m_newMenu->setPopupFiles(activeViewContainer()->url());
}
+void DolphinMainWindow::createDirectory()
+{
+ m_newMenu->setPopupFiles(activeViewContainer()->url());
+ m_newMenu->createDirectory();
+}
+
void DolphinMainWindow::quit()
{
close();
setCaption(homeUrl.fileName());
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
+ connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
ViewProperties props(homeUrl);
m_viewTab[m_tabIndex].primaryView = new DolphinViewContainer(this,
m_viewTab[m_tabIndex].splitter,
view->reload();
m_activeViewContainer->show();
m_actionHandler->setCurrentView(view);
-
+
m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
- connect(this, SIGNAL(urlChanged(const KUrl&)),
+ connect(this, SIGNAL(urlChanged(const KUrl&)),
m_remoteEncoding, SLOT(slotAboutToOpenUrl()));
m_tabBar = new KTabBar(this);
/** Updates the 'Create New...' sub menu. */
void updateNewMenu();
+ void createDirectory();
+
/** Shows the error message in the status bar of the active view. */
void showErrorMessage(const QString& message);
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
m_actionHandler->setCurrentView(m_view);
+ connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
connect(this, SIGNAL(aboutToOpenURL()),
m_extension->loadingProgress(percent);
}
+void DolphinPart::createDirectory()
+{
+ m_newMenu->setPopupFiles(url());
+ m_newMenu->createDirectory();
+}
+
#include "dolphinpart.moc"
*/
void updateProgress(int percent);
+ void createDirectory();
+
private:
void createActions();
void createGoAction(const char* name, const char* iconName,
#include <kaction.h>
#include <kactioncollection.h>
#include <klocale.h>
+#include <knewmenu.h>
#include <ktoggleaction.h>
#include <krun.h>
#include <kpropertiesdialog.h>
newDirAction->setText(i18nc("@action", "Create Folder..."));
newDirAction->setShortcut(Qt::Key_F10);
newDirAction->setIcon(KIcon("folder-new"));
- connect(newDirAction, SIGNAL(triggered()), SLOT(slotCreateDir()));
+ connect(newDirAction, SIGNAL(triggered()), this, SIGNAL(createDirectory()));
// Edit menu
return sortByActionGroup;
}
-void DolphinViewActionHandler::slotCreateDir()
-{
- Q_ASSERT(m_currentView);
- KonqOperations::newDir(m_currentView, m_currentView->url());
-}
-
void DolphinViewActionHandler::slotViewModeActionTriggered(QAction* action)
{
const DolphinView::Mode mode = action->data().value<DolphinView::Mode>();
* Sets the view that this action handler should work on.
*/
void setCurrentView(DolphinView* view);
-
+
/**
* Returns the view that this action handler should work on.
*/
* Returns the name of the action for the current viewmode
*/
QString currentViewModeActionName() const;
-
+
/**
* Returns m_actionCollection
*/
- KActionCollection* actionCollection();
+ KActionCollection* actionCollection();
public Q_SLOTS:
/**
*/
void actionBeingHandled();
-private Q_SLOTS:
/**
- * Opens the dialog for creating a directory. Is connected
- * with the key shortcut for "new directory" (F10).
+ * Emitted if the user requested creating a new directory by the F10 key.
+ * The receiver of the signal (DolphinMainWindow or DolphinPart) invokes
+ * the method createDirectory of their KNewMenu instance.
*/
- void slotCreateDir();
+ void createDirectory();
+private Q_SLOTS:
/**
* Emitted when the user requested a change of view mode
*/