Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Plugin-DidYouKnow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janis Born
Plugin-DidYouKnow
Commits
9c9ffacb
There was a problem fetching the pipeline summary.
Commit
9c9ffacb
authored
9 years ago
by
Janis Born
Browse files
Options
Downloads
Patches
Plain Diff
fix double deletion of dialog widget
parent
4bb72212
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
DidYouKnowPlugin.cc
+5
-4
5 additions, 4 deletions
DidYouKnowPlugin.cc
DidYouKnowPlugin.hh
+1
-1
1 addition, 1 deletion
DidYouKnowPlugin.hh
DidYouKnowWidget.cc
+27
-19
27 additions, 19 deletions
DidYouKnowWidget.cc
DidYouKnowWidget.hh
+6
-6
6 additions, 6 deletions
DidYouKnowWidget.hh
with
39 additions
and
30 deletions
DidYouKnowPlugin.cc
+
5
−
4
View file @
9c9ffacb
#include
"DidYouKnowPlugin.hh"
DidYouKnowPlugin
::
DidYouKnowPlugin
()
DidYouKnowPlugin
::
DidYouKnowPlugin
()
:
mDidYouKnowWidget
(
new
DidYouKnowWidget
())
{
}
...
...
@@ -13,9 +14,9 @@ void DidYouKnowPlugin::initializePlugin()
}
void
DidYouKnowPlugin
::
pluginsInitialized
()
{
mDidYouKnowWidget
.
show
();
mDidYouKnowWidget
.
raise
();
mDidYouKnowWidget
.
activateWindow
();
mDidYouKnowWidget
->
show
();
mDidYouKnowWidget
->
raise
();
mDidYouKnowWidget
->
activateWindow
();
}
#if QT_VERSION < 0x050000
...
...
This diff is collapsed.
Click to expand it.
DidYouKnowPlugin.hh
+
1
−
1
View file @
9c9ffacb
...
...
@@ -33,7 +33,7 @@ public slots:
QString
version
()
{
return
QString
(
"1.0"
);
}
private
:
DidYouKnowWidget
mDidYouKnowWidget
;
DidYouKnowWidget
*
mDidYouKnowWidget
;
};
#endif //DIDYOUKNOWPLUGIN_HH
This diff is collapsed.
Click to expand it.
DidYouKnowWidget.cc
+
27
−
19
View file @
9c9ffacb
...
...
@@ -17,35 +17,43 @@
#include
<iostream>
DidYouKnowWidget
::
DidYouKnowWidget
(
QWidget
*
_parent
)
DidYouKnowWidget
::
DidYouKnowWidget
(
QWidget
*
_parent
)
:
QDialog
(
_parent
)
{
setWindowTitle
(
"Tip of the Day"
);
setWindowFlags
(
Qt
::
Dialog
|
Qt
::
WindowTitleHint
|
Qt
::
WindowCloseButtonHint
);
mVBoxLayoutGlobal
=
new
QVBoxLayout
();
mHBoxLayoutBottomRow
=
new
QHBoxLayout
();
QSize
labelSize
(
420
,
200
);
mLabelTip
.
setText
(
"Did you know..."
);
mLabelTip
.
setMinimumSize
(
labelSize
);
mLabelTip
.
setMaximumSize
(
labelSize
);
mLabelTip
.
setAlignment
(
Qt
::
AlignTop
);
mLabelTip
.
setWordWrap
(
true
);
mLabelTip
=
new
QLabel
();
mLabelTip
->
setText
(
"Did you know..."
);
mLabelTip
->
setMinimumSize
(
labelSize
);
mLabelTip
->
setMaximumSize
(
labelSize
);
mLabelTip
->
setAlignment
(
Qt
::
AlignTop
);
mLabelTip
->
setWordWrap
(
true
);
mCheckBoxShowTipsOnStartup
.
setText
(
"&Show tips at startup"
);
mCheckBoxShowTipsOnStartup
.
setChecked
(
true
);
mCheckBoxShowTipsOnStartup
=
new
QCheckBox
();
mCheckBoxShowTipsOnStartup
->
setText
(
"&Show tips at startup"
);
mCheckBoxShowTipsOnStartup
->
setChecked
(
true
);
mPushButtonNextTip
.
setText
(
"&Tell me more!"
);
connect
(
&
mPushButtonNextTip
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
displayNextTip
()));
mPushButtonNextTip
=
new
QPushButton
();
mPushButtonNextTip
->
setText
(
"&Tell me more!"
);
connect
(
mPushButtonNextTip
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
displayNextTip
()));
mPushButtonClose
.
setText
(
"Thank y&ou!"
);
connect
(
&
mPushButtonClose
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
close
()));
mPushButtonClose
=
new
QPushButton
();
mPushButtonClose
->
setText
(
"Thank y&ou!"
);
connect
(
mPushButtonClose
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
close
()));
mHBoxLayoutBottomRow
.
addWidget
(
&
mCheckBoxShowTipsOnStartup
);
mHBoxLayoutBottomRow
.
addWidget
(
&
mPushButtonNextTip
);
mHBoxLayoutBottomRow
.
addWidget
(
&
mPushButtonClose
);
mHBoxLayoutBottomRow
->
addWidget
(
mCheckBoxShowTipsOnStartup
);
mHBoxLayoutBottomRow
->
addWidget
(
mPushButtonNextTip
);
mHBoxLayoutBottomRow
->
addWidget
(
mPushButtonClose
);
mVBoxLayoutGlobal
.
addWidget
(
&
mLabelTip
);
mVBoxLayoutGlobal
.
addLayout
(
&
mHBoxLayoutBottomRow
);
mVBoxLayoutGlobal
->
addWidget
(
mLabelTip
);
mVBoxLayoutGlobal
->
addLayout
(
mHBoxLayoutBottomRow
);
setLayout
(
&
mVBoxLayoutGlobal
);
setLayout
(
mVBoxLayoutGlobal
);
setFixedSize
(
sizeHint
());
try
{
...
...
@@ -131,7 +139,7 @@ void DidYouKnowWidget::displayTip(std::size_t _tipIndex)
text
+=
"<h1><img src=
\"
"
+
OpenFlipper
::
Options
::
iconDirStr
()
+
OpenFlipper
::
Options
::
dirSeparator
()
+
"lightbulb.png
\"
> Did you know...</h1>"
;
text
+=
"<hr>"
;
text
+=
mTips
[
_tipIndex
];
mLabelTip
.
setText
(
text
);
mLabelTip
->
setText
(
text
);
}
}
...
...
This diff is collapsed.
Click to expand it.
DidYouKnowWidget.hh
+
6
−
6
View file @
9c9ffacb
...
...
@@ -38,12 +38,12 @@ private:
std
::
vector
<
QString
>
mTips
;
std
::
size_t
mCurrentTipIndex
;
QVBoxLayout
mVBoxLayoutGlobal
;
QHBoxLayout
mHBoxLayoutBottomRow
;
QLabel
mLabelTip
;
QPushButton
mPushButtonNextTip
;
QPushButton
mPushButtonClose
;
QCheckBox
mCheckBoxShowTipsOnStartup
;
QVBoxLayout
*
mVBoxLayoutGlobal
;
QHBoxLayout
*
mHBoxLayoutBottomRow
;
QLabel
*
mLabelTip
;
QPushButton
*
mPushButtonNextTip
;
QPushButton
*
mPushButtonClose
;
QCheckBox
*
mCheckBoxShowTipsOnStartup
;
};
#endif //DIDYOUKNOWWIDGET_HH
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment