wpa_gui: Make Status strings visible to linguist

Linguist cannot see the strings coming from wpa_supplicant, so create
a function that translates these to tr() strings inside wpa_gui
source code.
This commit is contained in:
Stefan Oswald 2010-04-11 22:42:02 +03:00 committed by Jouni Malinen
parent 9086fe4466
commit 0d76b1ab5f
2 changed files with 27 additions and 1 deletions

View file

@ -460,6 +460,31 @@ int WpaGui::ctrlRequest(const char *cmd, char *buf, size_t *buflen)
}
QString WpaGui::wpaStateTranslate(char *state)
{
if (!strcmp(state, "DISCONNECTED"))
return tr("Disconnected");
else if (!strcmp(state, "INACTIVE"))
return tr("Inactive");
else if (!strcmp(state, "SCANNING"))
return tr("Scanning");
else if (!strcmp(state, "AUTHENTICATING"))
return tr("Authenticating");
else if (!strcmp(state, "ASSOCIATING"))
return tr("Associating");
else if (!strcmp(state, "ASSOCIATED"))
return tr("Associated");
else if (!strcmp(state, "4WAY_HANDSHAKE"))
return tr("4-Way Handshake");
else if (!strcmp(state, "GROUP_HANDSHAKE"))
return tr("Group Handshake");
else if (!strcmp(state, "COMPLETED"))
return tr("Completed");
else
return tr("Unknown");
}
void WpaGui::updateStatus()
{
char buf[2048], *start, *end, *pos;
@ -528,7 +553,7 @@ void WpaGui::updateStatus()
textIpAddress->setText(pos);
} else if (strcmp(start, "wpa_state") == 0) {
status_updated = true;
textStatus->setText(pos);
textStatus->setText(wpaStateTranslate(pos));
} else if (strcmp(start, "key_mgmt") == 0) {
auth_updated = true;
textAuthentication->setText(pos);

View file

@ -118,6 +118,7 @@ private:
QAction *quitAction;
QMenu *tray_menu;
QSystemTrayIcon *tray_icon;
QString wpaStateTranslate(char *state);
void createTrayIcon(bool);
bool ackTrayIcon;
bool startInTray;