1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

HackStudio: View unstaged diffs in files with DiffViewer

This commit is contained in:
Itamar 2020-09-12 20:53:20 +03:00 committed by Andreas Kling
parent ba11082b4b
commit d1eedd0e9f
4 changed files with 54 additions and 2 deletions

View file

@ -28,17 +28,21 @@
#include "GitFilesView.h"
#include "GitRepo.h"
#include <AK/Function.h>
#include <LibGUI/Forward.h>
#include <LibGUI/Widget.h>
namespace HackStudio {
typedef Function<void(const String& original_content, const String& diff)> ViewDiffCallback;
class GitWidget final : public GUI::Widget {
C_OBJECT(GitWidget)
public:
virtual ~GitWidget() override {}
void refresh();
void set_view_diff_callback(ViewDiffCallback callback);
private:
explicit GitWidget(const LexicalPath& repo_root);
@ -46,11 +50,13 @@ private:
void stage_file(const LexicalPath&);
void unstage_file(const LexicalPath&);
void commit();
void show_diff(const LexicalPath&);
LexicalPath m_repo_root;
RefPtr<GitFilesView> m_unstaged_files;
RefPtr<GitFilesView> m_staged_files;
RefPtr<GitRepo> m_git_repo;
ViewDiffCallback m_view_diff_callback;
};
}