Commit f8f0c4ce authored by Daniel Molkentin's avatar Daniel Molkentin

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>
......@@ -43,7 +43,7 @@
#include <sys/utsname.h>
#endif
using namespace Core::Internal;
using namespace Welcome;
static const QString getOsString()
{
......
......@@ -34,8 +34,7 @@
#include <QtCore/QXmlStreamReader>
#include <QtNetwork/QHttp>
namespace Core {
namespace Internal {
namespace Welcome {
class RSSFetcher : public QObject
{
......@@ -69,8 +68,7 @@ private:
int m_maxItems;
};
} // namespace Internal
} // namespace Core
} // namespace Welcome
#endif // RSSFETCHER_H
include(coreplugin_dependencies.pri)
LIBS *= -l$$qtLibraryTarget(Welcome)
TEMPLATE = lib
TARGET = Welcome
QT += network
include(../../qtcreatorplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
HEADERS += welcomeplugin.h \
welcomemode.h \
welcomemode_p.h \
rssfetcher.h
SOURCES += welcomeplugin.cpp \
welcomemode.cpp \
rssfetcher.cpp
FORMS += welcomemode.ui
RESOURCES += welcome.qrc
DEFINES += WELCOME_LIBRARY
OTHER_FILES += Welcome.pluginspec
<RCC>
<qresource prefix="/welcome" >
<file>images/btn_26.png</file>
<file>images/btn_26_hover.png</file>
<file>images/btn_27.png</file>
<file>images/btn_27_hover.png</file>
<file>images/feedback_arrow.png</file>
<file>images/feedback_arrow_hover.png</file>
<file>images/feedback-bar-background.png</file>
<file>images/list_bullet_arrow.png</file>
<file>images/mode_project.png</file>
<file>images/nokia_logo.png</file>
<file>images/product_logo.png</file>
<file>images/qt_logo.png</file>
<file>images/rc_combined.png</file>
<file>images/background_center_frame.png</file>
<file>images/center_frame_header.png</file>
<file>images/btn_26_pressed.png</file>
<file>images/combobox_arrow.png</file>
<file>images/arrow-left.png</file>
<file>images/arrow-right.png</file>
</qresource>
</RCC>
#ifndef WELCOME_GLOBAL_H
#define WELCOME_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(WELCOME_LIBRARY)
# define WELCOME_EXPORT Q_DECL_EXPORT
#else
# define WELCOME_EXPORT Q_DECL_IMPORT
#endif
#endif // CPPEDITOR_GLOBAL_H
......@@ -28,14 +28,16 @@
**************************************************************************/
#include "welcomemode.h"
#include "icore.h"
#include "iwizard.h"
#include "coreconstants.h"
#include "uniqueidmanager.h"
#include "modemanager.h"
#include "newdialog.h"
#include "rssfetcher.h"
#include <coreplugin/icore.h>
#include <coreplugin/dialogs/iwizard.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/dialogs/newdialog.h>
#include <utils/styledbar.h>
#include <QtGui/QDesktopServices>
......@@ -53,8 +55,7 @@
#include "ui_welcomemode.h"
namespace Core {
namespace Internal {
namespace Welcome {
struct WelcomeModePrivate
{
......@@ -206,7 +207,7 @@ WelcomeMode::WelcomeMode() :
connect(m_d->ui.nextTipBtn, SIGNAL(clicked()), this, SLOT(slotNextTip()));
connect(m_d->ui.prevTipBtn, SIGNAL(clicked()), this, SLOT(slotPrevTip()));
QSettings *settings = ICore::instance()->settings();
QSettings *settings = Core::ICore::instance()->settings();
int id = settings->value("General/WelcomeTab", 0).toInt();
m_d->btnGrp->button(id)->setChecked(true);
m_d->ui.stackedWidget->setCurrentIndex(id);
......@@ -214,7 +215,7 @@ WelcomeMode::WelcomeMode() :
WelcomeMode::~WelcomeMode()
{
QSettings *settings = ICore::instance()->settings();
QSettings *settings = Core::ICore::instance()->settings();
settings->setValue("General/WelcomeTab", m_d->btnGrp->checkedId());
delete m_d->m_widget;
delete m_d;
......@@ -232,7 +233,7 @@ QIcon WelcomeMode::icon() const
int WelcomeMode::priority() const
{
return Constants::P_MODE_WELCOME;
return Core::Constants::P_MODE_WELCOME;
}
QWidget* WelcomeMode::widget()
......@@ -242,13 +243,13 @@ QWidget* WelcomeMode::widget()
const char* WelcomeMode::uniqueModeName() const
{
return Constants::MODE_WELCOME;
return Core::Constants::MODE_WELCOME;
}
QList<int> WelcomeMode::context() const
{
static QList<int> contexts = QList<int>()
<< UniqueIDManager::instance()->uniqueIdentifier(Constants::C_WELCOME_MODE);
<< Core::UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_WELCOME_MODE);
return contexts;
}
......@@ -292,7 +293,7 @@ void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData)
void WelcomeMode::activateEditMode()
{
Core::ModeManager *modeManager = ModeManager::instance();
Core::ModeManager *modeManager = Core::ModeManager::instance();
if (modeManager->currentMode() == this)
modeManager->activateMode(Core::Constants::MODE_EDIT);
}
......@@ -516,7 +517,7 @@ void WelcomeModeButton::leaveEvent(QEvent *)
WelcomeModeTreeWidget::WelcomeModeTreeWidget(QWidget *parent) :
QTreeWidget(parent),
m_bullet(QLatin1String(":/core/images/welcomemode/list_bullet_arrow.png"))
m_bullet(QLatin1String(":/welcome/images/list_bullet_arrow.png"))
{
connect(this, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
SLOT(slotItemClicked(QTreeWidgetItem *)));
......@@ -567,5 +568,4 @@ void WelcomeModeTreeWidget::slotItemClicked(QTreeWidgetItem *item)
emit activated(item->data(0, Qt::UserRole).toString());
}
} // namespace Internal
} // namespace Core
} // namespace Welcome
......@@ -30,6 +30,8 @@
#ifndef WELCOMEMODE_H
#define WELCOMEMODE_H
#include "welcome_global.h"
#include <coreplugin/imode.h>
#include <QtCore/QObject>
......@@ -40,12 +42,11 @@ class QWidget;
class QUrl;
QT_END_NAMESPACE
namespace Core {
namespace Internal {
namespace Welcome {
struct WelcomeModePrivate;
class CORE_EXPORT WelcomeMode : public Core::IMode
class WELCOME_EXPORT WelcomeMode : public Core::IMode
{
Q_OBJECT
......@@ -102,7 +103,6 @@ private:
WelcomeModePrivate *m_d;
};
} // namespace Internal
} // namespace Core
} // namespace Welcome
#endif // WELCOMEMODE_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Core::Internal::WelcomePage</class>
<widget class="QWidget" name="Core::Internal::WelcomePage">
<class>Welcome::WelcomePage</class>
<widget class="QWidget" name="Welcome::WelcomePage">
<property name="geometry">
<rect>
<x>0</x>
......@@ -11,12 +11,12 @@
</rect>
</property>
<property name="styleSheet">
<string notr="true">#Core--Internal--WelcomePage {
<string notr="true">#Welcome--WelcomePage {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(215, 215, 215, 255));
}
QToolButton, QPushButton, QComboBox {
border-image: url(:/core/images/welcomemode/btn_26.png) 4;
border-image: url(:/welcome/images/btn_26.png) 4;
border-width: 4;
padding: 0px 6px;
font-size: 12px;
......@@ -31,7 +31,7 @@ QToolButton, QPushButton, QComboBox {
}
QComboBox::down-arrow {
image: url(:/core/images/welcomemode/combobox_arrow.png);
image: url(:/welcome/images/combobox_arrow.png);
}
QComboBox:drop-down
......@@ -44,7 +44,7 @@ QComboBox:drop-down
}
QToolButton:hover, QPushButton:hover, QComboBox:hover {
border-image: url(:/core/images/welcomemode/btn_26_hover.png) 4;
border-image: url(:/welcome/images/btn_26_hover.png) 4;
}
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
......@@ -52,7 +52,7 @@ QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {