mirror of
				https://github.com/robweber/xbmcbackup.git
				synced 2025-11-04 11:12:16 +01:00 
			
		
		
		
	added gui changes to be similar to Frodo branch
This commit is contained in:
		
							
								
								
									
										2
									
								
								resources/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								resources/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
 | 
			
		||||
*.pyo
 | 
			
		||||
@@ -87,6 +87,7 @@ class XbmcBackup:
 | 
			
		||||
    filesTotal = 1
 | 
			
		||||
 | 
			
		||||
    fileManager = None
 | 
			
		||||
    restore_point = None
 | 
			
		||||
    
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        self.local_path = xbmc.makeLegalFilename(xbmc.translatePath("special://home"),False);
 | 
			
		||||
@@ -106,27 +107,43 @@ class XbmcBackup:
 | 
			
		||||
        
 | 
			
		||||
        utils.log(utils.getString(30046))
 | 
			
		||||
 | 
			
		||||
    def run(self,mode=-1,runSilent=False):
 | 
			
		||||
	#check if we should use the progress bar
 | 
			
		||||
        if(utils.getSetting('run_silent') == 'false' and not runSilent):
 | 
			
		||||
            self.progressBar = xbmcgui.DialogProgress()
 | 
			
		||||
            self.progressBar.create(utils.getString(30010),utils.getString(30049) + "......")
 | 
			
		||||
    def listBackups(self):
 | 
			
		||||
        result = list()
 | 
			
		||||
 | 
			
		||||
        #determine backup mode
 | 
			
		||||
        if(mode == -1):
 | 
			
		||||
            mode = int(utils.getSetting('addon_mode'))
 | 
			
		||||
        #get all the folders in the current root path
 | 
			
		||||
        dirs = vfs.listdir(self.remote_path)
 | 
			
		||||
        
 | 
			
		||||
        for aDir in dirs:
 | 
			
		||||
            result.append(aDir[len(self.remote_path):-1])
 | 
			
		||||
 | 
			
		||||
        return result
 | 
			
		||||
 | 
			
		||||
    def selectRestore(self,restore_point):
 | 
			
		||||
        self.restore_point = restore_point
 | 
			
		||||
 | 
			
		||||
    def run(self,mode=-1,runSilent=False):
 | 
			
		||||
 | 
			
		||||
        #append backup folder name
 | 
			
		||||
        progressBarTitle = utils.getString(30010) + " - "
 | 
			
		||||
        if(mode == self.Backup and self.remote_path != ''):
 | 
			
		||||
            self.remote_path = self.remote_path + time.strftime("%Y%m%d") + "/"
 | 
			
		||||
	elif(mode == self.Restore and utils.getSetting("backup_name") != '' and self.remote_path != ''):
 | 
			
		||||
	    self.remote_path = self.remote_path + utils.getSetting("backup_name") + "/"
 | 
			
		||||
            progressBarTitle = progressBarTitle + utils.getString(30016)
 | 
			
		||||
	elif(mode == self.Restore and self.restore_point != None and self.remote_path != ''):
 | 
			
		||||
	    self.remote_path = self.remote_path + self.restore_point + "/"
 | 
			
		||||
	    progressBarTitle = progressBarTitle + utils.getString(30017)
 | 
			
		||||
	else:
 | 
			
		||||
            #kill the program here
 | 
			
		||||
	    self.remote_path = ""
 | 
			
		||||
	    return
 | 
			
		||||
 | 
			
		||||
        utils.log(utils.getString(30047) + ": " + self.local_path)
 | 
			
		||||
        utils.log(utils.getString(30048) + ": " + self.remote_path)
 | 
			
		||||
 | 
			
		||||
        #check if we should use the progress bar
 | 
			
		||||
        if(utils.getSetting('run_silent') == 'false' and not runSilent):
 | 
			
		||||
            self.progressBar = xbmcgui.DialogProgress()
 | 
			
		||||
            self.progressBar.create(progressBarTitle,utils.getString(30049) + "......")
 | 
			
		||||
            
 | 
			
		||||
        #run the correct mode
 | 
			
		||||
        if(mode == self.Backup):
 | 
			
		||||
            utils.log(utils.getString(30023) + " - " + utils.getString(30016))
 | 
			
		||||
@@ -206,5 +223,3 @@ class XbmcBackup:
 | 
			
		||||
 | 
			
		||||
        return result
 | 
			
		||||
 | 
			
		||||
    def isReady(self):
 | 
			
		||||
        return True if self.remote_path != '' else False
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,9 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 | 
			
		||||
<settings>
 | 
			
		||||
	<category id="general" label="30011">
 | 
			
		||||
		<setting id="addon_mode" type="enum" lvalues="30016|30017" default="0" label="30023" />
 | 
			
		||||
		<setting id="remote_selection" type="enum" lvalues="30018|30019" default="0" label="30025"/>
 | 
			
		||||
		<setting id="remote_path_2" type="text" label="30024" default="" visible="eq(-1,1)" />
 | 
			
		||||
		<setting id="remote_path" type="folder" label="30020" visible="eq(-2,0)" />
 | 
			
		||||
		<setting id="backup_name" type="text" label="30021" default="backup_date" visible="eq(-4,1)"/>
 | 
			
		||||
		<setting id="run_silent" type="bool" label="30022" default="false" />
 | 
			
		||||
	</category>
 | 
			
		||||
	<category id="selection" label="30012">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user