void VimeoPlaylistDialog::showNewPlaylist() {
    if (!m_scrollArea) {
        m_scrollArea = new QScrollArea(this);
        QWidget *scrollWidget = new QWidget(m_scrollArea);
        m_titleEdit = new QLineEdit(scrollWidget);
        m_descriptionEdit = new QTextEdit(scrollWidget);
        m_passwordEdit = new QLineEdit(scrollWidget);
        m_passwordEdit->setEchoMode(QLineEdit::Password);
        
        QVBoxLayout *vbox = new QVBoxLayout(scrollWidget);
        vbox->addWidget(new QLabel(tr("Title"), scrollWidget));
        vbox->addWidget(m_titleEdit);
        vbox->addWidget(new QLabel(tr("Description"), scrollWidget));
        vbox->addWidget(m_descriptionEdit);
        vbox->addWidget(new QLabel(tr("Password (if private)"), scrollWidget));
        vbox->addWidget(m_passwordEdit);
        vbox->setContentsMargins(0, 0, 0, 0);
        
        m_scrollArea->setWidget(scrollWidget);
        m_scrollArea->setWidgetResizable(true);
        
        m_stack->addWidget(m_scrollArea);
        
        connect(m_titleEdit, SIGNAL(textEdited(QString)), this, SLOT(onTitleChanged(QString)));
    }
    
    m_stack->setCurrentWidget(m_scrollArea);
}
Beispiel #2
0
void TabsManager::init()
{
    kdebugf();

    setState(StateNotLoaded);

    createDefaultConfiguration();

    connect(m_chatWidgetRepository, SIGNAL(chatWidgetRemoved(ChatWidget*)), this, SLOT(onDestroyingChat(ChatWidget *)));

    TabDialog = m_pluginInjectedFactory->makeInjected<TabWidget>(this);
    TabDialog->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(TabDialog, SIGNAL(currentChanged(int)), this, SLOT(onTabChange(int)));
    connect(TabDialog, SIGNAL(contextMenu(QWidget *, const QPoint &)),
            this, SLOT(onContextMenu(QWidget *, const QPoint &)));

    connect(Title, SIGNAL(titleChanged()), this, SLOT(onTitleChanged()));

    new WindowGeometryManager(new ConfigFileVariantWrapper(m_configuration, "Chat", "TabWindowsGeometry"), QRect(30, 30, 550, 400), TabDialog);

    makePopupMenu();

    // pozycja tabów
    configurationUpdated();

    m_menuInventory
    ->menu("buddy-list")
    ->addAction(m_openInNewTabAction, KaduMenu::SectionChat, 20)
    ->update();

    openStoredChatTabs();

    kdebugf2();
}
NewPlaylistWidget::NewPlaylistWidget( QWidget* parent )
    : QWidget( parent )
    , ui( new Ui::NewPlaylistWidget )
{
    ui->setupUi( this );

    m_saveButton = new QPushButton( tr( "&Create Playlist" ) );
    m_saveButton->setDefault( true );
    m_saveButton->setEnabled( false );

    ui->buttonBox->addButton( m_saveButton, QDialogButtonBox::AcceptRole );

    connect( ui->titleEdit, SIGNAL( textChanged( QString ) ), SLOT( onTitleChanged( QString ) ) );
    connect( ui->tagEdit, SIGNAL( textChanged( QString ) ), SLOT( onTagChanged() ) );
    connect( ui->buttonBox, SIGNAL( accepted() ), SLOT( savePlaylist() ) );
    connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( cancel() ) );

    m_suggestionsModel = new PlaylistModel( ui->suggestionsView );
    ui->suggestionsView->setPlaylistModel( m_suggestionsModel );
    ui->suggestionsView->overlay()->setEnabled( false );

    connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( updateSuggestions() ) );

    ui->titleEdit->setFocus();
}
Beispiel #4
0
void MainWindow::buildUI()
{
    delete m_toolBar;

    m_toolBar = addToolBar("Navigation");
    QAction* reloadAction = page()->action(QWebPage::Reload);
    connect(reloadAction, SIGNAL(triggered()), this, SLOT(changeLocation()));

    m_toolBar->addAction(page()->action(QWebPage::Back));
    m_toolBar->addAction(page()->action(QWebPage::Forward));
    m_toolBar->addAction(reloadAction);
    m_toolBar->addAction(page()->action(QWebPage::Stop));

#ifndef QT_NO_INPUTDIALOG
    urlEdit = new LocationEdit(m_toolBar);
    urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy());
    connect(urlEdit, SIGNAL(returnPressed()), SLOT(changeLocation()));
    QCompleter* completer = new QCompleter(m_toolBar);
    urlEdit->setCompleter(completer);
    completer->setModel(&urlModel);
    m_toolBar->addWidget(urlEdit);

    connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(setAddressUrl(QUrl)));
    connect(page(), SIGNAL(loadProgress(int)), urlEdit, SLOT(setProgress(int)));
#endif

    connect(page()->mainFrame(), SIGNAL(loadStarted()), this, SLOT(onLoadStarted()));
    connect(page()->mainFrame(), SIGNAL(iconChanged()), this, SLOT(onIconChanged()));
    connect(page()->mainFrame(), SIGNAL(titleChanged(QString)), this, SLOT(onTitleChanged(QString)));
    connect(page(), SIGNAL(windowCloseRequested()), this, SLOT(close()));

#ifndef QT_NO_SHORTCUT
    // short-cuts
    page()->action(QWebPage::Back)->setShortcut(QKeySequence::Back);
    page()->action(QWebPage::Stop)->setShortcut(Qt::Key_Escape);
    page()->action(QWebPage::Forward)->setShortcut(QKeySequence::Forward);
    page()->action(QWebPage::Reload)->setShortcut(QKeySequence::Refresh);
#ifndef QT_NO_UNDOSTACK
    page()->action(QWebPage::Undo)->setShortcut(QKeySequence::Undo);
    page()->action(QWebPage::Redo)->setShortcut(QKeySequence::Redo);
#endif
    page()->action(QWebPage::Cut)->setShortcut(QKeySequence::Cut);
    page()->action(QWebPage::Copy)->setShortcut(QKeySequence::Copy);
    page()->action(QWebPage::Paste)->setShortcut(QKeySequence::Paste);
    page()->action(QWebPage::SelectAll)->setShortcut(QKeySequence::SelectAll);

    page()->action(QWebPage::ToggleBold)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_B));
    page()->action(QWebPage::ToggleItalic)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_I));
    page()->action(QWebPage::ToggleUnderline)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_U));
#endif
}
Beispiel #5
0
FormFeedDetails::FormFeedDetails(ServiceRoot *service_root, QWidget *parent)
  : QDialog(parent),
    m_editableFeed(nullptr),
    m_serviceRoot(service_root) {
  initialize();
  createConnections();

  // Initialize that shit.
  onTitleChanged(QString());
  onDescriptionChanged(QString());
  onUrlChanged(QString());
  onUsernameChanged(QString());
  onPasswordChanged(QString());
}
Beispiel #6
0
void FormFeedDetails::createConnections() {
  // General connections.
  connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(apply()));
  connect(m_ui->m_txtTitle->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onTitleChanged(QString)));
  connect(m_ui->m_txtDescription->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onDescriptionChanged(QString)));
  connect(m_ui->m_txtUrl->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUrlChanged(QString)));
  connect(m_ui->m_txtUsername->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onUsernameChanged(QString)));
  connect(m_ui->m_txtPassword->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onPasswordChanged(QString)));
  connect(m_ui->m_gbAuthentication, SIGNAL(toggled(bool)), this, SLOT(onAuthenticationSwitched()));
  connect(m_ui->m_cmbAutoUpdateType, SIGNAL(currentIndexChanged(int)), this, SLOT(onAutoUpdateTypeChanged(int)));
  connect(m_ui->m_btnFetchMetadata, SIGNAL(clicked()), this, SLOT(guessFeed()));

  // Icon connections.
  connect(m_actionFetchIcon, SIGNAL(triggered()), this, SLOT(guessIconOnly()));
  connect(m_actionLoadIconFromFile, SIGNAL(triggered()), this, SLOT(onLoadIconFromFile()));
  connect(m_actionNoIcon, SIGNAL(triggered()), this, SLOT(onNoIconSelected()));
  connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon()));
}
void DailymotionPlaylistDialog::showNewPlaylist() {
    if (!m_widget) {
        m_widget = new QWidget(this);
        m_titleEdit = new QLineEdit(m_widget);
        m_descriptionEdit = new QTextEdit(m_widget);
        
        QVBoxLayout *vbox = new QVBoxLayout(m_widget);
        vbox->addWidget(new QLabel(tr("Title"), m_widget));
        vbox->addWidget(m_titleEdit);
        vbox->addWidget(new QLabel(tr("Description"), m_widget));
        vbox->addWidget(m_descriptionEdit);
        vbox->setContentsMargins(0, 0, 0, 0);
        
        m_stack->addWidget(m_widget);
        
        connect(m_titleEdit, SIGNAL(textEdited(QString)), this, SLOT(onTitleChanged(QString)));
    }
    
    m_stack->setCurrentWidget(m_widget);
}
Beispiel #8
0
void WebBrowser::createConnections() {
  connect(m_webView, &WebViewer::messageStatusChangeRequested, this, &WebBrowser::receiveMessageStatusChangeRequest);

  connect(m_txtLocation,SIGNAL(submitted(QString)), this, SLOT(loadUrl(QString)));
  connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SLOT(updateUrl(QUrl)));

  // Connect this WebBrowser to global TabWidget.
  //TabWidget *tab_widget = qApp->mainForm()->tabWidget();
  //connect(m_webView, SIGNAL(newTabRequested()), tab_widget, SLOT(addEmptyBrowser()));
  //connect(m_webView, SIGNAL(linkMiddleClicked(QUrl)), tab_widget, SLOT(addLinkedBrowser(QUrl)));

  // Change location textbox status according to webpage status.
  connect(m_webView, SIGNAL(loadStarted()), this, SLOT(onLoadingStarted()));
  connect(m_webView, SIGNAL(loadProgress(int)), this, SLOT(onLoadingProgress(int)));
  connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(onLoadingFinished(bool)));

  // Forward title/icon changes.
  connect(m_webView, SIGNAL(titleChanged(QString)), this, SLOT(onTitleChanged(QString)));
  connect(m_webView, SIGNAL(iconChanged(QIcon)), this, SLOT(onIconChanged(QIcon)));
}
Beispiel #9
0
WebView::WebView(QWidget *parent) :
    QWebView(parent)
{
    QSettings settings;
    request.setClientId(settings.value("Authentication/clientId").toString());
    request.setClientSecret(settings.value("Authentication/clientSecret").toString());
    request.setApiKey(settings.value("Authentication/apiKey").toString());
    request.setScopes(settings.value("Authentication/scopes").toStringList());
    
    connect(this, SIGNAL(titleChanged(QString)), this, SLOT(onTitleChanged(QString)));
    connect(&request, SIGNAL(finished()), this, SLOT(onRequestFinished()));
        
    QUrl u(QYouTube::AUTH_URL);
#if QT_VERSION >= 0x050000
    QUrlQuery query(u);
    query.addQueryItem("client_id", request.clientId());
    query.addQueryItem("redirect_uri", QYouTube::REDIRECT_URI);
    query.addQueryItem("response_type", "code");
    query.addQueryItem("scope", request.scopes().join(" "));
    query.addQueryItem("access_type", "offline");
    query.addQueryItem("display", "popup");
    u.setQuery(query);
#else
    u.addQueryItem("client_id", request.clientId());
    u.addQueryItem("redirect_uri", QYouTube::REDIRECT_URI);
    u.addQueryItem("response_type", "code");
    u.addQueryItem("scope", request.scopes().join(" "));
    u.addQueryItem("access_type", "offline");
    u.addQueryItem("display", "popup");
#endif
#ifdef QYOUTUBE_DEBUG
    qDebug() << "WebView::setUrl" << u;
#endif
    setWindowTitle(tr("YouTube authentication"));
    setUrl(u);
}