mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-12-16 07:23:41 +00:00
add openProfile
This commit is contained in:
@ -51,7 +51,8 @@ MainWindow::MainWindow(QWidget *parent,
|
||||
const bool showAbout,
|
||||
const bool showNetctlAuto,
|
||||
const bool showSettings,
|
||||
const int tabNum)
|
||||
const int tabNum,
|
||||
const QString openProfile)
|
||||
: QMainWindow(parent),
|
||||
ui(new Ui::MainWindow),
|
||||
debug(debugCmd)
|
||||
@ -61,6 +62,7 @@ MainWindow::MainWindow(QWidget *parent,
|
||||
if (debug) qDebug() << "[MainWindow]" << "[MainWindow]" << ":" << "showNetctlAuto" << showNetctlAuto;
|
||||
if (debug) qDebug() << "[MainWindow]" << "[MainWindow]" << ":" << "showSettings" << showSettings;
|
||||
if (debug) qDebug() << "[MainWindow]" << "[MainWindow]" << ":" << "tabNum" << tabNum;
|
||||
if (debug) qDebug() << "[MainWindow]" << "[MainWindow]" << ":" << "openProfile" << openProfile;
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->setCurrentIndex(tabNum-1);
|
||||
@ -107,6 +109,12 @@ MainWindow::MainWindow(QWidget *parent,
|
||||
updateTabs(ui->tabWidget->currentIndex());
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Ready"));
|
||||
|
||||
if (openProfile != QString("PROFILE")) {
|
||||
ui->comboBox_profile->addItem(openProfile);
|
||||
ui->comboBox_profile->setCurrentIndex(ui->comboBox_profile->count()-1);
|
||||
profileTabLoadProfile();
|
||||
}
|
||||
|
||||
if (showAbout)
|
||||
aboutWin->show();
|
||||
if (showNetctlAuto)
|
||||
@ -599,7 +607,8 @@ void MainWindow::mainTabEditProfile()
|
||||
ui->tabWidget->setDisabled(true);
|
||||
QString profile = ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 0)->text();
|
||||
ui->tabWidget->setCurrentIndex(1);
|
||||
ui->comboBox_profile->setCurrentIndex(ui->comboBox_profile->findText(profile));
|
||||
ui->comboBox_profile->addItem(profile);
|
||||
ui->comboBox_profile->setCurrentIndex(ui->comboBox_profile->count()-1);
|
||||
|
||||
profileTabLoadProfile();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user