mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-06 10:35:46 +00:00
update gui
This commit is contained in:
@ -49,6 +49,12 @@ void AboutWindow::createText()
|
||||
{
|
||||
if (debug) qDebug() << "[AboutWindow]" << "[createText]";
|
||||
|
||||
QStringList trdPartyList = QString(TRDPARTY_LICENSE).split(QChar(';'), QString::SkipEmptyParts);
|
||||
for (int i=0; i<trdPartyList.count(); i++)
|
||||
trdPartyList[i] = QString("<a href=\"%3\">%1</a> (%2 license)")
|
||||
.arg(trdPartyList[i].split(QChar(','))[0])
|
||||
.arg(trdPartyList[i].split(QChar(','))[1])
|
||||
.arg(trdPartyList[i].split(QChar(','))[2]);
|
||||
uiAbout->label_name->setText(QString(NAME));
|
||||
uiAbout->label_version->setText(QApplication::translate("AboutWindow", "Version %1\n(build date %2)")
|
||||
.arg(QString(VERSION)).arg(QString(BUILD_DATE)));
|
||||
@ -61,8 +67,8 @@ void AboutWindow::createText()
|
||||
QString("<a href=\"%1\">%2</a><br>").arg(QString(TRANSLATION)).arg(QApplication::translate("AboutWindow", "Translation issue")) +\
|
||||
QString("<a href=\"%1\">%2</a>").arg(QString(AUR_PACKAGES)).arg(QApplication::translate("AboutWindow", "AUR packages")));
|
||||
uiAbout->label_license->setText(QString("<small>© %1 <a href=\"mailto:%2\">%3</a><br>").arg(QString(DATE)).arg(QString(EMAIL)).arg(QString(AUTHOR)) +
|
||||
QApplication::translate("AboutWindow", "This software is licensed under %1").arg(QString(LICENSE)) +
|
||||
QString("</small>"));
|
||||
QApplication::translate("AboutWindow", "This software is licensed under %1").arg(QString(LICENSE)) + QString("<br>") +
|
||||
QApplication::translate("AboutWindow", "This software uses: %1").arg(trdPartyList.join(QString(", "))) + QString("</small>"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -396,7 +396,7 @@ void MainWindow::updateMainTab()
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [updateMainTab]"));
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
QList<QStringList> profiles = netctlCommand->getProfileList();
|
||||
QList<netctlProfileInfo> profiles = netctlCommand->getProfileList();
|
||||
|
||||
if (netctlCommand->isNetctlAutoRunning())
|
||||
ui->widget_netctlAuto->setHidden(false);
|
||||
@ -418,13 +418,13 @@ void MainWindow::updateMainTab()
|
||||
// create items
|
||||
for (int i=0; i<profiles.count(); i++) {
|
||||
// name
|
||||
ui->tableWidget_main->setItem(i, 0, new QTableWidgetItem(profiles[i][0]));
|
||||
ui->tableWidget_main->setItem(i, 0, new QTableWidgetItem(profiles[i].name));
|
||||
ui->tableWidget_main->item(i, 0)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
// description
|
||||
ui->tableWidget_main->setItem(i, 1, new QTableWidgetItem(profiles[i][1]));
|
||||
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][2]));
|
||||
ui->tableWidget_main->setItem(i, 2, new QTableWidgetItem(profiles[i].status));
|
||||
ui->tableWidget_main->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
}
|
||||
|
||||
@ -513,9 +513,9 @@ void MainWindow::updateWifiTab()
|
||||
if (!checkExternalApps(QString("wpasup")))
|
||||
return errorWin->showWindow(1, QString("[MainWindow] : [updateWifiTab]"));
|
||||
|
||||
QList<QStringList> scanResults = wpaCommand->scanWifi();
|
||||
|
||||
ui->tabWidget->setDisabled(true);
|
||||
QList<netctlWifiInfo> scanResults = wpaCommand->scanWifi();
|
||||
|
||||
ui->tableWidget_wifi->setSortingEnabled(false);
|
||||
ui->tableWidget_wifi->selectRow(-1);
|
||||
ui->tableWidget_wifi->sortByColumn(0, Qt::AscendingOrder);
|
||||
@ -532,16 +532,16 @@ void MainWindow::updateWifiTab()
|
||||
// create items
|
||||
for (int i=0; i<scanResults.count(); i++) {
|
||||
// name
|
||||
ui->tableWidget_wifi->setItem(i, 0, new QTableWidgetItem(scanResults[i][0]));
|
||||
ui->tableWidget_wifi->setItem(i, 0, new QTableWidgetItem(scanResults[i].name));
|
||||
ui->tableWidget_wifi->item(i, 0)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
// status
|
||||
ui->tableWidget_wifi->setItem(i, 1, new QTableWidgetItem(scanResults[i][1]));
|
||||
ui->tableWidget_wifi->setItem(i, 1, new QTableWidgetItem(scanResults[i].status));
|
||||
ui->tableWidget_wifi->item(i, 1)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
// signal
|
||||
ui->tableWidget_wifi->setItem(i, 2, new QTableWidgetItem(scanResults[i][2]));
|
||||
ui->tableWidget_wifi->setItem(i, 2, new QTableWidgetItem(scanResults[i].signal));
|
||||
ui->tableWidget_wifi->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
// security
|
||||
ui->tableWidget_wifi->setItem(i, 3, new QTableWidgetItem(scanResults[i][3]));
|
||||
ui->tableWidget_wifi->setItem(i, 3, new QTableWidgetItem(scanResults[i].security));
|
||||
ui->tableWidget_wifi->item(i, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
}
|
||||
|
||||
@ -936,9 +936,9 @@ void MainWindow::profileTabClear()
|
||||
if (debug) qDebug() << "[MainWindow]" << "[profileTabClear]";
|
||||
|
||||
ui->comboBox_profile->clear();
|
||||
QList<QStringList> profiles = netctlCommand->getProfileList();
|
||||
QList<netctlProfileInfo> profiles = netctlCommand->getProfileList();
|
||||
for (int i=0; i<profiles.count(); i++)
|
||||
ui->comboBox_profile->addItem(profiles[i][0]);
|
||||
ui->comboBox_profile->addItem(profiles[i].name);
|
||||
ui->comboBox_profile->setCurrentIndex(-1);
|
||||
|
||||
generalWid->clear();
|
||||
@ -1268,12 +1268,12 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
|
||||
|
||||
if (passwdWid != 0)
|
||||
delete passwdWid;
|
||||
if (netctlCommand->getInterfaceList().isEmpty())
|
||||
if (netctlCommand->getWirelessInterfaceList().isEmpty())
|
||||
return;
|
||||
|
||||
QMap<QString, QString> settings;
|
||||
settings[QString("Description")] = QString("'Automatically generated profile by Netctl GUI'");
|
||||
settings[QString("Interface")] = netctlCommand->getInterfaceList()[0];
|
||||
settings[QString("Interface")] = netctlCommand->getWirelessInterfaceList()[0];
|
||||
settings[QString("Connection")] = QString("wireless");
|
||||
QString security = ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 3)->text();
|
||||
if (checkState(QString("WPA"), security))
|
||||
|
@ -88,7 +88,7 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
||||
if (debug) qDebug() << "[NetctlAutoWindow]" << "[netctlAutoUpdateTable]";
|
||||
|
||||
ui->tableWidget->setDisabled(true);
|
||||
QList<QStringList> profiles = netctlCommand->getProfileListFromNetctlAuto();
|
||||
QList<netctlProfileInfo> profiles = netctlCommand->getProfileListFromNetctlAuto();
|
||||
|
||||
// actions
|
||||
if (netctlCommand->isNetctlAutoEnabled())
|
||||
@ -99,12 +99,16 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
||||
if (netctlCommand->isNetctlAutoRunning()) {
|
||||
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is running"));
|
||||
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Stop service"));
|
||||
ui->actionDisableAll->setVisible(true);
|
||||
ui->actionEnableAll->setVisible(true);
|
||||
ui->actionRestartService->setVisible(true);
|
||||
}
|
||||
else {
|
||||
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Start service"));
|
||||
ui->actionRestartService->setVisible(false);
|
||||
ui->label_info->setText(QApplication::translate("NetctlAutoWindow", "netctl-auto is not running"));
|
||||
ui->actionStartService->setText(QApplication::translate("NetctlAutoWindow", "Start service"));
|
||||
ui->actionDisableAll->setVisible(false);
|
||||
ui->actionEnableAll->setVisible(false);
|
||||
ui->actionRestartService->setVisible(false);
|
||||
netctlAutoRefreshButtons(0, 0);
|
||||
return;
|
||||
}
|
||||
@ -125,30 +129,26 @@ void NetctlAutoWindow::netctlAutoUpdateTable()
|
||||
// create items
|
||||
for (int i=0; i<profiles.count(); i++) {
|
||||
// name
|
||||
ui->tableWidget->setItem(i, 0, new QTableWidgetItem(profiles[i][0]));
|
||||
ui->tableWidget->setItem(i, 0, new QTableWidgetItem(profiles[i].name));
|
||||
ui->tableWidget->item(i, 0)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
if (profiles[i][2] == QString("*")) {
|
||||
// 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("*")) {
|
||||
// active
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
ui->tableWidget->item(i, 0)->setFont(font);
|
||||
}
|
||||
else if (profiles[i][2] == QString("!")) {
|
||||
QFont font;
|
||||
font.setItalic(true);
|
||||
ui->tableWidget->item(i, 0)->setFont(font);
|
||||
}
|
||||
// description
|
||||
ui->tableWidget->setItem(i, 1, new QTableWidgetItem(profiles[i][1]));
|
||||
ui->tableWidget->item(i, 1)->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
if (profiles[i][2] == QString("*")) {
|
||||
// active
|
||||
ui->tableWidget->setItem(i, 2, new QTableWidgetItem(QApplication::translate("NetctlAutoWindow", "yes")));
|
||||
ui->tableWidget->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
}
|
||||
else
|
||||
ui->tableWidget->setItem(i, 2, new QTableWidgetItem(QString("")));
|
||||
if (profiles[i][2] == QString("!")) {
|
||||
if (profiles[i].status == QString("!")) {
|
||||
// disabled
|
||||
QFont font;
|
||||
font.setItalic(true);
|
||||
ui->tableWidget->item(i, 0)->setFont(font);
|
||||
ui->tableWidget->setItem(i, 3, new QTableWidgetItem(QApplication::translate("NetctlAutoWindow", "yes")));
|
||||
ui->tableWidget->item(i, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
}
|
||||
|
Reference in New Issue
Block a user