now yuo can change styles again! (oops) wasnt saving teh nwe style file to the Resource class when it changed.

This commit is contained in:
Dana Jansens 2002-04-18 03:00:12 +00:00
parent e148f58d0e
commit 4602d87180
6 changed files with 11 additions and 10 deletions

View file

@ -1,4 +1,4 @@
// Icon.cc for Openbox // Iconmenu.cc for Openbox
// Copyright (c) 2001 Sean 'Shaleh' Perry <shaleh@debian.org> // Copyright (c) 2001 Sean 'Shaleh' Perry <shaleh@debian.org>
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
// //

View file

@ -1,4 +1,4 @@
// Icon.h for Openbox // Iconmenu.h for Openbox
// Copyright (c) 2001 Sean 'Shaleh' Perry <shaleh@debian.org> // Copyright (c) 2001 Sean 'Shaleh' Perry <shaleh@debian.org>
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
// //

View file

@ -102,7 +102,7 @@ void Rootmenu::itemSelected(int button, int index) {
case BScreen::SetStyle: case BScreen::SetStyle:
if (item->exec()) if (item->exec())
openbox.saveStyleFilename(item->exec()); openbox.setStyleFilename(item->exec());
case BScreen::Reconfigure: case BScreen::Reconfigure:
openbox.reconfigure(); openbox.reconfigure();

View file

@ -2160,7 +2160,7 @@ void BScreen::InitMenu(void) {
rootmenu->insert(i18n->getMessage(ScreenSet, ScreenExit, "Exit"), rootmenu->insert(i18n->getMessage(ScreenSet, ScreenExit, "Exit"),
BScreen::Exit); BScreen::Exit);
} else { } else {
openbox.saveMenuFilename(openbox.getMenuFilename()); openbox.setMenuFilename(openbox.getMenuFilename());
} }
} }
@ -2361,7 +2361,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
if (! feof(submenufile)) { if (! feof(submenufile)) {
if (! parseMenuFile(submenufile, menu)) if (! parseMenuFile(submenufile, menu))
openbox.saveMenuFilename(newfile); openbox.setMenuFilename(newfile);
fclose(submenufile); fclose(submenufile);
} }
@ -2520,7 +2520,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
rootmenuList->insert(stylesmenu); rootmenuList->insert(stylesmenu);
} }
openbox.saveMenuFilename(stylesdir); openbox.setMenuFilename(stylesdir);
} else { } else {
fprintf(stderr, i18n->getMessage(ScreenSet, fprintf(stderr, i18n->getMessage(ScreenSet,
ScreenSTYLESDIRErrorNotDir, ScreenSTYLESDIRErrorNotDir,

View file

@ -1137,15 +1137,16 @@ void Openbox::real_rereadMenu() {
} }
void Openbox::saveStyleFilename(const char *filename) { void Openbox::setStyleFilename(const char *filename) {
if (resource.style_file) if (resource.style_file)
delete [] resource.style_file; delete [] resource.style_file;
resource.style_file = bstrdup(filename); resource.style_file = bstrdup(filename);
config.setValue("session.styleFile", resource.style_file);
} }
void Openbox::saveMenuFilename(const char *filename) { void Openbox::setMenuFilename(const char *filename) {
Bool found = False; Bool found = False;
LinkedListIterator<MenuTimestamp> it(menuTimestamps); LinkedListIterator<MenuTimestamp> it(menuTimestamps);

View file

@ -178,8 +178,8 @@ public:
void setFocusedWindow(OpenboxWindow *w); void setFocusedWindow(OpenboxWindow *w);
void shutdown(); void shutdown();
void saveStyleFilename(const char *); void setStyleFilename(const char *);
void saveMenuFilename(const char *); void setMenuFilename(const char *);
void saveMenuSearch(Window, Basemenu *); void saveMenuSearch(Window, Basemenu *);
void saveWindowSearch(Window, OpenboxWindow *); void saveWindowSearch(Window, OpenboxWindow *);
void saveToolbarSearch(Window, Toolbar *); void saveToolbarSearch(Window, Toolbar *);