コード例 #1
0
ファイル: pintab.cpp プロジェクト: DJm00n/leechcraft
	void Plugin::pinTab (int index)
	{
		const int windowId = Proxy_->GetRootWindowsManager ()->GetPreferredWindowIndex ();
		auto window = Proxy_->GetRootWindowsManager ()->GetMainWindow (windowId);
		if (!window)
			return;
		auto tw = Proxy_->GetRootWindowsManager ()->GetTabWidget (windowId);
		if (!tw)
			return;

		if (index == -1)
			index = sender ()->property ("Leechcraft/PinTab/CurrentIndex").toInt ();

		if (index < 0 ||
				index >= tw->WidgetCount ())
		{
			qWarning () << Q_FUNC_INFO
					<< "invalid index "
					<< index;
			return;
		}

		tw->Widget (index)->
				setProperty ("SessionData/org.LeechCraft.PinTab.PinState", true);
		++Window2Id_ [window];
		auto pair = qMakePair (tw->TabText (index),
				tw->TabButton (index, CloseSide_));
		tw->SetTabData (index, Window2Id_ [window]);
		tw->SetTabText (index, "");
		tw->SetTabClosable (index, false);
		Window2PinTabsIndex2TabData_ [window] [Window2Id_.value (window, 0)] = pair;

		tw->MoveTab (index, Window2PinTabsIndex2TabData_ [window].count () - 1);
	}
コード例 #2
0
void CDockableDataViews::SetTabData(const ITableMap * data, const roxie::CSearchRowVector & searchResults)
{
    for(ITableMap::const_iterator itr = data->begin(); itr != data->end(); ++itr)
    {
        if (!boost::algorithm::equals(itr->first, _T("_")))
            SetTabData(itr->first, itr->second.m_table, false, searchResults);
    }
}