summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-02-11 05:36:14 (UTC)
committer zautrix <zautrix>2005-02-11 05:36:14 (UTC)
commit0c1191e3253542b4858261241975c159ee7910c6 (patch) (unidiff)
treebe97b6665d130f0b72db82005726fbf7cc030abb /kaddressbook
parent38c6a7b6ae1e98cba0fdf2d0fba59ad4b9060940 (diff)
downloadkdepimpi-0c1191e3253542b4858261241975c159ee7910c6.zip
kdepimpi-0c1191e3253542b4858261241975c159ee7910c6.tar.gz
kdepimpi-0c1191e3253542b4858261241975c159ee7910c6.tar.bz2
font fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabprefs.cpp1
-rw-r--r--kaddressbook/mainembedded.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 01e84d0..b96d28a 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -1,155 +1,154 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24//US#ifdef KAB_EMBEDDED 24//US#ifdef KAB_EMBEDDED
25//#include <qstring.h> 25//#include <qstring.h>
26//#endif //KAB_EMBEDDED 26//#endif //KAB_EMBEDDED
27 27
28#include <qtextstream.h> 28#include <qtextstream.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qregexp.h> 30#include <qregexp.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#include <libkdepim/kpimglobalprefs.h> 32#include <libkdepim/kpimglobalprefs.h>
33 33
34#include <kconfig.h> 34#include <kconfig.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kstaticdeleter.h> 36#include <kstaticdeleter.h>
37#include <kglobalsettings.h> 37#include <kglobalsettings.h>
38//US#include <kdebug.h> // defines kdDebug() 38//US#include <kdebug.h> // defines kdDebug()
39 39
40#include "kabprefs.h" 40#include "kabprefs.h"
41 41
42#ifdef DESKTOP_VERSION 42#ifdef DESKTOP_VERSION
43#include <qapplication.h> 43#include <qapplication.h>
44#endif 44#endif
45 45
46KABPrefs *KABPrefs::sInstance = 0; 46KABPrefs *KABPrefs::sInstance = 0;
47static KStaticDeleter<KABPrefs> staticDeleterAB; 47static KStaticDeleter<KABPrefs> staticDeleterAB;
48 48
49KABPrefs::KABPrefs() 49KABPrefs::KABPrefs()
50 : KPimPrefs("kaddressbookrc") 50 : KPimPrefs("kaddressbookrc")
51{ 51{
52 KPrefs::setCurrentGroup( "Views" ); 52 KPrefs::setCurrentGroup( "Views" );
53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); 53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
54 54
55 KPrefs::setCurrentGroup( "General" ); 55 KPrefs::setCurrentGroup( "General" );
56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); 56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); 57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
58
59#ifdef KAB_EMBEDDED 58#ifdef KAB_EMBEDDED
60 addItemBool("AskForQuit",&mAskForQuit,true); 59 addItemBool("AskForQuit",&mAskForQuit,true);
61 addItemBool("ToolBarHor",&mToolBarHor, true ); 60 addItemBool("ToolBarHor",&mToolBarHor, true );
62 addItemBool("ToolBarUp",&mToolBarUp, false ); 61 addItemBool("ToolBarUp",&mToolBarUp, false );
63 addItemBool("SearchWithReturn",&mSearchWithReturn, false ); 62 addItemBool("SearchWithReturn",&mSearchWithReturn, false );
64 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); 63 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont());
65 64
66 65
67#endif //KAB_EMBEDDED 66#endif //KAB_EMBEDDED
68 67
69 KPrefs::setCurrentGroup( "MainWindow" ); 68 KPrefs::setCurrentGroup( "MainWindow" );
70 bool m_visible = false; 69 bool m_visible = false;
71#ifdef DESKTOP_VERSION 70#ifdef DESKTOP_VERSION
72 m_visible = true; 71 m_visible = true;
73#endif 72#endif
74 addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); 73 addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible );
75 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); 74 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
76 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); 75 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
77 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); 76 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
78 addItemIntList( "DetailsSplitter", &mDetailsSplitter ); 77 addItemIntList( "DetailsSplitter", &mDetailsSplitter );
79 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); 78 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
80 79
81 80
82 KPrefs::setCurrentGroup( "Extensions_General" ); 81 KPrefs::setCurrentGroup( "Extensions_General" );
83 QStringList defaultExtensions; 82 QStringList defaultExtensions;
84 defaultExtensions << "merge"; 83 defaultExtensions << "merge";
85 defaultExtensions << "distribution_list_editor"; 84 defaultExtensions << "distribution_list_editor";
86 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 85 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
87 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); 86 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
88 87
89 KPrefs::setCurrentGroup( "Views" ); 88 KPrefs::setCurrentGroup( "Views" );
90 QString defaultView = i18n( "Default Table View" ); 89 QString defaultView = i18n( "Default Table View" );
91 addItemString( "CurrentView", &mCurrentView, defaultView ); 90 addItemString( "CurrentView", &mCurrentView, defaultView );
92 addItemStringList( "ViewNames", &mViewNames, defaultView ); 91 addItemStringList( "ViewNames", &mViewNames, defaultView );
93 92
94 KPrefs::setCurrentGroup( "Filters" ); 93 KPrefs::setCurrentGroup( "Filters" );
95 addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); 94 addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
96 95
97} 96}
98 97
99KABPrefs::~KABPrefs() 98KABPrefs::~KABPrefs()
100{ 99{
101 //qDebug("KABPrefs::~KABPrefs() "); 100 //qDebug("KABPrefs::~KABPrefs() ");
102 if (sInstance == this) 101 if (sInstance == this)
103 sInstance = staticDeleterAB.setObject(0); 102 sInstance = staticDeleterAB.setObject(0);
104} 103}
105 104
106KABPrefs *KABPrefs::instance() 105KABPrefs *KABPrefs::instance()
107{ 106{
108 if ( !sInstance ) { 107 if ( !sInstance ) {
109#ifdef KAB_EMBEDDED 108#ifdef KAB_EMBEDDED
110 sInstance = staticDeleterAB.setObject( new KABPrefs() ); 109 sInstance = staticDeleterAB.setObject( new KABPrefs() );
111#else //KAB_EMBEDDED 110#else //KAB_EMBEDDED
112 //US the following line has changed ???. Why 111 //US the following line has changed ???. Why
113 staticDeleterAB.setObject( sInstance, new KABPrefs() ); 112 staticDeleterAB.setObject( sInstance, new KABPrefs() );
114#endif //KAB_EMBEDDED 113#endif //KAB_EMBEDDED
115 sInstance->readConfig(); 114 sInstance->readConfig();
116 } 115 }
117 116
118 return sInstance; 117 return sInstance;
119} 118}
120 119
121void KABPrefs::setCategoryDefaults() 120void KABPrefs::setCategoryDefaults()
122{ 121{
123 mCustomCategories.clear(); 122 mCustomCategories.clear();
124 123
125 mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) 124 mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" )
126 << i18n( "Customer" ) << i18n( "Friend" ); 125 << i18n( "Customer" ) << i18n( "Friend" );
127} 126}
128 127
129 // US introduce a nonconst way to return the config object. 128 // US introduce a nonconst way to return the config object.
130KConfig* KABPrefs::getConfig() 129KConfig* KABPrefs::getConfig()
131{ 130{
132 return config(); 131 return config();
133} 132}
134void KABPrefs::usrReadConfig() 133void KABPrefs::usrReadConfig()
135{ 134{
136 KPimPrefs::usrReadConfig(); 135 KPimPrefs::usrReadConfig();
137} 136}
138 137
139 138
140/*US 139/*US
141void KABPrefs::usrSetDefaults() 140void KABPrefs::usrSetDefaults()
142{ 141{
143 KPimPrefs::usrSetDefaults(); 142 KPimPrefs::usrSetDefaults();
144} 143}
145 144
146void KABPrefs::usrReadConfig() 145void KABPrefs::usrReadConfig()
147{ 146{
148 KPimPrefs::usrReadConfig(); 147 KPimPrefs::usrReadConfig();
149} 148}
150 149
151void KABPrefs::usrWriteConfig() 150void KABPrefs::usrWriteConfig()
152{ 151{
153 KPimPrefs::usrWriteConfig(); 152 KPimPrefs::usrWriteConfig();
154} 153}
155*/ 154*/
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index d9968f3..336e350 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,102 +1,103 @@
1#ifndef DESKTOP_VERSION 1#ifndef DESKTOP_VERSION
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qcopchannel_qws.h> 3#include <qcopchannel_qws.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#else 5#else
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qwindowsstyle.h> 7#include <qwindowsstyle.h>
8#include <qplatinumstyle.h> 8#include <qplatinumstyle.h>
9#include <qmainwindow.h> 9#include <qmainwindow.h>
10#include <qmessagebox.h> 10#include <qmessagebox.h>
11#include <stdlib.h> 11#include <stdlib.h>
12#endif 12#endif
13 13
14#include <qtextcodec.h> 14#include <qtextcodec.h>
15#include <kstandarddirs.h> 15#include <kstandarddirs.h>
16#include <qregexp.h> 16#include <qregexp.h>
17#include <kglobal.h> 17#include <kglobal.h>
18#include <stdio.h> 18#include <stdio.h>
19#include <qdir.h> 19#include <qdir.h>
20#include "kabprefs.h" 20#include "kabprefs.h"
21#include "kaddressbookmain.h" 21#include "kaddressbookmain.h"
22#include "externalapphandler.h" 22#include "externalapphandler.h"
23#include <libkdepim/kpimglobalprefs.h> 23#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 24void dumpMissing();
25int main( int argc, char **argv ) 25int main( int argc, char **argv )
26{ 26{
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ()); 32 QApplication::setStyle( new QPlatinumStyle ());
33#ifdef _WIN32_ 33#ifdef _WIN32_
34 QString hdir ( getenv( "HOME") ); 34 QString hdir ( getenv( "HOME") );
35 if ( hdir.isEmpty() ) { 35 if ( hdir.isEmpty() ) {
36 QString hd ("C:/" ); 36 QString hd ("C:/" );
37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
38 if ( QDir::homeDirPath().lower() == hd.lower() ) { 38 if ( QDir::homeDirPath().lower() == hd.lower() ) {
39 _putenv( "HOME=C:"); 39 _putenv( "HOME=C:");
40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
41 } 41 }
42 } else { 42 } else {
43 QDir app_dir; 43 QDir app_dir;
44 if ( !app_dir.exists(hdir) ) 44 if ( !app_dir.exists(hdir) )
45 app_dir.mkdir (hdir); 45 app_dir.mkdir (hdir);
46 } 46 }
47#endif 47#endif
48#endif 48#endif
49 49
50 bool exitHelp = false; 50 bool exitHelp = false;
51 if ( argc > 1 ) { 51 if ( argc > 1 ) {
52 QString command = argv[1]; 52 QString command = argv[1];
53 if ( command == "-help" ){ 53 if ( command == "-help" ){
54 printf("KA/E command line commands:\n"); 54 printf("KA/E command line commands:\n");
55 printf(" no command: Start KA/E in usual way\n"); 55 printf(" no command: Start KA/E in usual way\n");
56 printf(" -help: This output\n"); 56 printf(" -help: This output\n");
57 printf(" KA/E is exiting now. Bye!\n"); 57 printf(" KA/E is exiting now. Bye!\n");
58 exitHelp = true; 58 exitHelp = true;
59 } 59 }
60 } 60 }
61 if ( ! exitHelp ) { 61 if ( ! exitHelp ) {
62 62
63 KGlobal::setAppName( "kaddressbook" ); 63 KGlobal::setAppName( "kaddressbook" );
64#ifndef DESKTOP_VERSION 64#ifndef DESKTOP_VERSION
65 if ( QApplication::desktop()->width() > 320 ) 65 if ( QApplication::desktop()->width() > 320 )
66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
67 else 67 else
68 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 68 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
69#else 69#else
70 QString fileName ; 70 QString fileName ;
71 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 71 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
72 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 72 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
73 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 73 QApplication::addLibraryPath ( qApp->applicationDirPath () );
74 74
75#endif 75#endif
76 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 76 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
77 // init language 77 // init language
78 KPimGlobalPrefs::instance()->setGlobalConfig(); 78 KPimGlobalPrefs::instance()->setGlobalConfig();
79 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
79 KAddressBookMain m ; 80 KAddressBookMain m ;
80//US MainWindow m; 81//US MainWindow m;
81#ifndef DESKTOP_VERSION 82#ifndef DESKTOP_VERSION
82 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 83 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
83#endif 84#endif
84 85
85 86
86#ifndef DESKTOP_VERSION 87#ifndef DESKTOP_VERSION
87 a.showMainWidget( &m ); 88 a.showMainWidget( &m );
88 89
89#else 90#else
90 a.setMainWidget( &m ); 91 a.setMainWidget( &m );
91 m.resize (640, 480 ); 92 m.resize (640, 480 );
92 m.show(); 93 m.show();
93#endif 94#endif
94 a.exec(); 95 a.exec();
95 96
96 dumpMissing(); 97 dumpMissing();
97 98
98 KPimGlobalPrefs::instance()->writeConfig(); 99 KPimGlobalPrefs::instance()->writeConfig();
99 } 100 }
100 qDebug("KA: Bye! "); 101 qDebug("KA: Bye! ");
101} 102}
102 103