diff --git a/konqueror/settings/konq/Makefile.am b/konqueror/settings/konq/Makefile.am index 40a20e27e..d9f7b3fdc 100644 --- a/konqueror/settings/konq/Makefile.am +++ b/konqueror/settings/konq/Makefile.am @@ -1,37 +1,37 @@ INCLUDES = -I$(top_srcdir)/libkonq $(all_includes) LDFLAGS = $(all_libraries) METASOURCES = AUTO kde_module_LTLIBRARIES = libkcm_konq.la libkcm_konq_la_SOURCES = behaviour.cpp rootopts.cpp \ - miscopts.cpp trashopts.cpp fontopts.cpp \ + trashopts.cpp fontopts.cpp \ desktop.cpp kwindesktop.cpp uiserver.stub main.cpp libkcm_konq_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined libkcm_konq_la_LIBADD = $(LIB_KIO) $(LIB_KDEUI) $(LIB_KSYCOCA) libkcm_konq_la_DATA = overlapping.png onlyone.png libkcm_konq_ladir = $(kde_datadir)/kcontrol/pics data_DATA = kcmkonq.desktop datadir = $(kde_appsdir)/Settings/FileBrowsing data2_DATA = desktop.desktop virtualdesktops.desktop data2dir = $(kde_appsdir)/Settings/LookNFeel install-data-local: uninstall.desktop $(mkinstalldirs) $(kde_appsdir)/Settings/LookNFeel/Desktop $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(kde_appsdir)/Settings/LookNFeel/Desktop/virtualdesktops.desktop $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(kde_appsdir)/Settings/LookNFeel/Desktop/desktop.desktop $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(kde_appsdir)/Settings/LookNFeel/Desktop/borders.desktop $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(kde_appsdir)/Settings/LookNFeel/Desktop/background.desktop uiserver_DIR = $(kde_includes)/kio EXTRA_DIST = $(libkcm_konq_la_DATA) $(data_DATA) messages: $(XGETTEXT) *.cpp -o $(podir)/kcmkonq.pot diff --git a/konqueror/settings/konq/behaviour.cpp b/konqueror/settings/konq/behaviour.cpp index d650502c8..2ea6fb063 100644 --- a/konqueror/settings/konq/behaviour.cpp +++ b/konqueror/settings/konq/behaviour.cpp @@ -1,201 +1,237 @@ -// Behaviour options for konqueror +/** + * Copyright (c) 2001 David Faure + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +// Behaviour options for konqueror #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include +#include +#include +#include #include "behaviour.h" -KBehaviourOptions::KBehaviourOptions(KConfig *config, QString group, bool showFileManagerOptions, QWidget *parent, const char *name ) - : KCModule(parent, name), g_pConfig(config), groupname(group), m_bFileManager(showFileManagerOptions) +KBehaviourOptions::KBehaviourOptions(KConfig *config, QString group, QWidget *parent, const char *name ) + : KCModule(parent, name), g_pConfig(config), groupname(group) { QLabel * label; int row = 0; - QGridLayout *lay = new QGridLayout(this,9,4, // rows, cols + QGridLayout *lay = new QGridLayout(this,10,4, // rows, cols KDialog::marginHint(), KDialog::spacingHint()); // border, space lay->setRowStretch(6,1); lay->setColStretch(1,1); lay->setColStretch(3,1); - // - only for konqueror, not for kdesktop -- - if (m_bFileManager) - { - kfmclientConfig = new KConfig(QString::fromLatin1("kfmclientrc"), false, false); - kfmclientConfig->setGroup(QString::fromLatin1("Settings")); //use these to set the one-process option in kfmclient + kfmclientConfig = new KConfig(QString::fromLatin1("kfmclientrc"), false, false); + kfmclientConfig->setGroup(QString::fromLatin1("Settings")); //use these to set the one-process option in kfmclient - row++; - winPixmap = new QLabel(this); - winPixmap->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); - winPixmap->setPixmap(QPixmap(locate("data", + row++; + winPixmap = new QLabel(this); + winPixmap->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); + winPixmap->setPixmap(QPixmap(locate("data", "kcontrol/pics/onlyone.png"))); - winPixmap->setFixedSize( winPixmap->sizeHint() ); - lay->addMultiCellWidget(winPixmap, row, row, 1, 2); - - // ---- - row++; - cbNewWin = new QCheckBox(i18n("&Open directories in separate windows"), this); - QWhatsThis::add( cbNewWin, i18n("If this option is checked, Konqueror will open a new window when " - "you open a directory, rather than showing that directory's contents in the current window.")); - lay->addMultiCellWidget(cbNewWin, row, row, 0, 2, Qt::AlignLeft); - connect(cbNewWin, SIGNAL(clicked()), this, SLOT(changed())); - connect(cbNewWin, SIGNAL(toggled(bool)), SLOT(updateWinPixmap(bool))); - - // ---- - row++; - label = new QLabel(i18n("Home &URL:"), this); - lay->addWidget(label, row, 0); - - homeURL = new QLineEdit(this); - lay->addMultiCellWidget(homeURL, row, row, 1, 3); - connect(homeURL, SIGNAL(textChanged(const QString &)), this, SLOT(changed())); - label->setBuddy(homeURL); - - QString homestr = i18n("This is the URL (e.g. a directory or a web page) where " - "konqueror will jump to when the \"Home\" button is pressed. Usually a 'tilde' (~)."); - QWhatsThis::add( label, homestr ); - QWhatsThis::add( homeURL, homestr ); - - // ---- - row++; - QString opstrg = i18n("With this option activated, only one instance of Konqueror " - "will exist in the memory of your computer at any moment " - "no matter how many browsing windows you open, " - "thus reducing resource requirements." - "

Be aware that this also means that, if something goes wrong, " - "all your browsing windows will be closed simultaneously"); - QString opstrl = i18n("With this option activated, only one instance of Konqueror " - "will exist in the memory of your computer at any moment " - "no matter how many local browsing windows you open, " - "thus reducing resource requirements." - "

Be aware that this also means that, if something goes wrong, " - "all your local browsing windows will be closed simultaneously"); - QString opstrw = i18n("With this option activated, only one instance of Konqueror " - "will exist in the memory of your computer at any moment " - "no matter how many web browsing windows you open, " - "thus reducing resource requirements." - "

Be aware that this also means that, if something goes wrong, " - "all your web browsing windows will be closed simultaneously"); - - bgOneProcess = new QVButtonGroup(i18n("Minimize memory usage"), this); - bgOneProcess->setExclusive( true ); - connect(bgOneProcess, SIGNAL(clicked(int)), this, SLOT(changed())); - { + winPixmap->setFixedSize( winPixmap->sizeHint() ); + lay->addMultiCellWidget(winPixmap, row, row, 1, 2); + + // ---- + row++; + cbNewWin = new QCheckBox(i18n("&Open directories in separate windows"), this); + QWhatsThis::add( cbNewWin, i18n("If this option is checked, Konqueror will open a new window when " + "you open a directory, rather than showing that directory's contents in the current window.")); + lay->addMultiCellWidget(cbNewWin, row, row, 0, 2, Qt::AlignLeft); + connect(cbNewWin, SIGNAL(clicked()), this, SLOT(changed())); + connect(cbNewWin, SIGNAL(toggled(bool)), SLOT(updateWinPixmap(bool))); + + // ---- + row++; + cbListProgress = new QCheckBox( i18n( "&Show network operations in a single window" ), this ); + lay->addMultiCellWidget(cbListProgress, row, row, 0, 2, Qt::AlignLeft); + connect(cbListProgress, SIGNAL(clicked()), this, SLOT(changed())); + + QWhatsThis::add( cbListProgress, i18n("Checking this option will group the" + " progress information for all network file transfers into a single window" + " with a list. When the option is not checked, all transfers appear in a" + " separate window.") ); + + + // ---- + row++; + label = new QLabel(i18n("Home &URL:"), this); + lay->addWidget(label, row, 0); + + homeURL = new QLineEdit(this); + lay->addMultiCellWidget(homeURL, row, row, 1, 3); + connect(homeURL, SIGNAL(textChanged(const QString &)), this, SLOT(changed())); + label->setBuddy(homeURL); + + QString homestr = i18n("This is the URL (e.g. a directory or a web page) where " + "konqueror will jump to when the \"Home\" button is pressed. Usually a 'tilde' (~)."); + QWhatsThis::add( label, homestr ); + QWhatsThis::add( homeURL, homestr ); + + // ---- + row++; + QString opstrg = i18n("With this option activated, only one instance of Konqueror " + "will exist in the memory of your computer at any moment " + "no matter how many browsing windows you open, " + "thus reducing resource requirements." + "

Be aware that this also means that, if something goes wrong, " + "all your browsing windows will be closed simultaneously"); + QString opstrl = i18n("With this option activated, only one instance of Konqueror " + "will exist in the memory of your computer at any moment " + "no matter how many local browsing windows you open, " + "thus reducing resource requirements." + "

Be aware that this also means that, if something goes wrong, " + "all your local browsing windows will be closed simultaneously"); + QString opstrw = i18n("With this option activated, only one instance of Konqueror " + "will exist in the memory of your computer at any moment " + "no matter how many web browsing windows you open, " + "thus reducing resource requirements." + "

Be aware that this also means that, if something goes wrong, " + "all your web browsing windows will be closed simultaneously"); + + bgOneProcess = new QVButtonGroup(i18n("Minimize memory usage"), this); + bgOneProcess->setExclusive( true ); + connect(bgOneProcess, SIGNAL(clicked(int)), this, SLOT(changed())); + { rbOPNever = new QRadioButton(i18n("&Never"), bgOneProcess); QWhatsThis::add( rbOPNever, i18n("Disables the minimization of memory usage and allows you " "to make each browsing activity independent from the others")); rbOPLocal = new QRadioButton(i18n("For &local browsing only (recommended)"), bgOneProcess); QWhatsThis::add( rbOPLocal, opstrl); rbOPWeb = new QRadioButton(i18n("For &web browsing only"), bgOneProcess); QWhatsThis::add( rbOPWeb, opstrw); rbOPAlways = new QRadioButton(i18n("&Always (use with care)"), bgOneProcess); QWhatsThis::add( rbOPAlways, opstrg); rbOPLocal->setChecked(true); - } - - lay->addMultiCellWidget(bgOneProcess, row, row, 0, 3); - } + lay->addMultiCellWidget(bgOneProcess, row, row, 0, 3); + load(); } void KBehaviourOptions::load() { g_pConfig->setGroup( groupname ); - if (m_bFileManager) - { - cbNewWin->setChecked( g_pConfig->readBoolEntry("AlwaysNewWin", false) ); - updateWinPixmap(cbNewWin->isChecked()); - - homeURL->setText(g_pConfig->readEntry("HomeURL", "~")); - - QString val = kfmclientConfig->readEntry( QString::fromLatin1("StartNewKonqueror"), - QString::fromLatin1("Web only") ); - if (val == QString::fromLatin1("Web only")) - rbOPLocal->setChecked(true); - else if (val == QString::fromLatin1("Local only")) - rbOPWeb->setChecked(true); - else if (val == QString::fromLatin1("Always") || - val == QString::fromLatin1("true") || - val == QString::fromLatin1("TRUE") || - val == QString::fromLatin1("1")) - rbOPNever->setChecked(true); - else - rbOPAlways->setChecked(true); - } + cbNewWin->setChecked( g_pConfig->readBoolEntry("AlwaysNewWin", false) ); + updateWinPixmap(cbNewWin->isChecked()); + + homeURL->setText(g_pConfig->readEntry("HomeURL", "~")); + + QString val = kfmclientConfig->readEntry( QString::fromLatin1("StartNewKonqueror"), + QString::fromLatin1("Web only") ); + if (val == QString::fromLatin1("Web only")) + rbOPLocal->setChecked(true); + else if (val == QString::fromLatin1("Local only")) + rbOPWeb->setChecked(true); + else if (val == QString::fromLatin1("Always") || + val == QString::fromLatin1("true") || + val == QString::fromLatin1("TRUE") || + val == QString::fromLatin1("1")) + rbOPNever->setChecked(true); + else + rbOPAlways->setChecked(true); + + KConfig config("uiserverrc"); + config.setGroup( "UIServer" ); + + cbListProgress->setChecked( config.readBoolEntry( "ShowList", false ) ); } void KBehaviourOptions::defaults() { - if (m_bFileManager) - { - cbNewWin->setChecked(false); + cbNewWin->setChecked(false); - homeURL->setText("~"); + homeURL->setText("~"); - rbOPLocal->setChecked(true); - } + rbOPLocal->setChecked(true); + + cbListProgress->setChecked( false ); } void KBehaviourOptions::save() { g_pConfig->setGroup( groupname ); - if (m_bFileManager) - { - g_pConfig->writeEntry( "AlwaysNewWin", cbNewWin->isChecked() ); - g_pConfig->writeEntry( "HomeURL", homeURL->text() ); - - QString val = QString::fromLatin1("Web only"); - if (rbOPWeb->isChecked()) - val = QString::fromLatin1("Local only"); - else if (rbOPNever->isChecked()) - val = QString::fromLatin1("Always"); - else if (rbOPAlways->isChecked()) - val = QString::fromLatin1("Never"); - kfmclientConfig->writeEntry(QString::fromLatin1("StartNewKonqueror"), val); - - kfmclientConfig->sync(); - } + g_pConfig->writeEntry( "AlwaysNewWin", cbNewWin->isChecked() ); + g_pConfig->writeEntry( "HomeURL", homeURL->text() ); + + QString val = QString::fromLatin1("Web only"); + if (rbOPWeb->isChecked()) + val = QString::fromLatin1("Local only"); + else if (rbOPNever->isChecked()) + val = QString::fromLatin1("Always"); + else if (rbOPAlways->isChecked()) + val = QString::fromLatin1("Never"); + kfmclientConfig->writeEntry(QString::fromLatin1("StartNewKonqueror"), val); + + kfmclientConfig->sync(); g_pConfig->sync(); + + // UIServer setting + KConfig config("uiserverrc"); + config.setGroup( "UIServer" ); + config.writeEntry( "ShowList", cbListProgress->isChecked() ); + config.sync(); + // Tell the running server + if ( kapp->dcopClient()->isApplicationRegistered( "kio_uiserver" ) ) + { + UIServer_stub uiserver( "kio_uiserver", "UIServer" ); + uiserver.setListMode( cbListProgress->isChecked() ); + } } void KBehaviourOptions::updateWinPixmap(bool b) { if (b) winPixmap->setPixmap(QPixmap(locate("data", "kcontrol/pics/overlapping.png"))); else winPixmap->setPixmap(QPixmap(locate("data", "kcontrol/pics/onlyone.png"))); } void KBehaviourOptions::changed() { emit KCModule::changed(true); } - #include "behaviour.moc" diff --git a/konqueror/settings/konq/behaviour.h b/konqueror/settings/konq/behaviour.h index 7f5832415..b7d6a1f7b 100644 --- a/konqueror/settings/konq/behaviour.h +++ b/konqueror/settings/konq/behaviour.h @@ -1,59 +1,69 @@ +/** + * Copyright (c) 2001 David Faure + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + #ifndef __BEHAVIOUR_H__ #define __BEHAVIOUR_H__ - #include - class QCheckBox; class QLabel; class QLineEdit; class KConfig; class QVButtonGroup; class QRadioButton; //----------------------------------------------------------------------------- class KBehaviourOptions : public KCModule { Q_OBJECT public: - /** - * @param showFileManagerOptions : set to true for konqueror, false for kdesktop - */ - KBehaviourOptions(KConfig *config, QString group, bool showFileManagerOptions, QWidget *parent=0, const char *name=0); + KBehaviourOptions(KConfig *config, QString group, QWidget *parent=0, const char *name=0); virtual void load(); virtual void save(); virtual void defaults(); - protected slots: void changed(); void updateWinPixmap(bool); private: KConfig *g_pConfig; KConfig *kfmclientConfig; QString groupname; - bool m_bFileManager; QCheckBox *cbNewWin; + QCheckBox *cbListProgress; QLabel *winPixmap; QLineEdit *homeURL; - + QVButtonGroup *bgOneProcess; - QRadioButton *rbOPNever, - *rbOPLocal, - *rbOPWeb, + QRadioButton *rbOPNever, + *rbOPLocal, + *rbOPWeb, *rbOPAlways; }; - #endif // __BEHAVIOUR_H__ - diff --git a/konqueror/settings/konq/main.cpp b/konqueror/settings/konq/main.cpp index 8559c3828..d9e5ff266 100644 --- a/konqueror/settings/konq/main.cpp +++ b/konqueror/settings/konq/main.cpp @@ -1,269 +1,250 @@ /* * main.cpp * * Copyright (c) 1999 Matthias Hoelzer-Kluepfel * * Requires the Qt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include #include #include #include #include #include #include #include "rootopts.h" #include "behaviour.h" #include "fontopts.h" -#include "miscopts.h" #include "trashopts.h" #include "desktop.h" #include "kwindesktop.h" #include "main.h" #include "main.moc" #include #undef CallSucceeded #undef Status // for multihead int konq_screen_number = 0; KonqyModule::KonqyModule(QWidget *parent, const char *name) : KCModule(parent, name) { if (qt_xdisplay()) konq_screen_number = DefaultScreen(qt_xdisplay()); KConfig *config = new KConfig("konquerorrc", false, true); QVBoxLayout *layout = new QVBoxLayout(this); tab = new QTabWidget(this); layout->addWidget(tab); QString groupName = "FMSettings"; - behaviour = new KBehaviourOptions(config, groupName, true, this); + behaviour = new KBehaviourOptions(config, groupName, this); tab->addTab(behaviour, i18n("&Behavior")); connect(behaviour, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); font = new KonqFontOptions(config, groupName, false, this); tab->addTab(font, i18n("&Appearance")); connect(font, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); trash = new KTrashOptions(config, "Trash", this); tab->addTab(trash, i18n("&Trash")); connect(trash, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - - misc = new KMiscOptions(config, "Misc Defaults", this); - tab->addTab(misc, i18n("&Other")); - connect(misc, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); } void KonqyModule::load() { behaviour->load(); font->load(); trash->load(); - misc->load(); } void KonqyModule::save() { behaviour->save(); font->save(); trash->save(); - misc->save(); // Send signal to konqueror // Warning. In case something is added/changed here, keep kfmclient in sync QByteArray data; if ( !kapp->dcopClient()->isAttached() ) kapp->dcopClient()->attach(); kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data ); } void KonqyModule::defaults() { behaviour->defaults(); font->defaults(); trash->defaults(); - misc->defaults(); } QString KonqyModule::quickHelp() const { return i18n("

File Manager

In this module, you can configure various" " aspects of Konqueror's file manager functionality. Please note that the" " Konqueror's web browser functionality has its own configuration module.

" " The configuration options for the file manager are organized under" " four tabs as described below:" "

Behavior

" " This tab contains global options for Konqueror, such as the directory" " tree's reaction to changes in adjoining views, whether directories are" " opened in new windows, etc." "

Appearance

" " This tab contains options customizing the appearance of Konqueror windows," " such as the font and color of text, background color, etc." "

Trash

" " This tab contains options for customizing the behavior of" - " Konqueror when you \"delete\" a file." - "

Other

" - " This tab contains a couple of miscellaneous options."); + " Konqueror when you \"delete\" a file."); } void KonqyModule::moduleChanged(bool state) { emit changed(state); } KDesktopModule::KDesktopModule(QWidget *parent, const char *name) : KCModule(parent, name) { QCString configname; if (konq_screen_number == 0) configname = "kdesktoprc"; else configname.sprintf("kdesktop-screen-%drc", konq_screen_number); KConfig *config = new KConfig(configname, false, false); QVBoxLayout *layout = new QVBoxLayout(this); tab = new QTabWidget(this); layout->addWidget(tab); root = new KRootOptions(config, this); tab->addTab(root, i18n("&Desktop")); connect(root, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - // Behaviour tab has nothing anymore for kdesktop - commented out - // those use "FMSettings" since they are read by KonqFMSettings - //behaviour = new KBehaviourOptions(config, "FMSettings", false, this); - //tab->addTab(behaviour, i18n("&Behavior")); - //connect(behaviour, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - font = new KonqFontOptions(config, "FMSettings", true, this); tab->addTab(font, i18n("&Appearance")); connect(font, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); virtualDesks = new KDesktopConfig(this, "VirtualDesktops"); tab->addTab(virtualDesks, i18n("&Number of Desktops")); connect(virtualDesks, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); borders = new KWinDesktopConfig(this, "WindowBorders"); tab->addTab(borders, i18n("&Borders")); connect(borders, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); //should we add Trash also here ? } void KDesktopModule::load() { - //behaviour->load(); root->load(); font->load(); virtualDesks->load(); borders->load(); } void KDesktopModule::save() { - //behaviour->save(); root->save(); font->save(); virtualDesks->save(); borders->save(); // Tell kdesktop about the new config file if ( !kapp->dcopClient()->isAttached() ) kapp->dcopClient()->attach(); QByteArray data; QCString appname; if (konq_screen_number == 0) appname = "kdesktop"; else appname.sprintf("kdesktop-screen-%d", konq_screen_number); kapp->dcopClient()->send( appname, "KDesktopIface", "configure()", data ); } void KDesktopModule::defaults() { - //behaviour->defaults(); root->defaults(); font->defaults(); virtualDesks->defaults(); borders->defaults(); } void KDesktopModule::moduleChanged(bool state) { emit changed(state); } void KDesktopModule::resizeEvent(QResizeEvent *) { tab->setGeometry(0,0,width(),height()); } QString KDesktopModule::quickHelp() const { return i18n("

Desktop

\n" "This module allows you to choose various options\n" "for your desktop, including the way in which icons are arranged, the\n" "location of your desktop directory, and the pop-up menus associated\n" "with clicks of the middle and right mouse buttons on the desktop.\n" "Use the \"Whats This?\" (Shift+F1) to get help on specific options."); } extern "C" { KCModule *create_konqueror(QWidget *parent, const char *name) { KGlobal::locale()->insertCatalogue("kcmkonq"); return new KonqyModule(parent, name); } KCModule *create_desktop(QWidget *parent, const char *name) { KGlobal::locale()->insertCatalogue("kcmkonq"); return new KDesktopModule(parent, name); } } diff --git a/konqueror/settings/konq/main.h b/konqueror/settings/konq/main.h index 939b5fcdd..4ef5ae92f 100644 --- a/konqueror/settings/konq/main.h +++ b/konqueror/settings/konq/main.h @@ -1,111 +1,110 @@ /* * main.h * * Copyright (c) 1999 Matthias Hoelzer-Kluepfel * * Requires the Qt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __MAIN_H__ #define __MAIN_H__ #include #include class KBehaviourOptions; class KonqFontOptions; class KMiscOptions; class KRootOptions; class KTrashOptions; class KDesktopConfig; class KWinDesktopConfig; class KonqyModule : public KCModule { Q_OBJECT public: KonqyModule(QWidget *parent, const char *name); void load(); void save(); void defaults(); QString quickHelp() const; protected slots: void moduleChanged(bool state); private: QTabWidget *tab; KBehaviourOptions *behaviour; KonqFontOptions *font; - KMiscOptions *misc; KTrashOptions *trash; }; class KDesktopModule : public KCModule { Q_OBJECT public: KDesktopModule(QWidget *parent, const char *name); void load(); void save(); void defaults(); QString quickHelp() const; protected: void resizeEvent(QResizeEvent *e); protected slots: void moduleChanged(bool state); private: QTabWidget *tab; KBehaviourOptions *behaviour; KonqFontOptions *font; KRootOptions *root; KDesktopConfig *virtualDesks; KWinDesktopConfig *borders; }; #endif diff --git a/konqueror/settings/konq/miscopts.cpp b/konqueror/settings/konq/miscopts.cpp deleted file mode 100644 index 76f22b5f9..000000000 --- a/konqueror/settings/konq/miscopts.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// -// "Misc Options" Tab for Konqueror configuration -// -// (c) Sven Radej 1998 -// (c) David Faure 1998-2000 - -#include -#include -#include -#include -#include -#include //CT - 12Nov1998 -#include -#include - -#include "miscopts.h" - -#include -#include // include default values directly from konqueror -#include -#include -#include -#include - - -//----------------------------------------------------------------------------- - -KMiscOptions::KMiscOptions(KConfig *config, QString group, QWidget *parent, const char *name ) - : KCModule( parent, name ), g_pConfig(config), groupname(group) -{ - QVBoxLayout *lay = new QVBoxLayout(this, KDialog::marginHint(), - KDialog::spacingHint()); - -/* - urlpropsbox = new QCheckBox(i18n("&Allow per-URL settings"), this); - lay->addWidget(urlpropsbox); - connect(urlpropsbox, SIGNAL(clicked()), this, SLOT(changed())); - - QWhatsThis::add( urlpropsbox, i18n("Checking this option allows you to customize" - " Konqueror settings separately for each URL. For example, you can configure" - " different views for different directories. (Note that you need to have" - " write access in those directories in order to save settings.)") ); -*/ - - QGroupBox *gbox = new QGroupBox(i18n("Preferred Programs"), this); - lay->addWidget(gbox); - - QGridLayout *grid = new QGridLayout(gbox, 0, 2, - KDialog::marginHint(), - KDialog::spacingHint()); - grid->addRowSpacing(0, gbox->fontMetrics().height()); - grid->setColStretch(1, 1); - - QLabel * label = new QLabel(i18n("Terminal program:"), gbox); - grid->addWidget(label, 1, 0); - - leTerminal = new QLineEdit(gbox); - grid->addWidget(leTerminal, 1, 1); - connect(leTerminal, SIGNAL(textChanged(const QString&)), this, SLOT(changed())); - - QString wtstr = i18n("Enter the name of your favourite terminal program here," - " for example, konsole or xterm. This program will be used when you open" - " a terminal window from Konqueror by selecting \"Open Terminal ...\"," - " or by using the Ctrl+T shortcut."); - QWhatsThis::add( label, wtstr ); - QWhatsThis::add( leTerminal, wtstr ); - - cbListProgress = new QCheckBox( i18n( "&Show network operations in a single window" ), this ); - lay->addWidget( cbListProgress ); - connect(cbListProgress, SIGNAL(clicked()), this, SLOT(changed())); - - QWhatsThis::add( cbListProgress, i18n("Checking this option will group the" - " progress information for all network file transfers into a single window" - " with a list. When the option is not checked, all transfers appear in a" - " separate window.") ); - - lay->addStretch(10); - lay->activate(); - - load(); -} - -void KMiscOptions::load() -{ - // *** load *** - g_pConfig->setGroup( groupname ); - QString sTerminal = g_pConfig->readEntry( "Terminal", DEFAULT_TERMINAL ); - - KConfig config("uiserverrc"); - config.setGroup( "UIServer" ); - - bool bShowList = config.readBoolEntry( "ShowList", false ); - - // *** apply to GUI *** - - leTerminal->setText(sTerminal); - cbListProgress->setChecked( bShowList ); -} - -void KMiscOptions::defaults() -{ - leTerminal->setText(DEFAULT_TERMINAL); - cbListProgress->setChecked( false ); -} - -void KMiscOptions::save() -{ - g_pConfig->setGroup( groupname ); - g_pConfig->writeEntry( "Terminal", leTerminal->text()); - g_pConfig->sync(); - - KConfig config("uiserverrc"); - config.setGroup( "UIServer" ); - config.writeEntry( "ShowList", cbListProgress->isChecked() ); - config.sync(); - // Tell the running server - if ( kapp->dcopClient()->isApplicationRegistered( "kio_uiserver" ) ) - { - UIServer_stub uiserver( "kio_uiserver", "UIServer" ); - uiserver.setListMode( cbListProgress->isChecked() ); - } -} - -void KMiscOptions::changed() -{ - emit KCModule::changed(true); -} - -#include "miscopts.moc" diff --git a/konqueror/settings/konq/miscopts.h b/konqueror/settings/konq/miscopts.h deleted file mode 100644 index dcfc64c2f..000000000 --- a/konqueror/settings/konq/miscopts.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// -// "Misc Options" Tab for Konqueror configuration -// -// (c) Sven Radej 1998 -// (c) David Faure 1998-2000 - -#ifndef __MISC_OPTIONS_H -#define __MISC_OPTIONS_H - -#include - - -//----------------------------------------------------------------------------- -// The "Misc Options" Tab contains : - -// Preferred terminal (David) -// Network operations in a single window (David) -// ... there is room for others :)) - - -#include -class KConfig; -class QCheckBox; -class QLineEdit; - -class KMiscOptions : public KCModule -{ - Q_OBJECT -public: - KMiscOptions(KConfig *config, QString group, QWidget *parent = 0L, const char *name = 0L ); - virtual void load(); - virtual void save(); - virtual void defaults(); - -private slots: - - void changed(); - -private: - - KConfig *g_pConfig; - QString groupname; - - QLineEdit *leTerminal; - QCheckBox *cbListProgress; -}; - -#endif