diff options
author | waker <wakeroid@gmail.com> | 2012-05-30 22:41:55 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-05-30 22:41:55 +0200 |
commit | 98a2f36916af7039f73f7ad071ad3daac0d2e414 (patch) | |
tree | 92c3bbc8720977639a20cfaeaf84b7be206f4d6a /plugins/gtkui | |
parent | 4c328e5564058757d993e109406baacfdcd97414 (diff) |
gtkui: fixed dsp plugin selection on init in prefwin
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/dspconfig.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/gtkui/dspconfig.c b/plugins/gtkui/dspconfig.c index 95767284..adb95f84 100644 --- a/plugins/gtkui/dspconfig.c +++ b/plugins/gtkui/dspconfig.c @@ -142,6 +142,9 @@ dsp_setup_init (GtkWidget *_prefwin) { gtk_tree_view_set_model (GTK_TREE_VIEW (listview), GTK_TREE_MODEL (mdl)); fill_dsp_chain (mdl); + GtkTreePath *path = gtk_tree_path_new_from_indices (0, -1); + gtk_tree_view_set_cursor (GTK_TREE_VIEW (listview), path, NULL, FALSE); + gtk_tree_path_free (path); GtkWidget *combobox = lookup_widget (prefwin, "dsp_preset"); dsp_fill_preset_list (combobox); @@ -234,9 +237,9 @@ listview_get_index (GtkWidget *list) { GtkTreePath *path; GtkTreeViewColumn *col; gtk_tree_view_get_cursor (GTK_TREE_VIEW (list), &path, &col); - if (!path || !col) { + if (!path) { // nothing selected - return - 1; + return -1; } int *indices = gtk_tree_path_get_indices (path); int idx = *indices; @@ -305,16 +308,7 @@ on_dsp_configure_clicked (GtkButton *button, gpointer user_data) { GtkWidget *list = lookup_widget (prefwin, "dsp_listview"); - GtkTreePath *path; - GtkTreeViewColumn *col; - gtk_tree_view_get_cursor (GTK_TREE_VIEW (list), &path, &col); - if (!path || !col) { - // nothing selected - return; - } - int *indices = gtk_tree_path_get_indices (path); - int idx = *indices; - g_free (indices); + int idx = listview_get_index (list); if (idx == -1) { return; } |