mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
some gui fixes
This commit is contained in:
parent
61d814d9a2
commit
f0adbb60e5
@ -88,8 +88,7 @@ QList<QVariant> sendDBusRequest(const QString service, const QString path,
|
|||||||
if (!args.isEmpty())
|
if (!args.isEmpty())
|
||||||
request.setArguments(args);
|
request.setArguments(args);
|
||||||
response = bus.call(request);
|
response = bus.call(request);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
QDBusConnection bus = QDBusConnection::sessionBus();
|
||||||
QDBusMessage request = QDBusMessage::createMethodCall(service, path, interface, cmd);
|
QDBusMessage request = QDBusMessage::createMethodCall(service, path, interface, cmd);
|
||||||
if (!args.isEmpty())
|
if (!args.isEmpty())
|
||||||
|
@ -88,8 +88,7 @@ void EthernetWidget::showAdvanced()
|
|||||||
if (ui->pushButton_ethernetAdvanced->isChecked()) {
|
if (ui->pushButton_ethernetAdvanced->isChecked()) {
|
||||||
ui->widget_ethernetAdvanced->setHidden(false);
|
ui->widget_ethernetAdvanced->setHidden(false);
|
||||||
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Hide advanced"));
|
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Hide advanced"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->widget_ethernetAdvanced->setHidden(true);
|
ui->widget_ethernetAdvanced->setHidden(true);
|
||||||
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Show advanced"));
|
ui->pushButton_ethernetAdvanced->setText(QApplication::translate("EthernetWidget", "Show advanced"));
|
||||||
}
|
}
|
||||||
|
@ -114,8 +114,7 @@ void GeneralWidget::showAdvanced()
|
|||||||
if (ui->pushButton_generalAdvanced->isChecked()) {
|
if (ui->pushButton_generalAdvanced->isChecked()) {
|
||||||
ui->widget_generalAdvanced->setHidden(false);
|
ui->widget_generalAdvanced->setHidden(false);
|
||||||
ui->pushButton_generalAdvanced->setText(QApplication::translate("GeneralWidget", "Hide advanced"));
|
ui->pushButton_generalAdvanced->setText(QApplication::translate("GeneralWidget", "Hide advanced"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->widget_generalAdvanced->setHidden(true);
|
ui->widget_generalAdvanced->setHidden(true);
|
||||||
ui->pushButton_generalAdvanced->setText(QApplication::translate("GeneralWidget", "Show advanced"));
|
ui->pushButton_generalAdvanced->setText(QApplication::translate("GeneralWidget", "Show advanced"));
|
||||||
}
|
}
|
||||||
|
@ -315,8 +315,7 @@ void IpWidget::ipEnable(const int state)
|
|||||||
ui->comboBox_ip->setDisabled(true);
|
ui->comboBox_ip->setDisabled(true);
|
||||||
ui->widget_ip->setDisabled(true);
|
ui->widget_ip->setDisabled(true);
|
||||||
ui->widget_ipRoutes->setDisabled(true);
|
ui->widget_ipRoutes->setDisabled(true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->comboBox_ip->setEnabled(true);
|
ui->comboBox_ip->setEnabled(true);
|
||||||
ui->widget_ip->setEnabled(true);
|
ui->widget_ip->setEnabled(true);
|
||||||
ui->widget_ipRoutes->setEnabled(true);
|
ui->widget_ipRoutes->setEnabled(true);
|
||||||
@ -341,8 +340,7 @@ void IpWidget::ip6Enable(const int state)
|
|||||||
ui->comboBox_ip6->setDisabled(true);
|
ui->comboBox_ip6->setDisabled(true);
|
||||||
ui->widget_ip6->setDisabled(true);
|
ui->widget_ip6->setDisabled(true);
|
||||||
ui->widget_ipRoutes6->setDisabled(true);
|
ui->widget_ipRoutes6->setDisabled(true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->comboBox_ip6->setEnabled(true);
|
ui->comboBox_ip6->setEnabled(true);
|
||||||
ui->widget_ip6->setEnabled(true);
|
ui->widget_ip6->setEnabled(true);
|
||||||
ui->widget_ipRoutes6->setEnabled(true);
|
ui->widget_ipRoutes6->setEnabled(true);
|
||||||
@ -355,8 +353,7 @@ void IpWidget::changeDhcpClient(const QString currentText)
|
|||||||
if (currentText == QString("dhcpcd")) {
|
if (currentText == QString("dhcpcd")) {
|
||||||
ui->widget_dhcpcdOpt->setHidden(false);
|
ui->widget_dhcpcdOpt->setHidden(false);
|
||||||
ui->widget_dhclientOpt->setHidden(true);
|
ui->widget_dhclientOpt->setHidden(true);
|
||||||
}
|
} else if (currentText == QString("dhclient")) {
|
||||||
else if (currentText == QString("dhclient")) {
|
|
||||||
ui->widget_dhcpcdOpt->setHidden(true);
|
ui->widget_dhcpcdOpt->setHidden(true);
|
||||||
ui->widget_dhclientOpt->setHidden(false);
|
ui->widget_dhclientOpt->setHidden(false);
|
||||||
}
|
}
|
||||||
@ -368,8 +365,7 @@ void IpWidget::showAdvanced()
|
|||||||
if (ui->pushButton_ipAdvanced->isChecked()) {
|
if (ui->pushButton_ipAdvanced->isChecked()) {
|
||||||
ui->widget_ipAdvanced->setHidden(false);
|
ui->widget_ipAdvanced->setHidden(false);
|
||||||
ui->pushButton_ipAdvanced->setText(QApplication::translate("IpWidget", "Hide advanced"));
|
ui->pushButton_ipAdvanced->setText(QApplication::translate("IpWidget", "Hide advanced"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->widget_ipAdvanced->setHidden(true);
|
ui->widget_ipAdvanced->setHidden(true);
|
||||||
ui->pushButton_ipAdvanced->setText(QApplication::translate("IpWidget", "Show advanced"));
|
ui->pushButton_ipAdvanced->setText(QApplication::translate("IpWidget", "Show advanced"));
|
||||||
}
|
}
|
||||||
@ -398,8 +394,7 @@ QMap<QString, QString> IpWidget::getSettings()
|
|||||||
routes.append(QString("'") + ui->listWidget_ipRoutes->item(i)->text() + QString("'"));
|
routes.append(QString("'") + ui->listWidget_ipRoutes->item(i)->text() + QString("'"));
|
||||||
ipSettings[QString("Routes")] = routes.join(QChar(' '));
|
ipSettings[QString("Routes")] = routes.join(QChar(' '));
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
ipSettings[QString("IP")] = QString("no");
|
ipSettings[QString("IP")] = QString("no");
|
||||||
if (ui->checkBox_ip6->checkState() == Qt::Checked) {
|
if (ui->checkBox_ip6->checkState() == Qt::Checked) {
|
||||||
ipSettings[QString("IP6")] = ui->comboBox_ip6->currentText();
|
ipSettings[QString("IP6")] = ui->comboBox_ip6->currentText();
|
||||||
@ -417,8 +412,7 @@ QMap<QString, QString> IpWidget::getSettings()
|
|||||||
routes.append(QString("'") + ui->listWidget_ipRoutes6->item(i)->text() + QString("'"));
|
routes.append(QString("'") + ui->listWidget_ipRoutes6->item(i)->text() + QString("'"));
|
||||||
ipSettings[QString("Routes6")] = routes.join(QChar(' '));
|
ipSettings[QString("Routes6")] = routes.join(QChar(' '));
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
ipSettings[QString("IP6")] = QString("no");
|
ipSettings[QString("IP6")] = QString("no");
|
||||||
if (ui->listWidget_custom->count() > 0) {
|
if (ui->listWidget_custom->count() > 0) {
|
||||||
QStringList custom;
|
QStringList custom;
|
||||||
@ -433,8 +427,7 @@ QMap<QString, QString> IpWidget::getSettings()
|
|||||||
if (ui->comboBox_dhcp->currentText() == QString("dhcpcd")) {
|
if (ui->comboBox_dhcp->currentText() == QString("dhcpcd")) {
|
||||||
if (!ui->lineEdit_dhcpcdOpt->text().isEmpty())
|
if (!ui->lineEdit_dhcpcdOpt->text().isEmpty())
|
||||||
ipSettings[QString("DhcpcdOptions")] = QString("'") + ui->lineEdit_dhcpcdOpt->text() + QString("'");
|
ipSettings[QString("DhcpcdOptions")] = QString("'") + ui->lineEdit_dhcpcdOpt->text() + QString("'");
|
||||||
}
|
} else if (ui->comboBox_dhcp->currentText() == QString("dhclient")) {
|
||||||
else if (ui->comboBox_dhcp->currentText() == QString("dhclient")) {
|
|
||||||
ipSettings[QString("DHCPClient")] = ui->comboBox_dhcp->currentText();
|
ipSettings[QString("DHCPClient")] = ui->comboBox_dhcp->currentText();
|
||||||
if (!ui->lineEdit_dhclientOpt->text().isEmpty())
|
if (!ui->lineEdit_dhclientOpt->text().isEmpty())
|
||||||
ipSettings[QString("DhclientOptions")] = QString("'") + ui->lineEdit_dhclientOpt->text() + QString("'");
|
ipSettings[QString("DhclientOptions")] = QString("'") + ui->lineEdit_dhclientOpt->text() + QString("'");
|
||||||
|
@ -36,12 +36,11 @@ using namespace std;
|
|||||||
bool restoreExistSession()
|
bool restoreExistSession()
|
||||||
{
|
{
|
||||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
QDBusConnection bus = QDBusConnection::sessionBus();
|
||||||
QDBusMessage request = QDBusMessage::createMethodCall(DBUS_SERVICE,
|
QDBusMessage request = QDBusMessage::createMethodCall(DBUS_SERVICE, DBUS_OBJECT_PATH,
|
||||||
DBUS_OBJECT_PATH,
|
DBUS_INTERFACE, QString("Restore"));
|
||||||
DBUS_INTERFACE,
|
|
||||||
QString("Restore"));
|
|
||||||
QDBusMessage response = bus.call(request);
|
QDBusMessage response = bus.call(request);
|
||||||
QList<QVariant> arguments = response.arguments();
|
QList<QVariant> arguments = response.arguments();
|
||||||
|
|
||||||
return !arguments.isEmpty();
|
return !arguments.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,68 +50,52 @@ int main(int argc, char *argv[])
|
|||||||
QMap<QString, QVariant> args = getArgs();
|
QMap<QString, QVariant> args = getArgs();
|
||||||
// reading
|
// reading
|
||||||
for (int i=1; i<argc; i++) {
|
for (int i=1; i<argc; i++) {
|
||||||
// windows
|
|
||||||
// daemonized
|
|
||||||
if (QString(argv[i]) == QString("--daemon")) {
|
if (QString(argv[i]) == QString("--daemon")) {
|
||||||
|
// daemonized
|
||||||
args[QString("minimized")] = (int) 1;
|
args[QString("minimized")] = (int) 1;
|
||||||
}
|
} else if (QString(argv[i]) == QString("--maximized")) {
|
||||||
// maximized
|
// maximized
|
||||||
else if (QString(argv[i]) == QString("--maximized")) {
|
|
||||||
args[QString("minimized")] = (int) 2;
|
args[QString("minimized")] = (int) 2;
|
||||||
}
|
} else if (QString(argv[i]) == QString("--minimized")) {
|
||||||
// minimized
|
// minimized
|
||||||
else if (QString(argv[i]) == QString("--minimized")) {
|
|
||||||
args[QString("minimized")] = (int) 3;
|
args[QString("minimized")] = (int) 3;
|
||||||
}
|
} else if (QString(argv[i]) == QString("--about")) {
|
||||||
// about
|
// about
|
||||||
else if (QString(argv[i]) == QString("--about")) {
|
|
||||||
args[QString("about")] = true;
|
args[QString("about")] = true;
|
||||||
}
|
} else if (QString(argv[i]) == QString("--netctl-auto")) {
|
||||||
// netctl-auto
|
// netctl-auto
|
||||||
else if (QString(argv[i]) == QString("--netctl-auto")) {
|
|
||||||
args[QString("auto")] = true;
|
args[QString("auto")] = true;
|
||||||
}
|
} else if (QString(argv[i]) == QString("--settings")) {
|
||||||
// settings
|
// settings
|
||||||
else if (QString(argv[i]) == QString("--settings")) {
|
|
||||||
args[QString("settings")] = true;
|
args[QString("settings")] = true;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-e")) || (QString(argv[i]) == QString("--essid"))) {
|
||||||
// main functions
|
// select ESSID
|
||||||
// select ESSID
|
|
||||||
else if ((QString(argv[i]) == QString("-e")) || (QString(argv[i]) == QString("--essid"))) {
|
|
||||||
args[QString("essid")] = QString(argv[i+1]);
|
args[QString("essid")] = QString(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-o")) || (QString(argv[i]) == QString("--open"))) {
|
||||||
// open profile
|
// open profile
|
||||||
else if ((QString(argv[i]) == QString("-o")) || (QString(argv[i]) == QString("--open"))) {
|
|
||||||
args[QString("open")] = QString(argv[i+1]);
|
args[QString("open")] = QString(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-s")) || (QString(argv[i]) == QString("--select"))) {
|
||||||
// select profile
|
// select profile
|
||||||
else if ((QString(argv[i]) == QString("-s")) || (QString(argv[i]) == QString("--select"))) {
|
|
||||||
args[QString("select")] = QString(argv[i+1]);
|
args[QString("select")] = QString(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-c")) || (QString(argv[i]) == QString("--config"))) {
|
||||||
// additional functions
|
// config path
|
||||||
// config path
|
|
||||||
else if ((QString(argv[i]) == QString("-c")) || (QString(argv[i]) == QString("--config"))) {
|
|
||||||
args[QString("config")] = QDir().absoluteFilePath(argv[i+1]);
|
args[QString("config")] = QDir().absoluteFilePath(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-d")) || (QString(argv[i]) == QString("--debug"))) {
|
||||||
// debug
|
// debug
|
||||||
else if ((QString(argv[i]) == QString("-d")) || (QString(argv[i]) == QString("--debug"))) {
|
|
||||||
args[QString("debug")] = true;
|
args[QString("debug")] = true;
|
||||||
}
|
} else if (QString(argv[i]) == QString("--default")) {
|
||||||
// default settings
|
// default settings
|
||||||
else if (QString(argv[i]) == QString("--default")) {
|
|
||||||
args[QString("defaults")] = true;
|
args[QString("defaults")] = true;
|
||||||
}
|
} else if (QString(argv[i]) == QString("--set-opts")) {
|
||||||
// options
|
// options
|
||||||
else if (QString(argv[i]) == QString("--set-opts")) {
|
|
||||||
args[QString("options")] = QString(argv[i+1]);
|
args[QString("options")] = QString(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-t")) || (QString(argv[i]) == QString("--tab"))) {
|
||||||
// tab number
|
// tab number
|
||||||
else if ((QString(argv[i]) == QString("-t")) || (QString(argv[i]) == QString("--tab"))) {
|
|
||||||
if (atoi(argv[i+1]) > 3)
|
if (atoi(argv[i+1]) > 3)
|
||||||
args[QString("tab")] = (int) 3;
|
args[QString("tab")] = (int) 3;
|
||||||
else if (atoi(argv[i+1]) < 1)
|
else if (atoi(argv[i+1]) < 1)
|
||||||
@ -120,21 +103,16 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
args[QString("tab")] = atoi(argv[i+1]);
|
args[QString("tab")] = atoi(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-h")) || (QString(argv[i]) == QString("--help"))) {
|
||||||
// messages
|
// help message
|
||||||
// help message
|
|
||||||
else if ((QString(argv[i]) == QString("-h")) || (QString(argv[i]) == QString("--help"))) {
|
|
||||||
args[QString("help")] = true;
|
args[QString("help")] = true;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-i")) || (QString(argv[i]) == QString("--info"))) {
|
||||||
// info message
|
// info message
|
||||||
else if ((QString(argv[i]) == QString("-i")) || (QString(argv[i]) == QString("--info"))) {
|
|
||||||
args[QString("info")] = true;
|
args[QString("info")] = true;
|
||||||
}
|
} else if ((QString(argv[i]) == QString("-v")) || (QString(argv[i]) == QString("--version"))) {
|
||||||
// version message
|
// version message
|
||||||
else if ((QString(argv[i]) == QString("-v")) || (QString(argv[i]) == QString("--version"))) {
|
|
||||||
args[QString("version")] = true;
|
args[QString("version")] = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
args[QString("error")] = true;
|
args[QString("error")] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,17 +147,14 @@ int main(int argc, char *argv[])
|
|||||||
cout << errorMessage().toUtf8().data() << endl;
|
cout << errorMessage().toUtf8().data() << endl;
|
||||||
cout << helpMessage().toUtf8().data();
|
cout << helpMessage().toUtf8().data();
|
||||||
return 127;
|
return 127;
|
||||||
}
|
} else if (args[QString("help")].toBool()) {
|
||||||
if (args[QString("help")].toBool()) {
|
|
||||||
cout << helpMessage().toUtf8().data();
|
cout << helpMessage().toUtf8().data();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else if (args[QString("info")].toBool()) {
|
||||||
if (args[QString("info")].toBool()) {
|
|
||||||
cout << versionMessage().toUtf8().data() << endl;
|
cout << versionMessage().toUtf8().data() << endl;
|
||||||
cout << infoMessage().toUtf8().data();
|
cout << infoMessage().toUtf8().data();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else if (args[QString("version")].toBool()) {
|
||||||
if (args[QString("version")].toBool()) {
|
|
||||||
cout << versionMessage().toUtf8().data();
|
cout << versionMessage().toUtf8().data();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,7 @@ void MobileWidget::showAdvanced()
|
|||||||
if (ui->pushButton_mobileAdvanced->isChecked()) {
|
if (ui->pushButton_mobileAdvanced->isChecked()) {
|
||||||
ui->widget_mobileAdvanced->setHidden(false);
|
ui->widget_mobileAdvanced->setHidden(false);
|
||||||
ui->pushButton_mobileAdvanced->setText(QApplication::translate("MobileWidget", "Hide advanced"));
|
ui->pushButton_mobileAdvanced->setText(QApplication::translate("MobileWidget", "Hide advanced"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->widget_mobileAdvanced->setHidden(true);
|
ui->widget_mobileAdvanced->setHidden(true);
|
||||||
ui->pushButton_mobileAdvanced->setText(QApplication::translate("MobileWidget", "Show advanced"));
|
ui->pushButton_mobileAdvanced->setText(QApplication::translate("MobileWidget", "Show advanced"));
|
||||||
}
|
}
|
||||||
|
@ -128,15 +128,13 @@ void NetctlAutoWindow::netctlAutoContextualMenu(const QPoint &pos)
|
|||||||
if (!ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 2)->text().isEmpty()) {
|
if (!ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 2)->text().isEmpty()) {
|
||||||
enableProfile->setVisible(false);
|
enableProfile->setVisible(false);
|
||||||
startProfile->setVisible(false);
|
startProfile->setVisible(false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
enableProfile->setVisible(true);
|
enableProfile->setVisible(true);
|
||||||
startProfile->setVisible(true);
|
startProfile->setVisible(true);
|
||||||
if (!ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 3)->text().isEmpty()) {
|
if (!ui->tableWidget->item(ui->tableWidget->currentItem()->row(), 3)->text().isEmpty()) {
|
||||||
enableProfile->setText(QApplication::translate("NetctlAutoWindow", "Enable"));
|
enableProfile->setText(QApplication::translate("NetctlAutoWindow", "Enable"));
|
||||||
enableProfile->setIcon(QIcon::fromTheme("edit-add"));
|
enableProfile->setIcon(QIcon::fromTheme("edit-add"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
enableProfile->setText(QApplication::translate("NetctlAutoWindow", "Disable"));
|
enableProfile->setText(QApplication::translate("NetctlAutoWindow", "Disable"));
|
||||||
enableProfile->setIcon(QIcon::fromTheme("edit-delete"));
|
enableProfile->setIcon(QIcon::fromTheme("edit-delete"));
|
||||||
}
|
}
|
||||||
@ -147,16 +145,13 @@ void NetctlAutoWindow::netctlAutoContextualMenu(const QPoint &pos)
|
|||||||
if (action == startProfile) {
|
if (action == startProfile) {
|
||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Switch to profile";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Switch to profile";
|
||||||
netctlAutoStartProfile();
|
netctlAutoStartProfile();
|
||||||
}
|
} else if (action == enableProfile) {
|
||||||
else if (action == enableProfile) {
|
|
||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Enable profile";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Enable profile";
|
||||||
netctlAutoEnableProfile();
|
netctlAutoEnableProfile();
|
||||||
}
|
} else if (action == enableAllProfiles) {
|
||||||
else if (action == enableAllProfiles) {
|
|
||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Enable all profiles";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Enable all profiles";
|
||||||
netctlAutoEnableAllProfiles();
|
netctlAutoEnableAllProfiles();
|
||||||
}
|
} else if (action == disableAllProfiles) {
|
||||||
else if (action == disableAllProfiles) {
|
|
||||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Disable all profiles";
|
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoContextualMenu]" << "Disable all profiles";
|
||||||
netctlAutoDisableAllProfiles();
|
netctlAutoDisableAllProfiles();
|
||||||
}
|
}
|
||||||
@ -178,8 +173,7 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
|||||||
running = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
running = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_LIB_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("isNetctlAutoActive"),
|
DBUS_HELPER_INTERFACE, QString("isNetctlAutoActive"),
|
||||||
QList<QVariant>(), true, debug)[0].toBool();
|
QList<QVariant>(), true, debug)[0].toBool();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
enabled = netctlCommand->isNetctlAutoEnabled();
|
enabled = netctlCommand->isNetctlAutoEnabled();
|
||||||
running = netctlCommand->isNetctlAutoRunning();
|
running = netctlCommand->isNetctlAutoRunning();
|
||||||
}
|
}
|
||||||
@ -194,8 +188,7 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
|||||||
ui->actionDisableAll->setVisible(true);
|
ui->actionDisableAll->setVisible(true);
|
||||||
ui->actionEnableAll->setVisible(true);
|
ui->actionEnableAll->setVisible(true);
|
||||||
ui->actionRestartService->setVisible(true);
|
ui->actionRestartService->setVisible(true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is not running"));
|
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is not running"));
|
||||||
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Start service"));
|
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Start service"));
|
||||||
ui->actionDisableAll->setVisible(false);
|
ui->actionDisableAll->setVisible(false);
|
||||||
@ -308,8 +301,7 @@ void NetctlAutoWindow::netctlAutoEnableProfile()
|
|||||||
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("autoEnable"),
|
DBUS_HELPER_INTERFACE, QString("autoEnable"),
|
||||||
args, true, debug)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
status = netctlCommand->autoEnableProfile(profile);
|
status = netctlCommand->autoEnableProfile(profile);
|
||||||
if (status)
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
@ -356,8 +348,7 @@ void NetctlAutoWindow::netctlAutoStartProfile()
|
|||||||
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
status = sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
||||||
DBUS_HELPER_INTERFACE, QString("autoStart"),
|
DBUS_HELPER_INTERFACE, QString("autoStart"),
|
||||||
args, true, debug)[0].toBool();
|
args, true, debug)[0].toBool();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
status = netctlCommand->autoStartProfile(profile);
|
status = netctlCommand->autoStartProfile(profile);
|
||||||
if (status)
|
if (status)
|
||||||
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
ui->statusBar->showMessage(QApplication::translate("NetctlAutoWindow", "Done"));
|
||||||
@ -449,8 +440,7 @@ void NetctlAutoWindow::netctlAutoRefreshButtons(QTableWidgetItem *current, QTabl
|
|||||||
// menu
|
// menu
|
||||||
ui->actionEnable->setVisible(false);
|
ui->actionEnable->setVisible(false);
|
||||||
ui->actionSwitch->setVisible(false);
|
ui->actionSwitch->setVisible(false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// buttons
|
// buttons
|
||||||
ui->pushButton_enable->setEnabled(true);
|
ui->pushButton_enable->setEnabled(true);
|
||||||
ui->pushButton_switch->setEnabled(true);
|
ui->pushButton_switch->setEnabled(true);
|
||||||
@ -464,8 +454,7 @@ void NetctlAutoWindow::netctlAutoRefreshButtons(QTableWidgetItem *current, QTabl
|
|||||||
// menu
|
// menu
|
||||||
ui->actionEnable->setText(QApplication::translate("NetctlAutoWindow", "Enable profile"));
|
ui->actionEnable->setText(QApplication::translate("NetctlAutoWindow", "Enable profile"));
|
||||||
ui->actionEnable->setIcon(QIcon::fromTheme("edit-add"));
|
ui->actionEnable->setIcon(QIcon::fromTheme("edit-add"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// buttons
|
// buttons
|
||||||
ui->pushButton_enable->setText(QApplication::translate("NetctlAutoWindow", "Disable"));
|
ui->pushButton_enable->setText(QApplication::translate("NetctlAutoWindow", "Disable"));
|
||||||
ui->pushButton_enable->setIcon(QIcon::fromTheme("edit-delete"));
|
ui->pushButton_enable->setIcon(QIcon::fromTheme("edit-delete"));
|
||||||
|
@ -66,8 +66,7 @@ void PasswdWidget::setPassword(const bool mode)
|
|||||||
if (mode) {
|
if (mode) {
|
||||||
ui->lineEdit->setEchoMode(QLineEdit::Password);
|
ui->lineEdit->setEchoMode(QLineEdit::Password);
|
||||||
ui->label->setText(QApplication::translate("PasswdWidget", "Password"));
|
ui->label->setText(QApplication::translate("PasswdWidget", "Password"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->lineEdit->setEchoMode(QLineEdit::Normal);
|
ui->lineEdit->setEchoMode(QLineEdit::Normal);
|
||||||
ui->label->setText(QApplication::translate("PasswdWidget", "ESSID"));
|
ui->label->setText(QApplication::translate("PasswdWidget", "ESSID"));
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,7 @@ void PppoeWidget::showAdvanced()
|
|||||||
if (ui->pushButton_pppoeAdvanced->isChecked()) {
|
if (ui->pushButton_pppoeAdvanced->isChecked()) {
|
||||||
ui->widget_pppoeAdvanced->setHidden(false);
|
ui->widget_pppoeAdvanced->setHidden(false);
|
||||||
ui->pushButton_pppoeAdvanced->setText(QApplication::translate("PppoeWidget", "Hide advanced"));
|
ui->pushButton_pppoeAdvanced->setText(QApplication::translate("PppoeWidget", "Hide advanced"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->widget_pppoeAdvanced->setHidden(true);
|
ui->widget_pppoeAdvanced->setHidden(true);
|
||||||
ui->pushButton_pppoeAdvanced->setText(QApplication::translate("PppoeWidget", "Show advanced"));
|
ui->pushButton_pppoeAdvanced->setText(QApplication::translate("PppoeWidget", "Show advanced"));
|
||||||
}
|
}
|
||||||
|
@ -58,17 +58,17 @@ void SettingsWindow::createActions()
|
|||||||
connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
|
connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
|
||||||
this, SLOT(changePage(QTreeWidgetItem *, QTreeWidgetItem *)));
|
this, SLOT(changePage(QTreeWidgetItem *, QTreeWidgetItem *)));
|
||||||
// buttons
|
// buttons
|
||||||
connect(ui->pushButton_helperPath, SIGNAL(clicked(bool)), this, SLOT(selectHelperPath()));
|
connect(ui->pushButton_helperPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_interfaceDir, SIGNAL(clicked(bool)), this, SLOT(selectIfaceDir()));
|
connect(ui->pushButton_interfacesDir, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_netctlPath, SIGNAL(clicked(bool)), this, SLOT(selectNetctlPath()));
|
connect(ui->pushButton_netctlPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_netctlAutoPath, SIGNAL(clicked(bool)), this, SLOT(selectNetctlAutoPath()));
|
connect(ui->pushButton_netctlAutoPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_profilePath, SIGNAL(clicked(bool)), this, SLOT(selectProfileDir()));
|
connect(ui->pushButton_profilePath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_rfkill, SIGNAL(clicked(bool)), this, SLOT(selectRfkillDir()));
|
connect(ui->pushButton_rfkill, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_status, SIGNAL(clicked(bool)), this, SLOT(startHelper()));
|
connect(ui->pushButton_status, SIGNAL(clicked(bool)), this, SLOT(startHelper()));
|
||||||
connect(ui->pushButton_sudo, SIGNAL(clicked(bool)), this, SLOT(selectSudoPath()));
|
connect(ui->pushButton_sudo, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_systemctlPath, SIGNAL(clicked(bool)), this, SLOT(selectSystemctlPath()));
|
connect(ui->pushButton_systemctlPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_wpaCliPath, SIGNAL(clicked(bool)), this, SLOT(selectWpaCliPath()));
|
connect(ui->pushButton_wpaCliPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
connect(ui->pushButton_wpaSupPath, SIGNAL(clicked(bool)), this, SLOT(selectWpaSupPath()));
|
connect(ui->pushButton_wpaSupPath, SIGNAL(clicked(bool)), this, SLOT(selectAbstractSomething()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,8 +136,7 @@ void SettingsWindow::setTray()
|
|||||||
if (ui->checkBox_enableTray->checkState() == 0) {
|
if (ui->checkBox_enableTray->checkState() == 0) {
|
||||||
ui->checkBox_closeToTray->setDisabled(true);
|
ui->checkBox_closeToTray->setDisabled(true);
|
||||||
ui->checkBox_startToTray->setDisabled(true);
|
ui->checkBox_startToTray->setDisabled(true);
|
||||||
}
|
} else if (ui->checkBox_enableTray->checkState() == 2) {
|
||||||
else if (ui->checkBox_enableTray->checkState() == 2) {
|
|
||||||
ui->checkBox_closeToTray->setEnabled(true);
|
ui->checkBox_closeToTray->setEnabled(true);
|
||||||
ui->checkBox_startToTray->setEnabled(true);
|
ui->checkBox_startToTray->setEnabled(true);
|
||||||
}
|
}
|
||||||
@ -153,140 +152,60 @@ void SettingsWindow::setDefault()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectHelperPath()
|
void SettingsWindow::selectAbstractSomething()
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectHelperPath]";
|
if (debug) qDebug() << "[SettingsWindow]" << "[selectAbstractSomething]";
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
bool isDir = false;
|
||||||
this,
|
QString path = QString("/usr/bin");
|
||||||
QApplication::translate("SettingsWindow", "Select helper command"),
|
QString text = QApplication::translate("SettingsWindow", "Select helper command");
|
||||||
QString("/usr/bin/"),
|
QLineEdit *lineEdit = ui->lineEdit_helperPath;
|
||||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
if (sender() == ui->pushButton_helperPath) {
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select helper command");
|
||||||
|
lineEdit = ui->lineEdit_helperPath;
|
||||||
|
} else if (sender() == ui->pushButton_interfacesDir) {
|
||||||
|
isDir = true;
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select path to directory with interfaces");
|
||||||
|
path = QString("/sys");
|
||||||
|
lineEdit = ui->lineEdit_interfacesDir;
|
||||||
|
} else if (sender() == ui->pushButton_netctlPath) {
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select netctl command");
|
||||||
|
lineEdit = ui->lineEdit_netctlPath;
|
||||||
|
} else if (sender() == ui->pushButton_netctlAutoPath) {
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select netctl-auto command");
|
||||||
|
lineEdit = ui->lineEdit_netctlAutoPath;
|
||||||
|
} else if (sender() == ui->pushButton_profilePath) {
|
||||||
|
isDir = true;
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select path to profile directory");
|
||||||
|
path = QString("/etc");
|
||||||
|
lineEdit = ui->lineEdit_profilePath;
|
||||||
|
} else if (sender() == ui->pushButton_rfkill) {
|
||||||
|
isDir = true;
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select path to directory with rfkill devices");
|
||||||
|
path = QString("/sys");
|
||||||
|
lineEdit = ui->lineEdit_rfkill;
|
||||||
|
} else if (sender() == ui->pushButton_sudo) {
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select sudo command");
|
||||||
|
lineEdit = ui->lineEdit_sudo;
|
||||||
|
} else if (sender() == ui->pushButton_systemctlPath) {
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select systemctl command");
|
||||||
|
lineEdit = ui->lineEdit_systemctlPath;
|
||||||
|
} else if (sender() == ui->pushButton_wpaCliPath) {
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select wpa_cli command");
|
||||||
|
lineEdit = ui->lineEdit_wpaCliPath;
|
||||||
|
} else if (sender() == ui->pushButton_wpaSupPath) {
|
||||||
|
text = QApplication::translate("SettingsWindow", "Select wpa_supplicant command");
|
||||||
|
lineEdit = ui->lineEdit_wpaSupPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString filename;
|
||||||
|
if (isDir)
|
||||||
|
filename = QFileDialog::getExistingDirectory(this, text, path);
|
||||||
|
else
|
||||||
|
filename = QFileDialog::getOpenFileName(this, text, path,
|
||||||
|
QApplication::translate("SettingsWindow", "All files (*)"));
|
||||||
if (!filename.isEmpty())
|
if (!filename.isEmpty())
|
||||||
ui->lineEdit_helperPath->setText(filename);
|
lineEdit->setText(filename);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectIfaceDir()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectIfaceDir]";
|
|
||||||
|
|
||||||
QString directory = QFileDialog::getExistingDirectory(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select path to directory with interfaces"),
|
|
||||||
QString("/sys/"));
|
|
||||||
if (!directory.isEmpty())
|
|
||||||
ui->lineEdit_interfacesDir->setText(directory);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectNetctlPath()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectNetctlPath]";
|
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select netctl command"),
|
|
||||||
QString("/usr/bin/"),
|
|
||||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
|
||||||
if (!filename.isEmpty())
|
|
||||||
ui->lineEdit_netctlPath->setText(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectNetctlAutoPath()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectNetctlAutoPath]";
|
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select netctl-auto command"),
|
|
||||||
QString("/usr/bin/"),
|
|
||||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
|
||||||
if (!filename.isEmpty())
|
|
||||||
ui->lineEdit_netctlAutoPath->setText(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectProfileDir()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectProfileDir]";
|
|
||||||
|
|
||||||
QString directory = QFileDialog::getExistingDirectory(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select path to profile directory"),
|
|
||||||
QString("/etc/"));
|
|
||||||
if (!directory.isEmpty())
|
|
||||||
ui->lineEdit_profilePath->setText(directory);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectRfkillDir()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectRfkillDir]";
|
|
||||||
|
|
||||||
QString directory = QFileDialog::getExistingDirectory(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select path to directory with rfkill devices"),
|
|
||||||
QString("/sys/"));
|
|
||||||
if (!directory.isEmpty())
|
|
||||||
ui->lineEdit_rfkill->setText(directory);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectSudoPath()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectSudoPath]";
|
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select sudo command"),
|
|
||||||
QString("/usr/bin/"),
|
|
||||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
|
||||||
if (!filename.isEmpty())
|
|
||||||
ui->lineEdit_sudo->setText(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectSystemctlPath()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectSystemctlPath]";
|
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select systemctl command"),
|
|
||||||
QString("/usr/bin/"),
|
|
||||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
|
||||||
if (!filename.isEmpty())
|
|
||||||
ui->lineEdit_systemctlPath->setText(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectWpaCliPath()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectWpaCliPath]";
|
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select wpa_cli command"),
|
|
||||||
QString("/usr/bin/"),
|
|
||||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
|
||||||
if (!filename.isEmpty())
|
|
||||||
ui->lineEdit_wpaCliPath->setText(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SettingsWindow::selectWpaSupPath()
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectWpaSupPath]";
|
|
||||||
|
|
||||||
QString filename = QFileDialog::getOpenFileName(
|
|
||||||
this,
|
|
||||||
QApplication::translate("SettingsWindow", "Select wpa_supplicant command"),
|
|
||||||
QString("/usr/bin/"),
|
|
||||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
|
||||||
if (!filename.isEmpty())
|
|
||||||
ui->lineEdit_wpaSupPath->setText(filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -494,14 +413,12 @@ void SettingsWindow::updateHelper()
|
|||||||
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop"));
|
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop"));
|
||||||
ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop"));
|
ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop"));
|
||||||
ui->pushButton_status->setDisabled(true);
|
ui->pushButton_status->setDisabled(true);
|
||||||
}
|
} else if (((MainWindow *)parent())->isHelperActive()) {
|
||||||
else if (((MainWindow *)parent())->isHelperActive()) {
|
|
||||||
ui->label_status->setText(QApplication::translate("SettingsWindow", "Active"));
|
ui->label_status->setText(QApplication::translate("SettingsWindow", "Active"));
|
||||||
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop"));
|
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Stop"));
|
||||||
ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop"));
|
ui->pushButton_status->setIcon(QIcon::fromTheme("process-stop"));
|
||||||
ui->pushButton_status->setEnabled(true);
|
ui->pushButton_status->setEnabled(true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->label_status->setText(QApplication::translate("SettingsWindow", "Inactive"));
|
ui->label_status->setText(QApplication::translate("SettingsWindow", "Inactive"));
|
||||||
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Start"));
|
ui->pushButton_status->setText(QApplication::translate("SettingsWindow", "Start"));
|
||||||
ui->pushButton_status->setIcon(QIcon::fromTheme("system-run"));
|
ui->pushButton_status->setIcon(QIcon::fromTheme("system-run"));
|
||||||
|
@ -53,16 +53,7 @@ private slots:
|
|||||||
void setTray();
|
void setTray();
|
||||||
void updateHelper();
|
void updateHelper();
|
||||||
// buttons
|
// buttons
|
||||||
void selectHelperPath();
|
void selectAbstractSomething();
|
||||||
void selectIfaceDir();
|
|
||||||
void selectNetctlPath();
|
|
||||||
void selectNetctlAutoPath();
|
|
||||||
void selectProfileDir();
|
|
||||||
void selectRfkillDir();
|
|
||||||
void selectSudoPath();
|
|
||||||
void selectSystemctlPath();
|
|
||||||
void selectWpaCliPath();
|
|
||||||
void selectWpaSupPath();
|
|
||||||
void startHelper();
|
void startHelper();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>686</width>
|
<width>684</width>
|
||||||
<height>403</height>
|
<height>401</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -136,8 +136,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>470</width>
|
<width>468</width>
|
||||||
<height>342</height>
|
<height>340</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
@ -211,8 +211,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>470</width>
|
<width>468</width>
|
||||||
<height>342</height>
|
<height>340</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||||
@ -381,8 +381,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>436</width>
|
<width>468</width>
|
||||||
<height>165</height>
|
<height>340</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
@ -568,8 +568,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>436</width>
|
<width>468</width>
|
||||||
<height>43</height>
|
<height>340</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
@ -638,8 +638,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>277</width>
|
<width>468</width>
|
||||||
<height>190</height>
|
<height>340</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||||
@ -835,8 +835,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>436</width>
|
<width>468</width>
|
||||||
<height>252</height>
|
<height>340</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||||
@ -863,7 +863,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_interfaceDir">
|
<widget class="QPushButton" name="pushButton_interfacesDir">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Browse</string>
|
<string>Browse</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -93,8 +93,7 @@ void TrayIcon::updateMenu()
|
|||||||
if (current.isEmpty()) {
|
if (current.isEmpty()) {
|
||||||
contextMenu[QString("title")]->setIcon(QIcon(QString(":network-offline-64x64")));
|
contextMenu[QString("title")]->setIcon(QIcon(QString(":network-offline-64x64")));
|
||||||
contextMenu[QString("title")]->setText(QApplication::translate("TrayIcon", "(inactive)"));
|
contextMenu[QString("title")]->setText(QApplication::translate("TrayIcon", "(inactive)"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
contextMenu[QString("title")]->setIcon(QIcon(QString(":network-idle-64x64")));
|
contextMenu[QString("title")]->setIcon(QIcon(QString(":network-idle-64x64")));
|
||||||
QString status;
|
QString status;
|
||||||
if (netctlAutoStatus)
|
if (netctlAutoStatus)
|
||||||
@ -112,14 +111,12 @@ void TrayIcon::updateMenu()
|
|||||||
contextMenu[QString("switch")]->setVisible(true);
|
contextMenu[QString("switch")]->setVisible(true);
|
||||||
contextMenu[QString("restart")]->setVisible(false);
|
contextMenu[QString("restart")]->setVisible(false);
|
||||||
contextMenu[QString("enable")]->setVisible(false);
|
contextMenu[QString("enable")]->setVisible(false);
|
||||||
|
|
||||||
switchToProfileMenu->clear();
|
switchToProfileMenu->clear();
|
||||||
for (int i=0; i<profiles.count(); i++) {
|
for (int i=0; i<profiles.count(); i++) {
|
||||||
QAction *profile = new QAction(profiles[i], this);
|
QAction *profile = new QAction(profiles[i], this);
|
||||||
switchToProfileMenu->addAction(profile);
|
switchToProfileMenu->addAction(profile);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
contextMenu[QString("start")]->setVisible(true);
|
contextMenu[QString("start")]->setVisible(true);
|
||||||
contextMenu[QString("stop")]->setVisible(!current.isEmpty());
|
contextMenu[QString("stop")]->setVisible(!current.isEmpty());
|
||||||
contextMenu[QString("switch")]->setVisible(false);
|
contextMenu[QString("switch")]->setVisible(false);
|
||||||
@ -133,8 +130,7 @@ void TrayIcon::updateMenu()
|
|||||||
contextMenu[QString("enable")]->setText(QApplication::translate("TrayIcon", "Disable %1").arg(current));
|
contextMenu[QString("enable")]->setText(QApplication::translate("TrayIcon", "Disable %1").arg(current));
|
||||||
else
|
else
|
||||||
contextMenu[QString("enable")]->setText(QApplication::translate("TrayIcon", "Enable %1").arg(current));
|
contextMenu[QString("enable")]->setText(QApplication::translate("TrayIcon", "Enable %1").arg(current));
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
contextMenu[QString("start")]->setText(QApplication::translate("TrayIcon", "Start profile"));
|
contextMenu[QString("start")]->setText(QApplication::translate("TrayIcon", "Start profile"));
|
||||||
startProfileMenu->clear();
|
startProfileMenu->clear();
|
||||||
for (int i=0; i<profiles.count(); i++) {
|
for (int i=0; i<profiles.count(); i++) {
|
||||||
|
@ -159,21 +159,18 @@ void WirelessWidget::changeSecurity(const QString currentText)
|
|||||||
ui->widget_wpaConfigSection->setHidden(true);
|
ui->widget_wpaConfigSection->setHidden(true);
|
||||||
ui->widget_wpaConfig->setHidden(true);
|
ui->widget_wpaConfig->setHidden(true);
|
||||||
ui->widget_key->setHidden(true);
|
ui->widget_key->setHidden(true);
|
||||||
}
|
} else if ((currentText == QString("wep")) ||
|
||||||
else if ((currentText == QString("wep")) ||
|
|
||||||
(currentText == QString("wpa"))) {
|
(currentText == QString("wpa"))) {
|
||||||
ui->widget_essid->setHidden(false);
|
ui->widget_essid->setHidden(false);
|
||||||
ui->widget_wpaConfigSection->setHidden(true);
|
ui->widget_wpaConfigSection->setHidden(true);
|
||||||
ui->widget_wpaConfig->setHidden(true);
|
ui->widget_wpaConfig->setHidden(true);
|
||||||
ui->widget_key->setHidden(false);
|
ui->widget_key->setHidden(false);
|
||||||
}
|
} else if (currentText == QString("wpa-configsection")) {
|
||||||
else if (currentText == QString("wpa-configsection")) {
|
|
||||||
ui->widget_essid->setHidden(true);
|
ui->widget_essid->setHidden(true);
|
||||||
ui->widget_wpaConfigSection->setHidden(false);
|
ui->widget_wpaConfigSection->setHidden(false);
|
||||||
ui->widget_wpaConfig->setHidden(true);
|
ui->widget_wpaConfig->setHidden(true);
|
||||||
ui->widget_key->setHidden(true);
|
ui->widget_key->setHidden(true);
|
||||||
}
|
} else if (currentText == QString("wpa-config")) {
|
||||||
else if (currentText == QString("wpa-config")) {
|
|
||||||
ui->widget_essid->setHidden(true);
|
ui->widget_essid->setHidden(true);
|
||||||
ui->widget_wpaConfigSection->setHidden(true);
|
ui->widget_wpaConfigSection->setHidden(true);
|
||||||
ui->widget_wpaConfig->setHidden(false);
|
ui->widget_wpaConfig->setHidden(false);
|
||||||
@ -199,8 +196,7 @@ void WirelessWidget::showAdvanced()
|
|||||||
if (ui->pushButton_wirelessAdvanced->isChecked()) {
|
if (ui->pushButton_wirelessAdvanced->isChecked()) {
|
||||||
ui->widget_wirelessAdvanced->setHidden(false);
|
ui->widget_wirelessAdvanced->setHidden(false);
|
||||||
ui->pushButton_wirelessAdvanced->setText(QApplication::translate("WirelessWidget", "Hide advanced"));
|
ui->pushButton_wirelessAdvanced->setText(QApplication::translate("WirelessWidget", "Hide advanced"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ui->widget_wirelessAdvanced->setHidden(true);
|
ui->widget_wirelessAdvanced->setHidden(true);
|
||||||
ui->pushButton_wirelessAdvanced->setText(QApplication::translate("WirelessWidget", "Show advanced"));
|
ui->pushButton_wirelessAdvanced->setText(QApplication::translate("WirelessWidget", "Show advanced"));
|
||||||
}
|
}
|
||||||
@ -221,8 +217,7 @@ QMap<QString, QString> WirelessWidget::getSettings()
|
|||||||
wirelessSettings[QString("Key")] = ui->lineEdit_key->text();
|
wirelessSettings[QString("Key")] = ui->lineEdit_key->text();
|
||||||
else
|
else
|
||||||
wirelessSettings[QString("Key")] = QString("'") + ui->lineEdit_key->text() + QString("'");
|
wirelessSettings[QString("Key")] = QString("'") + ui->lineEdit_key->text() + QString("'");
|
||||||
}
|
} else if (ui->comboBox_security->currentText() == QString("wpa"))
|
||||||
else if (ui->comboBox_security->currentText() == QString("wpa"))
|
|
||||||
wirelessSettings[QString("Key")] = QString("'") + ui->lineEdit_key->text() + QString("'");
|
wirelessSettings[QString("Key")] = QString("'") + ui->lineEdit_key->text() + QString("'");
|
||||||
if (ui->comboBox_security->currentText() == QString("wpa-configsection")) {
|
if (ui->comboBox_security->currentText() == QString("wpa-configsection")) {
|
||||||
QStringList section;
|
QStringList section;
|
||||||
|
@ -99,17 +99,14 @@ int main(int argc, char *argv[])
|
|||||||
cout << errorMessage().toUtf8().data() << endl;
|
cout << errorMessage().toUtf8().data() << endl;
|
||||||
cout << helpMessage().toUtf8().data();
|
cout << helpMessage().toUtf8().data();
|
||||||
return 127;
|
return 127;
|
||||||
}
|
} else if (args[QString("help")].toBool()) {
|
||||||
if (args[QString("help")].toBool()) {
|
|
||||||
cout << helpMessage().toUtf8().data();
|
cout << helpMessage().toUtf8().data();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else if (args[QString("info")].toBool()) {
|
||||||
if (args[QString("info")].toBool()) {
|
|
||||||
cout << versionMessage().toUtf8().data() << endl;
|
cout << versionMessage().toUtf8().data() << endl;
|
||||||
cout << infoMessage().toUtf8().data();
|
cout << infoMessage().toUtf8().data();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else if (args[QString("version")].toBool()) {
|
||||||
if (args[QString("version")].toBool()) {
|
|
||||||
cout << versionMessage().toUtf8().data();
|
cout << versionMessage().toUtf8().data();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user