diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2015-03-20 11:41:13 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2015-03-22 14:58:26 +0300 |
commit | fb7ecef4b7a794934e1527b6682ecc0373f3ed00 (patch) | |
tree | ca586ee788cc64bd36f309bfe3c1d59550c2fd2b /settings | |
parent | dac971a610788daeddcd5c9eae2b365abbcb2b91 (diff) | |
download | ixfce4-power-manager-fb7ecef4b7a794934e1527b6682ecc0373f3ed00.tar.gz |
Settings: Select the device-id
When the device-id is selected after the window is open, switch
to the devices tab and select it.
Diffstat (limited to 'settings')
-rw-r--r-- | settings/xfpm-settings-app.c | 6 | ||||
-rw-r--r-- | settings/xfpm-settings.c | 28 | ||||
-rw-r--r-- | settings/xfpm-settings.h | 2 |
3 files changed, 36 insertions, 0 deletions
diff --git a/settings/xfpm-settings-app.c b/settings/xfpm-settings-app.c index a50f7f6f..cfbb5537 100644 --- a/settings/xfpm-settings-app.c +++ b/settings/xfpm-settings-app.c @@ -147,6 +147,12 @@ xfpm_settings_app_launch (GApplication *app) DBG("window already opened, presenting it"); gtk_window_present (GTK_WINDOW (windows->data)); gdk_notify_startup_complete (); + + if (priv->device_id != NULL) + { + xfpm_settings_show_device_id (priv->device_id); + } + return; } diff --git a/settings/xfpm-settings.c b/settings/xfpm-settings.c index a95e595c..30d56584 100644 --- a/settings/xfpm-settings.c +++ b/settings/xfpm-settings.c @@ -2387,3 +2387,31 @@ xfpm_settings_dialog_new (XfconfChannel *channel, gboolean auth_suspend, return dialog; } + +void +xfpm_settings_show_device_id (gchar *device_id) +{ + GtkTreeIter *device_iter; + + if (device_id == NULL) + return; + + gtk_widget_show (gtk_notebook_get_nth_page (GTK_NOTEBOOK (nt), devices_page_num)); + gtk_notebook_set_current_page (GTK_NOTEBOOK (nt), devices_page_num); + + DBG("device_id %s", device_id); + + device_iter = find_device_in_tree (device_id); + if (device_iter) + { + GtkTreeSelection *selection; + + DBG("device found"); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (sideview)); + + gtk_tree_selection_select_iter (selection, device_iter); + view_cursor_changed_cb (GTK_TREE_VIEW (sideview), NULL); + gtk_tree_iter_free (device_iter); + } +} diff --git a/settings/xfpm-settings.h b/settings/xfpm-settings.h index b063b8ce..1e5e1a15 100644 --- a/settings/xfpm-settings.h +++ b/settings/xfpm-settings.h @@ -39,4 +39,6 @@ GtkWidget *xfpm_settings_dialog_new (XfconfChannel *channel, Window id, gchar *device_id); +void xfpm_settings_show_device_id (gchar *device_id); + #endif /* __XFPM_SETTINGS_H */ |