mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-06 18:45:46 +00:00
* add info instrument * implement needToBeConfigured() slot, see #29 * fix (#30) some improvements
This commit is contained in:
@ -196,5 +196,4 @@ void ErrorWindow::showWindow(const int mess, const QString sender, const QString
|
||||
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
|
||||
|
||||
messageBox.exec();
|
||||
return;
|
||||
}
|
||||
|
@ -186,8 +186,11 @@ void MainWindow::updateToolBars()
|
||||
void MainWindow::updateMainTab()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
QList<netctlProfileInfo> profiles;
|
||||
@ -281,8 +284,11 @@ void MainWindow::updateWifiTab()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
wifiTabSetEnabled(checkExternalApps(QString("wpasup")));
|
||||
if (!checkExternalApps(QString("wpasup")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("wpasup"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
QList<netctlWifiInfo> scanResults;
|
||||
@ -436,8 +442,11 @@ void MainWindow::mainTabEditProfile()
|
||||
void MainWindow::mainTabEnableProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
if (ui->tableWidget_main->currentItem() == 0) return;
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
@ -493,8 +502,11 @@ void MainWindow::mainTabRemoveProfile()
|
||||
void MainWindow::mainTabRestartProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
if (ui->tableWidget_main->currentItem() == 0) return;
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
@ -512,8 +524,11 @@ void MainWindow::mainTabRestartProfile()
|
||||
void MainWindow::mainTabStartProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
if (ui->tableWidget_main->currentItem() == 0) return;
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
@ -532,8 +547,11 @@ void MainWindow::mainTabStartProfile()
|
||||
void MainWindow::mainTabStopAllProfiles()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
bool status;
|
||||
@ -555,8 +573,11 @@ void MainWindow::mainTabStopAllProfiles()
|
||||
void MainWindow::mainTabSwitchToProfile()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
if (ui->tableWidget_main->currentItem() == 0) return;
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
@ -1056,8 +1077,11 @@ void MainWindow::wifiTabSetEnabled(const bool state)
|
||||
void MainWindow::wifiTabStart()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("wpasup")))
|
||||
return errorWin->showWindow(1, QString(PDEBUG));
|
||||
if (!checkExternalApps(QString("wpasup"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return;
|
||||
}
|
||||
if (ui->tableWidget_wifi->currentItem() == 0) return;
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
|
@ -268,6 +268,7 @@ bool MainWindow::forceStartHelper()
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
if (!checkExternalApps(QString("helper"))) {
|
||||
errorWin->showWindow(1, QString(PDEBUG));
|
||||
emit(needToBeConfigured());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -278,18 +278,23 @@ bool MainWindow::checkExternalApps(const QString apps = QString("all"))
|
||||
if (configuration[QString("SKIPCOMPONENTS")] == QString("true")) return true;
|
||||
QStringList cmd;
|
||||
cmd.append("which");
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
if ((apps == QString("helper")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("HELPER_PATH")]);
|
||||
}
|
||||
if ((apps == QString("netctl")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("NETCTL_PATH")]);
|
||||
cmd.append(configuration[QString("NETCTLAUTO_PATH")]);
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("sudo")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("systemctl")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("SYSTEMCTL_PATH")]);
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
}
|
||||
if ((apps == QString("wpasup")) || (apps == QString("all"))) {
|
||||
cmd.append(configuration[QString("SUDO_PATH")]);
|
||||
cmd.append(configuration[QString("WPACLI_PATH")]);
|
||||
cmd.append(configuration[QString("WPASUP_PATH")]);
|
||||
}
|
||||
@ -349,6 +354,7 @@ void MainWindow::createActions()
|
||||
connect(ui->pushButton_menu, SIGNAL(clicked(bool)), this, SLOT(updateToolBars()));
|
||||
connect(ui->pushButton_action, SIGNAL(clicked(bool)), this, SLOT(updateToolBars()));
|
||||
connect(ui->pushButton_help, SIGNAL(clicked(bool)), this, SLOT(updateToolBars()));
|
||||
connect(this, SIGNAL(needToBeConfigured()), this, SLOT(showSettingsWindow()));
|
||||
|
||||
// main tab events
|
||||
connect(ui->pushButton_netctlAuto, SIGNAL(clicked(bool)), this, SLOT(showNetctlAutoWindow()));
|
||||
|
@ -99,6 +99,9 @@ public slots:
|
||||
void connectToUnknownEssid(const QString passwd);
|
||||
void setHiddenName(const QString name);
|
||||
|
||||
signals:
|
||||
void needToBeConfigured();
|
||||
|
||||
private slots:
|
||||
void reportABug();
|
||||
// menu update slots
|
||||
|
Reference in New Issue
Block a user