use fallback icon scheme for stream icons, too

This commit is contained in:
Lennart Poettering 2009-08-26 02:15:57 +02:00
parent d98588b665
commit b373c000ea
1 changed files with 39 additions and 38 deletions

View File

@ -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;
}
};
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;
}
};
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_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;
}
};
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;
}
};
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) {