示例#1
0
void MainWidget::mainTabSwitchToProfile()
{
    if (debug) qDebug() << PDEBUG;
    if (!checkExternalApps(QString("netctl"), configuration, debug)) {
        ErrorWindow::showWindow(1, externalApps(QString("netctl"), configuration).join(QChar('\n')), debug);
        return mainWindow->emitNeedToBeConfigured();
    }
    if (ui->tableWidget_main->currentItem() == nullptr) return;

    mainWindow->setDisabled(true);
    QString profile = ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 0)->text();
    InterfaceAnswer answer = switchToProfileSlot(profile, mainWindow->netctlInterface,
                                                 useHelper, debug);
    mainWindow->showMessage(answer == InterfaceAnswer::True);

    updateMainTab();
}
示例#2
0
void MainWindow::mainTabSwitchToProfile()
{
    if (debug) qDebug() << PDEBUG;
    if (!checkExternalApps(QString("netctl"))) {
        ErrorWindow::showWindow(1, QString(PDEBUG), debug);
        emit(needToBeConfigured());
        return;
    }
    if (ui->tableWidget_main->currentItem() == nullptr) return;

    ui->tabWidget->setDisabled(true);
    QString profile = ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 0)->text();
    if (switchToProfileSlot(profile))
        ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
    else
        ui->statusBar->showMessage(QApplication::translate("MainWindow", "Error"));

    updateMainTab();
}