|
| 1 | +/* |
| 2 | +* Copyright 2025 elementary, Inc. (https://elementary.io) |
| 3 | +* |
| 4 | +* This program is free software; you can redistribute it and/or |
| 5 | +* modify it under the terms of the GNU Lesser General Public |
| 6 | +* License version 3 as published by the Free Software Foundation. |
| 7 | +* |
| 8 | +* This program is distributed in the hope that it will be useful, |
| 9 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | +* General Public License for more details. |
| 12 | +* |
| 13 | +* You should have received a copy of the GNU Lesser General Public |
| 14 | +* License along with this program; if not, write to the |
| 15 | +* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 16 | +* Boston, MA 02110-1301 USA |
| 17 | +*/ |
| 18 | + |
| 19 | +public class Scratch.Dialogs.OverwriteUncommittedConfirmationDialog : Granite.MessageDialog { |
| 20 | + |
| 21 | + public string branch_name { get; construct; } |
| 22 | + public OverwriteUncommittedConfirmationDialog (Gtk.Window parent, string new_branch_name) { |
| 23 | + Object ( |
| 24 | + buttons: Gtk.ButtonsType.NONE, |
| 25 | + transient_for: parent, |
| 26 | + branch_name: new_branch_name |
| 27 | + ); |
| 28 | + } |
| 29 | + |
| 30 | + construct { |
| 31 | + modal = true; |
| 32 | + image_icon = new ThemedIcon ("dialog-stop"); |
| 33 | + |
| 34 | + primary_text = _("There are uncommitted changes in the current branch"); |
| 35 | + ///TRANSLATORS '%s' is a placeholder for the name of the branch to be checked out |
| 36 | + secondary_text = _("Uncommitted changes will be permanently lost if <b>'%s'</b> is checked out now.\n\n<i>It is recommended that uncommitted changes are stashed, committed, or reverted before proceeding </i>").printf (branch_name); |
| 37 | + |
| 38 | + var proceed_button = (Gtk.Button) add_button (_("Checkout and Overwrite"), Gtk.ResponseType.ACCEPT); |
| 39 | + proceed_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); |
| 40 | + var cancel_button = add_button (_("Do not Checkout"), Gtk.ResponseType.REJECT); |
| 41 | + cancel_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); |
| 42 | + } |
| 43 | +} |
0 commit comments