Changeset 283:312974380d4f in qutecom-coip


Ignore:
Timestamp:
Jul 28, 2011 2:30:42 AM (23 months ago)
Author:
laurent <laurent@…>
Branch:
default
Message:

update gui

Location:
gui
Files:
7 added
30 edited

Legend:

Unmodified
Added
Removed
  • gui/resources/CMakeLists.txt

    r177 r283  
    33) 
    44 
    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) 
     1create_static_library(pix) 
    22 
    3 ow_use_private_libraries( 
     3use_private_libraries( 
    44        qtgui 
    55) 
    66 
    7 ow_use_public_libraries( 
     7use_public_libraries( 
    88        qt4 
    99) 
    1010 
    11 ow_add_public_include_dirs( 
     11add_public_include_dirs( 
    1212        ${CMAKE_CURRENT_BINARY_DIR} 
    1313        ${CMAKE_CURRENT_SOURCE_DIR} 
     
    1818) 
    1919 
    20 ow_create_project_binary() 
     20create_project_binary() 
  • gui/resources/pix/contact/contact.png

    • Property exe deleted
  • gui/resources/pix/pix.qrc

    r176 r283  
    3636        <file>call/callButtonPressed.png</file> 
    3737        <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> 
    3847    </qresource> 
    3948</RCC> 
  • gui/src/CMakeLists.txt

    r249 r283  
    11set(BINARY_NAME ${APPLICATION_NAME}) 
    22 
    3 ow_create_executable(QuteCom) 
     3create_executable(QuteCom) 
    44 
    5 ow_use_private_libraries( 
     5use_private_libraries( 
    66        owsystem 
    77        owsettings 
     
    1717endif (CRASH_REPORT_SUPPORT) 
    1818 
    19 ow_add_public_include_dirs( 
     19add_public_include_dirs( 
    2020        ${CMAKE_CURRENT_BINARY_DIR} 
    2121        ${CMAKE_CURRENT_SOURCE_DIR} 
     
    2323 
    2424qt4_wrap_cpp(${PROJECT_NAME}_SRCS 
     25        account/accountmonitor.h 
     26        account/accountmonitoritem.h 
    2527        call/callbutton.h 
    2628        call/calls.h 
     
    5860) 
    5961 
    60 ow_add_sources( 
     62add_sources( 
     63        account/accountmonitor.cpp 
     64        account/accountmonitoritem.cpp 
    6165        call/callbutton.cpp 
    6266        call/calls.cpp 
     
    96100 
    97101qt4_wrap_ui(${PROJECT_NAME}_SRCS 
     102        account/accountmonitoritem.ui 
    98103        call/callwidget.ui 
    99104        callbar/callbar.ui 
     
    116121) 
    117122 
    118 ow_create_project_binary(WIN32 MACOSX_BUNDLE) 
     123create_project_binary(WIN32 MACOSX_BUNDLE) 
  • gui/src/buildid/CMakeLists.txt

    r267 r283  
    1 ow_create_static_library(buildid) 
     1create_static_library(buildid) 
    22 
    3 ow_use_private_libraries(        
    4         tinyxml 
     3use_private_libraries(   
     4#       tinyxml 
    55        curl 
    66        ffmpeg 
     
    99 
    1010if(LIBPURPLE_SUPPORT) 
    11 ow_use_private_libraries( 
     11use_private_libraries( 
    1212        glib2 
    1313        libpurple 
     
    1616 
    1717if (NOT APPLE AND OWSOUND_PORTAUDIO_SUPPORT) 
    18         ow_use_private_libraries( 
     18        use_private_libraries( 
    1919                portaudio 
    2020        ) 
    2121endif (NOT APPLE AND OWSOUND_PORTAUDIO_SUPPORT) 
    2222 
    23 if (BUILDID_SUPPORT) 
    24         ow_add_private_definitions( 
    25                 -DDD_BUILDID=${CURRENT_DATE_TIME}LL 
    26                 -DDD_VERSION=${APPLICATION_VERSION} 
    27                 -DDD_REVISION=${SVN_REVISION} 
    28                 -DDD_SOFTPHONE_NAME=qutecom 
    29         ) 
    30 else (BUILDID_SUPPORT) 
    31         ow_add_private_definitions( 
    32                 -DDD_BUILDID=0LL 
    33                 -DDD_VERSION=0 
    34                 -DDD_REVISION=0 
    35                 -DDD_SOFTPHONE_NAME=qutecom 
    36         ) 
    37 endif (BUILDID_SUPPORT) 
    3823 
    39 ow_add_public_include_dirs( 
     24add_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 
     31add_public_include_dirs( 
    4032        ${CMAKE_CURRENT_BINARY_DIR} 
    4133        ${CMAKE_CURRENT_SOURCE_DIR} 
    4234) 
    4335 
    44 ow_add_sources( 
     36add_sources( 
    4537        buildid.cpp 
    4638) 
    4739 
    48 ow_create_project_binary() 
     40create_project_binary() 
  • gui/src/buildid/buildid.cpp

    r267 r283  
    55 
    66#include <curl/curl.h> 
    7 #if !defined(PORTAUDIO_SUPPORT) 
     7#if defined(PORTAUDIO_SUPPORT) 
    88        #include <portaudio.h> 
    99#endif 
    10 #include <tinyxml.h> 
    1110extern "C" { 
    12 #include <avcodec.h> 
     11#include <libavcodec/avcodec.h> 
    1312#if defined (LIBPURPLE_SUPPORT) 
    1413        #include <glib.h> 
     
    2019#define stringize(x) stringize2(x) 
    2120 
    22 const unsigned long long BuildId::getBuildId() { 
     21const char * BuildId::getBuildId() { 
    2322        return DD_BUILDID; 
    2423} 
    2524 
    2625const char * BuildId::getVersion() { 
    27         return stringize(DD_VERSION); 
     26        return DD_VERSION; 
    2827} 
    2928 
    3029const char * BuildId::getHgRevision() { 
    31         return stringize(DD_REVISION); 
     30        return DD_REVISION; 
    3231} 
    3332 
    3433const char * BuildId::getSoftphoneName() { 
    35         return stringize(DD_SOFTPHONE_NAME); 
     34        return DD_SOFTPHONE_NAME; 
    3635} 
    3736 
     
    6968        return version.c_str(); 
    7069} 
    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  
    66public: 
    77 
    8     static const unsigned long long getBuildId(); 
     8    static const char * getBuildId(); 
    99    static const char * getVersion(); 
    1010    static const char * getHgRevision(); 
     
    1515    static const char * getPortaudioVersion(); 
    1616    static const char * getAvcodecVersion(); 
    17     static const char * getTinyXmlVersion(); 
    1817}; 
    1918 
  • gui/src/call/callwidget.cpp

    r273 r283  
    1111        _lastStatus = EnumPhoneCallState::PhoneCallStateIncoming; 
    1212         
    13     ui->setupUi(this); 
     13   // ui->setupUi(this); 
    1414 
    1515        _labelMsg = new QLabel; 
  • gui/src/chat/chatwindow.cpp

    r177 r283  
    4040} 
    4141 
    42 TChatSession * ChatWindow::createNewChat(IMContact imContact) 
     42TChatSession * ChatWindow::createNewChat(Contact contact) 
    4343{ 
    4444        QList<TChatSession*> chatSessionList = _map.keys(); 
    4545        for(QList<TChatSession*>::iterator it = chatSessionList.begin() ; it != chatSessionList.end() ; it++) 
    4646        { 
    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); 
    4951                        _tabWidget->setCurrentWidget(_map.value(*it)); 
    5052                        show(); 
     
    5456        } 
    5557         
    56         Contact contact; 
    57         contact.addIMContact(imContact); 
    5858        TChatSession * session = Coip::self()->getTChatSessionManager().createTChatSession(); 
    5959        EnumSessionError::SessionError error = session->addContact(contact); 
     
    104104{ 
    105105        Contact contact = fileSession->getContact(); 
    106         IMContact imContact = contact.getIMContactList().front(); 
    107         TChatSession * session = createNewChat(imContact); 
     106        TChatSession * session = createNewChat(contact); 
    108107         
    109108        ChatWidget * chatWidget = _map.value(session); 
  • gui/src/chat/chatwindow.h

    r177 r283  
    3535        static ChatWindow * self(); 
    3636         
    37         TChatSession * createNewChat(IMContact); 
     37        TChatSession * createNewChat(Contact); 
    3838 
    3939protected: 
  • gui/src/contacts/contacts.cpp

    r255 r283  
    99    QTreeWidget(parent) 
    1010{ 
    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); 
    1624         
    1725        setHeaderHidden(true); 
     
    3139 
    3240        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); 
    3346         
    3447        userProfileSetSlot(Coip::self()->getTUserProfileManager().getCopyOfUserProfile()); 
     
    5467{ 
    5568        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); 
    6678        } 
    6779} 
     
    7890        if(contact) 
    7991        { 
    80                 QTreeWidgetItem * item; 
     92                ContactTreeWidgetItem * item; 
    8193                 
    8294                QTreeWidgetItem * root = NULL; 
    8395                if(contact->getGroupList().size()) 
    84                         root = _mapContacts.value(contact->getGroupList().front());      
     96                        root = _mapGroups.value(contact->getGroupList().front());        
    8597                 
    8698                if(root) 
    87                         item = new QTreeWidgetItem(root); 
     99                        item = new ContactTreeWidgetItem(contactId,root); 
    88100                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                 
    95103                if(contact->getAlias().empty()) 
    96104                        item->setText(0,QString::fromStdString(contact->getDisplayName())); 
     
    124132                                item->setText(0,QString::fromStdString(contact->getAlias())); 
    125133                 
    126                         QWidget * widget = itemWidget(_mapContacts.value(contactId),0); 
    127                         if(widget) 
    128                                 qobject_cast<ContactTreeWidget *>(widget)->update(); 
    129134                        sortItems(0,Qt::AscendingOrder); 
    130135                } 
    131136        } 
    132137        OWSAFE_DELETE(contact); 
     138} 
     139 
     140void 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    } 
    133149} 
    134150 
     
    143159                if(contact) 
    144160                { 
    145                         ChatWindow::self()->createNewChat(contact->getIMContactList().front()); 
     161                        ChatWindow::self()->createNewChat(*contact); 
    146162                } 
    147163                OWSAFE_DELETE(contact); 
    148164        } 
    149         else if(_mapGroups.values().contains(item)) 
    150         { 
    151                 if(item->isExpanded()) 
    152                         collapseItem(item); 
    153                 else 
    154                         expandItem(item); 
    155         } 
     165} 
     166 
     167std::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 ""; 
    156181} 
    157182 
  • gui/src/contacts/contacts.h

    r177 r283  
    55 
    66#include <coip/coip.h> 
     7 
     8class ContacTreeWidgetDelegate :  public QStyledItemDelegate 
     9{        
     10public: 
     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}; 
    7136 
    8137class Contacts : public QTreeWidget  
     
    13142    explicit Contacts(QWidget *parent = 0); 
    14143    ~Contacts(); 
     144     
     145    std::string getSelectedContactUUID(); 
    15146         
    16147private: 
     
    18149        QMap<std::string,QTreeWidgetItem *> _mapContacts; 
    19150        QMap<std::string,QTreeWidgetItem *> _mapGroups; 
     151        ContacTreeWidgetDelegate * _delegate; 
    20152         
    21153private Q_SLOTS: 
     
    30162         
    31163        void itemDoubleClickedSlot ( QTreeWidgetItem * item, int column ); 
     164    void itemClickedSlot(QTreeWidgetItem *,int); 
    32165         
    33166        void setFilterSlot(const QString &); 
  • gui/src/contacts/contacttreewidget.cpp

    r177 r283  
    55#include <util/pix.h> 
    66 
    7 ContactTreeWidget::ContactTreeWidget(std::string contactId,QWidget *parent)  
    8 :QWidget(parent),ui(new Ui::ContactTreeWidget),_contactId(contactId) 
     7ContactTreeWidgetItem::ContactTreeWidgetItem(std::string contactId,QTreeWidgetItem *parent)  
     8:QTreeWidgetItem(parent),_contactId(contactId) 
    99{ 
    10     ui->setupUi(this); 
    11         update(); 
     10 
    1211} 
    1312 
    14 void ContactTreeWidget::update() 
     13ContactTreeWidgetItem::ContactTreeWidgetItem(std::string contactId,QTreeWidget *parent)  
     14:QTreeWidgetItem(parent),_contactId(contactId) 
    1515{ 
    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         
    4817} 
    4918 
    50 ContactTreeWidget::~ContactTreeWidget() 
     19ContactTreeWidgetItem::~ContactTreeWidgetItem() 
    5120{ 
    52     delete ui; 
     21 
    5322} 
    5423 
    55 void ContactTreeWidget::changeEvent(QEvent *e) 
     24QVariant ContactTreeWidgetItem::data ( int column, int role ) const 
    5625{ 
    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); 
    5873    switch (e->type()) { 
    5974    case QEvent::LanguageChange: 
    60         ui->retranslateUi(this); 
     75        //ui->retranslateUi(this); 
    6176        break; 
    6277    default: 
    6378        break; 
    6479    } 
    65 } 
     80}*/ 
  • gui/src/contacts/contacttreewidget.h

    r177 r283  
    55#include <contacts/imcontactbutton.h> 
    66 
    7 namespace Ui { 
    8     class ContactTreeWidget; 
    9 } 
     7class ContactTreeWidgetItem : public QTreeWidgetItem { 
    108 
    11 class ContactTreeWidget : public QWidget { 
    12     Q_OBJECT 
    139public: 
    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(); 
    1713         
    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); 
    2020 
    2121private: 
    22     Ui::ContactTreeWidget *ui; 
    2322        std::string _contactId; 
    24          
    25         QMap<std::string,ImContactButton*> _map; 
    2623}; 
    2724 
  • gui/src/contacts/grouptreewidget.cpp

    r177 r283  
    11#include "grouptreewidget.h" 
    2 #include "ui_grouptreewidget.h" 
     2#include <coip/coip.h> 
    33 
    4 GroupTreeWidget::GroupTreeWidget(QString label,QWidget *parent) : 
    5     QWidget(parent), 
    6     ui(new Ui::GroupTreeWidget) 
     4GroupTreeWidget::GroupTreeWidget(std::string groupId,QTreeWidget *parent)  
     5:QTreeWidgetItem(parent),_groupId(groupId) 
    76{ 
    8     ui->setupUi(this); 
    9         ui->label->setText(label); 
     7    setExpanded(true); 
    108} 
    119 
    1210GroupTreeWidget::~GroupTreeWidget() 
    1311{ 
    14     delete ui; 
     12    
    1513} 
    1614 
    17 void GroupTreeWidget::changeEvent(QEvent *e) 
     15QVariant 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) 
    1841{ 
    1942    QWidget::changeEvent(e); 
     
    2548        break; 
    2649    } 
    27 } 
     50}*/ 
  • gui/src/contacts/grouptreewidget.h

    r177 r283  
    22#define GROUPTREEWIDGET_H 
    33 
    4 #include <QWidget> 
     4#include <QtGui> 
    55 
    6 namespace Ui { 
    7     class GroupTreeWidget; 
    8 } 
    9  
    10 class GroupTreeWidget : public QWidget { 
    11     Q_OBJECT 
     6class GroupTreeWidget : public QTreeWidgetItem { 
     7   
     8private: 
     9    std::string _groupId; 
     10     
    1211public: 
    13     explicit GroupTreeWidget(QString label,QWidget *parent = 0); 
     12    explicit GroupTreeWidget(std::string groupId,QTreeWidget *parent); 
    1413    ~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; 
    2116}; 
    2217 
  • gui/src/mainwindow/mainwindow.cpp

    r242 r283  
    99#include <statusbar/statusbar.h> 
    1010#include <profilebar/profilebar.h> 
     11#include <account/accountmonitor.h> 
    1112#include <wizard/wizard.h> 
    1213 
     
    1718    ui(new Ui::MainWindow) 
    1819{ 
    19     ui->setupUi(this); 
     20        ui->setupUi(this); 
    2021        QWidget * widget = new QWidget; 
    2122         
     
    2728        setUnifiedTitleAndToolBarOnMac(true); 
    2829        _toolBar = new QToolBar; 
    29         _toolBar->addWidget(ProfileBar::self()); 
     30        _toolBar->layout()->setMargin(0); 
     31        _toolBar->layout()->setSpacing(0); 
     32        _toolBar->addWidget(ProfileBar::self());         
    3033        addToolBar(_toolBar); 
    3134#else 
     
    3639#endif 
    3740 
     41        lay->addWidget(AccountMonitor::self()); 
    3842        lay->addWidget(Contacts::self()); 
    39         lay->addWidget(CallBar::self()); 
     43        //lay->addWidget(CallBar::self()); 
    4044        setCentralWidget(widget); 
    4145        setStatusBar(StatusBar::self()); 
     
    4347        ChatWindow::self(); 
    4448        Calls::self(); 
     49        Contacts::self(); 
    4550         
    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 &))); 
    4752        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())); 
    4957} 
    5058 
     
    6876} 
    6977 
    70 void MainWindow::actionAddContactClickedSlot() 
     78void MainWindow::addClickedSlot() 
    7179{ 
    7280        ContactWidget contactWidget; 
    7381        contactWidget.exec(); 
     82} 
     83 
     84void 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 
     97void 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 
     110void 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); 
    74121} 
    75122 
  • gui/src/mainwindow/mainwindow.h

    r177 r283  
    2525private Q_SLOTS: 
    2626        void actionWizardClickedSlot(); 
    27         void actionAddContactClickedSlot(); 
     27        void addClickedSlot(); 
     28        void chatClickedSlot(); 
     29        void audioClickedSlot(); 
     30        void videoClickedSlot(); 
    2831}; 
    2932 
  • gui/src/mainwindow/mainwindow.ui

    r177 r283  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>310</width> 
    10     <height>527</height> 
     9    <width>291</width> 
     10    <height>354</height> 
    1111   </rect> 
    1212  </property> 
    1313  <property name="windowTitle"> 
    14    <string>MainWindow</string> 
     14   <string>QuteCom</string> 
    1515  </property> 
    1616  <widget class="QWidget" name="centralwidget"/> 
     
    2020     <x>0</x> 
    2121     <y>0</y> 
    22      <width>310</width> 
     22     <width>291</width> 
    2323     <height>22</height> 
    2424    </rect> 
  • gui/src/manager/manager.cpp

    r255 r283  
    5858                Coip::self()->getTConnectManager().connectAllAccounts(); 
    5959        //} 
    60                  
    6160} 
    6261 
  • gui/src/profilebar/avatarbutton.cpp

    r177 r283  
    1010        setPixFront(QPixmap(":/qute.png")); 
    1111         
    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         
    1913        _menu->addAction("change avatar"); 
    2014} 
  • gui/src/profilebar/profilebar.cpp

    r255 r283  
    99    ui->setupUi(this); 
    1010                 
    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())); 
    1717         
    18         _avatarButton = new AvatarButton(ui->widgetAvatar); 
     18        ui->pushButtonPresence->setMenu(_menu); 
    1919         
    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)); 
    2132} 
    2233 
     
    2435{ 
    2536    delete ui; 
    26         delete _avatarButton; 
    2737} 
    2838 
    29 void ProfileBar::userProfileSetSlot(UserProfile userprofile) 
     39void ProfileBar::accountConnectionStateSlot(std::string accountId, EnumConnectionState::ConnectionState state) 
    3040{ 
    31         AccountList accountList = userprofile.getAccountList(); 
    32         for(std::list<Account>::iterator it = accountList.begin(); it != accountList.end() ; it ++) 
     41        if(state == EnumConnectionState::ConnectionStateConnected) 
    3342        { 
    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")); 
    3845        } 
    3946} 
    4047 
    41 void ProfileBar::accountAddedSlot(std::string accountId) 
    42 { 
    43         if(!_map.contains(accountId)) 
     48void 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++) 
    4452        { 
    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) 
    4859                { 
    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()); 
    5261                } 
    53         }                
     62                else 
     63                { 
     64                        if(account.getConnectionState() != EnumConnectionState::ConnectionStateConnected) 
     65                        { 
     66                                Coip::self()->getTConnectManager().connect(account.getUUID()); 
     67                        } 
     68                } 
     69        } 
    5470} 
    5571 
    56 void ProfileBar::accountRemovedSlot(std::string accountId) 
     72void ProfileBar::onlineClicked() 
     73{        
     74        updatePresenceState(EnumPresenceState::PresenceStateOnline); 
     75} 
     76 
     77void ProfileBar::awayClicked() 
    5778{ 
    58         if(_map.contains(accountId)) 
    59                 delete _map.take(accountId); 
     79        updatePresenceState(EnumPresenceState::PresenceStateAway); 
     80} 
     81 
     82void ProfileBar::doNotDisturbClicked() 
     83{ 
     84        updatePresenceState(EnumPresenceState::PresenceStateDoNotDisturb); 
     85} 
     86 
     87void ProfileBar::invisibleClicked() 
     88{ 
     89        updatePresenceState(EnumPresenceState::PresenceStateInvisible); 
     90} 
     91 
     92void ProfileBar::offlineClicked() 
     93{ 
     94        updatePresenceState(EnumPresenceState::PresenceStateOffline); 
    6095} 
    6196 
  • gui/src/profilebar/profilebar.h

    r177 r283  
    44#include <QWidget> 
    55#include <coip/coip.h> 
    6 #include <profilebar/accountbutton.h> 
    7 #include <profilebar/avatarbutton.h> 
    86 
    97namespace Ui { 
     
    2422    Ui::ProfileBar *ui; 
    2523        static ProfileBar * _self; 
    26         QMap<std::string,AccountButton*> _map; 
    27         AvatarButton * _avatarButton; 
     24         
     25        void updatePresenceState(EnumPresenceState::PresenceState presenceState); 
    2826         
    2927private 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(); 
    3434}; 
    3535 
  • gui/src/profilebar/profilebar.ui

    r177 r283  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>442</width> 
    10     <height>50</height> 
     9    <width>234</width> 
     10    <height>36</height> 
    1111   </rect> 
     12  </property> 
     13  <property name="sizePolicy"> 
     14   <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> 
     15    <horstretch>0</horstretch> 
     16    <verstretch>0</verstretch> 
     17   </sizepolicy> 
    1218  </property> 
    1319  <property name="minimumSize"> 
    1420   <size> 
    1521    <width>0</width> 
    16     <height>50</height> 
     22    <height>36</height> 
    1723   </size> 
    1824  </property> 
     
    2834  <layout class="QHBoxLayout" name="horizontalLayout_2"> 
    2935   <property name="spacing"> 
    30     <number>5</number> 
    31    </property> 
    32    <property name="leftMargin"> 
    33     <number>5</number> 
    34    </property> 
    35    <property name="topMargin"> 
    3636    <number>0</number> 
    3737   </property> 
    38    <property name="rightMargin"> 
    39     <number>0</number> 
    40    </property> 
    41    <property name="bottomMargin"> 
     38   <property name="margin"> 
    4239    <number>0</number> 
    4340   </property> 
    4441   <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 
     106QPushButton: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"> 
    46137     <property name="minimumSize"> 
    47138      <size> 
    48        <width>50</width> 
    49        <height>50</height> 
     139       <width>31</width> 
     140       <height>31</height> 
    50141      </size> 
    51142     </property> 
    52143     <property name="maximumSize"> 
    53144      <size> 
    54        <width>50</width> 
    55        <height>50</height> 
     145       <width>31</width> 
     146       <height>31</height> 
    56147      </size> 
    57148     </property> 
     149     <property name="text"> 
     150      <string/> 
     151     </property> 
     152     <property name="scaledContents"> 
     153      <bool>false</bool> 
     154     </property> 
    58155    </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> 
    69156   </item> 
    70157  </layout> 
     
    72159 <resources> 
    73160  <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"/> 
    74172 </resources> 
    75173 <connections/> 
  • gui/src/statusbar/statusbar.cpp

    r248 r283  
    1313        addPermanentWidget(_widget); 
    1414         
    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))); 
    1720} 
    1821 
  • gui/src/statusbar/statusbar.h

    r248 r283  
    3232         
    3333        static StatusBar * _self; 
     34         
     35Q_SIGNALS: 
     36        void addSignal(); 
     37        void chatSignal(); 
     38        void audioSignal(); 
     39        void videoSignal(); 
     40         
    3441}; 
    3542 
  • gui/src/statusbar/statusbar.ui

    r248 r283  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>100</width> 
    10     <height>25</height> 
     9    <width>320</width> 
     10    <height>32</height> 
    1111   </rect> 
     12  </property> 
     13  <property name="sizePolicy"> 
     14   <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> 
     15    <horstretch>10</horstretch> 
     16    <verstretch>0</verstretch> 
     17   </sizepolicy> 
    1218  </property> 
    1319  <property name="maximumSize"> 
     
    2834   </property> 
    2935   <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"> 
    3244      <size> 
    33        <width>25</width> 
    34        <height>25</height> 
     45       <width>35</width> 
     46       <height>0</height> 
    3547      </size> 
    3648     </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> 
    3955     </property> 
    40      <property name="value"> 
    41       <number>50</number> 
     56     <property name="text"> 
     57      <string>+</string> 
    4258     </property> 
    4359    </widget> 
    4460   </item> 
    4561   <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> 
    4782     <property name="maximumSize"> 
    4883      <size> 
    49        <width>25</width> 
    50        <height>25</height> 
     84       <width>16777215</width> 
     85       <height>16777215</height> 
    5186      </size> 
    5287     </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> 
    5598     </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> 
    58104     </property> 
    59105    </widget> 
    60106   </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> 
    61173  </layout> 
    62174 </widget> 
    63  <resources/> 
     175 <resources> 
     176  <include location="../../resources/pix/pix.qrc"/> 
     177 </resources> 
    64178 <connections/> 
    65179</ui> 
  • gui/src/wizard/audiopage.cpp

    r251 r283  
    1111    ui->setupUi(this); 
    1212         
    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++)  
    1515        {        
    1616                ui->comboBoxInput->addItem(it.value(),it.key()); 
     
    1818        } 
    1919         
    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++)  
    2222        {        
    2323                ui->comboBoxOutput->addItem(it.value(),it.key()); 
     
    2525        } 
    2626         
    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); 
    3030         
    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); 
    3434         
    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); 
    3838                 
    3939} 
     
    5757        { 
    5858                QVariant data = ui->comboBoxInput->itemData(index); 
    59                 Coip::self()->getTMediaManager().setAudioInputId(data.toInt()); 
     59                Coip::self()->getTMediaManager().setAudioInput(data.toString()); 
    6060        } 
    6161         
     
    6464        { 
    6565                QVariant data = ui->comboBoxOutput->itemData(index); 
    66                 Coip::self()->getTMediaManager().setAudioOutputId(data.toInt()); 
     66                Coip::self()->getTMediaManager().setAudioOutput(data.toString()); 
    6767        } 
    6868         
     
    7070        if(index > -1) 
    7171        { 
    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()); 
    7474        } 
    7575 
  • gui/src/wizard/videopage.cpp

    r249 r283  
    1111    ui->setupUi(this); 
    1212         
    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++)  
    1515                ui->comboBox->addItem(it.value(),it.key()); 
    1616         
     
    4242        QVariant data = ui->comboBox->itemData(index); 
    4343         
    44         Coip::self()->getTMediaManager().setVideoWebcamId(data.toInt()); 
     44        Coip::self()->getTMediaManager().setVideoWebcam(data.toString()); 
    4545        //Config::self()->set(CoIpManagerConfig::VIDEO_WEBCAM_DEVICE_KEY,ui->comboBox->currentText().toStdString()); 
    4646        //Config::self()->save(); 
Note: See TracChangeset for help on using the changeset viewer.