Code

show more axonometric grid lines
[inkscape.git] / src / extension / param / bool.cpp
index 509ded032dcb37691400e7eb5b2301090fb510f0..1dda3d73f82e4dea77009e5e1b839ac05b25056f 100644 (file)
 #include <gtkmm/box.h>
 #include <gtkmm/spinbutton.h>
 
-#include <xml/node.h>
-
+#include "xml/node.h"
 #include "../extension.h"
 #include "bool.h"
+#include "preferences.h"
 
 namespace Inkscape {
 namespace Extension {
@@ -29,14 +29,15 @@ ParamBool::ParamBool (const gchar * name, const gchar * guitext, const gchar * d
     if (sp_repr_children(xml) != NULL)
         defaultval = sp_repr_children(xml)->content();
 
-    if (defaultval != NULL && (!strcmp(defaultval, "TRUE") || !strcmp(defaultval, "true") || !strcmp(defaultval, "1"))) {
+    if (defaultval != NULL && (!strcmp(defaultval, "true") || !strcmp(defaultval, "true") || !strcmp(defaultval, "1"))) {
         _value = true;
     } else {
         _value = false;
     }
 
     gchar * pref_name = this->pref_name();
-    _value = (bool)prefs_get_int_attribute(PREF_DIR, pref_name, _value);
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    _value = prefs->getBool(extension_pref_root + pref_name, _value);
     g_free(pref_name);
 
     return;
@@ -57,7 +58,8 @@ ParamBool::set( bool in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ )
     _value = in;
 
     gchar * prefname = this->pref_name();
-    prefs_set_int_attribute(PREF_DIR, prefname, _value == true ? 1 : 0);
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setBool(extension_pref_root + prefname, _value);
     g_free(prefname);
 
     return _value;
@@ -150,3 +152,14 @@ ParamBool::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signa
 
 }  /* namespace Extension */
 }  /* namespace Inkscape */
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :