Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Modernise the Repository Manager #27

Open
wants to merge 60 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3391236
Remove useless RepoMan tests
scunz May 10, 2015
4cb1466
Remove signals from RM::Repo
scunz Mar 22, 2015
66ff7eb
Remove 'open' logic'
scunz May 10, 2015
359c33d
Make the RM::Repo's Git::Repository member private
scunz Mar 22, 2015
2a84e82
Keep instance pointer to RepoMan inside itself
scunz May 9, 2015
8287be5
Be explicit about namespace of Dumper class
scunz May 12, 2015
9fd2d59
Move AutoRefresher out of RM-namespace
scunz May 10, 2015
0495918
Make AutoRefresher internal
scunz Mar 22, 2015
6dbb19d
Move refresher instance into MacGitver
scunz Apr 17, 2015
f1bba00
Change RepoMan's "Set" to "List" everywhere
scunz Mar 22, 2015
32705f5
Move RepoMan Config Page to Config-Area
scunz May 10, 2015
57ac741
Remove all occurence of CollectionNode*
scunz May 13, 2015
a8d1387
Turn RM::ObjType into an Enum Class
scunz May 11, 2015
3df8c76
Move some RepoMan code around
scunz Mar 21, 2015
03ecab6
Remove "Data" part of the Data/XzyData.cpp filenames
scunz May 14, 2015
ae9fc06
Move Private class implementation into own CPP file (Base)
scunz May 11, 2015
4620084
Move Private class implementation into own CPP file (Tag)
scunz May 12, 2015
82c0947
Move Private class implementation into own CPP file (Ref)
scunz May 12, 2015
a35a14b
Move Private class implementation into own CPP file (Branch)
scunz May 12, 2015
48f6285
Move Private class implementation into own CPP file (Head)
scunz May 12, 2015
88094bd
Move Private class implementation into own CPP file (Repo)
scunz May 13, 2015
08490c4
Move Private class implementation into own CPP file (remainder)
scunz May 13, 2015
84c1666
Move Frontend implementation into Frontend namespace (Head)
scunz May 13, 2015
9c98a7e
Move Frontend implementation into Frontend namespace (Tag)
scunz May 13, 2015
92af47d
Move Frontend implementation into Frontend namespace (Repo)
scunz May 13, 2015
5558774
Move Frontend implementation into Frontend namespace (Submodule)
scunz May 14, 2015
df8e611
Move Frontend implementation into Frontend namespace (Remote)
scunz May 14, 2015
da32edf
Move Frontend implementation into Frontend namespace (Ref)
scunz May 14, 2015
c432029
Move Frontend implementation into Frontend namespace (Namespace)
scunz May 15, 2015
eefe86d
Move Frontend implementation into Frontend namespace (RefTreeNode)
scunz May 15, 2015
9c653d8
Move Frontend implementation into Frontend namespace (RefLog)
scunz May 15, 2015
d733d60
Move Frontend implementation into Frontend namespace (Branch)
scunz May 15, 2015
ddd3937
Move Frontend implementation into Frontend namespace (Base)
scunz May 15, 2015
db3828b
Move Frontend file into Frontend directory (Base)
scunz May 15, 2015
7404621
Move Frontend file into Frontend directory (Branch)
scunz May 15, 2015
ed19ff3
Move Frontend file into Frontend directory (RefLog)
scunz May 15, 2015
478e7ea
Move Frontend file into Frontend directory (RefTreeNode)
scunz May 15, 2015
d7f015b
Move Frontend file into Frontend directory (Namespace)
scunz May 15, 2015
ad9500d
Move Frontend file into Frontend directory (Head)
scunz May 13, 2015
aca744e
Move Frontend file into Frontend directory (Tag)
scunz May 13, 2015
63c16a4
Move Frontend file into Frontend directory (Submodule)
scunz May 14, 2015
4a0e678
Move Frontend file into Frontend directory (Repo)
scunz May 14, 2015
f2d9181
Move Frontend file into Frontend directory (Remote)
scunz May 14, 2015
4780585
Move Frontend file into Frontend directory (Ref)
scunz May 14, 2015
8886912
Rename Ref to Reference (File)
scunz May 14, 2015
c3c7a32
Rename Ref class to Reference
scunz May 14, 2015
27a3a4a
Temporary code
scunz Apr 21, 2015
6716792
Fixup to "Temporary Code" :(
scunz May 10, 2015
621c60e
Adjustments
scunz May 11, 2015
95b72da
Split off RepoMan & make everything compile at least
scunz Apr 11, 2015
c0db8d5
Remove events include from frontend classes
scunz May 12, 2015
ea4e5c6
Repoman Events
scunz Apr 19, 2015
b025377
Fix some Compat-Event compile issues
scunz Apr 19, 2015
7d11a40
Logging Channel for Git
scunz Apr 21, 2015
a6fbed8
Add Service Runner into the backend
scunz May 9, 2015
583a2a8
Add: OpenRepository Service
scunz May 9, 2015
302c1c5
Invoke OpenRepository service
scunz May 10, 2015
c36ac2d
Add: RefreshRepository Service
scunz May 9, 2015
e24515e
Add: refresh() method to RepoMan
scunz May 10, 2015
1878ca1
Missing Reference methods
scunz May 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ENABLE_TESTING()
SET(UTILS_APP_NAME MacGitver)

RAD_DEFINE_VERSION(MACGITVER_CORE 0 0 1)
RAD_DEFINE_VERSION(REPOMAN 0 0 1)

ADD_SUBDIRECTORY(CfgComp)

Expand Down
2 changes: 2 additions & 0 deletions Libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ INCLUDE_DIRECTORIES( BEFORE

ADD_SUBDIRECTORY(libLogger)
ADD_SUBDIRECTORY(libDiffViews)
ADD_SUBDIRECTORY(libRepoMan)
ADD_SUBDIRECTORY(libMacGitverCore)

25 changes: 17 additions & 8 deletions Libs/libMacGitverCore/App/MacGitver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
#include "libMacGitverCore/App/MgvPrimaryWindow.hpp"
#include "libMacGitverCore/Config/Config.h"
#include "libMacGitverCore/Config/Ui/GeneralConfigPage.hpp"
#include "libMacGitverCore/Config/Ui/RepoManConfigPage.hpp"
#include "libMacGitverCore/MacGitver/Modules.h"
#include "libMacGitverCore/RepoMan/RepoMan.hpp"
#include "libMacGitverCore/RepoMan/Config/RepoManConfigPage.hpp"
#include "libMacGitverCore/MacGitver/AutoRefresher.hpp"

#include "libRepoMan/RepoMan.hpp"

/**
* @class MacGitver
Expand All @@ -55,6 +57,7 @@

MacGitverPrivate::MacGitverPrivate(MacGitver* owner, bool runGui)
: isGui(runGui)
, refresher(nullptr)
{
sSelf = owner;
}
Expand All @@ -67,13 +70,16 @@ void MacGitverPrivate::init()
QApplication::setOrganizationName(QStringLiteral("MacGitver"));
QApplication::setApplicationName(QStringLiteral("MacGitver"));

// only start the auto refresher if we're running a GUI
refresher = new AutoRefresher;

Heaven::IconManager::self().defaultProvider()->addSearchPath(QStringLiteral(":/Images"));
} else {
QApplication::setOrganizationName(QStringLiteral("MacGitver"));
QApplication::setApplicationName(QStringLiteral("MacGitver_NonGui"));
}

sRepoMan = new RM::RepoMan;
RM::RepoMan::instance();
sModules = new Modules;

if (isGui) {
Expand All @@ -86,7 +92,8 @@ MacGitverPrivate::~MacGitverPrivate()
{
unregisterGlobalConfigPages();

delete sRepoMan; sRepoMan = NULL;
RM::RepoMan::instance().terminate();

delete sModules; sModules = NULL;

Log::Manager::release();
Expand All @@ -104,7 +111,6 @@ void MacGitverPrivate::bootGui()
}

MacGitver* MacGitverPrivate::sSelf = NULL;
RM::RepoMan* MacGitverPrivate::sRepoMan = NULL;
Modules* MacGitverPrivate::sModules = NULL;

MacGitver& MacGitver::self()
Expand All @@ -117,9 +123,7 @@ MacGitver& MacGitver::self()

RM::RepoMan& MacGitver::repoMan()
{
Q_ASSERT(MacGitverPrivate::sRepoMan);

return *MacGitverPrivate::sRepoMan;
return RM::RepoMan::instance();
}

MacGitver::MacGitver(bool runGui)
Expand Down Expand Up @@ -209,3 +213,8 @@ bool MacGitver::isRunningGui() const
{
return d->isGui;
}

AutoRefresher* MacGitver::refresher() const
{
return d->refresher;
}
4 changes: 4 additions & 0 deletions Libs/libMacGitverCore/App/MacGitver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace RM

typedef BlueSky::ViewDescriptor::CreatorFunc MgvViewCreator;

class AutoRefresher;
class MacGitverPrivate;

class MGV_CORE_API MacGitver
Expand All @@ -50,6 +51,7 @@ class MGV_CORE_API MacGitver

public:
static MacGitver& self();
GW_DEPRECATED
static RM::RepoMan& repoMan();

public:
Expand All @@ -66,6 +68,8 @@ class MGV_CORE_API MacGitver
MgvViewCreator creator);
void unregisterView(const BlueSky::ViewIdentifier& identifier);

AutoRefresher *refresher() const;

static void log(Log::Type type, const QString& logMessage);
static void log(Log::Type type, const char* logMessage);
static void log(Log::Type type, const Git::Result& r, const char* logMessage = nullptr);
Expand Down
3 changes: 2 additions & 1 deletion Libs/libMacGitverCore/App/MacGitverPrivate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
class QDir;

class Modules;
class AutoRefresher;

struct MgvViewInfo
{
Expand Down Expand Up @@ -62,7 +63,7 @@ private slots:
Git::GitWrap mGitWrap;
bool isGui;
MgvApp bsApp;
AutoRefresher* refresher;
static MacGitver* sSelf;
static Modules* sModules;
static RM::RepoMan* sRepoMan;
};
10 changes: 5 additions & 5 deletions Libs/libMacGitverCore/App/MgvPrimaryWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#include "libMacGitverCore/App/MgvPrimaryWindowPrivate.hpp"
#include "libMacGitverCore/MacGitver/Modules.h"

#include "libMacGitverCore/RepoMan/RepoMan.hpp"

#include "libMacGitverCore/Config/Config.h"
#include "libMacGitverCore/Config/Ui/ConfigDialog.hpp"
#include "libMacGitverCore/Widgets/RepoStateWidget.hpp"

#include "libRepoMan/RepoMan.hpp"

#include "libBlueSky/Application.hpp"
#include "libBlueSky/FooterWidget.hpp"

Expand Down Expand Up @@ -64,10 +64,10 @@ MgvPrimaryWindow::MgvPrimaryWindow()
w->show();
#endif

connect(&MacGitver::repoMan(), &RM::RepoMan::firstRepositoryOpened,
connect(&RM::RepoMan::instance(), &RM::RepoMan::firstRepositoryOpened,
this, &MgvPrimaryWindow::activateModeForRepo);

connect(&MacGitver::repoMan(), &RM::RepoMan::lastRepositoryClosed,
connect(&RM::RepoMan::instance(), &RM::RepoMan::lastRepositoryClosed,
this, &MgvPrimaryWindow::activateModeForRepo);

setupFonts();
Expand Down Expand Up @@ -157,7 +157,7 @@ void MgvPrimaryWindow::moveToCenter()

void MgvPrimaryWindow::activateModeForRepo()
{
if (MacGitver::repoMan().repositories().count() > 0) {
if (RM::RepoMan::instance().repositories().count() > 0) {
activateMode(QStringLiteral("HistoryMode"));
}
else {
Expand Down
68 changes: 10 additions & 58 deletions Libs/libMacGitverCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,12 @@ SET( SRC_FILES
Config/Ui/ConfigPage.cpp
Config/Ui/GeneralConfigPage.cpp
Config/Ui/ConfigPageProvider.cpp
Config/Ui/RepoManConfigPage.cpp

MacGitver/Module.cpp
MacGitver/Modules.cpp
MacGitver/GitPatchConsumer.cpp

RepoMan/AutoRefresher.cpp
RepoMan/Base.cpp
RepoMan/Ref.cpp
RepoMan/Branch.cpp
RepoMan/CollectionNode.cpp
RepoMan/Events.cpp
RepoMan/Repo.cpp
RepoMan/RepoMan.cpp
RepoMan/Remote.cpp
RepoMan/Tag.cpp
RepoMan/RefLog.cpp
RepoMan/Submodule.cpp
RepoMan/RefTreeNode.cpp
RepoMan/Namespace.cpp
RepoMan/Head.cpp

RepoMan/Private/Dumper.cpp

RepoMan/Config/RepoManConfigPage.cpp
MacGitver/AutoRefresher.cpp

SHMParser/ShellExpand.cpp

Expand Down Expand Up @@ -77,21 +59,6 @@ SET( PUB_HDR_FILES
MacGitver/GitPatchConsumer.hpp
MacGitver/IRepositoryContext.hpp

RepoMan/Base.hpp
RepoMan/Events.hpp
RepoMan/CollectionNode.hpp
RepoMan/Ref.hpp
RepoMan/Repo.hpp
RepoMan/RepoMan.hpp
RepoMan/Remote.hpp
RepoMan/Tag.hpp
RepoMan/Branch.hpp
RepoMan/RefLog.hpp
RepoMan/Submodule.hpp
RepoMan/RefTreeNode.hpp
RepoMan/Namespace.hpp
RepoMan/Head.hpp

SHMParser/ShellExpand.hpp

Widgets/ExpandableDlg.hpp
Expand All @@ -112,31 +79,17 @@ SET( PRI_HDR_FILES
App/MacGitverPrivate.hpp
App/MgvPrimaryWindowPrivate.hpp

MacGitver/AutoRefresher.hpp

Config/Ui/ConfigDialog.hpp
Config/Ui/GeneralConfigPage.hpp

RepoMan/AutoRefresher.hpp

RepoMan/Private/BasePrivate.hpp
RepoMan/Private/BranchPrivate.hpp
RepoMan/Private/CollectionNodePrivate.hpp
RepoMan/Private/NamespacePrivate.hpp
RepoMan/Private/RefPrivate.hpp
RepoMan/Private/RefLogPrivate.hpp
RepoMan/Private/RefTreeNodePrivate.hpp
RepoMan/Private/RemotePrivate.hpp
RepoMan/Private/RepoPrivate.hpp
RepoMan/Private/RepoManPrivate.hpp
RepoMan/Private/SubmodulePrivate.hpp
RepoMan/Private/TagPrivate.hpp
RepoMan/Private/Dumper.hpp
RepoMan/Private/HeadPrivate.hpp

RepoMan/Config/RepoManConfigPage.hpp
Config/Ui/RepoManConfigPage.hpp

Widgets/StringSelectorWidgetPrivate.h
Widgets/FlatTreeModelPrivate.h
Widgets/RepoStateWidget.hpp

MacGitver/AutoRefresher.hpp
)

SET( UI_FILES
Expand All @@ -145,16 +98,14 @@ SET( UI_FILES

Config/Ui/ConfigDialog.ui
Config/Ui/GeneralConfigPage.ui

RepoMan/Config/RepoManConfigPage.ui
Config/Ui/RepoManConfigPage.ui

Widgets/ExpandableDlg.ui
)

SET( HID_FILES

App/MgvPrimaryWindowActions.hid
RepoMan/Private/RepoManActions.hid

)

Expand All @@ -165,7 +116,7 @@ SET(RCC_FILES
SET( HDR_FILES ${PRI_HDR_FILES} ${PUB_HDR_FILES} )

SET(CCFG_FILES
RepoMan/AutoRefresherCfg.ccfg
MacGitver/AutoRefresherCfg.ccfg
)

CFGCOMP(CFG_FILES ${CCFG_FILES})
Expand Down Expand Up @@ -195,6 +146,7 @@ TARGET_LINK_LIBRARIES(
HeavenIcons
BlueSky
Logger
RepoMan

LINK_PRIVATE
GitWrap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
*
*/

#include "libMacGitverCore/RepoMan/Config/RepoManConfigPage.hpp"
#include "libMacGitverCore/RepoMan/Private/RepoManPrivate.hpp"
#include "libMacGitverCore/RepoMan/AutoRefresher.hpp"
#include "libMacGitverCore/RepoMan/RepoMan.hpp"
#include "libMacGitverCore/Config/Ui/RepoManConfigPage.hpp"

#include "libMacGitverCore/MacGitver/AutoRefresher.hpp"
#include "libMacGitverCore/App/MacGitver.hpp"

IMPLEMENT_NESTED_PAGE_CREATOR(RepoManConfigPage, 210)

RepoManConfigPage::RepoManConfigPage(ConfigDialog* dlg)
: ConfigPage(dlg)
, refresher(NULL)
, refresher(MacGitver::self().refresher())
{
setupUi(this);

Expand Down Expand Up @@ -71,9 +69,7 @@ void RepoManConfigPage::apply()

void RepoManConfigPage::init()
{
RM::RepoMan* rm = &MacGitver::repoMan();
RM::Internal::RepoManPrivate* rmp = RM::Internal::BasePrivate::dataOf<RM::RepoMan>(rm);
refresher = rmp->refresher;
Q_ASSERT(refresher);

grpEnableAutoRefresh->setChecked(refresher->refreshEnabled());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@

#include "ui_RepoManConfigPage.h"

namespace RM
{
class AutoRefresher;
}
class AutoRefresher;

class RepoManConfigPage
: public ConfigPage
Expand All @@ -55,5 +52,5 @@ private slots:
QWidget* widget();

private:
RM::AutoRefresher* refresher;
AutoRefresher* refresher;
};
Loading