-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessagedialog.cpp
More file actions
53 lines (50 loc) · 1.97 KB
/
messagedialog.cpp
File metadata and controls
53 lines (50 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//-----------------------------------------------------------------------------------------------------------
// Emby Explorer (Qt) (w) 2024-2025 by Jan Buchholz
// UI - Error messages
// last change: 20251014
//-----------------------------------------------------------------------------------------------------------
#include "messagedialog.h"
#include <QMessageBox>
MessageDialog::MessageDialog(QObject *parent) : QObject{parent} {
message m;
m = {
.msgNumber = MSG_ERR10,
.msgString = tr("User record not found.")};
messages.append(m);
m = {
.msgNumber = MSG_ERR11,
.msgString = tr("Failed to execute query for existing users.")};
messages.append(m);
m = {
.msgNumber = MSG_ERR12,
.msgString = tr("Login authentication unsuccessful.")};
messages.append(m);
m = {
.msgNumber = MSG_ERR13,
.msgString = tr("Error occurred during Excel file save.")};
messages.append(m);
m = {
.msgNumber = MSG_ERR14,
.msgString = tr("Could not establish a connection to the Emby server.")};
messages.append(m);
}
MessageDialog::~MessageDialog() {}
void MessageDialog::showMessage(QWidget *parent, int number) {
for (message &m : messages) {
if (m.msgNumber == number) {
QMessageBox msg;
msg.setParent(parent, Qt::Dialog|
Qt::WindowSystemMenuHint|
Qt::WindowCloseButtonHint|
Qt::WindowTitleHint|
Qt::CustomizeWindowHint|
Qt::MSWindowsFixedSizeDialogHint);
msg.setText(m.msgString);
msg.setWindowTitle(QString(APP_NAME) + " " + QString(APP_VERSION));
msg.setStandardButtons(QMessageBox::Ok);
msg.setIcon(QMessageBox::Critical);
msg.exec();
return;
}
}
}