mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-27 04:29:58 +00:00
start work on dbus module
This commit is contained in:
@ -35,13 +35,13 @@ using namespace std;
|
||||
bool restoreExistSession()
|
||||
{
|
||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
||||
QDBusMessage request = QDBusMessage::createMethodCall(DBUS_SERVICE,
|
||||
DBUS_OBJECT_PATH,
|
||||
DBUS_INTERFACE,
|
||||
QDBusMessage request = QDBusMessage::createMethodCall(QString(DBUS_SERVICE),
|
||||
QString(DBUS_OBJECT_PATH),
|
||||
QString(DBUS_INTERFACE),
|
||||
QString("RestoreWindow"));
|
||||
QDBusMessage response = bus.call(request);
|
||||
QList<QVariant> arguments = response.arguments();
|
||||
return ((arguments.size()==1) && arguments[0].toBool());
|
||||
return ((arguments.size() == 1) && arguments[0].toBool());
|
||||
}
|
||||
|
||||
|
||||
@ -56,11 +56,13 @@ QChar isParametrEnable(const bool parametr)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
QApplication::setQuitOnLastWindowClosed(false);
|
||||
|
||||
// check if exists
|
||||
if (restoreExistSession())
|
||||
return 0;
|
||||
|
||||
QApplication a(argc, argv);
|
||||
|
||||
// config path
|
||||
QString configPath = QString(QDir::homePath() + QString("/.config/netctl-gui.conf"));
|
||||
// translation
|
||||
|
Reference in New Issue
Block a user