vinagre r322 - in trunk: . data src
- From: jwendell svn gnome org
- To: svn-commits-list gnome org
- Subject: vinagre r322 - in trunk: . data src
- Date: Wed, 7 May 2008 02:51:09 +0100 (BST)
Author: jwendell
Date: Wed May 7 01:51:09 2008
New Revision: 322
URL: http://svn.gnome.org/viewvc/vinagre?rev=322&view=rev
Log:
2008-05-06 Jonh Wendell <jwendell gnome org>
* lots of files: Closes #518351 â Don't show tabs when only one connection is open.
Modified:
trunk/ChangeLog
trunk/data/vinagre.schemas.in
trunk/src/vinagre-notebook.c
trunk/src/vinagre-notebook.h
trunk/src/vinagre-prefs.c
trunk/src/vinagre-tab.c
trunk/src/vinagre-window.c
Modified: trunk/data/vinagre.schemas.in
==============================================================================
--- trunk/data/vinagre.schemas.in (original)
+++ trunk/data/vinagre.schemas.in Wed May 7 01:51:09 2008
@@ -54,7 +54,7 @@
<applyto>/apps/vinagre/always_show_tabs</applyto>
<owner>vinagre</owner>
<type>bool</type>
- <default>true</default>
+ <default>false</default>
<locale name="C">
<short>Whether we should show tabs even when there is only one active connection</short>
<long>Set to "true" to always show the tabs. Setting to "false" will only show the tabs when there are more than one active connection.</long>
Modified: trunk/src/vinagre-notebook.c
==============================================================================
--- trunk/src/vinagre-notebook.c (original)
+++ trunk/src/vinagre-notebook.c Wed May 7 01:51:09 2008
@@ -28,6 +28,7 @@
#include "vinagre-notebook.h"
#include "vinagre-utils.h"
+#include "vinagre-prefs.h"
#define VINAGRE_NOTEBOOK_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), VINAGRE_TYPE_NOTEBOOK, VinagreNotebookPrivate))
@@ -55,13 +56,41 @@
return GTK_WIDGET (nb);
}
+void
+vinagre_notebook_show_hide_tabs (VinagreNotebook *nb)
+{
+ gboolean always;
+ gint n;
+
+ n = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb));
+
+ g_object_get (vinagre_prefs_get_default (),
+ "always-show-tabs", &always,
+ NULL);
+
+ gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nb),
+ (n > 1) || (always));
+}
+
static void
vinagre_notebook_init (VinagreNotebook *notebook)
{
notebook->priv = VINAGRE_NOTEBOOK_GET_PRIVATE (notebook);
gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), TRUE);
+
+ g_signal_connect (notebook,
+ "page-added",
+ G_CALLBACK (vinagre_notebook_show_hide_tabs),
+ NULL);
+ g_signal_connect (notebook,
+ "page-removed",
+ G_CALLBACK (vinagre_notebook_show_hide_tabs),
+ NULL);
+ g_signal_connect_swapped (vinagre_prefs_get_default (),
+ "notify::always-show-tabs",
+ G_CALLBACK (vinagre_notebook_show_hide_tabs),
+ notebook);
}
static void
Modified: trunk/src/vinagre-notebook.h
==============================================================================
--- trunk/src/vinagre-notebook.h (original)
+++ trunk/src/vinagre-notebook.h Wed May 7 01:51:09 2008
@@ -93,6 +93,7 @@
void vinagre_notebook_remove_all_tabs (VinagreNotebook *nb);
+void vinagre_notebook_show_hide_tabs (VinagreNotebook *nb);
G_END_DECLS
#endif /* __VINAGRE_NOTEBOOK_H__ */
Modified: trunk/src/vinagre-prefs.c
==============================================================================
--- trunk/src/vinagre-prefs.c (original)
+++ trunk/src/vinagre-prefs.c Wed May 7 01:51:09 2008
@@ -230,7 +230,7 @@
g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_SHARED_FLAG, TRUE));
break;
case PROP_ALWAYS_SHOW_TABS:
- g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_ALWAYS_SHOW_TABS, TRUE));
+ g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_ALWAYS_SHOW_TABS, FALSE));
break;
case PROP_TOOLBAR_VISIBLE:
g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_TOOLBAR_VISIBLE, TRUE));
@@ -283,7 +283,7 @@
g_param_spec_boolean ("always-show-tabs",
"Always show tabs",
"Whether we should show the tabs even when there is ony one active connection",
- TRUE,
+ FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_TOOLBAR_VISIBLE,
Modified: trunk/src/vinagre-tab.c
==============================================================================
--- trunk/src/vinagre-tab.c (original)
+++ trunk/src/vinagre-tab.c Wed May 7 01:51:09 2008
@@ -112,6 +112,7 @@
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (tab->priv->scroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
+ vinagre_notebook_show_hide_tabs (tab->priv->nb);
}
return FALSE;
Modified: trunk/src/vinagre-window.c
==============================================================================
--- trunk/src/vinagre-window.c (original)
+++ trunk/src/vinagre-window.c Wed May 7 01:51:09 2008
@@ -124,7 +124,7 @@
if (window->priv->statusbar_visible)
gtk_widget_show_all (window->priv->statusbar);
- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->priv->notebook), TRUE);
+ vinagre_notebook_show_hide_tabs (VINAGRE_NOTEBOOK (window->priv->notebook));
gtk_notebook_set_show_border (GTK_NOTEBOOK (window->priv->notebook), TRUE);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]