refactor: messages::showCloseReminder

use app name for title
   create message using append
   enable translations
This commit is contained in:
sithlord48 2025-06-02 22:23:56 -04:00 committed by Nick Bolton
parent 5d94dd0dbf
commit 1286c18e1d

View file

@ -109,26 +109,23 @@ void messageHandler(QtMsgType type, const QMessageLogContext &context, const QSt
void showCloseReminder(QWidget *parent) void showCloseReminder(QWidget *parent)
{ {
QString message = QString( auto message = QObject::tr(
"<p>%1 will continue to run in the background and can be accessed " "<p>%1 will continue to run in the background and can be accessed via the %1 icon in your "
"via the %1 icon in your system notifications area. This " "system notifications area. This setting can be disabled.</p>"
"setting "
"can be disabled.</p>"
) )
.arg(kAppName); .arg(kAppName);
#if defined(Q_OS_LINUX) #if defined(Q_OS_LINUX)
message += QString( message.append(
"<p>On some Linux systems such as GNOME 3, the " QObject::tr(
"notification area might be disabled. " "<p>On Linux systems using GNOME 3, the notification area might be disabled. "
"You may need to " R"(You may need to <a href="%1" %2>enable an extension</a> to see the %3 tray icon.</p>)"
R"(<a href="%1" %2>enable an extension</a>)" )
" to see the %3 tray icon.</p>" .arg(kUrlGnomeTrayFix, kStyleLink, kAppName)
) );
.arg(kUrlGnomeTrayFix, kStyleLink, kAppName);
#endif #endif
QMessageBox::information(parent, "Notification area icon", message); QMessageBox::information(parent, kAppName, message);
} }
void showFirstServerStartMessage(QWidget *parent) void showFirstServerStartMessage(QWidget *parent)