9 #include "../GitCommand/CreateBranch.h" 10 #include "../GitCommand/SwitchBranch.h" 15 #include <LayoutBuilder.h> 24 TrackGitWindow(repo, BRect(0, 0, 300, 100),
"TrackGit - Create Branch",
25 B_DOCUMENT_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
30 BButton* fCreate =
new BButton(
"create",
"Create",
32 BButton* fCancel =
new BButton(
"cancel",
"Cancel",
35 BLayoutBuilder::Group<>(
this, B_VERTICAL, 0)
39 .AddGroup(B_HORIZONTAL, 0)
62 const git_error* err = giterr_last();
64 BString buffer(
"Error : %s");
66 buffer.ReplaceFirst(
"%s", err->message);
68 buffer.ReplaceFirst(
"%s",
"Invalid branch name. Does the " 69 "branch already exists?");
70 alert =
new BAlert(
"", buffer.String(),
"Cancel",
71 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
73 BString buffer(
"Branch %b created successfully.");
75 alert =
new BAlert(
"", buffer.String(),
"OK",
76 0, 0, B_WIDTH_AS_USUAL);
82 const git_error* err = giterr_last();
84 BString buffer(
"Error : %s");
85 buffer.ReplaceFirst(
"%s", err->message);
86 alert =
new BAlert(
"", buffer.String(),
"Cancel",
87 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
89 BString buffer(
"Switched to branch %b.");
91 alert =
new BAlert(
"", buffer.String(),
"OK",
92 0, 0, B_WIDTH_AS_USUAL);
102 BWindow::MessageReceived(msg);
Header file of Create Branch window.
virtual void Quit()
The function to Quit the window.
static int DoCreateBranch(BString, BString)
This function creates a new branch in repo with given name.
BCheckBox * fSwitchBranch
Switch Branch check box.
BTextControl * fBranchText
The Create Branch Text View.
static int DoSwitchBranch(BString, BString)
This function creates a new branch in repo with given name.
The TrackGit Window class.
virtual void MessageReceived(BMessage *)
Handler to received messages.
BString fRepo
The repo/directory where the command is called.
CreateBranchWindow(BString)
CreateBranchWindow Constructor.