Changeset 283:312974380d4f in qutecom-coip
- Timestamp:
- Jul 28, 2011 2:30:42 AM (23 months ago)
- Branch:
- default
- Location:
- gui
- Files:
-
- 7 added
- 30 edited
-
resources/CMakeLists.txt (modified) (1 diff)
-
resources/pix/CMakeLists.txt (modified) (2 diffs)
-
resources/pix/contact/contact.png (modified) (1 prop) (previous)
-
resources/pix/contact/horizontal-button-background.png (added)
-
resources/pix/contact/vertical-arrow.png (added)
-
resources/pix/pix.qrc (modified) (1 diff)
-
src/CMakeLists.txt (modified) (6 diffs)
-
src/account/accountmonitor.cpp (added)
-
src/account/accountmonitor.h (added)
-
src/account/accountmonitoritem.cpp (added)
-
src/account/accountmonitoritem.h (added)
-
src/account/accountmonitoritem.ui (added)
-
src/buildid/CMakeLists.txt (modified) (3 diffs)
-
src/buildid/buildid.cpp (modified) (3 diffs)
-
src/buildid/buildid.h (modified) (2 diffs)
-
src/call/callwidget.cpp (modified) (1 diff)
-
src/chat/chatwindow.cpp (modified) (3 diffs)
-
src/chat/chatwindow.h (modified) (1 diff)
-
src/contacts/contacts.cpp (modified) (6 diffs)
-
src/contacts/contacts.h (modified) (4 diffs)
-
src/contacts/contacttreewidget.cpp (modified) (1 diff)
-
src/contacts/contacttreewidget.h (modified) (1 diff)
-
src/contacts/grouptreewidget.cpp (modified) (2 diffs)
-
src/contacts/grouptreewidget.h (modified) (1 diff)
-
src/mainwindow/mainwindow.cpp (modified) (6 diffs)
-
src/mainwindow/mainwindow.h (modified) (1 diff)
-
src/mainwindow/mainwindow.ui (modified) (2 diffs)
-
src/manager/manager.cpp (modified) (1 diff)
-
src/profilebar/avatarbutton.cpp (modified) (1 diff)
-
src/profilebar/profilebar.cpp (modified) (2 diffs)
-
src/profilebar/profilebar.h (modified) (2 diffs)
-
src/profilebar/profilebar.ui (modified) (3 diffs)
-
src/statusbar/statusbar.cpp (modified) (1 diff)
-
src/statusbar/statusbar.h (modified) (1 diff)
-
src/statusbar/statusbar.ui (modified) (2 diffs)
-
src/wizard/audiopage.cpp (modified) (6 diffs)
-
src/wizard/videopage.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gui/resources/CMakeLists.txt
r177 r283 3 3 ) 4 4 5 ow_copy_dir_recursive(${CMAKE_CURRENT_SOURCE_DIR}/chat/* ${DATA_COPY_DIR}/chat/.)5 #copy_dir_recursive(${CMAKE_CURRENT_SOURCE_DIR}/chat/* ${DATA_COPY_DIR}/chat/.) -
gui/resources/pix/CMakeLists.txt
r176 r283 1 ow_create_static_library(pix)1 create_static_library(pix) 2 2 3 ow_use_private_libraries(3 use_private_libraries( 4 4 qtgui 5 5 ) 6 6 7 ow_use_public_libraries(7 use_public_libraries( 8 8 qt4 9 9 ) 10 10 11 ow_add_public_include_dirs(11 add_public_include_dirs( 12 12 ${CMAKE_CURRENT_BINARY_DIR} 13 13 ${CMAKE_CURRENT_SOURCE_DIR} … … 18 18 ) 19 19 20 ow_create_project_binary()20 create_project_binary() -
gui/resources/pix/contact/contact.png
- Property exe deleted
-
gui/resources/pix/pix.qrc
r176 r283 36 36 <file>call/callButtonPressed.png</file> 37 37 <file>call/holdButtonFullScreen.png</file> 38 <file>statusbar/audio_down.png</file> 39 <file>statusbar/audio_over.png</file> 40 <file>statusbar/audio.png</file> 41 <file>statusbar/video_down.png</file> 42 <file>statusbar/video_over.png</file> 43 <file>statusbar/video.png</file> 44 <file>contact/horizontal-button-background.png</file> 45 <file>contact/contact.png</file> 46 <file>contact/vertical-arrow.png</file> 38 47 </qresource> 39 48 </RCC> -
gui/src/CMakeLists.txt
r249 r283 1 1 set(BINARY_NAME ${APPLICATION_NAME}) 2 2 3 ow_create_executable(QuteCom)3 create_executable(QuteCom) 4 4 5 ow_use_private_libraries(5 use_private_libraries( 6 6 owsystem 7 7 owsettings … … 17 17 endif (CRASH_REPORT_SUPPORT) 18 18 19 ow_add_public_include_dirs(19 add_public_include_dirs( 20 20 ${CMAKE_CURRENT_BINARY_DIR} 21 21 ${CMAKE_CURRENT_SOURCE_DIR} … … 23 23 24 24 qt4_wrap_cpp(${PROJECT_NAME}_SRCS 25 account/accountmonitor.h 26 account/accountmonitoritem.h 25 27 call/callbutton.h 26 28 call/calls.h … … 58 60 ) 59 61 60 ow_add_sources( 62 add_sources( 63 account/accountmonitor.cpp 64 account/accountmonitoritem.cpp 61 65 call/callbutton.cpp 62 66 call/calls.cpp … … 96 100 97 101 qt4_wrap_ui(${PROJECT_NAME}_SRCS 102 account/accountmonitoritem.ui 98 103 call/callwidget.ui 99 104 callbar/callbar.ui … … 116 121 ) 117 122 118 ow_create_project_binary(WIN32 MACOSX_BUNDLE)123 create_project_binary(WIN32 MACOSX_BUNDLE) -
gui/src/buildid/CMakeLists.txt
r267 r283 1 ow_create_static_library(buildid)1 create_static_library(buildid) 2 2 3 ow_use_private_libraries(4 tinyxml3 use_private_libraries( 4 # tinyxml 5 5 curl 6 6 ffmpeg … … 9 9 10 10 if(LIBPURPLE_SUPPORT) 11 ow_use_private_libraries(11 use_private_libraries( 12 12 glib2 13 13 libpurple … … 16 16 17 17 if (NOT APPLE AND OWSOUND_PORTAUDIO_SUPPORT) 18 ow_use_private_libraries(18 use_private_libraries( 19 19 portaudio 20 20 ) 21 21 endif (NOT APPLE AND OWSOUND_PORTAUDIO_SUPPORT) 22 22 23 if (BUILDID_SUPPORT)24 ow_add_private_definitions(25 -DDD_BUILDID=${CURRENT_DATE_TIME}LL26 -DDD_VERSION=${APPLICATION_VERSION}27 -DDD_REVISION=${SVN_REVISION}28 -DDD_SOFTPHONE_NAME=qutecom29 )30 else (BUILDID_SUPPORT)31 ow_add_private_definitions(32 -DDD_BUILDID=0LL33 -DDD_VERSION=034 -DDD_REVISION=035 -DDD_SOFTPHONE_NAME=qutecom36 )37 endif (BUILDID_SUPPORT)38 23 39 ow_add_public_include_dirs( 24 add_private_definitions( 25 -DDD_BUILDID=\"${CURRENT_DATE_TIME}\" 26 -DDD_VERSION=\"${APPLICATION_VERSION}\" 27 -DDD_REVISION=\"${SVN_REVISION}\" 28 -DDD_SOFTPHONE_NAME=\"QuteCom\" 29 ) 30 31 add_public_include_dirs( 40 32 ${CMAKE_CURRENT_BINARY_DIR} 41 33 ${CMAKE_CURRENT_SOURCE_DIR} 42 34 ) 43 35 44 ow_add_sources(36 add_sources( 45 37 buildid.cpp 46 38 ) 47 39 48 ow_create_project_binary()40 create_project_binary() -
gui/src/buildid/buildid.cpp
r267 r283 5 5 6 6 #include <curl/curl.h> 7 #if !defined(PORTAUDIO_SUPPORT)7 #if defined(PORTAUDIO_SUPPORT) 8 8 #include <portaudio.h> 9 9 #endif 10 #include <tinyxml.h>11 10 extern "C" { 12 #include < avcodec.h>11 #include <libavcodec/avcodec.h> 13 12 #if defined (LIBPURPLE_SUPPORT) 14 13 #include <glib.h> … … 20 19 #define stringize(x) stringize2(x) 21 20 22 const unsigned long longBuildId::getBuildId() {21 const char * BuildId::getBuildId() { 23 22 return DD_BUILDID; 24 23 } 25 24 26 25 const char * BuildId::getVersion() { 27 return stringize(DD_VERSION);26 return DD_VERSION; 28 27 } 29 28 30 29 const char * BuildId::getHgRevision() { 31 return stringize(DD_REVISION);30 return DD_REVISION; 32 31 } 33 32 34 33 const char * BuildId::getSoftphoneName() { 35 return stringize(DD_SOFTPHONE_NAME);34 return DD_SOFTPHONE_NAME; 36 35 } 37 36 … … 69 68 return version.c_str(); 70 69 } 71 72 const char * BuildId::getTinyXmlVersion() {73 static std::string version(String::fromNumber(TIXML_MAJOR_VERSION) + "." +74 String::fromNumber(TIXML_MINOR_VERSION) + "." +75 String::fromNumber(TIXML_PATCH_VERSION));76 return version.c_str();77 } -
gui/src/buildid/buildid.h
r177 r283 6 6 public: 7 7 8 static const unsigned long longgetBuildId();8 static const char * getBuildId(); 9 9 static const char * getVersion(); 10 10 static const char * getHgRevision(); … … 15 15 static const char * getPortaudioVersion(); 16 16 static const char * getAvcodecVersion(); 17 static const char * getTinyXmlVersion();18 17 }; 19 18 -
gui/src/call/callwidget.cpp
r273 r283 11 11 _lastStatus = EnumPhoneCallState::PhoneCallStateIncoming; 12 12 13 ui->setupUi(this);13 // ui->setupUi(this); 14 14 15 15 _labelMsg = new QLabel; -
gui/src/chat/chatwindow.cpp
r177 r283 40 40 } 41 41 42 TChatSession * ChatWindow::createNewChat( IMContact imContact)42 TChatSession * ChatWindow::createNewChat(Contact contact) 43 43 { 44 44 QList<TChatSession*> chatSessionList = _map.keys(); 45 45 for(QList<TChatSession*>::iterator it = chatSessionList.begin() ; it != chatSessionList.end() ; it++) 46 46 { 47 if(ContactListHelper::getCopyOfFirstContactThatOwns((*it)->getContactList(),imContact)) 48 { 47 Contact * found = ContactListHelper::getCopyOfContact((*it)->getContactList(),contact.getUUID()); 48 if(found) 49 { 50 OWSAFE_DELETE(found); 49 51 _tabWidget->setCurrentWidget(_map.value(*it)); 50 52 show(); … … 54 56 } 55 57 56 Contact contact;57 contact.addIMContact(imContact);58 58 TChatSession * session = Coip::self()->getTChatSessionManager().createTChatSession(); 59 59 EnumSessionError::SessionError error = session->addContact(contact); … … 104 104 { 105 105 Contact contact = fileSession->getContact(); 106 IMContact imContact = contact.getIMContactList().front(); 107 TChatSession * session = createNewChat(imContact); 106 TChatSession * session = createNewChat(contact); 108 107 109 108 ChatWidget * chatWidget = _map.value(session); -
gui/src/chat/chatwindow.h
r177 r283 35 35 static ChatWindow * self(); 36 36 37 TChatSession * createNewChat( IMContact);37 TChatSession * createNewChat(Contact); 38 38 39 39 protected: -
gui/src/contacts/contacts.cpp
r255 r283 9 9 QTreeWidget(parent) 10 10 { 11 setStyleSheet( 12 // "QTreeView::item { border-bottom: 1px solid black;" 13 "QTreeView::item {margin-left: -20px;}" 14 ); 15 //setAlternatingRowColors(true); 11 setAlternatingRowColors(true); 12 13 setColumnCount(3); 14 15 setFocusPolicy(Qt::NoFocus); 16 17 header()->setStretchLastSection(false); 18 header()->setResizeMode(1,QHeaderView::Stretch); 19 header()->setResizeMode(0,QHeaderView::Fixed); 20 header()->resizeSection(0,25); 21 22 header()->setResizeMode(2,QHeaderView::Fixed); 23 header()->resizeSection(2,36); 16 24 17 25 setHeaderHidden(true); … … 31 39 32 40 connect(this,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(itemDoubleClickedSlot(QTreeWidgetItem *,int))); 41 connect(this,SIGNAL(itemClicked(QTreeWidgetItem *,int)),this,SLOT(itemClickedSlot(QTreeWidgetItem *,int))); 42 43 _delegate = new ContacTreeWidgetDelegate; 44 45 setItemDelegate(_delegate); 33 46 34 47 userProfileSetSlot(Coip::self()->getTUserProfileManager().getCopyOfUserProfile()); … … 54 67 { 55 68 ContactGroupList contactGroupList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactGroupList(); 56 for(ContactGroupList::iterator it = contactGroupList.begin() ; it != contactGroupList.end() ; it ++) 57 { 58 if((*it).first == groupId) 59 { 60 QTreeWidgetItem * item = new QTreeWidgetItem(this); 61 item->setText(0,QString::fromStdString((*it).second)); 62 setItemWidget (item,0,new GroupTreeWidget(QString::fromStdString((*it).second))); 63 _mapGroups.insert((*it).first,item); 64 sortItems(0,Qt::AscendingOrder); 65 } 69 70 std::map<std::string, std::string>::iterator it = contactGroupList.find(groupId); 71 72 if(it != contactGroupList.end()) 73 { 74 GroupTreeWidget * item = new GroupTreeWidget(groupId,this); 75 item->setText(1,QString::fromStdString((*it).second)); 76 _mapGroups.insert((*it).first,item); 77 sortItems(0,Qt::AscendingOrder); 66 78 } 67 79 } … … 78 90 if(contact) 79 91 { 80 QTreeWidgetItem * item;92 ContactTreeWidgetItem * item; 81 93 82 94 QTreeWidgetItem * root = NULL; 83 95 if(contact->getGroupList().size()) 84 root = _map Contacts.value(contact->getGroupList().front());96 root = _mapGroups.value(contact->getGroupList().front()); 85 97 86 98 if(root) 87 item = new QTreeWidgetItem(root);99 item = new ContactTreeWidgetItem(contactId,root); 88 100 else 89 item = new QTreeWidgetItem(this); 90 91 setItemWidget (item,0,new ContactTreeWidget(contactId)); 92 93 //item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicator); 94 //item->setIcon(0,QIcon(":/qute.png")); 101 item = new ContactTreeWidgetItem(contactId,this); 102 95 103 if(contact->getAlias().empty()) 96 104 item->setText(0,QString::fromStdString(contact->getDisplayName())); … … 124 132 item->setText(0,QString::fromStdString(contact->getAlias())); 125 133 126 QWidget * widget = itemWidget(_mapContacts.value(contactId),0);127 if(widget)128 qobject_cast<ContactTreeWidget *>(widget)->update();129 134 sortItems(0,Qt::AscendingOrder); 130 135 } 131 136 } 132 137 OWSAFE_DELETE(contact); 138 } 139 140 void Contacts::itemClickedSlot(QTreeWidgetItem * item,int) 141 { 142 if(_mapGroups.values().contains(item)) 143 { 144 if(item->isExpanded()) 145 collapseItem(item); 146 else 147 expandItem(item); 148 } 133 149 } 134 150 … … 143 159 if(contact) 144 160 { 145 ChatWindow::self()->createNewChat( contact->getIMContactList().front());161 ChatWindow::self()->createNewChat(*contact); 146 162 } 147 163 OWSAFE_DELETE(contact); 148 164 } 149 else if(_mapGroups.values().contains(item)) 150 { 151 if(item->isExpanded()) 152 collapseItem(item); 153 else 154 expandItem(item); 155 } 165 } 166 167 std::string Contacts::getSelectedContactUUID() 168 { 169 QList<QTreeWidgetItem *> items = selectedItems (); 170 if(items.count()) 171 { 172 QTreeWidgetItem * item = items.front(); 173 if(_mapContacts.values().contains(item)) 174 { 175 std::string uuid = _mapContacts.key(item); 176 return uuid; 177 } 178 } 179 180 return ""; 156 181 } 157 182 -
gui/src/contacts/contacts.h
r177 r283 5 5 6 6 #include <coip/coip.h> 7 8 class ContacTreeWidgetDelegate : public QStyledItemDelegate 9 { 10 public: 11 QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const 12 { 13 QVariant varIsItem = index.data(Qt::UserRole); 14 if(varIsItem.isNull() || varIsItem.toBool()) 15 return QSize(option.rect.width(),33); 16 17 return QStyledItemDelegate::sizeHint(option,index); 18 } 19 20 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const 21 { 22 QVariant varIsItem = index.data(Qt::UserRole); 23 QRect rect = option.rect; 24 if(index.column() == 0) 25 rect.setX(0); 26 27 if(varIsItem.isNull()) 28 { 29 if (option.state & QStyle::State_Selected) 30 painter->fillRect(rect, option.palette.highlight()); 31 32 return; 33 } 34 else if(varIsItem.toBool()) 35 { 36 if( index.column() == 0) 37 { 38 QVariant var = index.data(Qt::DecorationRole); 39 if( var.type() == QVariant::Pixmap) 40 { 41 QPixmap pix = var.value<QPixmap>(); 42 if(!pix.isNull()) 43 { 44 if (option.state & QStyle::State_Selected) 45 painter->fillRect(rect, option.palette.highlight()); 46 47 painter->drawPixmap(7,rect.y() + (rect.height()-pix.height())/2, pix); 48 return; 49 } 50 } 51 } 52 53 if( index.column() == 1) 54 { 55 QVariant var = index.data(Qt::DisplayRole); 56 if( var.type() == QVariant::String) 57 { 58 if (option.state & QStyle::State_Selected) 59 painter->fillRect(rect, option.palette.highlight()); 60 61 QString alias = var.value<QString>(); 62 painter->drawText(rect,Qt::AlignLeft|Qt::AlignVCenter,alias); 63 return; 64 } 65 } 66 67 if( index.column() == 2) 68 { 69 QVariant var = index.data(Qt::DecorationRole); 70 if( var.type() == QVariant::Pixmap) 71 { 72 if (option.state & QStyle::State_Selected) 73 painter->fillRect(rect, option.palette.highlight()); 74 75 QPixmap pix = var.value<QPixmap>(); 76 if(!pix.isNull()) 77 { 78 QRect rectpix = QRect(0,0,pix.width(),pix.height()); 79 rectpix.moveCenter(rect.center()); 80 painter->drawPixmap(rectpix, pix); 81 return; 82 } 83 } 84 } 85 } 86 else 87 { 88 painter->drawPixmap(rect,QPixmap(":/contact/horizontal-button-background.png")); 89 90 if(index.column() == 0) 91 { 92 QVariant varExpand = index.data(Qt::DisplayRole+1); 93 QPixmap arrow(":/contact/vertical-arrow.png"); 94 if(varExpand.toBool()) 95 { 96 QRect rarrow(0,0,11,12); 97 rarrow.moveCenter(rect.center()); 98 painter->drawPixmap(rarrow,arrow); 99 } 100 else 101 { 102 QRect rarrow(0,0,12,11); 103 rarrow.moveCenter(rect.center()); 104 QTransform transform; 105 painter->drawPixmap(rarrow,arrow.transformed(transform.rotate(-90))); 106 } 107 } 108 else if(index.column() == 1) 109 { 110 QVariant var = index.data(Qt::DisplayRole); 111 if( var.type() == QVariant::String) 112 { 113 QString group = var.value<QString>(); 114 115 QFont fontsav, myfont; 116 fontsav = myfont = painter->font(); 117 myfont.setBold(true); 118 QPen pensav = painter->pen(); 119 120 painter->setPen(QColor("grey")); 121 painter->setFont(myfont); 122 123 painter->drawText(rect,Qt::AlignLeft|Qt::AlignVCenter,group); 124 125 painter->setFont(fontsav); 126 painter->setPen(pensav); 127 } 128 } 129 130 return; 131 } 132 133 QStyledItemDelegate::paint(painter, option, index); 134 } 135 }; 7 136 8 137 class Contacts : public QTreeWidget … … 13 142 explicit Contacts(QWidget *parent = 0); 14 143 ~Contacts(); 144 145 std::string getSelectedContactUUID(); 15 146 16 147 private: … … 18 149 QMap<std::string,QTreeWidgetItem *> _mapContacts; 19 150 QMap<std::string,QTreeWidgetItem *> _mapGroups; 151 ContacTreeWidgetDelegate * _delegate; 20 152 21 153 private Q_SLOTS: … … 30 162 31 163 void itemDoubleClickedSlot ( QTreeWidgetItem * item, int column ); 164 void itemClickedSlot(QTreeWidgetItem *,int); 32 165 33 166 void setFilterSlot(const QString &); -
gui/src/contacts/contacttreewidget.cpp
r177 r283 5 5 #include <util/pix.h> 6 6 7 ContactTreeWidget ::ContactTreeWidget(std::string contactId,QWidget*parent)8 :Q Widget(parent),ui(new Ui::ContactTreeWidget),_contactId(contactId)7 ContactTreeWidgetItem::ContactTreeWidgetItem(std::string contactId,QTreeWidgetItem *parent) 8 :QTreeWidgetItem(parent),_contactId(contactId) 9 9 { 10 ui->setupUi(this); 11 update(); 10 12 11 } 13 12 14 void ContactTreeWidget::update() 13 ContactTreeWidgetItem::ContactTreeWidgetItem(std::string contactId,QTreeWidget *parent) 14 :QTreeWidgetItem(parent),_contactId(contactId) 15 15 { 16 ContactList contactList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactList(); 17 Contact * contact = ContactListHelper::getCopyOfContact(contactList, _contactId); 18 if(contact) 19 { 20 if(contact->getAlias().empty()) 21 ui->labelDisplayName->setText(QString::fromStdString(contact->getDisplayName())); 22 else 23 ui->labelDisplayName->setText(QString::fromStdString(contact->getAlias())); 24 QPixmap pix; 25 if(pix.loadFromData(contact->getIcon().getData())) 26 ui->labelAvatar->setPixmap(pix); 27 28 IMContactList imContactList = contact->getIMContactList(); 29 for(IMContactList::iterator it = imContactList.begin() ; it != imContactList.end() ; it ++) 30 { 31 IMContact imContact = *it; 32 ImContactButton * imContactButton; 33 34 if(!_map.contains(imContact.getUUID())) 35 { 36 imContactButton = new ImContactButton; 37 _map.insert(imContact.getUUID(),imContactButton); 38 ui->layoutProtocol->addWidget(imContactButton); 39 } 40 else 41 imContactButton = _map.value(imContact.getUUID()); 42 43 imContactButton->setPixBackground(Pix::getAccountPix(imContact.getAccountType())); 44 imContactButton->setPixPresence(Pix::getPresencePix(imContact.getPresenceState())); 45 } 46 } 47 OWSAFE_DELETE(contact); 16 48 17 } 49 18 50 ContactTreeWidget ::~ContactTreeWidget()19 ContactTreeWidgetItem::~ContactTreeWidgetItem() 51 20 { 52 delete ui; 21 53 22 } 54 23 55 void ContactTreeWidget::changeEvent(QEvent *e) 24 QVariant ContactTreeWidgetItem::data ( int column, int role ) const 56 25 { 57 QWidget::changeEvent(e); 26 if(role == Qt::UserRole) 27 return true; 28 29 if(column == 1 && role == Qt::DisplayRole) 30 { 31 ContactList contactList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactList(); 32 Contact * contact = ContactListHelper::getCopyOfContact(contactList, _contactId); 33 if(contact) 34 { 35 std::string alias = contact->getAlias(); 36 if(alias.empty()) 37 alias = contact->getDisplayName(); 38 39 return QString::fromStdString(alias); 40 } 41 } 42 else if (column == 0 && role == Qt::DecorationRole) 43 { 44 ContactList contactList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactList(); 45 Contact * contact = ContactListHelper::getCopyOfContact(contactList, _contactId); 46 if(contact) 47 { 48 return Pix::getPresencePix(contact->getPresenceState()); 49 } 50 } 51 else if (column == 2 && role == Qt::DecorationRole) 52 { 53 ContactList contactList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactList(); 54 Contact * contact = ContactListHelper::getCopyOfContact(contactList, _contactId); 55 if(contact) 56 { 57 QPixmap pix; 58 if(!pix.loadFromData(contact->getIcon().getData())) 59 pix = QPixmap(":/contact/contact.png"); 60 61 return pix.scaled(31,31,Qt::KeepAspectRatio,Qt::SmoothTransformation); 62 } 63 } 64 65 return QTreeWidgetItem::data(column,role); 66 } 67 68 69 70 /*void ContactTreeWidgetItem::changeEvent(QEvent *e) 71 { 72 //QWidget::changeEvent(e); 58 73 switch (e->type()) { 59 74 case QEvent::LanguageChange: 60 ui->retranslateUi(this);75 //ui->retranslateUi(this); 61 76 break; 62 77 default: 63 78 break; 64 79 } 65 } 80 }*/ -
gui/src/contacts/contacttreewidget.h
r177 r283 5 5 #include <contacts/imcontactbutton.h> 6 6 7 namespace Ui { 8 class ContactTreeWidget; 9 } 7 class ContactTreeWidgetItem : public QTreeWidgetItem { 10 8 11 class ContactTreeWidget : public QWidget {12 Q_OBJECT13 9 public: 14 explicit ContactTreeWidget(std::string contactId,QWidget *parent = 0);15 ~ContactTreeWidget();16 void update();10 ContactTreeWidgetItem(std::string contactId,QTreeWidgetItem *parent); 11 ContactTreeWidgetItem(std::string contactId,QTreeWidget *parent); 12 ~ContactTreeWidgetItem(); 17 13 18 protected: 19 void changeEvent(QEvent *e); 14 // void update(); 15 16 QVariant data ( int column, int role ) const; 17 18 //protected: 19 // void changeEvent(QEvent *e); 20 20 21 21 private: 22 Ui::ContactTreeWidget *ui;23 22 std::string _contactId; 24 25 QMap<std::string,ImContactButton*> _map;26 23 }; 27 24 -
gui/src/contacts/grouptreewidget.cpp
r177 r283 1 1 #include "grouptreewidget.h" 2 #include "ui_grouptreewidget.h"2 #include <coip/coip.h> 3 3 4 GroupTreeWidget::GroupTreeWidget(QString label,QWidget *parent) : 5 QWidget(parent), 6 ui(new Ui::GroupTreeWidget) 4 GroupTreeWidget::GroupTreeWidget(std::string groupId,QTreeWidget *parent) 5 :QTreeWidgetItem(parent),_groupId(groupId) 7 6 { 8 ui->setupUi(this); 9 ui->label->setText(label); 7 setExpanded(true); 10 8 } 11 9 12 10 GroupTreeWidget::~GroupTreeWidget() 13 11 { 14 delete ui;12 15 13 } 16 14 17 void GroupTreeWidget::changeEvent(QEvent *e) 15 QVariant GroupTreeWidget::data ( int column, int role ) const 16 { 17 if(role == Qt::UserRole) 18 return false; 19 20 else if(role == Qt::DisplayRole) 21 { 22 if(column == 1) 23 { 24 ContactGroupList contactGroupList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactGroupList(); 25 26 std::map<std::string, std::string>::iterator it = contactGroupList.find(_groupId); 27 28 if(it != contactGroupList.end()) 29 return QVariant(QString::fromStdString((*it).second)); 30 } 31 } 32 else if(role == Qt::DisplayRole +1) 33 { 34 return isExpanded(); 35 } 36 37 return QTreeWidgetItem::data(column,role); 38 } 39 40 /*void GroupTreeWidget::changeEvent(QEvent *e) 18 41 { 19 42 QWidget::changeEvent(e); … … 25 48 break; 26 49 } 27 } 50 }*/ -
gui/src/contacts/grouptreewidget.h
r177 r283 2 2 #define GROUPTREEWIDGET_H 3 3 4 #include <Q Widget>4 #include <QtGui> 5 5 6 namespace Ui { 7 class GroupTreeWidget; 8 } 9 10 class GroupTreeWidget : public QWidget { 11 Q_OBJECT 6 class GroupTreeWidget : public QTreeWidgetItem { 7 8 private: 9 std::string _groupId; 10 12 11 public: 13 explicit GroupTreeWidget( QString label,QWidget *parent = 0);12 explicit GroupTreeWidget(std::string groupId,QTreeWidget *parent); 14 13 ~GroupTreeWidget(); 15 16 protected: 17 void changeEvent(QEvent *e); 18 19 private: 20 Ui::GroupTreeWidget *ui; 14 15 QVariant data ( int column, int role ) const; 21 16 }; 22 17 -
gui/src/mainwindow/mainwindow.cpp
r242 r283 9 9 #include <statusbar/statusbar.h> 10 10 #include <profilebar/profilebar.h> 11 #include <account/accountmonitor.h> 11 12 #include <wizard/wizard.h> 12 13 … … 17 18 ui(new Ui::MainWindow) 18 19 { 19 ui->setupUi(this);20 ui->setupUi(this); 20 21 QWidget * widget = new QWidget; 21 22 … … 27 28 setUnifiedTitleAndToolBarOnMac(true); 28 29 _toolBar = new QToolBar; 29 _toolBar->addWidget(ProfileBar::self()); 30 _toolBar->layout()->setMargin(0); 31 _toolBar->layout()->setSpacing(0); 32 _toolBar->addWidget(ProfileBar::self()); 30 33 addToolBar(_toolBar); 31 34 #else … … 36 39 #endif 37 40 41 lay->addWidget(AccountMonitor::self()); 38 42 lay->addWidget(Contacts::self()); 39 lay->addWidget(CallBar::self());43 //lay->addWidget(CallBar::self()); 40 44 setCentralWidget(widget); 41 45 setStatusBar(StatusBar::self()); … … 43 47 ChatWindow::self(); 44 48 Calls::self(); 49 Contacts::self(); 45 50 46 connect(CallBar::self(),SIGNAL(textChangedSignal(const QString &)),Contacts::self(),SLOT(setFilterSlot(const QString &)));51 //connect(CallBar::self(),SIGNAL(textChangedSignal(const QString &)),Contacts::self(),SLOT(setFilterSlot(const QString &))); 47 52 connect(ui->actionWizard,SIGNAL(triggered()),Wizard::self(),SLOT(show())); 48 connect(ui->actionAdd,SIGNAL(triggered()),this,SLOT(actionAddContactClickedSlot())); 53 connect(StatusBar::self(),SIGNAL(addSignal()),this,SLOT(addClickedSlot())); 54 connect(StatusBar::self(),SIGNAL(chatSignal()),this,SLOT(chatClickedSlot())); 55 connect(StatusBar::self(),SIGNAL(audioSignal()),this,SLOT(audioClickedSlot())); 56 connect(StatusBar::self(),SIGNAL(videoSignal()),this,SLOT(videoClickedSlot())); 49 57 } 50 58 … … 68 76 } 69 77 70 void MainWindow::a ctionAddContactClickedSlot()78 void MainWindow::addClickedSlot() 71 79 { 72 80 ContactWidget contactWidget; 73 81 contactWidget.exec(); 82 } 83 84 void MainWindow::chatClickedSlot() 85 { 86 std::string uuid = Contacts::self()->getSelectedContactUUID(); 87 ContactList contactList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactList(); 88 89 Contact * contact = ContactListHelper::getCopyOfContact(contactList,uuid); 90 if(contact) 91 { 92 ChatWindow::self()->createNewChat(*contact); 93 } 94 OWSAFE_DELETE(contact); 95 } 96 97 void MainWindow::audioClickedSlot() 98 { 99 std::string uuid = Contacts::self()->getSelectedContactUUID(); 100 ContactList contactList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactList(); 101 102 Contact * contact = ContactListHelper::getCopyOfContact(contactList,uuid); 103 if(contact) 104 { 105 Calls::self()->createNewCallSessionWithContact(*contact); 106 } 107 OWSAFE_DELETE(contact); 108 } 109 110 void MainWindow::videoClickedSlot() 111 { 112 std::string uuid = Contacts::self()->getSelectedContactUUID(); 113 ContactList contactList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getContactList(); 114 115 Contact * contact = ContactListHelper::getCopyOfContact(contactList,uuid); 116 if(contact) 117 { 118 Calls::self()->createNewCallSessionWithContact(*contact); 119 } 120 OWSAFE_DELETE(contact); 74 121 } 75 122 -
gui/src/mainwindow/mainwindow.h
r177 r283 25 25 private Q_SLOTS: 26 26 void actionWizardClickedSlot(); 27 void actionAddContactClickedSlot(); 27 void addClickedSlot(); 28 void chatClickedSlot(); 29 void audioClickedSlot(); 30 void videoClickedSlot(); 28 31 }; 29 32 -
gui/src/mainwindow/mainwindow.ui
r177 r283 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 310</width>10 <height> 527</height>9 <width>291</width> 10 <height>354</height> 11 11 </rect> 12 12 </property> 13 13 <property name="windowTitle"> 14 <string> MainWindow</string>14 <string>QuteCom</string> 15 15 </property> 16 16 <widget class="QWidget" name="centralwidget"/> … … 20 20 <x>0</x> 21 21 <y>0</y> 22 <width> 310</width>22 <width>291</width> 23 23 <height>22</height> 24 24 </rect> -
gui/src/manager/manager.cpp
r255 r283 58 58 Coip::self()->getTConnectManager().connectAllAccounts(); 59 59 //} 60 61 60 } 62 61 -
gui/src/profilebar/avatarbutton.cpp
r177 r283 10 10 setPixFront(QPixmap(":/qute.png")); 11 11 12 _menu = new QMenu; 13 connect(_menu->addAction(QIcon(":/presence/online.png"),tr("Online")),SIGNAL(triggered()),this,SLOT(onlineClicked())); 14 connect(_menu->addAction(QIcon(":/presence/away.png"),tr("Away")),SIGNAL(triggered()),this,SLOT(awayClicked())); 15 connect(_menu->addAction(QIcon(":/presence/donotdisturb.png"),tr("Do not disturb")),SIGNAL(triggered()),this,SLOT(doNotDisturbClicked())); 16 connect(_menu->addAction(QIcon(":/presence/invisible.png"),tr("Invisible")),SIGNAL(triggered()),this,SLOT(invisibleClicked())); 17 connect(_menu->addAction(QIcon(":/presence/offline.png"),tr("Offline")),SIGNAL(triggered()),this,SLOT(offlineClicked())); 18 _menu->addSeparator(); 12 19 13 _menu->addAction("change avatar"); 20 14 } -
gui/src/profilebar/profilebar.cpp
r255 r283 9 9 ui->setupUi(this); 10 10 11 connect(&Coip::self()->getTUserProfileManager(), SIGNAL(userProfileSetSignal(UserProfile)),12 this,SLOT(userProfileSetSlot(UserProfile)));13 connect( &Coip::self()->getTUserProfileManager().getTAccountManager(), SIGNAL(accountAddedSignal(std::string)),14 this,SLOT(accountAddedSlot(std::string)));15 connect( &Coip::self()->getTUserProfileManager().getTAccountManager(), SIGNAL(accountRemovedSignal(std::string)),16 this,SLOT(accountRemovedSlot(std::string)));11 QMenu * _menu = new QMenu; 12 connect(_menu->addAction(QIcon(":/presence/online.png"),tr("Online")),SIGNAL(triggered()),this,SLOT(onlineClicked())); 13 connect(_menu->addAction(QIcon(":/presence/away.png"),tr("Away")),SIGNAL(triggered()),this,SLOT(awayClicked())); 14 connect(_menu->addAction(QIcon(":/presence/donotdisturb.png"),tr("Do not disturb")),SIGNAL(triggered()),this,SLOT(doNotDisturbClicked())); 15 connect(_menu->addAction(QIcon(":/presence/invisible.png"),tr("Invisible")),SIGNAL(triggered()),this,SLOT(invisibleClicked())); 16 connect(_menu->addAction(QIcon(":/presence/offline.png"),tr("Offline")),SIGNAL(triggered()),this,SLOT(offlineClicked())); 17 17 18 _avatarButton = new AvatarButton(ui->widgetAvatar);18 ui->pushButtonPresence->setMenu(_menu); 19 19 20 userProfileSetSlot(Coip::self()->getTUserProfileManager().getCopyOfUserProfile()); 20 connect(&Coip::self()->getTConnectManager(), 21 SIGNAL(accountConnectionStateSignal(std::string, EnumConnectionState::ConnectionState)),this, 22 SLOT(accountConnectionStateSlot(std::string, EnumConnectionState::ConnectionState))); 23 24 UserProfile profile = Coip::self()->getTUserProfileManager().getCopyOfUserProfile(); 25 std::string alias = profile.getAlias(); 26 if(alias.empty()) 27 alias = "set your alias !"; 28 29 ui->labelDisplayName->setText(QString::fromStdString(alias)); 30 31 ui->labelAvatar->setPixmap(QPixmap(":/contact/contact.png").scaled(31,31,Qt::KeepAspectRatio,Qt::SmoothTransformation)); 21 32 } 22 33 … … 24 35 { 25 36 delete ui; 26 delete _avatarButton;27 37 } 28 38 29 void ProfileBar:: userProfileSetSlot(UserProfile userprofile)39 void ProfileBar::accountConnectionStateSlot(std::string accountId, EnumConnectionState::ConnectionState state) 30 40 { 31 AccountList accountList = userprofile.getAccountList(); 32 for(std::list<Account>::iterator it = accountList.begin(); it != accountList.end() ; it ++) 41 if(state == EnumConnectionState::ConnectionStateConnected) 33 42 { 34 Account account = *it; 35 AccountButton * accountButton = new AccountButton(account.getUUID(),account.getAccountType()); 36 _map.insert(account.getUUID(),accountButton); 37 ui->horizontalLayout->addWidget(accountButton); 43 ui->pushButtonPresence->setText("connected"); 44 ui->labelPresence->setPixmap(QPixmap(":/presence/online.png")); 38 45 } 39 46 } 40 47 41 void ProfileBar::accountAddedSlot(std::string accountId) 42 { 43 if(!_map.contains(accountId)) 48 void ProfileBar::updatePresenceState(EnumPresenceState::PresenceState presenceState) 49 { 50 AccountList accountList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getAccountList(); 51 for(AccountList::iterator it = accountList.begin() ; it != accountList.end(); it++) 44 52 { 45 AccountList accountList = Coip::self()->getTUserProfileManager().getCopyOfUserProfile().getAccountList(); 46 Account * account = AccountListHelper::getCopyOfAccount(accountList, accountId); 47 if(account) 53 Account account = *it; 54 55 account.setPresenceState(presenceState); 56 Coip::self()->getTUserProfileManager().getTAccountManager().update(account,EnumUpdateSection::UpdateSectionPresenceState); 57 58 if(presenceState == EnumPresenceState::PresenceStateOffline) 48 59 { 49 AccountButton * accountButton = new AccountButton(accountId,account->getAccountType()); 50 _map.insert(accountId,accountButton); 51 ui->horizontalLayout->addWidget(accountButton); 60 Coip::self()->getTConnectManager().disconnect(account.getUUID()); 52 61 } 53 } 62 else 63 { 64 if(account.getConnectionState() != EnumConnectionState::ConnectionStateConnected) 65 { 66 Coip::self()->getTConnectManager().connect(account.getUUID()); 67 } 68 } 69 } 54 70 } 55 71 56 void ProfileBar::accountRemovedSlot(std::string accountId) 72 void ProfileBar::onlineClicked() 73 { 74 updatePresenceState(EnumPresenceState::PresenceStateOnline); 75 } 76 77 void ProfileBar::awayClicked() 57 78 { 58 if(_map.contains(accountId)) 59 delete _map.take(accountId); 79 updatePresenceState(EnumPresenceState::PresenceStateAway); 80 } 81 82 void ProfileBar::doNotDisturbClicked() 83 { 84 updatePresenceState(EnumPresenceState::PresenceStateDoNotDisturb); 85 } 86 87 void ProfileBar::invisibleClicked() 88 { 89 updatePresenceState(EnumPresenceState::PresenceStateInvisible); 90 } 91 92 void ProfileBar::offlineClicked() 93 { 94 updatePresenceState(EnumPresenceState::PresenceStateOffline); 60 95 } 61 96 -
gui/src/profilebar/profilebar.h
r177 r283 4 4 #include <QWidget> 5 5 #include <coip/coip.h> 6 #include <profilebar/accountbutton.h>7 #include <profilebar/avatarbutton.h>8 6 9 7 namespace Ui { … … 24 22 Ui::ProfileBar *ui; 25 23 static ProfileBar * _self; 26 QMap<std::string,AccountButton*> _map;27 AvatarButton * _avatarButton;24 25 void updatePresenceState(EnumPresenceState::PresenceState presenceState); 28 26 29 27 private Q_SLOTS: 30 void userProfileSetSlot(UserProfile); 31 32 void accountAddedSlot(std::string accountId); 33 void accountRemovedSlot(std::string accountId); 28 void accountConnectionStateSlot(std::string accountId, EnumConnectionState::ConnectionState state); 29 void onlineClicked(); 30 void awayClicked(); 31 void doNotDisturbClicked(); 32 void invisibleClicked(); 33 void offlineClicked(); 34 34 }; 35 35 -
gui/src/profilebar/profilebar.ui
r177 r283 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 442</width>10 <height> 50</height>9 <width>234</width> 10 <height>36</height> 11 11 </rect> 12 </property> 13 <property name="sizePolicy"> 14 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> 15 <horstretch>0</horstretch> 16 <verstretch>0</verstretch> 17 </sizepolicy> 12 18 </property> 13 19 <property name="minimumSize"> 14 20 <size> 15 21 <width>0</width> 16 <height> 50</height>22 <height>36</height> 17 23 </size> 18 24 </property> … … 28 34 <layout class="QHBoxLayout" name="horizontalLayout_2"> 29 35 <property name="spacing"> 30 <number>5</number>31 </property>32 <property name="leftMargin">33 <number>5</number>34 </property>35 <property name="topMargin">36 36 <number>0</number> 37 37 </property> 38 <property name="rightMargin"> 39 <number>0</number> 40 </property> 41 <property name="bottomMargin"> 38 <property name="margin"> 42 39 <number>0</number> 43 40 </property> 44 41 <item> 45 <widget class="QWidget" name="widgetAvatar" native="true"> 42 <layout class="QHBoxLayout" name="horizontalLayout"> 43 <property name="spacing"> 44 <number>0</number> 45 </property> 46 <property name="sizeConstraint"> 47 <enum>QLayout::SetDefaultConstraint</enum> 48 </property> 49 <property name="leftMargin"> 50 <number>0</number> 51 </property> 52 <item> 53 <widget class="QLabel" name="labelPresence"> 54 <property name="text"> 55 <string/> 56 </property> 57 <property name="pixmap"> 58 <pixmap resource="../../resources/pix/pix.qrc">:/presence/offline.png</pixmap> 59 </property> 60 </widget> 61 </item> 62 <item> 63 <layout class="QVBoxLayout" name="verticalLayout"> 64 <property name="spacing"> 65 <number>0</number> 66 </property> 67 <property name="leftMargin"> 68 <number>6</number> 69 </property> 70 <item> 71 <widget class="QLabel" name="labelDisplayName"> 72 <property name="sizePolicy"> 73 <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> 74 <horstretch>0</horstretch> 75 <verstretch>0</verstretch> 76 </sizepolicy> 77 </property> 78 <property name="text"> 79 <string>Set your alias !</string> 80 </property> 81 <property name="alignment"> 82 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> 83 </property> 84 </widget> 85 </item> 86 <item> 87 <widget class="QPushButton" name="pushButtonPresence"> 88 <property name="sizePolicy"> 89 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 90 <horstretch>0</horstretch> 91 <verstretch>0</verstretch> 92 </sizepolicy> 93 </property> 94 <property name="font"> 95 <font> 96 <pointsize>11</pointsize> 97 </font> 98 </property> 99 <property name="styleSheet"> 100 <string notr="true">QPushButton { 101 border-radius: 6px; 102 text-align: left; 103 margin: 0px; 104 } 105 106 QPushButton:pressed { 107 background-color: grey; 108 }</string> 109 </property> 110 <property name="text"> 111 <string>disconnected</string> 112 </property> 113 <property name="flat"> 114 <bool>true</bool> 115 </property> 116 </widget> 117 </item> 118 </layout> 119 </item> 120 </layout> 121 </item> 122 <item> 123 <spacer name="horizontalSpacer"> 124 <property name="orientation"> 125 <enum>Qt::Horizontal</enum> 126 </property> 127 <property name="sizeHint" stdset="0"> 128 <size> 129 <width>0</width> 130 <height>20</height> 131 </size> 132 </property> 133 </spacer> 134 </item> 135 <item> 136 <widget class="QLabel" name="labelAvatar"> 46 137 <property name="minimumSize"> 47 138 <size> 48 <width> 50</width>49 <height> 50</height>139 <width>31</width> 140 <height>31</height> 50 141 </size> 51 142 </property> 52 143 <property name="maximumSize"> 53 144 <size> 54 <width> 50</width>55 <height> 50</height>145 <width>31</width> 146 <height>31</height> 56 147 </size> 57 148 </property> 149 <property name="text"> 150 <string/> 151 </property> 152 <property name="scaledContents"> 153 <bool>false</bool> 154 </property> 58 155 </widget> 59 </item>60 <item>61 <layout class="QVBoxLayout" name="verticalLayout">62 <property name="spacing">63 <number>0</number>64 </property>65 <item>66 <layout class="QHBoxLayout" name="horizontalLayout"/>67 </item>68 </layout>69 156 </item> 70 157 </layout> … … 72 159 <resources> 73 160 <include location="../../resources/pix/pix.qrc"/> 161 <include location="../../resources/pix/pix.qrc"/> 162 <include location="../../resources/pix/pix.qrc"/> 163 <include location="../../resources/pix/pix.qrc"/> 164 <include location="../../resources/pix/pix.qrc"/> 165 <include location="../../resources/pix/pix.qrc"/> 166 <include location="../../resources/pix/pix.qrc"/> 167 <include location="../../resources/pix/pix.qrc"/> 168 <include location="../../resources/pix/pix.qrc"/> 169 <include location="../../resources/pix/pix.qrc"/> 170 <include location="../../resources/pix/pix.qrc"/> 171 <include location="../../resources/pix/pix.qrc"/> 74 172 </resources> 75 173 <connections/> -
gui/src/statusbar/statusbar.cpp
r248 r283 13 13 addPermanentWidget(_widget); 14 14 15 connect(ui->dialAudioInput,SIGNAL(valueChanged(int)),this,SLOT(dialAudioInputChangedSLot(int))); 16 connect(ui->dialAudioOutput,SIGNAL(valueChanged(int)),this,SLOT(dialAudioOutputChangedSLot(int))); 15 connect(ui->pushButtonAdd,SIGNAL(clicked()),this,SIGNAL(addSignal())); 16 connect(ui->pushButtonChat,SIGNAL(clicked()),this,SIGNAL(chatSignal())); 17 connect(ui->pushButtonAudio,SIGNAL(clicked()),this,SIGNAL(audioSignal())); 18 connect(ui->pushButtonVideo,SIGNAL(clicked()),this,SIGNAL(videoSignal())); 19 //connect(ui->dialAudioOutput,SIGNAL(valueChanged(int)),this,SLOT(dialAudioOutputChangedSLot(int))); 17 20 } 18 21 -
gui/src/statusbar/statusbar.h
r248 r283 32 32 33 33 static StatusBar * _self; 34 35 Q_SIGNALS: 36 void addSignal(); 37 void chatSignal(); 38 void audioSignal(); 39 void videoSignal(); 40 34 41 }; 35 42 -
gui/src/statusbar/statusbar.ui
r248 r283 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 100</width>10 <height> 25</height>9 <width>320</width> 10 <height>32</height> 11 11 </rect> 12 </property> 13 <property name="sizePolicy"> 14 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> 15 <horstretch>10</horstretch> 16 <verstretch>0</verstretch> 17 </sizepolicy> 12 18 </property> 13 19 <property name="maximumSize"> … … 28 34 </property> 29 35 <item> 30 <widget class="QDial" name="dialAudioInput"> 31 <property name="maximumSize"> 36 <widget class="QPushButton" name="pushButtonAdd"> 37 <property name="sizePolicy"> 38 <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> 39 <horstretch>0</horstretch> 40 <verstretch>0</verstretch> 41 </sizepolicy> 42 </property> 43 <property name="minimumSize"> 32 44 <size> 33 <width> 25</width>34 <height> 25</height>45 <width>35</width> 46 <height>0</height> 35 47 </size> 36 48 </property> 37 <property name="toolTip"> 38 <string>Input</string> 49 <property name="styleSheet"> 50 <string notr="true">QPushButton { 51 border: 1px solid #8f8f91; 52 53 border-radius: 6px; 54 }</string> 39 55 </property> 40 <property name=" value">41 < number>50</number>56 <property name="text"> 57 <string>+</string> 42 58 </property> 43 59 </widget> 44 60 </item> 45 61 <item> 46 <widget class="QDial" name="dialAudioOutput"> 62 <spacer name="horizontalSpacer"> 63 <property name="orientation"> 64 <enum>Qt::Horizontal</enum> 65 </property> 66 <property name="sizeHint" stdset="0"> 67 <size> 68 <width>40</width> 69 <height>20</height> 70 </size> 71 </property> 72 </spacer> 73 </item> 74 <item> 75 <widget class="QPushButton" name="pushButtonChat"> 76 <property name="sizePolicy"> 77 <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> 78 <horstretch>0</horstretch> 79 <verstretch>0</verstretch> 80 </sizepolicy> 81 </property> 47 82 <property name="maximumSize"> 48 83 <size> 49 <width> 25</width>50 <height> 25</height>84 <width>16777215</width> 85 <height>16777215</height> 51 86 </size> 52 87 </property> 53 <property name="toolTip"> 54 <string>Output</string> 88 <property name="styleSheet"> 89 <string notr="true">QPushButton { 90 border: 1px solid #8f8f91; 91 92 border-top-left-radius: 6px; 93 border-bottom-left-radius: 6px; 94 border-top-right-radius: 0px; 95 border-bottom-right-radius: 0px; 96 } 97 </string> 55 98 </property> 56 <property name="value"> 57 <number>50</number> 99 <property name="text"> 100 <string/> 101 </property> 102 <property name="flat"> 103 <bool>true</bool> 58 104 </property> 59 105 </widget> 60 106 </item> 107 <item> 108 <widget class="QPushButton" name="pushButtonAudio"> 109 <property name="sizePolicy"> 110 <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> 111 <horstretch>0</horstretch> 112 <verstretch>0</verstretch> 113 </sizepolicy> 114 </property> 115 <property name="styleSheet"> 116 <string notr="true">QPushButton { 117 border: 1px solid #8f8f91; 118 119 border-top-left-radius: 0px; 120 border-bottom-left-radius: 0px; 121 border-top-right-radius: 0px; 122 border-bottom-right-radius: 0px; 123 } 124 </string> 125 </property> 126 <property name="text"> 127 <string/> 128 </property> 129 <property name="flat"> 130 <bool>true</bool> 131 </property> 132 </widget> 133 </item> 134 <item> 135 <widget class="QPushButton" name="pushButtonVideo"> 136 <property name="sizePolicy"> 137 <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> 138 <horstretch>0</horstretch> 139 <verstretch>0</verstretch> 140 </sizepolicy> 141 </property> 142 <property name="styleSheet"> 143 <string notr="true">QPushButton { 144 border: 1px solid #8f8f91; 145 146 border-top-left-radius: 0px; 147 border-bottom-left-radius: 0px; 148 border-top-right-radius: 6px; 149 border-bottom-right-radius: 6px; 150 }</string> 151 </property> 152 <property name="text"> 153 <string/> 154 </property> 155 <property name="flat"> 156 <bool>true</bool> 157 </property> 158 </widget> 159 </item> 160 <item> 161 <spacer name="horizontalSpacer_2"> 162 <property name="orientation"> 163 <enum>Qt::Horizontal</enum> 164 </property> 165 <property name="sizeHint" stdset="0"> 166 <size> 167 <width>40</width> 168 <height>20</height> 169 </size> 170 </property> 171 </spacer> 172 </item> 61 173 </layout> 62 174 </widget> 63 <resources/> 175 <resources> 176 <include location="../../resources/pix/pix.qrc"/> 177 </resources> 64 178 <connections/> 65 179 </ui> -
gui/src/wizard/audiopage.cpp
r251 r283 11 11 ui->setupUi(this); 12 12 13 QMap< int,QString> mapInputs = Coip::self()->getTMediaManager().getAudioInputs();14 for (QMap< int,QString>::iterator it = mapInputs.begin() ; it != mapInputs.end(); it++)13 QMap<QString,QString> mapInputs = Coip::self()->getTMediaManager().getAudioInputs(); 14 for (QMap<QString,QString>::iterator it = mapInputs.begin() ; it != mapInputs.end(); it++) 15 15 { 16 16 ui->comboBoxInput->addItem(it.value(),it.key()); … … 18 18 } 19 19 20 QMap< int,QString> mapOutputs = Coip::self()->getTMediaManager().getAudioOutputs();21 for (QMap< int,QString>::iterator it = mapOutputs.begin() ; it != mapOutputs.end(); it++)20 QMap<QString,QString> mapOutputs = Coip::self()->getTMediaManager().getAudioOutputs(); 21 for (QMap<QString,QString>::iterator it = mapOutputs.begin() ; it != mapOutputs.end(); it++) 22 22 { 23 23 ui->comboBoxOutput->addItem(it.value(),it.key()); … … 25 25 } 26 26 27 int index = ui->comboBoxInput->findData(Coip::self()->getTMediaManager().getAudioInputId());28 if(index > -1)29 ui->comboBoxInput->setCurrentIndex(index);27 //QString index = ui->comboBoxInput->findData(Coip::self()->getTMediaManager().getAudioInput()); 28 //if(index > -1) 29 // ui->comboBoxInput->setCurrentIndex(index); 30 30 31 index = ui->comboBoxOutput->findData(Coip::self()->getTMediaManager().getAudioOutputId());32 if(index > -1)33 ui->comboBoxOutput->setCurrentIndex(index);31 //index = ui->comboBoxOutput->findData(Coip::self()->getTMediaManager().getAudioOutput()); 32 //if(index > -1) 33 // ui->comboBoxOutput->setCurrentIndex(index); 34 34 35 index= ui->comboBoxRinging->findData(Coip::self()->getTMediaManager().getAudioRingerId());36 if(index > -1)37 ui->comboBoxRinging->setCurrentIndex(index);35 //QString = ui->comboBoxRinging->findData(Coip::self()->getTMediaManager().getAudioRingerId()); 36 //if(index > -1) 37 // ui->comboBoxRinging->setCurrentIndex(index); 38 38 39 39 } … … 57 57 { 58 58 QVariant data = ui->comboBoxInput->itemData(index); 59 Coip::self()->getTMediaManager().setAudioInput Id(data.toInt());59 Coip::self()->getTMediaManager().setAudioInput(data.toString()); 60 60 } 61 61 … … 64 64 { 65 65 QVariant data = ui->comboBoxOutput->itemData(index); 66 Coip::self()->getTMediaManager().setAudioOutput Id(data.toInt());66 Coip::self()->getTMediaManager().setAudioOutput(data.toString()); 67 67 } 68 68 … … 70 70 if(index > -1) 71 71 { 72 QVariant data = ui->comboBoxRinging->itemData(index);73 Coip::self()->getTMediaManager().setAudioRingerId(data.toInt());72 //QVariant data = ui->comboBoxRinging->itemData(index); 73 //Coip::self()->getTMediaManager().setAudioRinger(data.toString()); 74 74 } 75 75 -
gui/src/wizard/videopage.cpp
r249 r283 11 11 ui->setupUi(this); 12 12 13 QMap< int,QString> map = Coip::self()->getTMediaManager().getVideoWebcams();14 for (QMap< int,QString>::iterator it = map.begin() ; it != map.end(); it++)13 QMap<QString,QString> map = Coip::self()->getTMediaManager().getVideoWebcams(); 14 for (QMap<QString,QString>::iterator it = map.begin() ; it != map.end(); it++) 15 15 ui->comboBox->addItem(it.value(),it.key()); 16 16 … … 42 42 QVariant data = ui->comboBox->itemData(index); 43 43 44 Coip::self()->getTMediaManager().setVideoWebcam Id(data.toInt());44 Coip::self()->getTMediaManager().setVideoWebcam(data.toString()); 45 45 //Config::self()->set(CoIpManagerConfig::VIDEO_WEBCAM_DEVICE_KEY,ui->comboBox->currentText().toStdString()); 46 46 //Config::self()->save();
Note: See TracChangeset
for help on using the changeset viewer.
