-
-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathBranchCheckoutPage.vala
More file actions
48 lines (40 loc) · 1.08 KB
/
BranchCheckoutPage.vala
File metadata and controls
48 lines (40 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright 2025 elementary, Inc. <https://elementary.io>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Authored by: Jeremy Wootten <jeremywootten@gmail.com>
*/
public class Scratch.Dialogs.BranchCheckoutPage : Gtk.Box, BranchActionPage {
public BranchAction action {
get {
return BranchAction.CHECKOUT;
}
}
public Ggit.Ref? branch_ref {
get {
return list_box.get_selected_row ().bref;
}
}
public string new_branch_name {
get {
return "";
}
}
public BranchActionDialog dialog { get; construct; }
private BranchListBox list_box;
public BranchCheckoutPage (BranchActionDialog dialog) {
Object (
dialog: dialog
);
}
construct {
list_box = new BranchListBox (dialog, true);
add (list_box);
list_box.branch_changed.connect ((text) => {
dialog.can_apply = dialog.project.has_branch_name (text, null);
});
}
public override void focus_start_widget () {
list_box.grab_focus ();
}
}