Пример #1
0
	void Plugin::RecoverTabs (const QList<TabRecoverInfo>& infos)
	{
		Q_FOREACH (const TabRecoverInfo& recInfo, infos)
		{
			QDataStream str (recInfo.Data_);
			qint8 version;
			str >> version;

			if (version == 1)
			{
				auto tab = Core::Instance ().CreateBlogiqueWidget ();
				Entry e;
				str >> e.Subject_
						>> e.Content_
						>> e.Date_
						>> e.Tags_
						>> e.Target_
						>> e.PostOptions_
						>> e.CustomData_;
				QByteArray accId;
				str >> accId;
				tab->FillWidget (e, accId);
				emit addNewTab ("Blogique", tab);
				emit changeTabIcon (tab, GetIcon ());
				emit raiseTab (tab);
				emit changeTabName (tab, e.Subject_);
			}
Пример #2
0
BrowserWidget* Core::NewURL (const QUrl& url, bool raise,
                             const QList<QPair<QByteArray, QVariant>>& props)
{
    if (!Initialized_)
        return 0;

    BrowserWidget *widget = new BrowserWidget ();
    widget->InitShortcuts ();
    Widgets_.push_back (widget);

    Q_FOREACH (const auto& pair, props)
        widget->setProperty (pair.first, pair.second);

    QString tabTitle = "Poshuku";
    if (url.host ().size ())
        tabTitle = url.host ();
    emit addNewTab (tabTitle, widget);

    ConnectSignals (widget);

    if (!url.isEmpty ())
        widget->SetURL (url);

    if (raise)
        emit raiseTab (widget);

    emit hookTabAdded (Util::DefaultHookProxy_ptr (new Util::DefaultHookProxy),
                       widget,
                       widget->getWebView (),
                       url);

    return widget;
}
Пример #3
0
	BrowserWidget* Core::NewURL (const QUrl& url, bool raise)
	{
		if (!Initialized_)
			return 0;

		BrowserWidget *widget = new BrowserWidget ();
		widget->InitShortcuts ();
		widget->SetUnclosers (Unclosers_);
		Widgets_.push_back (widget);

		QString tabTitle = "Poshuku";
		if (url.host ().size ())
			tabTitle = url.host ();
		emit addNewTab (tabTitle, widget);

		ConnectSignals (widget);

		if (!url.isEmpty ())
			widget->SetURL (url);

		if (raise)
			emit raiseTab (widget);
		
		emit hookTabAdded (Util::DefaultHookProxy_ptr (new Util::DefaultHookProxy),
				widget,
				widget->getWebView (),
				url);

		return widget;
	}
Пример #4
0
void ZLQtOptionsDialog::selectTab(const ZLResourceKey &key) {
	for (std::vector<shared_ptr<ZLDialogContent> >::const_iterator it = myTabs.begin(); it != myTabs.end(); ++it) {
		if ((*it)->key() == key.Name) {
			raiseTab(it - myTabs.begin());
			break;
		}
	}
}
Пример #5
0
	void Plugin::handleNewTab (const QString& name, QWidget *mt)
	{
		connect (mt,
				SIGNAL (removeTab (QWidget*)),
				this,
				SIGNAL (removeTab (QWidget*)));

		emit addNewTab (name, mt);
		emit raiseTab (mt);
	}
Пример #6
0
	void Plugin::handleNewTab (const QString& name, QWidget *mt)
	{
		connect (mt,
				SIGNAL (removeTab (QWidget*)),
				this,
				SIGNAL (removeTab (QWidget*)));

		emit addNewTab (MailTabClass_.VisibleName_, mt);
		emit raiseTab (mt);
	}
Пример #7
0
	void CoreInstanceObject::TabOpenRequested (const QByteArray& tabClass)
	{
		if (tabClass == "org.LeechCraft.SettingsPane")
		{
			emit addNewTab (tr ("Settings"), SettingsTab_);
			emit raiseTab (SettingsTab_);
		}
		else
			qWarning () << Q_FUNC_INFO
					<< "unknown tab class"
					<< tabClass;
	}
Пример #8
0
	void Plugin::TabOpenRequested (const QByteArray& tc)
	{
		if (tc == PlayerTC_.TabClass_)
		{
			emit addNewTab ("LMP", PlayerTab_);
			emit raiseTab (PlayerTab_);
		}
		else
			qWarning () << Q_FUNC_INFO
					<< "unknown tab class"
					<< tc;
	}
Пример #9
0
	void Plugin::TabOpenRequested (const QByteArray& tabClass)
	{
		if (tabClass == "Lackman")
		{
			emit addNewTab (GetName (), this);
			emit raiseTab (this);
		}
		else
			qWarning () << Q_FUNC_INFO
					<< "unknown tab class"
					<< tabClass;
	}
Пример #10
0
	void Plugin::handleNewTab (const QString& name, QWidget *mt)
	{
		connect (mt,
				SIGNAL (removeTab (QWidget*)),
				this,
				SIGNAL (removeTab (QWidget*)));

		if (const auto iwfs = qobject_cast<IWkFontsSettable*> (mt))
			WkFontsWidget_->RegisterSettable (iwfs);

		emit addNewTab (name, mt);
		emit raiseTab (mt);
	}
Пример #11
0
	void Plugin::CreateTab ()
	{
		BlogiqueWidget *blogPage = new BlogiqueWidget ();

		connect (blogPage,
				SIGNAL (removeTab (QWidget*)),
				this,
				SIGNAL (removeTab (QWidget*)));

		emit addNewTab ("Blogique", blogPage);
		emit changeTabIcon (blogPage, GetIcon ());
		emit raiseTab (blogPage);
	}
Пример #12
0
	void Plugin::TabOpenRequested (const QByteArray& tabClass)
	{
		if (tabClass == "ChoroidTab")
		{
			auto t = new ChoroidTab (TabInfo_, Proxy_, this);

			connect (t,
					SIGNAL (removeTab (QWidget*)),
					this,
					SIGNAL (removeTab (QWidget*)));

			emit addNewTab ("Choroid", t);
			emit raiseTab (t);
		}
Пример #13
0
	void Core::Handle (LeechCraft::Entity e)
	{
		const QString& query = e.Entity_.toString ();
		QStringList cats = e.Additional_ ["Categories"].toStringList ();

		SummaryWidget *newTab = CreateSummaryWidget ();

		Others_ << newTab;

		cats.prepend (query);
		newTab->SetQuery (cats);

		emit addNewTab (tr ("Summary"), newTab);
		emit changeTabIcon (newTab, QIcon (":/plugins/summary/resources/images/summary.svg"));
		emit raiseTab (newTab);
	}
Пример #14
0
	void Plugin::TabOpenRequested (const QByteArray& tabClass)
	{
		if (tabClass == "MUCTab")
			Core::Instance ().handleMucJoinRequested ();
		else if (tabClass == "SD")
			handleSDWidget (new ServiceDiscoveryWidget);
		else if (tabClass == "Search")
		{
			SearchWidget *search = new SearchWidget;
			connect (search,
					SIGNAL (removeTab (QWidget*)),
					this,
					SIGNAL (removeTab (QWidget*)));
			emit addNewTab (tr ("Search"), search);
			emit raiseTab (search);
		}
Пример #15
0
ZLDialogContent &ZLQtOptionsDialog::createTab(const ZLResourceKey &key) {
	QScrollView *sv = new QScrollView(myTabWidget);
	sv->setResizePolicy(QScrollView::AutoOneFit);
	sv->setFrameStyle(QFrame::NoFrame);
	
	ZLQtDialogContent *tab = new ZLQtDialogContent(sv->viewport(), tabResource(key));
	sv->addChild(tab->widget());
	myMenu->insertItem(::qtString(tab->displayName()), -1, myTabs.size());
	myTabWidget->addWidget(sv, myTabs.size());
	myTabs.push_back(tab);

	if(myTabs.size() == 1) {
		raiseTab(0);
	}

	return *tab;
}
Пример #16
0
	void Plugin::TabOpenRequested (const QByteArray& tcId,
			const DynPropertiesList_t& list, QDataStream *recover)
	{
		if (tcId == PhotosTabTC_.TabClass_)
		{
			auto tab = new PhotosTab (AccountsMgr_, PhotosTabTC_, this, Proxy_);
			for (const auto& prop : list)
				tab->setProperty (prop.first, prop.second);
			connect (tab,
					SIGNAL (removeTab (QWidget*)),
					this,
					SIGNAL (removeTab (QWidget*)));
			emit addNewTab (PhotosTabTC_.VisibleName_, tab);
			emit raiseTab (tab);

			if (recover)
				tab->RecoverState (*recover);
		}
Пример #17
0
void ZLQtOptionsDialog::selectTab(int i) {
	raiseTab(myMenu->indexOf(i));
}