def select_drive_restore_button_clicked(self, widget): #Displays individual folders self.BUTTON_SWITCH = False #Create a new HD view hdView = hdDialog(self.BUTTON_SWITCH,self.FOLDERS); input,name,self.FOLDERS,self.folders_selected = hdView.run() #Check if user pressed Ok and assign HD name if (input == gtk.RESPONSE_OK) : if self.FOLDERS == False: if(name!=""): #Assign the hard drive name self.hd_name=name #Tell the user what HD we will restore self.label39.set_text("Restoring from "+ self.external_name) self.logwindow.set_text("Restoring from " + self.external_name) self.textview2.set_buffer(self.logwindow) if self.LOCAL == True: self.label39.set_text("Restoring from " + self.hd_name + " to " + self.external_name) else: for folder in self.folders_selected: #Make sure there are actual folders if(folder!="" or None): self.label39.set_text("Restoring from selected folder(s)" + " to " + self.external_name) #Setup the textbuffer current_folders = str(self.folders_selected) #Put a line break between each folder foo = current_folders.replace(",",'\n') #Set the output textview self.logwindow.set_text("Restoring from: " + foo) self.textview2.set_buffer(self.logwindow)
def external_backup_button_clicked(self,widget): #A switch to display the individual folders button self.BUTTON_SWITCH = True hdExternal = hdDialog(self.BUTTON_SWITCH,self.FOLDERS); input, name, self.FOLDERS = hdExternal.run() if (input == gtk.RESPONSE_OK): if(name!=""): self.external_name_backup = name if self.FOLDERS: self.label11.set_text("Backing up selected folder(s) to " + self.external_name_backup) else: self.label11.set_text("Backing up " + self.hd_name_backup + " to " + self.external_name_backup)
def external_restore_button_clicked(self,widget): #Turn off Button_switch so no 'Individual Folder' button is shown self.BUTTON_SWITCH = True hdExternal = hdDialog(self.BUTTON_SWITCH,self.FOLDERS); input, name, self.FOLDERS= hdExternal.run() if (input == gtk.RESPONSE_OK): if(name!=""): self.external_name = name if self.FOLDERS: self.label39.set_text("Restoring from selected folder(s) to " + self.external_name ) else: self.label39.set_text("Restoring from " + self.hd_name + " to " + self.external_name)
def select_drive_backup_button_clicked(self, widget): #Button_switch determines if the 'Individual Folders' button should be displayed self.BUTTON_SWITCH = False #Run a new HD selector hdView = hdDialog(self.BUTTON_SWITCH,self.FOLDERS); input,name,self.FOLDERS,self.folders_selected_backup = hdView.run() #Check if user pressed Ok and assign HD name if (input == gtk.RESPONSE_OK) : if self.FOLDERS == False: if(name!=""): #Assign the hard drive name self.hd_name_backup=name #Tell the user what HD we will backup self.label11.set_text("Backing up "+ self.hd_name_backup) #Also set it in the output tab self.logwindow.set_text("Backing up " + self.hd_name_backup) self.textview2.set_buffer(self.logwindow) #If it's a local backup, also set what we're backing up to if self.LOCAL == True: self.label11.set_text("Backing up " + self.hd_name_backup + " to " + self.external_name_backup) else: for folder in self.folders_selected_backup: #Make sure there are actual folders if(folder!="" or None): #Set the label for what we're backing up self.label11.set_text("Backing up selected folder(s)") #Setup the textbuffer current_folders = str(self.folders_selected_backup) #Put a line break between each folder foo = current_folders.replace(",",'\n') #Set the output textview self.logwindow.set_text("Backing up: " + foo) self.textview2.set_buffer(self.logwindow) #If it's a local backup if self.LOCAL == True: self.label11.set_text("Backing up selected folder(s) to " + self.external_name_backup)