summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/ablabel.cpp3
-rw-r--r--core/pim/addressbook/abtable.cpp9
-rw-r--r--core/pim/addressbook/addressbook.cpp16
-rw-r--r--core/pim/addressbook/configdlg.cpp1
-rw-r--r--core/pim/addressbook/contacteditor.cpp11
-rw-r--r--core/pim/addressbook/main.cpp1
-rw-r--r--core/pim/addressbook/picker.cpp2
-rw-r--r--core/pim/datebook/datebook.cpp15
-rw-r--r--core/pim/datebook/datebookdayallday.cpp10
-rw-r--r--core/pim/datebook/datebookdayheaderimpl.cpp4
-rw-r--r--core/pim/datebook/datebooksettings.cpp1
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp4
-rw-r--r--core/pim/datebook/datebookweeklst.cpp1
-rw-r--r--core/pim/datebook/dateentryimpl.cpp11
-rw-r--r--core/pim/datebook/main.cpp1
-rw-r--r--core/pim/datebook/noteentryimpl.cpp2
-rw-r--r--core/pim/datebook/repeatentry.cpp4
-rw-r--r--core/pim/osearch/adresssearch.cpp2
-rw-r--r--core/pim/osearch/applnkitem.cpp1
-rw-r--r--core/pim/osearch/applnksearch.cpp1
-rw-r--r--core/pim/osearch/contactitem.cpp1
-rw-r--r--core/pim/osearch/datebooksearch.cpp2
-rw-r--r--core/pim/osearch/doclnkitem.cpp1
-rw-r--r--core/pim/osearch/doclnksearch.cpp1
-rw-r--r--core/pim/osearch/eventitem.cpp2
-rw-r--r--core/pim/osearch/main.cpp1
-rw-r--r--core/pim/osearch/mainwindow.cpp2
-rw-r--r--core/pim/osearch/olistview.cpp1
-rw-r--r--core/pim/osearch/resultitem.cpp1
-rw-r--r--core/pim/osearch/searchgroup.cpp3
-rw-r--r--core/pim/osearch/todoitem.cpp1
-rw-r--r--core/pim/osearch/todosearch.cpp1
-rw-r--r--core/pim/today/today.cpp1
-rw-r--r--core/pim/todo/mainwindow.cpp6
34 files changed, 1 insertions, 123 deletions
diff --git a/core/pim/addressbook/ablabel.cpp b/core/pim/addressbook/ablabel.cpp
index 1914f71..076e2e0 100644
--- a/core/pim/addressbook/ablabel.cpp
+++ b/core/pim/addressbook/ablabel.cpp
@@ -1,74 +1,71 @@
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 "ablabel.h" 21#include "ablabel.h"
22 22
23#include <qpe/stringutil.h>
24 23
25#include <qregexp.h>
26#include <qstylesheet.h>
27 24
28AbLabel::AbLabel( QWidget *parent, const char *name ): 25AbLabel::AbLabel( QWidget *parent, const char *name ):
29 QTextView( parent, name ), 26 QTextView( parent, name ),
30 m_empty( false ) 27 m_empty( false )
31{ 28{
32} 29}
33 30
34AbLabel::~AbLabel() 31AbLabel::~AbLabel()
35{ 32{
36} 33}
37 34
38void AbLabel::setContacts( const OContactAccess::List& viewList ) 35void AbLabel::setContacts( const OContactAccess::List& viewList )
39{ 36{
40 m_viewList = viewList; 37 m_viewList = viewList;
41 if (m_viewList.count() != 0){ 38 if (m_viewList.count() != 0){
42 m_empty = false; 39 m_empty = false;
43 m_itCurContact = m_viewList.begin(); 40 m_itCurContact = m_viewList.begin();
44 sync(); 41 sync();
45 }else{ 42 }else{
46 // m_itCurContact.clear(); 43 // m_itCurContact.clear();
47 m_empty = true; 44 m_empty = true;
48 setText( "" ); 45 setText( "" );
49 } 46 }
50} 47}
51 48
52int AbLabel::currentEntry_UID() 49int AbLabel::currentEntry_UID()
53{ 50{
54 OContact contact = currentEntry(); 51 OContact contact = currentEntry();
55 52
56 if ( contact.isEmpty() ) 53 if ( contact.isEmpty() )
57 return 0; 54 return 0;
58 else 55 else
59 return ( contact.uid() ); 56 return ( contact.uid() );
60} 57}
61 58
62OContact AbLabel::currentEntry() 59OContact AbLabel::currentEntry()
63{ 60{
64 if ( ! m_empty ) 61 if ( ! m_empty )
65 return ( *m_itCurContact ); 62 return ( *m_itCurContact );
66 else 63 else
67 return OContact(); 64 return OContact();
68} 65}
69 66
70 67
71bool AbLabel::selectContact( int UID ) 68bool AbLabel::selectContact( int UID )
72{ 69{
73 70
74 for ( int r = 0; r < m_viewList.count(); ++r ) { 71 for ( int r = 0; r < m_viewList.count(); ++r ) {
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 70330c7..f7bff58 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -1,84 +1,75 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) 3** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de)
4** 4**
5** This file is part of Qt Palmtop Environment. 5** This file is part of Qt Palmtop Environment.
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** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22 22
23#include <qpe/categoryselect.h>
24#include <qpe/config.h>
25#include <qpe/stringutil.h>
26#include <qpe/qcopenvelope_qws.h>
27#include <qpe/timestring.h> 23#include <qpe/timestring.h>
28#include <qpe/resource.h> 24#include <qpe/resource.h>
29 25
30#include <opie/orecordlist.h> 26#include <opie/orecordlist.h>
31 27
32#include <qasciidict.h>
33#include <qdatetime.h>
34#include <qfile.h>
35#include <qregexp.h>
36#include <qmessagebox.h>
37 28
38#include "abtable.h" 29#include "abtable.h"
39 30
40#include <errno.h> 31#include <errno.h>
41#include <fcntl.h> 32#include <fcntl.h>
42#include <unistd.h> 33#include <unistd.h>
43#include <stdlib.h> 34#include <stdlib.h>
44 35
45#include <ctype.h> //toupper() for key hack 36#include <ctype.h> //toupper() for key hack
46 37
47#if 0 38#if 0
48 39
49/*! 40/*!
50 \class AbTableItem abtable.h 41 \class AbTableItem abtable.h
51 42
52 \brief QTableItem based class for showing a field of an entry 43 \brief QTableItem based class for showing a field of an entry
53*/ 44*/
54 45
55AbTableItem::AbTableItem( QTable *t, EditType et, const QString &s, 46AbTableItem::AbTableItem( QTable *t, EditType et, const QString &s,
56 const QString &secondSortKey) 47 const QString &secondSortKey)
57 : QTableItem( t, et, s ) 48 : QTableItem( t, et, s )
58{ 49{
59 // sortKey = s.lower() + QChar( '\0' ) + secondSortKey.lower(); 50 // sortKey = s.lower() + QChar( '\0' ) + secondSortKey.lower();
60 sortKey = Qtopia::buildSortKey( s, secondSortKey ); 51 sortKey = Qtopia::buildSortKey( s, secondSortKey );
61} 52}
62 53
63int AbTableItem::alignment() const 54int AbTableItem::alignment() const
64{ 55{
65 return AlignLeft|AlignVCenter; 56 return AlignLeft|AlignVCenter;
66} 57}
67 58
68QString AbTableItem::key() const 59QString AbTableItem::key() const
69{ 60{
70 return sortKey; 61 return sortKey;
71} 62}
72 63
73// A way to reset the item, without out doing a delete or a new... 64// A way to reset the item, without out doing a delete or a new...
74void AbTableItem::setItem( const QString &txt, const QString &secondKey ) 65void AbTableItem::setItem( const QString &txt, const QString &secondKey )
75{ 66{
76 setText( txt ); 67 setText( txt );
77 sortKey = Qtopia::buildSortKey( txt, secondKey ); 68 sortKey = Qtopia::buildSortKey( txt, secondKey );
78 69
79 // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower(); 70 // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower();
80} 71}
81 72
82/*! 73/*!
83 \class AbPickItem abtable.h 74 \class AbPickItem abtable.h
84 75
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 1c7ddd4..9cf55b3 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -1,106 +1,90 @@
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"
23#include "ablabel.h"
24#include "abview.h"
25#include "abtable.h"
26// #include "addresssettings.h" 22// #include "addresssettings.h"
27#include "addressbook.h" 23#include "addressbook.h"
28 24
29 25
30#include <opie/ofileselector.h> 26#include <opie/ofileselector.h>
31#include <opie/ofiledialog.h> 27#include <opie/ofiledialog.h>
32#include <opie/ocontact.h> 28#include <opie/ocontact.h>
33#include <opie/ocontactaccessbackend_vcard.h> 29#include <opie/ocontactaccessbackend_vcard.h>
34 30
35#include <qpe/resource.h> 31#include <qpe/resource.h>
36#include <qpe/ir.h> 32#include <qpe/ir.h>
37#include <qpe/qpemessagebox.h> 33#include <qpe/qpemessagebox.h>
38#include <qpe/qcopenvelope_qws.h>
39#include <qtoolbar.h>
40#include <qmenubar.h> 34#include <qmenubar.h>
41// #include <qtoolbar.h> 35// #include <qtoolbar.h>
42// #include <qmenubar.h> 36// #include <qmenubar.h>
43#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
44#include <qpe/config.h>
45 38
46#include <qaction.h> 39#include <qaction.h>
47#include <qdialog.h>
48#include <qdir.h>
49#include <qfile.h>
50#include <qimage.h>
51#include <qlayout.h> 40#include <qlayout.h>
52#include <qmessagebox.h> 41#include <qmessagebox.h>
53#include <qpixmap.h>
54#include <qpopupmenu.h>
55#include <qstringlist.h>
56#include <qtoolbutton.h> 42#include <qtoolbutton.h>
57#include <qwhatsthis.h>
58#include <qdatetime.h>
59 43
60#include <stdlib.h> 44#include <stdlib.h>
61#include <sys/stat.h> 45#include <sys/stat.h>
62#include <sys/types.h> 46#include <sys/types.h>
63#include <fcntl.h> 47#include <fcntl.h>
64#include <unistd.h> 48#include <unistd.h>
65 49
66 50
67#include "picker.h" 51#include "picker.h"
68#include "configdlg.h" 52#include "configdlg.h"
69 53
70extern QString addressbookPersonalVCardName(); 54extern QString addressbookPersonalVCardName();
71 55
72AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 56AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
73 WFlags f ) 57 WFlags f )
74 : QMainWindow( parent, name, f ), 58 : QMainWindow( parent, name, f ),
75 catMenu (0l), 59 catMenu (0l),
76 abEditor(0l), 60 abEditor(0l),
77 syncing(FALSE), 61 syncing(FALSE),
78 m_tableViewButton(0l), 62 m_tableViewButton(0l),
79 m_cardViewButton(0l) 63 m_cardViewButton(0l)
80{ 64{
81 isLoading = true; 65 isLoading = true;
82 66
83 m_config.load(); 67 m_config.load();
84 68
85 setCaption( tr("Contacts") ); 69 setCaption( tr("Contacts") );
86 setIcon( Resource::loadPixmap( "AddressBook" ) ); 70 setIcon( Resource::loadPixmap( "AddressBook" ) );
87 71
88 // Settings for Main Menu 72 // Settings for Main Menu
89 // setToolBarsMovable( false ); 73 // setToolBarsMovable( false );
90 setToolBarsMovable( !m_config.fixedBars() ); 74 setToolBarsMovable( !m_config.fixedBars() );
91 setRightJustification( true ); 75 setRightJustification( true );
92 76
93 QToolBar *bar = new QToolBar( this ); 77 QToolBar *bar = new QToolBar( this );
94 bar->setHorizontalStretchable( TRUE ); 78 bar->setHorizontalStretchable( TRUE );
95 79
96 QMenuBar *mbList = new QMenuBar( bar ); 80 QMenuBar *mbList = new QMenuBar( bar );
97 mbList->setMargin( 0 ); 81 mbList->setMargin( 0 );
98 82
99 QPopupMenu *edit = new QPopupMenu( mbList ); 83 QPopupMenu *edit = new QPopupMenu( mbList );
100 mbList->insertItem( tr( "Contact" ), edit ); 84 mbList->insertItem( tr( "Contact" ), edit );
101 85
102 // Category Menu 86 // Category Menu
103 catMenu = new QPopupMenu( this ); 87 catMenu = new QPopupMenu( this );
104 catMenu->setCheckable( TRUE ); 88 catMenu->setCheckable( TRUE );
105 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); 89 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
106 mbList->insertItem( tr("View"), catMenu ); 90 mbList->insertItem( tr("View"), catMenu );
diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp
index 981f5e0..dee0f11 100644
--- a/core/pim/addressbook/configdlg.cpp
+++ b/core/pim/addressbook/configdlg.cpp
@@ -1,55 +1,54 @@
1#include "configdlg.h" 1#include "configdlg.h"
2 2
3#include <qcheckbox.h> 3#include <qcheckbox.h>
4#include <qradiobutton.h> 4#include <qradiobutton.h>
5#include <qlistbox.h> 5#include <qlistbox.h>
6#include <qpushbutton.h> 6#include <qpushbutton.h>
7#include <qiconset.h>
8 7
9#include <qpe/resource.h> 8#include <qpe/resource.h>
10 9
11#include <opie/ocontact.h> 10#include <opie/ocontact.h>
12#include "opie/ocontactfields.h" 11#include "opie/ocontactfields.h"
13 12
14ConfigDlg::ConfigDlg( QWidget *parent, const char *name): 13ConfigDlg::ConfigDlg( QWidget *parent, const char *name):
15 ConfigDlg_Base(parent, name, true ) 14 ConfigDlg_Base(parent, name, true )
16{ 15{
17 contFields = OContactFields::trfields(); 16 contFields = OContactFields::trfields();
18 17
19 // We add all Fields into the Listbox 18 // We add all Fields into the Listbox
20 for (uint i=0; i < contFields.count(); i++) { 19 for (uint i=0; i < contFields.count(); i++) {
21 allFieldListBox->insertItem( contFields[i] ); 20 allFieldListBox->insertItem( contFields[i] );
22 } 21 }
23 22
24 // Reset Widget Flags: This was not changeable by designer :( 23 // Reset Widget Flags: This was not changeable by designer :(
25 setWFlags ( WStyle_ContextHelp ); 24 setWFlags ( WStyle_ContextHelp );
26 25
27 // Set Pics to Buttons and Tabs 26 // Set Pics to Buttons and Tabs
28 m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); 27 m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) );
29 m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); 28 m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) );
30 m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); 29 m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) );
31 m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); 30 m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) );
32 31
33 32
34 // Get the translation maps between Field ID and translated strings 33 // Get the translation maps between Field ID and translated strings
35 m_mapStrToID = OContactFields::trFieldsToId(); 34 m_mapStrToID = OContactFields::trFieldsToId();
36 m_mapIDToStr = OContactFields::idToTrFields(); 35 m_mapIDToStr = OContactFields::idToTrFields();
37 36
38 connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); 37 connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) );
39 connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); 38 connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) );
40 connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); 39 connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) );
41 connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); 40 connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) );
42} 41}
43 42
44void ConfigDlg::slotItemUp() 43void ConfigDlg::slotItemUp()
45{ 44{
46 qWarning( "void ConfigDlg::slotItemUp()" ); 45 qWarning( "void ConfigDlg::slotItemUp()" );
47 46
48 int i = fieldListBox->currentItem(); 47 int i = fieldListBox->currentItem();
49 if ( i > 0 ) { 48 if ( i > 0 ) {
50 QString item = fieldListBox->currentText(); 49 QString item = fieldListBox->currentText();
51 fieldListBox->removeItem( i ); 50 fieldListBox->removeItem( i );
52 fieldListBox->insertItem( item, i-1 ); 51 fieldListBox->insertItem( item, i-1 );
53 fieldListBox->setCurrentItem( i-1 ); 52 fieldListBox->setCurrentItem( i-1 );
54 } 53 }
55 54
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 7932781..b1eb042 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1,95 +1,84 @@
1/* 1/*
2 * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> 2 * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org>
3 * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) 3 * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de)
4 * 4 *
5 * This file is an add-on for the OPIE Palmtop Environment 5 * This file is an add-on for the OPIE Palmtop Environment
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 pacakaging 9 * Foundation and appearing in the file LICENSE.GPL included in the pacakaging
10 * of this file. 10 * 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 * 15 *
16 * This is a rewrite of the abeditor.h file, modified to provide a more 16 * This is a rewrite of the abeditor.h file, modified to provide a more
17 * intuitive interface to TrollTech's original Address Book editor. This 17 * intuitive interface to TrollTech's original Address Book editor. This
18 * is made to operate exactly in interface with the exception of name. 18 * is made to operate exactly in interface with the exception of name.
19 * 19 *
20 */ 20 */
21 21
22#include "contacteditor.h" 22#include "contacteditor.h"
23#include "addresspicker.h"
24 23
25#include <qpe/categoryselect.h> 24#include <qpe/categoryselect.h>
26#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
27#include <qpe/qpedialog.h> 26#include <qpe/qpedialog.h>
28#include <qpe/timeconversion.h>
29#include <opie/ocontact.h> 27#include <opie/ocontact.h>
30#include <qpe/resource.h> 28#include <qpe/resource.h>
31 29
32#include <qcombobox.h>
33#include <qlabel.h> 30#include <qlabel.h>
34#include <qtabwidget.h> 31#include <qtabwidget.h>
35#include <qlayout.h> 32#include <qlayout.h>
36#include <qlineedit.h> 33#include <qlineedit.h>
37#include <qmultilineedit.h> 34#include <qmultilineedit.h>
38#include <qscrollview.h>
39#include <qtoolbutton.h> 35#include <qtoolbutton.h>
40#include <qpushbutton.h>
41#include <qmainwindow.h>
42#include <qvaluelist.h>
43#include <qpopupmenu.h>
44#include <qlistbox.h> 36#include <qlistbox.h>
45#include <qhbox.h>
46#include <qaction.h>
47#include <qiconset.h>
48#include <qmessagebox.h> 37#include <qmessagebox.h>
49#include <qwhatsthis.h> 38#include <qwhatsthis.h>
50 39
51#include <assert.h> 40#include <assert.h>
52 41
53static inline bool containsAlphaNum( const QString &str ); 42static inline bool containsAlphaNum( const QString &str );
54static inline bool constainsWhiteSpace( const QString &str ); 43static inline bool constainsWhiteSpace( const QString &str );
55 44
56// helper functions, convert our comma delimited list to proper 45// helper functions, convert our comma delimited list to proper
57// file format... 46// file format...
58void parseEmailFrom( const QString &txt, QString &strDefaultEmail, 47void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
59 QString &strAll ); 48 QString &strAll );
60 49
61// helper convert from file format to comma delimited... 50// helper convert from file format to comma delimited...
62void parseEmailTo( const QString &strDefaultEmail, 51void parseEmailTo( const QString &strDefaultEmail,
63 const QString &strOtherEmail, QString &strBack ); 52 const QString &strOtherEmail, QString &strBack );
64 53
65 ContactEditor::ContactEditor(const OContact &entry, 54 ContactEditor::ContactEditor(const OContact &entry,
66 QWidget *parent, 55 QWidget *parent,
67 const char *name, 56 const char *name,
68 WFlags ) 57 WFlags )
69 : QDialog( parent, name, TRUE, WStyle_ContextHelp ), 58 : QDialog( parent, name, TRUE, WStyle_ContextHelp ),
70 defaultEmailChooserPosition( -1 ), 59 defaultEmailChooserPosition( -1 ),
71 m_personalView ( false ), 60 m_personalView ( false ),
72 cmbDefaultEmail( 0 ), 61 cmbDefaultEmail( 0 ),
73 initializing ( false ) 62 initializing ( false )
74{ 63{
75 64
76 initializing = true; 65 initializing = true;
77 66
78 init(); 67 init();
79 setEntry( entry ); 68 setEntry( entry );
80 // cmbDefaultEmail = 0; 69 // cmbDefaultEmail = 0;
81 // defaultEmailChooserPosition = -1; 70 // defaultEmailChooserPosition = -1;
82 71
83 initializing = false; 72 initializing = false;
84} 73}
85 74
86ContactEditor::~ContactEditor() { 75ContactEditor::~ContactEditor() {
87} 76}
88 77
89void ContactEditor::init() { 78void ContactEditor::init() {
90 qWarning("init() START"); 79 qWarning("init() START");
91 80
92 uint i = 0; 81 uint i = 0;
93 82
94 QStringList trlChooserNames; 83 QStringList trlChooserNames;
95 84
diff --git a/core/pim/addressbook/main.cpp b/core/pim/addressbook/main.cpp
index 97bfa6d..47d370a 100644
--- a/core/pim/addressbook/main.cpp
+++ b/core/pim/addressbook/main.cpp
@@ -1,28 +1,27 @@
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>
24 23
25#include <opie/oapplicationfactory.h> 24#include <opie/oapplicationfactory.h>
26 25
27OPIE_EXPORT_APP( OApplicationFactory<AddressbookWindow> ) 26OPIE_EXPORT_APP( OApplicationFactory<AddressbookWindow> )
28 27
diff --git a/core/pim/addressbook/picker.cpp b/core/pim/addressbook/picker.cpp
index 9e0c78a..7a20591 100644
--- a/core/pim/addressbook/picker.cpp
+++ b/core/pim/addressbook/picker.cpp
@@ -1,52 +1,50 @@
1#include "picker.h" 1#include "picker.h"
2 2
3#include <qfont.h>
4#include <qstring.h>
5#include <qtimer.h> 3#include <qtimer.h>
6#include <qlayout.h> 4#include <qlayout.h>
7 5
8char PickerLabel::lastLetter = '\0'; 6char PickerLabel::lastLetter = '\0';
9 7
10PickerLabel::PickerLabel( QWidget *parent, const char *name ) 8PickerLabel::PickerLabel( QWidget *parent, const char *name )
11 : QLabel ( parent, name ) 9 : QLabel ( parent, name )
12{ 10{
13 currentLetter = 0; 11 currentLetter = 0;
14 //lastLetter = 0; 12 //lastLetter = 0;
15 13
16 letter1 = '\0'; 14 letter1 = '\0';
17 letter2 = '\0'; 15 letter2 = '\0';
18 letter3 = '\0'; 16 letter3 = '\0';
19 17
20 // setFont( QFont( "smallsmooth", 9 ) ); 18 // setFont( QFont( "smallsmooth", 9 ) );
21 setFont( QFont::defaultFont() ); 19 setFont( QFont::defaultFont() );
22 setTextFormat( Qt::RichText ); 20 setTextFormat( Qt::RichText );
23 21
24} 22}
25 23
26PickerLabel::~PickerLabel() 24PickerLabel::~PickerLabel()
27{ 25{
28 26
29} 27}
30 28
31void PickerLabel::setLetters( char ch1, char ch2, char ch3 ) 29void PickerLabel::setLetters( char ch1, char ch2, char ch3 )
32{ 30{
33 QString tmpStr; 31 QString tmpStr;
34 32
35 if (ch1 != '\0') 33 if (ch1 != '\0')
36 letter1 = ch1; 34 letter1 = ch1;
37 else 35 else
38 letter1 = ' '; 36 letter1 = ' ';
39 37
40 if (ch2 != '\0') 38 if (ch2 != '\0')
41 letter2 = ch2; 39 letter2 = ch2;
42 else 40 else
43 letter2 = ' '; 41 letter2 = ' ';
44 42
45 if (ch3 != '\0') 43 if (ch3 != '\0')
46 letter3 = ch3; 44 letter3 = ch3;
47 else 45 else
48 letter3 = ' '; 46 letter3 = ' ';
49 47
50 tmpStr = "<qt>"; 48 tmpStr = "<qt>";
51 tmpStr += letter1; 49 tmpStr += letter1;
52 tmpStr += letter2; 50 tmpStr += letter2;
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 24affd0..af26302 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -1,112 +1,97 @@
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 Qtopia Environment. 4** This file is part of Qtopia 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** $Id$ 19** $Id$
20** 20**
21**********************************************************************/ 21**********************************************************************/
22 22
23#define QTOPIA_INTERNAL_FD 23#define QTOPIA_INTERNAL_FD
24 24
25#include "datebook.h" 25#include "datebook.h"
26#include "datebookday.h" 26#include "datebookday.h"
27#include "datebooksettings.h" 27#include "datebooksettings.h"
28#include "datebookweek.h" 28#include "datebookweek.h"
29#include "datebookweeklst.h" 29#include "datebookweeklst.h"
30#include "dateentryimpl.h" 30#include "dateentryimpl.h"
31 31
32#include <qpe/datebookmonth.h> 32#include <qpe/datebookmonth.h>
33#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34#include <qpe/config.h> 34#include <qpe/config.h>
35#include <qpe/qpedebug.h>
36#include <qpe/event.h>
37#include <qpe/finddialog.h> 35#include <qpe/finddialog.h>
38#include <qpe/ir.h> 36#include <qpe/ir.h>
39#include <qmenubar.h>
40#include <qpe/qpemessagebox.h> 37#include <qpe/qpemessagebox.h>
41#include <qpe/resource.h> 38#include <qpe/resource.h>
42#include <qpe/sound.h> 39#include <qpe/sound.h>
43#include <qpe/timestring.h>
44#include <qtoolbar.h> 40#include <qtoolbar.h>
45#include <qpe/tzselect.h> 41#include <qpe/tzselect.h>
46#include <qpe/xmlreader.h>
47 42
48#include <qaction.h> 43#include <qaction.h>
49#include <qcopchannel_qws.h> 44#include <qcopchannel_qws.h>
50#include <qdatetime.h>
51#include <qdialog.h>
52#include <qfile.h>
53#include <qlabel.h>
54#include <qlayout.h> 45#include <qlayout.h>
55#include <qmessagebox.h> 46#include <qmessagebox.h>
56#include <qpopupmenu.h>
57#include <qpushbutton.h>
58#include <qregexp.h>
59#include <qtextcodec.h>
60#include <qtextstream.h>
61#include <qtimer.h> 47#include <qtimer.h>
62#include <qtl.h> 48#include <qtl.h>
63#include <qwidgetstack.h> 49#include <qwidgetstack.h>
64#include <qwindowsystem_qws.h>
65 50
66#include <sys/stat.h> 51#include <sys/stat.h>
67#include <sys/types.h> 52#include <sys/types.h>
68#include <fcntl.h> 53#include <fcntl.h>
69#include <unistd.h> 54#include <unistd.h>
70 55
71#include <stdlib.h> 56#include <stdlib.h>
72 57
73DateBook::DateBook( QWidget *parent, const char *, WFlags f ) 58DateBook::DateBook( QWidget *parent, const char *, WFlags f )
74 : QMainWindow( parent, "datebook", f ), 59 : QMainWindow( parent, "datebook", f ),
75 aPreset( FALSE ), 60 aPreset( FALSE ),
76 presetTime( -1 ), 61 presetTime( -1 ),
77 startTime( 8 ), // an acceptable default 62 startTime( 8 ), // an acceptable default
78 rowStyle( 0 ), 63 rowStyle( 0 ),
79 bJumpToCurTime(FALSE), 64 bJumpToCurTime(FALSE),
80 syncing(FALSE), 65 syncing(FALSE),
81 inSearch(FALSE), 66 inSearch(FALSE),
82 alarmCounter(0) 67 alarmCounter(0)
83{ 68{
84 bool needEvilHack= false; // if we need an Evil Hack 69 bool needEvilHack= false; // if we need an Evil Hack
85 QTime t; 70 QTime t;
86 t.start(); 71 t.start();
87 db = new DateBookDBHack; 72 db = new DateBookDBHack;
88 qDebug("loading db t=%d", t.elapsed() ); 73 qDebug("loading db t=%d", t.elapsed() );
89 loadSettings(); 74 loadSettings();
90 setCaption( tr("Calendar") ); 75 setCaption( tr("Calendar") );
91 setIcon( Resource::loadPixmap( "datebook_icon" ) ); 76 setIcon( Resource::loadPixmap( "datebook_icon" ) );
92 77
93 setToolBarsMovable( FALSE ); 78 setToolBarsMovable( FALSE );
94 79
95 views = new QWidgetStack( this ); 80 views = new QWidgetStack( this );
96 setCentralWidget( views ); 81 setCentralWidget( views );
97 82
98 dayView = 0; 83 dayView = 0;
99 weekView = 0; 84 weekView = 0;
100 weekLstView = 0; 85 weekLstView = 0;
101 monthView = 0; 86 monthView = 0;
102 87
103// QToolBar *bar = new QToolBar( this ); 88// QToolBar *bar = new QToolBar( this );
104// bar->setHorizontalStretchable( TRUE ); 89// bar->setHorizontalStretchable( TRUE );
105 90
106// QMenuBar *mb = new QMenuBar( bar ); 91// QMenuBar *mb = new QMenuBar( bar );
107// mb->setMargin( 0 ); 92// mb->setMargin( 0 );
108 93
109// QPopupMenu *view = new QPopupMenu( this ); 94// QPopupMenu *view = new QPopupMenu( this );
110// mb->insertItem( tr( "View" ), view ); 95// mb->insertItem( tr( "View" ), view );
111 96
112 QToolBar *sub_bar = new QToolBar(this); 97 QToolBar *sub_bar = new QToolBar(this);
diff --git a/core/pim/datebook/datebookdayallday.cpp b/core/pim/datebook/datebookdayallday.cpp
index 1244fd3..d43d31a 100644
--- a/core/pim/datebook/datebookdayallday.cpp
+++ b/core/pim/datebook/datebookdayallday.cpp
@@ -1,72 +1,62 @@
1/**************************************************************************** 1/****************************************************************************
2** GPL by Rajko Albrecht 2** GPL by Rajko Albrecht
3** 3**
4** 4**
5** 5**
6** 6**
7** 7**
8****************************************************************************/ 8****************************************************************************/
9#include "datebookdayallday.h" 9#include "datebookdayallday.h"
10 10
11#include <qpushbutton.h>
12#include <qlayout.h> 11#include <qlayout.h>
13#include <qvariant.h>
14#include <qtooltip.h>
15#include <qwhatsthis.h>
16#include <qobjectlist.h>
17#include <qpe/event.h>
18#include <qpe/ir.h> 12#include <qpe/ir.h>
19#include <qpe/datebookdb.h>
20#include <qpe/resource.h>
21#include <qpopupmenu.h> 13#include <qpopupmenu.h>
22#include <qtimer.h> 14#include <qtimer.h>
23#include <qregexp.h>
24#include <qdatetime.h>
25 15
26#include "datebookday.h" 16#include "datebookday.h"
27 17
28/* 18/*
29 * Constructs a DatebookdayAllday which is a child of 'parent', with the 19 * Constructs a DatebookdayAllday which is a child of 'parent', with the
30 * name 'name' and widget flags set to 'f' 20 * name 'name' and widget flags set to 'f'
31 */ 21 */
32DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags ) 22DatebookdayAllday::DatebookdayAllday(DateBookDB* db, QWidget* parent, const char* name, WFlags )
33 : QScrollView( parent, name ),item_count(0),dateBook(db) 23 : QScrollView( parent, name ),item_count(0),dateBook(db)
34{ 24{
35 if ( !name ) 25 if ( !name )
36 setName( "DatebookdayAllday" ); 26 setName( "DatebookdayAllday" );
37 setMinimumSize( QSize( 0, 0 ) ); 27 setMinimumSize( QSize( 0, 0 ) );
38 setMaximumHeight(3* (QFontMetrics(font()).height()+4) ); 28 setMaximumHeight(3* (QFontMetrics(font()).height()+4) );
39 29
40 m_MainFrame = new QFrame(viewport()); 30 m_MainFrame = new QFrame(viewport());
41 m_MainFrame->setFrameStyle(QFrame::NoFrame|QFrame::Plain); 31 m_MainFrame->setFrameStyle(QFrame::NoFrame|QFrame::Plain);
42 setFrameStyle(QFrame::NoFrame|QFrame::Plain); 32 setFrameStyle(QFrame::NoFrame|QFrame::Plain);
43 setResizePolicy( QScrollView::Default ); 33 setResizePolicy( QScrollView::Default );
44 setHScrollBarMode( AlwaysOff ); 34 setHScrollBarMode( AlwaysOff );
45 addChild(m_MainFrame); 35 addChild(m_MainFrame);
46 36
47 datebookdayalldayLayout = new QVBoxLayout( m_MainFrame ); 37 datebookdayalldayLayout = new QVBoxLayout( m_MainFrame );
48 datebookdayalldayLayout->setSpacing( 0 ); 38 datebookdayalldayLayout->setSpacing( 0 );
49 datebookdayalldayLayout->setMargin( 0 ); 39 datebookdayalldayLayout->setMargin( 0 );
50 40
51 lblDesc = new DatebookEventDesc(parent->parentWidget(),""); 41 lblDesc = new DatebookEventDesc(parent->parentWidget(),"");
52 lblDesc->setBackgroundColor(Qt::yellow); 42 lblDesc->setBackgroundColor(Qt::yellow);
53 lblDesc->hide(); 43 lblDesc->hide();
54 subWidgets.setAutoDelete(true); 44 subWidgets.setAutoDelete(true);
55} 45}
56 46
57/* 47/*
58 * Destroys the object and frees any allocated resources 48 * Destroys the object and frees any allocated resources
59 */ 49 */
60DatebookdayAllday::~DatebookdayAllday() 50DatebookdayAllday::~DatebookdayAllday()
61{ 51{
62 // no need to delete child widgets, Qt does it all for us 52 // no need to delete child widgets, Qt does it all for us
63} 53}
64 54
65DatebookAlldayDisp* DatebookdayAllday::addEvent(const EffectiveEvent&ev) 55DatebookAlldayDisp* DatebookdayAllday::addEvent(const EffectiveEvent&ev)
66{ 56{
67 DatebookAlldayDisp * lb; 57 DatebookAlldayDisp * lb;
68 lb = new DatebookAlldayDisp(dateBook,ev,m_MainFrame,NULL); 58 lb = new DatebookAlldayDisp(dateBook,ev,m_MainFrame,NULL);
69 lb->show(); 59 lb->show();
70 datebookdayalldayLayout->addWidget(lb); 60 datebookdayalldayLayout->addWidget(lb);
71 subWidgets.append(lb); 61 subWidgets.append(lb);
72 62
diff --git a/core/pim/datebook/datebookdayheaderimpl.cpp b/core/pim/datebook/datebookdayheaderimpl.cpp
index 3e965f5..213c843 100644
--- a/core/pim/datebook/datebookdayheaderimpl.cpp
+++ b/core/pim/datebook/datebookdayheaderimpl.cpp
@@ -1,77 +1,73 @@
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 Qtopia Environment. 4** This file is part of Qtopia 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#include "datebookdayheaderimpl.h" 20#include "datebookdayheaderimpl.h"
21 21
22#include <qpe/datebookmonth.h> 22#include <qpe/datebookmonth.h>
23#include <qpe/resource.h> 23#include <qpe/resource.h>
24#include <qpe/timestring.h>
25 24
26#include <qbuttongroup.h> 25#include <qbuttongroup.h>
27#include <qpopupmenu.h>
28#include <qstringlist.h>
29#include <qtimer.h>
30#include <qtoolbutton.h> 26#include <qtoolbutton.h>
31 27
32 28
33/* 29/*
34 * Constructs a DateBookDayHeader which is a child of 'parent', with the 30 * Constructs a DateBookDayHeader which is a child of 'parent', with the
35 * name 'name' and widget flags set to 'f' 31 * name 'name' and widget flags set to 'f'
36 * 32 *
37 * The dialog will by default be modeless, unless you set 'modal' to 33 * The dialog will by default be modeless, unless you set 'modal' to
38 * TRUE to construct a modal dialog. 34 * TRUE to construct a modal dialog.
39 */ 35 */
40DateBookDayHeader::DateBookDayHeader( bool useMonday, 36DateBookDayHeader::DateBookDayHeader( bool useMonday,
41 QWidget* parent, const char* name ) 37 QWidget* parent, const char* name )
42 : DateBookDayHeaderBase( parent, name ), 38 : DateBookDayHeaderBase( parent, name ),
43 bUseMonday( useMonday ) 39 bUseMonday( useMonday )
44{ 40{
45 connect(date,SIGNAL(pressed()),this,SLOT(pickDate())); 41 connect(date,SIGNAL(pressed()),this,SLOT(pickDate()));
46 42
47 setupNames(); 43 setupNames();
48 44
49 forward->setPixmap( Resource::loadPixmap( "forward" ) ); 45 forward->setPixmap( Resource::loadPixmap( "forward" ) );
50 back->setPixmap( Resource::loadPixmap( "back" ) ); 46 back->setPixmap( Resource::loadPixmap( "back" ) );
51 forwardweek->setPixmap( Resource::loadPixmap( "fastforward" ) ); 47 forwardweek->setPixmap( Resource::loadPixmap( "fastforward" ) );
52 backweek->setPixmap( Resource::loadPixmap( "fastback" ) ); 48 backweek->setPixmap( Resource::loadPixmap( "fastback" ) );
53 49
54 setBackgroundMode( PaletteButton ); 50 setBackgroundMode( PaletteButton );
55 grpDays->setBackgroundMode( PaletteButton ); 51 grpDays->setBackgroundMode( PaletteButton );
56} 52}
57 53
58/* 54/*
59 * Destroys the object and frees any allocated resources 55 * Destroys the object and frees any allocated resources
60 */ 56 */
61DateBookDayHeader::~DateBookDayHeader() 57DateBookDayHeader::~DateBookDayHeader()
62{ 58{
63 // no need to delete child widgets, Qt does it all for us 59 // no need to delete child widgets, Qt does it all for us
64} 60}
65 61
66void DateBookDayHeader::setStartOfWeek( bool onMonday ) 62void DateBookDayHeader::setStartOfWeek( bool onMonday )
67{ 63{
68 bUseMonday = onMonday; 64 bUseMonday = onMonday;
69 setupNames(); 65 setupNames();
70 setDate( currDate.year(), currDate.month(), currDate.day() ); 66 setDate( currDate.year(), currDate.month(), currDate.day() );
71} 67}
72 68
73void DateBookDayHeader::setupNames() 69void DateBookDayHeader::setupNames()
74{ 70{
75 if ( bUseMonday ) { 71 if ( bUseMonday ) {
76 cmdDay1->setText( DateBookDayHeaderBase::tr("Monday").left(1) ); 72 cmdDay1->setText( DateBookDayHeaderBase::tr("Monday").left(1) );
77 cmdDay2->setText( DateBookDayHeaderBase::tr("Tuesday").left(1) ); 73 cmdDay2->setText( DateBookDayHeaderBase::tr("Tuesday").left(1) );
diff --git a/core/pim/datebook/datebooksettings.cpp b/core/pim/datebook/datebooksettings.cpp
index 675b17f..a6d04ba 100644
--- a/core/pim/datebook/datebooksettings.cpp
+++ b/core/pim/datebook/datebooksettings.cpp
@@ -1,75 +1,74 @@
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 Qtopia Environment. 4** This file is part of Qtopia 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 "datebooksettings.h" 21#include "datebooksettings.h"
22 22
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24 24
25#include <qspinbox.h> 25#include <qspinbox.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qcombobox.h>
28 27
29DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent, 28DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent,
30 const char *name, bool modal, WFlags fl ) 29 const char *name, bool modal, WFlags fl )
31 : DateBookSettingsBase( parent, name, modal, fl ), 30 : DateBookSettingsBase( parent, name, modal, fl ),
32 ampm( whichClock ) 31 ampm( whichClock )
33{ 32{
34 init(); 33 init();
35 QObject::connect( qApp, SIGNAL( clockChanged( bool ) ), this, SLOT( slotChangeClock( bool ) ) ); 34 QObject::connect( qApp, SIGNAL( clockChanged( bool ) ), this, SLOT( slotChangeClock( bool ) ) );
36 QArray<int> categories; 35 QArray<int> categories;
37 comboCategory->setCategories( categories, "Calendar", tr("Calendar") ); 36 comboCategory->setCategories( categories, "Calendar", tr("Calendar") );
38} 37}
39 38
40DateBookSettings::~DateBookSettings() 39DateBookSettings::~DateBookSettings()
41{ 40{
42} 41}
43 42
44void DateBookSettings::setStartTime( int newStartViewTime ) 43void DateBookSettings::setStartTime( int newStartViewTime )
45{ 44{
46 if ( ampm ) { 45 if ( ampm ) {
47 if ( newStartViewTime >= 12 ) { 46 if ( newStartViewTime >= 12 ) {
48 newStartViewTime %= 12; 47 newStartViewTime %= 12;
49 if ( newStartViewTime == 0 ) 48 if ( newStartViewTime == 0 )
50 newStartViewTime = 12; 49 newStartViewTime = 12;
51 spinStart->setSuffix( tr(":00 PM") ); 50 spinStart->setSuffix( tr(":00 PM") );
52 } 51 }
53 else if ( newStartViewTime == 0 ) { 52 else if ( newStartViewTime == 0 ) {
54 newStartViewTime = 12; 53 newStartViewTime = 12;
55 spinStart->setSuffix( tr(":00 AM") ); 54 spinStart->setSuffix( tr(":00 AM") );
56 } 55 }
57 oldtime = newStartViewTime; 56 oldtime = newStartViewTime;
58 } 57 }
59 spinStart->setValue( newStartViewTime ); 58 spinStart->setValue( newStartViewTime );
60} 59}
61 60
62int DateBookSettings::startTime() const 61int DateBookSettings::startTime() const
63{ 62{
64 int returnMe = spinStart->value(); 63 int returnMe = spinStart->value();
65 if ( ampm ) { 64 if ( ampm ) {
66 if ( returnMe != 12 && spinStart->suffix().contains(tr("PM"), FALSE) ) 65 if ( returnMe != 12 && spinStart->suffix().contains(tr("PM"), FALSE) )
67 returnMe += 12; 66 returnMe += 12;
68 else if (returnMe == 12 && spinStart->suffix().contains(tr("AM"), TRUE)) 67 else if (returnMe == 12 && spinStart->suffix().contains(tr("AM"), TRUE))
69 returnMe = 0; 68 returnMe = 0;
70 } 69 }
71 return returnMe; 70 return returnMe;
72} 71}
73 72
74 73
75void DateBookSettings::setAlarmPreset( bool bAlarm, int presetTime ) 74void DateBookSettings::setAlarmPreset( bool bAlarm, int presetTime )
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index 84b4f1b..eaa9730 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -1,73 +1,69 @@
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 Qtopia Environment. 4** This file is part of Qtopia 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#include "datebookweekheaderimpl.h" 20#include "datebookweekheaderimpl.h"
21#include "datebookweekheader.h"
22#include "datebookweek.h" 21#include "datebookweek.h"
23#include <qlabel.h>
24#include <qspinbox.h>
25#include <qdatetime.h>
26#include <qpe/resource.h> 22#include <qpe/resource.h>
27#include <qpe/datebookmonth.h> 23#include <qpe/datebookmonth.h>
28 24
29#include <qtoolbutton.h> 25#include <qtoolbutton.h>
30 26
31/* 27/*
32 * Constructs a DateBookWeekHeader which is a child of 'parent', with the 28 * Constructs a DateBookWeekHeader which is a child of 'parent', with the
33 * name 'name' and widget flags set to 'f' 29 * name 'name' and widget flags set to 'f'
34 */ 30 */
35DateBookWeekHeader::DateBookWeekHeader( bool startOnMonday, QWidget* parent, const char* name, WFlags fl ) 31DateBookWeekHeader::DateBookWeekHeader( bool startOnMonday, QWidget* parent, const char* name, WFlags fl )
36 : DateBookWeekHeaderBase( parent, name, fl ), 32 : DateBookWeekHeaderBase( parent, name, fl ),
37 bStartOnMonday( startOnMonday ) 33 bStartOnMonday( startOnMonday )
38{ 34{
39 setBackgroundMode( PaletteButton ); 35 setBackgroundMode( PaletteButton );
40 labelDate->setBackgroundMode( PaletteButton ); 36 labelDate->setBackgroundMode( PaletteButton );
41 backmonth->setPixmap( Resource::loadPixmap("fastback") ); 37 backmonth->setPixmap( Resource::loadPixmap("fastback") );
42 backweek->setPixmap( Resource::loadPixmap("back") ); 38 backweek->setPixmap( Resource::loadPixmap("back") );
43 forwardweek->setPixmap( Resource::loadPixmap("forward") ); 39 forwardweek->setPixmap( Resource::loadPixmap("forward") );
44 forwardmonth->setPixmap( Resource::loadPixmap("fastforward") ); 40 forwardmonth->setPixmap( Resource::loadPixmap("fastforward") );
45} 41}
46 42
47/* 43/*
48 * Destroys the object and frees any allocated resources 44 * Destroys the object and frees any allocated resources
49 */ 45 */
50DateBookWeekHeader::~DateBookWeekHeader() 46DateBookWeekHeader::~DateBookWeekHeader()
51{ 47{
52 // no need to delete child widgets, Qt does it all for us 48 // no need to delete child widgets, Qt does it all for us
53} 49}
54 50
55void DateBookWeekHeader::pickDate() 51void DateBookWeekHeader::pickDate()
56{ 52{
57 static QPopupMenu *m1 = 0; 53 static QPopupMenu *m1 = 0;
58 static DateBookMonth *picker = 0; 54 static DateBookMonth *picker = 0;
59 if ( !m1 ) { 55 if ( !m1 ) {
60 m1 = new QPopupMenu( this ); 56 m1 = new QPopupMenu( this );
61 picker = new DateBookMonth( m1, 0, TRUE ); 57 picker = new DateBookMonth( m1, 0, TRUE );
62 m1->insertItem( picker ); 58 m1->insertItem( picker );
63 connect( picker, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( setDate( int, int, int ) ) ); 59 connect( picker, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( setDate( int, int, int ) ) );
64 // connect( m1, SIGNAL( aboutToHide() ), this, SLOT( gotHide() ) ); 60 // connect( m1, SIGNAL( aboutToHide() ), this, SLOT( gotHide() ) );
65 } 61 }
66 picker->setDate( date.year(), date.month(), date.day() ); 62 picker->setDate( date.year(), date.month(), date.day() );
67 m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height()))); 63 m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height())));
68 picker->setFocus(); 64 picker->setFocus();
69} 65}
70 66
71void DateBookWeekHeader::nextMonth() 67void DateBookWeekHeader::nextMonth()
72{ 68{
73 qWarning("nextMonth() " ); 69 qWarning("nextMonth() " );
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 24fb0ba..42a1753 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -1,57 +1,56 @@
1#include "datebookweeklst.h" 1#include "datebookweeklst.h"
2 2
3 3
4#include "datebook.h" 4#include "datebook.h"
5 5
6#include <qpe/datebookmonth.h> 6#include <qpe/datebookmonth.h>
7#include <qpe/config.h> 7#include <qpe/config.h>
8#include <qpe/resource.h> 8#include <qpe/resource.h>
9#include <qpe/calendar.h>
10 9
11#include <qlayout.h> 10#include <qlayout.h>
12#include <qtoolbutton.h> 11#include <qtoolbutton.h>
13#include <qtl.h> 12#include <qtl.h>
14 13
15bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false); 14bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false);
16 15
17DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) 16DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl)
18 : DateBookWeekLstHeaderBase(parent, name, fl) 17 : DateBookWeekLstHeaderBase(parent, name, fl)
19{ 18{
20 setBackgroundMode( PaletteButton ); 19 setBackgroundMode( PaletteButton );
21 labelDate->setBackgroundMode( PaletteButton ); 20 labelDate->setBackgroundMode( PaletteButton );
22 forwardweek->setBackgroundMode( PaletteButton ); 21 forwardweek->setBackgroundMode( PaletteButton );
23 forwardweek->setPixmap( Resource::loadPixmap("forward") ); 22 forwardweek->setPixmap( Resource::loadPixmap("forward") );
24 forwardmonth->setBackgroundMode( PaletteButton ); 23 forwardmonth->setBackgroundMode( PaletteButton );
25 forwardmonth->setPixmap( Resource::loadPixmap("fastforward") ); 24 forwardmonth->setPixmap( Resource::loadPixmap("fastforward") );
26 backweek->setBackgroundMode( PaletteButton ); 25 backweek->setBackgroundMode( PaletteButton );
27 backweek->setPixmap( Resource::loadPixmap("back") ); 26 backweek->setPixmap( Resource::loadPixmap("back") );
28 backmonth->setBackgroundMode( PaletteButton ); 27 backmonth->setBackgroundMode( PaletteButton );
29 backmonth->setPixmap( Resource::loadPixmap("fastback") ); 28 backmonth->setPixmap( Resource::loadPixmap("fastback") );
30 DateBookWeekLstHeaderBaseLayout->setSpacing(0); 29 DateBookWeekLstHeaderBaseLayout->setSpacing(0);
31 DateBookWeekLstHeaderBaseLayout->setMargin(0); 30 DateBookWeekLstHeaderBaseLayout->setMargin(0);
32 //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding)); 31 //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding));
33 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); 32 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed));
34 33
35 connect(backmonth, SIGNAL(clicked()), this, SLOT(prevMonth())); 34 connect(backmonth, SIGNAL(clicked()), this, SLOT(prevMonth()));
36 connect(backweek, SIGNAL(clicked()), this, SLOT(prevWeek())); 35 connect(backweek, SIGNAL(clicked()), this, SLOT(prevWeek()));
37 connect(forwardweek, SIGNAL(clicked()), this, SLOT(nextWeek())); 36 connect(forwardweek, SIGNAL(clicked()), this, SLOT(nextWeek()));
38 connect(forwardmonth, SIGNAL(clicked()), this, SLOT(nextMonth())); 37 connect(forwardmonth, SIGNAL(clicked()), this, SLOT(nextMonth()));
39 connect(labelDate, SIGNAL(clicked()), this, SLOT(pickDate())); 38 connect(labelDate, SIGNAL(clicked()), this, SLOT(pickDate()));
40 connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); 39 connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool)));
41 bStartOnMonday=onM; 40 bStartOnMonday=onM;
42} 41}
43DateBookWeekLstHeader::~DateBookWeekLstHeader(){} 42DateBookWeekLstHeader::~DateBookWeekLstHeader(){}
44 43
45void DateBookWeekLstHeader::setDate(const QDate &d) { 44void DateBookWeekLstHeader::setDate(const QDate &d) {
46 int year,week,dayofweek; 45 int year,week,dayofweek;
47 date=d; 46 date=d;
48 dayofweek=d.dayOfWeek(); 47 dayofweek=d.dayOfWeek();
49 if(bStartOnMonday) 48 if(bStartOnMonday)
50 dayofweek--; 49 dayofweek--;
51 else if( dayofweek == 7 ) 50 else if( dayofweek == 7 )
52 /* we already have the right day -7 would lead to the same week */ 51 /* we already have the right day -7 would lead to the same week */
53 dayofweek = 0; 52 dayofweek = 0;
54 53
55 date=date.addDays(-dayofweek); 54 date=date.addDays(-dayofweek);
56 55
57 calcWeek(date,week,year,bStartOnMonday); 56 calcWeek(date,week,year,bStartOnMonday);
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index 856837c..018bb5a 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -1,89 +1,78 @@
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 Qtopia Environment. 4** This file is part of Qtopia 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 "dateentryimpl.h" 21#include "dateentryimpl.h"
22#include "repeatentry.h" 22#include "repeatentry.h"
23 23
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/categoryselect.h> 25#include <qpe/categoryselect.h>
26#include <qpe/datebookmonth.h> 26#include <qpe/datebookmonth.h>
27#include <qpe/global.h>
28#include <qpe/timeconversion.h>
29#include <qpe/timestring.h>
30#include <qpe/tzselect.h> 27#include <qpe/tzselect.h>
31 28
32#include <qevent.h>
33#include <qcheckbox.h>
34#include <qcombobox.h>
35#include <qlayout.h>
36#include <qlineedit.h> 29#include <qlineedit.h>
37#include <qmultilineedit.h>
38#include <qpopupmenu.h>
39#include <qscrollview.h>
40#include <qspinbox.h> 30#include <qspinbox.h>
41#include <qtoolbutton.h>
42 31
43#include <opie/otimepicker.h> 32#include <opie/otimepicker.h>
44#include "onoteedit.h" 33#include "onoteedit.h"
45 34
46#include <stdlib.h> 35#include <stdlib.h>
47#include <stdio.h> 36#include <stdio.h>
48 37
49/* 38/*
50 * Constructs a DateEntry which is a child of 'parent', with the 39 * Constructs a DateEntry which is a child of 'parent', with the
51 * name 'name' and widget flags set to 'f' 40 * name 'name' and widget flags set to 'f'
52 * 41 *
53 * The dialog will by default be modeless, unless you set 'modal' to 42 * The dialog will by default be modeless, unless you set 'modal' to
54 * TRUE to construct a modal dialog. 43 * TRUE to construct a modal dialog.
55 */ 44 */
56 45
57DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, 46DateEntry::DateEntry( bool startOnMonday, const QDateTime &start,
58 const QDateTime &end, bool whichClock, QWidget* parent, 47 const QDateTime &end, bool whichClock, QWidget* parent,
59 const char* name ) 48 const char* name )
60 : DateEntryBase( parent, name ), 49 : DateEntryBase( parent, name ),
61 ampm( whichClock ), 50 ampm( whichClock ),
62 startWeekOnMonday( startOnMonday ), 51 startWeekOnMonday( startOnMonday ),
63 m_showStart(true) 52 m_showStart(true)
64{ 53{
65 init(); 54 init();
66 setDates(start,end); 55 setDates(start,end);
67 setFocusProxy(comboDescription); 56 setFocusProxy(comboDescription);
68} 57}
69 58
70bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) 59bool DateEntry::eventFilter(QObject *obj, QEvent *ev )
71{ 60{
72 if( ev->type() == QEvent::FocusIn ){ 61 if( ev->type() == QEvent::FocusIn ){
73 if( obj == comboStart ){ 62 if( obj == comboStart ){
74 timePickerStart->setHour(startTime.hour()); 63 timePickerStart->setHour(startTime.hour());
75 timePickerStart->setMinute(startTime.minute()); 64 timePickerStart->setMinute(startTime.minute());
76 TimePickerLabel->setText( tr("Start Time" ) ); 65 TimePickerLabel->setText( tr("Start Time" ) );
77 m_showStart= true; 66 m_showStart= true;
78 }else if( obj == comboEnd ){ 67 }else if( obj == comboEnd ){
79 timePickerStart->setHour(endTime.hour()); 68 timePickerStart->setHour(endTime.hour());
80 timePickerStart->setMinute(endTime.minute()); 69 timePickerStart->setMinute(endTime.minute());
81 TimePickerLabel->setText( tr("End Time") ); 70 TimePickerLabel->setText( tr("End Time") );
82 m_showStart = false; 71 m_showStart = false;
83 } 72 }
84 } else if( ev->type() == QEvent::FocusOut ){ 73 } else if( ev->type() == QEvent::FocusOut ){
85// if( obj == comboEnd ){ 74// if( obj == comboEnd ){
86// QString s; 75// QString s;
87// s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute()); 76// s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute());
88// comboEnd->setText(s); 77// comboEnd->setText(s);
89// } 78// }
diff --git a/core/pim/datebook/main.cpp b/core/pim/datebook/main.cpp
index 8004690..421e457 100644
--- a/core/pim/datebook/main.cpp
+++ b/core/pim/datebook/main.cpp
@@ -1,25 +1,24 @@
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 Qtopia Environment. 4** This file is part of Qtopia 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 "datebook.h" 21#include "datebook.h"
22#include <qpe/qpeapplication.h>
23#include <opie/oapplicationfactory.h> 22#include <opie/oapplicationfactory.h>
24 23
25OPIE_EXPORT_APP( OApplicationFactory<DateBook> ) 24OPIE_EXPORT_APP( OApplicationFactory<DateBook> )
diff --git a/core/pim/datebook/noteentryimpl.cpp b/core/pim/datebook/noteentryimpl.cpp
index 0e45985..14fe98e 100644
--- a/core/pim/datebook/noteentryimpl.cpp
+++ b/core/pim/datebook/noteentryimpl.cpp
@@ -1,17 +1,15 @@
1#include "noteentryimpl.h" 1#include "noteentryimpl.h"
2#include "qstring.h"
3#include "qmultilinedit.h"
4#include "qlabel.h" 2#include "qlabel.h"
5#include "onoteedit.h" 3#include "onoteedit.h"
6 4
7NoteEntry::NoteEntry(const QString &title, const QString &noteStr, 5NoteEntry::NoteEntry(const QString &title, const QString &noteStr,
8 QWidget* parent, const char* name, bool modal, 6 QWidget* parent, const char* name, bool modal,
9 WFlags fl) : 7 WFlags fl) :
10 NoteEntryBase(parent, name, modal, fl) { 8 NoteEntryBase(parent, name, modal, fl) {
11 9
12 10
13 eventLabel->setText(title); 11 eventLabel->setText(title);
14 note->setText(noteStr); 12 note->setText(noteStr);
15 int l=note->length(); 13 int l=note->length();
16 note->setCursorPosition(l,l,false); 14 note->setCursorPosition(l,l,false);
17} 15}
diff --git a/core/pim/datebook/repeatentry.cpp b/core/pim/datebook/repeatentry.cpp
index b1a162d..7cf36da 100644
--- a/core/pim/datebook/repeatentry.cpp
+++ b/core/pim/datebook/repeatentry.cpp
@@ -1,79 +1,75 @@
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 Qtopia Environment. 4** This file is part of Qtopia 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 "repeatentry.h" 21#include "repeatentry.h"
22 22
23#include <qpe/datebookmonth.h> 23#include <qpe/datebookmonth.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/timestring.h>
26 25
27#include <qbuttongroup.h>
28#include <qlabel.h> 26#include <qlabel.h>
29#include <qpopupmenu.h>
30#include <qspinbox.h> 27#include <qspinbox.h>
31#include <qtoolbutton.h>
32 28
33#include <time.h> 29#include <time.h>
34 30
35// Global Templates for use in setting up the repeat label... 31// Global Templates for use in setting up the repeat label...
36// the problem is these strings get initialized before QPEApplication can install the translator -zecke 32// the problem is these strings get initialized before QPEApplication can install the translator -zecke
37namespace { 33namespace {
38QString strDayTemplate; 34QString strDayTemplate;
39QString strYearTemplate; 35QString strYearTemplate;
40QString strMonthDateTemplate; 36QString strMonthDateTemplate;
41QString strMonthDayTemplate; 37QString strMonthDayTemplate;
42QString strWeekTemplate; 38QString strWeekTemplate;
43QString dayLabel[7]; 39QString dayLabel[7];
44} 40}
45 41
46/* 42/*
47 * static linkage to not polute the symbol table... 43 * static linkage to not polute the symbol table...
48 * The problem is that const and static linkage are resolved prior to installing a translator 44 * The problem is that const and static linkage are resolved prior to installing a translator
49 * leading to that the above strings are translted but to the original we delay the init of these strings... 45 * leading to that the above strings are translted but to the original we delay the init of these strings...
50 * -zecke 46 * -zecke
51 */ 47 */
52static void fillStrings() { 48static void fillStrings() {
53 strDayTemplate = QObject::tr("Every"); 49 strDayTemplate = QObject::tr("Every");
54 strYearTemplate = QObject::tr("%1 %2 every "); 50 strYearTemplate = QObject::tr("%1 %2 every ");
55 strMonthDateTemplate = QObject::tr("The %1 every "); 51 strMonthDateTemplate = QObject::tr("The %1 every ");
56 strMonthDayTemplate = QObject::tr("The %1 %1 of every"); 52 strMonthDayTemplate = QObject::tr("The %1 %1 of every");
57 strWeekTemplate = QObject::tr("Every "); 53 strWeekTemplate = QObject::tr("Every ");
58 dayLabel[0] = QObject::tr("Monday"); 54 dayLabel[0] = QObject::tr("Monday");
59 dayLabel[1] = QObject::tr("Tuesday"); 55 dayLabel[1] = QObject::tr("Tuesday");
60 dayLabel[2] = QObject::tr("Wednesday"); 56 dayLabel[2] = QObject::tr("Wednesday");
61 dayLabel[3] = QObject::tr("Thursday"); 57 dayLabel[3] = QObject::tr("Thursday");
62 dayLabel[4] = QObject::tr("Friday"); 58 dayLabel[4] = QObject::tr("Friday");
63 dayLabel[5] = QObject::tr("Saturday"); 59 dayLabel[5] = QObject::tr("Saturday");
64 dayLabel[6] = QObject::tr("Sunday"); 60 dayLabel[6] = QObject::tr("Sunday");
65} 61}
66 62
67 static QString numberPlacing( int x );// return the proper word format for 63 static QString numberPlacing( int x );// return the proper word format for
68 // x (1st, 2nd, etc) 64 // x (1st, 2nd, etc)
69static int week( const QDate &dt ); // what week in the month is dt? 65static int week( const QDate &dt ); // what week in the month is dt?
70 66
71RepeatEntry::RepeatEntry( bool startOnMonday, 67RepeatEntry::RepeatEntry( bool startOnMonday,
72 const QDate &newStart, QWidget *parent, 68 const QDate &newStart, QWidget *parent,
73 const char *name, bool modal, WFlags fl ) 69 const char *name, bool modal, WFlags fl )
74 : RepeatEntryBase( parent, name, modal, fl ), 70 : RepeatEntryBase( parent, name, modal, fl ),
75 start( newStart ), 71 start( newStart ),
76 currInterval( NONE ), 72 currInterval( NONE ),
77 startWeekOnMonday( startOnMonday ) 73 startWeekOnMonday( startOnMonday )
78{ 74{
79 if (strDayTemplate.isEmpty() ) 75 if (strDayTemplate.isEmpty() )
diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp
index dbd6df6..6891f03 100644
--- a/core/pim/osearch/adresssearch.cpp
+++ b/core/pim/osearch/adresssearch.cpp
@@ -1,61 +1,59 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "adresssearch.h" 13#include "adresssearch.h"
14#include "contactitem.h" 14#include "contactitem.h"
15 15
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17 17
18#include <qstring.h>
19#include <qiconset.h>
20//#include <qwhatsthis.h> 18//#include <qwhatsthis.h>
21 19
22AdressSearch::AdressSearch(QListView* parent, QString name): 20AdressSearch::AdressSearch(QListView* parent, QString name):
23 SearchGroup(parent, name) 21 SearchGroup(parent, name)
24{ 22{
25 _contacts = 0; 23 _contacts = 0;
26 QIconSet is = Resource::loadIconSet( "addressbook/AddressBookSmall" ); 24 QIconSet is = Resource::loadIconSet( "addressbook/AddressBookSmall" );
27 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 25 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
28 26
29 27
30 //QWhatsThis::add( this, QObject::tr("Search the addressbook") ); 28 //QWhatsThis::add( this, QObject::tr("Search the addressbook") );
31 /*QPixmap pix = Resource::loadPixmap( "addressbook/AddressBook" ); 29 /*QPixmap pix = Resource::loadPixmap( "addressbook/AddressBook" );
32 QImage img = pix.convertToImage(); 30 QImage img = pix.convertToImage();
33 img.smoothScale( 14, 14 ); 31 img.smoothScale( 14, 14 );
34 pix.convertFromImage( img ); 32 pix.convertFromImage( img );
35 setPixmap( 0, pix );*/ 33 setPixmap( 0, pix );*/
36} 34}
37 35
38 36
39AdressSearch::~AdressSearch() 37AdressSearch::~AdressSearch()
40{ 38{
41 delete _contacts; 39 delete _contacts;
42} 40}
43 41
44void AdressSearch::load() 42void AdressSearch::load()
45{ 43{
46 _contacts = new OPimContactAccess("osearch"); 44 _contacts = new OPimContactAccess("osearch");
47} 45}
48 46
49int AdressSearch::search() 47int AdressSearch::search()
50{ 48{
51 OPimRecordList<OPimContact> results = _contacts->matchRegexp(_search); 49 OPimRecordList<OPimContact> results = _contacts->matchRegexp(_search);
52 for (uint i = 0; i < results.count(); i++) { 50 for (uint i = 0; i < results.count(); i++) {
53 (void)new ContactItem( this, new OPimContact( results[i] )); 51 (void)new ContactItem( this, new OPimContact( results[i] ));
54 } 52 }
55 return results.count(); 53 return results.count();
56} 54}
57 55
58void AdressSearch::insertItem( void* ) 56void AdressSearch::insertItem( void* )
59{ 57{
60 58
61} 59}
diff --git a/core/pim/osearch/applnkitem.cpp b/core/pim/osearch/applnkitem.cpp
index 06c2b1e..19e765e 100644
--- a/core/pim/osearch/applnkitem.cpp
+++ b/core/pim/osearch/applnkitem.cpp
@@ -1,61 +1,60 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "applnkitem.h" 13#include "applnkitem.h"
14 14
15#include <qpe/applnk.h> 15#include <qpe/applnk.h>
16#include <qpe/qcopenvelope_qws.h> 16#include <qpe/qcopenvelope_qws.h>
17 17
18#include <qfileinfo.h>
19 18
20AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) 19AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app)
21 : ResultItem(parent) 20 : ResultItem(parent)
22{ 21{
23 _app = app; 22 _app = app;
24 setText(0, _app->name() ); 23 setText(0, _app->name() );
25 setPixmap(0, _app->pixmap() ); 24 setPixmap(0, _app->pixmap() );
26} 25}
27 26
28 27
29AppLnkItem::~AppLnkItem() 28AppLnkItem::~AppLnkItem()
30{ 29{
31} 30}
32 31
33 32
34QString AppLnkItem::toRichText() 33QString AppLnkItem::toRichText()
35{ 34{
36 QString text; 35 QString text;
37 text += "<b><h3>" + _app->name() + "</b></h3><br>"; 36 text += "<b><h3>" + _app->name() + "</b></h3><br>";
38 text += _app->comment() + "<br>"; 37 text += _app->comment() + "<br>";
39 text += "<br>`" + _app->exec() + "`<br>"; 38 text += "<br>`" + _app->exec() + "`<br>";
40 text += "<br>`" + _app->file() + "`<br>"; 39 text += "<br>`" + _app->file() + "`<br>";
41 text += "<br>`" + _app->linkFile() + "`<br>"; 40 text += "<br>`" + _app->linkFile() + "`<br>";
42 return text; 41 return text;
43} 42}
44 43
45void AppLnkItem::action( int act ) 44void AppLnkItem::action( int act )
46{ 45{
47 if (!_app->isValid()) qDebug("INVALID"); 46 if (!_app->isValid()) qDebug("INVALID");
48 if (act == 0) _app->execute(); 47 if (act == 0) _app->execute();
49 else if (act == 1){ 48 else if (act == 1){
50 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); 49 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)");
51 e << _app->linkFile(); 50 e << _app->linkFile();
52 } 51 }
53} 52}
54 53
55QIntDict<QString> AppLnkItem::actions() 54QIntDict<QString> AppLnkItem::actions()
56{ 55{
57 QIntDict<QString> result; 56 QIntDict<QString> result;
58 result.insert( 0, new QString( QObject::tr("execute") ) ); 57 result.insert( 0, new QString( QObject::tr("execute") ) );
59 result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); 58 result.insert( 1, new QString( QObject::tr("open in filemanager") ) );
60 return result; 59 return result;
61} 60}
diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp
index 1c84d66..758baf2 100644
--- a/core/pim/osearch/applnksearch.cpp
+++ b/core/pim/osearch/applnksearch.cpp
@@ -1,68 +1,67 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "applnksearch.h" 13#include "applnksearch.h"
14#include "applnkitem.h" 14#include "applnkitem.h"
15 15
16#include <qpe/applnk.h> 16#include <qpe/applnk.h>
17#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
18#include <qpe/resource.h> 18#include <qpe/resource.h>
19 19
20#include <qiconset.h>
21 20
22AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name) 21AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name)
23{ 22{
24 _apps = 0; 23 _apps = 0;
25 QIconSet is = Resource::loadIconSet( "osearch/applicationsSmall" ); 24 QIconSet is = Resource::loadIconSet( "osearch/applicationsSmall" );
26 //QIconSet is = Resource::loadIconSet( "AppsIcon" ); 25 //QIconSet is = Resource::loadIconSet( "AppsIcon" );
27 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 26 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
28} 27}
29 28
30 29
31AppLnkSearch::~AppLnkSearch() 30AppLnkSearch::~AppLnkSearch()
32{ 31{
33 delete _apps; 32 delete _apps;
34} 33}
35 34
36 35
37void AppLnkSearch::load() 36void AppLnkSearch::load()
38{ 37{
39 _apps = new AppLnkSet(QPEApplication::qpeDir()); 38 _apps = new AppLnkSet(QPEApplication::qpeDir());
40} 39}
41 40
42int AppLnkSearch::search() 41int AppLnkSearch::search()
43{ 42{
44 QList<AppLnk> appList = _apps->children(); 43 QList<AppLnk> appList = _apps->children();
45 44
46 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){ 45 for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){
47 if ( (_search.match( app->name() ) != -1) 46 if ( (_search.match( app->name() ) != -1)
48 || (_search.match(app->comment()) != -1) 47 || (_search.match(app->comment()) != -1)
49 || (_search.match(app->exec()) != -1) ) { 48 || (_search.match(app->exec()) != -1) ) {
50 insertItem( app ); 49 insertItem( app );
51 }else 50 }else
52 if (searchFile( app )) 51 if (searchFile( app ))
53 insertItem( app ); 52 insertItem( app );
54 qApp->processEvents( 100 ); 53 qApp->processEvents( 100 );
55 } 54 }
56 return _resultCount; 55 return _resultCount;
57} 56}
58 57
59void AppLnkSearch::insertItem( void *rec ) 58void AppLnkSearch::insertItem( void *rec )
60{ 59{
61 (void)new AppLnkItem( this, (AppLnk*)rec ); 60 (void)new AppLnkItem( this, (AppLnk*)rec );
62 _resultCount++; 61 _resultCount++;
63} 62}
64 63
65void AppLnkSearch::setSearch(QRegExp re) 64void AppLnkSearch::setSearch(QRegExp re)
66{ 65{
67 setOpen( false ); 66 setOpen( false );
68 SearchGroup::setSearch( re ); 67 SearchGroup::setSearch( re );
diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp
index eedc374..639af46 100644
--- a/core/pim/osearch/contactitem.cpp
+++ b/core/pim/osearch/contactitem.cpp
@@ -1,66 +1,65 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "contactitem.h" 13#include "contactitem.h"
14 14
15#include <qpe/resource.h> 15#include <qpe/resource.h>
16#include <qpe/qcopenvelope_qws.h> 16#include <qpe/qcopenvelope_qws.h>
17 17
18#include <qpixmap.h>
19 18
20 19
21ContactItem::ContactItem(OListViewItem* parent, OPimContact *contact) 20ContactItem::ContactItem(OListViewItem* parent, OPimContact *contact)
22: ResultItem(parent) 21: ResultItem(parent)
23{ 22{
24 _contact = contact; 23 _contact = contact;
25 setText(0, _contact->toShortText()); 24 setText(0, _contact->toShortText());
26 setIcon(); 25 setIcon();
27} 26}
28 27
29void ContactItem::setIcon() 28void ContactItem::setIcon()
30{ 29{
31 QPixmap icon; 30 QPixmap icon;
32 switch ( _contact->lastHitField() ) { 31 switch ( _contact->lastHitField() ) {
33 case -1: 32 case -1:
34 icon = Resource::loadPixmap( "reset" ); 33 icon = Resource::loadPixmap( "reset" );
35 break; 34 break;
36 case Qtopia::BusinessPhone: 35 case Qtopia::BusinessPhone:
37 icon = Resource::loadPixmap( "addressbook/phonework" ); 36 icon = Resource::loadPixmap( "addressbook/phonework" );
38 break; 37 break;
39 case Qtopia::BusinessFax: 38 case Qtopia::BusinessFax:
40 icon = Resource::loadPixmap( "addressbook/faxwork" ); 39 icon = Resource::loadPixmap( "addressbook/faxwork" );
41 break; 40 break;
42 case Qtopia::BusinessMobile: 41 case Qtopia::BusinessMobile:
43 icon = Resource::loadPixmap( "addressbook/mobilework" ); 42 icon = Resource::loadPixmap( "addressbook/mobilework" );
44 break; 43 break;
45 case Qtopia::DefaultEmail: 44 case Qtopia::DefaultEmail:
46 case Qtopia::Emails: 45 case Qtopia::Emails:
47 icon = Resource::loadPixmap( "addressbook/email" ); 46 icon = Resource::loadPixmap( "addressbook/email" );
48 break; 47 break;
49 case Qtopia::HomePhone: 48 case Qtopia::HomePhone:
50 icon = Resource::loadPixmap( "addressbook/phonehome" ); 49 icon = Resource::loadPixmap( "addressbook/phonehome" );
51 break; 50 break;
52 case Qtopia::HomeFax: 51 case Qtopia::HomeFax:
53 icon = Resource::loadPixmap( "addressbook/faxhome" ); 52 icon = Resource::loadPixmap( "addressbook/faxhome" );
54 break; 53 break;
55 case Qtopia::HomeMobile: 54 case Qtopia::HomeMobile:
56 icon = Resource::loadPixmap( "addressbook/mobilehome" ); 55 icon = Resource::loadPixmap( "addressbook/mobilehome" );
57 break; 56 break;
58 case Qtopia::HomeWebPage: 57 case Qtopia::HomeWebPage:
59 icon = Resource::loadPixmap( "addressbook/webpagehome" ); 58 icon = Resource::loadPixmap( "addressbook/webpagehome" );
60 break; 59 break;
61 case Qtopia::BusinessWebPage: 60 case Qtopia::BusinessWebPage:
62 icon = Resource::loadPixmap( "addressbook/webpagework" ); 61 icon = Resource::loadPixmap( "addressbook/webpagework" );
63 break; 62 break;
64 case Qtopia::Title: 63 case Qtopia::Title:
65 case Qtopia::JobTitle: 64 case Qtopia::JobTitle:
66 case Qtopia::FirstName: 65 case Qtopia::FirstName:
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index 2b4660a..eeea54b 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -1,73 +1,71 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "datebooksearch.h" 13#include "datebooksearch.h"
14#include "eventitem.h" 14#include "eventitem.h"
15 15
16#include <opie2/opimevent.h> 16#include <opie2/opimevent.h>
17#include <opie2/opimrecurrence.h> 17#include <opie2/opimrecurrence.h>
18 18
19 19
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/config.h> 21#include <qpe/config.h>
22 22
23#include <qiconset.h>
24#include <qaction.h> 23#include <qaction.h>
25#include <qdatetime.h>
26#include <qpopupmenu.h> 24#include <qpopupmenu.h>
27 25
28 26
29 27
30DatebookSearch::DatebookSearch(QListView* parent, QString name) 28DatebookSearch::DatebookSearch(QListView* parent, QString name)
31: SearchGroup(parent, name), _dates(0), _popupMenu(0) 29: SearchGroup(parent, name), _dates(0), _popupMenu(0)
32{ 30{
33 QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" ); 31 QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" );
34 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 32 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
35 actionShowPastEvents = new QAction( QObject::tr("show past events"),QString::null, 0, 0, 0, true ); 33 actionShowPastEvents = new QAction( QObject::tr("show past events"),QString::null, 0, 0, 0, true );
36 actionSearchInDates = new QAction( QObject::tr("search in dates"),QString::null, 0, 0, 0, true ); 34 actionSearchInDates = new QAction( QObject::tr("search in dates"),QString::null, 0, 0, 0, true );
37 Config cfg( "osearch", Config::User ); 35 Config cfg( "osearch", Config::User );
38 cfg.setGroup( "datebook_settings" ); 36 cfg.setGroup( "datebook_settings" );
39 actionShowPastEvents->setOn( cfg.readBoolEntry( "show_past_events", false ) ); 37 actionShowPastEvents->setOn( cfg.readBoolEntry( "show_past_events", false ) );
40 actionSearchInDates->setOn( cfg.readBoolEntry( "search_in_dates", true ) ); 38 actionSearchInDates->setOn( cfg.readBoolEntry( "search_in_dates", true ) );
41} 39}
42 40
43DatebookSearch::~DatebookSearch() 41DatebookSearch::~DatebookSearch()
44{ 42{
45 qDebug("SAVE DATEBOOK SEARCH CONFIG"); 43 qDebug("SAVE DATEBOOK SEARCH CONFIG");
46 Config cfg( "osearch", Config::User ); 44 Config cfg( "osearch", Config::User );
47 cfg.setGroup( "datebook_settings" ); 45 cfg.setGroup( "datebook_settings" );
48 cfg.writeEntry( "show_past_events", actionShowPastEvents->isOn() ); 46 cfg.writeEntry( "show_past_events", actionShowPastEvents->isOn() );
49 cfg.writeEntry( "search_in_dates", actionSearchInDates->isOn() ); 47 cfg.writeEntry( "search_in_dates", actionSearchInDates->isOn() );
50 delete _dates; 48 delete _dates;
51 delete _popupMenu; 49 delete _popupMenu;
52 delete actionShowPastEvents; 50 delete actionShowPastEvents;
53 delete actionSearchInDates; 51 delete actionSearchInDates;
54} 52}
55 53
56 54
57void DatebookSearch::load() 55void DatebookSearch::load()
58{ 56{
59 _dates = new ODateBookAccess(); 57 _dates = new ODateBookAccess();
60 _dates->load(); 58 _dates->load();
61} 59}
62 60
63int DatebookSearch::search() 61int DatebookSearch::search()
64{ 62{
65 OPimRecordList<OPimEvent> results = _dates->matchRegexp(_search); 63 OPimRecordList<OPimEvent> results = _dates->matchRegexp(_search);
66 for (uint i = 0; i < results.count(); i++) 64 for (uint i = 0; i < results.count(); i++)
67 insertItem( new OPimEvent( results[i] ) ); 65 insertItem( new OPimEvent( results[i] ) );
68 return _resultCount; 66 return _resultCount;
69} 67}
70 68
71void DatebookSearch::insertItem( void *rec ) 69void DatebookSearch::insertItem( void *rec )
72{ 70{
73 OPimEvent *ev = (OPimEvent*)rec; 71 OPimEvent *ev = (OPimEvent*)rec;
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp
index 1516b8e..df8e856 100644
--- a/core/pim/osearch/doclnkitem.cpp
+++ b/core/pim/osearch/doclnkitem.cpp
@@ -1,66 +1,65 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "doclnkitem.h" 13#include "doclnkitem.h"
14 14
15#include <qpe/applnk.h> 15#include <qpe/applnk.h>
16#include <qpe/qcopenvelope_qws.h> 16#include <qpe/qcopenvelope_qws.h>
17 17
18#include <qfile.h>
19#include <qtextstream.h> 18#include <qtextstream.h>
20#include <qfileinfo.h> 19#include <qfileinfo.h>
21 20
22DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app) 21DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
23 : ResultItem(parent) 22 : ResultItem(parent)
24{ 23{
25 _doc = app; 24 _doc = app;
26 setText(0, _doc->name() ); 25 setText(0, _doc->name() );
27 setPixmap(0, _doc->pixmap() ); 26 setPixmap(0, _doc->pixmap() );
28} 27}
29 28
30DocLnkItem::~DocLnkItem() 29DocLnkItem::~DocLnkItem()
31{ 30{
32} 31}
33 32
34QString DocLnkItem::toRichText() 33QString DocLnkItem::toRichText()
35{ 34{
36 QString text; 35 QString text;
37 text += "<b><h3>" + _doc->name() + "</b></h3><br>"; 36 text += "<b><h3>" + _doc->name() + "</b></h3><br>";
38 text += _doc->comment() + "<br>"; 37 text += _doc->comment() + "<br>";
39 text += QObject::tr("File: ") + _doc->file() + "<br>"; 38 text += QObject::tr("File: ") + _doc->file() + "<br>";
40 text += QObject::tr("Link: ") + _doc->linkFile() + "<br>"; 39 text += QObject::tr("Link: ") + _doc->linkFile() + "<br>";
41 text += QObject::tr("Mimetype: ") + _doc->type() + "<br>"; 40 text += QObject::tr("Mimetype: ") + _doc->type() + "<br>";
42 if ( _doc->type().contains( "text" ) ){ 41 if ( _doc->type().contains( "text" ) ){
43 text += "<br><br><hr><br>"; 42 text += "<br><br><hr><br>";
44 QFile f(_doc->file()); 43 QFile f(_doc->file());
45 if ( f.open(IO_ReadOnly) ) { 44 if ( f.open(IO_ReadOnly) ) {
46 QTextStream t( &f ); 45 QTextStream t( &f );
47 while ( !t.eof() ) 46 while ( !t.eof() )
48 text += t.readLine() + "<br>"; 47 text += t.readLine() + "<br>";
49 } 48 }
50 f.close(); 49 f.close();
51 } 50 }
52 /* text += "<br><br>`"; 51 /* text += "<br><br>`";
53 text += _doc->exec(); 52 text += _doc->exec();
54 text += "`";*/ 53 text += "`";*/
55 QStringList list = _doc->mimeTypes(); 54 QStringList list = _doc->mimeTypes();
56 int i = 0; 55 int i = 0;
57 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { 56 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
58 text += QString::number( i++) + " - " + *it ; 57 text += QString::number( i++) + " - " + *it ;
59 } 58 }
60 return text; 59 return text;
61} 60}
62 61
63void DocLnkItem::action( int act ) 62void DocLnkItem::action( int act )
64{ 63{
65 qDebug("action %i",act); 64 qDebug("action %i",act);
66 if (!_doc->isValid()) qDebug("INVALID"); 65 if (!_doc->isValid()) qDebug("INVALID");
diff --git a/core/pim/osearch/doclnksearch.cpp b/core/pim/osearch/doclnksearch.cpp
index c73dcbf..3f0d223 100644
--- a/core/pim/osearch/doclnksearch.cpp
+++ b/core/pim/osearch/doclnksearch.cpp
@@ -1,75 +1,74 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13 13
14 14
15#include "doclnkitem.h" 15#include "doclnkitem.h"
16#include "doclnksearch.h" 16#include "doclnksearch.h"
17 17
18#include <opie2/owait.h> 18#include <opie2/owait.h>
19 19
20#include <qpe/applnk.h> 20#include <qpe/applnk.h>
21#include <qpe/config.h> 21#include <qpe/config.h>
22#include <qpe/resource.h> 22#include <qpe/resource.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24 24
25#include <qaction.h> 25#include <qaction.h>
26#include <qfile.h> 26#include <qfile.h>
27#include <qiconset.h>
28#include <qpopupmenu.h> 27#include <qpopupmenu.h>
29#include <qtextstream.h> 28#include <qtextstream.h>
30 29
31 30
32DocLnkSearch::DocLnkSearch(QListView* parent, QString name) 31DocLnkSearch::DocLnkSearch(QListView* parent, QString name)
33: AppLnkSearch(parent, name), _popupMenu(0) 32: AppLnkSearch(parent, name), _popupMenu(0)
34{ 33{
35 QIconSet is = Resource::loadIconSet( "osearch/documentsSmall" ); 34 QIconSet is = Resource::loadIconSet( "osearch/documentsSmall" );
36 setPixmap( 0, is.pixmap( QIconSet::Automatic, true ) ); 35 setPixmap( 0, is.pixmap( QIconSet::Automatic, true ) );
37 36
38 actionSearchInFiles = new QAction( QObject::tr("search content"),QString::null, 0, 0, 0, true ); 37 actionSearchInFiles = new QAction( QObject::tr("search content"),QString::null, 0, 0, 0, true );
39 Config cfg( "osearch", Config::User ); 38 Config cfg( "osearch", Config::User );
40 cfg.setGroup( "doclnk_settings" ); 39 cfg.setGroup( "doclnk_settings" );
41 actionSearchInFiles->setOn( cfg.readBoolEntry( "search_content", false ) ); 40 actionSearchInFiles->setOn( cfg.readBoolEntry( "search_content", false ) );
42} 41}
43 42
44 43
45DocLnkSearch::~DocLnkSearch() 44DocLnkSearch::~DocLnkSearch()
46{ 45{
47 Config cfg( "osearch", Config::User ); 46 Config cfg( "osearch", Config::User );
48 cfg.setGroup( "doclnk_settings" ); 47 cfg.setGroup( "doclnk_settings" );
49 cfg.writeEntry( "search_content", actionSearchInFiles->isOn() ); 48 cfg.writeEntry( "search_content", actionSearchInFiles->isOn() );
50} 49}
51 50
52void DocLnkSearch::load() 51void DocLnkSearch::load()
53{ 52{
54 _apps = new DocLnkSet(QPEApplication::documentDir()); 53 _apps = new DocLnkSet(QPEApplication::documentDir());
55} 54}
56 55
57bool DocLnkSearch::searchFile( AppLnk *app ) 56bool DocLnkSearch::searchFile( AppLnk *app )
58{ 57{
59 if (!actionSearchInFiles->isOn()) return false; 58 if (!actionSearchInFiles->isOn()) return false;
60 DocLnk *doc = (DocLnk*)app; 59 DocLnk *doc = (DocLnk*)app;
61 bool found = false; 60 bool found = false;
62 if ( doc->type().contains( "text" ) ){ 61 if ( doc->type().contains( "text" ) ){
63#ifdef NEW_OWAIT 62#ifdef NEW_OWAIT
64 QString ouput = QObject::tr("searching %1").arg(doc->file()); 63 QString ouput = QObject::tr("searching %1").arg(doc->file());
65 OWait( output ); 64 OWait( output );
66#endif 65#endif
67 QFile f(doc->file()); 66 QFile f(doc->file());
68 if ( f.open(IO_ReadOnly) ) { 67 if ( f.open(IO_ReadOnly) ) {
69 QTextStream t( &f ); 68 QTextStream t( &f );
70 while ( !t.eof() ) 69 while ( !t.eof() )
71 if (_search.match( t.readLine()) != -1) { 70 if (_search.match( t.readLine()) != -1) {
72 found = true; 71 found = true;
73 break; 72 break;
74 } 73 }
75 } 74 }
diff --git a/core/pim/osearch/eventitem.cpp b/core/pim/osearch/eventitem.cpp
index f6e34fe..8dcfc70 100644
--- a/core/pim/osearch/eventitem.cpp
+++ b/core/pim/osearch/eventitem.cpp
@@ -1,68 +1,66 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "eventitem.h" 13#include "eventitem.h"
14 14
15 15
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/qcopenvelope_qws.h> 17#include <qpe/qcopenvelope_qws.h>
18 18
19#include <qdatetime.h>
20#include <qpixmap.h>
21 19
22EventItem::EventItem(OListViewItem* parent, OPimEvent *event) 20EventItem::EventItem(OListViewItem* parent, OPimEvent *event)
23 : ResultItem(parent) 21 : ResultItem(parent)
24{ 22{
25 _event = event; 23 _event = event;
26 setText(0, _event->toShortText() ); 24 setText(0, _event->toShortText() );
27 setIcon(); 25 setIcon();
28} 26}
29 27
30 28
31EventItem::~EventItem() 29EventItem::~EventItem()
32{ 30{
33} 31}
34 32
35 33
36QString EventItem::toRichText() 34QString EventItem::toRichText()
37{ 35{
38 return _event->toRichText(); 36 return _event->toRichText();
39} 37}
40 38
41void EventItem::action( int act ) 39void EventItem::action( int act )
42{ 40{
43 if (act == 0){ 41 if (act == 0){
44 QCopEnvelope e("QPE/Application/datebook", "viewDefault(QDate)"); 42 QCopEnvelope e("QPE/Application/datebook", "viewDefault(QDate)");
45 e << _event->startDateTime().date(); 43 e << _event->startDateTime().date();
46 }else if(act == 1){ 44 }else if(act == 1){
47 QCopEnvelope e("QPE/Application/datebook", "editEvent(int)"); 45 QCopEnvelope e("QPE/Application/datebook", "editEvent(int)");
48 e << _event->uid(); 46 e << _event->uid();
49 } 47 }
50} 48}
51 49
52QIntDict<QString> EventItem::actions() 50QIntDict<QString> EventItem::actions()
53{ 51{
54 QIntDict<QString> result; 52 QIntDict<QString> result;
55 result.insert( 0, new QString( QObject::tr("show") ) ); 53 result.insert( 0, new QString( QObject::tr("show") ) );
56 result.insert( 1, new QString( QObject::tr("edit") ) ); 54 result.insert( 1, new QString( QObject::tr("edit") ) );
57 return result; 55 return result;
58} 56}
59 57
60void EventItem::setIcon() 58void EventItem::setIcon()
61{ 59{
62 QPixmap icon; 60 QPixmap icon;
63 switch ( _event->lastHitField() ) { 61 switch ( _event->lastHitField() ) {
64 case -1: 62 case -1:
65 icon = Resource::loadPixmap( "reset" ); 63 icon = Resource::loadPixmap( "reset" );
66 // QWhatsThis::add( icon, QObject::tr("Enter your search terms here") ); 64 // QWhatsThis::add( icon, QObject::tr("Enter your search terms here") );
67 break; 65 break;
68 case Qtopia::DatebookDescription: 66 case Qtopia::DatebookDescription:
diff --git a/core/pim/osearch/main.cpp b/core/pim/osearch/main.cpp
index 9a03818..e0a2de3 100644
--- a/core/pim/osearch/main.cpp
+++ b/core/pim/osearch/main.cpp
@@ -1,7 +1,6 @@
1 1
2#include "mainwindow.h" 2#include "mainwindow.h"
3 3
4#include <qpe/qpeapplication.h>
5#include <opie/oapplicationfactory.h> 4#include <opie/oapplicationfactory.h>
6 5
7OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 6OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index 95f5967..bfe95b0 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -1,78 +1,78 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 10// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
11 11
12 12
13#include "olistview.h" 13#include "olistview.h"
14#include "olistviewitem.h" 14#include "olistviewitem.h"
15#include "resultitem.h" 15#include "resultitem.h"
16#include "adresssearch.h" 16#include "adresssearch.h"
17#include "todosearch.h" 17#include "todosearch.h"
18#include "datebooksearch.h" 18#include "datebooksearch.h"
19#include "applnksearch.h" 19#include "applnksearch.h"
20#include "doclnksearch.h" 20#include "doclnksearch.h"
21#include "mainwindow.h" 21#include "mainwindow.h"
22 22
23#include <opie2/owait.h> 23#include <opie2/owait.h>
24 24
25#include <qpe/qpemessagebox.h> 25#include <qpe/qpemessagebox.h>
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/config.h> 27#include <qpe/config.h>
28 28
29
29#include <qpe/qpeapplication.h> 30#include <qpe/qpeapplication.h>
30#include <qpe/config.h>
31#include <qpe/global.h> 31#include <qpe/global.h>
32 32
33#include <qtoolbar.h> 33#include <qtoolbar.h>
34#include <qaction.h> 34#include <qaction.h>
35#include <qmessagebox.h> 35#include <qmessagebox.h>
36#include <qpopupmenu.h> 36#include <qpopupmenu.h>
37#include <qtoolbutton.h> 37#include <qtoolbutton.h>
38#include <qstring.h> 38#include <qstring.h>
39#include <qlabel.h> 39#include <qlabel.h>
40#include <qfile.h> 40#include <qfile.h>
41#include <qhbuttongroup.h> 41#include <qhbuttongroup.h>
42#include <qhbox.h> 42#include <qhbox.h>
43#include <qpushbutton.h> 43#include <qpushbutton.h>
44#include <qintdict.h> 44#include <qintdict.h>
45#include <qlayout.h> 45#include <qlayout.h>
46#include <qlineedit.h> 46#include <qlineedit.h>
47#include <qsignalmapper.h> 47#include <qsignalmapper.h>
48#include <qtextbrowser.h> 48#include <qtextbrowser.h>
49#include <qregexp.h> 49#include <qregexp.h>
50#include <qwhatsthis.h> 50#include <qwhatsthis.h>
51#include <qmenubar.h> 51#include <qmenubar.h>
52 52
53 53
54 54
55static const char* const image1_data[] = { 55static const char* const image1_data[] = {
56"14 14 3 1", 56"14 14 3 1",
57". c None", 57". c None",
58"# c #000000", 58"# c #000000",
59"a c #ff0000", 59"a c #ff0000",
60"..............", 60"..............",
61"..##.......###", 61"..##.......###",
62".#aa#....##aa#", 62".#aa#....##aa#",
63"#aaaa#.##aaaa#", 63"#aaaa#.##aaaa#",
64".##aaa#aaaaa##", 64".##aaa#aaaaa##",
65"...#aaaaaaa#..", 65"...#aaaaaaa#..",
66"....#aaaaa#...", 66"....#aaaaa#...",
67"...#aaaaa#....", 67"...#aaaaa#....",
68"..#aaaaaaa#...", 68"..#aaaaaaa#...",
69".#aaaaaaaaa#..", 69".#aaaaaaaaa#..",
70"#aaaa###aaaa#.", 70"#aaaa###aaaa#.",
71"#aaa#..##aaa#.", 71"#aaa#..##aaa#.",
72"#aaa#...#aa#..", 72"#aaa#...#aa#..",
73".###.....##..."}; 73".###.....##..."};
74 74
75 75
76MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 76MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
77 QMainWindow( parent, name, f ), _currentItem(0) 77 QMainWindow( parent, name, f ), _currentItem(0)
78{ 78{
diff --git a/core/pim/osearch/olistview.cpp b/core/pim/osearch/olistview.cpp
index 7a7cb26..8fbb31d 100644
--- a/core/pim/osearch/olistview.cpp
+++ b/core/pim/osearch/olistview.cpp
@@ -1,40 +1,39 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> 9 // (c) 2002 Patrick S. Vogtp <tille@handhelds.org>
10 10
11#include "olistview.h" 11#include "olistview.h"
12#include "olistviewitem.h" 12#include "olistviewitem.h"
13 13
14#include <qpe/qpeapplication.h> 14#include <qpe/qpeapplication.h>
15 15
16#include <qmessagebox.h>
17 16
18 17
19OListView::OListView(QWidget *parent, const char *name ) 18OListView::OListView(QWidget *parent, const char *name )
20 : QListView(parent,name) 19 : QListView(parent,name)
21{ 20{
22 21
23 setRootIsDecorated( true ); 22 setRootIsDecorated( true );
24 addColumn(tr("Results"),qApp->desktop()->width() - 9 ); 23 addColumn(tr("Results"),qApp->desktop()->width() - 9 );
25 //setColumnWidthMode(0, Manual); 24 //setColumnWidthMode(0, Manual);
26 25
27 setSorting( -1 ); 26 setSorting( -1 );
28 connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); 27 connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*)));
29} 28}
30 29
31 30
32OListView::~OListView() 31OListView::~OListView()
33{ 32{
34} 33}
35 34
36void OListView::expand(QListViewItem *item) 35void OListView::expand(QListViewItem *item)
37{ 36{
38 ((OListViewItem*)item)->expand(); 37 ((OListViewItem*)item)->expand();
39} 38}
40 39
diff --git a/core/pim/osearch/resultitem.cpp b/core/pim/osearch/resultitem.cpp
index f051b12..41c22c0 100644
--- a/core/pim/osearch/resultitem.cpp
+++ b/core/pim/osearch/resultitem.cpp
@@ -1,27 +1,26 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "resultitem.h" 13#include "resultitem.h"
14 14
15 15
16#include <qmessagebox.h>
17 16
18ResultItem::ResultItem(OListViewItem* parent) 17ResultItem::ResultItem(OListViewItem* parent)
19: OListViewItem(parent) 18: OListViewItem(parent)
20{ 19{
21 20
22} 21}
23 22
24 23
25ResultItem::~ResultItem() 24ResultItem::~ResultItem()
26{ 25{
27} 26}
diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp
index 5377b9f..7a0b5a7 100644
--- a/core/pim/osearch/searchgroup.cpp
+++ b/core/pim/osearch/searchgroup.cpp
@@ -1,67 +1,64 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "olistviewitem.h"
14#include "searchgroup.h" 13#include "searchgroup.h"
15 14
16#include <opie2/owait.h> 15#include <opie2/owait.h>
17 16
18#include <qobject.h>
19#include <qregexp.h>
20#include <qapplication.h> 17#include <qapplication.h>
21 18
22#ifndef NEW_OWAIT 19#ifndef NEW_OWAIT
23static OWait *wait = 0; 20static OWait *wait = 0;
24#endif 21#endif
25 22
26SearchGroup::SearchGroup(QListView* parent, QString name) 23SearchGroup::SearchGroup(QListView* parent, QString name)
27: OListViewItem(parent, name) 24: OListViewItem(parent, name)
28{ 25{
29 _name = name; 26 _name = name;
30 loaded = false; 27 loaded = false;
31} 28}
32 29
33 30
34SearchGroup::~SearchGroup() 31SearchGroup::~SearchGroup()
35{ 32{
36} 33}
37 34
38 35
39void SearchGroup::expand() 36void SearchGroup::expand()
40{ 37{
41 //expanded = true; 38 //expanded = true;
42 if (_lastSearch != _search) clearList(); 39 if (_lastSearch != _search) clearList();
43 if (_search.isEmpty()) return; 40 if (_search.isEmpty()) return;
44 OListViewItem *dummy = new OListViewItem( this, "searching..."); 41 OListViewItem *dummy = new OListViewItem( this, "searching...");
45 setOpen( true ); 42 setOpen( true );
46 repaint(); 43 repaint();
47 int res_count = realSearch(); 44 int res_count = realSearch();
48 setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")"); 45 setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")");
49 delete dummy; 46 delete dummy;
50 repaint(); 47 repaint();
51} 48}
52 49
53void SearchGroup::doSearch() 50void SearchGroup::doSearch()
54{ 51{
55 clearList(); 52 clearList();
56 if (_search.isEmpty()) return; 53 if (_search.isEmpty()) return;
57 _resultCount = realSearch(); 54 _resultCount = realSearch();
58 //repaint(); 55 //repaint();
59} 56}
60 57
61void SearchGroup::setSearch(QRegExp re) 58void SearchGroup::setSearch(QRegExp re)
62{ 59{
63 if (re == _search) return; 60 if (re == _search) return;
64 setText(0, _name+" - "+re.pattern() ); 61 setText(0, _name+" - "+re.pattern() );
65 _search = re; 62 _search = re;
66 if (isOpen()) expand(); 63 if (isOpen()) expand();
67 else new OListViewItem( this, "searching..."); 64 else new OListViewItem( this, "searching...");
diff --git a/core/pim/osearch/todoitem.cpp b/core/pim/osearch/todoitem.cpp
index c20f1fd..be780a1 100644
--- a/core/pim/osearch/todoitem.cpp
+++ b/core/pim/osearch/todoitem.cpp
@@ -1,67 +1,66 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "todoitem.h" 13#include "todoitem.h"
14 14
15 15
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/qcopenvelope_qws.h> 17#include <qpe/qcopenvelope_qws.h>
18 18
19#include <qpixmap.h>
20 19
21 20
22TodoItem::TodoItem(OListViewItem* parent, OPimTodo *todo) 21TodoItem::TodoItem(OListViewItem* parent, OPimTodo *todo)
23: ResultItem(parent) 22: ResultItem(parent)
24{ 23{
25 _todo = todo; 24 _todo = todo;
26 setText( 0, todo->toShortText() ); 25 setText( 0, todo->toShortText() );
27 setIcon(); 26 setIcon();
28} 27}
29 28
30TodoItem::~TodoItem() 29TodoItem::~TodoItem()
31{ 30{
32 delete _todo; 31 delete _todo;
33} 32}
34 33
35QString TodoItem::toRichText() 34QString TodoItem::toRichText()
36{ 35{
37 return _todo->toRichText(); 36 return _todo->toRichText();
38} 37}
39 38
40void TodoItem::action( int act ) 39void TodoItem::action( int act )
41{ 40{
42 if (act == 0){ 41 if (act == 0){
43 QCopEnvelope e("QPE/Application/todolist", "show(int)"); 42 QCopEnvelope e("QPE/Application/todolist", "show(int)");
44 e << _todo->uid(); 43 e << _todo->uid();
45 }else if (act == 1){ 44 }else if (act == 1){
46 QCopEnvelope e("QPE/Application/todolist", "edit(int)"); 45 QCopEnvelope e("QPE/Application/todolist", "edit(int)");
47 e << _todo->uid(); 46 e << _todo->uid();
48 } 47 }
49} 48}
50 49
51QIntDict<QString> TodoItem::actions() 50QIntDict<QString> TodoItem::actions()
52{ 51{
53 QIntDict<QString> result; 52 QIntDict<QString> result;
54 result.insert( 0, new QString( QObject::tr("show") ) ); 53 result.insert( 0, new QString( QObject::tr("show") ) );
55 result.insert( 1, new QString( QObject::tr("edit") ) ); 54 result.insert( 1, new QString( QObject::tr("edit") ) );
56 return result; 55 return result;
57} 56}
58 57
59void TodoItem::setIcon() 58void TodoItem::setIcon()
60{ 59{
61 QPixmap icon; 60 QPixmap icon;
62 switch ( _todo->lastHitField() ) { 61 switch ( _todo->lastHitField() ) {
63 case -1: 62 case -1:
64 icon = Resource::loadPixmap( "reset" ); 63 icon = Resource::loadPixmap( "reset" );
65 break; 64 break;
66 case OPimTodo::Description: 65 case OPimTodo::Description:
67 icon = Resource::loadPixmap( "txt" ); 66 icon = Resource::loadPixmap( "txt" );
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp
index 5042803..cdf3a1c 100644
--- a/core/pim/osearch/todosearch.cpp
+++ b/core/pim/osearch/todosearch.cpp
@@ -1,67 +1,66 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "todosearch.h" 13#include "todosearch.h"
14#include "todoitem.h" 14#include "todoitem.h"
15 15
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/config.h> 17#include <qpe/config.h>
18 18
19#include <qiconset.h>
20#include <qaction.h> 19#include <qaction.h>
21#include <qpopupmenu.h> 20#include <qpopupmenu.h>
22 21
23 22
24TodoSearch::TodoSearch(QListView* parent, QString name) 23TodoSearch::TodoSearch(QListView* parent, QString name)
25: SearchGroup(parent, name), _todos(0), _popupMenu(0) 24: SearchGroup(parent, name), _todos(0), _popupMenu(0)
26{ 25{
27 //AppLnkSet als(QPEApplication::qpeDir()); 26 //AppLnkSet als(QPEApplication::qpeDir());
28 //setPixmap( 0, als.findExec("todolist")->pixmap() ); 27 //setPixmap( 0, als.findExec("todolist")->pixmap() );
29 QIconSet is = Resource::loadIconSet( "todo/TodoListSmall" ); 28 QIconSet is = Resource::loadIconSet( "todo/TodoListSmall" );
30 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 29 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
31 actionShowCompleted = new QAction( QObject::tr("show completed tasks"),QString::null, 0, 0, 0, true ); 30 actionShowCompleted = new QAction( QObject::tr("show completed tasks"),QString::null, 0, 0, 0, true );
32 Config cfg( "osearch", Config::User ); 31 Config cfg( "osearch", Config::User );
33 cfg.setGroup( "todo_settings" ); 32 cfg.setGroup( "todo_settings" );
34 actionShowCompleted->setOn( cfg.readBoolEntry( "show_completed_tasks", false ) ); 33 actionShowCompleted->setOn( cfg.readBoolEntry( "show_completed_tasks", false ) );
35 34
36} 35}
37 36
38 37
39TodoSearch::~TodoSearch() 38TodoSearch::~TodoSearch()
40{ 39{
41 Config cfg( "osearch", Config::User ); 40 Config cfg( "osearch", Config::User );
42 cfg.setGroup( "todo_settings" ); 41 cfg.setGroup( "todo_settings" );
43 cfg.writeEntry( "show_completed_tasks", actionShowCompleted->isOn() ); 42 cfg.writeEntry( "show_completed_tasks", actionShowCompleted->isOn() );
44 delete _popupMenu; 43 delete _popupMenu;
45 delete actionShowCompleted; 44 delete actionShowCompleted;
46 delete _todos; 45 delete _todos;
47} 46}
48 47
49 48
50void TodoSearch::load() 49void TodoSearch::load()
51{ 50{
52 _todos = new OPimTodoAccess(); 51 _todos = new OPimTodoAccess();
53 _todos->load(); 52 _todos->load();
54} 53}
55 54
56int TodoSearch::search() 55int TodoSearch::search()
57{ 56{
58 OPimRecordList<OPimTodo> results = _todos->matchRegexp(_search); 57 OPimRecordList<OPimTodo> results = _todos->matchRegexp(_search);
59 for (uint i = 0; i < results.count(); i++) 58 for (uint i = 0; i < results.count(); i++)
60 insertItem( new OPimTodo( results[i] )); 59 insertItem( new OPimTodo( results[i] ));
61 return _resultCount; 60 return _resultCount;
62} 61}
63 62
64void TodoSearch::insertItem( void *rec ) 63void TodoSearch::insertItem( void *rec )
65{ 64{
66 OPimTodo *todo = (OPimTodo*)rec; 65 OPimTodo *todo = (OPimTodo*)rec;
67 if (!actionShowCompleted->isOn() && 66 if (!actionShowCompleted->isOn() &&
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index b55a4a7..72cdfd6 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -1,72 +1,71 @@
1/* 1/*
2 * today.cpp 2 * today.cpp
3 * 3 *
4 * copyright : (c) 2002,2003,2004 by Maximilian Reiß 4 * copyright : (c) 2002,2003,2004 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#define QTOPIA_INTERNAL_LANGLIST 17#define QTOPIA_INTERNAL_LANGLIST
18 18
19#include "today.h" 19#include "today.h"
20 20
21#include <qpe/config.h> 21#include <qpe/config.h>
22#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
23#include <qpe/resource.h> 23#include <qpe/resource.h>
24#include <qpe/global.h>
25#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
26#include <qpe/contact.h> 25#include <qpe/contact.h>
27 26
28#include <qdir.h> 27#include <qdir.h>
29#include <qtimer.h> 28#include <qtimer.h>
30#include <qwhatsthis.h> 29#include <qwhatsthis.h>
31 30
32struct TodayPlugin { 31struct TodayPlugin {
33 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} 32 TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
34 QLibrary *library; 33 QLibrary *library;
35 QInterfacePtr<TodayPluginInterface> iface; 34 QInterfacePtr<TodayPluginInterface> iface;
36 TodayPluginObject *guiPart; 35 TodayPluginObject *guiPart;
37 QWidget *guiBox; 36 QWidget *guiBox;
38 QString name; 37 QString name;
39 bool active; 38 bool active;
40 bool excludeRefresh; 39 bool excludeRefresh;
41 int pos; 40 int pos;
42}; 41};
43 42
44static QValueList<TodayPlugin> pluginList; 43static QValueList<TodayPlugin> pluginList;
45 44
46static QMap<QString, TodayPlugin> tempList; 45static QMap<QString, TodayPlugin> tempList;
47 46
48Today::Today( QWidget* parent, const char* name, WFlags fl ) 47Today::Today( QWidget* parent, const char* name, WFlags fl )
49 : TodayBase( parent, name, fl ) { 48 : TodayBase( parent, name, fl ) {
50 49
51 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); 50 QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) );
52 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); 51 QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) );
53 52
54#if defined(Q_WS_QWS) 53#if defined(Q_WS_QWS)
55#if !defined(QT_NO_COP) 54#if !defined(QT_NO_COP)
56 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); 55 QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this );
57 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), 56 connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
58 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); 57 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
59#endif 58#endif
60#endif 59#endif
61 60
62 setOwnerField(); 61 setOwnerField();
63 m_refreshTimer = new QTimer( this ); 62 m_refreshTimer = new QTimer( this );
64 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); 63 connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
65 m_refreshTimer->start( 15000 ); 64 m_refreshTimer->start( 15000 );
66 m_big_box = 0L; 65 m_big_box = 0L;
67 66
68 67
69 layout = new QVBoxLayout( this ); 68 layout = new QVBoxLayout( this );
70 layout->addWidget( Frame ); 69 layout->addWidget( Frame );
71 layout->addWidget( OwnerField ); 70 layout->addWidget( OwnerField );
72 71
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 0613f2c..b68aad2 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -1,103 +1,97 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <> 3             .=l. Copyright (c) 2002 <>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can 5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that 12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with 21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include <unistd.h> 29#include <unistd.h>
30 30
31#include <opie2/opimrecurrence.h> 31#include <opie2/opimrecurrence.h>
32#include <opie2/opimnotifymanager.h> 32#include <opie2/opimnotifymanager.h>
33#include <opie2/otodoaccessvcal.h> 33#include <opie2/otodoaccessvcal.h>
34#include <opie2/oapplicationfactory.h> 34#include <opie2/oapplicationfactory.h>
35 35
36#include <qpe/applnk.h> 36#include <qpe/applnk.h>
37#include <qpe/config.h> 37#include <qpe/config.h>
38#include <qpe/ir.h> 38#include <qpe/ir.h>
39#include <qpe/resource.h> 39#include <qpe/resource.h>
40#include <qpe/qpemessagebox.h> 40#include <qpe/qpemessagebox.h>
41#include <qpe/alarmserver.h> 41#include <qpe/alarmserver.h>
42#include <qpe/timestring.h>
43#include <qpe/qpeapplication.h> 42#include <qpe/qpeapplication.h>
44 43
45#include <qmenubar.h> 44#include <qmenubar.h>
46#include <qmessagebox.h> 45#include <qmessagebox.h>
47#include <qtoolbar.h>
48#include <qpopupmenu.h>
49#include <qpushbutton.h> 46#include <qpushbutton.h>
50#include <qwidgetstack.h>
51#include <qaction.h> 47#include <qaction.h>
52#include <qtimer.h> 48#include <qtimer.h>
53#include <qvbox.h>
54#include <qlayout.h> 49#include <qlayout.h>
55#include <qlineedit.h>
56#include <qwhatsthis.h> 50#include <qwhatsthis.h>
57 51
58#include "quickeditimpl.h" 52#include "quickeditimpl.h"
59#include "todotemplatemanager.h" 53#include "todotemplatemanager.h"
60#include "templateeditor.h" 54#include "templateeditor.h"
61#include "tableview.h" 55#include "tableview.h"
62 56
63#include "textviewshow.h" 57#include "textviewshow.h"
64#include "todoeditor.h" 58#include "todoeditor.h"
65#include "mainwindow.h" 59#include "mainwindow.h"
66 60
67OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> ) 61OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> )
68 62
69using namespace Todo; 63using namespace Todo;
70 64
71MainWindow::MainWindow( QWidget* parent, 65MainWindow::MainWindow( QWidget* parent,
72 const char* name, WFlags ) 66 const char* name, WFlags )
73 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) 67 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp )
74{ 68{
75 if (!name) 69 if (!name)
76 setName("todo window"); 70 setName("todo window");
77 71
78 m_syncing = false; 72 m_syncing = false;
79 m_showing = false; 73 m_showing = false;
80 m_counter = 0; 74 m_counter = 0;
81 m_tempManager = new TemplateManager(); 75 m_tempManager = new TemplateManager();
82 m_tempManager->load(); 76 m_tempManager->load();
83 77
84 initUI(); 78 initUI();
85 initConfig(); 79 initConfig();
86 initViews(); 80 initViews();
87 initActions(); 81 initActions();
88 initEditor(); 82 initEditor();
89 initShow(); 83 initShow();
90 initTemplate(); 84 initTemplate();
91 85
92 populateTemplates(); 86 populateTemplates();
93 raiseCurrentView(); 87 raiseCurrentView();
94 QTimer::singleShot(0, this, SLOT(populateCategories() ) ); 88 QTimer::singleShot(0, this, SLOT(populateCategories() ) );
95} 89}
96void MainWindow::initTemplate() { 90void MainWindow::initTemplate() {
97 m_curTempEd = new TemplateEditor( this, templateManager() ); 91 m_curTempEd = new TemplateEditor( this, templateManager() );
98} 92}
99void MainWindow::initActions() { 93void MainWindow::initActions() {
100 94
101 // Data menu 95 // Data menu
102 m_edit->insertItem(QWidget::tr("New from template"), m_template, 96 m_edit->insertItem(QWidget::tr("New from template"), m_template,
103 -1, 0 ); 97 -1, 0 );