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
Marco Bubke
flatpak-qt-creator
Commits
d24cd037
Commit
d24cd037
authored
Jul 30, 2009
by
dt
Browse files
Change the apppereanve slightly for environment widgets.
parent
7be8be25
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/environmenteditmodel.cpp
View file @
d24cd037
...
...
@@ -31,6 +31,7 @@
#include <QtGui/QVBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QToolButton>
using
namespace
ProjectExplorer
;
...
...
@@ -424,46 +425,36 @@ void EnvironmentModel::setUserChanges(QList<EnvironmentItem> list)
////
EnvironmentWidget
::
EnvironmentWidget
(
QWidget
*
parent
,
QWidget
*
additionalDetailsWidget
)
:
Q
Stacked
Widget
(
parent
)
:
QWidget
(
parent
)
{
m_model
=
new
EnvironmentModel
();
m_model
->
setMergedEnvironments
(
true
);
connect
(
m_model
,
SIGNAL
(
userChangesUpdated
()),
this
,
SIGNAL
(
userChangesUpdated
()));
m_summaryPage
=
new
QWidget
();
addWidget
(
m_summaryPage
);
QVBoxLayout
*
vbox
=
new
QVBoxLayout
(
m_summaryPage
);
vbox
->
setContentsMargins
(
0
,
-
1
,
0
,
-
1
);
QPushButton
*
detailsButton
=
new
QPushButton
(
this
);
detailsButton
->
setText
(
tr
(
"Show Details"
));
QHBoxLayout
*
hdetailsButtonLayout
=
new
QHBoxLayout
();
hdetailsButtonLayout
->
setMargin
(
0
);
hdetailsButtonLayout
->
addWidget
(
detailsButton
);
hdetailsButtonLayout
->
addStretch
(
10
);
connect
(
detailsButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
switchToDetails
()));
vbox
->
addLayout
(
hdetailsButtonLayout
);
QVBoxLayout
*
vbox
=
new
QVBoxLayout
(
this
);
m_summaryText
=
new
QLabel
(
this
);
m_summaryText
->
setText
(
""
);
vbox
->
addWidget
(
m_summaryText
);
m_detailsPage
=
new
QWidget
();
//addWidget(m_detailsPage);
QVBoxLayout
*
vbox2
=
new
QVBoxLayout
(
m_detailsPage
);
vbox2
->
setContentsMargins
(
0
,
-
1
,
0
,
-
1
);
QToolButton
*
detailsButton
=
new
QToolButton
(
this
);
detailsButton
->
setText
(
tr
(
"Details"
));
connect
(
detailsButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
switchToDetails
()));
QPushButton
*
summaryButton
=
new
QPushButton
(
this
);
summaryButton
->
setText
(
tr
(
"Hide Details"
));
QHBoxLayout
*
hbox
=
new
QHBoxLayout
();
hbox
->
addWidget
(
m_summaryText
);
hbox
->
addWidget
(
detailsButton
);
hbox
->
setMargin
(
0
);
hbox
->
addWidget
(
summaryButton
);
hbox
->
addStretch
(
10
);
connect
(
summaryButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
switchToSummary
()));
vbox2
->
addLayout
(
hbox
);
vbox
->
addLayout
(
hbox
);
m_details
=
new
QWidget
(
this
);
m_details
->
setVisible
(
false
);
QVBoxLayout
*
vbox2
=
new
QVBoxLayout
(
m_details
);
vbox2
->
setMargin
(
0
);
if
(
additionalDetailsWidget
)
vbox2
->
addWidget
(
additionalDetailsWidget
);
...
...
@@ -478,30 +469,32 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
m_environmentTreeView
->
setMinimumHeight
(
400
);
horizontalLayout
->
addWidget
(
m_environmentTreeView
);
QVBoxLayout
*
vertical
Layout
_2
=
new
QVBoxLayout
();
QVBoxLayout
*
button
Layout
=
new
QVBoxLayout
();
m_editButton
=
new
QPushButton
(
this
);
m_editButton
->
setText
(
tr
(
"&Edit"
));
vertical
Layout
_2
->
addWidget
(
m_editButton
);
button
Layout
->
addWidget
(
m_editButton
);
m_addButton
=
new
QPushButton
(
this
);
m_addButton
->
setText
(
tr
(
"&Add"
));
vertical
Layout
_2
->
addWidget
(
m_addButton
);
button
Layout
->
addWidget
(
m_addButton
);
m_removeButton
=
new
QPushButton
(
this
);
m_removeButton
->
setEnabled
(
false
);
m_removeButton
->
setText
(
tr
(
"&Reset"
));
vertical
Layout
_2
->
addWidget
(
m_removeButton
);
button
Layout
->
addWidget
(
m_removeButton
);
m_unsetButton
=
new
QPushButton
(
this
);
m_unsetButton
->
setEnabled
(
false
);
m_unsetButton
->
setText
(
tr
(
"&Unset"
));
vertical
Layout
_2
->
addWidget
(
m_unsetButton
);
button
Layout
->
addWidget
(
m_unsetButton
);
QSpacerItem
*
verticalSpacer
=
new
QSpacerItem
(
20
,
40
,
QSizePolicy
::
Minimum
,
QSizePolicy
::
Expanding
);
vertical
Layout
_2
->
addItem
(
verticalSpacer
);
horizontalLayout
->
addLayout
(
vertical
Layout
_2
);
button
Layout
->
addItem
(
verticalSpacer
);
horizontalLayout
->
addLayout
(
button
Layout
);
vbox2
->
addLayout
(
horizontalLayout
);
vbox
->
addWidget
(
m_details
);
connect
(
m_model
,
SIGNAL
(
dataChanged
(
const
QModelIndex
&
,
const
QModelIndex
&
)),
this
,
SLOT
(
updateButtons
()));
...
...
@@ -520,26 +513,13 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
EnvironmentWidget
::~
EnvironmentWidget
()
{
delete
m_summaryPage
;
delete
m_detailsPage
;
delete
m_model
;
m_model
=
0
;
}
void
EnvironmentWidget
::
switchToDetails
()
{
addWidget
(
m_detailsPage
);
setCurrentWidget
(
m_detailsPage
);
removeWidget
(
m_summaryPage
);
}
void
EnvironmentWidget
::
switchToSummary
()
{
updateSummaryText
();
addWidget
(
m_summaryPage
);
setCurrentWidget
(
m_summaryPage
);
removeWidget
(
m_detailsPage
);
m_details
->
setVisible
(
!
m_details
->
isVisible
());
}
void
EnvironmentWidget
::
setBaseEnvironment
(
const
ProjectExplorer
::
Environment
&
env
)
...
...
src/plugins/projectexplorer/environmenteditmodel.h
View file @
d24cd037
...
...
@@ -89,7 +89,7 @@ private:
bool
m_mergedEnvironments
;
};
class
PROJECTEXPLORER_EXPORT
EnvironmentWidget
:
public
Q
Stacked
Widget
class
PROJECTEXPLORER_EXPORT
EnvironmentWidget
:
public
QWidget
{
Q_OBJECT
public:
...
...
@@ -122,9 +122,8 @@ private slots:
private:
void
updateSummaryText
();
EnvironmentModel
*
m_model
;
QWidget
*
m_summaryPage
;
QWidget
*
m_detailsPage
;
QLabel
*
m_summaryText
;
QWidget
*
m_details
;
QTreeView
*
m_environmentTreeView
;
QPushButton
*
m_editButton
;
QPushButton
*
m_addButton
;
...
...
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