]> cloud.milkyroute.net Git - dolphin.git/commitdiff
move the "Download New Services..." entry from the Settings menu to the service confi...
authorPeter Penz <peter.penz19@gmail.com>
Mon, 9 Nov 2009 18:13:36 +0000 (18:13 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 9 Nov 2009 18:13:36 +0000 (18:13 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1046788

src/CMakeLists.txt
src/dolphinmainwindow.cpp
src/dolphinpart.rc
src/dolphinui.rc
src/dolphinviewactionhandler.h
src/settings/servicessettingspage.cpp
src/settings/servicessettingspage.h

index e44334d51127933b5b2437a3ee05132fb39ce250..0f4e33424f3d1df7dd088b4f5fa6579000319c34 100644 (file)
@@ -54,14 +54,14 @@ set(dolphinprivate_LIB_SRCS
     )
     
 if(Nepomuk_FOUND)
-set(dolphinprivate_LIB_SRCS
-  ${dolphinprivate_LIB_SRCS}
-  panels/information/kcommentwidget.cpp
-  panels/information/kedittagsdialog.cpp
-  panels/information/kloadmetadatathread.cpp
-  panels/information/nepomukmassupdatejob.cpp
-  panels/information/ktaggingwidget.cpp
-)
+    set(dolphinprivate_LIB_SRCS
+        ${dolphinprivate_LIB_SRCS}
+        panels/information/kcommentwidget.cpp
+        panels/information/kedittagsdialog.cpp
+        panels/information/kloadmetadatathread.cpp
+        panels/information/nepomukmassupdatejob.cpp
+        panels/information/ktaggingwidget.cpp
+    )
 endif(Nepomuk_FOUND)
 
 kde4_add_kcfg_files(dolphinprivate_LIB_SRCS
@@ -265,7 +265,7 @@ kde4_add_plugin(kcm_dolphingeneral ${kcm_dolphingeneral_PART_SRCS})
 
 target_link_libraries(kcm_dolphinviewmodes  ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} dolphinprivate)
 target_link_libraries(kcm_dolphinnavigation  ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} dolphinprivate)
-target_link_libraries(kcm_dolphinservices  ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} dolphinprivate)
+target_link_libraries(kcm_dolphinservices  ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KNEWSTUFF2_LIBRARY} dolphinprivate)
 target_link_libraries(kcm_dolphingeneral ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} dolphinprivate)
 if (Nepomuk_FOUND)
   target_link_libraries(kcm_dolphinviewmodes ${NEPOMUK_LIBRARIES})
index e55be1d3063d1a69aafc53a310abc7576a3c25ac..5c89b77e0d474ab56ba367f6980e9a0b7145121f 100644 (file)
@@ -756,7 +756,7 @@ void DolphinMainWindow::goUp()
 void DolphinMainWindow::goBack(Qt::MouseButtons buttons)
 {
     // The default case (left button pressed) is handled in goBack().
-    if(buttons == Qt::MidButton) {
+    if (buttons == Qt::MidButton) {
         KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigator();
         openNewTab(urlNavigator->historyUrl(urlNavigator->historyIndex() + 1));
     }
@@ -765,7 +765,7 @@ void DolphinMainWindow::goBack(Qt::MouseButtons buttons)
 void DolphinMainWindow::goForward(Qt::MouseButtons buttons)
 {
     // The default case (left button pressed) is handled in goForward().
-    if(buttons == Qt::MidButton) {
+    if (buttons == Qt::MidButton) {
         KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigator();
         openNewTab(urlNavigator->historyUrl(urlNavigator->historyIndex() - 1));
     }
@@ -774,7 +774,7 @@ void DolphinMainWindow::goForward(Qt::MouseButtons buttons)
 void DolphinMainWindow::goUp(Qt::MouseButtons buttons)
 {
     // The default case (left button pressed) is handled in goUp().
-    if(buttons == Qt::MidButton) {
+    if (buttons == Qt::MidButton) {
         openNewTab(activeViewContainer()->url().upUrl());
     }
 }
index ec7af696dd2e1b262685c5618386e34e9c8f8f0f..d0b2cc634b9da37e82acc2e95df800a2c7f57837 100644 (file)
@@ -59,9 +59,6 @@
     <Action name="compare_files" />
     <Action name="change_remote_encoding" />
   </Menu>
-  <Menu name="settings">
-    <Action name="get_servicemenu"/>
-  </Menu>
 </MenuBar>
 <ToolBar name="mainToolBar"><text context="@title:menu">Dolphin Toolbar</text>
   <Action name="icons" />
index a7f585092ce2a623c0d765806491d36d7e1ded0c..ff5e22f3c54e02a1232cfba6c4f16a4dc5cd40a0 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="dolphin" version="11">
+<kpartgui name="dolphin" version="12">
     <MenuBar>
         <Menu name="file">
             <Action name="create_new" />
@@ -81,9 +81,6 @@
             <Action name="compare_files" />
             <Action name="change_remote_encoding" />
         </Menu>
-        <Menu name="settings">
-            <Action name="get_servicemenu" />
-        </Menu>
     </MenuBar>
     <State name="new_file" >
         <disable>
index fb6c9528f5fe00d9461bc44248837bfa1e798515..1ce5f9d487a9d83606e4b870130ab9b2e6512565 100644 (file)
@@ -209,11 +209,6 @@ private Q_SLOTS:
      * like name, size and permissions.
      */
     void slotProperties();
-       
-    /**
-     * Starts KHotNewStuff to download servicemenus.
-     */
-    void slotGetServiceMenu();
 
 private:
     /**
index a58df2096afb025f9f9b3215c264377d782a685e..9088366a8098e5a6109e59a0e913fbbaad109aec 100644 (file)
@@ -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();
index 2e8a6b9e06466321574323bc69c9dad1a7339a86..359cc77ad6465da3334476f9d72cb1f8fa7b14a4 100644 (file)
@@ -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: