kde4_add_library(dolphinprivate SHARED ${dolphinprivate_LIB_SRCS})
-target_link_libraries(dolphinprivate ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} konq ${QIMAGEBLITZ_LIBRARIES} ${X11_LIBRARIES})
+target_link_libraries(dolphinprivate ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} konq knewstuff2 ${QIMAGEBLITZ_LIBRARIES} ${X11_LIBRARIES})
if(X11_Xrender_FOUND)
target_link_libraries(dolphinprivate ${X11_Xrender_LIB} )
endif(X11_Xrender_FOUND)
install( FILES kcm/kcmdolphinnavigation.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kcm/kcmdolphinservices.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kcm/kcmdolphingeneral.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES khns/servicemenu.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
+install( PROGRAMS khns/servicemenuinstallation DESTINATION ${BIN_INSTALL_DIR} )
+install( PROGRAMS khns/servicemenudeinstallation DESTINATION ${BIN_INSTALL_DIR} )
#include <ktoggleaction.h>
#include <krun.h>
#include <kpropertiesdialog.h>
+#include <knewstuff2/engine.h>
DolphinViewActionHandler::DolphinViewActionHandler(KActionCollection* collection, QObject* parent)
findFile->setShortcut(Qt::CTRL | Qt::Key_F);
findFile->setIcon(KIcon("edit-find"));
connect(findFile, SIGNAL(triggered()), this, SLOT(slotFindFile()));
+
+ // Settings menu
+
+ KAction* getServiceMenu = m_actionCollection->addAction("get_servicemenu");
+ getServiceMenu->setText(i18nc("@action:inmenu Settings", "Get Servicemenu..."));
+ getServiceMenu->setIcon(KIcon ("get-hot-new-stuff"));
+ connect(getServiceMenu, SIGNAL(triggered()), this, SLOT(slotGetServiceMenu()));
}
QActionGroup* DolphinViewActionHandler::createAdditionalInformationActionGroup()
dialog->raise();
dialog->activateWindow();
}
+
+void DolphinViewActionHandler::slotGetServiceMenu()
+{
+ KNS::Engine khns(m_currentView);
+ khns.init("servicemenu.knsrc");
+ khns.downloadDialogModal(m_currentView);
+}
--- /dev/null
+#!/usr/bin/env ruby
+require 'pathname'
+require 'fileutils'
+archive = ARGV[0]
+def mimeType(filename)
+ IO.popen("file --mime-type -b " + filename).gets().strip!()
+end
+$archivetypes = { "application/x-tar" => :"tar -xf %s -C %s",
+ "application/tar" => :"tar -xf %s -C %s",
+ "application/x-gzip" => :"tar -zxf %s -C %s",
+ "application/gzip" => :"tar -zxf %s -C %s",
+ "application/x-gzip-compressed-tar" => :"tar -zxf %s -C %s",
+ "application/gzip-compressed-tar" => :"tar -zxf %s -C %s",
+ "application/x-gzip-compressed" => :"tar -zxf %s -C %s",
+ "application/gzip-compressed" => :"tar -zxf %s -C %s",
+ "application/bzip" => :"tar -jxf %s -C %s",
+ "application/bzip2" => :"tar -jxf %s -C %s",
+ "application/x-bzip" => :"tar -jxf %s -C %s",
+ "application/x-bzip2" => :"tar -jxf %s -C %s",
+ "application/bzip-compressed" => :"tar -jxf %s -C %s",
+ "application/bzip2-compressed" => :"tar -jxf %s -C %s",
+ "application/x-bzip-compressed" => :"tar -jxf %s -C %s",
+ "application/x-bzip2-compressed" => :"tar -jxf %s -C %s",
+ "application/bzip-compressed-tar" => :"tar -jxf %s -C %s",
+ "application/bzip2-compressed-tar" => :"tar -jxf %s -C %s",
+ "application/x-bzip-compressed-tar" => :"tar -jxf %s -C %s",
+ "application/x-bzip2-compressed-tar" => :"tar -jxf %s -C %s",
+ "application/zip" => :"unzip %s -d %s",
+ "application/x-zip" => :"unzip %s -d %s",
+ "application/x-zip-compressed" => :"unzip %s -d %s",
+ "multipart/x-zip" => :"unzip %s -d %s",
+ "application/tgz" => :"tar -zxf %s -C %s",
+ "application/x-compressed-gtar" => :"tar -zxf %s -C %s",
+ "application/x-gtar" => :"tar -zxf %s -C %s",
+ "file/tgz" => :"tar -zxf %s -C %s",
+ "multipart/x-tar-gz" => :"tar -zxf %s -C %s",
+ "application/x-gunzip" => :"tar -zxf %s -C %s",
+ "application/gzipped" => :"tar -zxf %s -C %s",
+ "gzip/document" => :"tar -zxf %s -C %s",
+ "application/x-bz2 " => :"tar -jxf %s -C %s",
+ "application/x-gtar" => :"tar -xf %s -C %s",
+ "multipart/x-tar" => :"tar -xf %s -C %s"
+}
+def uncompress(filename, output)
+ system(sprintf($archivetypes[mimeType(filename)].to_s, filename, output))
+end
+dir = archive + "-dir"
+if File.exist?(dir)
+ FileleUtils.rm_r(dir)
+end
+FileUtils.mkdir(dir)
+exit(-1) if !uncompress(archive, dir)
+# try: install-it.sh
+# try: install-it
+# try: installKDE4.sh
+# try: installKDE4
+# try: install.sh
+# try: install
+dd = Dir.new(dir)
+dd.read
+dd.read
+dir += "/" + dd.read
+dd = nil
+def fail()
+ system("kdialog --passivepopup \"Installation failed\" 15")
+ exit(-1)
+end
+if !((File.exist?(file = dir + "/install-it.sh") || File.exist?(file = dir + "/install-it")) && system(file))
+ fail() if !File.exist?(file = dir + "/installKDE4.sh") && !File.exist?(file = dir + "/installKDE4") && !File.exist?(file = dir + "/install.sh") && !File.exist?(file = dir + "/install")
+ File.new(file).chmod(0700)
+ fail() if !system(file + " --local") && !system(file + "--local-install") && !system(file + " --install")
+end