Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
40f5d38b
Commit
40f5d38b
authored
15 years ago
by
Friedemann Kleint
Browse files
Options
Downloads
Patches
Plain Diff
Git: Introduce diff repository and group actions.
parent
c55b5b7b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/git/gitplugin.cpp
+21
-5
21 additions, 5 deletions
src/plugins/git/gitplugin.cpp
src/plugins/git/gitplugin.h
+2
-0
2 additions, 0 deletions
src/plugins/git/gitplugin.h
with
23 additions
and
5 deletions
src/plugins/git/gitplugin.cpp
+
21
−
5
View file @
40f5d38b
...
...
@@ -110,6 +110,7 @@ GitPlugin::GitPlugin() :
m_core
(
0
),
m_diffAction
(
0
),
m_diffProjectAction
(
0
),
m_diffRepositoryAction
(
0
),
m_statusRepositoryAction
(
0
),
m_logAction
(
0
),
m_blameAction
(
0
),
...
...
@@ -270,11 +271,6 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect
(
m_diffProjectAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
diffCurrentProject
()));
gitContainer
->
addAction
(
command
);
m_statusRepositoryAction
=
new
QAction
(
tr
(
"Repository Status"
),
this
);
command
=
actionManager
->
registerAction
(
m_statusRepositoryAction
,
"Git.StatusRepository"
,
globalcontext
);
connect
(
m_statusRepositoryAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
statusRepository
()));
gitContainer
->
addAction
(
command
);
m_logProjectAction
=
new
Utils
::
ParameterAction
(
tr
(
"Log Project"
),
tr
(
"Log Project
\"
%1
\"
"
),
Utils
::
ParameterAction
::
AlwaysEnabled
,
this
);
command
=
actionManager
->
registerAction
(
m_logProjectAction
,
"Git.LogProject"
,
globalcontext
);
command
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Alt+G,Alt+K"
)));
...
...
@@ -282,6 +278,18 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect
(
m_logProjectAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
logProject
()));
gitContainer
->
addAction
(
command
);
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
QLatin1String
(
"Git.Sep.Repository"
),
this
));
m_diffRepositoryAction
=
new
QAction
(
tr
(
"Diff Repository"
),
this
);
command
=
actionManager
->
registerAction
(
m_diffRepositoryAction
,
"Git.DiffRepository"
,
globalcontext
);
connect
(
m_diffRepositoryAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
diffRepository
()));
gitContainer
->
addAction
(
command
);
m_statusRepositoryAction
=
new
QAction
(
tr
(
"Repository Status"
),
this
);
command
=
actionManager
->
registerAction
(
m_statusRepositoryAction
,
"Git.StatusRepository"
,
globalcontext
);
connect
(
m_statusRepositoryAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
statusRepository
()));
gitContainer
->
addAction
(
command
);
m_undoRepositoryAction
=
new
QAction
(
tr
(
"Undo Repository Changes"
),
this
);
command
=
actionManager
->
registerAction
(
m_undoRepositoryAction
,
"Git.UndoRepository"
,
globalcontext
);
command
->
setAttribute
(
Core
::
Command
::
CA_UpdateText
);
...
...
@@ -390,6 +398,13 @@ void GitPlugin::diffCurrentProject()
m_gitClient
->
diff
(
state
.
currentProjectTopLevel
(),
QStringList
(),
state
.
relativeCurrentProject
());
}
void
GitPlugin
::
diffRepository
()
{
const
VCSBase
::
VCSBasePluginState
state
=
currentState
();
QTC_ASSERT
(
state
.
hasTopLevel
(),
return
)
m_gitClient
->
diff
(
state
.
topLevel
(),
QStringList
(),
QStringList
());
}
void
GitPlugin
::
statusRepository
()
{
const
VCSBase
::
VCSBasePluginState
state
=
currentState
();
...
...
@@ -673,6 +688,7 @@ void GitPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
m_undoRepositoryAction
->
setEnabled
(
projectEnabled
);
const
bool
repositoryEnabled
=
currentState
().
hasTopLevel
();
m_diffRepositoryAction
->
setEnabled
(
repositoryEnabled
);
m_statusRepositoryAction
->
setEnabled
(
repositoryEnabled
);
m_branchListAction
->
setEnabled
(
repositoryEnabled
);
m_stashListAction
->
setEnabled
(
repositoryEnabled
);
...
...
This diff is collapsed.
Click to expand it.
src/plugins/git/gitplugin.h
+
2
−
0
View file @
40f5d38b
...
...
@@ -88,6 +88,7 @@ public:
private
slots
:
void
diffCurrentFile
();
void
diffCurrentProject
();
void
diffRepository
();
void
submitEditorDiff
(
const
QStringList
&
unstaged
,
const
QStringList
&
staged
);
void
submitCurrentLog
();
void
statusRepository
();
...
...
@@ -121,6 +122,7 @@ private:
Core
::
ICore
*
m_core
;
Utils
::
ParameterAction
*
m_diffAction
;
Utils
::
ParameterAction
*
m_diffProjectAction
;
QAction
*
m_diffRepositoryAction
;
QAction
*
m_statusRepositoryAction
;
Utils
::
ParameterAction
*
m_logAction
;
Utils
::
ParameterAction
*
m_blameAction
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment