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

		proxy->SetReturnValue (PreferredWindowsQueue_.takeFirst ());
		proxy->CancelDefault ();
	}
Esempio n. 2
0
	void Plugin::hookEntryActionAreasRequested (IHookProxy_ptr proxy,
			QObject *action, QObject*)
	{
		if (action != AddToMetacontacts_)
			return;

		const QStringList& oldList = proxy->GetReturnValue ().toStringList ();
		proxy->SetReturnValue (oldList + QStringList ("contactListContextMenu"));
	}
Esempio n. 3
0
	void Plugin::hookEntryActionAreasRequested (IHookProxy_ptr proxy,
			QObject *action, QObject*)
	{
		if (!action->property ("Azoth/Depester/IsGood").toBool ())
			return;

		QStringList ours;
		ours << "contactListContextMenu";
		proxy->SetReturnValue (proxy->GetReturnValue ().toStringList () + ours);
	}
Esempio n. 4
0
	void Plugin::hookEntryActionsRequested (IHookProxy_ptr proxy, QObject *entryObj)
	{
		ICLEntry *entry = qobject_cast<ICLEntry*> (entryObj);
		if (!entry || entry->GetEntryType () != ICLEntry::ETChat)
			return;

		QList<QVariant> list = proxy->GetReturnValue ().toList ();
		list << QVariant::fromValue<QObject*> (AddToMetacontacts_);
		proxy->SetReturnValue (list);

		AddToMetacontacts_->setProperty ("Azoth/Metacontacts/Object",
				QVariant::fromValue<QObject*> (entryObj));
	}
Esempio n. 5
0
	void Plugin::hookEntryActionAreasRequested (IHookProxy_ptr proxy,
			QObject *action, QObject*)
	{
		if (!action->property ("Azoth/ChatHistory/IsGood").toBool ())
			return;

		QStringList ours;
		ours << "contactListContextMenu"
			<< "tabContextMenu";
		if (action->property ("ActionIcon") == "view-history")
			ours << "toolbar";

		proxy->SetReturnValue (proxy->GetReturnValue ().toStringList () + ours);
	}
	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)));
	}