[Xfce4-commits] <ristretto:master> Add 'use-thunar-properties' setting.

Stephan Arts noreply at xfce.org
Sun Sep 25 19:30:11 CEST 2011


Updating branch refs/heads/master
         to 68151bcb4be5d47922459582ea684bc56e9e1c71 (commit)
       from 040bad4a9156dca43a1278a0d02f6117269ca9d8 (commit)

commit 68151bcb4be5d47922459582ea684bc56e9e1c71
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Sep 25 19:27:04 2011 +0200

    Add 'use-thunar-properties' setting.

 src/main_window.c |   10 +++++++++-
 src/settings.c    |   21 ++++++++++++++++++++-
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/src/main_window.c b/src/main_window.c
index e2576d9..e67cd1c 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -2353,6 +2353,9 @@ cb_rstto_main_window_properties (GtkWidget *widget, RsttoMainWindow *window)
     GFile *file = rstto_image_list_iter_get_file (window->priv->iter);
     gchar *uri = NULL;
     GtkWidget *dialog = NULL;
+    gboolean use_thunar_properties = rstto_settings_get_boolean_property (
+            window->priv->settings_manager,
+            "use-thunar-properties");
     if (file)
     {
         /* TODO: Add a property that allows forcing the built-in
@@ -2360,7 +2363,7 @@ cb_rstto_main_window_properties (GtkWidget *widget, RsttoMainWindow *window)
          * 
          * For now this is here for development purposes.
          */
-        if ( 0 )
+        if ( TRUE == use_thunar_properties )
         {
             uri = g_file_get_uri(file);
             if(dbus_g_proxy_call(window->priv->filemanager_proxy,
@@ -2373,6 +2376,11 @@ cb_rstto_main_window_properties (GtkWidget *widget, RsttoMainWindow *window)
                                  G_TYPE_INVALID) == FALSE)
             {
                 g_warning("DBUS CALL FAILED: '%s'", error->message);
+                dialog = rstto_properties_dialog_new (
+                        GTK_WINDOW (window),
+                        file);
+                gtk_dialog_run (GTK_DIALOG(dialog));
+                gtk_widget_destroy(dialog);
             }
             g_free(uri);
         }
diff --git a/src/settings.c b/src/settings.c
index b127c48..647348d 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -74,6 +74,7 @@ enum
     PROP_THUMBNAILBAR_SIZE,
     PROP_DESKTOP_TYPE,
     PROP_REVERT_ZOOM_DIRECTION,
+    PROP_USE_THUNAR_PROPERTIES,
 };
 
 GType
@@ -126,6 +127,7 @@ struct _RsttoSettingsPriv
     gboolean  wrap_images;
     gint      thumbnailbar_size;
     gchar    *desktop_type;
+    gboolean  use_thunar_properties;
 };
 
 
@@ -157,6 +159,7 @@ rstto_settings_init (GObject *object)
     settings->priv->window_width = 600;
     settings->priv->window_height = 400;
     settings->priv->wrap_images = TRUE;
+    settings->priv->use_thunar_properties = TRUE;
 
     xfconf_g_property_bind (settings->priv->channel, "/window/width", G_TYPE_UINT, settings, "window-width");
     xfconf_g_property_bind (settings->priv->channel, "/window/height", G_TYPE_UINT, settings, "window-height");
@@ -179,9 +182,10 @@ rstto_settings_init (GObject *object)
 
     xfconf_g_property_bind_gdkcolor (settings->priv->channel, "/window/bgcolor-fullscreen", settings, "bgcolor-fullscreen");
     xfconf_g_property_bind (settings->priv->channel, "/window/revert-zoom-direction", G_TYPE_BOOLEAN, settings, "revert-zoom-direction");
+    xfconf_g_property_bind (settings->priv->channel, "/window/thumbnailbar/size", G_TYPE_INT, settings, "thumbnailbar-size");
     xfconf_g_property_bind (settings->priv->channel, "/image/quality", G_TYPE_UINT, settings, "image-quality");
     xfconf_g_property_bind (settings->priv->channel, "/image/wrap", G_TYPE_BOOLEAN, settings, "wrap-images");
-    xfconf_g_property_bind (settings->priv->channel, "/window/thumbnailbar/size", G_TYPE_INT, settings, "thumbnailbar-size");
+    xfconf_g_property_bind (settings->priv->channel, "/window/use-thunar-properties", G_TYPE_BOOLEAN, settings, "use-thunar-properties");
 }
 
 
@@ -389,6 +393,15 @@ rstto_settings_class_init (GObjectClass *object_class)
     g_object_class_install_property (object_class,
                                      PROP_DESKTOP_TYPE,
                                      pspec);
+
+    pspec = g_param_spec_boolean ("use-thunar-properties",
+                                  "",
+                                  "",
+                                  TRUE,
+                                  G_PARAM_READWRITE);
+    g_object_class_install_property (object_class,
+                                     PROP_USE_THUNAR_PROPERTIES,
+                                     pspec);
 }
 
 /**
@@ -555,6 +568,9 @@ rstto_settings_set_property    (GObject      *object,
                 g_free (settings->priv->desktop_type);
             settings->priv->desktop_type = g_value_dup_string (value);
             break;
+        case PROP_USE_THUNAR_PROPERTIES:
+            settings->priv->use_thunar_properties = g_value_get_boolean (value);
+            break;
         default:
             break;
     }
@@ -630,6 +646,9 @@ rstto_settings_get_property    (GObject    *object,
         case PROP_DESKTOP_TYPE:
             g_value_set_string (value, settings->priv->desktop_type);
             break;
+        case PROP_USE_THUNAR_PROPERTIES:
+            g_value_set_boolean (value, settings->priv->use_thunar_properties);
+            break;
         default:
             break;
 


More information about the Xfce4-commits mailing list