diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 7ab83d578..ce8fadeba 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -512,13 +512,13 @@ namespace BlackCore QLatin1String(" Windows 10: ") % boolToYesNo(CBuildConfig::isRunningOnWindows10()) % separator % - QLatin1String("MacOSX: ") % - boolToYesNo(CBuildConfig::isRunningOnMacOSXPlatform()) % - QLatin1String(" Linux: ") % + QLatin1String("Linux: ") % boolToYesNo(CBuildConfig::isRunningOnLinuxPlatform()) % + QLatin1String(" Unix: ") % + boolToYesNo(CBuildConfig::isRunningOnUnixPlatform()) % separator % - QLatin1String("Unix: ") % - boolToYesNo(CBuildConfig::isRunningOnUnixPlatform()); + QLatin1String("MacOSX: ") % + boolToYesNo(CBuildConfig::isRunningOnMacOSXPlatform()); return env; } diff --git a/src/blackgui/components/aboutdialog.cpp b/src/blackgui/components/aboutdialog.cpp new file mode 100644 index 000000000..db9868cef --- /dev/null +++ b/src/blackgui/components/aboutdialog.cpp @@ -0,0 +1,37 @@ +/* Copyright (C) 2017 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#include "aboutdialog.h" +#include "ui_aboutdialog.h" +#include "blackgui/guiapplication.h" + +namespace BlackGui +{ + namespace Components + { + CAboutDialog::CAboutDialog(QWidget *parent) : + QDialog(parent), ui(new Ui::CAboutDialog) + { + ui->setupUi(this); + this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); + this->init(); + } + + CAboutDialog::~CAboutDialog() + { } + + void CAboutDialog::init() + { + ui->lbl_VersionValue->setText(sGui->getApplicationNameVersionBetaDev()); + ui->pte_Info->setPlainText(sGui->getInfoString("\n")); + ui->pte_Info->appendPlainText("\nSetup follows:\n----"); + ui->pte_Info->appendPlainText(sGui->getGlobalSetup().convertToQString("\n", true)); + } + } // ns +} // ns diff --git a/src/blackgui/components/aboutdialog.h b/src/blackgui/components/aboutdialog.h new file mode 100644 index 000000000..46f063c35 --- /dev/null +++ b/src/blackgui/components/aboutdialog.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2017 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKGUI_COMPONENTS_ABOUTDIALOG_H +#define BLACKGUI_COMPONENTS_ABOUTDIALOG_H + +#include +#include + +namespace Ui { class CAboutDialog; } +namespace BlackGui +{ + namespace Components + { + /*! + * About dialog + */ + class CAboutDialog : public QDialog + { + Q_OBJECT + + public: + //! Constructor + explicit CAboutDialog(QWidget *parent = nullptr); + + //! Destructor + virtual ~CAboutDialog(); + + private: + //! Init values + void init(); + + QScopedPointer ui; + }; + } // ns +} // ns + +#endif // guard diff --git a/src/blackgui/components/aboutdialog.ui b/src/blackgui/components/aboutdialog.ui new file mode 100644 index 000000000..fbb067f62 --- /dev/null +++ b/src/blackgui/components/aboutdialog.ui @@ -0,0 +1,91 @@ + + + CAboutDialog + + + + 0 + 0 + 320 + 258 + + + + + 300 + 200 + + + + About swift + + + false + + + + + + Version: + + + + + + + about swift details + + + QPlainTextEdit::NoWrap + + + true + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + Version .... + + + + + + + Details: + + + + + + + + + bb_AboutDialog + accepted() + CAboutDialog + accept() + + + 261 + 248 + + + 319 + 199 + + + + + diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 64308fb2d..4293f2cb4 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -12,6 +12,7 @@ #include "blackcore/data/globalsetup.h" #include "blackgui/components/applicationclosedialog.h" #include "blackgui/components/downloadandinstalldialog.h" +#include "blackgui/components/aboutdialog.h" #include "blackgui/guiapplication.h" #include "blackgui/guiutility.h" #include "blackgui/registermetadata.h" @@ -462,20 +463,6 @@ namespace BlackGui this->displayTextInConsole(getAllUserMetatypesTypes()); }); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - - a = menu.addAction("Setup"); - c = connect(a, &QAction::triggered, this, [a, this]() - { - this->displayTextInConsole(this->getGlobalSetup().convertToQString("\n", true)); - }); - Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - - a = menu.addAction("Compile info"); - c = connect(a, &QAction::triggered, this, [a, this]() - { - this->displayTextInConsole(this->getInfoString("\n")); - }); - Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); Q_UNUSED(c); } @@ -526,7 +513,7 @@ namespace BlackGui void CGuiApplication::addMenuHelp(QMenu &menu) { - const QWidget *w = mainApplicationWindow(); + QWidget *w = mainApplicationWindow(); if (!w) { return; } QAction *a = menu.addAction(w->style()->standardIcon(QStyle::SP_TitleBarContextHelpButton), "Online help"); bool c = connect(a, &QAction::triggered, this, [this]() @@ -535,7 +522,17 @@ namespace BlackGui }); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); - a = menu.addAction("About Qt"); + a = menu.addAction(QApplication::windowIcon(), "About swift"); + c = connect(a, &QAction::triggered, this, [w]() + { + CAboutDialog dialog(w); + dialog.exec(); + }); + Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed"); + Q_UNUSED(c); + + // https://joekuan.wordpress.com/2015/09/23/list-of-qt-icons/ + a = menu.addAction(QApplication::style()->standardIcon(QStyle::SP_TitleBarMenuButton), "About Qt"); c = connect(a, &QAction::triggered, this, []() { QApplication::aboutQt();