shell: Move helper functions
This commit is contained in:
parent
e01e33e76e
commit
43b53020ca
1 changed files with 30 additions and 30 deletions
|
@ -109,6 +109,36 @@ get_icon_name_from_g_icon (GIcon *gicon)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
shell_set_current_notebook_widget (GtkNotebook *notebook,
|
||||||
|
GtkWidget *child)
|
||||||
|
{
|
||||||
|
int num_pages, i;
|
||||||
|
|
||||||
|
num_pages = gtk_notebook_get_n_pages (notebook);
|
||||||
|
for (i = 0; i < num_pages; i++)
|
||||||
|
{
|
||||||
|
GtkWidget *widget;
|
||||||
|
|
||||||
|
widget = gtk_notebook_get_nth_page (notebook, i);
|
||||||
|
if (widget == child)
|
||||||
|
{
|
||||||
|
gtk_notebook_set_current_page (notebook, i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static GtkWidget *
|
||||||
|
shell_get_current_notebook_widget (GtkNotebook *notebook)
|
||||||
|
{
|
||||||
|
int current_page;
|
||||||
|
|
||||||
|
current_page = gtk_notebook_get_current_page (notebook);
|
||||||
|
g_assert (current_page >= 0);
|
||||||
|
return gtk_notebook_get_nth_page (notebook, current_page);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
activate_panel (GnomeControlCenter *shell,
|
activate_panel (GnomeControlCenter *shell,
|
||||||
const gchar *id,
|
const gchar *id,
|
||||||
|
@ -202,36 +232,6 @@ _shell_remove_all_custom_widgets (GnomeControlCenterPrivate *priv)
|
||||||
g_ptr_array_set_size (priv->custom_widgets, 0);
|
g_ptr_array_set_size (priv->custom_widgets, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
shell_set_current_notebook_widget (GtkNotebook *notebook,
|
|
||||||
GtkWidget *child)
|
|
||||||
{
|
|
||||||
int num_pages, i;
|
|
||||||
|
|
||||||
num_pages = gtk_notebook_get_n_pages (notebook);
|
|
||||||
for (i = 0; i < num_pages; i++)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = gtk_notebook_get_nth_page (notebook, i);
|
|
||||||
if (widget == child)
|
|
||||||
{
|
|
||||||
gtk_notebook_set_current_page (notebook, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
|
||||||
shell_get_current_notebook_widget (GtkNotebook *notebook)
|
|
||||||
{
|
|
||||||
int current_page;
|
|
||||||
|
|
||||||
current_page = gtk_notebook_get_current_page (notebook);
|
|
||||||
g_assert (current_page >= 0);
|
|
||||||
return gtk_notebook_get_nth_page (notebook, current_page);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
shell_show_overview_page (GnomeControlCenterPrivate *priv)
|
shell_show_overview_page (GnomeControlCenterPrivate *priv)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue