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

Move Welcome Page to separate plugin.

parent 95e5bfbd
......@@ -44,24 +44,5 @@
<file>images/unlocked.png</file>
<file>images/extension.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>
</RCC>
......@@ -28,7 +28,6 @@
**************************************************************************/
#include "coreplugin.h"
#include "welcomemode.h"
#include "editmode.h"
#include "editormanager.h"
#include "mainwindow.h"
......@@ -42,16 +41,12 @@
using namespace Core::Internal;
CorePlugin::CorePlugin() :
m_mainWindow(new MainWindow), m_welcomeMode(0), m_editMode(0)
m_mainWindow(new MainWindow), m_editMode(0)
{
}
CorePlugin::~CorePlugin()
{
if (m_welcomeMode) {
removeObject(m_welcomeMode);
delete m_welcomeMode;
}
if (m_editMode) {
removeObject(m_editMode);
delete m_editMode;
......@@ -68,9 +63,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
Q_UNUSED(arguments)
const bool success = m_mainWindow->init(errorMessage);
if (success) {
m_welcomeMode = new WelcomeMode;
addObject(m_welcomeMode);
EditorManager *editorManager = m_mainWindow->editorManager();
m_editMode = new EditMode(editorManager);
addObject(m_editMode);
......@@ -80,7 +72,6 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
void CorePlugin::extensionsInitialized()
{
m_mainWindow->modeManager()->activateMode(m_welcomeMode->uniqueModeName());
m_mainWindow->extensionsInitialized();
}
......
......@@ -32,10 +32,13 @@
#include <extensionsystem/iplugin.h>
namespace Core {
class IMode;
}
namespace Core {
namespace Internal {
class WelcomeMode;
class EditMode;
class MainWindow;
......@@ -56,7 +59,7 @@ public slots:
private:
MainWindow *m_mainWindow;
WelcomeMode *m_welcomeMode;
Core::IMode *m_welcomeMode;
EditMode *m_editMode;
};
......
......@@ -20,8 +20,6 @@ DEPENDPATH += dialogs \
editormanager \
scriptmanager
SOURCES += mainwindow.cpp \
welcomemode.cpp \
rssfetcher.cpp \
editmode.cpp \
tabpositionindicator.cpp \
fancyactionbar.cpp \
......@@ -81,9 +79,6 @@ SOURCES += mainwindow.cpp \
dialogs/iwizard.cpp \
settingsdatabase.cpp
HEADERS += mainwindow.h \
welcomemode.h \
welcomemode_p.h \
rssfetcher.h \
editmode.h \
tabpositionindicator.h \
fancyactionbar.h \
......@@ -166,8 +161,7 @@ FORMS += dialogs/newdialog.ui \
dialogs/saveitemsdialog.ui \
dialogs/openwithdialog.ui \
editormanager/openeditorsview.ui \
generalsettings.ui \
welcomemode.ui
generalsettings.ui
RESOURCES += core.qrc \
fancyactionbar.qrc
......
......@@ -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="Find" version="1.2.80"/>
<dependency name="QuickOpen" version="1.2.80"/>
<dependency name="Welcome" version="1.2.80"/>
</dependencyList>
</plugin>
......@@ -4,6 +4,7 @@ include(../../qtcreatorplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/find/find.pri)
include(../../plugins/quickopen/quickopen.pri)
include(../../plugins/welcome/welcome.pri)
QT += network
CONFIG += help
DEFINES += QT_CLUCENE_SUPPORT \
......
......@@ -56,6 +56,8 @@
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/welcomemode.h>
#include <welcome/welcomemode.h>
#include <texteditor/texteditorconstants.h>
#include <utils/styledbar.h>
......@@ -611,8 +613,8 @@ void HelpPlugin::extensionsInitialized()
using namespace Core::Internal;
using namespace Core::Constants;
WelcomeMode *welcomeMode =
qobject_cast<WelcomeMode*>(m_core->modeManager()->mode(MODE_WELCOME));
Welcome::WelcomeMode *welcomeMode =
qobject_cast<Welcome::WelcomeMode*>(m_core->modeManager()->mode(MODE_WELCOME));
if (welcomeMode) {
connect(welcomeMode, SIGNAL(openHelpPage(QString)), this,
SLOT(openHelpPage(QString)));
......
......@@ -4,6 +4,7 @@
TEMPLATE = subdirs
SUBDIRS = plugin_coreplugin \
plugin_welcome \
plugin_find \
plugin_texteditor \
plugin_cppeditor \
......@@ -30,13 +31,16 @@ SUBDIRS = plugin_coreplugin \
plugin_fakevim \
plugin_designer \
plugin_resourceeditor \
plugin_genericprojectmanager \
plugin_genericprojectmanager \
plugin_duieditor \
plugin_qmlprojectmanager \
debugger/dumper.pro
plugin_coreplugin.subdir = coreplugin
plugin_welcome.subdir = welcome
plugin_welcome.depends = plugin_coreplugin
plugin_find.subdir = find
plugin_find.depends += plugin_coreplugin
......
......@@ -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="QuickOpen" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="Welcome" version="1.2.80"/>
</dependencyList>
</plugin>
......@@ -74,11 +74,10 @@
#include <coreplugin/findplaceholder.h>
#include <coreplugin/basefilewizard.h>
#include <coreplugin/mainwindow.h>
#include <coreplugin/welcomemode.h>
#include <coreplugin/vcsmanager.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>
#include <coreplugin/welcomemode.h>
#include <welcome/welcomemode.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <utils/parameteraction.h>
......@@ -647,7 +646,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
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))) {
connect(welcomeMode, SIGNAL(manageSessions()), this, SLOT(showSessionManager()));
}
......@@ -837,7 +836,7 @@ void ProjectExplorerPlugin::showSessionManager()
Core::IMode *welcomeMode = modeManager->mode(Core::Constants::MODE_WELCOME);
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
}
// 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.activeSession = m_session->activeSession();
welcomePageData.previousSession = m_session->lastSession();
......@@ -1032,7 +1031,7 @@ void ProjectExplorerPlugin::updateWelcomePage(Core::Internal::WelcomeMode *welco
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);
}
......@@ -1081,7 +1080,7 @@ void ProjectExplorerPlugin::restoreSession()
// update welcome page
Core::ModeManager *modeManager = Core::ModeManager::instance();
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);
connect(welcomeMode, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString)));
connect(welcomeMode, SIGNAL(requestProject(QString)), this, SLOT(loadProject(QString)));
......
......@@ -46,21 +46,20 @@
#include <QtGui/QTreeWidget>
#include <QtGui/QTreeWidgetItem>
namespace Core {
class IContext;
class IMode;
class IFileFactory;
namespace Internal {
class WelcomeMode;
}
namespace Utils {
class ParameterAction;
}
}
namespace ProjectExplorer {
namespace Welcome {
class WelcomeMode;
}
namespace ProjectExplorer {
class BuildManager;
class PersistentSettings;
class RunConfiguration;
......@@ -210,7 +209,7 @@ private:
void updateActions();
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;
static ProjectExplorerPlugin *m_instance;
......
......@@ -3,3 +3,4 @@ include(../../plugins/quickopen/quickopen.pri)
include(../../plugins/find/find.pri)
include(../../plugins/coreplugin/coreplugin.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>
<dependency name="CppEditor" version="1.2.80"/>
<dependency name="Help" version="1.2.80"/>
<dependency name="Designer" version="1.2.80"/>
<dependency name="Welcome" version="1.2.80"/>
</dependencyList>
</plugin>
......@@ -42,7 +42,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/welcomemode.h>
#include <welcome/welcomemode.h>
#include <extensionsystem/pluginmanager.h>
#include <help/helpplugin.h>
#include <utils/qtcassert.h>
......@@ -121,7 +121,7 @@ QtVersionManager::QtVersionManager()
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))) {
connect(this, 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>
Supports Markdown
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