From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/appwizard/appwizardpart.cpp | 98 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 parts/appwizard/appwizardpart.cpp (limited to 'parts/appwizard/appwizardpart.cpp') diff --git a/parts/appwizard/appwizardpart.cpp b/parts/appwizard/appwizardpart.cpp new file mode 100644 index 00000000..8a19f548 --- /dev/null +++ b/parts/appwizard/appwizardpart.cpp @@ -0,0 +1,98 @@ +/*************************************************************************** + * Copyright (C) 2001 by Bernd Gehrmann * + * bernd@kdevelop.org * + * * + * 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. * + * * + ***************************************************************************/ + +#include +#include +#include + +#include "appwizardpart.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "importdlg.h" +#include "appwizarddlg.h" +#include "appwizardfactory.h" +#include +#include +#include +#include +#include + +AppWizardPart::AppWizardPart(QObject *parent, const char *name, const QStringList &) + : KDevPlugin(AppWizardFactory::info(), parent, name ? name : "AppWizardPart") +{ + setInstance(AppWizardFactory::instance()); + setXMLFile("kdevappwizard.rc"); + + KAction *action; + + action = new KAction( i18n("&New Project..."), "window_new", 0, + this, SLOT(slotNewProject()), + actionCollection(), "project_new" ); + action->setToolTip( i18n("Generate a new project from a template") ); + action->setWhatsThis( i18n("New project

" + "This starts KDevelop's application wizard. " + "It helps you to generate a skeleton for your " + "application from a set of templates.") ); + + action = new KAction( i18n("&Import Existing Project..."),"wizard", 0, + this, SLOT(slotImportProject()), + actionCollection(), "project_import" ); + action->setToolTip( i18n("Import existing project") ); + action->setWhatsThis( i18n("Import existing project

Creates a project file for a given directory.") ); +} + + +AppWizardPart::~AppWizardPart() +{ +} + + +void AppWizardPart::slotNewProject() +{ + kdDebug(9010) << "new project" << endl; + AppWizardDialog dlg(this, 0, "app wizard"); + dlg.templates_listview->setFocus(); + dlg.exec(); +} + + +void AppWizardPart::slotImportProject() +{ + ImportDialog dlg(this, 0, "import dialog"); + dlg.exec(); +} + +void AppWizardPart::openFilesAfterGeneration(const KURL::List urlsToOpen) +{ + m_urlsToOpen = urlsToOpen; + connect( core(), SIGNAL( projectOpened() ), this, SLOT( openFilesAfterGeneration() ) ); +} + +void AppWizardPart::openFilesAfterGeneration() +{ + for (KURL::List::const_iterator it = m_urlsToOpen.begin(); it != m_urlsToOpen.end(); ++it) + partController()->editDocument(*it); + m_urlsToOpen.clear(); + disconnect( core(), SIGNAL( projectOpened() ), this, SLOT( openFilesAfterGeneration() ) ); +} + +#include "appwizardpart.moc" + +// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off; -- cgit v1.2.3