+void Slit::saveOnTop(bool b) {
+ on_top = b;
+ config->setValue(slitstr + "onTop", on_top);
+}
+
+void Slit::saveAutoHide(bool b) {
+ do_auto_hide = b;
+ config->setValue(slitstr + "autoHide", do_auto_hide);
+}
+
+void Slit::savePlacement(int p) {
+ placement = p;
+ const char *pname;
+ switch (placement) {
+ case TopLeft: pname = "TopLeft"; break;
+ case CenterLeft: pname = "CenterLeft"; break;
+ case BottomLeft: pname = "BottomLeft"; break;
+ case TopCenter: pname = "TopCenter"; break;
+ case BottomCenter: pname = "BottomCenter"; break;
+ case TopRight: pname = "TopRight"; break;
+ case BottomRight: pname = "BottomRight"; break;
+ case CenterRight: default: pname = "CenterRight"; break;
+ }
+ config->setValue(slitstr + "placement", pname);
+}
+
+void Slit::saveDirection(int d) {
+ direction = d;
+ config->setValue(slitstr + "direction", (direction == Horizontal ?
+ "Horizontal" : "Vertical"));
+}
+
+void Slit::save_rc(void) {
+ saveOnTop(on_top);
+ saveAutoHide(do_auto_hide);
+ savePlacement(placement);
+ saveDirection(direction);
+}
+
+void Slit::load_rc(void) {
+ std::string s;
+
+ if (! config->getValue(slitstr + "onTop", on_top))
+ on_top = false;
+
+ if (! config->getValue(slitstr + "autoHide", do_auto_hide))
+ do_auto_hide = false;
+ hidden = do_auto_hide;
+
+ if (config->getValue(slitstr + "direction", s) && s == "Horizontal")
+ direction = Horizontal;
+ else
+ direction = Vertical;
+
+ if (config->getValue(slitstr + "placement", s)) {
+ if (s == "TopLeft")
+ placement = TopLeft;
+ else if (s == "CenterLeft")
+ placement = CenterLeft;
+ else if (s == "BottomLeft")
+ placement = BottomLeft;
+ else if (s == "TopCenter")
+ placement = TopCenter;
+ else if (s == "BottomCenter")
+ placement = BottomCenter;
+ else if (s == "TopRight")
+ placement = TopRight;
+ else if (s == "BottomRight")
+ placement = BottomRight;
+ else //if (s == "CenterRight")
+ placement = CenterRight;
+ } else
+ placement = CenterRight;
+}
+
+