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 <QCoreApplication>
18 #if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
23 #endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
25 MainWindow::MainWindow(QWidget *parent)
26 : QMainWindow(parent), m_ui(new Ui::MainWindow)
29 m_xbmc = new Xbmc(this);
32 MainWindow::~MainWindow()
38 void MainWindow::setOrientation(ScreenOrientation orientation)
41 if (orientation != ScreenOrientationAuto) {
42 #if defined(ORIENTATIONLOCK)
43 const CAknAppUiBase::TAppUiOrientation uiOrientation =
44 (orientation == ScreenOrientationLockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
45 : CAknAppUi::EAppUiOrientationLandscape;
46 CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
49 appUi->SetOrientationL(uiOrientation);
52 #else // ORIENTATIONLOCK
53 qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
54 #endif // ORIENTATIONLOCK
56 #elif defined(Q_WS_MAEMO_5)
57 Qt::WidgetAttribute attribute;
58 switch (orientation) {
59 case ScreenOrientationLockPortrait:
60 attribute = Qt::WA_Maemo5PortraitOrientation;
62 case ScreenOrientationLockLandscape:
63 attribute = Qt::WA_Maemo5LandscapeOrientation;
65 case ScreenOrientationAuto:
67 attribute = Qt::WA_Maemo5AutoOrientation;
70 setAttribute(attribute, true);
72 Q_UNUSED(orientation);
73 #endif // Q_OS_SYMBIAN
76 void MainWindow::showExpanded()
80 #elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
87 void MainWindow::on_actionSetup_triggered()
91 if(dialog.exec() == QDialog::Accepted) {
96 void MainWindow::on_rightBtn_clicked()
98 m_xbmc->actionRight();
101 void MainWindow::on_leftBtn_clicked()
103 m_xbmc->actionLeft();
106 void MainWindow::on_upBtn_clicked()
111 void MainWindow::on_downBtn_clicked()
113 m_xbmc->actionDown();
116 void MainWindow::on_playBtn_clicked()
118 m_xbmc->actionPlay();
121 void MainWindow::on_muteBtn_clicked()
123 m_xbmc->actionMute();
126 void MainWindow::on_parentDirBtn_clicked()
128 m_xbmc->actionParentDir();
131 void MainWindow::on_volumeUpBtn_clicked()
133 m_xbmc->actionVolumeUp();
136 void MainWindow::on_volumeDownBtn_clicked()
138 m_xbmc->actionVolumeDown();
141 void MainWindow::on_nextSubtitleBtn_clicked()
143 m_xbmc->actionNextSubtitle();
146 void MainWindow::on_nextLanguageBtn_clicked()
148 m_xbmc->actionNextLanguage();
151 void MainWindow::on_selectButton_clicked()
153 m_xbmc->actionSelect();
156 void MainWindow::on_stopBtn_clicked()
158 m_xbmc->actionStop();