~tkluck/backintime/mountmonitor

« back to all changes in this revision

Viewing changes to plugins/kde4plugin.py

  • Committer: Timo Kluck
  • Date: 2009-11-26 22:25:01 UTC
  • mfrom: (585.1.47 trunk)
  • Revision ID: tkluck@netbook-tjk-20091126222501-6cfwq1jfud2c0m3j
* added kde support
 * removed accidentally added ¨feature¨ of a per-folder on-mount action (added by copy pasting code)
 * merge with current version in trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#    Back In Time
2
 
#    Copyright (C) 2008-2009 Oprea Dan
 
2
#    Copyright (C) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey
3
3
#
4
4
#    This program is free software; you can redistribute it and/or modify
5
5
#    it under the terms of the GNU General Public License as published by
23
23
import logger
24
24
import threading
25
25
import time
 
26
import gettext
 
27
 
 
28
_=gettext.gettext
26
29
 
27
30
 
28
31
if len( os.getenv( 'DISPLAY', '' ) ) == 0:
68
71
                        from PyKDE4.kdecore import KAboutData, KCmdLineArgs, ki18n
69
72
                        from PyKDE4.kdeui import KApplication, KSystemTrayIcon, KIcon
70
73
 
71
 
                        kaboutdata = KAboutData( 'backintime', '', ki18n( self.config.APP_NAME ), self.config.VERSION, ki18n( '' ), KAboutData.License_GPL_V2, ki18n( self.config.COPYRIGHT ), ki18n( '' ), 'http://backintime.le-web.org', 'dan@le-web.org' )
 
74
                        kaboutdata = KAboutData( 'backintime', '', ki18n( self.config.APP_NAME ), self.config.VERSION, ki18n( '' ), KAboutData.License_GPL_V2, ki18n( self.config.COPYRIGHT ), ki18n( '' ), 'http://backintime.le-web.org', 'bit-team@lists.launchpad.net' )
72
75
                        kaboutdata.setProgramIconName( 'document-save' )
73
76
 
74
77
                        KCmdLineArgs.init( [sys.argv[0]], kaboutdata )
162
165
 
163
166
        def on_new_snapshot( self, snapshot_id, snapshot_path ):
164
167
                return
 
168
                
 
169
        def ask_user_on_mount( self, path ):
 
170
                from PyKDE4.kdecore import KAboutData, KCmdLineArgs, ki18n
 
171
                from PyKDE4.kdeui import KApplication, KSystemTrayIcon, KIcon, KMessageBox
 
172
 
 
173
                kaboutdata = KAboutData( 'backintime', '', ki18n( self.config.APP_NAME ), self.config.VERSION, ki18n( '' ), KAboutData.License_GPL_V2, ki18n( self.config.COPYRIGHT ), ki18n( '' ), 'http://backintime.le-web.org', 'bit-team@lists.launchpad.net' )
 
174
 
 
175
                kaboutdata.setProgramIconName( 'document-save' )
 
176
 
 
177
                KCmdLineArgs.init( [sys.argv[0]], kaboutdata )
 
178
                kapp = KApplication()
 
179
                messagebox = KMessageBox()
 
180
                
 
181
                make_backup=messagebox.questionYesNo(None,self.config.APP_NAME,"\
 
182
The location %s contains snapshots (backups) of \
 
183
some files in the system. Do you want to make \
 
184
a snapshot now?" % path)
 
185
                return make_backup==m.Yes
 
186
 
165
187
 
166
188