Merge lp:~fabiozaramella/scratch/fix-1337291 into lp:~elementary-apps/scratch/scratch

Proposed by Fabio Zaramella
Status: Merged
Approved by: Cody Garver
Approved revision: 1358
Merged at revision: 1388
Proposed branch: lp:~fabiozaramella/scratch/fix-1337291
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 73 lines (+12/-8)
2 files modified
src/Services/TemplateManager.vala (+6/-4)
src/Widgets/SearchManager.vala (+6/-4)
To merge this branch: bzr merge lp:~fabiozaramella/scratch/fix-1337291
Reviewer Review Type Date Requested Status
Robert Roth (community) Approve
Cody Garver Pending
Review via email: mp+235405@code.launchpad.net

This proposal supersedes a proposal from 2014-08-15.

Commit message

* Replace deprecated Granite.LightWindow with Gtk.Dialog in TemplateManager
* Replace deprecated Granite.SearchBar with Gtk.SearchEntry in SearchManager

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

Doesn't window.title = label; need to be window.title = _(label); so that the translation carries?

review: Needs Information
Revision history for this message
Fabio Zaramella (fabiozaramella) wrote : Posted in a previous version of this proposal

Sincerely i don't know, but if it has to be translated also the row:

var button = new TemplateButton (label, description, icon_id);

should be:

var button = new TemplateButton (_(label), description, icon_id);

no?

Revision history for this message
Robert Roth (evfool) wrote :

I guess you've had a conflict, fix the merge comments.

review: Needs Fixing (code review)
1357. By ffabio-96-x

solve conflicts

Revision history for this message
Fabio Zaramella (fabiozaramella) wrote :

no it's not ok now

Revision history for this message
Robert Roth (evfool) wrote :

The "<<<<<<< TREE", ">>>>>>> MERGE-SOURCE" and "=======" conflict markers are still there, the replace_entry is declared and set up twice, once with text, next time with icon only, this can't be ok.

review: Needs Fixing
1358. By ffabio-96-x

now should be ok

Revision history for this message
Fabio Zaramella (fabiozaramella) wrote :

yeah i've noticed that :p

Revision history for this message
Fabio Zaramella (fabiozaramella) wrote :

removed

Revision history for this message
Robert Roth (evfool) wrote :

Ok, thanks, code-wise it looks ok now, the diff does look like doing exactly what the comments say it does.
Regarding the label string needing translation: I think the label should come as a translated string from the register_template invocation (not used at all right now), along with the description string, so I am approving this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Services/TemplateManager.vala'
2--- src/Services/TemplateManager.vala 2013-07-23 20:22:38 +0000
3+++ src/Services/TemplateManager.vala 2014-10-03 19:54:38 +0000
4@@ -209,7 +209,7 @@
5 **/
6 public class Scratch.TemplateManager : GLib.Object {
7
8- private Granite.Widgets.LightWindow dialog;
9+ private Gtk.Dialog dialog;
10
11 private Scratch.Template current_template;
12
13@@ -227,7 +227,8 @@
14 public signal void template_loaded (Template template, File file);
15
16 public TemplateManager () {
17- dialog = new Granite.Widgets.LightWindow (_("Templates"));
18+ dialog = new Gtk.Dialog ();
19+ dialog.title = _("Templates");
20
21 this.grid = new Gtk.Grid ();
22 this.grid.margin = 5;
23@@ -267,7 +268,8 @@
24 button.clicked.connect (() => {
25 current_template = (Scratch.Template) Object.new (template_type);
26 this.dialog.hide ();
27- var window = new Granite.Widgets.LightWindow (label);
28+ var window = new Gtk.Dialog ();
29+ window.title = label;
30 if (parent != null) window.set_transient_for ((Gtk.Window)parent);
31 window.add (current_template.get_creation_box ());
32 window.show_all ();
33@@ -305,4 +307,4 @@
34 dialog.show_all ();
35 }
36 }
37-}
38+}
39\ No newline at end of file
40
41=== modified file 'src/Widgets/SearchManager.vala'
42--- src/Widgets/SearchManager.vala 2014-08-31 19:20:46 +0000
43+++ src/Widgets/SearchManager.vala 2014-10-03 19:54:38 +0000
44@@ -32,8 +32,8 @@
45 private Gtk.ToolItem tool_arrow_up;
46 private Gtk.ToolItem tool_arrow_down;
47
48- public Granite.Widgets.SearchBar search_entry;
49- public Granite.Widgets.SearchBar replace_entry;
50+ public Gtk.SearchEntry search_entry;
51+ public Gtk.SearchEntry replace_entry;
52 public Gtk.SpinButton go_to_entry;
53 private Gtk.Adjustment go_to_adj;
54
55@@ -68,7 +68,8 @@
56 // Main entries
57 // Search entry
58 this.window = window;
59- search_entry = new Granite.Widgets.SearchBar (_("Find"));
60+ search_entry = new Gtk.SearchEntry ();
61+ search_entry.placeholder_text = _("Find");
62 search_entry.width_request = 250;
63
64 // Back and Next buttons
65@@ -87,7 +88,8 @@
66 previous.image = i;
67
68 // Replace entry
69- replace_entry = new Granite.Widgets.SearchBar (_("Replace With"));
70+ replace_entry = new Gtk.SearchEntry ();
71+ replace_entry.placeholder_text = _("Replace With");
72 replace_entry.set_icon_from_icon_name (Gtk.EntryIconPosition.PRIMARY, "edit-symbolic");
73 replace_entry.width_request = 250;
74

Subscribers

People subscribed via source and target branches