Changeset 26:8de487772114
- Timestamp:
- 09/14/07 18:59:48
(1 year ago)
- Author:
- Nikita@Luc
- Message:
add support for video
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r24 |
r26 |
|
| 124 | 124 | connect(phapi.phapiwarp ,SIGNAL(appelSortant(int,QString,int)),this,SLOT(appelSortant(int,QString,int))); |
|---|
| 125 | 125 | |
|---|
| 126 | | floatWidget = new FloatWidget(0,&phapi); |
|---|
| | 126 | floatWidget = new FloatWidget(0,&phapi,xml); |
|---|
| 127 | 127 | floatWidget->hide(); |
|---|
| 128 | 128 | connect(floatButton,SIGNAL(clicked()),this,SLOT(showHideFloatingWidget())); |
|---|
| … | … | |
| 333 | 333 | { |
|---|
| 334 | 334 | if(it.value()->status == 0) |
|---|
| 335 | | tmp->setStatusIcon(":/images/check.png"); |
|---|
| | 335 | tmp->setStatusIcon(":/images/call.png"); |
|---|
| 336 | 336 | else if(it.value()->status == 2) |
|---|
| 337 | 337 | tmp->setStatusIcon(":/images/hold.png"); |
|---|
| … | … | |
| 364 | 364 | { |
|---|
| 365 | 365 | pix = phapi.phapiwarp->mapCidPix.value(callSelected); |
|---|
| | 366 | QRect r = label->geometry(); |
|---|
| | 367 | r.adjust(3,3,-3,-3); |
|---|
| | 368 | |
|---|
| | 369 | int dx = 4; |
|---|
| | 370 | int dy = 3; |
|---|
| | 371 | |
|---|
| | 372 | if(xml->general.is169.toInt()) |
|---|
| | 373 | { |
|---|
| | 374 | dx = 16; |
|---|
| | 375 | dy = 9; |
|---|
| | 376 | } |
|---|
| | 377 | |
|---|
| | 378 | QSize realre(dx,dy); |
|---|
| | 379 | for(int i = 0 ; i < 2000 ; i++) |
|---|
| | 380 | { |
|---|
| | 381 | if(realre.width()+dx <= r.width() && realre.height()+dy<= r.height()) |
|---|
| | 382 | { |
|---|
| | 383 | realre = QSize(realre.width()+dx,realre.height() +dy); |
|---|
| | 384 | } |
|---|
| | 385 | else |
|---|
| | 386 | continue; |
|---|
| | 387 | } |
|---|
| | 388 | r.setWidth(realre.width()); |
|---|
| | 389 | r.setHeight(realre.height()); |
|---|
| | 390 | |
|---|
| | 391 | r.moveCenter(label->geometry().center()); |
|---|
| | 392 | painter.drawPixmap(r, pix); |
|---|
| 366 | 393 | } |
|---|
| 367 | 394 | else |
|---|
| | 395 | { |
|---|
| | 396 | pix = QPixmap(":images/pix.png"); |
|---|
| | 397 | QRect re = pix.rect(); |
|---|
| | 398 | re.moveCenter(label->geometry().center()); |
|---|
| 368 | 399 | pix=QPixmap(":images/pix.png"); |
|---|
| 369 | | |
|---|
| 370 | | QRect re = pix.rect(); |
|---|
| 371 | | re.moveCenter(label->geometry().center()); |
|---|
| 372 | | painter.drawPixmap(re , pix); |
|---|
| | 400 | painter.drawPixmap(re, pix); |
|---|
| | 401 | } |
|---|
| 373 | 402 | } |
|---|
| 374 | 403 | |
|---|
| r24 |
r26 |
|
| 40 | 40 | cl = new QPushButton; |
|---|
| 41 | 41 | cl->setMaximumSize(32,20); |
|---|
| 42 | | cl->setIcon(QIcon(":/images/delete.png")); |
|---|
| | 42 | cl->setIcon(QIcon(":/images/end.png")); |
|---|
| 43 | 43 | |
|---|
| 44 | 44 | QHBoxLayout * lay = new QHBoxLayout; |
|---|
| r25 |
r26 |
|
| 1 | 1 | #include"floatwidget.h" |
|---|
| 2 | 2 | |
|---|
| 3 | | FloatWidget::FloatWidget(QWidget * parent , PhApiHead * _phapi ) |
|---|
| 4 | | :QWidget(parent),phapi(_phapi),callSelected(-1),ligneSelected(-1) |
|---|
| | 3 | FloatWidget::FloatWidget(QWidget * parent , PhApiHead * _phapi ,xmlWrapper * _xml) |
|---|
| | 4 | :QWidget(parent),phapi(_phapi),callSelected(-1),ligneSelected(-1),xml(_xml) |
|---|
| 5 | 5 | { |
|---|
| 6 | 6 | setWindowTitle("Milli phone"); |
|---|
| … | … | |
| 38 | 38 | setLayout(layV); |
|---|
| 39 | 39 | |
|---|
| | 40 | connect(textEdit,SIGNAL(returnPressed()),this,SLOT(sendClicked())); |
|---|
| 40 | 41 | connect(send,SIGNAL(clicked()),this,SLOT(sendClicked())); |
|---|
| 41 | 42 | |
|---|
| … | … | |
| 64 | 65 | { |
|---|
| 65 | 66 | pix = phapi->phapiwarp->mapCidPix.value(callSelected); |
|---|
| | 67 | QRect r = label->geometry(); |
|---|
| | 68 | r.adjust(3,3,-3,-3); |
|---|
| | 69 | |
|---|
| | 70 | int dx = 4; |
|---|
| | 71 | int dy = 3; |
|---|
| | 72 | |
|---|
| | 73 | if(xml->general.is169.toInt()) |
|---|
| | 74 | { |
|---|
| | 75 | dx = 16; |
|---|
| | 76 | dy = 9; |
|---|
| | 77 | } |
|---|
| | 78 | |
|---|
| | 79 | QSize realre(dx,dy); |
|---|
| | 80 | |
|---|
| | 81 | for(int i = 0 ; i < 2000 ; i++) |
|---|
| | 82 | { |
|---|
| | 83 | if(realre.width()+dx <= r.width() && realre.height()+dy<= r.height()) |
|---|
| | 84 | { |
|---|
| | 85 | realre = QSize(realre.width()+dx,realre.height() +dy); |
|---|
| | 86 | } |
|---|
| | 87 | else |
|---|
| | 88 | continue; |
|---|
| | 89 | } |
|---|
| | 90 | r.setWidth(realre.width()); |
|---|
| | 91 | r.setHeight(realre.height()); |
|---|
| | 92 | |
|---|
| | 93 | r.moveCenter(label->geometry().center()); |
|---|
| | 94 | painter.drawPixmap(r, pix); |
|---|
| 66 | 95 | } |
|---|
| 67 | 96 | else |
|---|
| | 97 | { |
|---|
| | 98 | pix = QPixmap(":images/pix.png"); |
|---|
| | 99 | QRect re = pix.rect(); |
|---|
| | 100 | re.moveCenter(label->geometry().center()); |
|---|
| 68 | 101 | pix=QPixmap(":images/pix.png"); |
|---|
| | 102 | painter.drawPixmap(re, pix); |
|---|
| 69 | 103 | |
|---|
| 70 | | QRect re = pix.rect(); |
|---|
| 71 | | re.moveCenter(label->geometry().center()); |
|---|
| 72 | | painter.drawPixmap(re , pix); |
|---|
| 73 | | |
|---|
| | 104 | } |
|---|
| 74 | 105 | } |
|---|
| 75 | 106 | |
|---|
| r25 |
r26 |
|
| 4 | 4 | #include<QtGui> |
|---|
| 5 | 5 | #include "phapihead.h" |
|---|
| | 6 | #include "xmlwrapper.h" |
|---|
| 6 | 7 | |
|---|
| 7 | 8 | class FloatWidget :public QWidget |
|---|
| … | … | |
| 10 | 11 | |
|---|
| 11 | 12 | private: |
|---|
| | 13 | xmlWrapper * xml; |
|---|
| 12 | 14 | QMap<int,QString> map; |
|---|
| 13 | 15 | QGroupBox* label; |
|---|
| … | … | |
| 19 | 21 | int callSelected,ligneSelected; |
|---|
| 20 | 22 | public: |
|---|
| 21 | | FloatWidget(QWidget * parent = 0, PhApiHead * _phapi = 0); |
|---|
| | 23 | FloatWidget(QWidget * parent = 0, PhApiHead * _phapi = 0,xmlWrapper * _xml = 0); |
|---|
| 22 | 24 | |
|---|
| 23 | 25 | protected: |
|---|
| r23 |
r26 |
|
| 8 | 8 | |
|---|
| 9 | 9 | video = new QCheckBox("Video",this); |
|---|
| | 10 | |
|---|
| | 11 | seize9= new QCheckBox("16/9",this); |
|---|
| | 12 | quatre3= new QCheckBox("4/3",this); |
|---|
| 10 | 13 | |
|---|
| 11 | 14 | init = new QPushButton(this); |
|---|
| … | … | |
| 20 | 23 | QVBoxLayout * lay = new QVBoxLayout; |
|---|
| 21 | 24 | lay->addWidget(video); |
|---|
| | 25 | lay->addWidget(quatre3); |
|---|
| | 26 | lay->addWidget(seize9); |
|---|
| | 27 | |
|---|
| 22 | 28 | lay->addLayout(lh); |
|---|
| 23 | 29 | lay->addWidget(init); |
|---|
| … | … | |
| 30 | 36 | video->setCheckState (Qt::Unchecked); |
|---|
| 31 | 37 | |
|---|
| | 38 | if(xml->general.is169.toInt()) |
|---|
| | 39 | { |
|---|
| | 40 | seize9->setCheckState (Qt::Checked); |
|---|
| | 41 | quatre3->setCheckState (Qt::Unchecked); |
|---|
| | 42 | } |
|---|
| | 43 | else |
|---|
| | 44 | { |
|---|
| | 45 | seize9->setCheckState (Qt::Unchecked); |
|---|
| | 46 | quatre3->setCheckState (Qt::Checked); |
|---|
| | 47 | } |
|---|
| | 48 | |
|---|
| 32 | 49 | linePort->setText(xml->general.localPort); |
|---|
| 33 | 50 | connect(video,SIGNAL(stateChanged ( int )),this,SLOT(stateChanged ( int ))); |
|---|
| | 51 | connect(seize9,SIGNAL(stateChanged ( int )),this,SLOT(seize9stateChanged ( int ))); |
|---|
| | 52 | connect(quatre3,SIGNAL(stateChanged ( int )),this,SLOT(quatre3stateChanged ( int ))); |
|---|
| | 53 | |
|---|
| 34 | 54 | connect(linePort,SIGNAL(editingFinished ()),this,SLOT(editingFinished ())); |
|---|
| 35 | 55 | } |
|---|
| r23 |
r26 |
|
| 11 | 11 | private: |
|---|
| 12 | 12 | QCheckBox * video; |
|---|
| | 13 | |
|---|
| | 14 | QCheckBox * seize9; |
|---|
| | 15 | QCheckBox * quatre3; |
|---|
| | 16 | |
|---|
| 13 | 17 | QLabel * labPort; |
|---|
| 14 | 18 | QLineEdit * linePort; |
|---|
| … | … | |
| 39 | 43 | } |
|---|
| 40 | 44 | } |
|---|
| | 45 | |
|---|
| | 46 | void seize9stateChanged ( int state ) |
|---|
| | 47 | { |
|---|
| | 48 | if(state) |
|---|
| | 49 | { |
|---|
| | 50 | quatre3->setCheckState(Qt::Unchecked); |
|---|
| | 51 | xml->general.is169 = "1"; |
|---|
| | 52 | xml->writeSipConf(); |
|---|
| | 53 | } |
|---|
| | 54 | else |
|---|
| | 55 | { |
|---|
| | 56 | quatre3->setCheckState(Qt::Checked); |
|---|
| | 57 | xml->general.is169= "0"; |
|---|
| | 58 | xml->writeSipConf(); |
|---|
| | 59 | } |
|---|
| | 60 | } |
|---|
| | 61 | |
|---|
| | 62 | void quatre3stateChanged ( int state ) |
|---|
| | 63 | { |
|---|
| | 64 | if(state) |
|---|
| | 65 | { |
|---|
| | 66 | seize9->setCheckState(Qt::Unchecked); |
|---|
| | 67 | xml->general.is169 = "0"; |
|---|
| | 68 | xml->writeSipConf(); |
|---|
| | 69 | } |
|---|
| | 70 | else |
|---|
| | 71 | { |
|---|
| | 72 | seize9->setCheckState(Qt::Checked); |
|---|
| | 73 | xml->general.is169= "1"; |
|---|
| | 74 | xml->writeSipConf(); |
|---|
| | 75 | } |
|---|
| | 76 | } |
|---|
| 41 | 77 | }; |
|---|
| 42 | 78 | |
|---|
| r25 |
r26 |
|
| 27 | 27 | <file>images/inside.png</file> |
|---|
| 28 | 28 | <file>images/enCom.png</file> |
|---|
| | 29 | <file>images/call.png</file> |
|---|
| | 30 | <file>images/conference.png</file> |
|---|
| | 31 | <file>images/end.png</file> |
|---|
| 29 | 32 | </qresource> |
|---|
| 30 | 33 | </RCC> |
|---|
| r24 |
r26 |
|
| 100 | 100 | general.video = generalElt.attribute("video"); |
|---|
| 101 | 101 | general.localPort = generalElt.attribute("localPort"); |
|---|
| | 102 | general.is169= generalElt.attribute("is169"); |
|---|
| 102 | 103 | } |
|---|
| 103 | 104 | |
|---|
| … | … | |
| 215 | 216 | general.video = "0"; |
|---|
| 216 | 217 | general.localPort = "5060"; |
|---|
| | 218 | |
|---|
| | 219 | general.is169= "0"; |
|---|
| 217 | 220 | |
|---|
| 218 | 221 | writeSipConf(); |
|---|
| … | … | |
| 327 | 330 | generalElt.setAttribute("video",general.video ); |
|---|
| 328 | 331 | generalElt.setAttribute("localPort",general.localPort); |
|---|
| | 332 | |
|---|
| | 333 | generalElt.setAttribute("is169",general.is169); |
|---|
| 329 | 334 | |
|---|
| 330 | 335 | root.appendChild(generalElt); |
|---|
| r22 |
r26 |
|
| 91 | 91 | QString video; |
|---|
| 92 | 92 | |
|---|
| | 93 | QString is169; |
|---|
| | 94 | |
|---|
| 93 | 95 | QList<xmlLigne> listLigne; |
|---|
| 94 | 96 | QList<xmlContact> listContact; |
|---|