summaryrefslogtreecommitdiffstats
path: root/src/gui/App.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
commitaa473d19780f2670bb828835ee7ce970571016cf (patch)
tree0483fcb2cc350b3cc2f660f22449f803ae12f93d /src/gui/App.cpp
parent44ddb73018b96a6979b4339f4ba234e5c97741f8 (diff)
downloadingen-aa473d19780f2670bb828835ee7ce970571016cf.tar.gz
ingen-aa473d19780f2670bb828835ee7ce970571016cf.tar.bz2
ingen-aa473d19780f2670bb828835ee7ce970571016cf.zip
Strip trailing whitespace.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1999 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/App.cpp')
-rw-r--r--src/gui/App.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index c7056a64..f15b3355 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -1,15 +1,15 @@
/* This file is part of Ingen.
* Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *
+ *
* Ingen is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
- *
+ *
* Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -79,7 +79,7 @@ App::App(Ingen::Shared::World* world)
, _enable_signal(true)
{
Glib::RefPtr<Gnome::Glade::Xml> glade_xml = GladeFactory::new_glade_reference();
-
+
Glib::set_application_name("Ingen");
gtk_window_set_default_icon_name("ingen");
@@ -110,16 +110,16 @@ App::init(int argc, char** argv, Ingen::Shared::World* world)
if (!_instance)
_instance = new App(world);
-
+
// Load configuration settings
_instance->configuration()->load_settings();
_instance->configuration()->apply_settings();
-
+
// Set default window icon
_instance->_about_dialog->property_program_name() = "Ingen";
_instance->_about_dialog->property_logo_icon_name() = "ingen";
gtk_window_set_default_icon_name("ingen");
-
+
// Set style for embedded node GUIs
const string rc_style =
"style \"ingen_embedded_node_gui_style\" {"
@@ -135,9 +135,9 @@ App::init(int argc, char** argv, Ingen::Shared::World* world)
" fg[INSENSITIVE] = \"#FFFFFF\""
"}\n"
"widget \"*ingen_embedded_node_gui_container*\" style \"ingen_embedded_node_gui_style\"\n";
-
+
Gtk::RC::parse_string(rc_style);
-
+
App::instance().connect_window()->start(world);
// Run main iterations here until we're attached to the engine
@@ -166,14 +166,14 @@ App::attach(SharedPtr<SigClientInterface> client,
assert( ! _loader);
_world->engine->register_client(client.get());
-
+
_client = client;
_handle = handle;
_store = SharedPtr<ClientStore>(new ClientStore(_world->engine, client));
_loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(_world->engine));
_patch_tree_window->init(*_store);
-
+
_client->signal_response_error.connect(sigc::mem_fun(this, &App::error_response));
_client->signal_error.connect(sigc::mem_fun(this, &App::error_message));
}
@@ -193,7 +193,7 @@ App::detach()
_world->engine.reset();
}
}
-
+
const SharedPtr<Serialiser>&
App::serialiser()
@@ -223,7 +223,7 @@ void
App::error_message(const string& str)
{
_messages_window->post(str);
-
+
if (!_messages_window->is_visible())
_messages_window->present();
@@ -256,7 +256,7 @@ App::activity_port_destroyed(Port* port)
ActivityPorts::iterator i = _activity_ports.find(port);
if (i != _activity_ports.end())
_activity_ports.erase(i);
-
+
return;
}
@@ -291,17 +291,17 @@ App::event_load_session()
{
Gtk::FileChooserDialog* dialog
= new Gtk::FileChooserDialog(*_main_window, "Load Session", Gtk::FILE_CHOOSER_ACTION_OPEN);
-
+
dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
- dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
+ dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
int result = dialog->run();
string filename = dialog->get_filename();
delete dialog;
cout << result << endl;
-
+
assert(result == Gtk::RESPONSE_OK || result == Gtk::RESPONSE_CANCEL || result == Gtk::RESPONSE_NONE);
-
+
if (result == Gtk::RESPONSE_OK)
//configuration->load_session(filename);
_controller->load_session(filename);
@@ -312,7 +312,7 @@ void
App::event_save_session_as()
{
Gtk::FileChooserDialog dialog(*_main_window, "Save Session", Gtk::FILE_CHOOSER_ACTION_SAVE);
-
+
/*
Gtk::VBox* box = dialog.get_vbox();
Gtk::Label warning("Warning: Recursively saving will overwrite any subpatch files \
@@ -321,20 +321,20 @@ App::event_save_session_as()
Gtk::CheckButton recursive_checkbutton("Recursively save all subpatches");
box->pack_start(recursive_checkbutton, false, false, 0);
recursive_checkbutton.show();
- */
+ */
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
- dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
-
+ dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
+
int result = dialog.run();
//bool recursive = recursive_checkbutton.get_active();
-
+
assert(result == Gtk::RESPONSE_OK || result == Gtk::RESPONSE_CANCEL || result == Gtk::RESPONSE_NONE);
-
- if (result == Gtk::RESPONSE_OK) {
+
+ if (result == Gtk::RESPONSE_OK) {
string filename = dialog.get_filename();
if (filename.length() < 11 || filename.substr(filename.length()-10) != ".omsession")
filename += ".omsession";
-
+
bool confirm = false;
std::fstream fin;
fin.open(filename.c_str(), std::ios::in);
@@ -351,7 +351,7 @@ App::event_save_session_as()
confirm = true;
}
fin.close();
-
+
if (confirm) {
_controller->save_session(filename);
}
@@ -365,7 +365,7 @@ App::register_callbacks()
{
Glib::signal_timeout().connect(
sigc::mem_fun(App::instance(), &App::gtk_main_iteration), 25, G_PRIORITY_DEFAULT);
-
+
Glib::signal_timeout().connect(
sigc::mem_fun(App::instance(), &App::animate), 50, G_PRIORITY_DEFAULT);
}
@@ -384,7 +384,7 @@ App::gtk_main_iteration()
_client->emit_signals();
_enable_signal = true;
}
-
+
return true;
}
@@ -410,7 +410,7 @@ App::icon_from_path(const string& path, int size)
/* If weak references to Glib::Objects are needed somewhere else it will
probably be a good idea to create a proper WeakPtr class instead of
using raw pointers, but for a single use this will do. */
-
+
Glib::RefPtr<Gdk::Pixbuf> buf;
if (path.length() == 0)
return buf;
@@ -444,9 +444,9 @@ App::icon_destroyed(void* data)
Icons::iterator iter = instance()._icons.find(*p);
if (iter != instance()._icons.end())
instance()._icons.erase(iter);
-
+
delete p; // allocated in App::icon_from_path
-
+
return NULL;
}