Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
6793f1f9
Commit
6793f1f9
authored
Jun 16, 2010
by
Friedemann Kleint
Browse files
VCS[git]: Add arguments setting for gitk, add to locator.
Task-number: QTCREATORBUG-1577
parent
f96efa07
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/git/gitclient.cpp
View file @
6793f1f9
...
...
@@ -1272,12 +1272,14 @@ void GitClient::launchGitK(const QString &workingDirectory)
#ifdef Q_OS_WIN
// Launch 'wish' shell from git binary directory with the gitk located there
const
QString
binary
=
gitBinDirectory
+
QLatin1String
(
"/wish"
);
const
QStringList
arguments
(
gitBinDirectory
+
QLatin1String
(
"/gitk"
));
QStringList
arguments
(
gitBinDirectory
+
QLatin1String
(
"/gitk"
));
#else
// Simple: Run gitk from binary path
const
QString
binary
=
gitBinDirectory
+
QLatin1String
(
"/gitk"
);
const
QStringList
arguments
;
QStringList
arguments
;
#endif
if
(
!
m_settings
.
gitkOptions
.
isEmpty
())
arguments
.
append
(
m_settings
.
gitkOptions
.
split
(
QLatin1Char
(
' '
)));
outwin
->
appendCommand
(
workingDirectory
,
binary
,
arguments
);
// This should always use QProcess::startDetached (as not to kill
// the child), but that does not have an environment parameter.
...
...
src/plugins/git/gitplugin.cpp
View file @
6793f1f9
...
...
@@ -418,7 +418,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
createRepositoryAction
(
actionManager
,
gitContainer
,
tr
(
"Launch gitk"
),
QLatin1String
(
"Git.LaunchGitK"
),
globalcontext
,
fals
e
,
&
GitClient
::
launchGitK
);
globalcontext
,
tru
e
,
&
GitClient
::
launchGitK
);
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
QLatin1String
(
"Git.Sep.Global"
),
this
));
...
...
src/plugins/git/gitsettings.cpp
View file @
6793f1f9
...
...
@@ -46,6 +46,7 @@ static const char promptToSubmitKeyC[] = "PromptForSubmit";
static
const
char
omitAnnotationDateKeyC
[]
=
"OmitAnnotationDate"
;
static
const
char
spaceIgnorantBlameKeyC
[]
=
"SpaceIgnorantBlame"
;
static
const
char
diffPatienceKeyC
[]
=
"DiffPatience"
;
static
const
char
gitkOptionsKeyC
[]
=
"GitKOptions"
;
enum
{
defaultPullRebase
=
0
,
...
...
@@ -84,6 +85,7 @@ void GitSettings::fromSettings(QSettings *settings)
omitAnnotationDate
=
settings
->
value
(
QLatin1String
(
omitAnnotationDateKeyC
),
false
).
toBool
();
spaceIgnorantBlame
=
settings
->
value
(
QLatin1String
(
spaceIgnorantBlameKeyC
),
true
).
toBool
();
diffPatience
=
settings
->
value
(
QLatin1String
(
diffPatienceKeyC
),
true
).
toBool
();
gitkOptions
=
settings
->
value
(
QLatin1String
(
gitkOptionsKeyC
)).
toString
();
settings
->
endGroup
();
}
...
...
@@ -99,6 +101,7 @@ void GitSettings::toSettings(QSettings *settings) const
settings
->
setValue
(
QLatin1String
(
omitAnnotationDateKeyC
),
omitAnnotationDate
);
settings
->
setValue
(
QLatin1String
(
spaceIgnorantBlameKeyC
),
spaceIgnorantBlame
);
settings
->
setValue
(
QLatin1String
(
diffPatienceKeyC
),
diffPatience
);
settings
->
setValue
(
QLatin1String
(
gitkOptionsKeyC
),
gitkOptions
);
settings
->
endGroup
();
}
...
...
@@ -108,7 +111,8 @@ bool GitSettings::equals(const GitSettings &s) const
&&
timeoutSeconds
==
s
.
timeoutSeconds
&&
promptToSubmit
==
s
.
promptToSubmit
&&
pullRebase
==
s
.
pullRebase
&&
omitAnnotationDate
==
s
.
omitAnnotationDate
&&
spaceIgnorantBlame
==
s
.
spaceIgnorantBlame
&&
diffPatience
==
s
.
diffPatience
;
&&
diffPatience
==
s
.
diffPatience
&&
gitkOptions
==
s
.
gitkOptions
;
}
QString
GitSettings
::
gitBinaryPath
(
bool
*
ok
,
QString
*
errorMessage
)
const
...
...
src/plugins/git/gitsettings.h
View file @
6793f1f9
...
...
@@ -60,6 +60,7 @@ struct GitSettings
bool
omitAnnotationDate
;
bool
spaceIgnorantBlame
;
bool
diffPatience
;
QString
gitkOptions
;
};
inline
bool
operator
==
(
const
GitSettings
&
p1
,
const
GitSettings
&
p2
)
...
...
src/plugins/git/settingspage.cpp
View file @
6793f1f9
...
...
@@ -61,6 +61,7 @@ GitSettings SettingsPageWidget::settings() const
rc
.
omitAnnotationDate
=
m_ui
.
omitAnnotationDataCheckBox
->
isChecked
();
rc
.
spaceIgnorantBlame
=
m_ui
.
spaceIgnorantBlameCheckBox
->
isChecked
();
rc
.
diffPatience
=
m_ui
.
diffPatienceCheckBox
->
isChecked
();
rc
.
gitkOptions
=
m_ui
.
gitkOptionsLineEdit
->
text
().
trimmed
();
return
rc
;
}
...
...
@@ -75,6 +76,7 @@ void SettingsPageWidget::setSettings(const GitSettings &s)
m_ui
.
omitAnnotationDataCheckBox
->
setChecked
(
s
.
omitAnnotationDate
);
m_ui
.
spaceIgnorantBlameCheckBox
->
setChecked
(
s
.
spaceIgnorantBlame
);
m_ui
.
diffPatienceCheckBox
->
setChecked
(
s
.
diffPatience
);
m_ui
.
gitkOptionsLineEdit
->
setText
(
s
.
gitkOptions
);
}
void
SettingsPageWidget
::
setSystemPath
()
...
...
src/plugins/git/settingspage.ui
View file @
6793f1f9
...
...
@@ -2,14 +2,6 @@
<ui
version=
"4.0"
>
<class>
Git::Internal::SettingsPage
</class>
<widget
class=
"QWidget"
name=
"Git::Internal::SettingsPage"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
409
</width>
<height>
385
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QGroupBox"
name=
"environmentGroupBox"
>
...
...
@@ -45,7 +37,7 @@
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"
h
orizontalLayout
_2
"
>
<layout
class=
"QHBoxLayout"
name=
"
noteH
orizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"noteLabel"
>
<property
name=
"text"
>
...
...
@@ -152,6 +144,25 @@
</layout>
</widget>
</item>
<item>
<widget
class=
"QGroupBox"
name=
"gitkGroupBox"
>
<property
name=
"title"
>
<string>
Gitk
</string>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout_2"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"gitkOptionsLabel"
>
<property
name=
"text"
>
<string>
Arguments:
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"gitkOptionsLineEdit"
/>
</item>
</layout>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment