Exemplo n.º 1
0
    void WorkAreaWidget::handle(OpeningShellEvent *event)
    {
        const QString &title = event->shell->title();

        QString shellName = title.isEmpty() ? " Loading..." : title;

        setUpdatesEnabled(false);
        QueryWidget *queryWidget = new QueryWidget(event->shell,_tabWidget);

        _tabWidget->addTab(queryWidget, shellName);
        _tabWidget->setCurrentIndex(_tabWidget->count() - 1);
#if !defined(Q_OS_MAC)
        _tabWidget->setTabIcon(_tabWidget->count() - 1, GuiRegistry::instance().mongodbIcon());
#endif
        setUpdatesEnabled(true);
        queryWidget->showProgress();
    }
Exemplo n.º 2
0
void WorkAreaTabWidget::handle(OpeningShellEvent *event)
{
    const QString &title = event->shell->title();

    QString shellName = title.isEmpty() ? " Loading..." : title;

    QueryWidget *queryWidget = new QueryWidget(event->shell,this);
    VERIFY(connect(queryWidget, SIGNAL(titleChanged(const QString &)), this, SLOT(tabTextChange(const QString &))));
    VERIFY(connect(queryWidget, SIGNAL(toolTipChanged(const QString &)), this, SLOT(tooltipTextChange(const QString &))));

    addTab(queryWidget, shellName);

    setCurrentIndex(count() - 1);
#if !defined(Q_OS_MAC)
    setTabIcon(count() - 1, GuiRegistry::instance().mongodbIcon());
#endif
    if (event->shell->isExecutable()) {
        queryWidget->showProgress();
    }
}