summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-26 02:15:57 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-26 02:15:57 +0200
commitb373c000eae32604dbef3939b0108d1e56bb8a9d (patch)
tree4432628ab5b4afd4867fb57310d7da5e6a642664 /src
parentd98588b665da22e12d9a8f503748d97ea464bb84 (diff)
use fallback icon scheme for stream icons, too
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cc71
1 files changed, 36 insertions, 35 deletions
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<Gnome::Glade::Xml>& x) :
Gtk::Window(cobject),
@@ -184,7 +185,7 @@ void MainWindow::updateCard(const pa_card_info &info) {
w->profiles.push_back(std::pair<Glib::ustring,Glib::ustring>(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; i<info.n_ports; ++i) {
- port_priorities.insert(*info.ports[i]);
+ port_priorities.insert(*info.ports[i]);
}
w->ports.clear();
for (std::set<pa_sink_port_info>::iterator i = port_priorities.begin(); i != port_priorities.end(); ++i)
- w->ports.push_back(std::pair<Glib::ustring,Glib::ustring>(i->name, i->description));
+ w->ports.push_back(std::pair<Glib::ustring,Glib::ustring>(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<pa_source_port_info,source_port_prio_compare> 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; i<info.n_ports; ++i) {
- port_priorities.insert(*info.ports[i]);
+ port_priorities.insert(*info.ports[i]);
}
w->ports.clear();
for (std::set<pa_source_port_info>::iterator i = port_priorities.begin(); i != port_priorities.end(); ++i)
- w->ports.push_back(std::pair<Glib::ustring,Glib::ustring>(i->name, i->description));
+ w->ports.push_back(std::pair<Glib::ustring,Glib::ustring>(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) {