added addManagedResource, which adds a resource to BScreen and will be destroy by BScreen. + removed geom window nls

This commit is contained in:
fluxgen 2006-03-18 22:03:23 +00:00
parent 716bb32ec2
commit 1eda33b856

View file

@ -424,6 +424,7 @@ BScreen::~BScreen() {
destroyAndClearList(m_workspaces_list); destroyAndClearList(m_workspaces_list);
destroyAndClearList(m_netizen_list); destroyAndClearList(m_netizen_list);
destroyAndClearList(m_managed_resources);
//why not destroyAndClearList(m_icon_list); ? //why not destroyAndClearList(m_icon_list); ?
//problem with that: a delete FluxboxWindow* calls m_diesig.notify() //problem with that: a delete FluxboxWindow* calls m_diesig.notify()
@ -1414,8 +1415,7 @@ void BScreen::initMenu() {
FbTk::RefCount<FbTk::Command> exit_fb(CommandParser::instance().parseLine("exit")); FbTk::RefCount<FbTk::Command> exit_fb(CommandParser::instance().parseLine("exit"));
FbTk::RefCount<FbTk::Command> execute_xterm(CommandParser::instance().parseLine("exec xterm")); FbTk::RefCount<FbTk::Command> execute_xterm(CommandParser::instance().parseLine("exec xterm"));
m_rootmenu->setInternalMenu(); m_rootmenu->setInternalMenu();
m_rootmenu->insert(_FBTEXT(Menu, xterm, "xterm", "xterm - in fallback menu"), m_rootmenu->insert("xterm", execute_xterm);
execute_xterm);
m_rootmenu->insert(_FBTEXT(Menu, Restart, "Restart", "Restart command"), m_rootmenu->insert(_FBTEXT(Menu, Restart, "Restart", "Restart command"),
restart_fb); restart_fb);
m_rootmenu->insert(_FBTEXT(Menu, Exit, "Exit", "Exit command"), m_rootmenu->insert(_FBTEXT(Menu, Exit, "Exit", "Exit command"),
@ -1442,6 +1442,11 @@ void BScreen::removeConfigMenu(FbTk::Menu &menu) {
} }
void BScreen::addManagedResource(FbTk::Resource_base *resource) {
m_managed_resources.push_back(resource);
}
void BScreen::setupConfigmenu(FbTk::Menu &menu) { void BScreen::setupConfigmenu(FbTk::Menu &menu) {
_FB_USES_NLS; _FB_USES_NLS;
@ -1631,14 +1636,9 @@ void BScreen::showPosition(int x, int y) {
pos_visible = true; pos_visible = true;
} }
char label[256]; char label[256];
sprintf(label, "X: %4d x Y: %4d", x, y);
_FB_USES_NLS;
sprintf(label,
_FBTEXT(Screen, PositionFormat,
"X: %4d x Y: %4d",
"Format for screen coordinates - %4d for X, and %4d for Y"), x, y);
m_pos_window.clear(); m_pos_window.clear();
@ -1748,16 +1748,17 @@ void BScreen::leftWorkspace(const int delta) {
void BScreen::renderGeomWindow() { void BScreen::renderGeomWindow() {
char label[256];
_FB_USES_NLS; _FB_USES_NLS;
const char *s = _FBTEXT(Screen, sprintf(label,
GeometryLength, _FBTEXT(Screen, GeometryFormat,
"W: 0000 x H: 0000", "W: %4d x H: %4d", "Representative maximum sized text for width and height dialog"),
"Representative maximum sized text for width and height dialog"); 0, 0);
int l = strlen(s);
int geom_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2; int geom_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2;
int geom_w = winFrameTheme().font().textWidth(s, l) + winFrameTheme().bevelWidth()*2; int geom_w = winFrameTheme().font().textWidth(label, strlen(label)) + winFrameTheme().bevelWidth()*2;
m_geom_window.resize(geom_w, geom_h); m_geom_window.resize(geom_w, geom_h);
m_geom_window.setBorderWidth(winFrameTheme().border().width()); m_geom_window.setBorderWidth(winFrameTheme().border().width());
@ -1793,16 +1794,9 @@ void BScreen::renderGeomWindow() {
void BScreen::renderPosWindow() { void BScreen::renderPosWindow() {
_FB_USES_NLS;
const char *s = _FBTEXT(Screen,
PositionLength,
"0: 0000 x 0: 0000",
"Representative maximum sized text for X and Y dialog");
int l = strlen(s);
int pos_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2; int pos_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2;
int pos_w = winFrameTheme().font().textWidth(s, l) + winFrameTheme().bevelWidth()*2; int pos_w = winFrameTheme().font().textWidth("0: 0000 x 0: 0000", 17) + winFrameTheme().bevelWidth()*2;
m_pos_window.resize(pos_w, pos_h); m_pos_window.resize(pos_w, pos_h);
m_pos_window.setBorderWidth(winFrameTheme().border().width()); m_pos_window.setBorderWidth(winFrameTheme().border().width());