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
Marco Bubke
flatpak-qt-creator
Commits
9b93e5e3
Commit
9b93e5e3
authored
Dec 14, 2009
by
con
Browse files
Merge branch 'master' of scm.dev.nokia.troll.no:creator/mainline
Conflicts: src/plugins/coreplugin/outputpane.h
parents
1677ae37
255e7d1d
Changes
40
Hide whitespace changes
Inline
Side-by-side
src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
View file @
9b93e5e3
...
...
@@ -95,6 +95,14 @@ ProjectExplorer::Environment CMakeBuildConfiguration::baseEnvironment() const
return
env
;
}
QString
CMakeBuildConfiguration
::
baseEnvironmentText
()
const
{
if
(
useSystemEnvironment
())
return
tr
(
"System Environment"
);
else
return
tr
(
"Clear Environment"
);
}
ProjectExplorer
::
Environment
CMakeBuildConfiguration
::
environment
()
const
{
ProjectExplorer
::
Environment
env
=
baseEnvironment
();
...
...
src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h
View file @
9b93e5e3
...
...
@@ -51,6 +51,7 @@ public:
ProjectExplorer
::
Environment
environment
()
const
;
ProjectExplorer
::
Environment
baseEnvironment
()
const
;
QString
baseEnvironmentText
()
const
;
void
setUserEnvironmentChanges
(
const
QList
<
ProjectExplorer
::
EnvironmentItem
>
&
diff
);
QList
<
ProjectExplorer
::
EnvironmentItem
>
userEnvironmentChanges
()
const
;
bool
useSystemEnvironment
()
const
;
...
...
src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.cpp
View file @
9b93e5e3
...
...
@@ -80,6 +80,7 @@ void CMakeBuildEnvironmentWidget::init(ProjectExplorer::BuildConfiguration *bc)
m_clearSystemEnvironmentCheckBox
->
setChecked
(
!
m_buildConfiguration
->
useSystemEnvironment
());
m_buildEnvironmentWidget
->
setBaseEnvironment
(
m_buildConfiguration
->
baseEnvironment
());
m_buildEnvironmentWidget
->
setBaseEnvironmentText
(
m_buildConfiguration
->
baseEnvironmentText
());
m_buildEnvironmentWidget
->
setUserChanges
(
m_buildConfiguration
->
userEnvironmentChanges
());
m_buildEnvironmentWidget
->
updateButtons
();
}
...
...
@@ -93,9 +94,11 @@ void CMakeBuildEnvironmentWidget::clearSystemEnvironmentCheckBoxClicked(bool che
{
m_buildConfiguration
->
setUseSystemEnvironment
(
!
checked
);
m_buildEnvironmentWidget
->
setBaseEnvironment
(
m_buildConfiguration
->
baseEnvironment
());
m_buildEnvironmentWidget
->
setBaseEnvironmentText
(
m_buildConfiguration
->
baseEnvironmentText
());
}
void
CMakeBuildEnvironmentWidget
::
environmentChanged
()
{
m_buildEnvironmentWidget
->
setBaseEnvironment
(
m_buildConfiguration
->
baseEnvironment
());
m_buildEnvironmentWidget
->
setBaseEnvironmentText
(
m_buildConfiguration
->
baseEnvironmentText
());
}
src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
View file @
9b93e5e3
...
...
@@ -195,6 +195,18 @@ ProjectExplorer::Environment CMakeRunConfiguration::baseEnvironment() const
return
env
;
}
QString
CMakeRunConfiguration
::
baseEnvironmentText
()
const
{
if
(
m_baseEnvironmentBase
==
CMakeRunConfiguration
::
CleanEnvironmentBase
)
{
return
tr
(
"Clean Environment"
);
}
else
if
(
m_baseEnvironmentBase
==
CMakeRunConfiguration
::
SystemEnvironmentBase
)
{
return
tr
(
"System Environment"
);
}
else
if
(
m_baseEnvironmentBase
==
CMakeRunConfiguration
::
BuildEnvironmentBase
)
{
return
tr
(
"Build Environment"
);
}
return
QString
();
}
void
CMakeRunConfiguration
::
setBaseEnvironmentBase
(
BaseEnvironmentBase
env
)
{
if
(
m_baseEnvironmentBase
==
env
)
...
...
@@ -301,6 +313,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
m_environmentWidget
=
new
ProjectExplorer
::
EnvironmentWidget
(
this
,
baseEnvironmentWidget
);
m_environmentWidget
->
setBaseEnvironment
(
m_cmakeRunConfiguration
->
baseEnvironment
());
m_environmentWidget
->
setBaseEnvironmentText
(
m_cmakeRunConfiguration
->
baseEnvironmentText
());
m_environmentWidget
->
setUserChanges
(
m_cmakeRunConfiguration
->
userEnvironmentChanges
());
vbx
->
addWidget
(
m_environmentWidget
);
...
...
@@ -358,6 +371,7 @@ void CMakeRunConfigurationWidget::baseEnvironmentComboBoxChanged(int index)
m_cmakeRunConfiguration
->
setBaseEnvironmentBase
(
CMakeRunConfiguration
::
BaseEnvironmentBase
(
index
));
m_environmentWidget
->
setBaseEnvironment
(
m_cmakeRunConfiguration
->
baseEnvironment
());
m_environmentWidget
->
setBaseEnvironmentText
(
m_cmakeRunConfiguration
->
baseEnvironmentText
());
m_ignoreChange
=
false
;
}
...
...
@@ -368,6 +382,7 @@ void CMakeRunConfigurationWidget::baseEnvironmentChanged()
m_baseEnvironmentComboBox
->
setCurrentIndex
(
m_cmakeRunConfiguration
->
baseEnvironmentBase
());
m_environmentWidget
->
setBaseEnvironment
(
m_cmakeRunConfiguration
->
baseEnvironment
());
m_environmentWidget
->
setBaseEnvironmentText
(
m_cmakeRunConfiguration
->
baseEnvironmentText
());
}
void
CMakeRunConfigurationWidget
::
userEnvironmentChangesChanged
()
...
...
src/plugins/cmakeprojectmanager/cmakerunconfiguration.h
View file @
9b93e5e3
...
...
@@ -90,6 +90,8 @@ private:
void
setBaseEnvironmentBase
(
BaseEnvironmentBase
env
);
BaseEnvironmentBase
baseEnvironmentBase
()
const
;
ProjectExplorer
::
Environment
baseEnvironment
()
const
;
QString
baseEnvironmentText
()
const
;
void
setUserEnvironmentChanges
(
const
QList
<
ProjectExplorer
::
EnvironmentItem
>
&
diff
);
QList
<
ProjectExplorer
::
EnvironmentItem
>
userEnvironmentChanges
()
const
;
...
...
src/plugins/coreplugin/actionmanager/command.cpp
View file @
9b93e5e3
...
...
@@ -37,6 +37,7 @@
#include
<QtGui/QAction>
#include
<QtGui/QShortcut>
#include
<QtGui/QMainWindow>
/*!
\class Core::Command
...
...
@@ -424,8 +425,11 @@ QKeySequence Action::keySequence() const
OverrideableAction
::
OverrideableAction
(
int
id
)
:
Action
(
id
),
m_currentAction
(
0
),
m_active
(
false
),
m_contextInitialized
(
false
)
m_contextInitialized
(
false
),
m_dummyShortcutEater
(
this
)
{
Core
::
ICore
::
instance
()
->
mainWindow
()
->
addAction
(
&
m_dummyShortcutEater
);
m_dummyShortcutEater
.
setEnabled
(
false
);
}
void
OverrideableAction
::
setAction
(
QAction
*
action
)
...
...
@@ -465,9 +469,11 @@ bool OverrideableAction::setCurrentContext(const QList<int> &context)
m_active
=
true
;
return
true
;
}
// no active/delegate action, "visible" action is not enabled/visible
if
(
hasAttribute
(
CA_Hide
))
m_action
->
setVisible
(
false
);
m_action
->
setEnabled
(
false
);
m_dummyShortcutEater
.
setEnabled
(
false
);
m_active
=
false
;
return
false
;
}
...
...
@@ -521,6 +527,9 @@ void OverrideableAction::actionChanged()
m_action
->
setEnabled
(
m_currentAction
->
isEnabled
());
m_action
->
setVisible
(
m_currentAction
->
isVisible
());
m_dummyShortcutEater
.
setShortcuts
(
m_action
->
shortcuts
());
m_dummyShortcutEater
.
setEnabled
(
!
m_action
->
isEnabled
());
}
bool
OverrideableAction
::
isActive
()
const
...
...
src/plugins/coreplugin/actionmanager/command_p.h
View file @
9b93e5e3
...
...
@@ -153,6 +153,7 @@ private:
QMap
<
int
,
QPointer
<
QAction
>
>
m_contextActionMap
;
bool
m_active
;
bool
m_contextInitialized
;
QAction
m_dummyShortcutEater
;
};
}
// namespace Internal
...
...
src/plugins/coreplugin/editmode.cpp
View file @
9b93e5e3
...
...
@@ -68,7 +68,7 @@ EditMode::EditMode(EditorManager *editorManager) :
MiniSplitter
*
splitter
=
new
MiniSplitter
;
splitter
->
setOrientation
(
Qt
::
Vertical
);
splitter
->
insertWidget
(
0
,
rightPaneSplitter
);
splitter
->
insertWidget
(
1
,
new
Core
::
OutputPanePlaceHolder
(
this
));
splitter
->
insertWidget
(
1
,
new
Core
::
OutputPanePlaceHolder
(
this
,
splitter
));
splitter
->
setStretchFactor
(
0
,
3
);
splitter
->
setStretchFactor
(
1
,
0
);
...
...
src/plugins/coreplugin/outputpane.cpp
View file @
9b93e5e3
...
...
@@ -43,6 +43,7 @@
#include
<extensionsystem/pluginmanager.h>
#include
<utils/styledbar.h>
#include
<utils/qtcassert.h>
#include
<QtCore/QDebug>
...
...
@@ -51,6 +52,7 @@
#include
<QtGui/QComboBox>
#include
<QtGui/QFocusEvent>
#include
<QtGui/QHBoxLayout>
#include
<QtGui/QSplitter>
#include
<QtGui/QMenu>
#include
<QtGui/QPainter>
#include
<QtGui/QToolButton>
...
...
@@ -61,9 +63,10 @@ using namespace Core::Internal;
OutputPanePlaceHolder
*
OutputPanePlaceHolder
::
m_current
=
0
;
OutputPanePlaceHolder
::
OutputPanePlaceHolder
(
Core
::
IMode
*
mode
,
Q
Widget
*
parent
)
OutputPanePlaceHolder
::
OutputPanePlaceHolder
(
Core
::
IMode
*
mode
,
Q
Splitter
*
parent
)
:
QWidget
(
parent
),
m_mode
(
mode
),
m_closeable
(
true
)
{
m_splitter
=
parent
;
setVisible
(
false
);
setLayout
(
new
QVBoxLayout
);
QSizePolicy
sp
;
...
...
@@ -111,6 +114,40 @@ void OutputPanePlaceHolder::currentModeChanged(Core::IMode *mode)
}
}
void
OutputPanePlaceHolder
::
maximizeOrMinimize
(
bool
maximize
)
{
if
(
!
m_splitter
)
return
;
int
idx
=
m_splitter
->
indexOf
(
this
);
if
(
idx
<
0
)
return
;
QList
<
int
>
sizes
=
m_splitter
->
sizes
();
if
(
maximize
)
{
int
sum
;
foreach
(
int
s
,
sizes
)
sum
+=
s
;
for
(
int
i
=
0
;
i
<
sizes
.
count
();
++
i
)
{
sizes
[
i
]
=
32
;
}
sizes
[
idx
]
=
sum
-
(
sizes
.
count
()
-
1
)
*
32
;
}
else
{
int
target
=
sizeHint
().
height
();
int
space
=
sizes
[
idx
]
-
target
;
if
(
space
>
0
)
{
for
(
int
i
=
0
;
i
<
sizes
.
count
();
++
i
)
{
sizes
[
i
]
+=
space
/
(
sizes
.
count
()
-
1
);
}
sizes
[
idx
]
=
target
;
}
}
m_splitter
->
setSizes
(
sizes
);
}
////
// OutputPaneManager
////
...
...
@@ -138,6 +175,8 @@ void OutputPaneManager::updateStatusButtons(bool visible)
int
idx
=
m_widgetComboBox
->
itemData
(
m_widgetComboBox
->
currentIndex
()).
toInt
();
if
(
m_buttons
.
value
(
idx
))
m_buttons
.
value
(
idx
)
->
setChecked
(
visible
);
m_minMaxButton
->
setVisible
(
OutputPanePlaceHolder
::
m_current
&&
OutputPanePlaceHolder
::
m_current
->
canMaximizeOrMinimize
());
}
OutputPaneManager
::
OutputPaneManager
(
QWidget
*
parent
)
:
...
...
@@ -145,6 +184,8 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
m_widgetComboBox
(
new
QComboBox
),
m_clearButton
(
new
QToolButton
),
m_closeButton
(
new
QToolButton
),
m_minMaxAction
(
0
),
m_minMaxButton
(
new
QToolButton
),
m_nextAction
(
0
),
m_prevAction
(
0
),
m_lastIndex
(
-
1
),
...
...
@@ -168,6 +209,10 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
m_prevAction
->
setText
(
tr
(
"Previous Item"
));
connect
(
m_prevAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
slotPrev
()));
m_minMaxAction
=
new
QAction
(
this
);
m_minMaxAction
->
setText
(
tr
(
"Minimize/Maximize Output Pane"
));
m_minMaxButton
->
setArrowType
(
Qt
::
UpArrow
);
m_closeButton
->
setIcon
(
QIcon
(
":/core/images/closebutton.png"
));
connect
(
m_closeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
slotHide
()));
...
...
@@ -185,6 +230,7 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
m_nextToolButton
=
new
QToolButton
;
toolLayout
->
addWidget
(
m_nextToolButton
);
toolLayout
->
addWidget
(
m_opToolBarWidgets
);
toolLayout
->
addWidget
(
m_minMaxButton
);
toolLayout
->
addWidget
(
m_closeButton
);
mainlayout
->
addWidget
(
m_toolBar
);
mainlayout
->
addWidget
(
m_outputWidgetPane
,
10
);
...
...
@@ -248,6 +294,12 @@ void OutputPaneManager::init()
cmd
->
setDefaultKeySequence
(
QKeySequence
(
"F6"
));
mpanes
->
addAction
(
cmd
,
"Coreplugin.OutputPane.ActionsGroup"
);
cmd
=
am
->
registerAction
(
m_minMaxAction
,
"Coreplugin.OutputPane.minmax"
,
globalcontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
"Ctrl+9"
));
mpanes
->
addAction
(
cmd
,
"Coreplugin.OutputPane.ActionsGroup"
);
m_minMaxButton
->
setDefaultAction
(
cmd
->
action
());
connect
(
m_minMaxAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
slotMinMax
()));
QAction
*
sep
=
new
QAction
(
this
);
sep
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
sep
,
QLatin1String
(
"Coreplugin.OutputPane.Sep"
),
globalcontext
);
...
...
@@ -353,6 +405,18 @@ void OutputPaneManager::shortcutTriggered()
}
}
void
OutputPaneManager
::
slotMinMax
()
{
QTC_ASSERT
(
OutputPanePlaceHolder
::
m_current
,
return
);
if
(
!
OutputPanePlaceHolder
::
m_current
->
isVisible
())
// easier than disabling/enabling the action
return
;
bool
maximize
=
m_minMaxButton
->
arrowType
()
==
Qt
::
UpArrow
;
OutputPanePlaceHolder
::
m_current
->
maximizeOrMinimize
(
maximize
);
m_minMaxButton
->
setArrowType
(
maximize
?
Qt
::
DownArrow
:
Qt
::
UpArrow
);
}
void
OutputPaneManager
::
buttonTriggered
()
{
QPushButton
*
button
=
qobject_cast
<
QPushButton
*>
(
sender
());
...
...
src/plugins/coreplugin/outputpane.h
View file @
9b93e5e3
...
...
@@ -42,6 +42,7 @@ class QComboBox;
class
QToolButton
;
class
QStackedWidget
;
class
QMenu
;
class
QSplitter
;
QT_END_NAMESPACE
namespace
Core
{
...
...
@@ -60,16 +61,19 @@ class CORE_EXPORT OutputPanePlaceHolder : public QWidget
friend
class
Core
::
Internal
::
OutputPaneManager
;
// needs to set m_visible and thus access m_current
Q_OBJECT
public:
OutputPanePlaceHolder
(
Core
::
IMode
*
mode
,
Q
Widget
*
parent
=
0
);
OutputPanePlaceHolder
(
Core
::
IMode
*
mode
,
Q
Splitter
*
parent
=
0
);
~
OutputPanePlaceHolder
();
void
setCloseable
(
bool
b
);
bool
closeable
();
static
OutputPanePlaceHolder
*
getCurrent
()
{
return
m_current
;
}
inline
bool
canMaximizeOrMinimize
()
const
{
return
m_splitter
!=
0
;
}
void
maximizeOrMinimize
(
bool
maximize
);
private
slots
:
void
currentModeChanged
(
Core
::
IMode
*
);
private:
Core
::
IMode
*
m_mode
;
QSplitter
*
m_splitter
;
bool
m_closeable
;
static
OutputPanePlaceHolder
*
m_current
;
};
...
...
@@ -93,6 +97,7 @@ public slots:
void
slotNext
();
void
slotPrev
();
void
shortcutTriggered
();
void
slotMinMax
();
protected:
void
focusInEvent
(
QFocusEvent
*
e
);
...
...
@@ -122,6 +127,9 @@ private:
QToolButton
*
m_clearButton
;
QToolButton
*
m_closeButton
;
QAction
*
m_minMaxAction
;
QToolButton
*
m_minMaxButton
;
QAction
*
m_nextAction
;
QAction
*
m_prevAction
;
QToolButton
*
m_prevToolButton
;
...
...
src/plugins/cvs/cvsplugin.cpp
View file @
9b93e5e3
...
...
@@ -79,11 +79,6 @@ static inline QString msgLogParsingFailed()
return
CVSPlugin
::
tr
(
"Parsing of the log output failed"
);
}
// Timeout for normal output commands
enum
{
cvsShortTimeOut
=
10000
};
// Timeout for submit, update
enum
{
cvsLongTimeOut
=
120000
};
static
const
char
*
const
CMD_ID_CVS_MENU
=
"CVS.Menu"
;
static
const
char
*
const
CMD_ID_ADD
=
"CVS.Add"
;
static
const
char
*
const
CMD_ID_DELETE_FILE
=
"CVS.Delete"
;
...
...
@@ -434,7 +429,7 @@ void CVSPlugin::cvsDiff(const QString &workingDir, const QStringList &files)
// CVS returns the diff exit code (1 if files differ), which is
// undistinguishable from a "file not found" error, unfortunately.
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
switch
(
response
.
result
)
{
case
CVSResponse
::
NonNullExitCode
:
case
CVSResponse
::
Ok
:
...
...
@@ -518,7 +513,7 @@ void CVSPlugin::revertCurrentFile()
QTC_ASSERT
(
state
.
hasFile
(),
return
)
QStringList
args
;
args
<<
QLatin1String
(
"diff"
)
<<
state
.
relativeCurrentFile
();
const
CVSResponse
diffResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
diffResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
switch
(
diffResponse
.
result
)
{
case
CVSResponse
::
Ok
:
return
;
// Not modified, diff exit code 0
...
...
@@ -539,7 +534,7 @@ void CVSPlugin::revertCurrentFile()
// revert
args
.
clear
();
args
<<
QLatin1String
(
"update"
)
<<
QLatin1String
(
"-C"
)
<<
state
.
relativeCurrentFile
();
const
CVSResponse
revertResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
cvsShortT
imeOut
,
true
);
const
CVSResponse
revertResponse
=
runCVS
(
state
.
currentFileTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
true
);
if
(
revertResponse
.
result
==
CVSResponse
::
Ok
)
{
fcb
.
setModifiedReload
(
true
);
cvsVersionControl
()
->
emitFilesChanged
(
QStringList
(
state
.
currentFile
()));
...
...
@@ -589,7 +584,7 @@ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files)
// We need the "Examining <subdir>" stderr output to tell
// where we are, so, have stdout/stderr channels merged.
QStringList
args
=
QStringList
(
QLatin1String
(
"status"
));
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
0
,
true
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
0
,
true
);
if
(
response
.
result
!=
CVSResponse
::
Ok
)
return
;
// Get list of added/modified/deleted files and purge out undesired ones
...
...
@@ -638,7 +633,7 @@ bool CVSPlugin::commit(const QString &messageFile,
QStringList
args
=
QStringList
(
QLatin1String
(
"commit"
));
args
<<
QLatin1String
(
"-F"
)
<<
messageFile
;
args
.
append
(
fileList
);
const
CVSResponse
response
=
runCVS
(
m_commitRepository
,
args
,
cvsL
ongTimeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
m_commitRepository
,
args
,
m_settings
.
l
ongTimeOut
MS
()
,
true
);
return
response
.
result
==
CVSResponse
::
Ok
;
}
...
...
@@ -658,7 +653,7 @@ void CVSPlugin::filelog(const QString &workingDir, const QStringList &files)
QStringList
args
;
args
<<
QLatin1String
(
"log"
);
args
.
append
(
files
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
if
(
response
.
result
!=
CVSResponse
::
Ok
)
return
;
...
...
@@ -683,7 +678,7 @@ void CVSPlugin::updateProject()
QStringList
args
(
QLatin1String
(
"update"
));
args
.
push_back
(
QLatin1String
(
"-dR"
));
args
.
append
(
state
.
relativeCurrentProject
());
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
cvsL
ongTimeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
m_settings
.
l
ongTimeOut
MS
()
,
true
);
if
(
response
.
result
==
CVSResponse
::
Ok
)
cvsVersionControl
()
->
emitRepositoryChanged
(
state
.
currentProjectTopLevel
());
}
...
...
@@ -703,7 +698,7 @@ void CVSPlugin::annotate(const QString &workingDir, const QString &file)
const
QString
source
=
VCSBase
::
VCSBaseEditor
::
getSource
(
workingDir
,
file
);
QStringList
args
;
args
<<
QLatin1String
(
"annotate"
)
<<
file
;
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
if
(
response
.
result
!=
CVSResponse
::
Ok
)
return
;
...
...
@@ -729,7 +724,7 @@ void CVSPlugin::projectStatus()
QTC_ASSERT
(
state
.
hasProject
(),
return
)
QStringList
args
;
args
<<
QLatin1String
(
"status"
)
<<
state
.
relativeCurrentProject
();
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
response
=
runCVS
(
state
.
currentProjectTopLevel
(),
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
response
.
result
==
CVSResponse
::
Ok
)
showOutputInEditor
(
tr
(
"Project status"
),
response
.
stdOut
,
VCSBase
::
RegularCommandOutput
,
state
.
currentProjectTopLevel
(),
0
);
}
...
...
@@ -787,7 +782,7 @@ bool CVSPlugin::describe(const QString &toplevel, const QString &file, const
// Run log to obtain commit id and details
QStringList
args
;
args
<<
QLatin1String
(
"log"
)
<<
(
QLatin1String
(
"-r"
)
+
changeNr
)
<<
file
;
const
CVSResponse
logResponse
=
runCVS
(
toplevel
,
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
logResponse
=
runCVS
(
toplevel
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
logResponse
.
result
!=
CVSResponse
::
Ok
)
{
*
errorMessage
=
logResponse
.
message
;
return
false
;
...
...
@@ -808,7 +803,7 @@ bool CVSPlugin::describe(const QString &toplevel, const QString &file, const
args
.
clear
();
args
<<
QLatin1String
(
"log"
)
<<
QLatin1String
(
"-d"
)
<<
(
dateS
+
QLatin1Char
(
'<'
)
+
nextDayS
);
const
CVSResponse
repoLogResponse
=
runCVS
(
toplevel
,
args
,
cvsL
ongTimeOut
,
false
);
const
CVSResponse
repoLogResponse
=
runCVS
(
toplevel
,
args
,
m_settings
.
l
ongTimeOut
MS
()
,
false
);
if
(
repoLogResponse
.
result
!=
CVSResponse
::
Ok
)
{
*
errorMessage
=
repoLogResponse
.
message
;
return
false
;
...
...
@@ -844,7 +839,7 @@ bool CVSPlugin::describe(const QString &repositoryPath,
// Run log
QStringList
args
(
QLatin1String
(
"log"
));
args
<<
(
QLatin1String
(
"-r"
)
+
it
->
revisions
.
front
().
revision
)
<<
it
->
file
;
const
CVSResponse
logResponse
=
runCVS
(
repositoryPath
,
args
,
cvsShortT
imeOut
,
false
);
const
CVSResponse
logResponse
=
runCVS
(
repositoryPath
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
);
if
(
logResponse
.
result
!=
CVSResponse
::
Ok
)
{
*
errorMessage
=
logResponse
.
message
;
return
false
;
...
...
@@ -860,7 +855,7 @@ bool CVSPlugin::describe(const QString &repositoryPath,
args
<<
m_settings
.
cvsDiffOptions
<<
QLatin1String
(
"-r"
)
<<
previousRev
<<
QLatin1String
(
"-r"
)
<<
it
->
revisions
.
front
().
revision
<<
it
->
file
;
const
CVSResponse
diffResponse
=
runCVS
(
repositoryPath
,
args
,
cvsShortT
imeOut
,
false
,
codec
);
const
CVSResponse
diffResponse
=
runCVS
(
repositoryPath
,
args
,
m_settings
.
t
imeOut
MS
()
,
false
,
codec
);
switch
(
diffResponse
.
result
)
{
case
CVSResponse
::
Ok
:
case
CVSResponse
::
NonNullExitCode
:
// Diff exit code != 0
...
...
@@ -1037,7 +1032,7 @@ bool CVSPlugin::vcsAdd(const QString &workingDir, const QString &rawFileName)
{
QStringList
args
;
args
<<
QLatin1String
(
"add"
)
<<
rawFileName
;
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
true
);
return
response
.
result
==
CVSResponse
::
Ok
;
}
...
...
@@ -1045,7 +1040,7 @@ bool CVSPlugin::vcsDelete(const QString &workingDir, const QString &rawFileName)
{
QStringList
args
;
args
<<
QLatin1String
(
"remove"
)
<<
QLatin1String
(
"-f"
)
<<
rawFileName
;
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
cvsShortT
imeOut
,
true
);
const
CVSResponse
response
=
runCVS
(
workingDir
,
args
,
m_settings
.
t
imeOut
MS
()
,
true
);
return
response
.
result
==
CVSResponse
::
Ok
;
}
...
...
src/plugins/cvs/cvssettings.cpp
View file @
9b93e5e3
...
...
@@ -39,6 +39,9 @@ static const char *promptToSubmitKeyC = "PromptForSubmit";
static
const
char
*
diffOptionsKeyC
=
"DiffOptions"
;
static
const
char
*
describeByCommitIdKeyC
=
"DescribeByCommitId"
;
static
const
char
*
defaultDiffOptions
=
"-du"
;
static
const
char
*
timeOutKeyC
=
"TimeOut"
;
enum
{
defaultTimeOutS
=
30
};
static
QString
defaultCommand
()
{
...
...
@@ -56,6 +59,7 @@ namespace CVS {
CVSSettings
::
CVSSettings
()
:
cvsCommand
(
defaultCommand
()),
cvsDiffOptions
(
QLatin1String
(
defaultDiffOptions
)),
timeOutS
(
defaultTimeOutS
),
promptToSubmit
(
true
),
describeByCommitId
(
true
)
{
...
...
@@ -69,6 +73,7 @@ void CVSSettings::fromSettings(QSettings *settings)
cvsRoot
=
settings
->
value
(
QLatin1String
(
rootC
),
QString
()).
toString
();
cvsDiffOptions
=
settings
->
value
(
QLatin1String
(
diffOptionsKeyC
),
QLatin1String
(
defaultDiffOptions
)).
toString
();
describeByCommitId
=
settings
->
value
(
QLatin1String
(
describeByCommitIdKeyC
),
true
).
toBool
();
timeOutS
=
settings
->
value
(
QLatin1String
(
timeOutKeyC
),
defaultTimeOutS
).
toInt
();
settings
->
endGroup
();
}
...
...
@@ -78,7 +83,8 @@ void CVSSettings::toSettings(QSettings *settings) const
settings
->
setValue
(
QLatin1String
(
commandKeyC
),
cvsCommand
);
settings
->
setValue
(
QLatin1String
(
promptToSubmitKeyC
),
promptToSubmit
);
settings
->
setValue
(
QLatin1String
(
rootC
),
cvsRoot
);
settings
->
setValue
(
QLatin1String
(
diffOptionsKeyC
),
cvsDiffOptions
);
settings
->
setValue
(
QLatin1String
(
diffOptionsKeyC
),
cvsDiffOptions
);
settings
->
setValue
(
QLatin1String
(
timeOutKeyC
),
timeOutS
);
settings
->
setValue
(
QLatin1String
(
describeByCommitIdKeyC
),
describeByCommitId
);
settings
->
endGroup
();
}
...
...
@@ -89,6 +95,7 @@ bool CVSSettings::equals(const CVSSettings &s) const
&&
describeByCommitId
==
s
.
describeByCommitId
&&
cvsCommand
==
s
.
cvsCommand
&&
cvsRoot
==
s
.
cvsRoot
&&
timeOutS
==
s
.
timeOutS
&&
cvsDiffOptions
==
s
.
cvsDiffOptions
;
}
...
...
src/plugins/cvs/cvssettings.h
View file @
9b93e5e3
...
...
@@ -46,6 +46,9 @@ struct CVSSettings
void
fromSettings
(
QSettings
*
);
void
toSettings
(
QSettings
*
)
const
;
inline
int
timeOutMS
()
const
{
return
timeOutS
*
10000
;
}
inline
int
longTimeOutMS
()
const
{
return
timeOutS
*
100000
;
}
// Add common options to the command line
QStringList
addOptions
(
const
QStringList
&
args
)
const
;
...
...
@@ -54,6 +57,7 @@ struct CVSSettings
QString
cvsCommand
;
QString
cvsRoot
;
QString
cvsDiffOptions
;
int
timeOutS
;
bool
promptToSubmit
;
bool
describeByCommitId
;
};
...
...
src/plugins/cvs/settingspage.cpp
View file @
9b93e5e3
...
...
@@ -57,6 +57,7 @@ CVSSettings SettingsPageWidget::settings() const
rc
.
cvsCommand
=
m_ui
.
commandPathChooser
->
path
();
rc
.
cvsRoot
=
m_ui
.
rootLineEdit
->
text
();
rc
.
cvsDiffOptions
=
m_ui
.
diffOptionsLineEdit
->
text
();
rc
.
timeOutS
=
m_ui
.
timeOutSpinBox
->
value
();
rc
.
promptToSubmit
=
m_ui
.
promptToSubmitCheckBox
->
isChecked
();
rc
.
describeByCommitId
=
m_ui
.
describeByCommitIdCheckBox
->
isChecked
();
return
rc
;
...
...
@@ -67,6 +68,7 @@ void SettingsPageWidget::setSettings(const CVSSettings &s)
m_ui
.
commandPathChooser
->
setPath
(
s
.
cvsCommand
);
m_ui
.
rootLineEdit
->
setText
(
s
.
cvsRoot
);
m_ui
.
diffOptionsLineEdit
->
setText
(
s
.
cvsDiffOptions
);
m_ui
.
timeOutSpinBox
->
setValue
(
s
.
timeOutS
);
m_ui
.
promptToSubmitCheckBox
->
setChecked
(
s
.
promptToSubmit
);
m_ui
.
describeByCommitIdCheckBox
->
setChecked
(
s
.
describeByCommitId
);
}
...
...
src/plugins/cvs/settingspage.ui
View file @
9b93e5e3
...
...
@@ -2,6 +2,14 @@
<ui
version=
"4.0"
>
<class>
CVS::Internal::SettingsPage
</class>
<widget
class=
"QWidget"
name=
"CVS::Internal::SettingsPage"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
447
</width>
<height>
281
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QGroupBox"
name=
"miscGroupBox"
>
...
...
@@ -38,24 +46,24 @@
<string>
Miscellaneous
</string>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout"
>
<item
row=
"
0
"
column=
"0"
>
<item
row=
"
1
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"diffOptionsLabel"
>
<property
name=
"text"
>
<string>
Diff Options:
</string>
</property>
</widget>
</item>
<item
row=
"
0
"
column=
"1"
>
<item
row=
"
1
"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"diffOptionsLineEdit"
/>
</item>
<item
row=
"
1
"
column=
"0"
colspan=
"2"
>
<item
row=
"
2
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"promptToSubmitCheckBox"
>
<property
name=
"text"
>
<string>
Prompt on submit
</string>
</property>
</widget>
</item>
<item
row=
"
2
"
column=
"0"
colspan=
"2"
>
<item
row=
"
3
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"describeByCommitIdCheckBox"
>