Пример #1
0
	void TabsPropsManager::HandlePreferredWindowIndex (const IHookProxy_ptr& proxy, const QWidget*)
	{
		if (PreferredWindowsQueue_.empty ())
			return;

		proxy->SetReturnValue (PreferredWindowsQueue_.takeFirst ());
		proxy->CancelDefault ();
	}
Пример #2
0
	void Plugin::hookTabSetText (IHookProxy_ptr proxy, int index, int windowId)
	{
		auto window = Proxy_->GetRootWindowsManager ()->GetMainWindow (windowId);
		if (!window)
			return;
		auto tw = Proxy_->GetRootWindowsManager ()->GetTabWidget (windowId);
		if (!tw)
			return;

		int realIndex = tw->TabData (index).toInt ();
		if (Window2PinTabsIndex2TabData_.contains (window) &&
				Window2PinTabsIndex2TabData_ [window].contains (realIndex))
			proxy->CancelDefault ();
	}
Пример #3
0
	void Plugin::hookGonnaHandleSmiles (IHookProxy_ptr proxy,
			QString body, QString)
	{
		if (ConvScriptPath_.isEmpty ())
			return;
		
		if (!XmlSettingsManager::Instance ()
				.property ("OnDisplayRendering").toBool ())
			return;

		if (!body.contains ("$$"))
			return;
		
		proxy->CancelDefault ();
	}
Пример #4
0
	void FileScheme::hookNAMCreateRequest (IHookProxy_ptr proxy,
			QNetworkAccessManager*,
			QNetworkAccessManager::Operation *op,
			QIODevice**)
	{
		if (*op != QNetworkAccessManager::GetOperation)
			return;

		const QNetworkRequest& req = proxy->GetValue ("request").value<QNetworkRequest> ();
		const QUrl& url = req.url ();
		if (url.scheme () != "file" ||
				!QFileInfo (url.toLocalFile ()).isDir ())
			return;

		proxy->CancelDefault ();
		proxy->SetReturnValue (QVariant::fromValue<QNetworkReply*> (new SchemeReply (req, this)));
	}
Пример #5
0
	void Plugin::hookTrayIconVisibilityChanged (IHookProxy_ptr proxy, QSystemTrayIcon*, bool)
	{
		proxy->CancelDefault ();
	}
Пример #6
0
	void Plugin::HandleMsgOccurence (IHookProxy_ptr proxy, QObject *message)
	{
		IMessage *msg = qobject_cast<IMessage*> (message);
		if (IsEntryIgnored (msg->OtherPart ()))
			proxy->CancelDefault ();
	}
Пример #7
0
	void Plugin::hookDnDEntry2Entry (IHookProxy_ptr proxy,
			QObject *source, QObject *target)
	{
		if (Core::Instance ().HandleDnDEntry2Entry (source, target))
			proxy->CancelDefault ();
	}
Пример #8
0
	void Plugin::hookAddingCLEntryBegin (IHookProxy_ptr proxy, QObject *entry)
	{
		if (Core::Instance ().HandleRealEntryAddBegin (entry))
			proxy->CancelDefault ();
	}
Пример #9
0
	void Plugin::hookDockBarWillBeShown (IHookProxy_ptr proxy,
			QMainWindow*, QToolBar*, Qt::DockWidgetArea)
	{
		proxy->CancelDefault ();
	}
Пример #10
0
	void Plugin::hookDockWidgetActionVisToggled (IHookProxy_ptr proxy,
			QMainWindow *win, QDockWidget *dw, bool visible)
	{
		proxy->CancelDefault ();
	}