qtinternetradio/ui/src/irsearchchannelsview.cpp
changeset 15 065198191975
parent 14 896e9dbc5f19
child 16 5723da102db1
equal deleted inserted replaced
14:896e9dbc5f19 15:065198191975
    49         iChannelModel(NULL),iPreset(NULL),iLogoPreset(NULL),
    49         iChannelModel(NULL),iPreset(NULL),iLogoPreset(NULL),
    50         iConvertTimer(NULL) 
    50         iConvertTimer(NULL) 
    51 {
    51 {
    52     LOG_METHOD;
    52     LOG_METHOD;
    53     iSettings = IRQSettings::openInstance();    
    53     iSettings = IRQSettings::openInstance();    
    54     //if this view is not starting view, finish all initialization in constructor
    54     loadLayout();
    55     if (getViewManager()->views().count() > 0)
    55     connectWidget();  
    56     {
    56     switch2InitState();       
    57         if (!initCompleted())
    57     initMenu();        
    58         {            
    58     initTimer();
    59             normalInit();             
       
    60         }
       
    61     }
       
    62 }
       
    63 
       
    64 void IRSearchChannelsView::lazyInit()
       
    65 {
       
    66     LOG_METHOD;
       
    67     if (!initCompleted())
       
    68     {
       
    69         normalInit();                     
       
    70     }        
       
    71 }
       
    72 
       
    73 void IRSearchChannelsView::normalInit()
       
    74 {
       
    75     LOG_METHOD;
       
    76     if (!initCompleted())
       
    77     { 
       
    78         IRBaseView::lazyInit();
       
    79         loadLayout();
       
    80         connectWidget();  
       
    81         switch2InitState();       
       
    82         initMenu();        
       
    83         initTimer();
       
    84         setInitCompleted(true);
       
    85     }
       
    86 }
    59 }
    87 
    60 
    88 void IRSearchChannelsView::initMenu()
    61 void IRSearchChannelsView::initMenu()
    89 {
    62 {
    90     LOG_METHOD;
    63     LOG_METHOD;
   538     switch (aCommand)
   511     switch (aCommand)
   539     {   
   512     {   
   540     case EIR_ViewCommand_ACTIVATED:         
   513     case EIR_ViewCommand_ACTIVATED:         
   541         iIconIndexArray.clear();        
   514         iIconIndexArray.clear();        
   542         iListView->clearFocus();
   515         iListView->clearFocus();
       
   516         iSearchPanelWidget->setFocusDelegation(FocusDelegationFirstChild);  
   543         iSearchPanelWidget->setFocus();        
   517         iSearchPanelWidget->setFocus();        
       
   518         if( (0 == iChannelModel->rowCount()) 
       
   519             && iKeyText.isEmpty() )
       
   520         {
       
   521             showVkb();
       
   522         }
   544         connectIsdsClient();
   523         connectIsdsClient();
   545         break;
   524         break;
   546         
   525         
   547     case EIR_ViewCommand_DEACTIVATE:     
   526     case EIR_ViewCommand_DEACTIVATE:     
   548         disconnectIsdsClient();
   527         disconnectIsdsClient();
   567         hideVkb();
   546         hideVkb();
   568     }
   547     }
   569   
   548   
   570     return false;
   549     return false;
   571 }
   550 }
       
   551 
       
   552 void IRSearchChannelsView::showVkb()
       
   553 {
       
   554     QInputContext *ic = qApp->inputContext(); 
       
   555     if (ic)
       
   556     {
       
   557         QEvent *event = new QEvent(QEvent::RequestSoftwareInputPanel);
       
   558         ic->filterEvent(event);
       
   559         delete event;
       
   560     }
       
   561 }
       
   562 
   572 void IRSearchChannelsView::hideVkb()
   563 void IRSearchChannelsView::hideVkb()
   573 {
   564 {
   574     QInputContext *ic = qApp->inputContext(); 
   565     QInputContext *ic = qApp->inputContext(); 
   575     if (ic)
   566     if (ic)
   576     {
   567     {