]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add a "New Window" option to Dolphin
authorHolger Freyther <holger+kde@freyther.de>
Wed, 29 Nov 2006 12:31:16 +0000 (12:31 +0000)
committerHolger Freyther <holger+kde@freyther.de>
Wed, 29 Nov 2006 12:31:16 +0000 (12:31 +0000)
svn path=/trunk/playground/utils/dolphin/; revision=609048

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/dolphinui.rc

index af9bd0a011b818726b08b000f89b5c4074689089..9748c6e24d34faa6e675fdcbc67fc50edba2bb90 100644 (file)
@@ -323,6 +323,11 @@ void DolphinMainWindow::slotUndo()
     UndoManager::instance().undo(this);
 }
 
+void DolphinMainWindow::slotNewMainWindow()
+{
+    DolphinApplication::app()->createMainWindow()->show();
+}
+
 void DolphinMainWindow::closeEvent(QCloseEvent* event)
 {
     // KDE4-TODO
@@ -1216,6 +1221,9 @@ void DolphinMainWindow::loadSettings()
 void DolphinMainWindow::setupActions()
 {
     // setup 'File' menu
+    KAction *action = new KAction(KIcon("window_new"),  i18n( "New &Window" ), actionCollection(), "new_window" );
+    connect(action, SIGNAL(triggered()), this, SLOT(slotNewMainWindow()));
+
     KAction* createFolder = new KAction(i18n("Folder..."), actionCollection(), "create_folder");
     createFolder->setIcon(KIcon("folder"));
     createFolder->setShortcut(Qt::Key_N);
index dbe6ed4e02820ac4f768be745c156efd30fe0a08..d736c82627fb5a460fd792dc0d88d8c07779b83d 100644 (file)
@@ -169,6 +169,9 @@ public slots:
     /** @see slotUndo() */
     void slotUndo();
 
+    /** Open a  new mainwindow */
+    void slotNewMainWindow();
+
 protected:
     /** @see QMainWindow::closeEvent */
     virtual void closeEvent(QCloseEvent* event);
index 6e5e2740105e2d73906534415a480f74a9a27042..49eb67dafca6df054a4fca0466b6bddca9e1b231 100644 (file)
@@ -1,7 +1,8 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui version="1" name="dolphin" >
+<kpartgui version="2" name="dolphin" >
  <MenuBar>
   <Menu name="file" >
+   <Action name="new_window" />
    <Menu name="create_new" >
     <text>Create New</text>
     <Action name="create_folder" />