summaryrefslogtreecommitdiff
path: root/endless
diff options
context:
space:
mode:
authorMatt Watson <mattdangerw@gmail.com>2013-06-04 17:09:22 -0700
committerMatt Watson <mattdangerw@gmail.com>2013-06-10 13:38:01 -0700
commit799c49aa4a564e9135b93a435bc8e7f7f5047708 (patch)
tree82a090bee5b52cfb1eea3581a21a02025fbf4b2e /endless
parentff976f3f6031439d473fd7c60a09a26c0f2b0e71 (diff)
visible-page property update if visible page is removed
Before the visible page would be set to null if it was removed, instead of pointing to another page in the page manager. Also signals for property changes were not emitted. [endlessm/eos-sdk#101]
Diffstat (limited to 'endless')
-rw-r--r--endless/eospagemanager.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/endless/eospagemanager.c b/endless/eospagemanager.c
index 2db0975..e066f84 100644
--- a/endless/eospagemanager.c
+++ b/endless/eospagemanager.c
@@ -462,9 +462,21 @@ eos_page_manager_remove (GtkContainer *container,
if (info->name != NULL)
g_hash_table_remove (self->priv->pages_by_name, info->name);
- /* If this was the only page */
if (self->priv->visible_page_info == info)
- self->priv->visible_page_info = NULL;
+ {
+ /* If this was the only page */
+ if (self->priv->page_info == NULL)
+ {
+ self->priv->visible_page_info = NULL;
+ }
+ /* Otherwise set visible page as the first in our list. */
+ else
+ {
+ EosPageManagerPageInfo *visible_info = g_list_first (self->priv->page_info)->data;
+ set_visible_page_from_info (self, visible_info);
+ }
+
+ }
page_info_free (info);