mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-08 03:15:54 +00:00
added completions
removed wpa_actiond dependency
This commit is contained in:
@ -43,9 +43,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
// config path
|
||||
QString configPath = QString(QDir::homePath() + QString("/.config/netctl-gui.conf"));
|
||||
// translation
|
||||
QString configPath = QDir::homePath() + QDir::separator() + QString(".config") +
|
||||
QDir::separator() + QString("netctl-gui.conf");
|
||||
QString language = Language::defineLanguage(configPath);
|
||||
QTranslator translator;
|
||||
translator.load(QString(":/translations/") + language);
|
||||
@ -103,8 +103,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
// additional functions
|
||||
// config path
|
||||
else if (QString(argv[i]) == QString("--config")) {
|
||||
configPath = QString(argv[i+1]);
|
||||
else if ((QString(argv[i]) == QString("-c")) || (QString(argv[i]) == QString("--config"))) {
|
||||
configPath = QDir().absoluteFilePath(argv[i+1]);
|
||||
i++;
|
||||
}
|
||||
// debug
|
||||
@ -162,7 +162,7 @@ int main(int argc, char *argv[])
|
||||
helpMessage += QString("netctl-gui [ --about ] [ --netctl-auto ] [ --settings ]\n");
|
||||
helpMessage += QString(" [ -e ESSID | --essid ESSID ] [ -o PROFILE | --open PROFILE ]\n");
|
||||
helpMessage += QString(" [ -s PROFILE | --select PROFILE ]\n");
|
||||
helpMessage += QString(" [ --config FILE ] [ -d | --debug ] [ --default ]\n");
|
||||
helpMessage += QString(" [ -c FILE | --config FILE ] [ -d | --debug ] [ --default ]\n");
|
||||
helpMessage += QString(" [ --set-opts OPTIONS ] [ -t NUM | --tab NUM ]\n");
|
||||
helpMessage += QString(" [ -v | --version ] [ -i | --info ] [ -h | --help]\n\n");
|
||||
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Parametrs:"));
|
||||
@ -190,7 +190,7 @@ int main(int argc, char *argv[])
|
||||
.arg(QApplication::translate("MainWindow", "select profile %1").arg(selectProfile));
|
||||
// additional functions
|
||||
helpMessage += QString("%1\n").arg(QApplication::translate("MainWindow", "Additional flags:"));
|
||||
helpMessage += QString(" --config %1\n")
|
||||
helpMessage += QString(" -c %1 --config %1\n")
|
||||
.arg(configPath, -10);
|
||||
helpMessage += QString(" - %1\n")
|
||||
.arg(QApplication::translate("MainWindow", "read configuration from this file"));
|
||||
|
@ -197,9 +197,6 @@ bool MainWindow::checkExternalApps(const QString apps = QString("all"))
|
||||
commandLine.append(configuration[QString("WPACLI_PATH")]);
|
||||
commandLine.append(configuration[QString("WPASUP_PATH")]);
|
||||
}
|
||||
if ((apps == QString("wpaact")) || (apps == QString("all"))) {
|
||||
commandLine.append(configuration[QString("WPAACTIOND_PATH")]);
|
||||
}
|
||||
QProcess command;
|
||||
if (debug) qDebug() << "[MainWindow]" << "[checkExternalApps]" << ":" << "Run cmd" << commandLine.join(QChar(' '));
|
||||
command.start(commandLine.join(QChar(' ')));
|
||||
|
@ -65,7 +65,6 @@ void SettingsWindow::createActions()
|
||||
connect(ui->pushButton_rfkill, SIGNAL(clicked(bool)), SLOT(selectRfkillDir()));
|
||||
connect(ui->pushButton_sudo, SIGNAL(clicked(bool)), SLOT(selectSudoPath()));
|
||||
connect(ui->pushButton_systemctlPath, SIGNAL(clicked(bool)), SLOT(selectSystemctlPath()));
|
||||
connect(ui->pushButton_wpaActiondPath, SIGNAL(clicked(bool)), SLOT(selectWpaActiondPath()));
|
||||
connect(ui->pushButton_wpaCliPath, SIGNAL(clicked(bool)), SLOT(selectWpaCliPath()));
|
||||
connect(ui->pushButton_wpaSupPath, SIGNAL(clicked(bool)), SLOT(selectWpaSupPath()));
|
||||
}
|
||||
@ -222,20 +221,6 @@ void SettingsWindow::selectSystemctlPath()
|
||||
}
|
||||
|
||||
|
||||
void SettingsWindow::selectWpaActiondPath()
|
||||
{
|
||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectWpaActiondPath]";
|
||||
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
QApplication::translate("SettingsWindow", "Select wpa_actiond command"),
|
||||
QString("/usr/bin/"),
|
||||
QApplication::translate("SettingsWindow", "All files (*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->lineEdit_wpaActiondPath->setText(filename);
|
||||
}
|
||||
|
||||
|
||||
void SettingsWindow::selectWpaCliPath()
|
||||
{
|
||||
if (debug) qDebug() << "[SettingsWindow]" << "[selectWpaCliPath]";
|
||||
@ -293,7 +278,6 @@ QMap<QString, QString> SettingsWindow::readSettings()
|
||||
settings[QString("RFKILL_DIR")] = ui->lineEdit_rfkill->text();
|
||||
settings[QString("SUDO_PATH")] = ui->lineEdit_sudo->text();
|
||||
settings[QString("SYSTEMCTL_PATH")] = ui->lineEdit_systemctlPath->text();
|
||||
settings[QString("WPAACTIOND_PATH")] = ui->lineEdit_wpaActiondPath->text();
|
||||
settings[QString("WPACLI_PATH")] = ui->lineEdit_wpaCliPath->text();
|
||||
settings[QString("WPASUP_PATH")] = ui->lineEdit_wpaSupPath->text();
|
||||
settings[QString("WPA_DRIVERS")] = ui->lineEdit_wpaSupDrivers->text();
|
||||
@ -325,7 +309,6 @@ void SettingsWindow::setSettings(const QMap<QString, QString> settings)
|
||||
ui->lineEdit_rfkill->setText(settings[QString("RFKILL_DIR")]);
|
||||
ui->lineEdit_sudo->setText(settings[QString("SUDO_PATH")]);
|
||||
ui->lineEdit_systemctlPath->setText(settings[QString("SYSTEMCTL_PATH")]);
|
||||
ui->lineEdit_wpaActiondPath->setText(settings[QString("WPAACTIOND_PATH")]);
|
||||
ui->lineEdit_wpaCliPath->setText(settings[QString("WPACLI_PATH")]);
|
||||
ui->lineEdit_wpaSupPath->setText(settings[QString("WPASUP_PATH")]);
|
||||
ui->lineEdit_wpaSupDrivers->setText(settings[QString("WPA_DRIVERS")]);
|
||||
@ -353,7 +336,6 @@ QMap<QString, QString> SettingsWindow::getDefault()
|
||||
settings[QString("RFKILL_DIR")] = QString("/sys/class/rfkill/");
|
||||
settings[QString("SUDO_PATH")] = QString("/usr/bin/kdesu");
|
||||
settings[QString("SYSTEMCTL_PATH")] = QString("/usr/bin/systemctl");
|
||||
settings[QString("WPAACTIOND_PATH")] = QString("/usr/bin/wpa_actiond");
|
||||
settings[QString("WPACLI_PATH")] = QString("/usr/bin/wpa_cli");
|
||||
settings[QString("WPASUP_PATH")] = QString("/usr/bin/wpa_supplicant");
|
||||
settings[QString("WPA_DRIVERS")] = QString("nl80211,wext");
|
||||
|
@ -57,7 +57,6 @@ private slots:
|
||||
void selectRfkillDir();
|
||||
void selectSudoPath();
|
||||
void selectSystemctlPath();
|
||||
void selectWpaActiondPath();
|
||||
void selectWpaCliPath();
|
||||
void selectWpaSupPath();
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>670</width>
|
||||
<height>331</height>
|
||||
<width>668</width>
|
||||
<height>329</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -127,8 +127,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>454</width>
|
||||
<height>270</height>
|
||||
<width>452</width>
|
||||
<height>268</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
@ -194,8 +194,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>454</width>
|
||||
<height>270</height>
|
||||
<width>452</width>
|
||||
<height>268</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
@ -381,8 +381,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>454</width>
|
||||
<height>270</height>
|
||||
<width>452</width>
|
||||
<height>268</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
@ -451,8 +451,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>454</width>
|
||||
<height>270</height>
|
||||
<width>452</width>
|
||||
<height>268</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
@ -518,37 +518,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_wpaActiondPath">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_wpaActiondPath">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>wpa_actiond path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_wpaActiondPath">
|
||||
<property name="toolTip">
|
||||
<string>Path to wpa_actiond</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_wpaActiondPath">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_pid">
|
||||
<item>
|
||||
@ -679,8 +648,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>454</width>
|
||||
<height>270</height>
|
||||
<width>436</width>
|
||||
<height>103</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
|
Reference in New Issue
Block a user