Ejemplo n.º 1
0
	void TabsPropsManager::HandlePreferredWindowIndex (const IHookProxy_ptr& proxy, const QWidget*)
	{
		if (PreferredWindowsQueue_.empty ())
			return;

		proxy->SetReturnValue (PreferredWindowsQueue_.takeFirst ());
		proxy->CancelDefault ();
	}
Ejemplo n.º 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 ();
	}
Ejemplo n.º 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 ();
	}
Ejemplo n.º 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)));
	}
Ejemplo n.º 5
0
	void Plugin::hookTrayIconVisibilityChanged (IHookProxy_ptr proxy, QSystemTrayIcon*, bool)
	{
		proxy->CancelDefault ();
	}
Ejemplo n.º 6
0
	void Plugin::HandleMsgOccurence (IHookProxy_ptr proxy, QObject *message)
	{
		IMessage *msg = qobject_cast<IMessage*> (message);
		if (IsEntryIgnored (msg->OtherPart ()))
			proxy->CancelDefault ();
	}
Ejemplo n.º 7
0
	void Plugin::hookDnDEntry2Entry (IHookProxy_ptr proxy,
			QObject *source, QObject *target)
	{
		if (Core::Instance ().HandleDnDEntry2Entry (source, target))
			proxy->CancelDefault ();
	}
Ejemplo n.º 8
0
	void Plugin::hookAddingCLEntryBegin (IHookProxy_ptr proxy, QObject *entry)
	{
		if (Core::Instance ().HandleRealEntryAddBegin (entry))
			proxy->CancelDefault ();
	}
Ejemplo n.º 9
0
	void Plugin::hookDockBarWillBeShown (IHookProxy_ptr proxy,
			QMainWindow*, QToolBar*, Qt::DockWidgetArea)
	{
		proxy->CancelDefault ();
	}
Ejemplo n.º 10
0
	void Plugin::hookDockWidgetActionVisToggled (IHookProxy_ptr proxy,
			QMainWindow *win, QDockWidget *dw, bool visible)
	{
		proxy->CancelDefault ();
	}