Ejemplo n.º 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_);
			}
Ejemplo n.º 2
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);
	}
Ejemplo n.º 3
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);
	}
Ejemplo n.º 4
0
			void TabManager::AddTab (const QUrl& url, QString local)
			{
				if (local.isEmpty () ||
						local == "." ||
						local == "..")
					local = XmlSettingsManager::Instance ()
						.Property ("LastPanedLocalPath", QDir::homePath ()).toString ();

				TabWidget_ptr w (new TabWidget (url, local));
				QString tabName = url.host ();
				if (tabName.isEmpty ())
					tabName = "LCFTP";
				emit addNewTab (tabName, w);
				emit changeTabIcon (w, QIcon (":/resources/images/lcftp.svg"));
				Widgets_ << w;
			}
Ejemplo n.º 5
0
	void Core::handleIconChanged (const QIcon& newIcon)
	{
		emit changeTabIcon (dynamic_cast<QWidget*> (sender ()), newIcon);
	}