added enum setting to make setting the remote path more understandable

This commit is contained in:
robweber 2012-04-28 14:46:42 -05:00
parent f0d98152f1
commit 1d320cd601
3 changed files with 10 additions and 7 deletions

View File

@ -90,14 +90,15 @@ class XbmcBackup:
def __init__(self):
self.local_path = xbmc.translatePath("special://home")
if(self.Addon.getSetting('remote_path_2') != '' and vfs.exists(self.Addon.getSetting('remote_path_2'))):
if(self.Addon.getSetting('remote_selection') == '1' and vfs.exists(self.Addon.getSetting('remote_path_2'))):
xbmc.log(str(self.Addon.getSetting('remote_path_2')))
self.remote_path = self.Addon.getSetting('remote_path_2')
self.Addon.setSetting("remote_path","")
elif(self.Addon.getSetting('remote_path') != '' and vfs.exists(self.Addon.getSetting("remote_path"))):
elif(self.Addon.getSetting('remote_selection') == '0' and vfs.exists(self.Addon.getSetting("remote_path"))):
self.remote_path = self.Addon.getSetting("remote_path")
if(self.Addon.getSetting("backup_name") != ''):
if(self.Addon.getSetting("backup_name") != '' and self.remote_path != ''):
self.remote_path = self.remote_path + self.Addon.getSetting("backup_name") + "/"
else:
self.remote_path = ""

View File

@ -9,7 +9,8 @@
<string id="30022">Run Silent</string>
<string id="30023">Mode</string>
<string id="30024">Type Remote Path</string>
<string id="30025">Remote Path Type</string>
<string id="30030">User Addons</string>
<string id="30031">Addon Data</string>
<string id="30032">Database</string>

View File

@ -2,8 +2,9 @@
<settings>
<category id="general" label="30011">
<setting id="addon_mode" type="enum" values="Backup|Restore" default="Backup" label="30023" />
<setting id="remote_path_2" type="text" label="30024" default="" />
<setting id="remote_path" type="folder" label="30020" />
<setting id="remote_selection" type="enum" values="Browse Path|Type Path" defaults="Browse Path" 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="xbmc_backup"/>
<setting id="run_silent" type="bool" label="30022" default="false" />
</category>