┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-11-09 18:13:36 +0000
committerPeter Penz <[email protected]>2009-11-09 18:13:36 +0000
commit232e7eaad76cc027341a6d927ebb905312c4ff4c (patch)
treef484a6eb2e1a98c6d243a03818a1708068d4f842 /src/settings
parent7ff8c0d89aecc356d66b2aed25804b5ff22fbff9 (diff)
move the "Download New Services..." entry from the Settings menu to the service configuration dialog
svn path=/trunk/KDE/kdebase/apps/; revision=1046788
Diffstat (limited to 'src/settings')
-rw-r--r--src/settings/servicessettingspage.cpp16
-rw-r--r--src/settings/servicessettingspage.h9
2 files changed, 25 insertions, 0 deletions
diff --git a/src/settings/servicessettingspage.cpp b/src/settings/servicessettingspage.cpp
index a58df2096..9088366a8 100644
--- a/src/settings/servicessettingspage.cpp
+++ b/src/settings/servicessettingspage.cpp
@@ -24,6 +24,7 @@
#include <kdesktopfileactions.h>
#include <kicon.h>
#include <klocale.h>
+#include <knewstuff2/engine.h>
#include <kservice.h>
#include <kservicetypetrader.h>
#include <kstandarddirs.h>
@@ -31,6 +32,7 @@
#include <QEvent>
#include <QLabel>
#include <QListWidget>
+#include <QPushButton>
#include <QVBoxLayout>
ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
@@ -43,6 +45,7 @@ ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
QLabel* label = new QLabel(i18nc("@label:textbox",
"Configure which services should "
"be shown in the context menu."), this);
+ label->setWordWrap(true);
m_servicesList = new QListWidget(this);
m_servicesList->setSortingEnabled(true);
@@ -50,8 +53,13 @@ ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
connect(m_servicesList, SIGNAL(itemClicked(QListWidgetItem*)),
this, SIGNAL(changed()));
+ QPushButton* downloadButton = new QPushButton(i18nc("@action:button", "Download New Services..."));
+ downloadButton->setIcon(KIcon("get-hot-new-stuff"));
+ connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadNewServices()));
+
topLayout->addWidget(label);
topLayout->addWidget(m_servicesList);
+ topLayout->addWidget(downloadButton);
}
ServicesSettingsPage::~ServicesSettingsPage()
@@ -121,6 +129,14 @@ void ServicesSettingsPage::loadServices()
}
}
+void ServicesSettingsPage::downloadNewServices()
+{
+ KNS::Engine khns(this);
+ khns.init("servicemenu.knsrc");
+ khns.downloadDialogModal(this);
+ loadServices();
+}
+
bool ServicesSettingsPage::isInServicesList(const QString& service) const
{
const int count = m_servicesList->count();
diff --git a/src/settings/servicessettingspage.h b/src/settings/servicessettingspage.h
index 2e8a6b9e0..359cc77ad 100644
--- a/src/settings/servicessettingspage.h
+++ b/src/settings/servicessettingspage.h
@@ -44,7 +44,16 @@ protected:
virtual bool event(QEvent* event);
private slots:
+ /**
+ * Loads locally installed services.
+ */
void loadServices();
+
+ /**
+ * Opens KHotNewStuff to download new services.
+ */
+ void downloadNewServices();
+
bool isInServicesList(const QString& service) const;
private: