mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 23:12:56 +00:00
HackStudio: Add new multiline commit dialog
This new commit dialog features multi-line input and a line and column indicator. A great improvement over the last one, if you ask me! :^)
This commit is contained in:
parent
e92b6047ad
commit
4cfc992125
Notes:
sideshowbarker
2024-07-17 21:51:10 +09:00
Author: https://github.com/caoimhebyrne
Commit: 4cfc992125
Pull-request: https://github.com/SerenityOS/serenity/pull/11521
Reviewed-by: https://github.com/BertalanD ✅
5 changed files with 141 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "GitWidget.h"
|
||||
#include "../Dialogs/Git/GitCommitDialog.h"
|
||||
#include "GitFilesModel.h"
|
||||
#include <LibCore/File.h>
|
||||
#include <LibDiff/Format.h>
|
||||
|
@ -134,13 +135,17 @@ void GitWidget::unstage_file(const LexicalPath& file)
|
|||
|
||||
void GitWidget::commit()
|
||||
{
|
||||
String message;
|
||||
auto res = GUI::InputBox::show(window(), message, "Commit message:", "Commit");
|
||||
if (res != GUI::InputBox::ExecOK || message.is_empty())
|
||||
if (m_git_repo.is_null()) {
|
||||
GUI::MessageBox::show(window(), "There is no git repository to commit to!", "Error", GUI::MessageBox::Type::Error);
|
||||
return;
|
||||
dbgln("commit message: {}", message);
|
||||
m_git_repo->commit(message);
|
||||
refresh();
|
||||
}
|
||||
|
||||
auto dialog = GitCommitDialog::construct(window());
|
||||
dialog->on_commit = [this](auto& message) {
|
||||
m_git_repo->commit(message);
|
||||
refresh();
|
||||
};
|
||||
dialog->exec();
|
||||
}
|
||||
|
||||
void GitWidget::set_view_diff_callback(ViewDiffCallback callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue