diff --git a/src/blackgui/qss/swiftcore.qss b/src/blackgui/qss/swiftcore.qss index 81e3eb2aa..83e821292 100644 --- a/src/blackgui/qss/swiftcore.qss +++ b/src/blackgui/qss/swiftcore.qss @@ -128,7 +128,25 @@ QTableView, QTreeView { background-image: url(:/textures/icons/textures/texture-inner.jpg); } -QSizeGrip { +QSizeGrip { } + +QScrollArea { + border: 1px solid green; + border-radius: 5px; +} + +QScrollBar:horizontal { + border: 2px solid gray; + background: slategray; + height: 10px; + margin: 0px 5px 0px 5px; +} + +QScrollBar:vertical { + border: 2px solid gray; + background: slategray; + width: 10px; + margin: 5px 0px 5px 0; } #le_CommandLineInput { @@ -138,11 +156,11 @@ QSizeGrip { border-radius: 5px; } -#comp_log { +#comp_Log { background: transparent; /** background is background color here **/ } -#gb_dbusMode { +#gb_DBusMode { background: transparent; /** background is background color here **/ background-image: url(:/textures/icons/textures/texture-inner.jpg); } @@ -150,4 +168,4 @@ QSizeGrip { #gb_Controls { background: transparent; /** background is background color here **/ background-image: url(:/textures/icons/textures/texture-inner.jpg); -} \ No newline at end of file +} diff --git a/src/swiftcore/swiftcore.cpp b/src/swiftcore/swiftcore.cpp index af53a1dc8..f983f8700 100644 --- a/src/swiftcore/swiftcore.cpp +++ b/src/swiftcore/swiftcore.cpp @@ -11,9 +11,11 @@ #include "ui_swiftcore.h" #include "blackmisc/icon.h" #include "blackmisc/loghandler.h" +#include "blackmisc/project.h" +#include "blackgui/components/logcomponent.h" +#include "blackgui/components/enableforruntime.h" #include "blackcore/dbus_server.h" #include "blackgui/stylesheetutility.h" -#include "blackgui/components/enableforruntime.h" #include #include #include @@ -24,25 +26,25 @@ using namespace BlackGui; using namespace BlackGui::Components; CSwiftCore::CSwiftCore(const SetupInfo &info, QWidget *parent) : - CSystemTrayWindow(BlackMisc::CIcons::swiftNova24(), parent), + CSystemTrayWindow(CIcons::swiftNova24(), parent), ui(new Ui::CSwiftCore) { ui->setupUi(this); - + const QString name("swiftcore " + CProject::version()); SystemTrayMode mode = MinimizeToTray | QuitOnClose; setSystemTrayMode(mode); - setToolTip(QStringLiteral("swiftcore")); - + setToolTip(name); + setWindowTitle(name); + setWindowIcon(CIcons::swiftNova24()); + setWindowIconText(name); setupLogDisplay(); - connectSlots(); ps_onStyleSheetsChanged(); startCore(info); } CSwiftCore::~CSwiftCore() -{ -} +{ } void CSwiftCore::ps_startCorePressed() { @@ -58,19 +60,19 @@ void CSwiftCore::ps_stopCorePressed() void CSwiftCore::ps_appendLogMessage(const CStatusMessage &message) { - ui->comp_log->appendStatusMessageToList(message); + ui->comp_InfoArea->getLogComponent()->appendStatusMessageToList(message); } void CSwiftCore::ps_p2pModeToggled(bool checked) { if (checked) { - ui->le_p2pAddress->setEnabled(true); + ui->le_P2PAddress->setEnabled(true); } else { - ui->le_p2pAddress->setText(QString()); - ui->le_p2pAddress->setEnabled(false); + ui->le_P2PAddress->setText(QString()); + ui->le_P2PAddress->setEnabled(false); } } @@ -87,9 +89,9 @@ void CSwiftCore::ps_onStyleSheetsChanged() void CSwiftCore::connectSlots() { - connect(ui->pb_startCore, &QPushButton::clicked, this, &CSwiftCore::ps_startCorePressed); - connect(ui->pb_stopCore, &QPushButton::clicked, this, &CSwiftCore::ps_stopCorePressed); - connect(ui->rb_p2pBus, &QRadioButton::toggled, this, &CSwiftCore::ps_p2pModeToggled); + connect(ui->pb_StartCore, &QPushButton::clicked, this, &CSwiftCore::ps_startCorePressed); + connect(ui->pb_StopCore, &QPushButton::clicked, this, &CSwiftCore::ps_stopCorePressed); + connect(ui->rb_P2PBus, &QRadioButton::toggled, this, &CSwiftCore::ps_p2pModeToggled); connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CSwiftCore::ps_onStyleSheetsChanged); } @@ -100,7 +102,6 @@ void CSwiftCore::setupLogDisplay() auto logHandler = CLogHandler::instance()->handlerForPattern( CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo) ); - logHandler->subscribe(this, &CSwiftCore::ps_appendLogMessage); } @@ -109,9 +110,9 @@ void CSwiftCore::startCore(const SetupInfo &setup) if (getRuntime()) { return; } if (setup.m_dbusAddress.isEmpty()) { return; } - ui->pb_startCore->setEnabled(false); - ui->pb_stopCore->setEnabled(true); - ui->gb_dbusMode->setDisabled(true); + ui->pb_StartCore->setEnabled(false); + ui->pb_StopCore->setEnabled(true); + ui->gb_DBusMode->setDisabled(true); // context createRuntime(CRuntimeConfig::forCoreAllLocalInDBus(setup.m_dbusAddress), this); @@ -122,10 +123,11 @@ void CSwiftCore::startCore(const SetupInfo &setup) void CSwiftCore::stopCore() { if (!getRuntime()) { return; } + getRuntime()->gracefulShutdown(); - ui->pb_startCore->setEnabled(true); - ui->pb_stopCore->setEnabled(false); - ui->gb_dbusMode->setDisabled(false); + ui->pb_StartCore->setEnabled(true); + ui->pb_StopCore->setEnabled(false); + ui->gb_DBusMode->setDisabled(false); // Force quit, since we cannot close the runtime qApp->quit(); @@ -133,10 +135,10 @@ void CSwiftCore::stopCore() QString CSwiftCore::getDBusAddress() const { - if (ui->rb_sessionBus->isChecked()) { return CDBusServer::sessionDBusServer(); } - if (ui->rb_systemBus->isChecked()) { return CDBusServer::systemDBusServer(); } - if (ui->rb_p2pBus->isChecked()) { return CDBusServer::fixAddressToDBusAddress(ui->le_p2pAddress->text()); } + if (ui->rb_SessionBus->isChecked()) { return CDBusServer::sessionDBusServer(); } + if (ui->rb_SystemBus->isChecked()) { return CDBusServer::systemDBusServer(); } + if (ui->rb_P2PBus->isChecked()) { return CDBusServer::fixAddressToDBusAddress(ui->le_P2PAddress->text()); } - Q_ASSERT_X(false, "CSwiftCore::getDBusAddress()", "The impossible happended!"); + Q_ASSERT_X(false, Q_FUNC_INFO, "The impossible happend!"); return ""; } diff --git a/src/swiftcore/swiftcore.h b/src/swiftcore/swiftcore.h index af353441c..d50022d08 100644 --- a/src/swiftcore/swiftcore.h +++ b/src/swiftcore/swiftcore.h @@ -18,10 +18,7 @@ #include "blackgui/components/enableforruntime.h" #include -namespace Ui -{ - class CSwiftCore; -} +namespace Ui { class CSwiftCore; } //! swift core control class CSwiftCore : @@ -38,7 +35,7 @@ public: SetupInfo() {} bool m_minimzed = false; //!< Start minimized to tray - QString m_dbusAddress; //!< DBus address (session, system, p2p) + QString m_dbusAddress; //!< DBus address (session, system, p2p) }; //! Constructor @@ -48,7 +45,6 @@ public: ~CSwiftCore(); private slots: - // PushButton slots void ps_startCorePressed(); void ps_stopCorePressed(); @@ -59,15 +55,13 @@ private slots: virtual void ps_onStyleSheetsChanged(); private: - void connectSlots(); void setupLogDisplay(); void startCore(const SetupInfo &setup); void stopCore(); - QString getDBusAddress() const; QScopedPointer ui; }; -#endif // SWIFTCORE_H +#endif // guard diff --git a/src/swiftcore/swiftcore.ui b/src/swiftcore/swiftcore.ui index c847fc4ee..a95e7d08b 100644 --- a/src/swiftcore/swiftcore.ui +++ b/src/swiftcore/swiftcore.ui @@ -13,10 +13,7 @@ swiftcore - - - - + @@ -25,7 +22,7 @@ - + /** Main window **/ QTextEdit { @@ -38,7 +35,7 @@ QTextEdit { - + false @@ -72,17 +69,14 @@ QTextEdit { - - - - + DBus Mode - + Session @@ -92,21 +86,21 @@ QTextEdit { - + P2P - + System - + false @@ -121,19 +115,11 @@ QTextEdit { + + + - - - - 0 - 0 - 460 - 25 - - - - @@ -149,18 +135,18 @@ QTextEdit {
blackgui/components/infobarstatuscomponent.h
1 - - BlackGui::Components::CLogComponent - QWidget -
blackgui/components/logcomponent.h
- 1 -
BlackGui::CCommandInput QLineEdit
blackgui/commandinput.h
1
+ + BlackGui::Components::CCoreInfoAreaComponent + QWidget +
blackgui/components/coreinfoareacomponent.h
+ 1 +