mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-06 10:35:46 +00:00
update netctlProfileInfo structure
This commit is contained in:
@ -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; i<profiles.count(); i++) {
|
||||
@ -424,8 +425,27 @@ void MainWindow::updateMainTab()
|
||||
ui->tableWidget_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);
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>477</width>
|
||||
<height>505</height>
|
||||
<width>475</width>
|
||||
<height>503</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -92,7 +92,15 @@
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Status</string>
|
||||
<string>Active</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
|
||||
@ -206,8 +214,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>445</width>
|
||||
<height>349</height>
|
||||
<width>443</width>
|
||||
<height>347</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -367,7 +375,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>477</width>
|
||||
<width>475</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -573,7 +581,9 @@
|
||||
</action>
|
||||
<action name="actionReport">
|
||||
<property name="icon">
|
||||
<iconset theme="tools-report-bug"/>
|
||||
<iconset theme="tools-report-bug">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Report a bug</string>
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user