Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
3304cbf2
Commit
3304cbf2
authored
Aug 07, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue 555
parent
143febc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
UBMainWindow.cpp
src/gui/UBMainWindow.cpp
+18
-2
No files found.
src/gui/UBMainWindow.cpp
View file @
3304cbf2
...
...
@@ -151,18 +151,34 @@ void UBMainWindow::onExportDone()
actionDocumentAdd
->
setEnabled
(
true
);
}
#include "core/UBDisplayManager.h"
bool
UBMainWindow
::
yesNoQuestion
(
QString
windowTitle
,
QString
text
)
{
QMessageBox
messageBox
;
messageBox
.
setParent
(
this
);
messageBox
.
setWindowFlags
(
Qt
::
Dialog
);
messageBox
.
setWindowTitle
(
windowTitle
);
messageBox
.
setText
(
text
);
QPushButton
*
yesButton
=
messageBox
.
addButton
(
tr
(
"Yes"
),
QMessageBox
::
YesRole
);
messageBox
.
addButton
(
tr
(
"No"
),
QMessageBox
::
NoRole
);
messageBox
.
setIcon
(
QMessageBox
::
Question
);
messageBox
.
exec
();
#ifdef Q_WS_X11
// to avoid to be handled by x11. This allows us to keep to the back all the windows manager stuff like palette, toolbar ...
messageBox
.
setWindowFlags
(
Qt
::
Dialog
|
Qt
::
X11BypassWindowManagerHint
);
//To calculate the correct size
messageBox
.
show
();
QSize
messageBoxSize
=
messageBox
.
size
();
//to center on the screen because it's no more handled by X11
QRect
controlScreenRect
=
UBApplication
::
applicationController
->
displayManager
()
->
controlGeometry
();
messageBox
.
move
((
controlScreenRect
.
width
()
/
2
)
-
(
messageBoxSize
.
width
()
*
0.5
),
(
controlScreenRect
.
height
()
/
2
)
-
(
messageBoxSize
.
height
()
*
0.5
));
#else
messageBox
.
setWindowFlags
(
Qt
::
Dialog
);
#endif
messageBox
.
exec
();
return
messageBox
.
clickedButton
()
==
yesButton
;
}
...
...
Write
Preview
Markdown
is supported
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