From 36ba7f534562e55ba880e3e2699c2aea5a5377f8 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 19 Oct 2013 18:42:28 +0200 Subject: Add check box to control tabbar mouse wheel in konqueror Move tabbed browsing options into single dialog This resolves Bug 910 --- kcontrol/konqhtml/advancedTabDialog.cpp | 14 ++++++++++++ kcontrol/konqhtml/advancedTabOptions.ui | 35 ++++++++++++++++++++++++++++- kcontrol/konqhtml/htmlopts.cpp | 39 +++++++-------------------------- kcontrol/konqhtml/htmlopts.h | 7 +++--- 4 files changed, 60 insertions(+), 35 deletions(-) (limited to 'kcontrol/konqhtml') diff --git a/kcontrol/konqhtml/advancedTabDialog.cpp b/kcontrol/konqhtml/advancedTabDialog.cpp index f58bb9836..d9a995588 100644 --- a/kcontrol/konqhtml/advancedTabDialog.cpp +++ b/kcontrol/konqhtml/advancedTabDialog.cpp @@ -15,6 +15,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software + + -------------------------------------------------------------- + Additional changes: + - 2013/10/16 Michele Calgaro + * centralized "tabbed browsing" options in this dialog */ #include @@ -58,6 +63,9 @@ advancedTabDialog::advancedTabDialog(TQWidget* parent, TDEConfig* config, const layout->addSpacing( 20 ); layout->addStretch(); + connect(m_advancedWidget->m_pShowMMBInTabs, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); + connect(m_advancedWidget->m_pDynamicTabbarHide, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); + connect(m_advancedWidget->m_pDynamicTabbarCycle, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); connect(m_advancedWidget->m_pNewTabsInBackground, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed())); connect(m_advancedWidget->m_pOpenAfterCurrentPage, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed())); connect(m_advancedWidget->m_pTabConfirm, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed())); @@ -77,6 +85,9 @@ advancedTabDialog::~advancedTabDialog() void advancedTabDialog::load() { m_pConfig->setGroup("FMSettings"); + m_advancedWidget->m_pShowMMBInTabs->setChecked( m_pConfig->readBoolEntry( "MMBOpensTab", false ) ); + m_advancedWidget->m_pDynamicTabbarHide->setChecked( !(m_pConfig->readBoolEntry( "AlwaysTabbedMode", false )) ); + m_advancedWidget->m_pDynamicTabbarCycle->setChecked( m_pConfig->readBoolEntry( "TabsCycleWheel", false ) ); m_advancedWidget->m_pNewTabsInBackground->setChecked( ! (m_pConfig->readBoolEntry( "NewTabsInFront", false )) ); m_advancedWidget->m_pOpenAfterCurrentPage->setChecked( m_pConfig->readBoolEntry( "OpenAfterCurrentPage", false ) ); m_advancedWidget->m_pPermanentCloseButton->setChecked( m_pConfig->readBoolEntry( "PermanentCloseButton", false ) ); @@ -98,6 +109,9 @@ void advancedTabDialog::load() void advancedTabDialog::save() { m_pConfig->setGroup("FMSettings"); + m_pConfig->writeEntry( "MMBOpensTab", (m_advancedWidget->m_pShowMMBInTabs->isChecked()) ); + m_pConfig->writeEntry( "AlwaysTabbedMode", ( !(m_advancedWidget->m_pDynamicTabbarHide->isChecked())) ); + m_pConfig->writeEntry( "TabsCycleWheel", (m_advancedWidget->m_pDynamicTabbarCycle->isChecked()) ); m_pConfig->writeEntry( "NewTabsInFront", !(m_advancedWidget->m_pNewTabsInBackground->isChecked()) ); m_pConfig->writeEntry( "OpenAfterCurrentPage", m_advancedWidget->m_pOpenAfterCurrentPage->isChecked() ); m_pConfig->writeEntry( "PermanentCloseButton", m_advancedWidget->m_pPermanentCloseButton->isChecked() ); diff --git a/kcontrol/konqhtml/advancedTabOptions.ui b/kcontrol/konqhtml/advancedTabOptions.ui index df4419e95..3e4acb644 100644 --- a/kcontrol/konqhtml/advancedTabOptions.ui +++ b/kcontrol/konqhtml/advancedTabOptions.ui @@ -24,7 +24,7 @@ TextLabel3 - <b>Advanced Options</b> + <b>Tab Options</b> @@ -49,6 +49,39 @@ unnamed + + + m_pShowMMBInTabs + + + Open &links in new tab instead of in new window + + + 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. + + + + + m_pDynamicTabbarHide + + + &Hide the tab bar when only one tab is open + + + This will display the tab bar only if there are two or more tabs. Otherwise it will always be displayed. + + + + + m_pDynamicTabbarCycle + + + C&ycle tabs with mouse wheel + + + This will cycle through tabs when there are two or more tabs using the mouse wheel. + + m_pNewTabsInBackground diff --git a/kcontrol/konqhtml/htmlopts.cpp b/kcontrol/konqhtml/htmlopts.cpp index f8731f60d..5ba1a8d9b 100644 --- a/kcontrol/konqhtml/htmlopts.cpp +++ b/kcontrol/konqhtml/htmlopts.cpp @@ -4,6 +4,10 @@ // (c) Sven Radej 1998 // (c) David Faure 1998 // (c) 2001 Waldo Bastian +// +// -------------------------------------------------------------- +// - 2013/10/16 Michele Calgaro +// Move some options to the 'advancedTabDialog' dialog #include //CT - 12Nov1998 #include @@ -82,26 +86,9 @@ KMiscHTMLOptions::KMiscHTMLOptions(TDEConfig *config, TQString group, TQWidget * // Tabbed Browsing TQGroupBox *bgTabbedBrowsing = new TQGroupBox( 0, Qt::Vertical, i18n("Tabbed Browsing"), this ); - TQVBoxLayout *laygroup = new TQVBoxLayout(bgTabbedBrowsing->layout(), KDialog::spacingHint() ); - - m_pShowMMBInTabs = new TQCheckBox( i18n( "Open &links in new tab instead of in new window" ), bgTabbedBrowsing ); - TQWhatsThis::add( m_pShowMMBInTabs, 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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); - laygroup->addWidget(m_pShowMMBInTabs); - - m_pDynamicTabbarHide = new TQCheckBox( i18n( "Hide the tab bar when only one tab is open" ), bgTabbedBrowsing ); - TQWhatsThis::add( m_pDynamicTabbarHide, i18n("This will display the tab bar only if there are two or more tabs. Otherwise it will always be displayed.") ); - connect(m_pDynamicTabbarHide, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); - laygroup->addWidget(m_pDynamicTabbarHide); - - m_pDynamicTabbarCycle = new TQCheckBox( i18n( "C&ycle tabs with mouse wheel" ), bgTabbedBrowsing ); - TQWhatsThis::add( m_pDynamicTabbarCycle, i18n("This will cycle through tabs when there are two or more tabs.") ); - connect(m_pDynamicTabbarCycle, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); - laygroup->addWidget(m_pDynamicTabbarCycle); - - TQHBoxLayout *laytab = new TQHBoxLayout(laygroup, KDialog::spacingHint()); - TQPushButton *advancedTabButton = new TQPushButton( i18n( "Advanced Options"), bgTabbedBrowsing ); + TQHBoxLayout *laytab = new TQHBoxLayout(bgTabbedBrowsing->layout(), KDialog::spacingHint()); + + TQPushButton *advancedTabButton = new TQPushButton( i18n( "Show &tab options"), bgTabbedBrowsing ); laytab->addWidget(advancedTabButton); laytab->addStretch(); connect(advancedTabButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(launchAdvancedTabDialog())); @@ -299,14 +286,9 @@ void KMiscHTMLOptions::load( bool useDefaults ) m_pMaxFormCompletionItems->setValue( m_pConfig->readNumEntry( "MaxFormCompletionItems", 10 ) ); m_pMaxFormCompletionItems->setEnabled( m_pFormCompletionCheckBox->isChecked() ); - m_pConfig->setGroup("FMSettings"); - m_pShowMMBInTabs->setChecked( m_pConfig->readBoolEntry( "MMBOpensTab", false ) ); - m_pDynamicTabbarHide->setChecked( ! (m_pConfig->readBoolEntry( "AlwaysTabbedMode", false )) ); - m_pDynamicTabbarCycle->setChecked( m_pConfig->readBoolEntry( "TabsCycleWheel", true ) ); - TDEConfig config("kbookmarkrc", true, false); config.setReadDefaults( useDefaults ); - config.setGroup("Bookmarks"); + config.setGroup("Bookmarks"); m_pAdvancedAddBookmarkCheckBox->setChecked( config.readBoolEntry("AdvancedAddBookmarkDialog", false) ); m_pOnlyMarkedBookmarksCheckBox->setChecked( config.readBoolEntry("FilteredToolbar", false) ); @@ -372,11 +354,6 @@ void KMiscHTMLOptions::save() m_pConfig->writeEntry( "FormCompletion", m_pFormCompletionCheckBox->isChecked() ); m_pConfig->writeEntry( "MaxFormCompletionItems", m_pMaxFormCompletionItems->value() ); - - m_pConfig->setGroup("FMSettings"); - m_pConfig->writeEntry( "MMBOpensTab", m_pShowMMBInTabs->isChecked() ); - m_pConfig->writeEntry( "AlwaysTabbedMode", !(m_pDynamicTabbarHide->isChecked()) ); - m_pConfig->writeEntry( "TabsCycleWheel", m_pDynamicTabbarCycle->isChecked() ); m_pConfig->sync(); TDEConfig config("kbookmarkrc", false, false); diff --git a/kcontrol/konqhtml/htmlopts.h b/kcontrol/konqhtml/htmlopts.h index 43ba62cee..c318d0628 100644 --- a/kcontrol/konqhtml/htmlopts.h +++ b/kcontrol/konqhtml/htmlopts.h @@ -4,6 +4,10 @@ // // (c) Sven Radej 1998 // (c) David Faure 1998 +// +// -------------------------------------------------------------- +// - 2013/10/16 Michele Calgaro +// Move some options to the 'advancedTabDialog' dialog #ifndef __KMISCHTML_OPTIONS_H #define __KMISCHTML_OPTIONS_H @@ -60,10 +64,7 @@ private: TQCheckBox* m_pAutoRedirectCheckBox; TQCheckBox* m_pOpenMiddleClick; TQCheckBox* m_pBackRightClick; - TQCheckBox* m_pShowMMBInTabs; TQCheckBox* m_pFormCompletionCheckBox; - TQCheckBox* m_pDynamicTabbarHide; - TQCheckBox* m_pDynamicTabbarCycle; TQCheckBox* m_pAdvancedAddBookmarkCheckBox; TQCheckBox* m_pOnlyMarkedBookmarksCheckBox; KIntNumInput* m_pMaxFormCompletionItems; -- cgit v1.2.1