mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
rewrite netctlautowindow
This commit is contained in:
parent
172624b494
commit
558a206a8d
@ -143,7 +143,7 @@ bool MainWindow::forceStopHelper()
|
|||||||
|
|
||||||
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Close"),
|
DBUS_HELPER_INTERFACE, QString("Close"),
|
||||||
QList<QVariant>(), true);
|
QList<QVariant>(), true, debug);
|
||||||
|
|
||||||
return !responce.isEmpty();
|
return !responce.isEmpty();
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
|
|||||||
if (useHelper)
|
if (useHelper)
|
||||||
interfaces = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
interfaces = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("WirelessInterfaces"),
|
DBUS_HELPER_INTERFACE, QString("WirelessInterfaces"),
|
||||||
QList<QVariant>(), true)[0].toStringList();
|
QList<QVariant>(), true, debug)[0].toStringList();
|
||||||
else
|
else
|
||||||
interfaces = netctlCommand->getWirelessInterfaceList();
|
interfaces = netctlCommand->getWirelessInterfaceList();
|
||||||
if (interfaces.isEmpty())
|
if (interfaces.isEmpty())
|
||||||
@ -228,15 +228,15 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
|
|||||||
args.append(settingsList);
|
args.append(settingsList);
|
||||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Create"),
|
DBUS_HELPER_INTERFACE, QString("Create"),
|
||||||
args, true);
|
args, true, debug);
|
||||||
args.clear();
|
args.clear();
|
||||||
args.append(profile);
|
args.append(profile);
|
||||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Start"),
|
DBUS_HELPER_INTERFACE, QString("Start"),
|
||||||
args, true);
|
args, true, debug);
|
||||||
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString profileTempName = netctlProfile->createProfile(profile, settings);
|
QString profileTempName = netctlProfile->createProfile(profile, settings);
|
||||||
@ -375,10 +375,10 @@ void MainWindow::mainTabEnableProfile()
|
|||||||
args.append(profile);
|
args.append(profile);
|
||||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Enable"),
|
DBUS_HELPER_INTERFACE, QString("Enable"),
|
||||||
args, true);
|
args, true, debug);
|
||||||
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("isProfileEnabled"),
|
DBUS_HELPER_INTERFACE, QString("isProfileEnabled"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
netctlCommand->enableProfile(profile);
|
netctlCommand->enableProfile(profile);
|
||||||
@ -406,7 +406,7 @@ void MainWindow::mainTabRemoveProfile()
|
|||||||
args.append(profile);
|
args.append(profile);
|
||||||
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Remove"),
|
DBUS_HELPER_INTERFACE, QString("Remove"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
status = netctlProfile->removeProfile(profile);
|
status = netctlProfile->removeProfile(profile);
|
||||||
@ -435,10 +435,10 @@ void MainWindow::mainTabRestartProfile()
|
|||||||
args.append(profile);
|
args.append(profile);
|
||||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Restart"),
|
DBUS_HELPER_INTERFACE, QString("Restart"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
netctlCommand->restartProfile(profile);
|
netctlCommand->restartProfile(profile);
|
||||||
@ -470,10 +470,10 @@ void MainWindow::mainTabStartProfile()
|
|||||||
args.append(profile);
|
args.append(profile);
|
||||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Start"),
|
DBUS_HELPER_INTERFACE, QString("Start"),
|
||||||
args, true);
|
args, true, debug);
|
||||||
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
netctlCommand->startProfile(profile);
|
netctlCommand->startProfile(profile);
|
||||||
@ -664,7 +664,7 @@ void MainWindow::profileTabClear()
|
|||||||
if (useHelper)
|
if (useHelper)
|
||||||
profiles = parseOutputNetctl(sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
profiles = parseOutputNetctl(sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("ProfileList"),
|
DBUS_HELPER_INTERFACE, QString("ProfileList"),
|
||||||
QList<QVariant>(), true));
|
QList<QVariant>(), true, debug), debug);
|
||||||
else
|
else
|
||||||
profiles = netctlCommand->getProfileList();
|
profiles = netctlCommand->getProfileList();
|
||||||
for (int i=0; i<profiles.count(); i++)
|
for (int i=0; i<profiles.count(); i++)
|
||||||
@ -858,7 +858,7 @@ void MainWindow::profileTabCreateProfile()
|
|||||||
args.append(settingsList);
|
args.append(settingsList);
|
||||||
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Create"),
|
DBUS_HELPER_INTERFACE, QString("Create"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString profileTempName = netctlProfile->createProfile(profile, settings);
|
QString profileTempName = netctlProfile->createProfile(profile, settings);
|
||||||
@ -886,7 +886,7 @@ void MainWindow::profileTabLoadProfile()
|
|||||||
args.append(profile);
|
args.append(profile);
|
||||||
QStringList settingsList = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
QStringList settingsList = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Profile"),
|
DBUS_HELPER_INTERFACE, QString("Profile"),
|
||||||
args, true)[0].toStringList();
|
args, true, debug)[0].toStringList();
|
||||||
for (int i=0; i<settingsList.count(); i++) {
|
for (int i=0; i<settingsList.count(); i++) {
|
||||||
QString key = settingsList[i].split(QString("=="))[0];
|
QString key = settingsList[i].split(QString("=="))[0];
|
||||||
QString value = settingsList[i].split(QString("=="))[1];
|
QString value = settingsList[i].split(QString("=="))[1];
|
||||||
@ -958,7 +958,7 @@ void MainWindow::profileTabRemoveProfile()
|
|||||||
args.append(profile);
|
args.append(profile);
|
||||||
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Remove"),
|
DBUS_HELPER_INTERFACE, QString("Remove"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
status = netctlProfile->removeProfile(profile);
|
status = netctlProfile->removeProfile(profile);
|
||||||
@ -1068,15 +1068,15 @@ void MainWindow::wifiTabStart()
|
|||||||
args.append(profile);
|
args.append(profile);
|
||||||
QString profileName = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
QString profileName = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("ProfileByEssid"),
|
DBUS_HELPER_INTERFACE, QString("ProfileByEssid"),
|
||||||
args, true)[0].toString();
|
args, true, debug)[0].toString();
|
||||||
args.clear();
|
args.clear();
|
||||||
args.append(profileName);
|
args.append(profileName);
|
||||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Start"),
|
DBUS_HELPER_INTERFACE, QString("Start"),
|
||||||
args, true);
|
args, true, debug);
|
||||||
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
|
||||||
args, true)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString profileName = wpaCommand->existentProfile(profile);
|
QString profileName = wpaCommand->existentProfile(profile);
|
||||||
|
@ -125,7 +125,7 @@ QString MainWindow::getInformation()
|
|||||||
if (useHelper) {
|
if (useHelper) {
|
||||||
QStringList request = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
QStringList request = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Information"),
|
DBUS_HELPER_INTERFACE, QString("Information"),
|
||||||
QList<QVariant>(), true)[0].toStringList();
|
QList<QVariant>(), true, debug)[0].toStringList();
|
||||||
profile = request[0];
|
profile = request[0];
|
||||||
status = request[1];
|
status = request[1];
|
||||||
}
|
}
|
||||||
@ -165,7 +165,7 @@ bool MainWindow::isHelperActive()
|
|||||||
|
|
||||||
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("Active"),
|
DBUS_HELPER_INTERFACE, QString("Active"),
|
||||||
QList<QVariant>(), true);
|
QList<QVariant>(), true, debug);
|
||||||
|
|
||||||
return (!responce.isEmpty());
|
return (!responce.isEmpty());
|
||||||
}
|
}
|
||||||
@ -605,10 +605,10 @@ void MainWindow::updateMainTab()
|
|||||||
if (useHelper) {
|
if (useHelper) {
|
||||||
netctlAutoStatus = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
netctlAutoStatus = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("isNetctlAutoActive"),
|
DBUS_HELPER_INTERFACE, QString("isNetctlAutoActive"),
|
||||||
QList<QVariant>(), true)[0].toBool();
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
profiles = parseOutputNetctl(sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
profiles = parseOutputNetctl(sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("ProfileList"),
|
DBUS_HELPER_INTERFACE, QString("ProfileList"),
|
||||||
QList<QVariant>(), true));
|
QList<QVariant>(), true, debug), debug);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
netctlAutoStatus = netctlCommand->isNetctlAutoRunning();
|
netctlAutoStatus = netctlCommand->isNetctlAutoRunning();
|
||||||
@ -700,7 +700,7 @@ void MainWindow::updateWifiTab()
|
|||||||
if (useHelper)
|
if (useHelper)
|
||||||
scanResults = parseOutputWifi(sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
scanResults = parseOutputWifi(sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("WiFi"),
|
DBUS_HELPER_INTERFACE, QString("WiFi"),
|
||||||
QList<QVariant>(), true));
|
QList<QVariant>(), true, debug), debug);
|
||||||
else
|
else
|
||||||
scanResults = wpaCommand->scanWifi();
|
scanResults = wpaCommand->scanWifi();
|
||||||
|
|
||||||
|
@ -169,12 +169,26 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
|||||||
|
|
||||||
ui->tableWidget->setDisabled(true);
|
ui->tableWidget->setDisabled(true);
|
||||||
// actions
|
// actions
|
||||||
if (netctlCommand->isNetctlAutoEnabled())
|
bool enabled = false;
|
||||||
|
bool running = false;
|
||||||
|
if (useHelper) {
|
||||||
|
enabled = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("isNetctlAutoEnabled"),
|
||||||
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
|
running = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("isNetctlAutoRunning"),
|
||||||
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enabled = netctlCommand->isNetctlAutoEnabled();
|
||||||
|
running = netctlCommand->isNetctlAutoRunning();
|
||||||
|
}
|
||||||
|
if (enabled)
|
||||||
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Disable service"));
|
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Disable service"));
|
||||||
else
|
else
|
||||||
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Enable service"));
|
ui->actionEnableService->setText(QApplication::translate("NetctlAutoWindow", "Enable service"));
|
||||||
ui->actionEnableService->setVisible(true);
|
ui->actionEnableService->setVisible(true);
|
||||||
if (netctlCommand->isNetctlAutoRunning()) {
|
if (running) {
|
||||||
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is running"));
|
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is running"));
|
||||||
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Stop service"));
|
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Stop service"));
|
||||||
ui->actionDisableAll->setVisible(true);
|
ui->actionDisableAll->setVisible(true);
|
||||||
@ -190,7 +204,13 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
|||||||
netctlAutoRefreshButtons(0, 0);
|
netctlAutoRefreshButtons(0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QList<netctlProfileInfo> profiles = netctlCommand->getProfileListFromNetctlAuto();
|
QList<netctlProfileInfo> profiles;
|
||||||
|
if (useHelper)
|
||||||
|
profiles = parseOutputNetctl(sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("ProfileList"),
|
||||||
|
QList<QVariant>(), true, debug), debug);
|
||||||
|
else
|
||||||
|
profiles = netctlCommand->getProfileListFromNetctlAuto();
|
||||||
|
|
||||||
ui->tableWidget->setSortingEnabled(false);
|
ui->tableWidget->setSortingEnabled(false);
|
||||||
ui->tableWidget->selectRow(-1);
|
ui->tableWidget->selectRow(-1);
|
||||||
@ -257,7 +277,14 @@ void NetctlAutoWindow::netctlAutoDisableAllProfiles()
|
|||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoDisableAllProfiles]";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoDisableAllProfiles]";
|
||||||
|
|
||||||
ui->tableWidget->setDisabled(true);
|
ui->tableWidget->setDisabled(true);
|
||||||
if (netctlCommand->autoDisableAllProfiles())
|
bool status = false;
|
||||||
|
if (useHelper)
|
||||||
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("autoDisableAll"),
|
||||||
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
|
else
|
||||||
|
status = netctlCommand->autoDisableAllProfiles();
|
||||||
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
else
|
else
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
||||||
@ -274,7 +301,17 @@ void NetctlAutoWindow::netctlAutoEnableProfile()
|
|||||||
return;
|
return;
|
||||||
ui->tableWidget->setDisabled(true);
|
ui->tableWidget->setDisabled(true);
|
||||||
QString profile = ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 0)->text();
|
QString profile = ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 0)->text();
|
||||||
if (netctlCommand->autoEnableProfile(profile))
|
bool status = false;
|
||||||
|
if (useHelper) {
|
||||||
|
QList<QVariant> args;
|
||||||
|
args.append(profile);
|
||||||
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("autoEnable"),
|
||||||
|
args, true, debug)[0].toBool();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
status = netctlCommand->autoEnableProfile(profile);
|
||||||
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
else
|
else
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
||||||
@ -288,7 +325,14 @@ void NetctlAutoWindow::netctlAutoEnableAllProfiles()
|
|||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoEnableAllProfiles]";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoEnableAllProfiles]";
|
||||||
|
|
||||||
ui->tableWidget->setDisabled(true);
|
ui->tableWidget->setDisabled(true);
|
||||||
if (netctlCommand->autoEnableAllProfiles())
|
bool status = false;
|
||||||
|
if (useHelper)
|
||||||
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("autoEnableAll"),
|
||||||
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
|
else
|
||||||
|
status = netctlCommand->autoEnableAllProfiles();
|
||||||
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
else
|
else
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
||||||
@ -305,7 +349,17 @@ void NetctlAutoWindow::netctlAutoStartProfile()
|
|||||||
return;
|
return;
|
||||||
ui->tableWidget->setDisabled(true);
|
ui->tableWidget->setDisabled(true);
|
||||||
QString profile = ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 0)->text();
|
QString profile = ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 0)->text();
|
||||||
if (netctlCommand->autoStartProfile(profile))
|
bool status = false;
|
||||||
|
if (useHelper) {
|
||||||
|
QList<QVariant> args;
|
||||||
|
args.append(profile);
|
||||||
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("autoStart"),
|
||||||
|
args, true, debug)[0].toBool();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
status = netctlCommand->autoStartProfile(profile);
|
||||||
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
else
|
else
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
||||||
@ -318,7 +372,14 @@ void NetctlAutoWindow::netctlAutoEnableService()
|
|||||||
{
|
{
|
||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoEnableService]";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoEnableService]";
|
||||||
|
|
||||||
if (netctlCommand->autoEnableService())
|
bool status = false;
|
||||||
|
if (useHelper)
|
||||||
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("autoServiceEnable"),
|
||||||
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
|
else
|
||||||
|
status = netctlCommand->autoEnableService();
|
||||||
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
else
|
else
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
||||||
@ -331,7 +392,14 @@ void NetctlAutoWindow::netctlAutoRestartService()
|
|||||||
{
|
{
|
||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoRestartService]";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoRestartService]";
|
||||||
|
|
||||||
if (netctlCommand->autoRestartService())
|
bool status = false;
|
||||||
|
if (useHelper)
|
||||||
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("autoServiceRestart"),
|
||||||
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
|
else
|
||||||
|
status = netctlCommand->autoRestartService();
|
||||||
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
else
|
else
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
||||||
@ -344,7 +412,14 @@ void NetctlAutoWindow::netctlAutoStartService()
|
|||||||
{
|
{
|
||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoStartService]";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoStartService]";
|
||||||
|
|
||||||
if (netctlCommand->autoStartService())
|
bool status = false;
|
||||||
|
if (useHelper)
|
||||||
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CONTROL_PATH,
|
||||||
|
DBUS_HELPER_INTERFACE, QString("autoServiceStart"),
|
||||||
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
|
else
|
||||||
|
status = netctlCommand->autoStartService();
|
||||||
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
else
|
else
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Error"));
|
||||||
|
Loading…
Reference in New Issue
Block a user