[Xfce4-commits] <thunar-shares-plugin:master> Disable GuestAccess when is not available (Not hide it)
Daniel Morales
noreply at xfce.org
Tue Jan 26 20:58:01 CET 2010
Updating branch refs/heads/master
to 4401e0b51990f9bb79a0eb3092343115d8923de7 (commit)
from 1bf3590d83c9b452a5844cd4cce25dadbf6544fb (commit)
commit 4401e0b51990f9bb79a0eb3092343115d8923de7
Author: Daniel Morales <daniel at daniel.com.uy>
Date: Tue Jan 26 17:56:48 2010 -0200
Disable GuestAccess when is not available (Not hide it)
thunar-plugin/tsp-page.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/thunar-plugin/tsp-page.c b/thunar-plugin/tsp-page.c
index b8851c8..3e38389 100644
--- a/thunar-plugin/tsp-page.c
+++ b/thunar-plugin/tsp-page.c
@@ -99,6 +99,8 @@ struct _TspPage
gboolean can_guests;
gchar *share_name;
gchar *share_comment;
+
+ gboolean supports_guest;
};
/* implements the tsp_page_get_type() and tsp_page_register_type() functions */
@@ -132,7 +134,6 @@ tsp_page_init (TspPage *page)
GtkWidget *vbox1;
GtkWidget *hbox1;
GtkWidget *widget;
- gboolean guest_ok = FALSE;
/* Main container */
vbox1 = gtk_vbox_new (FALSE, 0);
@@ -222,9 +223,10 @@ tsp_page_init (TspPage *page)
gtk_widget_show_all (vbox1);
/* Check if guest access is supported */
- shares_supports_guest_ok (&guest_ok, NULL);
- if (!guest_ok){
- gtk_widget_hide (page->cb_share_guest);
+ shares_supports_guest_ok (&page->supports_guest, NULL);
+
+ if (!page->supports_guest){
+ gtk_widget_set_sensitive(page->cb_share_guest, FALSE);
}
}
@@ -549,7 +551,10 @@ tsp_page_sensibility (TspPage *tsp_page,
gtk_widget_set_sensitive (GTK_WIDGET (tsp_page->label_name), sens);
gtk_widget_set_sensitive (GTK_WIDGET (tsp_page->label_comments), sens);
gtk_widget_set_sensitive (GTK_WIDGET (tsp_page->label_comments), sens);
- gtk_widget_set_sensitive (GTK_WIDGET (tsp_page->cb_share_guest), sens);
+
+ if (tsp_page->supports_guest){
+ gtk_widget_set_sensitive (GTK_WIDGET (tsp_page->cb_share_guest), sens);
+ }
}
/* Checks if the settings of the current file has been changed */
More information about the Xfce4-commits
mailing list