[gnome-control-center] shell: Handle non-existant panels more gracefully
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] shell: Handle non-existant panels more gracefully
- Date: Wed, 20 Jun 2012 18:17:42 +0000 (UTC)
commit fd3afa8d4f64d942f2da42fde7504dbd519a2ce1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jun 12 17:53:08 2012 -0400
shell: Handle non-existant panels more gracefully
If we're at the overview screen and try to launch a non-existant panel,
we shouldn't remove the scroll view.
https://bugzilla.gnome.org/show_bug.cgi?id=677980
shell/gnome-control-center.c | 40 +++++++++++++++-------------------------
1 files changed, 15 insertions(+), 25 deletions(-)
---
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index dee3f2c..fa15d6c 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -895,9 +895,10 @@ _shell_set_active_panel_from_id (CcShell *shell,
GtkTreeIter iter;
gboolean iter_valid;
gchar *name = NULL;
- gchar *desktop;
- GIcon *gicon;
+ gchar *desktop = NULL;
+ GIcon *gicon = NULL;
GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv;
+ GtkWidget *old_panel;
/* clear any custom widgets */
_shell_remove_all_custom_widgets (priv);
@@ -932,6 +933,8 @@ _shell_set_active_panel_from_id (CcShell *shell,
name = NULL;
id = NULL;
+ desktop = NULL;
+ gicon = NULL;
}
iter_valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store),
@@ -940,38 +943,25 @@ _shell_set_active_panel_from_id (CcShell *shell,
if (!name)
{
- cc_notebook_remove_page (CC_NOTEBOOK (priv->notebook), priv->current_panel);
- priv->current_panel = NULL;
- cc_notebook_select_page (CC_NOTEBOOK (priv->notebook),
- priv->scrolled_window,
- TRUE);
g_warning ("Could not find settings panel \"%s\"", start_id);
- return FALSE;
}
- else
+ else if (activate_panel (GNOME_CONTROL_CENTER (shell), start_id, argv, desktop,
+ name, gicon) == FALSE)
{
- GtkWidget *old_panel;
-
old_panel = priv->current_panel;
priv->current_panel = NULL;
-
- if (activate_panel (GNOME_CONTROL_CENTER (shell), start_id, argv, desktop,
- name, gicon) == FALSE)
- {
- cc_notebook_select_page (CC_NOTEBOOK (priv->notebook),
- priv->scrolled_window, TRUE);
- }
-
+ cc_notebook_select_page (CC_NOTEBOOK (priv->notebook),
+ priv->scrolled_window, TRUE);
if (old_panel)
cc_notebook_remove_page (CC_NOTEBOOK (priv->notebook), old_panel);
+ }
- g_free (name);
- g_free (desktop);
- if (gicon)
- g_object_unref (gicon);
+ g_free (name);
+ g_free (desktop);
+ if (gicon)
+ g_object_unref (gicon);
- return TRUE;
- }
+ return TRUE;
}
static GtkWidget *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]