summaryrefslogtreecommitdiff
path: root/core/pim/addressbook
authortreke <treke>2003-11-11 07:14:38 (UTC)
committer treke <treke>2003-11-11 07:14:38 (UTC)
commit1eb61020dcba9bafd2926ab701120f5ef94905f7 (patch) (unidiff)
tree10d128bbf5b5b597aaf9602cb372ccbe46c12558 /core/pim/addressbook
parentf3326a60ba002b420f33b6132dc1740c0fc4ffef (diff)
downloadopie-1eb61020dcba9bafd2926ab701120f5ef94905f7.zip
opie-1eb61020dcba9bafd2926ab701120f5ef94905f7.tar.gz
opie-1eb61020dcba9bafd2926ab701120f5ef94905f7.tar.bz2
Updating apps to use quickexec. Ipks are now generated properly.
Diffstat (limited to 'core/pim/addressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp4
-rw-r--r--core/pim/addressbook/addressbook.h1
-rw-r--r--core/pim/addressbook/addressbook.pro6
-rw-r--r--core/pim/addressbook/main.cpp17
4 files changed, 9 insertions, 19 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 0ba024e..438c270 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -223,96 +223,100 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
223 a->addTo( edit ); 223 a->addTo( edit );
224 224
225 225
226#ifdef __DEBUG_RELEASE 226#ifdef __DEBUG_RELEASE
227 // Remove this function for public Release ! This is only 227 // Remove this function for public Release ! This is only
228 // for debug purposes .. 228 // for debug purposes ..
229 a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); 229 a = new QAction( tr( "Save all Data"), QString::null, 0, 0 );
230 connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); 230 connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) );
231 a->addTo( edit ); 231 a->addTo( edit );
232#endif 232#endif
233 a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 233 a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null,
234 0, this, 0 ); 234 0, this, 0 );
235 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); 235 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) );
236 a->addTo( edit ); 236 a->addTo( edit );
237 237
238 // Create Views 238 // Create Views
239 listContainer = new QWidget( this ); 239 listContainer = new QWidget( this );
240 QVBoxLayout *vb = new QVBoxLayout( listContainer ); 240 QVBoxLayout *vb = new QVBoxLayout( listContainer );
241 241
242 m_abView = new AbView( listContainer, m_config.orderList() ); 242 m_abView = new AbView( listContainer, m_config.orderList() );
243 vb->addWidget( m_abView ); 243 vb->addWidget( m_abView );
244 // abList->setHScrollBarMode( QScrollView::AlwaysOff ); 244 // abList->setHScrollBarMode( QScrollView::AlwaysOff );
245 connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), 245 connect( m_abView, SIGNAL( signalViewSwitched ( int ) ),
246 this, SLOT( slotViewSwitched( int ) ) ); 246 this, SLOT( slotViewSwitched( int ) ) );
247 247
248 248
249 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); 249 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
250 250
251 // m_abView->load(); // Already done by c'tor . 251 // m_abView->load(); // Already done by c'tor .
252 252
253 // Letter Picker 253 // Letter Picker
254 pLabel = new LetterPicker( listContainer ); 254 pLabel = new LetterPicker( listContainer );
255 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 255 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
256 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); 256 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) );
257 257
258 vb->addWidget( pLabel ); 258 vb->addWidget( pLabel );
259 259
260 // All Categories into view-menu.. 260 // All Categories into view-menu..
261 populateCategories(); 261 populateCategories();
262 262
263 // Fontsize 263 // Fontsize
264 defaultFont = new QFont( m_abView->font() ); 264 defaultFont = new QFont( m_abView->font() );
265 slotSetFont(m_config.fontSize()); 265 slotSetFont(m_config.fontSize());
266 m_curFontSize = m_config.fontSize(); 266 m_curFontSize = m_config.fontSize();
267 267
268 setCentralWidget(listContainer); 268 setCentralWidget(listContainer);
269 269
270 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 270 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
271 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
272 connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) );
273 connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ),
274 this, SLOT( appMessage(const QCString &, const QByteArray &) ) );
271 275
272 276
273 isLoading = false; 277 isLoading = false;
274} 278}
275 279
276 280
277void AddressbookWindow::slotConfig() 281void AddressbookWindow::slotConfig()
278{ 282{
279 ConfigDlg* dlg = new ConfigDlg( this, "Config" ); 283 ConfigDlg* dlg = new ConfigDlg( this, "Config" );
280 dlg -> setConfig( m_config ); 284 dlg -> setConfig( m_config );
281 dlg -> showMaximized(); 285 dlg -> showMaximized();
282 if ( dlg -> exec() ) { 286 if ( dlg -> exec() ) {
283 qWarning ("Config Dialog accepted!"); 287 qWarning ("Config Dialog accepted!");
284 m_config = dlg -> getConfig(); 288 m_config = dlg -> getConfig();
285 if ( m_curFontSize != m_config.fontSize() ){ 289 if ( m_curFontSize != m_config.fontSize() ){
286 qWarning("Font was changed!"); 290 qWarning("Font was changed!");
287 m_curFontSize = m_config.fontSize(); 291 m_curFontSize = m_config.fontSize();
288 emit slotSetFont( m_curFontSize ); 292 emit slotSetFont( m_curFontSize );
289 } 293 }
290 m_abView -> setListOrder( m_config.orderList() ); 294 m_abView -> setListOrder( m_config.orderList() );
291 } 295 }
292 296
293 delete dlg; 297 delete dlg;
294} 298}
295 299
296 300
297void AddressbookWindow::slotSetFont( int size ) 301void AddressbookWindow::slotSetFont( int size )
298{ 302{
299 qWarning("void AddressbookWindow::slotSetFont( %d )", size); 303 qWarning("void AddressbookWindow::slotSetFont( %d )", size);
300 304
301 if (size > 2 || size < 0) 305 if (size > 2 || size < 0)
302 size = 1; 306 size = 1;
303 307
304 m_config.setFontSize( size ); 308 m_config.setFontSize( size );
305 309
306 QFont *currentFont; 310 QFont *currentFont;
307 311
308 switch (size) { 312 switch (size) {
309 case 0: 313 case 0:
310 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); 314 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) );
311 currentFont = new QFont (m_abView->font()); 315 currentFont = new QFont (m_abView->font());
312 // abList->resizeRows(currentFont->pixelSize() + 7); :SX 316 // abList->resizeRows(currentFont->pixelSize() + 7); :SX
313 // abList->resizeRows(); 317 // abList->resizeRows();
314 break; 318 break;
315 case 1: 319 case 1:
316 m_abView->setFont( *defaultFont ); 320 m_abView->setFont( *defaultFont );
317 currentFont = new QFont (m_abView->font()); 321 currentFont = new QFont (m_abView->font());
318 // // abList->resizeRows(currentFont->pixelSize() + 7); 322 // // abList->resizeRows(currentFont->pixelSize() + 7);
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h
index f7a560a..34bcb2a 100644
--- a/core/pim/addressbook/addressbook.h
+++ b/core/pim/addressbook/addressbook.h
@@ -3,96 +3,97 @@
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 QPEToolBar;
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 AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 52 AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
52 ~AddressbookWindow(); 53 ~AddressbookWindow();
53 54
54protected: 55protected:
55 void resizeEvent( QResizeEvent * e ); 56 void resizeEvent( QResizeEvent * e );
56 57
57 void editPersonal(); 58 void editPersonal();
58 void editEntry( EntryMode ); 59 void editEntry( EntryMode );
59 void closeEvent( QCloseEvent *e ); 60 void closeEvent( QCloseEvent *e );
60 bool save(); 61 bool save();
61 62
62public slots: 63public slots:
63 void flush(); 64 void flush();
64 void reload(); 65 void reload();
65 void appMessage(const QCString &, const QByteArray &); 66 void appMessage(const QCString &, const QByteArray &);
66 void setDocument( const QString & ); 67 void setDocument( const QString & );
67#ifdef __DEBUG_RELEASE 68#ifdef __DEBUG_RELEASE
68 // void slotSave(); 69 // void slotSave();
69#endif 70#endif
70 71
71private slots: 72private slots:
72 void importvCard(); 73 void importvCard();
73 void exportvCard(); 74 void exportvCard();
74 void slotListNew(); 75 void slotListNew();
75 /* void slotListView(); */ 76 /* void slotListView(); */
76 void slotListDelete(); 77 void slotListDelete();
77 void slotViewBack(); 78 void slotViewBack();
78 void slotViewEdit(); 79 void slotViewEdit();
79 void slotPersonalView(); 80 void slotPersonalView();
80 void listIsEmpty( bool ); 81 void listIsEmpty( bool );
81 /* void slotSettings(); */ 82 /* void slotSettings(); */
82 void writeMail(); 83 void writeMail();
83 void slotBeam(); 84 void slotBeam();
84 void beamDone( Ir * ); 85 void beamDone( Ir * );
85 void slotSetCategory( int ); 86 void slotSetCategory( int );
86 void slotSetLetter( char ); 87 void slotSetLetter( char );
87 void slotUpdateToolbar(); 88 void slotUpdateToolbar();
88 void slotSetFont(int); 89 void slotSetFont(int);
89 90
90 void slotFindOpen(); 91 void slotFindOpen();
91 void slotFindClose(); 92 void slotFindClose();
92 void slotFind(); 93 void slotFind();
93 void slotNotFound(); 94 void slotNotFound();
94 void slotWrapAround(); 95 void slotWrapAround();
95 96
96 void slotViewSwitched( int ); 97 void slotViewSwitched( int );
97 void slotListView(); 98 void slotListView();
98 void slotCardView(); 99 void slotCardView();
diff --git a/core/pim/addressbook/addressbook.pro b/core/pim/addressbook/addressbook.pro
index c90568a..6a04e22 100644
--- a/core/pim/addressbook/addressbook.pro
+++ b/core/pim/addressbook/addressbook.pro
@@ -1,51 +1,49 @@
1 TEMPLATE= app 1 #CONFIG = qt warn_on release quick-app
2 #CONFIG = qt warn_on release 2 CONFIG = qt warn_on debug quick-app
3 CONFIG = qt warn_on debug
4 DESTDIR = $(OPIEDIR)/bin
5 HEADERS= addressbook.h \ 3 HEADERS= addressbook.h \
6 contacteditor.h \ 4 contacteditor.h \
7 ablabel.h \ 5 ablabel.h \
8 abtable.h \ 6 abtable.h \
9 picker.h \ 7 picker.h \
10 ofloatbar.h \ 8 ofloatbar.h \
11 configdlg.h \ 9 configdlg.h \
12 abconfig.h \ 10 abconfig.h \
13 abview.h 11 abview.h
14 SOURCES= main.cpp \ 12 SOURCES= main.cpp \
15 addressbook.cpp \ 13 addressbook.cpp \
16 contacteditor.cpp \ 14 contacteditor.cpp \
17 ablabel.cpp \ 15 ablabel.cpp \
18 abtable.cpp \ 16 abtable.cpp \
19 picker.cpp \ 17 picker.cpp \
20 configdlg.cpp \ 18 configdlg.cpp \
21 abconfig.cpp \ 19 abconfig.cpp \
22 abview.cpp 20 abview.cpp
23 21
24 INTERFACES= configdlg_base.ui 22 INTERFACES= configdlg_base.ui
25 TARGET = addressbook 23 TARGET = addressbook
26INCLUDEPATH += $(OPIEDIR)/include 24INCLUDEPATH += $(OPIEDIR)/include
27 DEPENDPATH+= $(OPIEDIR)/include 25 DEPENDPATH+= $(OPIEDIR)/include
28LIBS += -lqpe -lopie 26LIBS += -lqpe -lopie
29 27
30TRANSLATIONS = ../../../i18n/de/addressbook.ts \ 28TRANSLATIONS = ../../../i18n/de/addressbook.ts \
31 ../../../i18n/nl/addressbook.ts \ 29 ../../../i18n/nl/addressbook.ts \
32 ../../../i18n/da/addressbook.ts \ 30 ../../../i18n/da/addressbook.ts \
33 ../../../i18n/xx/addressbook.ts \ 31 ../../../i18n/xx/addressbook.ts \
34 ../../../i18n/en/addressbook.ts \ 32 ../../../i18n/en/addressbook.ts \
35 ../../../i18n/es/addressbook.ts \ 33 ../../../i18n/es/addressbook.ts \
36 ../../../i18n/fr/addressbook.ts \ 34 ../../../i18n/fr/addressbook.ts \
37 ../../../i18n/hu/addressbook.ts \ 35 ../../../i18n/hu/addressbook.ts \
38 ../../../i18n/ja/addressbook.ts \ 36 ../../../i18n/ja/addressbook.ts \
39 ../../../i18n/ko/addressbook.ts \ 37 ../../../i18n/ko/addressbook.ts \
40 ../../../i18n/no/addressbook.ts \ 38 ../../../i18n/no/addressbook.ts \
41 ../../../i18n/pl/addressbook.ts \ 39 ../../../i18n/pl/addressbook.ts \
42 ../../../i18n/pt/addressbook.ts \ 40 ../../../i18n/pt/addressbook.ts \
43 ../../../i18n/pt_BR/addressbook.ts \ 41 ../../../i18n/pt_BR/addressbook.ts \
44 ../../../i18n/sl/addressbook.ts \ 42 ../../../i18n/sl/addressbook.ts \
45 ../../../i18n/zh_CN/addressbook.ts \ 43 ../../../i18n/zh_CN/addressbook.ts \
46 ../../../i18n/it/addressbook.ts \ 44 ../../../i18n/it/addressbook.ts \
47 ../../../i18n/zh_TW/addressbook.ts 45 ../../../i18n/zh_TW/addressbook.ts
48 46
49 47
50 48
51include ( $(OPIEDIR)/include.pro ) 49include ( $(OPIEDIR)/include.pro )
diff --git a/core/pim/addressbook/main.cpp b/core/pim/addressbook/main.cpp
index 2ea1819..97bfa6d 100644
--- a/core/pim/addressbook/main.cpp
+++ b/core/pim/addressbook/main.cpp
@@ -1,41 +1,28 @@
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 20
21#include "addressbook.h" 21#include "addressbook.h"
22 22
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qpe/qcopenvelope_qws.h>
25#include <qstring.h>
26 24
27int main( int argc, char ** argv ) 25#include <opie/oapplicationfactory.h>
28{
29 QPEApplication a( argc, argv );
30 26
31 AddressbookWindow mw; 27OPIE_EXPORT_APP( OApplicationFactory<AddressbookWindow> )
32 QObject::connect( &a, SIGNAL( flush() ), &mw, SLOT( flush() ) );
33 QObject::connect( &a, SIGNAL( reload() ), &mw, SLOT( reload() ) );
34 QObject::connect( &a, SIGNAL( appMessage(const QCString &, const QByteArray &) ),
35 &mw, SLOT( appMessage(const QCString &, const QByteArray &) ) );
36 28
37 mw.setCaption( AddressbookWindow::tr("Contacts") );
38 a.showMainDocumentWidget(&mw);
39
40 return a.exec();
41}