Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
cfd99849
Commit
cfd99849
authored
Jan 21, 2010
by
con
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New project mode layout, first part.
parent
b832bc3d
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
316 additions
and
744 deletions
+316
-744
src/plugins/projectexplorer/buildsettingspropertiespage.cpp
src/plugins/projectexplorer/buildsettingspropertiespage.cpp
+14
-2
src/plugins/projectexplorer/buildsettingspropertiespage.h
src/plugins/projectexplorer/buildsettingspropertiespage.h
+4
-2
src/plugins/projectexplorer/dependenciespanel.cpp
src/plugins/projectexplorer/dependenciespanel.cpp
+5
-0
src/plugins/projectexplorer/dependenciespanel.h
src/plugins/projectexplorer/dependenciespanel.h
+1
-0
src/plugins/projectexplorer/doubletabwidget.cpp
src/plugins/projectexplorer/doubletabwidget.cpp
+153
-18
src/plugins/projectexplorer/doubletabwidget.h
src/plugins/projectexplorer/doubletabwidget.h
+6
-0
src/plugins/projectexplorer/editorsettingspropertiespage.cpp
src/plugins/projectexplorer/editorsettingspropertiespage.cpp
+5
-0
src/plugins/projectexplorer/editorsettingspropertiespage.h
src/plugins/projectexplorer/editorsettingspropertiespage.h
+1
-0
src/plugins/projectexplorer/iprojectproperties.h
src/plugins/projectexplorer/iprojectproperties.h
+2
-0
src/plugins/projectexplorer/projectexplorer.cpp
src/plugins/projectexplorer/projectexplorer.cpp
+2
-1
src/plugins/projectexplorer/projectwindow.cpp
src/plugins/projectexplorer/projectwindow.cpp
+100
-606
src/plugins/projectexplorer/projectwindow.h
src/plugins/projectexplorer/projectwindow.h
+16
-114
src/plugins/projectexplorer/runsettingspropertiespage.cpp
src/plugins/projectexplorer/runsettingspropertiespage.cpp
+5
-0
src/plugins/projectexplorer/runsettingspropertiespage.h
src/plugins/projectexplorer/runsettingspropertiespage.h
+2
-1
No files found.
src/plugins/projectexplorer/buildsettingspropertiespage.cpp
View file @
cfd99849
...
@@ -54,6 +54,11 @@ using namespace ProjectExplorer::Internal;
...
@@ -54,6 +54,11 @@ using namespace ProjectExplorer::Internal;
// BuildSettingsPanelFactory
// BuildSettingsPanelFactory
///
///
QString
BuildSettingsPanelFactory
::
displayName
()
const
{
return
QApplication
::
tr
(
"Build Settings"
);
}
bool
BuildSettingsPanelFactory
::
supports
(
Project
*
project
)
bool
BuildSettingsPanelFactory
::
supports
(
Project
*
project
)
{
{
return
project
->
hasBuildSettings
();
return
project
->
hasBuildSettings
();
...
@@ -94,6 +99,11 @@ QIcon BuildSettingsPanel::icon() const
...
@@ -94,6 +99,11 @@ QIcon BuildSettingsPanel::icon() const
return
m_icon
;
return
m_icon
;
}
}
void
BuildSettingsPanel
::
widgetWasAddedToLayout
()
{
m_widget
->
setupUi
();
}
///
///
// BuildSettingsWidget
// BuildSettingsWidget
///
///
...
@@ -108,12 +118,14 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project) :
...
@@ -108,12 +118,14 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project) :
m_buildConfiguration
(
0
),
m_buildConfiguration
(
0
),
m_leftMargin
(
0
)
m_leftMargin
(
0
)
{
{
// Provide some time for our contentsmargins to get updated:
// setup is done after panel has been added to layout.
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
setupUi
()));
// setupUi will be called by the IPropertiesPanel implementation then.
// this is necessary to handle the margin by hand for the up/down/delete hover
}
}
void
BuildSettingsWidget
::
setupUi
()
void
BuildSettingsWidget
::
setupUi
()
{
{
// called by IPropertiesPanel implementation once the panel has been added
QMargins
margins
(
contentsMargins
());
QMargins
margins
(
contentsMargins
());
m_leftMargin
=
margins
.
left
();
m_leftMargin
=
margins
.
left
();
margins
.
setLeft
(
0
);
margins
.
setLeft
(
0
);
...
...
src/plugins/projectexplorer/buildsettingspropertiespage.h
View file @
cfd99849
...
@@ -51,6 +51,7 @@ namespace Internal {
...
@@ -51,6 +51,7 @@ namespace Internal {
class
BuildSettingsPanelFactory
:
public
IPanelFactory
class
BuildSettingsPanelFactory
:
public
IPanelFactory
{
{
public:
public:
QString
displayName
()
const
;
bool
supports
(
Project
*
project
);
bool
supports
(
Project
*
project
);
IPropertiesPanel
*
createPanel
(
Project
*
project
);
IPropertiesPanel
*
createPanel
(
Project
*
project
);
};
};
...
@@ -65,6 +66,7 @@ public:
...
@@ -65,6 +66,7 @@ public:
QString
displayName
()
const
;
QString
displayName
()
const
;
QWidget
*
widget
()
const
;
QWidget
*
widget
()
const
;
QIcon
icon
()
const
;
QIcon
icon
()
const
;
void
widgetWasAddedToLayout
();
private:
private:
BuildSettingsWidget
*
m_widget
;
BuildSettingsWidget
*
m_widget
;
...
@@ -84,6 +86,8 @@ public:
...
@@ -84,6 +86,8 @@ public:
void
addSubWidget
(
const
QString
&
name
,
QWidget
*
widget
);
void
addSubWidget
(
const
QString
&
name
,
QWidget
*
widget
);
QList
<
QWidget
*>
subWidgets
()
const
;
QList
<
QWidget
*>
subWidgets
()
const
;
void
setupUi
();
private
slots
:
private
slots
:
void
updateBuildSettings
();
void
updateBuildSettings
();
void
currentIndexChanged
(
int
index
);
void
currentIndexChanged
(
int
index
);
...
@@ -96,8 +100,6 @@ private slots:
...
@@ -96,8 +100,6 @@ private slots:
void
checkMakeActiveLabel
();
void
checkMakeActiveLabel
();
void
makeActive
();
void
makeActive
();
void
setupUi
();
void
addedBuildConfiguration
(
ProjectExplorer
::
BuildConfiguration
*
bc
);
void
addedBuildConfiguration
(
ProjectExplorer
::
BuildConfiguration
*
bc
);
void
removedBuildConfiguration
(
ProjectExplorer
::
BuildConfiguration
*
bc
);
void
removedBuildConfiguration
(
ProjectExplorer
::
BuildConfiguration
*
bc
);
void
buildConfigurationDisplayNameChanged
();
void
buildConfigurationDisplayNameChanged
();
...
...
src/plugins/projectexplorer/dependenciespanel.cpp
View file @
cfd99849
...
@@ -319,6 +319,11 @@ DependenciesPanelFactory::DependenciesPanelFactory(SessionManager *session)
...
@@ -319,6 +319,11 @@ DependenciesPanelFactory::DependenciesPanelFactory(SessionManager *session)
{
{
}
}
QString
DependenciesPanelFactory
::
displayName
()
const
{
return
QApplication
::
tr
(
"Dependencies"
);
}
bool
DependenciesPanelFactory
::
supports
(
Project
*
/* project */
)
bool
DependenciesPanelFactory
::
supports
(
Project
*
/* project */
)
{
{
return
true
;
return
true
;
...
...
src/plugins/projectexplorer/dependenciespanel.h
View file @
cfd99849
...
@@ -52,6 +52,7 @@ class DependenciesPanelFactory : public IPanelFactory
...
@@ -52,6 +52,7 @@ class DependenciesPanelFactory : public IPanelFactory
public:
public:
DependenciesPanelFactory
(
SessionManager
*
session
);
DependenciesPanelFactory
(
SessionManager
*
session
);
QString
displayName
()
const
;
bool
supports
(
Project
*
project
);
bool
supports
(
Project
*
project
);
IPropertiesPanel
*
createPanel
(
Project
*
project
);
IPropertiesPanel
*
createPanel
(
Project
*
project
);
...
...
src/plugins/projectexplorer/doubletabwidget.cpp
View file @
cfd99849
...
@@ -7,6 +7,9 @@
...
@@ -7,6 +7,9 @@
#include <QtGui/QPainter>
#include <QtGui/QPainter>
#include <QtGui/QFont>
#include <QtGui/QFont>
#include <QtGui/QMouseEvent>
#include <QtGui/QMouseEvent>
#include <QtGui/QMenu>
#include <QtDebug>
using
namespace
ProjectExplorer
::
Internal
;
using
namespace
ProjectExplorer
::
Internal
;
...
@@ -15,6 +18,7 @@ static const int MARGIN = 12;
...
@@ -15,6 +18,7 @@ static const int MARGIN = 12;
static
const
int
OTHER_HEIGHT
=
38
;
static
const
int
OTHER_HEIGHT
=
38
;
static
const
int
SELECTION_IMAGE_WIDTH
=
10
;
static
const
int
SELECTION_IMAGE_WIDTH
=
10
;
static
const
int
SELECTION_IMAGE_HEIGHT
=
20
;
static
const
int
SELECTION_IMAGE_HEIGHT
=
20
;
static
const
int
OVERFLOW_DROPDOWN_WIDTH
=
Utils
::
StyleHelper
::
navigationWidgetHeight
();
static
void
drawFirstLevelSeparator
(
QPainter
*
painter
,
QPoint
top
,
QPoint
bottom
)
static
void
drawFirstLevelSeparator
(
QPainter
*
painter
,
QPoint
top
,
QPoint
bottom
)
{
{
...
@@ -53,7 +57,8 @@ static void drawSecondLevelSeparator(QPainter *painter, QPoint top, QPoint botto
...
@@ -53,7 +57,8 @@ static void drawSecondLevelSeparator(QPainter *painter, QPoint top, QPoint botto
DoubleTabWidget
::
DoubleTabWidget
(
QWidget
*
parent
)
:
DoubleTabWidget
::
DoubleTabWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
),
QWidget
(
parent
),
ui
(
new
Ui
::
DoubleTabWidget
),
ui
(
new
Ui
::
DoubleTabWidget
),
m_currentIndex
(
-
1
)
m_currentIndex
(
-
1
),
m_lastVisibleIndex
(
-
1
)
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
}
}
...
@@ -88,6 +93,44 @@ void DoubleTabWidget::addTab(const QString &name, const QStringList &subTabs)
...
@@ -88,6 +93,44 @@ void DoubleTabWidget::addTab(const QString &name, const QStringList &subTabs)
update
();
update
();
}
}
void
DoubleTabWidget
::
insertTab
(
int
index
,
const
QString
&
name
,
const
QStringList
&
subTabs
)
{
Tab
tab
;
tab
.
name
=
name
;
tab
.
subTabs
=
subTabs
;
tab
.
currentSubTab
=
tab
.
subTabs
.
isEmpty
()
?
-
1
:
0
;
m_tabs
.
insert
(
index
,
tab
);
if
(
m_currentIndex
==
-
1
)
{
m_currentIndex
=
m_tabs
.
size
()
-
1
;
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
}
else
if
(
m_currentIndex
>=
index
)
{
++
m_currentIndex
;
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
}
update
();
}
void
DoubleTabWidget
::
removeTab
(
int
index
)
{
m_tabs
.
removeAt
(
index
);
if
(
index
<=
m_currentIndex
)
{
--
m_currentIndex
;
if
(
m_currentIndex
<
0
&&
m_tabs
.
size
()
>
0
)
m_currentIndex
=
0
;
if
(
m_currentIndex
<
0
)
{
emit
currentIndexChanged
(
-
1
,
-
1
);
}
else
{
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
}
}
update
();
}
int
DoubleTabWidget
::
tabCount
()
const
{
return
m_tabs
.
size
();
}
void
DoubleTabWidget
::
mousePressEvent
(
QMouseEvent
*
event
)
void
DoubleTabWidget
::
mousePressEvent
(
QMouseEvent
*
event
)
{
{
if
(
event
->
y
()
<
Utils
::
StyleHelper
::
navigationWidgetHeight
())
{
if
(
event
->
y
()
<
Utils
::
StyleHelper
::
navigationWidgetHeight
())
{
...
@@ -98,21 +141,39 @@ void DoubleTabWidget::mousePressEvent(QMouseEvent *event)
...
@@ -98,21 +141,39 @@ void DoubleTabWidget::mousePressEvent(QMouseEvent *event)
if
(
eventX
<=
x
)
if
(
eventX
<=
x
)
return
;
return
;
int
i
;
int
i
;
for
(
i
=
0
;
i
<
m_tabs
.
size
();
++
i
)
{
for
(
i
=
0
;
i
<=
m_lastVisibleIndex
;
++
i
)
{
int
otherX
=
x
+
2
*
MARGIN
+
fm
.
width
(
m_tabs
.
at
(
i
).
name
);
int
otherX
=
x
+
2
*
MARGIN
+
fm
.
width
(
m_tabs
.
at
(
m_currentTabIndices
.
at
(
i
)).
name
);
if
(
eventX
>
x
&&
eventX
<
otherX
)
{
if
(
eventX
>
x
&&
eventX
<
otherX
)
{
break
;
break
;
}
}
x
=
otherX
;
x
=
otherX
;
}
}
if
(
i
<
m_tabs
.
size
()
)
{
if
(
i
<
=
m_lastVisibleIndex
)
{
if
(
m_currentIndex
!=
i
)
{
if
(
m_currentIndex
!=
m_currentTabIndices
.
at
(
i
)
)
{
m_currentIndex
=
i
;
m_currentIndex
=
m_currentTabIndices
.
at
(
i
)
;
update
();
update
();
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
}
}
event
->
accept
();
event
->
accept
();
return
;
return
;
}
else
if
(
m_lastVisibleIndex
<
m_tabs
.
size
()
-
1
)
{
// handle overflow menu
if
(
eventX
>
x
&&
eventX
<
x
+
OVERFLOW_DROPDOWN_WIDTH
)
{
QMenu
overflowMenu
;
QList
<
QAction
*>
actions
;
for
(
int
i
=
m_lastVisibleIndex
+
1
;
i
<
m_tabs
.
size
();
++
i
)
{
actions
<<
overflowMenu
.
addAction
(
m_tabs
.
at
(
m_currentTabIndices
.
at
(
i
)).
name
);
}
if
(
QAction
*
action
=
overflowMenu
.
exec
(
mapToGlobal
(
QPoint
(
x
+
1
,
1
))))
{
int
index
=
m_currentTabIndices
.
at
(
actions
.
indexOf
(
action
)
+
m_lastVisibleIndex
+
1
);
if
(
m_currentIndex
!=
index
)
{
m_currentIndex
=
index
;
update
();
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
}
}
}
}
}
}
else
if
(
event
->
y
()
<
Utils
::
StyleHelper
::
navigationWidgetHeight
()
+
OTHER_HEIGHT
)
{
}
else
if
(
event
->
y
()
<
Utils
::
StyleHelper
::
navigationWidgetHeight
()
+
OTHER_HEIGHT
)
{
int
diff
=
(
OTHER_HEIGHT
-
SELECTION_IMAGE_HEIGHT
)
/
2
;
int
diff
=
(
OTHER_HEIGHT
-
SELECTION_IMAGE_HEIGHT
)
/
2
;
...
@@ -146,7 +207,6 @@ void DoubleTabWidget::mousePressEvent(QMouseEvent *event)
...
@@ -146,7 +207,6 @@ void DoubleTabWidget::mousePressEvent(QMouseEvent *event)
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
emit
currentIndexChanged
(
m_currentIndex
,
m_tabs
.
at
(
m_currentIndex
).
currentSubTab
);
return
;
return
;
}
}
}
}
event
->
ignore
();
event
->
ignore
();
}
}
...
@@ -193,18 +253,85 @@ void DoubleTabWidget::paintEvent(QPaintEvent *event)
...
@@ -193,18 +253,85 @@ void DoubleTabWidget::paintEvent(QPaintEvent *event)
// top level tabs
// top level tabs
int
x
=
2
*
MARGIN
+
qMax
(
fm
.
width
(
m_title
),
MIN_LEFT_MARGIN
);
int
x
=
2
*
MARGIN
+
qMax
(
fm
.
width
(
m_title
),
MIN_LEFT_MARGIN
);
// calculate sizes
QList
<
int
>
nameWidth
;
int
width
=
x
;
int
indexSmallerThanOverflow
=
-
1
;
int
indexSmallerThanWidth
=
-
1
;
for
(
int
i
=
0
;
i
<
m_tabs
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
m_tabs
.
size
();
++
i
)
{
if
(
i
==
m_currentIndex
)
{
const
Tab
&
tab
=
m_tabs
.
at
(
i
);
int
w
=
fm
.
width
(
tab
.
name
);
nameWidth
<<
w
;
width
+=
2
*
MARGIN
+
w
;
if
(
width
<
r
.
width
())
indexSmallerThanWidth
=
i
;
if
(
width
<
r
.
width
()
-
OVERFLOW_DROPDOWN_WIDTH
)
indexSmallerThanOverflow
=
i
;
}
m_lastVisibleIndex
=
-
1
;
m_currentTabIndices
.
resize
(
m_tabs
.
size
());
if
(
indexSmallerThanWidth
==
m_tabs
.
size
()
-
1
)
{
// => everything fits
for
(
int
i
=
0
;
i
<
m_tabs
.
size
();
++
i
)
m_currentTabIndices
[
i
]
=
i
;
m_lastVisibleIndex
=
m_tabs
.
size
()
-
1
;
}
else
{
// => we need the overflow thingy
if
(
m_currentIndex
<=
indexSmallerThanOverflow
)
{
// easy going, simply draw everything that fits
for
(
int
i
=
0
;
i
<
m_tabs
.
size
();
++
i
)
m_currentTabIndices
[
i
]
=
i
;
m_lastVisibleIndex
=
indexSmallerThanOverflow
;
}
else
{
// now we need to put the current tab into
// visible range. for that we need to find the place
// to put it, so it fits
width
=
x
;
int
index
=
0
;
bool
handledCurrentIndex
=
false
;
for
(
int
i
=
0
;
i
<
m_tabs
.
size
();
++
i
)
{
if
(
index
!=
m_currentIndex
)
{
if
(
!
handledCurrentIndex
)
{
// check if enough room for current tab after this one
if
(
width
+
2
*
MARGIN
+
nameWidth
.
at
(
index
)
+
2
*
MARGIN
+
nameWidth
.
at
(
m_currentIndex
)
<
r
.
width
()
-
OVERFLOW_DROPDOWN_WIDTH
)
{
m_currentTabIndices
[
i
]
=
index
;
++
index
;
width
+=
2
*
MARGIN
+
nameWidth
.
at
(
index
);
}
else
{
m_currentTabIndices
[
i
]
=
m_currentIndex
;
handledCurrentIndex
=
true
;
m_lastVisibleIndex
=
i
;
}
}
else
{
m_currentTabIndices
[
i
]
=
index
;
++
index
;
}
}
else
{
++
index
;
--
i
;
}
}
}
}
// actually draw top level tabs
for
(
int
i
=
0
;
i
<=
m_lastVisibleIndex
;
++
i
)
{
int
actualIndex
=
m_currentTabIndices
.
at
(
i
);
Tab
tab
=
m_tabs
.
at
(
actualIndex
);
if
(
actualIndex
==
m_currentIndex
)
{
painter
.
setPen
(
Utils
::
StyleHelper
::
borderColor
());
painter
.
setPen
(
Utils
::
StyleHelper
::
borderColor
());
painter
.
drawLine
(
x
-
1
,
0
,
x
-
1
,
r
.
height
()
-
1
);
painter
.
drawLine
(
x
-
1
,
0
,
x
-
1
,
r
.
height
()
-
1
);
painter
.
fillRect
(
QRect
(
x
,
0
,
painter
.
fillRect
(
QRect
(
x
,
0
,
2
*
MARGIN
+
fm
.
width
(
m_tabs
.
at
(
i
)
.
name
),
2
*
MARGIN
+
fm
.
width
(
tab
.
name
),
r
.
height
()
+
1
),
r
.
height
()
+
1
),
grad
);
grad
);
x
+=
MARGIN
;
x
+=
MARGIN
;
painter
.
setPen
(
Qt
::
black
);
painter
.
setPen
(
Qt
::
black
);
painter
.
drawText
(
x
,
baseline
,
m_tabs
.
at
(
i
)
.
name
);
painter
.
drawText
(
x
,
baseline
,
tab
.
name
);
x
+=
fm
.
width
(
m_tabs
.
at
(
i
).
name
);
x
+=
nameWidth
.
at
(
actualIndex
);
x
+=
MARGIN
;
x
+=
MARGIN
;
painter
.
setPen
(
Utils
::
StyleHelper
::
borderColor
());
painter
.
setPen
(
Utils
::
StyleHelper
::
borderColor
());
painter
.
drawLine
(
x
,
0
,
x
,
r
.
height
()
-
1
);
painter
.
drawLine
(
x
,
0
,
x
,
r
.
height
()
-
1
);
...
@@ -213,19 +340,27 @@ void DoubleTabWidget::paintEvent(QPaintEvent *event)
...
@@ -213,19 +340,27 @@ void DoubleTabWidget::paintEvent(QPaintEvent *event)
drawFirstLevelSeparator
(
&
painter
,
QPoint
(
x
,
0
),
QPoint
(
x
,
r
.
height
()
-
1
));
drawFirstLevelSeparator
(
&
painter
,
QPoint
(
x
,
0
),
QPoint
(
x
,
r
.
height
()
-
1
));
x
+=
MARGIN
;
x
+=
MARGIN
;
painter
.
setPen
(
Utils
::
StyleHelper
::
panelTextColor
());
painter
.
setPen
(
Utils
::
StyleHelper
::
panelTextColor
());
painter
.
drawText
(
x
+
1
,
baseline
,
m_tabs
.
at
(
i
)
.
name
);
painter
.
drawText
(
x
+
1
,
baseline
,
tab
.
name
);
x
+=
fm
.
width
(
m_tabs
.
at
(
i
).
name
);
x
+=
nameWidth
.
at
(
actualIndex
);
x
+=
MARGIN
;
x
+=
MARGIN
;
drawFirstLevelSeparator
(
&
painter
,
QPoint
(
x
,
0
),
QPoint
(
x
,
r
.
height
()
-
1
));
drawFirstLevelSeparator
(
&
painter
,
QPoint
(
x
,
0
),
QPoint
(
x
,
r
.
height
()
-
1
));
}
}
if
(
x
>=
r
.
width
())
// TODO: do something useful...
}
break
;
// draw overflow button
if
(
m_lastVisibleIndex
<
m_tabs
.
size
()
-
1
)
{
QStyleOption
opt
;
opt
.
rect
=
QRect
(
x
,
0
,
OVERFLOW_DROPDOWN_WIDTH
-
1
,
r
.
height
()
-
1
);
style
()
->
drawPrimitive
(
QStyle
::
PE_IndicatorArrowDown
,
&
opt
,
&
painter
,
this
);
drawFirstLevelSeparator
(
&
painter
,
QPoint
(
x
+
OVERFLOW_DROPDOWN_WIDTH
,
0
),
QPoint
(
x
+
OVERFLOW_DROPDOWN_WIDTH
,
r
.
height
()
-
1
));
}
}
// second level tabs
// second level tabs
static
QPixmap
left
(
":/projectexplorer/leftselection.png"
);
static
QPixmap
left
(
":/projectexplorer/
images/
leftselection.png"
);
static
QPixmap
mid
(
":/projectexplorer/midselection.png"
);
static
QPixmap
mid
(
":/projectexplorer/
images/
midselection.png"
);
static
QPixmap
right
(
":/projectexplorer/rightselection.png"
);
static
QPixmap
right
(
":/projectexplorer/
images/
rightselection.png"
);
if
(
m_currentIndex
!=
-
1
)
{
if
(
m_currentIndex
!=
-
1
)
{
int
y
=
r
.
height
()
+
(
OTHER_HEIGHT
-
left
.
height
())
/
2.
;
int
y
=
r
.
height
()
+
(
OTHER_HEIGHT
-
left
.
height
())
/
2.
;
int
imageHeight
=
left
.
height
();
int
imageHeight
=
left
.
height
();
...
...
src/plugins/projectexplorer/doubletabwidget.h
View file @
cfd99849
#ifndef DOUBLETABWIDGET_H
#ifndef DOUBLETABWIDGET_H
#define DOUBLETABWIDGET_H
#define DOUBLETABWIDGET_H
#include <QtCore/QVector>
#include <QtGui/QWidget>
#include <QtGui/QWidget>
namespace
ProjectExplorer
{
namespace
ProjectExplorer
{
...
@@ -20,6 +21,9 @@ public:
...
@@ -20,6 +21,9 @@ public:
QString
title
()
const
{
return
m_title
;
}
QString
title
()
const
{
return
m_title
;
}
void
addTab
(
const
QString
&
name
,
const
QStringList
&
subTabs
);
void
addTab
(
const
QString
&
name
,
const
QStringList
&
subTabs
);
void
insertTab
(
int
index
,
const
QString
&
name
,
const
QStringList
&
subTabs
);
void
removeTab
(
int
index
);
int
tabCount
()
const
;
signals:
signals:
void
currentIndexChanged
(
int
index
,
int
subIndex
);
void
currentIndexChanged
(
int
index
,
int
subIndex
);
...
@@ -42,6 +46,8 @@ private:
...
@@ -42,6 +46,8 @@ private:
QString
m_title
;
QString
m_title
;
QList
<
Tab
>
m_tabs
;
QList
<
Tab
>
m_tabs
;
int
m_currentIndex
;
int
m_currentIndex
;
QVector
<
int
>
m_currentTabIndices
;
int
m_lastVisibleIndex
;
};
};
}
// namespace Internal
}
// namespace Internal
...
...
src/plugins/projectexplorer/editorsettingspropertiespage.cpp
View file @
cfd99849
...
@@ -38,6 +38,11 @@
...
@@ -38,6 +38,11 @@
using
namespace
ProjectExplorer
;
using
namespace
ProjectExplorer
;
using
namespace
ProjectExplorer
::
Internal
;
using
namespace
ProjectExplorer
::
Internal
;
QString
EditorSettingsPanelFactory
::
displayName
()
const
{
return
QApplication
::
tr
(
"Editor Settings"
);
}
bool
EditorSettingsPanelFactory
::
supports
(
Project
*
/*project*/
)
bool
EditorSettingsPanelFactory
::
supports
(
Project
*
/*project*/
)
{
{
return
true
;
return
true
;
...
...
src/plugins/projectexplorer/editorsettingspropertiespage.h
View file @
cfd99849
...
@@ -40,6 +40,7 @@ namespace Internal {
...
@@ -40,6 +40,7 @@ namespace Internal {
class
EditorSettingsPanelFactory
:
public
IPanelFactory
class
EditorSettingsPanelFactory
:
public
IPanelFactory
{
{
public:
public:
QString
displayName
()
const
;
bool
supports
(
Project
*
project
);
bool
supports
(
Project
*
project
);
IPropertiesPanel
*
createPanel
(
Project
*
project
);
IPropertiesPanel
*
createPanel
(
Project
*
project
);
};
};
...
...
src/plugins/projectexplorer/iprojectproperties.h
View file @
cfd99849
...
@@ -48,12 +48,14 @@ public:
...
@@ -48,12 +48,14 @@ public:
virtual
QString
displayName
()
const
=
0
;
virtual
QString
displayName
()
const
=
0
;
virtual
QIcon
icon
()
const
=
0
;
virtual
QIcon
icon
()
const
=
0
;
virtual
QWidget
*
widget
()
const
=
0
;
virtual
QWidget
*
widget
()
const
=
0
;
virtual
void
widgetWasAddedToLayout
()
{
}
};
};
class
PROJECTEXPLORER_EXPORT
IPanelFactory
:
public
QObject
class
PROJECTEXPLORER_EXPORT
IPanelFactory
:
public
QObject
{
{
Q_OBJECT
Q_OBJECT
public:
public:
virtual
QString
displayName
()
const
=
0
;
virtual
bool
supports
(
Project
*
project
)
=
0
;
virtual
bool
supports
(
Project
*
project
)
=
0
;
virtual
IPropertiesPanel
*
createPanel
(
Project
*
project
)
=
0
;
virtual
IPropertiesPanel
*
createPanel
(
Project
*
project
)
=
0
;
};
};
...
...
src/plugins/projectexplorer/projectexplorer.cpp
View file @
cfd99849
...
@@ -903,6 +903,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
...
@@ -903,6 +903,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
void
ProjectExplorerPlugin
::
shutdown
()
void
ProjectExplorerPlugin
::
shutdown
()
{
{
d
->
m_proWindow
->
shutdown
();
// disconnect from session
d
->
m_session
->
clear
();
d
->
m_session
->
clear
();
// d->m_proWindow->saveConfigChanges();
// d->m_proWindow->saveConfigChanges();
}
}
...
@@ -2240,7 +2241,7 @@ BuildConfigDialog::BuildConfigDialog(Project *project, QWidget *parent)
...
@@ -2240,7 +2241,7 @@ BuildConfigDialog::BuildConfigDialog(Project *project, QWidget *parent)
}
}
QFormLayout
*
formlayout
=
new
QFormLayout
;
QFormLayout
*
formlayout
=
new
QFormLayout
;
formlayout
->
addRow
(
ActiveConfigurationWidget
::
tr
(
"Active run configuration"
),
formlayout
->
addRow
(
tr
(
"Active run configuration"
),
// ^ avoiding a new translatable string for active run configuration
// ^ avoiding a new translatable string for active run configuration
new
QLabel
(
activeRun
->
displayName
()));
new
QLabel
(
activeRun
->
displayName
()));
formlayout
->
addRow
(
tr
(
"Choose build configuration:"
),
m_configCombo
);
formlayout
->
addRow
(
tr
(
"Choose build configuration:"
),
m_configCombo
);
...
...
src/plugins/projectexplorer/projectwindow.cpp
View file @
cfd99849
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#include "projectwindow.h"
#include "projectwindow.h"
#include "doubletabwidget.h"
#include "project.h"
#include "project.h"
#include "environment.h"
#include "environment.h"
#include "projectexplorer.h"
#include "projectexplorer.h"
...
@@ -90,22 +92,6 @@ public:
...
@@ -90,22 +92,6 @@ public:
}
}
};
};
///
// PanelsWidget::Panel
///
PanelsWidget
::
Panel
::
Panel
(
QWidget
*
w
)
:
iconLabel
(
0
),
lineWidget
(
0
),
nameLabel
(
0
),
panelWidget
(
w
)
{
}
PanelsWidget
::
Panel
::~
Panel
()
{
delete
iconLabel
;
delete
lineWidget
;
delete
nameLabel
;
// do not delete panelWidget, we do not own it!
}
///
///
// PanelsWidget
// PanelsWidget
///
///
...
@@ -129,24 +115,7 @@ PanelsWidget::PanelsWidget(QWidget *parent) :
...
@@ -129,24 +115,7 @@ PanelsWidget::PanelsWidget(QWidget *parent) :
PanelsWidget
::~
PanelsWidget
()
PanelsWidget
::~
PanelsWidget
()