13
0

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
This commit is contained in:
Paul Davis 2007-02-01 19:53:58 +00:00
parent b05c4dc540
commit e0991be04d
3 changed files with 18 additions and 6 deletions

View File

@ -483,7 +483,6 @@ OptionEditor::mtc_port_chosen (MIDI::Port *port, Gtk::RadioButton* rb)
{ {
if (session) { if (session) {
if (rb->get_active()) { if (rb->get_active()) {
cerr << "Activating MTC port " << port->name() << endl;
if (port) { if (port) {
session->set_mtc_port (port->name()); session->set_mtc_port (port->name());
Config->set_mtc_port_name (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 (session) {
if (rb->get_active()) { if (rb->get_active()) {
cerr << "Activating MMC port " << port->name() << endl;
if (port) { if (port) {
session->set_mmc_port (port->name()); session->set_mmc_port (port->name());
Config->set_mtc_port_name (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 (session) {
if (rb->get_active()) { if (rb->get_active()) {
cerr << "Activating MIDI port " << port->name() << endl;
if (port) { if (port) {
session->set_midi_port (port->name()); session->set_midi_port (port->name());
Config->set_midi_port_name (port->name()); Config->set_midi_port_name (port->name());

View File

@ -50,6 +50,8 @@ using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace std; using namespace std;
Glib::ustring SoundFileBrowser::persistent_folder;
SoundFileBox::SoundFileBox () SoundFileBox::SoundFileBox ()
: :
_session(0), _session(0),
@ -308,6 +310,11 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s)
chooser.set_filter (filter); chooser.set_filter (filter);
chooser.set_select_multiple (true); chooser.set_select_multiple (true);
chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview)); 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_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)); 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); set_session (s);
} }
SoundFileBrowser::~SoundFileBrowser ()
{
persistent_folder = chooser.get_current_folder();
}
void void
SoundFileBrowser::set_session (Session* s) SoundFileBrowser::set_session (Session* s)
{ {
@ -548,3 +560,4 @@ SoundFileOmega::mode_changed ()
break; break;
} }
} }

View File

@ -88,7 +88,7 @@ class SoundFileBrowser : public ArdourDialog
{ {
public: public:
SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0); SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0);
virtual ~SoundFileBrowser () {}; virtual ~SoundFileBrowser ();
virtual void set_session (ARDOUR::Session*); virtual void set_session (ARDOUR::Session*);
@ -96,7 +96,9 @@ class SoundFileBrowser : public ArdourDialog
Gtk::FileChooserWidget chooser; Gtk::FileChooserWidget chooser;
Gtk::FileFilter filter; Gtk::FileFilter filter;
SoundFileBox preview; SoundFileBox preview;
static Glib::ustring persistent_folder;
class FoundTagColumns : public Gtk::TreeModel::ColumnRecord class FoundTagColumns : public Gtk::TreeModel::ColumnRecord
{ {
public: public:
@ -110,7 +112,7 @@ class SoundFileBrowser : public ArdourDialog
Gtk::TreeView found_list_view; Gtk::TreeView found_list_view;
Gtk::Entry found_entry; Gtk::Entry found_entry;
Gtk::Button found_search_btn; Gtk::Button found_search_btn;
Gtk::Notebook notebook; Gtk::Notebook notebook;
void update_preview (); void update_preview ();