[gnome-control-center/wip/animated-notebook: 5/9] shell: Remove prior panel at the last minute
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/animated-notebook: 5/9] shell: Remove prior panel at the last minute
- Date: Mon, 30 Apr 2012 18:29:56 +0000 (UTC)
commit a38fb0fbd750e6e698dffd123ac9849d5e71c638
Author: Bastien Nocera <hadess hadess net>
Date: Mon Apr 30 17:07:36 2012 +0100
shell: Remove prior panel at the last minute
Once we've already switch to a new panel.
shell/gnome-control-center.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index 468ef71..699b489 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -927,17 +927,29 @@ _shell_set_active_panel_from_id (CcShell *shell,
if (!name)
{
+ gtk_container_remove (GTK_CONTAINER (priv->notebook), priv->current_panel);
+ priv->current_panel = NULL;
+ shell_set_current_notebook_widget (GTK_NOTEBOOK (priv->notebook),
+ priv->scrolled_window);
g_warning ("Could not find settings panel \"%s\"", start_id);
return FALSE;
}
else
{
- if (priv->current_panel)
- gtk_container_remove (GTK_CONTAINER (priv->notebook), priv->current_panel);
+ GtkWidget *old_panel;
+
+ old_panel = priv->current_panel;
priv->current_panel = NULL;
- activate_panel (GNOME_CONTROL_CENTER (shell), start_id, argv, desktop,
- name, gicon);
+ if (activate_panel (GNOME_CONTROL_CENTER (shell), start_id, argv, desktop,
+ name, gicon) == FALSE)
+ {
+ shell_set_current_notebook_widget (GTK_NOTEBOOK (priv->notebook),
+ priv->scrolled_window);
+ }
+
+ if (old_panel)
+ gtk_container_remove (GTK_CONTAINER (priv->notebook), old_panel);
g_free (name);
g_free (desktop);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]