mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-08 03:15:54 +00:00
small edit of showing information
This commit is contained in:
@ -480,10 +480,33 @@ void MainWindow::connectToUnknownEssid(const QString passwd)
|
||||
netctlCommand->startProfile(profile);
|
||||
status = netctlCommand->isProfileActive(profile);
|
||||
}
|
||||
if (status)
|
||||
QString message;
|
||||
if (status) {
|
||||
message = QApplication::translate("MainWindow", "Connection is successfully.");
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
else
|
||||
} else {
|
||||
message = QApplication::translate("MainWindow", "Connection failed.");
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Error"));
|
||||
}
|
||||
message += QString("\n");
|
||||
message += QApplication::translate("MainWindow", "Do you want to save profile %1?").arg(profile);
|
||||
int select = QMessageBox::question(this, QApplication::translate("MainWindow", "WiFi menu"),
|
||||
message, QMessageBox::Save | QMessageBox::Discard, QMessageBox::Save);
|
||||
switch (select) {
|
||||
case QMessageBox::Save:
|
||||
break;
|
||||
case QMessageBox::Discard:
|
||||
default:
|
||||
if (useHelper) {
|
||||
QList<QVariant> args;
|
||||
args.append(profile);
|
||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
||||
DBUS_HELPER_INTERFACE, QString("Remove"),
|
||||
args, true, debug)[0].toBool();
|
||||
} else
|
||||
netctlProfile->removeProfile(profile);
|
||||
break;
|
||||
}
|
||||
|
||||
updateWifiTab();
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ MainWindow::MainWindow(QWidget *parent,
|
||||
qtTranslator(qtAppTranslator),
|
||||
translator(appTranslator)
|
||||
{
|
||||
setWindowIcon(QIcon(":icon"));
|
||||
if (debug) qDebug() << PDEBUG << ":" << "about" << args[QString("about")].toBool();
|
||||
if (debug) qDebug() << PDEBUG << ":" << "auto" << args[QString("auto")].toBool();
|
||||
if (debug) qDebug() << PDEBUG << ":" << "config" << configPath;
|
||||
|
@ -96,18 +96,23 @@ void TrayIcon::updateMenu()
|
||||
contextMenu[QString("title")]->setText(QApplication::translate("TrayIcon", "(inactive)"));
|
||||
} else {
|
||||
contextMenu[QString("title")]->setIcon(QIcon(QString(":network-idle-64x64")));
|
||||
QStringList status;
|
||||
if (netctlAutoStatus)
|
||||
QStringList currentProfiles, status;
|
||||
if (netctlAutoStatus) {
|
||||
currentProfiles.append(current);
|
||||
status.append(QApplication::translate("TrayIcon", "(netctl-auto)"));
|
||||
else {
|
||||
for (int i=0; i<enabled.split(QChar('|')).count(); i++)
|
||||
} else {
|
||||
for (int i=0; i<enabled.split(QChar('|')).count(); i++) {
|
||||
currentProfiles.append(current.split(QChar('|'))[i]);
|
||||
if (enabled.split(QChar('|'))[i] == QString("0"))
|
||||
status.append(QApplication::translate("TrayIcon", "static"));
|
||||
else
|
||||
status.append(QApplication::translate("TrayIcon", "enabled"));
|
||||
}
|
||||
}
|
||||
contextMenu[QString("title")]->setText(current + QString(" ") +
|
||||
QString("(") + status.join(QChar('|')) + QString(")"));
|
||||
QStringList profiles;
|
||||
for (int i=0; i<currentProfiles.count(); i++)
|
||||
profiles.append(currentProfiles[i] + QString(" (") + status[i] + QString(")"));
|
||||
contextMenu[QString("title")]->setText(profiles.join(QString(" | ")));
|
||||
}
|
||||
|
||||
if (netctlAutoStatus) {
|
||||
|
Reference in New Issue
Block a user