diff options
| author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-08 14:22:19 +0100 | 
|---|---|---|
| committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-08 14:22:19 +0100 | 
| commit | 4e3c479a0f279926e0bd9a359a0ee57b334e976e (patch) | |
| tree | 068f1da93a4ff6dcce251f5152df16bf77be53a8 /src/forms | |
| parent | libconfig test (diff) | |
| download | smolbote-4e3c479a0f279926e0bd9a359a0ee57b334e976e.tar.xz | |
Replaced tinytoml with libconfig
Diffstat (limited to 'src/forms')
| -rw-r--r-- | src/forms/aboutdialog.cpp | 64 | ||||
| -rw-r--r-- | src/forms/aboutdialog.h | 4 | ||||
| -rw-r--r-- | src/forms/profilesdialog.cpp | 22 | ||||
| -rw-r--r-- | src/forms/profilesdialog.h | 2 | 
4 files changed, 51 insertions, 41 deletions
| diff --git a/src/forms/aboutdialog.cpp b/src/forms/aboutdialog.cpp index e9c2a93..addf66c 100644 --- a/src/forms/aboutdialog.cpp +++ b/src/forms/aboutdialog.cpp @@ -20,7 +20,6 @@  #include "aboutdialog.h"  #include "ui_aboutdialog.h" -#include "browser.h"  AboutDialog::AboutDialog(QWidget *parent) :      QDialog(parent), @@ -34,42 +33,51 @@ AboutDialog::AboutDialog(QWidget *parent) :      QLabel *aboutLabel = new QLabel(this);      aboutLabel->setWordWrap(true);      aboutLabel->setText(tr("<h2>smolbote %1</h2>" -                           "<p><i>yet another Qute browser</i></p>" -                           "<p>Copyright (C) 2017  Xian Nox</p>" -                           "<p>This program comes with ABSOLUTELY NO WARRANTY. " -                           "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.</p>") +                           "<p><i>yet another Qute browser</i></p>")                          .arg(qApp->applicationVersion()));      ui->toolBox->addItem(aboutLabel, tr("About")); -    QLabel *detailsLabel = new QLabel(this); -    detailsLabel->setWordWrap(true); -    detailsLabel->setText(tr("<h3>Version %1</h3>" -                             "<p>" -                             "Based on Qt " QT_VERSION_STR "<br>" -#if defined __clang__ -                             "Compiled with Clang " __clang_version__ "<br>" -#elif defined __GNUC__ -                             "Compiled with GCC " __VERSION__ "<br>" -#endif -                             "Configuration lives in %2<br>" -                             "Default configuration lives in %3" -                             "</p>") -                          .arg(browser->applicationLongVersion(), -                               browser->settings()->configurationPath(), -                               browser->settings()->defaultsPath())); -    ui->toolBox->addItem(detailsLabel, tr("Details")); +    QLabel *licenseLabel = new QLabel(this); +    licenseLabel->setWordWrap(true); +    licenseLabel->setText(tr("<p>Copyright (C) 2017 Xian Nox</p>" +                             "<p>This program is free software, and you are welcome to use it under the conditions set by the GNU GPLv3:" +                             "<ul>" +                             "<li> the freedom to use the software for any purpose,</li>" +                             "<li> the freedom to change the software to suit your needs,</li>" +                             "<li> the freedom to share the software with anyone,</li>" +                             "<li> the freedom to share the changes you make, and</li>" +                             "<li> the responsibility to grant the same freedoms when sharing the software.</li>" +                             "</ul>" +                             "<p>You can find the full license text in LICENSE.md.</p>")); +    ui->toolBox->addItem(licenseLabel, tr("License"));      QLabel *libsLabel = new QLabel(this);      libsLabel->setWordWrap(true); -    libsLabel->setText(tr("<ul>" -                          "<li>Qt %1</li>" -                          "<li>tinytoml</li>" -                          "</ul>") -                       .arg(qVersion())); -    ui->toolBox->addItem(libsLabel, tr("Libraries")); +    libsLabel->setText(tr("<h3>Version %1</h3>" +                          "<p>" +                          "Based on Qt " QT_VERSION_STR "<br>" +                          "Compiled with %2" +                          "</p>" +                          "<p><ul>" +                          "<li>Qt %3</li>" +                          "<li>libconfig</li>" +                          "</ul></p>") +                       .arg(qApp->applicationVersion(), getCompiler(), qVersion())); +    ui->toolBox->addItem(libsLabel, tr("Details"));  }  AboutDialog::~AboutDialog()  {      delete ui;  } + +constexpr const char *getCompiler() +{ +    if(__clang__) { +        return "Clang " __clang_version__; +    } else if(__GNUC__) { +        return "GCC " __VERSION__; +    } else { +        return "unknown compiler"; +    } +} diff --git a/src/forms/aboutdialog.h b/src/forms/aboutdialog.h index 98a4a49..e7b2bb3 100644 --- a/src/forms/aboutdialog.h +++ b/src/forms/aboutdialog.h @@ -32,11 +32,13 @@ class AboutDialog : public QDialog      Q_OBJECT  public: -    explicit AboutDialog(QWidget *parent = 0); +    explicit AboutDialog(QWidget *parent = nullptr);      ~AboutDialog();  private:      Ui::AboutDialog *ui;  }; +constexpr const char* getCompiler(); +  #endif // ABOUTDIALOG_H diff --git a/src/forms/profilesdialog.cpp b/src/forms/profilesdialog.cpp index 7723683..b295675 100644 --- a/src/forms/profilesdialog.cpp +++ b/src/forms/profilesdialog.cpp @@ -36,7 +36,7 @@ ProfilesDialog::ProfilesDialog(MainWindow *window, QWidget *parent) :  {      m_window = window; -    m_view = new ProfileView(0, this); +    m_view = new ProfileView(nullptr, this);      // Hide the profile view because we're fancy      // Give focus to the top widget because otherwise the listwidget gains focus @@ -69,10 +69,10 @@ void ProfilesDialog::loadProfiles()  {      ui->listWidget->clear(); -    for(QString name : browser->profiles()) { -        QListWidgetItem *item = new QListWidgetItem(browser->profile(name)->name(), ui->listWidget); -        item->setData(Qt::UserRole, name); -    } +//    for(QString name : browser->profiles()) { +//        QListWidgetItem *item = new QListWidgetItem(browser->profile(name)->name(), ui->listWidget); +//        item->setData(Qt::UserRole, name); +//    }  }  void ProfilesDialog::newProfile() @@ -80,19 +80,19 @@ void ProfilesDialog::newProfile()      bool ok;      QString name = QInputDialog::getText(this, tr("Profile Name"), tr("Profile Name:"), QLineEdit::Normal, tr("Default"), &ok); -    if(ok) { -        browser->profile(name); -        loadProfiles(); -    } +//    if(ok) { +//        browser->profile(name); +//        loadProfiles(); +//    }  }  void ProfilesDialog::loadSelectedProfile()  { -    m_window->setProfile(browser->profile(ui->listWidget->currentItem()->data(Qt::UserRole).toString())); +    //m_window->setProfile(browser->profile(ui->listWidget->currentItem()->data(Qt::UserRole).toString()));  }  void ProfilesDialog::viewProfile(int index)  { -    m_view->setProfile(browser->profile(ui->listWidget->item(index)->data(Qt::UserRole).toString())); +    //m_view->setProfile(browser->profile(ui->listWidget->item(index)->data(Qt::UserRole).toString()));      m_view->show();  } diff --git a/src/forms/profilesdialog.h b/src/forms/profilesdialog.h index 71226e0..066fa7c 100644 --- a/src/forms/profilesdialog.h +++ b/src/forms/profilesdialog.h @@ -34,7 +34,7 @@ class ProfilesDialog : public QDialog      Q_OBJECT  public: -    explicit ProfilesDialog(MainWindow *window, QWidget *parent = 0); +    explicit ProfilesDialog(MainWindow *window, QWidget *parent = nullptr);      ~ProfilesDialog();  public slots: | 
