From 817dea8f1e7e6fc13ec3b9ffeb739b3c458a8d0f Mon Sep 17 00:00:00 2001 From: Dvogonen Date: Sat, 11 Jan 2014 00:54:45 +0100 Subject: [PATCH 1/7] Fetch donors and coders from files. Improved dialog appearance. --- companion/src/contributorsdialog.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index d60a682db..4372eb730 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -1,7 +1,6 @@ #include "contributorsdialog.h" #include "ui_contributorsdialog.h" #include -#define CLINESEP "=====================================================\n" contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), @@ -10,22 +9,27 @@ 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"); + ui->textBrowser->insertHtml(tr("

People who have contributed to this project

")); + ui->textBrowser->insertPlainText("\n"); + QFile file(":/DONATIONS.txt"); if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - ui->textBrowser->insertPlainText(file.readAll()); + QString color = "black"; + while (!file.atEnd()) { + QByteArray line = file.readLine(); + ui->textBrowser->insertHtml(QString("") + line + QString(",  ")); + if (color == "black") + color = "#505050"; + else + color = "black"; + } } ui->textBrowser->insertPlainText("\n"); - ui->textBrowser->insertPlainText(CLINESEP); - ui->textBrowser->insertPlainText(tr("Coders")+"\n"); - ui->textBrowser->insertPlainText(CLINESEP); - QFile file2(":/coders"); + ui->textBrowser->insertHtml(tr("

Coders

")); + QFile file2(":/CREDITS.txt"); if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) { ui->textBrowser->insertPlainText(file2.readAll()); } - ui->textBrowser->insertPlainText("\n\n\n"); + ui->textBrowser->insertPlainText("\n\n"); ui->textBrowser->insertPlainText(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.")); ui->textBrowser->insertPlainText("\n\n"); ui->textBrowser->insertPlainText(tr("Thank you all !!!")); From f7e1c6cb8b5c22167faed710111c1f9c18ad34c5 Mon Sep 17 00:00:00 2001 From: Dvogonen Date: Sat, 11 Jan 2014 22:33:01 +0100 Subject: [PATCH 2/7] Now formatted in 6 columns. Looks rather nice. Stripped http:// tags in donors text file to improve automatic formatting. --- DONATIONS.txt | 6 ++--- companion/src/contributorsdialog.cpp | 38 ++++++++++++++++++---------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/DONATIONS.txt b/DONATIONS.txt index d1ea683e8..7076054ce 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -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 diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index 4372eb730..d49925caf 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -9,26 +9,38 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu ui->setupUi(this); switch (contest) { case 0: { - ui->textBrowser->insertHtml(tr("

People who have contributed to this project

")); - ui->textBrowser->insertPlainText("\n"); QFile file(":/DONATIONS.txt"); + QString htmlString = ""; + htmlString += ""; if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - QString color = "black"; + int i = 0; while (!file.atEnd()) { - QByteArray line = file.readLine(); - ui->textBrowser->insertHtml(QString("") + line + QString(",  ")); - if (color == "black") - color = "#505050"; - else - color = "black"; - } + QByteArray line = file.readLine(); + htmlString += QString(""); + i++; + if (!(i%6)){ + htmlString += ""; + } + } + htmlString += ""; } - ui->textBrowser->insertPlainText("\n"); - ui->textBrowser->insertHtml(tr("

Coders

")); + + htmlString += ""; QFile file2(":/CREDITS.txt"); if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - ui->textBrowser->insertPlainText(file2.readAll()); + int i = 0; + while (!file2.atEnd()) { + QByteArray line = file2.readLine(); + htmlString += QString(""); + i++; + if (!(i%6)){ + htmlString += ""; + } + } } + htmlString += "

People who have contributed to this project

") + line + QString("

Coders

") + line + QString("
"; + ui->textBrowser->insertHtml(htmlString); + ui->textBrowser->insertPlainText("\n\n"); ui->textBrowser->insertPlainText(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.")); ui->textBrowser->insertPlainText("\n\n"); From 00779bc33afff1aef556dd216c1cc273882dca21 Mon Sep 17 00:00:00 2001 From: Dvogonen Date: Sun, 12 Jan 2014 01:16:37 +0100 Subject: [PATCH 3/7] Settled on 5 rows. Fixed minor bug that prevented the changelog of companion from diaplying. --- companion/src/contributorsdialog.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index d49925caf..f72685a76 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -11,21 +11,21 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu case 0: { QFile file(":/DONATIONS.txt"); QString htmlString = ""; - htmlString += ""; + htmlString += ""; if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { int i = 0; while (!file.atEnd()) { QByteArray line = file.readLine(); htmlString += QString(""); i++; - if (!(i%6)){ + if (!(i%5)){ htmlString += ""; } } htmlString += ""; } - htmlString += ""; + htmlString += ""; QFile file2(":/CREDITS.txt"); if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) { int i = 0; @@ -33,7 +33,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu QByteArray line = file2.readLine(); htmlString += QString(""); i++; - if (!(i%6)){ + if (!(i%5)){ htmlString += ""; } } @@ -52,7 +52,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu break; case 1:{ - QFile file(":/releasenotes"); + QFile file(":/releasenotes.txt"); if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { ui->textBrowser->insertHtml(file.readAll()); } From a025d325dd63dc789006adc071d0eaf44c5b9f47 Mon Sep 17 00:00:00 2001 From: Romolo Manfredini Date: Sun, 12 Jan 2014 10:14:55 +0100 Subject: [PATCH 4/7] Contributor dialog fixed --- companion/src/CMakeLists.txt | 3 +- companion/src/contributorsdialog.cpp | 95 +++++++++++++++++----------- companion/src/contributorsdialog.ui | 15 ++++- 3 files changed, 75 insertions(+), 38 deletions(-) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 318a65524..593443103 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -1,7 +1,7 @@ PROJECT( companion9x ) 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 ) @@ -39,6 +39,7 @@ ENDIF() FIND_PACKAGE( Qt4 REQUIRED ) SET( QT_USE_QTNETWORK True ) SET( QT_USE_QTXML True ) +SET( QT_USE_QTWEBKIT True ) INCLUDE( ${QT_USE_FILE} ) IF ( APPLE ) diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index f72685a76..a555c294a 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -10,54 +10,77 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu switch (contest) { case 0: { QFile file(":/DONATIONS.txt"); - QString htmlString = "

People who have contributed to this project

People who have contributed to this project

") + line + QString("

Coders

Coders

") + line + QString("
"; - htmlString += ""; + QString str; + str.append(""); + str.append("\n

People who have contributed to this project

"); + str.append(""); + str.append("
"+tr("People who have contributed to this project")+"
"); + str.append(""); if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - int i = 0; - while (!file.atEnd()) { - QByteArray line = file.readLine(); - htmlString += QString(""); - i++; - if (!(i%5)){ - htmlString += ""; - } + int columns=6; + float cwidth=100.0/columns; + while (!file.atEnd()) { + str.append(""); + for (int i=0; i"); + } else { + str.append("class=\"mycss\">"); + } + str.append(line.trimmed()+""); + } else { + str.append("class=\"mycss\"> "); } - htmlString += ""; + } + str.append(""); + } } - - htmlString += ""; + str.append("
") + line + QString("

Coders

"); QFile file2(":/CREDITS.txt"); + str.append(""); + str.append(""); + str.append("
"+tr("Coders")+"
"); + str.append(""); if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - int i = 0; - while (!file2.atEnd()) { - QByteArray line = file2.readLine(); - htmlString += QString(""); - i++; - if (!(i%5)){ - htmlString += ""; - } + while (!file2.atEnd()) { + str.append(""); + for (int i=0; i<3; i++) { + str.append(""); + } + str.append(""); + } + + str.append(""); + str.append(""); + str.append("
") + line + QString("
"); + if (!file2.atEnd()) { + QByteArray line = file2.readLine(); + str.append(line.trimmed()); + } else { + str.append(" "); } + str.append("
"+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.")+"
"+tr("Thank you all !!!")+"
"); + str.append(""); } - htmlString += ""; - ui->textBrowser->insertHtml(htmlString); - - ui->textBrowser->insertPlainText("\n\n"); - ui->textBrowser->insertPlainText(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.")); - ui->textBrowser->insertPlainText("\n\n"); - ui->textBrowser->insertPlainText(tr("Thank you all !!!")); - ui->textBrowser->setReadOnly(true); - ui->textBrowser->verticalScrollBar()->setValue(0); + ui->webBrowser->setHtml(str,QUrl("")); + ui->webBrowser->scroll(0,0); this->setWindowTitle(tr("Contributors")); } break; case 1:{ - QFile file(":/releasenotes.txt"); + QFile file(":/releasenotes"); if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - ui->textBrowser->insertHtml(file.readAll()); + ui->webBrowser->setHtml(file.readAll(),QUrl("")); } - ui->textBrowser->setReadOnly(true); - ui->textBrowser->verticalScrollBar()->setValue(0); + ui->webBrowser->scroll(0,0); this->setWindowTitle(tr("Companion9x Release Notes")); } break; @@ -80,7 +103,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu void contributorsDialog::showEvent ( QShowEvent * ) { - ui->textBrowser->verticalScrollBar()->setValue(0); + ui->webBrowser->scroll(0,0); } contributorsDialog::~contributorsDialog() @@ -90,7 +113,7 @@ contributorsDialog::~contributorsDialog() void contributorsDialog::replyFinished(QNetworkReply * reply) { - ui->textBrowser->insertHtml(reply->readAll()); + ui->webBrowser->setHtml(reply->readAll(),QUrl("")); } void contributorsDialog::forceClose() { diff --git a/companion/src/contributorsdialog.ui b/companion/src/contributorsdialog.ui index 1c09ba66d..28fc29060 100644 --- a/companion/src/contributorsdialog.ui +++ b/companion/src/contributorsdialog.ui @@ -19,10 +19,23 @@ - + + + + about:blank + + + + + + QWebView + QWidget +
QtWebKit/QWebView
+
+
From bcf072708d33f0bafc3c19e0ad1276fd405a85f9 Mon Sep 17 00:00:00 2001 From: Dvogonen Date: Sun, 12 Jan 2014 10:46:16 +0100 Subject: [PATCH 5/7] Corrected name of releae notes --- companion/src/contributorsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index a555c294a..f4317515c 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -76,7 +76,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu break; case 1:{ - QFile file(":/releasenotes"); + QFile file(":/releasenotes.txt"); if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { ui->webBrowser->setHtml(file.readAll(),QUrl("")); } From f2c5e428d964e6ba3fc9bcdfb4ce6b42ee7edfb7 Mon Sep 17 00:00:00 2001 From: Romolo Manfredini Date: Sun, 12 Jan 2014 10:49:37 +0100 Subject: [PATCH 6/7] more space between sections --- companion/src/contributorsdialog.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index a555c294a..a2f8a2ac7 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -45,6 +45,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu str.append(""); QFile file2(":/CREDITS.txt"); str.append(""); + str.append(""); str.append(""); str.append("
 
"+tr("Coders")+"
"); str.append(""); @@ -63,12 +64,12 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu } str.append(""); } - - str.append(""); - str.append(""); - str.append("
"+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.")+"
"+tr("Thank you all !!!")+"
"); - str.append(""); } + str.append(" "); + str.append(""+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.")+""); + str.append(""+tr("Thank you all !!!")+""); + str.append(""); + str.append(""); ui->webBrowser->setHtml(str,QUrl("")); ui->webBrowser->scroll(0,0); this->setWindowTitle(tr("Contributors")); From 0c0662711e7cd8443d3802edd022a7025468b73b Mon Sep 17 00:00:00 2001 From: Romolo Manfredini Date: Sun, 19 Jan 2014 08:10:28 +0100 Subject: [PATCH 7/7] Revert to old renderer --- companion/src/CMakeLists.txt | 1 - companion/src/contributorsdialog.cpp | 12 ++++++------ companion/src/contributorsdialog.ui | 19 +++---------------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 593443103..6769e9337 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -39,7 +39,6 @@ ENDIF() FIND_PACKAGE( Qt4 REQUIRED ) SET( QT_USE_QTNETWORK True ) SET( QT_USE_QTXML True ) -SET( QT_USE_QTWEBKIT True ) INCLUDE( ${QT_USE_FILE} ) IF ( APPLE ) diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index 5a1cb0e1e..598076771 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -70,8 +70,8 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu str.append(""+tr("Thank you all !!!")+""); str.append(""); str.append(""); - ui->webBrowser->setHtml(str,QUrl("")); - ui->webBrowser->scroll(0,0); + ui->textEditor->setHtml(str); + ui->textEditor->scroll(0,0); this->setWindowTitle(tr("Contributors")); } break; @@ -79,9 +79,9 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu case 1:{ QFile file(":/releasenotes.txt"); if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - ui->webBrowser->setHtml(file.readAll(),QUrl("")); + ui->textEditor->setHtml(file.readAll()); } - ui->webBrowser->scroll(0,0); + ui->textEditor->scroll(0,0); this->setWindowTitle(tr("Companion9x Release Notes")); } break; @@ -104,7 +104,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu void contributorsDialog::showEvent ( QShowEvent * ) { - ui->webBrowser->scroll(0,0); + ui->textEditor->scroll(0,0); } contributorsDialog::~contributorsDialog() @@ -114,7 +114,7 @@ contributorsDialog::~contributorsDialog() void contributorsDialog::replyFinished(QNetworkReply * reply) { - ui->webBrowser->setHtml(reply->readAll(),QUrl("")); + ui->textEditor->setHtml(reply->readAll()); } void contributorsDialog::forceClose() { diff --git a/companion/src/contributorsdialog.ui b/companion/src/contributorsdialog.ui index 28fc29060..f50e0fe0d 100644 --- a/companion/src/contributorsdialog.ui +++ b/companion/src/contributorsdialog.ui @@ -6,8 +6,8 @@ 0 0 - 926 - 333 + 788 + 528 @@ -19,23 +19,10 @@ - - - - about:blank - - - + - - - QWebView - QWidget -
QtWebKit/QWebView
-
-