rewrite ui part (except for privateslots)

This commit is contained in:
arcan1s 2015-02-28 04:05:34 +03:00
parent e70ebe318d
commit 1333967535
19 changed files with 181 additions and 262 deletions

View File

@ -30,7 +30,7 @@ QList<netctlProfileInfo> parseOutputNetctl(const QList<QVariant> raw,
if (debug) qDebug() << PDEBUG;
QList<netctlProfileInfo> profileInfo;
if (raw.size() == 0) return profileInfo;
if (raw.count() == 0) return profileInfo;
QStringList list = raw[0].toStringList();
for (int i=0; i<list.count(); i++) {
QStringList info = list[i].split(QChar('|'));
@ -53,7 +53,7 @@ QList<netctlWifiInfo> parseOutputWifi(const QList<QVariant> raw,
if (debug) qDebug() << PDEBUG;
QList<netctlWifiInfo> wifiInfo;
if (raw.size() == 0) return wifiInfo;
if (raw.count() == 0) return wifiInfo;
QStringList list = raw[0].toStringList();
for (int i=0; i<list.count(); i++) {
QStringList info = list[i].split(QChar('|'));
@ -84,23 +84,14 @@ QList<QVariant> sendDBusRequest(const QString service, const QString path,
if (debug) qDebug() << PDEBUG << ":" << "args" << args;
if (debug) qDebug() << PDEBUG << ":" << "is system bus" << system;
QList<QVariant> arguments;
QDBusMessage response;
if (system) {
QDBusConnection bus = QDBusConnection::systemBus();
QDBusMessage request = QDBusMessage::createMethodCall(service, path, interface, cmd);
if (!args.isEmpty())
request.setArguments(args);
response = bus.call(request, QDBus::BlockWithGui);
} else {
QDBusConnection bus = QDBusConnection::sessionBus();
QDBusMessage request = QDBusMessage::createMethodCall(service, path, interface, cmd);
if (!args.isEmpty())
request.setArguments(args);
response = bus.call(request, QDBus::BlockWithGui);
}
arguments = response.arguments();
if (arguments.size() == 0)
QDBusConnection bus = QDBusConnection::sessionBus();
if (system)
bus = QDBusConnection::systemBus();
QDBusMessage request = QDBusMessage::createMethodCall(service, path, interface, cmd);
if (!args.isEmpty()) request.setArguments(args);
QDBusMessage response = bus.call(request, QDBus::BlockWithGui);
QList<QVariant> arguments = response.arguments();
if (arguments.count() == 0)
if (debug) qDebug() << PDEBUG << ":" << "Error message" << response.errorMessage();
return arguments;

View File

@ -108,7 +108,7 @@ void IpWidget::createActions()
connect(ui->lineEdit_ipAddress, SIGNAL(returnPressed()), this, SLOT(addIp()));
connect(ui->pushButton_ipRoutes, SIGNAL(clicked(bool)), this, SLOT(addIpRoutes()));
connect(ui->pushButton_ipAddress6, SIGNAL(clicked(bool)), this, SLOT(addIp6()));
connect(ui->lineEdit_ipAddress6, SIGNAL(returnPressed(bool)), this, SLOT(addIp6()));
connect(ui->lineEdit_ipAddress6, SIGNAL(returnPressed()), this, SLOT(addIp6()));
connect(ui->pushButton_ipRoutes6, SIGNAL(clicked(bool)), this, SLOT(addIpRoutes6()));
connect(ui->pushButton_custom, SIGNAL(clicked(bool)), this, SLOT(addCustom()));
connect(ui->lineEdit_custom, SIGNAL(returnPressed()), this, SLOT(addCustom()));

View File

@ -137,11 +137,11 @@ int main(int argc, char *argv[])
(args[QString("error")].toBool()))
args[QString("detached")] = false;
if (args[QString("essid")].toString() != QString("ESSID"))
args[QString("tab")] = (int) 3;
args[QString("tab")] = static_cast<int>(3);
if (args[QString("open")].toString() != QString("PROFILE"))
args[QString("tab")] = (int) 2;
args[QString("tab")] = static_cast<int>(2);
if (args[QString("select")].toString() != QString("PROFILE"))
args[QString("tab")] = (int) 1;
args[QString("tab")] = static_cast<int>(1);
// detach from console
if (args[QString("detached")].toBool())
@ -162,7 +162,7 @@ int main(int argc, char *argv[])
if (args[QString("error")].toBool()) {
cout << errorMessage().toUtf8().data() << endl;
cout << helpMessage().toUtf8().data();
return 127;
return 1;
} else if (args[QString("help")].toBool()) {
cout << helpMessage().toUtf8().data();
return 0;

View File

@ -353,15 +353,15 @@ void MainWindow::mainTabContextualMenu(const QPoint &pos)
// create menu
QMenu menu(this);
QAction *refreshTable = menu.addAction(QApplication::translate("MainWindow", "Refresh"));
refreshTable->setIcon(QIcon::fromTheme("stock-refresh"));
refreshTable->setIcon(QIcon::fromTheme("view-refresh"));
menu.addSeparator();
QAction *startProfile = menu.addAction(QApplication::translate("MainWindow", "Start profile"));
QAction *restartProfile = menu.addAction(QApplication::translate("MainWindow", "Restart profile"));
restartProfile->setIcon(QIcon::fromTheme("stock-refresh"));
restartProfile->setIcon(QIcon::fromTheme("view-refresh"));
QAction *enableProfile = menu.addAction(QApplication::translate("MainWindow", "Enable profile"));
menu.addSeparator();
QAction *editProfile = menu.addAction(QApplication::translate("MainWindow", "Edit profile"));
editProfile->setIcon(QIcon::fromTheme("edit"));
editProfile->setIcon(QIcon::fromTheme("document-edit"));
QAction *removeProfile = menu.addAction(QApplication::translate("MainWindow", "Remove profile"));
removeProfile->setIcon(QIcon::fromTheme("edit-delete"));
@ -899,7 +899,7 @@ void MainWindow::wifiTabContextualMenu(const QPoint &pos)
// create menu
QMenu menu(this);
QAction *refreshTable = menu.addAction(QApplication::translate("MainWindow", "Refresh"));
refreshTable->setIcon(QIcon::fromTheme("stock-refresh"));
refreshTable->setIcon(QIcon::fromTheme("view-refresh"));
menu.addSeparator();
QAction *startWifi = menu.addAction(QApplication::translate("MainWindow", "Start WiFi"));

View File

@ -94,9 +94,13 @@ bool MainWindow::enableProfileSlot(const QString profile)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Enable"),
args, true, debug);
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileEnabled"),
args, true, debug)[0].toBool();
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileEnabled"),
args, true, debug);
if (responce.isEmpty())
current = netctlCommand->isProfileEnabled(profile);
else
current = responce[0].toBool();
} else {
netctlCommand->enableProfile(profile);
current = netctlCommand->isProfileEnabled(profile);
@ -118,9 +122,13 @@ bool MainWindow::restartProfileSlot(const QString profile)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Restart"),
args, true, debug)[0].toBool();
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug)[0].toBool();
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug);
if (responce.isEmpty())
current = netctlCommand->isProfileActive(profile);
else
current = responce[0].toBool();
} else {
netctlCommand->restartProfile(profile);
current = netctlCommand->isProfileActive(profile);
@ -139,10 +147,11 @@ bool MainWindow::startProfileSlot(const QString profile)
if (useHelper) {
QList<QVariant> args;
args.append(profile);
QStringList currentProfile = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("ActiveProfile"),
QList<QVariant>(), true, debug)[0]
.toString().split(QChar('|'));
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("ActiveProfile"),
QList<QVariant>(), true, debug);
QStringList currentProfile;
if (!responce.isEmpty()) currentProfile = responce[0].toString().split(QChar('|'));
if ((currentProfile.isEmpty()) || (currentProfile.contains(profile)))
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Start"),
@ -151,9 +160,13 @@ bool MainWindow::startProfileSlot(const QString profile)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("SwitchTo"),
args, true, debug);
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug)[0].toBool();
responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug);
if (responce.isEmpty())
current = netctlCommand->isProfileActive(profile);
else
current = responce[0].toBool();
} else {
QStringList currentProfile = netctlCommand->getActiveProfile();
if ((currentProfile.isEmpty()) || (currentProfile.contains(profile)))
@ -188,11 +201,12 @@ bool MainWindow::switchToProfileSlot(const QString profile)
if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile;
bool netctlAutoStatus = false;
if (useHelper)
netctlAutoStatus = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isNetctlAutoActive"),
QList<QVariant>(), true, debug)[0].toBool();
else
if (useHelper) {
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isNetctlAutoActive"),
QList<QVariant>(), true, debug);
if (!responce.isEmpty()) netctlAutoStatus = responce[0].toBool();
} else
netctlAutoStatus = netctlCommand->isNetctlAutoRunning();
bool current;
@ -203,9 +217,13 @@ bool MainWindow::switchToProfileSlot(const QString profile)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("autoStart"),
args, true, debug);
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("autoIsProfileActive"),
args, true, debug)[0].toBool();
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("autoIsProfileActive"),
args, true, debug);
if (responce.isEmpty())
current = netctlCommand->autoIsProfileActive(profile);
else
current = responce[0].toBool();
} else {
netctlCommand->autoStartProfile(profile);
current = netctlCommand->autoIsProfileActive(profile);
@ -217,9 +235,13 @@ bool MainWindow::switchToProfileSlot(const QString profile)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("SwitchTo"),
args, true, debug);
current = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug)[0].toBool();
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug);
if (responce.isEmpty())
current = netctlCommand->isProfileActive(profile);
else
current = responce[0].toBool();
} else {
netctlCommand->switchToProfile(profile);
current = netctlCommand->isProfileActive(profile);
@ -272,17 +294,14 @@ bool MainWindow::forceStartHelper()
return false;
}
QString cmd = configuration[QString("HELPER_PATH")] + QString(" -c ") + configPath;
QString cmd = QString("%1 -c %2").arg(configuration[QString("HELPER_PATH")]).arg(configPath);
if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd;
TaskResult process = runTask(cmd, false);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
if (process.exitCode == 0)
return true;
else
return false;
return (process.exitCode == 0);
}
@ -314,15 +333,7 @@ void MainWindow::setTab(int tab)
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Update tab" << tab;
switch (tab) {
case 0:
case 1:
case 2:
break;
default:
tab = 0;
break;
}
if (tab > 2) tab = 0;
ui->tabWidget->setCurrentIndex(tab);
updateTabs(tab);
@ -353,9 +364,8 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
// update translation
qApp->removeTranslator(translator);
QString language = Language::defineLanguage(configPath,
args[QString("options")].toString());
qtTranslator->load(QString("qt_") + language, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QString language = Language::defineLanguage(configPath, args[QString("options")].toString());
qtTranslator->load(QString("qt_%1").arg(language), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
qApp->installTranslator(qtTranslator);
translator->load(QString(":/translations/") + language);
qApp->installTranslator(translator);
@ -366,7 +376,7 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
// tray
if ((QSystemTrayIcon::isSystemTrayAvailable()) &&
(configuration[QString("SYSTRAY")] == QString("true")))
(configuration[QString("SYSTRAY")] == QString("true")))
trayIcon->setVisible(true);
else
trayIcon->setVisible(false);
@ -423,14 +433,17 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
{
if (debug) qDebug() << PDEBUG;
if (passwdWid != 0)
delete passwdWid;
if (passwdWid != nullptr) delete passwdWid;
QStringList interfaces;
if (useHelper)
interfaces = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("WirelessInterfaces"),
QList<QVariant>(), true, debug)[0].toStringList();
else
if (useHelper) {
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("WirelessInterfaces"),
QList<QVariant>(), true, debug);
if (responce.isEmpty())
interfaces = netctlCommand->getWirelessInterfaceList();
else
interfaces = responce[0].toStringList();
} else
interfaces = netctlCommand->getWirelessInterfaceList();
if (interfaces.isEmpty()) return;
@ -445,11 +458,9 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
settings[QString("Security")] = QString("wep");
else
settings[QString("Security")] = QString("none");
settings[QString("ESSID")] = QString("'") +
ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 0)->text() +
QString("'");
settings[QString("ESSID")] = QString("'%1'").arg(ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 0)->text());
if (!passwd.isEmpty())
settings[QString("Key")] = QString("'") + passwd + QString("'");
settings[QString("Key")] = QString("'%1'").arg(passwd);
settings[QString("IP")] = QString("dhcp");
if (hiddenNetwork)
settings[QString("Hidden")] = QString("yes");
@ -460,7 +471,7 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
if (useHelper) {
QStringList settingsList;
for (int i=0; i<settings.keys().count(); i++)
settingsList.append(settings.keys()[i] + QString("==") + settings[settings.keys()[i]]);
settingsList.append(QString("%1==%2").arg(settings.keys()[i]).arg(settings[settings.keys()[i]]));
QList<QVariant> args;
args.append(profile);
args.append(settingsList);
@ -472,9 +483,13 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Start"),
args, true, debug);
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug)[0].toBool();
QList<QVariant> responce = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("isProfileActive"),
args, true, debug);
if (responce.isEmpty())
status = netctlCommand->isProfileActive(profile);
else
status = responce[0].toBool();
} else {
QString profileTempName = netctlProfile->createProfile(profile, settings);
netctlProfile->copyProfile(profileTempName);
@ -503,7 +518,7 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
args.append(profile);
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
DBUS_HELPER_INTERFACE, QString("Remove"),
args, true, debug)[0].toBool();
args, true, debug);
} else
netctlProfile->removeProfile(profile);
break;

View File

@ -21,6 +21,7 @@
#include <QDBusConnection>
#include <QDBusMessage>
#include <QDebug>
#include <QLineEdit>
#include <QMenu>
#include <pdebug/pdebug.h>
@ -79,7 +80,7 @@ MainWindow::MainWindow(QWidget *parent,
for (int i=0; i<ui->tableWidget_wifi->rowCount(); i++)
if (ui->tableWidget_wifi->item(i, 0)->text() == args[QString("essid")].toString())
ui->tableWidget_wifi->setCurrentCell(i, 0);
if (ui->tableWidget_wifi->currentItem() == 0)
if (ui->tableWidget_wifi->currentItem() == nullptr)
ErrorWindow::showWindow(18, QString(PDEBUG), debug);
} else if (args[QString("open")].toString() != QString("PROFILE")) {
ui->comboBox_profile->addItem(args[QString("open")].toString());
@ -88,7 +89,7 @@ MainWindow::MainWindow(QWidget *parent,
for (int i=0; i<ui->tableWidget_main->rowCount(); i++)
if (ui->tableWidget_main->item(i, 0)->text() == args[QString("select")].toString())
ui->tableWidget_main->setCurrentCell(i, 0);
if (ui->tableWidget_main->currentItem() == 0)
if (ui->tableWidget_main->currentItem() == nullptr)
ErrorWindow::showWindow(17, QString(PDEBUG), debug);
}
@ -118,30 +119,28 @@ QStringList MainWindow::printInformation()
{
if (debug) qDebug() << PDEBUG;
QString profile;
QString status;
QStringList output;
output.append(QString("none"));
output.append(QString("(none)"));
if (useHelper) {
QStringList request = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
DBUS_HELPER_INTERFACE, QString("Information"),
QList<QVariant>(), true, debug)[0].toStringList();
profile = request[0];
status = request[1];
if (request.count() != 2) return output;
output = request;
} else {
if (netctlCommand->isNetctlAutoRunning()) {
profile = netctlCommand->autoGetActiveProfile();
status = QString("netctl-auto");
output[0] = netctlCommand->autoGetActiveProfile();
output[1] = QString("netctl-auto");
} else {
QStringList currentProfiles = netctlCommand->getActiveProfile();
profile = currentProfiles.join(QChar('|'));
output[0] = currentProfiles.join(QChar('|'));
QStringList statusList;
for (int i=0; i<currentProfiles.count(); i++)
statusList.append(netctlCommand->getProfileStatus(currentProfiles[i]));
status = statusList.join(QChar('|'));
output[1] = statusList.join(QChar('|'));
}
}
QStringList output;
output.append(profile);
output.append(status);
return output;
}
@ -153,8 +152,7 @@ QStringList MainWindow::printSettings()
QStringList settingsList;
for (int i=0; i<configuration.keys().count(); i++)
settingsList.append(configuration.keys()[i] + QString("==") +
configuration[configuration.keys()[i]]);
settingsList.append(QString("%1==%2").arg(configuration.keys()[i]).arg(configuration[configuration.keys()[i]]));
return settingsList;
}
@ -243,18 +241,15 @@ bool MainWindow::isHelperServiceActive()
{
if (debug) qDebug() << PDEBUG;
QString cmd = configuration[QString("SYSTEMCTL_PATH")] + QString(" is-active ") +
configuration[QString("HELPER_SERVICE")];
QString cmd = QString("%1 is-active %2").arg(configuration[QString("SYSTEMCTL_PATH")])
.arg(configuration[QString("HELPER_SERVICE")]);
if (debug) qDebug() << PDEBUG << "Run cmd" << cmd;
TaskResult process = runTask(cmd, false);
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
if (process.exitCode != 0)
return false;
else
return true;
return (process.exitCode == 0);
}
@ -262,8 +257,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
{
if (debug) qDebug() << PDEBUG;
if ((QSystemTrayIcon::isSystemTrayAvailable()) &&
(configuration[QString("SYSTRAY")] == QString("true"))) {
if ((QSystemTrayIcon::isSystemTrayAvailable()) && (configuration[QString("SYSTRAY")] == QString("true"))) {
hide();
event->ignore();
} else
@ -305,10 +299,7 @@ bool MainWindow::checkExternalApps(const QString apps = QString("all"))
if (process.exitCode != 0)
if (debug) qDebug() << PDEBUG << ":" << "Error" << process.error;
if (process.exitCode != 0)
return false;
else
return true;
return (process.exitCode == 0);
}
@ -334,14 +325,12 @@ QString MainWindow::checkStatus(const bool statusBool, const bool nullFalse)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Status" << statusBool;
if (debug) qDebug() << PDEBUG << ":" << "Return null false" << nullFalse;
if (debug) qDebug() << PDEBUG << ":" << "Return null on false" << nullFalse;
if (statusBool)
return QApplication::translate("MainWindow", "yes");
if (nullFalse)
return QString("");
else
return QApplication::translate("MainWindow", "no");
if (statusBool) return QApplication::translate("MainWindow", "yes");
if (!nullFalse) return QApplication::translate("MainWindow", "no");
return QString("");
}
@ -372,6 +361,7 @@ void MainWindow::createActions()
// profile tab events
connect(ui->comboBox_profile, SIGNAL(currentIndexChanged(QString)), this, SLOT(profileTabLoadProfile()));
connect(ui->comboBox_profile, SIGNAL(editTextChanged(QString)), this, SLOT(updateMenuProfile()));
connect(ui->comboBox_profile->lineEdit(), SIGNAL(returnPressed()), this, SLOT(profileTabLoadProfile()));
connect(generalWid->connectionType, SIGNAL(currentIndexChanged(QString)), this, SLOT(profileTabChangeState(QString)));
// wifi tab events
@ -406,11 +396,10 @@ void MainWindow::createObjects()
// backend
createDBusSession();
if (useHelper)
if (!forceStartHelper()) {
ErrorWindow::showWindow(19, QString(PDEBUG), debug);
useHelper = false;
}
if ((useHelper) && (!forceStartHelper())) {
ErrorWindow::showWindow(19, QString(PDEBUG), debug);
useHelper = false;
}
checkHelperStatus();
netctlCommand = new Netctl(debug, configuration);
@ -462,13 +451,13 @@ void MainWindow::createToolBars()
actionToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
toolBarActions[QString("netctlAuto")] = actionToolBar->addAction(QApplication::translate("MainWindow", "netctl-auto"),
this, SLOT(showNetctlAutoWindow()));
toolBarActions[QString("mainRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("stock-refresh")),
toolBarActions[QString("mainRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("view-refresh")),
QApplication::translate("MainWindow", "Refresh"),
this, SLOT(updateMainTab()));
toolBarActions[QString("profileClear")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-clear")),
QApplication::translate("MainWindow", "Clear"),
this, SLOT(profileTabClear()));
toolBarActions[QString("wifiRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("stock-refresh")),
toolBarActions[QString("wifiRefresh")] = actionToolBar->addAction(QIcon::fromTheme(QString("view-refresh")),
QApplication::translate("MainWindow", "Refresh"),
this, SLOT(updateWifiTab()));
@ -482,7 +471,7 @@ void MainWindow::createToolBars()
toolBarActions[QString("mainSwitch")] = menu->addAction(QIcon::fromTheme(QString("system-run")),
QApplication::translate("MainWindow", "Switch"),
this, SLOT(mainTabSwitchToProfile()));
toolBarActions[QString("mainRestart")] = menu->addAction(QIcon::fromTheme(QString("stock-refresh")),
toolBarActions[QString("mainRestart")] = menu->addAction(QIcon::fromTheme(QString("view-refresh")),
QApplication::translate("MainWindow", "Restart"),
this, SLOT(mainTabRestartProfile()));
toolBarActions[QString("mainEnable")] = menu->addAction(QIcon::fromTheme(QString("edit-add")),
@ -503,7 +492,7 @@ void MainWindow::createToolBars()
actionMenu->setMenu(menu);
actionToolBar->addWidget(actionMenu);
toolBarActions[QString("mainEdit")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit")),
toolBarActions[QString("mainEdit")] = actionToolBar->addAction(QIcon::fromTheme(QString("document-edit")),
QApplication::translate("MainWindow", "Edit"),
this, SLOT(mainTabEditProfile()));
toolBarActions[QString("mainRemove")] = actionToolBar->addAction(QIcon::fromTheme(QString("edit-delete")),
@ -554,16 +543,6 @@ void MainWindow::deleteObjects()
}
void MainWindow::keyPressEvent(QKeyEvent *pressedKey)
{
if (debug) qDebug() << PDEBUG;
if (pressedKey->key() == Qt::Key_Return)
if (ui->comboBox_profile->hasFocus())
profileTabLoadProfile();
}
QMap<QString, QString> MainWindow::parseOptions(const QString options)
{
if (debug) qDebug() << PDEBUG;

View File

@ -167,7 +167,6 @@ private:
void createObjects();
void createToolBars();
void deleteObjects();
void keyPressEvent(QKeyEvent *pressedKey);
QString configPath;
bool debug = false;
bool hiddenNetwork;

View File

@ -34,7 +34,7 @@ QMap<QString, QVariant> getArgs()
QMap<QString, QVariant> args;
// windows
args[QString("detached")] = false;
args[QString("minimized")] = (int) 0;
args[QString("minimized")] = static_cast<int>(0);
args[QString("about")] = false;
args[QString("auto")] = false;
args[QString("settings")] = false;
@ -43,11 +43,11 @@ QMap<QString, QVariant> getArgs()
args[QString("open")] = QString("PROFILE");
args[QString("select")] = QString("PROFILE");
// additional functions
args[QString("config")] = QString(QDir::homePath() + QString("/.config/netctl-gui.conf"));
args[QString("config")] = QString("%1/.config/netctl-gui.conf").arg(QDir::homePath());
args[QString("debug")] = false;
args[QString("defaults")] = false;
args[QString("options")] = QString("OPTIONS");
args[QString("tab")] = (int) 1;
args[QString("tab")] = static_cast<int>(1);
// messages
args[QString("error")] = false;
args[QString("help")] = false;
@ -66,46 +66,29 @@ QString helpMessage()
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Options:"));
// windows
helpMessage += QString(" %1\n").arg(QApplication::translate("MainWindow", "Open window:"));
helpMessage += QString(" --detached - %1\n")
.arg(QApplication::translate("MainWindow", "start detached from console"));
helpMessage += QString(" --maximized - %1\n")
.arg(QApplication::translate("MainWindow", "start maximized"));
helpMessage += QString(" --minimized - %1\n")
.arg(QApplication::translate("MainWindow", "start minimized to tray"));
helpMessage += QString(" --about - %1\n")
.arg(QApplication::translate("MainWindow", "show about window"));
helpMessage += QString(" --netctl-auto - %1\n")
.arg(QApplication::translate("MainWindow", "show netctl-auto window"));
helpMessage += QString(" --settings - %1\n")
.arg(QApplication::translate("MainWindow", "show settings window"));
helpMessage += QString(" --detached - %1\n").arg(QApplication::translate("MainWindow", "start detached from console"));
helpMessage += QString(" --maximized - %1\n").arg(QApplication::translate("MainWindow", "start maximized"));
helpMessage += QString(" --minimized - %1\n").arg(QApplication::translate("MainWindow", "start minimized to tray"));
helpMessage += QString(" --about - %1\n").arg(QApplication::translate("MainWindow", "show about window"));
helpMessage += QString(" --netctl-auto - %1\n").arg(QApplication::translate("MainWindow", "show netctl-auto window"));
helpMessage += QString(" --settings - %1\n").arg(QApplication::translate("MainWindow", "show settings window"));
// main functions
helpMessage += QString(" %1\n").arg(QApplication::translate("MainWindow", "Functions:"));
helpMessage += QString(" -e, --essid <arg> - %1\n")
.arg(QApplication::translate("MainWindow", "select this ESSID"));
helpMessage += QString(" -o, --open <arg> - %1\n")
.arg(QApplication::translate("MainWindow", "open this profile"));
helpMessage += QString(" -s, --select <arg> - %1\n")
.arg(QApplication::translate("MainWindow", "select this profile"));
helpMessage += QString(" -e, --essid <arg> - %1\n").arg(QApplication::translate("MainWindow", "select this ESSID"));
helpMessage += QString(" -o, --open <arg> - %1\n").arg(QApplication::translate("MainWindow", "open this profile"));
helpMessage += QString(" -s, --select <arg> - %1\n").arg(QApplication::translate("MainWindow", "select this profile"));
// additional functions
helpMessage += QString(" %1\n").arg(QApplication::translate("MainWindow", "Additional flags:"));
helpMessage += QString(" -c, --config <arg> - %1\n")
.arg(QApplication::translate("MainWindow", "read configuration from this file"));
helpMessage += QString(" -d, --debug - %1\n")
.arg(QApplication::translate("MainWindow", "print debug information"));
helpMessage += QString(" --default - %1\n")
.arg(QApplication::translate("MainWindow", "start with default settings"));
helpMessage += QString(" --set-opts <arg> - %1\n")
.arg(QApplication::translate("MainWindow", "set options for this run, comma separated"));
helpMessage += QString(" -t, --tab <arg> - %1\n")
.arg(QApplication::translate("MainWindow", "open a tab with this number"));
helpMessage += QString(" -c, --config <arg> - %1\n").arg(QApplication::translate("MainWindow", "read configuration from this file"));
helpMessage += QString(" -d, --debug - %1\n").arg(QApplication::translate("MainWindow", "print debug information"));
helpMessage += QString(" --default - %1\n").arg(QApplication::translate("MainWindow", "start with default settings"));
helpMessage += QString(" --set-opts <arg> - %1\n").arg(QApplication::translate("MainWindow", "set options for this run, comma separated"));
helpMessage += QString(" -t, --tab <arg> - %1\n").arg(QApplication::translate("MainWindow", "open a tab with this number"));
// messages
helpMessage += QString(" %1\n").arg(QApplication::translate("MainWindow", "Show messages:"));
helpMessage += QString(" -v, --version - %1\n")
.arg(QApplication::translate("MainWindow", "show version and exit"));
helpMessage += QString(" -i, --info - %1\n")
.arg(QApplication::translate("MainWindow", "show build information and exit"));
helpMessage += QString(" -h, --help - %1\n")
.arg(QApplication::translate("MainWindow", "show this help and exit"));
helpMessage += QString(" -v, --version - %1\n").arg(QApplication::translate("MainWindow", "show version and exit"));
helpMessage += QString(" -i, --info - %1\n").arg(QApplication::translate("MainWindow", "show build information and exit"));
helpMessage += QString(" -h, --help - %1\n").arg(QApplication::translate("MainWindow", "show this help and exit"));
return helpMessage;
}
@ -115,8 +98,7 @@ QString infoMessage()
{
QString infoMessage = QString("");
// build information
infoMessage += QApplication::translate("MainWindow", "Build date: %1").
arg(QString(BUILD_DATE));
infoMessage += QApplication::translate("MainWindow", "Build date: %1").arg(QString(BUILD_DATE));
// cmake
infoMessage += QString("\n%1:\n").arg(QApplication::translate("MainWindow", "cmake flags"));
// cmake properties
@ -162,15 +144,9 @@ QString versionMessage()
{
QString versionMessage = QString("");
versionMessage += QString("%1\n").arg(QString(NAME));
versionMessage += QString("%1 : %2\n")
.arg(QApplication::translate("MainWindow", "Version"))
.arg(QString(VERSION));
versionMessage += QString("%1 : %2\n")
.arg(QApplication::translate("MainWindow", "Author"))
.arg(QString(AUTHOR));
versionMessage += QString("%1 : %2\n")
.arg(QApplication::translate("MainWindow", "License"))
.arg(QString(LICENSE));
versionMessage += QString("%1 : %2\n").arg(QApplication::translate("MainWindow", "Version")).arg(QString(VERSION));
versionMessage += QString("%1 : %2\n").arg(QApplication::translate("MainWindow", "Author")).arg(QString(AUTHOR));
versionMessage += QString("%1 : %2\n").arg(QApplication::translate("MainWindow", "License")).arg(QString(LICENSE));
return versionMessage;
}

View File

@ -70,7 +70,7 @@
<string>Refresh</string>
</property>
<property name="icon">
<iconset theme="stock-refresh">
<iconset theme="view-refresh">
<normaloff/>
</iconset>
</property>
@ -223,7 +223,7 @@
</action>
<action name="actionRefresh">
<property name="icon">
<iconset theme="stock-refresh">
<iconset theme="view-refresh">
<normaloff/>
</iconset>
</property>

View File

@ -70,8 +70,7 @@ QString NetctlGuiAdaptor::Pony()
{
QString pony;
QFile ponyFile(QString(":pinkiepie"));
if (!ponyFile.open(QIODevice::ReadOnly))
return pony;
if (!ponyFile.open(QIODevice::ReadOnly)) return pony;
pony = QTextCodec::codecForMib(106)->toUnicode(ponyFile.readAll());
ponyFile.close();

View File

@ -177,13 +177,8 @@ void SettingsWindow::setTray()
{
if (debug) qDebug() << PDEBUG;
if (ui->checkBox_enableTray->checkState() == 0) {
ui->checkBox_closeToTray->setDisabled(true);
ui->checkBox_startToTray->setDisabled(true);
} else if (ui->checkBox_enableTray->checkState() == 2) {
ui->checkBox_closeToTray->setEnabled(true);
ui->checkBox_startToTray->setEnabled(true);
}
ui->checkBox_closeToTray->setDisabled(ui->checkBox_enableTray->checkState() == 0);
ui->checkBox_startToTray->setDisabled(ui->checkBox_enableTray->checkState() == 0);
}
@ -328,8 +323,7 @@ QMap<QString, QString> SettingsWindow::readSettings()
config[QString("WPA_DRIVERS")] = ui->lineEdit_wpaSupDrivers->text();
for (int i=0; i<config.keys().count(); i++)
if (debug) qDebug() << PDEBUG << ":" << config.keys()[i] + QString("=") +
config[config.keys()[i]];
if (debug) qDebug() << PDEBUG << ":" << QString("%1=%2").arg(config.keys()[i]).arg(config[config.keys()[i]]);
return config;
}
@ -356,12 +350,8 @@ void SettingsWindow::setSettings(const QMap<QString, QString> config)
ui->lineEdit_helperPath->setText(config[QString("HELPER_PATH")]);
ui->lineEdit_helperService->setText(config[QString("HELPER_SERVICE")]);
ui->lineEdit_interfacesDir->setText(config[QString("IFACE_DIR")]);
ui->comboBox_language->setCurrentIndex(0);
for (int i=0; i<ui->comboBox_language->count(); i++)
if (ui->comboBox_language->itemText(i) == config[QString("LANGUAGE")]) {
ui->comboBox_language->setCurrentIndex(i);
break;
}
int index = ui->comboBox_language->findText(config[QString("LANGUAGE")]);
ui->comboBox_language->setCurrentIndex(index);
ui->lineEdit_netctlPath->setText(config[QString("NETCTL_PATH")]);
ui->lineEdit_netctlAutoPath->setText(config[QString("NETCTLAUTO_PATH")]);
ui->lineEdit_netctlAutoService->setText(config[QString("NETCTLAUTO_SERVICE")]);
@ -392,8 +382,7 @@ void SettingsWindow::setSettings(const QMap<QString, QString> config)
ui->lineEdit_wpaSupDrivers->setText(config[QString("WPA_DRIVERS")]);
for (int i=0; i<config.keys().count(); i++)
if (debug) qDebug() << PDEBUG << ":" << config.keys()[i] + QString("=") +
config[config.keys()[i]];
if (debug) qDebug() << PDEBUG << ":" << QString("%1=%2").arg(config.keys()[i]).arg(config[config.keys()[i]]);
}
@ -458,8 +447,7 @@ QMap<QString, QString> SettingsWindow::getSettings(QString fileName)
settings.endGroup();
for (int i=0; i<config.keys().count(); i++)
if (debug) qDebug() << PDEBUG << ":" << config.keys()[i] + QString("=") +
config[config.keys()[i]];
if (debug) qDebug() << PDEBUG << ":" << QString("%1=%2").arg(config.keys()[i]).arg(config[config.keys()[i]]);
return config;
}

View File

@ -202,7 +202,7 @@ void TrayIcon::createActions()
connect(switchToProfileMenu, SIGNAL(triggered(QAction *)), this, SLOT(switchToProfileSlot(QAction *)));
menuActions->addAction(contextMenu[QString("switch")]);
contextMenu[QString("restart")] = new QAction(QIcon::fromTheme("stock-refresh"), QApplication::translate("TrayIcon", "Restart profile"), this);
contextMenu[QString("restart")] = new QAction(QIcon::fromTheme("view-refresh"), QApplication::translate("TrayIcon", "Restart profile"), this);
connect(contextMenu[QString("restart")], SIGNAL(triggered(bool)), this, SLOT(restartProfileSlot()));
menuActions->addAction(contextMenu[QString("restart")]);

View File

@ -68,9 +68,7 @@ void WirelessWidget::clear()
if (rfkillDirectory->exists()) {
QStringList rfkillDevices = rfkillDirectory->entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for (int i=0; i<rfkillDevices.count(); i++) {
QFile device(QString("%1%2%3%2name").arg(rfkillDirectory->absolutePath())
.arg(QDir::separator())
.arg(rfkillDevices[i]));
QFile device(QString("%1/%2/name").arg(rfkillDirectory->absolutePath()).arg(rfkillDevices[i]));
if (!device.open(QIODevice::ReadOnly)) continue;
ui->comboBox_rfkill->addItem(QString(device.readLine()).trimmed());
device.close();

View File

@ -120,7 +120,7 @@ int main(int argc, char *argv[])
if (args[QString("error")].toBool()) {
cout << errorMessage().toUtf8().data() << endl;
cout << helpMessage().toUtf8().data();
return 127;
return 11;
} else if (args[QString("help")].toBool()) {
cout << helpMessage().toUtf8().data();
return 0;

View File

@ -54,27 +54,17 @@ QString helpMessage()
helpMessage += QString("netctlgui-helper [ options ]\n");
helpMessage += QString("%1\n").arg(QCoreApplication::translate("NetctlHelper", "Options:"));
// windows
helpMessage += QString(" -c, --config <arg> - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "read configuration from this file"));
helpMessage += QString(" -d, --debug - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "print debug information"));
helpMessage += QString(" --nodaemon - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "do not start as daemon"));
helpMessage += QString(" --replace - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "force replace the existing session"));
helpMessage += QString(" --restore - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "force restore the existing session"));
helpMessage += QString(" --session - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "force create user DBus session"));
helpMessage += QString(" --system - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "do not read user configuration, system-wide only"));
helpMessage += QString(" -c, --config <arg> - %1\n").arg(QCoreApplication::translate("NetctlHelper", "read configuration from this file"));
helpMessage += QString(" -d, --debug - %1\n").arg(QCoreApplication::translate("NetctlHelper", "print debug information"));
helpMessage += QString(" --nodaemon - %1\n").arg(QCoreApplication::translate("NetctlHelper", "do not start as daemon"));
helpMessage += QString(" --replace - %1\n").arg(QCoreApplication::translate("NetctlHelper", "force replace the existing session"));
helpMessage += QString(" --restore - %1\n").arg(QCoreApplication::translate("NetctlHelper", "force restore the existing session"));
helpMessage += QString(" --session - %1\n").arg(QCoreApplication::translate("NetctlHelper", "force create user DBus session"));
helpMessage += QString(" --system - %1\n").arg(QCoreApplication::translate("NetctlHelper", "do not read user configuration, system-wide only"));
helpMessage += QString(" %1\n").arg(QCoreApplication::translate("NetctlHelper", "Show messages:"));
helpMessage += QString(" -v, --version - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "show version and exit"));
helpMessage += QString(" -i, --info - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "show build information and exit"));
helpMessage += QString(" -h, --help - %1\n")
.arg(QCoreApplication::translate("NetctlHelper", "show this help and exit"));
helpMessage += QString(" -v, --version - %1\n").arg(QCoreApplication::translate("NetctlHelper", "show version and exit"));
helpMessage += QString(" -i, --info - %1\n").arg(QCoreApplication::translate("NetctlHelper", "show build information and exit"));
helpMessage += QString(" -h, --help - %1\n").arg(QCoreApplication::translate("NetctlHelper", "show this help and exit"));
return helpMessage;
}
@ -131,15 +121,9 @@ QString versionMessage()
{
QString versionMessage = QString("");
versionMessage += QString("%1\n").arg(QString(NAME));
versionMessage += QString("%1 : %2\n")
.arg(QCoreApplication::translate("NetctlHelper", "Version"))
.arg(QString(VERSION));
versionMessage += QString("%1 : %2\n")
.arg(QCoreApplication::translate("NetctlHelper", "Author"))
.arg(QString(AUTHOR));
versionMessage += QString("%1 : %2\n")
.arg(QCoreApplication::translate("NetctlHelper", "License"))
.arg(QString(LICENSE));
versionMessage += QString("%1 : %2\n").arg(QCoreApplication::translate("NetctlHelper", "Version")).arg(QString(VERSION));
versionMessage += QString("%1 : %2\n").arg(QCoreApplication::translate("NetctlHelper", "Author")).arg(QString(AUTHOR));
versionMessage += QString("%1 : %2\n").arg(QCoreApplication::translate("NetctlHelper", "License")).arg(QString(LICENSE));
return versionMessage;
}

View File

@ -494,9 +494,7 @@ QStringList Netctl::getWirelessInterfaceList()
interfaces.append(mainInterface);
QStringList allInterfaces = ifaceDirectory->entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for (int i=0; i<allInterfaces.count(); i++) {
QString dir = QString("%1%2%3%2wireless").arg(ifaceDirectory->path())
.arg(QDir::separator())
.arg(allInterfaces[i]);
QString dir = QString("%1/%2/wireless").arg(ifaceDirectory->path()).arg(allInterfaces[i]);
if (debug) qDebug() << PDEBUG << ":" << "Check directory" << dir;
if (QDir(dir).exists())
interfaces.append(allInterfaces[i]);

View File

@ -80,9 +80,7 @@ bool NetctlProfile::copyProfile(const QString oldPath)
return false;
}
QString newPath = QString("%1%2%3").arg(profileDirectory->absolutePath())
.arg(QDir::separator())
.arg(QFileInfo(oldPath).fileName());
QString newPath = QString("%1/%2").arg(profileDirectory->absolutePath()).arg(QFileInfo(oldPath).fileName());
QString cmd = QString("%1 /usr/bin/mv \"%2\" \"%3\"").arg(sudoCommand)
.arg(oldPath)
.arg(newPath);
@ -104,9 +102,7 @@ QString NetctlProfile::createProfile(const QString profile, const QMap<QString,
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Profile" << profile;
QString profileTempName = QString("%1%2%3").arg(QDir::tempPath())
.arg(QDir::separator())
.arg(QFileInfo(profile).fileName());
QString profileTempName = QString("%1/%2").arg(QDir::tempPath()).arg(QFileInfo(profile).fileName());
QFile profileFile(profileTempName);
if (debug) qDebug() << PDEBUG << ":" << "Save to" << profileTempName;
if (!profileFile.open(QIODevice::WriteOnly | QIODevice::Text))
@ -215,9 +211,7 @@ QMap<QString, QString> NetctlProfile::getSettingsFromProfile(const QString profi
systemVariables.append(output[i].split(QChar('='))[0]);
// profile variables
QMap<QString, QString> settings;
QString profileUrl = QString("%1%2%3").arg(profileDirectory->absolutePath())
.arg(QDir::separator())
.arg(QFileInfo(profile).fileName());
QString profileUrl = QString("%1/%2").arg(profileDirectory->absolutePath()).arg(QFileInfo(profile).fileName());
cmd = QString("env -i bash -c \"source '%1'; set\"").arg(profileUrl);
if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd;
process = runTask(cmd, false);
@ -269,9 +263,7 @@ bool NetctlProfile::removeProfile(const QString profile)
return false;
}
QString profilePath = QString("%1%2%3").arg(profileDirectory->absolutePath())
.arg(QDir::separator())
.arg(QFileInfo(profile).fileName());
QString profilePath = QString("%1/%2").arg(profileDirectory->absolutePath()).arg(QFileInfo(profile).fileName());
QString cmd = QString("%1 /usr/bin/rm \"%2\"").arg(sudoCommand).arg(profilePath);
if (debug) qDebug() << PDEBUG << ":" << "Run cmd" << cmd;
TaskResult process = runTask(cmd, useSuid);

View File

@ -477,7 +477,7 @@ void Netctl::createActions()
menuActions.append(contextMenu[QString("switch")]);
contextMenu[QString("restart")] = new QAction(i18n("Restart profile"), this);
contextMenu[QString("restart")]->setIcon(QIcon::fromTheme("stock-refresh"));
contextMenu[QString("restart")]->setIcon(QIcon::fromTheme("view-refresh"));
connect(contextMenu[QString("restart")], SIGNAL(triggered(bool)), this, SLOT(restartProfileSlot()));
menuActions.append(contextMenu[QString("restart")]);

View File

@ -105,7 +105,7 @@ Item {
plasmoid.setAction("stopProfile", i18n("Stop profile"), "dialog-close")
plasmoid.setAction("stopAllProfiles", i18n("Stop all profiles"), "dialog-close")
plasmoid.setAction("switchToProfile", i18n("Switch to profile"))
plasmoid.setAction("restartProfile", i18n("Restart profile"), "stock-refresh")
plasmoid.setAction("restartProfile", i18n("Restart profile"), "view-refresh")
plasmoid.setAction("enableProfile", i18n("Enable profile"))
plasmoid.setAction("startWifi", i18n("Show WiFi menu"), "netctl-gui-wifi")
// helper