WebbrowserCommandHandler::WebbrowserCommandHandler( PixelStreamWindowManager& windowManager,
                                                    PixelStreamerLauncher& pixelStreamLauncher,
                                                    const QString& defaultURL )
    : _windowManager( windowManager )
    , _defaultURL( defaultURL )
{
    connect( this, SIGNAL( openWebBrowser( QPointF, QSize, QString )),
             &pixelStreamLauncher,
             SLOT( openWebBrowser( QPointF, QSize, QString )));
}
void WebbrowserWidget::accept()
{
    const QSize dimensions(widthSpinBox_->value(), heightSpinBox_->value());

    emit openWebBrowser(QPointF(.5,.5), dimensions, urlLineEdit_->text());

    QDialog::accept();
}
예제 #3
0
MasterWindow::MasterWindow(ScenePtr scene_, OptionsPtr options,
                           ScreenLockPtr lock, Configuration& config)
    : QMainWindow()
    , _scene{scene_}
    , _options(options)
    , _backgroundWidget(new BackgroundWidget(config, this))
#if TIDE_ENABLE_WEBBROWSER_SUPPORT
    , _webbrowserWidget(new WebbrowserWidget(config, this))
#endif
    , _contentFolder(config.folders.contents)
    , _sessionFolder(config.folders.sessions)
    , _tmpDir(config.folders.tmp)
    , _uploadDir(config.folders.upload)
{
    _backgroundWidget->setModal(true);

#if TIDE_ENABLE_WEBBROWSER_SUPPORT
    connect(_webbrowserWidget, &WebbrowserWidget::openWebBrowser,
            [this](QString url, QSize size, ushort debugPort) {
                emit openWebBrowser(_getActiveSceneIndex(), url, size,
                                    QPointF(), debugPort);
            });
#endif

    connect(&_loadSessionOp, &QFutureWatcher<ScenePtr>::finished, [this]() {
        if (auto scene = _loadSessionOp.result())
            emit sessionLoaded(scene);
        else
            QMessageBox::warning(this, "Error", "Could not load session file.",
                                 QMessageBox::Ok, QMessageBox::Ok);
    });

    connect(&_saveSessionOp, &QFutureWatcher<bool>::finished, [this]() {
        if (!_saveSessionOp.result())
            QMessageBox::warning(this, "Error", "Could not save session file.",
                                 QMessageBox::Ok, QMessageBox::Ok);
    });

    resize(DEFAULT_WINDOW_SIZE);
    setAcceptDrops(true);

    _setupMasterWindowUI();
    _addSurfacesTabViews(config, lock);

    show();
}
void WebbrowserCommandHandler::handle( const deflect::Command& command,
                                       const QString& senderUri )
{
    QString url = command.getArguments();
    if( url.isEmpty( ))
        url = _defaultURL;

    QPointF position;

    // Center the new content where the dock is
    // TODO: DISCL-230
    ContentWindowPtr parentWindow = _windowManager.getContentWindow(senderUri);
    if( parentWindow )
        position = parentWindow->getCoordinates().center();

    emit openWebBrowser( position, QSize(), url );
}
void OpenWebBrowser(const QString &url)
{
    openWebBrowser(url);
}