summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 93581e8..82a1b57 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -47,48 +47,52 @@
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 <qpe/qpemenubar.h> 52#include <qpe/qpemenubar.h>
53#include <qmessagebox.h> 53#include <qmessagebox.h>
54#include <qpixmap.h> 54#include <qpixmap.h>
55#include <qpopupmenu.h> 55#include <qpopupmenu.h>
56#include <qpe/qpetoolbar.h> 56#include <qpe/qpetoolbar.h>
57#include <qstringlist.h> 57#include <qstringlist.h>
58#include <qtoolbutton.h> 58#include <qtoolbutton.h>
59#include <qwhatsthis.h> 59#include <qwhatsthis.h>
60 60
61#include <stdlib.h> 61#include <stdlib.h>
62#include <sys/stat.h> 62#include <sys/stat.h>
63#include <sys/types.h> 63#include <sys/types.h>
64#include <fcntl.h> 64#include <fcntl.h>
65#include <unistd.h> 65#include <unistd.h>
66 66
67#include <qdatetime.h> 67#include <qdatetime.h>
68 68
69#include "picker.h" 69#include "picker.h"
70 70
71// Remove this for OPIE releae 1.0 !
72#define __DEBUG_RELEASE
73
74
71static QString addressbookPersonalVCardName() 75static QString addressbookPersonalVCardName()
72{ 76{
73 QString filename = Global::applicationFileName("addressbook", 77 QString filename = Global::applicationFileName("addressbook",
74 "businesscard.vcf"); 78 "businesscard.vcf");
75 return filename; 79 return filename;
76} 80}
77 81
78 82
79AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 83AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
80 WFlags f ) 84 WFlags f )
81 : QMainWindow( parent, name, f ), 85 : QMainWindow( parent, name, f ),
82 abEditor(0), 86 abEditor(0),
83 bAbEditFirstTime(TRUE), 87 bAbEditFirstTime(TRUE),
84 syncing(FALSE) 88 syncing(FALSE)
85{ 89{
86 isLoading = true; 90 isLoading = true;
87 91
88 initFields(); 92 initFields();
89 93
90 setCaption( tr("Contacts") ); 94 setCaption( tr("Contacts") );
91 setIcon( Resource::loadPixmap( "AddressBook" ) ); 95 setIcon( Resource::loadPixmap( "AddressBook" ) );
92 96
93 setToolBarsMovable( FALSE ); 97 setToolBarsMovable( FALSE );
94 98
@@ -163,52 +167,61 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
163 167
164 if ( Ir::supported() ) { 168 if ( Ir::supported() ) {
165 a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, 169 a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null,
166 0, this, 0 ); 170 0, this, 0 );
167 actionBeam = a; 171 actionBeam = a;
168 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); 172 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
169 a->addTo( edit ); 173 a->addTo( edit );
170 a->addTo( listTools ); 174 a->addTo( listTools );
171 } 175 }
172 176
173 edit->insertSeparator(); 177 edit->insertSeparator();
174 178
175 a = new QAction( tr("Import vCard"), QString::null, 0, 0, 0, TRUE ); 179 a = new QAction( tr("Import vCard"), QString::null, 0, 0, 0, TRUE );
176 actionPersonal = a; 180 actionPersonal = a;
177 connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); 181 connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) );
178 a->addTo( edit ); 182 a->addTo( edit );
179 183
180 edit->insertSeparator(); 184 edit->insertSeparator();
181 185
182 a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); 186 a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE );
183 actionPersonal = a; 187 actionPersonal = a;
184 connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); 188 connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) );
185 a->addTo( edit ); 189 a->addTo( edit );
186 190
187 191 // Do we need this function ? (se)
188 a = new QAction( tr( "Arrange Edit Fields"), QString::null, 0, 0 ); 192 // a = new QAction( tr( "Arrange Edit Fields"), QString::null, 0, 0 );
189 connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); 193 // connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
194 // a->addTo( edit );
195
196
197#ifdef __DEBUG_RELEASE
198 // Remove this function for public Release ! This is only
199 // for debug purposes ..
200 a = new QAction( tr( "Save all Data"), QString::null, 0, 0 );
201 connect( a, SIGNAL( activated() ), this, SLOT( save() ) );
190 a->addTo( edit ); 202 a->addTo( edit );
203#endif
191 204
192 // Create Views 205 // Create Views
193 listContainer = new QWidget( this ); 206 listContainer = new QWidget( this );
194 207
195 QVBoxLayout *vb = new QVBoxLayout( listContainer ); 208 QVBoxLayout *vb = new QVBoxLayout( listContainer );
196 209
197 abList = new AbTable( &orderedFields, listContainer, "table" ); 210 abList = new AbTable( &orderedFields, listContainer, "table" );
198 vb->addWidget(abList); 211 vb->addWidget(abList);
199 // abList->setHScrollBarMode( QScrollView::AlwaysOff ); 212 // abList->setHScrollBarMode( QScrollView::AlwaysOff );
200 connect( abList, SIGNAL( empty( bool ) ), this, SLOT( listIsEmpty( bool ) ) ); 213 connect( abList, SIGNAL( empty( bool ) ), this, SLOT( listIsEmpty( bool ) ) );
201 connect( abList, SIGNAL( details() ), this, SLOT( slotListView() ) ); 214 connect( abList, SIGNAL( details() ), this, SLOT( slotListView() ) );
202 connect( abList, SIGNAL(currentChanged(int,int)), this, SLOT(slotUpdateToolbar()) ); 215 connect( abList, SIGNAL(currentChanged(int,int)), this, SLOT(slotUpdateToolbar()) );
203 216
204 mView = 0; 217 mView = 0;
205 218
206 abList->load(); 219 abList->load();
207 220
208 pLabel = new LetterPicker( listContainer ); 221 pLabel = new LetterPicker( listContainer );
209 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 222 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
210 vb->addWidget(pLabel); 223 vb->addWidget(pLabel);
211 catMenu = new QPopupMenu( this ); 224 catMenu = new QPopupMenu( this );
212 catMenu->setCheckable( TRUE ); 225 catMenu->setCheckable( TRUE );
213 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); 226 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
214 populateCategories(); 227 populateCategories();