📄 kreferdialog.cpp
字号:
#include <signal.h>#include <stdlib.h>#include <sys/ioctl.h>#include <sys/soundcard.h>#include <sys/stat.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h>#include <fcntl.h>#include <math.h>#include <qbuttongroup.h>#include <qdatetime.h>#include <qdir.h>#include <qgrid.h>#include <qhbox.h>#include <qlabel.h>#include <qlayout.h>#include <qlineedit.h>#include <qmessagebox.h>#include <qpushbutton.h>#include <qsettings.h>#include <qtextedit.h>#include <qtimer.h>#include <qvbox.h>#include <qsound.h>#include "kcallwidget.h"#include "kreferdialog.h"#include "kphone.h"#include "kphoneview.h"#include "ksipauthentication.h"#include "sessioncontrol.h"#include "callaudio.h"#include "../dissipate2/mimecontenttype.h"#include "../dissipate2/sdpbuild.h"#include "../dissipate2/sipcall.h"#include "../dissipate2/sipmessage.h"#include "../dissipate2/siptransaction.h"#include "../dissipate2/sipuser.h"#include "../dissipate2/udpmessagesocket.h"#include "kstatics.h"KReferDialog::KReferDialog( KPhoneView * phv,int kcwn,QString uPrefix,QWidget *parent, const char *name ) : QDialog( parent, name, true ){ phoneView=phv; kcwNumber= kcwn; userPrefix=uPrefix; phoneBook = 0; QVBox *vbox = new QVBox( this ); vbox->setMargin( 3 ); vbox->setSpacing( 3 ); QVBoxLayout *vboxl = new QVBoxLayout( this, 5 ); vboxl->addWidget( vbox ); (void) new QLabel( "Refer-to URI:", vbox ); touri = new QLineEdit( vbox ); touri->setMinimumWidth( fontMetrics().maxWidth() * 20 ); QHBoxLayout *buttonBox; buttonBox = new QHBoxLayout( vboxl, 6 ); loadUri = new QPushButton( "", this ); QIconSet icon; icon.setPixmap(SHARE_DIR "/icons/phonebook.png", QIconSet::Automatic ); loadUri->setIconSet( icon ); loadUri->setFixedWidth( loadUri->fontMetrics().maxWidth() * 2 ); buttonBox->addWidget( loadUri ); helpPushButton = new QPushButton( this, "help button" ); helpPushButton->setText( "&help..." ); helpPushButton->setEnabled( FALSE ); buttonBox->addWidget( helpPushButton ); QSpacerItem *spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); buttonBox->addItem( spacer ); okPushButton = new QPushButton( this, "ok button" ); okPushButton->setText( "OK" ); okPushButton->setDefault( TRUE ); buttonBox->addWidget( okPushButton ); cancelPushButton = new QPushButton( this, "cancel button" ); cancelPushButton->setText( "Cancel" ); cancelPushButton->setAccel( Key_Escape ); buttonBox->addWidget( cancelPushButton ); connect( loadUri, SIGNAL( clicked() ), this, SLOT( getUri() ) ); connect( okPushButton, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); connect( cancelPushButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) );}KReferDialog::~KReferDialog( void ){}void KReferDialog::slotOk( void ){ if( touri->text().stripWhiteSpace() != QString::null ) { //transfer if your CallWidget is alive if(phoneView->isExistingWidget(kcwNumber)) newSessionRefer( touri->text() ); } touri->clear(); QDialog::accept();}void KReferDialog::slotCancel( void ){ touri->clear(); QDialog::reject();}void KReferDialog::getUri( void ){ QSettings settings; QString p = KStatics::dBase + userPrefix + "/local"; QString xmlFile = settings.readEntry( p + "/PhoneBook", "" ); if( xmlFile.isEmpty() ) { if( userPrefix.isEmpty() ) { xmlFile = QDir::homeDirPath() + "/.KPhoneSI-phonebook.xml"; } else { xmlFile = QDir::homeDirPath() + "/.KPhoneSI_" + userPrefix + "phonebook.xml"; } } QStringList r; if( !phoneBook ) { phoneBook = new PhoneBook( xmlFile, this, userPrefix + "Phone Book", receivedCalls, missedCalls, dialledCalls, r ); } phoneBook->exec(); touri->setText( phoneBook->getUri() ); //((KPhoneView *)parentWidget())->updateContacts( xmlFile );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -