diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-12-31 19:15:24 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-12-31 19:15:24 +0000 |
| commit | 745e840547b5443ecfb9b6f0a4f14b0d035d59c2 (patch) | |
| tree | e20da017ab6d93775136f0cd2267a25f7c83f8d6 /src/screen.cc | |
| parent | 1161a90a70b21d3064a9dee62c72dd4be3025ada (diff) | |
load config options from the python environment
Diffstat (limited to 'src/screen.cc')
| -rw-r--r-- | src/screen.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/screen.cc b/src/screen.cc index 61869a17..80b9083d 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -37,7 +37,7 @@ static int anotherWMRunning(Display *display, XErrorEvent *) { namespace ob { -OBScreen::OBScreen(int screen, const otk::Configuration &config) +OBScreen::OBScreen(int screen) : _number(screen), _root(screen) { @@ -74,8 +74,18 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config) // initialize the screen's style _style.setImageControl(_image_control); - _style.load(config); - + std::string stylepath; + Openbox::instance->getConfigString("theme", &stylepath); + otk::Configuration sconfig(false); + sconfig.setFile(otk::expandTilde(stylepath)); + if (!sconfig.load()) { + sconfig.setFile(otk::expandTilde(DEFAULTSTYLE)); + if (!sconfig.load()) { + printf(_("Unable to load default style: %s. Aborting.\n"), DEFAULTSTYLE); + ::exit(1); + } + } + _style.load(sconfig); // Set the netwm atoms for geomtery and viewport unsigned long geometry[] = { _info->width(), @@ -323,14 +333,6 @@ void OBScreen::setWorkArea() { } -void OBScreen::loadStyle(const otk::Configuration &config) -{ - _style.load(config); - - // XXX: make stuff redraw! -} - - void OBScreen::manageWindow(Window window) { OBClient *client = 0; |
