1 // checksum 0xfd0b version 0x20001
3 This file was generated by the Mobile Qt Application wizard of Qt Creator.
4 MainWindow is a convenience class containing mobile device specific code
5 such as screen orientation handling.
6 It is recommended not to modify this file, since newer versions of Qt Creator
7 may offer an updated version of it.
10 #include "mainwindow.h"
11 #include "ui_mainwindow.h"
13 #include "setupdialog.h"
16 #include <QGraphicsRectItem>
17 #include <QGraphicsEllipseItem>
19 #include <QCoreApplication>
21 #if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
26 #endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
28 MainWindow::MainWindow(QWidget *parent)
29 : QMainWindow(parent), m_ui(new Ui::MainWindow)
32 m_xbmc = new Xbmc(this);
35 MainWindow::~MainWindow()
41 void MainWindow::setOrientation(ScreenOrientation orientation)
44 if (orientation != ScreenOrientationAuto) {
45 #if defined(ORIENTATIONLOCK)
46 const CAknAppUiBase::TAppUiOrientation uiOrientation =
47 (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
48 : CAknAppUi::EAppUiOrientationLandscape;
49 CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
52 appUi->SetOrientationL(uiOrientation);
55 #else // ORIENTATIONLOCK
56 qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
57 #endif // ORIENTATIONLOCK
59 #elif defined(Q_WS_MAEMO_5)
60 Qt::WidgetAttribute attribute;
61 switch (orientation) {
62 case ScreenOrientationLockPortrait:
63 attribute = Qt::WA_Maemo5PortraitOrientation;
65 case ScreenOrientationLockLandscape:
66 attribute = Qt::WA_Maemo5LandscapeOrientation;
68 case ScreenOrientationAuto:
70 attribute = Qt::WA_Maemo5AutoOrientation;
73 setAttribute(attribute, true);
75 Q_UNUSED(orientation);
76 #endif // Q_OS_SYMBIAN
79 void MainWindow::showExpanded()
83 #elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
90 void MainWindow::on_actionSetup_triggered()
94 if(dialog.exec() == QDialog::Accepted) {
99 void MainWindow::on_rightBtn_clicked()
101 m_xbmc->actionRight();
104 void MainWindow::on_leftBtn_clicked()
106 m_xbmc->actionLeft();
109 void MainWindow::on_upBtn_clicked()
114 void MainWindow::on_downBtn_clicked()
116 m_xbmc->actionDown();
119 void MainWindow::on_playBtn_clicked()
121 m_xbmc->actionPlay();
124 void MainWindow::on_muteBtn_clicked()
126 m_xbmc->actionMute();
129 void MainWindow::on_volumeUpBtn_clicked()
131 m_xbmc->actionVolumeUp();
134 void MainWindow::on_volumeDownBtn_clicked()
136 m_xbmc->actionVolumeDown();
139 void MainWindow::on_nextSubtitleBtn_clicked()
141 m_xbmc->actionNextSubtitle();
144 void MainWindow::on_nextLanguageBtn_clicked()
146 m_xbmc->actionNextLanguage();
149 void MainWindow::on_selectButton_clicked()
151 m_xbmc->actionSelect();
154 void MainWindow::on_stopBtn_clicked()
156 m_xbmc->actionStop();