refactored code to use strings.xml

This commit is contained in:
robweber 2012-09-12 10:02:33 -05:00
parent 9bda2055b3
commit 17a4e8ad3d
3 changed files with 22 additions and 7 deletions

View File

@ -31,7 +31,22 @@
<string id="30050">Remote Path exists - may have old files in it!</string> <string id="30050">Remote Path exists - may have old files in it!</string>
<string id="30051">Creating Files List</string> <string id="30051">Creating Files List</string>
<string id="30052">Writing file</string> <string id="30052">Writing file</string>
<string id="30053">Starting scheduled backup</string>
<string id="30060">Enable Scheduler</string> <string id="30060">Enable Scheduler</string>
<string id="30061">Schedule</string>
<string id="30062">Hour of Day</string>
<string id="30063">Day of Week</string>
<string id="30064">Cron Schedule</string>
<string id="30065">Sunday</string>
<string id="30066">Monday</string>
<string id="30067">Tuesday</string>
<string id="30068">Wednesday</string>
<string id="30069">Thursday</string>
<string id="30070">Friday</string>
<string id="30071">Saturday</string>
<string id="30072">Every Day</string>
<string id="30073">Every Week</string>
<string id="30074">First Day of Month</string>
<string id="30075">Custom Schedule</string>
</strings> </strings>

View File

@ -18,9 +18,9 @@
</category> </category>
<category id="scheduling" label="30013"> <category id="scheduling" label="30013">
<setting id="enable_scheduler" type="bool" label="30060" default="false" /> <setting id="enable_scheduler" type="bool" label="30060" default="false" />
<setting id="schedule_interval" type="enum" label="Schedule" values="Every Day|Every Week|First Day of Month|Custom Schedule" default="0" enable="eq(-1,true)"/> <setting id="schedule_interval" type="enum" label="30061" lvalues="30072|30073|30074|30075" default="0" enable="eq(-1,true)"/>
<setting id="schedule_time" type="labelenum" label="Hour of Day" values="00:00|01:00|02:00|03:00|04:00|05:00|06:00|07:00|08:00|09:00|10:00|11:00|12:00|13:00|14:00|15:00|16:00|17:00|18:00|19:00|20:00|21:00|22:00|23:00" default="00:00" visible="!eq(-1,3)" enable="eq(-2,true)"/> <setting id="schedule_time" type="labelenum" label="30062" values="00:00|01:00|02:00|03:00|04:00|05:00|06:00|07:00|08:00|09:00|10:00|11:00|12:00|13:00|14:00|15:00|16:00|17:00|18:00|19:00|20:00|21:00|22:00|23:00" default="00:00" visible="!eq(-1,3)" enable="eq(-2,true)"/>
<setting id="day_of_week" type="enum" label="Day of Week" values="Sun|Mon|Tue|Wed|Thurs|Fri|Sat" default="0" visible="eq(-2,1)" enable="eq(-3,true)"/> <setting id="day_of_week" type="enum" label="30063" lvalues="30065|30066|30067|30068|30069|30070|30071" default="0" visible="eq(-2,1)" enable="eq(-3,true)"/>
<setting id="cron_schedule" type="text" label="Cron Schedule" default="0 0 * * *" visible="eq(-3,3)" enable="eq(-4,true)"/> <setting id="cron_schedule" type="text" label="30064" default="0 0 * * *" visible="eq(-3,3)" enable="eq(-4,true)"/>
</category> </category>
</settings> </settings>

View File

@ -28,7 +28,7 @@ class BackupScheduler:
if(self.next_run <= now): if(self.next_run <= now):
if(utils.getSetting('run_silent') == 'false'): if(utils.getSetting('run_silent') == 'false'):
utils.showNotification("Starting scheduled backup") utils.showNotification(utils.getString(30053))
#run the job in backup mode, hiding the dialog box #run the job in backup mode, hiding the dialog box
backup = XbmcBackup() backup = XbmcBackup()
backup.run(XbmcBackup.Backup,True) backup.run(XbmcBackup.Backup,True)