Skip to content

Commit 37e744e

Browse files
committed
Use windowTitle parameter instead of setTitle after init of MessageBox
1 parent 0396cff commit 37e744e

File tree

6 files changed

+26
-41
lines changed

6 files changed

+26
-41
lines changed

lib/python/Plugins/Extensions/AtileHD/plugin.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# -*- coding: utf-8 -*-
22

3-
#This plugin is free software, you are allowed to
4-
#modify it (if you keep the license),
5-
#but you are not allowed to distribute/publish
6-
#it without source code (this version and your modifications).
7-
#This means you also have to distribute
8-
#source code of your modifications.
3+
# This plugin is free software, you are allowed to
4+
# modify it (if you keep the license),
5+
# but you are not allowed to distribute/publish
6+
# it without source code (this version and your modifications).
7+
# This means you also have to distribute
8+
# source code of your modifications.
99
from os import listdir, readlink, remove, rename, symlink, chdir, makedirs, mkdir
1010
from os.path import basename, exists, isdir, islink, realpath
1111
from shutil import rmtree
@@ -543,8 +543,7 @@ def AtileHDScreenCB(self):
543543
self["config"].setCurrentIndex(0)
544544

545545
def restartGUI(self):
546-
restartbox = self.session.openWithCallback(self.restartGUIcb, MessageBox, _("Restart necessary, restart GUI now?"), MessageBox.TYPE_YESNO)
547-
restartbox.setTitle(_("Message"))
546+
self.session.openWithCallback(self.restartGUIcb, MessageBox, _("Restart necessary, restart GUI now?"), MessageBox.TYPE_YESNO, windowTitle=_("Message"))
548547

549548
def about(self):
550549
self.session.open(AtileHD_About)

lib/python/Plugins/SystemPlugins/SABnzbdSetup/plugin.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def InstalldataAvail(self, str, retval, extra_args):
5959
if isinstance(str, bytes):
6060
str = str.decode(encoding='utf-8', errors='strict')
6161
if not str:
62-
restartbox = self.session.openWithCallback(self.InstallPackage, MessageBox, _('Your %s %s will be restarted after the installation of service.\n\nDo you want to install now ?') % getBoxDisplayName(), MessageBox.TYPE_YESNO)
63-
restartbox.setTitle(_('Ready to install "%s"?') % self.service_name)
62+
self.session.openWithCallback(self.InstallPackage, MessageBox, _('Your %s %s will be restarted after the installation of service.\n\nDo you want to install now ?') % getBoxDisplayName(), MessageBox.TYPE_YESNO, windowTitle=_('Ready to install "%s"?') % self.service_name)
6463
else:
6564
self.updateService()
6665

@@ -72,8 +71,7 @@ def InstallPackage(self, val):
7271

7372
def doInstall(self, callback, pkgname):
7473
self["actions"].setEnabled(False)
75-
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO)
76-
self.message.setTitle(_('Installing Service'))
74+
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO, windowTitle=_("Installing Service"))
7775
self.Console.ePopen('/usr/bin/opkg install ' + pkgname + ' sync', callback)
7876

7977
def installComplete(self, result=None, retval=None, extra_args=None):
@@ -88,8 +86,7 @@ def UninstalldataAvail(self, str, retval, extra_args):
8886
if isinstance(str, bytes):
8987
str = str.decode(encoding='utf-8', errors='strict')
9088
if str:
91-
restartbox = self.session.openWithCallback(self.RemovePackage, MessageBox, _("Your %s %s will be restarted after the removal of service\nDo you want to remove now?") % getBoxDisplayName(), MessageBox.TYPE_YESNO)
92-
restartbox.setTitle(_("Ready to remove \"%s\"?") % self.service_name)
89+
self.session.openWithCallback(self.RemovePackage, MessageBox, _("Your %s %s will be restarted after the removal of service\nDo you want to remove now?") % getBoxDisplayName(), MessageBox.TYPE_YESNO, windowTitle=_("Ready to remove \"%s\"?") % self.service_name)
9390
else:
9491
self.updateService()
9592

@@ -99,8 +96,7 @@ def RemovePackage(self, val):
9996

10097
def doRemove(self, callback, pkgname):
10198
self["actions"].setEnabled(False)
102-
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO)
103-
self.message.setTitle(_('Removing Service'))
99+
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO, windowTitle=_("Removing Service"))
104100
self.Console.ePopen('/usr/bin/opkg remove ' + pkgname + ' --force-remove --autoremove sync', callback)
105101

106102
def removeComplete(self, result=None, retval=None, extra_args=None):

lib/python/Screens/CronTimer.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ def installCheck(self):
6767

6868
def checkNetworkState(self, result, retval, extra_args):
6969
if not result:
70-
self.feedscheck = self.session.open(MessageBox, _("Please wait whilst feeds state is checked."), MessageBox.TYPE_INFO, enable_input=False)
71-
self.feedscheck.setTitle(_("Checking Feeds"))
70+
self.feedscheck = self.session.open(MessageBox, _("Please wait whilst feeds state is checked."), MessageBox.TYPE_INFO, enable_input=False, windowTitle=_("Checking Feeds"))
7271
self.CheckConsole = Console()
7372
self.CheckConsole.ePopen([OPKGCMD, OPKGCMD, "update"], self.checkNetworkStateFinished)
7473
else:
@@ -94,8 +93,7 @@ def installPackageFailed(self, val):
9493
self.close()
9594

9695
def doInstall(self, callback, pkgname):
97-
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO, enable_input=False)
98-
self.message.setTitle(_("Installing Service"))
96+
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO, enable_input=False, windowTitle=_("Installing Service"))
9997
self.callOpkg(["install", pkgname], callback)
10098

10199
def installComplete(self, result=None, retval=None, extra_args=None):
@@ -122,8 +120,7 @@ def removePackage(self, val):
122120
self.close()
123121

124122
def doRemove(self, callback, pkgname):
125-
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO, enable_input=False)
126-
self.message.setTitle(_("Removing Service"))
123+
self.message = self.session.open(MessageBox, _("Please wait..."), MessageBox.TYPE_INFO, enable_input=False, windowTitle=_("Removing Service"))
127124
self.callOpkg(["--force-remove", "--autoremove", "remove", pkgname], callback)
128125

129126
def removeComplete(self, result=None, retval=None, extra_args=None):

lib/python/Screens/LogManager.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def JobTrash(self):
120120
print("[LogManager] probing folders")
121121

122122
if (datetime.now().hour == 3) or (time() - config.crash.lastfulljobtrashtime.value > 3600 * 24):
123-
#full JobTrash (in all potential log file dirs) between 03:00 and 04:00 AM / every 24h
123+
# full JobTrash (in all potential log file dirs) between 03:00 and 04:00 AM / every 24h
124124
config.crash.lastfulljobtrashtime.setValue(int(time()))
125125
config.crash.lastfulljobtrashtime.save()
126126
configfile.save()
@@ -129,7 +129,7 @@ def JobTrash(self):
129129
matches.append(join(mount, 'logs'))
130130
matches.append('/home/root/logs')
131131
else:
132-
#small JobTrash (in selected log file dir only) twice a day
132+
# small JobTrash (in selected log file dir only) twice a day
133133
matches.append(config.crash.debug_path.value)
134134

135135
print("[LogManager] found following log's: %s" % matches)
@@ -145,9 +145,9 @@ def JobTrash(self):
145145
try:
146146
fn = join(root, name)
147147
st = stat(fn)
148-
#print "Logname: %s" % fn
149-
#print "Last created: %s" % ctime(st.st_ctime)
150-
#print "Last modified: %s" % ctime(st.st_mtime)
148+
# print "Logname: %s" % fn
149+
# print "Last created: %s" % ctime(st.st_ctime)
150+
# print "Last modified: %s" % ctime(st.st_mtime)
151151
if st.st_mtime < ctimeLimit:
152152
print("[LogManager] %s: Too old: %s" % (str(fn), ctime(st.st_mtime)))
153153
eBackgroundFileEraser.getInstance().erase(fn)
@@ -292,12 +292,10 @@ def deletelog(self):
292292
self.selectedFiles = self["list"].getSelectedList()
293293
if self.selectedFiles:
294294
message = _("Do you want to delete all selected files:\n(choose 'No' to only delete the currently selected file.)")
295-
ybox = self.session.openWithCallback(self.doDelete1, MessageBox, message, MessageBox.TYPE_YESNO)
296-
ybox.setTitle(_("Delete Confirmation"))
295+
self.session.openWithCallback(self.doDelete1, MessageBox, message, MessageBox.TYPE_YESNO, windowTitle=_("Delete Confirmation"))
297296
elif self.sel:
298297
message = _("Are you sure you want to delete this log:\n") + str(self.sel[0])
299-
ybox = self.session.openWithCallback(self.doDelete3, MessageBox, message, MessageBox.TYPE_YESNO)
300-
ybox.setTitle(_("Delete Confirmation"))
298+
self.session.openWithCallback(self.doDelete3, MessageBox, message, MessageBox.TYPE_YESNO, windowTitle=_("Delete Confirmation"))
301299
else:
302300
self.session.open(MessageBox, _("You have selected no logs to delete."), MessageBox.TYPE_INFO, timeout=10)
303301

@@ -308,12 +306,10 @@ def doDelete1(self, answer):
308306
if self.sel is not None:
309307
if answer is True:
310308
message = _("Are you sure you want to delete all selected logs:\n") + self.selectedFiles
311-
ybox = self.session.openWithCallback(self.doDelete2, MessageBox, message, MessageBox.TYPE_YESNO)
312-
ybox.setTitle(_("Delete Confirmation"))
309+
self.session.openWithCallback(self.doDelete2, MessageBox, message, MessageBox.TYPE_YESNO, windowTitle=_("Delete Confirmation"))
313310
else:
314311
message = _("Are you sure you want to delete this log:\n") + str(self.sel[0])
315-
ybox = self.session.openWithCallback(self.doDelete3, MessageBox, message, MessageBox.TYPE_YESNO)
316-
ybox.setTitle(_("Delete Confirmation"))
312+
self.session.openWithCallback(self.doDelete3, MessageBox, message, MessageBox.TYPE_YESNO, windowTitle=_("Delete Confirmation"))
317313

318314
def doDelete2(self, answer):
319315
if answer is True:

lib/python/Screens/ScriptRunner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ def runscript(self):
5656
self.sel = self['list'].getCurrent()
5757
if self.sel:
5858
message = _("Are you ready to run the script?")
59-
ybox = self.session.openWithCallback(self.Run, MessageBox, message, MessageBox.TYPE_YESNO)
60-
ybox.setTitle(_("Run Confirmation"))
59+
self.session.openWithCallback(self.Run, MessageBox, message, MessageBox.TYPE_YESNO, windowTitle=_("Run Confirmation"))
6160
else:
6261
self.session.open(MessageBox, _("You have no script to run."), MessageBox.TYPE_INFO, timeout=10)
6362

lib/python/Screens/SwapManager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ def actDeact(self):
250250
if self.swapPlace:
251251
self.Console.ePopen(f"swapon {self.swapPlace}", self.updateSwap)
252252
else:
253-
mybox = self.session.open(MessageBox, _("Swap File not found. You have to create the file before to activate."), MessageBox.TYPE_INFO)
254-
mybox.setTitle(_("Info"))
253+
self.session.open(MessageBox, _("Swap File not found. You have to create the file before to activate."), MessageBox.TYPE_INFO, windowTitle=_("Info"))
255254
else:
256255
self.Console.ePopen("swapon " + self.swapPlace, self.updateSwap)
257256

@@ -311,6 +310,5 @@ def autoSsWap(self):
311310
config.usage.swapautostart.save()
312311
configfile.save()
313312
else:
314-
mybox = self.session.open(MessageBox, _("You have to create a Swap File before to activate the autostart."), MessageBox.TYPE_INFO)
315-
mybox.setTitle(_("Info"))
313+
self.session.open(MessageBox, _("You have to create a Swap File before to activate the autostart."), MessageBox.TYPE_INFO, windowTitle=_("Info"))
316314
self.updateSwap()

0 commit comments

Comments
 (0)