From 0016cc12c048a5e74bdd0a4b54894f05006fe5b7 Mon Sep 17 00:00:00 2001 From: in3otd Date: Sun, 1 Feb 2015 22:20:16 +0100 Subject: [PATCH 1/4] Redesigned the Qucs About dialog. --- qucs/qucs/dialogs/CMakeLists.txt | 3 + qucs/qucs/dialogs/Makefile.am | 6 +- qucs/qucs/dialogs/aboutdialog.cpp | 180 ++++++++++++++++++++++++++++++ qucs/qucs/dialogs/aboutdialog.h | 37 ++++++ qucs/qucs/qucs.qrc | 1 + qucs/qucs/qucs_actions.cpp | 8 ++ qucs/qucs/qucs_init.cpp | 43 ------- 7 files changed, 232 insertions(+), 46 deletions(-) create mode 100644 qucs/qucs/dialogs/aboutdialog.cpp create mode 100644 qucs/qucs/dialogs/aboutdialog.h diff --git a/qucs/qucs/dialogs/CMakeLists.txt b/qucs/qucs/dialogs/CMakeLists.txt index dfbb2b2671..af9e56b361 100755 --- a/qucs/qucs/dialogs/CMakeLists.txt +++ b/qucs/qucs/dialogs/CMakeLists.txt @@ -7,6 +7,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} #INCLUDES = $(X11_INCLUDES) $(QT_INCLUDES) -I$(top_srcdir)/qucs SET(DIALOGS_HDRS +aboutdialog.h changedialog.h digisettingsdialog.h exportdialog.h @@ -35,9 +36,11 @@ importdialog.cpp savedialog.cpp labeldialog.cpp searchdialog.cpp librarydialog.cpp settingsdialog.cpp matchdialog.cpp simmessage.cpp newprojdialog.cpp sweepdialog.cpp exportdialog.cpp loaddialog.cpp +aboutdialog.cpp ) SET(DIALOGS_MOC_HDRS +aboutdialog.h changedialog.h digisettingsdialog.h exportdialog.h diff --git a/qucs/qucs/dialogs/Makefile.am b/qucs/qucs/dialogs/Makefile.am index d355845166..e6be37e3c4 100644 --- a/qucs/qucs/dialogs/Makefile.am +++ b/qucs/qucs/dialogs/Makefile.am @@ -28,7 +28,7 @@ MOCHEADERS = settingsdialog.h simmessage.h qucssettingsdialog.h \ labeldialog.h changedialog.h matchdialog.h digisettingsdialog.h \ sweepdialog.h searchdialog.h librarydialog.h importdialog.h \ packagedialog.h savedialog.h vasettingsdialog.h \ - exportdialog.h loaddialog.h newprojdialog.h + exportdialog.h loaddialog.h newprojdialog.h aboutdialog.h MOCFILES = $(MOCHEADERS:.h=.moc.cpp) @@ -40,8 +40,8 @@ libdialogs_a_SOURCES = settingsdialog.cpp newprojdialog.cpp \ simmessage.cpp qucssettingsdialog.cpp labeldialog.cpp changedialog.cpp \ matchdialog.cpp sweepdialog.cpp digisettingsdialog.cpp searchdialog.cpp \ librarydialog.cpp importdialog.cpp packagedialog.cpp \ - savedialog.cpp vasettingsdialog.cpp \ - exportdialog.cpp loaddialog.cpp + savedialog.cpp vasettingsdialog.cpp exportdialog.cpp loaddialog.cpp \ + aboutdialog.cpp nodist_libdialogs_a_SOURCES = $(MOCFILES) diff --git a/qucs/qucs/dialogs/aboutdialog.cpp b/qucs/qucs/dialogs/aboutdialog.cpp new file mode 100644 index 0000000000..ccc5705fc0 --- /dev/null +++ b/qucs/qucs/dialogs/aboutdialog.cpp @@ -0,0 +1,180 @@ +/* + * aboutdialog.cpp - customary about dialog showing various info + * + * Copyright (C) 2015, Qucs team (see AUTHORS file) + * + * This file is part of Qucs + * + * Qucs is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qucs. If not, see . + * + */ + +/*! + * \file aboutdialog.cpp + * \brief Implementation of the About dialog + */ + +#ifdef HAVE_CONFIG_H +# include +#endif +#include "aboutdialog.h" + +#include +#include +#include +#include +#include +#include +#include + +AboutDialog::AboutDialog(QWidget *parent) + : QDialog(parent) +{ + QLabel *lbl; + + setWindowTitle(tr("About Qucs")); + + all = new QVBoxLayout(this); + + QLabel *iconLabel = new QLabel(); + iconLabel->setPixmap(QPixmap(QString(":/bitmaps/hicolor/128x128/apps/qucs.png"))); + + QWidget *hbox = new QWidget(); + QHBoxLayout *hl = new QHBoxLayout(hbox); + + hl->addWidget(iconLabel); + all->addWidget(hbox); + + QWidget *vbox = new QWidget(); + QVBoxLayout *vl = new QVBoxLayout(vbox); + hl->addWidget(vbox); + + QString versionText; + versionText = tr("Version")+" "+PACKAGE_VERSION+ +#ifdef GIT + " ("+GIT+") " + +#endif + "\n"; + + vl->addWidget(new QLabel("Quite Universal Circuit Simulator")); + lbl = new QLabel(versionText); + lbl->setAlignment(Qt::AlignHCenter); + vl->addWidget(lbl); + vl->addWidget(new QLabel(tr("Copyright (C)")+" 2003-2009 "+ + tr("by Michael Margraf")+"\n"+ + tr("Copyright (C)")+" 2011-2015 "+ + tr("Qucs Team"))); + + 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"); + lbl->setAlignment(Qt::AlignHCenter); + all->addWidget(lbl); + + QTabWidget *t = new QTabWidget(); + all->addWidget(t); + + 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 ? + supportText = tr("Home Page") + " : http://qucs.sourceforge.net/
"+ + tr("Documentation start page") + " : http://qucs.sourceforge.net/docs.html
" + + tr("Components reference manual") + " : http://qucs.sourceforge.net/doc/0.0.19/html/index.html
" + + tr("Help mailing list") + " : " + tr("qucs-help on SourceForge") + ""; + + QTextBrowser *supportBrowser = new QTextBrowser; + supportBrowser->setOpenExternalLinks(true); + supportBrowser->setHtml(supportText); + + QString licenseText; + licenseText = "Qucs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This software is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details..

You should have received a copy of the GNU General Public License along with Qucs, see the file COPYING. If not see http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,Boston, MA 02110-1301, USA."; + + QTextBrowser *licenseBrowser = new QTextBrowser; + licenseBrowser->setOpenExternalLinks(true); + licenseBrowser->setHtml(licenseText); + + t->addTab(authorsBrowser, tr("Authors")); + t->addTab(trBrowser, tr("Translations")); + t->addTab(supportBrowser, tr("Support")); + t->addTab(licenseBrowser, tr("License")); + + QWidget *hbBtn = new QWidget(); + QHBoxLayout *hlBtn = new QHBoxLayout(hbBtn); + all->addWidget(hbBtn); + + QPushButton *okButton = new QPushButton(tr("&OK"), parent); + okButton->setFocus(); + connect(okButton, SIGNAL(clicked()), this, SLOT(close())); + hlBtn->addStretch(); + hlBtn->addWidget(okButton); +} diff --git a/qucs/qucs/dialogs/aboutdialog.h b/qucs/qucs/dialogs/aboutdialog.h new file mode 100644 index 0000000000..c4e9cf6a8a --- /dev/null +++ b/qucs/qucs/dialogs/aboutdialog.h @@ -0,0 +1,37 @@ +/* + * aboutdialog.h - customary about dialog showing various info + * + * Copyright (C) 2015, Qucs team (see AUTHORS file) + * + * This file is part of Qucs + * + * Qucs is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Qucs. If not, see . + * + */ + +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include +#include + +class AboutDialog : public QDialog { + Q_OBJECT +public: + AboutDialog(QWidget *parent = 0); + private: + QVBoxLayout *all; +}; + +#endif diff --git a/qucs/qucs/qucs.qrc b/qucs/qucs/qucs.qrc index 4838bdc895..33e2226cdd 100644 --- a/qucs/qucs/qucs.qrc +++ b/qucs/qucs/qucs.qrc @@ -235,5 +235,6 @@ bitmaps/tick.png bitmaps/error.png bitmaps/mutualx.png + bitmaps/hicolor/128x128/apps/qucs.png diff --git a/qucs/qucs/qucs_actions.cpp b/qucs/qucs/qucs_actions.cpp index 91cadc115c..31c228b3c5 100644 --- a/qucs/qucs/qucs_actions.cpp +++ b/qucs/qucs/qucs_actions.cpp @@ -55,6 +55,7 @@ #include "dialogs/loaddialog.h" #include "dialogs/importdialog.h" #include "dialogs/packagedialog.h" +#include "dialogs/aboutdialog.h" #include "module.h" // for editing component name on schematic @@ -1595,3 +1596,10 @@ void QucsApp::slotBuildModule() messageDock->msgDock->show(); } + +// ---------------------------------------------------------- +void QucsApp::slotHelpAbout() +{ + AboutDialog *ad = new AboutDialog(this); + ad->exec(); +} diff --git a/qucs/qucs/qucs_init.cpp b/qucs/qucs/qucs_init.cpp index 2f28da7caa..a68d1305ce 100644 --- a/qucs/qucs/qucs_init.cpp +++ b/qucs/qucs/qucs_init.cpp @@ -1054,46 +1054,3 @@ void QucsApp::slotToggleOctave(bool on) viewOctaveDock->blockSignals(false); } -// ---------------------------------------------------------- -void QucsApp::slotHelpAbout() -{ - QMessageBox::about(this, tr("About..."), - tr("Qucs Version")+" "+PACKAGE_VERSION+ -#ifdef GIT - " ("+GIT+") " + -#endif - "\n"+ - tr("Quite Universal Circuit Simulator")+"\n"+ - tr("Copyright (C)")+" 2003-2009 "+ - tr("by Michael Margraf")+"\n"+ - tr("Copyright (C)")+" 2011-2015 "+ - tr("Qucs Team")+"\n"+ - "\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"+ - tr("Simulator by Stefan Jahn")+"\n"+ - tr("VHDL simulator 'FreeHDL' by Edwin Naroska and Marius Vollmer")+"\n"+ - tr("Special thanks to Jens Flucke and Raimund Jacob")+"\n"+ - tr("Many thanks to Mike Brinson for correcting the VHDL output")+"\n"+ - tr("GUI improvements by Gopala Krishna A")+"\n"+ - tr("Verilog-AMS interface by Helene Parruitte")+"\n"+ - tr("Verilog-AMS dynamic loader by Guilherme Brondani Torri")+"\n\n"+ - tr("Translations:")+"\n"+ - tr("German by Stefan Jahn")+"\n"+ - tr("Polish by Dariusz Pienkowski")+"\n"+ - tr("Romanian by Radu Circa")+"\n"+ - tr("French by Vincent Habchi, F5RCS")+"\n"+ - tr("Portuguese by Luciano Franca, Helio de Sousa, Guilherme Brondani Torri")+"\n"+ - tr("Spanish by Jose L. Redrejo Rodriguez")+"\n"+ - tr("Japanese by Toyoyuki Ishikawa")+"\n"+ - tr("Italian by Giorgio Luparia and Claudio Girardi")+"\n"+ - tr("Hebrew by Dotan Nahum")+"\n"+ - tr("Swedish by Peter Landgren")+"\n"+ - tr("Turkish by Onur and Ozgur Cobanoglu")+"\n"+ - tr("Hungarian by Jozsef Bus")+"\n"+ - tr("Russian by Igor Gorbounov")+"\n"+ - tr("Czech by Marek Straka")+"\n"+ - tr("Catalan by Antoni Subirats")+"\n"+ - tr("Arabic by Chabane Noureddine")+"\n"+ - tr("Kazakh by Erbol Keshubaev")); -} From 7f19636daae138e5c8ccbb22477fa88003c68640 Mon Sep 17 00:00:00 2001 From: in3otd Date: Sun, 15 Feb 2015 19:22:34 +0100 Subject: [PATCH 2/4] Added shuffling of authors in About dialog. Every time the corresponding Tab is selected, the order of Authors or Translators will be randomly shuffled. --- qucs/qucs/dialogs/aboutdialog.cpp | 176 ++++++++++++++++++++---------- qucs/qucs/dialogs/aboutdialog.h | 27 ++++- 2 files changed, 142 insertions(+), 61 deletions(-) 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 From bcb3f658c0ef4112e75947e0a5fb1d3f187ab5e0 Mon Sep 17 00:00:00 2001 From: in3otd Date: Fri, 26 Jun 2015 22:35:33 +0200 Subject: [PATCH 3/4] Update Authors list and expand text in Support Tab Added in3otd to the Current Authors list. Some more links and explanations in the Support Tab (IRC, Resources page, etc.) --- qucs/qucs/dialogs/aboutdialog.cpp | 12 +++++++++--- qucs/qucs/dialogs/aboutdialog.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qucs/qucs/dialogs/aboutdialog.cpp b/qucs/qucs/dialogs/aboutdialog.cpp index 89fca643c9..9a66e34161 100644 --- a/qucs/qucs/dialogs/aboutdialog.cpp +++ b/qucs/qucs/dialogs/aboutdialog.cpp @@ -58,7 +58,8 @@ AboutDialog::AboutDialog(QWidget *parent) 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("You-Tang Lee (YodaLee) - GUI programmer, Qt4 porter"), + tr("Claudio Girardi - testing, general fixes") }}; prevDevs = {{ @@ -157,8 +158,13 @@ AboutDialog::AboutDialog(QWidget *parent) // link to home page, help mailing list, IRC ? supportText = tr("Home Page") + " : http://qucs.sourceforge.net/
"+ tr("Documentation start page") + " : http://qucs.sourceforge.net/docs.html
" + - tr("Components reference manual") + " : http://qucs.sourceforge.net/doc/0.0.19/html/index.html
" + - tr("Help mailing list") + " : " + tr("qucs-help on SourceForge") + ""; + tr("Components reference manual") + " : http://qucs.github.io/qucs-manual/

" + + tr("If you need help on using Qucs, please join the") + "
" + + tr("help mailing list") + " : " + tr("qucs-help on SourceForge") + "
" + + "(" + tr("please attach the schematic you are having problems with") + ")

" + + // use http://webchat.freenode.net/?channels=qucs ? + tr("IRC general discussion channel") + " : #qucs on freenode.net

" + + tr("Additional resources") + " : https://github.com/Qucs/qucs#resources"; QTextBrowser *supportBrowser = new QTextBrowser; supportBrowser->setOpenExternalLinks(true); diff --git a/qucs/qucs/dialogs/aboutdialog.h b/qucs/qucs/dialogs/aboutdialog.h index 7e67cfaf26..2ff93b731d 100644 --- a/qucs/qucs/dialogs/aboutdialog.h +++ b/qucs/qucs/dialogs/aboutdialog.h @@ -42,7 +42,7 @@ class AboutDialog : public QDialog { void setAuthorsText(void); void setTrText(void); - std::array currAuths; // current Qucs authors + std::array currAuths; // current Qucs authors std::array prevDevs; // previous Qucs developers std::array trAuths; // Qucs translators From 40e67488aa4e1838fb641243e066c1d6d0226b10 Mon Sep 17 00:00:00 2001 From: in3otd Date: Fri, 26 Jun 2015 23:42:40 +0200 Subject: [PATCH 4/4] Filter out the Ctrl-Wheel (text zoom) event To avoid having the user accidentally zooming the text while scrolling using the mouse wheel, the Ctrl-Wheel event is filtered out. --- qucs/qucs/dialogs/aboutdialog.cpp | 22 +++++++++++++++++++--- qucs/qucs/dialogs/aboutdialog.h | 3 +++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/qucs/qucs/dialogs/aboutdialog.cpp b/qucs/qucs/dialogs/aboutdialog.cpp index 9a66e34161..750f784e07 100644 --- a/qucs/qucs/dialogs/aboutdialog.cpp +++ b/qucs/qucs/dialogs/aboutdialog.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -147,12 +148,12 @@ AboutDialog::AboutDialog(QWidget *parent) QTabWidget *t = new QTabWidget(); all->addWidget(t); connect(t, SIGNAL(currentChanged(int)), this, SLOT(currentChangedSlot(int))); - authorsBrowser = new QTextBrowser; + // the Ctrl-Wheel event we would like to filter is handled by the viewport + authorsBrowser->viewport()->installEventFilter(this); trBrowser = new QTextBrowser; - - + trBrowser->viewport()->installEventFilter(this); QString supportText; // link to home page, help mailing list, IRC ? @@ -167,6 +168,7 @@ AboutDialog::AboutDialog(QWidget *parent) tr("Additional resources") + " : https://github.com/Qucs/qucs#resources"; QTextBrowser *supportBrowser = new QTextBrowser; + supportBrowser->viewport()->installEventFilter(this); supportBrowser->setOpenExternalLinks(true); supportBrowser->setHtml(supportText); @@ -174,6 +176,7 @@ AboutDialog::AboutDialog(QWidget *parent) licenseText = "Qucs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This software is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details..

You should have received a copy of the GNU General Public License along with Qucs, see the file COPYING. If not see http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,Boston, MA 02110-1301, USA."; QTextBrowser *licenseBrowser = new QTextBrowser; + licenseBrowser->viewport()->installEventFilter(this); licenseBrowser->setOpenExternalLinks(true); licenseBrowser->setHtml(licenseText); @@ -240,3 +243,16 @@ void AboutDialog::setTrText() { trBrowser->setHtml(trText); } + +// event filter to remove the Ctrl-Wheel (text zoom) event +bool AboutDialog::eventFilter(QObject *obj, QEvent *event) { + if ((event->type() == QEvent::Wheel) && + (QApplication::keyboardModifiers() & Qt::ControlModifier )) { + return true; // eat Ctrl-Wheel event + } else { + // pass the event on to the parent class + return QDialog::eventFilter(obj, event); + } +} + + diff --git a/qucs/qucs/dialogs/aboutdialog.h b/qucs/qucs/dialogs/aboutdialog.h index 2ff93b731d..785c814d08 100644 --- a/qucs/qucs/dialogs/aboutdialog.h +++ b/qucs/qucs/dialogs/aboutdialog.h @@ -38,6 +38,9 @@ class AboutDialog : public QDialog { public: AboutDialog(QWidget *parent = 0); +protected: + bool eventFilter(QObject *obj, QEvent *ev); + private: void setAuthorsText(void); void setTrText(void);