mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-04-08 00:53:48 +02:00
OP-6: WIP
* Removed New/Save/Open dialogs * Removed printer * Changed version number in pluginspec. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@274 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
87dd4942e4
commit
de914586c8
@ -1,4 +1,4 @@
|
|||||||
<plugin name="Core" version="1.3.1" compatVersion="1.3.1">
|
<plugin name="Core" version="1.0.0" compatVersion="1.0.0">
|
||||||
<vendor>The OpenPilot Project</vendor>
|
<vendor>The OpenPilot Project</vendor>
|
||||||
<copyright>(C) 2010 OpenPilot Project</copyright>
|
<copyright>(C) 2010 OpenPilot Project</copyright>
|
||||||
<license>
|
<license>
|
||||||
|
@ -46,7 +46,6 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class IEditor;
|
|
||||||
class IFileWizardExtension;
|
class IFileWizardExtension;
|
||||||
|
|
||||||
class BaseFileWizardParameterData;
|
class BaseFileWizardParameterData;
|
||||||
|
@ -57,13 +57,6 @@ CoreImpl::CoreImpl(MainWindow *mainwindow)
|
|||||||
m_mainwindow = mainwindow;
|
m_mainwindow = mainwindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CoreImpl::showNewItemDialog(const QString &title,
|
|
||||||
const QList<IWizard *> &wizards,
|
|
||||||
const QString &defaultLocation)
|
|
||||||
{
|
|
||||||
return m_mainwindow->showNewItemDialog(title, wizards, defaultLocation);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CoreImpl::showOptionsDialog(const QString &group, const QString &page, QWidget *parent)
|
bool CoreImpl::showOptionsDialog(const QString &group, const QString &page, QWidget *parent)
|
||||||
{
|
{
|
||||||
return m_mainwindow->showOptionsDialog(group, page, parent);
|
return m_mainwindow->showOptionsDialog(group, page, parent);
|
||||||
@ -120,11 +113,6 @@ SettingsDatabase *CoreImpl::settingsDatabase() const
|
|||||||
return m_mainwindow->settingsDatabase();
|
return m_mainwindow->settingsDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPrinter *CoreImpl::printer() const
|
|
||||||
{
|
|
||||||
return m_mainwindow->printer();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
# define SHARE_PATH "/../Resources"
|
# define SHARE_PATH "/../Resources"
|
||||||
#else
|
#else
|
||||||
|
@ -44,9 +44,6 @@ public:
|
|||||||
CoreImpl(MainWindow *mainwindow);
|
CoreImpl(MainWindow *mainwindow);
|
||||||
~CoreImpl() {}
|
~CoreImpl() {}
|
||||||
|
|
||||||
QStringList showNewItemDialog(const QString &title,
|
|
||||||
const QList<IWizard *> &wizards,
|
|
||||||
const QString &defaultLocation = QString());
|
|
||||||
bool showOptionsDialog(const QString &group = QString(),
|
bool showOptionsDialog(const QString &group = QString(),
|
||||||
const QString &page = QString(),
|
const QString &page = QString(),
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
@ -65,7 +62,6 @@ public:
|
|||||||
|
|
||||||
QSettings *settings() const;
|
QSettings *settings() const;
|
||||||
SettingsDatabase *settingsDatabase() const;
|
SettingsDatabase *settingsDatabase() const;
|
||||||
QPrinter *printer() const;
|
|
||||||
|
|
||||||
QString resourcePath() const;
|
QString resourcePath() const;
|
||||||
|
|
||||||
|
@ -28,11 +28,8 @@ SOURCES += mainwindow.cpp \
|
|||||||
actionmanager/command.cpp \
|
actionmanager/command.cpp \
|
||||||
actionmanager/actioncontainer.cpp \
|
actionmanager/actioncontainer.cpp \
|
||||||
actionmanager/commandsfile.cpp \
|
actionmanager/commandsfile.cpp \
|
||||||
dialogs/saveitemsdialog.cpp \
|
|
||||||
dialogs/newdialog.cpp \
|
|
||||||
dialogs/settingsdialog.cpp \
|
dialogs/settingsdialog.cpp \
|
||||||
dialogs/shortcutsettings.cpp \
|
dialogs/shortcutsettings.cpp \
|
||||||
dialogs/openwithdialog.cpp \
|
|
||||||
basemode.cpp \
|
basemode.cpp \
|
||||||
baseview.cpp \
|
baseview.cpp \
|
||||||
coreplugin.cpp \
|
coreplugin.cpp \
|
||||||
@ -68,11 +65,8 @@ HEADERS += mainwindow.h \
|
|||||||
actionmanager/command_p.h \
|
actionmanager/command_p.h \
|
||||||
actionmanager/actioncontainer_p.h \
|
actionmanager/actioncontainer_p.h \
|
||||||
actionmanager/commandsfile.h \
|
actionmanager/commandsfile.h \
|
||||||
dialogs/saveitemsdialog.h \
|
|
||||||
dialogs/newdialog.h \
|
|
||||||
dialogs/settingsdialog.h \
|
dialogs/settingsdialog.h \
|
||||||
dialogs/shortcutsettings.h \
|
dialogs/shortcutsettings.h \
|
||||||
dialogs/openwithdialog.h \
|
|
||||||
dialogs/iwizard.h \
|
dialogs/iwizard.h \
|
||||||
dialogs/ioptionspage.h \
|
dialogs/ioptionspage.h \
|
||||||
icontext.h \
|
icontext.h \
|
||||||
@ -104,11 +98,8 @@ HEADERS += mainwindow.h \
|
|||||||
mimedatabase.h \
|
mimedatabase.h \
|
||||||
settingsdatabase.h \
|
settingsdatabase.h \
|
||||||
eventfilteringmainwindow.h
|
eventfilteringmainwindow.h
|
||||||
FORMS += dialogs/newdialog.ui \
|
FORMS += dialogs/settingsdialog.ui \
|
||||||
dialogs/settingsdialog.ui \
|
|
||||||
dialogs/shortcutsettings.ui \
|
dialogs/shortcutsettings.ui \
|
||||||
dialogs/saveitemsdialog.ui \
|
|
||||||
dialogs/openwithdialog.ui \
|
|
||||||
generalsettings.ui
|
generalsettings.ui
|
||||||
RESOURCES += core.qrc \
|
RESOURCES += core.qrc \
|
||||||
fancyactionbar.qrc
|
fancyactionbar.qrc
|
||||||
|
@ -1,145 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file 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 file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. 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.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "newdialog.h"
|
|
||||||
#include "ui_newdialog.h"
|
|
||||||
#include "basefilewizard.h"
|
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
|
||||||
#include <coreplugin/dialogs/iwizard.h>
|
|
||||||
|
|
||||||
#include <QtGui/QHeaderView>
|
|
||||||
#include <QtGui/QPushButton>
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Core::IWizard*)
|
|
||||||
|
|
||||||
static inline Core::IWizard *wizardOfItem(const QTreeWidgetItem *item = 0)
|
|
||||||
{
|
|
||||||
if (!item)
|
|
||||||
return 0;
|
|
||||||
return qVariantValue<Core::IWizard*>(item->data(0, Qt::UserRole));
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace Core;
|
|
||||||
using namespace Core::Internal;
|
|
||||||
|
|
||||||
NewDialog::NewDialog(QWidget *parent) :
|
|
||||||
QDialog(parent),
|
|
||||||
m_ui(new Core::Internal::Ui::NewDialog),
|
|
||||||
m_okButton(0)
|
|
||||||
{
|
|
||||||
typedef QMap<QString, QTreeWidgetItem *> CategoryItemMap;
|
|
||||||
m_ui->setupUi(this);
|
|
||||||
m_okButton = m_ui->buttonBox->button(QDialogButtonBox::Ok);
|
|
||||||
m_okButton->setDefault(true);
|
|
||||||
|
|
||||||
m_ui->watermark->setPixmap(BaseFileWizard::watermark());
|
|
||||||
|
|
||||||
m_ui->templatesTree->header()->hide();
|
|
||||||
connect(m_ui->templatesTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
|
|
||||||
this, SLOT(currentItemChanged(QTreeWidgetItem*)));
|
|
||||||
connect(m_ui->templatesTree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), m_okButton, SLOT(animateClick()));
|
|
||||||
|
|
||||||
connect(m_okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
|
|
||||||
connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void NewDialog::setWizards(const QList<IWizard*> wizards)
|
|
||||||
{
|
|
||||||
typedef QMap<QString, QTreeWidgetItem *> CategoryItemMap;
|
|
||||||
|
|
||||||
CategoryItemMap categories;
|
|
||||||
QVariant wizardPtr;
|
|
||||||
|
|
||||||
m_ui->templatesTree->clear();
|
|
||||||
foreach (IWizard *wizard, wizards) {
|
|
||||||
// ensure category root
|
|
||||||
const QString categoryName = wizard->category();
|
|
||||||
CategoryItemMap::iterator cit = categories.find(categoryName);
|
|
||||||
if (cit == categories.end()) {
|
|
||||||
QTreeWidgetItem *categoryItem = new QTreeWidgetItem(m_ui->templatesTree);
|
|
||||||
categoryItem->setFlags(Qt::ItemIsEnabled);
|
|
||||||
categoryItem->setText(0, wizard->trCategory());
|
|
||||||
qVariantSetValue<IWizard*>(wizardPtr, 0);
|
|
||||||
categoryItem->setData(0, Qt::UserRole, wizardPtr);
|
|
||||||
cit = categories.insert(categoryName, categoryItem);
|
|
||||||
}
|
|
||||||
// add item
|
|
||||||
QTreeWidgetItem *wizardItem = new QTreeWidgetItem(cit.value(), QStringList(wizard->name()));
|
|
||||||
wizardItem->setIcon(0, wizard->icon());
|
|
||||||
qVariantSetValue<IWizard*>(wizardPtr, wizard);
|
|
||||||
wizardItem->setData(0, Qt::UserRole, wizardPtr);
|
|
||||||
wizardItem->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::IWizard *NewDialog::showDialog()
|
|
||||||
{
|
|
||||||
m_ui->templatesTree->expandAll();
|
|
||||||
if (QTreeWidgetItem *rootItem = m_ui->templatesTree->topLevelItem(0)) {
|
|
||||||
m_ui->templatesTree->scrollToItem(rootItem);
|
|
||||||
if (rootItem->childCount())
|
|
||||||
m_ui->templatesTree->setCurrentItem(rootItem->child(0));
|
|
||||||
}
|
|
||||||
updateOkButton();
|
|
||||||
if (exec() != Accepted)
|
|
||||||
return 0;
|
|
||||||
return currentWizard();
|
|
||||||
}
|
|
||||||
|
|
||||||
NewDialog::~NewDialog()
|
|
||||||
{
|
|
||||||
delete m_ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
IWizard *NewDialog::currentWizard() const
|
|
||||||
{
|
|
||||||
return wizardOfItem(m_ui->templatesTree->currentItem());
|
|
||||||
}
|
|
||||||
|
|
||||||
void NewDialog::currentItemChanged(QTreeWidgetItem *cat)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (const IWizard *wizard = wizardOfItem(cat))
|
|
||||||
m_ui->descLabel->setText(wizard->description());
|
|
||||||
else
|
|
||||||
m_ui->descLabel->setText(QString());
|
|
||||||
updateOkButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
void NewDialog::okButtonClicked()
|
|
||||||
{
|
|
||||||
if (m_ui->templatesTree->currentItem())
|
|
||||||
accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
void NewDialog::updateOkButton()
|
|
||||||
{
|
|
||||||
m_okButton->setEnabled(currentWizard() != 0);
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file 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 file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. 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.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef NEWDIALOG_H
|
|
||||||
#define NEWDIALOG_H
|
|
||||||
|
|
||||||
#include <QtGui/QDialog>
|
|
||||||
#include <QtCore/QList>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QPushButton;
|
|
||||||
class QTreeWidgetItem;
|
|
||||||
class QStringList;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
|
|
||||||
class IWizard;
|
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class NewDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
class NewDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit NewDialog(QWidget *parent);
|
|
||||||
virtual ~NewDialog();
|
|
||||||
|
|
||||||
void setWizards(const QList<IWizard*> wizards);
|
|
||||||
|
|
||||||
Core::IWizard *showDialog();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void currentItemChanged(QTreeWidgetItem *cat);
|
|
||||||
void okButtonClicked();
|
|
||||||
void updateOkButton();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Core::IWizard *currentWizard() const;
|
|
||||||
|
|
||||||
Ui::NewDialog *m_ui;
|
|
||||||
QPushButton *m_okButton;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Core
|
|
||||||
|
|
||||||
#endif // NEWDIALOG_H
|
|
@ -1,80 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Core::Internal::NewDialog</class>
|
|
||||||
<widget class="QDialog" name="Core::Internal::NewDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>490</width>
|
|
||||||
<height>390</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>New Project</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout">
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QTreeWidget" name="templatesTree">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>400</width>
|
|
||||||
<height>301</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>1</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLabel" name="descLabel">
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="watermark">
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@ -1,84 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file 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 file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. 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.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "openwithdialog.h"
|
|
||||||
|
|
||||||
#include <QtGui/QListWidget>
|
|
||||||
#include <QtGui/QPushButton>
|
|
||||||
#include <QtCore/QFileInfo>
|
|
||||||
|
|
||||||
using namespace Core;
|
|
||||||
using namespace Core::Internal;
|
|
||||||
|
|
||||||
OpenWithDialog::OpenWithDialog(const QString &fileName, QWidget *parent)
|
|
||||||
: QDialog(parent)
|
|
||||||
{
|
|
||||||
setupUi(this);
|
|
||||||
label->setText(tr("Open file '%1' with:").arg(QFileInfo(fileName).fileName()));
|
|
||||||
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
|
|
||||||
|
|
||||||
connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
|
|
||||||
this, SLOT(accept()));
|
|
||||||
connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
|
|
||||||
this, SLOT(reject()));
|
|
||||||
connect(editorListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
|
|
||||||
this, SLOT(accept()));
|
|
||||||
connect(editorListWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
|
|
||||||
this, SLOT(currentItemChanged(QListWidgetItem*,QListWidgetItem*)));
|
|
||||||
|
|
||||||
setOkButtonEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenWithDialog::setOkButtonEnabled(bool v)
|
|
||||||
{
|
|
||||||
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenWithDialog::setEditors(const QStringList &editors)
|
|
||||||
{
|
|
||||||
foreach (const QString &e, editors)
|
|
||||||
editorListWidget->addItem(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString OpenWithDialog::editor() const
|
|
||||||
{
|
|
||||||
if (const QListWidgetItem *item = editorListWidget->currentItem())
|
|
||||||
return item->text();
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenWithDialog::setCurrentEditor(int index)
|
|
||||||
{
|
|
||||||
editorListWidget->setCurrentRow(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenWithDialog::currentItemChanged(QListWidgetItem *current, QListWidgetItem *)
|
|
||||||
{
|
|
||||||
setOkButtonEnabled(current);
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file 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 file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. 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.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef OPENWITHDIALOG_H
|
|
||||||
#define OPENWITHDIALOG_H
|
|
||||||
|
|
||||||
#include <QtGui/QDialog>
|
|
||||||
#include "ui_openwithdialog.h"
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
|
|
||||||
class ICore;
|
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
// Present the user with a file name and a list of available
|
|
||||||
// editor kinds to choose from.
|
|
||||||
class OpenWithDialog : public QDialog, public Ui::OpenWithDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
OpenWithDialog(const QString &fileName, QWidget *parent);
|
|
||||||
|
|
||||||
void setEditors(const QStringList &);
|
|
||||||
QString editor() const;
|
|
||||||
|
|
||||||
void setCurrentEditor(int index);
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void currentItemChanged(QListWidgetItem *, QListWidgetItem *);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void setOkButtonEnabled(bool);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Core
|
|
||||||
|
|
||||||
#endif // OPENWITHDIALOG_H
|
|
@ -1,46 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>OpenWithDialog</class>
|
|
||||||
<widget class="QWidget" name="OpenWithDialog" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>358</width>
|
|
||||||
<height>199</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle" >
|
|
||||||
<string>Open File With...</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Open file extension with:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QListWidget" name="editorListWidget" />
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons" >
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@ -1,137 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file 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 file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. 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.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "saveitemsdialog.h"
|
|
||||||
#include "mainwindow.h"
|
|
||||||
|
|
||||||
#include <coreplugin/ifile.h>
|
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
|
||||||
#include <QtCore/QFileInfo>
|
|
||||||
#include <QtCore/QDir>
|
|
||||||
#include <QtGui/QPushButton>
|
|
||||||
#include <QtGui/QTreeWidget>
|
|
||||||
#include <QtGui/QHeaderView>
|
|
||||||
#include <QtGui/QCheckBox>
|
|
||||||
#include <QtGui/QPushButton>
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Core::IFile*);
|
|
||||||
|
|
||||||
using namespace Core;
|
|
||||||
using namespace Core::Internal;
|
|
||||||
|
|
||||||
SaveItemsDialog::SaveItemsDialog(QWidget *parent,
|
|
||||||
QList<IFile *> items)
|
|
||||||
: QDialog(parent)
|
|
||||||
{
|
|
||||||
m_ui.setupUi(this);
|
|
||||||
QPushButton *discardButton = m_ui.buttonBox->addButton(tr("Do not Save"), QDialogButtonBox::DestructiveRole);
|
|
||||||
m_ui.buttonBox->button(QDialogButtonBox::Save)->setDefault(true);
|
|
||||||
m_ui.buttonBox->button(QDialogButtonBox::Save)->setFocus(Qt::TabFocusReason);
|
|
||||||
m_ui.buttonBox->button(QDialogButtonBox::Save)->setMinimumWidth(130); // bad magic number to avoid resizing of button
|
|
||||||
|
|
||||||
m_ui.saveBeforeBuildCheckBox->setVisible(false);
|
|
||||||
|
|
||||||
foreach (IFile *file, items) {
|
|
||||||
QString visibleName;
|
|
||||||
QString directory;
|
|
||||||
QString fileName = file->fileName();
|
|
||||||
if (fileName.isEmpty()) {
|
|
||||||
visibleName = file->suggestedFileName();
|
|
||||||
} else {
|
|
||||||
QFileInfo info = QFileInfo(fileName);
|
|
||||||
directory = info.absolutePath();
|
|
||||||
visibleName = info.fileName();
|
|
||||||
}
|
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.treeWidget, QStringList()
|
|
||||||
<< visibleName << QDir::toNativeSeparators(directory));
|
|
||||||
item->setData(0, Qt::UserRole, qVariantFromValue(file));
|
|
||||||
}
|
|
||||||
|
|
||||||
m_ui.treeWidget->resizeColumnToContents(0);
|
|
||||||
m_ui.treeWidget->selectAll();
|
|
||||||
updateSaveButton();
|
|
||||||
|
|
||||||
connect(m_ui.buttonBox->button(QDialogButtonBox::Save), SIGNAL(clicked()),
|
|
||||||
this, SLOT(collectItemsToSave()));
|
|
||||||
connect(discardButton, SIGNAL(clicked()), this, SLOT(discardAll()));
|
|
||||||
connect(m_ui.treeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(updateSaveButton()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SaveItemsDialog::setMessage(const QString &msg)
|
|
||||||
{
|
|
||||||
m_ui.msgLabel->setText(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SaveItemsDialog::updateSaveButton()
|
|
||||||
{
|
|
||||||
int count = m_ui.treeWidget->selectedItems().count();
|
|
||||||
QPushButton *button = m_ui.buttonBox->button(QDialogButtonBox::Save);
|
|
||||||
if (count == m_ui.treeWidget->topLevelItemCount()) {
|
|
||||||
button->setEnabled(true);
|
|
||||||
button->setText(tr("Save All"));
|
|
||||||
} else if (count == 0) {
|
|
||||||
button->setEnabled(false);
|
|
||||||
button->setText(tr("Save"));
|
|
||||||
} else {
|
|
||||||
button->setEnabled(true);
|
|
||||||
button->setText(tr("Save Selected"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SaveItemsDialog::collectItemsToSave()
|
|
||||||
{
|
|
||||||
m_itemsToSave.clear();
|
|
||||||
foreach (QTreeWidgetItem *item, m_ui.treeWidget->selectedItems()) {
|
|
||||||
m_itemsToSave.append(item->data(0, Qt::UserRole).value<IFile*>());
|
|
||||||
}
|
|
||||||
accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SaveItemsDialog::discardAll()
|
|
||||||
{
|
|
||||||
m_ui.treeWidget->clearSelection();
|
|
||||||
collectItemsToSave();
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<IFile*> SaveItemsDialog::itemsToSave() const
|
|
||||||
{
|
|
||||||
return m_itemsToSave;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SaveItemsDialog::setAlwaysSaveMessage(const QString &msg)
|
|
||||||
{
|
|
||||||
m_ui.saveBeforeBuildCheckBox->setText(msg);
|
|
||||||
m_ui.saveBeforeBuildCheckBox->setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SaveItemsDialog::alwaysSaveChecked()
|
|
||||||
{
|
|
||||||
return m_ui.saveBeforeBuildCheckBox->isChecked();
|
|
||||||
}
|
|
@ -1,76 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator
|
|
||||||
**
|
|
||||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
**
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** Commercial Usage
|
|
||||||
**
|
|
||||||
** Licensees holding valid Qt Commercial licenses may use this file 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 file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. 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.
|
|
||||||
**
|
|
||||||
** If you are unsure which license is appropriate for your use, please
|
|
||||||
** contact the sales department at http://qt.nokia.com/contact.
|
|
||||||
**
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef SAVEITEMSDIALOG_H
|
|
||||||
#define SAVEITEMSDIALOG_H
|
|
||||||
|
|
||||||
#include <QtCore/QMap>
|
|
||||||
#include <QtGui/QDialog>
|
|
||||||
|
|
||||||
#include "ui_saveitemsdialog.h"
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QCheckBox;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
|
|
||||||
class IFile;
|
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class MainWindow;
|
|
||||||
|
|
||||||
class SaveItemsDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
SaveItemsDialog(QWidget *parent,
|
|
||||||
QList<Core::IFile *> items);
|
|
||||||
|
|
||||||
void setMessage(const QString &msg);
|
|
||||||
void setAlwaysSaveMessage(const QString &msg);
|
|
||||||
bool alwaysSaveChecked();
|
|
||||||
QList<Core::IFile *> itemsToSave() const;
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void collectItemsToSave();
|
|
||||||
void discardAll();
|
|
||||||
void updateSaveButton();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::SaveItemsDialog m_ui;
|
|
||||||
QList<Core::IFile*> m_itemsToSave;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Core
|
|
||||||
|
|
||||||
#endif // SAVEITEMSDIALOG_H
|
|
@ -1,100 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>SaveItemsDialog</class>
|
|
||||||
<widget class="QDialog" name="SaveItemsDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>457</width>
|
|
||||||
<height>200</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Save Changes</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="msgLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>The following files have unsaved changes:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QTreeWidget" name="treeWidget">
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="textElideMode">
|
|
||||||
<enum>Qt::ElideLeft</enum>
|
|
||||||
</property>
|
|
||||||
<property name="indentation">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rootIsDecorated">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="uniformRowHeights">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="headerHidden">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="columnCount">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">1</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">2</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="saveBeforeBuildCheckBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Automatically save all files before building</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>treeWidget</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>buttonBox</sender>
|
|
||||||
<signal>rejected()</signal>
|
|
||||||
<receiver>SaveItemsDialog</receiver>
|
|
||||||
<slot>reject()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>199</x>
|
|
||||||
<y>174</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>199</x>
|
|
||||||
<y>99</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
@ -186,14 +186,6 @@
|
|||||||
\see SettingsDatabase
|
\see SettingsDatabase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QPrinter *ICore::printer() const
|
|
||||||
\brief Returns the application's printer object.
|
|
||||||
|
|
||||||
Always use this printer object for printing, so the different parts of the
|
|
||||||
application re-use its settings.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QString ICore::resourcePath() const
|
\fn QString ICore::resourcePath() const
|
||||||
\brief Returns the absolute path that is used for resources like
|
\brief Returns the absolute path that is used for resources like
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QMainWindow;
|
class QMainWindow;
|
||||||
class QPrinter;
|
|
||||||
class QSettings;
|
class QSettings;
|
||||||
template <class T> class QList;
|
template <class T> class QList;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
@ -62,10 +61,6 @@ public:
|
|||||||
|
|
||||||
static ICore *instance();
|
static ICore *instance();
|
||||||
|
|
||||||
virtual QStringList showNewItemDialog(const QString &title,
|
|
||||||
const QList<IWizard *> &wizards,
|
|
||||||
const QString &defaultLocation = QString()) = 0;
|
|
||||||
|
|
||||||
virtual bool showOptionsDialog(const QString &group = QString(),
|
virtual bool showOptionsDialog(const QString &group = QString(),
|
||||||
const QString &page = QString(),
|
const QString &page = QString(),
|
||||||
QWidget *parent = 0) = 0;
|
QWidget *parent = 0) = 0;
|
||||||
@ -85,7 +80,6 @@ public:
|
|||||||
|
|
||||||
virtual QSettings *settings() const = 0;
|
virtual QSettings *settings() const = 0;
|
||||||
virtual SettingsDatabase *settingsDatabase() const = 0;
|
virtual SettingsDatabase *settingsDatabase() const = 0;
|
||||||
virtual QPrinter *printer() const = 0;
|
|
||||||
|
|
||||||
virtual QString resourcePath() const = 0;
|
virtual QString resourcePath() const = 0;
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class IEditor;
|
|
||||||
/*!
|
/*!
|
||||||
\class Core::ICoreListener
|
\class Core::ICoreListener
|
||||||
|
|
||||||
@ -66,7 +65,6 @@ public:
|
|||||||
ICoreListener(QObject *parent = 0) : QObject(parent) {}
|
ICoreListener(QObject *parent = 0) : QObject(parent) {}
|
||||||
virtual ~ICoreListener() {}
|
virtual ~ICoreListener() {}
|
||||||
|
|
||||||
virtual bool editorAboutToClose(IEditor * /*editor*/) { return true; }
|
|
||||||
virtual bool coreAboutToClose() { return true; }
|
virtual bool coreAboutToClose() { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#include "messagemanager.h"
|
#include "messagemanager.h"
|
||||||
#include "modemanager.h"
|
#include "modemanager.h"
|
||||||
#include "mimedatabase.h"
|
#include "mimedatabase.h"
|
||||||
#include "newdialog.h"
|
|
||||||
#include "outputpane.h"
|
#include "outputpane.h"
|
||||||
#include "plugindialog.h"
|
#include "plugindialog.h"
|
||||||
#include "shortcutsettings.h"
|
#include "shortcutsettings.h"
|
||||||
@ -73,11 +72,9 @@
|
|||||||
#include <QtGui/QCloseEvent>
|
#include <QtGui/QCloseEvent>
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QPixmap>
|
#include <QtGui/QPixmap>
|
||||||
#include <QtGui/QPrinter>
|
|
||||||
#include <QtGui/QShortcut>
|
#include <QtGui/QShortcut>
|
||||||
#include <QtGui/QStatusBar>
|
#include <QtGui/QStatusBar>
|
||||||
#include <QtGui/QWizard>
|
#include <QtGui/QWizard>
|
||||||
#include <QtGui/QPrinter>
|
|
||||||
#include <QtGui/QToolButton>
|
#include <QtGui/QToolButton>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
|
|
||||||
@ -111,7 +108,6 @@ MainWindow::MainWindow() :
|
|||||||
m_settingsDatabase(new SettingsDatabase(QFileInfo(m_settings->fileName()).path(),
|
m_settingsDatabase(new SettingsDatabase(QFileInfo(m_settings->fileName()).path(),
|
||||||
QLatin1String("OpenPilotGCS"),
|
QLatin1String("OpenPilotGCS"),
|
||||||
this)),
|
this)),
|
||||||
m_printer(0),
|
|
||||||
m_actionManager(new ActionManagerPrivate(this)),
|
m_actionManager(new ActionManagerPrivate(this)),
|
||||||
m_variableManager(new VariableManager(this)),
|
m_variableManager(new VariableManager(this)),
|
||||||
m_viewManager(0),
|
m_viewManager(0),
|
||||||
@ -200,8 +196,6 @@ MainWindow::~MainWindow()
|
|||||||
m_generalSettings = 0;
|
m_generalSettings = 0;
|
||||||
delete m_settings;
|
delete m_settings;
|
||||||
m_settings = 0;
|
m_settings = 0;
|
||||||
delete m_printer;
|
|
||||||
m_printer = 0;
|
|
||||||
delete m_uniqueIDManager;
|
delete m_uniqueIDManager;
|
||||||
m_uniqueIDManager = 0;
|
m_uniqueIDManager = 0;
|
||||||
|
|
||||||
@ -628,7 +622,6 @@ void MainWindow::registerDefaultActions()
|
|||||||
|
|
||||||
void MainWindow::newFile()
|
void MainWindow::newFile()
|
||||||
{
|
{
|
||||||
showNewItemDialog(tr("New...", "Title of dialog"), IWizard::allWizards());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::openFile()
|
void MainWindow::openFile()
|
||||||
@ -637,15 +630,6 @@ void MainWindow::openFile()
|
|||||||
|
|
||||||
static QList<IFileFactory*> getNonEditorFileFactories()
|
static QList<IFileFactory*> getNonEditorFileFactories()
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
const QList<IFileFactory*> allFileFactories =
|
|
||||||
ExtensionSystem::PluginManager::instance()->getObjects<IFileFactory>();
|
|
||||||
QList<IFileFactory*> nonEditorFileFactories;
|
|
||||||
foreach (IFileFactory *factory, allFileFactories) {
|
|
||||||
if (!qobject_cast<IEditorFactory *>(factory))
|
|
||||||
nonEditorFileFactories.append(factory);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
QList<IFileFactory*> tmp;
|
QList<IFileFactory*> tmp;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
@ -685,39 +669,6 @@ void MainWindow::setFocusToEditor()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList MainWindow::showNewItemDialog(const QString &title,
|
|
||||||
const QList<IWizard *> &wizards,
|
|
||||||
const QString &defaultLocation)
|
|
||||||
{
|
|
||||||
|
|
||||||
QString defaultDir = defaultLocation;
|
|
||||||
|
|
||||||
if (defaultDir.isEmpty())
|
|
||||||
defaultDir = Utils::PathChooser::homePath();
|
|
||||||
|
|
||||||
// Scan for wizards matching the filter and pick one. Don't show
|
|
||||||
// dialog if there is only one.
|
|
||||||
IWizard *wizard = 0;
|
|
||||||
switch (wizards.size()) {
|
|
||||||
case 0:
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
wizard = wizards.front();
|
|
||||||
break;
|
|
||||||
default: {
|
|
||||||
NewDialog dlg(this);
|
|
||||||
dlg.setWizards(wizards);
|
|
||||||
dlg.setWindowTitle(title);
|
|
||||||
wizard = dlg.showDialog();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!wizard)
|
|
||||||
return QStringList();
|
|
||||||
return wizard->runWizard(defaultDir, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MainWindow::showOptionsDialog(const QString &category,
|
bool MainWindow::showOptionsDialog(const QString &category,
|
||||||
const QString &page,
|
const QString &page,
|
||||||
QWidget *parent)
|
QWidget *parent)
|
||||||
@ -1020,13 +971,6 @@ void MainWindow::aboutPlugins()
|
|||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPrinter *MainWindow::printer() const
|
|
||||||
{
|
|
||||||
if (!m_printer)
|
|
||||||
m_printer = new QPrinter(QPrinter::HighResolution);
|
|
||||||
return m_printer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::setFullScreen(bool on)
|
void MainWindow::setFullScreen(bool on)
|
||||||
{
|
{
|
||||||
if (bool(windowState() & Qt::WindowFullScreen) == on)
|
if (bool(windowState() & Qt::WindowFullScreen) == on)
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QSettings;
|
class QSettings;
|
||||||
class QShortcut;
|
class QShortcut;
|
||||||
class QPrinter;
|
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
@ -98,7 +97,6 @@ public:
|
|||||||
|
|
||||||
inline QSettings *settings() const { return m_settings; }
|
inline QSettings *settings() const { return m_settings; }
|
||||||
inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; }
|
inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; }
|
||||||
virtual QPrinter *printer() const;
|
|
||||||
IContext * currentContextObject() const;
|
IContext * currentContextObject() const;
|
||||||
QStatusBar *statusBar() const;
|
QStatusBar *statusBar() const;
|
||||||
void addAdditionalContext(int context);
|
void addAdditionalContext(int context);
|
||||||
@ -118,10 +116,6 @@ public slots:
|
|||||||
void exit();
|
void exit();
|
||||||
void setFullScreen(bool on);
|
void setFullScreen(bool on);
|
||||||
|
|
||||||
QStringList showNewItemDialog(const QString &title,
|
|
||||||
const QList<IWizard *> &wizards,
|
|
||||||
const QString &defaultLocation = QString());
|
|
||||||
|
|
||||||
bool showOptionsDialog(const QString &category = QString(),
|
bool showOptionsDialog(const QString &category = QString(),
|
||||||
const QString &page = QString(),
|
const QString &page = QString(),
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
@ -164,7 +158,6 @@ private:
|
|||||||
QList<int> m_additionalContexts;
|
QList<int> m_additionalContexts;
|
||||||
QSettings *m_settings;
|
QSettings *m_settings;
|
||||||
SettingsDatabase *m_settingsDatabase;
|
SettingsDatabase *m_settingsDatabase;
|
||||||
mutable QPrinter *m_printer;
|
|
||||||
ActionManagerPrivate *m_actionManager;
|
ActionManagerPrivate *m_actionManager;
|
||||||
MessageManager *m_messageManager;
|
MessageManager *m_messageManager;
|
||||||
VariableManager *m_variableManager;
|
VariableManager *m_variableManager;
|
||||||
|
@ -84,21 +84,6 @@ void VariableManager::removeFileInfo(const QString &tag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void VariableManager::updateCurrentDocument(Core::IEditor *editor)
|
|
||||||
{
|
|
||||||
const QString currentDocumentTag = QLatin1String("CURRENT_DOCUMENT");
|
|
||||||
removeFileInfo(currentDocumentTag);
|
|
||||||
if (editor) {
|
|
||||||
if (const Core::IFile *file = editor->file()) {
|
|
||||||
const QString fileName = file->fileName();
|
|
||||||
if (!fileName.isEmpty())
|
|
||||||
insertFileInfo(currentDocumentTag, fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QString VariableManager::value(const QString &variable) const
|
QString VariableManager::value(const QString &variable) const
|
||||||
{
|
{
|
||||||
return m_map.value(variable);
|
return m_map.value(variable);
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS = plugin_coreplugin \
|
SUBDIRS = plugin_coreplugin \
|
||||||
plugin_welcome
|
plugin_welcome \
|
||||||
|
plugin_tutorial
|
||||||
|
|
||||||
# Blank Template Plugin, not compiled by default
|
# Blank Template Plugin, not compiled by default
|
||||||
#SUBDIRS += plugin_donothing
|
#SUBDIRS += plugin_donothing
|
||||||
@ -18,3 +19,6 @@ plugin_coreplugin.subdir = coreplugin
|
|||||||
plugin_welcome.subdir = welcome
|
plugin_welcome.subdir = welcome
|
||||||
plugin_welcome.depends = plugin_coreplugin
|
plugin_welcome.depends = plugin_coreplugin
|
||||||
|
|
||||||
|
plugin_tutorial.subdir = tutorial
|
||||||
|
plugin_tutorial.depends = plugin_coreplugin
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<plugin name="Welcome" version="1.3.1" compatVersion="1.3.1">
|
<plugin name="Welcome" version="1.0.0" compatVersion="1.0.0">
|
||||||
<vendor>The OpenPilot Project</vendor>
|
<vendor>The OpenPilot Project</vendor>
|
||||||
<copyright>(C) 2010 OpenPilot Project</copyright>
|
<copyright>(C) 2010 OpenPilot Project</copyright>
|
||||||
<license>
|
<license>
|
||||||
@ -12,6 +12,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
|
|||||||
<description>Default Welcome Screen Plugin</description>
|
<description>Default Welcome Screen Plugin</description>
|
||||||
<url>http://www.openpilot.org</url>
|
<url>http://www.openpilot.org</url>
|
||||||
<dependencyList>
|
<dependencyList>
|
||||||
<dependency name="Core" version="1.3.1"/>
|
<dependency name="Core" version="1.0.0"/>
|
||||||
</dependencyList>
|
</dependencyList>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
#include <coreplugin/uniqueidmanager.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/dialogs/newdialog.h>
|
|
||||||
|
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
#include <utils/welcomemodetreewidget.h>
|
#include <utils/welcomemodetreewidget.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user