Merge lp:~elementary-apps/pantheon-photos/remove-multitextentrydialog into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: David Hewitt
Approved revision: 3164
Merged at revision: 3165
Proposed branch: lp:~elementary-apps/pantheon-photos/remove-multitextentrydialog
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 126 lines (+0/-100)
3 files modified
src/CMakeLists.txt (+0/-1)
src/Dialogs/Dialogs.vala (+0/-21)
src/Dialogs/MultiTextEntryDialog.vala (+0/-78)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-photos/remove-multitextentrydialog
Reviewer Review Type Date Requested Status
Photos Devs Pending
Review via email: mp+317699@code.launchpad.net

Commit message

* Remove unused MultiTextEntryDialog.vala
* Dialogs.vala: Remove unused class MultiTextEntryDialogMediator

Description of the change

I guess this is dead code. Nothing seems to call it and the app compiles fine without it

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2017-02-16 19:35:47 +0000
+++ src/CMakeLists.txt 2017-02-18 02:44:04 +0000
@@ -76,7 +76,6 @@
76 Dialogs/AdjustDateTimeDialog.vala76 Dialogs/AdjustDateTimeDialog.vala
77 Dialogs/Dialogs.vala77 Dialogs/Dialogs.vala
78 Dialogs/ExportDialog.vala78 Dialogs/ExportDialog.vala
79 Dialogs/MultiTextEntryDialog.vala
80 Dialogs/PreferencesDialog.vala79 Dialogs/PreferencesDialog.vala
81 Dialogs/ProgressDialog.vala80 Dialogs/ProgressDialog.vala
82 Dialogs/TextEntryDialog.vala81 Dialogs/TextEntryDialog.vala
8382
=== modified file 'src/Dialogs/Dialogs.vala'
--- src/Dialogs/Dialogs.vala 2017-02-16 19:35:47 +0000
+++ src/Dialogs/Dialogs.vala 2017-02-18 02:44:04 +0000
@@ -631,27 +631,6 @@
631 }631 }
632}632}
633633
634public abstract class MultiTextEntryDialogMediator {
635 private MultiTextEntryDialog dialog;
636
637 public MultiTextEntryDialogMediator (string title, string label, string? initial_text = null) {
638 Gtk.Builder builder = AppWindow.create_builder ();
639 dialog = new MultiTextEntryDialog ();
640 dialog.get_content_area ().add ((Gtk.Box) builder.get_object ("dialog-vbox4"));
641 dialog.set_builder (builder);
642 dialog.setup (on_modify_validate, title, label, initial_text);
643 }
644
645 protected virtual bool on_modify_validate (string text) {
646 return true;
647 }
648
649 protected string? _execute () {
650 return dialog.execute ();
651 }
652}
653
654
655// This method takes primary and secondary texts and returns ready-to-use pango markup634// This method takes primary and secondary texts and returns ready-to-use pango markup
656// for a HIG-compliant alert dialog. Please see635// for a HIG-compliant alert dialog. Please see
657// http://library.gnome.org/devel/hig-book/2.32/windows-alert.html.en for details.636// http://library.gnome.org/devel/hig-book/2.32/windows-alert.html.en for details.
658637
=== removed file 'src/Dialogs/MultiTextEntryDialog.vala'
--- src/Dialogs/MultiTextEntryDialog.vala 2017-02-16 19:35:47 +0000
+++ src/Dialogs/MultiTextEntryDialog.vala 1970-01-01 00:00:00 +0000
@@ -1,78 +0,0 @@
1/*
2* Copyright (c) 2009-2013 Yorba Foundation
3* 2017 elementary LLC. (https://launchpad.net/pantheon-photos)
4*
5* This program is free software; you can redistribute it and/or
6* modify it under the terms of the GNU Lesser General Public
7* License as published by the Free Software Foundation; either
8* version 2.1 of the License, or (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 GNU
13* General Public License for more details.
14*
15* You should have received a copy of the GNU General Public
16* License along with this program; if not, write to the
17* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18* Boston, MA 02110-1301 USA
19*/
20
21public class MultiTextEntryDialog : Gtk.Dialog {
22 public delegate bool OnModifyValidateType (string text);
23
24 private unowned OnModifyValidateType on_modify_validate;
25 private Gtk.TextView entry;
26 private Gtk.Builder builder;
27 private Gtk.Button button1;
28 private Gtk.Button button2;
29 private Gtk.ButtonBox action_area_box;
30
31 public void set_builder (Gtk.Builder builder) {
32 this.builder = builder;
33 }
34
35 public void setup (OnModifyValidateType? modify_validate, string title, string label, string? initial_text) {
36 set_title (title);
37 set_resizable (true);
38 set_deletable (false);
39 set_default_size (500, 300);
40 set_parent_window (AppWindow.get_instance ().get_parent_window ());
41 set_transient_for (AppWindow.get_instance ());
42 on_modify_validate = modify_validate;
43
44 Gtk.Label name_label = builder.get_object ("label9") as Gtk.Label;
45 name_label.set_text (label);
46
47 Gtk.ScrolledWindow scrolled = builder.get_object ("scrolledwindow1") as Gtk.ScrolledWindow;
48 scrolled.set_shadow_type (Gtk.ShadowType.ETCHED_IN);
49
50 entry = builder.get_object ("textview1") as Gtk.TextView;
51 entry.set_wrap_mode (Gtk.WrapMode.WORD);
52 entry.buffer = new Gtk.TextBuffer (null);
53 entry.buffer.text = (initial_text != null ? initial_text : "");
54
55 entry.grab_focus ();
56
57 action_area_box = (Gtk.ButtonBox) get_action_area ();
58 action_area_box.set_layout (Gtk.ButtonBoxStyle.END);
59
60 button1 = (Gtk.Button) add_button (_ ("_Cancel"), Gtk.ResponseType.CANCEL);
61 button2 = (Gtk.Button) add_button (_ ("_Save"), Gtk.ResponseType.OK);
62
63 set_has_resize_grip (true);
64 }
65
66 public string? execute () {
67 string? text = null;
68
69 show_all ();
70
71 if (run () == Gtk.ResponseType.OK)
72 text = entry.buffer.text;
73
74 destroy ();
75
76 return text;
77 }
78}

Subscribers

People subscribed via source and target branches