locationpickerservice/src/locationpickerappwindow.cpp
changeset 30 96df3ab41000
parent 20 cd10d5b85554
child 31 8db05346071b
equal deleted inserted replaced
26:f3533f6eae3f 30:96df3ab41000
    78         locationPickerWidget = mLocationPickerDocumentLoader->findWidget("LocationPickerLandscapeView");
    78         locationPickerWidget = mLocationPickerDocumentLoader->findWidget("LocationPickerLandscapeView");
    79         Q_ASSERT_X((locationPickerWidget != 0), "locationpickerservice", "invalid DocML file");
    79         Q_ASSERT_X((locationPickerWidget != 0), "locationpickerservice", "invalid DocML file");
    80         mLocationPickerLandscapeView = qobject_cast<LocationPickerLandscapeView*>(locationPickerWidget);
    80         mLocationPickerLandscapeView = qobject_cast<LocationPickerLandscapeView*>(locationPickerWidget);
    81         mLocationPickerContent->populateModel(Qt::Horizontal);
    81         mLocationPickerContent->populateModel(Qt::Horizontal);
    82         //initialize widgets and connect to respective signals 
    82         //initialize widgets and connect to respective signals 
    83         mLocationPickerLandscapeView->init(Qt::Horizontal, mLocationPickerContent->getStandardGridModel());
    83         mLocationPickerLandscapeView->init(Qt::Horizontal, mLocationPickerContent->getStandardModel());
    84         connectLandscapeSlots();
    84         connectLandscapeSlots();
    85         addView(mLocationPickerLandscapeView);
    85         addView(mLocationPickerLandscapeView);
    86         //connect to orientationChanged signal
    86         //connect to orientationChanged signal
    87         connect(this, SIGNAL(orientationChanged(Qt::Orientation)),this, SLOT(changeOrientation(Qt::Orientation)));
    87    	    connect(this, SIGNAL(orientationChanged(Qt::Orientation)),this, SLOT(changeOrientation(Qt::Orientation)));
    88         //launch the view in current orientation
    88         //launch the view in current orientation
    89         changeOrientation(this->orientation());
    89         changeOrientation(this->orientation());
    90     }
    90     }
    91 }
    91 }
    92 
    92 
   145         addView(mLocationPickerSearchView);
   145         addView(mLocationPickerSearchView);
   146     }
   146     }
   147     //set LocationPickerSearchview as current view
   147     //set LocationPickerSearchview as current view
   148     setCurrentView(mLocationPickerSearchView);
   148     setCurrentView(mLocationPickerSearchView);
   149     mviewType = ELocationPickerSearchView;
   149     mviewType = ELocationPickerSearchView;
   150 
       
   151 }
   150 }
   152 
   151 
   153 // ----------------------------------------------------------------------------
   152 // ----------------------------------------------------------------------------
   154 // LocationPickerAppWindow::activateLocationPickerView()
   153 // LocationPickerAppWindow::activateLocationPickerView()
   155 // ----------------------------------------------------------------------------
   154 // ----------------------------------------------------------------------------
   158     mviewType = ELocationPickerContent;
   157     mviewType = ELocationPickerContent;
   159     //check the orientation and load view accordingly 
   158     //check the orientation and load view accordingly 
   160     if(this->orientation() == Qt::Horizontal)
   159     if(this->orientation() == Qt::Horizontal)
   161     {
   160     {
   162         mLocationPickerLandscapeView->setViewType( ELocationPickerContent );
   161         mLocationPickerLandscapeView->setViewType( ELocationPickerContent );
   163         mLocationPickerLandscapeView->manageGridView();
   162         mLocationPickerLandscapeView->manageHgWidget();
   164         setCurrentView(mLocationPickerLandscapeView);
   163         setCurrentView(mLocationPickerLandscapeView);
   165     }
   164     }
   166     else
   165     else
   167     { 
   166     { 
   168         mLocationPickerPotraitView->setViewType( ELocationPickerContent );
   167         mLocationPickerPotraitView->setViewType( ELocationPickerContent );
   214          //load landscape view in current potrait content
   213          //load landscape view in current potrait content
   215          mLocationPickerLandscapeView->setViewType( mLocationPickerPotraitView->getViewType() );
   214          mLocationPickerLandscapeView->setViewType( mLocationPickerPotraitView->getViewType() );
   216          //load landscape for all content except collectionlistcontent
   215          //load landscape for all content except collectionlistcontent
   217     	 if(mLocationPickerPotraitView->getViewType() != ELocationPickerCollectionListContent)
   216     	 if(mLocationPickerPotraitView->getViewType() != ELocationPickerCollectionListContent)
   218     	 {
   217     	 {
   219              mLocationPickerLandscapeView->manageGridView();
   218              mLocationPickerLandscapeView->manageHgWidget();
   220     		 setCurrentView(mLocationPickerLandscapeView);
   219     		 setCurrentView(mLocationPickerLandscapeView);
   221 		 }
   220 		 }
   222 	 }
   221 	 }
   223 }
   222 }
   224 
   223 
   287 // ----------------------------------------------------------------------------
   286 // ----------------------------------------------------------------------------
   288 void LocationPickerAppWindow::allListHandle()
   287 void LocationPickerAppWindow::allListHandle()
   289 {
   288 {
   290     //all list after collection list in horizontal orientation
   289     //all list after collection list in horizontal orientation
   291     mLocationPickerLandscapeView->setViewType( ELocationPickerContent );
   290     mLocationPickerLandscapeView->setViewType( ELocationPickerContent );
   292     mLocationPickerLandscapeView->manageGridView();
   291     mLocationPickerLandscapeView->manageHgWidget();
   293     setCurrentView(mLocationPickerLandscapeView);
   292     setCurrentView(mLocationPickerLandscapeView);
   294 }
   293 }
   295 
   294 
   296 // ----------------------------------------------------------------------------
   295 // ----------------------------------------------------------------------------
   297 // LocationPickerAppWindow::clearContentModels()
   296 // LocationPickerAppWindow::clearContentModels()