From 15fdfc41615e8567425eaa9bfc8f8eed74b737a6 Mon Sep 17 00:00:00 2001 From: pedro Date: Mon, 14 Jun 2010 20:14:09 +0000 Subject: [PATCH] minor progress git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@774 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/config/Config.pluginspec | 2 +- ground/src/plugins/config/config.pro | 1 + ground/src/plugins/config/configgadget.h | 1 + ground/src/plugins/config/configgadget.ui | 92 ++++++++++++++++++ .../plugins/config/configgadgetfactory.cpp | 2 +- .../src/plugins/config/configgadgetwidget.cpp | 13 ++- .../src/plugins/config/configgadgetwidget.h | 7 ++ ground/src/plugins/config/configplugin.cpp | 4 +- ground/src/plugins/config/ui_configgadget.h | 96 +++++++++++++++++++ .../plugins/config/ui_configgadgetwidget.h | 96 +++++++++++++++++++ 10 files changed, 305 insertions(+), 9 deletions(-) create mode 100644 ground/src/plugins/config/configgadget.ui create mode 100644 ground/src/plugins/config/ui_configgadget.h create mode 100644 ground/src/plugins/config/ui_configgadgetwidget.h diff --git a/ground/src/plugins/config/Config.pluginspec b/ground/src/plugins/config/Config.pluginspec index e21390f80..91b409c9b 100644 --- a/ground/src/plugins/config/Config.pluginspec +++ b/ground/src/plugins/config/Config.pluginspec @@ -1,4 +1,4 @@ - + The OpenPilot Project (C) 2010 OpenPilot Project Your License goes here diff --git a/ground/src/plugins/config/config.pro b/ground/src/plugins/config/config.pro index c15fb1633..def31f896 100644 --- a/ground/src/plugins/config/config.pro +++ b/ground/src/plugins/config/config.pro @@ -15,3 +15,4 @@ SOURCES += configplugin.cpp \ configgadgetfactory.cpp \ configgadgetoptionspage.cpp \ configgadget.cpp +FORMS += configgadget.ui diff --git a/ground/src/plugins/config/configgadget.h b/ground/src/plugins/config/configgadget.h index 0c80e6f86..f50e86630 100644 --- a/ground/src/plugins/config/configgadget.h +++ b/ground/src/plugins/config/configgadget.h @@ -35,6 +35,7 @@ class IUAVGadget; class QWidget; class QString; class ConfigGadgetWidget; +class Ui_ConfigGadget; using namespace Core; diff --git a/ground/src/plugins/config/configgadget.ui b/ground/src/plugins/config/configgadget.ui new file mode 100644 index 000000000..ecb89a351 --- /dev/null +++ b/ground/src/plugins/config/configgadget.ui @@ -0,0 +1,92 @@ + + + ConfigGadget + + + + 0 + 0 + 500 + 400 + + + + Form + + + + + 10 + 350 + 481 + 41 + + + + + QLayout::SetMinimumSize + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Send + + + + + + + + + 10 + 10 + 221 + 331 + + + + + 0 + 0 + + + + + + + 240 + 10 + 251 + 331 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + diff --git a/ground/src/plugins/config/configgadgetfactory.cpp b/ground/src/plugins/config/configgadgetfactory.cpp index 85135f73a..088033711 100644 --- a/ground/src/plugins/config/configgadgetfactory.cpp +++ b/ground/src/plugins/config/configgadgetfactory.cpp @@ -32,7 +32,7 @@ #include ConfigGadgetFactory::ConfigGadgetFactory(QObject *parent) : - IUAVGadgetFactory(QString("MapGadget"), tr("Map Gadget"), parent) + IUAVGadgetFactory(QString("ConfigGadget"), tr("Config Gadget"), parent) { } diff --git a/ground/src/plugins/config/configgadgetwidget.cpp b/ground/src/plugins/config/configgadgetwidget.cpp index 3cc01ac4e..e06c9d2da 100644 --- a/ground/src/plugins/config/configgadgetwidget.cpp +++ b/ground/src/plugins/config/configgadgetwidget.cpp @@ -25,6 +25,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "configgadgetwidget.h" +#include "ui_configgadget.h" #include @@ -35,12 +36,14 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) { - setMinimumSize(64,64); + m_config = new Ui_ConfigGadget(); + m_config->setupUi(this); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - this-> - setToolTip(tr("Choose a gadget to display in this view.\n") + - tr("You can also split this view in two.\n\n") + - tr("Maybe you first have to choose Show Toolbars in the Window menu.")); +// this-> +// setToolTip(tr("Choose a gadget to display in this view.\n") + +// tr("You can also split this view in two.\n\n") + +// tr("Maybe you first have to choose Show Toolbars in the Window menu.")); + } ConfigGadgetWidget::~ConfigGadgetWidget() diff --git a/ground/src/plugins/config/configgadgetwidget.h b/ground/src/plugins/config/configgadgetwidget.h index cadde43bc..97fac6264 100644 --- a/ground/src/plugins/config/configgadgetwidget.h +++ b/ground/src/plugins/config/configgadgetwidget.h @@ -27,8 +27,11 @@ #ifndef CONFIGGADGETWIDGET_H #define CONFIGGADGETWIDGET_H +#include "ui_configgadget.h" #include +class Ui_ConfigGadget; + class ConfigGadgetWidget: public QWidget { Q_OBJECT @@ -39,6 +42,10 @@ public: protected: void resizeEvent(QResizeEvent * event); + +private: + Ui_ConfigGadget *m_config; + }; #endif // CONFIGGADGETWIDGET_H diff --git a/ground/src/plugins/config/configplugin.cpp b/ground/src/plugins/config/configplugin.cpp index a91aa8246..bc9ef96a9 100644 --- a/ground/src/plugins/config/configplugin.cpp +++ b/ground/src/plugins/config/configplugin.cpp @@ -44,8 +44,8 @@ bool ConfigPlugin::initialize(const QStringList& args, QString *errMsg) { Q_UNUSED(args); Q_UNUSED(errMsg); -// cf = new ConfigGadgetFactory(this); -// addAutoReleasedObject(cf); + cf = new ConfigGadgetFactory(this); + addAutoReleasedObject(cf); return true; } diff --git a/ground/src/plugins/config/ui_configgadget.h b/ground/src/plugins/config/ui_configgadget.h new file mode 100644 index 000000000..a5ec6e8b6 --- /dev/null +++ b/ground/src/plugins/config/ui_configgadget.h @@ -0,0 +1,96 @@ +/******************************************************************************** +** Form generated from reading UI file 'configgadget.ui' +** +** Created: Wed 19. May 23:01:40 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CONFIGGADGET_H +#define UI_CONFIGGADGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_ConfigGadget +{ +public: + QWidget *horizontalLayoutWidget; + QHBoxLayout *horizontalLayout; + QSpacerItem *horizontalSpacer; + QPushButton *sendButtun; + QTreeView *treeView; + QFrame *frame; + + void setupUi(QWidget *ConfigGadget) + { + if (ConfigGadget->objectName().isEmpty()) + ConfigGadget->setObjectName(QString::fromUtf8("ConfigGadget")); + ConfigGadget->resize(500, 400); + horizontalLayoutWidget = new QWidget(ConfigGadget); + horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget")); + horizontalLayoutWidget->setGeometry(QRect(10, 350, 481, 41)); + horizontalLayout = new QHBoxLayout(horizontalLayoutWidget); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setSizeConstraint(QLayout::SetMinimumSize); + horizontalLayout->setContentsMargins(0, 0, 0, 0); + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout->addItem(horizontalSpacer); + + sendButtun = new QPushButton(horizontalLayoutWidget); + sendButtun->setObjectName(QString::fromUtf8("sendButtun")); + + horizontalLayout->addWidget(sendButtun); + + treeView = new QTreeView(ConfigGadget); + treeView->setObjectName(QString::fromUtf8("treeView")); + treeView->setGeometry(QRect(10, 10, 221, 331)); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(treeView->sizePolicy().hasHeightForWidth()); + treeView->setSizePolicy(sizePolicy); + frame = new QFrame(ConfigGadget); + frame->setObjectName(QString::fromUtf8("frame")); + frame->setGeometry(QRect(240, 10, 251, 331)); + QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(frame->sizePolicy().hasHeightForWidth()); + frame->setSizePolicy(sizePolicy1); + frame->setFrameShape(QFrame::StyledPanel); + frame->setFrameShadow(QFrame::Raised); + + retranslateUi(ConfigGadget); + + QMetaObject::connectSlotsByName(ConfigGadget); + } // setupUi + + void retranslateUi(QWidget *ConfigGadget) + { + ConfigGadget->setWindowTitle(QApplication::translate("ConfigGadget", "Form", 0, QApplication::UnicodeUTF8)); + sendButtun->setText(QApplication::translate("ConfigGadget", "Send", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class ConfigGadget: public Ui_ConfigGadget {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CONFIGGADGET_H diff --git a/ground/src/plugins/config/ui_configgadgetwidget.h b/ground/src/plugins/config/ui_configgadgetwidget.h new file mode 100644 index 000000000..3307f844d --- /dev/null +++ b/ground/src/plugins/config/ui_configgadgetwidget.h @@ -0,0 +1,96 @@ +/******************************************************************************** +** Form generated from reading UI file 'configgadgetwidget.ui' +** +** Created: Tue 18. May 19:44:42 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_CONFIGGADGETWIDGET_H +#define UI_CONFIGGADGETWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_ConfigGadgetWidget +{ +public: + QWidget *horizontalLayoutWidget; + QHBoxLayout *horizontalLayout; + QSpacerItem *horizontalSpacer; + QPushButton *sendButtun; + QTreeView *treeView; + QFrame *frame; + + void setupUi(QWidget *ConfigGadgetWidget) + { + if (ConfigGadgetWidget->objectName().isEmpty()) + ConfigGadgetWidget->setObjectName(QString::fromUtf8("ConfigGadgetWidget")); + ConfigGadgetWidget->resize(500, 400); + horizontalLayoutWidget = new QWidget(ConfigGadgetWidget); + horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget")); + horizontalLayoutWidget->setGeometry(QRect(10, 350, 481, 41)); + horizontalLayout = new QHBoxLayout(horizontalLayoutWidget); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setSizeConstraint(QLayout::SetMinimumSize); + horizontalLayout->setContentsMargins(0, 0, 0, 0); + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout->addItem(horizontalSpacer); + + sendButtun = new QPushButton(horizontalLayoutWidget); + sendButtun->setObjectName(QString::fromUtf8("sendButtun")); + + horizontalLayout->addWidget(sendButtun); + + treeView = new QTreeView(ConfigGadgetWidget); + treeView->setObjectName(QString::fromUtf8("treeView")); + treeView->setGeometry(QRect(10, 10, 221, 331)); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(treeView->sizePolicy().hasHeightForWidth()); + treeView->setSizePolicy(sizePolicy); + frame = new QFrame(ConfigGadgetWidget); + frame->setObjectName(QString::fromUtf8("frame")); + frame->setGeometry(QRect(240, 10, 251, 331)); + QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(frame->sizePolicy().hasHeightForWidth()); + frame->setSizePolicy(sizePolicy1); + frame->setFrameShape(QFrame::StyledPanel); + frame->setFrameShadow(QFrame::Raised); + + retranslateUi(ConfigGadgetWidget); + + QMetaObject::connectSlotsByName(ConfigGadgetWidget); + } // setupUi + + void retranslateUi(QWidget *ConfigGadgetWidget) + { + ConfigGadgetWidget->setWindowTitle(QApplication::translate("ConfigGadgetWidget", "Form", 0, QApplication::UnicodeUTF8)); + sendButtun->setText(QApplication::translate("ConfigGadgetWidget", "Send", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class ConfigGadgetWidget: public Ui_ConfigGadgetWidget {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_CONFIGGADGETWIDGET_H