projects
/
dorian
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
64fef28
)
Even more Symbian improvements. Work around softkey visibility bug.
author
Akos Polster
<akos@pipacs.com>
Mon, 13 Jun 2011 13:56:18 +0000
(15:56 +0200)
committer
Akos Polster
<akos@pipacs.com>
Mon, 13 Jun 2011 13:56:18 +0000
(15:56 +0200)
adopterwindow.cpp
patch
|
blob
|
history
adopterwindow.h
patch
|
blob
|
history
fullscreenwindow.cpp
patch
|
blob
|
history
fullscreenwindow.h
patch
|
blob
|
history
mainwindow.cpp
patch
|
blob
|
history
mainwindow.h
patch
|
blob
|
history
model/book.cpp
patch
|
blob
|
history
diff --git
a/adopterwindow.cpp
b/adopterwindow.cpp
index
a1f369b
..
7ec642d
100644
(file)
--- a/
adopterwindow.cpp
+++ b/
adopterwindow.cpp
@@
-172,7
+172,8
@@
void AdopterWindow::leaveEvent(QEvent *event)
void AdopterWindow::keyPressEvent(QKeyEvent *event)
{
void AdopterWindow::keyPressEvent(QKeyEvent *event)
{
- TRACE;
+ Trace t("AdopterWindow::keyPressEvent");
+
switch (event->key()) {
case Qt::Key_PageDown:
#ifdef Q_WS_MAEMO_5
switch (event->key()) {
case Qt::Key_PageDown:
#ifdef Q_WS_MAEMO_5
diff --git
a/adopterwindow.h
b/adopterwindow.h
index
7420d2c
..
26c08cb
100644
(file)
--- a/
adopterwindow.h
+++ b/
adopterwindow.h
@@
-12,7
+12,7
@@
class TranslucentButton;
/**
* A toplevel window that can adopt a BookView and other children.
/**
* A toplevel window that can adopt a BookView and other children.
- * On Maemo, it can also grab the volume keys.
+ * On some platforms, it can also grab the volume keys.
*/
class AdopterWindow: public MainBase
{
*/
class AdopterWindow: public MainBase
{
@@
-51,14
+51,15
@@
protected:
/**
* Handle show events.
/**
* Handle show events.
- * On Symbian, volume keys can only be grabbed, if the window is shown.
+ * On Symbian, volume keys can only be grabbed, when the window is shown.
+ * So we do it from here.
*/
void showEvent(QShowEvent *event);
/** Handle resize event: Restore reading position. */
void resizeEvent(QResizeEvent *event);
*/
void showEvent(QShowEvent *event);
/** Handle resize event: Restore reading position. */
void resizeEvent(QResizeEvent *event);
- /** Handle close event. */
+ /** Handle close event: Save reading position. */
void closeEvent(QCloseEvent *event);
/** Handle leave event: Save reading position. */
void closeEvent(QCloseEvent *event);
/** Handle leave event: Save reading position. */
diff --git
a/fullscreenwindow.cpp
b/fullscreenwindow.cpp
index
1ffbd7b
..
27ac731
100644
(file)
--- a/
fullscreenwindow.cpp
+++ b/
fullscreenwindow.cpp
@@
-35,15
+35,23
@@
FullScreenWindow::FullScreenWindow(QWidget *parent): AdopterWindow(parent)
void FullScreenWindow::showEvent(QShowEvent *e)
{
Trace t("FullScreenWindow::showEvent");
void FullScreenWindow::showEvent(QShowEvent *e)
{
Trace t("FullScreenWindow::showEvent");
- AdopterWindow::showEvent(e);
+ qDebug() << "Softkeys visible?"
+ << (windowFlags() & Qt::WindowSoftkeysVisibleHint);
placeChildren();
placeChildren();
+ AdopterWindow::showEvent(e);
}
void FullScreenWindow::resizeEvent(QResizeEvent *e)
{
Trace t("FullScreenWindow::resizeEvent");
}
void FullScreenWindow::resizeEvent(QResizeEvent *e)
{
Trace t("FullScreenWindow::resizeEvent");
- AdopterWindow::resizeEvent(e);
placeChildren();
placeChildren();
+ AdopterWindow::resizeEvent(e);
+}
+
+void FullScreenWindow::closeEvent(QCloseEvent *e)
+{
+ Trace t("FullscreenWindow::closeEvent");
+ AdopterWindow::closeEvent(e);
}
void FullScreenWindow::placeChildren()
}
void FullScreenWindow::placeChildren()
diff --git
a/fullscreenwindow.h
b/fullscreenwindow.h
index
d91408c
..
0a84e54
100644
(file)
--- a/
fullscreenwindow.h
+++ b/
fullscreenwindow.h
@@
-18,7
+18,7
@@
class FullScreenWindow: public AdopterWindow
Q_OBJECT
public:
Q_OBJECT
public:
- explicit FullScreenWindow(QWidget *parent);
+ explicit FullScreenWindow(QWidget *parent = 0);
/**
* Adopt children.
/**
* Adopt children.
@@
-39,6
+39,9
@@
protected:
/** Handle show event. */
void showEvent(QShowEvent *e);
/** Handle show event. */
void showEvent(QShowEvent *e);
+ /** Handle close event. */
+ void closeEvent(QCloseEvent *e);
+
protected slots:
/** Re-align adopted child windows. */
void placeChildren();
protected slots:
/** Re-align adopted child windows. */
void placeChildren();
diff --git
a/mainwindow.cpp
b/mainwindow.cpp
index
82fde67
..
8694cd2
100755
(executable)
--- a/
mainwindow.cpp
+++ b/
mainwindow.cpp
@@
-43,10
+43,6
@@
MainWindow::MainWindow(QWidget *parent):
setAttribute(Qt::WA_Maemo5StackedWindow, true);
#endif
setAttribute(Qt::WA_Maemo5StackedWindow, true);
#endif
-#ifndef Q_OS_SYMBIAN
- setWindowTitle("Dorian");
-#endif
-
// Central widget. Must be an intermediate, because the book view widget
// might be re-parented later
QFrame *central = new QFrame(this);
// Central widget. Must be an intermediate, because the book view widget
// might be re-parented later
QFrame *central = new QFrame(this);
@@
-122,7
+118,7
@@
MainWindow::MainWindow(QWidget *parent):
connect(view, SIGNAL(progress(qreal)), prog, SLOT(setProgress(qreal)));
// Shadow window for full screen reading
connect(view, SIGNAL(progress(qreal)), prog, SLOT(setProgress(qreal)));
// Shadow window for full screen reading
- fullScreenWindow = new FullScreenWindow(this);
+ fullScreenWindow = new FullScreenWindow();
connect(fullScreenWindow, SIGNAL(restore()), this, SLOT(showRegular()));
// Handle settings changes
connect(fullScreenWindow, SIGNAL(restore()), this, SLOT(showRegular()));
// Handle settings changes
@@
-138,6
+134,11
@@
MainWindow::MainWindow(QWidget *parent):
#endif
}
#endif
}
+MainWindow::~MainWindow()
+{
+ delete fullScreenWindow;
+}
+
void MainWindow::initialize()
{
TRACE;
void MainWindow::initialize()
{
TRACE;
@@
-199,7
+200,7
@@
void MainWindow::showBig()
leaveBookView();
fullScreenWindow->takeBookView(view, prog, prev, next);
leaveBookView();
fullScreenWindow->takeBookView(view, prog, prev, next);
-#ifdef Q_WS_MAEMO_5
+#if defined(Q_WS_MAEMO_5)
fullScreenWindow->raise();
#else
hide();
fullScreenWindow->raise();
#else
hide();
diff --git
a/mainwindow.h
b/mainwindow.h
index
1f50c41
..
c33f33b
100755
(executable)
--- a/
mainwindow.h
+++ b/
mainwindow.h
@@
-22,6
+22,7
@@
class MainWindow: public AdopterWindow
public:
MainWindow(QWidget *parent = 0);
public:
MainWindow(QWidget *parent = 0);
+ ~MainWindow();
void initialize();
public slots:
void initialize();
public slots:
diff --git
a/model/book.cpp
b/model/book.cpp
index
7516665
..
ca6f912
100644
(file)
--- a/
model/book.cpp
+++ b/
model/book.cpp
@@
-82,7
+82,7
@@
void Book::peek()
void Book::close()
{
void Book::close()
{
- TRACE;
+ Trace t("Book::close");
content.clear();
parts.clear();
QDir::setCurrent(QDir::rootPath());
content.clear();
parts.clear();
QDir::setCurrent(QDir::rootPath());