-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patherrors.cpp
More file actions
26 lines (23 loc) · 850 Bytes
/
Copy patherrors.cpp
File metadata and controls
26 lines (23 loc) · 850 Bytes
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
#include "errors.h"
#include <QMessageBox>
#include <tuple>
Error eNone = Error(E_NONE, "none", "none");
Error eNoneCallReqHandlers = Error(E_NONE, "call request handlers", "call request handlers");
Error eNoPassword = Error(E_NONE, "password", "password");
Error eNoWif = Error(E_NONE, "wif", "wif");
void Show(const QString& psCaption, const QString& psMsg, const ErrorType& errT)
{
QMessageBox messageBox;
if (errT == E_INFO)
messageBox.information(nullptr, psCaption, psMsg);
if (errT == E_WARN)
messageBox.warning(nullptr, psCaption, psMsg);
if (errT == E_FATAL)
messageBox.critical(nullptr, psCaption, psMsg);
messageBox.setFixedSize(500, 200);
}
void Show(const Error& peErr)
{
if (std::get<0>(peErr) == E_NONE) return;
Show(std::get<1>(peErr), std::get<2>(peErr), std::get<0>(peErr));
}