logsui/logsapp/src/logsbaseview.cpp
changeset 21 2f0af9ba7665
parent 18 acd4e87b24b4
equal deleted inserted replaced
18:acd4e87b24b4 21:2f0af9ba7665
    41 #include <xqservicerequest.h>
    41 #include <xqservicerequest.h>
    42 #include <hblabel.h>
    42 #include <hblabel.h>
    43 #include <hblistview.h>
    43 #include <hblistview.h>
    44 #include <QGraphicsLinearLayout>
    44 #include <QGraphicsLinearLayout>
    45 #include <hbpushbutton.h>
    45 #include <hbpushbutton.h>
    46 #include <hbactivitymanager.h>
    46 #include <afactivitystorage.h>
    47 #include <hbmodeliterator.h>
    47 #include <hbmodeliterator.h>
    48 #include <hbscrollbar.h>
    48 #include <hbscrollbar.h>
    49 #include <hbstringutil.h>
    49 #include <hbstringutil.h>
       
    50 #include <hbtoolbarextension.h>
       
    51 #include <hblistwidget.h>
       
    52 #include <hblistwidgetitem.h>
       
    53 #include <hblistviewitem.h>
       
    54 #include <hbframebackground.h>
       
    55 
    50 
    56 
    51 Q_DECLARE_METATYPE(LogsCall*)
    57 Q_DECLARE_METATYPE(LogsCall*)
    52 Q_DECLARE_METATYPE(LogsMessage*)
    58 Q_DECLARE_METATYPE(LogsMessage*)
    53 Q_DECLARE_METATYPE(LogsContact*)
    59 Q_DECLARE_METATYPE(LogsContact*)
    54 Q_DECLARE_METATYPE(LogsDetailsModel*)
    60 Q_DECLARE_METATYPE(LogsDetailsModel*)
    64     LogsAbstractViewManager& viewManager )
    70     LogsAbstractViewManager& viewManager )
    65     : HbView(0),
    71     : HbView(0),
    66       mViewId( viewId ),
    72       mViewId( viewId ),
    67       mRepository( repository ),
    73       mRepository( repository ),
    68       mViewManager( viewManager ),
    74       mViewManager( viewManager ),
    69       mShowFilterMenu(0),
       
    70       mEmptyListLabel(0),
    75       mEmptyListLabel(0),
    71       mInitialized(false),
    76       mInitialized(false),
    72       mCall(0),
    77       mCall(0),
    73       mMessage(0),
    78       mMessage(0),
    74       mContact(0),
    79       mContact(0),
    75       mDetailsModel(0),
    80       mDetailsModel(0),
    76       mCallTypeMapper(0),
    81       mCallTypeMapper(0),
    77       mOptionsMenu(0),
    82       mOptionsMenu(0),
    78       mActivating(false)
    83       mActivating(false),
       
    84       mShowDialpad(true),
       
    85       mViewSwitchList(0)
    79 {
    86 {
    80     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::LogsBaseView()" );
    87     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::LogsBaseView()" );
    81 
    88 
    82     setNavigationAction(new HbAction(Hb::BackNaviAction, this));
    89     setNavigationAction(new HbAction(Hb::BackNaviAction, this));
    83     connect(navigationAction(), SIGNAL(triggered()), this, 
    90     connect(navigationAction(), SIGNAL(triggered()), this, 
   139 
   146 
   140 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   141 //
   148 //
   142 // -----------------------------------------------------------------------------
   149 // -----------------------------------------------------------------------------
   143 //
   150 //
   144 void LogsBaseView::clearActivity(HbActivityManager& manager)
   151 void LogsBaseView::clearActivity(AfActivityStorage& manager)
   145 {
   152 {
   146     foreach ( const QString& activity, mActivities ){
   153     foreach ( const QString& activity, mActivities ){
   147         manager.removeActivity(activity);
   154         manager.removeActivity(activity);
   148     }
   155     }
   149 }
   156 }
   184 
   191 
   185 // -----------------------------------------------------------------------------
   192 // -----------------------------------------------------------------------------
   186 //
   193 //
   187 // -----------------------------------------------------------------------------
   194 // -----------------------------------------------------------------------------
   188 //
   195 //
   189 void LogsBaseView::activated(bool showDialer, QVariant args)
   196 void LogsBaseView::activated(bool showDialer, QVariant args, const QString& dialpadText)
   190 {
   197 {
   191     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::activated()" );
   198     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::activated()" );
   192     Q_UNUSED(args);
   199     Q_UNUSED(args);
   193     //we have to set object tree of the repository to the current view
   200     //we have to set object tree of the repository to the current view
   194     mRepository.setObjectTreeToView( mViewId );
   201     mRepository.setObjectTreeToView( mViewId );
   205     connect( &mDialpad->editor(), SIGNAL( contentsChanged() ), this,
   212     connect( &mDialpad->editor(), SIGNAL( contentsChanged() ), this,
   206             SLOT( dialpadEditorTextChanged() ) );
   213             SLOT( dialpadEditorTextChanged() ) );
   207 
   214 
   208     if (showDialer && !mDialpad->isOpen()) {
   215     if (showDialer && !mDialpad->isOpen()) {
   209         openDialpad();
   216         openDialpad();
       
   217     }
       
   218     if (!showDialer && mDialpad->isOpen()) {
       
   219         mDialpad->closeDialpad();
       
   220         }
       
   221     
       
   222     if (currDialpadText() != dialpadText){
       
   223         mDialpad->editor().setText(dialpadText);
   210     }
   224     }
   211     
   225     
   212     updateWidgetsSizeAndLayout();
   226     updateWidgetsSizeAndLayout();
   213     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::activated()" );
   227     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::activated()" );
   214 }
   228 }
   246 {
   260 {
   247     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::cancelServiceRequest()" );
   261     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::cancelServiceRequest()" );
   248     if (mContact) {
   262     if (mContact) {
   249         mContact->cancelServiceRequest();
   263         mContact->cancelServiceRequest();
   250     }
   264     }
       
   265     if (mMessage) {
       
   266         mMessage->cancelServiceRequest();
       
   267     }
   251     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::cancelServiceRequest()" );
   268     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::cancelServiceRequest()" );
   252 }
   269 }
   253 
   270 
   254 // -----------------------------------------------------------------------------
   271 // -----------------------------------------------------------------------------
   255 //
   272 //
   268 // -----------------------------------------------------------------------------
   285 // -----------------------------------------------------------------------------
   269 //
   286 //
   270 void LogsBaseView::handleBackSoftkey()
   287 void LogsBaseView::handleBackSoftkey()
   271 {
   288 {
   272     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::handleBackSoftkey()" );
   289     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::handleBackSoftkey()" );
   273     mViewManager.activateView( LogsRecentViewId, false, QVariant() );
   290     mViewManager.activateView( LogsRecentViewId, mShowDialpad,QVariant(), currDialpadText() );
   274     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::handleBackSoftkey()" );
   291     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::handleBackSoftkey()" );
   275 }
   292 }
   276 
   293 
   277 // -----------------------------------------------------------------------------
   294 // -----------------------------------------------------------------------------
   278 //
   295 //
   279 // -----------------------------------------------------------------------------
   296 // -----------------------------------------------------------------------------
   280 //
   297 //
   281 void LogsBaseView::initFilterMenu()
       
   282 {
       
   283     mShowFilterMenu = 
       
   284         qobject_cast<HbMenu*>( mRepository.findWidget( logsShowFilterMenuId ) );
       
   285 }
       
   286 
       
   287 // -----------------------------------------------------------------------------
       
   288 //
       
   289 // -----------------------------------------------------------------------------
       
   290 //
       
   291 void LogsBaseView::addActionNamesToMap()
       
   292 {
       
   293     mActionMap.clear();
       
   294     mActionMap.insert(XQService::LogsViewReceived, logsShowFilterReceivedMenuActionId);
       
   295     mActionMap.insert(XQService::LogsViewCalled, logsShowFilterDialledMenuActionId);
       
   296     mActionMap.insert(XQService::LogsViewMissed, logsShowFilterMissedMenuActionId);
       
   297     mActionMap.insert(XQService::LogsViewAll, logsShowFilterRecentMenuActionId);  
       
   298 }
       
   299 
       
   300 // -----------------------------------------------------------------------------
       
   301 //
       
   302 // -----------------------------------------------------------------------------
       
   303 //
       
   304 void LogsBaseView::initView()
   298 void LogsBaseView::initView()
   305 {   
   299 {
   306     Q_ASSERT_X( !mInitialized, "logs [UI] ", "view is already initialized!!" );
   300     Q_ASSERT_X( !mInitialized, "logs [UI] ", "view is already initialized!!" );
   307     mInitialized = true;
   301     mInitialized = true;
   308     initFilterMenu();
   302 }
   309     addActionNamesToMap();
   303 
       
   304 // -----------------------------------------------------------------------------
       
   305 //
       
   306 // -----------------------------------------------------------------------------
       
   307 //
       
   308 qreal LogsBaseView::populateViewSwitchList(HbListWidget& list)
       
   309 {
       
   310     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::populateViewSwitchList()" );    
       
   311     qreal maxWidth = 0.0;
       
   312     qreal width = 0.0;
       
   313     QFontMetricsF fontMetrics(HbFontSpec(HbFontSpec::Secondary).font());
       
   314     
       
   315     typedef QPair<XQService::LogsViewIndex, QString> QListViewPair;
       
   316     QList<QListViewPair> viewList;
       
   317     viewList.append( QListViewPair(XQService::LogsViewAll, 
       
   318                            hbTrId("txt_dialer_ui_list_recent") ));
       
   319     viewList.append( QListViewPair(XQService::LogsViewCalled, 
       
   320                            hbTrId("txt_dialer_ui_list_dialled") ));
       
   321     viewList.append( QListViewPair(XQService::LogsViewReceived, 
       
   322                            hbTrId("txt_dialer_ui_list_received") ));
       
   323     viewList.append( QListViewPair(XQService::LogsViewMissed, 
       
   324                            hbTrId("txt_dialer_ui_list_missed") ));
       
   325     
       
   326     for (int i=0; i<viewList.count(); i++) {
       
   327         HbListWidgetItem* item = new HbListWidgetItem();
       
   328         item->setText(viewList.at(i).second);
       
   329         item->setData(viewList.at(i).first, Qt::UserRole);
       
   330         list.addItem(item);
       
   331         
       
   332         width = fontMetrics.width(viewList.at(i).second);
       
   333         LOGS_QDEBUG_2( "logs [UI] -> width: ", width );
       
   334         maxWidth = qMax(maxWidth, width);        
       
   335     }
       
   336     LOGS_QDEBUG_2( "logs [UI] -> maxwidth: ", maxWidth );
       
   337     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::populateViewSwitchList()" );
       
   338     return maxWidth;
       
   339 }
       
   340 
       
   341 // -----------------------------------------------------------------------------
       
   342 //
       
   343 // -----------------------------------------------------------------------------
       
   344 //
       
   345 void LogsBaseView::initToolbarExtension()
       
   346 {
       
   347     Q_ASSERT_X( !mViewSwitchList, "logs [UI] ", "toolbar extension is already initialized!!" );
       
   348     bool singleSelection = mViewId == LogsRecentViewId;
       
   349     HbToolBarExtension* toolbarExtention = new HbToolBarExtension();
       
   350     toolbarExtention->setContentsMargins(0.0,0.0,0.0,0.0);
       
   351     
       
   352     mViewSwitchList = new HbListWidget();
       
   353     mViewSwitchList->setObjectName("LogsViewSwitchList");//used in CSS
       
   354     mViewSwitchList->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
       
   355 
       
   356     qreal maxWidth = populateViewSwitchList(*mViewSwitchList);
       
   357     qreal width = 0.0;    
       
   358     qreal shortEdge = 0.0;
       
   359     if (style()->parameter(QString("var(hb-param-screen-short-edge)"),shortEdge)){
       
   360         mViewSwitchList->setMaximumWidth(shortEdge);
       
   361         mViewSwitchList->setMinimumWidth(shortEdge*2.0/3.0);
       
   362     }
       
   363     
       
   364     QString expr;
       
   365     if (singleSelection) {
       
   366         mViewSwitchList->setSelectionMode(HbAbstractItemView::SingleSelection);
       
   367         expr = "expr(var(hb-param-margin-gene-left) + var(hb-param-graphic-size-secondary) ";
       
   368         expr += "+ var(hb-param-margin-gene-middle-horizontal) + var(hb-param-margin-gene-right))";
       
   369     } else {
       
   370         expr = "expr(var(hb-param-margin-gene-left) + var(hb-param-margin-gene-right))";
       
   371     }
       
   372     
       
   373     if (style()->parameter(expr, width)) {
       
   374         LOGS_QDEBUG_2( "logs [UI] -> margins: ", width );
       
   375         width += maxWidth;
       
   376         LOGS_QDEBUG_2( "logs [UI] -> total width: ", width );
       
   377         mViewSwitchList->setPreferredWidth(width);
       
   378     }
       
   379     
       
   380     HbFrameBackground frame("qtg_fr_popup_list_normal", HbFrameDrawer::NinePieces);
       
   381     mViewSwitchList->listItemPrototype()->setDefaultFrame(frame);
       
   382     
       
   383     connect(mViewSwitchList, SIGNAL(activated(HbListWidgetItem*)), 
       
   384             this, SLOT(handleViewSwitchSelected(HbListWidgetItem*)));
       
   385     connect(mViewSwitchList, SIGNAL(activated(HbListWidgetItem*)), 
       
   386             toolbarExtention, SLOT(close()));
       
   387  
       
   388     toolbarExtention->setContentWidget(mViewSwitchList);
       
   389     
       
   390     HbAction* dialerAction = qobject_cast<HbAction*>( 
       
   391                          mRepository.findObject( logsDialerActionId ) );
       
   392     if (dialerAction) {
       
   393         HbAction* extensionAction = toolBar()->insertExtension(dialerAction,toolbarExtention);
       
   394         extensionAction->setIcon(HbIcon("qtg_mono_show_view"));
       
   395     } else {
       
   396         delete toolbarExtention;
       
   397         mViewSwitchList = 0;
       
   398     }
       
   399 }
       
   400 
       
   401 // -----------------------------------------------------------------------------
       
   402 //
       
   403 // -----------------------------------------------------------------------------
       
   404 //
       
   405 void LogsBaseView::handleViewSwitchSelected(HbListWidgetItem* item)
       
   406 {
       
   407     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::handleViewSwitchSelected()" );
       
   408     int viewId = item->data(Qt::UserRole).toInt();
       
   409     QVariant args(viewId);
       
   410     mViewManager.activateView( LogsRecentViewId, false, args );
       
   411     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::handleViewSwitchSelected()" );
   310 }
   412 }
   311 
   413 
   312 // -----------------------------------------------------------------------------
   414 // -----------------------------------------------------------------------------
   313 //
   415 //
   314 // -----------------------------------------------------------------------------
   416 // -----------------------------------------------------------------------------
   382 
   484 
   383 // -----------------------------------------------------------------------------
   485 // -----------------------------------------------------------------------------
   384 //
   486 //
   385 // -----------------------------------------------------------------------------
   487 // -----------------------------------------------------------------------------
   386 //
   488 //
   387 void LogsBaseView::showFilterMenu()
       
   388 {
       
   389     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::showFilterMenu()" );
       
   390     if ( mShowFilterMenu ) {
       
   391         QRectF toolbarGeometry = toolBar()->geometry();
       
   392         QSizeF menuSize = mShowFilterMenu->size();
       
   393         LOGS_QDEBUG_2("logs [UI]    menusize:", menuSize)
       
   394         
       
   395         if ( layoutDirection() == Qt::LeftToRight ){
       
   396             QPointF pos( toolbarGeometry.bottomRight().x(),
       
   397                          toolbarGeometry.topRight().y() ); 
       
   398     
       
   399             mShowFilterMenu->setPreferredPos(pos,HbPopup::BottomRightCorner);
       
   400             LOGS_QDEBUG_2("logs [UI]    menu br pos:", pos)
       
   401         } else {
       
   402             QPointF pos( toolbarGeometry.topLeft().x(),
       
   403                          toolbarGeometry.topLeft().y() ); 
       
   404                
       
   405             mShowFilterMenu->setPreferredPos(pos,HbPopup::BottomLeftCorner);
       
   406             LOGS_QDEBUG_2("logs [UI]    menu bl pos:", pos)
       
   407         }
       
   408         mShowFilterMenu->open();
       
   409     }
       
   410     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::showFilterMenu()" );
       
   411 }
       
   412 
       
   413 // -----------------------------------------------------------------------------
       
   414 //
       
   415 // -----------------------------------------------------------------------------
       
   416 //
       
   417 void LogsBaseView::openDialpad()
   489 void LogsBaseView::openDialpad()
   418 {
   490 {
   419     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::openDialpad()" );
   491     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::openDialpad()" );
   420    
       
   421     updateCallButton();
   492     updateCallButton();
   422     setDialpadPosition();
   493     setDialpadPosition();
   423     mDialpad->openDialpad();
   494     mDialpad->openDialpad();
   424     
       
   425     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::openDialpad()" );
   495     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::openDialpad()" );
   426 }
   496 }
   427 
   497 
   428 // -----------------------------------------------------------------------------
   498 // -----------------------------------------------------------------------------
   429 //
   499 //
   506 
   576 
   507 // -----------------------------------------------------------------------------
   577 // -----------------------------------------------------------------------------
   508 // 
   578 // 
   509 // -----------------------------------------------------------------------------
   579 // -----------------------------------------------------------------------------
   510 //
   580 //
   511 void LogsBaseView::changeFilter(HbAction* action)
       
   512 {
       
   513     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::changeFilter()" );
       
   514     XQService::LogsViewIndex view = mActionMap.key( action->objectName(),
       
   515             XQService::LogsViewAll );
       
   516     QVariant args(view);
       
   517     mViewManager.activateView( LogsRecentViewId, false, args );
       
   518     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::changeFilter()" );
       
   519 }
       
   520 
       
   521 // -----------------------------------------------------------------------------
       
   522 // 
       
   523 // -----------------------------------------------------------------------------
       
   524 //
       
   525 void LogsBaseView::addToContacts()
   581 void LogsBaseView::addToContacts()
   526 {
   582 {
   527     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::addToContacts()" );
   583     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::addToContacts()" );
   528     if ( isDialpadInput() ){
   584     if ( isDialpadInput() ){
   529         saveNumberInDialpadToContacts();
   585         saveNumberInDialpadToContacts();
   543 // -----------------------------------------------------------------------------
   599 // -----------------------------------------------------------------------------
   544 //
   600 //
   545 void LogsBaseView::saveNumberInDialpadToContacts()
   601 void LogsBaseView::saveNumberInDialpadToContacts()
   546 {
   602 {
   547     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::saveNumberInDialpadToContacts()" );
   603     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::saveNumberInDialpadToContacts()" );
   548     if (mDialpad->editor().text().length() > 0){
   604     if (currDialpadText().length() > 0){
   549         delete mContact;
   605         delete mContact;
   550         mContact = 0;
   606         mContact = 0;
   551         QString phoneNumber = 
   607         QString phoneNumber = 
   552             HbStringUtil::convertDigitsTo(mDialpad->editor().text(), WesternDigit);
   608             HbStringUtil::convertDigitsTo(currDialpadText(), WesternDigit);
   553         mContact = logsModel()->createContact(phoneNumber);
   609         mContact = logsModel()->createContact(phoneNumber);
   554         saveContact();
   610         saveContact();
   555     }
   611     }
   556     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::saveNumberInDialpadToContacts()" );
   612     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::saveNumberInDialpadToContacts()" );
   557 }
   613 }
   679 // 
   735 // 
   680 // -----------------------------------------------------------------------------
   736 // -----------------------------------------------------------------------------
   681 //
   737 //
   682 void LogsBaseView::updateCallButton()
   738 void LogsBaseView::updateCallButton()
   683 {
   739 {
   684     mDialpad->setCallButtonEnabled( !mDialpad->editor().text().isEmpty() );
   740     mDialpad->setCallButtonEnabled( !currDialpadText().isEmpty() );
   685 }
   741 }
   686 
   742 
   687 // -----------------------------------------------------------------------------
   743 // -----------------------------------------------------------------------------
   688 //
   744 //
   689 // -----------------------------------------------------------------------------
   745 // -----------------------------------------------------------------------------
   693     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::tryCallToDialpadNumber()" );
   749     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::tryCallToDialpadNumber()" );
   694     bool called = false;
   750     bool called = false;
   695     if ( isDialpadInput() ){
   751     if ( isDialpadInput() ){
   696         // Call to inputted number
   752         // Call to inputted number
   697         QString phoneNumber = 
   753         QString phoneNumber = 
   698             HbStringUtil::convertDigitsTo(mDialpad->editor().text(), WesternDigit);
   754             HbStringUtil::convertDigitsTo(currDialpadText(), WesternDigit);
   699         LogsCall::callToNumber( callType, phoneNumber );
   755         LogsCall::callToNumber( callType, phoneNumber );
   700         called = true;
   756         called = true;
   701     }
   757     }
   702     LOGS_QDEBUG_2( "logs [UI] <- LogsBaseView::tryCallToDialpadNumber(), called",
   758     LOGS_QDEBUG_2( "logs [UI] <- LogsBaseView::tryCallToDialpadNumber(), called",
   703                    called );
   759                    called );
   713     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::tryMessageToDialpadNumber()" );
   769     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::tryMessageToDialpadNumber()" );
   714     bool messageSent = false;
   770     bool messageSent = false;
   715     if ( isDialpadInput() ){
   771     if ( isDialpadInput() ){
   716         // Message to inputted number
   772         // Message to inputted number
   717         QString phoneNumber = 
   773         QString phoneNumber = 
   718             HbStringUtil::convertDigitsTo(mDialpad->editor().text(), WesternDigit);
   774             HbStringUtil::convertDigitsTo(currDialpadText(), WesternDigit);
   719         LogsMessage::sendMessageToNumber( phoneNumber );
   775         delete mMessage;
       
   776         mMessage = 0;
       
   777         mMessage = LogsMessage::sendMessageToNumber( phoneNumber );
   720         messageSent = true;
   778         messageSent = true;
   721     }
   779     }
   722     LOGS_QDEBUG_2( "logs [UI] <- LogsBaseView::tryMessageToDialpadNumber(), sent", 
   780     LOGS_QDEBUG_2( "logs [UI] <- LogsBaseView::tryMessageToDialpadNumber(), sent", 
   723                  messageSent );
   781                  messageSent );
   724     return messageSent;
   782     return messageSent;
   962     if ( !mDetailsModel ){
  1020     if ( !mDetailsModel ){
   963         return;
  1021         return;
   964     }
  1022     }
   965     
  1023     
   966     QVariant arg = qVariantFromValue( mDetailsModel );
  1024     QVariant arg = qVariantFromValue( mDetailsModel );
   967     if ( mViewManager.activateView(LogsDetailsViewId, false, arg) ){
  1025     if ( mViewManager.activateView(LogsDetailsViewId, false, arg, currDialpadText()) ){
   968         mDetailsModel = 0;
  1026         mDetailsModel = 0;
   969     }
  1027     }
   970    
  1028    
   971     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::showCallDetails()" );
  1029     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::showCallDetails()" );
   972 }
  1030 }
  1199 //
  1257 //
  1200 bool LogsBaseView::tryMatchesViewTransition()
  1258 bool LogsBaseView::tryMatchesViewTransition()
  1201 {
  1259 {
  1202     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::tryMatchesViewTransition()" );
  1260     LOGS_QDEBUG( "logs [UI] -> LogsBaseView::tryMatchesViewTransition()" );
  1203     bool viewChanged = false;
  1261     bool viewChanged = false;
  1204     if ( mDialpad->editor().text().length() > 0  && isContactSearchEnabled() ) {
  1262     if ( currDialpadText().length() > 0  && isContactSearchEnabled() ) {
  1205         viewChanged = mViewManager.activateView( LogsMatchesViewId, true, QVariant() ); 
  1263         viewChanged = mViewManager.activateView( LogsMatchesViewId, true, QVariant(), currDialpadText() ); 
  1206     }
  1264     }
  1207     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::tryMatchesViewTransition()" );
  1265     LOGS_QDEBUG( "logs [UI] <- LogsBaseView::tryMatchesViewTransition()" );
  1208     return viewChanged;
  1266     return viewChanged;
  1209 }
  1267 }
  1210 
  1268 
  1212 // 
  1270 // 
  1213 // -----------------------------------------------------------------------------
  1271 // -----------------------------------------------------------------------------
  1214 //
  1272 //
  1215 bool LogsBaseView::isDialpadInput() const 
  1273 bool LogsBaseView::isDialpadInput() const 
  1216 {
  1274 {
  1217     return ( mDialpad->isOpen() && !mDialpad->editor().text().isEmpty() );
  1275     return ( mDialpad->isOpen() && !currDialpadText().isEmpty() );
  1218 }
  1276 }
  1219 
  1277 
  1220 // -----------------------------------------------------------------------------
  1278 // -----------------------------------------------------------------------------
  1221 //
  1279 //
  1222 // -----------------------------------------------------------------------------
  1280 // -----------------------------------------------------------------------------
  1327     } else if (visible && mOptionsMenu) {
  1385     } else if (visible && mOptionsMenu) {
  1328         setMenu(mOptionsMenu);
  1386         setMenu(mOptionsMenu);
  1329         mOptionsMenu = 0;
  1387         mOptionsMenu = 0;
  1330     }
  1388     }
  1331 }
  1389 }
       
  1390 
       
  1391 // -----------------------------------------------------------------------------
       
  1392 //
       
  1393 // -----------------------------------------------------------------------------
       
  1394 //
       
  1395 QString LogsBaseView::currDialpadText() const
       
  1396 {
       
  1397     return mDialpad->editor().text();
       
  1398 }