]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
If the user changes the sorting by clicking on a header section, the resulting sortin...
[dolphin.git] / src / dolphinmainwindow.cpp
index 300d99d928eccff08b0354ffd95629a91f3b355e..5e9948939fe61489dd807bff457c7371f90d7045 100644 (file)
@@ -24,6 +24,7 @@
 #include <assert.h>\r
 \r
 #include "dolphinapplication.h"\r
+#include "dolphinnewmenu.h"\r
 #include "dolphinsettings.h"\r
 #include "dolphinsettingsdialog.h"\r
 #include "dolphinstatusbar.h"\r
 #include <kicon.h>\r
 #include <kiconloader.h>\r
 #include <kio/netaccess.h>\r
+#include <kio/deletejob.h>\r
 #include <kio/renamedialog.h>\r
 #include <kinputdialog.h>\r
 #include <klocale.h>\r
 #include <kmenu.h>\r
 #include <kmessagebox.h>\r
-#include <knewmenu.h>\r
 #include <konqmimedata.h>\r
 #include <kpropertiesdialog.h>\r
 #include <kprotocolinfo.h>\r
@@ -160,7 +161,7 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
                                               i18n("&Link Here") + "\t" + seq);\r
 \r
         popup.addSeparator();\r
-        popup.addAction(KIcon("stop"), i18n("Cancel"));\r
+        QAction* cancelAction = popup.addAction(KIcon("stop"), i18n("Cancel"));\r
 \r
         QAction* activatedAction = popup.exec(QCursor::pos());\r
         if (activatedAction == moveAction) {\r
@@ -172,6 +173,9 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
         else if (activatedAction == linkAction) {\r
             action = Qt::LinkAction;\r
         }\r
+        else if (activatedAction == cancelAction) {\r
+            return;\r
+        }\r
     }\r
 \r
     switch (action) {\r
@@ -321,7 +325,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
 \r
     // TODO: I assume there will be a generic way in KDE 4 to store the docks\r
     // of the main window. In the meantime they are stored manually:\r
-    QString filename = KStandardDirs::locateLocal("data", KGlobal::instance()->instanceName());\r
+    QString filename = KStandardDirs::locateLocal("data", KGlobal::mainComponent().componentName());\r
     filename.append("/panels_layout");\r
     QFile file(filename);\r
     if (file.open(QIODevice::WriteOnly)) {\r
@@ -485,6 +489,12 @@ void DolphinMainWindow::slotUndoTextChanged(const QString& text)
     }\r
 }\r
 \r
+void DolphinMainWindow::undo()\r
+{\r
+    clearStatusBar();\r
+    KonqUndoManager::self()->undo();\r
+}\r
+\r
 void DolphinMainWindow::cut()\r
 {\r
     QMimeData* mimeData = new QMimeData();\r
@@ -921,8 +931,7 @@ void DolphinMainWindow::loadSettings()
     // TODO: I assume there will be a generic way in KDE 4 to restore the docks\r
     // of the main window. In the meantime they are restored manually (see also\r
     // DolphinMainWindow::closeEvent() for more details):\r
-    QString filename = KStandardDirs::locateLocal("data", KGlobal::instance()->instanceName());\r
-    filename.append("/panels_layout");\r
+    QString filename = KStandardDirs::locateLocal("data", KGlobal::mainComponent().componentName());   filename.append("/panels_layout");\r
     QFile file(filename);\r
     if (file.open(QIODevice::ReadOnly)) {\r
         QByteArray data = file.readAll();\r
@@ -934,7 +943,7 @@ void DolphinMainWindow::loadSettings()
 void DolphinMainWindow::setupActions()\r
 {\r
     // setup 'File' menu\r
-    m_newMenu = new KNewMenu(actionCollection(), this, "create_new");\r
+    m_newMenu = new DolphinNewMenu(this);\r
     KMenu* menu = m_newMenu->menu();\r
     menu->setTitle(i18n("Create New..."));\r
     menu->setIcon(SmallIcon("filenew"));\r
@@ -971,7 +980,7 @@ void DolphinMainWindow::setupActions()
     KStandardAction::quit(this, SLOT(quit()), actionCollection());\r
 \r
     // setup 'Edit' menu\r
-    KStandardAction::undo(KonqUndoManager::self(),\r
+    KStandardAction::undo(this,\r
                           SLOT(undo()),\r
                           actionCollection());\r
 \r