X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=mainwindow.cpp;h=4860d41646b35c8ea585a0a475bd23af1a00a284;hb=707b1e5f9b76acbcb6b085d0c129763093b6d52a;hp=e20bf84dbcac886969aef52efa467770fffa5c09;hpb=4f302c4427507fec544f32b9003035e93f32b2e2;p=dorian diff --git a/mainwindow.cpp b/mainwindow.cpp index e20bf84..4860d41 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -60,42 +60,41 @@ MainWindow::MainWindow(QWidget *parent): // Tool bar actions -#ifdef Q_OS_SYMBIAN - fullScreenAction = addToolBarAction(this, SLOT(showBig()), - "view-fullscreen", tr("Full screen")); -#endif - chaptersAction = addToolBarAction(this, SLOT(showChapters()), "chapters", tr("Chapters"), true); bookmarksAction = addToolBarAction(this, SLOT(showBookmarks()), "bookmarks", tr("Bookmarks"), true); - infoAction = addToolBarAction(this, SLOT(showInfo()), - "info", tr("Book info"), true); libraryAction = addToolBarAction(this, SLOT(showLibrary()), - "library", tr("Library"), true); + "library", tr("Library"), false); #ifdef Q_WS_MAEMO_5 settingsAction = menuBar()->addAction(tr("Settings")); connect(settingsAction, SIGNAL(triggered()), this, SLOT(showSettings())); devToolsAction = menuBar()->addAction(tr("Developer")); connect(devToolsAction, SIGNAL(triggered()), this, SLOT(showDevTools())); - QAction *aboutAction = menuBar()->addAction(tr("About")); - connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); #else settingsAction = addToolBarAction(this, SLOT(showSettings()), "preferences-system", tr("Settings")); devToolsAction = addToolBarAction(this, SLOT(showDevTools()), "developer", tr("Developer")); - addToolBarAction(this, SLOT(about()), "about", tr("About")); -#endif // Q_WS_MAEMO_5 +#endif -#ifndef Q_OS_SYMBIAN - addToolBarSpace(); + rotateAction = addToolBarAction(this, SLOT(rotate()), + "rotate", tr("Rotate"), true); + // addToolBarSpace(); fullScreenAction = addToolBarAction(this, SLOT(showBig()), - "view-fullscreen", tr("Full screen")); + "view-fullscreen", tr("Full screen"), true); + +#if defined(Q_WS_MAEMO_5) + QAction *aboutAction = menuBar()->addAction(tr("About")); + connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); #else - (void)addToolBarAction(this, SLOT(close()), "", tr("Exit")); -#endif + addToolBarAction(this, SLOT(about()), "about", tr("About")); +#endif // defined(Q_WS_MAEMO_5) + +#if defined(Q_OS_SYMBIAN) + (void)addToolBarAction(this, SLOT(close()), "", tr("Exit"), false); +#endif // defined(Q_OS_SYMBIAN) // Decorations prev = new TranslucentButton("back", this); @@ -229,12 +228,12 @@ void MainWindow::showSettings() (new SettingsWindow(this))->show(); } -void MainWindow::showInfo() +void MainWindow::rotate() { - if (mCurrent.isValid()) { - (new InfoDialog(Library::instance()->book(mCurrent), this, false))-> - exec(); - } + QString current = Settings::instance()->value("orientation", + Platform::instance()->defaultOrientation()).toString(); + QString target = (current == "landscape")? "portrait": "landscape"; + Settings::instance()->setValue("orientation", target); } void MainWindow::showDevTools() @@ -364,11 +363,13 @@ void MainWindow::about() label->setTextFormat(Qt::RichText); label->setOpenExternalLinks(true); label->setWordWrap(true); - label->setText(tr("Dorian %1

Copyright © 2010 " - "Akos Polster <akos@pipacs.com>
" - "Licensed under GNU General Public License, Version 3
" - "Source code:
" - "dorian.garage.maemo.org").arg(version)); + label->setText(tr("Dorian %1

" + "Copyright © 2010-2011 by " + "Akos Polster <akos@pipacs.com>

" + "Licensed under GNU General Public License, Version 3

" + "" + "dorian.garage.maemo.org

" + ).arg(version)); aboutDialog->addWidget(label); aboutDialog->addStretch(); aboutDialog->show();