Esempio n. 1
0
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:");
}
Esempio n. 2
0
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();
}
Esempio n. 3
0
void SettingsManager::load()
{
    QString path = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/";
    QDir dir;
    if(!dir.mkpath(path))
    {
        return;
    }
    QWebSettings::setIconDatabasePath(path);
    QSettings settings("PayableOnDeath", "Surfer");
    setImagesEnabled(settings.value("webkit/images", true).toBool());
    setJavascriptEnabled(settings.value("webkit/javascript", true).toBool());
    setJavaEnabled(settings.value("webkit/java", true).toBool());
    setPluginsEnabled(settings.value("webkit/plugins", true).toBool());
    setPrivateBrowsingEnabled(settings.value("webkit/private_browsing", false).toBool());
    setMainWindowGeometry(settings.value("geometry/main_window").toRect());
    setHistoryDialogGeometry(settings.value("geometry/history_dialog").toRect());
    setBookmarksDialogGeometry(settings.value("geometry/bookmarks_dialog").toRect());
    setSettingsDialogGeometry(settings.value("geometry/settings_dialog").toRect());
    setDownloadDialogGeometry(settings.value("geometry/download_dialog").toRect());
    setMaximumCacheSize(settings.value("extension/cache/maximum_size", 50 * 1024 * 1024).toLongLong());
    setHistoryExpirationDays(settings.value("extension/history/expiration_days", 7).toInt());
    setDownloadPath(settings.value("extension/download/path", "").toString());
    setSansFontFamily(settings.value("font/sans/family").toString());
    setSerifFontFamily(settings.value("font/serif/family").toString());
    setMonoFontFamily(settings.value("font/mono/family").toString());
    setStandardFontSize(settings.value("font/standard/size", 12).toInt());
    setMonoFontSize(settings.value("font/mono/size", 12).toInt());
}
Esempio n. 4
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()));
}
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( );
}
Esempio n. 6
0
void SettingsManager::reset()
{
    setImagesEnabled(true);
    setJavascriptEnabled(true);
    setJavaEnabled(true);
    setPluginsEnabled(true);
    setPrivateBrowsingEnabled(false);
    setMaximumCacheSize(50 * 1024 * 1024);
    setHistoryExpirationDays(7);
    setDownloadPath("");
    setStandardFontSize(12);
    setMonoFontSize(12);
}
KHTMLSideBar::KHTMLSideBar()
    : KHTMLPart()
{
    setStatusMessagesEnabled(false);
    setMetaRefreshEnabled(true);
    setJavaEnabled(false);
    setPluginsEnabled(false);

    setFormNotification(KHTMLPart::Only);
    connect(this,
            SIGNAL(formSubmitNotification(const char*,QString,QByteArray,QString,QString,QString)),
            this,
            SLOT(formProxy(const char*,QString,QByteArray,QString,QString,QString))
           );


    _linkMenu = new KMenu(widget());

    KAction* openLinkAction = new KAction(i18n("&Open Link"), this);
    _linkMenu->addAction(openLinkAction);
    connect(openLinkAction, SIGNAL(triggered()), this, SLOT(loadPage()));

    KAction* openWindowAction = new KAction(i18n("Open in New &Window"), this);
    _linkMenu->addAction(openWindowAction);
    connect(openWindowAction, SIGNAL(triggered()), this, SLOT(loadNewWindow()));


    _menu = new KMenu(widget());

    KAction* reloadAction = new KAction(i18n("&Reload"), this);
    reloadAction->setIcon(KIcon("view-refresh"));
    _menu->addAction(reloadAction);
    connect(reloadAction, SIGNAL(triggered()), this, SIGNAL(reload()));

    KAction* autoReloadAction = new KAction(i18n("Set &Automatic Reload"), this);
    autoReloadAction->setIcon(KIcon("view-refresh"));
    _menu->addAction(autoReloadAction);
    connect(autoReloadAction, SIGNAL(triggered()), this, SIGNAL(setAutoReload()));

    connect(this, SIGNAL(popupMenu(QString,QPoint)),
            this, SLOT(showMenu(QString,QPoint)));

}