-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathutils.cpp
More file actions
36 lines (26 loc) · 1.13 KB
/
Copy pathutils.cpp
File metadata and controls
36 lines (26 loc) · 1.13 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
#include "utils.hpp"
#include <QObject>
#include <QMessageBox>
#include <QCoreApplication>
#include <sdbus-c++/IConnection.h>
#include <sdbus-c++/Types.h>
#include <sdbus-c++/sdbus-c++.h>
namespace Utils{
void adapterNotFound(QWidget *parent) {
QMessageBox::critical(parent, QCoreApplication::applicationName(), QObject::tr("No adapters available!"));
}
void deviceNotFound(QWidget *parent) {
QMessageBox::warning(parent, QCoreApplication::applicationName(), QObject::tr("Couldn't get an available device"));
}
void networkConfigure(const std::string &type, QWidget *parent){
QString data = QObject::tr("Something is wrong with the %1 network configuration. These types of network need to be configured through the Manage Networks menu.")
.arg(type);
QMessageBox::warning(parent, QCoreApplication::applicationName(), data);
}
QPixmap getIcon(const char *name){
return QPixmap(name).scaled(TRAY_ICON_SCALE);
}
bool getAutoDarkMode(QWidget *parent){
return parent->palette().window().color().value() < parent->palette().windowText().color().value();
}
}