From 0291bbfe56e0e3020862fb54073f968d66b53ae6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 6 Apr 2014 20:19:09 +0000 Subject: Eliminate messages window in favour of an optional pane (single-window interface). git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5361 a436a847-0d15-0410-975c-d299462d15a1 --- src/Patchage.cpp | 49 +++++++--------------- src/Patchage.hpp | 12 +++--- src/patchage.ui | 126 ++++++++++++++----------------------------------------- 3 files changed, 52 insertions(+), 135 deletions(-) (limited to 'src') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 5507f25..4dec0f2 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -111,14 +111,13 @@ Patchage::Patchage(int argc, char** argv) , INIT_WIDGET(_menu_increase_font_size) , INIT_WIDGET(_menu_decrease_font_size) , INIT_WIDGET(_menu_normal_font_size) - , INIT_WIDGET(_messages_clear_but) - , INIT_WIDGET(_messages_close_but) - , INIT_WIDGET(_messages_win) , INIT_WIDGET(_toolbar) , INIT_WIDGET(_clear_load_but) , INIT_WIDGET(_xrun_progress) , INIT_WIDGET(_latency_label) , INIT_WIDGET(_legend_alignment) + , INIT_WIDGET(_main_paned) + , INIT_WIDGET(_log_scrolledwindow) , INIT_WIDGET(_status_text) , _legend(NULL) , _attach(true) @@ -204,7 +203,7 @@ Patchage::Patchage(int argc, char** argv) _menu_view_arrange->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_arrange)); _menu_view_messages->signal_activate().connect( - sigc::mem_fun(this, &Patchage::on_show_messages)); + sigc::mem_fun(this, &Patchage::on_view_messages)); _menu_view_toolbar->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_view_toolbar)); _menu_help_about->signal_activate().connect( @@ -224,17 +223,12 @@ Patchage::Patchage(int argc, char** argv) _menu_normal_font_size->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_normal_font_size)); - _messages_clear_but->signal_clicked().connect( - sigc::mem_fun(this, &Patchage::on_messages_clear)); - _messages_close_but->signal_clicked().connect( - sigc::mem_fun(this, &Patchage::on_messages_close)); - _error_tag = Gtk::TextTag::create(); - _error_tag->property_foreground() = "#FF0000"; + _error_tag->property_foreground() = "#CC0000"; _status_text->get_buffer()->get_tag_table()->add(_error_tag); _warning_tag = Gtk::TextTag::create(); - _warning_tag->property_foreground() = "#FFFF00"; + _warning_tag->property_foreground() = "#E6B200"; _status_text->get_buffer()->get_tag_table()->add(_warning_tag); _canvas->widget().show(); @@ -278,6 +272,7 @@ Patchage::Patchage(int argc, char** argv) connect_widgets(); update_state(); _menu_view_toolbar->set_active(_conf->get_show_toolbar()); + _main_paned->set_position(42); _canvas->widget().grab_focus(); @@ -315,8 +310,6 @@ Patchage::~Patchage() delete _conf; _about_win.destroy(); - _messages_win.destroy(); - _xml.reset(); } @@ -482,16 +475,16 @@ void Patchage::error_msg(const std::string& msg) { Glib::RefPtr buffer = _status_text->get_buffer(); - buffer->insert_with_tag(buffer->end(), msg + "\n", _error_tag); + buffer->insert_with_tag(buffer->end(), std::string("\n") + msg, _error_tag); _status_text->scroll_to_mark(buffer->get_insert(), 0); - _messages_win->present(); + _menu_view_messages->set_active(true); } void Patchage::info_msg(const std::string& msg) { Glib::RefPtr buffer = _status_text->get_buffer(); - buffer->insert(buffer->end(), msg + "\n"); + buffer->insert(buffer->end(), std::string("\n") + msg); _status_text->scroll_to_mark(buffer->get_insert(), 0); } @@ -499,7 +492,7 @@ void Patchage::warning_msg(const std::string& msg) { Glib::RefPtr buffer = _status_text->get_buffer(); - buffer->insert_with_tag(buffer->end(), msg + "\n", _warning_tag); + buffer->insert_with_tag(buffer->end(), std::string("\n") + msg, _warning_tag); _status_text->scroll_to_mark(buffer->get_insert(), 0); } @@ -834,20 +827,6 @@ Patchage::on_legend_color_change(int id, const std::string& label, uint32_t rgba _canvas->for_each_edge(update_edge_color, this); } -void -Patchage::on_messages_clear() -{ - _status_text->get_buffer()->erase( - _status_text->get_buffer()->begin(), - _status_text->get_buffer()->end()); -} - -void -Patchage::on_messages_close() -{ - _messages_win->hide(); -} - void Patchage::on_quit() { @@ -891,9 +870,13 @@ Patchage::on_export_dot() } void -Patchage::on_show_messages() +Patchage::on_view_messages() { - _messages_win->present(); + if (_menu_view_messages->get_active()) { + _log_scrolledwindow->show(); + } else { + _log_scrolledwindow->hide(); + } } void diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 06cbace..ac55b26 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -95,11 +96,9 @@ protected: void on_arrange(); void on_help_about(); - void on_messages_clear(); - void on_messages_close(); void on_quit(); void on_export_dot(); - void on_show_messages(); + void on_view_messages(); void on_view_toolbar(); void on_store_positions(); void on_view_human_names(); @@ -157,7 +156,7 @@ protected: Widget _menu_save_session; Widget _menu_save_close_session; Widget _menu_view_arrange; - Widget _menu_view_messages; + Widget _menu_view_messages; Widget _menu_view_toolbar; Widget _menu_view_refresh; Widget _menu_view_human_names; @@ -168,14 +167,13 @@ protected: Widget _menu_increase_font_size; Widget _menu_decrease_font_size; Widget _menu_normal_font_size; - Widget _messages_clear_but; - Widget _messages_close_but; - Widget _messages_win; Widget _toolbar; Widget _clear_load_but; Widget _xrun_progress; Widget _latency_label; Widget _legend_alignment; + Widget _main_paned; + Widget _log_scrolledwindow; Widget _status_text; Legend* _legend; diff --git a/src/patchage.ui b/src/patchage.ui index c8f7a25..f41c938 100644 --- a/src/patchage.ui +++ b/src/patchage.ui @@ -1,6 +1,6 @@ - + False @@ -880,11 +880,11 @@ Nedko Arnaudov <nedko@arnaudov.name> False - + False True False - _Messages... + _Messages True @@ -894,7 +894,7 @@ Nedko Arnaudov <nedko@arnaudov.name> False True False - _Toolbar... + _Toolbar True True @@ -1203,123 +1203,59 @@ The bar represents the percentage of available time used for audio processing (i - + True True - True - True - True - in + 3200 - - - - - True - True - 2 - - - - - - - False - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - Patchage - Messages - center-on-parent - patchage - dialog - main_win - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - end - - - gtk-clear - False - True + True - False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True + never + automatic + in + + + True + False + False + False + word + False + False + + - False - False - 0 + False + True - - gtk-close - False + True True - True True True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True + in + + + - False - False - 1 + True + False - - False - True - end - 0 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - in - - - 640 - 480 - True - False - False - word - False - False - - - True True - 1 + 2 - - messages_clear_but - messages_close_but - -- cgit v1.2.1