mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 23:47:21 +00:00
rewrite errorwindow
This commit is contained in:
parent
5e1a4be134
commit
79fc70efa1
@ -16,88 +16,194 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "errorwindow.h"
|
||||
#include "ui_errorwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QGridLayout>
|
||||
#include <QSpacerItem>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
ErrorWindow::ErrorWindow(QWidget *parent, const bool debugCmd, const int messageNumber)
|
||||
: QMainWindow(parent),
|
||||
debug(debugCmd),
|
||||
ui(new Ui::ErrorWindow)
|
||||
ErrorWindow::ErrorWindow(QWidget *parent, const bool debugCmd)
|
||||
: debug(debugCmd)
|
||||
{
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[ErrorWindow]" << ":" << "Initializate with error code" << messageNumber;
|
||||
|
||||
ui->setupUi(this);
|
||||
setMessage(messageNumber);
|
||||
}
|
||||
|
||||
|
||||
ErrorWindow::~ErrorWindow()
|
||||
{
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[~ErrorWindow]";
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ErrorWindow::setMessage(const int mess)
|
||||
{
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[setMessage]";
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[setMessage]" << ":" << "Message" << mess;
|
||||
|
||||
QString message;
|
||||
QStringList ErrorWindow::getMessage(const int mess)
|
||||
{
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[getMessage]";
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[getMessage]" << ":" << "Message" << mess;
|
||||
|
||||
QString message, title;
|
||||
switch(mess) {
|
||||
case 1:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Could not find components");
|
||||
break;
|
||||
case 2:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Does not support yet");
|
||||
break;
|
||||
case 3:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Profile name is not set");
|
||||
break;
|
||||
case 4:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Bind interfaces are not set");
|
||||
break;
|
||||
case 5:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Description is not set");
|
||||
break;
|
||||
case 6:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Ip settings are not set");
|
||||
break;
|
||||
case 7:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Configuration file does not exist");
|
||||
break;
|
||||
case 8:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Key is not set");
|
||||
break;
|
||||
case 9:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Wireless settings are not set");
|
||||
break;
|
||||
case 10:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Configuration file is not set");
|
||||
break;
|
||||
case 11:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "ESSID is not set");
|
||||
break;
|
||||
case 12:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "MAC address is incorrect");
|
||||
break;
|
||||
case 13:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Session ID is not set");
|
||||
break;
|
||||
case 14:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "APN is not set");
|
||||
break;
|
||||
case 15:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "APN is not set");
|
||||
break;
|
||||
case 16:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Empty user/group name");
|
||||
break;
|
||||
default:
|
||||
title = QApplication::translate("ErrorWindow", "Error!");
|
||||
message = QApplication::translate("ErrorWindow", "Unknown error");
|
||||
break;
|
||||
}
|
||||
|
||||
ui->label->setText(message);
|
||||
QStringList fullMessage;
|
||||
fullMessage.append(title);
|
||||
fullMessage.append(message);
|
||||
return fullMessage;
|
||||
}
|
||||
|
||||
|
||||
QMessageBox::Icon ErrorWindow::getIcon(const int mess)
|
||||
{
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[getIcon]";
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[getIcon]" << ":" << "Message" << mess;
|
||||
|
||||
QMessageBox::Icon icon;
|
||||
switch(mess) {
|
||||
case 1:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 2:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 3:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 4:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 5:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 6:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 7:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 8:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 9:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 10:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 11:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 12:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 13:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 14:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 15:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
case 16:
|
||||
icon = QMessageBox::Critical;
|
||||
break;
|
||||
default:
|
||||
icon = QMessageBox::NoIcon;
|
||||
break;
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
void ErrorWindow::showWindow(const int mess, const QString sender)
|
||||
{
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[showWindow]";
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[showWindow]" << ":" << "Message" << mess;
|
||||
if (debug) qDebug() << "[ErrorWindow]" << "[showWindow]" << ":" << "Sender" << sender;
|
||||
|
||||
QStringList message = getMessage(mess);
|
||||
QMessageBox messageBox;
|
||||
messageBox.setText(message[0]);
|
||||
messageBox.setInformativeText(message[1]);
|
||||
if (debug)
|
||||
messageBox.setDetailedText(QApplication::translate("ErrorWindow", "Sender : %1").
|
||||
arg(sender));
|
||||
messageBox.setIcon(getIcon(mess));
|
||||
messageBox.setStandardButtons(QMessageBox::Ok);
|
||||
messageBox.setDefaultButton(QMessageBox::Ok);
|
||||
|
||||
QSpacerItem *horizontalSpacer = new QSpacerItem(400, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
QGridLayout *layout = (QGridLayout *)messageBox.layout();
|
||||
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
|
||||
|
||||
messageBox.exec();
|
||||
return;
|
||||
}
|
||||
|
@ -18,27 +18,28 @@
|
||||
#ifndef ERRORWINDOW_H
|
||||
#define ERRORWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QMessageBox>
|
||||
#include <QObject>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class ErrorWindow;
|
||||
}
|
||||
|
||||
class ErrorWindow : public QMainWindow
|
||||
class ErrorWindow : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ErrorWindow(QWidget *parent = 0,
|
||||
const bool debugCmd = false,
|
||||
const int messageNumber = 0);
|
||||
const bool debugCmd = false);
|
||||
~ErrorWindow();
|
||||
|
||||
public slots:
|
||||
void showWindow(const int mess = 0,
|
||||
const QString sender = QString());
|
||||
|
||||
private:
|
||||
bool debug;
|
||||
Ui::ErrorWindow *ui;
|
||||
void setMessage(const int mess);
|
||||
QStringList getMessage(const int mess);
|
||||
QMessageBox::Icon getIcon(const int mess);
|
||||
};
|
||||
|
||||
|
||||
#endif /* ERRORWINDOW_H */
|
||||
|
@ -75,8 +75,11 @@ MainWindow::MainWindow(QWidget *parent,
|
||||
configuration = settingsWin->getSettings();
|
||||
|
||||
// gui
|
||||
// windows
|
||||
aboutWin = new AboutWindow(this, debug);
|
||||
errorWin = new ErrorWindow(this, debug);
|
||||
netctlAutoWin = new NetctlAutoWindow(this, debug, configuration);
|
||||
// profile widgets
|
||||
generalWid = new GeneralWidget(this, configuration);
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(generalWid);
|
||||
ipWid = new IpWidget(this);
|
||||
@ -145,6 +148,7 @@ MainWindow::~MainWindow()
|
||||
delete wirelessWid;
|
||||
|
||||
delete aboutWin;
|
||||
delete errorWin;
|
||||
delete netctlAutoWin;
|
||||
delete settingsWin;
|
||||
delete ui;
|
||||
@ -314,6 +318,7 @@ void MainWindow::updateTabs(const int tab)
|
||||
updateProfileTab();
|
||||
else if (tab == 2)
|
||||
updateWifiTab();
|
||||
updateMenu(tab);
|
||||
}
|
||||
|
||||
|
||||
@ -336,11 +341,8 @@ void MainWindow::updateMenu(const int tab)
|
||||
void MainWindow::updateMainTab()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[updateMainTab]";
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [updateMainTab]"));
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
QList<QStringList> profiles = netctlCommand->getProfileList();
|
||||
@ -454,11 +456,8 @@ void MainWindow::updateWifiTab()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[updateWifiTab]";
|
||||
wifiTabSetEnabled(checkExternalApps(QString("wpasup")));
|
||||
if (!checkExternalApps(QString("wpasup"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("wpasup")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [updateWifiTab]"));
|
||||
|
||||
QList<QStringList> scanResults = wpaCommand->scanWifi();
|
||||
|
||||
@ -633,11 +632,8 @@ void MainWindow::mainTabRemoveProfile()
|
||||
void MainWindow::mainTabEnableProfile()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[mainTabEnableProfile]";
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [mainTabEnableProfile]"));
|
||||
if (ui->tableWidget_main->currentItem() == 0)
|
||||
return;
|
||||
|
||||
@ -665,11 +661,8 @@ void MainWindow::mainTabEnableProfile()
|
||||
void MainWindow::mainTabRestartProfile()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[mainTabRestartProfile]";
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [mainTabRestartProfile]"));
|
||||
if (ui->tableWidget_main->currentItem() == 0)
|
||||
return;
|
||||
|
||||
@ -688,11 +681,8 @@ void MainWindow::mainTabRestartProfile()
|
||||
void MainWindow::mainTabStartProfile()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[mainTabStartProfile]";
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [mainTabStartProfile]"));
|
||||
if (ui->tableWidget_main->currentItem() == 0)
|
||||
return;
|
||||
|
||||
@ -721,11 +711,8 @@ void MainWindow::mainTabRefreshButtons(QTableWidgetItem *current, QTableWidgetIt
|
||||
{
|
||||
Q_UNUSED(previous);
|
||||
if (debug) qDebug() << "[MainWindow]" << "[mainTabRefreshButtons]";
|
||||
if (!checkExternalApps(QString("netctl"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("netctl")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [mainTabRefreshButtons]"));
|
||||
if (current == 0) {
|
||||
ui->pushButton_mainRestart->setDisabled(true);
|
||||
ui->pushButton_mainStart->setDisabled(true);
|
||||
@ -919,21 +906,12 @@ void MainWindow::profileTabCreateProfile()
|
||||
if (debug) qDebug() << "[MainWindow]" << "[profileTabCreateProfile]";
|
||||
|
||||
// error checking
|
||||
if (ui->comboBox_profile->currentText().isEmpty()) {
|
||||
errorWin = new ErrorWindow(this, debug, 3);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (generalWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 4);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (generalWid->isOk() == 2) {
|
||||
errorWin = new ErrorWindow(this, debug, 5);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (ui->comboBox_profile->currentText().isEmpty())
|
||||
return errorWin->showWindow(3, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
if (generalWid->isOk() == 1)
|
||||
return errorWin->showWindow(4, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (generalWid->isOk() == 2)
|
||||
return errorWin->showWindow(5, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
if ((generalWid->connectionType->currentText() == QString("ethernet")) ||
|
||||
(generalWid->connectionType->currentText() == QString("wireless")) ||
|
||||
(generalWid->connectionType->currentText() == QString("bond")) ||
|
||||
@ -943,114 +921,60 @@ void MainWindow::profileTabCreateProfile()
|
||||
(generalWid->connectionType->currentText() == QString("tuntap")) ||
|
||||
(generalWid->connectionType->currentText() == QString("vlan")) ||
|
||||
(generalWid->connectionType->currentText() == QString("macvlan"))) {
|
||||
if (ipWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 6);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (ipWid->isOk() == 2) {
|
||||
errorWin = new ErrorWindow(this, debug, 6);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (ipWid->isOk() == 1)
|
||||
return errorWin->showWindow(6, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (ipWid->isOk() == 2)
|
||||
return errorWin->showWindow(6, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
if (generalWid->connectionType->currentText() == QString("ethernet")) {
|
||||
if (ethernetWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 7);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (ethernetWid->isOk() == 1)
|
||||
return errorWin->showWindow(7, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("wireless")) {
|
||||
if (wirelessWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 8);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (wirelessWid->isOk() == 2) {
|
||||
errorWin = new ErrorWindow(this, debug, 9);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (wirelessWid->isOk() == 3) {
|
||||
errorWin = new ErrorWindow(this, debug, 10);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (wirelessWid->isOk() == 4) {
|
||||
errorWin = new ErrorWindow(this, debug, 7);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (wirelessWid->isOk() == 5) {
|
||||
errorWin = new ErrorWindow(this, debug, 11);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (wirelessWid->isOk() == 1)
|
||||
return errorWin->showWindow(8, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (wirelessWid->isOk() == 2)
|
||||
return errorWin->showWindow(9, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (wirelessWid->isOk() == 3)
|
||||
return errorWin->showWindow(10, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (wirelessWid->isOk() == 4)
|
||||
return errorWin->showWindow(7, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (wirelessWid->isOk() == 5)
|
||||
return errorWin->showWindow(11, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("bridge")) {
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("pppoe")) {
|
||||
if (pppoeWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 7);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (pppoeWid->isOk() == 2) {
|
||||
errorWin = new ErrorWindow(this, debug, 12);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (pppoeWid->isOk() == 3) {
|
||||
errorWin = new ErrorWindow(this, debug, 13);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
else if (pppoeWid->isOk() == 4) {
|
||||
errorWin = new ErrorWindow(this, debug, 12);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (pppoeWid->isOk() == 1)
|
||||
return errorWin->showWindow(7, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (pppoeWid->isOk() == 2)
|
||||
return errorWin->showWindow(12, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (pppoeWid->isOk() == 3)
|
||||
return errorWin->showWindow(13, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
else if (pppoeWid->isOk() == 4)
|
||||
return errorWin->showWindow(12, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("mobile_ppp")) {
|
||||
if (mobileWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 14);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (mobileWid->isOk() == 2) {
|
||||
errorWin = new ErrorWindow(this, debug, 7);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (mobileWid->isOk() == 1)
|
||||
return errorWin->showWindow(14, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
if (mobileWid->isOk() == 2)
|
||||
return errorWin->showWindow(7, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("tunnel")) {
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("tuntap")) {
|
||||
if (tuntapWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 15);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (tuntapWid->isOk() == 2) {
|
||||
errorWin = new ErrorWindow(this, debug, 15);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (tuntapWid->isOk() == 1)
|
||||
return errorWin->showWindow(15, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
if (tuntapWid->isOk() == 2)
|
||||
return errorWin->showWindow(15, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("vlan")) {
|
||||
if (ethernetWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 7);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (ethernetWid->isOk() == 1)
|
||||
return errorWin->showWindow(7, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
else if (generalWid->connectionType->currentText() == QString("macvlan")) {
|
||||
if (ethernetWid->isOk() == 1) {
|
||||
errorWin = new ErrorWindow(this, debug, 7);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (ethernetWid->isOk() == 1)
|
||||
return errorWin->showWindow(7, QString("[MainWindow] : [profileTabCreateProfile]"));
|
||||
}
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
@ -1333,11 +1257,8 @@ void MainWindow::setHiddenName(const QString name)
|
||||
void MainWindow::wifiTabStart()
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[wifiTabStart]";
|
||||
if (!checkExternalApps(QString("wpasup"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("wpasup")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [wifiTabStart]"));
|
||||
if (ui->tableWidget_wifi->currentItem() == 0)
|
||||
return;
|
||||
|
||||
@ -1404,11 +1325,8 @@ void MainWindow::wifiTabRefreshButtons(QTableWidgetItem *current, QTableWidgetIt
|
||||
{
|
||||
Q_UNUSED(previous);
|
||||
if (debug) qDebug() << "[MainWindow]" << "[wifiTabRefreshButtons]";
|
||||
if (!checkExternalApps(QString("wpasup"))) {
|
||||
errorWin = new ErrorWindow(this, debug, 1);
|
||||
errorWin->show();
|
||||
return;
|
||||
}
|
||||
if (!checkExternalApps(QString("wpasup")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [wifiTabRefreshButtons]"));
|
||||
if (current == 0) {
|
||||
ui->pushButton_wifiStart->setDisabled(true);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user