mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 23:47:21 +00:00
fix startprofileslot
This commit is contained in:
parent
abbc5641cd
commit
f238ba3a6a
@ -138,9 +138,10 @@ bool MainWindow::startProfileSlot(const QString profile)
|
|||||||
if (useHelper) {
|
if (useHelper) {
|
||||||
QList<QVariant> args;
|
QList<QVariant> args;
|
||||||
args.append(profile);
|
args.append(profile);
|
||||||
if (sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
QString currentProfile = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("ActiveProfile"),
|
DBUS_HELPER_INTERFACE, QString("ActiveProfile"),
|
||||||
QList<QVariant>(), true, debug)[0].toString().isEmpty())
|
QList<QVariant>(), true, debug)[0].toString();
|
||||||
|
if ((currentProfile.isEmpty()) || (currentProfile == profile))
|
||||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Start"),
|
DBUS_HELPER_INTERFACE, QString("Start"),
|
||||||
args, true, debug);
|
args, true, debug);
|
||||||
@ -152,7 +153,8 @@ bool MainWindow::startProfileSlot(const QString profile)
|
|||||||
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
||||||
args, true, debug)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
} else {
|
} else {
|
||||||
if (netctlCommand->getActiveProfile().isEmpty())
|
QString currentProfile = netctlCommand->getActiveProfile();
|
||||||
|
if ((currentProfile.isEmpty()) || (currentProfile == profile))
|
||||||
netctlCommand->startProfile(profile);
|
netctlCommand->startProfile(profile);
|
||||||
else
|
else
|
||||||
netctlCommand->switchToProfile(profile);
|
netctlCommand->switchToProfile(profile);
|
||||||
|
Loading…
Reference in New Issue
Block a user