def cb_button_restore_backup(self, button):
self.config_save()
files_cache = os.listdir(self.winetricks_cache)
files_backup = os.listdir(self.winetricks_cache_backup)
files_to_copy = list(set(files_backup) - set(files_cache))
self.n_files_to_copy = len(files_to_copy)
if self.n_files_to_copy == 0:
message_dialog = Gtk.MessageDialog(
self.main_window,
0,
Gtk.MessageType.ERROR,
Gtk.ButtonsType.OK,
_("All files from backup exists in cache"),
width_request = 360
)
content_area = message_dialog.get_content_area()
content_area.set_property('margin-left', 10)
content_area.set_property('margin-right', 10)
content_area.set_property('margin-top', 10)
content_area.set_property('margin-bottom', 10)
action_area = message_dialog.get_action_area()
action_area.set_property('spacing', 10)
self.main_window.hide()
message_dialog.run()
message_dialog.destroy()
self.main_window.show()
else:
self.button_make_backup.set_visible(False)
self.button_restore_backup.set_visible(False)
self.progressbar.set_visible(True)
for file_name in files_to_copy:
self.copy_files(file_name, 'restore_backup')
winetricks_cache_backup.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录