| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "iversioncontrol.h" |
| 4 |
#include "icommandsystem.h" |
| 5 |
#include "Repository.h" |
| 6 |
|
| 7 |
namespace vcs |
| 8 |
{ |
| 9 |
|
| 10 |
namespace ui { class VcsStatus; } |
| 11 |
|
| 12 |
const char* const RKEY_AUTO_FETCH_ENABLED = "user/ui/vcs/git/autoFetchEnabled"; |
| 13 |
const char* const RKEY_AUTO_FETCH_INTERVAL = "user/ui/vcs/git/autoFetchInterval"; |
| 14 |
|
| 15 |
class GitModule final : |
| 16 |
public IVersionControlModule, |
| 17 |
public RegisterableModule, |
| 18 |
public std::enable_shared_from_this<GitModule> |
| 19 |
{ |
| 20 |
private: |
| 21 |
std::shared_ptr<git::Repository> _repository; |
| 22 |
|
| 23 |
std::unique_ptr<ui::VcsStatus> _statusBarWidget; |
| 24 |
|
| 25 |
public: |
| 26 |
static constexpr const char* UriPrefix = "git"; |
| 27 |
|
| 28 |
std::string getUriPrefix() override; |
| 29 |
ArchiveTextFilePtr openTextFile(const std::string& vcsUri) override; |
| 30 |
|
| 31 |
// RegisterableModule implementation |
| 32 |
const std::string& getName() const override; |
| 33 |
const StringSet& getDependencies() const override; |
| 34 |
void initialiseModule(const IApplicationContext& ctx) override; |
| 35 |
void shutdownModule() override; |
| 36 |
|
| 37 |
private: |
| 38 |
void registerCommands(); |
| 39 |
void createPreferencePage(); |
| 40 |
|
| 41 |
void fetch(const cmd::ArgumentList& args); |
| 42 |
}; |
| 43 |
|
| 44 |
} |