summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-05-15 23:07:40 +0000
committerLennart Poettering <lennart@poettering.net>2008-05-15 23:07:40 +0000
commitfdd7a5220cd191b18b9baa8f793a3187c2e4021b (patch)
tree2cee5456fedfde59fc5cea46e8122aa01da08879
parent386c8efd5a8781899ea52e85f8dbe3b0844c102d (diff)
more intelligent initial page selection
git-svn-id: file:///home/lennart/svn/public/pavucontrol/trunk@80 c17c95f2-f111-0410-90bf-f30a9569010c
-rw-r--r--src/pavucontrol.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc
index b378507..7ada05f 100644
--- a/src/pavucontrol.cc
+++ b/src/pavucontrol.cc
@@ -1254,9 +1254,6 @@ void sink_input_cb(pa_context *, const pa_sink_input_info *i, int eol, void *use
MainWindow *w = static_cast<MainWindow*>(userdata);
if (eol) {
- if (w->sinkInputWidgets.size() <= 0)
- w->notebook->set_current_page(2);
-
dec_outstanding(w);
return;
}
@@ -1273,6 +1270,18 @@ void source_output_cb(pa_context *, const pa_source_output_info *i, int eol, voi
MainWindow *w = static_cast<MainWindow*>(userdata);
if (eol) {
+ /* At this point all notebook pages have been populated, so
+ * let's open one that isn't empty */
+
+ if (w->sinkInputWidgets.size() > 0)
+ w->notebook->set_current_page(0);
+ else if (w->sourceOutputWidgets.size() > 0)
+ w->notebook->set_current_page(1);
+ else if (w->sourceWidgets.size() > 0 && w->sinkWidgets.size() == 0)
+ w->notebook->set_current_page(3);
+ else
+ w->notebook->set_current_page(2);
+
dec_outstanding(w);
return;
}