Hi.

Karl Hoffmann did write about this already but something got wrong with posting the diff-file.

We want to manually forward a call. It's working but is still in early state (f.e. the caller doesn't see that his call was transfered to another number).

Here is the patch. Feedback is welcome.
*** 
/qutecom-2-2-0c9ef25e8554/wengophone/src/presentation/qt/phonecall/QtPhoneCall.cpp
  
--- /workspace/qutecom/wengophone/src/presentation/qt/phonecall/QtPhoneCall.cpp 
***************
*** 17,22 ****
--- 17,23 ----
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
+ 
  #include "QtPhoneCall.h"
  
  #include "ui_PhoneCallWidget.h"
***************
*** 34,39 ****
--- 35,41 ----
  
  #include <presentation/qt/QtWengoPhone.h>
  #include <presentation/qt/QtToolBar.h>
+ #include <presentation/qt/callbar/QtCallBar.h>
  #include <presentation/qt/statusbar/QtStatusBar.h>
  #include <presentation/qt/contactlist/QtContactList.h>
  #include <presentation/qt/profile/QtProfileDetails.h>
***************
*** 69,74 ****
--- 71,77 ----
  #include <QtCore/QTimer>
  
  #include <QtGui/QMenu>
+ #include <QtGui/QMessageBox>
  #include <QtGui/QPainter>
  
  // If a PSTN number is shorter than this length, we assume it's a special sip
***************
*** 231,247 ****
        _actionHold = new QAction(_phoneCallWidget);
        SAFE_CONNECT(_actionHold, SIGNAL(triggered()), SLOT(holdOrResume()));
  
        //Add contact
        _actionAddContact = new 
QAction(QIcon(":/pics/actions/add-contact.png"), tr("Add contact"), 
_phoneCallWidget);
        SAFE_CONNECT(_actionAddContact, SIGNAL(triggered()), 
SLOT(addContact()));
        setButtonAction(_ui->addContactButton, _actionAddContact);
        ////
  
        SAFE_CONNECT(_ui->dialpadButton, SIGNAL(toggled(bool)), 
SLOT(toggleDialpad(bool)) );
        SAFE_CONNECT(_ui->smileysButton, SIGNAL(toggled(bool)), 
SLOT(toggleSmileys(bool)) );
        SAFE_CONNECT(_ui->createConf, SIGNAL(clicked()), SLOT(createConf()) );
  
- 
        //Computes the call duration
        _callTimer = new QTimer(_phoneCallWidget);
        SAFE_CONNECT(_callTimer, SIGNAL(timeout()), SLOT(updateCallDuration()));
--- 234,254 ----
        _actionHold = new QAction(_phoneCallWidget);
        SAFE_CONNECT(_actionHold, SIGNAL(triggered()), SLOT(holdOrResume()));
  
+       //Call forward
+       _actionTransfer= new QAction(_phoneCallWidget);
+       SAFE_CONNECT(_ui->forwardButton, SIGNAL(clicked()), 
SLOT(callTransfer()) );
+ 
        //Add contact
        _actionAddContact = new 
QAction(QIcon(":/pics/actions/add-contact.png"), tr("Add contact"), 
_phoneCallWidget);
        SAFE_CONNECT(_actionAddContact, SIGNAL(triggered()), 
SLOT(addContact()));
        setButtonAction(_ui->addContactButton, _actionAddContact);
        ////
  
+ 
        SAFE_CONNECT(_ui->dialpadButton, SIGNAL(toggled(bool)), 
SLOT(toggleDialpad(bool)) );
        SAFE_CONNECT(_ui->smileysButton, SIGNAL(toggled(bool)), 
SLOT(toggleSmileys(bool)) );
        SAFE_CONNECT(_ui->createConf, SIGNAL(clicked()), SLOT(createConf()) );
  
        //Computes the call duration
        _callTimer = new QTimer(_phoneCallWidget);
        SAFE_CONNECT(_callTimer, SIGNAL(timeout()), SLOT(updateCallDuration()));
***************
*** 558,563 ****
--- 565,587 ----
        updateHoldAction();
  }
  
+  //--start my dirty hack
+  void QtPhoneCall::callTransfer() {
+ 
+         std::string forwardNumber = 
_qtWengoPhone->getQtCallBar().getPhoneComboBoxCurrentText();
+         if (forwardNumber.length()>0){
+           _cPhoneCall.blindTransfer(forwardNumber);
+           _qtWengoPhone->getQtCallBar().clearPhoneComboBoxEditText();
+         }
+         else {
+               QString titel = tr("QuteCom - Information");
+               QString message = tr("You must enter a phone number");
+               QMessageBox::information(_qtWengoPhone->getWidget(), titel, 
message );
+         }
+ 
+  }
+  //-- end my dirty hack
+ 
  void QtPhoneCall::updateCallDuration() {
        _duration++;
        updateStatusLabel();
***************
*** 807,813 ****
  void QtPhoneCall::createConf()
  {
        QString address = 
QString::fromStdString(_cPhoneCall.getPeerSipAddress());
!       
        if(address.contains("@"))
                address = address.section("@",0,0);
  
--- 831,837 ----
  void QtPhoneCall::createConf()
  {
        QString address = 
QString::fromStdString(_cPhoneCall.getPeerSipAddress());
! 
        if(address.contains("@"))
                address = address.section("@",0,0);
  
*** 
/qutecom-2-2-0c9ef25e8554/wengophone/src/presentation/qt/phonecall/QtPhoneCall.h
    
--- /workspace/qutecom/wengophone/src/presentation/qt/phonecall/QtPhoneCall.h   
***************
*** 95,100 ****
--- 95,102 ----
  
        void rejectCall();
  
+       void callTransfer();
+ 
        void toggleFlipVideoImage();
  
  private Q_SLOTS:
***************
*** 143,148 ****
--- 145,152 ----
  
        QAction * _actionHold;
  
+       QAction * _actionTransfer;
+ 
        QAction * _actionAddContact;
  
        /** Computes the call duration. */
***************
*** 162,168 ****
  
        //FIXME hack in order to prevent a crash
        bool _closed;
!       
        bool _videoEnabledInConfig;
  
        /** protect videoFrameReceivedEvent */
--- 166,172 ----
  
        //FIXME hack in order to prevent a crash
        bool _closed;
! 
        bool _videoEnabledInConfig;
  
        /** protect videoFrameReceivedEvent */
*** 
/qutecom-2-2-0c9ef25e8554/wengophone/src/presentation/qt/phonecall/PhoneCallWidget.ui
       
--- 
/workspace/qutecom/wengophone/src/presentation/qt/phonecall/PhoneCallWidget.ui  
    
***************
*** 5,11 ****
     <rect>
      <x>0</x>
      <y>0</y>
!     <width>284</width>
      <height>418</height>
     </rect>
    </property>
--- 5,11 ----
     <rect>
      <x>0</x>
      <y>0</y>
!     <width>366</width>
      <height>418</height>
     </rect>
    </property>
***************
*** 197,212 ****
        <property name="spacing" >
         <number>6</number>
        </property>
!       <property name="leftMargin" >
!        <number>0</number>
!       </property>
!       <property name="topMargin" >
!        <number>0</number>
!       </property>
!       <property name="rightMargin" >
!        <number>0</number>
!       </property>
!       <property name="bottomMargin" >
         <number>0</number>
        </property>
        <item>
--- 197,203 ----
        <property name="spacing" >
         <number>6</number>
        </property>
!       <property name="margin" >
         <number>0</number>
        </property>
        <item>
***************
*** 283,298 ****
       <property name="spacing" >
        <number>6</number>
       </property>
!      <property name="leftMargin" >
!       <number>0</number>
!      </property>
!      <property name="topMargin" >
!       <number>0</number>
!      </property>
!      <property name="rightMargin" >
!       <number>0</number>
!      </property>
!      <property name="bottomMargin" >
        <number>0</number>
       </property>
       <item>
--- 274,280 ----
       <property name="spacing" >
        <number>6</number>
       </property>
!      <property name="margin" >
        <number>0</number>
       </property>
       <item>
***************
*** 316,322 ****
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
!        <property name="sizeHint" >
          <size>
           <width>0</width>
           <height>20</height>
--- 298,304 ----
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
!        <property name="sizeHint" stdset="0" >
          <size>
           <width>0</width>
           <height>20</height>
***************
*** 338,353 ****
       <property name="spacing" >
        <number>0</number>
       </property>
!      <property name="leftMargin" >
!       <number>0</number>
!      </property>
!      <property name="topMargin" >
!       <number>0</number>
!      </property>
!      <property name="rightMargin" >
!       <number>0</number>
!      </property>
!      <property name="bottomMargin" >
        <number>0</number>
       </property>
       <item>
--- 320,326 ----
       <property name="spacing" >
        <number>0</number>
       </property>
!      <property name="margin" >
        <number>0</number>
       </property>
       <item>
***************
*** 377,383 ****
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
!        <property name="sizeHint" >
          <size>
           <width>0</width>
           <height>20</height>
--- 350,356 ----
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
!        <property name="sizeHint" stdset="0" >
          <size>
           <width>0</width>
           <height>20</height>
***************
*** 402,424 ****
        <number>1</number>
       </property>
       <property name="currentIndex" >
!       <number>0</number>
       </property>
       <widget class="QWidget" name="videoPage" >
        <layout class="QVBoxLayout" >
         <property name="spacing" >
          <number>0</number>
         </property>
!        <property name="leftMargin" >
!         <number>0</number>
!        </property>
!        <property name="topMargin" >
!         <number>0</number>
!        </property>
!        <property name="rightMargin" >
!         <number>0</number>
!        </property>
!        <property name="bottomMargin" >
          <number>0</number>
         </property>
         <item>
--- 375,388 ----
        <number>1</number>
       </property>
       <property name="currentIndex" >
!       <number>1</number>
       </property>
       <widget class="QWidget" name="videoPage" >
        <layout class="QVBoxLayout" >
         <property name="spacing" >
          <number>0</number>
         </property>
!        <property name="margin" >
          <number>0</number>
         </property>
         <item>
***************
*** 429,435 ****
           <property name="sizeType" >
            <enum>QSizePolicy::Expanding</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>20</width>
             <height>40</height>
--- 393,399 ----
           <property name="sizeType" >
            <enum>QSizePolicy::Expanding</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>20</width>
             <height>40</height>
***************
*** 455,461 ****
           <property name="sizeType" >
            <enum>QSizePolicy::Expanding</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>20</width>
             <height>40</height>
--- 419,425 ----
           <property name="sizeType" >
            <enum>QSizePolicy::Expanding</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>20</width>
             <height>40</height>
***************
*** 470,485 ****
         <property name="spacing" >
          <number>0</number>
         </property>
!        <property name="leftMargin" >
!         <number>0</number>
!        </property>
!        <property name="topMargin" >
!         <number>0</number>
!        </property>
!        <property name="rightMargin" >
!         <number>0</number>
!        </property>
!        <property name="bottomMargin" >
          <number>0</number>
         </property>
         <item>
--- 434,440 ----
         <property name="spacing" >
          <number>0</number>
         </property>
!        <property name="margin" >
          <number>0</number>
         </property>
         <item>
***************
*** 487,493 ****
           <property name="orientation" >
            <enum>Qt::Vertical</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>20</width>
             <height>40</height>
--- 442,448 ----
           <property name="orientation" >
            <enum>Qt::Vertical</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>20</width>
             <height>40</height>
***************
*** 500,515 ****
           <property name="spacing" >
            <number>6</number>
           </property>
!          <property name="leftMargin" >
!           <number>0</number>
!          </property>
!          <property name="topMargin" >
!           <number>0</number>
!          </property>
!          <property name="rightMargin" >
!           <number>0</number>
!          </property>
!          <property name="bottomMargin" >
            <number>0</number>
           </property>
           <item>
--- 455,461 ----
           <property name="spacing" >
            <number>6</number>
           </property>
!          <property name="margin" >
            <number>0</number>
           </property>
           <item>
***************
*** 517,523 ****
             <property name="orientation" >
              <enum>Qt::Horizontal</enum>
             </property>
!            <property name="sizeHint" >
              <size>
               <width>40</width>
               <height>20</height>
--- 463,469 ----
             <property name="orientation" >
              <enum>Qt::Horizontal</enum>
             </property>
!            <property name="sizeHint" stdset="0" >
              <size>
               <width>40</width>
               <height>20</height>
***************
*** 549,555 ****
             <property name="orientation" >
              <enum>Qt::Horizontal</enum>
             </property>
!            <property name="sizeHint" >
              <size>
               <width>40</width>
               <height>20</height>
--- 495,501 ----
             <property name="orientation" >
              <enum>Qt::Horizontal</enum>
             </property>
!            <property name="sizeHint" stdset="0" >
              <size>
               <width>40</width>
               <height>20</height>
***************
*** 567,573 ****
           <property name="sizeType" >
            <enum>QSizePolicy::Expanding</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>20</width>
             <height>40</height>
--- 513,519 ----
           <property name="sizeType" >
            <enum>QSizePolicy::Expanding</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>20</width>
             <height>40</height>
***************
*** 601,616 ****
         <property name="spacing" >
          <number>6</number>
         </property>
!        <property name="leftMargin" >
!         <number>0</number>
!        </property>
!        <property name="topMargin" >
!         <number>0</number>
!        </property>
!        <property name="rightMargin" >
!         <number>0</number>
!        </property>
!        <property name="bottomMargin" >
          <number>0</number>
         </property>
         <item>
--- 547,553 ----
         <property name="spacing" >
          <number>6</number>
         </property>
!        <property name="margin" >
          <number>0</number>
         </property>
         <item>
***************
*** 618,624 ****
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>40</width>
             <height>20</height>
--- 555,561 ----
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>40</width>
             <height>20</height>
***************
*** 632,638 ****
            <string>&amp;Accept</string>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/actions/accept-phone.png</iconset>
           </property>
           <property name="default" >
            <bool>true</bool>
--- 569,576 ----
            <string>&amp;Accept</string>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/actions/accept-phone.png</normaloff>:/pics/actions/accept-phone.png</iconset>
           </property>
           <property name="default" >
            <bool>true</bool>
***************
*** 645,651 ****
            <string>&amp;Reject</string>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/actions/hangup-phone.png</iconset>
           </property>
          </widget>
         </item>
--- 583,590 ----
            <string>&amp;Reject</string>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/actions/hangup-phone.png</normaloff>:/pics/actions/hangup-phone.png</iconset>
           </property>
          </widget>
         </item>
***************
*** 654,660 ****
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>40</width>
             <height>20</height>
--- 593,599 ----
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>40</width>
             <height>20</height>
***************
*** 675,690 ****
         <property name="spacing" >
          <number>6</number>
         </property>
!        <property name="leftMargin" >
!         <number>0</number>
!        </property>
!        <property name="topMargin" >
!         <number>0</number>
!        </property>
!        <property name="rightMargin" >
!         <number>0</number>
!        </property>
!        <property name="bottomMargin" >
          <number>0</number>
         </property>
         <item>
--- 614,620 ----
         <property name="spacing" >
          <number>6</number>
         </property>
!        <property name="margin" >
          <number>0</number>
         </property>
         <item>
***************
*** 692,698 ****
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>0</width>
             <height>20</height>
--- 622,628 ----
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>0</width>
             <height>20</height>
***************
*** 706,712 ****
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/actions/hangup-phone.png</iconset>
           </property>
          </widget>
         </item>
--- 636,643 ----
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/actions/hangup-phone.png</normaloff>:/pics/actions/hangup-phone.png</iconset>
           </property>
          </widget>
         </item>
***************
*** 716,722 ****
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/actions/hold-phone.png</iconset>
           </property>
          </widget>
         </item>
--- 647,668 ----
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/actions/hold-phone.png</normaloff>:/pics/actions/hold-phone.png</iconset>
!          </property>
!         </widget>
!        </item>
!        <item>
!         <widget class="QPushButton" name="forwardButton" >
!          <property name="toolTip" >
!           <string>Weiterleiten</string>
!          </property>
!          <property name="text" >
!           <string/>
!          </property>
!          <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/config/call-forward.png</normaloff>:/pics/config/call-forward.png</iconset>
           </property>
          </widget>
         </item>
***************
*** 726,732 ****
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/actions/add-contact.png</iconset>
           </property>
          </widget>
         </item>
--- 672,679 ----
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/actions/add-contact.png</normaloff>:/pics/actions/add-contact.png</iconset>
           </property>
          </widget>
         </item>
***************
*** 736,742 ****
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/iconbar/conference.png</iconset>
           </property>
          </widget>
         </item>
--- 683,690 ----
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/iconbar/conference.png</normaloff>:/pics/iconbar/conference.png</iconset>
           </property>
          </widget>
         </item>
***************
*** 749,755 ****
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/dialpad/dialpad.png</iconset>
           </property>
           <property name="checkable" >
            <bool>true</bool>
--- 697,704 ----
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/dialpad/dialpad.png</normaloff>:/pics/dialpad/dialpad.png</iconset>
           </property>
           <property name="checkable" >
            <bool>true</bool>
***************
*** 765,771 ****
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" 
>:/pics/dialpad/audiosmileys.png</iconset>
           </property>
           <property name="checkable" >
            <bool>true</bool>
--- 714,721 ----
            <string/>
           </property>
           <property name="icon" >
!           <iconset resource="../../../../resources/wengophone.qrc" >
!            
<normaloff>:/pics/dialpad/audiosmileys.png</normaloff>:/pics/dialpad/audiosmileys.png</iconset>
           </property>
           <property name="checkable" >
            <bool>true</bool>
***************
*** 777,783 ****
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" >
            <size>
             <width>0</width>
             <height>20</height>
--- 727,733 ----
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
!          <property name="sizeHint" stdset="0" >
            <size>
             <width>0</width>
             <height>20</height>
***************
*** 800,805 ****
--- 750,757 ----
    </customwidget>
   </customwidgets>
   <resources>
+   <include location="../../../../resources/wengophone.qrc" />
+   <include location="../../../../resources/wengophone.qrc" />
    <include location="../../../../resources/wengophone.qrc" />
   </resources>
   <connections/>
_______________________________________________
QuteCom-dev mailing list
[email protected]
http://lists.qutecom.org/mailman/listinfo/qutecom-dev

Reply via email to