summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaybin Rutkin <taybin@taybin.com>2005-12-02 22:12:56 +0000
committerTaybin Rutkin <taybin@taybin.com>2005-12-02 22:12:56 +0000
commitf2c09c7a7a195bcd4cf6e095b3c380e803b5a058 (patch)
tree1a451033a99f8103ea0e03c981a70582ebc39cd8
parent9388c84f06e35950306f33e8cc352e32309258dd (diff)
Dialogbox checkmarks turn off when dialogs are closed.
git-svn-id: svn://localhost/trunk/ardour2@164 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/SConscript4
-rw-r--r--gtk2_ardour/actions.cc13
-rw-r--r--gtk2_ardour/actions.h3
-rw-r--r--gtk2_ardour/ardour_ui.h6
-rw-r--r--gtk2_ardour/ardour_ui2.cc2
-rw-r--r--gtk2_ardour/ardour_ui_dialogs.cc72
-rw-r--r--gtk2_ardour/main.cc4
-rw-r--r--gtk2_ardour/sfdb_ui.cc8
-rw-r--r--gtk2_ardour/sfdb_ui.h4
9 files changed, 41 insertions, 75 deletions
diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript
index 168db5871b..452d84480a 100644
--- a/gtk2_ardour/SConscript
+++ b/gtk2_ardour/SConscript
@@ -18,14 +18,14 @@ gtkardour.Append(DOMAIN=domain, MAJOR=1,MINOR=0,MICRO=2)
gtkardour.Append(CCFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
gtkardour.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
gtkardour.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
-gtkardour.Append(CXXFLAGS="-DFLOWCANVAS_AA")
+#gtkardour.Append(CXXFLAGS="-DFLOWCANVAS_AA")
gtkardour.Append(PACKAGE=domain)
gtkardour.Append(POTFILE=domain + '.pot')
gtkardour.Merge ([
libraries['ardour'],
libraries['gtkmm2ext'],
- libraries['flowcanvas'],
+# libraries['flowcanvas'],
libraries['midi++2'],
libraries['pbd3'],
libraries['gtkmm2'],
diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc
index 19af1dfd07..0dca875e3f 100644
--- a/gtk2_ardour/actions.cc
+++ b/gtk2_ardour/actions.cc
@@ -202,3 +202,16 @@ ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
(*i)->set_sensitive (state);
}
}
+
+void
+ActionManager::uncheck_toggleaction (const std::string& actionname)
+{
+ RefPtr<Action> act = get_action (actionname);
+ if (act) {
+ RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
+ tact->set_active (false);
+ } else {
+ error << "Invalid action name: " << actionname << endmsg;
+ }
+}
+
diff --git a/gtk2_ardour/actions.h b/gtk2_ardour/actions.h
index bcf8d935a6..f1abcf5b54 100644
--- a/gtk2_ardour/actions.h
+++ b/gtk2_ardour/actions.h
@@ -65,7 +65,8 @@ class ActionManager
std::vector<std::string>& paths,
std::vector<std::string>& keys,
std::vector<Gtk::AccelKey>& bindings);
-
+
+ static void uncheck_toggleaction (const std::string& actionname);
};
#endif /* __ardour_gtk_actions_h__ */
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 3697eb7303..e67bebbe28 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -613,12 +613,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
LocationUI *location_ui;
int create_location_ui ();
- void location_ui_hiding ();
- void big_clock_hiding ();
- void route_params_hiding ();
- void connection_editor_hiding ();
- void option_hiding ();
-
/* Various options */
void toggle_recording_plugins ();
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index 5196d13b61..d0f93dab8d 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -428,7 +428,7 @@ ARDOUR_UI::setup_clock ()
big_clock_window->set_title (_("ardour: clock"));
big_clock_window->set_type_hint (Gdk::WINDOW_TYPE_HINT_MENU);
big_clock_window->signal_realize().connect (bind (sigc::ptr_fun (set_decoration), big_clock_window, (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
- big_clock_window->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::big_clock_hiding));
+ big_clock_window->signal_unmap().connect (bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleBigClock")));
manage_window (*big_clock_window);
}
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc
index 3d299e9ac2..3b2f51956c 100644
--- a/gtk2_ardour/ardour_ui_dialogs.cc
+++ b/gtk2_ardour/ardour_ui_dialogs.cc
@@ -25,6 +25,7 @@
#include <ardour/session.h>
+#include "actions.h"
#include "ardour_ui.h"
#include "connection_editor.h"
#include "location_ui.h"
@@ -33,7 +34,6 @@
#include "public_editor.h"
#include "route_params_ui.h"
#include "sfdb_ui.h"
-#include "actions.h"
#include "i18n.h"
@@ -180,13 +180,12 @@ int
ARDOUR_UI::create_connection_editor ()
{
if (connection_editor == 0) {
- // GTK2FIX
- // connection_editor = new ConnectionEditor ();
- // connection_editor->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::connection_editor_hiding));
+// connection_editor = new ConnectionEditor ();
+// connection_editor->signal_unmap().connect (sigc::bind (ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleConnections")));
}
if (session) {
- // connection_editor->set_session (session);
+// connection_editor->set_session (session);
}
return 0;
@@ -211,20 +210,6 @@ ARDOUR_UI::toggle_connection_editor ()
}
void
-ARDOUR_UI::connection_editor_hiding()
-{
- //GTK2FIX
- // connection_editor_check->set_active(false);
-}
-
-void
-ARDOUR_UI::big_clock_hiding()
-{
- // GTK2FIX
- // big_clock_check->set_active(false);
-}
-
-void
ARDOUR_UI::toggle_big_clock_window ()
{
if (big_clock_window->is_visible()) {
@@ -239,7 +224,7 @@ ARDOUR_UI::toggle_options_window ()
{
if (option_editor == 0) {
option_editor = new OptionEditor (*this, *editor, *mixer);
- option_editor->signal_unmap().connect(mem_fun(*this, &ARDOUR_UI::option_hiding));
+ option_editor->signal_unmap().connect(sigc::bind (ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleOptionsWindow")));
option_editor->set_session (session);
}
@@ -251,13 +236,6 @@ ARDOUR_UI::toggle_options_window ()
}
void
-ARDOUR_UI::option_hiding ()
-{
- // GTK2FIX
- // options_window_check->set_active(false);
-}
-
-void
ARDOUR_UI::toggle_auto_input ()
{
@@ -272,8 +250,8 @@ ARDOUR_UI::create_location_ui ()
if (location_ui == 0) {
location_ui = new LocationUI ();
location_ui->set_session (session);
- location_ui->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::location_ui_hiding));
- }
+ location_ui->signal_unmap().connect (sigc::bind (ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleLocations")));
+ }
return 0;
}
@@ -291,20 +269,13 @@ ARDOUR_UI::toggle_location_window ()
}
}
-void
-ARDOUR_UI::location_ui_hiding()
-{
- // GTK2FIX
- // locations_dialog_check->set_active(false);
-}
-
int
ARDOUR_UI::create_route_params ()
{
if (route_params == 0) {
route_params = new RouteParams_UI (*engine);
route_params->set_session (session);
- route_params->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::route_params_hiding));
+ route_params->signal_unmap().connect (sigc::bind(ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleInspector")));
}
return 0;
}
@@ -324,29 +295,12 @@ ARDOUR_UI::toggle_route_params_window ()
}
void
-ARDOUR_UI::route_params_hiding ()
-{
- // GTK2FIX
- // route_params_check->set_active (false);
-}
-
-void
ARDOUR_UI::toggle_sound_file_browser ()
{
- /* This is called from the check menu item. If checked on, open
- * a new SoundFileBrowser, and connect it's quit method to the
- * check menu item so if it is toggled off, it exits. If it exits
- * by itself, set the check menu item to false.
- * If this is called by checking off, don't do anything, the signals
- * should handle everything. I expect this idiom to be useful for
- * other Gtk::Dialog's as well. --Taybin */
+ using namespace Glib;
- //GTK2FIX
- //if (sfdb_check->get_active()) {
- //SoundFileBrowser sfdb(_("Sound File Browser"));
- //sfdb_check->signal_toggled().connect (bind (mem_fun (sfdb, &Gtk::Dialog::response), Gtk::RESPONSE_CANCEL));
- //sfdb.run();
- //sfdb_check->set_active(false);
- //}
-}
+ SoundFileBrowser sfdb(_("Sound File Browser"));
+ sfdb.run();
+ ActionManager::uncheck_toggleaction(X_("<Actions>/Common/ToggleSoundFileBrowser"));
+}
diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc
index 2aaf2ccdd2..808e4f32c8 100644
--- a/gtk2_ardour/main.cc
+++ b/gtk2_ardour/main.cc
@@ -57,10 +57,6 @@ using namespace GTK_ARDOUR;
using namespace ARDOUR;
using namespace sigc;
-Transmitter error (Transmitter::Error);
-Transmitter info (Transmitter::Info);
-Transmitter fatal (Transmitter::Fatal);
-Transmitter warning (Transmitter::Warning);
TextReceiver text_receiver ("ardour");
extern int curvetest (string);
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index 5ed88cd3e6..5b71a62cb5 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -30,10 +30,12 @@
SoundFileBrowser::SoundFileBrowser (std::string title)
:
- Gtk::Dialog(title, false),
+ ArdourDialog(title),
chooser(Gtk::FILE_CHOOSER_ACTION_OPEN)
{
get_vbox()->pack_start(chooser);
+
+ show_all();
}
SoundFileChooser::SoundFileChooser (std::string title)
@@ -42,6 +44,8 @@ SoundFileChooser::SoundFileChooser (std::string title)
{
add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+
+ show_all();
}
SoundFileOmega::SoundFileOmega (std::string title)
@@ -59,6 +63,8 @@ SoundFileOmega::SoundFileOmega (std::string title)
embed_btn.signal_clicked().connect (mem_fun (*this, &SoundFileOmega::embed_clicked));
import_btn.signal_clicked().connect (mem_fun (*this, &SoundFileOmega::import_clicked));
+
+ show_all();
}
void
diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h
index d948d006b3..ec7f226cc3 100644
--- a/gtk2_ardour/sfdb_ui.h
+++ b/gtk2_ardour/sfdb_ui.h
@@ -33,7 +33,9 @@
#include <gtkmm/dialog.h>
#include <gtkmm/filechooserwidget.h>
-class SoundFileBrowser : public Gtk::Dialog
+#include "ardour_dialog.h"
+
+class SoundFileBrowser : public ArdourDialog
{
public:
SoundFileBrowser (std::string title);