From e1afda10e33bdd892ee655cda7b94c066d269817 Mon Sep 17 00:00:00 2001 From: Samuel Hand Date: Thu, 9 Aug 2018 15:29:15 +0100 Subject: Make constructors the first function --- plugins/omemo/src/manage_key_dialog.vala | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'plugins/omemo/src/manage_key_dialog.vala') diff --git a/plugins/omemo/src/manage_key_dialog.vala b/plugins/omemo/src/manage_key_dialog.vala index d359fd81..e13b9279 100644 --- a/plugins/omemo/src/manage_key_dialog.vala +++ b/plugins/omemo/src/manage_key_dialog.vala @@ -31,26 +31,6 @@ public class ManageKeyDialog : Gtk.Dialog { private bool return_to_main; private int current_response; - private void handle_cancel() { - if (manage_stack.get_visible_child_name() == "main") close(); - - if (manage_stack.get_visible_child_name() == "verify") { - manage_stack.set_visible_child_name("main"); - cancel_button.label = "Cancel"; - } - - if (manage_stack.get_visible_child_name() == "confirm") { - if (return_to_main) { - manage_stack.set_visible_child_name("main"); - cancel_button.label = "Cancel"; - } else { - manage_stack.set_visible_child_name("verify"); - } - } - - ok_button.sensitive = false; - } - public ManageKeyDialog(Row device, Database db) { Object(use_header_bar : 1); @@ -85,6 +65,26 @@ public class ManageKeyDialog : Gtk.Dialog { }); } + private void handle_cancel() { + if (manage_stack.get_visible_child_name() == "main") close(); + + if (manage_stack.get_visible_child_name() == "verify") { + manage_stack.set_visible_child_name("main"); + cancel_button.label = "Cancel"; + } + + if (manage_stack.get_visible_child_name() == "confirm") { + if (return_to_main) { + manage_stack.set_visible_child_name("main"); + cancel_button.label = "Cancel"; + } else { + manage_stack.set_visible_child_name("verify"); + } + } + + ok_button.sensitive = false; + } + private Box make_action_box(string title, string desc){ Box box = new Box(Orientation.VERTICAL, 0) { visible = true, margin_start = 20, margin_end = 20, margin_top = 14, margin_bottom = 14 }; Label lbl_title = new Label(title) { visible = true, halign = Align.START }; -- cgit v1.2.3-70-g09d2