• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kopete/kopete

appearanceconfig.cpp

Go to the documentation of this file.
00001 /*
00002     appearanceconfig.cpp  -  Kopete Look Feel Config
00003 
00004     Copyright (c) 2001-2002 by Duncan Mac-Vicar Prett <duncan@kde.org>
00005     Copyright (c) 2005-2006 by Michaƫl Larouche       <larouche@kde.org>
00006 
00007     Kopete    (c) 2002-2006 by the Kopete developers  <kopete-devel@kde.org>
00008 
00009     *************************************************************************
00010     *                                                                       *
00011     * This program is free software; you can redistribute it and/or modify  *
00012     * it under the terms of the GNU General Public License as published by  *
00013     * the Free Software Foundation; either version 2 of the License, or     *
00014     * (at your option) any later version.                                   *
00015     *                                                                       *
00016     *************************************************************************
00017 */
00018 
00019 #include "appearanceconfig.h"
00020 #include "ui_appearanceconfig_colors.h"
00021 #include "ui_appearanceconfig_contactlist.h"
00022 #include "ui_appearanceconfig_advanced.h"
00023 
00024 #include "tooltipeditdialog.h"
00025 
00026 #include <QCheckBox>
00027 #include <QDir>
00028 #include <QLayout>
00029 #include <QSpinBox>
00030 #include <QSlider>
00031 #include <QLabel>
00032 #include <QPixmap>
00033 #include <QVBoxLayout>
00034 
00035 #include <kdeversion.h>
00036 #include <kinputdialog.h>
00037 
00038 #include <kcolorcombo.h>
00039 #include <kcolorbutton.h>
00040 #include <kdebug.h>
00041 #include <kfontrequester.h>
00042 #include <kpluginfactory.h>
00043 #include <kpluginloader.h>
00044 #include <kio/netaccess.h>
00045 #include <khtmlview.h>
00046 #include <klineedit.h>
00047 #include <klocale.h>
00048 #include <kmessagebox.h>
00049 #include <kpushbutton.h>
00050 #include <kstandarddirs.h>
00051 #include <kurl.h> // KNewStuff
00052 #include <kurlrequesterdialog.h>
00053 #include <krun.h>
00054 #include <kfiledialog.h>
00055 
00056 #include "kopeteglobal.h"
00057 
00058 #include <qtabwidget.h>
00059 
00060 #include "kopeteappearancesettings.h"
00061 
00062 //class AppearanceConfig;
00063 
00064 K_PLUGIN_FACTORY( KopeteAppearanceConfigFactory,
00065         registerPlugin<AppearanceConfig>(); )
00066 K_EXPORT_PLUGIN( KopeteAppearanceConfigFactory("kcm_kopete_appearanceconfig") )
00067 
00068 class FakeProtocol;
00069 class FakeAccount;
00070 class FakeContact;
00071 
00072 class AppearanceConfig::Private
00073 {
00074 public:
00075     Private()
00076      : mAppearanceTabCtl(0L)
00077     {}
00078 
00079     QTabWidget *mAppearanceTabCtl;
00080 
00081     Ui::AppearanceConfig_Colors mPrfsColors;
00082     Ui::AppearanceConfig_ContactList mPrfsContactList;
00083     Ui::AppearanceConfig_Advanced mPrfsAdvanced;
00084 };
00085 
00086 
00087 AppearanceConfig::AppearanceConfig(QWidget *parent, const QVariantList &args )
00088 : KCModule( KopeteAppearanceConfigFactory::componentData(), parent, args )
00089 {
00090     d = new Private;
00091 
00092     QVBoxLayout *layout = new QVBoxLayout(this);
00093     // since the tab widget is already within a layout with margins in the KSettings::Dialog
00094     // it needs no margins of its own.
00095     layout->setContentsMargins( 0, 0, 0, 0 );
00096     d->mAppearanceTabCtl = new QTabWidget(this);
00097     d->mAppearanceTabCtl->setObjectName("mAppearanceTabCtl");
00098     layout->addWidget( d->mAppearanceTabCtl );
00099 
00100     KConfigGroup config(KGlobal::config(), "ChatWindowSettings");
00101 
00102     // "Contact List" TAB =======================================================
00103     QWidget *contactListWidget = new QWidget(d->mAppearanceTabCtl);
00104     d->mPrfsContactList.setupUi(contactListWidget);
00105     addConfig( Kopete::AppearanceSettings::self(), contactListWidget );
00106 
00107     connect(d->mPrfsContactList.mEditTooltips, SIGNAL(clicked()),
00108         this, SLOT(slotEditTooltips()));
00109 
00110     d->mAppearanceTabCtl->addTab(contactListWidget, i18n("Contact List"));
00111 
00112     // "Colors and Fonts" TAB ===================================================
00113     QWidget *colorsWidget = new QWidget(d->mAppearanceTabCtl);
00114     d->mPrfsColors.setupUi(colorsWidget);
00115     addConfig( Kopete::AppearanceSettings::self(), colorsWidget );
00116 
00117     d->mAppearanceTabCtl->addTab(colorsWidget, i18n("Colors && Fonts"));
00118 
00119     // "Advanced" TAB ===========================================================
00120     QWidget *advancedWidget = new QWidget(d->mAppearanceTabCtl);
00121     d->mPrfsAdvanced.setupUi(advancedWidget);
00122     addConfig( Kopete::AppearanceSettings::self(), advancedWidget );
00123 
00124     d->mAppearanceTabCtl->addTab(advancedWidget, i18n("Advanced"));
00125 
00126     // ==========================================================================
00127 
00128     load();
00129 }
00130 
00131 AppearanceConfig::~AppearanceConfig()
00132 {
00133     delete d;
00134 }
00135 
00136 void AppearanceConfig::save()
00137 {
00138     KCModule::save();
00139 //  kDebug(14000) << "called.";
00140 
00141     Kopete::AppearanceSettings *settings = Kopete::AppearanceSettings::self();
00142 
00143     settings->writeConfig();
00144 
00145     load();
00146 }
00147 
00148 void AppearanceConfig::load()
00149 {
00150     KCModule::load();
00151 
00152 //  kDebug(14000) << "called";
00153 }
00154 
00155 void AppearanceConfig::slotHighlightChanged()
00156 {
00157 //  bool value = mPrfsChatWindow->highlightEnabled->isChecked();
00158 //  mPrfsChatWindow->foregroundColor->setEnabled ( value );
00159 //  mPrfsChatWindow->backgroundColor->setEnabled ( value );
00160 //  slotUpdateChatPreview();
00161 }
00162 
00163 void AppearanceConfig::slotChangeFont()
00164 {
00165     emitChanged();
00166 }
00167 
00168 void AppearanceConfig::emitChanged()
00169 {
00170     emit changed( true );
00171 }
00172 
00173 void AppearanceConfig::slotEditTooltips()
00174 {
00175     TooltipEditDialog *dlg = new TooltipEditDialog(this);
00176     connect(dlg, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
00177     dlg->exec();
00178     delete dlg;
00179 }
00180 
00181 #include "appearanceconfig.moc"
00182 // vim: set noet ts=4 sts=4 sw=4:

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal