aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2020-12-18 22:01:22 +0100
committerPapoteur <papoteur@mageia.org>2020-12-18 22:01:22 +0100
commit0481230a0c998c553845354d2407232b46649741 (patch)
treed4453ae226eb57526b04bc30b0c1f511bc4473e3 /lib
parent7461a5f3ba5ceec4a15625c57dd46c68c4c11dbe (diff)
downloadisodumper-0481230a0c998c553845354d2407232b46649741.tar
isodumper-0481230a0c998c553845354d2407232b46649741.tar.gz
isodumper-0481230a0c998c553845354d2407232b46649741.tar.bz2
isodumper-0481230a0c998c553845354d2407232b46649741.tar.xz
isodumper-0481230a0c998c553845354d2407232b46649741.zip
Finalize previous changes
Diffstat (limited to 'lib')
-rwxr-xr-xlib/isodumper.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index d868cfb..12b3eb5 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -149,7 +149,6 @@ class UDisks2(object):
i_drive = self.bus.get(self.SERVICE, drive)
i_drive.Eject({})
-
class Info(object):
def __init__(self, title, richtext, text):
self.title = title
@@ -178,6 +177,16 @@ class IsoDumper(basedialog.BaseDialog):
self.devicelist.addItem(str(name + ' (' + path.lstrip() + ') ' + self.sizeof_fmt(size)), False)
return True
+ def active_signal(self):
+ print("Active")
+ self.u.iface["org.freedesktop.DBus.ObjectManager"].InterfacesAdded.connect(self.refresh_signal)
+ self.u.iface["org.freedesktop.DBus.ObjectManager"].InterfacesRemoved.connect(self.refresh_signal)
+
+ def deactive_signal(self):
+ print("Désactive")
+ #self.u.iface["org.freedesktop.DBus.ObjectManager"].onInterfacesAdded = None
+ #self.u.iface["org.freedesktop.DBus.ObjectManager"].onInterfacesRemoved = None
+
def udev_wait(self, operation):
wait = Popen(["udevadm", "settle", "--timeout=15"], stderr=PIPE)
wait.communicate()
@@ -204,6 +213,12 @@ class IsoDumper(basedialog.BaseDialog):
self.dialog.recalcLayout()
self.restore()
+ def refresh_signal(self, device, params):
+ print("Refresh ", device)
+ self.devicelist.deleteAllItems()
+ self.get_devices()
+ self.dialog.recalcLayout()
+
def device_selected(self):
selitem = self.devicelist.selectedItem()
if selitem is not None:
@@ -212,8 +227,9 @@ class IsoDumper(basedialog.BaseDialog):
if self.dev.startswith(name + ' (' + path.lstrip()):
self.deviceSize = size
self.device_name = name.rstrip().replace(' ', '')
- self.logger(_('Target Device: ') + self.dev)
- logging.info(_('Target Device: {}').format(self.dev))
+ message = _('Target Device: {}').format(self.dev)
+ self.logger(message)
+ logging.info(message)
self.formatbt.setEnabled()
self.ima.setEnabled()
self.backup_select.setEnabled()
@@ -391,6 +407,7 @@ class IsoDumper(basedialog.BaseDialog):
message = _('Executing copy from {source} to {target}').format(source=source, target=target)
self.logger(message)
logging.info(message)
+ self.deactive_signal()
bus = SystemBus()
iface = bus.get("org.mageia.Magiback", "Isodumper")
success, message = self.u.do_unmount(target)
@@ -479,6 +496,7 @@ class IsoDumper(basedialog.BaseDialog):
self.restore()
else:
self.restore()
+ self.active_signal()
def success(self):
self.operation = False
@@ -715,12 +733,12 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
except:
message = _('UDisks2 is not available on your system')
logging.error(message)
- self.logger(message)
self.emergency(message)
if not self.get_devices():
self.dialog.destroy()
yui.YUILoader.deleteUI()
exit()
+ self.active_signal()
self.device_selected()
self.dialog.recalcLayout()
self.uEventQueue = SimpleQueue()