EVENT_LISTITEM = 9
EVENT_DONE = 10
EVENT_ERROR = 11
+ EVENT_MODIFIED = 12
CMD_INSTALL = 0
CMD_LIST = 1
self.callCallbacks(self.EVENT_ERROR, None)
elif data.find('ipkg_download: ERROR:') == 0:
self.callCallbacks(self.EVENT_ERROR, None)
+ elif data.find(' Configuration file') == 0:
+ self.callCallbacks(self.EVENT_MODIFIED, data.split(' \'', 1)[1][:-1])
+
def callCallbacks(self, event, param = None):
for callback in self.callbackList:
callback(event, param)
def isRunning(self):
return self.cmd.running()
+
+ def write(self, what):
+ if what:
+ # We except unterminated commands
+ what += "\n"
+ self.cmd.write(what, len(what))
elif event == IpkgComponent.EVENT_CONFIGURING:
self.package.setText(param)
self.status.setText(_("Configuring"))
+ elif event == IpkgComponent.EVENT_MODIFIED:
+ self.session.openWithCallback(
+ self.modificationCallback,
+ MessageBox,
+ _("A configuration file (%s) was modified since Installation.\nDo you want to keep your version?") % (param)
+ )
elif event == IpkgComponent.EVENT_ERROR:
self.error += 1
elif event == IpkgComponent.EVENT_DONE:
self.status.setText(_("Error") + " - " + error)
#print event, "-", param
pass
-
+
+ def modificationCallback(self, res):
+ self.ipkg.write(res and "N" or "Y")
+
def exit(self):
if not self.ipkg.isRunning():
if self.packages != 0 and self.error == 0:
from Components.Label import Label
from Components.Slider import Slider
from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
from enigma import eTimer
class Ipkg(Screen):
self.error += 1
elif event == IpkgComponent.EVENT_DONE:
self.runNextCmd()
-
+ elif event == IpkgComponent.EVENT_MODIFIED:
+ self.session.openWithCallback(
+ self.modificationCallback,
+ MessageBox,
+ _("A configuration file (%s) was modified since Installation.\nDo you want to keep your version?") % (param)
+ )
+
+ def modificationCallback(self, res):
+ self.ipkg.write(res and "N" or "Y")
+
def exit(self):
if not self.ipkg.isRunning():
self.close()