Merge lp:~evfool/synaptic/lp262915 into lp:synaptic

Proposed by Robert Roth
Status: Needs review
Proposed branch: lp:~evfool/synaptic/lp262915
Merge into: lp:synaptic
Diff against target: 101 lines (+32/-11)
2 files modified
gtk/gtkbuilder/dialog_quit.ui (+23/-8)
gtk/rgmainwindow.cc (+9/-3)
To merge this branch: bzr merge lp:~evfool/synaptic/lp262915
Reviewer Review Type Date Requested Status
synaptic-developers Pending
Review via email: mp+135786@code.launchpad.net

Description of the change

* Added apply changes and quit button to the quit confirmation dialog
* Reordered buttons and updated text to be consistent with the GNOME interface (inspired from gEdit's unsaved changes warning)

To post a comment you must log in.

Unmerged revisions

2114. By Robert Roth

Added apply changes and quit button to the quit confirmation dialog (LP: #262915)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/gtkbuilder/dialog_quit.ui'
2--- gtk/gtkbuilder/dialog_quit.ui 2012-10-17 20:05:41 +0000
3+++ gtk/gtkbuilder/dialog_quit.ui 2012-11-22 21:53:20 +0000
4@@ -4,6 +4,7 @@
5 <object class="GtkDialog" id="dialog_quit">
6 <property name="visible">True</property>
7 <property name="can_focus">False</property>
8+ <property name="title" translatable="no"></property>
9 <property name="border_width">6</property>
10 <property name="resizable">False</property>
11 <property name="type_hint">normal</property>
12@@ -19,6 +20,21 @@
13 <property name="can_focus">False</property>
14 <property name="layout_style">end</property>
15 <child>
16+ <object class="GtkButton" id="okbutton1">
17+ <property name="label">gtk-quit</property>
18+ <property name="visible">True</property>
19+ <property name="can_focus">True</property>
20+ <property name="can_default">True</property>
21+ <property name="receives_default">False</property>
22+ <property name="use_stock">True</property>
23+ </object>
24+ <packing>
25+ <property name="expand">False</property>
26+ <property name="fill">True</property>
27+ <property name="position">0</property>
28+ </packing>
29+ </child>
30+ <child>
31 <object class="GtkButton" id="cancelbutton1">
32 <property name="label">gtk-cancel</property>
33 <property name="visible">True</property>
34@@ -30,22 +46,20 @@
35 <packing>
36 <property name="expand">False</property>
37 <property name="fill">True</property>
38- <property name="position">0</property>
39+ <property name="position">1</property>
40 </packing>
41 </child>
42 <child>
43- <object class="GtkButton" id="okbutton1">
44- <property name="label">gtk-quit</property>
45+ <object class="GtkButton" id="applyquitbutton1">
46+ <property name="label" translatable="yes">Apply changes and Quit</property>
47 <property name="visible">True</property>
48 <property name="can_focus">True</property>
49- <property name="can_default">True</property>
50- <property name="receives_default">False</property>
51- <property name="use_stock">True</property>
52+ <property name="receives_default">True</property>
53 </object>
54 <packing>
55 <property name="expand">False</property>
56 <property name="fill">True</property>
57- <property name="position">1</property>
58+ <property name="position">2</property>
59 </packing>
60 </child>
61 </object>
62@@ -88,7 +102,7 @@
63 <property name="can_focus">False</property>
64 <property name="xalign">0</property>
65 <property name="yalign">0</property>
66- <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;Quit and discard marked changes?&lt;/big&gt;&lt;/b&gt;
67+ <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;Apply marked changes before closing?&lt;/big&gt;&lt;/b&gt;
68
69 There are still marked changes that have not yet been applied. They will get lost if you choose to quit 'Synaptic'.</property>
70 <property name="use_markup">True</property>
71@@ -117,6 +131,7 @@
72 </object>
73 </child>
74 <action-widgets>
75+ <action-widget response="-10">applyquitbutton1</action-widget>
76 <action-widget response="-6">cancelbutton1</action-widget>
77 <action-widget response="-5">okbutton1</action-widget>
78 </action-widgets>
79
80=== modified file 'gtk/rgmainwindow.cc'
81--- gtk/rgmainwindow.cc 2012-11-22 14:13:46 +0000
82+++ gtk/rgmainwindow.cc 2012-11-22 21:53:20 +0000
83@@ -2045,9 +2045,15 @@
84 {
85 if (_interfaceLocked > 0)
86 return true;
87-
88- RGGtkBuilderUserDialog dia(this);
89- if (_unsavedChanges == false || dia.run("quit")) {
90+ gint res = 0;
91+ if (_unsavedChanges == true) {
92+ RGGtkBuilderUserDialog dia(this);
93+ res = dia.run("quit", true);
94+ if (res == GTK_RESPONSE_APPLY) {
95+ this->cbProceedClicked(NULL, this);
96+ }
97+ }
98+ if (_unsavedChanges == false || GTK_RESPONSE_OK == res || GTK_RESPONSE_APPLY == res) {
99 _error->Discard();
100 saveState();
101 showErrors();

Subscribers

People subscribed via source and target branches

to status/vote changes: