Commit 9b9f3fd1 authored by Nick Shaforostoff's avatar Nick Shaforostoff
Browse files

Reorganized konqueror configure dialog, made it hierarchic: no more scrolling...

Reorganized konqueror configure dialog, made it hierarchic: no more scrolling the messy plain pages list.
Moved tabs options out of 'web behaviour' to new General page as they apply to both filemanagement and web-browsing modes.

CCMAIL: kde-usability@kde.org


svn path=/trunk/KDE/kdebase/konqueror/; revision=652679
parent f2c1f9c3
......@@ -1902,11 +1902,6 @@ void KonqMainWindow::slotGoHistory()
}
}
QStringList KonqMainWindow::configModules() const
{
return m_configureModules;
}
void KonqMainWindow::slotConfigureExtensions()
{
KonqExtensionManager extensionManager(0, this, m_currentView ? m_currentView->part() : 0);
......@@ -1920,16 +1915,44 @@ void KonqMainWindow::slotConfigure()
m_configureDialog = new KCMultiDialog( this );
m_configureDialog->setObjectName( "configureDialog" );
QStringList modules = configModules();
QStringList::ConstIterator end( modules.end() );
if (KAuthorized::authorizeControlModule("khtml_general") )
m_configureDialog->addModule("khtml_general");
for( QStringList::ConstIterator it = modules.begin();
it != end; ++it )
if (KAuthorized::authorizeControlModule("kcmkonqyperformance") )
m_configureDialog->addModule("kcmkonqyperformance");
if (KAuthorized::authorizeControlModule("filebehavior") )
{
if ( KAuthorized::authorizeControlModule( *it ) )
{
m_configureDialog->addModule( *it );
}
KPageWidgetItem * fileManagementGroup = m_configureDialog->addModule("filebehavior");
fileManagementGroup->setName(i18n("File Management"));
#define ADD_MODULE(name) if (KAuthorized::authorizeControlModule(name))\
m_configureDialog->addModule(KCModuleInfo(name),fileManagementGroup);
ADD_MODULE("fileappearance")
ADD_MODULE("filepreviews")
ADD_MODULE("filetypes")
#undef ADD_MODULE
}
if (KAuthorized::authorizeControlModule("khtml_behavior"))
{
KPageWidgetItem * webGroup = m_configureDialog->addModule("khtml_behavior");
webGroup->setName(i18n("Web Browsing"));
#define ADD_MODULE(name) if (KAuthorized::authorizeControlModule(name))\
m_configureDialog->addModule(KCModuleInfo(name),webGroup);
ADD_MODULE("khtml_filter")
ADD_MODULE("ebrowsing")
ADD_MODULE("cache")
ADD_MODULE("proxy")
ADD_MODULE("khtml_fonts")
ADD_MODULE("kcmcss")
ADD_MODULE("kcmhistory")
ADD_MODULE("cookies")
ADD_MODULE("crypto")
ADD_MODULE("useragent")
ADD_MODULE("khtml_java_js")
ADD_MODULE("khtml_plugins")
#undef ADD_MODULE
}
}
......@@ -3791,8 +3814,8 @@ void KonqMainWindow::initActions()
m_paRemoveLocalProperties->setText( i18n( "Remove Folder Properties" ) );
connect(m_paRemoveLocalProperties, SIGNAL(triggered(bool) ), SLOT( slotRemoveLocalProperties() ));
m_configureModules << "filebehavior" << "fileappearance" <<
QStringList configureModules;
configureModules << "khtml_general" "filebehavior" << "fileappearance" <<
"filepreviews" << "filetypes" <<
"khtml_behavior" << "khtml_java_js" <<
"khtml_filter" <<
......@@ -3802,8 +3825,7 @@ void KonqMainWindow::initActions()
"crypto" << "useragent" <<
"khtml_plugins" << "kcmkonqyperformance";
if (!KAuthorized::authorizeControlModules(configModules()).isEmpty())
if (!KAuthorized::authorizeControlModules(configureModules).isEmpty())
actionCollection()->addAction( KStandardAction::Preferences, this, SLOT(slotConfigure()) );
actionCollection()->addAction( KStandardAction::KeyBindings, guiFactory(), SLOT( configureShortcuts() ) );
......
......@@ -715,12 +715,6 @@ private: // members
KCMultiDialog* m_configureDialog;
/**
* A list of the modules to be shown in
* the configure dialog.
*/
QStringList m_configureModules;
QLabel* m_locationLabel;
QPointer<KonqCombo> m_combo;
static KConfig *s_comboConfig;
......
......@@ -4,7 +4,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/libkonq )
########### next target ###############
set(kcm_konqhtml_PART_SRCS
advancedTabDialog.cpp
generalopts.cpp
htmlopts.cpp
jsopts.cpp
javaopts.cpp
......@@ -32,4 +32,4 @@ install(TARGETS kcm_konqhtml DESTINATION ${PLUGIN_INSTALL_DIR} )
########### install files ###############
install( FILES khtml_behavior.desktop khtml_java_js.desktop khtml_fonts.desktop khtml_filter.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES khtml_general.desktop khtml_behavior.desktop khtml_java_js.desktop khtml_fonts.desktop khtml_filter.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......@@ -16,31 +16,31 @@
<property name="margin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="TextLabel3" >
<property name="text" >
<string>&lt;b>Advanced Options&lt;/b></string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="Line1" >
<property name="frameShape" >
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="m_pShowMMBInTabs" >
<property name="text" >
<string>Open &amp;links in new tab instead of in new window</string>
</property>
<property name="whatsThis" stdset="0" >
<string>This will open a new tab instead of a new window in various situations, such as choosing a link or a folder with the middle mouse button.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="m_pDynamicTabbarHide" >
<property name="text" >
<string>Hide the tab bar when only one tab is open</string>
</property>
<property name="whatsThis" stdset="0" >
<string>This will display the tab bar only if there are two or more tabs. Otherwise it will always be displayed.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="m_pNewTabsInBackground" >
<property name="text" >
......
////
// Add here all general options - those that apply to both web browsing and filemanagement mode
//
// (c) Sven Radej 1998
// (c) David Faure 1998
// (c) 2001 Waldo Bastian <bastian@kde.org>
// (c) 2007 Nick Shaforostoff <shafff@ukr.net>
#include <QLayout>//CT - 12Nov1998
#include <QGroupBox>
#include <QDBusMessage>
#include <QDBusConnection>
#include "generalopts.h"
#include "ui_advancedTabOptions.h"
#include <konq_defaults.h> // include default values directly from konqueror
#include <kapplication.h>
#include "khtml_settings.h"
#include "generalopts.moc"
#include <kgenericfactory.h>
typedef KGenericFactory<KKonqGeneralOptions, QWidget> KKonqGeneralOptionsFactory;
K_EXPORT_COMPONENT_FACTORY( khtml_general, KKonqGeneralOptionsFactory("kcmkonqgeneral") )
//-----------------------------------------------------------------------------
KKonqGeneralOptions::KKonqGeneralOptions(QWidget *parent, const QStringList&)
: KCModule( KKonqGeneralOptionsFactory::componentData(), parent )
{
m_pConfig = KSharedConfig::openConfig("konquerorrc", KConfig::NoGlobals);
int row = 0;
QGridLayout *lay = new QGridLayout(this);
QGroupBox* tabsGroup = new QGroupBox(i18n("Tabbed Browsing"));
tabOptions = new Ui_advancedTabOptions;
tabOptions->setupUi(tabsGroup);
connect(tabOptions->m_pShowMMBInTabs, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pDynamicTabbarHide, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pNewTabsInBackground, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pOpenAfterCurrentPage, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pTabConfirm, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pTabCloseActivatePrevious, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pPermanentCloseButton, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pKonquerorTabforExternalURL, SIGNAL(clicked()), SLOT(slotChanged()));
connect(tabOptions->m_pPopupsWithinTabs, SIGNAL(clicked()), SLOT(slotChanged()));
lay->addWidget( tabsGroup, row, 0, 1, 2 );
// row++;
lay->setRowStretch(row, 1);
load();
emit changed(false);
}
KKonqGeneralOptions::~KKonqGeneralOptions()
{
}
void KKonqGeneralOptions::load()
{
KConfigGroup cg(m_pConfig, QByteArray(""));
cg.changeGroup("FMSettings");
tabOptions->m_pShowMMBInTabs->setChecked( cg.readEntry( "MMBOpensTab", false ) );
tabOptions->m_pDynamicTabbarHide->setChecked( ! (cg.readEntry( "AlwaysTabbedMode", false )) );
tabOptions->m_pNewTabsInBackground->setChecked( ! (cg.readEntry( "NewTabsInFront", false)) );
tabOptions->m_pOpenAfterCurrentPage->setChecked( cg.readEntry( "OpenAfterCurrentPage", false) );
tabOptions->m_pPermanentCloseButton->setChecked( cg.readEntry( "PermanentCloseButton", false) );
tabOptions->m_pKonquerorTabforExternalURL->setChecked( cg.readEntry( "KonquerorTabforExternalURL", false) );
tabOptions->m_pPopupsWithinTabs->setChecked( cg.readEntry( "PopupsWithinTabs", false) );
tabOptions->m_pTabCloseActivatePrevious->setChecked( cg.readEntry( "TabCloseActivatePrevious", false) );
cg.changeGroup("Notification Messages");
tabOptions->m_pTabConfirm->setChecked( !cg.hasKey("MultipleTabConfirm") );
}
void KKonqGeneralOptions::defaults()
{
bool old = m_pConfig->readDefaults();
m_pConfig->setReadDefaults(true);
load();
m_pConfig->setReadDefaults(old);
}
void KKonqGeneralOptions::save()
{
KConfigGroup cg(m_pConfig, "FMSettings");
cg.writeEntry( "MMBOpensTab", tabOptions->m_pShowMMBInTabs->isChecked() );
cg.writeEntry( "AlwaysTabbedMode", !(tabOptions->m_pDynamicTabbarHide->isChecked()) );
cg.writeEntry( "NewTabsInFront", !(tabOptions->m_pNewTabsInBackground->isChecked()) );
cg.writeEntry( "OpenAfterCurrentPage", tabOptions->m_pOpenAfterCurrentPage->isChecked() );
cg.writeEntry( "PermanentCloseButton", tabOptions->m_pPermanentCloseButton->isChecked() );
cg.writeEntry( "KonquerorTabforExternalURL", tabOptions->m_pKonquerorTabforExternalURL->isChecked() );
cg.writeEntry( "PopupsWithinTabs", tabOptions->m_pPopupsWithinTabs->isChecked() );
cg.writeEntry( "TabCloseActivatePrevious", tabOptions->m_pTabCloseActivatePrevious->isChecked() );
cg.sync();
// It only matters wether the key is present, its value has no meaning
cg.changeGroup("Notification Messages");
if ( tabOptions->m_pTabConfirm->isChecked() )
cg.deleteEntry( "MultipleTabConfirm" );
else
cg.writeEntry( "MultipleTabConfirm", true );
// Send signal to all konqueror instances
QDBusMessage message =
QDBusMessage::createSignal("/KonqMain", "org.kde.Konqueror.Main", "reparseConfiguration");
QDBusConnection::sessionBus().send(message);
emit changed(false);
}
void KKonqGeneralOptions::slotChanged()
{
emit changed(true);
}
//
//
// General options (for both fm and web modes) konqueror options
//
// (c) Sven Radej 1998
// (c) David Faure 1998
// (c) Nick Shaforostoff 2007
#ifndef __KONQGENERAL_OPTIONS_H
#define __KONQGENERAL_OPTIONS_H
#include <QCheckBox>
#include <QComboBox>
#include <QString>
#include <kcmodule.h>
#include <ksharedconfig.h>
class Ui_advancedTabOptions;
class KKonqGeneralOptions : public KCModule
{
Q_OBJECT
public:
KKonqGeneralOptions( QWidget *parent, const QStringList& );
~KKonqGeneralOptions();
virtual void load();
virtual void save();
virtual void defaults();
private Q_SLOTS:
void slotChanged();
private:
KSharedConfig::Ptr m_pConfig;
Ui_advancedTabOptions* tabOptions;
};
#endif
......@@ -13,7 +13,6 @@
#include <QDBusConnection>
#include "htmlopts.h"
#include "advancedTabDialog.h"
#include <konq_defaults.h> // include default values directly from konqueror
#include <kglobalsettings.h> // get default for DEFAULT_CHANGECURSOR
......@@ -101,37 +100,6 @@ KMiscHTMLOptions::KMiscHTMLOptions(QWidget *parent, const QStringList&)
lay->addWidget( bgForm, row, 0, 1, 2 );
row++;
// Tabbed Browsing
QGroupBox *bgTabbedBrowsing = new QGroupBox( i18n("Tabbed Browsing") );
QVBoxLayout *laygroup = new QVBoxLayout();
laygroup->setSpacing(KDialog::spacingHint());
m_pShowMMBInTabs = new QCheckBox( i18n( "Open &links in new tab instead of in new window" ) );
m_pShowMMBInTabs->setWhatsThis( i18n("This will open a new tab instead of a new window in various situations, "
"such as choosing a link or a folder with the middle mouse button.") );
connect(m_pShowMMBInTabs, SIGNAL(clicked()), SLOT(slotChanged()));
laygroup->addWidget(m_pShowMMBInTabs);
m_pDynamicTabbarHide = new QCheckBox( i18n( "Hide the tab bar when only one tab is open" ) );
m_pDynamicTabbarHide->setWhatsThis( i18n("This will display the tab bar only if there are two or more tabs. Otherwise it will always be displayed.") );
connect(m_pDynamicTabbarHide, SIGNAL(clicked()), SLOT(slotChanged()));
laygroup->addWidget(m_pDynamicTabbarHide);
QHBoxLayout *laytab = new QHBoxLayout();
laygroup->addItem(laytab);
laytab->setSpacing(KDialog::spacingHint());
QPushButton *advancedTabButton = new QPushButton( i18n( "Advanced Options") );
laytab->addWidget(advancedTabButton);
laytab->addStretch();
connect(advancedTabButton, SIGNAL(clicked()), this, SLOT(launchAdvancedTabDialog()));
bgTabbedBrowsing->setLayout(laygroup);
lay->addWidget( bgTabbedBrowsing, row, 0, 1, 2 );
row++;
// Mouse behavior
QGroupBox *bgMouse = new QGroupBox( i18n("Mouse Beha&vior") );
......@@ -312,10 +280,6 @@ void KMiscHTMLOptions::load()
m_pMaxFormCompletionItems->setValue( cg.readEntry( "MaxFormCompletionItems", 10 ) );
m_pMaxFormCompletionItems->setEnabled( m_pFormCompletionCheckBox->isChecked() );
cg.changeGroup("FMSettings");
m_pShowMMBInTabs->setChecked( cg.readEntry( "MMBOpensTab", false ) );
m_pDynamicTabbarHide->setChecked( ! (cg.readEntry( "AlwaysTabbedMode", false )) );
// Writes the value of m_pAccessKeys into khtmlrc to affect all applications using KHTML
KConfig _khtmlconfig("khtmlrc", KConfig::NoGlobals);
KConfigGroup khtmlconfig(&_khtmlconfig, "Access Keys");
......@@ -378,9 +342,6 @@ void KMiscHTMLOptions::save()
cg.writeEntry( "FormCompletion", m_pFormCompletionCheckBox->isChecked() );
cg.writeEntry( "MaxFormCompletionItems", m_pMaxFormCompletionItems->value() );
cg.changeGroup("FMSettings");
cg.writeEntry( "MMBOpensTab", m_pShowMMBInTabs->isChecked() );
cg.writeEntry( "AlwaysTabbedMode", !(m_pDynamicTabbarHide->isChecked()) );
cg.sync();
// Reads in the value of m_accessKeysEnabled by calling accessKeysEnabled() in khtml_settings.cpp
......@@ -406,11 +367,3 @@ void KMiscHTMLOptions::slotChanged()
emit changed(true);
}
void KMiscHTMLOptions::launchAdvancedTabDialog()
{
advancedTabDialog* dialog = new advancedTabDialog(this, m_pConfig, "advancedTabDialog");
dialog->exec();
}
......@@ -41,7 +41,6 @@ public:
private Q_SLOTS:
void slotChanged();
void launchAdvancedTabDialog();
private:
KSharedConfig::Ptr m_pConfig;
......@@ -55,9 +54,7 @@ private:
QCheckBox* m_pAutoRedirectCheckBox;
QCheckBox* m_pOpenMiddleClick;
QCheckBox* m_pBackRightClick;
QCheckBox* m_pShowMMBInTabs;
QCheckBox* m_pFormCompletionCheckBox;
QCheckBox* m_pDynamicTabbarHide;
QCheckBox* m_pAdvancedAddBookmarkCheckBox;
QCheckBox* m_pOnlyMarkedBookmarksCheckBox;
QCheckBox* m_pAccessKeys;
......
[Desktop Entry]
Encoding=UTF-8
Type=Service
ServiceTypes=KCModule
DocPath=kcontrol/khtml/index.html#kbrowse-html
Icon=konqueror
Exec=kcmshell khtml_general
X-KDE-ParentApp=kcontrol
X-KDE-Library=konqhtml
X-KDE-FactoryName=khtml_general
Name=General
Name[x-test]=xxGeneralxx
Comment=Configure the browser behavior
Comment[x-test]=xxConfigure the browser behaviorxx
Keywords=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding
Keywords[x-test]=xxkonqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encodingxx
Categories=Qt;KDE;X-KDE-settings-webbrowsing;
......@@ -34,6 +34,7 @@ KHTTPOptions::KHTTPOptions(KSharedConfig::Ptr config, QString group, const KComp
// defaultCharsets = QString("utf-8 ")+klocale->charset()+" iso-8859-1";
defaultCharsets = QString("utf-8 ")+" iso-8859-1"; // TODO
// if lang=ru or uk then +cp1251+koi8u - these are most used encodings (though locale may/should be utf8) --nick shaforostoff
// finaly read the options
load();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment