qtinternetradio/ui/src/irtermsconsview.cpp
changeset 5 0930554dc389
parent 3 ee64f059b8e1
child 15 065198191975
equal deleted inserted replaced
3:ee64f059b8e1 5:0930554dc389
    18 #include <hbpushbutton.h>
    18 #include <hbpushbutton.h>
    19 
    19 
    20 #include "irtermsconsview.h"
    20 #include "irtermsconsview.h"
    21 #include "irapplication.h"
    21 #include "irapplication.h"
    22 #include "iruidefines.h"
    22 #include "iruidefines.h"
       
    23 #include "irviewmanager.h"
    23 
    24 
    24 IRTermsConsView::IRTermsConsView(IRApplication* aApplication, TIRViewId aViewId) 
    25 IRTermsConsView::IRTermsConsView(IRApplication* aApplication, TIRViewId aViewId) 
    25     : IRBaseView(aApplication, aViewId)
    26     : IRBaseView(aApplication, aViewId)
    26 
    27 
    27 {
    28 {
    41     QObjectList roots;
    42     QObjectList roots;
    42     roots.append(this);
    43     roots.append(this);
    43     iLoader.setObjectTree(roots);
    44     iLoader.setObjectTree(roots);
    44     iLoader.load(TERMS_CONS_VIEW_LAYOUT_FILENAME);        
    45     iLoader.load(TERMS_CONS_VIEW_LAYOUT_FILENAME);        
    45     
    46     
    46     HbPushButton *acceptButton = qobject_cast<HbPushButton *>(iLoader.findObject("accept_btn"));
    47 	// load correct orientation
    47     HbPushButton *denyButton = qobject_cast<HbPushButton *>(iLoader.findObject("deny_btn"));
    48     connect( getViewManager(), SIGNAL( orientationChanged(Qt::Orientation) ),
       
    49              this, SLOT( handleOrientationChanged(Qt::Orientation) ) );
       
    50 	handleOrientationChanged(getViewManager()->orientation());
       
    51 	        
       
    52     HbPushButton *acceptButton = qobject_cast<HbPushButton *>(iLoader.findObject(TERMS_CONS_VIEW_ACCEPT_BTN));
       
    53     HbPushButton *declineButton = qobject_cast<HbPushButton *>(iLoader.findObject(TERMS_CONS_VIEW_DECLINE_BTN));
    48     
    54     
    49     connect( acceptButton, SIGNAL(released()),
    55     connect( acceptButton, SIGNAL(released()),
    50              iApplication, SLOT(handleTermsConsAccepted()) );    
    56              iApplication, SLOT(handleTermsConsAccepted()) );    
    51     connect( denyButton, SIGNAL(released()),
    57     connect( declineButton, SIGNAL(released()),
    52              iApplication, SIGNAL(quit()) );      
    58              iApplication, SIGNAL(quit()) );      
    53 }
    59 }
    54 
    60 
    55 
    61 void IRTermsConsView::handleOrientationChanged(Qt::Orientation aOrientation)
       
    62 {
       
    63     if (aOrientation == Qt::Vertical)
       
    64     {
       
    65         iLoader.load(TERMS_CONS_VIEW_LAYOUT_FILENAME, PORTRAIT_SEC);
       
    66     }
       
    67     else
       
    68     {
       
    69         iLoader.load(TERMS_CONS_VIEW_LAYOUT_FILENAME, LANDSCAPE_SEC);
       
    70     }
       
    71 }