summarylogtreecommitdiffstats
path: root/hide_properties.patch
blob: b609b221ec047bf771fd83eefa9664fd89696269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: hide "Properties" in users context menu
Author: Thaddäus Tintenfisch <thad.fisch@gmail.com>
Bug: https://bugs.launchpad.net/bugs/586080
Last-Update: 2014-03-07

--- a/src/users/callbacks.c
+++ b/src/users/callbacks.c
@@ -63,7 +63,7 @@
 }
 
 static void
-do_popup_menu (GtkTreeView *treeview, GdkEventButton *event)
+do_popup_menu (GtkTreeView *treeview, GdkEventButton *event, gint table)
 {
 	GtkTreeSelection *selection;
 	GtkUIManager *ui_manager;
@@ -91,6 +91,9 @@
 	gtk_widget_set_sensitive (gtk_ui_manager_get_widget (ui_manager, "/MainMenu/Delete"),
 				  cont > 0);
 
+	if (table == TABLE_USERS)
+		gtk_widget_hide (gtk_ui_manager_get_widget (ui_manager, "/MainMenu/Properties"));
+
 	gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
 			button, event_time);
 }
@@ -120,7 +123,7 @@
 
 			gtk_tree_path_free (path);
 
-			do_popup_menu (treeview, event);
+			do_popup_menu (treeview, event, table);
 		}
 
 		return TRUE;
@@ -136,7 +139,7 @@
 gboolean
 on_table_popup_menu (GtkTreeView *treeview, GtkWidget *popup)
 {
-	do_popup_menu (treeview, NULL);
+	do_popup_menu (treeview, NULL, -1);
 	return TRUE;
 }
 
@@ -158,6 +161,8 @@
 
 	if (table == TABLE_GROUPS)
 		on_group_settings_clicked (NULL, NULL);
+	else if (table == TABLE_USERS)
+		return; // do nothing
 }
 
 void