@@ -52,11 +52,8 @@ QStringList SplitWarnings(const QString& warnings)
5252 return result;
5353}
5454
55- QString RuntimeDialogTitle (const QString& caption, unsigned int style)
55+ QString RuntimeDialogTitle (unsigned int style)
5656{
57- if (!caption.isEmpty ()) {
58- return caption;
59- }
6057 if (style & CClientUIInterface::ICON_ERROR ) {
6158 return QObject::tr (" Error" );
6259 }
@@ -386,7 +383,7 @@ void NodeModel::showStartupWarnings()
386383 const QString warnings{m_startup_warning_messages.join (QStringLiteral (" \n\n " ))};
387384 m_startup_warning_messages.clear ();
388385 // MSG_WARNING is modal; startup notices should be shown once without blocking initialization.
389- showRuntimeDialogOnGuiThread (warnings, QString{}, CClientUIInterface::ICON_WARNING , /* question=*/ false );
386+ showRuntimeDialogOnGuiThread (warnings, CClientUIInterface::ICON_WARNING , /* question=*/ false );
390387}
391388
392389void NodeModel::recordStartupErrorMessage (const QString& message)
@@ -567,18 +564,16 @@ void NodeModel::ConnectToRuntimeDialogSignals()
567564 assert (!m_handler_question);
568565
569566 m_handler_message_box = m_node.handleMessageBox (
570- [this ](const bilingual_str& message, const std::string& caption, unsigned int style) {
567+ [this ](const bilingual_str& message, unsigned int style) {
571568 return showRuntimeDialog (
572569 QString::fromStdString (message.translated ),
573- QString::fromStdString (caption),
574570 style,
575571 /* question=*/ false );
576572 });
577573 m_handler_question = m_node.handleQuestion (
578- [this ](const bilingual_str& message, [[maybe_unused]] const std::string& non_interactive_message, const std::string& caption, unsigned int style) {
574+ [this ](const bilingual_str& message, [[maybe_unused]] const std::string& non_interactive_message, unsigned int style) {
579575 return showRuntimeDialog (
580576 QString::fromStdString (message.translated ),
581- QString::fromStdString (caption),
582577 style,
583578 /* question=*/ true );
584579 });
@@ -658,7 +653,7 @@ QVariantList NodeModel::nodeInformationRows()
658653 rows.push_back (InformationRow (tr (" User agent" ), QString::fromStdString (strSubVersion)));
659654 rows.push_back (InformationRow (tr (" Datadir" ), QString::fromStdString (fs::PathToString (gArgs .GetDataDirNet ()))));
660655 rows.push_back (InformationRow (tr (" Blocks dir" ), QString::fromStdString (fs::PathToString (gArgs .GetBlocksDirPath ()))));
661- rows.push_back (InformationRow (tr (" Startup time" ), QDateTime::fromSecsSinceEpoch ( GetStartupTime ( )).toString ()));
656+ rows.push_back (InformationRow (tr (" Startup time" ), QDateTime::currentDateTime (). addSecs (- TicksSeconds ( GetUptime () )).toString ()));
662657 rows.push_back (InformationRow (tr (" Network" ), QString::fromStdString (Params ().GetChainTypeString ())));
663658 rows.push_back (InformationRow (tr (" Block height" ), QString::number (block_height)));
664659 rows.push_back (InformationRow (tr (" Header height" ), QString::number (header_height)));
@@ -672,27 +667,27 @@ QVariantList NodeModel::nodeInformationRows()
672667 return rows;
673668}
674669
675- bool NodeModel::showRuntimeDialog (const QString& message, const QString& caption, unsigned int style, bool question)
670+ bool NodeModel::showRuntimeDialog (const QString& message, unsigned int style, bool question)
676671{
677672 if (QThread::currentThread () == thread ()) {
678- return showRuntimeDialogOnGuiThread (message, caption, style, question);
673+ return showRuntimeDialogOnGuiThread (message, style, question);
679674 }
680675
681676 if (!(style & CClientUIInterface::MODAL ) && !question) {
682- QMetaObject::invokeMethod (this , [this , message, caption, style, question] {
683- showRuntimeDialogOnGuiThread (message, caption, style, question);
677+ QMetaObject::invokeMethod (this , [this , message, style, question] {
678+ showRuntimeDialogOnGuiThread (message, style, question);
684679 }, Qt::QueuedConnection);
685680 return false ;
686681 }
687682
688683 bool result{false };
689- QMetaObject::invokeMethod (this , [this , &result, message, caption, style, question] {
690- result = showRuntimeDialogOnGuiThread (message, caption, style, question);
684+ QMetaObject::invokeMethod (this , [this , &result, message, style, question] {
685+ result = showRuntimeDialogOnGuiThread (message, style, question);
691686 }, Qt::BlockingQueuedConnection);
692687 return result;
693688}
694689
695- bool NodeModel::showRuntimeDialogOnGuiThread (const QString& message, const QString& caption, unsigned int style, bool question)
690+ bool NodeModel::showRuntimeDialogOnGuiThread (const QString& message, unsigned int style, bool question)
696691{
697692 if (!m_runtime_dialogs_enabled && !question) {
698693 if (style & CClientUIInterface::ICON_WARNING ) {
@@ -710,7 +705,6 @@ bool NodeModel::showRuntimeDialogOnGuiThread(const QString& message, const QStri
710705 const bool blocking{(style & CClientUIInterface::MODAL ) || question};
711706 auto request{std::make_shared<RuntimeDialogRequest>()};
712707 request->message = message;
713- request->caption = caption;
714708 request->style = style;
715709 request->question = question;
716710 if (!m_runtime_dialogs_enabled && (question || (style & CClientUIInterface::ICON_ERROR ))) {
@@ -743,7 +737,7 @@ bool NodeModel::showRuntimeDialogOnGuiThread(const QString& message, const QStri
743737void NodeModel::showRuntimeDialogRequest (const std::shared_ptr<RuntimeDialogRequest>& request)
744738{
745739 m_runtime_dialog_active = request;
746- m_runtime_dialog_title = RuntimeDialogTitle (request->caption , request-> style );
740+ m_runtime_dialog_title = RuntimeDialogTitle (request->style );
747741 m_runtime_dialog_message = request->message ;
748742 m_runtime_dialog_icon = RuntimeDialogIcon (request->style );
749743 m_runtime_dialog_buttons = RuntimeDialogButtons (request->style );
@@ -778,11 +772,10 @@ void NodeModel::answerRuntimeDialog(unsigned int button)
778772}
779773
780774#ifdef ENABLE_TEST_AUTOMATION
781- void NodeModel::showRuntimeDialogForTest (const QString& message, const QString& caption, unsigned int style, bool question)
775+ void NodeModel::showRuntimeDialogForTest (const QString& message, unsigned int style, bool question)
782776{
783777 auto request{std::make_shared<RuntimeDialogRequest>()};
784778 request->message = message;
785- request->caption = caption;
786779 request->style = style;
787780 request->question = question;
788781
0 commit comments