From 85a945468c6b065ee43ce1dc2f6e4c03eb9fe3c3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Apr 2015 23:10:42 +0000 Subject: Hide close/quit menu items in plugin GUI. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5669 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/App.cpp | 1 + src/gui/App.hpp | 4 ++++ src/gui/GraphBox.cpp | 6 ++++++ src/gui/ingen_gui.ui | 6 ------ src/gui/ingen_gui_lv2.cpp | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/gui') diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 882aec2d..0c7aea8c 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -75,6 +75,7 @@ App::App(Ingen::World* world) , _sample_rate(48000) , _enable_signal(true) , _requested_plugins(false) + , _is_plugin(false) { _world->conf().load_default("ingen", "gui.ttl"); diff --git a/src/gui/App.hpp b/src/gui/App.hpp index db7af77b..c609fa36 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -106,6 +106,9 @@ public: uint32_t sample_rate() const; + bool is_plugin() const { return _is_plugin; } + void set_is_plugin(bool b) { _is_plugin = b; } + ConnectWindow* connect_window() const { return _connect_window; } MessagesWindow* messages_dialog() const { return _messages_window; } GraphTreeWindow* graph_tree() const { return _graph_tree_window; } @@ -160,6 +163,7 @@ protected: bool _enable_signal; bool _requested_plugins; + bool _is_plugin; }; } // namespace GUI diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp index 693d0c04..2b84b16f 100644 --- a/src/gui/GraphBox.cpp +++ b/src/gui/GraphBox.cpp @@ -182,6 +182,12 @@ GraphBox::create(App& app, SPtr graph) xml->get_widget_derived("graph_win_vbox", result); result->init_box(app); result->set_graph(graph, SPtr()); + + if (app.is_plugin()) { + result->_menu_close->set_sensitive(false); + result->_menu_quit->set_sensitive(false); + } + return SPtr(result); } diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui index 95ea2424..21d67543 100644 --- a/src/gui/ingen_gui.ui +++ b/src/gui/ingen_gui.ui @@ -836,12 +836,6 @@ See COPYING file included with this distribution, or http://www.gnu.org/licenses - - - True - False - - gtk-quit diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp index a8e48007..386f30c0 100644 --- a/src/gui/ingen_gui_lv2.cpp +++ b/src/gui/ingen_gui_lv2.cpp @@ -133,6 +133,7 @@ instantiate(const LV2UI_Descriptor* descriptor, ui->app = Ingen::GUI::App::create(ui->world); ui->client = SPtr( new Ingen::Client::SigClientInterface()); + ui->app->set_is_plugin(true); ui->app->attach(ui->client); ui->reader = SPtr( -- cgit v1.2.1