diff --git a/sources/gui/src/mainwindow.cpp b/sources/gui/src/mainwindow.cpp index 3e9f64f..bba0eaa 100644 --- a/sources/gui/src/mainwindow.cpp +++ b/sources/gui/src/mainwindow.cpp @@ -413,7 +413,8 @@ void MainWindow::updateMainTab() QStringList headerList; headerList.append(QApplication::translate("MainWindow", "Name")); headerList.append(QApplication::translate("MainWindow", "Description")); - headerList.append(QApplication::translate("MainWindow", "Status")); + headerList.append(QApplication::translate("MainWindow", "Active")); + headerList.append(QApplication::translate("MainWindow", "Enabled")); ui->tableWidget_main->setHorizontalHeaderLabels(headerList); // create items for (int i=0; itableWidget_main->setItem(i, 1, new QTableWidgetItem(profiles[i].description)); ui->tableWidget_main->item(i, 1)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); // status - ui->tableWidget_main->setItem(i, 2, new QTableWidgetItem(profiles[i].status)); - ui->tableWidget_main->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + if (profiles[i].active) { + // active + QFont font; + font.setBold(true); + ui->tableWidget_main->item(i, 0)->setFont(font); + ui->tableWidget_main->setItem(i, 2, new QTableWidgetItem(QApplication::translate("MainWindow", "yes"))); + ui->tableWidget_main->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + } + else + ui->tableWidget_main->setItem(i, 2, new QTableWidgetItem(QString(""))); + if (profiles[i].enabled) { + // enabled + ui->tableWidget_main->setItem(i, 3, new QTableWidgetItem(QApplication::translate("MainWindow", "yes"))); + ui->tableWidget_main->item(i, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + } + else { + QFont font; + font.setItalic(true); + ui->tableWidget_main->item(i, 0)->setFont(font); + ui->tableWidget_main->setItem(i, 3, new QTableWidgetItem(QString(""))); + } } ui->tableWidget_main->setSortingEnabled(true); diff --git a/sources/gui/src/mainwindow.ui b/sources/gui/src/mainwindow.ui index 56b5a1b..3838b17 100644 --- a/sources/gui/src/mainwindow.ui +++ b/sources/gui/src/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 477 - 505 + 475 + 503 @@ -92,7 +92,15 @@ - Status + Active + + + AlignHCenter|AlignVCenter|AlignCenter + + + + + Enabled AlignHCenter|AlignVCenter|AlignCenter @@ -206,8 +214,8 @@ 0 0 - 445 - 349 + 443 + 347 @@ -367,7 +375,7 @@ 0 0 - 477 + 475 22 @@ -573,7 +581,9 @@ - + + + Report a bug diff --git a/sources/gui/src/netctlautowindow.cpp b/sources/gui/src/netctlautowindow.cpp index efe2bcc..3828f8b 100644 --- a/sources/gui/src/netctlautowindow.cpp +++ b/sources/gui/src/netctlautowindow.cpp @@ -134,7 +134,8 @@ void NetctlAutoWindow::netctlAutoUpdateTable() // description ui->tableWidget->setItem(i, 1, new QTableWidgetItem(profiles[i].description)); ui->tableWidget->item(i, 1)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); - if (profiles[i].status == QString("*")) { + // status + if (profiles[i].active) { // active QFont font; font.setBold(true); @@ -144,7 +145,7 @@ void NetctlAutoWindow::netctlAutoUpdateTable() } else ui->tableWidget->setItem(i, 2, new QTableWidgetItem(QString(""))); - if (profiles[i].status == QString("!")) { + if (profiles[i].enabled) { // disabled QFont font; font.setItalic(true); diff --git a/sources/netctlgui/include/netctlgui/netctlinteract.h b/sources/netctlgui/include/netctlgui/netctlinteract.h index 6be430f..095cb59 100644 --- a/sources/netctlgui/include/netctlgui/netctlinteract.h +++ b/sources/netctlgui/include/netctlgui/netctlinteract.h @@ -40,14 +40,17 @@ class NetctlProfile; * profile name * @var netctlProfileInfo::description * profile description - * @var netctlProfileInfo::status + * @var netctlProfileInfo::active + * profile status + * @var netctlProfileInfo::enabled * profile status */ typedef struct { QString name; QString description; - QString status; + bool active; + bool enabled; } netctlProfileInfo; /** diff --git a/sources/netctlgui/src/netctlinteract.cpp b/sources/netctlgui/src/netctlinteract.cpp index a7cb76a..4b283e8 100644 --- a/sources/netctlgui/src/netctlinteract.cpp +++ b/sources/netctlgui/src/netctlinteract.cpp @@ -164,7 +164,8 @@ QList Netctl::getProfileList() netctlProfileInfo profileInfo; profileInfo.name = output[i].mid(2, -1); profileInfo.description = getProfileDescription(profileInfo.name); - profileInfo.status = getProfileStatus(profileInfo.name); + profileInfo.active = isProfileActive(profileInfo.name); + profileInfo.enabled = isProfileEnabled(profileInfo.name); fullProfilesInfo.append(profileInfo); } @@ -186,7 +187,8 @@ QList Netctl::getProfileListFromNetctlAuto() netctlProfileInfo profileInfo; profileInfo.name = output[i].mid(2, -1); profileInfo.description = getProfileDescription(profileInfo.name); - profileInfo.status = output[i].left(1); + profileInfo.active = autoIsProfileActive(profileInfo.name); + profileInfo.enabled = autoIsProfileEnabled(profileInfo.name); fullProfilesInfo.append(profileInfo); } @@ -272,7 +274,7 @@ bool Netctl::autoIsProfileActive(const QString profile) bool status = false; QList profiles = getProfileListFromNetctlAuto(); for (int i=0; i profiles = getProfileListFromNetctlAuto(); for (int i=0; i