diff options
author | David Robillard <d@drobilla.net> | 2007-04-12 23:20:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-04-12 23:20:37 +0000 |
commit | 959a7909c1adca430a63f783fd16687242a7be3d (patch) | |
tree | b5048c3cc1bbb60bb680472b97ebba6ebb92d72f /libs/gtkmm2ext | |
parent | 96ca08b9257e4048294cd1804a65d4ae6cd88814 (diff) |
Merged with trunk R1705.
Synced .po files with trunk.
Fixed more editor operations to be type agnostic (ie not audio only).
git-svn-id: svn://localhost/ardour2/branches/midi@1709 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r-- | libs/gtkmm2ext/SConscript | 1 | ||||
-rw-r--r-- | libs/gtkmm2ext/fastmeter.cc | 4 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtk_ui.cc | 10 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/fastmeter.h | 2 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/window_title.h | 44 | ||||
-rw-r--r-- | libs/gtkmm2ext/window_title.cc | 26 |
6 files changed, 79 insertions, 8 deletions
diff --git a/libs/gtkmm2ext/SConscript b/libs/gtkmm2ext/SConscript index 579ba5dd8e..504801aa03 100644 --- a/libs/gtkmm2ext/SConscript +++ b/libs/gtkmm2ext/SConscript @@ -56,6 +56,7 @@ tearoff.cc textviewer.cc utils.cc version.cc +window_title.cc """) gtkmm2ext.VersionBuild(['version.cc','gtkmm2ext/version.h'], []) diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc index 253dad80a2..ab1e1472b3 100644 --- a/libs/gtkmm2ext/fastmeter.cc +++ b/libs/gtkmm2ext/fastmeter.cc @@ -50,7 +50,6 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o) hold_state = 0; current_peak = 0; current_level = 0; - current_user_level = -100.0f; set_events (BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK); @@ -413,10 +412,9 @@ FastMeter::horizontal_expose (GdkEventExpose* ev) } void -FastMeter::set (float lvl, float usrlvl) +FastMeter::set (float lvl) { current_level = lvl; - current_user_level = usrlvl; if (lvl > current_peak) { current_peak = lvl; diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index 177e4f3dbb..903f56ba6f 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -37,6 +37,7 @@ #include <gtkmm2ext/textviewer.h> #include <gtkmm2ext/popup.h> #include <gtkmm2ext/utils.h> +#include <gtkmm2ext/window_title.h> #include "i18n.h" @@ -87,10 +88,11 @@ UI::UI (string namestr, int *argc, char ***argv, string rcfile) errors->text().set_editable (false); errors->text().set_name ("ErrorText"); - string title; - title = namestr; - title += ": Log"; - errors->set_title (title); + Glib::set_application_name(namestr); + + WindowTitle title(Glib::get_application_name()); + title += _("Log"); + errors->set_title (title.get_string()); errors->dismiss_button().set_name ("ErrorLogCloseButton"); errors->signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), (Window *) errors)); diff --git a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h index 775cb201cd..48bed3d150 100644 --- a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h +++ b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h @@ -35,7 +35,7 @@ class FastMeter : public Gtk::DrawingArea { FastMeter (long hold_cnt, unsigned long width, Orientation); virtual ~FastMeter (); - void set (float level, float user_level=0.0f); + void set (float level); void clear (); float get_level() { return current_level; } diff --git a/libs/gtkmm2ext/gtkmm2ext/window_title.h b/libs/gtkmm2ext/gtkmm2ext/window_title.h new file mode 100644 index 0000000000..1ce7d64b92 --- /dev/null +++ b/libs/gtkmm2ext/gtkmm2ext/window_title.h @@ -0,0 +1,44 @@ +#ifndef WINDOW_TITLE_INCLUDED +#define WINDOW_TITLE_INCLUDED + +#include <string> + +namespace Gtkmm2ext { + +using std::string; + +/** + * \class The WindowTitle class can be used to maintain the + * consistancy of window titles between windows and dialogs. + * + * Each string element that is added to the window title will + * be separated by a hyphen. + */ +class WindowTitle +{ +public: + + /** + * \param title The first string/element of the window title + * which will may be the application name or the document + * name in a document based application. + */ + WindowTitle(const string& title); + + /** + * Add an string element to the window title. + */ + void operator+= (const string&); + + /// @return The window title string. + const string& get_string () { return m_title;} + +private: + + string m_title; + +}; + +} // Gtkmm2ext + +#endif // WINDOW_TITLE_INCLUDED diff --git a/libs/gtkmm2ext/window_title.cc b/libs/gtkmm2ext/window_title.cc new file mode 100644 index 0000000000..237be1ff0f --- /dev/null +++ b/libs/gtkmm2ext/window_title.cc @@ -0,0 +1,26 @@ +#include "gtkmm2ext/window_title.h" + +#include "i18n.h" + +namespace { + +// I don't know if this should be translated. +const char* const title_separator = X_(" - "); + +} // anonymous namespace + +namespace Gtkmm2ext { + +WindowTitle::WindowTitle(const string& title) + : m_title(title) +{ + +} + +void +WindowTitle::operator+= (const string& element) +{ + m_title = m_title + title_separator + element; +} + +} |