detailsviewsettingspage.cpp
dolphinapplication.cpp
dolphinmainwindow.cpp
+ dolphinnewmenu.cpp
dolphinview.cpp
dolphinstatusbar.cpp
dolphindirlister.cpp
#include "dolphindirlister.h"
#include <kio/jobclasses.h>
-// TODO:
-#include <stdio.h>
-
DolphinDirLister::DolphinDirLister() :
KDirLister()
{
void DolphinDirLister::handleError(KIO::Job* job)
{
- // TODO: some error texts should be adjusted manually
emit errorMessage(job->errorString());
}
/**
* @brief Extends the class KDirLister by emitting an error
- * signal containing text.
+ * signal containing text.
*
* @author Peter Penz
*/
#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 <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
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
void connectViewSignals(int viewIndex);
private:
- KNewMenu* m_newMenu;
- QSplitter* m_splitter;
- DolphinView* m_activeView;
-
/**
* DolphinMainWindowsupports only one or two views, which
* are handled internally as primary and secondary view.
PrimaryIdx = 0,
SecondaryIdx = 1
};
- DolphinView* m_view[SecondaryIdx + 1];
-
- /// remember pending undo operations until they are finished
- QList<KonqOperations::Operation> m_undoOperations;
/**
* Implements a custom error handling for the undo manager. This
* assures that all errors are shown in the status bar of Dolphin
* instead as modal error dialog with an OK button.
*/
- class UndoUiInterface : public KonqUndoManager::UiInterface {
+ class UndoUiInterface : public KonqUndoManager::UiInterface
+ {
public:
UndoUiInterface(DolphinMainWindow* mainWin);
virtual ~UndoUiInterface();
private:
DolphinMainWindow* m_mainWin;
};
+
+ KNewMenu* m_newMenu;
+ QSplitter* m_splitter;
+ DolphinView* m_activeView;
+
+ DolphinView* m_view[SecondaryIdx + 1];
+
+ /// remember pending undo operations until they are finished
+ QList<KonqOperations::Operation> m_undoOperations;
};
#endif // _DOLPHIN_H_
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2006 by Peter Penz *
+ * peter.penz@gmx.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#include "dolphinnewmenu.h"
+#include "dolphinmainwindow.h"
+#include "dolphinstatusbar.h"
+#include "dolphinview.h"
+
+#include <kactioncollection.h>
+#include <kio/job.h>
+
+DolphinNewMenu::DolphinNewMenu(DolphinMainWindow* mainWin) :
+ KNewMenu(mainWin->actionCollection(), mainWin, "create_new"),
+ m_mainWin(mainWin)
+{
+}
+
+DolphinNewMenu::~DolphinNewMenu()
+{
+}
+
+void DolphinNewMenu::slotResult(KJob* job)
+{
+ if (job->error()) {
+ DolphinStatusBar* statusBar = m_mainWin->activeView()->statusBar();
+ statusBar->setMessage(job->errorString(), DolphinStatusBar::Error);
+ }
+ else {
+ KNewMenu::slotResult(job);
+ }
+}
+
+#include "dolphinnewmenu.moc"
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2006 by Peter Penz *
+ * peter.penz@gmx.at *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#ifndef DOLPHINNEWMENU_H
+#define DOLPHINNEWMENU_H
+
+//class KActionCollection; // TODO: only required temporary because of
+ // missing forward declaration in knewmenu.h
+#include <knewmenu.h>
+
+class DolphinMainWindow;
+class KJob;
+
+/**
+ * @brief Represents the 'Create New...' sub menu for the File menu
+ * and the context menu.
+ *
+ * The only difference to KNewMenu is the custom error handling.
+ * All errors are shown in the status bar of Dolphin
+ * instead as modal error dialog with an OK button.
+ */
+class DolphinNewMenu : public KNewMenu
+{
+Q_OBJECT
+
+public:
+ DolphinNewMenu(DolphinMainWindow* mainWin);
+ virtual ~DolphinNewMenu();
+
+protected slots:
+ /** @see KNewMenu::slotResult() */
+ virtual void slotResult(KJob* job);
+
+private:
+ DolphinMainWindow* m_mainWin;
+};
+
+#endif