gnome-commander r2462 - in trunk: . doc/C libgcmd src



Author: epiotr
Date: Wed Feb 11 22:05:22 2009
New Revision: 2462
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2462&view=rev

Log:
Fixed problem #571239 (replacing obsoleted GnomeColorPicker with GtkColorButton)

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/doc/C/gnome-commander.xml
   trunk/libgcmd/libgcmd-widget-factory.c
   trunk/libgcmd/libgcmd-widget-factory.h
   trunk/src/gnome-cmd-options-dialog.cc

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Wed Feb 11 22:05:22 2009
@@ -12,6 +12,7 @@
  * Fixed problem #556664 (bookmarks can not be saved for mounted devices)
  * Fixed problem #567404 (crash when INSERT pressed over subdir)
  * Fixed problem #570727 (usage of deprecated gnome_url_show)
+ * Fixed problem #571239 (replacing obsoleted GnomeColorPicker with GtkColorButton)
  * Fixed problem with setting equal pane size in horizontal mode
 
 New features:

Modified: trunk/doc/C/gnome-commander.xml
==============================================================================
--- trunk/doc/C/gnome-commander.xml	(original)
+++ trunk/doc/C/gnome-commander.xml	Wed Feb 11 22:05:22 2009
@@ -5930,6 +5930,9 @@
                             <para>Fixed problem #570727 (usage of deprecated gnome_url_show)</para>
                         </listitem>
                         <listitem>
+                            <para>Fixed problem #571239 (replacing obsoleted GnomeColorPicker with GtkColorButton)</para>
+                        </listitem>
+                        <listitem>
                             <para>Fixed problem with setting equal pane size in horizontal mode</para>
                         </listitem>
                     </itemizedlist>

Modified: trunk/libgcmd/libgcmd-widget-factory.c
==============================================================================
--- trunk/libgcmd/libgcmd-widget-factory.c	(original)
+++ trunk/libgcmd/libgcmd-widget-factory.c	Wed Feb 11 22:05:22 2009
@@ -371,9 +371,9 @@
 
 
 GtkWidget *
-create_color_picker (GtkWidget *parent, gchar *name)
+create_color_button (GtkWidget *parent, gchar *name)
 {
-    GtkWidget *w = gnome_color_picker_new ();
+    GtkWidget *w = gtk_color_button_new ();
     gtk_widget_ref (w);
     gtk_object_set_data_full (GTK_OBJECT (parent), name, w,
                               (GtkDestroyNotify) gtk_widget_unref);

Modified: trunk/libgcmd/libgcmd-widget-factory.h
==============================================================================
--- trunk/libgcmd/libgcmd-widget-factory.h	(original)
+++ trunk/libgcmd/libgcmd-widget-factory.h	Wed Feb 11 22:05:22 2009
@@ -77,7 +77,7 @@
 
 GtkWidget *create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint value);
 
-GtkWidget *create_color_picker (GtkWidget *parent, gchar *name);
+GtkWidget *create_color_button (GtkWidget *parent, gchar *name);
 
 GtkWidget *create_icon_entry (GtkWidget *parent, gchar *name, const gchar *icon_path);
 

Modified: trunk/src/gnome-cmd-options-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-options-dialog.cc	(original)
+++ trunk/src/gnome-cmd-options-dialog.cc	Wed Feb 11 22:05:22 2009
@@ -336,41 +336,16 @@
 
 static void on_edit_colors_close (GtkButton *btn, GtkWidget *dlg)
 {
-    GtkWidget *norm_fg = lookup_widget (GTK_WIDGET (dlg), "default_fg");
-    GtkWidget *norm_bg = lookup_widget (GTK_WIDGET (dlg), "default_bg");
-    GtkWidget *alt_fg = lookup_widget (GTK_WIDGET (dlg), "alternate_fg");
-    GtkWidget *alt_bg = lookup_widget (GTK_WIDGET (dlg), "alternate_bg");
-    GtkWidget *sel_fg = lookup_widget (GTK_WIDGET (dlg), "selected_fg");
-    GtkWidget *sel_bg = lookup_widget (GTK_WIDGET (dlg), "selected_bg");
-    GtkWidget *curs_fg = lookup_widget (GTK_WIDGET (dlg), "cursor_fg");
-    GtkWidget *curs_bg = lookup_widget (GTK_WIDGET (dlg), "cursor_bg");
     GnomeCmdColorTheme *colors = gnome_cmd_data_get_custom_color_theme ();
-    gushort a;
 
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (norm_fg),
-        &colors->norm_fg->red, &colors->norm_fg->green, &colors->norm_fg->blue, &a);
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (norm_bg),
-        &colors->norm_bg->red, &colors->norm_bg->green, &colors->norm_bg->blue, &a);
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (alt_fg),
-        &colors->alt_fg->red, &colors->alt_fg->green, &colors->alt_fg->blue, &a);
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (alt_bg),
-        &colors->alt_bg->red, &colors->alt_bg->green, &colors->alt_bg->blue, &a);
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (sel_fg),
-        &colors->sel_fg->red, &colors->sel_fg->green, &colors->sel_fg->blue, &a);
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (sel_bg),
-        &colors->sel_bg->red, &colors->sel_bg->green, &colors->sel_bg->blue, &a);
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (curs_fg),
-        &colors->curs_fg->red, &colors->curs_fg->green, &colors->curs_fg->blue, &a);
-    gnome_color_picker_get_i16 (
-        GNOME_COLOR_PICKER (curs_bg),
-        &colors->curs_bg->red, &colors->curs_bg->green, &colors->curs_bg->blue, &a);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "default_fg")), colors->norm_fg);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "default_bg")), colors->norm_bg);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "alternate_fg")), colors->alt_fg);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "alternate_bg")), colors->alt_bg);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "selected_fg")), colors->sel_fg);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "selected_bg")), colors->sel_bg);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "cursor_fg")), colors->curs_fg);
+    gtk_color_button_get_color (GTK_COLOR_BUTTON (lookup_widget (dlg, "cursor_bg")), colors->curs_bg);
 
     gtk_widget_destroy (dlg);
 }
@@ -382,10 +357,11 @@
     gtk_widget_ref (dlg);
 
     GtkWidget *cat, *cat_box;
-    GtkWidget *table, *label, *cpicker;
+    GtkWidget *table, *label;
+    GtkWidget *cbutton;
     GnomeCmdColorTheme *colors = gnome_cmd_data_get_custom_color_theme ();
 
-    // The color pickers
+    // The color buttons
     cat_box = create_vbox (dlg, FALSE, 12);
     cat = create_category (dlg, cat_box, _("Colors"));
     gnome_cmd_dialog_add_category (GNOME_CMD_DIALOG (dlg), cat);
@@ -393,46 +369,30 @@
     table = create_table (dlg, 5, 3);
     gtk_container_add (GTK_CONTAINER (cat_box), table);
 
-    cpicker = create_color_picker (dlg, "default_fg");
-    table_add (table, cpicker, 1, 1, (GtkAttachOptions)0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->norm_fg->red, colors->norm_fg->green, colors->norm_fg->blue, 0);
-    cpicker = create_color_picker (dlg, "default_bg");
-    table_add (table, cpicker, 2, 1, (GtkAttachOptions)0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->norm_bg->red, colors->norm_bg->green, colors->norm_bg->blue, 0);
-    cpicker = create_color_picker (dlg, "alternate_fg");
-    table_add (table, cpicker, 1, 2, (GtkAttachOptions)0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->alt_fg->red, colors->alt_fg->green, colors->alt_fg->blue, 0);
-    cpicker = create_color_picker (dlg, "alternate_bg");
-    table_add (table, cpicker, 2, 2, (GtkAttachOptions) 0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->alt_bg->red, colors->alt_bg->green, colors->alt_bg->blue, 0);
-    cpicker = create_color_picker (dlg, "selected_fg");
-    table_add (table, cpicker, 1, 3, (GtkAttachOptions) 0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->sel_fg->red, colors->sel_fg->green, colors->sel_fg->blue, 0);
-    cpicker = create_color_picker (dlg, "selected_bg");
-    table_add (table, cpicker, 2, 3, (GtkAttachOptions) 0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->sel_bg->red, colors->sel_bg->green, colors->sel_bg->blue, 0);
-    cpicker = create_color_picker (dlg, "cursor_fg");
-    table_add (table, cpicker, 1, 4, (GtkAttachOptions) 0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->curs_fg->red, colors->curs_fg->green, colors->curs_fg->blue, 0);
-    cpicker = create_color_picker (dlg, "cursor_bg");
-    table_add (table, cpicker, 2, 4, (GtkAttachOptions) 0);
-    gnome_color_picker_set_i16 (
-        GNOME_COLOR_PICKER (cpicker),
-        colors->curs_bg->red, colors->curs_bg->green, colors->curs_bg->blue, 0);
+    cbutton = create_color_button (dlg, "default_fg");
+    table_add (table, cbutton, 1, 1, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->norm_fg);
+    cbutton = create_color_button (dlg, "default_bg");
+    table_add (table, cbutton, 2, 1, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->norm_bg);
+    cbutton = create_color_button (dlg, "alternate_fg");
+    table_add (table, cbutton, 1, 2, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->alt_fg);
+    cbutton = create_color_button (dlg, "alternate_bg");
+    table_add (table, cbutton, 2, 2, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->alt_bg);
+    cbutton = create_color_button (dlg, "selected_fg");
+    table_add (table, cbutton, 1, 3, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->sel_fg);
+    cbutton = create_color_button (dlg, "selected_bg");
+    table_add (table, cbutton, 2, 3, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->sel_bg);
+    cbutton = create_color_button (dlg, "cursor_fg");
+    table_add (table, cbutton, 1, 4, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->curs_fg);
+    cbutton = create_color_button (dlg, "cursor_bg");
+    table_add (table, cbutton, 2, 4, (GtkAttachOptions) 0);
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (cbutton), colors->curs_bg);
 
     label = create_label (dlg, _("Foreground"));
     table_add (table, label, 1, 0, (GtkAttachOptions) GTK_FILL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]