Пример #1
0
	void GlooxCLEntry::addToPrivacyList (bool add)
	{
		const auto& jid = GetJID ();

		auto lists = Account_->GetClientConnection ()->GetPrivacyListsManager ();

		auto current = lists->GetCurrentList ();
		auto items = current.GetItems ();
		for (const auto& item : items)
		{
			if (item.GetType () != PrivacyListItem::TJid)
				continue;

			if (item.GetValue () != jid)
				continue;

			if ((item.GetAction () == PrivacyListItem::AAllow && !add) ||
				(item.GetAction () == PrivacyListItem::ADeny && add))
				return;

			if (!add)
			{
				items.removeAll (item);
				break;
			}
		}
		if (add)
			items.append (PrivacyListItem (jid, PrivacyListItem::TJid));

		if (items.size () == current.GetItems ().size ())
			return;

		current.SetItems (items);
		lists->SetList (current);
	}
Пример #2
0
SimpleConfig::SimpleConfig(const vector<string> &other_tabs,
                           const vector<SG_Alignment *> &other_screens) {
  vector<string> items(4 + other_tabs.size());
  vector<SG_Alignment *> screens(4 + other_tabs.size());
  items[0] = "Video";
  items[1] = "Audio";
  items[2] = "Mouse";
  items[3] = "Keyboard";
  screens[0] = BuildVideoScreen();
  screens[1] = BuildAudioScreen();
  screens[2] = BuildMouseScreen();
  screens[3] = BuildKeyboardScreen();
  copy(other_tabs.begin(), other_tabs.end(), items.begin() + 4);
  copy(other_screens.begin(), other_screens.end(), screens.begin() + 4);
  Resize(1, 16);
  SetItems(items);
  SetAreas(screens);
  mode = 0;
  oldmode = 0;
  timeleft = 0;
  disptime = 0;
  setback = false;
  confirm = true;
  rescue_thread = NULL;
  SetBackground(new SG_Panel());
}
Пример #3
0
void SomaFMSearchProvider::RecreateItems() {
  QList<Item> items;

  foreach (const SomaFMService::Stream& stream, service_->Streams()) {
    Item item;
    item.metadata_ = stream.ToSong(service_->name());
    item.keyword_ = stream.title_;
    items << item;
  }

  SetItems(items);
}
void IntergalacticFMSearchProvider::RecreateItems() {
  QList<Item> items;

  for (const IntergalacticFMService::Stream& stream : service_->Streams()) {
    Item item;
    item.metadata_ = stream.ToSong(service_->name());
    item.keyword_ = stream.title_;
    items << item;
  }

  SetItems(items);
}
void SavedRadioSearchProvider::RecreateItems() {
  QList<Item> items;

  for (const SavedRadio::Stream& stream : service_->Streams()) {
    Item item;
    item.metadata_.set_title(stream.name_);
    item.metadata_.set_url(stream.url_);
    item.keyword_ = stream.name_;
    items << item;
  }

  SetItems(items);
}
Пример #6
0
void FoundGroupsModel::fetchMoreContent(const QString& text)
{
    if (text.isEmpty()) {
        return;
    }
    if (m_LastSearch != text) {
        m_CurrentPage = 1;
        m_HasMore = true;
        SetItems({});
    }
    m_LastSearch = text;

    SailreadsManager::Instance()->searchGroup(this, text, m_CurrentPage);
}
Пример #7
0
void FoundGroupsModel::handleGotFoundGroups(const CountedItems<GroupPtr>& groups)
{
    if (!groups.m_BeginIndex && !groups.m_EndIndex)
    {
        Clear();
    }
    else if (groups.m_BeginIndex == 1) {
        m_CurrentPage = 1;
        SetItems(groups.m_Items);
    }
    else {
        AddItems(groups.m_Items);
    }

    SetHasMore(groups.m_EndIndex != groups.m_Count);
    if (m_HasMore) {
        ++m_CurrentPage;
    }
}
GXBlockingPG::GXBlockingPG
	(
	JXTextButton*			cancelButton,
	JXStaticText*			counter,
	JXProgressIndicator*	indicator
	)
	:
	JXProgressDisplay(),
	itsWindow(NULL)
{
	if (counter != NULL)
		{
		itsWindow = counter->GetWindow();
		}
	else if (indicator != NULL)
		{
		itsWindow = indicator->GetWindow();
		}
	assert( itsWindow != NULL );

	SetItems(cancelButton, counter, indicator);
}
Пример #9
0
void ReviewsModel::handleGotReviews(quint64 booksShelfId, const CountedItems<ReviewPtr>& reviews)
{
    if (m_BookShelfId != booksShelfId) {
        return;
    }

    if (!reviews.m_BeginIndex && !reviews.m_EndIndex)
    {
        Clear();
    }
    else if (reviews.m_BeginIndex == 1) {
        m_CurrentPage = 1;
        SetItems(reviews.m_Items);
    }
    else {
        AddItems(reviews.m_Items);
    }

    SetHasMore(reviews.m_EndIndex != reviews.m_Count);
    if (m_HasMore) {
        ++m_CurrentPage;
    }
}
Пример #10
0
void GasSysDlg::SetTempItems( int num )
{
	if( num <= 0 ) return;
	SetItems(m_tempRecords,m_tempDataModel,m_tempCListCtrl,num);
}
Пример #11
0
void GasSysDlg::SetPermItems(int num)
{
	if( num <= 0 ) return;
	SetItems(m_permRecords,m_permDataModel,m_permCListCtrl,num);
}