]> Dogcows Code - chaz/openbox/blobdiff - src/screen.cc
typo
[chaz/openbox] / src / screen.cc
index 61869a17a427c212e751947401d5b151b4de7cf9..da603ed8cb3d690152853fa13c5cc46539651f78 100644 (file)
@@ -23,6 +23,7 @@ extern "C" {
 #include "openbox.hh"
 #include "frame.hh"
 #include "bindings.hh"
+#include "python.hh"
 #include "otk/display.hh"
 
 static bool running;
@@ -37,7 +38,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 +75,18 @@ OBScreen::OBScreen(int screen, const otk::Configuration &config)
 
   // initialize the screen's style
   _style.setImageControl(_image_control);
-  _style.load(config);
-
+  std::string stylepath;
+  python_get_string("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 +334,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;
This page took 0.021608 seconds and 4 git commands to generate.