Commit f8f0c4ce authored by Daniel Molkentin's avatar Daniel Molkentin
Browse files

Move Welcome Page to separate plugin.

parent 95e5bfbd
...@@ -44,24 +44,5 @@ ...@@ -44,24 +44,5 @@
<file>images/unlocked.png</file> <file>images/unlocked.png</file>
<file>images/extension.png</file> <file>images/extension.png</file>
<file>images/darkclosebutton.png</file> <file>images/darkclosebutton.png</file>
<file>images/welcomemode/btn_26.png</file>
<file>images/welcomemode/btn_26_hover.png</file>
<file>images/welcomemode/btn_27.png</file>
<file>images/welcomemode/btn_27_hover.png</file>
<file>images/welcomemode/feedback_arrow.png</file>
<file>images/welcomemode/feedback_arrow_hover.png</file>
<file>images/welcomemode/feedback-bar-background.png</file>
<file>images/welcomemode/list_bullet_arrow.png</file>
<file>images/welcomemode/mode_project.png</file>
<file>images/welcomemode/nokia_logo.png</file>
<file>images/welcomemode/product_logo.png</file>
<file>images/welcomemode/qt_logo.png</file>
<file>images/welcomemode/rc_combined.png</file>
<file>images/welcomemode/background_center_frame.png</file>
<file>images/welcomemode/center_frame_header.png</file>
<file>images/welcomemode/btn_26_pressed.png</file>
<file>images/welcomemode/combobox_arrow.png</file>
<file>images/welcomemode/arrow-left.png</file>
<file>images/welcomemode/arrow-right.png</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
**************************************************************************/ **************************************************************************/
#include "coreplugin.h" #include "coreplugin.h"
#include "welcomemode.h"
#include "editmode.h" #include "editmode.h"
#include "editormanager.h" #include "editormanager.h"
#include "mainwindow.h" #include "mainwindow.h"
...@@ -42,16 +41,12 @@ ...@@ -42,16 +41,12 @@
using namespace Core::Internal; using namespace Core::Internal;
CorePlugin::CorePlugin() : CorePlugin::CorePlugin() :
m_mainWindow(new MainWindow), m_welcomeMode(0), m_editMode(0) m_mainWindow(new MainWindow), m_editMode(0)
{ {
} }
CorePlugin::~CorePlugin() CorePlugin::~CorePlugin()
{ {
if (m_welcomeMode) {
removeObject(m_welcomeMode);
delete m_welcomeMode;
}
if (m_editMode) { if (m_editMode) {
removeObject(m_editMode); removeObject(m_editMode);
delete m_editMode; delete m_editMode;
...@@ -68,9 +63,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) ...@@ -68,9 +63,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
Q_UNUSED(arguments) Q_UNUSED(arguments)
const bool success = m_mainWindow->init(errorMessage); const bool success = m_mainWindow->init(errorMessage);
if (success) { if (success) {
m_welcomeMode = new WelcomeMode;
addObject(m_welcomeMode);
EditorManager *editorManager = m_mainWindow->editorManager(); EditorManager *editorManager = m_mainWindow->editorManager();
m_editMode = new EditMode(editorManager); m_editMode = new EditMode(editorManager);
addObject(m_editMode); addObject(m_editMode);
...@@ -80,7 +72,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) ...@@ -80,7 +72,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
void CorePlugin::extensionsInitialized() void CorePlugin::extensionsInitialized()
{ {
m_mainWindow->modeManager()->activateMode(m_welcomeMode->uniqueModeName());
m_mainWindow->extensionsInitialized(); m_mainWindow->extensionsInitialized();
} }
......
...@@ -32,10 +32,13 @@ ...@@ -32,10 +32,13 @@
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
namespace Core {
class IMode;
}
namespace Core { namespace Core {
namespace Internal { namespace Internal {
class WelcomeMode;
class EditMode; class EditMode;
class MainWindow; class MainWindow;
...@@ -56,7 +59,7 @@ public slots: ...@@ -56,7 +59,7 @@ public slots:
private: private:
MainWindow *m_mainWindow; MainWindow *m_mainWindow;
WelcomeMode *m_welcomeMode; Core::IMode *m_welcomeMode;
EditMode *m_editMode; EditMode *m_editMode;
}; };
......
...@@ -20,8 +20,6 @@ DEPENDPATH += dialogs \ ...@@ -20,8 +20,6 @@ DEPENDPATH += dialogs \
editormanager \ editormanager \
scriptmanager scriptmanager
SOURCES += mainwindow.cpp \ SOURCES += mainwindow.cpp \
welcomemode.cpp \
rssfetcher.cpp \
editmode.cpp \ editmode.cpp \
tabpositionindicator.cpp \ tabpositionindicator.cpp \
fancyactionbar.cpp \ fancyactionbar.cpp \
...@@ -81,9 +79,6 @@ SOURCES += mainwindow.cpp \ ...@@ -81,9 +79,6 @@ SOURCES += mainwindow.cpp \
dialogs/iwizard.cpp \ dialogs/iwizard.cpp \
settingsdatabase.cpp settingsdatabase.cpp
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
welcomemode.h \
welcomemode_p.h \
rssfetcher.h \
editmode.h \ editmode.h \
tabpositionindicator.h \ tabpositionindicator.h \
fancyactionbar.h \ fancyactionbar.h \
...@@ -166,8 +161,7 @@ FORMS += dialogs/newdialog.ui \ ...@@ -166,8 +161,7 @@ FORMS += dialogs/newdialog.ui \
dialogs/saveitemsdialog.ui \ dialogs/saveitemsdialog.ui \
dialogs/openwithdialog.ui \ dialogs/openwithdialog.ui \
editormanager/openeditorsview.ui \ editormanager/openeditorsview.ui \
generalsettings.ui \ generalsettings.ui
welcomemode.ui
RESOURCES += core.qrc \ RESOURCES += core.qrc \
fancyactionbar.qrc fancyactionbar.qrc
......
...@@ -22,5 +22,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -22,5 +22,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<dependency name="Core" version="1.2.80"/> <dependency name="Core" version="1.2.80"/>
<dependency name="Find" version="1.2.80"/> <dependency name="Find" version="1.2.80"/>
<dependency name="QuickOpen" version="1.2.80"/> <dependency name="QuickOpen" version="1.2.80"/>
<dependency name="Welcome" version="1.2.80"/>
</dependencyList> </dependencyList>
</plugin> </plugin>
...@@ -4,6 +4,7 @@ include(../../qtcreatorplugin.pri) ...@@ -4,6 +4,7 @@ include(../../qtcreatorplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/find/find.pri) include(../../plugins/find/find.pri)
include(../../plugins/quickopen/quickopen.pri) include(../../plugins/quickopen/quickopen.pri)
include(../../plugins/welcome/welcome.pri)
QT += network QT += network
CONFIG += help CONFIG += help
DEFINES += QT_CLUCENE_SUPPORT \ DEFINES += QT_CLUCENE_SUPPORT \
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#include <coreplugin/uniqueidmanager.h> #include <coreplugin/uniqueidmanager.h>
#include <coreplugin/welcomemode.h> #include <coreplugin/welcomemode.h>
#include <welcome/welcomemode.h>
#include <texteditor/texteditorconstants.h> #include <texteditor/texteditorconstants.h>
#include <utils/styledbar.h> #include <utils/styledbar.h>
...@@ -611,8 +613,8 @@ void HelpPlugin::extensionsInitialized() ...@@ -611,8 +613,8 @@ void HelpPlugin::extensionsInitialized()
using namespace Core::Internal; using namespace Core::Internal;
using namespace Core::Constants; using namespace Core::Constants;
WelcomeMode *welcomeMode = Welcome::WelcomeMode *welcomeMode =
qobject_cast<WelcomeMode*>(m_core->modeManager()->mode(MODE_WELCOME)); qobject_cast<Welcome::WelcomeMode*>(m_core->modeManager()->mode(MODE_WELCOME));
if (welcomeMode) { if (welcomeMode) {
connect(welcomeMode, SIGNAL(openHelpPage(QString)), this, connect(welcomeMode, SIGNAL(openHelpPage(QString)), this,
SLOT(openHelpPage(QString))); SLOT(openHelpPage(QString)));
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = plugin_coreplugin \ SUBDIRS = plugin_coreplugin \
plugin_welcome \
plugin_find \ plugin_find \
plugin_texteditor \ plugin_texteditor \
plugin_cppeditor \ plugin_cppeditor \
...@@ -37,6 +38,9 @@ SUBDIRS = plugin_coreplugin \ ...@@ -37,6 +38,9 @@ SUBDIRS = plugin_coreplugin \
plugin_coreplugin.subdir = coreplugin plugin_coreplugin.subdir = coreplugin
plugin_welcome.subdir = welcome
plugin_welcome.depends = plugin_coreplugin
plugin_find.subdir = find plugin_find.subdir = find
plugin_find.depends += plugin_coreplugin plugin_find.depends += plugin_coreplugin
......
...@@ -23,5 +23,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -23,5 +23,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<dependency name="Find" version="1.2.80"/> <dependency name="Find" version="1.2.80"/>
<dependency name="QuickOpen" version="1.2.80"/> <dependency name="QuickOpen" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/> <dependency name="TextEditor" version="1.2.80"/>
<dependency name="Welcome" version="1.2.80"/>
</dependencyList> </dependencyList>
</plugin> </plugin>
...@@ -74,11 +74,10 @@ ...@@ -74,11 +74,10 @@
#include <coreplugin/findplaceholder.h> #include <coreplugin/findplaceholder.h>
#include <coreplugin/basefilewizard.h> #include <coreplugin/basefilewizard.h>
#include <coreplugin/mainwindow.h> #include <coreplugin/mainwindow.h>
#include <coreplugin/welcomemode.h>
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <coreplugin/iversioncontrol.h> #include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <coreplugin/welcomemode.h> #include <welcome/welcomemode.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/parameteraction.h> #include <utils/parameteraction.h>
...@@ -647,7 +646,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er ...@@ -647,7 +646,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
m_projectExplorerSettings.showCompilerOutput = s->value("ProjectExplorer/Settings/ShowCompilerOutput", false).toBool(); m_projectExplorerSettings.showCompilerOutput = s->value("ProjectExplorer/Settings/ShowCompilerOutput", false).toBool();
} }
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*> if (Welcome::WelcomeMode *welcomeMode = qobject_cast<Welcome::WelcomeMode*>
(Core::ICore::instance()->modeManager()->mode(Core::Constants::MODE_WELCOME))) { (Core::ICore::instance()->modeManager()->mode(Core::Constants::MODE_WELCOME))) {
connect(welcomeMode, SIGNAL(manageSessions()), this, SLOT(showSessionManager())); connect(welcomeMode, SIGNAL(manageSessions()), this, SLOT(showSessionManager()));
} }
...@@ -837,7 +836,7 @@ void ProjectExplorerPlugin::showSessionManager() ...@@ -837,7 +836,7 @@ void ProjectExplorerPlugin::showSessionManager()
Core::IMode *welcomeMode = modeManager->mode(Core::Constants::MODE_WELCOME); Core::IMode *welcomeMode = modeManager->mode(Core::Constants::MODE_WELCOME);
if (modeManager->currentMode() == welcomeMode) if (modeManager->currentMode() == welcomeMode)
{ {
updateWelcomePage(qobject_cast<Core::Internal::WelcomeMode*>(welcomeMode)); updateWelcomePage(qobject_cast<Welcome::WelcomeMode*>(welcomeMode));
} }
} }
...@@ -1020,9 +1019,9 @@ Project *ProjectExplorerPlugin::startupProject() const ...@@ -1020,9 +1019,9 @@ Project *ProjectExplorerPlugin::startupProject() const
} }
// update welcome page // update welcome page
void ProjectExplorerPlugin::updateWelcomePage(Core::Internal::WelcomeMode *welcomeMode) void ProjectExplorerPlugin::updateWelcomePage(Welcome::WelcomeMode *welcomeMode)
{ {
Core::Internal::WelcomeMode::WelcomePageData welcomePageData; Welcome::WelcomeMode::WelcomePageData welcomePageData;
welcomePageData.sessionList = m_session->sessions(); welcomePageData.sessionList = m_session->sessions();
welcomePageData.activeSession = m_session->activeSession(); welcomePageData.activeSession = m_session->activeSession();
welcomePageData.previousSession = m_session->lastSession(); welcomePageData.previousSession = m_session->lastSession();
...@@ -1032,7 +1031,7 @@ void ProjectExplorerPlugin::updateWelcomePage(Core::Internal::WelcomeMode *welco ...@@ -1032,7 +1031,7 @@ void ProjectExplorerPlugin::updateWelcomePage(Core::Internal::WelcomeMode *welco
void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode) void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
{ {
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(mode)) if (Welcome::WelcomeMode *welcomeMode = qobject_cast<Welcome::WelcomeMode*>(mode))
updateWelcomePage(welcomeMode); updateWelcomePage(welcomeMode);
} }
...@@ -1081,7 +1080,7 @@ void ProjectExplorerPlugin::restoreSession() ...@@ -1081,7 +1080,7 @@ void ProjectExplorerPlugin::restoreSession()
// update welcome page // update welcome page
Core::ModeManager *modeManager = Core::ModeManager::instance(); Core::ModeManager *modeManager = Core::ModeManager::instance();
connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*))); connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*)));
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*>(modeManager->mode(Core::Constants::MODE_WELCOME))) { if (Welcome::WelcomeMode *welcomeMode = qobject_cast<Welcome::WelcomeMode*>(modeManager->mode(Core::Constants::MODE_WELCOME))) {
updateWelcomePage(welcomeMode); updateWelcomePage(welcomeMode);
connect(welcomeMode, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString))); connect(welcomeMode, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString)));
connect(welcomeMode, SIGNAL(requestProject(QString)), this, SLOT(loadProject(QString))); connect(welcomeMode, SIGNAL(requestProject(QString)), this, SLOT(loadProject(QString)));
......
...@@ -46,21 +46,20 @@ ...@@ -46,21 +46,20 @@
#include <QtGui/QTreeWidget> #include <QtGui/QTreeWidget>
#include <QtGui/QTreeWidgetItem> #include <QtGui/QTreeWidgetItem>
namespace Core { namespace Core {
class IContext; class IContext;
class IMode; class IMode;
class IFileFactory; class IFileFactory;
namespace Internal {
class WelcomeMode;
}
namespace Utils { namespace Utils {
class ParameterAction; class ParameterAction;
} }
} }
namespace ProjectExplorer { namespace Welcome {
class WelcomeMode;
}
namespace ProjectExplorer {
class BuildManager; class BuildManager;
class PersistentSettings; class PersistentSettings;
class RunConfiguration; class RunConfiguration;
...@@ -210,7 +209,7 @@ private: ...@@ -210,7 +209,7 @@ private:
void updateActions(); void updateActions();
void addToRecentProjects(const QString &fileName, const QString &displayName); void addToRecentProjects(const QString &fileName, const QString &displayName);
void updateWelcomePage(Core::Internal::WelcomeMode *welcomeMode); void updateWelcomePage(Welcome::WelcomeMode *welcomeMode);
Internal::ProjectFileFactory *findProjectFileFactory(const QString &filename) const; Internal::ProjectFileFactory *findProjectFileFactory(const QString &filename) const;
static ProjectExplorerPlugin *m_instance; static ProjectExplorerPlugin *m_instance;
......
...@@ -3,3 +3,4 @@ include(../../plugins/quickopen/quickopen.pri) ...@@ -3,3 +3,4 @@ include(../../plugins/quickopen/quickopen.pri)
include(../../plugins/find/find.pri) include(../../plugins/find/find.pri)
include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/texteditor/texteditor.pri) include(../../plugins/texteditor/texteditor.pri)
include(../../plugins/welcome/welcome.pri)
...@@ -25,5 +25,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> ...@@ -25,5 +25,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<dependency name="CppEditor" version="1.2.80"/> <dependency name="CppEditor" version="1.2.80"/>
<dependency name="Help" version="1.2.80"/> <dependency name="Help" version="1.2.80"/>
<dependency name="Designer" version="1.2.80"/> <dependency name="Designer" version="1.2.80"/>
<dependency name="Welcome" version="1.2.80"/>
</dependencyList> </dependencyList>
</plugin> </plugin>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/modemanager.h> #include <coreplugin/modemanager.h>
#include <coreplugin/welcomemode.h> #include <welcome/welcomemode.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <help/helpplugin.h> #include <help/helpplugin.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
...@@ -121,7 +121,7 @@ QtVersionManager::QtVersionManager() ...@@ -121,7 +121,7 @@ QtVersionManager::QtVersionManager()
writeVersionsIntoSettings(); writeVersionsIntoSettings();
if (Core::Internal::WelcomeMode *welcomeMode = qobject_cast<Core::Internal::WelcomeMode*> if (Welcome::WelcomeMode *welcomeMode = qobject_cast<Welcome::WelcomeMode*>
(Core::ICore::instance()->modeManager()->mode(Core::Constants::MODE_WELCOME))) { (Core::ICore::instance()->modeManager()->mode(Core::Constants::MODE_WELCOME))) {
connect(this, SIGNAL(updatedExamples(QString, QString)), connect(this, SIGNAL(updatedExamples(QString, QString)),
welcomeMode, SIGNAL(updatedExamples(QString, QString))); welcomeMode, SIGNAL(updatedExamples(QString, QString)));
......
<plugin name="Welcome" version="1.2.80" compatVersion="1.2.80">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this plugin in
accordance with the Qt Commercial License Agreement provided with the
Software or, alternatively, in accordance with the terms contained in
a written agreement between you and Nokia.
GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser
General Public License version 2.1 as published by the Free Software
Foundation. Please review the following information to
ensure the GNU Lesser General Public License version 2.1 requirements
will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Default Welcome Screen Plugin</description>
<url>http://www.qtsoftware.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
</dependencyList>
</plugin>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment