Exemple #1
0
void PlaylistWindow::addSimplePlaylist(QStringList data)
{

    auto pl = PlaylistCollection::getSingleton()->newPlaylist(tr("New Playlist"));
    pl->fromStringList(data);
    addNewTab(pl->uuid(), pl->title());
}
Exemple #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;
}
Exemple #3
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_);
			}
Exemple #4
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;
	}
Exemple #5
0
void MainWindow::on_contactsList_doubleClicked(const QModelIndex &index)
{
    QString to = index.model()->index(index.row(), ContactAlias, QModelIndex()).data().toString();

    if(tabIsOpen(to)) {
        openChatBox();
    }else
        addNewTab(to);
}
Exemple #6
0
	void Plugin::handleHistoryRequested ()
	{
		ChatHistoryWidget *wh = new ChatHistoryWidget;
		connect (wh,
				SIGNAL (removeSelf (QWidget*)),
				this,
				SIGNAL (removeTab (QWidget*)));
		emit addNewTab (tr ("Chat history"), wh);
	}
Exemple #7
0
			void Plugin::newTabRequested ()
			{
				TabWidget *w = new TabWidget ();
				connect (w,
						SIGNAL (removeTab (QWidget*)),
						this,
						SIGNAL (removeTab (QWidget*)));
				emit addNewTab (QString ("Tab++"), w);
			}
Exemple #8
0
	void Aggregator::TabOpenRequested (const QByteArray& tabClass)
	{
		if (tabClass == "Aggregator")
			emit addNewTab (GetTabClassInfo ().VisibleName_, this);
		else
			qWarning () << Q_FUNC_INFO
					<< "unknown tab class"
					<< tabClass;
	}
Exemple #9
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);
	}
Exemple #10
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);
	}
Exemple #11
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;
	}
	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;
	}
Exemple #13
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;
	}
Exemple #14
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);
	}
Exemple #15
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);
	}
Exemple #16
0
void PlaylistWindow::newTab()
{
    bool ok;
    QString title = QInputDialog::getText(this, tr("Enter Playlist Name"),
                                           "Name", QLineEdit::Normal,
                                          tr("New Playlist"), &ok);
    if (!ok)
        return;
    else if (title.isEmpty())
        title = tr("New Playlist");

    auto pl = PlaylistCollection::getSingleton()->newPlaylist(title);
    addNewTab(pl->uuid(), pl->title());
}
//================================================================================
void ROCWidget::on_addRowTabPB_clicked()
{
  newNonStandardTabDialog dialog(this) ;
  dialog.setType("row") ;
  dialog.setRange(0,ROC_->keyValue_["MAX_ROWS"].toInt()) ;
  dialog.exec() ;
  if( !dialog.state() ) return ;

  emit addNewTab(this,
                 ROC_,
                 QString("row"),
                 dialog.getNewRowCol(),
                 dialog.getNewPitch()) ;
}
Exemple #18
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);
		}
Exemple #19
0
PlaylistWindow::PlaylistWindow(QWidget *parent) :
    QDockWidget(parent),
    ui(new Ui::PlaylistWindow),
    currentPlaylist(),
    showSearch(false)
{
    clipboard = new PlaylistSelection;

    ui->setupUi(this);
    addNewTab(QUuid(), tr("Quick Playlist"));
    ui->searchHost->setVisible(false);
    ui->searchField->installEventFilter(this);

    connectSignalsToSlots();
}
Exemple #20
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);
	}
Exemple #21
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);
		}
Exemple #22
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;
			}
Exemple #23
0
void PlaylistWindow::tabsFromVList(const QVariantList &qvl)
{
    ui->tabWidget->clear();
    widgets.clear();
    for (const QVariant &v : qvl) {
        auto qdp = new QDrawnPlaylist();
        qdp->setDisplayParser(&displayParser);
        qdp->fromVMap(v.toMap());
        connect(qdp, &QDrawnPlaylist::itemDesired, this, &PlaylistWindow::itemDesired);
        auto pl = PlaylistCollection::getSingleton()->playlistOf(qdp->uuid());
        ui->tabWidget->addTab(qdp, pl->title());
        widgets.insert(pl->uuid(), qdp);
    }
    if (widgets.count() < 1)
        addNewTab(QUuid(), tr("Quick Playlist"));
}
Exemple #24
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);
		}
Exemple #25
0
// Add message to ChatBox
void MainWindow::addToConversation(ChatMessage msg)
{
    openChatBox();

    QString tabName = msg.to();

    if(msg.to() == myProfile->login)
        tabName = msg.from();

    bool tabOpen = tabIsOpen(tabName);

    if(!tabOpen)
        addNewTab(tabName);

    // Get sender CBDC widget and add to conversation message
    ChatBoxDialogContent *w = (ChatBoxDialogContent*) sender();
    w->ui->conversationHistory->append(msg.toHtml());

    qDebug()<<"client: '" + msg.from() + "' send to '" + msg.to() + "' message: '" + msg.text() + "'";
}
Exemple #26
0
void MainWindow::on_actionOpen_triggered()
{
   QString fileName = QFileDialog::getOpenFileName(this);
   if(fileName.isEmpty())
       return ;
   QString name = fileName.right(fileName.length()-fileName.indexOf("#")-1);
   QString timename = name.left(name.length()-4);
   QDateTime startTime=QDateTime::fromString(timename,"yyyy-MM-dd hh-mm-ss");
   if(startTime.isValid()==false)
   {

       QMessageBox::critical(this,"error","wrong file name");
       return;
   }
   if(loadData(fileName))
   {
        addNewTab(fileName);
   }

}
MainTabWidget::MainTabWidget(QWidget *parent) :
	QTabWidget(parent),
	ui(new Ui::MainTabWidget),
	m_loading(true)
{
	ui->setupUi(this);

	auto addTabBtn = new QToolButton(this);
	addTabBtn->setIcon(QIcon(":/gfx/list-add.png"));
	addTabBtn->setToolTip(tr("Open a new tab"));
	connect(addTabBtn, SIGNAL(clicked()), this, SLOT(addNewTab()));

	int i = addTab(new QLabel("Add tabs by pressing \"+\""), QString());
	setTabEnabled(i, false);
	tabBar()->setTabButton(i, QTabBar::RightSide, addTabBtn);

	load();

	connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
	connect(this, SIGNAL(currentChanged(int)), this, SLOT(tabChange(int)));
	connect(tabBar(), SIGNAL(tabMoved(int,int)), this, SLOT(handleTabMove(int,int)));
}
Exemple #28
0
void PlaylistWindow::duplicateTab()
{
    auto origin = currentPlaylistWidget();
    auto remote = PlaylistCollection::getSingleton()->clonePlaylist(origin->uuid());
    addNewTab(remote->uuid(), remote->title());
}
//-------------------------------------------------------------------------
QPlainTextEdit* MainWindow::getTab(const QString& fileName)
{
  QPlainTextEdit *result = findTab(fileName);
  return result != 0 ? result : addNewTab(fileName);
}
AddTabDesignerAction::AddTabDesignerAction()
    : AbstractAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
{
    connect(action(), SIGNAL(triggered()), this, SLOT(addNewTab()));
}