class Widget(QWidget, ScreenWidget): name = "pisiRescue" def __init__(self): QWidget.__init__(self) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("General", "Starting D-Bus..."),"operation":yali.util.start_dbus}, {"text":_("General", "Connecting to D-Bus..."),"operation":yali.postinstall.connectToDBus}, {"text":_("General", "Fetching history..."),"operation":self.fillHistoryList}]) self.ui.buttonSelectConnection.clicked.connect(self.showConnections) self.connectionWidget = None def showConnections(self): self.connectionWidget.show() def fillHistoryList(self): ui = PisiUI() ctx.logger.debug("PisiUI is creating..") yali.pisiiface.initialize(ui, with_comar = True) try: history = yali.pisiiface.getHistory() for hist in history: HistoryItem(self.ui.historyList, hist) except: return False return True def checkRegisteredConnections(self): self.connectionWidget = ConnectionWidget(self) registeredConnectionsTotal = 0 for connection in self.connectionWidget.connections.values(): registeredConnectionsTotal+=len(connection) return registeredConnectionsTotal def shown(self): self.ui.buttonSelectConnection.setEnabled(False) ctx.interface.informationWindow.update(_("General", "Please Wait...")) self.steps.slotRunOperations() ctx.interface.informationWindow.hide() if self.checkRegisteredConnections(): self.ui.buttonSelectConnection.setEnabled(True) else: self.ui.labelStatus.setText(_("General", "No connection available")) def execute(self): ctx.takeBackOperation = self.ui.historyList.currentItem().getInfo() ctx.mainScreen.step_increment = 2 return True def backCheck(self): ctx.mainScreen.step_increment = 2 return True
class Widget(QWidget, ScreenWidget): name = "pisiRescue" def __init__(self): QWidget.__init__(self) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting D-Bus..."),"operation":yali.util.start_dbus}, {"text":_("Connecting to D-Bus..."),"operation":yali.postinstall.connectToDBus}, {"text":_("Fetching history..."),"operation":self.fillHistoryList}]) self.ui.buttonSelectConnection.clicked.connect(self.showConnections) self.connectionWidget = None def showConnections(self): self.connectionWidget.show() def fillHistoryList(self): ui = PisiUI() ctx.logger.debug("PisiUI is creating..") yali.pisiiface.initialize(ui, with_comar = True) try: history = yali.pisiiface.getHistory() for hist in history: HistoryItem(self.ui.historyList, hist) except: return False return True def checkRegisteredConnections(self): self.connectionWidget = ConnectionWidget(self) registeredConnectionsTotal = 0 for connection in self.connectionWidget.connections.values(): registeredConnectionsTotal+=len(connection) return registeredConnectionsTotal def shown(self): self.ui.buttonSelectConnection.setEnabled(False) ctx.interface.informationWindow.update(_("Please Wait...")) self.steps.slotRunOperations() ctx.interface.informationWindow.hide() if self.checkRegisteredConnections(): self.ui.buttonSelectConnection.setEnabled(True) else: self.ui.labelStatus.setText(_("No connection available")) def execute(self): ctx.takeBackOperation = self.ui.historyList.currentItem().getInfo() ctx.mainScreen.step_increment = 2 return True def backCheck(self): ctx.mainScreen.step_increment = 2 return True
def __init__(self): QWidget.__init__(self) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("General", "Starting D-Bus..."),"operation":yali.util.start_dbus}, {"text":_("General", "Connecting to D-Bus..."),"operation":yali.postinstall.connectToDBus}, {"text":_("General", "Fetching history..."),"operation":self.fillHistoryList}]) self.ui.buttonSelectConnection.clicked.connect(self.showConnections) self.connectionWidget = None
def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting D-Bus..."),"operation":yali.util.start_dbus}, {"text":_("Connecting to D-Bus..."),"operation":yali.postinstall.connectToDBus}, {"text":_("Fetching history..."),"operation":self.fillHistoryList}]) self.connect(self.ui.buttonSelectConnection, SIGNAL("clicked()"), self.showConnections) self.connectionWidget = None
class Widget(QtGui.QWidget, ScreenWidget): title = _("Take Back Your System") icon = "iconInstall" helpSummary = _("") help = _(""" <p> Pisi, the package management system of Pardus, stores every operation in its history database. More technically speaking, every removal/installation/update operation within Pisi is a point-in-time that the user may want to return back in case of a serious problem or system inconsistency. </p> <p> This repair mode allows users to visualize the operation history and to return back to a previous system state. </p> """) def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting D-Bus..."),"operation":yali.util.start_dbus}, {"text":_("Connecting to D-Bus..."),"operation":yali.postinstall.connectToDBus}, {"text":_("Fetching history..."),"operation":self.fillHistoryList}]) self.connect(self.ui.buttonSelectConnection, SIGNAL("clicked()"), self.showConnections) self.connectionWidget = None def showConnections(self): self.connectionWidget.show() def fillHistoryList(self): ui = PisiUI() ctx.logger.debug("PisiUI is creating..") yali.pisiiface.initialize(ui, with_comar = True) try: history = yali.pisiiface.getHistory() for hist in history: HistoryItem(self.ui.historyList, hist) except: return False return True def checkRegisteredConnections(self): self.connectionWidget = ConnectionWidget(self) registeredConnectionsTotal = 0 for connection in self.connectionWidget.connections.values(): registeredConnectionsTotal+=len(connection) return registeredConnectionsTotal def shown(self): self.ui.buttonSelectConnection.setEnabled(False) ctx.yali.info.show() self.steps.slotRunOperations() ctx.yali.info.hide() if self.checkRegisteredConnections(): self.ui.buttonSelectConnection.setEnabled(True) else: self.ui.labelStatus.setText(_("No connection available")) def execute(self): ctx.takeBackOperation = self.ui.historyList.currentItem().getInfo() ctx.mainScreen.stepIncrement = 2 return True def backCheck(self): ctx.mainScreen.stepIncrement = 2 return True