summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index faae0a9..4fa9253 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -6,55 +6,53 @@
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 "addresssettings.h" 22// #include "addresssettings.h"
23#include "addressbook.h" 23#include "addressbook.h"
24 24
25#include <opie2/odebug.h> 25#include <opie2/odebug.h>
26#include <opie2/ofileselector.h> 26#include <opie2/ofileselector.h>
27#include <opie2/ofiledialog.h> 27#include <opie2/ofiledialog.h>
28#include <opie2/opimcontact.h> 28#include <opie2/opimcontact.h>
29#include <opie2/ocontactaccessbackend_vcard.h> 29#include <opie2/ocontactaccessbackend_vcard.h>
30#include <opie2/oresource.h>
30 31
31#include <qpe/resource.h>
32#include <qpe/ir.h> 32#include <qpe/ir.h>
33#include <qpe/qpemessagebox.h> 33#include <qpe/qpemessagebox.h>
34#include <qmenubar.h> 34#include <qmenubar.h>
35// #include <qtoolbar.h>
36// #include <qmenubar.h>
37#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
38 36
39#include <qaction.h> 37#include <qaction.h>
40#include <qlayout.h> 38#include <qlayout.h>
41#include <qmessagebox.h> 39#include <qmessagebox.h>
42#include <qtoolbutton.h> 40#include <qtoolbutton.h>
43 41
44#include <stdlib.h> 42#include <stdlib.h>
45#include <sys/stat.h> 43#include <sys/stat.h>
46#include <sys/types.h> 44#include <sys/types.h>
47#include <fcntl.h> 45#include <fcntl.h>
48#include <unistd.h> 46#include <unistd.h>
49 47
50 48
51#include "picker.h" 49#include "picker.h"
52#include "configdlg.h" 50#include "configdlg.h"
53 51
54extern QString addressbookPersonalVCardName(); 52extern QString addressbookPersonalVCardName();
55 53
56AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 54AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
57 WFlags /*f*/ ) 55 WFlags /*f*/ )
58 : Opie::OPimMainWindow( "Addressbook", "Contacts", tr( "Contact" ), "AddressBook", 56 : Opie::OPimMainWindow( "Addressbook", "Contacts", tr( "Contact" ), "AddressBook",
59 parent, name, WType_TopLevel | WStyle_ContextHelp ), 57 parent, name, WType_TopLevel | WStyle_ContextHelp ),
60 abEditor(0l), 58 abEditor(0l),
@@ -72,69 +70,75 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
72 70
73 m_abView = new AbView( m_listContainer, m_config.orderList() ); 71 m_abView = new AbView( m_listContainer, m_config.orderList() );
74 vb->addWidget( m_abView ); 72 vb->addWidget( m_abView );
75 connect( m_abView, SIGNAL(signalViewSwitched(int)), 73 connect( m_abView, SIGNAL(signalViewSwitched(int)),
76 this, SLOT(slotViewSwitched(int)) ); 74 this, SLOT(slotViewSwitched(int)) );
77 75
78 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); 76 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
79 77
80 // Letter Picker 78 // Letter Picker
81 pLabel = new LetterPicker( m_listContainer ); 79 pLabel = new LetterPicker( m_listContainer );
82 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 80 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
83 connect(m_abView, SIGNAL(signalClearLetterPicker()), pLabel, SLOT(clear()) ); 81 connect(m_abView, SIGNAL(signalClearLetterPicker()), pLabel, SLOT(clear()) );
84 82
85 vb->addWidget( pLabel ); 83 vb->addWidget( pLabel );
86 84
87 // Quick search bar 85 // Quick search bar
88 m_searchBar = new OFloatBar( "Search", this, QMainWindow::Top, true ); 86 m_searchBar = new OFloatBar( "Search", this, QMainWindow::Top, true );
89 m_searchBar->setHorizontalStretchable( true ); 87 m_searchBar->setHorizontalStretchable( true );
90 m_searchBar->hide(); 88 m_searchBar->hide();
91 m_searchEdit = new QLineEdit( m_searchBar, "m_searchEdit" ); 89 m_searchEdit = new QLineEdit( m_searchBar, "m_searchEdit" );
92 90
93 m_searchBar->setStretchableWidget( m_searchEdit ); 91 m_searchBar->setStretchableWidget( m_searchEdit );
94 connect( m_searchEdit, SIGNAL(returnPressed()), this, SLOT(slotFind()) ); 92 connect( m_searchEdit, SIGNAL(returnPressed()), this, SLOT(slotFind()) );
95 93
96 QAction *a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 94 QAction *a = new QAction( tr( "Start Search" ),
95 Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ),
96 QString::null, 0, this, 0 );
97 connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); 97 connect( a, SIGNAL(activated()), this, SLOT(slotFind()) );
98 a->addTo( m_searchBar ); 98 a->addTo( m_searchBar );
99 99
100 // Insert Contact menu items 100 // Insert Contact menu items
101 QActionGroup *items = new QActionGroup( this, QString::null, false ); 101 QActionGroup *items = new QActionGroup( this, QString::null, false );
102 102
103 m_actionMail = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), 103 m_actionMail = new QAction( tr( "Write Mail To" ),
104 QString::null, 0, items, 0 ); 104 Opie::Core::OResource::loadPixmap( "addressbook/sendmail" ),
105 QString::null, 0, items, 0 );
105 connect( m_actionMail, SIGNAL(activated()), this, SLOT(writeMail()) ); 106 connect( m_actionMail, SIGNAL(activated()), this, SLOT(writeMail()) );
106 107
107 a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), 108 a = new QAction( tr("Import vCard"),
108 QString::null, 0, items, 0 ); 109 Opie::Core::OResource::loadPixmap( "addressbook/fileimport" ),
110 QString::null, 0, items, 0 );
109 connect( a, SIGNAL(activated()), this, SLOT(importvCard()) ); 111 connect( a, SIGNAL(activated()), this, SLOT(importvCard()) );
110 112
111 a = new QAction( tr("Export vCard"), Resource::loadPixmap( "addressbook/fileexport"), 113 a = new QAction( tr("Export vCard"),
114 Opie::Core::OResource::loadPixmap( "addressbook/fileexport" ),
112 QString::null, 0, items, 0 ); 115 QString::null, 0, items, 0 );
113 connect( a, SIGNAL(activated()), this, SLOT(exportvCard()) ); 116 connect( a, SIGNAL(activated()), this, SLOT(exportvCard()) );
114 117
115 m_actionPersonal = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), 118 m_actionPersonal = new QAction( tr("My Personal Details"),
116 QString::null, 0, items, 0 , true ); 119 Opie::Core::OResource::loadPixmap( "addressbook/identity" ),
120 QString::null, 0, items, 0 , true );
117 connect( m_actionPersonal, SIGNAL(activated()), this, SLOT(slotPersonalView()) ); 121 connect( m_actionPersonal, SIGNAL(activated()), this, SLOT(slotPersonalView()) );
118 122
119 insertItemMenuItems( items ); 123 insertItemMenuItems( items );
120 124
121 // Insert View menu items 125 // Insert View menu items
122 items = new QActionGroup( this, QString::null, false ); 126 items = new QActionGroup( this, QString::null, false );
123 127
124 a = new QAction( tr("Show quick search bar"),QString::null, 0, items, 0, true ); 128 a = new QAction( tr("Show quick search bar"),QString::null, 0, items, 0, true );
125 connect( a, SIGNAL(toggled(bool)), this, SLOT(slotShowFind(bool)) ); 129 connect( a, SIGNAL(toggled(bool)), this, SLOT(slotShowFind(bool)) );
126 130
127 insertViewMenuItems( items ); 131 insertViewMenuItems( items );
128 132
129 // Fontsize 133 // Fontsize
130 defaultFont = new QFont( m_abView->font() ); 134 defaultFont = new QFont( m_abView->font() );
131 slotSetFont(m_config.fontSize()); 135 slotSetFont(m_config.fontSize());
132 m_curFontSize = m_config.fontSize(); 136 m_curFontSize = m_config.fontSize();
133 137
134 setCentralWidget(m_listContainer); 138 setCentralWidget(m_listContainer);
135 139
136 //odebug << "adressbook contrsuction: t=" << t.elapsed() << oendl; 140 //odebug << "adressbook contrsuction: t=" << t.elapsed() << oendl;
137 connect( qApp, SIGNAL(flush()), this, SLOT(flush()) ); 141 connect( qApp, SIGNAL(flush()), this, SLOT(flush()) );
138 connect( qApp, SIGNAL(reload()), this, SLOT(reload()) ); 142 connect( qApp, SIGNAL(reload()), this, SLOT(reload()) );
139 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), 143 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
140 this, SLOT(appMessage(const QCString&,const QByteArray&)) ); 144 this, SLOT(appMessage(const QCString&,const QByteArray&)) );