gnome-commander r2054 - in branches/gcmd-1-3: . doc/C src



Author: epiotr
Date: Fri Sep  5 21:04:08 2008
New Revision: 2054
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2054&view=rev

Log:
Visibility of connection/device list is configurable now

Modified:
   branches/gcmd-1-3/ChangeLog
   branches/gcmd-1-3/doc/C/gnome-commander.xml
   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-file-selector.cc
   branches/gcmd-1-3/src/gnome-cmd-file-selector.h
   branches/gcmd-1-3/src/gnome-cmd-main-menu.cc
   branches/gcmd-1-3/src/gnome-cmd-user-actions.cc
   branches/gcmd-1-3/src/gnome-cmd-user-actions.h

Modified: branches/gcmd-1-3/doc/C/gnome-commander.xml
==============================================================================
--- branches/gcmd-1-3/doc/C/gnome-commander.xml	(original)
+++ branches/gcmd-1-3/doc/C/gnome-commander.xml	Fri Sep  5 21:04:08 2008
@@ -5033,15 +5033,22 @@
                                 <row valign="top">
                                     <entry><para></para></entry>
                                     <entry><para>cmdline_visibility</para></entry>
-                                    <entry><para></para></entry>
-                                    <entry><para></para></entry>
+                                    <entry><para>boolean</para></entry>
+                                    <entry><para>Show commandline.</para></entry>
                                     <entry><para></para></entry>
                                 </row>
                                 <row valign="top">
                                     <entry><para></para></entry>
                                     <entry><para>conbuttons_visibility</para></entry>
+                                    <entry><para>boolean</para></entry>
+                                    <entry><para>Show connection/device buttons.</para></entry>
                                     <entry><para></para></entry>
+                                </row>
+                                <row valign="top">
                                     <entry><para></para></entry>
+                                    <entry><para>con_list_visibility</para></entry>
+                                    <entry><para>boolean</para></entry>
+                                    <entry><para>Show connection/device list.</para></entry>
                                     <entry><para></para></entry>
                                 </row>
                                 <row valign="top">

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 Sep  5 21:04:08 2008
@@ -90,6 +90,7 @@
     AdvrenameDefaults    *advrename_defaults;
     gboolean             list_orientation;
     gboolean             conbuttons_visibility;
+    gboolean             concombo_visibility;
     gboolean             cmdline_visibility;
     gchar                *start_dirs[2];
     gchar                *last_pattern;
@@ -1212,6 +1213,7 @@
     gnome_cmd_data_set_int    ("/options/filter_type", data->priv->filter_type);
     gnome_cmd_data_set_bool   ("/options/list_orientation", data->priv->list_orientation);
     gnome_cmd_data_set_bool   ("/options/conbuttons_visibility", data->priv->conbuttons_visibility);
+    gnome_cmd_data_set_bool   ("/options/con_list_visibility", data->priv->concombo_visibility);
     gnome_cmd_data_set_bool   ("/options/cmdline_visibility", data->priv->cmdline_visibility);
 
     gnome_cmd_data_set_bool   ("/programs/honor_expect_uris", data->priv->honor_expect_uris);
@@ -1436,6 +1438,7 @@
     data->priv->filter_type = (Filter::Type) gnome_cmd_data_get_int ("/options/filter_type", Filter::TYPE_FNMATCH);
     data->priv->list_orientation = gnome_cmd_data_get_bool ("/options/list_orientation", FALSE);
     data->priv->conbuttons_visibility = gnome_cmd_data_get_bool ("/options/conbuttons_visibility", TRUE);
+    data->priv->concombo_visibility = gnome_cmd_data_get_bool ("/options/con_list_visibility", TRUE);
     data->priv->cmdline_visibility = gnome_cmd_data_get_bool ("/options/cmdline_visibility", TRUE);
     data->priv->gui_update_rate = gnome_cmd_data_get_int ("/options/gui_update_rate", DEFAULT_GUI_UPDATE_RATE);
     data->priv->main_win_pos[0] = gnome_cmd_data_get_int ("/options/main_win_pos_x", -1);
@@ -2366,6 +2369,18 @@
 }
 
 
+gboolean gnome_cmd_data_get_concombo_visibility (void)
+{
+    return data->priv->concombo_visibility;
+}
+
+
+void gnome_cmd_data_set_concombo_visibility (gboolean value)
+{
+    data->priv->concombo_visibility = value;
+}
+
+
 gboolean gnome_cmd_data_get_cmdline_visibility (void)
 {
     return data->priv->cmdline_visibility;

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 Sep  5 21:04:08 2008
@@ -241,6 +241,9 @@
 gboolean gnome_cmd_data_get_conbuttons_visibility (void);
 void gnome_cmd_data_set_conbuttons_visibility (gboolean value);
 
+gboolean gnome_cmd_data_get_concombo_visibility (void);
+void gnome_cmd_data_set_concombo_visibility (gboolean value);
+
 gboolean gnome_cmd_data_get_cmdline_visibility (void);
 void gnome_cmd_data_set_cmdline_visibility (gboolean value);
 

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 Sep  5 21:04:08 2008
@@ -1398,12 +1398,12 @@
 
     // show the widgets
     gtk_widget_show (GTK_WIDGET (vbox));
-    gtk_widget_show (fs->con_hbox);
-    gtk_widget_show (fs->dir_indicator);
+    fs->update_concombo_visibility();
+    gtk_widget_show (fs->con_combo);
     gtk_widget_show (fs->root_btn);
-    gtk_widget_show (fs->scrolledwindow);
     gtk_widget_show (fs->vol_label);
-    gtk_widget_show (fs->con_combo);
+    gtk_widget_show (fs->dir_indicator);
+    gtk_widget_show (fs->scrolledwindow);
     gtk_widget_show (fs->list_widget);
     gtk_widget_show (fs->info_label);
 
@@ -2142,6 +2142,15 @@
 }
 
 
+void GnomeCmdFileSelector::update_concombo_visibility()
+{
+    if (gnome_cmd_data_get_concombo_visibility ())
+        gtk_widget_show (con_hbox);
+    else
+        gtk_widget_hide (con_hbox);
+}
+
+
 static void on_filter_box_close (GtkButton *btn, GnomeCmdFileSelector *fs)
 {
     if (!fs->priv->filter_box) return;

Modified: branches/gcmd-1-3/src/gnome-cmd-file-selector.h
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-selector.h	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-selector.h	Fri Sep  5 21:04:08 2008
@@ -95,6 +95,7 @@
     void update_style();
     void update_connections();
     void update_conbuttons_visibility();
+    void update_concombo_visibility();
 
     gboolean key_pressed(GdkEventKey *event);
 };

Modified: branches/gcmd-1-3/src/gnome-cmd-main-menu.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-main-menu.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-main-menu.cc	Fri Sep  5 21:04:08 2008
@@ -105,8 +105,9 @@
     GtkWidget *help_menu;
 
     GtkWidget *menu_edit_paste;
-    GtkWidget *menu_view_conbuttons;
     GtkWidget *menu_view_toolbar;
+    GtkWidget *menu_view_conbuttons;
+    GtkWidget *menu_view_concombo;
     GtkWidget *menu_view_buttonbar;
     GtkWidget *menu_view_cmdline;
     GtkWidget *menu_view_hidden_files;
@@ -617,14 +618,20 @@
         },
         MENUTYPE_SEPARATOR,
         {
+            MENU_TYPE_TOGGLEITEM, _("Show Toolbar"), "", NULL,
+            (gpointer) view_toolbar, NULL,
+            GNOME_APP_PIXMAP_NONE, NULL,
+            NULL
+        },
+        {
             MENU_TYPE_TOGGLEITEM, _("Show Device Buttons"), "", NULL,
             (gpointer) view_conbuttons, NULL,
             GNOME_APP_PIXMAP_NONE, NULL,
             NULL
         },
         {
-            MENU_TYPE_TOGGLEITEM, _("Show Toolbar"), "", NULL,
-            (gpointer) view_toolbar, NULL,
+            MENU_TYPE_TOGGLEITEM, _("Show Device List"), "", NULL,
+            (gpointer) view_concombo, NULL,
             GNOME_APP_PIXMAP_NONE, NULL,
             NULL
         },
@@ -821,21 +828,25 @@
     gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), main_menu->priv->help_menu);
 
     main_menu->priv->menu_edit_paste = edit_menu_uiinfo[2].widget;
-    main_menu->priv->menu_view_conbuttons = view_menu_uiinfo[4].widget;
-    main_menu->priv->menu_view_toolbar = view_menu_uiinfo[5].widget;
-    main_menu->priv->menu_view_cmdline = view_menu_uiinfo[6].widget;
-    main_menu->priv->menu_view_buttonbar = view_menu_uiinfo[7].widget;
-    main_menu->priv->menu_view_hidden_files = view_menu_uiinfo[9].widget;
-    main_menu->priv->menu_view_backup_files = view_menu_uiinfo[10].widget;
+    main_menu->priv->menu_view_toolbar = view_menu_uiinfo[4].widget;
+    main_menu->priv->menu_view_conbuttons = view_menu_uiinfo[5].widget;
+    main_menu->priv->menu_view_concombo = view_menu_uiinfo[6].widget;
+    main_menu->priv->menu_view_cmdline = view_menu_uiinfo[7].widget;
+    main_menu->priv->menu_view_buttonbar = view_menu_uiinfo[8].widget;
+    main_menu->priv->menu_view_hidden_files = view_menu_uiinfo[10].widget;
+    main_menu->priv->menu_view_backup_files = view_menu_uiinfo[11].widget;
     main_menu->priv->menu_view_back = view_menu_uiinfo[0].widget;
     main_menu->priv->menu_view_forward = view_menu_uiinfo[1].widget;
 
     gtk_check_menu_item_set_active (
+        GTK_CHECK_MENU_ITEM (main_menu->priv->menu_view_toolbar),
+        gnome_cmd_data_get_toolbar_visibility ());
+    gtk_check_menu_item_set_active (
         GTK_CHECK_MENU_ITEM (main_menu->priv->menu_view_conbuttons),
         gnome_cmd_data_get_conbuttons_visibility ());
     gtk_check_menu_item_set_active (
-        GTK_CHECK_MENU_ITEM (main_menu->priv->menu_view_toolbar),
-        gnome_cmd_data_get_toolbar_visibility ());
+        GTK_CHECK_MENU_ITEM (main_menu->priv->menu_view_concombo),
+        gnome_cmd_data_get_concombo_visibility ());
     gtk_check_menu_item_set_active (
         GTK_CHECK_MENU_ITEM (main_menu->priv->menu_view_buttonbar),
         gnome_cmd_data_get_buttonbar_visibility ());

Modified: branches/gcmd-1-3/src/gnome-cmd-user-actions.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-user-actions.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-user-actions.cc	Fri Sep  5 21:04:08 2008
@@ -1188,6 +1188,17 @@
 }
 
 
+void view_concombo (GtkMenuItem *menuitem, gpointer not_used)
+{
+    if (!GTK_WIDGET_REALIZED (main_win)) return;
+
+    GtkCheckMenuItem *checkitem = (GtkCheckMenuItem *) menuitem;
+    gnome_cmd_data_set_concombo_visibility (checkitem->active);
+    get_fs (ACTIVE)->update_concombo_visibility();
+    get_fs (INACTIVE)->update_concombo_visibility();
+}
+
+
 void view_toolbar (GtkMenuItem *menuitem, gpointer not_used)
 {
     if (!GTK_WIDGET_REALIZED (main_win)) return;

Modified: branches/gcmd-1-3/src/gnome-cmd-user-actions.h
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-user-actions.h	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-user-actions.h	Fri Sep  5 21:04:08 2008
@@ -267,6 +267,7 @@
 
 /************** View Menu **************/
 GNOME_CMD_USER_ACTION(view_conbuttons);
+GNOME_CMD_USER_ACTION(view_concombo);
 GNOME_CMD_USER_ACTION(view_toolbar);
 GNOME_CMD_USER_ACTION(view_buttonbar);
 GNOME_CMD_USER_ACTION(view_cmdline);



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