Example #1
0
void Hdd_Activity::init()
{
    KGlobal::locale()->insertCatalog("plasma_applet_system-monitor");
    setEngine(dataEngine("systemmonitor"));
    setTitle(i18n("Disk Activity"), true);

    /* At the time this method is running, not all sources may be connected. */
    connect(engine(), SIGNAL(sourceAdded(QString)), this, SLOT(sourceChanged(QString)));
    connect(engine(), SIGNAL(sourceRemoved(QString)), this, SLOT(sourceChanged(QString)));

    foreach (const QString& source, engine()->sources()) {
        sourceChanged(source);
    }
Example #2
0
/*
 * This SLOT is called every time the user clicks a url inside newsTab textBrowser
 */
void MainWindow::onTabNewsSourceChanged(QUrl newSource)
{
  if(newSource.isRelative())
  {
    //If the user clicked a relative and impossible to display link...
    QTextBrowser *text = ui->twProperties->widget(ctn_TABINDEX_NEWS)->findChild<QTextBrowser*>("textBrowser");
    if (text)
    {
      disconnect(text, SIGNAL(sourceChanged(QUrl)), this, SLOT(onTabNewsSourceChanged(QUrl)));
      text->setHtml(utils::parseDistroNews());
      connect(text, SIGNAL(sourceChanged(QUrl)), this, SLOT(onTabNewsSourceChanged(QUrl)));
    }
  }
}
Example #3
0
void ShotgunField::setSource(Node *source)
{
    if (m_source != source) {
        m_source = source;
        emit sourceChanged(m_source);
    }
}
Example #4
0
Player::Player(  QWidget * parent, Qt::WindowFlags f)
    : QWidget(parent, f)
{
    m_current =NULL;
    last=NULL;

#ifdef REPEAT
    m_repeatCheck = false;
#endif
    m_mediaPlayer = new QMediaPlayer();
    connect(m_mediaPlayer,SIGNAL(stateChanged(QMediaPlayer::State)),this,SLOT(playerStatusChanged(QMediaPlayer::State)));
    connect(m_mediaPlayer,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(statusChanged(QMediaPlayer::MediaStatus)));

    connect(m_mediaPlayer,SIGNAL(currentMediaChanged(QMediaContent)),this,SLOT(sourceChanged(QMediaContent)));
    mypreference = Preference_data::getInstance();
    myPlaylist = Playlist::getInstance();
    m_listposition = -1;
    position = 0;
    selectedReadMode = mypreference->getSelectedReadMode();

    setupActions();

    //readSettings();
    setupUi();
    m_seekSlider->setMaximum(0);

}
Example #5
0
//![0]
MainWindow::MainWindow()
{
    audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
    mediaObject = new Phonon::MediaObject(this);
    metaInformationResolver = new Phonon::MediaObject(this);

    mediaObject->setTickInterval(1000);
//![0]
//![2]
    connect(mediaObject, SIGNAL(tick(qint64)), this, SLOT(tick(qint64)));
    connect(mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
            this, SLOT(stateChanged(Phonon::State,Phonon::State)));
    connect(metaInformationResolver, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
            this, SLOT(metaStateChanged(Phonon::State,Phonon::State)));
    connect(mediaObject, SIGNAL(currentSourceChanged(Phonon::MediaSource)),
            this, SLOT(sourceChanged(Phonon::MediaSource)));
    connect(mediaObject, SIGNAL(aboutToFinish()), this, SLOT(aboutToFinish()));
//![2]

//![1]
    Phonon::createPath(mediaObject, audioOutput);
//![1]

    setupActions();
    setupMenus();
    setupUi();
    timeLcd->display("00:00"); 
}
Example #6
0
void MySvgView::setSource(QUrl arg)
{
    if (m_source != arg) {
        m_source = arg;

        QString str = m_source.toLocalFile();
        if(str == "") {
            str = m_source.toString();
            if(str=="") {
                svg->deleteLater();
                svg = new QSvgRenderer(this);
                return;
            }
        }

        if( str.mid (0, 3) == "qrc")
            str = str.mid (3, str.count ()-3);
        svg->load (str);
        setDefaultSize (svg->defaultSize ());
        int width = svg->defaultSize ().width ();
        int height = svg->defaultSize ().height ();
        setImplicitWidth(width);
        setImplicitHeight(height);
        update ();
        emit sourceChanged(arg);
    }
}
void QDeclarativeAudio::setSource(const QUrl &url)
{
    if (url == m_source)
        return;

    m_source = url;
    m_content = m_source.isEmpty() ? QMediaContent() : m_source;
    m_loaded = false;
    if (m_complete && (m_autoLoad || m_content.isNull() || m_autoPlay)) {
        if (m_error != QMediaPlayer::ServiceMissingError && m_error != QMediaPlayer::NoError) {
            m_error = QMediaPlayer::NoError;
            m_errorString = QString();

            emit errorChanged();
        }

        m_player->setMedia(m_content, 0);
        m_loaded = true;
    }
    else
        emit sourceChanged();

    if (m_autoPlay)
        m_player->play();
}
void FileIO::setSource(const QString& source) {
    mSource = source;
    if (mSource.startsWith("file://")) {
        mSource.remove(0,6);
    }
    sourceChanged();
}
Example #9
0
MetaWindow::MetaWindow(QWidget *parent, Qt::WindowFlags flags)
  :QMainWindow(parent,flags)
{
  serverConnection = new UDJServerConnection(this);
  audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
  mediaObject = new Phonon::MediaObject(this);

  mediaObject->setTickInterval(1000);
  connect(mediaObject, SIGNAL(tick(qint64)), this, SLOT(tick(qint64)));
  connect(mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
    this, SLOT(stateChanged(Phonon::State, Phonon::State)));
  connect(mediaObject, SIGNAL(currentSourceChanged(Phonon::MediaSource)),
    this, SLOT(sourceChanged(Phonon::MediaSource)));
  connect(mediaObject, SIGNAL(finished()), this, SLOT(finished()));

  Phonon::createPath(mediaObject, audioOutput);

  createActions();
  setupUi();
  setupMenus();
  bool ok;
  QString username = QInputDialog::getText(this, tr("Username"), 
    tr("Username:"******"", &ok);
  QString password = QInputDialog::getText(this, tr("Password"), 
    tr("Password:"******"", &ok);
  serverConnection->startConnection(username, password);
}
Example #10
0
void ResourceModel::connectToKeyboardLayout(DataIndexKeyboardLayout *keyboardLayout)
{
    connect(keyboardLayout, SIGNAL(titleChanged()), m_signalMapper, SLOT(map()));
    connect(keyboardLayout, SIGNAL(nameChanged()), m_signalMapper, SLOT(map()));
    connect(keyboardLayout, SIGNAL(pathChanged()), m_signalMapper, SLOT(map()));
    connect(keyboardLayout, SIGNAL(sourceChanged()), m_signalMapper, SLOT(map()));
}
Example #11
0
void SpriteSheet::setSource(const QUrl &source)
{
    if (m_source == source)
        return;

    if (m_pixMap)
        delete m_pixMap;

    m_source = source;

    if (m_source.url().startsWith("qrc:/"))
        m_pixMap = new QPixmap(m_source.url().replace(QString("qrc:/"), QString(":/")));
    else
        m_pixMap = new QPixmap(m_source.toLocalFile());

    if (!m_pixMap)
        qCritical() << QString("Bacon2D>>Image \'%1\' failed to load!").arg(m_source.url());

    if (m_frames)
        updateSizeInfo();

    update();

    emit sourceChanged();
}
Example #12
0
int Playengine::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: volume((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: statusChanged((*reinterpret_cast< Playengine::STATUS(*)>(_a[1]))); break;
        case 2: buffering((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: tick((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 4: togglePause(); break;
        case 5: play((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
        case 6: stop(); break;
        case 7: setVolume((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 8: stateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 9: tickslot((*reinterpret_cast< qint64(*)>(_a[1]))); break;
        case 10: sourceChanged((*reinterpret_cast< const Phonon::MediaSource(*)>(_a[1]))); break;
        case 11: metaStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 12: aboutToFinish(); break;
        case 13: bufferPercent((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 14: volumeChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 15;
    }
    return _id;
}
void HelpPopup::DoInitDialog() {
    ToLog(LOGMSG_DEBUGTRACE,"IN:HelpPopup::DoInitDialog");

    if (HelpEngine) {
        ui->HelpBrowserWidget->HelpEngine=HelpEngine;
        ui->ContentWidget->InitHelpEngine(HelpEngine);
        ui->FollowInterfaceCB->setChecked(*WikiFollowInterface);
        ui->HelpSplitter->setStretchFactor(0,1);
        ui->HelpSplitter->setStretchFactor(1,3);

        connect(ui->HelpBrowserWidget,SIGNAL(historyChanged()),SLOT(PageChanged()));
        connect(ui->HelpBrowserWidget,SIGNAL(sourceChanged(QUrl)),SLOT(SourceChanged(QUrl)));
        connect(ui->ContentWidget,SIGNAL(clicked(QModelIndex)),this,SLOT(UpdateUrl(QModelIndex)));
        connect(ui->ContentWidget,SIGNAL(collapsed(QModelIndex)),this,SLOT(CollapsedOrExpanded(QModelIndex)));
        connect(ui->ContentWidget,SIGNAL(expanded(QModelIndex)),this,SLOT(CollapsedOrExpanded(QModelIndex)));
        connect(ui->ExitBT,SIGNAL(pressed()),this,SLOT(Exit()));
        connect(ui->PreviousBT,SIGNAL(pressed()),this,SLOT(Back()));
        connect(ui->NextBT,SIGNAL(pressed()),this,SLOT(Next()));
        connect(ui->CCBYSABT,SIGNAL(pressed()),this,SLOT(CCBYSABT()));
        connect(ui->HomeBT,SIGNAL(pressed()),this,SLOT(Home()));
        connect(ui->WebSiteBT,SIGNAL(pressed()),this,SLOT(WebSite()));
        connect(ui->ForumBT,SIGNAL(pressed()),this,SLOT(Forum()));
        connect(ui->FollowInterfaceCB,SIGNAL(clicked()),this,SLOT(Follow()));
        PageChanged();
    }
}
Example #14
0
void FilteredImage::setSource(const QString &source)
{
    if(m_source != source)
    {
        m_source = source;

        QImageReader ir(m_source);
        QByteArray format(ir.format());

        m_image = ir.read();

        NemoImageMetadata meta(m_source, format);

        if (meta.orientation() != NemoImageMetadata::TopLeft)
        {
            m_image = rotate(m_image, meta.orientation());
        }

        setImplicitWidth((qreal)m_image.width());
        setImplicitHeight((qreal)m_image.height());

        m_imageChanged = true;
        emit sourceChanged(m_source);
        emit imageChanged(m_image);
    }
}
Example #15
0
MadaoWindow::MadaoWindow()
{
    audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
    mediaObject = new Phonon::MediaObject(this);
    musicGetter = new Phonon::MediaObject(this);

    connect(mediaObject, SIGNAL(aboutToFinish()),
            this, SLOT(autoNext()));

    connect(musicGetter, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
            this, SLOT(metaStateChanged(Phonon::State,Phonon::State)));

    connect(mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
            this, SLOT(stateChanged(Phonon::State,Phonon::State)));

    connect(mediaObject, SIGNAL(currentSourceChanged(Phonon::MediaSource)),
             this, SLOT(sourceChanged(Phonon::MediaSource)));

    Phonon::createPath(mediaObject, audioOutput);

    setAllActions();
    setGui();

    resize(720,480);
    setMinimumSize(720,480);
    playing = false;
    set = false;
    currentSong = 0;
    songsNumber = 0;
    addToTable = 0;
    lastRow = 0;
    QIcon icon("Data/taizo_hasegawa_2564.jpg");
    setWindowIcon(icon);
}
Example #16
0
void Script::setUrl(QUrl url)
{
    if (url == m_url)
        return;

    QNetworkRequest request(url);
    auto reply = m_networkAccessManager.get(request);
    m_status = Loading;
    emit statusChanged(m_status);
    connect(reply, &QNetworkReply::finished, [=] () {
        if (m_status == Loading) {
            if (reply->error() == QNetworkReply::NoError) {
                m_source = QString::fromUtf8(reply->readAll());
                emit sourceChanged(m_source);

                m_status = Loaded;
                emit statusChanged(m_status);
            } else {
                emit error(nullptr, QString("Failed to load “").append(url.toString()).append("”"));

                m_status = Error;
                emit statusChanged(m_status);
            }
        }

        reply->deleteLater();
    });
}
Example #17
0
void GriloModel::setSource(GriloDataSource *source) {
  if (m_source == source) {
    return;
  }

  beginResetModel();

  if (m_source) {
    m_source->removeModel(this);
  }

  m_source = source;

  if (m_source) {
    m_source->addModel(this);
  }

  endResetModel();

  emit sourceChanged();

  if (m_source) {
    m_source->prefill(this);
  }
}
KstSettingsDlgI::KstSettingsDlgI(QWidget* parent, const char *name, WFlags fl) : KstSettingsDlg(parent, name, fl)
{
  fillAxesSettings();
  updateCurveColorSettings();
  setSettings(KstSettings::globalSettings());
  setClean();
  updateAxesButtons();
  updateAxesSettings();
  updateEMailSettings();
  _source->insertStringList(KstDataSource::pluginList());
  if (_source->count() > 0) {
    sourceChanged(_source->text(0));
  } else {
    _configureSource->setEnabled(false);
  }

  QString hours = i18n(" hours");
  QLineEdit* edit = dynamic_cast<QLineEdit*>(_valueOffset->child("qt_spinbox_edit"));
  if (edit) {
    edit->setMaxLength(5 + hours.length());
  }
  _valueOffset->setRange(-24.0, 24.0, 0.50, false);
  _valueOffset->setSuffix(i18n(" hours"));
  _colorPalette->_label->setText(i18n("Curve color sequence: "));

  connect(_spinBoxLineWidth, SIGNAL(valueChanged(int)), this, SLOT(setDirty()));
  connect(_spinBoxLineWidth->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_valueOffset->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(updateTimezone(const QString&)));
  connect(_timer->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_kIntSpinBoxEMailPort->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_colorPalette->_palette, SIGNAL(activated(int)), this, SLOT(setDirty()));
  connect(_fontSize->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
  connect(_fontMinSize->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
}
bool FileIO::addExtension(const QString &extension) {
    QString newExtension = "." + extension;
    if (!mSource.toLower().endsWith(newExtension.toLower())) {
        mSource = mSource + newExtension;
        sourceChanged();
    }
}
void sACNListener::checkSourceExpiration()
{
    char cidstr [CID::CIDSTRINGBYTES];
    for(std::vector<sACNSource *>::iterator it = m_sources.begin(); it != m_sources.end(); ++it)
    {
        if((*it)->src_valid)
        {
            if((*it)->active.Expired() && (*it)->priority_wait.Expired())
            {
                (*it)->src_valid = false;
                CID::CIDIntoString((*it)->src_cid, cidstr);
                emit sourceLost(*it);
                m_mergeAll = true;
                qDebug() << "Lost source " << cidstr;
            }
            else if ((*it)->doing_per_channel && (*it)->priority_wait.Expired())
            {
                CID::CIDIntoString((*it)->src_cid, cidstr);
                (*it)->doing_per_channel = false;
                emit sourceChanged(*it);
                m_mergeAll = true;
                qDebug() << "sACNListener" << QThread::currentThreadId() << ": Source stopped sending per-channel priority" << cidstr;
            }
        }
    }
}
Example #21
0
void Player::handleTransportChange()
{
  if (m_player)
  {
#define AVTRANSPORT_UNCHANGED           0
#define AVTRANSPORT_STATE_CHANGED       1
#define AVTRANSPORT_PLAYMODE_CHANGED    2
#define AVTRANSPORT_SLEEPTIMER_CHANGED  4
    unsigned signalMask = AVTRANSPORT_UNCHANGED;

    SONOS::AVTProperty prop = m_player->GetTransportProperty();

    setCurrentMeta(prop);
    emit sourceChanged();

    if (prop.TransportState != m_AVTProperty.TransportState)
      signalMask |= AVTRANSPORT_STATE_CHANGED;

    if (prop.CurrentPlayMode != m_AVTProperty.CurrentPlayMode)
      signalMask |= AVTRANSPORT_PLAYMODE_CHANGED;

    if (prop.r_SleepTimerGeneration != m_AVTProperty.r_SleepTimerGeneration)
      signalMask |= AVTRANSPORT_SLEEPTIMER_CHANGED;

    // Set property before emit
    m_AVTProperty = prop;
    if (signalMask & AVTRANSPORT_STATE_CHANGED)
      emit playbackStateChanged();
    if (signalMask & AVTRANSPORT_PLAYMODE_CHANGED)
      emit playModeChanged();
    if (signalMask & AVTRANSPORT_SLEEPTIMER_CHANGED)
      emit sleepTimerChanged();
  }
}
Example #22
0
void DataWizardPageDataSource::configureSource() {
  QPointer<DataSourceDialog> dialog = new DataSourceDialog(DataDialog::New, _dataSource, this);
  if ( dialog->exec() == QDialog::Accepted ) {
    sourceChanged(_dataSource->fileName());
  }
  delete dialog;
}
VectorDialog::VectorDialog(ObjectPtr dataObject, QWidget *parent)
  : DataDialog(dataObject, parent) {

  if (editMode() == Edit)
    setWindowTitle(tr("Edit Vector"));
  else
    setWindowTitle(tr("New Vector"));

  Q_ASSERT(_document);
  _vectorTab = new VectorTab(_document->objectStore(), this);
  addDataTab(_vectorTab);

  if (editMode() == Edit) {
    configureTab(dataObject);
  } else {
    configureTab(0);
  }

  connect(_vectorTab, SIGNAL(sourceChanged()), this, SLOT(updateButtons()));
  connect(_vectorTab, SIGNAL(fieldChanged()), this, SLOT(updateButtons()));

  connect(this, SIGNAL(editMultipleMode()), this, SLOT(editMultipleMode()));
  connect(this, SIGNAL(editSingleMode()), this, SLOT(editSingleMode()));

  connect(_vectorTab, SIGNAL(modified()), this, SLOT(modified()));
  updateButtons();
}
Example #24
0
void CarPI::_displayIconsChanged(int iconmask) {
    QString icons;
    bool news, rds, traffic;

    if ((iconmask & DISPLAY_ICON_NO_NEWS) == 0) {
        news = true;
    }
    else {
        news = false;
    }

    if ((iconmask & DISPLAY_ICON_NO_AFRDS) == 0) { /* Jeżeli jest AF-RDS to na pewno źródłem jest radio */
        icons += "AF-RDS";
        rds = true;

        if (_sourceCurrent != sourceFM) {
            _sourceCurrent = sourceFM;
            emit sourceChanged(_sourceCurrent);
        }
    }
    else {
        rds = false;
    }

    if ((iconmask & DISPLAY_ICON_NO_TRAFFIC) == 0) {
        traffic = true;
    }
    else {
        traffic = false;
    }

    emit radioIconsChanged(news, traffic, rds);
}
Example #25
0
void DeclarativeDragArea::setSource(QQuickItem* source)
{
    if (m_source != source) {
        m_source = source;
        emit sourceChanged();
    }
}
Example #26
0
void HelpWidget::addViewer(HelpViewer *viewer)
{
    m_viewerStack->addWidget(viewer);
    viewer->setFocus(Qt::OtherFocusReason);
    viewer->setActionVisible(HelpViewer::Action::NewPage, m_style == ModeWidget);
    viewer->setActionVisible(HelpViewer::Action::ExternalWindow, m_style != ExternalWindow);
    connect(viewer, &HelpViewer::sourceChanged, this, [viewer, this](const QUrl &url) {
        if (currentViewer() == viewer) {
            m_addBookmarkAction->setEnabled(isBookmarkable(url));
            emit sourceChanged(url);
        }
    });
    connect(viewer, &HelpViewer::forwardAvailable, this, [viewer, this](bool available) {
        if (currentViewer() == viewer)
            m_forwardAction->setEnabled(available);
    });
    connect(viewer, &HelpViewer::backwardAvailable, this, [viewer, this](bool available) {
        if (currentViewer() == viewer)
            m_backAction->setEnabled(available);
    });
    connect(viewer, &HelpViewer::printRequested, this, [viewer, this]() {
        print(viewer);
    });
    if (m_style == ExternalWindow)
        connect(viewer, &HelpViewer::titleChanged, this, &HelpWidget::updateWindowTitle);

    connect(viewer, &HelpViewer::loadFinished, this, &HelpWidget::highlightSearchTerms);
    connect(viewer, &HelpViewer::newPageRequested, [](const QUrl &url) {
        OpenPagesManager::instance().createPage(url);
    });
    connect(viewer, &HelpViewer::externalPageRequested, this, &openUrlInWindow);

    updateCloseButton();
}
Example #27
0
HelpBrowser::HelpBrowser()
{
	m_engine = new QHelpEngine(DATA_LOCATION "/doc/fatrat.qhc", this);
	if(!m_engine->setupData())
	{
		QMessageBox::critical(this, tr("Help"), tr("Failed to load the documentation."));
		deleteLater();
		return;
	}
	
	setupUi(this);
	
	QHelpContentWidget* content = m_engine->contentWidget();
	splitter->insertWidget(0, content);
	splitter->setSizes(QList<int>() << 80 << 400);
	content->setRootIsDecorated(false);
	
	textBrowser->setEngine(m_engine);
	
	connect(content, SIGNAL(linkActivated(const QUrl&)), this, SLOT(openPage(const QUrl&)));
	connect(content, SIGNAL(clicked(const QModelIndex&)), this, SLOT(itemClicked(const QModelIndex&)));
	connect(textBrowser, SIGNAL(sourceChanged(const QUrl&)), this, SLOT(sourceChanged()));
	
	openPage( QUrl(INDEX_URL) );
	
	QTimer::singleShot(100, content, SLOT(expandAll()));
	QTimer::singleShot(100, this, SLOT(sourceChanged()));
}
Example #28
0
File: text.cpp Project: KDE/klook
void MyText::setSource(const QString& source)
{
    if (m_source == source) {
        return;
    }
    m_source = source;

    QFile f(m_source);
    if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
        return;
    }

    QByteArray data = f.readAll().data();
    KEncodingProber prober(KEncodingProber::Universal);
    prober.feed(data);

    QString str;
    if (prober.confidence() > 0.7) {
        str = QTextCodec::codecForName(prober.encoding())->toUnicode(data);
    }
    else {
        str = QString::fromUtf8(data);
    }

    m_viewer->setPlainText(str);

    emit sourceChanged();
    emit ready();
}
Example #29
0
HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent)
    : QWebView(parent)
    , helpEngine(engine)
    , parentWidget(parent)
    , loadFinished(false)
{
    setAcceptDrops(false);

    setPage(new HelpPage(parent, helpEngine, this));

    page()->setNetworkAccessManager(new HelpNetworkAccessManager(engine, this));

    QAction* action = pageAction(QWebPage::OpenLinkInNewWindow);
    action->setText(tr("Open Link in New Tab"));
    if (!parent)
        action->setVisible(false);

    pageAction(QWebPage::DownloadLinkToDisk)->setVisible(false);
    pageAction(QWebPage::DownloadImageToDisk)->setVisible(false);
    pageAction(QWebPage::OpenImageInNewWindow)->setVisible(false);

    connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this,
        SLOT(actionChanged()));
    connect(pageAction(QWebPage::Back), SIGNAL(changed()), this,
        SLOT(actionChanged()));
    connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this,
        SLOT(actionChanged()));
    connect(page(), SIGNAL(linkHovered(QString,QString,QString)), this,
        SIGNAL(highlighted(QString)));
    connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));
    connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool)));
}
Example #30
0
void VectorTab::sourceValid(QString filename, int requestID) {
  if (_requestID != requestID) {
    return;
  }
  _valid = true;
  _dataSource = DataSourcePluginManager::findOrLoadSource(_store, filename);
  _field->setEnabled(true);

  _dataSource->readLock();

  _field->addItems(_dataSource->vector().list());
  if (!_initField.isEmpty()) {
    setField(_initField);
  }
  _field->setEditable(!_dataSource->vector().isListComplete());
  _configure->setEnabled(_dataSource->hasConfigWidget() && (_mode == DataVector));

  updateUpdateBox();
  updateIndexList(_dataSource);

  _dataSource->unlock();


  validating = false;

  _store->cleanUpDataSourceList();
  _field->setEnabled(_mode == DataVector);

  emit sourceChanged();
}