diff --git a/ground/src/plugins/coreplugin/Core.pluginspec b/ground/src/plugins/coreplugin/Core.pluginspec index 72f71a872..cbda03344 100644 --- a/ground/src/plugins/coreplugin/Core.pluginspec +++ b/ground/src/plugins/coreplugin/Core.pluginspec @@ -1,4 +1,4 @@ - + The OpenPilot Project (C) 2010 OpenPilot Project diff --git a/ground/src/plugins/coreplugin/basefilewizard.h b/ground/src/plugins/coreplugin/basefilewizard.h index fb2711379..cb56ea7fb 100644 --- a/ground/src/plugins/coreplugin/basefilewizard.h +++ b/ground/src/plugins/coreplugin/basefilewizard.h @@ -46,7 +46,6 @@ QT_END_NAMESPACE namespace Core { -class IEditor; class IFileWizardExtension; class BaseFileWizardParameterData; diff --git a/ground/src/plugins/coreplugin/coreimpl.cpp b/ground/src/plugins/coreplugin/coreimpl.cpp index f9282a2ce..4ea5f17aa 100644 --- a/ground/src/plugins/coreplugin/coreimpl.cpp +++ b/ground/src/plugins/coreplugin/coreimpl.cpp @@ -57,13 +57,6 @@ CoreImpl::CoreImpl(MainWindow *mainwindow) m_mainwindow = mainwindow; } -QStringList CoreImpl::showNewItemDialog(const QString &title, - const QList &wizards, - const QString &defaultLocation) -{ - return m_mainwindow->showNewItemDialog(title, wizards, defaultLocation); -} - bool CoreImpl::showOptionsDialog(const QString &group, const QString &page, QWidget *parent) { return m_mainwindow->showOptionsDialog(group, page, parent); @@ -120,11 +113,6 @@ SettingsDatabase *CoreImpl::settingsDatabase() const return m_mainwindow->settingsDatabase(); } -QPrinter *CoreImpl::printer() const -{ - return m_mainwindow->printer(); -} - #ifdef Q_OS_MAC # define SHARE_PATH "/../Resources" #else diff --git a/ground/src/plugins/coreplugin/coreimpl.h b/ground/src/plugins/coreplugin/coreimpl.h index 5a6a531fd..e0cc89a5e 100644 --- a/ground/src/plugins/coreplugin/coreimpl.h +++ b/ground/src/plugins/coreplugin/coreimpl.h @@ -44,9 +44,6 @@ public: CoreImpl(MainWindow *mainwindow); ~CoreImpl() {} - QStringList showNewItemDialog(const QString &title, - const QList &wizards, - const QString &defaultLocation = QString()); bool showOptionsDialog(const QString &group = QString(), const QString &page = QString(), QWidget *parent = 0); @@ -65,7 +62,6 @@ public: QSettings *settings() const; SettingsDatabase *settingsDatabase() const; - QPrinter *printer() const; QString resourcePath() const; diff --git a/ground/src/plugins/coreplugin/coreplugin.pro b/ground/src/plugins/coreplugin/coreplugin.pro index f49beacbc..43072da55 100644 --- a/ground/src/plugins/coreplugin/coreplugin.pro +++ b/ground/src/plugins/coreplugin/coreplugin.pro @@ -28,11 +28,8 @@ SOURCES += mainwindow.cpp \ actionmanager/command.cpp \ actionmanager/actioncontainer.cpp \ actionmanager/commandsfile.cpp \ - dialogs/saveitemsdialog.cpp \ - dialogs/newdialog.cpp \ dialogs/settingsdialog.cpp \ dialogs/shortcutsettings.cpp \ - dialogs/openwithdialog.cpp \ basemode.cpp \ baseview.cpp \ coreplugin.cpp \ @@ -68,11 +65,8 @@ HEADERS += mainwindow.h \ actionmanager/command_p.h \ actionmanager/actioncontainer_p.h \ actionmanager/commandsfile.h \ - dialogs/saveitemsdialog.h \ - dialogs/newdialog.h \ dialogs/settingsdialog.h \ dialogs/shortcutsettings.h \ - dialogs/openwithdialog.h \ dialogs/iwizard.h \ dialogs/ioptionspage.h \ icontext.h \ @@ -104,11 +98,8 @@ HEADERS += mainwindow.h \ mimedatabase.h \ settingsdatabase.h \ eventfilteringmainwindow.h -FORMS += dialogs/newdialog.ui \ - dialogs/settingsdialog.ui \ +FORMS += dialogs/settingsdialog.ui \ dialogs/shortcutsettings.ui \ - dialogs/saveitemsdialog.ui \ - dialogs/openwithdialog.ui \ generalsettings.ui RESOURCES += core.qrc \ fancyactionbar.qrc diff --git a/ground/src/plugins/coreplugin/dialogs/newdialog.cpp b/ground/src/plugins/coreplugin/dialogs/newdialog.cpp deleted file mode 100644 index 19c010843..000000000 --- a/ground/src/plugins/coreplugin/dialogs/newdialog.cpp +++ /dev/null @@ -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 -#include - -#include -#include - -Q_DECLARE_METATYPE(Core::IWizard*) - -static inline Core::IWizard *wizardOfItem(const QTreeWidgetItem *item = 0) -{ - if (!item) - return 0; - return qVariantValue(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 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 wizards) -{ - typedef QMap 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(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(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); -} diff --git a/ground/src/plugins/coreplugin/dialogs/newdialog.h b/ground/src/plugins/coreplugin/dialogs/newdialog.h deleted file mode 100644 index 005f65fb1..000000000 --- a/ground/src/plugins/coreplugin/dialogs/newdialog.h +++ /dev/null @@ -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 -#include - -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 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 diff --git a/ground/src/plugins/coreplugin/dialogs/newdialog.ui b/ground/src/plugins/coreplugin/dialogs/newdialog.ui deleted file mode 100644 index a21b06a8c..000000000 --- a/ground/src/plugins/coreplugin/dialogs/newdialog.ui +++ /dev/null @@ -1,80 +0,0 @@ - - - Core::Internal::NewDialog - - - - 0 - 0 - 490 - 390 - - - - New Project - - - - 6 - - - 9 - - - - - 0 - - - 6 - - - - - - 400 - 301 - - - - - 1 - - - - - - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - diff --git a/ground/src/plugins/coreplugin/dialogs/openwithdialog.cpp b/ground/src/plugins/coreplugin/dialogs/openwithdialog.cpp deleted file mode 100644 index a35602328..000000000 --- a/ground/src/plugins/coreplugin/dialogs/openwithdialog.cpp +++ /dev/null @@ -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 -#include -#include - -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); -} diff --git a/ground/src/plugins/coreplugin/dialogs/openwithdialog.h b/ground/src/plugins/coreplugin/dialogs/openwithdialog.h deleted file mode 100644 index 4d4000060..000000000 --- a/ground/src/plugins/coreplugin/dialogs/openwithdialog.h +++ /dev/null @@ -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 -#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 diff --git a/ground/src/plugins/coreplugin/dialogs/openwithdialog.ui b/ground/src/plugins/coreplugin/dialogs/openwithdialog.ui deleted file mode 100644 index 1ec069d59..000000000 --- a/ground/src/plugins/coreplugin/dialogs/openwithdialog.ui +++ /dev/null @@ -1,46 +0,0 @@ - - OpenWithDialog - - - - 0 - 0 - 358 - 199 - - - - Open File With... - - - - 9 - - - 6 - - - - - Open file extension with: - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - - diff --git a/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp b/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp deleted file mode 100644 index 84dfb64f5..000000000 --- a/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp +++ /dev/null @@ -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 - -#include -#include -#include -#include -#include -#include -#include -#include - -Q_DECLARE_METATYPE(Core::IFile*); - -using namespace Core; -using namespace Core::Internal; - -SaveItemsDialog::SaveItemsDialog(QWidget *parent, - QList 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()); - } - accept(); -} - -void SaveItemsDialog::discardAll() -{ - m_ui.treeWidget->clearSelection(); - collectItemsToSave(); -} - -QList 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(); -} diff --git a/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.h b/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.h deleted file mode 100644 index 5c575c27a..000000000 --- a/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.h +++ /dev/null @@ -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 -#include - -#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 items); - - void setMessage(const QString &msg); - void setAlwaysSaveMessage(const QString &msg); - bool alwaysSaveChecked(); - QList itemsToSave() const; - -private slots: - void collectItemsToSave(); - void discardAll(); - void updateSaveButton(); - -private: - Ui::SaveItemsDialog m_ui; - QList m_itemsToSave; -}; - -} // namespace Internal -} // namespace Core - -#endif // SAVEITEMSDIALOG_H diff --git a/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.ui b/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.ui deleted file mode 100644 index 2565ed2c4..000000000 --- a/ground/src/plugins/coreplugin/dialogs/saveitemsdialog.ui +++ /dev/null @@ -1,100 +0,0 @@ - - - SaveItemsDialog - - - - 0 - 0 - 457 - 200 - - - - Save Changes - - - - - - The following files have unsaved changes: - - - - - - - QAbstractItemView::ExtendedSelection - - - Qt::ElideLeft - - - 0 - - - false - - - true - - - true - - - 2 - - - - 1 - - - - - 2 - - - - - - - - Automatically save all files before building - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - - - treeWidget - - - - - buttonBox - rejected() - SaveItemsDialog - reject() - - - 199 - 174 - - - 199 - 99 - - - - - diff --git a/ground/src/plugins/coreplugin/icore.cpp b/ground/src/plugins/coreplugin/icore.cpp index 11d7ba77b..b9f0bb6db 100644 --- a/ground/src/plugins/coreplugin/icore.cpp +++ b/ground/src/plugins/coreplugin/icore.cpp @@ -186,14 +186,6 @@ \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 \brief Returns the absolute path that is used for resources like diff --git a/ground/src/plugins/coreplugin/icore.h b/ground/src/plugins/coreplugin/icore.h index 1b8f8a45d..a7ca9e0b5 100644 --- a/ground/src/plugins/coreplugin/icore.h +++ b/ground/src/plugins/coreplugin/icore.h @@ -35,7 +35,6 @@ QT_BEGIN_NAMESPACE class QMainWindow; -class QPrinter; class QSettings; template class QList; QT_END_NAMESPACE @@ -62,10 +61,6 @@ public: static ICore *instance(); - virtual QStringList showNewItemDialog(const QString &title, - const QList &wizards, - const QString &defaultLocation = QString()) = 0; - virtual bool showOptionsDialog(const QString &group = QString(), const QString &page = QString(), QWidget *parent = 0) = 0; @@ -85,7 +80,6 @@ public: virtual QSettings *settings() const = 0; virtual SettingsDatabase *settingsDatabase() const = 0; - virtual QPrinter *printer() const = 0; virtual QString resourcePath() const = 0; diff --git a/ground/src/plugins/coreplugin/icorelistener.h b/ground/src/plugins/coreplugin/icorelistener.h index 08d77fd7e..a00e9052b 100644 --- a/ground/src/plugins/coreplugin/icorelistener.h +++ b/ground/src/plugins/coreplugin/icorelistener.h @@ -34,7 +34,6 @@ #include namespace Core { -class IEditor; /*! \class Core::ICoreListener @@ -66,7 +65,6 @@ public: ICoreListener(QObject *parent = 0) : QObject(parent) {} virtual ~ICoreListener() {} - virtual bool editorAboutToClose(IEditor * /*editor*/) { return true; } virtual bool coreAboutToClose() { return true; } }; diff --git a/ground/src/plugins/coreplugin/mainwindow.cpp b/ground/src/plugins/coreplugin/mainwindow.cpp index 6955e55e4..369b4c98e 100644 --- a/ground/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/src/plugins/coreplugin/mainwindow.cpp @@ -39,7 +39,6 @@ #include "messagemanager.h" #include "modemanager.h" #include "mimedatabase.h" -#include "newdialog.h" #include "outputpane.h" #include "plugindialog.h" #include "shortcutsettings.h" @@ -73,11 +72,9 @@ #include #include #include -#include #include #include #include -#include #include #include @@ -111,7 +108,6 @@ MainWindow::MainWindow() : m_settingsDatabase(new SettingsDatabase(QFileInfo(m_settings->fileName()).path(), QLatin1String("OpenPilotGCS"), this)), - m_printer(0), m_actionManager(new ActionManagerPrivate(this)), m_variableManager(new VariableManager(this)), m_viewManager(0), @@ -200,8 +196,6 @@ MainWindow::~MainWindow() m_generalSettings = 0; delete m_settings; m_settings = 0; - delete m_printer; - m_printer = 0; delete m_uniqueIDManager; m_uniqueIDManager = 0; @@ -628,7 +622,6 @@ void MainWindow::registerDefaultActions() void MainWindow::newFile() { - showNewItemDialog(tr("New...", "Title of dialog"), IWizard::allWizards()); } void MainWindow::openFile() @@ -637,15 +630,6 @@ void MainWindow::openFile() static QList getNonEditorFileFactories() { -#if 0 - const QList allFileFactories = - ExtensionSystem::PluginManager::instance()->getObjects(); - QList nonEditorFileFactories; - foreach (IFileFactory *factory, allFileFactories) { - if (!qobject_cast(factory)) - nonEditorFileFactories.append(factory); - } -#endif QList tmp; return tmp; } @@ -685,39 +669,6 @@ void MainWindow::setFocusToEditor() } -QStringList MainWindow::showNewItemDialog(const QString &title, - const QList &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, const QString &page, QWidget *parent) @@ -1020,13 +971,6 @@ void MainWindow::aboutPlugins() dialog.exec(); } -QPrinter *MainWindow::printer() const -{ - if (!m_printer) - m_printer = new QPrinter(QPrinter::HighResolution); - return m_printer; -} - void MainWindow::setFullScreen(bool on) { if (bool(windowState() & Qt::WindowFullScreen) == on) diff --git a/ground/src/plugins/coreplugin/mainwindow.h b/ground/src/plugins/coreplugin/mainwindow.h index 6e77779ae..7477ea5b5 100644 --- a/ground/src/plugins/coreplugin/mainwindow.h +++ b/ground/src/plugins/coreplugin/mainwindow.h @@ -39,7 +39,6 @@ QT_BEGIN_NAMESPACE class QSettings; class QShortcut; -class QPrinter; class QToolButton; QT_END_NAMESPACE @@ -98,7 +97,6 @@ public: inline QSettings *settings() const { return m_settings; } inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; } - virtual QPrinter *printer() const; IContext * currentContextObject() const; QStatusBar *statusBar() const; void addAdditionalContext(int context); @@ -118,10 +116,6 @@ public slots: void exit(); void setFullScreen(bool on); - QStringList showNewItemDialog(const QString &title, - const QList &wizards, - const QString &defaultLocation = QString()); - bool showOptionsDialog(const QString &category = QString(), const QString &page = QString(), QWidget *parent = 0); @@ -164,7 +158,6 @@ private: QList m_additionalContexts; QSettings *m_settings; SettingsDatabase *m_settingsDatabase; - mutable QPrinter *m_printer; ActionManagerPrivate *m_actionManager; MessageManager *m_messageManager; VariableManager *m_variableManager; diff --git a/ground/src/plugins/coreplugin/variablemanager.cpp b/ground/src/plugins/coreplugin/variablemanager.cpp index 52869c55d..40d07c85e 100644 --- a/ground/src/plugins/coreplugin/variablemanager.cpp +++ b/ground/src/plugins/coreplugin/variablemanager.cpp @@ -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 { return m_map.value(variable); diff --git a/ground/src/plugins/plugins.pro b/ground/src/plugins/plugins.pro index 7637fdb1b..aea49188e 100644 --- a/ground/src/plugins/plugins.pro +++ b/ground/src/plugins/plugins.pro @@ -4,7 +4,8 @@ TEMPLATE = subdirs SUBDIRS = plugin_coreplugin \ - plugin_welcome + plugin_welcome \ + plugin_tutorial # Blank Template Plugin, not compiled by default #SUBDIRS += plugin_donothing @@ -18,3 +19,6 @@ plugin_coreplugin.subdir = coreplugin plugin_welcome.subdir = welcome plugin_welcome.depends = plugin_coreplugin +plugin_tutorial.subdir = tutorial +plugin_tutorial.depends = plugin_coreplugin + diff --git a/ground/src/plugins/welcome/Welcome.pluginspec b/ground/src/plugins/welcome/Welcome.pluginspec index 2b6591162..1c9636110 100644 --- a/ground/src/plugins/welcome/Welcome.pluginspec +++ b/ground/src/plugins/welcome/Welcome.pluginspec @@ -1,4 +1,4 @@ - + The OpenPilot Project (C) 2010 OpenPilot Project @@ -12,6 +12,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. Default Welcome Screen Plugin http://www.openpilot.org - + diff --git a/ground/src/plugins/welcome/welcomemode.cpp b/ground/src/plugins/welcome/welcomemode.cpp index 0fa2cfc35..7140ea9cb 100644 --- a/ground/src/plugins/welcome/welcomemode.cpp +++ b/ground/src/plugins/welcome/welcomemode.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include