From ac7edef9ad73818435420479a0dfa9c5ed517a79 Mon Sep 17 00:00:00 2001 From: rathnor Date: Fri, 25 Jul 2003 10:03:55 +0000 Subject: make sure all menus have titles, make -version go to stdout --- ChangeLog | 3 +++ src/Screen.cc | 19 +++++++++++-------- src/Slit.cc | 10 ++++++++-- src/Toolbar.cc | 10 ++++++++-- src/ToolbarHandler.cc | 5 ++++- src/Workspace.cc | 3 ++- src/Xinerama.hh | 9 +++++---- src/main.cc | 4 ++-- 8 files changed, 43 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0a4f21..93f89cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 0.9.5: *03/07/25: + * Make sure all the menus have titles, make -version go to stdout (Simon) + Screen.cc Slit.cc Toolbar.cc ToolbarHandler.cc Xinerama.hh + Workspace.cc main.cc * Fix pesky crash and phantom icons (diesig wasn't getting through) (Simon) ToolbarHandler.cc *03/07/24: 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.206 2003/07/20 08:12:36 rathnor Exp $ +// $Id: Screen.cc,v 1.207 2003/07/25 10:03:55 rathnor Exp $ #include "Screen.hh" @@ -145,11 +145,14 @@ int anotherWMRunning(Display *display, XErrorEvent *) { return -1; } -FbTk::Menu *createMenuFromScreen(BScreen &screen) { +FbTk::Menu *createMenuFromScreen(BScreen &screen, const char *label = 0) { FbTk::Menu *menu = new FbMenu(*screen.menuTheme(), screen.screenNumber(), screen.imageControl(), *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); + if (label) + menu->setLabel(label); + return menu; } @@ -412,7 +415,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm, // own resources we must do this. fluxbox->load_rc(*this); - m_configmenu.reset(createMenuFromScreen(*this)); + // TODO: nls + m_configmenu.reset(createMenuFromScreen(*this, "Configuration")); setupConfigmenu(*m_configmenu.get()); m_configmenu->setInternalMenu(); @@ -1849,7 +1853,9 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { // create focus menu // we don't set this to internal menu so will // be deleted toghether with the parent - FbTk::Menu *focus_menu = createMenuFromScreen(*this); + const char *focusmenu_label = i18n->getMessage(ConfigmenuSet, ConfigmenuFocusModel, + "Focus Model"); + FbTk::Menu *focus_menu = createMenuFromScreen(*this, focusmenu_label); focus_menu->insert(new FocusModelMenuItem(i18n->getMessage( ConfigmenuSet, @@ -1881,10 +1887,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { focus_menu->update(); - menu.insert(i18n->getMessage( - ConfigmenuSet, ConfigmenuFocusModel, - "Focus Model"), - focus_menu); + menu.insert(focusmenu_label, focus_menu); #ifdef SLIT if (slit() != 0) { slit()->menu().setInternalMenu(); diff --git a/src/Slit.cc b/src/Slit.cc index 18a4c31..8b03749 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.74 2003/07/23 10:42:12 fluxgen Exp $ +// $Id: Slit.cc,v 1.75 2003/07/25 10:03:55 rathnor Exp $ #include "Slit.hh" @@ -315,6 +315,10 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer)); moveToLayer((*m_rc_layernum).getNum()); + // TODO: nls + if (m_layermenu.get()) + m_layermenu->setLabel("Slit Layer"); + // Get client list for sorting purposes loadClientList(filename); @@ -1219,12 +1223,14 @@ void Slit::setupMenu() { #ifdef XINERAMA if (screen().hasXinerama()) { + // TODO: nls (main label, plus menu heading) m_slitmenu.insert("On Head...", new XineramaHeadMenu( *screen().menuTheme(), screen(), screen().imageControl(), *screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), - *this + *this, + "Slit on Head" )); } diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 251d8dd..409181b 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.102 2003/07/19 11:55:49 rathnor Exp $ +// $Id: Toolbar.cc,v 1.103 2003/07/25 10:03:55 rathnor Exp $ #include "Toolbar.hh" @@ -284,6 +284,10 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi moveToLayer((*m_rc_layernum).getNum()); + // TODO: nls + m_layermenu.setLabel("Toolbar Layer"); + m_placementmenu.setLabel("Toolbar Placement"); + m_layermenu.setInternalMenu(); m_placementmenu.setInternalMenu(); setupMenus(); @@ -1392,12 +1396,14 @@ void Toolbar::setupMenus() { menu.insert("Layer...", &tbar.layermenu()); if (tbar.screen().hasXinerama()) { + // TODO: nls (main label plus menu heading menu.insert("On Head...", new XineramaHeadMenu( *tbar.screen().menuTheme(), tbar.screen(), tbar.screen().imageControl(), *tbar.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), - tbar + tbar, + "Toolbar on Head" )); } diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc index d5682e9..6a3cd0b 100644 --- a/src/ToolbarHandler.cc +++ b/src/ToolbarHandler.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolbarHandler.cc,v 1.25 2003/07/25 08:46:51 rathnor Exp $ +// $Id: ToolbarHandler.cc,v 1.26 2003/07/25 10:03:55 rathnor Exp $ /** * The ToolbarHandler class acts as a rough interface to the toolbar. @@ -118,6 +118,9 @@ void setupModeMenu(FbTk::Menu &menu, ToolbarHandler &handler) { //using namespace FBNLS; using namespace FbTk; + // TODO: nls + menu.setLabel("Toolbar Mode"); + RefCount saverc_cmd(new SimpleCommand( *Fluxbox::instance(), &Fluxbox::save_rc)); diff --git a/src/Workspace.cc b/src/Workspace.cc index 0628492..6b59a59 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.76 2003/06/24 18:34:01 fluxgen Exp $ +// $Id: Workspace.cc,v 1.77 2003/07/25 10:03:55 rathnor Exp $ #include "Workspace.hh" @@ -131,6 +131,7 @@ Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager, m_cascade_y[i] = 32 + scrn.getHeadY(i); } m_clientmenu.setInternalMenu(); + setName(name); } diff --git a/src/Xinerama.hh b/src/Xinerama.hh index 8bbd3d1..99c8705 100644 --- a/src/Xinerama.hh +++ b/src/Xinerama.hh @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Xinerama.hh,v 1.4 2003/07/19 11:55:49 rathnor Exp $ +// $Id: Xinerama.hh,v 1.5 2003/07/25 10:03:55 rathnor Exp $ #ifndef XINERAMA_HH #define XINERAMA_HH @@ -65,7 +65,7 @@ template class XineramaHeadMenu : public FbMenu { public: XineramaHeadMenu(MenuTheme &tm, BScreen &screen, FbTk::ImageControl &imgctrl, - FbTk::XLayer &layer, ItemType &item); + FbTk::XLayer &layer, ItemType &item, const char * title); private: ItemType &m_object; @@ -74,11 +74,12 @@ private: template XineramaHeadMenu::XineramaHeadMenu(MenuTheme &tm, BScreen &screen, FbTk::ImageControl &imgctrl, - FbTk::XLayer &layer, ItemType &item): + FbTk::XLayer &layer, ItemType &item, const char * title = 0): FbMenu(tm, screen.screenNumber(), imgctrl, layer), m_object(item) { - + if (title) + setLabel(title); FbTk::RefCount saverc_cmd(new FbTk::SimpleCommand( *Fluxbox::instance(), &Fluxbox::save_rc)); diff --git a/src/main.cc b/src/main.cc index 7a82857..ecaff6a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: main.cc,v 1.21 2003/07/18 15:44:36 rathnor Exp $ +// $Id: main.cc,v 1.22 2003/07/25 10:03:55 rathnor Exp $ #include "fluxbox.hh" #include "I18n.hh" @@ -176,7 +176,7 @@ int main(int argc, char **argv) { } } else if (strcmp(argv[i], "-version") == 0 || strcmp(argv[i], "-v") == 0) { // print current version string - cerr<<"Fluxbox "<<__fluxbox_version<<" : (c) 2001-2003 Henrik Kinnunen "<= argc) { -- cgit v0.11.2