Replaced the welcome page with a QML based one.
It's still necessary to replace the mode images with the correct ones.
@ -1,47 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file communitywelcomepage.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 WelcomePlugin Welcome Plugin
|
|
||||||
* @{
|
|
||||||
* @brief The GCS Welcome 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 "communitywelcomepage.h"
|
|
||||||
#include "communitywelcomepagewidget.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Welcome {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
CommunityWelcomePage::CommunityWelcomePage()
|
|
||||||
: m_page(new CommunityWelcomePageWidget)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget* CommunityWelcomePage::page()
|
|
||||||
{
|
|
||||||
return m_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Welcome
|
|
@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file communitywelcomepage.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 WelcomePlugin Welcome Plugin
|
|
||||||
* @{
|
|
||||||
* @brief The GCS Welcome 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 COMMUNITYWELCOMEPAGE_H
|
|
||||||
#define COMMUNITYWELCOMEPAGE_H
|
|
||||||
|
|
||||||
#include "welcome_global.h"
|
|
||||||
|
|
||||||
#include <utils/iwelcomepage.h>
|
|
||||||
|
|
||||||
namespace Welcome {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class CommunityWelcomePageWidget;
|
|
||||||
|
|
||||||
class CommunityWelcomePage : public Utils::IWelcomePage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
CommunityWelcomePage();
|
|
||||||
|
|
||||||
QWidget *page();
|
|
||||||
QString title() const { return tr("Community"); }
|
|
||||||
int priority() const { return 30; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
CommunityWelcomePageWidget *m_page;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Welcome
|
|
||||||
|
|
||||||
#endif // COMMUNITYWELCOMEPAGE_H
|
|
@ -1,86 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file communitywelcomepagewidget.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 WelcomePlugin Welcome Plugin
|
|
||||||
* @{
|
|
||||||
* @brief The GCS Welcome 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 "communitywelcomepagewidget.h"
|
|
||||||
#include "ui_communitywelcomepagewidget.h"
|
|
||||||
|
|
||||||
#include "rssfetcher.h"
|
|
||||||
|
|
||||||
#include <QtCore/QMap>
|
|
||||||
#include <QtGui/QDesktopServices>
|
|
||||||
#include <QtGui/QTreeWidgetItem>
|
|
||||||
|
|
||||||
namespace Welcome {
|
|
||||||
namespace Internal {
|
|
||||||
CommunityWelcomePageWidget::CommunityWelcomePageWidget(QWidget *parent) :
|
|
||||||
QWidget(parent),
|
|
||||||
m_rssFetcher(new RSSFetcher(7)),
|
|
||||||
ui(new Ui::CommunityWelcomePageWidget)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->labsTitleLabel->setStyledText(tr("News From the OpenPilot Project"));
|
|
||||||
ui->sitesTitleLabel->setStyledText(tr("OpenPilot Websites"));
|
|
||||||
|
|
||||||
connect(ui->newsTreeWidget, SIGNAL(activated(QString)), SLOT(slotUrlClicked(QString)));
|
|
||||||
connect(ui->sitesTreeWidget, SIGNAL(activated(QString)), SLOT(slotUrlClicked(QString)));
|
|
||||||
|
|
||||||
connect(m_rssFetcher, SIGNAL(newsItemReady(QString, QString, QString)),
|
|
||||||
ui->newsTreeWidget, SLOT(slotAddNewsItem(QString, QString, QString)));
|
|
||||||
//: Add localized feed here only if one exists
|
|
||||||
m_rssFetcher->fetch(QUrl(tr("http://www.openpilot.org/feed/")));
|
|
||||||
|
|
||||||
QList<QPair<QString, QString> > sites;
|
|
||||||
sites << qMakePair(tr("OpenPilot Home"), QString(QLatin1String("http://www.openpilot.org")));
|
|
||||||
sites << qMakePair(tr("OpenPilot Wiki"), QString(QLatin1String("http://wiki.openpilot.org")));
|
|
||||||
sites << qMakePair(tr("OpenPilot Store"), QString(QLatin1String("http://www.openpilot.org/hardware/get-hardware/")));
|
|
||||||
sites << qMakePair(tr("OpenPilot Forums"), QString(QLatin1String("http://forums.openpilot.org")));
|
|
||||||
sites << qMakePair(tr("OpenPilot Code Reviews"), QString(QLatin1String("http://git.openpilot.org")));
|
|
||||||
sites << qMakePair(tr("OpenPilot Progress Tracker"), QString(QLatin1String("http://progress.openpilot.org")));
|
|
||||||
|
|
||||||
QListIterator<QPair<QString, QString> > it(sites);
|
|
||||||
while (it.hasNext()) {
|
|
||||||
QPair<QString, QString> pair = it.next();
|
|
||||||
ui->sitesTreeWidget->addItem(pair.first, pair.second, pair.second);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CommunityWelcomePageWidget::~CommunityWelcomePageWidget()
|
|
||||||
{
|
|
||||||
delete m_rssFetcher;
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommunityWelcomePageWidget::slotUrlClicked(const QString &data)
|
|
||||||
{
|
|
||||||
QDesktopServices::openUrl(QUrl(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Welcome
|
|
@ -1,63 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file communitywelcomepagewidget.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 WelcomePlugin Welcome Plugin
|
|
||||||
* @{
|
|
||||||
* @brief The GCS Welcome 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 COMMUNITYWELCOMEPAGEWIDGET_H
|
|
||||||
#define COMMUNITYWELCOMEPAGEWIDGET_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
namespace Welcome {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class RSSFetcher;
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class CommunityWelcomePageWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CommunityWelcomePageWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
CommunityWelcomePageWidget(QWidget *parent = 0);
|
|
||||||
~CommunityWelcomePageWidget();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void slotUrlClicked(const QString &data);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
RSSFetcher *m_rssFetcher;
|
|
||||||
Ui::CommunityWelcomePageWidget *ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Welcome
|
|
||||||
#endif // COMMUNITYWELCOMEPAGEWIDGET_H
|
|
@ -1,195 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Welcome::Internal::CommunityWelcomePageWidget</class>
|
|
||||||
<widget class="QWidget" name="Welcome::Internal::CommunityWelcomePageWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>667</width>
|
|
||||||
<height>352</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="labsFrame">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="Utils::WelcomeModeLabel" name="labsTitleLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Utils::WelcomeModeTreeWidget" name="newsTreeWidget">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>340</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::NoSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="verticalScrollMode">
|
|
||||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="rootIsDecorated">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="uniformRowHeights">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="allColumnsShowFocus">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="columnCount">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<attribute name="headerVisible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="headerDefaultSectionSize">
|
|
||||||
<number>24</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="headerMinimumSectionSize">
|
|
||||||
<number>0</number>
|
|
||||||
</attribute>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">1</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">2</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="sitesFrame">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="Utils::WelcomeModeLabel" name="sitesTitleLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Utils::WelcomeModeTreeWidget" name="sitesTreeWidget">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::NoSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="verticalScrollMode">
|
|
||||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="rootIsDecorated">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="uniformRowHeights">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="allColumnsShowFocus">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="columnCount">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<attribute name="headerVisible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="headerDefaultSectionSize">
|
|
||||||
<number>24</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="headerMinimumSectionSize">
|
|
||||||
<number>0</number>
|
|
||||||
</attribute>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">1</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">2</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>Utils::WelcomeModeTreeWidget</class>
|
|
||||||
<extends>QTreeWidget</extends>
|
|
||||||
<header>utils/welcomemodetreewidget.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>Utils::WelcomeModeLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header>utils/welcomemodetreewidget.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
Before Width: | Height: | Size: 323 B |
Before Width: | Height: | Size: 304 B |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 430 B |
Before Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 629 B |
Before Width: | Height: | Size: 697 B |
Before Width: | Height: | Size: 188 KiB |
Before Width: | Height: | Size: 333 B |
Before Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 530 B |
@ -0,0 +1,47 @@
|
|||||||
|
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||||
|
import QtQuick 1.1
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 600
|
||||||
|
height: 300
|
||||||
|
|
||||||
|
BorderImage {
|
||||||
|
id: background
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
border { left: 30; top: 30; right: 30; bottom: 30 }
|
||||||
|
source: "images/welcome-news-bg.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
NewsPanel {
|
||||||
|
id: newsPanel
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
width: parent.width*0.6
|
||||||
|
anchors.margins: 32
|
||||||
|
|
||||||
|
onClicked: welcomePlugin.openUrl(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
//better to use image instead
|
||||||
|
Rectangle {
|
||||||
|
id: separator
|
||||||
|
width: 1
|
||||||
|
height: parent.height*0.7
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: newsPanel.right
|
||||||
|
anchors.margins: 16
|
||||||
|
color: "#A0A0B0"
|
||||||
|
}
|
||||||
|
|
||||||
|
SitesPanel {
|
||||||
|
anchors.left: newsPanel.right
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.margins: 32
|
||||||
|
|
||||||
|
onClicked: welcomePlugin.openUrl(url)
|
||||||
|
}
|
||||||
|
}
|
77
ground/openpilotgcs/src/plugins/welcome/qml/NewsPanel.qml
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||||
|
import QtQuick 1.1
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: container
|
||||||
|
width: 100
|
||||||
|
height: 62
|
||||||
|
|
||||||
|
signal clicked(string url)
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: header
|
||||||
|
text: "Project News"
|
||||||
|
width: parent.width
|
||||||
|
color: "#303060"
|
||||||
|
font {
|
||||||
|
pointSize: 14
|
||||||
|
weight: Font.Bold
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: view
|
||||||
|
width: parent.width
|
||||||
|
anchors { top: header.bottom; topMargin: 14; bottom: parent.bottom }
|
||||||
|
model: xmlModel
|
||||||
|
delegate: listDelegate
|
||||||
|
clip: true
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlListModel {
|
||||||
|
id: xmlModel
|
||||||
|
source: "http://www.openpilot.org/feed/"
|
||||||
|
query: "/rss/channel/item"
|
||||||
|
|
||||||
|
XmlRole { name: "title"; query: "title/string()" }
|
||||||
|
XmlRole { name: "description"; query: "description/string()" }
|
||||||
|
XmlRole { name: "link"; query: "link/string()" }
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: listDelegate
|
||||||
|
Item {
|
||||||
|
width: view.width
|
||||||
|
height: column.height + 16
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: column
|
||||||
|
spacing: 4
|
||||||
|
Text {
|
||||||
|
text: title
|
||||||
|
width: view.width
|
||||||
|
elide: Text.ElideRight
|
||||||
|
font.bold: true
|
||||||
|
color: mouseArea.containsMouse ? "darkblue" : "black"
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: description
|
||||||
|
width: view.width
|
||||||
|
elide: Text.ElideRight
|
||||||
|
color: mouseArea.containsMouse ? "darkblue" : "black"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: {
|
||||||
|
console.log(link)
|
||||||
|
container.clicked(link)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
63
ground/openpilotgcs/src/plugins/welcome/qml/SitesPanel.qml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||||
|
import QtQuick 1.1
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: container
|
||||||
|
width: 100
|
||||||
|
height: 62
|
||||||
|
|
||||||
|
signal clicked(string url)
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: header
|
||||||
|
text: "OpenPilot Websites"
|
||||||
|
width: parent.width
|
||||||
|
color: "#303060"
|
||||||
|
font {
|
||||||
|
pointSize: 14
|
||||||
|
weight: Font.Bold
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel {
|
||||||
|
id: sitesModel
|
||||||
|
ListElement { title: "OpenPilot Home"; link: "http://www.openpilot.org" }
|
||||||
|
ListElement { title: "OpenPilot Wiki"; link: "http://wiki.openpilot.org" }
|
||||||
|
ListElement { title: "OpenPilot Store"; link: "http://www.openpilot.org/hardware/get-hardware/" }
|
||||||
|
ListElement { title: "OpenPilot Forums"; link: "http://forums.openpilot.org" }
|
||||||
|
ListElement { title: "OpenPilot Code Reviews"; link: "http://git.openpilot.org" }
|
||||||
|
ListElement { title: "OpenPilot Progress Tracker"; link: "http://progress.openpilot.org" }
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: view
|
||||||
|
width: parent.width
|
||||||
|
anchors { top: header.bottom; topMargin: 14; bottom: parent.bottom }
|
||||||
|
model: sitesModel
|
||||||
|
spacing: 8
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
delegate: Text {
|
||||||
|
text: title
|
||||||
|
width: view.width
|
||||||
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
|
||||||
|
font {
|
||||||
|
pointSize: 12
|
||||||
|
weight: Font.Bold
|
||||||
|
}
|
||||||
|
|
||||||
|
color: mouseArea.containsMouse ? "darkblue" : "black"
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: {
|
||||||
|
console.log(link)
|
||||||
|
container.clicked(link)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||||
|
import QtQuick 1.1
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: welcomeButton
|
||||||
|
width: 116
|
||||||
|
height: 116
|
||||||
|
|
||||||
|
property string baseIconName
|
||||||
|
property alias label : labelText.text
|
||||||
|
|
||||||
|
signal clicked
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: icon
|
||||||
|
source: "images/"+baseIconName+".png"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: hoveredIcon
|
||||||
|
source: "images/"+baseIconName+"-hover.png"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
opacity: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: labelImage
|
||||||
|
source: "images/button-label.png"
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.bottom: hoveredIcon.top
|
||||||
|
anchors.bottomMargin: -8
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: labelText
|
||||||
|
anchors.baseline: parent.verticalCenter
|
||||||
|
anchors.baselineOffset: -4
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
font {
|
||||||
|
weight: Font.DemiBold
|
||||||
|
pointSize: 14
|
||||||
|
}
|
||||||
|
color: "#272727"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
states: State {
|
||||||
|
name: "hovered"
|
||||||
|
PropertyChanges { target: hoveredIcon; opacity: 1.0 }
|
||||||
|
PropertyChanges { target: labelImage; opacity: 1.0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
transitions: Transition {
|
||||||
|
from: ""; to: "hovered"; reversible: true
|
||||||
|
NumberAnimation { targets: [hoveredIcon, labelImage]; property: "opacity"; duration: 150; easing.type: Easing.InOutQuad }
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
onEntered: welcomeButton.state = "hovered"
|
||||||
|
onExited: welcomeButton.state = ""
|
||||||
|
onClicked: welcomeButton.clicked()
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 144 KiB |
After Width: | Height: | Size: 13 KiB |
BIN
ground/openpilotgcs/src/plugins/welcome/qml/images/welcome.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
80
ground/openpilotgcs/src/plugins/welcome/qml/main.qml
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
import QtQuick 1.1
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 1024
|
||||||
|
height: 768
|
||||||
|
|
||||||
|
color: "#272727"
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: bg
|
||||||
|
source: "images/welcome-op-bg.png"
|
||||||
|
anchors.fill: parent
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
smooth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width
|
||||||
|
spacing: 32
|
||||||
|
|
||||||
|
Row {
|
||||||
|
//anchors.bottom: parent.verticalCenter
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
spacing: 16
|
||||||
|
|
||||||
|
Image {
|
||||||
|
source: "images/welcome-op-logo.png"
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Grid {
|
||||||
|
id: buttons
|
||||||
|
columns: 3
|
||||||
|
spacing: 4
|
||||||
|
|
||||||
|
WelcomePageButton {
|
||||||
|
baseIconName: "welcome-flightdata"
|
||||||
|
label: "Flight Data"
|
||||||
|
onClicked: welcomePlugin.openPage("Mode1")
|
||||||
|
}
|
||||||
|
|
||||||
|
WelcomePageButton {
|
||||||
|
baseIconName: "welcome-flightdata"
|
||||||
|
label: "Configuration"
|
||||||
|
onClicked: welcomePlugin.openPage("Mode2")
|
||||||
|
}
|
||||||
|
|
||||||
|
WelcomePageButton {
|
||||||
|
baseIconName: "welcome-flightdata"
|
||||||
|
label: "Flight Planner"
|
||||||
|
onClicked: welcomePlugin.openPage("Mode3")
|
||||||
|
}
|
||||||
|
|
||||||
|
WelcomePageButton {
|
||||||
|
baseIconName: "welcome-flightdata"
|
||||||
|
label: "Scopes"
|
||||||
|
onClicked: welcomePlugin.openPage("Mode4")
|
||||||
|
}
|
||||||
|
|
||||||
|
WelcomePageButton {
|
||||||
|
baseIconName: "welcome-flightdata"
|
||||||
|
label: "HIL"
|
||||||
|
onClicked: welcomePlugin.openPage("Mode5")
|
||||||
|
}
|
||||||
|
|
||||||
|
WelcomePageButton {
|
||||||
|
baseIconName: "welcome-flightdata"
|
||||||
|
label: "Firmware"
|
||||||
|
onClicked: welcomePlugin.openPage("Mode6")
|
||||||
|
}
|
||||||
|
} //icons grid
|
||||||
|
} // images row
|
||||||
|
|
||||||
|
CommunityPanel {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
width: parent.width*0.8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,186 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file rssfetcher.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 WelcomePlugin Welcome Plugin
|
|
||||||
* @{
|
|
||||||
* @brief The GCS Welcome 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 <QtCore/QDebug>
|
|
||||||
#include <QtCore/QSysInfo>
|
|
||||||
#include <QtCore/QLocale>
|
|
||||||
#include <QtGui/QDesktopServices>
|
|
||||||
#include <QtGui/QLineEdit>
|
|
||||||
#include <QtNetwork/QHttp>
|
|
||||||
#include <QtNetwork/QNetworkProxyFactory>
|
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
|
||||||
|
|
||||||
#include "rssfetcher.h"
|
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
|
||||||
#include <sys/utsname.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace Welcome::Internal;
|
|
||||||
|
|
||||||
static const QString getOsString()
|
|
||||||
{
|
|
||||||
QString osString;
|
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
switch (QSysInfo::WindowsVersion) {
|
|
||||||
case (QSysInfo::WV_4_0):
|
|
||||||
osString += QLatin1String("WinNT4.0");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::WV_5_0):
|
|
||||||
osString += QLatin1String("Windows NT 5.0");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::WV_5_1):
|
|
||||||
osString += QLatin1String("Windows NT 5.1");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::WV_5_2):
|
|
||||||
osString += QLatin1String("Windows NT 5.2");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::WV_6_0):
|
|
||||||
osString += QLatin1String("Windows NT 6.0");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::WV_6_1):
|
|
||||||
osString += QLatin1String("Windows NT 6.1");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
osString += QLatin1String("Windows NT (Unknown)");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#elif defined (Q_OS_MAC)
|
|
||||||
if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
|
|
||||||
osString += QLatin1String("PPC ");
|
|
||||||
else
|
|
||||||
osString += QLatin1String("Intel ");
|
|
||||||
osString += QLatin1String("Mac OS X ");
|
|
||||||
switch (QSysInfo::MacintoshVersion) {
|
|
||||||
case (QSysInfo::MV_10_3):
|
|
||||||
osString += QLatin1String("10_3");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::MV_10_4):
|
|
||||||
osString += QLatin1String("10_4");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::MV_10_5):
|
|
||||||
osString += QLatin1String("10_5");
|
|
||||||
break;
|
|
||||||
case (QSysInfo::MV_10_6):
|
|
||||||
osString += QLatin1String("10_6");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
osString += QLatin1String("(Unknown)");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#elif defined (Q_OS_UNIX)
|
|
||||||
struct utsname uts;
|
|
||||||
if (uname(&uts) == 0)
|
|
||||||
osString += QString("%1 %2").arg(QLatin1String(uts.sysname))
|
|
||||||
.arg(QLatin1String(uts.release));
|
|
||||||
else
|
|
||||||
osString += QLatin1String("Unix (Unknown)");
|
|
||||||
#else
|
|
||||||
ossttring = QLatin1String("Unknown OS");
|
|
||||||
#endif
|
|
||||||
return osString;
|
|
||||||
}
|
|
||||||
|
|
||||||
RSSFetcher::RSSFetcher(int maxItems, QObject *parent)
|
|
||||||
: QObject(parent), m_items(0), m_maxItems(maxItems)
|
|
||||||
{
|
|
||||||
connect(&m_http, SIGNAL(readyRead(const QHttpResponseHeader &)),
|
|
||||||
this, SLOT(readData(const QHttpResponseHeader &)));
|
|
||||||
|
|
||||||
connect(&m_http, SIGNAL(requestFinished(int, bool)),
|
|
||||||
this, SLOT(finished(int, bool)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void RSSFetcher::fetch(const QUrl &url)
|
|
||||||
{
|
|
||||||
QList<QNetworkProxy> proxies = QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(url));
|
|
||||||
if (proxies.count() > 0)
|
|
||||||
m_http.setProxy(proxies.first());
|
|
||||||
m_http.setHost(url.host());
|
|
||||||
QString agentStr = QString("OP-GCS/%1 (QHttp %2; %3; %4; %5 bit)")
|
|
||||||
.arg(Core::Constants::GCS_VERSION_LONG).arg(qVersion())
|
|
||||||
.arg(getOsString()).arg(QLocale::system().name())
|
|
||||||
.arg(QSysInfo::WordSize);
|
|
||||||
QHttpRequestHeader header("GET", url.path());
|
|
||||||
//qDebug() << agentStr;
|
|
||||||
header.setValue("User-Agent", agentStr);
|
|
||||||
header.setValue("Host", url.host());
|
|
||||||
m_connectionId = m_http.request(header);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RSSFetcher::readData(const QHttpResponseHeader &resp)
|
|
||||||
{
|
|
||||||
if (resp.statusCode() != 200)
|
|
||||||
m_http.abort();
|
|
||||||
else {
|
|
||||||
m_xml.addData(m_http.readAll());
|
|
||||||
parseXml();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void RSSFetcher::finished(int id, bool error)
|
|
||||||
{
|
|
||||||
Q_UNUSED(id)
|
|
||||||
m_items = 0;
|
|
||||||
emit finished(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RSSFetcher::parseXml()
|
|
||||||
{
|
|
||||||
while (!m_xml.atEnd()) {
|
|
||||||
m_xml.readNext();
|
|
||||||
if (m_xml.isStartElement()) {
|
|
||||||
if (m_xml.name() == "item") {
|
|
||||||
m_titleString.clear();
|
|
||||||
m_descriptionString.clear();
|
|
||||||
m_linkString.clear();
|
|
||||||
}
|
|
||||||
m_currentTag = m_xml.name().toString();
|
|
||||||
} else if (m_xml.isEndElement()) {
|
|
||||||
if (m_xml.name() == "item") {
|
|
||||||
m_items++;
|
|
||||||
if (m_items > m_maxItems)
|
|
||||||
return;
|
|
||||||
emit newsItemReady(m_titleString, m_descriptionString, m_linkString);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (m_xml.isCharacters() && !m_xml.isWhitespace()) {
|
|
||||||
if (m_currentTag == "title")
|
|
||||||
m_titleString += m_xml.text().toString();
|
|
||||||
else if (m_currentTag == "description")
|
|
||||||
m_descriptionString += m_xml.text().toString();
|
|
||||||
else if (m_currentTag == "link")
|
|
||||||
m_linkString += m_xml.text().toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (m_xml.error() && m_xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) {
|
|
||||||
qWarning() << "XML ERROR:" << m_xml.lineNumber() << ": " << m_xml.errorString();
|
|
||||||
m_http.abort();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,75 +0,0 @@
|
|||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
*
|
|
||||||
* @file rssfetcher.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 WelcomePlugin Welcome Plugin
|
|
||||||
* @{
|
|
||||||
* @brief The GCS Welcome 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 RSSFETCHER_H
|
|
||||||
#define RSSFETCHER_H
|
|
||||||
|
|
||||||
#include <QtCore/QUrl>
|
|
||||||
#include <QtCore/QXmlStreamReader>
|
|
||||||
#include <QtNetwork/QHttp>
|
|
||||||
|
|
||||||
namespace Welcome {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class RSSFetcher : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
RSSFetcher(int maxItems, QObject *parent = 0);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void newsItemReady(const QString& title, const QString& desciption, const QString& url);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void fetch(const QUrl &url);
|
|
||||||
void finished(int id, bool error);
|
|
||||||
void readData(const QHttpResponseHeader &);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void finished(bool error);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void parseXml();
|
|
||||||
|
|
||||||
QXmlStreamReader m_xml;
|
|
||||||
QString m_currentTag;
|
|
||||||
QString m_linkString;
|
|
||||||
QString m_descriptionString;
|
|
||||||
QString m_titleString;
|
|
||||||
|
|
||||||
QHttp m_http;
|
|
||||||
int m_connectionId;
|
|
||||||
int m_items;
|
|
||||||
int m_maxItems;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Welcome
|
|
||||||
} // namespace Internal
|
|
||||||
|
|
||||||
#endif // RSSFETCHER_H
|
|
||||||
|
|
@ -1,22 +1,16 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = Welcome
|
TARGET = Welcome
|
||||||
QT += network
|
QT += network declarative
|
||||||
|
|
||||||
include(../../openpilotgcsplugin.pri)
|
include(../../openpilotgcsplugin.pri)
|
||||||
include(welcome_dependencies.pri)
|
include(welcome_dependencies.pri)
|
||||||
|
|
||||||
HEADERS += welcomeplugin.h \
|
HEADERS += welcomeplugin.h \
|
||||||
welcomemode.h \
|
welcomemode.h \
|
||||||
rssfetcher.h \
|
|
||||||
communitywelcomepagewidget.h \
|
|
||||||
communitywelcomepage.h \
|
|
||||||
welcome_global.h
|
welcome_global.h
|
||||||
SOURCES += welcomeplugin.cpp \
|
SOURCES += welcomeplugin.cpp \
|
||||||
welcomemode.cpp \
|
welcomemode.cpp \
|
||||||
rssfetcher.cpp \
|
|
||||||
communitywelcomepagewidget.cpp \
|
|
||||||
communitywelcomepage.cpp
|
|
||||||
|
|
||||||
FORMS += welcomemode.ui \
|
|
||||||
communitywelcomepagewidget.ui
|
|
||||||
RESOURCES += welcome.qrc
|
RESOURCES += welcome.qrc
|
||||||
DEFINES += WELCOME_LIBRARY
|
DEFINES += WELCOME_LIBRARY
|
||||||
OTHER_FILES += Welcome.pluginspec
|
OTHER_FILES += Welcome.pluginspec
|
||||||
|
@ -1,20 +1,16 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/welcome">
|
<qresource prefix="/welcome">
|
||||||
<file>images/btn_26.png</file>
|
<file>qml/main.qml</file>
|
||||||
<file>images/btn_26_hover.png</file>
|
<file>qml/CommunityPanel.qml</file>
|
||||||
<file>images/btn_27.png</file>
|
<file>qml/SitesPanel.qml</file>
|
||||||
<file>images/btn_27_hover.png</file>
|
<file>qml/WelcomePageButton.qml</file>
|
||||||
<file>images/feedback_arrow.png</file>
|
<file>qml/NewsPanel.qml</file>
|
||||||
<file>images/feedback_arrow_hover.png</file>
|
<file>qml/images/welcome-news-bg.png</file>
|
||||||
<file>images/feedback-bar-background.png</file>
|
<file>qml/images/welcome-op-logo.png</file>
|
||||||
<file>images/list_bullet_arrow.png</file>
|
<file>qml/images/button-label.png</file>
|
||||||
<file>images/mode_project.png</file>
|
<file>qml/images/welcome-flightdata-hover.png</file>
|
||||||
<file>images/rc_combined.png</file>
|
<file>qml/images/welcome-flightdata.png</file>
|
||||||
<file>images/background_center_frame.png</file>
|
<file>qml/images/welcome-op-bg.png</file>
|
||||||
<file>images/center_frame_header.png</file>
|
<file>qml/images/welcome-bg.png</file>
|
||||||
<file>images/btn_26_pressed.png</file>
|
|
||||||
<file>images/combobox_arrow.png</file>
|
|
||||||
<file>images/arrow-left.png</file>
|
|
||||||
<file>images/arrow-right.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -39,19 +39,18 @@
|
|||||||
#include <utils/welcomemodetreewidget.h>
|
#include <utils/welcomemodetreewidget.h>
|
||||||
#include <utils/iwelcomepage.h>
|
#include <utils/iwelcomepage.h>
|
||||||
|
|
||||||
#include <QtGui/QMouseEvent>
|
|
||||||
#include <QtGui/QScrollArea>
|
|
||||||
#include <QtGui/QButtonGroup>
|
|
||||||
#include <QtGui/QDesktopServices>
|
#include <QtGui/QDesktopServices>
|
||||||
#include <QtGui/QToolButton>
|
|
||||||
|
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
#include <QtCore/QUrl>
|
#include <QtCore/QUrl>
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <QtDeclarative/qdeclarative.h>
|
||||||
|
#include <QtDeclarative/qdeclarativeview.h>
|
||||||
|
#include <QtDeclarative/qdeclarativeengine.h>
|
||||||
|
#include <QtDeclarative/qdeclarativecontext.h>
|
||||||
|
|
||||||
#include "ui_welcomemode.h"
|
#include <cstdlib>
|
||||||
|
|
||||||
using namespace ExtensionSystem;
|
using namespace ExtensionSystem;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@ -62,13 +61,7 @@ struct WelcomeModePrivate
|
|||||||
{
|
{
|
||||||
WelcomeModePrivate();
|
WelcomeModePrivate();
|
||||||
|
|
||||||
QScrollArea *m_scrollArea;
|
QDeclarativeView *declarativeView;
|
||||||
QWidget *m_widget;
|
|
||||||
QWidget *m_welcomePage;
|
|
||||||
QMap<QAbstractButton*, QWidget*> buttonMap;
|
|
||||||
QHBoxLayout * buttonLayout;
|
|
||||||
Ui::WelcomeMode ui;
|
|
||||||
int currentTip;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
WelcomeModePrivate::WelcomeModePrivate()
|
WelcomeModePrivate::WelcomeModePrivate()
|
||||||
@ -80,34 +73,15 @@ WelcomeMode::WelcomeMode() :
|
|||||||
m_d(new WelcomeModePrivate),
|
m_d(new WelcomeModePrivate),
|
||||||
m_priority(Core::Constants::P_MODE_WELCOME)
|
m_priority(Core::Constants::P_MODE_WELCOME)
|
||||||
{
|
{
|
||||||
m_d->m_widget = new QWidget;
|
m_d->declarativeView = new QDeclarativeView;
|
||||||
QVBoxLayout *l = new QVBoxLayout(m_d->m_widget);
|
m_d->declarativeView->setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
||||||
l->setMargin(0);
|
m_d->declarativeView->engine()->rootContext()->setContextProperty("welcomePlugin", this);
|
||||||
l->setSpacing(0);
|
m_d->declarativeView->setSource(QUrl("qrc:/welcome/qml/main.qml"));
|
||||||
// l->addWidget(new Utils::StyledBar(m_d->m_widget));
|
|
||||||
m_d->m_welcomePage = new QWidget(m_d->m_widget);
|
|
||||||
m_d->ui.setupUi(m_d->m_welcomePage);
|
|
||||||
m_d->ui.helpUsLabel->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
|
||||||
m_d->ui.feedbackButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
|
||||||
l->addWidget(m_d->m_welcomePage);
|
|
||||||
|
|
||||||
m_d->m_scrollArea = new QScrollArea;
|
|
||||||
m_d->m_scrollArea->setFrameStyle(QFrame::NoFrame);
|
|
||||||
m_d->m_scrollArea->setWidget(m_d->m_widget);
|
|
||||||
m_d->m_scrollArea->setWidgetResizable(true);
|
|
||||||
|
|
||||||
PluginManager *pluginManager = PluginManager::instance();
|
|
||||||
connect(pluginManager, SIGNAL(objectAdded(QObject*)), SLOT(welcomePluginAdded(QObject*)));
|
|
||||||
|
|
||||||
connect(m_d->ui.feedbackButton, SIGNAL(clicked()), SLOT(slotFeedback()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WelcomeMode::~WelcomeMode()
|
WelcomeMode::~WelcomeMode()
|
||||||
{
|
{
|
||||||
// QSettings *settings = Core::ICore::instance()->settings();
|
delete m_d->declarativeView;
|
||||||
// settings->setValue("General/WelcomeTab", m_d->ui.stackedWidget->currentIndex());
|
|
||||||
delete m_d->m_widget;
|
|
||||||
delete m_d;
|
delete m_d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +102,7 @@ int WelcomeMode::priority() const
|
|||||||
|
|
||||||
QWidget* WelcomeMode::widget()
|
QWidget* WelcomeMode::widget()
|
||||||
{
|
{
|
||||||
return m_d->m_scrollArea;
|
return m_d->declarativeView;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* WelcomeMode::uniqueModeName() const
|
const char* WelcomeMode::uniqueModeName() const
|
||||||
@ -143,87 +117,14 @@ QList<int> WelcomeMode::context() const
|
|||||||
return contexts;
|
return contexts;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sortFunction(IWelcomePage * a, IWelcomePage *b)
|
void WelcomeMode::openUrl(const QString &url)
|
||||||
{
|
{
|
||||||
return a->priority() < b->priority();
|
QDesktopServices::openUrl(QUrl(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WelcomeMode::initPlugins()
|
void WelcomeMode::openPage(const QString &page)
|
||||||
{
|
{
|
||||||
m_d->buttonLayout = new QHBoxLayout(m_d->ui.navFrame);
|
Core::ModeManager::instance()->activateMode(page);
|
||||||
m_d->buttonLayout->setMargin(0);
|
|
||||||
m_d->buttonLayout->setSpacing(0);
|
|
||||||
delete m_d->ui.stackedWidget->currentWidget();
|
|
||||||
QList<IWelcomePage*> plugins = PluginManager::instance()->getObjects<IWelcomePage>();
|
|
||||||
qSort(plugins.begin(), plugins.end(), &sortFunction);
|
|
||||||
foreach (IWelcomePage* plugin, plugins) {
|
|
||||||
// QToolButton * btn = new QToolButton;
|
|
||||||
// btn->setCheckable(true);
|
|
||||||
// btn->setText(plugin->title());
|
|
||||||
// btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
||||||
// btn->setAutoExclusive(true);
|
|
||||||
// connect (btn, SIGNAL(clicked()), SLOT(showClickedPage()));
|
|
||||||
m_d->ui.stackedWidget->addWidget(plugin->page());
|
|
||||||
// m_d->buttonLayout->addWidget(btn);
|
|
||||||
// m_d->buttonMap.insert(btn, plugin->page());
|
|
||||||
}
|
|
||||||
m_d->buttonLayout->addSpacing(5);
|
|
||||||
|
|
||||||
// TODO, This probably can beremoved. See OP-310
|
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
|
||||||
int tabId = settings->value("General/WelcomeTab", 0).toInt();
|
|
||||||
|
|
||||||
int pluginCount = m_d->ui.stackedWidget->count();
|
|
||||||
if (tabId < pluginCount) {
|
|
||||||
m_d->ui.stackedWidget->setCurrentIndex(tabId);
|
|
||||||
QMapIterator<QAbstractButton*, QWidget*> it(m_d->buttonMap);
|
|
||||||
while (it.hasNext())
|
|
||||||
if (it.next().value() == m_d->ui.stackedWidget->currentWidget()) {
|
|
||||||
it.key()->setChecked(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// TODO Delete until here
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WelcomeMode::welcomePluginAdded(QObject *obj)
|
|
||||||
{
|
|
||||||
if (IWelcomePage *plugin = qobject_cast<IWelcomePage*>(obj))
|
|
||||||
{
|
|
||||||
QToolButton * btn = new QToolButton;
|
|
||||||
btn->setCheckable(true);
|
|
||||||
btn->setAutoExclusive(true);
|
|
||||||
btn->setText(plugin->title());
|
|
||||||
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
||||||
connect (btn, SIGNAL(clicked()), SLOT(showClickedPage()));
|
|
||||||
int insertPos = 0;
|
|
||||||
QList<IWelcomePage*> plugins = PluginManager::instance()->getObjects<IWelcomePage>();
|
|
||||||
foreach (IWelcomePage* p, plugins) {
|
|
||||||
if (plugin->priority() < p->priority())
|
|
||||||
insertPos++;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
m_d->ui.stackedWidget->insertWidget(insertPos, plugin->page());
|
|
||||||
m_d->buttonMap.insert(btn, plugin->page());
|
|
||||||
m_d->buttonLayout->insertWidget(insertPos, btn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WelcomeMode::showClickedPage()
|
|
||||||
{
|
|
||||||
QAbstractButton *btn = qobject_cast<QAbstractButton*>(sender());
|
|
||||||
QMap<QAbstractButton*, QWidget*>::iterator it = m_d->buttonMap.find(btn);
|
|
||||||
if (it.value())
|
|
||||||
m_d->ui.stackedWidget->setCurrentWidget(it.value());
|
|
||||||
}
|
|
||||||
|
|
||||||
void WelcomeMode::slotFeedback()
|
|
||||||
{
|
|
||||||
QDesktopServices::openUrl(QUrl(QLatin1String(
|
|
||||||
"http://forums.openpilot.org")));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Welcome
|
} // namespace Welcome
|
||||||
|
@ -60,13 +60,11 @@ public:
|
|||||||
QList<int> context() const;
|
QList<int> context() const;
|
||||||
void activated();
|
void activated();
|
||||||
QString contextHelpId() const { return QLatin1String("OpenPilot GCS"); }
|
QString contextHelpId() const { return QLatin1String("OpenPilot GCS"); }
|
||||||
void initPlugins();
|
|
||||||
void setPriority(int priority) { m_priority = priority; }
|
void setPriority(int priority) { m_priority = priority; }
|
||||||
|
|
||||||
private slots:
|
public slots:
|
||||||
void slotFeedback();
|
void openUrl(const QString &url);
|
||||||
void welcomePluginAdded(QObject*);
|
void openPage(const QString &page);
|
||||||
void showClickedPage();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WelcomeModePrivate *m_d;
|
WelcomeModePrivate *m_d;
|
||||||
|
@ -1,379 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Welcome::WelcomeMode</class>
|
|
||||||
<widget class="QWidget" name="Welcome::WelcomeMode">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>864</width>
|
|
||||||
<height>690</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">#Welcome--WelcomePage {
|
|
||||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(215, 215, 215, 255));
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton, QPushButton, QComboBox {
|
|
||||||
border-image: url(:/welcome/images/btn_26.png) 4;
|
|
||||||
border-width: 4;
|
|
||||||
padding: 0px 6px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
*{
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
QComboBox QAbstractItemView {
|
|
||||||
background-color:white;
|
|
||||||
}
|
|
||||||
|
|
||||||
QComboBox::down-arrow {
|
|
||||||
image: url(:/welcome/images/combobox_arrow.png);
|
|
||||||
}
|
|
||||||
|
|
||||||
QComboBox:drop-down
|
|
||||||
{
|
|
||||||
subcontrol-origin: padding;
|
|
||||||
subcontrol-position: top right;
|
|
||||||
border-left-style: none;
|
|
||||||
border-top-right-radius: 1px;
|
|
||||||
border-bottom-right-radius: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton:hover, QPushButton:hover, QComboBox:hover {
|
|
||||||
border-image: url(:/welcome/images/btn_26_hover.png) 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
|
|
||||||
color:gray;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton:pressed, QPushButton:pressed{
|
|
||||||
border-image: url(:/welcome/images/btn_26_pressed.png) 4;
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="gradientWidget" native="true">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string>#gradientWidget {
|
|
||||||
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(215, 215, 215, 255));
|
|
||||||
}</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QFrame" name="mainFrame">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>662</width>
|
|
||||||
<height>515</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>662</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">#mainFrame {
|
|
||||||
border-image: url(:/welcome/images/background_center_frame.png) 4;
|
|
||||||
border-width: 4;
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="headerFrame">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>649</width>
|
|
||||||
<height>74</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>649</width>
|
|
||||||
<height>89</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string>#headerFrame {
|
|
||||||
border-image: url(:/welcome/images/center_frame_header.png) 0;
|
|
||||||
border-width: 0;
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="navFrame">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="cursor">
|
|
||||||
<cursorShape>PointingHandCursor</cursorShape>
|
|
||||||
</property>
|
|
||||||
<property name="autoFillBackground">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">QToolButton {
|
|
||||||
border-image:none;
|
|
||||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0.0, y2: 1.0,
|
|
||||||
stop: 0 #838383,
|
|
||||||
stop: 0.4 #707070,
|
|
||||||
stop: 0.401 #636363,
|
|
||||||
stop: 1 #4a4a4a);
|
|
||||||
border: 0px solid black;
|
|
||||||
border-top: 1px solid #303030;
|
|
||||||
border-bottom: 1px solid #202020;
|
|
||||||
color: white;
|
|
||||||
height:20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton:hover {
|
|
||||||
border-image:none;
|
|
||||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0.0, y2: 1.0,
|
|
||||||
stop: 0 #909090,
|
|
||||||
stop: 0.4 #808080,
|
|
||||||
stop: 0.401 #707070,
|
|
||||||
stop: 1 #555555);
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton:checked, QToolButton:checked:pressed {
|
|
||||||
border-image:none;
|
|
||||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0.0, y2: 1.0,
|
|
||||||
stop: 0 #ffffff,
|
|
||||||
stop: 0.4 #eeeeee,
|
|
||||||
stop: 0.401 #e2e2e2,
|
|
||||||
stop: 1 #dddddd);
|
|
||||||
color: black;
|
|
||||||
border-top: 1px solid #606060;
|
|
||||||
border-bottom: 1px solid #404040;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton:pressed {
|
|
||||||
border-image:none;
|
|
||||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0.0, y2: 1.0,
|
|
||||||
stop: 0 #383838,
|
|
||||||
stop: 0.2 #404040,
|
|
||||||
stop: 0.201 #484848,
|
|
||||||
stop: 1 #505050);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QStackedWidget" name="stackedWidget">
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="widget">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_7">
|
|
||||||
<property name="margin">
|
|
||||||
<number>18</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>24</number>
|
|
||||||
</property>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>17</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="helpUsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Help us make OpenPilot even better</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_6">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>6</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="feedbackButton">
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::TabFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">height:19px;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Feedback</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="welcome.qrc">
|
|
||||||
<normaloff>:/welcome/images/feedback_arrow.png</normaloff>:/welcome/images/feedback_arrow.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<spacer name="bottomVerticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<spacer name="topVerticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources>
|
|
||||||
<include location="welcome.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@ -30,8 +30,6 @@
|
|||||||
|
|
||||||
#include "welcomemode.h"
|
#include "welcomemode.h"
|
||||||
|
|
||||||
#include "communitywelcomepage.h"
|
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/basemode.h>
|
#include <coreplugin/basemode.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
@ -49,7 +47,7 @@
|
|||||||
using namespace Welcome::Internal;
|
using namespace Welcome::Internal;
|
||||||
|
|
||||||
WelcomePlugin::WelcomePlugin()
|
WelcomePlugin::WelcomePlugin()
|
||||||
: m_welcomeMode(0), m_communityWelcomePage(0)
|
: m_welcomeMode(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,10 +57,6 @@ WelcomePlugin::~WelcomePlugin()
|
|||||||
removeObject(m_welcomeMode);
|
removeObject(m_welcomeMode);
|
||||||
delete m_welcomeMode;
|
delete m_welcomeMode;
|
||||||
}
|
}
|
||||||
if (m_communityWelcomePage) {
|
|
||||||
removeObject(m_communityWelcomePage);
|
|
||||||
delete m_communityWelcomePage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Initializes the plugin. Returns true on success.
|
/*! Initializes the plugin. Returns true on success.
|
||||||
@ -76,9 +70,6 @@ bool WelcomePlugin::initialize(const QStringList &arguments, QString *error_mess
|
|||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(error_message)
|
Q_UNUSED(error_message)
|
||||||
|
|
||||||
m_communityWelcomePage = new Internal::CommunityWelcomePage;
|
|
||||||
addObject(m_communityWelcomePage);
|
|
||||||
|
|
||||||
m_welcomeMode = new WelcomeMode;
|
m_welcomeMode = new WelcomeMode;
|
||||||
addObject(m_welcomeMode);
|
addObject(m_welcomeMode);
|
||||||
|
|
||||||
@ -98,7 +89,6 @@ bool WelcomePlugin::initialize(const QStringList &arguments, QString *error_mess
|
|||||||
*/
|
*/
|
||||||
void WelcomePlugin::extensionsInitialized()
|
void WelcomePlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
m_welcomeMode->initPlugins();
|
|
||||||
Core::ModeManager::instance()->activateMode(m_welcomeMode->uniqueModeName());
|
Core::ModeManager::instance()->activateMode(m_welcomeMode->uniqueModeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ namespace Welcome {
|
|||||||
class WelcomeMode;
|
class WelcomeMode;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class CommunityWelcomePage;
|
|
||||||
|
|
||||||
class WelcomePlugin
|
class WelcomePlugin
|
||||||
: public ExtensionSystem::IPlugin
|
: public ExtensionSystem::IPlugin
|
||||||
@ -53,7 +52,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
WelcomeMode *m_welcomeMode;
|
WelcomeMode *m_welcomeMode;
|
||||||
Internal::CommunityWelcomePage *m_communityWelcomePage;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Welcome
|
} // namespace Welcome
|
||||||
|