From b373c000eae32604dbef3939b0108d1e56bb8a9d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Aug 2009 02:15:57 +0200 Subject: use fallback icon scheme for stream icons, too --- src/mainwindow.cc | 71 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cc b/src/mainwindow.cc index b1f33df..3867237 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -37,33 +37,34 @@ /* Used for profile sorting */ struct profile_prio_compare { - bool operator() (const pa_card_profile_info& lhs, const pa_card_profile_info& rhs) const { - - if (lhs.priority == rhs.priority) - return strcmp(lhs.name, rhs.name) > 0; - - return lhs.priority > rhs.priority; - } + bool operator() (const pa_card_profile_info& lhs, const pa_card_profile_info& rhs) const { + + if (lhs.priority == rhs.priority) + return strcmp(lhs.name, rhs.name) > 0; + + return lhs.priority > rhs.priority; + } }; + struct sink_port_prio_compare { - bool operator() (const pa_sink_port_info& lhs, const pa_sink_port_info& rhs) const { - - if (lhs.priority == rhs.priority) - return strcmp(lhs.name, rhs.name) > 0; - - return lhs.priority > rhs.priority; - } + bool operator() (const pa_sink_port_info& lhs, const pa_sink_port_info& rhs) const { + + if (lhs.priority == rhs.priority) + return strcmp(lhs.name, rhs.name) > 0; + + return lhs.priority > rhs.priority; + } }; + struct source_port_prio_compare { - bool operator() (const pa_source_port_info& lhs, const pa_source_port_info& rhs) const { - - if (lhs.priority == rhs.priority) - return strcmp(lhs.name, rhs.name) > 0; - - return lhs.priority > rhs.priority; - } -}; + bool operator() (const pa_source_port_info& lhs, const pa_source_port_info& rhs) const { + + if (lhs.priority == rhs.priority) + return strcmp(lhs.name, rhs.name) > 0; + return lhs.priority > rhs.priority; + } +}; MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr& x) : Gtk::Window(cobject), @@ -184,7 +185,7 @@ void MainWindow::updateCard(const pa_card_info &info) { w->profiles.push_back(std::pair(i->name, i->description)); w->activeProfile = info.active_profile ? info.active_profile->name : ""; - + w->updating = false; w->prepareMenu(); @@ -236,12 +237,12 @@ void MainWindow::updateSink(const pa_sink_info &info) { port_priorities.clear(); for (uint32_t i=0; iports.clear(); for (std::set::iterator i = port_priorities.begin(); i != port_priorities.end(); ++i) - w->ports.push_back(std::pair(i->name, i->description)); + w->ports.push_back(std::pair(i->name, i->description)); w->activePort = info.active_port ? info.active_port->name : ""; @@ -359,7 +360,7 @@ void MainWindow::updateSource(const pa_source_info &info) { bool is_new = false; const char *icon; std::set port_priorities; - + if (sourceWidgets.count(info.index)) w = sourceWidgets[info.index]; else { @@ -398,12 +399,12 @@ void MainWindow::updateSource(const pa_source_info &info) { port_priorities.clear(); for (uint32_t i=0; iports.clear(); for (std::set::iterator i = port_priorities.begin(); i != port_priorities.end(); ++i) - w->ports.push_back(std::pair(i->name, i->description)); + w->ports.push_back(std::pair(i->name, i->description)); w->activePort = info.active_port ? info.active_port->name : ""; @@ -453,7 +454,7 @@ void MainWindow::setIconFromProplist(Gtk::Image *icon, pa_proplist *l, const cha finish: - icon->set_from_icon_name(t, Gtk::ICON_SIZE_SMALL_TOOLBAR); + set_icon_name_fallback(icon, t, Gtk::ICON_SIZE_SMALL_TOOLBAR); } void MainWindow::updateSinkInput(const pa_sink_input_info &info) { @@ -721,8 +722,8 @@ void MainWindow::reallyUpdateDeviceVisibility() { w->directionLabel->show(); w->deviceButton->show(); } else { - w->directionLabel->hide(); - w->deviceButton->hide(); + w->directionLabel->hide(); + w->deviceButton->hide(); } if (showSinkInputType == SINK_INPUT_ALL || w->type == showSinkInputType) { @@ -746,11 +747,11 @@ void MainWindow::reallyUpdateDeviceVisibility() { SourceOutputWidget* w = i->second; if (sourceWidgets.size() > 1) { - w->directionLabel->show(); - w->deviceButton->show(); + w->directionLabel->show(); + w->deviceButton->show(); } else { - w->directionLabel->hide(); - w->deviceButton->hide(); + w->directionLabel->hide(); + w->deviceButton->hide(); } if (showSourceOutputType == SOURCE_OUTPUT_ALL || w->type == showSourceOutputType) { -- cgit