gnome-commander r2178 - in branches/gcmd-1-3: . src



Author: epiotr
Date: Fri Oct 10 20:53:04 2008
New Revision: 2178
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2178&view=rev

Log:
GnomeCmdData: more C++ rework

Modified:
   branches/gcmd-1-3/ChangeLog
   branches/gcmd-1-3/src/gnome-cmd-combo.cc
   branches/gcmd-1-3/src/gnome-cmd-data.cc
   branches/gcmd-1-3/src/gnome-cmd-data.h
   branches/gcmd-1-3/src/gnome-cmd-dir-indicator.cc
   branches/gcmd-1-3/src/gnome-cmd-file-selector.cc
   branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc
   branches/gcmd-1-3/src/utils.cc

Modified: branches/gcmd-1-3/src/gnome-cmd-combo.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-combo.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-combo.cc	Fri Oct 10 20:53:04 2008
@@ -368,7 +368,7 @@
 
     combo->button = gtk_button_new ();
     gtk_widget_ref (combo->button);
-    gtk_button_set_relief (GTK_BUTTON (combo->button), gnome_cmd_data_get_button_relief ());
+    gtk_button_set_relief (GTK_BUTTON (combo->button), gnome_cmd_data.button_relief);
     gtk_object_set_data_full (GTK_OBJECT (combo), "button", combo->button, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (combo->button);
 

Modified: branches/gcmd-1-3/src/gnome-cmd-data.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-data.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-data.cc	Fri Oct 10 20:53:04 2008
@@ -60,8 +60,6 @@
     gchar                *theme_icon_dir;
     gchar                *document_icon_dir;
     guint                bookmark_dialog_col_width[BOOKMARK_DIALOG_NUM_COLUMNS];
-    GtkReliefStyle       btn_relief;
-    gboolean             device_only_icon;
     gint                 dir_cache_size;
     gboolean             use_ls_colors;
     gboolean             honor_expect_uris;
@@ -1114,9 +1112,11 @@
 
     icon_size = 16;
     dev_icon_size = 16;
+    device_only_icon = FALSE;
     list_row_height = 16;
     memset(fs_col_width, 0, sizeof(fs_col_width));
     gui_update_rate = DEFAULT_GUI_UPDATE_RATE;
+    button_relief = GTK_RELIEF_NONE;
 
     cmdline_history = NULL;
     cmdline_history_length = 0;
@@ -1294,7 +1294,7 @@
     priv->document_icon_dir = gnome_cmd_data_get_string ("/options/document_icon_dir", document_icon_dir);
     g_free (document_icon_dir);
     cmdline_history_length = gnome_cmd_data_get_int ("/options/cmdline_history_length", 16);
-    priv->btn_relief = (GtkReliefStyle) gnome_cmd_data_get_int ("/options/btn_relief", GTK_RELIEF_NONE);
+    button_relief = (GtkReliefStyle) gnome_cmd_data_get_int ("/options/btn_relief", GTK_RELIEF_NONE);
     filter_type = (Filter::Type) gnome_cmd_data_get_int ("/options/filter_type", Filter::TYPE_FNMATCH);
     list_orientation = gnome_cmd_data_get_bool ("/options/list_orientation", FALSE);
     gui_update_rate = gnome_cmd_data_get_int ("/options/gui_update_rate", DEFAULT_GUI_UPDATE_RATE);
@@ -1337,7 +1337,7 @@
 
     use_gcmd_block = gnome_cmd_data_get_bool ("/programs/use_gcmd_block", FALSE);
 
-    priv->device_only_icon = gnome_cmd_data_get_bool ("/devices/only_icon", FALSE);
+    device_only_icon = gnome_cmd_data_get_bool ("/devices/only_icon", FALSE);
     priv->dir_cache_size = gnome_cmd_data_get_int ("/options/dir_cache_size", 10);
     priv->use_ls_colors = gnome_cmd_data_get_bool ("/colors/use_ls_colors", FALSE);
 
@@ -1644,7 +1644,7 @@
     gnome_cmd_data_set_string ("/options/theme_icon_dir", priv->theme_icon_dir);
     gnome_cmd_data_set_string ("/options/document_icon_dir", priv->document_icon_dir);
     gnome_cmd_data_set_int    ("/options/cmdline_history_length", cmdline_history_length);
-    gnome_cmd_data_set_int    ("/options/btn_relief", priv->btn_relief);
+    gnome_cmd_data_set_int    ("/options/btn_relief", button_relief);
     gnome_cmd_data_set_int    ("/options/filter_type", filter_type);
     gnome_cmd_data_set_bool   ("/options/list_orientation", list_orientation);
     gnome_cmd_data_set_int    ("/options/gui_update_rate", gui_update_rate);
@@ -1681,7 +1681,7 @@
 
     gnome_cmd_data_set_bool   ("/programs/use_gcmd_block", use_gcmd_block);
 
-    gnome_cmd_data_set_bool   ("/devices/only_icon", priv->device_only_icon);
+    gnome_cmd_data_set_bool   ("/devices/only_icon", device_only_icon);
     gnome_cmd_data_set_int    ("/options/dir_cache_size", priv->dir_cache_size);
     gnome_cmd_data_set_bool   ("/colors/use_ls_colors", priv->use_ls_colors);
 
@@ -1973,30 +1973,6 @@
 }
 
 
-void gnome_cmd_data_set_button_relief (GtkReliefStyle relief)
-{
-    gnome_cmd_data.priv->btn_relief = relief;
-}
-
-
-GtkReliefStyle gnome_cmd_data_get_button_relief ()
-{
-    return gnome_cmd_data.priv->btn_relief;
-}
-
-
-void gnome_cmd_data_set_device_only_icon (gboolean value)
-{
-    gnome_cmd_data.priv->device_only_icon = value;
-}
-
-
-gboolean gnome_cmd_data_get_device_only_icon ()
-{
-    return gnome_cmd_data.priv->device_only_icon;
-}
-
-
 gint gnome_cmd_data_get_dir_cache_size ()
 {
     return gnome_cmd_data.priv->dir_cache_size;

Modified: branches/gcmd-1-3/src/gnome-cmd-data.h
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-data.h	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-data.h	Fri Oct 10 20:53:04 2008
@@ -119,9 +119,11 @@
 
     guint                        icon_size;
     guint                        dev_icon_size;
+    gboolean                     device_only_icon;
     gint                         list_row_height;
     guint                        fs_col_width[GnomeCmdFileList::NUM_COLUMNS];
     guint                        gui_update_rate;
+    GtkReliefStyle               button_relief;
 
     GList                       *cmdline_history;
     gint                         cmdline_history_length;
@@ -205,12 +207,6 @@
 gint gnome_cmd_data_get_bookmark_dialog_col_width (guint column);
 void gnome_cmd_data_set_bookmark_dialog_col_width (guint column, gint width);
 
-GtkReliefStyle gnome_cmd_data_get_button_relief ();
-void gnome_cmd_data_set_button_relief (GtkReliefStyle relief);
-
-gboolean gnome_cmd_data_get_device_only_icon ();
-void gnome_cmd_data_set_device_only_icon (gboolean value);
-
 gint gnome_cmd_data_get_dir_cache_size ();
 void gnome_cmd_data_set_dir_cache_size (gint size);
 

Modified: branches/gcmd-1-3/src/gnome-cmd-dir-indicator.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-dir-indicator.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-dir-indicator.cc	Fri Oct 10 20:53:04 2008
@@ -445,7 +445,7 @@
     indicator->priv->history_button = gtk_button_new ();
     GTK_WIDGET_UNSET_FLAGS (indicator->priv->history_button, GTK_CAN_FOCUS);
     gtk_widget_ref (indicator->priv->history_button);
-    gtk_button_set_relief (GTK_BUTTON (indicator->priv->history_button), gnome_cmd_data_get_button_relief ());
+    gtk_button_set_relief (GTK_BUTTON (indicator->priv->history_button), gnome_cmd_data.button_relief);
     gtk_object_set_data_full (GTK_OBJECT (indicator),
                               "button", indicator->priv->history_button,
                               (GtkDestroyNotify) gtk_widget_unref);
@@ -460,7 +460,7 @@
     // create the bookmark popup button
     indicator->priv->bookmark_button = create_styled_pixmap_button (NULL, IMAGE_get_gnome_cmd_pixmap (PIXMAP_BOOKMARK));
     GTK_WIDGET_UNSET_FLAGS (indicator->priv->bookmark_button, GTK_CAN_FOCUS);
-    gtk_button_set_relief (GTK_BUTTON (indicator->priv->bookmark_button), gnome_cmd_data_get_button_relief ());
+    gtk_button_set_relief (GTK_BUTTON (indicator->priv->bookmark_button), gnome_cmd_data.button_relief);
     gtk_object_set_data_full (GTK_OBJECT (indicator), "button", indicator->priv->bookmark_button, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (indicator->priv->bookmark_button);
 

Modified: branches/gcmd-1-3/src/gnome-cmd-file-selector.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-selector.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-selector.cc	Fri Oct 10 20:53:04 2008
@@ -900,7 +900,7 @@
             }
         }
 
-        if (!gnome_cmd_data_get_device_only_icon () || !pm)
+        if (!gnome_cmd_data.device_only_icon || !pm)
         {
             label = gtk_label_new (gnome_cmd_con_get_alias (con));
             gtk_widget_ref (label);

Modified: branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc	Fri Oct 10 20:53:04 2008
@@ -1688,7 +1688,7 @@
 
     check = create_check (parent, _("Show only the icons"), "device_only_icon");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data_get_device_only_icon());
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data.device_only_icon);
 
     check = create_check (parent, _("Skip mounting (useful when using super-mount)"), "skip_mounting");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
@@ -1709,7 +1709,7 @@
     GtkWidget *device_only_icon = lookup_widget (dialog, "device_only_icon");
     GtkWidget *skip_mounting = lookup_widget (dialog, "skip_mounting");
 
-    gnome_cmd_data_set_device_only_icon (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (device_only_icon)));
+    gnome_cmd_data.device_only_icon = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (device_only_icon));
     gnome_cmd_data_set_skip_mounting (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (skip_mounting)));
 }
 

Modified: branches/gcmd-1-3/src/utils.cc
==============================================================================
--- branches/gcmd-1-3/src/utils.cc	(original)
+++ branches/gcmd-1-3/src/utils.cc	Fri Oct 10 20:53:04 2008
@@ -891,7 +891,7 @@
 {
     GtkWidget *w = text ? gtk_button_new_with_label (text) : gtk_button_new ();
 
-    gtk_button_set_relief (GTK_BUTTON (w), gnome_cmd_data_get_button_relief ());
+    gtk_button_set_relief (GTK_BUTTON (w), gnome_cmd_data.button_relief);
     gtk_widget_ref (w);
     gtk_widget_show (w);
 



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