1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

Contributors / Release notes dialogs refactoring

This commit is contained in:
bsongis 2015-07-08 18:54:09 +02:00
parent 46d7fb3ff6
commit df7f715dd3
13 changed files with 841 additions and 729 deletions

View file

@ -1,11 +1,14 @@
Bertrand Songis Bertrand Songis (bsongis)
Romolo Manfredini André Bernet (kilrah)
André Bernet
Michael Blandford Michael Blandford
Damjan Adamic (projectkk2glider)
Franck Aguerre (jivarofad)
Romolo Manfredini (romoloman)
Martin Hotař (mhotar)
Rob Thomson Rob Thomson
Bryan J. Rentoul (aka Gruvin) Bryan J. Rentoul (gruvin)
Cameron Weeks Cameron Weeks (th9xer)
Martin Hotař
Andreas Weitl Andreas Weitl
Kjell Kernen Kjell Kernen
Gabriel Birkus Gabriel Birkus
@ -13,10 +16,4 @@ Jean-Pierre Parisy
Karl Szmutny Karl Szmutny
Michal Hlavinka Michal Hlavinka
Pat Mackenzie Pat Mackenzie
Michael Byrne (logos and official splashes) Michael Byrne
Severino Anedda (splash screens)
Grootwitbaas - 9xforums.com (mac)
Adrian Amberg (splash screens)
Wallaguest1 - 9xforums.com (splash screens)
HC1969 - 9xforums.com (splash screens)

View file

@ -1,3 +1,13 @@
<a href="http://frsky-rc.com">FrSky (monthly)</a>
<a href="http://alofthobbies.com">Aloft Hobbies</a>
<a href="http://jonathan.it">Jonathan Modellismo</a>
<a href="http://wstech.de">WsTech</a>
<a href="http://aviomotive.com">Aviomotive</a>
<a href="http://boltrc.com">BoltRC</a>
<a href="http://aerialtechhobbies.com">Aerial Tech Hobbies</a>
<a href="http://litepilots.com">LitePilots</a>
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
Mario Sette Mario Sette
Felice Baratto Felice Baratto
Alessandro Mari Alessandro Mari
@ -17,8 +27,8 @@ Marc Lucht
Michel Baily Michel Baily
Zdenek Trojanek Zdenek Trojanek
Martin Hotar Martin Hotar
[Devo] Stefan Grundevik Stefan Grundevik
[Devo] Fabio Eboli Fabio Eboli
Federico Zotti Federico Zotti
Albin Esbjörnsson Albin Esbjörnsson
Kilian Hüttenhofer Kilian Hüttenhofer
@ -37,7 +47,6 @@ R. Scott Page
Johan Cronje Johan Cronje
Renato Aranghelovici Renato Aranghelovici
Jeffrey Irvin Jeffrey Irvin
Aloft Hobbies
John Rodgers John Rodgers
Kenneth Crump Kenneth Crump
Damjan Adamic Damjan Adamic
@ -80,7 +89,6 @@ Christian Schulz
Gregory J Shepherd Gregory J Shepherd
Michael Shellim Michael Shellim
Ming Wang Ming Wang
R. Scott Page
Bernard Lukaschek Bernard Lukaschek
Nigel Chippindale Nigel Chippindale
Mike Perkins Mike Perkins
@ -93,7 +101,6 @@ Heinrich Illig
Michael Collins Michael Collins
Michael Manning Michael Manning
Craig Lorentz Craig Lorentz
Jonathan Modellismo - jonathan.it
André Lasseret André Lasseret
Felipe Alexandre de Oliveira Felipe Alexandre de Oliveira
Brian Harris Brian Harris
@ -121,7 +128,6 @@ Christophe Rodriguez
Larisa Filocamo Larisa Filocamo
Hartmut Sahm Hartmut Sahm
Åke Brodin Åke Brodin
Aloft Hobbies - www.alofthobbies.com
Ted Moss Ted Moss
Filippos Tigarakis Filippos Tigarakis
Chewytm Chewytm
@ -169,15 +175,12 @@ Willie Swanepoel
Satoru Sasaki Satoru Sasaki
Tyler Darby Tyler Darby
Nicholas Crego Nicholas Crego
Keith Hertzog
Johan Moelich Johan Moelich
Timo Esser Timo Esser
Dean Church (monthly)
Brian Paddock Brian Paddock
Jean Pierre Parisy Jean Pierre Parisy
Norbert Martsch Norbert Martsch
Jean-Marie Guitard Jean-Marie Guitard
Mike Perkins
Tilman Baumann Tilman Baumann
Fred Larssen Fred Larssen
Ari Aalto Ari Aalto
@ -199,7 +202,6 @@ Blake Spilman
Timothy Pelletier Timothy Pelletier
Glen Roe (ShowMaster) Glen Roe (ShowMaster)
Jan Van Ooteghem Jan Van Ooteghem
David Ankers - Special thanks here to the OpenPilot project!
Lawrence Christensen Lawrence Christensen
Leo Duflou Leo Duflou
Bruce Wood Bruce Wood
@ -253,7 +255,6 @@ Terry McKinley
Марков Алексей Марков Алексей
Offer Shmuely Offer Shmuely
Ian Lobley Ian Lobley
Keith Hertzog
Stéphane Fortas Stéphane Fortas
Peter Mitrik Peter Mitrik
Thomas Majewski Thomas Majewski
@ -272,7 +273,6 @@ Miguel Villalpando
Kim Dong Hoon Kim Dong Hoon
Terry McKinley Terry McKinley
Walter Bell Walter Bell
wsTech - http://wstech.de
Clinton Linck Clinton Linck
Josep Clodas Sola Josep Clodas Sola
Thierry Martin Thierry Martin
@ -306,7 +306,6 @@ Henry Deucker
Christian Fuchs Christian Fuchs
Arold Reinders Arold Reinders
Robert Miller Robert Miller
Aviomotive - www.aviomotive.com
Mark Gaskievicz Mark Gaskievicz
Roland Müller Roland Müller
Frank Gewalt Frank Gewalt
@ -320,7 +319,6 @@ Steve Coley
Sean Cull Sean Cull
Roberto Orsello Roberto Orsello
David Finger David Finger
FrSky - www.frsky-rc.com (monthly)
Jean-Marie Oddo Jean-Marie Oddo
Mike Matheny Mike Matheny
Glen Roe (Showmaster) Glen Roe (Showmaster)
@ -347,7 +345,6 @@ Sven Assmus
Markus Eberl Markus Eberl
Nicholas Field Nicholas Field
Harald Wilczak Harald Wilczak
Michel Baily
John Grepps John Grepps
Anthony Burbidge Anthony Burbidge
Sherba Baine Sherba Baine
@ -359,7 +356,6 @@ Aaron Stringer
Alan J Wasserman Alan J Wasserman
Wolfgang Rauser Wolfgang Rauser
Samuel Cook Samuel Cook
BoltRC - www.boltrc.com
Friedrich Ipolt Friedrich Ipolt
Barrington Cole Barrington Cole
Charles Lakins Charles Lakins
@ -426,14 +422,11 @@ Markus Wolf
Andrew Fazio Andrew Fazio
Stefan Künst Stefan Künst
Stephen Adams Stephen Adams
Arold Reinders
Tauno Rautakorpi Tauno Rautakorpi
Frank Houvenaghel Frank Houvenaghel
Aerial Tech Hobbies - www.aerialtechhobbies.com
George Neusse George Neusse
Andreja Rusjakovski Andreja Rusjakovski
Axel Stöckle Axel Stöckle
Mike Perkins
Erwin Störrle Erwin Störrle
Rodger Hopper Rodger Hopper
Fernando Cesar Fernando Cesar
@ -489,7 +482,6 @@ Robert Ferguson
CY Enterprise CY Enterprise
Michel Stathakis Neto Michel Stathakis Neto
Beat Zurflueh Beat Zurflueh
Heinrich Illig
Portstate Pty Ltd Portstate Pty Ltd
Jens Hoffmann Jens Hoffmann
Ricardo Santos Ricardo Santos
@ -504,7 +496,6 @@ Cecil Porter
Robert Canavan Robert Canavan
Greg Higginbottom Greg Higginbottom
Tim Walker Tim Walker
Thos. O'Meara Photography
Spis Ltd/TurboNote Spis Ltd/TurboNote
Patricia Cox Patricia Cox
Matthew Lukes Matthew Lukes
@ -619,7 +610,6 @@ Manuel McLure
Fernando Rimoldi Fernando Rimoldi
Hiltenkamp Stephan Hiltenkamp Stephan
Sandeep Kishore Jain Sandeep Kishore Jain
Sebastien Charpentier
Greg Parker Greg Parker
Norman Maaß Norman Maaß
Adriano Del Ben Adriano Del Ben
@ -649,7 +639,6 @@ Pasi Pitkänen
Lexington S Morley Lexington S Morley
Jeff Roberson Jeff Roberson
Volkov Victor Volkov Victor
Mike Perkins
Bryan Anderson Bryan Anderson
Daniel Garber Daniel Garber
Pavel Stein Pavel Stein
@ -674,7 +663,8 @@ RK Custom Homes
James Houck James Houck
Piet Teekens Piet Teekens
Tommy Widenflycht Tommy Widenflycht
Johan Petrus Theophilus Maria van Melis Johan Petrus Theophilus
Maria van Melis
Ralph Gustafson Ralph Gustafson
Paul Luby Paul Luby
Andrew Duncan Andrew Duncan
@ -683,7 +673,6 @@ Edward Glover
Kelly Byrd Kelly Byrd
Brad Curtis Brad Curtis
Wolfgang Kuhl Wolfgang Kuhl
LitePilots - litepilots.com
John Beidl John Beidl
Roy Nixon Roy Nixon
Glen Roe Glen Roe
@ -751,7 +740,7 @@ F.Javier Martinez Velasco
Claudio Piccinini Claudio Piccinini
John Jackson John Jackson
John Beech John Beech
Rene Traa Rene TraaJohn Jackson
Sebastien Charpentier (monthly) Sebastien Charpentier (monthly)
Nigel Hendriks Nigel Hendriks
Frédéric Devillard Frédéric Devillard
@ -766,7 +755,6 @@ Richard Shagam
Stephen Bailey Stephen Bailey
DK-System DK-System
Casa Kuxtal Casa Kuxtal
Alain Labonne
Christopher Potts Christopher Potts
Douglas George Douglas George
Michael Banks Michael Banks

View file

@ -144,6 +144,8 @@ set(companion_SRCS
burnconfigdialog.cpp burnconfigdialog.cpp
comparedialog.cpp comparedialog.cpp
contributorsdialog.cpp contributorsdialog.cpp
releasenotesdialog.cpp
releasenotesfirmwaredialog.cpp
customizesplashdialog.cpp customizesplashdialog.cpp
radiointerface.cpp radiointerface.cpp
progresswidget.cpp progresswidget.cpp
@ -174,6 +176,8 @@ set(companion_MOC_HDRS
fusesdialog.h fusesdialog.h
logsdialog.h logsdialog.h
contributorsdialog.h contributorsdialog.h
releasenotesdialog.h
releasenotesfirmwaredialog.h
customizesplashdialog.h customizesplashdialog.h
splashlibrary.h splashlibrary.h
splashlabel.h splashlabel.h
@ -203,7 +207,7 @@ set(companion_UIS
burnconfigdialog.ui burnconfigdialog.ui
downloaddialog.ui downloaddialog.ui
printdialog.ui printdialog.ui
contributorsdialog.ui htmldialog.ui
customizesplashdialog.ui customizesplashdialog.ui
splashlibrary.ui splashlibrary.ui
progresswidget.ui progresswidget.ui

View file

@ -1,134 +1,108 @@
#include "contributorsdialog.h" #include "contributorsdialog.h"
#include "ui_contributorsdialog.h" #include "ui_htmldialog.h"
#include <QtGui>
#include "helpers.h" #include "helpers.h"
contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) : ContributorsDialog::ContributorsDialog(QWidget * parent):
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::contributorsDialog) ui(new Ui::HtmlDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
switch (contest) {
case 0:
{
this->setWindowIcon(CompanionIcon("contributors.png"));
QFile file(":/DONATIONS.txt");
QString str;
str.append("<html><head>");
str.append("<style type=\"text/css\">\n");
str.append(".mycss\n{\nfont-weight:normal;\ncolor:#000000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
str.append(".mycssb\n{\nfont-weight:bold;\ncolor:#C00000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
str.append(".myhead\n{\nfont-weight:bold;\ncolor:#000000;font-size:14px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
str.append("</style>\n</head><body class=\"mycss\"><table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
str.append("<tr><td class=\"myhead\">"+tr("People who have contributed to this project")+"</td></tr>");
str.append("</table>");
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
int columns=6;
float cwidth=100.0/columns;
while (!file.atEnd()) {
str.append("<tr>");
for (int i=0; i<columns; i++) {
str.append(QString("<td width=\"%1%\" ").arg(cwidth));
if (!file.atEnd()) {
QByteArray line = file.readLine();
if (line.contains("monthly") || line.contains("mensual")) {
str.append("class=\"mycssb\">");
} else {
str.append("class=\"mycss\">");
}
str.append(line.trimmed()+"</td>");
} else {
str.append("class=\"mycss\">&nbsp;</td>");
}
}
str.append("</tr>");
}
}
str.append("</table>");
QFile file2(":/CREDITS.txt");
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
str.append("<tr><td class=\"mycss\">&nbsp;</td></tr>");
str.append("<tr><td class=\"myhead\">"+tr("Coders")+"</td></tr>");
str.append("</table>");
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
while (!file2.atEnd()) {
str.append("<tr>");
for (int i=0; i<3; i++) {
str.append("<td width=\"33.33%\" class=\"mycss\">");
if (!file2.atEnd()) {
QByteArray line = file2.readLine();
str.append(line.trimmed());
} else {
str.append("&nbsp;");
}
str.append("</td>");
}
str.append("</tr>");
}
}
str.append("<tr><td class=\"mycss\">&nbsp;</td></tr>");
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>");
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Thank you all !!!") + "</td></tr>");
str.append("</table>");
str.append("</body></html>");
ui->textEditor->setHtml(str);
ui->textEditor->scroll(0, 0);
setWindowTitle(tr("Contributors"));
break;
}
case 1:
{
this->setWindowIcon(CompanionIcon("changelog.png"));
QFile file(":/releasenotes.txt");
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
ui->textEditor->setHtml(file.readAll());
ui->textEditor->setOpenExternalLinks(true);
}
ui->textEditor->scroll(0,0);
setWindowTitle(tr("Companion Release Notes"));
break;
}
case 2: setWindowTitle(tr("OpenTX Contributors"));
{ setWindowIcon(CompanionIcon("contributors.png"));
if (!rnurl.isEmpty()) {
this->setWindowIcon(CompanionIcon("changelog.png")); QString str = "<html>" \
this->setWindowTitle(tr("OpenTX Release Notes")); "<head>" \
manager = new QNetworkAccessManager(this); " <style type=\"text/css\">" \
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*))); " .normal { font-weight:normal;color:#000000;vertical-align:top;font-size:10px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
QUrl url(rnurl); " .bold { font-weight:bold;color:#C00000;vertical-align:top;font-size:10px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
QNetworkRequest request(url); " .title { font-weight:bold;color:#000000;font-size:14px;text-align:left;font-family:arial,helvetica,sans-serif; }" \
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); " </style>" \
manager->get(request); "</head>"
} "<body class=\"normal\">";
else {
QTimer::singleShot(0, this, SLOT(forceClose())); QFile credits(":/CREDITS.txt");
} if (credits.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
if (line.trimmed() == "")
break; break;
} names.append(line.trimmed());
} }
str.append(formatTable(tr("Main Developers"), names, 3));
names.clear();
while (!credits.atEnd()) {
QByteArray line = credits.readLine();
names.append(line.trimmed());
}
str.append(formatTable(tr("Other contributors"), names, 3));
}
QFile donations(":/DONATIONS.txt");
if (donations.open(QIODevice::ReadOnly | QIODevice::Text)) {
QStringList names;
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
if (line.trimmed() == "")
break;
names.append(line.trimmed());
}
str.append(formatTable(tr("Companies and projects who have donated to OpenTX"), names, 3));
names.clear();
while (!donations.atEnd()) {
QByteArray line = donations.readLine();
names.append(line);
}
str.append(formatTable(tr("People who have donated to OpenTX"), names, 6));
}
str.append(" <tr><td class=\"normal\">&nbsp;</td></tr>" \
" <tr><td colspan=3 class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
" <tr><td colspan=3 class=\"normal\">" + tr("Thank you all !!!") + "</td></tr>" \
"</table>");
str.append("</body></html>");
ui->textEditor->setHtml(str);
ui->textEditor->scroll(0, 0);
ui->textEditor->setOpenExternalLinks(true);
} }
void contributorsDialog::showEvent ( QShowEvent * ) ContributorsDialog::~ContributorsDialog()
{ {
ui->textEditor->scroll(0, 0); delete ui;
} }
contributorsDialog::~contributorsDialog() QString ContributorsDialog::formatTable(const QString & title, const QStringList & names, int columns)
{ {
delete ui; const float cwidth = 100.0 / columns;
} QString str = "<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>" \
" <tr><td class=\"normal\">&nbsp;</td></tr>" \
" <tr><td class=\"title\">" + title + "</td></tr>" \
"</table>";
void contributorsDialog::replyFinished(QNetworkReply * reply) str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
{
ui->textEditor->setHtml(reply->readAll());
ui->textEditor->setOpenExternalLinks(true);
}
void contributorsDialog::forceClose() int column = 0;
{ foreach(QString name, names) {
accept();; if (column == 0) {
str.append("<tr>");
}
QString trclass = name.contains("monthly") ? "bold" : "normal";
str.append(QString("<td width=\"%1%\" class=\"%2\">%3</td>").arg(cwidth).arg(trclass).arg(name.trimmed().replace("monthly", tr("monthly"))));
if (++column == columns) {
str.append("</tr>");
column = 0;
}
}
if (column != 0) {
str.append("</tr>");
}
str.append("</table>");
return str;
} }

View file

@ -2,30 +2,22 @@
#define CONTRIBUTORSDIALOG_H #define CONTRIBUTORSDIALOG_H
#include <QDialog> #include <QDialog>
#include "eeprominterface.h"
#include "downloaddialog.h"
namespace Ui { namespace Ui {
class contributorsDialog; class HtmlDialog;
} }
class contributorsDialog : public QDialog class ContributorsDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public:
explicit contributorsDialog(QWidget *parent = 0, int contest = 0, QString rnurl = QString() );
~contributorsDialog();
private: public:
Ui::contributorsDialog *ui; explicit ContributorsDialog(QWidget * parent = 0);
QNetworkAccessManager *manager; ~ContributorsDialog();
void showEvent ( QShowEvent * ); private:
Ui::HtmlDialog * ui;
private slots: QString formatTable(const QString & title, const QStringList & names, int colums);
void forceClose();
void replyFinished(QNetworkReply * reply);
}; };
#endif // CONTRIBUTORSDIALOG_H #endif // CONTRIBUTORSDIALOG_H

View file

@ -1094,6 +1094,17 @@ void addOpenTxCommonOptions(OpenTxFirmware * firmware)
firmware->addOptions(fai_options); firmware->addOptions(fai_options);
} }
void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
{
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
firmware->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
firmware->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
firmware->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack"));
}
void addOpenTxLcdOptions(OpenTxFirmware * firmware) void addOpenTxLcdOptions(OpenTxFirmware * firmware)
{ {
Option lcd_options[] = { Option lcd_options[] = {
@ -1338,35 +1349,20 @@ void registerOpenTxFirmwares()
/* Taranis board */ /* Taranis board */
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS); openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("haptic", QObject::tr("Haptic module installed")); openTx->addOption("haptic", QObject::tr("Haptic module installed"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts")); addOpenTxTaranisOptions(openTx);
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
openTx->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
addOpenTxCommonOptions(openTx); addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx); firmwares.push_back(openTx);
/* Taranis Plus board */ /* Taranis Plus board */
openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS); openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support")); addOpenTxTaranisOptions(openTx);
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
openTx->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
addOpenTxCommonOptions(openTx); addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx); firmwares.push_back(openTx);
/* Taranis X9E board */ /* Taranis X9E board */
openTx = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("OpenTX for FrSky Taranis X9E"), BOARD_TARANIS_X9E); openTx = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("OpenTX for FrSky Taranis X9E"), BOARD_TARANIS_X9E);
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support")); addOpenTxTaranisOptions(openTx);
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
openTx->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
addOpenTxCommonOptions(openTx); addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx); firmwares.push_back(openTx);

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>contributorsDialog</class> <class>HtmlDialog</class>
<widget class="QDialog" name="contributorsDialog"> <widget class="QDialog" name="HtmlDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View file

@ -56,6 +56,8 @@
#include "printdialog.h" #include "printdialog.h"
#include "version.h" #include "version.h"
#include "contributorsdialog.h" #include "contributorsdialog.h"
#include "releasenotesdialog.h"
#include "releasenotesfirmwaredialog.h"
#include "customizesplashdialog.h" #include "customizesplashdialog.h"
#include "flasheepromdialog.h" #include "flasheepromdialog.h"
#include "flashfirmwaredialog.h" #include "flashfirmwaredialog.h"
@ -422,8 +424,8 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
msgBox.resize(0, 0); msgBox.resize(0, 0);
msgBox.exec(); msgBox.exec();
if (msgBox.clickedButton() == rnButton) { if (msgBox.clickedButton() == rnButton) {
contributorsDialog *cd = new contributorsDialog(this,2,rn); ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
cd->exec(); dialog->exec();
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(versionString), QMessageBox::Yes | QMessageBox::No); int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(versionString), QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) if (ret2 == QMessageBox::Yes)
download = true; download = true;
@ -451,7 +453,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
msgBox.resize(0,0); msgBox.resize(0,0);
msgBox.exec(); msgBox.exec();
if( msgBox.clickedButton() == rnButton ) { if( msgBox.clickedButton() == rnButton ) {
contributorsDialog *cd = new contributorsDialog(this, 2, rn); ContributorsDialog *cd = new ContributorsDialog(this); // , 2, rn);
cd->exec(); cd->exec();
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(versionString), int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(versionString),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
@ -666,8 +668,8 @@ void MainWindow::fwPrefs()
void MainWindow::contributors() void MainWindow::contributors()
{ {
contributorsDialog *cd = new contributorsDialog(this,0); ContributorsDialog * dialog = new ContributorsDialog(this);
cd->exec(); dialog->exec();
} }
void MainWindow::sdsync() void MainWindow::sdsync()
@ -686,8 +688,8 @@ void MainWindow::sdsync()
void MainWindow::changelog() void MainWindow::changelog()
{ {
contributorsDialog *cd = new contributorsDialog(this,1); ReleaseNotesDialog * dialog = new ReleaseNotesDialog(this);
cd->exec(); dialog->exec();
} }
void MainWindow::fwchangelog() void MainWindow::fwchangelog()
@ -698,8 +700,8 @@ void MainWindow::fwchangelog()
QMessageBox::information(this, tr("Firmware updates"), tr("Current firmware does not provide release notes informations.")); QMessageBox::information(this, tr("Firmware updates"), tr("Current firmware does not provide release notes informations."));
} }
else { else {
contributorsDialog *cd = new contributorsDialog(this,2, rn); ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
cd->exec(); dialog->exec();
} }
} }

View file

@ -0,0 +1,25 @@
#include "releasenotesdialog.h"
#include "ui_htmldialog.h"
ReleaseNotesDialog::ReleaseNotesDialog(QWidget * parent) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::HtmlDialog)
{
ui->setupUi(this);
setWindowTitle(tr("Companion Release Notes"));
setWindowIcon(CompanionIcon("changelog.png"));
QFile file(":/releasenotes.txt");
if (file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
ui->textEditor->setHtml(file.readAll());
ui->textEditor->setOpenExternalLinks(true);
}
ui->textEditor->scroll(0, 0);
ui->textEditor->setOpenExternalLinks(true);
}
ReleaseNotesDialog::~ReleaseNotesDialog()
{
delete ui;
}

View file

@ -0,0 +1,23 @@
#ifndef RELEASENOTESDIALOG_H
#define RELEASENOTESDIALOG_H
#include <QDialog>
#include "helpers.h"
namespace Ui {
class HtmlDialog;
}
class ReleaseNotesDialog : public QDialog
{
Q_OBJECT
public:
explicit ReleaseNotesDialog(QWidget *parent = 0);
~ReleaseNotesDialog();
private:
Ui::HtmlDialog * ui;
};
#endif // RELEASENOTESDIALOG_H

View file

@ -0,0 +1,32 @@
#include "releasenotesfirmwaredialog.h"
#include "ui_htmldialog.h"
#include "helpers.h"
ReleaseNotesFirmwareDialog::ReleaseNotesFirmwareDialog(QWidget * parent, const QString & rnurl):
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
ui(new Ui::HtmlDialog)
{
ui->setupUi(this);
setWindowTitle(tr("OpenTX Release Notes"));
setWindowIcon(CompanionIcon("changelog.png"));
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(replyFinished(QNetworkReply *)));
QUrl url(rnurl);
QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
manager->get(request);
}
ReleaseNotesFirmwareDialog::~ReleaseNotesFirmwareDialog()
{
delete ui;
}
void ReleaseNotesFirmwareDialog::replyFinished(QNetworkReply * reply)
{
ui->textEditor->setHtml(reply->readAll());
ui->textEditor->setOpenExternalLinks(true);
}

View file

@ -0,0 +1,29 @@
#ifndef RELEASENOTESFIRMWAREDIALOG_H
#define RELEASENOTESFIRMWAREDIALOG_H
#include <QDialog>
#include "eeprominterface.h"
#include "downloaddialog.h"
namespace Ui {
class HtmlDialog;
}
class ReleaseNotesFirmwareDialog : public QDialog
{
Q_OBJECT
public:
explicit ReleaseNotesFirmwareDialog(QWidget *parent, const QString & rnurl);
~ReleaseNotesFirmwareDialog();
private:
Ui::HtmlDialog *ui;
QNetworkAccessManager *manager;
private slots:
void replyFinished(QNetworkReply * reply);
};
#endif // RELEASENOTESFIRMWAREDIALOG_H

File diff suppressed because it is too large Load diff