Merge lp:~andrewfister/deja-dup/close-button-fix into lp:~deja-dup-team/deja-dup/trunk

Proposed by Andrew Fister
Status: Merged
Merge reported by: Michael Terry
Merged at revision: not available
Proposed branch: lp:~andrewfister/deja-dup/close-button-fix
Merge into: lp:~deja-dup-team/deja-dup/trunk
Diff against target: 69 lines (+15/-1)
3 files modified
AUTHORS (+1/-1)
deja-dup/Assistant.vala (+2/-0)
deja-dup/AssistantOperation.vala (+12/-0)
To merge this branch: bzr merge lp:~andrewfister/deja-dup/close-button-fix
Reviewer Review Type Date Requested Status
Michael Terry Approve
Review via email: mp+29686@code.launchpad.net

Description of the change

Instead of stopping the backup and closing when the window manager close button is pressed, Deja-Dup should "minimize to tray", or in other words just hide the window. This is the functionality implemented in this branch.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Merged, with the fix that we do_cancel instead of do_close to retain previous behavior.

review: Approve
Revision history for this message
Andrew Fister (andrewfister) wrote :

Are you using do_cancel there because of the hide_everything in do_cancel? It just seemed to me, semantically, that if there's no operation going on, then there's inherently nothing to cancel, so why call something called do_cancel?

Revision history for this message
Michael Terry (mterry) wrote :

Uh, you're right, I guess. Since there's no operation, it means we just do 'hide_everything' then 'do_close'. I used do_cancel because that's what the close button used to do. But it is harmless.

Revision history for this message
Andrew Fister (andrewfister) wrote :

OK, that's cool. Thanks for the quick review :-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2010-05-29 17:44:34 +0000
3+++ AUTHORS 2010-07-12 10:46:40 +0000
4@@ -5,7 +5,7 @@
5
6 Files: *
7 Copyright: 2008–2010 Michael Terry <mike@mterry.name>
8- 2009 Andrew Fister <temposs@gmail.com>
9+ 2009,2010 Andrew Fister <temposs@gmail.com>
10 2010 Michael Vogt <michael.vogt@ubuntu.com>
11 License: GPL-3+
12
13
14=== modified file 'deja-dup/Assistant.vala'
15--- deja-dup/Assistant.vala 2010-06-14 01:06:33 +0000
16+++ deja-dup/Assistant.vala 2010-07-12 10:46:40 +0000
17@@ -2,6 +2,7 @@
18 /*
19 This file is part of Déjà Dup.
20 © 2009 Michael Terry <mike@mterry.name>
21+ © 2010 Andrew Fister <temposs@gmail.com>
22
23 Déjà Dup is free software: you can redistribute it and/or modify
24 it under the terms of the GNU General Public License as published by
25@@ -128,6 +129,7 @@
26 void handle_response(int resp)
27 {
28 switch (resp) {
29+ case Gtk.ResponseType.DELETE_EVENT: break;
30 case BACK: go_back(); break;
31 case APPLY:
32 case FORWARD: go_forward(); break;
33
34=== modified file 'deja-dup/AssistantOperation.vala'
35--- deja-dup/AssistantOperation.vala 2010-06-14 01:06:33 +0000
36+++ deja-dup/AssistantOperation.vala 2010-07-12 10:46:40 +0000
37@@ -2,6 +2,7 @@
38 /*
39 This file is part of Déjà Dup.
40 © 2008,2009 Michael Terry <mike@mterry.name>
41+ © 2010 Andrew Fister <temposs@gmail.com>
42
43 Déjà Dup is free software: you can redistribute it and/or modify
44 it under the terms of the GNU General Public License as published by
45@@ -78,6 +79,7 @@
46 canceled.connect(do_cancel);
47 closed.connect(do_close);
48 prepare.connect(do_prepare);
49+ delete_event.connect(do_minimize_to_tray);
50 }
51
52 protected abstract Gtk.Widget? make_confirm_page();
53@@ -472,6 +474,16 @@
54 else
55 do_close();
56 }
57+
58+ bool do_minimize_to_tray(Gdk.Event event)
59+ {
60+ if (op != null)
61+ hide_on_delete(); // minimize to tray when operation is in progress
62+ else
63+ do_close(); // otherwise, do the normal close operation
64+
65+ return true;
66+ }
67
68 protected virtual void do_close()
69 {

Subscribers

People subscribed via source and target branches