Commit 3e35dc69 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Remove some unused glade stuff. Fix some warnings. Until we add support to


2008-03-31  William Jon McCann  <jmccann@redhat.com>

	* gui/user-switch-applet/Makefile.am:
	* gui/user-switch-applet/gdm-user-switch-applet.glade:
	Remove some unused glade stuff.
	* gui/user-switch-applet/gdm-user-menu-item.c: (reset_sensitivity),
	(on_user_icon_changed):
	Fix some warnings.
	* gui/user-switch-applet/applet.c: (user_sessions_changed_cb),
	(maybe_add_user), (manager_user_added_cb), (fill_applet):
	Until we add support to GDM for preselecting the user during
	FUS we should only display the currently logged in users in the applet.


svn path=/trunk/; revision=6082
parent fdbecd5d
2008-03-31 William Jon McCann <jmccann@redhat.com>
* gui/user-switch-applet/Makefile.am:
* gui/user-switch-applet/gdm-user-switch-applet.glade:
Remove some unused glade stuff.
* gui/user-switch-applet/gdm-user-menu-item.c: (reset_sensitivity),
(on_user_icon_changed):
Fix some warnings.
* gui/user-switch-applet/applet.c: (user_sessions_changed_cb),
(maybe_add_user), (manager_user_added_cb), (fill_applet):
Until we add support to GDM for preselecting the user during
FUS we should only display the currently logged in users in the applet.
2008-03-27 Brian Cameron <brian.cameron@sun.com>
* daemon/gdm-session-linux-auditor.[ch],
......
......@@ -8,7 +8,7 @@ INCLUDES = \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBLOCALEDIR=\""$(prefix)/lib/locale"\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DGLADEDIR=\""$(pkgdatadir)"\" \
-DGLADEDIR=\""$(pkgdatadir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DSBINDIR=\""$(sbindir)"\" \
$(GTK_CFLAGS) \
......@@ -31,11 +31,6 @@ gdm_user_switch_applet_LDADD = \
$(APPLET_LIBS) \
$(NULL)
gladedir = $(pkgdatadir)
glade_DATA = \
gdm-user-switch-applet.glade \
$(NULL)
# Bonobo UI
uidir = $(datadir)/gnome-2.0/ui
ui_DATA = \
......@@ -55,7 +50,6 @@ $(server_in_files): $(server_in_files:.server.in=.server.in.in)
@INTLTOOL_SERVER_RULE@
EXTRA_DIST = \
$(glade_DATA) \
$(ui_DATA) \
GNOME_FastUserSwitchApplet.server.in.in \
$(NULL)
......
......@@ -60,6 +60,8 @@ typedef struct _GdmAppletData
GtkWidget *login_screen_item;
GSList *items;
gboolean active_only;
guint client_notify_lockdown_id;
guint user_notify_id;
GQuark user_menu_item_quark;
......@@ -104,33 +106,6 @@ about_me_cb (BonoboUIComponent *ui_container,
}
}
static GladeXML *
get_glade_xml (const char *root)
{
GladeXML *xml;
xml = glade_xml_new (GLADEDIR "/gdm-user-switch-applet.glade", root, NULL);
if (xml == NULL) {
GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL,
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_("Missing Required File"));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("The User Selector's interfaces file, `%s', could not be opened. It is likely that this application was not properly installed or configured."),
GLADEDIR "/gdm-user-switch-applet.glade");
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
bonobo_main_quit ();
return NULL;
}
return xml;
}
/*
* gnome-panel/applets/wncklet/window-menu.c:window_filter_button_press()
*
......@@ -855,12 +830,27 @@ user_sessions_changed_cb (GdmUser *user,
{
GtkWidget *menuitem;
g_debug ("Sessions changed for %s", gdm_user_get_user_name (user));
menuitem = g_object_get_qdata (G_OBJECT (user), adata->user_menu_item_quark);
if (menuitem == NULL) {
return;
}
gtk_widget_show (menuitem);
if (adata->active_only) {
guint num_sessions;
num_sessions = gdm_user_get_num_sessions (user);
g_debug ("Sessions changed for %s num=%u", gdm_user_get_user_name (user), num_sessions);
if (num_sessions > 0) {
gtk_widget_show (menuitem);
} else {
gtk_widget_hide (menuitem);
}
} else {
gtk_widget_show (menuitem);
}
sort_menu (adata);
}
......@@ -896,13 +886,32 @@ add_user (GdmAppletData *adata,
adata);
}
static gboolean
maybe_add_user (GdmAppletData *adata,
GdmUser *user)
{
if (adata->active_only) {
guint num_sessions;
num_sessions = gdm_user_get_num_sessions (user);
if (num_sessions < 1) {
return FALSE;
}
}
add_user (adata, user);
return TRUE;
}
static void
manager_user_added_cb (GdmUserManager *manager,
GdmUser *user,
GdmAppletData *adata)
{
add_user (adata, user);
sort_menu (adata);
if (maybe_add_user (adata, user)) {
sort_menu (adata);
}
}
static void
......@@ -983,6 +992,9 @@ fill_applet (PanelApplet *applet)
adata = g_new0 (GdmAppletData, 1);
adata->applet = applet;
/* Until we add user selecting to GDM */
adata->active_only = TRUE;
adata->client = gconf_client_get_default ();
adata->manager = gdm_user_manager_ref_default ();
......@@ -1127,7 +1139,7 @@ fill_applet (PanelApplet *applet)
*/
users = gdm_user_manager_list_users (adata->manager);
while (users != NULL) {
add_user (adata, users->data);
maybe_add_user (adata, users->data);
users = g_slist_delete_link (users, users);
}
......
......@@ -105,9 +105,10 @@ reset_sensitivity (GdmUserMenuItem *item)
}
if (gdm_user_get_uid (item->user) == getuid ()) {
gtk_widget_set_sensitive (item, (gdm_user_get_num_sessions (item->user) > 1));
gtk_widget_set_sensitive (GTK_WIDGET (item),
(gdm_user_get_num_sessions (item->user) > 1));
} else {
gtk_widget_set_sensitive (item, TRUE);
gtk_widget_set_sensitive (GTK_WIDGET(item), TRUE);
}
}
......@@ -131,7 +132,7 @@ static void
on_user_icon_changed (GdmUser *user,
GdmUserMenuItem *item)
{
if (gtk_widget_has_screen (item)) {
if (gtk_widget_has_screen (GTK_WIDGET (item))) {
reset_icon (item);
}
}
......
This diff is collapsed.
2008-03-31 William Jon McCann <jmccann@redhat.com>
* POTFILES.in: Removed file.
2008-03-27 Kjartan Maraas <kmaraas@gnome.org>
* nb.po: Updated Norwegian bokmål translation.
......
......@@ -75,7 +75,6 @@ gui/simple-greeter/gdm-user-chooser-widget.c
gui/simple-greeter/greeter-main.c
gui/user-switch-applet/applet.c
gui/user-switch-applet/gdm-user-menu-item.c
gui/user-switch-applet/gdm-user-switch-applet.glade
gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
utils/gdmflexiserver.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment