Changeset 6322 for trunk/qt4-gui/src/core
- Timestamp:
- 06/17/08 03:18:28 (5 months ago)
- Location:
- trunk/qt4-gui/src/core
- Files:
-
- 2 modified
-
mainwin.cpp (modified) (3 diffs)
-
mainwin.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/core/mainwin.cpp
r6320 r6322 738 738 } 739 739 740 void MainWindow::setCurrentGroup(int groupId) 741 { 740 void MainWindow::setCurrentGroup(int index) 741 { 742 unsigned short groupId = myUserGroupsBox->itemData(index).toUInt(); 742 743 GroupType groupType = GROUPS_USER; 743 unsigned short nNumGroups = gUserManager.NumGroups(); 744 745 if (groupId > nNumGroups) 746 { 747 groupId -= nNumGroups; 744 if (groupId >= ContactListModel::SystemGroupOffset) 745 { 748 746 groupType = GROUPS_SYSTEM; 747 groupId -= ContactListModel::SystemGroupOffset; 749 748 } 750 749 751 750 Config::ContactList::instance()->setGroup(groupType, groupId); 752 updateCurrentGroup();753 751 } 754 752 … … 758 756 int group = Config::ContactList::instance()->groupId(); 759 757 760 unsigned short nNumGroups = gUserManager.NumGroups();761 762 758 if (groupType == GROUPS_SYSTEM) 763 group += nNumGroups;759 group += ContactListModel::SystemGroupOffset; 764 760 765 761 // Update the combo box 766 myUserGroupsBox->setCurrentIndex(group); 762 int index = myUserGroupsBox->findData(group); 763 if (index == -1) 764 return; 765 myUserGroupsBox->setCurrentIndex(index); 767 766 768 767 // Update the msg label if necessary … … 783 782 // update the combo box 784 783 myUserGroupsBox->clear(); 785 myUserGroupsBox->addItem(LicqStrings::getSystemGroupName(GROUP_ALL_USERS)); 784 myUserGroupsBox->addItem(LicqStrings::getSystemGroupName(GROUP_ALL_USERS), 785 ContactListModel::SystemGroupOffset); 786 786 787 787 FOR_EACH_GROUP_START_SORTED(LOCK_R) 788 788 { 789 myUserGroupsBox->addItem(QString::fromLocal8Bit(pGroup->name().c_str()) );789 myUserGroupsBox->addItem(QString::fromLocal8Bit(pGroup->name().c_str()), pGroup->id()); 790 790 } 791 791 FOR_EACH_GROUP_END 792 792 793 793 for (unsigned short i = 1; i < NUM_GROUPS_SYSTEM_ALL; i++) 794 myUserGroupsBox->addItem(LicqStrings::getSystemGroupName(i)); 794 myUserGroupsBox->addItem(LicqStrings::getSystemGroupName(i), 795 ContactListModel::SystemGroupOffset + i); 795 796 796 797 updateCurrentGroup(); -
trunk/qt4-gui/src/core/mainwin.h
r6222 r6322 136 136 void updateEvents(); 137 137 void updateStatus(CICQSignal* = NULL); 138 void setCurrentGroup(int); 138 139 /** 140 * Groups combo box was changed to show a new group 141 * 142 * @param index Combo box index of selected item 143 */ 144 void setCurrentGroup(int index); 145 139 146 //TODO 140 147 //void callUserFunction(QString id, unsigned long ppid);
