diff --git a/qucs/qucs/dialogs/aboutdialog.cpp b/qucs/qucs/dialogs/aboutdialog.cpp index ccc5705fc0..89fca643c9 100644 --- a/qucs/qucs/dialogs/aboutdialog.cpp +++ b/qucs/qucs/dialogs/aboutdialog.cpp @@ -25,6 +25,13 @@ * \brief Implementation of the About dialog */ +#include +#include +#include + +#include +#include + #ifdef HAVE_CONFIG_H # include #endif @@ -37,27 +44,81 @@ #include #include #include +#include + AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent) { + currAuths = {{ + tr("Guilherme Brondani Torri - GUI programmer, Verilog-A dynamic loader"), + tr("Mike Brinson - testing, modelling and documentation, tutorial contributor"), + tr("Richard Crozier - testing, modelling, Octave."), + tr("Bastien Roucaries - bondwire and rectangular waveguide model implementation"), + tr("Frans Schreuder - GUI programmer, release"), + tr("Clemens Novak - GUI programmer"), + tr("Vadim Kuznetsov - filter synthesis (qucs-activefilter), SPICE integration (NGSPICE, Xyce)"), + tr("You-Tang Lee (YodaLee) - GUI programmer, Qt4 porter") + }}; + + prevDevs = {{ + tr("Michael Margraf - founder of the project, GUI programmer"), + tr("Stefan Jahn - Programmer of simulator"), + tr("Jens Flucke - webpages and translator"), + tr("Raimund Jacob - tester and applyer of Stefan's patches, author of documentation"), + tr("Vincent Habchi - coplanar line and filter synthesis code, documentation contributor"), + tr("Toyoyuki Ishikawa - some filter synthesis code and attenuator synthesis"), + tr("Gopala Krishna A - GUI programmer, Qt4 porter"), + tr("Helene Parruitte - programmer of the Verilog-AMS interface"), + tr("Gunther Kraut - equation solver contributions, exponential sources, author of documentation"), + tr("Andrea Zonca - temperature model for rectangular waveguide") + }}; + + trAuths = {{ + tr("German by Stefan Jahn"), + tr("Polish by Dariusz Pienkowski"), + tr("Romanian by Radu Circa"), + tr("French by Vincent Habchi, F5RCS"), + tr("Portuguese by Luciano Franca, Helio de Sousa, Guilherme Brondani Torri"), + tr("Spanish by Jose L. Redrejo Rodriguez"), + tr("Japanese by Toyoyuki Ishikawa"), + tr("Italian by Giorgio Luparia and Claudio Girardi"), + tr("Hebrew by Dotan Nahum"), + tr("Swedish by Markus Gothe and Peter Landgren"), + tr("Turkish by Onur and Ozgur Cobanoglu"), + tr("Hungarian by Jozsef Bus"), + tr("Russian by Igor Gorbounov"), + tr("Czech by Marek Straka and Martin Stejskal"), + tr("Catalan by Antoni Subirats"), + tr("Ukrainian by Dystryk"), + tr("Arabic by Chabane Noureddine"), + tr("Kazakh by Erbol Keshubaev") + }}; + + + std::shuffle(currAuths.begin(), currAuths.end(), rng); + QLabel *lbl; setWindowTitle(tr("About Qucs")); all = new QVBoxLayout(this); + //all->setContentsMargins(0,0,0,0); + //all->setSpacing(0); QLabel *iconLabel = new QLabel(); iconLabel->setPixmap(QPixmap(QString(":/bitmaps/hicolor/128x128/apps/qucs.png"))); QWidget *hbox = new QWidget(); QHBoxLayout *hl = new QHBoxLayout(hbox); + hl->setContentsMargins(0,0,0,0); hl->addWidget(iconLabel); all->addWidget(hbox); - + QWidget *vbox = new QWidget(); QVBoxLayout *vl = new QVBoxLayout(vbox); + //vl->setContentsMargins(0,0,0,0); hl->addWidget(vbox); QString versionText; @@ -78,72 +139,19 @@ AboutDialog::AboutDialog(QWidget *parent) lbl = new QLabel("\nThis is free software; see the source for copying conditions." "\nThere is NO warranty; not even for MERCHANTABILITY or " - "\nFITNESS FOR A PARTICULAR PURPOSE.\n\n"); + "\nFITNESS FOR A PARTICULAR PURPOSE.\n"); lbl->setAlignment(Qt::AlignHCenter); all->addWidget(lbl); QTabWidget *t = new QTabWidget(); all->addWidget(t); + connect(t, SIGNAL(currentChanged(int)), this, SLOT(currentChangedSlot(int))); + + + authorsBrowser = new QTextBrowser; + trBrowser = new QTextBrowser; - QString authorsText; - authorsText = - tr("Current Qucs Team:") + - "
    " + - "
  • " + tr("Guilherme Brondani Torri - GUI programmer, Verilog-A dynamic loader") + "
  • " + - "
  • " + tr("Mike Brinson - testing, modelling and documentation, tutorial contributor") + "
  • " + - "
  • " + tr("Richard Crozier - testing, modelling, Octave.") + "
  • " + - "
  • " + tr("Bastien Roucaries - bondwire and rectangular waveguide model implementation") + "
  • " + - "
  • " + tr("Frans Schreuder - GUI programmer, release") + "
  • " + - "
  • " + tr("Clemens Novak - GUI programmer") + "
  • " + - "
  • " + tr("Vadim Kuznetsov - filter synthesis (qucs-activefilter), SPICE integration (NGSPICE, Xyce)") + "
  • " + - "
  • " + tr("You-Tang Lee (YodaLee) - GUI programmer, Qt4 porter") + "
  • " + - "
" + - tr("Previous Developers") + - "
    " + - "
  • " + tr("Michael Margraf - founder of the project, GUI programmer") + "
  • " + - "
  • " + tr("Stefan Jahn - Programmer of simulator") + "
  • " + - "
  • " + tr("Jens Flucke - webpages and translator") + "
  • " + - "
  • " + tr("Raimund Jacob - tester and applyer of Stefan's patches, author of documentation") + "
  • " + - "
  • " + tr("Vincent Habchi - coplanar line and filter synthesis code, documentation contributor") + "
  • " + - "
  • " + tr("Toyoyuki Ishikawa - some filter synthesis code and attenuator synthesis") + "
  • " + - "
  • " + tr("Gopala Krishna A - GUI programmer, Qt4 porter") + "
  • " + - "
  • " + tr("Helene Parruitte - programmer of the Verilog-AMS interface") + "
  • " + - "
  • " + tr("Gunther Kraut - equation solver contributions, exponential sources, author of documentation") + "
  • " + - "
  • " + tr("Andrea Zonca - temperature model for rectangular waveguide") + "
  • " + - "
"; - - QTextBrowser *authorsBrowser = new QTextBrowser; - - authorsBrowser->setHtml(authorsText); - - QString thanksText; - thanksText = "TBD"; - QString trText; - trText = tr("GUI translations :") + - "
    " + - "
  • " + tr("German by Stefan Jahn") + "
  • "+ - "
  • " + tr("Polish by Dariusz Pienkowski") + "
  • " + - "
  • " + tr("Romanian by Radu Circa") + "
  • " + - "
  • " + tr("French by Vincent Habchi, F5RCS") + "
  • " + - "
  • " + tr("Portuguese by Luciano Franca, Helio de Sousa, Guilherme Brondani Torri") + "
  • " + - "
  • " + tr("Spanish by Jose L. Redrejo Rodriguez") + "
  • " + - "
  • " + tr("Japanese by Toyoyuki Ishikawa") + "
  • " + - "
  • " + tr("Italian by Giorgio Luparia and Claudio Girardi") + "
  • " + - "
  • " + tr("Hebrew by Dotan Nahum") + "
  • " + - "
  • " + tr("Swedish by Markus Gothe and Peter Landgren") + "
  • " + - "
  • " + tr("Turkish by Onur and Ozgur Cobanoglu") + "
  • " + - "
  • " + tr("Hungarian by Jozsef Bus") + "
  • " + - "
  • " + tr("Russian by Igor Gorbounov") + "
  • " + - "
  • " + tr("Czech by Marek Straka and Martin Stejskal") + "
  • " + - "
  • " + tr("Catalan by Antoni Subirats") + "
  • " + - "
  • " + tr("Ukrainian by Dystryk") + "
  • " + - "
  • " + tr("Arabic by Chabane Noureddine") + "
  • " + - "
  • " + tr("Kazakh by Erbol Keshubaev") + "
  • " + - "
"; - - QTextBrowser *trBrowser = new QTextBrowser; - trBrowser->setHtml(trText); QString supportText; // link to home page, help mailing list, IRC ? @@ -170,6 +178,7 @@ AboutDialog::AboutDialog(QWidget *parent) QWidget *hbBtn = new QWidget(); QHBoxLayout *hlBtn = new QHBoxLayout(hbBtn); + hlBtn->setContentsMargins(0,0,0,0); all->addWidget(hbBtn); QPushButton *okButton = new QPushButton(tr("&OK"), parent); @@ -177,4 +186,51 @@ AboutDialog::AboutDialog(QWidget *parent) connect(okButton, SIGNAL(clicked()), this, SLOT(close())); hlBtn->addStretch(); hlBtn->addWidget(okButton); + + setAuthorsText(); + setTrText(); + prevTab = 0; // first Tab is selected by default +} + +void AboutDialog::currentChangedSlot(int index) { + if (prevTab == 0) { // deselected tab with current and previous authors + // shuffle them + std::shuffle(currAuths.begin(), currAuths.end(), rng); + std::shuffle(prevDevs.begin(), prevDevs.end(), rng); + setAuthorsText(); + } else if (prevTab == 1) {// deselected tab with translators + std::shuffle(trAuths.begin(), trAuths.end(), rng); + setTrText(); + } + + prevTab = index; +} + +void AboutDialog::setAuthorsText() { + + QString authorsText; + authorsText = tr("Current Qucs Team:") + "
    "; + + for(QString& tStr : currAuths) { + authorsText += ("
  • " + tStr + "
  • "); + } + authorsText += "
"; + authorsText += tr("Previous Developers") + "
    "; + for(QString& tStr : prevDevs) { + authorsText += ("
  • " + tStr + "
  • "); + } + authorsText += "
"; + + authorsBrowser->setHtml(authorsText); +} + +void AboutDialog::setTrText() { + QString trText; + trText = tr("GUI translations :") + "
    "; + for(QString& tStr : trAuths) { + trText += ("
  • " + tStr + "
  • "); + } + trText += "
"; + + trBrowser->setHtml(trText); } diff --git a/qucs/qucs/dialogs/aboutdialog.h b/qucs/qucs/dialogs/aboutdialog.h index c4e9cf6a8a..7e67cfaf26 100644 --- a/qucs/qucs/dialogs/aboutdialog.h +++ b/qucs/qucs/dialogs/aboutdialog.h @@ -23,15 +23,40 @@ #ifndef ABOUTDIALOG_H #define ABOUTDIALOG_H +#include +#include + #include #include +class QString; +class QTextBrowser; + class AboutDialog : public QDialog { Q_OBJECT + public: AboutDialog(QWidget *parent = 0); - private: + +private: + void setAuthorsText(void); + void setTrText(void); + + std::array currAuths; // current Qucs authors + std::array prevDevs; // previous Qucs developers + std::array trAuths; // Qucs translators + QVBoxLayout *all; + QTextBrowser *authorsBrowser; // to show authors + QTextBrowser *trBrowser; // to show translators + + int prevTab; // previously selected tab + + std::mt19937 rng {std::random_device{}()}; // random number generator + +public slots: + void currentChangedSlot(int index); // tab selection changed + }; #endif