diff --git a/src/blackgui/components/coresettingsdialog.cpp b/src/blackgui/components/coresettingsdialog.cpp new file mode 100644 index 000000000..587478707 --- /dev/null +++ b/src/blackgui/components/coresettingsdialog.cpp @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 + * 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 "coresettingsdialog.h" +#include "ui_coresettingsdialog.h" + +namespace BlackGui +{ + namespace Components + { + CCoreSettingsDialog::CCoreSettingsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::CCoreSettingsDialog) + { + ui->setupUi(this); + } + + CCoreSettingsDialog::~CCoreSettingsDialog() + { } + } // ns +} // ns diff --git a/src/blackgui/components/coresettingsdialog.h b/src/blackgui/components/coresettingsdialog.h new file mode 100644 index 000000000..a307dcccf --- /dev/null +++ b/src/blackgui/components/coresettingsdialog.h @@ -0,0 +1,44 @@ +/* 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_CORESETTINGSDIALOG_H +#define BLACKGUI_COMPONENTS_CORESETTINGSDIALOG_H + +#include "blackgui/blackguiexport.h" +#include +#include + +namespace Ui { class CCoreSettingsDialog; } +namespace BlackGui +{ + namespace Components + { + /** + * Core / swift pilot client settings as Dialog + */ + class BLACKGUI_EXPORT CCoreSettingsDialog : public QDialog + { + Q_OBJECT + + public: + //! Constructor + explicit CCoreSettingsDialog(QWidget *parent = nullptr); + + //! Destructor + virtual ~CCoreSettingsDialog(); + + private: + QScopedPointer ui; + }; + } // ns +} // ns + +#endif // guard diff --git a/src/blackgui/components/coresettingsdialog.ui b/src/blackgui/components/coresettingsdialog.ui new file mode 100644 index 000000000..f4643e369 --- /dev/null +++ b/src/blackgui/components/coresettingsdialog.ui @@ -0,0 +1,93 @@ + + + CCoreSettingsDialog + + + + 0 + 0 + 350 + 400 + + + + + 350 + 400 + + + + swift settings + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + BlackGui::Components::CSettingsComponent + QTabWidget +
blackgui/components/settingscomponent.h
+ 1 +
+
+ + + + bb_CoreSettingsDialog + accepted() + CCoreSettingsDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + bb_CoreSettingsDialog + rejected() + CCoreSettingsDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
diff --git a/src/swiftcore/swiftcore.cpp b/src/swiftcore/swiftcore.cpp index 069fb9322..8a75b070f 100644 --- a/src/swiftcore/swiftcore.cpp +++ b/src/swiftcore/swiftcore.cpp @@ -11,6 +11,7 @@ #include "blackcore/corefacade.h" #include "blackgui/components/commandinput.h" #include "blackgui/components/coreinfoareacomponent.h" +#include "blackgui/components/coresettingsdialog.h" #include "blackgui/components/logcomponent.h" #include "blackgui/guiapplication.h" #include "blackgui/stylesheetutility.h" @@ -120,6 +121,15 @@ void CSwiftCore::ps_p2pModeToggled(bool checked) } } +void CSwiftCore::ps_showSettingsDialog() +{ + if (!m_settingsDialog) + { + m_settingsDialog.reset(new CCoreSettingsDialog(this)); + } + m_settingsDialog->show(); +} + void CSwiftCore::ps_onStyleSheetsChanged() { this->initStyleSheet(); @@ -150,6 +160,7 @@ void CSwiftCore::initMenus() sGui->addMenuFile(*ui->menu_File); sGui->addMenuWindow(*ui->menu_Window); sGui->addMenuHelp(*ui->menu_Help); + connect(ui->menu_SettingsDialog, &QAction::triggered, this, &CSwiftCore::ps_showSettingsDialog); } void CSwiftCore::startCore(const QString &dBusAdress) diff --git a/src/swiftcore/swiftcore.h b/src/swiftcore/swiftcore.h index 57dfb9074..5e5358111 100644 --- a/src/swiftcore/swiftcore.h +++ b/src/swiftcore/swiftcore.h @@ -22,7 +22,7 @@ #include class QWidget; - +namespace BlackGui { namespace Components { class CCoreSettingsDialog; }} namespace Ui { class CSwiftCore; } /*! @@ -52,6 +52,9 @@ private slots: void ps_p2pModeToggled(bool checked); //! @} + //! Show the settings dialog + void ps_showSettingsDialog(); + //! Style sheet has changed virtual void ps_onStyleSheetsChanged(); @@ -69,6 +72,7 @@ private: void stopCore(); QString getDBusAddress() const; + QScopedPointer m_settingsDialog; QScopedPointer ui; }; diff --git a/src/swiftcore/swiftcore.ui b/src/swiftcore/swiftcore.ui index 7ba3919e8..a4b850715 100644 --- a/src/swiftcore/swiftcore.ui +++ b/src/swiftcore/swiftcore.ui @@ -156,10 +156,26 @@ QTextEdit { &Window + + + Settings + + + + + + + + :/pastel/icons/pastel/16/wrench-orange.png:/pastel/icons/pastel/16/wrench-orange.png + + + Modify settings + + @@ -188,6 +204,8 @@ QTextEdit { 1 - + + +