Skip to content

Commit

Permalink
[NetworkSetup] Added possibility to drop current wifi config
Browse files Browse the repository at this point in the history
Requested by GigaBlue1
  • Loading branch information
teamblue-e2 committed Jun 5, 2024
1 parent 7f97f3c commit 4e83dd5
Show file tree
Hide file tree
Showing 45 changed files with 1,342 additions and 199 deletions.
24 changes: 22 additions & 2 deletions lib/python/Screens/NetworkSetup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import subprocess
from os import path, unlink, system
from os import path, unlink, system, remove
import string
from random import Random
from Screens.Screen import Screen
Expand Down Expand Up @@ -448,7 +448,7 @@ def __init__(self, session, networkinfo, essid=None):

self["Adaptertext"] = StaticText(_("Network:"))
self["Adapter"] = StaticText()
self["introduction2"] = StaticText(_("Press OK to activate the settings."))
self["introduction2"] = StaticText(_("Press green button to activate the settings."))
self["key_red"] = StaticText(_("Cancel"))
self["key_green"] = StaticText(_("Save"))

Expand Down Expand Up @@ -906,6 +906,8 @@ def ok(self):
if self["menulist"].getCurrent()[1][0] == 'extendedSetup':
self.extended = self["menulist"].getCurrent()[1][2]
self.extended(self.session, self.iface)
if self["menulist"].getCurrent()[1] == 'removewifi':
self.session.openWithCallback(self.removeWifiConfig, MessageBox, (_("Are you sure you want to remove your wifi configuration?\n\n") + self.oktext))

def up(self):
self["menulist"].up()
Expand Down Expand Up @@ -949,6 +951,8 @@ def loadDescription(self):
self["description"].setText(_("Set the MAC-adress of your receiver.\n") + self.oktext)
if self["menulist"].getCurrent()[1] == 'ipv6':
self["description"].setText(_("Enable/Disable IPv6 support of your receiver.\n") + self.oktext)
if self["menulist"].getCurrent()[1] == 'removewifi':
self["description"].setText(_("Delete the current Wifi configuration.\n") + self.oktext)

def updateStatusbar(self, data=None):
self.mainmenu = self.genMainMenu()
Expand Down Expand Up @@ -1002,6 +1006,12 @@ def genMainMenu(self):

if path.exists(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkWizard/networkwizard.xml")):
menu.append((_("Network wizard"), "openwizard"))
try:
from Plugins.SystemPlugins.WirelessLan.Wlan import getWlanConfigName
if path.exists(getWlanConfigName(self.iface)):
menu.append((_("Delete Wifi configuration"), "removewifi"))
except:
pass
# CHECK WHICH BOXES NOW SUPPORT MAC-CHANGE VIA GUI
if getBoxType() not in ('DUMMY') and self.iface == 'eth0':
menu.append((_("Network MAC settings"), "mac"))
Expand Down Expand Up @@ -1041,6 +1051,16 @@ def WlanScanClosed(self, *ret):
iStatus.stopWlanConsole()
self.updateStatusbar()

def removeWifiConfig(self, ret=False):
if ret:
from Plugins.SystemPlugins.WirelessLan.Wlan import getWlanConfigName
try:
remove(getWlanConfigName(self.iface))
self.session.open(MessageBox, _("Finished removing your wifi configuration"), type=MessageBox.TYPE_INFO, timeout=10, default=False)
self.updateStatusbar()
except:
self.session.open(MessageBox, _("Error removing your wifi configuration"), type=MessageBox.TYPE_ERROR, timeout=10, default=False)

def restartLan(self, ret=False):
if ret:
iNetwork.restartNetwork(self.restartLanDataAvail)
Expand Down
35 changes: 30 additions & 5 deletions po/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: enigma2 teamBlue\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-04 18:59+0200\n"
"POT-Creation-Date: 2024-06-05 13:49+0200\n"
"PO-Revision-Date: 2018-12-17 02:51+0200\n"
"Last-Translator: Hazem <[email protected]>\n"
"Language-Team: Arabic <[email protected]>\n"
Expand Down Expand Up @@ -1439,6 +1439,14 @@ msgstr "هل أنت متأكد أنك تريد الخروج من هذه النا
msgid "Are you sure you want to reload the EPG data from:\n"
msgstr "هل أنت متأكد أنك تريد الخروج من هذه النافذه ؟"

#, fuzzy
msgid ""
"Are you sure you want to remove your wifi configuration?\n"
"\n"
msgstr ""
"هل أنت متاكد أنك تريد تنشيط تكوينات الشبكه؟\n"
"\n"

msgid ""
"Are you sure you want to restart your network interfaces?\n"
"\n"
Expand Down Expand Up @@ -3677,6 +3685,10 @@ msgstr "مسح البند"
msgid "Delete Image"
msgstr "حذف الملف"

#, fuzzy
msgid "Delete Wifi configuration"
msgstr "تهيئة الموالف"

#, fuzzy
msgid "Delete all the text"
msgstr "مسح مدخل قائمة العرض"
Expand Down Expand Up @@ -3728,6 +3740,10 @@ msgstr ""
msgid "Delete the character under the text cursor"
msgstr ""

#, fuzzy
msgid "Delete the current Wifi configuration.\n"
msgstr "تنشيط التكوين الحالى"

msgid "Delete the selected files or directories"
msgstr ""

Expand Down Expand Up @@ -4849,6 +4865,10 @@ msgstr ""
msgid "Error reading bouquets.tv"
msgstr "إنتهاء تحرير الباقه"

#, fuzzy
msgid "Error removing your wifi configuration"
msgstr "تهيئة الموالف"

#, python-format
msgid ""
"Error renaming %s to %s:\n"
Expand Down Expand Up @@ -5420,6 +5440,10 @@ msgstr "تم الانتهاء"
msgid "Finished configuring your network"
msgstr "تم الانتهاء من تكوين شبكتك"

#, fuzzy
msgid "Finished removing your wifi configuration"
msgstr "تم النتهاء من إعادة تشغيل الشبكه"

msgid "Finished restarting your network"
msgstr "تم النتهاء من إعادة تشغيل الشبكه"

Expand Down Expand Up @@ -9577,10 +9601,6 @@ msgstr "أضغط موافق من الريموت للمتابعه"
msgid "Press OK to activate the selected %s skin."
msgstr "أضغط موافق لتفعيل الجلد المختار."

#
msgid "Press OK to activate the settings."
msgstr "اضغط موافق لتفعيل الاعدادات"

msgid "Press OK to edit the settings."
msgstr "أضغط موافق لتحرير الاعدادات"

Expand Down Expand Up @@ -9630,6 +9650,11 @@ msgstr "أضغط موافق لتبدل الأختيار"
msgid "Press OK, save and exit..."
msgstr ""

#
#, fuzzy
msgid "Press green button to activate the settings."
msgstr "اضغط موافق لتفعيل الاعدادات"

msgid "Press or select button and then press 'OK' for attach function."
msgstr ""

Expand Down
32 changes: 28 additions & 4 deletions po/bg.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: enigma2 teamBlue\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-04 18:59+0200\n"
"POT-Creation-Date: 2024-06-05 13:49+0200\n"
"PO-Revision-Date: 2018-11-12 20:51+0200\n"
"Last-Translator: Мартин Петков <[email protected]>\n"
"Language-Team: Bulgarian\n"
Expand Down Expand Up @@ -1275,6 +1275,14 @@ msgstr ""
"Искате ли да рестартирате вашия мрежов интерфейс?\n"
"\n"

#, fuzzy
msgid ""
"Are you sure you want to remove your wifi configuration?\n"
"\n"
msgstr ""
"Искате ли да активирате тези мрежови настройки?\n"
"\n"

msgid ""
"Are you sure you want to restart your network interfaces?\n"
"\n"
Expand Down Expand Up @@ -3378,6 +3386,10 @@ msgstr "Изтриване запис"
msgid "Delete Image"
msgstr "Неуспешно изтриване!"

#, fuzzy
msgid "Delete Wifi configuration"
msgstr "Тунер конфигурация"

#, fuzzy
msgid "Delete all the text"
msgstr "Изтриване запис"
Expand Down Expand Up @@ -3424,6 +3436,10 @@ msgstr ""
msgid "Delete the character under the text cursor"
msgstr ""

#, fuzzy
msgid "Delete the current Wifi configuration.\n"
msgstr "Моля изчакайте за активиране на вашите мрежови настройки..."

msgid "Delete the selected files or directories"
msgstr ""

Expand Down Expand Up @@ -4459,6 +4475,9 @@ msgstr ""
msgid "Error reading bouquets.tv"
msgstr "редактирането на букет завърши"

msgid "Error removing your wifi configuration"
msgstr ""

#, python-format
msgid ""
"Error renaming %s to %s:\n"
Expand Down Expand Up @@ -4996,6 +5015,10 @@ msgstr "Завърши"
msgid "Finished configuring your network"
msgstr "Завърши мрежовата конфигурация"

#, fuzzy
msgid "Finished removing your wifi configuration"
msgstr "Завърши рестартирането на мрежата"

msgid "Finished restarting your network"
msgstr "Завърши рестартирането на мрежата"

Expand Down Expand Up @@ -8793,9 +8816,6 @@ msgstr "Натиснете ОК на дистанционното за да пр
msgid "Press OK to activate the selected %s skin."
msgstr "Натиснете ОК за да активирате настройките."

msgid "Press OK to activate the settings."
msgstr "Натиснете ОК за да активирате настройките."

msgid "Press OK to edit the settings."
msgstr "Натиснете ОК за да редактирате настройките."

Expand Down Expand Up @@ -8843,6 +8863,10 @@ msgstr ""
msgid "Press OK, save and exit..."
msgstr ""

#, fuzzy
msgid "Press green button to activate the settings."
msgstr "Натиснете ОК за да активирате настройките."

msgid "Press or select button and then press 'OK' for attach function."
msgstr ""

Expand Down
40 changes: 35 additions & 5 deletions po/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: enigma2 teamBlue\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-04 18:59+0200\n"
"POT-Creation-Date: 2024-06-05 13:49+0200\n"
"PO-Revision-Date: 2007-08-14 10:23+0200\n"
"Last-Translator: Oriol Pellicer <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -1429,6 +1429,15 @@ msgstr ""
"segur que vols restaurar\n"
"el següent backup:\n"

#
#, fuzzy
msgid ""
"Are you sure you want to remove your wifi configuration?\n"
"\n"
msgstr ""
"segur que vols restaurar\n"
"el següent backup:\n"

#
msgid ""
"Are you sure you want to restart your network interfaces?\n"
Expand Down Expand Up @@ -3769,6 +3778,11 @@ msgstr "Esborrar entrada"
msgid "Delete Image"
msgstr "Ha fallat l'eliminació!"

#
#, fuzzy
msgid "Delete Wifi configuration"
msgstr "Configuració del sintonitzador"

#
#, fuzzy
msgid "Delete all the text"
Expand Down Expand Up @@ -3827,6 +3841,11 @@ msgstr ""
msgid "Delete the character under the text cursor"
msgstr ""

#
#, fuzzy
msgid "Delete the current Wifi configuration.\n"
msgstr "Configuració del sintonitzador"

msgid "Delete the selected files or directories"
msgstr ""

Expand Down Expand Up @@ -5004,6 +5023,11 @@ msgstr ""
msgid "Error reading bouquets.tv"
msgstr "fi de l'edició de llistes"

#
#, fuzzy
msgid "Error removing your wifi configuration"
msgstr "Configuració del sintonitzador"

#, python-format
msgid ""
"Error renaming %s to %s:\n"
Expand Down Expand Up @@ -5613,6 +5637,11 @@ msgstr ""
msgid "Finished configuring your network"
msgstr ""

#
#, fuzzy
msgid "Finished removing your wifi configuration"
msgstr "Configuració del sintonitzador"

#
msgid "Finished restarting your network"
msgstr ""
Expand Down Expand Up @@ -9952,10 +9981,6 @@ msgstr ""
msgid "Press OK to activate the selected %s skin."
msgstr "Prem OK per a activar la configuració."

#
msgid "Press OK to activate the settings."
msgstr "Prem OK per a activar la configuració."

#
msgid "Press OK to edit the settings."
msgstr ""
Expand Down Expand Up @@ -10014,6 +10039,11 @@ msgstr ""
msgid "Press OK, save and exit..."
msgstr ""

#
#, fuzzy
msgid "Press green button to activate the settings."
msgstr "Prem OK per a activar la configuració."

msgid "Press or select button and then press 'OK' for attach function."
msgstr ""

Expand Down
Loading

0 comments on commit 4e83dd5

Please sign in to comment.