| 138 | | myOnlineNotifyCheck = new QCheckBox(tr("Online notify")); |
| 139 | | myOnlineNotifyCheck->setToolTip(tr("Notify when this contact comes online.")); |
| 140 | | mySysGroupLayout->addWidget(myOnlineNotifyCheck); |
| 141 | | |
| 142 | | myVisibleListCheck = new QCheckBox(tr("Visible List")); |
| 143 | | myVisibleListCheck->setToolTip(tr("Contact will see you online even if you're invisible.")); |
| 144 | | mySysGroupLayout->addWidget(myVisibleListCheck); |
| 145 | | |
| 146 | | myInvisibleListCheck = new QCheckBox(tr("Invisible List")); |
| 147 | | myInvisibleListCheck->setToolTip(tr("Contact will always see you as offline.")); |
| 148 | | mySysGroupLayout->addWidget(myInvisibleListCheck); |
| 149 | | |
| 150 | | myIgnoreListCheck = new QCheckBox(tr("Ignore List")); |
| 151 | | myIgnoreListCheck->setToolTip(tr("Ignore any events from this contact.")); |
| 152 | | mySysGroupLayout->addWidget(myIgnoreListCheck); |
| 153 | | |
| 154 | | myNewUsersCheck = new QCheckBox(tr("New Users")); |
| 155 | | myNewUsersCheck->setToolTip(tr("Contact was recently added to the list.")); |
| 156 | | mySysGroupLayout->addWidget(myNewUsersCheck); |
| | 138 | mySystemGroupCheck[GROUP_ONLINE_NOTIFY] = new QCheckBox(tr("Online notify")); |
| | 139 | mySystemGroupCheck[GROUP_ONLINE_NOTIFY]->setToolTip(tr("Notify when this contact comes online.")); |
| | 140 | mySysGroupLayout->addWidget(mySystemGroupCheck[GROUP_ONLINE_NOTIFY]); |
| | 141 | |
| | 142 | mySystemGroupCheck[GROUP_VISIBLE_LIST] = new QCheckBox(tr("Visible List")); |
| | 143 | mySystemGroupCheck[GROUP_VISIBLE_LIST]->setToolTip(tr("Contact will see you online even if you're invisible.")); |
| | 144 | mySysGroupLayout->addWidget(mySystemGroupCheck[GROUP_VISIBLE_LIST]); |
| | 145 | |
| | 146 | mySystemGroupCheck[GROUP_INVISIBLE_LIST] = new QCheckBox(tr("Invisible List")); |
| | 147 | mySystemGroupCheck[GROUP_INVISIBLE_LIST]->setToolTip(tr("Contact will always see you as offline.")); |
| | 148 | mySysGroupLayout->addWidget(mySystemGroupCheck[GROUP_INVISIBLE_LIST]); |
| | 149 | |
| | 150 | mySystemGroupCheck[GROUP_IGNORE_LIST] = new QCheckBox(tr("Ignore List")); |
| | 151 | mySystemGroupCheck[GROUP_IGNORE_LIST]->setToolTip(tr("Ignore any events from this contact.")); |
| | 152 | mySysGroupLayout->addWidget(mySystemGroupCheck[GROUP_IGNORE_LIST]); |
| | 153 | |
| | 154 | mySystemGroupCheck[GROUP_NEW_USERS] = new QCheckBox(tr("New Users")); |
| | 155 | mySystemGroupCheck[GROUP_NEW_USERS]->setToolTip(tr("Contact was recently added to the list.")); |
| | 156 | mySysGroupLayout->addWidget(mySystemGroupCheck[GROUP_NEW_USERS]); |
| 331 | | // Set user groups (SetUserInGroup will take lock so must be called here) |
| | 327 | const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); |
| | 328 | if (u == NULL) |
| | 329 | return; |
| | 330 | |
| | 331 | // Get current group memberships so we only set those that have actually changed |
| | 332 | int serverGroup = 0; |
| | 333 | if (u->GetSID() != 0) |
| | 334 | serverGroup = gUserManager.GetGroupFromID(u->GetGSID()); |
| | 335 | const UserGroupList& userGroups = u->GetGroups(); |
| | 336 | unsigned long systemGroups = u->GetSystemGroups(); |
| | 337 | |
| | 338 | gUserManager.DropUser(u); |
| | 339 | |
| | 340 | // First set server group |
| 337 | | bool inServer = dynamic_cast<QRadioButton*>(myGroupsTable->cellWidget(i, 2))->isChecked(); |
| 338 | | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_USER, gid, inLocal | inServer, inServer); |
| | 358 | if ((userGroups.count(gid) > 0) != inLocal) |
| | 359 | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_USER, gid, inLocal, false); |
| 342 | | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_SYSTEM, |
| 343 | | GROUP_ONLINE_NOTIFY, myOnlineNotifyCheck->isChecked(), true); |
| 344 | | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_SYSTEM, |
| 345 | | GROUP_VISIBLE_LIST, myVisibleListCheck->isChecked(), true); |
| 346 | | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_SYSTEM, |
| 347 | | GROUP_INVISIBLE_LIST, myInvisibleListCheck->isChecked(), true); |
| 348 | | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_SYSTEM, |
| 349 | | GROUP_IGNORE_LIST, myIgnoreListCheck->isChecked(), true); |
| 350 | | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_SYSTEM, |
| 351 | | GROUP_NEW_USERS, myNewUsersCheck->isChecked(), true); |
| | 363 | for (unsigned short i = 1; i < NUM_GROUPS_SYSTEM_ALL; ++i) |
| | 364 | { |
| | 365 | bool inGroup = mySystemGroupCheck[i]->isChecked(); |
| | 366 | if ((systemGroups & (1L << (i - 1))) != inGroup) |
| | 367 | gUserManager.SetUserInGroup(id.toLatin1().data(), ppid, GROUPS_SYSTEM, i, inGroup, true); |
| | 368 | } |