Skip to content
GitLab
Menu
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
174147a9
Commit
174147a9
authored
May 20, 2010
by
Robert Loehning
Browse files
Using selected session's name as initial value when cloning or renaming
session
parent
1f6949c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/sessiondialog.cpp
View file @
174147a9
...
...
@@ -78,18 +78,19 @@ class SessionNameInputDialog : public QDialog
{
Q_OBJECT
public:
SessionNameInputDialog
(
const
QStringList
&
sessions
);
SessionNameInputDialog
(
const
QStringList
&
sessions
,
const
QString
&
initialValue
=
QString
()
);
QString
value
()
const
;
private:
QLineEdit
*
m_newSessionLineEdit
;
};
SessionNameInputDialog
::
SessionNameInputDialog
(
const
QStringList
&
sessions
)
SessionNameInputDialog
::
SessionNameInputDialog
(
const
QStringList
&
sessions
,
const
QString
&
initialValue
)
{
QVBoxLayout
*
hlayout
=
new
QVBoxLayout
(
this
);
QLabel
*
label
=
new
QLabel
(
tr
(
"Enter the name of the session:"
),
this
);
hlayout
->
addWidget
(
label
);
m_newSessionLineEdit
=
new
QLineEdit
(
this
);
m_newSessionLineEdit
->
setText
(
initialValue
);
m_newSessionLineEdit
->
setValidator
(
new
SessionValidator
(
this
,
sessions
));
hlayout
->
addWidget
(
m_newSessionLineEdit
);
QDialogButtonBox
*
buttons
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
Qt
::
Horizontal
,
this
);
...
...
@@ -191,7 +192,7 @@ void SessionDialog::createNew()
void
SessionDialog
::
clone
()
{
SessionNameInputDialog
newSessionInputDialog
(
m_sessionManager
->
sessions
());
SessionNameInputDialog
newSessionInputDialog
(
m_sessionManager
->
sessions
()
,
m_ui
.
sessionList
->
currentItem
()
->
text
()
);
newSessionInputDialog
.
setWindowTitle
(
tr
(
"New session name"
));
if
(
newSessionInputDialog
.
exec
()
==
QDialog
::
Accepted
)
{
QString
newSession
=
newSessionInputDialog
.
value
();
...
...
@@ -215,7 +216,7 @@ void SessionDialog::remove()
void
SessionDialog
::
rename
()
{
SessionNameInputDialog
newSessionInputDialog
(
m_sessionManager
->
sessions
());
SessionNameInputDialog
newSessionInputDialog
(
m_sessionManager
->
sessions
()
,
m_ui
.
sessionList
->
currentItem
()
->
text
()
);
newSessionInputDialog
.
setWindowTitle
(
tr
(
"Rename session"
));
if
(
newSessionInputDialog
.
exec
()
==
QDialog
::
Accepted
)
{
m_sessionManager
->
renameSession
(
m_ui
.
sessionList
->
currentItem
()
->
text
(),
newSessionInputDialog
.
value
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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