Fix messy window title and make it all nice and pretty (#705)

This commit is contained in:
Crystalwarrior 2022-05-23 21:42:35 +03:00 committed by GitHub
parent b56805e3e2
commit 35004921d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -32,7 +32,7 @@ AOApplication::AOApplication(int &argc, char **argv) : QApplication(argc, argv)
original_message_handler = qInstallMessageHandler(message_handler);
setApplicationVersion(get_version_string());
setApplicationDisplayName(tr("Attorney Online 2"));
setApplicationDisplayName(tr("Attorney Online %1").arg(applicationVersion()));
}
AOApplication::~AOApplication()

View File

@ -173,7 +173,6 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
courtroom_loaded = false;
window_title = tr("Attorney Online %1").arg(applicationVersion());
int selected_server = w_lobby->get_selected_server();
QString server_address = "", server_name = "";
@ -183,7 +182,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
server_name = info.name;
server_address =
QString("%1:%2").arg(info.ip, QString::number(info.port));
window_title += ": " + server_name;
window_title = server_name;
}
}
else {
@ -192,7 +191,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
server_name = info.name;
server_address =
QString("%1:%2").arg(info.ip, QString::number(info.port));
window_title += ": " + server_name;
window_title = server_name;
}
}