make sure all menus have titles, make -version go to stdout

This commit is contained in:
rathnor 2003-07-25 10:03:55 +00:00
parent 9ca1f367cb
commit ac7edef9ad
8 changed files with 43 additions and 20 deletions

View file

@ -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:

View file

@ -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();

View file

@ -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<Slit>(
*screen().menuTheme(),
screen(),
screen().imageControl(),
*screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
*this
*this,
"Slit on Head"
));
}

View file

@ -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<Toolbar>(
*tbar.screen().menuTheme(),
tbar.screen(),
tbar.screen().imageControl(),
*tbar.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
tbar
tbar,
"Toolbar on Head"
));
}

View file

@ -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<Command> saverc_cmd(new SimpleCommand<Fluxbox>(
*Fluxbox::instance(),
&Fluxbox::save_rc));

View file

@ -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);
}

View file

@ -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 <typename ItemType>
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 <typename ItemType>
XineramaHeadMenu<ItemType>::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<FbTk::Command> saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(
*Fluxbox::instance(),
&Fluxbox::save_rc));

View file

@ -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 "<<endl<<endl;
cout<<"Fluxbox "<<__fluxbox_version<<" : (c) 2001-2003 Henrik Kinnunen "<<endl<<endl;
exit(0);
} else if (strcmp(argv[i], "-log") == 0 ) {
if (i + 1 >= argc) {