Remove Apply button in Import dialog/Window and change OK to "Import"
authorTim Mayberry <mojofunk@gmail.com>
Thu, 3 Sep 2015 13:10:42 +0000 (23:10 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Thu, 3 Sep 2015 23:45:09 +0000 (09:45 +1000)
Don't close the window when clicking on Import. Changing "OK" to "Import" makes
it clear what action is being taken by the button. I quite frequently imported
several files from different directories using "Apply" and then would click on
OK to finish using the dialog only to have the last import occur again
unintentionally.

Another option would of been to change "Apply" to "Import" and "OK" to "Import
and Close" and not have a Close button.

gtk2_ardour/sfdb_ui.cc
gtk2_ardour/sfdb_ui.h

index 2874f935839826c29bf4faa98791e206978c05c4..3f1d93fb4ccd15bcc91966957194f550b7771f15 100644 (file)
@@ -554,9 +554,8 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi
        , matches (0)
        , _status (0)
        , _done (false)
-       , ok_button (Stock::OK)
+       , import_button (_("Import"))
        , close_button (Stock::CLOSE)
-       , apply_button (Stock::APPLY)
        , gm (0)
 {
 
@@ -726,16 +725,11 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi
        button_box->set_layout (BUTTONBOX_END);
        button_box->pack_start (close_button, false, false);
        close_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &SoundFileBrowser::do_something), RESPONSE_CLOSE));
-       if (persistent) {
-               button_box->pack_start (apply_button, false, false);
-               apply_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &SoundFileBrowser::do_something), RESPONSE_APPLY));
-       }
 
-       button_box->pack_start (ok_button, false, false);
-       ok_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &SoundFileBrowser::do_something), RESPONSE_OK));
+       button_box->pack_start (import_button, false, false);
+       import_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &SoundFileBrowser::do_something), RESPONSE_OK));
 
-       Gtkmm2ext::UI::instance()->set_tip (ok_button, _("Press to import selected files and close this window"));
-       Gtkmm2ext::UI::instance()->set_tip (apply_button, _("Press to import selected files and leave this window open"));
+       Gtkmm2ext::UI::instance()->set_tip (import_button, _("Press to import selected files"));
        Gtkmm2ext::UI::instance()->set_tip (close_button, _("Press to close this window without importing any files"));
 
        vpacker.pack_end (*button_box, false, false);
@@ -767,8 +761,7 @@ SoundFileBrowser::run ()
 void
 SoundFileBrowser::set_action_sensitive (bool yn)
 {
-       ok_button.set_sensitive (yn);
-       apply_button.set_sensitive (yn);
+       import_button.set_sensitive (yn);
 }
 
 void
@@ -1991,9 +1984,5 @@ SoundFileOmega::do_something (int action)
        } else {
                PublicEditor::instance().do_embed (paths, chns, mode, where, instrument);
        }
-       
-       if (action == RESPONSE_OK) {
-               hide ();
-       }
 }
        
index c8aaa03d0e277286a2b1b54ba1a96364a03f55a6..07de8b74d8e18790c4d3909f287399966513cc3a 100644 (file)
@@ -213,9 +213,8 @@ class SoundFileBrowser : public ArdourWindow
        Gtk::HBox hpacker;
        Gtk::VBox vpacker;
 
-       Gtk::Button ok_button;
+       Gtk::Button import_button;
        Gtk::Button close_button;
-       Gtk::Button apply_button;
 
        static std::string persistent_folder;