示例#1
0
bool PurpleIMContactList::changeGroupNameCbk(void * dataIn)
{
	Mutex::ScopedLock lock(PurpleIMContactList::_mutex);

	PurpleIMContactListCallbackData* cbData = (PurpleIMContactListCallbackData*)dataIn;

	PurpleGroup *gGroup = purple_find_group( cbData->getOldGroupName().c_str() );
	
	if (gGroup) 
	{
		purple_blist_rename_group(gGroup, cbData->getNewGroupName().c_str() );
	}

	timeoutRemove( cbData );

	delete cbData;

	return TRUE;
}
示例#2
0
void BuddyListGroup::GroupContextMenu::renameResponseHandler(
    CppConsUI::InputDialog& activator,
    CppConsUI::AbstractDialog::ResponseType response)
{
  if (response != CppConsUI::AbstractDialog::RESPONSE_OK)
    return;

  const char *name = activator.getText();
  PurpleGroup *group = parent_group->getPurpleGroup();
  PurpleGroup *other = purple_find_group(name);
  if (other && !purple_utf8_strcasecmp(name, purple_group_get_name(group))) {
    LOG->message(_("Specified group is already in the list."));
    /* TODO Add group merging. Note that purple_blist_rename_group() can do
     * the merging. */
  }
  else
    purple_blist_rename_group(group, name);

  // close context menu
  close();
}