1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-04 17:30:55 +00:00

Add a "New Window" option to Dolphin

svn path=/trunk/playground/utils/dolphin/; revision=609048
This commit is contained in:
Holger Freyther 2006-11-29 12:31:16 +00:00
parent 9a4a17dd4d
commit 91c5f52d87
3 changed files with 13 additions and 1 deletions

View 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);

View 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);

View 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" />