QList<VlcDirectory>* AppSettings::getFavourites() { return new QList<VlcDirectory>(); }
bool AppSettings::addFavourite(VlcDirectory dir) { return true; }
bool AppSettings::deleteFavourite(VlcDirectory dir) { return true; }
+Orientation AppSettings::setOrientation(Orientation orientation) {
+ QSettings sets;
+ sets.setValue("config/orientation", (int)orientation);
+ return orientation;
+}
+Orientation AppSettings::getOrientation() {
+ QSettings sets;
+ return (Orientation)(sets.value("config/orientation", AUTO_ROTATE).toInt());
+}
+
mainwindow->showMaximized();
#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
-mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ Orientation o = AppSettings::getOrientation();
+ switch (o) {
+ case AUTO_ROTATE:
+ mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ break;
+ case LANDSCAPE:
+ mainwindow->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
+ break;
+ case PORTRAIT:
+ mainwindow->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+ break;
+ default:
+ mainwindow->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ break;
+ }
#endif
return a.exec();
}
#include "configdialog.h"
#include "aboutdialog.h"
#include "accountdialog.h"
+ #include "appsettings.h"
//#include "vlcstatus.h"
PlayerMainWindow::PlayerMainWindow(QWidget *parent) :
connect(ui->actionAbout,SIGNAL(triggered()),this,SLOT(showAbout()));
connect(ui->actionPortrait,SIGNAL(triggered()),this,SLOT(setPortrait()));
connect(ui->actionLandscape,SIGNAL(triggered()),this,SLOT(setLandscape()));
+ connect(ui->actionAutoRotate,SIGNAL(triggered()),this,SLOT(setAutoRotate()));
connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(show()));
connect(ui->playlistButton,SIGNAL(clicked()),mPlayListMainWindow,SLOT(showPlayList()));
connect(ui->browseButton,SIGNAL(clicked()),mBrowserMainWindow,SLOT(show()));
void PlayerMainWindow::setPortrait()
{
- #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+ #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ AppSettings::setOrientation(PORTRAIT);
+ this->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
#endif
-
-
}
void PlayerMainWindow::setLandscape()
{
- #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
- #endif
+ #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ AppSettings::setOrientation(LANDSCAPE);
+ this->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
+ #endif
}
void PlayerMainWindow::setAutoRotate()
{
#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
- this->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
- #endif
+ AppSettings::setOrientation(AUTO_ROTATE);
+ this->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+ #endif
}
void PlayerMainWindow::orientationChanged() {
<addaction name="actionAbout"/>
<addaction name="actionPortrait"/>
<addaction name="actionLandscape"/>
+ <addaction name="actionAutoRotate"/>
</widget>
<addaction name="menuMenu"/>
</widget>
<string>Landscape Mode</string>
</property>
</action>
+ <action name="actionAutoRotate">
+ <property name="text">
+ <string>Auto Rotate</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>