Changeset 6261

Show
Ignore:
Timestamp:
06/11/08 08:33:16 (4 months ago)
Author:
eugene
Message:

Added an ability to choose the group user will be added to.

Location:
branches/qt4-gui_group/src/dialogs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/qt4-gui_group/src/dialogs/adduserdlg.cpp

    r6252 r6261  
    3131#include "helpers/support.h" 
    3232 
     33#include "widgets/groupcombobox.h" 
    3334#include "widgets/protocombobox.h" 
    3435 
     
    5455  layDialog->addWidget(lblProtocol, line, 0); 
    5556  layDialog->addWidget(myProtocol, line++, 1); 
     57 
     58  QLabel* lblGroup = new QLabel(tr("&Group:")); 
     59  myGroup = new GroupComboBox(); 
     60  myGroup->setCurrentGroupId(gUserManager.NewUserGroup()); 
     61  lblGroup->setBuddy(myGroup); 
     62 
     63  layDialog->addWidget(lblGroup, line, 0); 
     64  layDialog->addWidget(myGroup, line++, 1); 
    5665 
    5766  QLabel* lblUin = new QLabel(tr("New &User ID:")); 
     
    8392void AddUserDlg::ok() 
    8493{ 
    85   QString uin = myUin->text(); 
     94  QString uin = myUin->text().trimmed(); 
    8695 
    8796  if (!uin.isEmpty()) 
     97  { 
     98    unsigned short currentNewGroup = gUserManager.NewUserGroup(); 
     99    gUserManager.SetNewUserGroup(myGroup->currentGroupId()); 
    88100    gLicqDaemon->AddUserToList(uin.toLatin1(), myProtocol->currentPpid(), 
    89101        myNotify->isChecked()); 
     102    gUserManager.SetNewUserGroup(currentNewGroup); 
     103  } 
    90104 
    91105  close(); 
  • branches/qt4-gui_group/src/dialogs/adduserdlg.h

    r6221 r6261  
    2929namespace LicqQtGui 
    3030{ 
     31class GroupComboBox; 
    3132class ProtoComboBox; 
    3233 
     
    4142   QCheckBox* myNotify; 
    4243   QLineEdit* myUin; 
     44   GroupComboBox* myGroup; 
    4345   ProtoComboBox* myProtocol; 
    4446