diff --git a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp similarity index 77% rename from ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp rename to ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp index c4f94d6aa..b6a9016a0 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp @@ -1,14 +1,9 @@ /** ****************************************************************************** * - * @file authorsdialog.cpp + * @file aboutdialog.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -26,46 +21,38 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "authorsdialog.h" +#include "aboutdialog.h" +#include "ui_aboutdialog.h" #include "version_info/version_info.h" #include "coreconstants.h" #include "icore.h" -#include - #include #include #include -#include -#include -#include -#include -#include +#include +#include -#include -#include -#include -#include - -using namespace Core; -using namespace Core::Internal; using namespace Core::Constants; -AuthorsDialog::AuthorsDialog(QWidget *parent) - : QDialog(parent) +AboutDialog::AboutDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutDialog) { - // We need to set the window icon explicitly here since for some reason the - // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME) + ui->setupUi(this); setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png")); setWindowTitle(tr("About OpenPilot")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - // This loads a QML doc containing a Tabbed view - QDeclarativeView *view = new QDeclarativeView(this); + + // This loads a QML doc + QQuickView *view = new QQuickView(); + QWidget *container = QWidget::createWindowContainer(view, this); view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml")); + ui->verticalLayout->addWidget(container); QString version = QLatin1String(GCS_VERSION_LONG); version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate); @@ -108,3 +95,8 @@ AuthorsDialog::AuthorsDialog(QWidget *parent) // Expose the version description to the QML doc view->rootContext()->setContextProperty("version", description); } + +AboutDialog::~AboutDialog() +{ + delete ui; +} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.h b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h similarity index 74% rename from ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.h rename to ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h index 7c88cdf0e..d9d97f1eb 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h @@ -1,14 +1,9 @@ /** ****************************************************************************** * - * @file authors.h + * @file aboutdialog.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -26,19 +21,25 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef AUTHORSDIALOG_H -#define AUTHORSDIALOG_H +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H #include -namespace Core { -namespace Internal { -class AuthorsDialog : public QDialog { - Q_OBJECT -public: - explicit AuthorsDialog(QWidget *parent); -}; -} // namespace Internal -} // namespace Core +namespace Ui { +class AboutDialog; +} -#endif // AUTHORSDIALOG_H +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent = 0); + ~AboutDialog(); + +private: + Ui::AboutDialog *ui; +}; + +#endif // ABOUTDIALOG_H diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui new file mode 100644 index 000000000..6e50a77c3 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui @@ -0,0 +1,36 @@ + + + AboutDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + diff --git a/ground/openpilotgcs/src/plugins/coreplugin/core.qrc b/ground/openpilotgcs/src/plugins/coreplugin/core.qrc index 8a4418c53..f8158f9be 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/core.qrc +++ b/ground/openpilotgcs/src/plugins/coreplugin/core.qrc @@ -62,8 +62,6 @@ images/cpu.png images/tx-rx.svg qml/images/tab.png - qml/ScrollDecorator.qml - qml/TabWidget.qml qml/AboutDialog.qml ../../../../../build/openpilotgcs-synthetics/AuthorsModel.qml diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro index 1631fda8f..312fc2acb 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = Core DEFINES += CORE_LIBRARY -QT += declarative \ +QT += quick \ xml \ network \ script \ @@ -32,7 +32,6 @@ SOURCES += mainwindow.cpp \ uniqueidmanager.cpp \ messagemanager.cpp \ messageoutputwindow.cpp \ - versiondialog.cpp \ iuavgadget.cpp \ uavgadgetmanager/uavgadgetmanager.cpp \ uavgadgetmanager/uavgadgetview.cpp \ @@ -70,8 +69,8 @@ SOURCES += mainwindow.cpp \ uavgadgetdecorator.cpp \ workspacesettings.cpp \ uavconfiginfo.cpp \ - authorsdialog.cpp \ - telemetrymonitorwidget.cpp + telemetrymonitorwidget.cpp \ + aboutdialog.cpp HEADERS += mainwindow.h \ tabpositionindicator.h \ @@ -105,7 +104,6 @@ HEADERS += mainwindow.h \ iversioncontrol.h \ iview.h \ icorelistener.h \ - versiondialog.h \ core_global.h \ basemode.h \ baseview.h \ @@ -131,15 +129,16 @@ HEADERS += mainwindow.h \ uavgadgetdecorator.h \ workspacesettings.h \ uavconfiginfo.h \ - authorsdialog.h \ iconfigurableplugin.h \ - telemetrymonitorwidget.h + telemetrymonitorwidget.h \ + aboutdialog.h FORMS += dialogs/settingsdialog.ui \ dialogs/shortcutsettings.ui \ generalsettings.ui \ uavgadgetoptionspage.ui \ - workspacesettings.ui + workspacesettings.ui \ + aboutdialog.ui RESOURCES += core.qrc \ fancyactionbar.qrc diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp index ecb57a0b2..179ca92f7 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp @@ -45,7 +45,7 @@ #include "uavgadgetinstancemanager.h" #include "workspacesettings.h" -#include "authorsdialog.h" +#include "aboutdialog.h" #include "baseview.h" #include "ioutputpane.h" #include "icorelistener.h" @@ -56,7 +56,6 @@ #include "threadmanager.h" #include "uniqueidmanager.h" #include "variablemanager.h" -#include "versiondialog.h" #include #include @@ -114,8 +113,7 @@ MainWindow::MainWindow() : m_modeManager(0), m_connectionManager(0), m_mimeDatabase(new MimeDatabase), - m_versionDialog(0), - m_authorsDialog(0), + m_aboutDialog(0), m_activeContext(0), m_generalSettings(new GeneralSettings), m_shortcutSettings(new ShortcutSettings), @@ -793,7 +791,7 @@ void MainWindow::registerDefaultActions() #ifdef Q_WS_MAC cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); #endif - connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutOpenPilotAuthors())); + connect(tmpaction, SIGNAL(triggered()), this, SLOT(showAboutDialog())); } void MainWindow::newFile() @@ -802,42 +800,6 @@ void MainWindow::newFile() void MainWindow::openFile() {} -/*static QList getNonEditorFileFactories() - { - QList tmp; - return tmp; - } - - static IFileFactory *findFileFactory(const QList &fileFactories, - const MimeDatabase *db, - const QFileInfo &fi) - { - if (const MimeType mt = db->findByFile(fi)) { - const QString type = mt.type(); - foreach (IFileFactory *factory, fileFactories) { - if (factory->mimeTypes().contains(type)) - return factory; - } - } - return 0; - } - - // opens either an editor or loads a project - void MainWindow::openFiles(const QStringList &fileNames) - { - QList nonEditorFileFactories = getNonEditorFileFactories(); - - foreach (const QString &fileName, fileNames) { - const QFileInfo fi(fileName); - const QString absoluteFilePath = fi.absoluteFilePath(); - if (IFileFactory *fileFactory = findFileFactory(nonEditorFileFactories, mimeDatabase(), fi)) { - fileFactory->open(absoluteFilePath); - } else { - - } - } - }*/ - void MainWindow::setFocusToEditor() {} @@ -1404,43 +1366,24 @@ void MainWindow::openRecentFile() if (!fileName.isEmpty()) {} } -void MainWindow::aboutOpenPilotGCS() +void MainWindow::showAboutDialog() { - if (!m_versionDialog) { - m_versionDialog = new VersionDialog(this); - connect(m_versionDialog, SIGNAL(finished(int)), - this, SLOT(destroyVersionDialog())); + if (!m_aboutDialog) { + m_aboutDialog = new AboutDialog(this); + connect(m_aboutDialog, SIGNAL(finished(int)), + this, SLOT(destroyAboutDialog())); } - m_versionDialog->show(); + m_aboutDialog->show(); } -void MainWindow::destroyVersionDialog() +void MainWindow::destroyAboutDialog() { - if (m_versionDialog) { - m_versionDialog->deleteLater(); - m_versionDialog = 0; + if (m_aboutDialog) { + m_aboutDialog->deleteLater(); + m_aboutDialog = 0; } } -void MainWindow::aboutOpenPilotAuthors() -{ - if (!m_authorsDialog) { - m_authorsDialog = new AuthorsDialog(this); - connect(m_authorsDialog, SIGNAL(finished(int)), - this, SLOT(destroyAuthorsDialog())); - } - m_authorsDialog->show(); -} - -void MainWindow::destroyAuthorsDialog() -{ - if (m_authorsDialog) { - m_authorsDialog->deleteLater(); - m_authorsDialog = 0; - } -} - - void MainWindow::aboutPlugins() { PluginDialog dialog(this); @@ -1456,12 +1399,8 @@ void MainWindow::setFullScreen(bool on) if (on) { setWindowState(windowState() | Qt::WindowFullScreen); - // statusBar()->hide(); - // menuBar()->hide(); } else { setWindowState(windowState() & ~Qt::WindowFullScreen); - // menuBar()->show(); - // statusBar()->show(); } } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h index a1aa1f508..c19903424 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h @@ -43,6 +43,8 @@ class QToolButton; class MyTabWidget; QT_END_NAMESPACE +class AboutDialog; + namespace Core { class ActionManager; class BaseMode; @@ -72,8 +74,6 @@ class FancyTabWidget; class GeneralSettings; class ShortcutSettings; class WorkspaceSettings; -class VersionDialog; -class AuthorsDialog; class CORE_EXPORT MainWindow : public EventFilteringMainWindow { Q_OBJECT @@ -154,12 +154,10 @@ private slots: void openRecentFile(); void setFocusToEditor(); void saveAll(); - void aboutOpenPilotGCS(); + void showAboutDialog(); + void destroyAboutDialog(); void aboutPlugins(); - void aboutOpenPilotAuthors(); void updateFocusWidget(QWidget *old, QWidget *now); - void destroyVersionDialog(); - void destroyAuthorsDialog(); void modeChanged(Core::IMode *mode); void showUavGadgetMenus(bool show, bool hasSplitter); void applyTabBarSettings(QTabWidget::TabPosition pos, bool movable); @@ -191,8 +189,7 @@ private: MimeDatabase *m_mimeDatabase; MyTabWidget *m_modeStack; Core::BaseView *m_outputView; - VersionDialog *m_versionDialog; - AuthorsDialog *m_authorsDialog; + AboutDialog *m_aboutDialog; IContext *m_activeContext; diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml index 9e1d64f20..b6e7b7299 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml @@ -1,110 +1,100 @@ - /**************************************************************************** - ** - ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:BSD$ - ** You may use this file under the terms of the BSD license as follows: - ** - ** "Redistribution and use in source and binary forms, with or without - ** modification, are permitted provided that the following conditions are - ** met: - ** * Redistributions of source code must retain the above copyright - ** notice, this list of conditions and the following disclaimer. - ** * Redistributions in binary form must reproduce the above copyright - ** notice, this list of conditions and the following disclaimer in - ** the documentation and/or other materials provided with the - ** distribution. - ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor - ** the names of its contributors may be used to endorse or promote - ** products derived from this software without specific prior written - ** permission. - ** - ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +/** + ****************************************************************************** + * + * @file aboutdialog.qml + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ - import QtQuick 1.1 - - // This is a tabbed pane element. Add a nested Rectangle to add a tab. - TabWidget { - // Define AuthorsModel as type - property AuthorsModel authors: AuthorsModel {} - - id: tabs - width: 640; height: 480 - // This tab is for the GCS version information - Rectangle { - property string title: "OpenPilot GCS" - anchors.fill: parent - color: "#e3e3e3" - - Rectangle { - anchors.fill: parent; anchors.margins: 20 - color: "#e3e3e3" - Image { - source: "../images/openpilot_logo_128.png" - x: 0; y: 0; z: 100 - fillMode: Image.PreserveAspectFit - } - Flickable { - anchors.fill: parent - anchors.centerIn: parent - Text { - id: versionLabel - x: 156; y: 0 - width: 430; height: 379 - horizontalAlignment: Qt.AlignLeft - font.pixelSize: 12 - wrapMode: Text.WordWrap - // @var version exposed in authorsdialog.cpp - text: version - } +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 + +GridLayout { + width: 600 + height: 400 + ColumnLayout { + id: columnLayout1 + anchors.fill: parent + spacing: 10 + RowLayout { + id: rowLayout1 + Image { + id: logo + anchors.left: parent.left + anchors.leftMargin: 10 + anchors.top: parent.top + anchors.topMargin: 10 + source: "../images/openpilot_logo_128.png" + z: 100 + fillMode: Image.PreserveAspectFit + } + TabView { + id: tabs + anchors.left: logo.right + anchors.leftMargin: 10 + anchors.right: parent.right + anchors.rightMargin: 10 + anchors.top: parent.top + anchors.topMargin: 10 + Layout.fillHeight: true + Layout.fillWidth: true + anchors.bottom: parent.bottom + anchors.bottomMargin: 10 + Tab { + title: qsTr("About") + Text { + id: versionLabel + anchors.fill: parent + anchors.margins: 10 + font.pixelSize: 12 + wrapMode: Text.WordWrap + text: version + } + } + + Tab { + title: qsTr("Contributors") + ListView { + id: authorsView + anchors.fill: parent + anchors.margins: 10 + + spacing: 3 + model: authors + delegate: Text { + text: name + } + clip: true + } } } } - // This tab is for the authors/contributors/credits - Rectangle { - property string title: "Contributors" - anchors.fill: parent; color: "#e3e3e3" - Rectangle { - anchors.fill: parent; anchors.margins: 20 - color: "#e3e3e3" - Text { - id: description - text: "

These people have been key contributors to the OpenPilot project. Without the work of the people in this list, OpenPilot would not be what it is today.

This list is sorted alphabetically by name

" - width: 600 - wrapMode: Text.WordWrap - - } - ListView { - id: authorsView - y: description.y + description.height + 20 - width: parent.width; height: parent.height - description.height - 20 - spacing: 3 - model: authors - delegate: Text { - text: name - } - clip: true - } - ScrollDecorator { - flickableItem: authorsView - } - } - } + Button { + id: button + x: 512 + y: 369 + text: qsTr("Ok") + activeFocusOnPress: true + anchors.right: parent.right + anchors.rightMargin: 10 + anchors.bottom: parent.bottom + anchors.bottomMargin: 10 + } + } } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template b/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template index 63d7e45cc..8bbabc0ab 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template @@ -1,7 +1,7 @@ /* This list model was created for the AuthorsDialog. */ -import QtQuick 1.1 +import QtQuick 2.0 ListModel { ${LIST_ELEMENTS} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml deleted file mode 100644 index 24c79c927..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml +++ /dev/null @@ -1,40 +0,0 @@ -import QtQuick 1.1 - -Rectangle { - id: scrollDecorator - - property Flickable flickableItem: null - - Loader { - id: scrollLoader - sourceComponent: scrollDecorator.flickableItem ? scrollBar : undefined - } - - Component.onDestruction: scrollLoader.sourceComponent = undefined - - Component { - id: scrollBar - Rectangle { - property Flickable flickable: scrollDecorator.flickableItem - - parent: flickable - anchors.right: parent.right - - smooth: true - radius: 2 - color: "gray" - border.color: "lightgray" - border.width: 1.0 - opacity: flickable.moving ? 0.8 : 0.4 - - Behavior on opacity { - NumberAnimation { duration: 500 } - } - - width: 4 - height: flickable.height * (flickable.height / flickable.contentHeight) - y: flickable.height * (flickable.contentY / flickable.contentHeight) - visible: flickable.height < flickable.contentHeight - } - } -} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml deleted file mode 100644 index b6ce6bd41..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 - -Item { - id: tabWidget - - // Setting the default property to stack.children means any child items - // of the TabWidget are actually added to the 'stack' item's children. - // See the "Property Binding" - // documentation for details on default properties. - default property alias content: stack.children - - property int current: 0 - - onCurrentChanged: setOpacities() - Component.onCompleted: setOpacities() - - function setOpacities() { - for (var i = 0; i < stack.children.length; ++i) { - stack.children[i].opacity = (i == current ? 1 : 0) - } - } - - Row { - id: header - - Repeater { - model: stack.children.length - delegate: Rectangle { - width: tabWidget.width / stack.children.length; height: 36 - - Rectangle { - width: parent.width; height: 1 - anchors { bottom: parent.bottom; bottomMargin: 1 } - color: "#acb2c2" - } - BorderImage { - anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 } - border { left: 7; right: 7 } - source: "images/tab.png" - visible: tabWidget.current == index - } - Text { - horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter - anchors.fill: parent - text: stack.children[index].title - elide: Text.ElideRight - font.bold: tabWidget.current == index - } - MouseArea { - anchors.fill: parent - onClicked: tabWidget.current = index - } - } - } - } - - Item { - id: stack - width: tabWidget.width - anchors.top: header.bottom; anchors.bottom: tabWidget.bottom - } -} \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp deleted file mode 100644 index 6887239fe..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - ****************************************************************************** - * - * @file versiondialog.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "versiondialog.h" -#include "version_info/version_info.h" -#include "coreconstants.h" -#include "icore.h" - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace Core; -using namespace Core::Internal; -using namespace Core::Constants; - -VersionDialog::VersionDialog(QWidget *parent) - : QDialog(parent) -{ - // We need to set the window icon explicitly here since for some reason the - // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME) - setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png")); - - setWindowTitle(tr("About OpenPilot GCS")); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - QGridLayout *layout = new QGridLayout(this); - layout->setSizeConstraint(QLayout::SetFixedSize); - - const QString description = tr( - "

OpenPilot Ground Control Station

" - "GCS Revision: %1
" - "UAVO Hash: %2
" - "
" - "Built from %3
" - "Built on %4 at %5
" - "Based on Qt %6 (%7 bit)
" - "
" - "© %8, 2010-%9. All rights reserved.
" - "
" - "This program is free software; you can redistribute it and/or modify
" - "it under the terms of the GNU General Public License as published by
" - "the Free Software Foundation; either version 3 of the License, or
" - "(at your option) any later version.
" - "
" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " - "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.
" - ).arg( - VersionInfo::revision().left(60), // %1 - VersionInfo::uavoHash().left(8), // %2 - VersionInfo::origin(), // $3 - QLatin1String(__DATE__), // %4 - QLatin1String(__TIME__), // %5 - QLatin1String(QT_VERSION_STR), // %6 - QString::number(QSysInfo::WordSize), // %7 - QLatin1String(GCS_AUTHOR), // %8 - VersionInfo::year() // %9 - ); - - QLabel *copyRightLabel = new QLabel(description); - copyRightLabel->setWordWrap(true); - copyRightLabel->setOpenExternalLinks(true); - copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); - - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close); - QTC_ASSERT(closeButton, /**/); - buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole)); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - - QLabel *logoLabel = new QLabel; - logoLabel->setPixmap(QPixmap(QLatin1String(":/core/images/openpilot_logo_128.png"))); - layout->addWidget(logoLabel, 0, 0, 1, 1); - layout->addWidget(copyRightLabel, 0, 1, 4, 4); - layout->addWidget(buttonBox, 4, 0, 1, 5); -} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h deleted file mode 100644 index 58fd217b7..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - ****************************************************************************** - * - * @file versiondialog.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef VERSIONDIALOG_H -#define VERSIONDIALOG_H - -#include - -namespace Core { -namespace Internal { -class VersionDialog : public QDialog { - Q_OBJECT -public: - explicit VersionDialog(QWidget *parent); -}; -} // namespace Internal -} // namespace Core - -#endif // VERSIONDIALOG_H