Commit c7d08f9b authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

Use Open Project button in Getting Started mode

We already have it in the projects mode so we might as well
use the same in "Getting Started".

Reviewed-by: danimo
parent a99614b2
......@@ -1283,6 +1283,18 @@ QPrinter *MainWindow::printer() const
return m_printer;
}
void MainWindow::openProject()
{
// ### We need a way to access the mimedatabase and differentiate
// between project types and other files. This is currently not possible
const QString filters = "All Files (*);;Projects(*.pro *.qmlproject)";
QString selectedFilters = "Projects(*.pro *.qmlproject)";
QStringList files =
Core::ICore::instance()->fileManager()->getOpenFileNames(
filters, tr("Open Project"), &selectedFilters);
openFiles(files);
}
void MainWindow::setFullScreen(bool on)
{
if (bool(windowState() & Qt::WindowFullScreen) == on)
......
......@@ -126,6 +126,7 @@ signals:
void windowActivated();
public slots:
void openProject();
void newFile();
void openFileWith();
void exit();
......
......@@ -91,7 +91,8 @@ ProjectWelcomePageWidget::ProjectWelcomePageWidget(QWidget *parent) :
connect(ui->sessTreeWidget, SIGNAL(activated(QString)), SLOT(slotSessionClicked(QString)));
connect(ui->projTreeWidget, SIGNAL(activated(QString)), SLOT(slotProjectClicked(QString)));
connect(ui->createNewProjectButton, SIGNAL(clicked()), SLOT(slotCreateNewProject()));
connect(ui->openProjectButton, SIGNAL(clicked()), this, SLOT(slotOpenProject()));
connect(ui->openProjectButton, SIGNAL(clicked()),
Core::ICore::instance()->mainWindow(), SLOT(openProject()));
connect(ui->manageSessionsButton, SIGNAL(clicked()), SIGNAL(manageSessions()));
ui->createNewProjectButton->setIcon(
......@@ -160,23 +161,6 @@ void ProjectWelcomePageWidget::activateEditMode()
modeManager->activateMode(Core::Constants::MODE_EDIT);
}
void ProjectWelcomePageWidget::slotOpenProject()
{
// ### We need a way to access the mimedatabase and differentiate
// between project types and other files. This is currently not possible
const QString filters = "All Files (*);;Projects(*.pro *.qmlproject)";
QString selectedFilters = "Projects(*.pro *.qmlproject)";
QStringList files =
Core::ICore::instance()->fileManager()->getOpenFileNames(
filters, tr("Open Project"), &selectedFilters);
Core::Internal::MainWindow *mw = qobject_cast<Core::Internal::MainWindow*>
(Core::ICore::instance()->mainWindow());
Q_ASSERT(mw);
mw->openFiles(files);
}
void ProjectWelcomePageWidget::slotSessionClicked(const QString &data)
{
emit requestSession(data);
......
......@@ -69,7 +69,6 @@ private slots:
void slotSessionClicked(const QString &data);
void slotProjectClicked(const QString &data);
void slotCreateNewProject();
void slotOpenProject();
private:
void activateEditMode();
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>486</width>
<width>520</width>
<height>221</height>
</rect>
</property>
......@@ -153,10 +153,6 @@
<property name="text">
<string>Create Project...</string>
</property>
<property name="icon">
<iconset resource="../coreplugin/core.qrc">
<normaloff>:/core/images/filenew.png</normaloff>:/core/images/filenew.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
......@@ -182,8 +178,6 @@
<header location="global">utils/welcomemodetreewidget.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../coreplugin/core.qrc"/>
</resources>
<resources/>
<connections/>
</ui>
......@@ -32,6 +32,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/mainwindow.h>
#include <utils/pathchooser.h>
......@@ -86,10 +87,13 @@ GettingStartedWelcomePageWidget::GettingStartedWelcomePageWidget(QWidget *parent
connect(ui->nextTipBtn, SIGNAL(clicked()), this, SLOT(slotNextTip()));
connect(ui->prevTipBtn, SIGNAL(clicked()), this, SLOT(slotPrevTip()));
connect(ui->openProjectButton, SIGNAL(clicked()), Core::ICore::instance()->mainWindow(), SLOT(openProject()));
connect(ui->createNewProjectButton, SIGNAL(clicked()), this, SLOT(slotCreateNewProject()));
ui->createNewProjectButton->setIcon(
QIcon::fromTheme("document-new", ui->createNewProjectButton->icon()));
ui->openProjectButton->setIcon(
QIcon::fromTheme("document-open", ui->openProjectButton->icon()));
}
GettingStartedWelcomePageWidget::~GettingStartedWelcomePageWidget()
......
......@@ -61,7 +61,9 @@
</widget>
</item>
<item row="1" column="0">
<widget class="Utils::WelcomeModeTreeWidget" name="tutorialTreeWidget" native="true"/>
<widget class="Utils::WelcomeModeTreeWidget" name="tutorialTreeWidget" native="true">
<zorder></zorder>
</widget>
</item>
</layout>
</widget>
......@@ -353,6 +355,19 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="openProjectButton">
<property name="minimumSize">
<size>
<width>160</width>
<height>36</height>
</size>
</property>
<property name="text">
<string>Open Project...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="createNewProjectButton">
<property name="minimumSize">
......@@ -367,10 +382,6 @@
<property name="text">
<string>Create Project...</string>
</property>
<property name="icon">
<iconset resource="../coreplugin/core.qrc">
<normaloff>:/core/images/filenew.png</normaloff>:/core/images/filenew.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
......@@ -397,7 +408,6 @@
</customwidget>
</customwidgets>
<resources>
<include location="../coreplugin/core.qrc"/>
<include location="../welcome/welcome.qrc"/>
</resources>
<connections/>
......
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