Report WM frames as such in application list
http://sourceforge.net/apps/trac/easystroke/ticket/35
+9 −5 · 4 files changed
-
actions.cc+2 −2 -
prefs.cc+2 −3 -
win.cc+4 −0 -
win.h+1 −0
@@ -300,7 +300,7 @@ Actions::Actions() : void Actions::load_app_list(const Gtk::TreeNodeChildren &ch, ActionListDiff *actions) { Gtk::TreeRow row = *(apps_model->append(ch)); - row[ca.app] = actions->name; + row[ca.app] = app_name_hr(actions->name); row[ca.actions] = actions; for (ActionListDiff::iterator i = actions->begin(); i != actions->end(); i++) load_app_list(row.children(), &(*i)); @@ -606,7 +606,7 @@ void Actions::on_add_app() { apps_model->children().begin()->children() : apps_view->get_selection()->get_selected()->children(); Gtk::TreeRow row = *(apps_model->append(ch)); - row[ca.app] = name; + row[ca.app] = app_name_hr(name); row[ca.actions] = child; actions.apps[name] = child; Gtk::TreePath path = apps_model->get_path(row); @@ -336,7 +336,7 @@ Prefs::Prefs() { for (std::map<std::string, RButtonInfo>::const_iterator i = exceptions.begin(); i!=exceptions.end(); i++) { Gtk::TreeModel::Row row = *(tm->append()); row[cols.app] = i->first; - row[cols.user_app] = i->first == "" ? _("(window manager frame)") : i->first; + row[cols.user_app] = app_name_hr(i->first); row[cols.button] = i->second ? i->second->get_button_text() : _("<App disabled>"); } } @@ -586,11 +586,10 @@ void Prefs::on_add() { is_new = prefs.exceptions.write_ref(a).insert( std::pair<std::string, RButtonInfo>(str, RButtonInfo())).second; } - Glib::ustring user_str = str == "" ? _("(window manager frame)") : str; if (is_new) { Gtk::TreeModel::Row row = *(tm->append()); row[cols.app] = str; - row[cols.user_app] = user_str; + row[cols.user_app] = app_name_hr(str); row[cols.button] = _("<App disabled>"); Gtk::TreePath path = tm->get_path(row); tv->set_cursor(path); @@ -267,3 +267,7 @@ void error_dialog(const Glib::ustring &text) { dialog.show(); dialog.run(); } + +Glib::ustring app_name_hr(Glib::ustring src) { + return src == "" ? _("(window manager frame)") : src; +} @@ -122,4 +122,5 @@ private: }; void error_dialog(const Glib::ustring &); +Glib::ustring app_name_hr(Glib::ustring); #endif