Merge pull request #564 from opentx/romolo/fix_and_improve_contributors_dialog_506
Fixes #506
This commit is contained in:
+3
-3
@@ -95,8 +95,8 @@ Heinrich Illig
|
||||
Michael Collins
|
||||
Michael Manning
|
||||
Craig Lorentz
|
||||
Jonathan Modellismo - http://jonathan.it
|
||||
Aviomotive - http://www.aviomotive.com
|
||||
Jonathan Modellismo - jonathan.it
|
||||
Aviomotive - www.aviomotive.com
|
||||
André Lasseret
|
||||
Felipe Alexandre de Oliveira
|
||||
Brian Harris
|
||||
@@ -126,7 +126,7 @@ Larisa Filocamo
|
||||
Alex Calderhead
|
||||
Hartmut Sahm
|
||||
Åke Brodin
|
||||
Aloft Hobbies - http://www.alofthobbies.com
|
||||
Aloft Hobbies - www.alofthobbies.com
|
||||
Ted Moss
|
||||
Filippos Tigarakis
|
||||
Chewytm
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "1" )
|
||||
SET( C9X_VERSION_MINOR "51" )
|
||||
SET( C9X_VERSION_MINOR "52" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "contributorsdialog.h"
|
||||
#include "ui_contributorsdialog.h"
|
||||
#include <QtGui>
|
||||
#define CLINESEP "=====================================================\n"
|
||||
|
||||
contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
@@ -10,40 +9,80 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
|
||||
ui->setupUi(this);
|
||||
switch (contest) {
|
||||
case 0: {
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
ui->textBrowser->insertPlainText(tr("People who have contributed to this project")+"\n");
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
QFile file(":/contributors");
|
||||
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 ) ) {
|
||||
ui->textBrowser->insertPlainText(file.readAll());
|
||||
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\"> </td>");
|
||||
}
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
ui->textBrowser->insertPlainText("\n");
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
ui->textBrowser->insertPlainText(tr("Coders")+"\n");
|
||||
ui->textBrowser->insertPlainText(CLINESEP);
|
||||
QFile file2(":/coders");
|
||||
str.append("</table>");
|
||||
QFile file2(":/CREDITS.txt");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
str.append("<tr><td class=\"mycss\"> </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 ) ) {
|
||||
ui->textBrowser->insertPlainText(file2.readAll());
|
||||
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(" ");
|
||||
}
|
||||
str.append("</td>");
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
ui->textBrowser->insertPlainText("\n\n\n");
|
||||
ui->textBrowser->insertPlainText(tr(
|
||||
"Honors go to Rafal Tomczak (RadioClone) and Thomas Husterer (th9x) \nof course. Also to Erez Raviv (er9x) and the fantastic eePe program \nwhich was the staring point for OpenTX Companion."));
|
||||
ui->textBrowser->insertPlainText("\n\n");
|
||||
ui->textBrowser->insertPlainText(tr("Thank you all !!!"));
|
||||
ui->textBrowser->setReadOnly(true);
|
||||
ui->textBrowser->verticalScrollBar()->setValue(0);
|
||||
str.append("<tr><td class=\"mycss\"> </td></tr>");
|
||||
str.append("<tr><td colspan=3 class=\"mycss\">"+tr("Honors go to Rafal Tomczak (RadioClone) and Thomas Husterer (th9x) \nof course. Also to Erez Raviv (er9x) and it's fantastic eePe, from which\ncompanion9x was forked out.")+"</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);
|
||||
this->setWindowTitle(tr("Contributors"));
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:{
|
||||
QFile file(":/releasenotes");
|
||||
QFile file(":/releasenotes.txt");
|
||||
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
ui->textBrowser->insertHtml(file.readAll());
|
||||
ui->textEditor->setHtml(file.readAll());
|
||||
}
|
||||
ui->textBrowser->setReadOnly(true);
|
||||
ui->textBrowser->verticalScrollBar()->setValue(0);
|
||||
this->setWindowTitle(tr("Companion Release Notes"));
|
||||
ui->textEditor->scroll(0,0);
|
||||
this->setWindowTitle(tr("Companion9x Release Notes"));
|
||||
}
|
||||
break;
|
||||
case 2:{
|
||||
@@ -65,7 +104,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
|
||||
|
||||
void contributorsDialog::showEvent ( QShowEvent * )
|
||||
{
|
||||
ui->textBrowser->verticalScrollBar()->setValue(0);
|
||||
ui->textEditor->scroll(0,0);
|
||||
}
|
||||
|
||||
contributorsDialog::~contributorsDialog()
|
||||
@@ -75,7 +114,7 @@ contributorsDialog::~contributorsDialog()
|
||||
|
||||
void contributorsDialog::replyFinished(QNetworkReply * reply)
|
||||
{
|
||||
ui->textBrowser->insertHtml(reply->readAll());
|
||||
ui->textEditor->setHtml(reply->readAll());
|
||||
}
|
||||
|
||||
void contributorsDialog::forceClose() {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>926</width>
|
||||
<height>333</height>
|
||||
<width>788</width>
|
||||
<height>528</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -19,7 +19,7 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextBrowser" name="textBrowser"/>
|
||||
<widget class="QTextEdit" name="textEditor"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user