aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-07-25 10:03:55 (GMT)
committerrathnor <rathnor>2003-07-25 10:03:55 (GMT)
commitac7edef9ad73818435420479a0dfa9c5ed517a79 (patch)
tree4fd531858253a00bd36689153e6c83c65890df39 /src/Screen.cc
parent9ca1f367cb9eef78ee1871fe5b96298f8325d987 (diff)
downloadfluxbox-ac7edef9ad73818435420479a0dfa9c5ed517a79.zip
fluxbox-ac7edef9ad73818435420479a0dfa9c5ed517a79.tar.bz2
make sure all menus have titles, make -version go to stdout
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 35added..880d769 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.206 2003/07/20 08:12:36 rathnor Exp $ 25// $Id: Screen.cc,v 1.207 2003/07/25 10:03:55 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -145,11 +145,14 @@ int anotherWMRunning(Display *display, XErrorEvent *) {
145 return -1; 145 return -1;
146} 146}
147 147
148FbTk::Menu *createMenuFromScreen(BScreen &screen) { 148FbTk::Menu *createMenuFromScreen(BScreen &screen, const char *label = 0) {
149 FbTk::Menu *menu = new FbMenu(*screen.menuTheme(), 149 FbTk::Menu *menu = new FbMenu(*screen.menuTheme(),
150 screen.screenNumber(), 150 screen.screenNumber(),
151 screen.imageControl(), 151 screen.imageControl(),
152 *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); 152 *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()));
153 if (label)
154 menu->setLabel(label);
155
153 return menu; 156 return menu;
154} 157}
155 158
@@ -412,7 +415,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
412 // own resources we must do this. 415 // own resources we must do this.
413 fluxbox->load_rc(*this); 416 fluxbox->load_rc(*this);
414 417
415 m_configmenu.reset(createMenuFromScreen(*this)); 418 // TODO: nls
419 m_configmenu.reset(createMenuFromScreen(*this, "Configuration"));
416 setupConfigmenu(*m_configmenu.get()); 420 setupConfigmenu(*m_configmenu.get());
417 m_configmenu->setInternalMenu(); 421 m_configmenu->setInternalMenu();
418 422
@@ -1849,7 +1853,9 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1849 // create focus menu 1853 // create focus menu
1850 // we don't set this to internal menu so will 1854 // we don't set this to internal menu so will
1851 // be deleted toghether with the parent 1855 // be deleted toghether with the parent
1852 FbTk::Menu *focus_menu = createMenuFromScreen(*this); 1856 const char *focusmenu_label = i18n->getMessage(ConfigmenuSet, ConfigmenuFocusModel,
1857 "Focus Model");
1858 FbTk::Menu *focus_menu = createMenuFromScreen(*this, focusmenu_label);
1853 1859
1854 focus_menu->insert(new FocusModelMenuItem(i18n->getMessage( 1860 focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
1855 ConfigmenuSet, 1861 ConfigmenuSet,
@@ -1881,10 +1887,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1881 1887
1882 focus_menu->update(); 1888 focus_menu->update();
1883 1889
1884 menu.insert(i18n->getMessage( 1890 menu.insert(focusmenu_label, focus_menu);
1885 ConfigmenuSet, ConfigmenuFocusModel,
1886 "Focus Model"),
1887 focus_menu);
1888#ifdef SLIT 1891#ifdef SLIT
1889 if (slit() != 0) { 1892 if (slit() != 0) {
1890 slit()->menu().setInternalMenu(); 1893 slit()->menu().setInternalMenu();