[Xfce4-commits] <ristretto:stephan/gtk3> Port RsttoWallpaperManager to gtk-3

Stephan Arts noreply at xfce.org
Fri May 4 20:42:05 CEST 2012


Updating branch refs/heads/stephan/gtk3
         to 4014cd12e2b81329940f0670f23096e54f2f78fe (commit)
       from 0b7b13df0cc657f5021f0814639cd2765f2dc51c (commit)

commit 4014cd12e2b81329940f0670f23096e54f2f78fe
Author: Stephan Arts <stephan at xfce.org>
Date:   Thu May 3 00:16:29 2012 +0200

    Port RsttoWallpaperManager to gtk-3

 src/gnome_wallpaper_manager.c |    7 ++++---
 src/privacy_dialog.c          |   34 +++++++++++++++++++++++++++-------
 src/settings.c                |   16 ++++++++--------
 src/xfce_wallpaper_manager.c  |   41 ++++++++++++++++++++++++-----------------
 4 files changed, 63 insertions(+), 35 deletions(-)

diff --git a/src/gnome_wallpaper_manager.c b/src/gnome_wallpaper_manager.c
index c687327..5d3ac40 100644
--- a/src/gnome_wallpaper_manager.c
+++ b/src/gnome_wallpaper_manager.c
@@ -257,7 +257,7 @@ rstto_gnome_wallpaper_manager_init (GObject *object)
     vbox = gtk_dialog_get_content_area ( GTK_DIALOG (manager->priv->dialog));
 
     manager->priv->monitor_chooser = rstto_monitor_chooser_new ();
-    manager->priv->style_combo = gtk_combo_box_new_text();
+    manager->priv->style_combo = gtk_combo_box_text_new();
 
     gtk_table_set_row_spacing (GTK_TABLE(image_prop_table), 1, 4);
 
@@ -308,8 +308,9 @@ rstto_gnome_wallpaper_manager_init (GObject *object)
             0,
             0);
 
-    gtk_combo_box_append_text (
-            GTK_COMBO_BOX (manager->priv->style_combo),
+    gtk_combo_box_text_append (
+            GTK_COMBO_BOX_TEXT (manager->priv->style_combo),
+            NULL,
             _("Auto"));
 
     gtk_combo_box_set_active (
diff --git a/src/privacy_dialog.c b/src/privacy_dialog.c
index db2749d..dbabf24 100644
--- a/src/privacy_dialog.c
+++ b/src/privacy_dialog.c
@@ -154,12 +154,32 @@ rstto_privacy_dialog_init (RsttoPrivacyDialog *dialog)
 
     dialog->priv->cleanup_vbox = gtk_vbox_new(FALSE, 0);
     dialog->priv->cleanup_frame = xfce_gtk_frame_box_new_with_content(_("Cleanup"), dialog->priv->cleanup_vbox);
-    dialog->priv->cleanup_timeframe_combo = gtk_combo_box_new_text();
-    gtk_combo_box_insert_text(GTK_COMBO_BOX(dialog->priv->cleanup_timeframe_combo), 0, _("Last Hour"));
-    gtk_combo_box_insert_text(GTK_COMBO_BOX(dialog->priv->cleanup_timeframe_combo), 1, _("Last Two Hours"));
-    gtk_combo_box_insert_text(GTK_COMBO_BOX(dialog->priv->cleanup_timeframe_combo), 2, _("Last Four Hours"));
-    gtk_combo_box_insert_text(GTK_COMBO_BOX(dialog->priv->cleanup_timeframe_combo), 3, _("Today"));
-    gtk_combo_box_insert_text(GTK_COMBO_BOX(dialog->priv->cleanup_timeframe_combo), 4, _("Everything"));
+    dialog->priv->cleanup_timeframe_combo = gtk_combo_box_text_new ();
+    gtk_combo_box_text_insert (
+            GTK_COMBO_BOX_TEXT(dialog->priv->cleanup_timeframe_combo),
+            0,
+            NULL,
+            _("Last Hour"));
+    gtk_combo_box_text_insert (
+            GTK_COMBO_BOX_TEXT(dialog->priv->cleanup_timeframe_combo),
+            1,
+            NULL,
+            _("Last Two Hours"));
+    gtk_combo_box_text_insert (
+            GTK_COMBO_BOX_TEXT(dialog->priv->cleanup_timeframe_combo),
+            2,
+            NULL,
+            _("Last Four Hours"));
+    gtk_combo_box_text_insert (
+            GTK_COMBO_BOX_TEXT(dialog->priv->cleanup_timeframe_combo),
+            3,
+            NULL,
+            _("Today"));
+    gtk_combo_box_text_insert (
+            GTK_COMBO_BOX_TEXT(dialog->priv->cleanup_timeframe_combo),
+            4,
+            NULL,
+            _("Everything"));
     g_signal_connect (G_OBJECT (dialog->priv->cleanup_timeframe_combo), 
                       "changed", (GCallback)cb_rstto_privacy_dialog_combobox_timeframe_changed, dialog);
     gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->priv->cleanup_timeframe_combo), 0);
@@ -171,7 +191,7 @@ rstto_privacy_dialog_init (RsttoPrivacyDialog *dialog)
     gtk_box_pack_start (GTK_BOX (display_main_hbox), 
                         dialog->priv->cleanup_timeframe_combo, FALSE, FALSE, 0);
 
-    gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 
                        dialog->priv->cleanup_frame);
 
     gtk_widget_show_all (dialog->priv->cleanup_frame);
diff --git a/src/settings.c b/src/settings.c
index d279010..99d0c35 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -161,17 +161,17 @@ rstto_settings_init (GObject *object)
         /* If the accels.scm file is missing, we are probably
          * dealing with a first-boot. Add default accelerators.
          */
-        gtk_accel_map_change_entry ("<Window>/fullscreen", GDK_F, 0, FALSE);
-        gtk_accel_map_change_entry ("<Window>/unfullscreen", GDK_Escape, 0, FALSE);
-        gtk_accel_map_change_entry ("<Window>/next-image", GDK_Page_Down, 0, FALSE);
-        gtk_accel_map_change_entry ("<Window>/previous-image", GDK_Page_Up, 0, FALSE);
-        gtk_accel_map_change_entry ("<Window>/quit", GDK_q, 0, FALSE);
+        gtk_accel_map_change_entry ("<Window>/fullscreen", GDK_KEY_F, 0, FALSE);
+        gtk_accel_map_change_entry ("<Window>/unfullscreen", GDK_KEY_Escape, 0, FALSE);
+        gtk_accel_map_change_entry ("<Window>/next-image", GDK_KEY_Page_Down, 0, FALSE);
+        gtk_accel_map_change_entry ("<Window>/previous-image", GDK_KEY_Page_Up, 0, FALSE);
+        gtk_accel_map_change_entry ("<Window>/quit", GDK_KEY_q, 0, FALSE);
 
-        gtk_accel_map_change_entry ("<Window>/delete", GDK_Delete, GDK_SHIFT_MASK, FALSE);
+        gtk_accel_map_change_entry ("<Window>/delete", GDK_KEY_Delete, GDK_SHIFT_MASK, FALSE);
 
-        gtk_accel_map_change_entry ("<Window>/refresh", GDK_r, GDK_CONTROL_MASK, FALSE);
+        gtk_accel_map_change_entry ("<Window>/refresh", GDK_KEY_r, GDK_CONTROL_MASK, FALSE);
 
-        gtk_accel_map_change_entry ("<Actions>/RsttoWindow/play", GDK_F5, 0, FALSE);
+        gtk_accel_map_change_entry ("<Actions>/RsttoWindow/play", GDK_KEY_F5, 0, FALSE);
     }
     
     settings->priv->slideshow_timeout = 5;
diff --git a/src/xfce_wallpaper_manager.c b/src/xfce_wallpaper_manager.c
index 8d6d651..5270534 100644
--- a/src/xfce_wallpaper_manager.c
+++ b/src/xfce_wallpaper_manager.c
@@ -118,8 +118,8 @@ struct _RsttoXfceWallpaperManagerPriv
 
     GtkWidget *monitor_chooser;
     GtkWidget *style_combo;
-    GtkObject *saturation_adjustment;
-    GtkObject *brightness_adjustment;
+    GtkAdjustment *saturation_adjustment;
+    GtkAdjustment *brightness_adjustment;
 
     GtkWidget *dialog;
 };
@@ -176,11 +176,12 @@ rstto_xfce_wallpaper_manager_check_running (RsttoWallpaperManager *self)
     Atom xfce_selection_atom;
     GdkScreen *gdk_screen = gdk_screen_get_default();
     gint xscreen = gdk_screen_get_number(gdk_screen);
+    GdkDisplay *gdk_display = gdk_display_get_default ();
 
     g_snprintf(selection_name, 100, XFDESKTOP_SELECTION_FMT, xscreen);
 
-    xfce_selection_atom = XInternAtom (gdk_display, selection_name, False);
-    if((XGetSelectionOwner(GDK_DISPLAY(), xfce_selection_atom)))
+    xfce_selection_atom = XInternAtom ((Display *)gdk_display, selection_name, False);
+    if((XGetSelectionOwner((Display *)gdk_display, xfce_selection_atom)))
     {
         return TRUE;
     }
@@ -394,7 +395,7 @@ rstto_xfce_wallpaper_manager_init (GObject *object)
     saturation_slider = gtk_hscale_new (
             GTK_ADJUSTMENT (manager->priv->saturation_adjustment));
     manager->priv->monitor_chooser = rstto_monitor_chooser_new ();
-    manager->priv->style_combo = gtk_combo_box_new_text();
+    manager->priv->style_combo = gtk_combo_box_text_new();
 
     gtk_table_set_row_spacing (GTK_TABLE(image_prop_table), 1, 4);
 
@@ -503,23 +504,29 @@ rstto_xfce_wallpaper_manager_init (GObject *object)
             0,
             0);
 
-    gtk_combo_box_append_text (
-            GTK_COMBO_BOX (manager->priv->style_combo),
+    gtk_combo_box_text_append (
+            GTK_COMBO_BOX_TEXT (manager->priv->style_combo),
+            NULL,
             _("Auto"));
-    gtk_combo_box_append_text (
-            GTK_COMBO_BOX (manager->priv->style_combo),
+    gtk_combo_box_text_append (
+            GTK_COMBO_BOX_TEXT (manager->priv->style_combo),
+            NULL,
             _("Centered"));
-    gtk_combo_box_append_text (
-            GTK_COMBO_BOX (manager->priv->style_combo),
+    gtk_combo_box_text_append (
+            GTK_COMBO_BOX_TEXT (manager->priv->style_combo),
+            NULL,
             _("Tiled"));
-    gtk_combo_box_append_text (
-            GTK_COMBO_BOX (manager->priv->style_combo),
+    gtk_combo_box_text_append (
+            GTK_COMBO_BOX_TEXT (manager->priv->style_combo),
+            NULL,
             _("Stretched"));
-    gtk_combo_box_append_text (
-            GTK_COMBO_BOX (manager->priv->style_combo),
+    gtk_combo_box_text_append (
+            GTK_COMBO_BOX_TEXT (manager->priv->style_combo),
+            NULL,
             _("Scaled"));
-    gtk_combo_box_append_text (
-            GTK_COMBO_BOX (manager->priv->style_combo),
+    gtk_combo_box_text_append (
+            GTK_COMBO_BOX_TEXT (manager->priv->style_combo),
+            NULL,
             _("Zoomed"));
 
     gtk_combo_box_set_active (


More information about the Xfce4-commits mailing list