summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-04-06 20:19:09 +0000
committerDavid Robillard <d@drobilla.net>2014-04-06 20:19:09 +0000
commit0291bbfe56e0e3020862fb54073f968d66b53ae6 (patch)
treeda5203b0f41c59e086d45964d884b873da2e2f32 /src
parentea6f9d14761645d1228f3a945e47b96cfcd149a6 (diff)
downloadpatchage-0291bbfe56e0e3020862fb54073f968d66b53ae6.tar.gz
patchage-0291bbfe56e0e3020862fb54073f968d66b53ae6.tar.bz2
patchage-0291bbfe56e0e3020862fb54073f968d66b53ae6.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/Patchage.cpp49
-rw-r--r--src/Patchage.hpp12
-rw-r--r--src/patchage.ui126
3 files changed, 52 insertions, 135 deletions
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<Gtk::TextBuffer> 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<Gtk::TextBuffer> 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<Gtk::TextBuffer> 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);
}
@@ -835,20 +828,6 @@ Patchage::on_legend_color_change(int id, const std::string& label, uint32_t rgba
}
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()
{
#ifdef HAVE_ALSA
@@ -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 <gtkmm/main.h>
#include <gtkmm/menubar.h>
#include <gtkmm/menuitem.h>
+#include <gtkmm/paned.h>
#include <gtkmm/progressbar.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/textview.h>
@@ -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<Gtk::MenuItem> _menu_save_session;
Widget<Gtk::MenuItem> _menu_save_close_session;
Widget<Gtk::MenuItem> _menu_view_arrange;
- Widget<Gtk::MenuItem> _menu_view_messages;
+ Widget<Gtk::CheckMenuItem> _menu_view_messages;
Widget<Gtk::CheckMenuItem> _menu_view_toolbar;
Widget<Gtk::MenuItem> _menu_view_refresh;
Widget<Gtk::CheckMenuItem> _menu_view_human_names;
@@ -168,14 +167,13 @@ protected:
Widget<Gtk::MenuItem> _menu_increase_font_size;
Widget<Gtk::MenuItem> _menu_decrease_font_size;
Widget<Gtk::MenuItem> _menu_normal_font_size;
- Widget<Gtk::Button> _messages_clear_but;
- Widget<Gtk::Button> _messages_close_but;
- Widget<Gtk::Dialog> _messages_win;
Widget<Gtk::Toolbar> _toolbar;
Widget<Gtk::ToolButton> _clear_load_but;
Widget<Gtk::ProgressBar> _xrun_progress;
Widget<Gtk::Label> _latency_label;
Widget<Gtk::Alignment> _legend_alignment;
+ Widget<Gtk::Paned> _main_paned;
+ Widget<Gtk::ScrolledWindow> _log_scrolledwindow;
Widget<Gtk::TextView> _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 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
+ <requires lib="gtk+" version="2.18"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAboutDialog" id="about_win">
<property name="can_focus">False</property>
@@ -880,11 +880,11 @@ Nedko Arnaudov &lt;nedko@arnaudov.name&gt;</property>
<object class="GtkMenu" id="view_menu_menu">
<property name="can_focus">False</property>
<child>
- <object class="GtkMenuItem" id="menu_view_messages">
+ <object class="GtkCheckMenuItem" id="menu_view_messages">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">_Messages...</property>
+ <property name="label" translatable="yes">_Messages</property>
<property name="use_underline">True</property>
<accelerator key="M" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
@@ -894,7 +894,7 @@ Nedko Arnaudov &lt;nedko@arnaudov.name&gt;</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">_Toolbar...</property>
+ <property name="label" translatable="yes">_Toolbar</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<accelerator key="t" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -1203,123 +1203,59 @@ The bar represents the percentage of available time used for audio processing (i
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="main_scrolledwin">
+ <object class="GtkVPaned" id="main_paned">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="shadow_type">in</property>
+ <property name="position">3200</property>
<child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkDialog" id="messages_win">
- <property name="can_focus">False</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Patchage - Messages</property>
- <property name="window_position">center-on-parent</property>
- <property name="icon_name">patchage</property>
- <property name="type_hint">dialog</property>
- <property name="transient_for">main_win</property>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="messages_clear_but">
- <property name="label">gtk-clear</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
+ <object class="GtkScrolledWindow" id="log_scrolledwindow">
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="use_stock">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="status_text">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">False</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">word</property>
+ <property name="cursor_visible">False</property>
+ <property name="accepts_tab">False</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="messages_close_but">
- <property name="label">gtk-close</property>
- <property name="use_action_appearance">False</property>
+ <object class="GtkScrolledWindow" id="main_scrolledwin">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="use_stock">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
+ <property name="resize">True</property>
+ <property name="shrink">False</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTextView" id="status_text">
- <property name="width_request">640</property>
- <property name="height_request">480</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- <property name="accepts_tab">False</property>
- </object>
- </child>
- </object>
- <packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="0">messages_clear_but</action-widget>
- <action-widget response="0">messages_close_but</action-widget>
- </action-widgets>
</object>
</interface>