Exemple #1
0
void LLPanelFriends::filterContacts()
{
	std::string friend_name;
	std::string search_name;

	search_name = LLPanelFriends::getChild<LLLineEditor>("buddy_search_lineedit")->getValue().asString();

	if ((search_name != "" /*&& search_name != mLastContactSearch*/))
	{	
		mLastContactSearch = search_name;
		refreshNames(LLFriendObserver::ADD);

		std::vector<LLScrollListItem*> vFriends = mFriendsList->getAllData(); // all of it.
		for (std::vector<LLScrollListItem*>::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr)
		{
			friend_name = utf8str_tolower((*itr)->getColumn(LIST_FRIEND_NAME)->getValue().asString());
			BOOL show_entry = (friend_name.find(utf8str_tolower(search_name)) != std::string::npos);

			if (!show_entry)
			{
				mFriendsList->deleteItems((*itr)->getValue());
			}
		}

		refreshUI();
	}
	else if (search_name == "" && search_name != mLastContactSearch) refreshNames(LLFriendObserver::ADD);
}
void LLPanelFriends::filterContacts(const std::string& search_name)
{
	std::string friend_name;

	if ((search_name != "" /*&& search_name != mLastContactSearch*/))
	{	
		if (search_name.find(mLastContactSearch) == std::string::npos)
		{
			refreshNames(LLFriendObserver::ADD);
		}

		//llinfos << "search_name = " << search_name <<llendl;

		std::vector<LLScrollListItem*> vFriends = mFriendsList->getAllData(); // all of it.
		for (std::vector<LLScrollListItem*>::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr)
		{
			friend_name = utf8str_tolower((*itr)->getColumn(LIST_FRIEND_NAME)->getValue().asString());
			BOOL show_entry = (friend_name.find(utf8str_tolower(search_name)) != std::string::npos);
			//llinfos << "friend_name = " << friend_name << (show_entry?" (shown)":"") <<llendl;
			if (!show_entry)
			{
				mFriendsList->deleteItems((*itr)->getValue());
			}
		}

		mFriendsList->updateLayout();
		refreshUI();
	}
	else if (search_name == "" && search_name != mLastContactSearch) refreshNames(LLFriendObserver::ADD);
	mLastContactSearch = search_name;
}
Exemple #3
0
void LLPanelFriends::filterContacts(const std::string& search_string)
{
    if (search_string.empty())
    {
        refreshNames(LLFriendObserver::ADD, "");
    }
    else
    {
        refreshNames(LLFriendObserver::ADD, search_string);
    }
    refreshUI();
}
Exemple #4
0
// virtual
BOOL LLFloaterFriends::postBuild()
{
	mFriendsList = LLUICtrlFactory::getScrollListByName(this, "friend_list");
	mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
	mFriendsList->setMaximumSelectCallback(onMaximumSelect);
	mFriendsList->setCommitOnSelectionChange(TRUE);
	childSetCommitCallback("friend_list", onSelectName, this);
	childSetDoubleClickCallback("friend_list", onClickIM);

	refreshNames();

	childSetAction("im_btn", onClickIM, this);
	childSetAction("profile_btn", onClickProfile, this);
	childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
	childSetAction("pay_btn", onClickPay, this);
	childSetAction("add_btn", onClickAddFriend, this);
	childSetAction("remove_btn", onClickRemove, this);
	childSetAction("close_btn", onClickClose, this);

	setDefaultBtn("im_btn");

	updateFriends(LLFriendObserver::ADD);
	refreshUI();

	// primary sort = online status, secondary sort = name
	mFriendsList->sortByColumn("friend_name", TRUE);
	mFriendsList->sortByColumn("icon_online_status", TRUE);

	return TRUE;
}
// virtual
BOOL LLPanelFriends::postBuild()
{
	mFriendsList = getChild<LLScrollListCtrl>("friend_list");
	mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
	mFriendsList->setMaximumSelectCallback(onMaximumSelect);
	mFriendsList->setCommitOnSelectionChange(TRUE);
	childSetCommitCallback("friend_list", onSelectName, this);
	childSetDoubleClickCallback("friend_list", onClickIM);

	U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE;
	refreshNames(changed_mask);

	childSetAction("im_btn", onClickIM, this);
	childSetAction("profile_btn", onClickProfile, this);
	childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
	childSetAction("pay_btn", onClickPay, this);
	childSetAction("add_btn", onClickAddFriend, this);
	childSetAction("remove_btn", onClickRemove, this);

	setDefaultBtn("im_btn");

	updateFriends(LLFriendObserver::ADD);
	refreshUI();

	// primary sort = online status, secondary sort = name
	mFriendsList->sortByColumn(std::string("friend_name"), TRUE);
	mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE);

	return TRUE;
}
Exemple #6
0
void LLPanelFriends::setContactGroup(std::string contact_grp)
{
	LLChat msg("Group set to " + contact_grp);
	LLFloaterChat::addChat(msg);
	refreshNames(LLFriendObserver::ADD);
	refreshUI();
	categorizeContacts();
}
Exemple #7
0
// virtual
BOOL LLPanelFriends::postBuild()
{
	mFriendsList = getChild<LLScrollListCtrl>("friend_list");
	mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
	mFriendsList->setMaximumSelectCallback(onMaximumSelect);
	mFriendsList->setCommitOnSelectionChange(TRUE);
	childSetCommitCallback("friend_list", onSelectName, this);
	childSetCommitCallback("buddy_group_combobox", onChangeContactGroup, this);
	childSetDoubleClickCallback("friend_list", onClickIM);

	// <dogmode>
	// Contact search and group system.
	// 09/05/2010 - Charley Levenque
	LLLineEditor* contact = getChild<LLLineEditor>("buddy_search_lineedit");
	if (contact)
	{
		contact->setKeystrokeCallback(&onContactSearchKeystroke);
	}

	getChild<LLTextBox>("s_num")->setValue("0");
	getChild<LLTextBox>("f_num")->setValue(llformat("%d", mFriendsList->getItemCount()));

	U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE;
	refreshNames(changed_mask);

	childSetAction("im_btn", onClickIM, this);
	childSetAction("assign_btn", onClickAssign, this);
	childSetAction("expand_collapse_btn", onClickExpand, this);
	childSetAction("profile_btn", onClickProfile, this);
	childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
	childSetAction("pay_btn", onClickPay, this);
	childSetAction("add_btn", onClickAddFriend, this);
	childSetAction("remove_btn", onClickRemove, this);
	//childSetAction("export_btn", onClickExport, this); Making Dummy View -HgB
	//childSetAction("import_btn", onClickImport, this); Making Dummy View -HgB

	setDefaultBtn("im_btn");

	updateFriends(LLFriendObserver::ADD);
	refreshUI();

	// primary sort = online status, secondary sort = name
	mFriendsList->sortByColumn(std::string("friend_name"), TRUE);
	mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE);

	updateColumns(this);

	return TRUE;
}
void MainWindow::setupDay(ActivityTableView *tableView, ProjectTotalsListView *listView, const QDate &date)
{
  /* Setup table model */
  ActivityTableModel *tableModel = new ActivityTableModel(date, m_recordManager, this);
  connect(this, SIGNAL(activityCreated(QSharedPointer<Activity>)),
      tableModel, SLOT(created(QSharedPointer<Activity>)));
  connect(tableModel, SIGNAL(activityStarted()),
      m_ui.tblCurrent->model(), SLOT(refreshActivities()));
  connect(tableModel, SIGNAL(activitySaved()),
      m_activityCompleterModel, SLOT(refreshNames()));
  connect(tableModel, SIGNAL(activityDestroyed()),
      m_activityCompleterModel, SLOT(refreshNames()));
  connect(tableModel, SIGNAL(activitySaved()),
      m_tagCompleterModel, SLOT(refreshNames()));
  connect(tableModel, SIGNAL(activityDestroyed()),
      m_tagCompleterModel, SLOT(refreshNames()));

  /* Setup list model */
  ProjectTotalsListModel *listModel = new ProjectTotalsListModel(date, m_recordManager, this);
  connect(this, SIGNAL(activityCreated(QSharedPointer<Activity>)),
      listModel, SLOT(created(QSharedPointer<Activity>)));

  setupDay(tableView, listView, tableModel, listModel);
}
Exemple #9
0
void LLFloaterFriends::updateFriends(U32 changed_mask)
{
	if (!sInstance) return;
	LLUUID selected_id;
	LLCtrlListInterface *friends_list = sInstance->childGetListInterface("friend_list");
	if (!friends_list) return;
	LLCtrlScrollInterface *friends_scroll = sInstance->childGetScrollInterface("friend_list");
	if (!friends_scroll) return;
	
	// We kill the selection warning, otherwise we'll spam with warning popups
	// if the maximum amount of friends are selected
	mShowMaxSelectWarning = false;

	LLDynamicArray<LLUUID> selected_friends = sInstance->getSelectedIDs();
	if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
	{
		refreshNames();
	}
	else if(changed_mask & LLFriendObserver::POWERS)
	{
		--mNumRightsChanged;
		if(mNumRightsChanged > 0)
		{
			mPeriod = RIGHTS_CHANGE_TIMEOUT;	
			mEventTimer.start();
			mEventTimer.reset();
			mAllowRightsChange = FALSE;
		}
		else
		{
			tick();
		}
	}
	if(selected_friends.size() > 0)
	{
		// only non-null if friends was already found. This may fail,
		// but we don't really care here, because refreshUI() will
		// clean up the interface.
		friends_list->setCurrentByID(selected_id);
		for(LLDynamicArray<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr)
		{
			friends_list->setSelectedByValue(*itr, true);
		}
	}

	refreshUI();
	mShowMaxSelectWarning = true;
}
// virtual
BOOL LLPanelFriends::postBuild()
{
	mFriendsList = getChild<LLScrollListCtrl>("friend_list");
	mFriendsList->setCommitOnSelectionChange(TRUE);
	mFriendsList->setCommitCallback(onSelectName, this);
	//childSetCommitCallback("buddy_group_combobox", onChangeContactGroup, this);
	mFriendsList->setDoubleClickCallback(onClickIM, this);

	// <dogmode>
	// Contact search and group system.
	// 09/05/2010 - Charley Levenque
	LLFilterEditor* contact = getChild<LLFilterEditor>("buddy_search_lineedit");
	if (contact)
	{
		contact->setCommitCallback(boost::bind(&LLPanelFriends::onContactFilterEdit, this, _2));
	}

	getChild<LLTextBox>("s_num")->setValue("0");
	getChild<LLTextBox>("f_num")->setValue(llformat("%d", mFriendsList->getItemCount()));

	U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE;
	refreshNames(changed_mask);

	childSetAction("im_btn", onClickIM, this);
	//childSetAction("assign_btn", onClickAssign, this);
	childSetAction("expand_collapse_btn", onClickExpand, this);
	childSetAction("profile_btn", onClickProfile, this);
	getChild<LLUICtrl>("offer_teleport_btn")->setCommitCallback(boost::bind(static_cast<void(*)(const uuid_vec_t&)>(LLAvatarActions::offerTeleport), boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList)));
	childSetAction("pay_btn", onClickPay, this);
	childSetAction("add_btn", onClickAddFriend, this);
	getChild<LLUICtrl>("remove_btn")->setCommitCallback(boost::bind(LLAvatarActions::removeFriendsDialog, boost::bind(&LLScrollListCtrl::getSelectedIDs, mFriendsList)));
	//childSetAction("export_btn", onClickExport, this); Making Dummy View -HgB
	//childSetAction("import_btn", onClickImport, this); Making Dummy View -HgB

	setDefaultBtn("im_btn");

	updateFriends(LLFriendObserver::ADD);
	refreshUI();

	// primary sort = online status, secondary sort = name
	mFriendsList->sortByColumn(std::string("friend_name"), TRUE);
	mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE);

	updateColumns(this);

	return TRUE;
}