contactwidgethsplugin/contactwidgeths/src/commlauncherwidget.cpp
changeset 59 a642906a277a
parent 47 7cbcb2896f0e
child 71 7cc7d74059f9
equal deleted inserted replaced
47:7cbcb2896f0e 59:a642906a277a
   111     Destructor
   111     Destructor
   112 */
   112 */
   113 CommLauncherWidget::~CommLauncherWidget()
   113 CommLauncherWidget::~CommLauncherWidget()
   114 {
   114 {
   115     // Deleting request cancels all pending requests 
   115     // Deleting request cancels all pending requests 
   116     delete mRequest;
   116     if (mRequest) {
       
   117         delete mRequest;
       
   118         mRequest = NULL;
       
   119     }
       
   120 
   117 }
   121 }
   118 
   122 
   119 /*!
   123 /*!
   120     Sets the contact for the widget
   124     Sets the contact for the widget
   121 */
   125 */
   516 /*!
   520 /*!
   517     Handles call key events
   521     Handles call key events
   518 */
   522 */
   519 void CommLauncherWidget::keyPressEvent(QKeyEvent *event)
   523 void CommLauncherWidget::keyPressEvent(QKeyEvent *event)
   520 {
   524 {
       
   525 	qDebug() << "keyPressEvent event=" << event->key();
   521     if (event->key() == Qt::Key_Yes) {
   526     if (event->key() == Qt::Key_Yes) {
   522         // Call key initializes a call
   527         // Call key initializes a call
   523         makeCall();
   528         makeCall();
   524         event->accept();
   529         event->accept();
   525     } else if (event->key() == Qt::Key_No || event->key() == Qt::Key_Select) {
   530     } else {
   526         // End key and Select key close the communication launcher and 
   531       close();
   527         // forward the key event to HbPopup
   532       //HbPopup::keyPressEvent(event);
   528         close();
       
   529         HbPopup::keyPressEvent(event);
       
   530     } else {
       
   531         HbPopup::keyPressEvent(event);
       
   532     } 
   533     } 
   533 }
   534 }
   534 
   535 
   535 /*!
   536 /*!
   536     Counts the width for the launcher. 
   537     Counts the width for the launcher. 
   547     width = mButtonCount * buttonSize + (mButtonCount + 1) * verticalMargin;
   548     width = mButtonCount * buttonSize + (mButtonCount + 1) * verticalMargin;
   548     
   549     
   549     return width;
   550     return width;
   550 }
   551 }
   551 
   552 
       
   553