summaryrefslogtreecommitdiff
path: root/core/pim/addressbook
Unidiff
Diffstat (limited to 'core/pim/addressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp6
-rw-r--r--core/pim/addressbook/addressbook.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 406ced6..9f668f4 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -1,157 +1,157 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** Copyright (C) 2003 Stefan Eilers (eilers.stefan@epost.de) 3** Copyright (C) 2003 Stefan Eilers (eilers.stefan@epost.de)
4** 4**
5** This file is part of the Open Palmtop Environment (see www.opie.info). 5** This file is part of the Open Palmtop Environment (see www.opie.info).
6** 6**
7** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14** 14**
15** See http://www.trolltech.com/gpl/ for GPL licensing information. 15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16** 16**
17** 17**
18**********************************************************************/ 18**********************************************************************/
19 19
20#define QTOPIA_INTERNAL_FD 20#define QTOPIA_INTERNAL_FD
21 21
22#include "contacteditor.h" 22#include "contacteditor.h"
23#include "ablabel.h" 23#include "ablabel.h"
24#include "abview.h" 24#include "abview.h"
25#include "abtable.h" 25#include "abtable.h"
26// #include "addresssettings.h" 26// #include "addresssettings.h"
27#include "addressbook.h" 27#include "addressbook.h"
28 28
29 29
30#include <opie/ofileselector.h> 30#include <opie/ofileselector.h>
31#include <opie/ofiledialog.h> 31#include <opie/ofiledialog.h>
32#include <opie/ocontact.h> 32#include <opie/ocontact.h>
33#include <opie/ocontactaccessbackend_vcard.h> 33#include <opie/ocontactaccessbackend_vcard.h>
34 34
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <qpe/ir.h> 36#include <qpe/ir.h>
37#include <qpe/qpemessagebox.h> 37#include <qpe/qpemessagebox.h>
38#include <qpe/qcopenvelope_qws.h> 38#include <qpe/qcopenvelope_qws.h>
39#include <qpe/qpetoolbar.h> 39#include <qtoolbar.h>
40#include <qmenubar.h> 40#include <qmenubar.h>
41// #include <qtoolbar.h> 41// #include <qtoolbar.h>
42// #include <qmenubar.h> 42// #include <qmenubar.h>
43#include <qpe/qpeapplication.h> 43#include <qpe/qpeapplication.h>
44#include <qpe/config.h> 44#include <qpe/config.h>
45 45
46#include <qaction.h> 46#include <qaction.h>
47#include <qdialog.h> 47#include <qdialog.h>
48#include <qdir.h> 48#include <qdir.h>
49#include <qfile.h> 49#include <qfile.h>
50#include <qimage.h> 50#include <qimage.h>
51#include <qlayout.h> 51#include <qlayout.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qpixmap.h> 53#include <qpixmap.h>
54#include <qpopupmenu.h> 54#include <qpopupmenu.h>
55#include <qstringlist.h> 55#include <qstringlist.h>
56#include <qtoolbutton.h> 56#include <qtoolbutton.h>
57#include <qwhatsthis.h> 57#include <qwhatsthis.h>
58#include <qdatetime.h> 58#include <qdatetime.h>
59 59
60#include <stdlib.h> 60#include <stdlib.h>
61#include <sys/stat.h> 61#include <sys/stat.h>
62#include <sys/types.h> 62#include <sys/types.h>
63#include <fcntl.h> 63#include <fcntl.h>
64#include <unistd.h> 64#include <unistd.h>
65 65
66 66
67#include "picker.h" 67#include "picker.h"
68#include "configdlg.h" 68#include "configdlg.h"
69 69
70extern QString addressbookPersonalVCardName(); 70extern QString addressbookPersonalVCardName();
71 71
72AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 72AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
73 WFlags f ) 73 WFlags f )
74 : QMainWindow( parent, name, f ), 74 : QMainWindow( parent, name, f ),
75 catMenu (0l), 75 catMenu (0l),
76 abEditor(0l), 76 abEditor(0l),
77 syncing(FALSE), 77 syncing(FALSE),
78 m_tableViewButton(0l), 78 m_tableViewButton(0l),
79 m_cardViewButton(0l) 79 m_cardViewButton(0l)
80{ 80{
81 isLoading = true; 81 isLoading = true;
82 82
83 m_config.load(); 83 m_config.load();
84 84
85 setCaption( tr("Contacts") ); 85 setCaption( tr("Contacts") );
86 setIcon( Resource::loadPixmap( "AddressBook" ) ); 86 setIcon( Resource::loadPixmap( "AddressBook" ) );
87 87
88 // Settings for Main Menu 88 // Settings for Main Menu
89 // setToolBarsMovable( false ); 89 // setToolBarsMovable( false );
90 setToolBarsMovable( !m_config.fixedBars() ); 90 setToolBarsMovable( !m_config.fixedBars() );
91 setRightJustification( true ); 91 setRightJustification( true );
92 92
93 QPEToolBar *bar = new QPEToolBar( this ); 93 QToolBar *bar = new QToolBar( this );
94 bar->setHorizontalStretchable( TRUE ); 94 bar->setHorizontalStretchable( TRUE );
95 95
96 QMenuBar *mbList = new QMenuBar( bar ); 96 QMenuBar *mbList = new QMenuBar( bar );
97 mbList->setMargin( 0 ); 97 mbList->setMargin( 0 );
98 98
99 QPopupMenu *edit = new QPopupMenu( mbList ); 99 QPopupMenu *edit = new QPopupMenu( mbList );
100 mbList->insertItem( tr( "Contact" ), edit ); 100 mbList->insertItem( tr( "Contact" ), edit );
101 101
102 // Category Menu 102 // Category Menu
103 catMenu = new QPopupMenu( this ); 103 catMenu = new QPopupMenu( this );
104 catMenu->setCheckable( TRUE ); 104 catMenu->setCheckable( TRUE );
105 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); 105 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
106 mbList->insertItem( tr("View"), catMenu ); 106 mbList->insertItem( tr("View"), catMenu );
107 107
108 // Create Toolbar 108 // Create Toolbar
109 listTools = new QPEToolBar( this, "list operations" ); 109 listTools = new QToolBar( this, "list operations" );
110 listTools->setHorizontalStretchable( true ); 110 listTools->setHorizontalStretchable( true );
111 addToolBar( listTools ); 111 addToolBar( listTools );
112 moveToolBar( listTools, m_config.getToolBarPos() ); 112 moveToolBar( listTools, m_config.getToolBarPos() );
113 113
114 // View Icons 114 // View Icons
115 m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/listview" ), 115 m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/listview" ),
116 QString::null, 0, this, 0 ); 116 QString::null, 0, this, 0 );
117 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); 117 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) );
118 m_tableViewButton->setToggleAction( true ); 118 m_tableViewButton->setToggleAction( true );
119 m_tableViewButton->addTo( listTools ); 119 m_tableViewButton->addTo( listTools );
120 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "addressbook/cardview" ), QString::null, 0, this, 0 ); 120 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "addressbook/cardview" ), QString::null, 0, this, 0 );
121 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) ); 121 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) );
122 m_cardViewButton->setToggleAction( true ); 122 m_cardViewButton->setToggleAction( true );
123 m_cardViewButton->addTo( listTools ); 123 m_cardViewButton->addTo( listTools );
124 124
125 listTools->addSeparator(); 125 listTools->addSeparator();
126 126
127 // Other Buttons 127 // Other Buttons
128 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 128 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null,
129 0, this, 0 ); 129 0, this, 0 );
130 actionNew = a; 130 actionNew = a;
131 connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) ); 131 connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) );
132 a->addTo( edit ); 132 a->addTo( edit );
133 a->addTo( listTools ); 133 a->addTo( listTools );
134 134
135 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 135 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
136 0, this, 0 ); 136 0, this, 0 );
137 actionEdit = a; 137 actionEdit = a;
138 connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); 138 connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) );
139 a->addTo( edit ); 139 a->addTo( edit );
140 a->addTo( listTools ); 140 a->addTo( listTools );
141 141
142 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 142 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
143 0, this, 0 ); 143 0, this, 0 );
144 actionTrash = a; 144 actionTrash = a;
145 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); 145 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) );
146 a->addTo( edit ); 146 a->addTo( edit );
147 a->addTo( listTools ); 147 a->addTo( listTools );
148 148
149 149
150 // make it possible to go directly to businesscard via qcop call 150 // make it possible to go directly to businesscard via qcop call
151 //#if defined(Q_WS_QWS) // Why this ? (se) 151 //#if defined(Q_WS_QWS) // Why this ? (se)
152#if !defined(QT_NO_COP) 152#if !defined(QT_NO_COP)
153 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); 153 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this );
154 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), 154 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
155 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); 155 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
156#endif 156#endif
157 // #endif 157 // #endif
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h
index 34bcb2a..9217e95 100644
--- a/core/pim/addressbook/addressbook.h
+++ b/core/pim/addressbook/addressbook.h
@@ -1,137 +1,137 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qt Palmtop Environment. 4** This file is part of Qt Palmtop Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef Addressbook_H 20#ifndef Addressbook_H
21#define Addressbook_H 21#define Addressbook_H
22 22
23// Remove this for OPIE releae 1.0 ! 23// Remove this for OPIE releae 1.0 !
24// #define __DEBUG_RELEASE 24// #define __DEBUG_RELEASE
25 25
26#include <qmainwindow.h> 26#include <qmainwindow.h>
27#include <qvaluelist.h> 27#include <qvaluelist.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include "ofloatbar.h" 30#include "ofloatbar.h"
31#include "abview.h" 31#include "abview.h"
32#include "abconfig.h" 32#include "abconfig.h"
33 33
34class ContactEditor; 34class ContactEditor;
35class AbLabel; 35class AbLabel;
36class AbTable; 36class AbTable;
37class QPEToolBar; 37class QToolBar;
38class QPopupMenu; 38class QPopupMenu;
39class QToolButton; 39class QToolButton;
40class QDialog; 40class QDialog;
41class Ir; 41class Ir;
42class QAction; 42class QAction;
43class LetterPicker; 43class LetterPicker;
44 44
45class AddressbookWindow: public QMainWindow 45class AddressbookWindow: public QMainWindow
46{ 46{
47 Q_OBJECT 47 Q_OBJECT
48public: 48public:
49 enum EntryMode { NewEntry=0, EditEntry }; 49 enum EntryMode { NewEntry=0, EditEntry };
50 50
51 static QString appName() { return QString::fromLatin1("addressbook"); } 51 static QString appName() { return QString::fromLatin1("addressbook"); }
52 AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 52 AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
53 ~AddressbookWindow(); 53 ~AddressbookWindow();
54 54
55protected: 55protected:
56 void resizeEvent( QResizeEvent * e ); 56 void resizeEvent( QResizeEvent * e );
57 57
58 void editPersonal(); 58 void editPersonal();
59 void editEntry( EntryMode ); 59 void editEntry( EntryMode );
60 void closeEvent( QCloseEvent *e ); 60 void closeEvent( QCloseEvent *e );
61 bool save(); 61 bool save();
62 62
63public slots: 63public slots:
64 void flush(); 64 void flush();
65 void reload(); 65 void reload();
66 void appMessage(const QCString &, const QByteArray &); 66 void appMessage(const QCString &, const QByteArray &);
67 void setDocument( const QString & ); 67 void setDocument( const QString & );
68#ifdef __DEBUG_RELEASE 68#ifdef __DEBUG_RELEASE
69 // void slotSave(); 69 // void slotSave();
70#endif 70#endif
71 71
72private slots: 72private slots:
73 void importvCard(); 73 void importvCard();
74 void exportvCard(); 74 void exportvCard();
75 void slotListNew(); 75 void slotListNew();
76 /* void slotListView(); */ 76 /* void slotListView(); */
77 void slotListDelete(); 77 void slotListDelete();
78 void slotViewBack(); 78 void slotViewBack();
79 void slotViewEdit(); 79 void slotViewEdit();
80 void slotPersonalView(); 80 void slotPersonalView();
81 void listIsEmpty( bool ); 81 void listIsEmpty( bool );
82 /* void slotSettings(); */ 82 /* void slotSettings(); */
83 void writeMail(); 83 void writeMail();
84 void slotBeam(); 84 void slotBeam();
85 void beamDone( Ir * ); 85 void beamDone( Ir * );
86 void slotSetCategory( int ); 86 void slotSetCategory( int );
87 void slotSetLetter( char ); 87 void slotSetLetter( char );
88 void slotUpdateToolbar(); 88 void slotUpdateToolbar();
89 void slotSetFont(int); 89 void slotSetFont(int);
90 90
91 void slotFindOpen(); 91 void slotFindOpen();
92 void slotFindClose(); 92 void slotFindClose();
93 void slotFind(); 93 void slotFind();
94 void slotNotFound(); 94 void slotNotFound();
95 void slotWrapAround(); 95 void slotWrapAround();
96 96
97 void slotViewSwitched( int ); 97 void slotViewSwitched( int );
98 void slotListView(); 98 void slotListView();
99 void slotCardView(); 99 void slotCardView();
100 100
101 void slotConfig(); 101 void slotConfig();
102 102
103private: 103private:
104 void populateCategories(); 104 void populateCategories();
105 105
106 QPopupMenu *catMenu; 106 QPopupMenu *catMenu;
107 QPEToolBar *listTools; 107 QToolBar *listTools;
108 QToolButton *deleteButton; 108 QToolButton *deleteButton;
109 enum Panes { paneList=0, paneView, paneEdit }; 109 enum Panes { paneList=0, paneView, paneEdit };
110 ContactEditor *abEditor; 110 ContactEditor *abEditor;
111 LetterPicker *pLabel; 111 LetterPicker *pLabel;
112 AbView* m_abView; 112 AbView* m_abView;
113 QWidget *listContainer; 113 QWidget *listContainer;
114 114
115 // Searching stuff 115 // Searching stuff
116 OFloatBar* searchBar; 116 OFloatBar* searchBar;
117 QLineEdit* searchEdit; 117 QLineEdit* searchEdit;
118 118
119 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; 119 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail;
120 120
121 int viewMargin; 121 int viewMargin;
122 122
123 bool syncing; 123 bool syncing;
124 QFont *defaultFont; 124 QFont *defaultFont;
125 int m_curFontSize; 125 int m_curFontSize;
126 126
127 bool isLoading; 127 bool isLoading;
128 128
129 AbConfig m_config; 129 AbConfig m_config;
130 130
131 QAction* m_tableViewButton; 131 QAction* m_tableViewButton;
132 QAction* m_cardViewButton; 132 QAction* m_cardViewButton;
133 133
134 int active_view; 134 int active_view;
135}; 135};
136 136
137#endif 137#endif