[gnome-system-tools: 37/39] Merge branch 'users-ui-redesign'



commit 4a29483a4f8b8caba943f4b3bc0ef96275d3e091
Merge: 00c6880... 2e15455...
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Mon Nov 30 22:23:26 2009 +0100

    Merge branch 'users-ui-redesign'
    
    Conflicts:
    	src/services/callbacks.c
    	src/users/users-tool.c

 configure.in                 |    2 +
 interfaces/users.ui          | 2991 +++++++++++++++++++++++++-----------------
 src/common/gst-dialog.c      |   32 +-
 src/common/gst-dialog.h      |    3 +-
 src/common/gst-tool.c        |   16 +-
 src/common/gst-tool.h        |    1 +
 src/services/services-tool.c |    9 +-
 src/users/callbacks.c        |  184 +---
 src/users/group-settings.c   |    3 +-
 src/users/groups-table.c     |    6 +
 src/users/main.c             |   41 +-
 src/users/table.c            |  145 ++-
 src/users/user-profiles.c    |  245 +++-
 src/users/user-profiles.h    |   21 +-
 src/users/user-settings.c    |  854 ++++++++++---
 src/users/user-settings.h    |   11 +-
 src/users/users-table.c      |  160 ++-
 src/users/users-table.h      |   33 +-
 src/users/users-tool.c       |   52 +-
 src/users/users-tool.h       |    2 +
 20 files changed, 3056 insertions(+), 1755 deletions(-)
---
diff --cc src/users/users-tool.c
index f1f20ea,1734ae4..424e168
--- a/src/users/users-tool.c
+++ b/src/users/users-tool.c
@@@ -176,35 -173,48 +173,69 @@@ update_groups (GstUsersTool *tool
  static void
  update_profiles (GstUsersTool *tool)
  {
- 	GList *names = NULL;
+ 	GList *list, *l;
+ 	GtkWidget *label1, *label2, *button;
+ 	GstUserProfile *profile;
+ 	int max_len, len;
+ 
+ 	list = gst_user_profiles_get_list (tool->profiles);
+ 	table_populate_profiles (tool, list);
+ 
+ 	/* Hide profiles line in main dialog if only one profile is available */
+ 	label1 = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog,
+ 	                                "user_settings_profile");
+ 	label2 = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog,
+ 	                                "user_settings_profile_label");
+ 	button = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog,
+ 	                                "edit_user_profile_button");
+ 
+ 	if (g_list_length (list) > 1) {
+ 		gtk_widget_show (label1);
+ 		gtk_widget_show (label2);
+ 		gtk_widget_show (button);
+ 	}
+ 	else {
+ 		gtk_widget_hide (label1);
+ 		gtk_widget_hide (label2);
+ 		gtk_widget_hide (button);
+ 		return;
+ 	}
+ 
+ 	/* use the length of the longest profile name to avoid resizing
+ 	 * the label and moving widgets around */
+ 	max_len = 0;
+ 	for (l = list; l; l = l->next) {
+ 		profile = l->data;
+ 		len = g_utf8_strlen (profile->name, -1);
+ 		if (len > max_len)
+ 			max_len = len;
+ 	}
  
- 	names = gst_user_profiles_get_names (tool->profiles);
- 	table_populate_profiles (tool, names);
- 	g_list_free (names);
+ 	gtk_label_set_width_chars (GTK_LABEL (label1), max_len);
  }
  
 +static void
 +update_shells (GstUsersTool *tool)
 +{
 +	GtkWidget *combo;
 +	GtkTreeModel *model;
 +	GList *shells;
 +	GtkTreeIter iter;
 +
 +	combo = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "user_settings_shell");
 +	model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
 +	shells = oobs_users_config_get_available_shells (OOBS_USERS_CONFIG (tool->users_config));
 +
 +	while (shells) {
 +		gtk_list_store_append (GTK_LIST_STORE (model), &iter);
 +		gtk_list_store_set (GTK_LIST_STORE (model), &iter,
 +				    0, shells->data,
 +				    -1);
 +		shells = shells->next;
 +	}
 +}
 +
- static void
+ void
  gst_users_tool_update_gui (GstTool *tool)
  {
  	update_users (GST_USERS_TOOL (tool));



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