2007-01-26 00:55:49 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* 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"
|
2009-03-17 20:47:03 +00:00
|
|
|
|
2007-01-26 00:55:49 +00:00
|
|
|
#include "dolphinmainwindow.h"
|
2009-03-17 20:47:03 +00:00
|
|
|
#include "dolphinnewmenuobserver.h"
|
2007-01-26 00:55:49 +00:00
|
|
|
#include "dolphinview.h"
|
2007-06-07 21:10:48 +00:00
|
|
|
#include "dolphinviewcontainer.h"
|
2009-08-01 20:01:51 +00:00
|
|
|
#include "statusbar/dolphinstatusbar.h"
|
2007-01-26 00:55:49 +00:00
|
|
|
|
|
|
|
#include <kactioncollection.h>
|
|
|
|
#include <kio/job.h>
|
|
|
|
|
2008-11-14 19:51:13 +00:00
|
|
|
DolphinNewMenu::DolphinNewMenu(QWidget* parent, DolphinMainWindow* mainWin) :
|
2010-01-26 12:04:56 +00:00
|
|
|
KNewFileMenu(mainWin->actionCollection(), "create_new", parent),
|
2007-05-06 17:41:49 +00:00
|
|
|
m_mainWin(mainWin)
|
|
|
|
{
|
2009-03-17 20:47:03 +00:00
|
|
|
DolphinNewMenuObserver::instance().attach(this);
|
2007-05-06 17:41:49 +00:00
|
|
|
}
|
2007-01-26 00:55:49 +00:00
|
|
|
|
|
|
|
DolphinNewMenu::~DolphinNewMenu()
|
2007-05-06 17:41:49 +00:00
|
|
|
{
|
2009-03-17 20:47:03 +00:00
|
|
|
DolphinNewMenuObserver::instance().detach(this);
|
2007-05-06 17:41:49 +00:00
|
|
|
}
|
2007-01-26 00:55:49 +00:00
|
|
|
|
|
|
|
void DolphinNewMenu::slotResult(KJob* job)
|
|
|
|
{
|
|
|
|
if (job->error()) {
|
2007-06-07 21:10:48 +00:00
|
|
|
DolphinStatusBar* statusBar = m_mainWin->activeViewContainer()->statusBar();
|
2007-01-26 00:55:49 +00:00
|
|
|
statusBar->setMessage(job->errorString(), DolphinStatusBar::Error);
|
2007-04-09 19:12:54 +00:00
|
|
|
} else {
|
2010-01-26 12:04:56 +00:00
|
|
|
KNewFileMenu::slotResult(job);
|
2007-01-26 00:55:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "dolphinnewmenu.moc"
|