Began refactoring settings handling.
[vlc-remote] / playermainwindow.cpp
index 1157c66..c77bd56 100644 (file)
@@ -84,6 +84,8 @@
       connect(mTimer,SIGNAL(timeout()),this,SLOT(askStatus()));
       connect(ui->actionConfiguration,SIGNAL(triggered()),this,SLOT(showConfig()));
       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->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);
+    #endif
+    
+      
+  }
+
+  void PlayerMainWindow::setLandscape()
+  {
+      #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+      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
+  }
+
   void PlayerMainWindow::orientationChanged() {
       QRect screenGeometry = QApplication::desktop()->screenGeometry();
       mIsLandscape = (screenGeometry.width() > screenGeometry.height());
           //   rebuild display layout
           //   retrieve album art
           mHasImage = false;
-          mPlayListMainWindow->requestPlayList();
+          QTimer::singleShot(500, mPlayListMainWindow, SLOT(requestPlayList()));
       }
       // Update the buttons on the playlist window
       if (NULL != this->mPlayListMainWindow) {
   void PlayerMainWindow::setCoverArtFromPixmap(QPixmap image) {
     mHasImage = true;
     ui->labelArtLandscape->setPixmap(image.scaledToHeight(120, Qt::SmoothTransformation));
-    ui->labelArtPortrait->setPixmap(image.scaledToHeight(310, Qt::SmoothTransformation));
+    ui->labelArtPortrait->setPixmap(image.scaledToHeight(320, Qt::SmoothTransformation));
     if (mIsLandscape) {
         ui->labelArtPortrait->setVisible(false);
         ui->labelArtLandscape->setVisible(true);