Merge lp:~kjtehprogrammer/maya/fix-1300571 into lp:~elementary-apps/maya/trunk

Proposed by KJ Lawrence
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~kjtehprogrammer/maya/fix-1300571
Merge into: lp:~elementary-apps/maya/trunk
Diff against target: 105 lines (+12/-16)
2 files modified
src/Application.vala (+2/-2)
src/View/EventDialog.vala (+10/-14)
To merge this branch: bzr merge lp:~kjtehprogrammer/maya/fix-1300571
Reviewer Review Type Date Requested Status
Corentin Noël Disapprove
Review via email: mp+213964@code.launchpad.net

Description of the change

Switch to Gtk.Dialog

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :

I have a branch waiting for review that also replace the LightWindow.
It does replace this branch.

review: Disapprove
Revision history for this message
KJ Lawrence (kjtehprogrammer) wrote :

> I have a branch waiting for review that also replace the LightWindow.
> It does replace this branch.

Cool, at least someone is doing it!

Unmerged revisions

541. By KJ Lawrence

Forgot a 'print'...

540. By KJ Lawrence

Change from Gtk.Window/Granite.Widgets.LightWindow to Gtk.Dialog

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Application.vala'
2--- src/Application.vala 2014-03-24 22:15:29 +0000
3+++ src/Application.vala 2014-04-03 03:09:20 +0000
4@@ -297,7 +297,7 @@
5
6 //--- SIGNAL HANDLERS ---//
7
8- void on_event_dialog_response (View.EventDialog dialog, bool response_id, bool add_event) {
9+ void on_event_dialog_response (View.EventDialog dialog, int response_id, bool add_event) {
10
11 E.CalComponent event = dialog.ecal;
12 E.Source source = dialog.source;
13@@ -306,7 +306,7 @@
14
15 dialog.dispose ();
16
17- if (response_id != true)
18+ if (response_id != 1)
19 return;
20
21 if (add_event)
22
23=== modified file 'src/View/EventDialog.vala'
24--- src/View/EventDialog.vala 2014-03-21 06:16:35 +0000
25+++ src/View/EventDialog.vala 2014-04-03 03:09:20 +0000
26@@ -22,11 +22,7 @@
27 EDIT
28 }
29
30-#if USE_GRANITE_DECORATED_WINDOW
31-public class EventDialog : Granite.Widgets.LightWindow {
32-#else
33-public class EventDialog : Gtk.Window {
34-#endif
35+public class EventDialog : Gtk.Dialog {
36
37 /**
38 * The different widgets in the dialog.
39@@ -47,8 +43,6 @@
40 */
41 private bool can_edit = true;
42
43- public signal void response (bool response);
44-
45 private Gtk.Grid content_grid { get; private set; }
46
47 private Gee.ArrayList<E.Source> sources;
48@@ -98,10 +92,11 @@
49
50 // Dialog properties
51 //modal = true;
52+ set_parent_window(window.get_parent_window ());
53 window_position = Gtk.WindowPosition.CENTER_ON_PARENT;
54- //set_flags(Gtk.DialogFlags.DESTROY_WITH_PARENT);
55 type_hint = Gdk.WindowTypeHint.DIALOG;
56- transient_for = window;
57+ resizable = false;
58+ delete_event.connect(() => { response(0); return true; });
59
60 // Build dialog
61 build_dialog (date_time != null);
62@@ -196,7 +191,7 @@
63 break;
64 }
65 }
66- response (true);
67+ response (1);
68 }
69
70 //--- Helpers ---//
71@@ -400,7 +395,7 @@
72 var buttonbox = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
73 buttonbox.set_layout (Gtk.ButtonBoxStyle.END);
74
75- var cancel_button = new Gtk.Button.from_stock (Gtk.Stock.CANCEL);
76+ var cancel_button = new Gtk.Button.with_label (_("Cancel"));
77 if (add_event) {
78 create_button = new Gtk.Button.with_label (_("Create Event"));
79 }
80@@ -409,7 +404,7 @@
81 }
82
83 create_button.clicked.connect (save);
84- cancel_button.clicked.connect (() => {response (false);this.destroy();});
85+ cancel_button.clicked.connect (() => { response (0); this.destroy(); });
86
87 buttonbox.pack_end (cancel_button);
88 buttonbox.pack_end (create_button);
89@@ -419,7 +414,8 @@
90 content_grid.attach (subgrid, 0, 0, 1, 1);
91 content_grid.attach (buttonbox, 0, 1, 1, 1);
92
93- this.add (content_grid);
94+ Gtk.Box container = get_content_area () as Gtk.Box;
95+ container.add(content_grid);
96
97 show_all();
98 }
99@@ -558,4 +554,4 @@
100 }
101
102
103-}
104+}
105\ No newline at end of file

Subscribers

People subscribed via source and target branches