diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-01 19:53:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-01 19:53:58 +0000 |
commit | e0991be04d5fad5715a90b1fa6e38bcb5a0e5bce (patch) | |
tree | ab1be8c0422d5fdeaac4a2ed5e071d660ce20548 /gtk2_ardour | |
parent | b05c4dc540d0f9f97975a0d6ff9c3cd8a569b980 (diff) |
add a persistent folder variable so that every time the sfdb_ui is created, it shows the same location that it was left in
git-svn-id: svn://localhost/ardour2/trunk@1404 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/option_editor.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/sfdb_ui.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/sfdb_ui.h | 8 |
3 files changed, 18 insertions, 6 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 1c76f8079b..85cb3dab1d 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -483,7 +483,6 @@ OptionEditor::mtc_port_chosen (MIDI::Port *port, Gtk::RadioButton* rb) { if (session) { if (rb->get_active()) { - cerr << "Activating MTC port " << port->name() << endl; if (port) { session->set_mtc_port (port->name()); Config->set_mtc_port_name (port->name()); @@ -500,7 +499,6 @@ OptionEditor::mmc_port_chosen (MIDI::Port* port, Gtk::RadioButton* rb) { if (session) { if (rb->get_active()) { - cerr << "Activating MMC port " << port->name() << endl; if (port) { session->set_mmc_port (port->name()); Config->set_mtc_port_name (port->name()); @@ -517,7 +515,6 @@ OptionEditor::midi_port_chosen (MIDI::Port* port, Gtk::RadioButton* rb) { if (session) { if (rb->get_active()) { - cerr << "Activating MIDI port " << port->name() << endl; if (port) { session->set_midi_port (port->name()); Config->set_midi_port_name (port->name()); diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index cb91fcba6b..00c33bf8ef 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -50,6 +50,8 @@ using namespace ARDOUR; using namespace PBD; using namespace std; +Glib::ustring SoundFileBrowser::persistent_folder; + SoundFileBox::SoundFileBox () : _session(0), @@ -308,6 +310,11 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s) chooser.set_filter (filter); chooser.set_select_multiple (true); chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview)); + + if (!persistent_folder.empty()) { + chooser.set_current_folder (persistent_folder); + } + found_list_view.get_selection()->signal_changed().connect(mem_fun(*this, &SoundFileBrowser::found_list_view_selected)); found_search_btn.signal_clicked().connect(mem_fun(*this, &SoundFileBrowser::found_search_clicked)); @@ -318,6 +325,11 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s) set_session (s); } +SoundFileBrowser::~SoundFileBrowser () +{ + persistent_folder = chooser.get_current_folder(); +} + void SoundFileBrowser::set_session (Session* s) { @@ -548,3 +560,4 @@ SoundFileOmega::mode_changed () break; } } + diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h index fb0b7da600..bbc6e2edd4 100644 --- a/gtk2_ardour/sfdb_ui.h +++ b/gtk2_ardour/sfdb_ui.h @@ -88,7 +88,7 @@ class SoundFileBrowser : public ArdourDialog { public: SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0); - virtual ~SoundFileBrowser () {}; + virtual ~SoundFileBrowser (); virtual void set_session (ARDOUR::Session*); @@ -96,7 +96,9 @@ class SoundFileBrowser : public ArdourDialog Gtk::FileChooserWidget chooser; Gtk::FileFilter filter; SoundFileBox preview; - + + static Glib::ustring persistent_folder; + class FoundTagColumns : public Gtk::TreeModel::ColumnRecord { public: @@ -110,7 +112,7 @@ class SoundFileBrowser : public ArdourDialog Gtk::TreeView found_list_view; Gtk::Entry found_entry; Gtk::Button found_search_btn; - + Gtk::Notebook notebook; void update_preview (); |