projects
/
easylist
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7204d96
)
Now starting with keyboard opened won't overwrite the QSettings. It will only start...
author
Willem Liu
<willem.liu@gmail.com>
Tue, 14 Sep 2010 16:04:01 +0000
(18:04 +0200)
committer
Willem Liu
<willem.liu@gmail.com>
Tue, 14 Sep 2010 16:04:01 +0000
(18:04 +0200)
src/mainwindow.cpp
patch
|
blob
|
history
diff --git
a/src/mainwindow.cpp
b/src/mainwindow.cpp
index
ebec627
..
991fefa
100755
(executable)
--- a/
src/mainwindow.cpp
+++ b/
src/mainwindow.cpp
@@
-54,12
+54,16
@@
MainWindow::MainWindow(QWidget *parent) :
landscape = settings->value("Landscape").toBool();
\r
}
\r
settings->setValue("Landscape", landscape);
\r
landscape = settings->value("Landscape").toBool();
\r
}
\r
settings->setValue("Landscape", landscape);
\r
- // If keyboard is opened at start.
\r
+ // If keyboard is opened at start. We do landscape mode.
\r
+ // Otherwise we do what's read from the QSettings.
\r
if(isKeyboardClosed() == false)
\r
{
\r
if(isKeyboardClosed() == false)
\r
{
\r
- landscape = true;
\r
+ setLandscapeMode(true);
\r
+ }
\r
+ else
\r
+ {
\r
+ setLandscapeMode(landscape);
\r
}
\r
}
\r
- setLandscapeMode(landscape);
\r
// Auto-detect portrait/landscape mode. Only works on top widget.
\r
// setAttribute(Qt::WA_Maemo5AutoOrientation, true);
\r
showListWindow();
\r
// Auto-detect portrait/landscape mode. Only works on top widget.
\r
// setAttribute(Qt::WA_Maemo5AutoOrientation, true);
\r
showListWindow();
\r
@@
-97,7
+101,7
@@
bool MainWindow::isKeyboardClosed()
void MainWindow::slotKeyboardSlide()
\r
{
\r
// When keyboard is opened.
\r
void MainWindow::slotKeyboardSlide()
\r
{
\r
// When keyboard is opened.
\r
- if(false == isKeyboardClosed())
\r
+ if(isKeyboardClosed() == false)
\r
{
\r
setLandscapeMode(true);
\r
}
\r
{
\r
setLandscapeMode(true);
\r
}
\r
@@
-251,11
+255,13
@@
void MainWindow::setLandscapeMode(bool landscape)
{
\r
if(landscape)
\r
{
\r
{
\r
if(landscape)
\r
{
\r
+ qDebug() << "Landscape";
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, false);
\r
}
\r
else
\r
{
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, false);
\r
}
\r
else
\r
{
\r
+ qDebug() << "Portrait";
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, false);
\r
}
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, false);
\r
}
\r