コード例 #1
0
ファイル: htmlview.cpp プロジェクト: delight/Pana
HTMLView::HTMLView( QWidget *parentWidget, const char *widgetname, const bool DNDEnabled, const bool JScriptEnabled )
        : KHTMLPart( parentWidget, widgetname )
{
    m_instances++;
    setJavaEnabled( false );
    setPluginsEnabled( false );

    setDNDEnabled( DNDEnabled );
    setJScriptEnabled( JScriptEnabled );

    KActionCollection* ac = actionCollection();
    ac->setAutoConnectShortcuts( true );
    m_copy = KStdAction::copy( this, SLOT( copyText() ), ac, "htmlview_copy" );
    m_selectAll = KStdAction::selectAll( this, SLOT( selectAll() ), ac, "htmlview_select_all" );
    {
        KPopupMenu m;
        m_copy->plug( &m );
        m_selectAll->plug( &m );

        m_copy->unplug( &m );
        m_selectAll->unplug( &m );
    }

    connect( this, SIGNAL( selectionChanged() ), SLOT( enableCopyAction() ) );
    enableCopyAction();
}
コード例 #2
0
ファイル: movelist_textual.cpp プロジェクト: Axure/tagua
Textual::Textual(QWidget *parent)
: KHTMLPart(parent, parent, KHTMLPart::BrowserViewGUI)
, m_curr_selected(-1)
, m_layout_style(0) {

  m_loader.setSize(12);

  connect(browserExtension(), SIGNAL(openUrlRequest(const KUrl&,const KParts::URLArgs&)),
                                                                    this, SLOT(onURL(const KUrl&)));
  setJScriptEnabled(false);
  setJavaEnabled(false);
  setMetaRefreshEnabled(false);
  setPluginsEnabled(false);

  QString fpath = KStandardDirs::locate("appdata", "scripts/movelist_textual.html");
  //kDebug() << "HTML file is:"<< fpath;
  QFile file(fpath);
  file.open(QIODevice::ReadOnly);
  QTextStream stream(&file);
  QString html = stream.readAll();
  //kDebug() << "Using HTML:"<<html;

  begin();
  write(html);
  end();
  setMove(0, -1, "Mainline:");
}
コード例 #3
0
WelcomePageView::WelcomePageView(QWidget* const parent)
    : KHTMLPart(parent)
{
    widget()->setFocusPolicy(Qt::WheelFocus);
    // Let's better be paranoid and disable plugins (it defaults to enabled):
    setPluginsEnabled(false);
    setJScriptEnabled(false); // just make this explicit.
    setJavaEnabled(false);    // just make this explicit.
    setMetaRefreshEnabled(false);
    setURLCursor(Qt::PointingHandCursor);
    view()->adjustSize();

    // Disable some KHTMLPart actions as they break predefined digiKam actions.
    // We can re-assign the disabled actions later if we ever need to.
    disablePredefinedActions();

    // ------------------------------------------------------------

    connect(browserExtension(), SIGNAL(openUrlRequest(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)),
            this, SLOT(slotUrlOpen(KUrl)));

    connect(ThemeManager::instance(), SIGNAL(signalThemeChanged()),
            this, SLOT(slotThemeChanged()));

    QTimer::singleShot(0, this, SLOT(slotThemeChanged()));
}
コード例 #4
0
void KCHMViewWindow_KHTMLPart::invalidate( )
{
	m_zoomfactor = 0;

	setJScriptEnabled ( appConfig.m_kdeEnableJS );
	setJavaEnabled ( appConfig.m_kdeEnableJava );
	setMetaRefreshEnabled ( appConfig.m_kdeEnableRefresh );
	setPluginsEnabled ( appConfig.m_kdeEnablePlugins );
	
	KCHMViewWindow::invalidate( );
}
コード例 #5
0
GPSTrackListWidget::GPSTrackListWidget(QWidget* parent)
                  : KHTMLPart(parent), d(new GPSTrackListWidgetPrivate)
{
    setJScriptEnabled(true);
    setDNDEnabled(false);
    setEditable(false);

    view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view()->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view()->setMinimumSize(480, 360);
    view()->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
}