summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <cguthrie@mandriva.org>2009-10-03 10:58:38 +0100
committerColin Guthrie <cguthrie@mandriva.org>2009-10-03 10:58:38 +0100
commit7d59faee21b2cad60245efc9461991e8c73e2e22 (patch)
tree39f0ac0e865f5c957dee779fa2a2d286696782e5
parent9f594acc825a4f1e76d972f8233603bc0b6413dc (diff)
packagekit: Tidy up packagekit UI integration code
-rw-r--r--src/paprefs.cc49
1 files changed, 15 insertions, 34 deletions
diff --git a/src/paprefs.cc b/src/paprefs.cc
index 0e4cf83..f711e17 100644
--- a/src/paprefs.cc
+++ b/src/paprefs.cc
@@ -104,6 +104,7 @@ public:
void onGConfChange(const Glib::ustring& key, const Gnome::Conf::Value& value);
+ void showInstallButton(Gtk::Button *button, bool available);
void installFiles(const char *a, const char *b);
bool
@@ -217,40 +218,13 @@ void MainWindow::updateSensitive() {
upnpMediaServerCheckButton->set_sensitive(upnpAvailable);
upnpNullSinkCheckButton->set_sensitive(upnpAvailable && upnpMediaServerCheckButton->get_active());
- if (zeroconfDiscoverAvailable)
- zeroconfDiscoverInstallButton->hide();
- else
- zeroconfDiscoverInstallButton->show();
-
- if (zeroconfRaopDiscoverAvailable)
- zeroconfRaopDiscoverInstallButton->hide();
- else
- zeroconfRaopDiscoverInstallButton->show();
-
- if (remoteAvailable)
- remoteInstallButton->hide();
- else
- remoteInstallButton->show();
-
- if (zeroconfPublishAvailable)
- zeroconfPublishInstallButton->hide();
- else
- zeroconfPublishInstallButton->show();
-
- if (upnpAvailable)
- upnpInstallButton->hide();
- else
- upnpInstallButton->show();
-
- if (rtpRecvAvailable)
- rtpRecvInstallButton->hide();
- else
- rtpRecvInstallButton->show();
-
- if (rtpSendAvailable)
- rtpSendInstallButton->hide();
- else
- rtpSendInstallButton->show();
+ showInstallButton(zeroconfDiscoverInstallButton, zeroconfDiscoverAvailable);
+ showInstallButton(zeroconfRaopDiscoverInstallButton, zeroconfRaopDiscoverAvailable);
+ showInstallButton(remoteInstallButton, remoteAvailable);
+ showInstallButton(zeroconfPublishInstallButton, zeroconfPublishAvailable);
+ showInstallButton(upnpInstallButton, upnpAvailable);
+ showInstallButton(rtpRecvInstallButton, rtpRecvAvailable);
+ showInstallButton(rtpSendInstallButton, rtpSendAvailable);
}
void MainWindow::onChangeRemoteAccess() {
@@ -313,6 +287,13 @@ void MainWindow::onChangeUpnp() {
writeToGConfUPnP();
}
+void MainWindow::showInstallButton(Gtk::Button *button, bool available) {
+ if (available)
+ button->hide();
+ else
+ button->show();
+}
+
void MainWindow::installFiles(const char *a, const char *b = NULL) {
DBusGConnection *connection;
DBusGProxy *proxy;