author | zautrix <zautrix> | 2004-07-07 11:56:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-07 11:56:39 (UTC) |
commit | 56721aac86c9ae5253abac8962474c8d1a7e648a (patch) (unidiff) | |
tree | c12f41eba0d5724ee800cdb92727ffd6d3c1cf6c /kaddressbook | |
parent | 13d88c91f2916090bd45e23b504d0b665c68126f (diff) | |
download | kdepimpi-56721aac86c9ae5253abac8962474c8d1a7e648a.zip kdepimpi-56721aac86c9ae5253abac8962474c8d1a7e648a.tar.gz kdepimpi-56721aac86c9ae5253abac8962474c8d1a7e648a.tar.bz2 |
Changes for compiling on desktop
-rw-r--r-- | kaddressbook/kcmconfigs/addresseewidget.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp index f84b2ba..eb5bdd9 100644 --- a/kaddressbook/kcmconfigs/addresseewidget.cpp +++ b/kaddressbook/kcmconfigs/addresseewidget.cpp | |||
@@ -1,60 +1,61 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
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 | #include <qgroupbox.h> | 24 | #include <qgroupbox.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlistbox.h> | 27 | #include <qlistbox.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qapplication.h> | ||
29 | 30 | ||
30 | #include <kbuttonbox.h> | 31 | #include <kbuttonbox.h> |
31 | #include <kcombobox.h> | 32 | #include <kcombobox.h> |
32 | #include <kconfig.h> | 33 | #include <kconfig.h> |
33 | #include <kdialog.h> | 34 | #include <kdialog.h> |
34 | #include <klocale.h> | 35 | #include <klocale.h> |
35 | #include <kglobal.h> | 36 | #include <kglobal.h> |
36 | #include <klineedit.h> | 37 | #include <klineedit.h> |
37 | #include <kstandarddirs.h> | 38 | #include <kstandarddirs.h> |
38 | 39 | ||
39 | #include "addresseewidget.h" | 40 | #include "addresseewidget.h" |
40 | 41 | ||
41 | NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, | 42 | NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, |
42 | const char *name ) | 43 | const char *name ) |
43 | : QWidget( parent, name ) | 44 | : QWidget( parent, name ) |
44 | { | 45 | { |
45 | if (KGlobal::getOrientation() == KGlobal::Portrait) | 46 | if (KGlobal::getOrientation() == KGlobal::Portrait) |
46 | { | 47 | { |
47 | QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), | 48 | QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), |
48 | KDialog::spacingHintSmall() ); | 49 | KDialog::spacingHintSmall() ); |
49 | 50 | ||
50 | QLabel *label = new QLabel( i18n( title ), this ); | 51 | QLabel *label = new QLabel( i18n( title ), this ); |
51 | layout->addWidget( label, 0, 1 ); | 52 | layout->addWidget( label, 0, 1 ); |
52 | 53 | ||
53 | mBox = new QListBox( this ); | 54 | mBox = new QListBox( this ); |
54 | mBox->setMaximumSize(70, 70); | 55 | mBox->setMaximumSize(70, 70); |
55 | layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); | 56 | layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); |
56 | 57 | ||
57 | KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); | 58 | KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); |
58 | mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); | 59 | mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); |
59 | mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); | 60 | mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); |
60 | bbox->layout(); | 61 | bbox->layout(); |
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index dce6a88..cf1fd3e 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -16,78 +16,79 @@ | |||
16 | 16 | ||
17 | int main( int argc, char **argv ) | 17 | int main( int argc, char **argv ) |
18 | { | 18 | { |
19 | #ifndef DESKTOP_VERSION | 19 | #ifndef DESKTOP_VERSION |
20 | QPEApplication a( argc, argv ); | 20 | QPEApplication a( argc, argv ); |
21 | a.setKeepRunning (); | 21 | a.setKeepRunning (); |
22 | #else | 22 | #else |
23 | QApplication a( argc, argv ); | 23 | QApplication a( argc, argv ); |
24 | QApplication::setStyle( new QPlatinumStyle ()); | 24 | QApplication::setStyle( new QPlatinumStyle ()); |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | bool exitHelp = false; | 27 | bool exitHelp = false; |
28 | if ( argc > 1 ) { | 28 | if ( argc > 1 ) { |
29 | QString command = argv[1]; | 29 | QString command = argv[1]; |
30 | if ( command == "-help" ){ | 30 | if ( command == "-help" ){ |
31 | printf("KA/E command line commands:\n"); | 31 | printf("KA/E command line commands:\n"); |
32 | printf(" no command: Start KA/E in usual way\n"); | 32 | printf(" no command: Start KA/E in usual way\n"); |
33 | printf(" -help: This output\n"); | 33 | printf(" -help: This output\n"); |
34 | printf(" KA/E is exiting now. Bye!\n"); | 34 | printf(" KA/E is exiting now. Bye!\n"); |
35 | exitHelp = true; | 35 | exitHelp = true; |
36 | } | 36 | } |
37 | } | 37 | } |
38 | if ( ! exitHelp ) { | 38 | if ( ! exitHelp ) { |
39 | 39 | ||
40 | KGlobal::setAppName( "kaddressbook" ); | 40 | KGlobal::setAppName( "kaddressbook" ); |
41 | #ifndef DESKTOP_VERSION | 41 | #ifndef DESKTOP_VERSION |
42 | if ( QApplication::desktop()->width() > 320 ) | 42 | if ( QApplication::desktop()->width() > 320 ) |
43 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); | 43 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); |
44 | else | 44 | else |
45 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 45 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
46 | #else | 46 | #else |
47 | QString fileName ; | 47 | QString fileName ; |
48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/"; | 48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; |
49 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 49 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
50 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | ||
50 | 51 | ||
51 | #endif | 52 | #endif |
52 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 53 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
53 | KAddressBookMain m ; | 54 | KAddressBookMain m ; |
54 | //US MainWindow m; | 55 | //US MainWindow m; |
55 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 56 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
56 | 57 | ||
57 | #ifndef DESKTOP_VERSION | 58 | #ifndef DESKTOP_VERSION |
58 | a.showMainWidget( &m ); | 59 | a.showMainWidget( &m ); |
59 | #else | 60 | #else |
60 | a.setMainWidget(m ); | 61 | a.setMainWidget( &m ); |
61 | m->show(); | 62 | m.show(); |
62 | #endif | 63 | #endif |
63 | a.exec(); | 64 | a.exec(); |
64 | 65 | ||
65 | } | 66 | } |
66 | qDebug("KA: Bye! "); | 67 | qDebug("KA: Bye! "); |
67 | } | 68 | } |
68 | 69 | ||
69 | /* | 70 | /* |
70 | #include <stdlib.h> | 71 | #include <stdlib.h> |
71 | 72 | ||
72 | #include <qstring.h> | 73 | #include <qstring.h> |
73 | 74 | ||
74 | #include <kabc/stdaddressbook.h> | 75 | #include <kabc/stdaddressbook.h> |
75 | #include <kaboutdata.h> | 76 | #include <kaboutdata.h> |
76 | #include <kcmdlineargs.h> | 77 | #include <kcmdlineargs.h> |
77 | #include <kcrash.h> | 78 | #include <kcrash.h> |
78 | #include <kdebug.h> | 79 | #include <kdebug.h> |
79 | #include <klocale.h> | 80 | #include <klocale.h> |
80 | #include <kstartupinfo.h> | 81 | #include <kstartupinfo.h> |
81 | #include <kuniqueapplication.h> | 82 | #include <kuniqueapplication.h> |
82 | #include <kwin.h> | 83 | #include <kwin.h> |
83 | 84 | ||
84 | #include "kaddressbookmain.h" | 85 | #include "kaddressbookmain.h" |
85 | #include "kabcore.h" | 86 | #include "kabcore.h" |
86 | 87 | ||
87 | extern "C" { | 88 | extern "C" { |
88 | 89 | ||
89 | void crashHandler( int ) | 90 | void crashHandler( int ) |
90 | { | 91 | { |
91 | KABC::StdAddressBook::handleCrash(); | 92 | KABC::StdAddressBook::handleCrash(); |
92 | ::exit( 0 ); | 93 | ::exit( 0 ); |
93 | } | 94 | } |