more intelligent initial page selection

git-svn-id: file:///home/lennart/svn/public/pavucontrol/trunk@80 c17c95f2-f111-0410-90bf-f30a9569010c
This commit is contained in:
Lennart Poettering 2008-05-15 23:07:40 +00:00
parent 386c8efd5a
commit fdd7a5220c
1 changed files with 12 additions and 3 deletions

View File

@ -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;
}