1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-879 removed now unused importsettings dialog

This commit is contained in:
Philippe Renon 2013-04-07 22:28:13 +02:00
parent 030cab376e
commit f6c94687fc
4 changed files with 13 additions and 180 deletions

View File

@ -1,22 +1,27 @@
TEMPLATE = lib
TARGET = Core
DEFINES += CORE_LIBRARY
QT += declarative \
xml \
network \
script \
svg \
sql
include(../../openpilotgcsplugin.pri)
include(../../libs/utils/utils.pri)
include(../../shared/scriptwrapper/scriptwrapper.pri)
include(coreplugin_dependencies.pri)
INCLUDEPATH += dialogs \
uavgadgetmanager \
actionmanager
DEPENDPATH += dialogs \
uavgadgetmanager \
actionmanager
SOURCES += mainwindow.cpp \
tabpositionindicator.cpp \
fancyactionbar.cpp \
@ -64,8 +69,8 @@ SOURCES += mainwindow.cpp \
workspacesettings.cpp \
uavconfiginfo.cpp \
authorsdialog.cpp \
telemetrymonitorwidget.cpp \
dialogs/importsettings.cpp
telemetrymonitorwidget.cpp
HEADERS += mainwindow.h \
tabpositionindicator.h \
fancyactionbar.h \
@ -126,20 +131,22 @@ HEADERS += mainwindow.h \
uavconfiginfo.h \
authorsdialog.h \
iconfigurableplugin.h \
telemetrymonitorwidget.h \
dialogs/importsettings.h
telemetrymonitorwidget.h
FORMS += dialogs/settingsdialog.ui \
dialogs/shortcutsettings.ui \
generalsettings.ui \
uavgadgetoptionspage.ui \
workspacesettings.ui \
dialogs/importsettings.ui
workspacesettings.ui
RESOURCES += core.qrc \
fancyactionbar.qrc
unix:!macx {
images.files = images/openpilot_logo_*.png
images.files = images/qtcreator_logo_*.png
images.path = /share/pixmaps
INSTALLS += images
}
OTHER_FILES += Core.pluginspec

View File

@ -1,57 +0,0 @@
#include "importsettings.h"
#include "ui_importsettings.h"
#include <QDir>
#include <QSettings>
#include <utils/xmlconfig.h>
#include <QTimer>
importSettings::importSettings(QWidget *parent) :
QDialog(parent),
ui(new Ui::importSettings)
{
ui->setupUi(this);
connect(ui->cbConfigs, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDetails(int)));
connect(ui->btnLoad, SIGNAL(clicked()), this, SLOT(accept()));
QTimer::singleShot(500, this, SLOT(repaint()));
}
void importSettings::loadFiles(QString path)
{
QDir myDir(path);
QStringList filters;
filters << "*.xml";
QStringList list = myDir.entryList(filters,QDir::Files);
int x = 0;
foreach(QString fileStr, list) {
fileInfo *info = new fileInfo;
QSettings settings(path+QDir::separator() + fileStr, XmlConfig::XmlSettingsFormat);
settings.beginGroup("General");
info->description = settings.value("Description", "None").toString();
info->details = settings.value("Details", "None").toString();
settings.endGroup();
info->file = path + QDir::separator() + fileStr;
configList.insert(x,info);
ui->cbConfigs->addItem(info->description, x);
++x;
}
}
void importSettings::updateDetails(int index)
{
fileInfo *info = configList.value(ui->cbConfigs->itemData(index).toInt());
ui->lblDetails->setText(info->details);
}
QString importSettings::choosenConfig()
{
fileInfo *info = configList.value(ui->cbConfigs->itemData(ui->cbConfigs->currentIndex()).toInt());
return info->file;
}
importSettings::~importSettings()
{
foreach(fileInfo * info,configList.values()) {
delete info;
}
delete ui;
}

View File

@ -1,35 +0,0 @@
#ifndef IMPORTSETTINGS_H
#define IMPORTSETTINGS_H
#include <QDialog>
#include <QMap>
namespace Ui {
class importSettings;
}
class importSettings : public QDialog
{
Q_OBJECT
struct fileInfo {
QString file;
QString description;
QString details;
};
public:
explicit importSettings(QWidget *parent = 0);
~importSettings();
void loadFiles(QString path);
QString choosenConfig();
private:
Ui::importSettings *ui;
QMap<int,fileInfo*> configList;
private slots:
void updateDetails(int);
};
#endif // IMPORTSETTINGS_H

View File

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>importSettings</class>
<widget class="QDialog" name="importSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>373</width>
<height>167</height>
</rect>
</property>
<property name="windowTitle">
<string>OpenPilotGCS</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>No configuration file could be found.
Please choose from one of the default configurations</string>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbConfigs"/>
</item>
<item>
<widget class="QLabel" name="lblDetails">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<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="QPushButton" name="btnLoad">
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>