From b99cb4c431f7184089789f56e2d76478d056dc3e Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Sun, 9 Feb 2014 00:35:46 +0100 Subject: [PATCH 1/3] Import and Export of profiles removed. --- companion/src/fwpreferencesdialog.cpp | 50 --------------------------- companion/src/fwpreferencesdialog.h | 2 -- companion/src/fwpreferencesdialog.ui | 28 ++++----------- 3 files changed, 7 insertions(+), 73 deletions(-) diff --git a/companion/src/fwpreferencesdialog.cpp b/companion/src/fwpreferencesdialog.cpp index c4c2a820b..2dfce0e73 100644 --- a/companion/src/fwpreferencesdialog.cpp +++ b/companion/src/fwpreferencesdialog.cpp @@ -460,56 +460,6 @@ void fwPreferencesDialog::on_ProfSave_PB_clicked() } } -void fwPreferencesDialog::on_export_PB_clicked() -{ - QSettings settings; - QString profile=QString("profile%1").arg(ui->ProfSlot_SB->value()); - QString name=ui->ProfName_LE->text(); - if (!name.isEmpty()) { - QString fileName = QFileDialog::getSaveFileName(this, tr("Export profile As"), settings.value("lastDir").toString() + "/" +name+".ini" , "*.ini"); - if (fileName.isEmpty()) - return; - QSettings exportfile(fileName, QSettings::IniFormat); - settings.beginGroup("Profiles"); - settings.beginGroup(profile); - QStringList keys = settings.childKeys(); - foreach (QString key, keys) { - exportfile.setValue(key,settings.value(key)); - } - settings.endGroup(); - } - settings.endGroup(); -} - -void fwPreferencesDialog::on_import_PB_clicked() -{ - QSettings settings; - QString profile=QString("profile%1").arg(ui->ProfSlot_SB->value()); - QString name=ui->ProfName_LE->text(); - if (!name.isEmpty()) { - int ret = QMessageBox::question(this, "Companion", - tr("Profile slot is not empty, profile slot %1 will we overwritten.
Are you sure ?").arg(ui->ProfSlot_SB->value()) , - QMessageBox::Yes | QMessageBox::No); - if (ret==QMessageBox::No) { - return; - } - } - QString fileName = QFileDialog::getOpenFileName(this, tr("Open Profile to import"), settings.value("lastDir").toString(), "*.ini"); - if (fileName.isEmpty()) - return; - QSettings importfile(fileName, QSettings::IniFormat); - settings.beginGroup("Profiles"); - settings.beginGroup(profile); - QStringList keys = importfile.childKeys(); - foreach (QString key, keys) { - settings.setValue(key,importfile.value(key)); - } - settings.endGroup(); - settings.endGroup(); - on_ProfSlot_SB_valueChanged(); -} - - void fwPreferencesDialog::on_SplashSelect_clicked() { QString supportedImageFormats; diff --git a/companion/src/fwpreferencesdialog.h b/companion/src/fwpreferencesdialog.h index 6a3b165d7..67eb0bd03 100644 --- a/companion/src/fwpreferencesdialog.h +++ b/companion/src/fwpreferencesdialog.h @@ -43,8 +43,6 @@ private slots: void on_checkFWUpdates_clicked(); void on_ProfSlot_SB_valueChanged(); void on_ProfSave_PB_clicked(); - void on_export_PB_clicked(); - void on_import_PB_clicked(); void on_SplashSelect_clicked(); void on_clearImageButton_clicked(); }; diff --git a/companion/src/fwpreferencesdialog.ui b/companion/src/fwpreferencesdialog.ui index 798862ded..b7b4e54f5 100644 --- a/companion/src/fwpreferencesdialog.ui +++ b/companion/src/fwpreferencesdialog.ui @@ -86,13 +86,6 @@ - - - - Save Profile - - - @@ -938,20 +931,6 @@ This is used by the templated to determine which channel goes to what number out - - - - Export - - - - - - - Import - - - @@ -1126,6 +1105,13 @@ May be different from firmware language + + + + Save Profile + + + From 7ef74361180d9e3dff6c821cd194c7443d5b0a24 Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Sun, 9 Feb 2014 01:12:01 +0100 Subject: [PATCH 2/3] Fixes #495 Added link to OpenTX documentation page in the help menu --- companion/src/mainwindow.cpp | 12 ++++++++++++ companion/src/mainwindow.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index fd9cfc9f9..df57d182c 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include "mainwindow.h" #include "mdichild.h" #include "burnconfigdialog.h" @@ -686,6 +687,11 @@ void MainWindow::newFile() child->show(); } +void MainWindow::openDocumentURL() +{ + QString link = "http://www.open-tx.org/documents.html"; + QDesktopServices::openUrl(QUrl(link)); +} void MainWindow::openFile() { @@ -1900,6 +1906,11 @@ void MainWindow::createActions() russianLanguageAct = new QAction(tr("Russian"),this); russianLanguageAct->setStatusTip(tr("Use Russian in menus")); connect(russianLanguageAct, SIGNAL(triggered()), this, SLOT(setRULanguage())); + + openDocumentURLAct = new QAction(tr("Manuals and other Documents"),this); + openDocumentURLAct->setStatusTip(tr("Open the OpenTX document page in a web browser")); + connect(openDocumentURLAct, SIGNAL(triggered()), this, SLOT(openDocumentURL())); + } void MainWindow::createMenus() @@ -1992,6 +2003,7 @@ void MainWindow::createMenus() helpMenu->addAction(checkForUpdatesAct); helpMenu->addSeparator(); helpMenu->addAction(aboutAct); + helpMenu->addAction(openDocumentURLAct); helpMenu->addSeparator(); helpMenu->addAction(changelogAct); helpMenu->addAction(fwchangelogAct); diff --git a/companion/src/mainwindow.h b/companion/src/mainwindow.h index 60d6759fc..34472d123 100644 --- a/companion/src/mainwindow.h +++ b/companion/src/mainwindow.h @@ -83,6 +83,8 @@ public slots: void unloadProfile(); private slots: + void openDocumentURL(); + void setLanguage(QString langString); void setDefaultLanguage() {setLanguage("");}; void setCZLanguage() {setLanguage("cs_CZ");}; @@ -270,6 +272,7 @@ private: QAction *portugueseLanguageAct; QAction *swedishLanguageAct; QAction *russianLanguageAct; + QAction *openDocumentURLAct; QString fwToUpdate; QToolButton * profileButton; }; From d932bfc79a2535976b4ed86d98df055158bf23e6 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 9 Feb 2014 08:49:54 +0100 Subject: [PATCH 3/3] Update DONATIONS.txt --- DONATIONS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index b1ff31579..2f8a9e743 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -316,3 +316,4 @@ Christian Fuchs Arold Reinders Robert Miller Aviomotive - www.aviomotive.com +Mark Gaskievicz