From 745e840547b5443ecfb9b6f0a4f14b0d035d59c2 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 31 Dec 2002 19:15:24 +0000 Subject: load config options from the python environment --- src/screen.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/screen.cc') 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; -- cgit v1.2.3