From 7de18201a38fc8bee15e6ef162fb35d242e6d00b Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 20 Apr 2010 20:22:38 +0100 Subject: connection: Show a nice label when connecting to PA. --- src/mainwindow.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cc') diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 7a831e8..7ada1ca 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -73,7 +73,8 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("cardsVBox", cardsVBox); x->get_widget("streamsVBox", streamsVBox); @@ -85,6 +86,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("noRecsLabel", noRecsLabel); x->get_widget("noSinksLabel", noSinksLabel); x->get_widget("noSourcesLabel", noSourcesLabel); + x->get_widget("connectingLabel", connectingLabel); x->get_widget("sinkInputTypeComboBox", sinkInputTypeComboBox); x->get_widget("sourceOutputTypeComboBox", sourceOutputTypeComboBox); x->get_widget("sinkTypeComboBox", sinkTypeComboBox); @@ -106,6 +108,10 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSourceOutputTypeComboBoxChanged)); sinkTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSinkTypeComboBoxChanged)); sourceTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSourceTypeComboBoxChanged)); + + /* Hide first and show when we're connected */ + notebook->hide(); + connectingLabel->show(); } MainWindow* MainWindow::create() { @@ -720,6 +726,19 @@ gboolean idle_cb(gpointer data) { return FALSE; } +void MainWindow::setConnectionState(gboolean connected) { + if (m_connected != connected) { + m_connected = connected; + if (m_connected) { + connectingLabel->hide(); + notebook->show(); + } else { + notebook->hide(); + connectingLabel->show(); + } + } +} + void MainWindow::updateDeviceVisibility() { if (idle_source) -- cgit