Merge lp:~tkluck/backintime/mountmonitor into lp:backintime/1.0

Proposed by Timo Kluck
Status: Needs review
Proposed branch: lp:~tkluck/backintime/mountmonitor
Merge into: lp:backintime/1.0
Diff against target: 666 lines (+334/-11)
21 files modified
AUTHORS (+1/-0)
CHANGES (+2/-0)
VERSION (+2/-1)
common/Makefile.template (+4/-0)
common/backintime-mountmonitor.desktop (+12/-0)
common/backintime.py (+23/-0)
common/config.py (+18/-2)
common/debian_specific/control (+2/-2)
common/mountmonitor.py (+117/-0)
common/pluginmanager.py (+9/-0)
gnome/debian_specific/control (+2/-2)
gnome/docbook/C/backintime-C.omf (+8/-0)
gnome/docbook/C/backintime.xml (+10/-0)
gnome/settingsdialog.glade (+30/-1)
gnome/settingsdialog.py (+26/-0)
kde4/backintime-kde4.desktop (+1/-0)
kde4/debian_specific/control (+2/-2)
kde4/docbook/en/index.docbook (+10/-0)
kde4/settingsdialog.py (+16/-1)
plugins/gnomeplugin.py (+16/-0)
plugins/kde4plugin.py (+23/-0)
To merge this branch: bzr merge lp:~tkluck/backintime/mountmonitor
Reviewer Review Type Date Requested Status
Christophe CHAUVET (community) Needs Fixing
Back In Time Team Pending
Review via email: mp+16196@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Timo Kluck (tkluck) wrote :

I added some functionality that I want to propose for the main trunk.

It is a small python script that monitors mounting of filesystems. It checks whether a new mount contains a backintime directory, and if it does, shows a dialog box to the user asking whether to make a snapshot. Behaviour (no action / show dialog box / silently make backup) is configurable.

Works both in Gnome and KDE4. However, Gnome mounts connected volumes automatically, and KDE does not. So in Gnome, the dialog box is shown after connecting the drive, and in KDE, only after manually mounting.

Pros: this feature has been requested a couple of times, and I myself am a happy user.

Cons: it seems a waste of resources to have a daemon running just for showing a single dialog box. This is not yet configurable from BiT (but is it with system preferences).

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi

I see lot of conflict in your merge proposal, can you resolve it before ask to merge ?

Regards,

review: Needs Fixing
lp:~tkluck/backintime/mountmonitor updated
592. By Timo Kluck <tkluck@netbook-tjk>

fix some merge conflicts.

593. By Timo Kluck <tkluck@netbook-tjk>

fixed merge conflict config.py

594. By Timo Kluck <tkluck@netbook-tjk>

fixed merge conflicts

Revision history for this message
Timo Kluck (tkluck) wrote :

> Hi
>
> I see lot of conflict in your merge proposal, can you resolve it before ask to
> merge ?
>
> Regards,

Hi,

I think I have fixed the merge conflicts in the code. I kept different version numbers for 'my' branch though (appending -tjk) to distinguish the branches. Should I change those too?

Also, I added the dependency python-gobject (part of PythonGTK) to the backintime-common package. The mount monitor daemon depends on it. I am unsure of whether this is a problem for KDE users?

Unmerged revisions

594. By Timo Kluck <tkluck@netbook-tjk>

fixed merge conflicts

593. By Timo Kluck <tkluck@netbook-tjk>

fixed merge conflict config.py

592. By Timo Kluck <tkluck@netbook-tjk>

fix some merge conflicts.

591. By Timo Kluck <tkluck@netbook-tjk>

KDE4Plugin now working.
Added logging in mount monitor

590. By Timo Kluck <tkluck@netbook-tjk>

Correct dialog box for KDE

589. By Timo Kluck <tkluck@netbook-tjk>

removed merge tags

588. By Timo Kluck <tkluck@netbook-tjk>

* 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

587. By Timo Kluck <tkluck@netbook-tjk>

added new files

586. By Timo Kluck <tkluck@netbook-tjk>

adding mount monitor

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2009-11-06 13:00:42 +0000
+++ AUTHORS 2010-01-08 19:59:12 +0000
@@ -1,3 +1,4 @@
1Oprea Dan (<dan@le-web.org>)1Oprea Dan (<dan@le-web.org>)
2Bart de Koning (<bratdaking@gmail.com>)2Bart de Koning (<bratdaking@gmail.com>)
3Richard Bailey (<rmjb@mail.com>)3Richard Bailey (<rmjb@mail.com>)
4Timo Kluck (<tkluck@science.uva.nl>) (additional code)
45
=== modified file 'CHANGES'
--- CHANGES 2010-01-07 08:57:36 +0000
+++ CHANGES 2010-01-08 19:59:12 +0000
@@ -1,5 +1,6 @@
1Back In Time1Back In Time
22
3=======
3Version 1.0.04Version 1.0.0
4* smart remove was slightly changed (https://bugs.launchpad.net/backintime/+bug/502435)5* smart remove was slightly changed (https://bugs.launchpad.net/backintime/+bug/502435)
5* fix bug: https://bugs.launchpad.net/backintime/+bug/5038596* fix bug: https://bugs.launchpad.net/backintime/+bug/503859
@@ -17,6 +18,7 @@
17* fix bug: https://bugs.launchpad.net/backintime/+bug/41269518* fix bug: https://bugs.launchpad.net/backintime/+bug/412695
18* update Slovak translation (Tomáš Vadina <kyberdev@gmail.com>)19* update Slovak translation (Tomáš Vadina <kyberdev@gmail.com>)
19* multiple profiles support20* multiple profiles support
21* Added a backintime daemon that (optionally) makes a snapshot upon mounting an external drive.
20* GNOME: fix notification22* GNOME: fix notification
21* backintime snapshot folder is restructured to ../backintime/machine/user/profile_id/23* backintime snapshot folder is restructured to ../backintime/machine/user/profile_id/
22* added the possibility to include other snapshot folders within a profile, it can only read those, there is not a GUI implementation yet24* added the possibility to include other snapshot folders within a profile, it can only read those, there is not a GUI implementation yet
2325
=== modified file 'VERSION'
--- VERSION 2010-01-07 08:57:36 +0000
+++ VERSION 2010-01-08 19:59:12 +0000
@@ -1,1 +1,2 @@
10.9.99beta1010.9.99tjk
2
23
=== modified file 'common/Makefile.template'
--- common/Makefile.template 2009-04-28 14:02:13 +0000
+++ common/Makefile.template 2010-01-08 19:59:12 +0000
@@ -37,4 +37,8 @@
37 #install application37 #install application
38 install -d $(DEST)/bin38 install -d $(DEST)/bin
39 install backintime $(DEST)/bin39 install backintime $(DEST)/bin
40
41 # install daemon
42 install -d $(DESTDIR)/etc/xdg/autostart
43 install --mode=644 backintime-mountmonitor.desktop $(DESTDIR)/etc/xdg/autostart
4044
4145
=== added file 'common/backintime-mountmonitor.desktop'
--- common/backintime-mountmonitor.desktop 1970-01-01 00:00:00 +0000
+++ common/backintime-mountmonitor.desktop 2010-01-08 19:59:12 +0000
@@ -0,0 +1,12 @@
1[Desktop Entry]
2Name=Back In Time (Mount Monitor)
3Exec=backintime --mountmonitor
4NoDisplay=true
5Icon=gtk-save
6Terminal=false
7X-MultipleArgs=false
8Type=Application
9StartupNotify=false
10Categories=GNOME;GTK;System;
11Comment=Simple backup system
12Name[nl_NL]=backintime-mountmonitor.desktop
013
=== modified file 'common/backintime.py'
--- common/backintime.py 2009-12-17 10:18:53 +0000
+++ common/backintime.py 2010-01-08 19:59:12 +0000
@@ -72,6 +72,10 @@
72 print '\tShow the ID of the last snapshot (and exit)'72 print '\tShow the ID of the last snapshot (and exit)'
73 print '--last-snapshot-path'73 print '--last-snapshot-path'
74 print '\tShow the path to the last snapshot (and exit)'74 print '\tShow the path to the last snapshot (and exit)'
75 print '--mountmonitor'
76 print '\tStart the mount monitor daemon'
77 print '--mountmonitor-stop'
78 print '\tStop the mount monitor daemon'
75 print '-v | --version'79 print '-v | --version'
76 print '\tShow version (and exit)'80 print '\tShow version (and exit)'
77 print '--license'81 print '--license'
@@ -80,7 +84,17 @@
80 print '\tShow this help (and exit)'84 print '\tShow this help (and exit)'
81 print ''85 print ''
8286
87def start_mountmonitor():
88 import subprocess
89 source = os.path.join(os.path.dirname(__file__),"mountmonitor.py")
90 cmd = "python"
91 p=subprocess.Popen((cmd,source))
92 print "Mount Monitor Started, Process ID is %s." % p.pid
93
8394
95def stop_mountmonitor():
96 print "Cannot stop Mount Monitor, not implemented."
97
84def start_app( app_name = 'backintime', extra_args = [] ):98def start_app( app_name = 'backintime', extra_args = [] ):
85 cfg = config.Config()99 cfg = config.Config()
86 print_version( cfg, app_name )100 print_version( cfg, app_name )
@@ -182,6 +196,15 @@
182 if arg == '--gnome' or arg == '--kde4' or arg == '--kde3':196 if arg == '--gnome' or arg == '--kde4' or arg == '--kde3':
183 continue197 continue
184198
199 if arg == '--mountmonitor':
200 start_mountmonitor()
201 sys.exit(0)
202
203 if arg == '--mountmonitor-stop':
204 stop_mountmonitor()
205 sys.exit(0)
206
207
185 if arg[0] == '-':208 if arg[0] == '-':
186 if not arg[0] in extra_args:209 if not arg[0] in extra_args:
187 print "Ignore option: %s" % arg210 print "Ignore option: %s" % arg
188211
=== modified file 'common/config.py'
--- common/config.py 2010-01-07 08:57:36 +0000
+++ common/config.py 2010-01-08 19:59:12 +0000
@@ -35,7 +35,7 @@
3535
36class Config( configfile.ConfigFileWithProfiles ):36class Config( configfile.ConfigFileWithProfiles ):
37 APP_NAME = 'Back In Time'37 APP_NAME = 'Back In Time'
38 VERSION = '0.9.99beta10'38 VERSION = '0.9.99tjk'
39 COPYRIGHT = 'Copyright (c) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey'39 COPYRIGHT = 'Copyright (c) 2008-2009 Oprea Dan, Bart de Koning, Richard Bailey'
40 CONFIG_VERSION = 440 CONFIG_VERSION = 4
4141
@@ -50,6 +50,10 @@
5050
51 DISK_UNIT_MB = 1051 DISK_UNIT_MB = 10
52 DISK_UNIT_GB = 2052 DISK_UNIT_GB = 20
53
54 NO_ACTION = 0
55 ASK = 10
56 SILENT_SNAPSHOT = 20
5357
54 AUTOMATIC_BACKUP_MODES = { 58 AUTOMATIC_BACKUP_MODES = {
55 NONE : _('Disabled'), 59 NONE : _('Disabled'),
@@ -68,6 +72,12 @@
68 }72 }
6973
70 MIN_FREE_SPACE_UNITS = { DISK_UNIT_MB : 'Mb', DISK_UNIT_GB : 'Gb' }74 MIN_FREE_SPACE_UNITS = { DISK_UNIT_MB : 'Mb', DISK_UNIT_GB : 'Gb' }
75
76 ON_MOUNT_ACTIONS = {
77 NO_ACTION: _('No action'),
78 ASK: _('Ask user'),
79 SILENT_SNAPSHOT: _('Silently take snapshot')
80 }
7181
7282
73 def __init__( self ):83 def __init__( self ):
@@ -238,7 +248,7 @@
238 profile_id = self.get_current_profile()248 profile_id = self.get_current_profile()
239249
240 if not os.path.isdir( value ):250 if not os.path.isdir( value ):
241 self.notify_error( _( '%s is not a folder !' ) )251 self.notify_error( _( '%s is not a folder !' % value) )
242 return False252 return False
243253
244 #Initialize the snapshots folder254 #Initialize the snapshots folder
@@ -335,6 +345,12 @@
335 def set_automatic_backup_mode( self, value, profile_id = None ):345 def set_automatic_backup_mode( self, value, profile_id = None ):
336 self.set_profile_int_value( 'snapshots.automatic_backup_mode', value, profile_id )346 self.set_profile_int_value( 'snapshots.automatic_backup_mode', value, profile_id )
337347
348 def get_on_mount_action( self, profile_id = None ):
349 return self.get_profile_int_value( 'snapshots.on_mount_action', self.NO_ACTION, profile_id )
350
351 def set_on_mount_action( self, value, profile_id = None ):
352 self.set_profile_int_value( 'snapshots.on_mount_action', value, profile_id )
353
338 #def get_per_directory_schedule( self, profile_id = None ):354 #def get_per_directory_schedule( self, profile_id = None ):
339 # return self.get_profile_bool_value( 'snapshots.expert.per_directory_schedule', False, profile_id )355 # return self.get_profile_bool_value( 'snapshots.expert.per_directory_schedule', False, profile_id )
340356
341357
=== modified file 'common/debian_specific/control'
--- common/debian_specific/control 2010-01-07 08:57:36 +0000
+++ common/debian_specific/control 2010-01-08 19:59:12 +0000
@@ -1,11 +1,11 @@
1Package: backintime-common1Package: backintime-common
2Version: 0.9.99beta102Version: 0.9.99tjk
3Priority: optional3Priority: optional
4Section: utils4Section: utils
5Maintainer: BIT Team <bit-team@lists.launchpad.net>5Maintainer: BIT Team <bit-team@lists.launchpad.net>
6Architecture: all6Architecture: all
7Homepage: http://backintime.le-web.org7Homepage: http://backintime.le-web.org
8Depends: python, rsync, cron8Depends: python, rsync, cron, python-gobject
9Recommends: powermgmt-base9Recommends: powermgmt-base
10Conflicts: backintime10Conflicts: backintime
11Replaces: backintime11Replaces: backintime
1212
=== removed file 'common/man/C/backintime.1.gz'
13Binary files common/man/C/backintime.1.gz 2010-01-07 08:57:36 +0000 and common/man/C/backintime.1.gz 1970-01-01 00:00:00 +0000 differ13Binary files common/man/C/backintime.1.gz 2010-01-07 08:57:36 +0000 and common/man/C/backintime.1.gz 1970-01-01 00:00:00 +0000 differ
=== added file 'common/mountmonitor.py'
--- common/mountmonitor.py 1970-01-01 00:00:00 +0000
+++ common/mountmonitor.py 2010-01-08 19:59:12 +0000
@@ -0,0 +1,117 @@
1# Back In Time
2# Copyright (C) 2008-2009 Oprea Dan
3# Additional code for monitoring volume mounts: Copyright (C) 2009 Timo Kluck
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19import sys
20
21import os
22
23import gtk
24
25import config
26import pluginmanager
27import logger
28
29
30# this function can be called if we find another way of monitoring mounts than running a daemon
31def on_mount_action(mount_path):
32 mount_monitor=backintime_mount_monitor()
33 mount_monitor.on_mount_added(mount_path)
34
35# set up a monitor
36class backintime_mount_monitor():
37
38 # connect specifies whether to listen for mount events
39 def __init__(self, connect=False):
40
41 if connect:
42 import gio
43 self.volume_monitor=gio.VolumeMonitor()
44 #self.volume_monitor.connect("drive-connected",self._on_drive_connected)
45 self.volume_monitor.connect("mount-added",self._on_mount_added)
46
47
48 self.pluginmanager = pluginmanager.PluginManager()
49
50 self.config=config.Config()
51 # FIXME: no Snapshots object available, but plugins use only snapshots.config. So we pass self as argument.
52 # this is probably going to be buggy in the future
53 self.pluginmanager.load_plugins(self)
54
55 # ask user whether he/she wants to take a snapshot
56 def ask_user(self, mount_path):
57 if self.pluginmanager.has_gui_plugins():
58 make_backup=self.pluginmanager.ask_user_on_mount(mount_path)
59
60 if make_backup:
61 self.make_snapshot()
62
63 # make a snapshot
64 def make_snapshot(self):
65 app = 'backintime'
66 if os.path.isfile( './backintime' ):
67 app = './backintime'
68 cmd = "%s --backup &" % app
69 os.system( cmd )
70
71
72 # callback for gio
73 def _on_mount_added(self,volume_monitor,mount):
74
75 mount_path=mount.get_root().get_path()
76 logger.info("Mount detected: %s" % mount_path)
77 self.on_mount_added(mount_path)
78
79 # callback for gio
80 def _on_drive_connected(self,volume_monitor,drive):
81 # reload configuration
82 self.config=config.Config()
83
84 snapshots_path=self.config.get_snapshots_path()
85
86 volumes=drive.get_volumes()
87 for volume in volumes:
88 if snapshots_path.find(volume.get_name())>=0:
89 volume.mount(None,self._empty_callback)
90
91 def _empty_callback(a,b,c):
92 return
93
94 # actual code to run when mount added
95 def on_mount_added(self,mount_path):
96
97 # reload configuration
98 self.config=config.Config()
99
100 snapshots_path=self.config.get_snapshots_path()
101
102 if os.path.commonprefix([snapshots_path,mount_path])==mount_path:
103 if os.path.isdir(snapshots_path):
104 logger.info("Mounted disk contains snapshots. Performing configured action.")
105 on_mount_action=self.config.get_on_mount_action()
106 if on_mount_action==self.config.ASK:
107 self.ask_user(mount_path)
108 elif on_mount_action==self.config.SILENT_SNAPSHOT:
109 self.make_snapshot()
110
111
112if __name__=="__main__":
113 mount_monitor=backintime_mount_monitor(True)
114
115
116 gtk.main()
117
0118
=== modified file 'common/pluginmanager.py'
--- common/pluginmanager.py 2009-11-02 13:52:00 +0000
+++ common/pluginmanager.py 2010-01-08 19:59:12 +0000
@@ -46,6 +46,9 @@
4646
47 def on_new_snapshot( self, snapshot_id, snapshot_path ):47 def on_new_snapshot( self, snapshot_id, snapshot_path ):
48 return48 return
49
50 def ask_user_on_mount( self, path ):
51 return False
4952
5053
51class PluginManager():54class PluginManager():
@@ -103,4 +106,10 @@
103 def on_new_snapshot( self, snapshot_id, snapshot_path ):106 def on_new_snapshot( self, snapshot_id, snapshot_path ):
104 for plugin in self.plugins:107 for plugin in self.plugins:
105 plugin.on_new_snapshot( snapshot_id, snapshot_path )108 plugin.on_new_snapshot( snapshot_id, snapshot_path )
109
110 def ask_user_on_mount( self,path ):
111 if self.has_gui_plugins_:
112 return self.plugins[0].ask_user_on_mount( path )
113 else:
114 return False
106115
107116
=== modified file 'gnome/debian_specific/control'
--- gnome/debian_specific/control 2010-01-07 08:57:36 +0000
+++ gnome/debian_specific/control 2010-01-08 19:59:12 +0000
@@ -1,10 +1,10 @@
1Package: backintime-gnome1Package: backintime-gnome
2Version: 0.9.99beta102Version: 0.9.99tjk
3Priority: optional3Priority: optional
4Section: gnome4Section: gnome
5Maintainer: BIT Team <bit-team@lists.launchpad.net>5Maintainer: BIT Team <bit-team@lists.launchpad.net>
6Architecture: all6Architecture: all
7Homepage: http://backintime.le-web.org7Homepage: http://backintime.le-web.org
8Depends: x11-utils, python-glade2, python-gnome2, python-notify, meld, gksu, backintime-common (= 0.9.99beta10)8Depends: x11-utils, python-glade2, python-gnome2, python-notify, meld, gksu, backintime-common (= 0.9.99tjk)
9Description: Simple backup system for GNOME Desktop9Description: Simple backup system for GNOME Desktop
10 This is a GNOME GUI frontend for backintime-common.10 This is a GNOME GUI frontend for backintime-common.
1111
=== modified file 'gnome/docbook/C/backintime-C.omf'
--- gnome/docbook/C/backintime-C.omf 2010-01-07 08:57:36 +0000
+++ gnome/docbook/C/backintime-C.omf 2010-01-08 19:59:12 +0000
@@ -5,7 +5,15 @@
5 <maintainer>(BIT Team)</maintainer>5 <maintainer>(BIT Team)</maintainer>
6 <title>Back In Time Manual</title>6 <title>Back In Time Manual</title>
7 <date>November 2008</date>7 <date>November 2008</date>
8<<<<<<< TREE
9<<<<<<< TREE
10 <version identifier="Back In Time Manual 0.9.26" date="November 2008"/>
11=======
12 <version identifier="Back In Time Manual 0.9.99beta2" date="November 2008"/>
13>>>>>>> MERGE-SOURCE
14=======
8 <version identifier="Back In Time Manual 0.9.99beta10" date="November 2008"/>15 <version identifier="Back In Time Manual 0.9.99beta10" date="November 2008"/>
16>>>>>>> MERGE-SOURCE
9 <subject category="GNOME|Applications|System Tools"/>17 <subject category="GNOME|Applications|System Tools"/>
10 <description>18 <description>
11 Back In Time is a simple backup system for GNOME desktop.19 Back In Time is a simple backup system for GNOME desktop.
1220
=== modified file 'gnome/docbook/C/backintime.xml'
--- gnome/docbook/C/backintime.xml 2010-01-07 08:57:36 +0000
+++ gnome/docbook/C/backintime.xml 2010-01-08 19:59:12 +0000
@@ -3,8 +3,18 @@
3<!ENTITY legal SYSTEM "legal.xml">3<!ENTITY legal SYSTEM "legal.xml">
4<!ENTITY appname "Back In Time">4<!ENTITY appname "Back In Time">
5<!ENTITY app "<application>&appname;</application>">5<!ENTITY app "<application>&appname;</application>">
6<<<<<<< TREE
7<<<<<<< TREE
8<!ENTITY appversion "0.9.26">
9<!ENTITY manrevision "0.9.26">
10=======
11<!ENTITY appversion "0.9.99beta2">
12<!ENTITY manrevision "0.9.99beta2">
13>>>>>>> MERGE-SOURCE
14=======
6<!ENTITY appversion "0.9.99beta10">15<!ENTITY appversion "0.9.99beta10">
7<!ENTITY manrevision "0.9.99beta10">16<!ENTITY manrevision "0.9.99beta10">
17>>>>>>> MERGE-SOURCE
8<!ENTITY date "Mars 2009">18<!ENTITY date "Mars 2009">
9]>19]>
10<!--20<!--
1121
=== removed file 'gnome/man/C/backintime-gnome.1.gz'
12Binary files gnome/man/C/backintime-gnome.1.gz 2010-01-07 08:57:36 +0000 and gnome/man/C/backintime-gnome.1.gz 1970-01-01 00:00:00 +0000 differ22Binary files gnome/man/C/backintime-gnome.1.gz 2010-01-07 08:57:36 +0000 and gnome/man/C/backintime-gnome.1.gz 1970-01-01 00:00:00 +0000 differ
=== modified file 'gnome/settingsdialog.glade'
--- gnome/settingsdialog.glade 2010-01-07 08:57:36 +0000
+++ gnome/settingsdialog.glade 2010-01-08 19:59:12 +0000
@@ -205,6 +205,35 @@
205 </packing>205 </packing>
206 </child>206 </child>
207 <child>207 <child>
208 <object class="GtkFrame" id="frame3">
209 <property name="visible">True</property>
210 <property name="label_xalign">0</property>
211 <property name="shadow_type">none</property>
212 <child>
213 <object class="GtkAlignment" id="alignment3">
214 <property name="visible">True</property>
215 <property name="left_padding">12</property>
216 <child>
217 <object class="GtkComboBox" id="cb_on_mount_action">
218 <property name="visible">True</property>
219 </object>
220 </child>
221 </object>
222 </child>
223 <child type="label">
224 <object class="GtkLabel" id="lbl_onmount1">
225 <property name="visible">True</property>
226 <property name="label" translatable="yes">&lt;b&gt;On connecting disk&lt;/b&gt;</property>
227 <property name="use_markup">True</property>
228 </object>
229 </child>
230 </object>
231 <packing>
232 <property name="expand">False</property>
233 <property name="position">2</property>
234 </packing>
235 </child>
236 <child>
208 <object class="GtkHBox" id="hbox1">237 <object class="GtkHBox" id="hbox1">
209 <property name="visible">True</property>238 <property name="visible">True</property>
210 <child>239 <child>
@@ -223,7 +252,7 @@
223 </child>252 </child>
224 </object>253 </object>
225 <packing>254 <packing>
226 <property name="position">2</property>255 <property name="position">3</property>
227 </packing>256 </packing>
228 </child>257 </child>
229 </object>258 </object>
230259
=== modified file 'gnome/settingsdialog.py'
--- gnome/settingsdialog.py 2010-01-06 08:42:40 +0000
+++ gnome/settingsdialog.py 2010-01-08 19:59:12 +0000
@@ -111,6 +111,17 @@
111 self.rev_automatic_backup_modes[ map[key] ] = key111 self.rev_automatic_backup_modes[ map[key] ] = key
112 self.store_backup_mode.append( [ map[key], key ] )112 self.store_backup_mode.append( [ map[key], key ] )
113 113
114 #on mount action store
115 self.store_on_mount_action = gtk.ListStore( str, int )
116 default_on_mount_action_index = 0
117 map = self.config.ON_MOUNT_ACTIONS
118 self.rev_on_mount_actions = {}
119 keys = map.keys()
120 keys.sort()
121 for key in keys:
122 self.rev_on_mount_actions[ map[key] ] = key
123 self.store_on_mount_action.append( [ map[key], key ] )
124
114 #per directory schedule125 #per directory schedule
115 #self.cb_per_directory_schedule = get( 'cb_per_directory_schedule' )126 #self.cb_per_directory_schedule = get( 'cb_per_directory_schedule' )
116 #self.lbl_schedule = get( 'lbl_schedule' )127 #self.lbl_schedule = get( 'lbl_schedule' )
@@ -168,6 +179,15 @@
168 self.cb_backup_mode.pack_start( renderer, True )179 self.cb_backup_mode.pack_start( renderer, True )
169 self.cb_backup_mode.add_attribute( renderer, 'text', 0 )180 self.cb_backup_mode.add_attribute( renderer, 'text', 0 )
170 181
182 #setup on mount action
183 self.cb_on_mount_action = get( 'cb_on_mount_action' )
184 self.cb_on_mount_action.set_model( self.store_on_mount_action )
185
186 self.cb_on_mount_action.clear()
187 renderer = gtk.CellRendererText()
188 self.cb_on_mount_action.pack_end( renderer, True )
189 self.cb_on_mount_action.add_attribute( renderer, 'text', 0 )
190
171 #setup remove old backups older than191 #setup remove old backups older than
172 self.edit_remove_old_backup_value = get( 'edit_remove_old_backup_value' )192 self.edit_remove_old_backup_value = get( 'edit_remove_old_backup_value' )
173 self.cb_remove_old_backup_unit = get( 'cb_remove_old_backup_unit' )193 self.cb_remove_old_backup_unit = get( 'cb_remove_old_backup_unit' )
@@ -308,6 +328,9 @@
308 #per directory schedule328 #per directory schedule
309 #self.cb_per_directory_schedule.set_active( self.config.get_per_directory_schedule() )329 #self.cb_per_directory_schedule.set_active( self.config.get_per_directory_schedule() )
310 330
331 #setup on mount action
332 self.cb_on_mount_action.set_active( self.config.get_on_mount_action() )
333
311 #setup include folders334 #setup include folders
312 #self.update_per_directory_option()335 #self.update_per_directory_option()
313 336
@@ -433,6 +456,9 @@
433 456
434 #global schedule457 #global schedule
435 self.config.set_automatic_backup_mode( self.store_backup_mode.get_value( self.cb_backup_mode.get_active_iter(), 1 ) )458 self.config.set_automatic_backup_mode( self.store_backup_mode.get_value( self.cb_backup_mode.get_active_iter(), 1 ) )
459
460 #on mount action
461 self.config.set_on_mount_action( self.store_on_mount_action.get_value( self.cb_on_mount_action.get_active_iter(), 1 ) )
436 462
437 #auto-remove snapshots463 #auto-remove snapshots
438 self.config.set_remove_old_snapshots( 464 self.config.set_remove_old_snapshots(
439465
=== modified file 'kde4/backintime-kde4.desktop' (properties changed: -x to +x)
--- kde4/backintime-kde4.desktop 2009-04-27 13:43:00 +0000
+++ kde4/backintime-kde4.desktop 2010-01-08 19:59:12 +0000
@@ -1,3 +1,4 @@
1#!/usr/bin/env xdg-open
1[Desktop Entry]2[Desktop Entry]
2Name=Back In Time3Name=Back In Time
3Exec=backintime-kde44Exec=backintime-kde4
45
=== modified file 'kde4/debian_specific/control'
--- kde4/debian_specific/control 2010-01-07 08:57:36 +0000
+++ kde4/debian_specific/control 2010-01-08 19:59:12 +0000
@@ -1,11 +1,11 @@
1Package: backintime-kde41Package: backintime-kde4
2Version: 0.9.99beta102Version: 0.9.99tjk
3Priority: optional3Priority: optional
4Section: kde44Section: kde4
5Maintainer: BIT Team <bit-team@lists.launchpad.net>5Maintainer: BIT Team <bit-team@lists.launchpad.net>
6Architecture: all6Architecture: all
7Homepage: http://backintime.le-web.org7Homepage: http://backintime.le-web.org
8Depends: x11-utils, kdesudo, python-kde4 (>= 4.1), backintime-common (= 0.9.99beta10)8Depends: x11-utils, kdesudo, python-kde4 (>= 4.1), backintime-common (= 0.9.99tjk)
9Suggests: kompare9Suggests: kompare
10Description: Simple backup system for KDE4 Desktop10Description: Simple backup system for KDE4 Desktop
11 This is a KDE4 (>= 4.1) GUI frontend for backintime-common.11 This is a KDE4 (>= 4.1) GUI frontend for backintime-common.
1212
=== modified file 'kde4/docbook/en/index.docbook'
--- kde4/docbook/en/index.docbook 2010-01-07 08:57:36 +0000
+++ kde4/docbook/en/index.docbook 2010-01-08 19:59:12 +0000
@@ -3,8 +3,18 @@
3<!ENTITY legal SYSTEM "legal.xml">3<!ENTITY legal SYSTEM "legal.xml">
4<!ENTITY appname "Back In Time">4<!ENTITY appname "Back In Time">
5<!ENTITY app "<application>&appname;</application>">5<!ENTITY app "<application>&appname;</application>">
6<<<<<<< TREE
7<<<<<<< TREE
8<!ENTITY appversion "0.9.26">
9<!ENTITY manrevision "0.9.26">
10=======
11<!ENTITY appversion "0.9.99beta2">
12<!ENTITY manrevision "0.9.99beta2">
13>>>>>>> MERGE-SOURCE
14=======
6<!ENTITY appversion "0.9.99beta10">15<!ENTITY appversion "0.9.99beta10">
7<!ENTITY manrevision "0.9.99beta10">16<!ENTITY manrevision "0.9.99beta10">
17>>>>>>> MERGE-SOURCE
8<!ENTITY date "November 2008">18<!ENTITY date "November 2008">
9]>19]>
10<!--20<!--
1121
=== removed file 'kde4/man/C/backintime-kde4.1.gz'
12Binary files kde4/man/C/backintime-kde4.1.gz 2010-01-07 08:57:36 +0000 and kde4/man/C/backintime-kde4.1.gz 1970-01-01 00:00:00 +0000 differ22Binary files kde4/man/C/backintime-kde4.1.gz 2010-01-07 08:57:36 +0000 and kde4/man/C/backintime-kde4.1.gz 1970-01-01 00:00:00 +0000 differ
=== modified file 'kde4/settingsdialog.py'
--- kde4/settingsdialog.py 2010-01-07 09:15:31 +0000
+++ kde4/settingsdialog.py 2010-01-08 19:59:12 +0000
@@ -130,6 +130,17 @@
130 hlayout.addWidget( self.combo_automatic_snapshots )130 hlayout.addWidget( self.combo_automatic_snapshots )
131 self.fill_combo( self.combo_automatic_snapshots, self.config.AUTOMATIC_BACKUP_MODES )131 self.fill_combo( self.combo_automatic_snapshots, self.config.AUTOMATIC_BACKUP_MODES )
132132
133 #On mount action
134 group_box = QGroupBox( self )
135 self.global_on_mount_group_box = group_box
136 group_box.setTitle( QString.fromUtf8( _( 'On connecting disk:' ) ) )
137 layout.addWidget( group_box )
138
139 hlayout = QHBoxLayout( group_box )
140
141 self.combo_on_mount_action = KComboBox( self )
142 hlayout.addWidget( self.combo_on_mount_action )
143 self.fill_combo( self.combo_on_mount_action, self.config.ON_MOUNT_ACTIONS )
133 #144 #
134 layout.addStretch()145 layout.addStretch()
135 146
@@ -361,7 +372,8 @@
361 #TAB: General372 #TAB: General
362 self.edit_snapshots_path.setText( QString.fromUtf8( self.config.get_snapshots_path() ) )373 self.edit_snapshots_path.setText( QString.fromUtf8( self.config.get_snapshots_path() ) )
363 self.set_combo_value( self.combo_automatic_snapshots, self.config.get_automatic_backup_mode() )374 self.set_combo_value( self.combo_automatic_snapshots, self.config.get_automatic_backup_mode() )
364375 self.set_combo_value( self.combo_on_mount_action, self.config.get_on_mount_action() )
376
365 #TAB: Include377 #TAB: Include
366 self.list_include.clear()378 self.list_include.clear()
367379
@@ -433,6 +445,9 @@
433 #schedule445 #schedule
434 self.config.set_automatic_backup_mode( self.combo_automatic_snapshots.itemData( self.combo_automatic_snapshots.currentIndex() ).toInt()[0] )446 self.config.set_automatic_backup_mode( self.combo_automatic_snapshots.itemData( self.combo_automatic_snapshots.currentIndex() ).toInt()[0] )
435447
448 # onmount action
449 self.config.set_on_mount_action( self.combo_on_mount_action.itemData( self.combo_on_mount_action.currentIndex() ).toInt()[0] )
450
436 #auto-remove451 #auto-remove
437 self.config.set_remove_old_snapshots( 452 self.config.set_remove_old_snapshots(
438 self.cb_remove_older_then.isChecked(), 453 self.cb_remove_older_then.isChecked(),
439454
=== modified file 'plugins/gnomeplugin.py'
--- plugins/gnomeplugin.py 2009-12-01 08:48:44 +0000
+++ plugins/gnomeplugin.py 2010-01-08 19:59:12 +0000
@@ -163,6 +163,9 @@
163 return False163 return False
164164
165 self.systray = None165 self.systray = None
166
167 self.config=snapshots.config
168
166 try:169 try:
167 self.systray = GnomePlugin.Systray( snapshots )170 self.systray = GnomePlugin.Systray( snapshots )
168 except:171 except:
@@ -186,4 +189,17 @@
186189
187 def on_new_snapshot( self, snapshot_id, snapshot_path ):190 def on_new_snapshot( self, snapshot_id, snapshot_path ):
188 return191 return
192
193
194 def ask_user_on_mount(self, path):
195
196 tools.register_backintime_path('gnome')
197 import messagebox
198
199 make_backup=messagebox.show_question(None,self.config,"\
200The location %s contains snapshots (backups) of \
201some files in the system. Do you want to make \
202a snapshot now?" % path)
203 from gtk import RESPONSE_YES
204 return make_backup==RESPONSE_YES
189205
190206
=== modified file 'plugins/kde4plugin.py'
--- plugins/kde4plugin.py 2009-12-28 12:17:16 +0000
+++ plugins/kde4plugin.py 2010-01-08 19:59:12 +0000
@@ -70,3 +70,26 @@
70 except:70 except:
71 pass71 pass
7272
73 def ask_user_on_mount( self, path ):
74 from PyKDE4.kdecore import KAboutData, KCmdLineArgs, ki18n
75 from PyKDE4.kdeui import KApplication, KSystemTrayIcon, KIcon, KMessageBox
76
77 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' )
78
79 kaboutdata.setProgramIconName( 'document-save' )
80
81 KCmdLineArgs.init( [sys.argv[0]], kaboutdata )
82 kapp = KApplication()
83 messagebox = KMessageBox()
84
85 make_backup=messagebox.questionYesNo(None,"\
86The location %s contains snapshots (backups) of \
87some files in the system. Do you want to make \
88a snapshot now?" % path, "")
89
90 kapp = None
91
92 return make_backup==messagebox.Yes
93
94
95

Subscribers

People subscribed via source and target branches