author | treke <treke> | 2003-11-11 07:14:38 (UTC) |
---|---|---|
committer | treke <treke> | 2003-11-11 07:14:38 (UTC) |
commit | 1eb61020dcba9bafd2926ab701120f5ef94905f7 (patch) (unidiff) | |
tree | 10d128bbf5b5b597aaf9602cb372ccbe46c12558 | |
parent | f3326a60ba002b420f33b6132dc1740c0fc4ffef (diff) | |
download | opie-1eb61020dcba9bafd2926ab701120f5ef94905f7.zip opie-1eb61020dcba9bafd2926ab701120f5ef94905f7.tar.gz opie-1eb61020dcba9bafd2926ab701120f5ef94905f7.tar.bz2 |
Updating apps to use quickexec. Ipks are now generated properly.
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 4 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 1 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.pro | 6 | ||||
-rw-r--r-- | core/pim/addressbook/main.cpp | 17 | ||||
-rw-r--r-- | core/pim/datebook/datebook.h | 1 | ||||
-rw-r--r-- | core/pim/datebook/datebook.pro | 4 | ||||
-rw-r--r-- | core/pim/datebook/main.cpp | 19 | ||||
-rw-r--r-- | core/pim/osearch/main.cpp | 11 | ||||
-rw-r--r-- | core/pim/osearch/osearch.pro | 17 | ||||
-rw-r--r-- | core/pim/today/today.pro | 18 | ||||
-rw-r--r-- | noncore/apps/opie-reader/opie-reader.control | 2 | ||||
-rw-r--r-- | noncore/multimedia/opierec/main.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opierec/opierec.pro | 4 | ||||
-rw-r--r-- | noncore/multimedia/opierec/qtrec.h | 1 |
14 files changed, 31 insertions, 86 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 0ba024e..438c270 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -1,1057 +1,1061 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** Copyright (C) 2003 Stefan Eilers (eilers.stefan@epost.de) | 3 | ** Copyright (C) 2003 Stefan Eilers (eilers.stefan@epost.de) |
4 | ** | 4 | ** |
5 | ** This file is part of the Open Palmtop Environment (see www.opie.info). | 5 | ** This file is part of the Open Palmtop Environment (see www.opie.info). |
6 | ** | 6 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 10 | ** packaging of this file. |
11 | ** | 11 | ** |
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** | 17 | ** |
18 | **********************************************************************/ | 18 | **********************************************************************/ |
19 | 19 | ||
20 | #define QTOPIA_INTERNAL_FD | 20 | #define QTOPIA_INTERNAL_FD |
21 | 21 | ||
22 | #include "contacteditor.h" | 22 | #include "contacteditor.h" |
23 | #include "ablabel.h" | 23 | #include "ablabel.h" |
24 | #include "abview.h" | 24 | #include "abview.h" |
25 | #include "abtable.h" | 25 | #include "abtable.h" |
26 | // #include "addresssettings.h" | 26 | // #include "addresssettings.h" |
27 | #include "addressbook.h" | 27 | #include "addressbook.h" |
28 | 28 | ||
29 | 29 | ||
30 | #include <opie/ofileselector.h> | 30 | #include <opie/ofileselector.h> |
31 | #include <opie/ofiledialog.h> | 31 | #include <opie/ofiledialog.h> |
32 | #include <opie/ocontact.h> | 32 | #include <opie/ocontact.h> |
33 | #include <opie/ocontactaccessbackend_vcard.h> | 33 | #include <opie/ocontactaccessbackend_vcard.h> |
34 | 34 | ||
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | #include <qpe/ir.h> | 36 | #include <qpe/ir.h> |
37 | #include <qpe/qpemessagebox.h> | 37 | #include <qpe/qpemessagebox.h> |
38 | #include <qpe/qcopenvelope_qws.h> | 38 | #include <qpe/qcopenvelope_qws.h> |
39 | #include <qpe/qpetoolbar.h> | 39 | #include <qpe/qpetoolbar.h> |
40 | #include <qpe/qpemenubar.h> | 40 | #include <qpe/qpemenubar.h> |
41 | // #include <qtoolbar.h> | 41 | // #include <qtoolbar.h> |
42 | // #include <qmenubar.h> | 42 | // #include <qmenubar.h> |
43 | #include <qpe/qpeapplication.h> | 43 | #include <qpe/qpeapplication.h> |
44 | #include <qpe/config.h> | 44 | #include <qpe/config.h> |
45 | 45 | ||
46 | #include <qaction.h> | 46 | #include <qaction.h> |
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qdir.h> | 48 | #include <qdir.h> |
49 | #include <qfile.h> | 49 | #include <qfile.h> |
50 | #include <qimage.h> | 50 | #include <qimage.h> |
51 | #include <qlayout.h> | 51 | #include <qlayout.h> |
52 | #include <qmessagebox.h> | 52 | #include <qmessagebox.h> |
53 | #include <qpixmap.h> | 53 | #include <qpixmap.h> |
54 | #include <qpopupmenu.h> | 54 | #include <qpopupmenu.h> |
55 | #include <qstringlist.h> | 55 | #include <qstringlist.h> |
56 | #include <qtoolbutton.h> | 56 | #include <qtoolbutton.h> |
57 | #include <qwhatsthis.h> | 57 | #include <qwhatsthis.h> |
58 | #include <qdatetime.h> | 58 | #include <qdatetime.h> |
59 | 59 | ||
60 | #include <stdlib.h> | 60 | #include <stdlib.h> |
61 | #include <sys/stat.h> | 61 | #include <sys/stat.h> |
62 | #include <sys/types.h> | 62 | #include <sys/types.h> |
63 | #include <fcntl.h> | 63 | #include <fcntl.h> |
64 | #include <unistd.h> | 64 | #include <unistd.h> |
65 | 65 | ||
66 | 66 | ||
67 | #include "picker.h" | 67 | #include "picker.h" |
68 | #include "configdlg.h" | 68 | #include "configdlg.h" |
69 | 69 | ||
70 | extern QString addressbookPersonalVCardName(); | 70 | extern QString addressbookPersonalVCardName(); |
71 | 71 | ||
72 | AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | 72 | AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, |
73 | WFlags f ) | 73 | WFlags f ) |
74 | : QMainWindow( parent, name, f ), | 74 | : QMainWindow( parent, name, f ), |
75 | catMenu (0l), | 75 | catMenu (0l), |
76 | abEditor(0l), | 76 | abEditor(0l), |
77 | syncing(FALSE), | 77 | syncing(FALSE), |
78 | m_tableViewButton(0l), | 78 | m_tableViewButton(0l), |
79 | m_cardViewButton(0l) | 79 | m_cardViewButton(0l) |
80 | { | 80 | { |
81 | isLoading = true; | 81 | isLoading = true; |
82 | 82 | ||
83 | m_config.load(); | 83 | m_config.load(); |
84 | 84 | ||
85 | setCaption( tr("Contacts") ); | 85 | setCaption( tr("Contacts") ); |
86 | setIcon( Resource::loadPixmap( "AddressBook" ) ); | 86 | setIcon( Resource::loadPixmap( "AddressBook" ) ); |
87 | 87 | ||
88 | // Settings for Main Menu | 88 | // Settings for Main Menu |
89 | // setToolBarsMovable( false ); | 89 | // setToolBarsMovable( false ); |
90 | setToolBarsMovable( !m_config.fixedBars() ); | 90 | setToolBarsMovable( !m_config.fixedBars() ); |
91 | setRightJustification( true ); | 91 | setRightJustification( true ); |
92 | 92 | ||
93 | QPEToolBar *bar = new QPEToolBar( this ); | 93 | QPEToolBar *bar = new QPEToolBar( this ); |
94 | bar->setHorizontalStretchable( TRUE ); | 94 | bar->setHorizontalStretchable( TRUE ); |
95 | 95 | ||
96 | QPEMenuBar *mbList = new QPEMenuBar( bar ); | 96 | QPEMenuBar *mbList = new QPEMenuBar( bar ); |
97 | mbList->setMargin( 0 ); | 97 | mbList->setMargin( 0 ); |
98 | 98 | ||
99 | QPopupMenu *edit = new QPopupMenu( mbList ); | 99 | QPopupMenu *edit = new QPopupMenu( mbList ); |
100 | mbList->insertItem( tr( "Contact" ), edit ); | 100 | mbList->insertItem( tr( "Contact" ), edit ); |
101 | 101 | ||
102 | // Category Menu | 102 | // Category Menu |
103 | catMenu = new QPopupMenu( this ); | 103 | catMenu = new QPopupMenu( this ); |
104 | catMenu->setCheckable( TRUE ); | 104 | catMenu->setCheckable( TRUE ); |
105 | connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); | 105 | connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); |
106 | mbList->insertItem( tr("View"), catMenu ); | 106 | mbList->insertItem( tr("View"), catMenu ); |
107 | 107 | ||
108 | // Create Toolbar | 108 | // Create Toolbar |
109 | listTools = new QPEToolBar( this, "list operations" ); | 109 | listTools = new QPEToolBar( this, "list operations" ); |
110 | listTools->setHorizontalStretchable( true ); | 110 | listTools->setHorizontalStretchable( true ); |
111 | addToolBar( listTools ); | 111 | addToolBar( listTools ); |
112 | moveToolBar( listTools, m_config.getToolBarPos() ); | 112 | moveToolBar( listTools, m_config.getToolBarPos() ); |
113 | 113 | ||
114 | // View Icons | 114 | // View Icons |
115 | m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/listview" ), | 115 | m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/listview" ), |
116 | QString::null, 0, this, 0 ); | 116 | QString::null, 0, this, 0 ); |
117 | connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); | 117 | connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); |
118 | m_tableViewButton->setToggleAction( true ); | 118 | m_tableViewButton->setToggleAction( true ); |
119 | m_tableViewButton->addTo( listTools ); | 119 | m_tableViewButton->addTo( listTools ); |
120 | m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "addressbook/cardview" ), QString::null, 0, this, 0 ); | 120 | m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "addressbook/cardview" ), QString::null, 0, this, 0 ); |
121 | connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) ); | 121 | connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) ); |
122 | m_cardViewButton->setToggleAction( true ); | 122 | m_cardViewButton->setToggleAction( true ); |
123 | m_cardViewButton->addTo( listTools ); | 123 | m_cardViewButton->addTo( listTools ); |
124 | 124 | ||
125 | listTools->addSeparator(); | 125 | listTools->addSeparator(); |
126 | 126 | ||
127 | // Other Buttons | 127 | // Other Buttons |
128 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, | 128 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, |
129 | 0, this, 0 ); | 129 | 0, this, 0 ); |
130 | actionNew = a; | 130 | actionNew = a; |
131 | connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) ); | 131 | connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) ); |
132 | a->addTo( edit ); | 132 | a->addTo( edit ); |
133 | a->addTo( listTools ); | 133 | a->addTo( listTools ); |
134 | 134 | ||
135 | a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, | 135 | a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, |
136 | 0, this, 0 ); | 136 | 0, this, 0 ); |
137 | actionEdit = a; | 137 | actionEdit = a; |
138 | connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); | 138 | connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); |
139 | a->addTo( edit ); | 139 | a->addTo( edit ); |
140 | a->addTo( listTools ); | 140 | a->addTo( listTools ); |
141 | 141 | ||
142 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, | 142 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, |
143 | 0, this, 0 ); | 143 | 0, this, 0 ); |
144 | actionTrash = a; | 144 | actionTrash = a; |
145 | connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); | 145 | connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); |
146 | a->addTo( edit ); | 146 | a->addTo( edit ); |
147 | a->addTo( listTools ); | 147 | a->addTo( listTools ); |
148 | 148 | ||
149 | 149 | ||
150 | // make it possible to go directly to businesscard via qcop call | 150 | // make it possible to go directly to businesscard via qcop call |
151 | //#if defined(Q_WS_QWS) // Why this ? (se) | 151 | //#if defined(Q_WS_QWS) // Why this ? (se) |
152 | #if !defined(QT_NO_COP) | 152 | #if !defined(QT_NO_COP) |
153 | QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); | 153 | QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); |
154 | connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), | 154 | connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), |
155 | this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); | 155 | this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); |
156 | #endif | 156 | #endif |
157 | // #endif | 157 | // #endif |
158 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), | 158 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), |
159 | QString::null, 0, this, 0 ); | 159 | QString::null, 0, this, 0 ); |
160 | actionFind = a; | 160 | actionFind = a; |
161 | connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); | 161 | connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); |
162 | a->addTo( edit ); | 162 | a->addTo( edit ); |
163 | a->addTo( listTools ); | 163 | a->addTo( listTools ); |
164 | 164 | ||
165 | // Much better search widget, taken from QTReader.. (se) | 165 | // Much better search widget, taken from QTReader.. (se) |
166 | searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); | 166 | searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); |
167 | searchBar->setHorizontalStretchable( TRUE ); | 167 | searchBar->setHorizontalStretchable( TRUE ); |
168 | searchBar->hide(); | 168 | searchBar->hide(); |
169 | searchEdit = new QLineEdit( searchBar, "searchEdit" ); | 169 | searchEdit = new QLineEdit( searchBar, "searchEdit" ); |
170 | 170 | ||
171 | // QFont f("unifont", 16 /*, QFont::Bold*/); | 171 | // QFont f("unifont", 16 /*, QFont::Bold*/); |
172 | // searchEdit->setFont( f ); | 172 | // searchEdit->setFont( f ); |
173 | 173 | ||
174 | searchBar->setStretchableWidget( searchEdit ); | 174 | searchBar->setStretchableWidget( searchEdit ); |
175 | connect( searchEdit, SIGNAL( returnPressed( ) ), | 175 | connect( searchEdit, SIGNAL( returnPressed( ) ), |
176 | this, SLOT( slotFind( ) ) ); | 176 | this, SLOT( slotFind( ) ) ); |
177 | 177 | ||
178 | a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); | 178 | a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); |
179 | connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); | 179 | connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); |
180 | a->addTo( searchBar ); | 180 | a->addTo( searchBar ); |
181 | 181 | ||
182 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 182 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
183 | connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); | 183 | connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); |
184 | a->addTo( searchBar ); | 184 | a->addTo( searchBar ); |
185 | 185 | ||
186 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), | 186 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), |
187 | QString::null, 0, this, 0 ); | 187 | QString::null, 0, this, 0 ); |
188 | //a->setEnabled( FALSE ); we got support for it now :) zecke | 188 | //a->setEnabled( FALSE ); we got support for it now :) zecke |
189 | actionMail = a; | 189 | actionMail = a; |
190 | connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) ); | 190 | connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) ); |
191 | a->addTo( edit ); | 191 | a->addTo( edit ); |
192 | a->addTo( listTools ); | 192 | a->addTo( listTools ); |
193 | 193 | ||
194 | if ( Ir::supported() ) { | 194 | if ( Ir::supported() ) { |
195 | a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, | 195 | a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, |
196 | 0, this, 0 ); | 196 | 0, this, 0 ); |
197 | actionBeam = a; | 197 | actionBeam = a; |
198 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); | 198 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); |
199 | a->addTo( edit ); | 199 | a->addTo( edit ); |
200 | a->addTo( listTools ); | 200 | a->addTo( listTools ); |
201 | } | 201 | } |
202 | 202 | ||
203 | edit->insertSeparator(); | 203 | edit->insertSeparator(); |
204 | 204 | ||
205 | a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), QString::null, | 205 | a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), QString::null, |
206 | 0, this, 0); | 206 | 0, this, 0); |
207 | actionPersonal = a; | 207 | actionPersonal = a; |
208 | connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); | 208 | connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); |
209 | a->addTo( edit ); | 209 | a->addTo( edit ); |
210 | 210 | ||
211 | a = new QAction( tr("Export vCard"), Resource::loadPixmap( "addressbook/fileexport"), QString::null, | 211 | a = new QAction( tr("Export vCard"), Resource::loadPixmap( "addressbook/fileexport"), QString::null, |
212 | 0, this, 0); | 212 | 0, this, 0); |
213 | actionPersonal = a; | 213 | actionPersonal = a; |
214 | connect( a, SIGNAL( activated() ), this, SLOT( exportvCard() ) ); | 214 | connect( a, SIGNAL( activated() ), this, SLOT( exportvCard() ) ); |
215 | a->addTo( edit ); | 215 | a->addTo( edit ); |
216 | 216 | ||
217 | edit->insertSeparator(); | 217 | edit->insertSeparator(); |
218 | 218 | ||
219 | a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), | 219 | a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), |
220 | QString::null, 0, this, 0 , TRUE ); | 220 | QString::null, 0, this, 0 , TRUE ); |
221 | actionPersonal = a; | 221 | actionPersonal = a; |
222 | connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); | 222 | connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); |
223 | a->addTo( edit ); | 223 | a->addTo( edit ); |
224 | 224 | ||
225 | 225 | ||
226 | #ifdef __DEBUG_RELEASE | 226 | #ifdef __DEBUG_RELEASE |
227 | // Remove this function for public Release ! This is only | 227 | // Remove this function for public Release ! This is only |
228 | // for debug purposes .. | 228 | // for debug purposes .. |
229 | a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); | 229 | a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); |
230 | connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); | 230 | connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); |
231 | a->addTo( edit ); | 231 | a->addTo( edit ); |
232 | #endif | 232 | #endif |
233 | a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, | 233 | a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, |
234 | 0, this, 0 ); | 234 | 0, this, 0 ); |
235 | connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); | 235 | connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); |
236 | a->addTo( edit ); | 236 | a->addTo( edit ); |
237 | 237 | ||
238 | // Create Views | 238 | // Create Views |
239 | listContainer = new QWidget( this ); | 239 | listContainer = new QWidget( this ); |
240 | QVBoxLayout *vb = new QVBoxLayout( listContainer ); | 240 | QVBoxLayout *vb = new QVBoxLayout( listContainer ); |
241 | 241 | ||
242 | m_abView = new AbView( listContainer, m_config.orderList() ); | 242 | m_abView = new AbView( listContainer, m_config.orderList() ); |
243 | vb->addWidget( m_abView ); | 243 | vb->addWidget( m_abView ); |
244 | // abList->setHScrollBarMode( QScrollView::AlwaysOff ); | 244 | // abList->setHScrollBarMode( QScrollView::AlwaysOff ); |
245 | connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), | 245 | connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), |
246 | this, SLOT( slotViewSwitched( int ) ) ); | 246 | this, SLOT( slotViewSwitched( int ) ) ); |
247 | 247 | ||
248 | 248 | ||
249 | QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); | 249 | QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); |
250 | 250 | ||
251 | // m_abView->load(); // Already done by c'tor . | 251 | // m_abView->load(); // Already done by c'tor . |
252 | 252 | ||
253 | // Letter Picker | 253 | // Letter Picker |
254 | pLabel = new LetterPicker( listContainer ); | 254 | pLabel = new LetterPicker( listContainer ); |
255 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); | 255 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); |
256 | connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); | 256 | connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); |
257 | 257 | ||
258 | vb->addWidget( pLabel ); | 258 | vb->addWidget( pLabel ); |
259 | 259 | ||
260 | // All Categories into view-menu.. | 260 | // All Categories into view-menu.. |
261 | populateCategories(); | 261 | populateCategories(); |
262 | 262 | ||
263 | // Fontsize | 263 | // Fontsize |
264 | defaultFont = new QFont( m_abView->font() ); | 264 | defaultFont = new QFont( m_abView->font() ); |
265 | slotSetFont(m_config.fontSize()); | 265 | slotSetFont(m_config.fontSize()); |
266 | m_curFontSize = m_config.fontSize(); | 266 | m_curFontSize = m_config.fontSize(); |
267 | 267 | ||
268 | setCentralWidget(listContainer); | 268 | setCentralWidget(listContainer); |
269 | 269 | ||
270 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); | 270 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); |
271 | connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) ); | ||
272 | connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) ); | ||
273 | connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ), | ||
274 | this, SLOT( appMessage(const QCString &, const QByteArray &) ) ); | ||
271 | 275 | ||
272 | 276 | ||
273 | isLoading = false; | 277 | isLoading = false; |
274 | } | 278 | } |
275 | 279 | ||
276 | 280 | ||
277 | void AddressbookWindow::slotConfig() | 281 | void AddressbookWindow::slotConfig() |
278 | { | 282 | { |
279 | ConfigDlg* dlg = new ConfigDlg( this, "Config" ); | 283 | ConfigDlg* dlg = new ConfigDlg( this, "Config" ); |
280 | dlg -> setConfig( m_config ); | 284 | dlg -> setConfig( m_config ); |
281 | dlg -> showMaximized(); | 285 | dlg -> showMaximized(); |
282 | if ( dlg -> exec() ) { | 286 | if ( dlg -> exec() ) { |
283 | qWarning ("Config Dialog accepted!"); | 287 | qWarning ("Config Dialog accepted!"); |
284 | m_config = dlg -> getConfig(); | 288 | m_config = dlg -> getConfig(); |
285 | if ( m_curFontSize != m_config.fontSize() ){ | 289 | if ( m_curFontSize != m_config.fontSize() ){ |
286 | qWarning("Font was changed!"); | 290 | qWarning("Font was changed!"); |
287 | m_curFontSize = m_config.fontSize(); | 291 | m_curFontSize = m_config.fontSize(); |
288 | emit slotSetFont( m_curFontSize ); | 292 | emit slotSetFont( m_curFontSize ); |
289 | } | 293 | } |
290 | m_abView -> setListOrder( m_config.orderList() ); | 294 | m_abView -> setListOrder( m_config.orderList() ); |
291 | } | 295 | } |
292 | 296 | ||
293 | delete dlg; | 297 | delete dlg; |
294 | } | 298 | } |
295 | 299 | ||
296 | 300 | ||
297 | void AddressbookWindow::slotSetFont( int size ) | 301 | void AddressbookWindow::slotSetFont( int size ) |
298 | { | 302 | { |
299 | qWarning("void AddressbookWindow::slotSetFont( %d )", size); | 303 | qWarning("void AddressbookWindow::slotSetFont( %d )", size); |
300 | 304 | ||
301 | if (size > 2 || size < 0) | 305 | if (size > 2 || size < 0) |
302 | size = 1; | 306 | size = 1; |
303 | 307 | ||
304 | m_config.setFontSize( size ); | 308 | m_config.setFontSize( size ); |
305 | 309 | ||
306 | QFont *currentFont; | 310 | QFont *currentFont; |
307 | 311 | ||
308 | switch (size) { | 312 | switch (size) { |
309 | case 0: | 313 | case 0: |
310 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); | 314 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); |
311 | currentFont = new QFont (m_abView->font()); | 315 | currentFont = new QFont (m_abView->font()); |
312 | // abList->resizeRows(currentFont->pixelSize() + 7); :SX | 316 | // abList->resizeRows(currentFont->pixelSize() + 7); :SX |
313 | // abList->resizeRows(); | 317 | // abList->resizeRows(); |
314 | break; | 318 | break; |
315 | case 1: | 319 | case 1: |
316 | m_abView->setFont( *defaultFont ); | 320 | m_abView->setFont( *defaultFont ); |
317 | currentFont = new QFont (m_abView->font()); | 321 | currentFont = new QFont (m_abView->font()); |
318 | // // abList->resizeRows(currentFont->pixelSize() + 7); | 322 | // // abList->resizeRows(currentFont->pixelSize() + 7); |
319 | // abList->resizeRows(); | 323 | // abList->resizeRows(); |
320 | break; | 324 | break; |
321 | case 2: | 325 | case 2: |
322 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); | 326 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); |
323 | currentFont = new QFont (m_abView->font()); | 327 | currentFont = new QFont (m_abView->font()); |
324 | // //abList->resizeRows(currentFont->pixelSize() + 7); | 328 | // //abList->resizeRows(currentFont->pixelSize() + 7); |
325 | // abList->resizeRows(); | 329 | // abList->resizeRows(); |
326 | break; | 330 | break; |
327 | } | 331 | } |
328 | } | 332 | } |
329 | 333 | ||
330 | 334 | ||
331 | 335 | ||
332 | void AddressbookWindow::importvCard() { | 336 | void AddressbookWindow::importvCard() { |
333 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | 337 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); |
334 | if(!str.isEmpty() ){ | 338 | if(!str.isEmpty() ){ |
335 | setDocument((const QString&) str ); | 339 | setDocument((const QString&) str ); |
336 | } | 340 | } |
337 | 341 | ||
338 | } | 342 | } |
339 | void AddressbookWindow::exportvCard() | 343 | void AddressbookWindow::exportvCard() |
340 | { | 344 | { |
341 | qWarning(" void AddressbookWindow::exportvCard()"); | 345 | qWarning(" void AddressbookWindow::exportvCard()"); |
342 | QString filename = OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); | 346 | QString filename = OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); |
343 | if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ | 347 | if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ |
344 | qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 ); | 348 | qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 ); |
345 | OContact curCont = m_abView->currentEntry(); | 349 | OContact curCont = m_abView->currentEntry(); |
346 | if ( !curCont.isEmpty() ){ | 350 | if ( !curCont.isEmpty() ){ |
347 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 351 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
348 | filename ); | 352 | filename ); |
349 | OContactAccess* access = new OContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); | 353 | OContactAccess* access = new OContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); |
350 | if ( access ){ | 354 | if ( access ){ |
351 | access->add( curCont ); | 355 | access->add( curCont ); |
352 | access->save(); | 356 | access->save(); |
353 | } | 357 | } |
354 | delete access; | 358 | delete access; |
355 | }else | 359 | }else |
356 | QMessageBox::critical( 0, "Export VCard", | 360 | QMessageBox::critical( 0, "Export VCard", |
357 | QString( tr( "You have to select a contact !") ) ); | 361 | QString( tr( "You have to select a contact !") ) ); |
358 | 362 | ||
359 | }else | 363 | }else |
360 | QMessageBox::critical( 0, "Export VCard", | 364 | QMessageBox::critical( 0, "Export VCard", |
361 | QString( tr( "You have to set a filename !") ) ); | 365 | QString( tr( "You have to set a filename !") ) ); |
362 | } | 366 | } |
363 | 367 | ||
364 | void AddressbookWindow::setDocument( const QString &filename ) | 368 | void AddressbookWindow::setDocument( const QString &filename ) |
365 | { | 369 | { |
366 | qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); | 370 | qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); |
367 | 371 | ||
368 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ | 372 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ |
369 | 373 | ||
370 | 374 | ||
371 | 375 | ||
372 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), | 376 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), |
373 | tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), | 377 | tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), |
374 | tr( "&Yes" ), tr( "&No" ), QString::null, | 378 | tr( "&Yes" ), tr( "&No" ), QString::null, |
375 | 0, // Enter == button 0 | 379 | 0, // Enter == button 0 |
376 | 2 ) ) { // Escape == button 2 | 380 | 2 ) ) { // Escape == button 2 |
377 | case 0: | 381 | case 0: |
378 | qWarning("YES clicked"); | 382 | qWarning("YES clicked"); |
379 | break; | 383 | break; |
380 | case 1: | 384 | case 1: |
381 | qWarning("NO clicked"); | 385 | qWarning("NO clicked"); |
382 | return; | 386 | return; |
383 | break; | 387 | break; |
384 | } | 388 | } |
385 | } | 389 | } |
386 | 390 | ||
387 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 391 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
388 | filename ); | 392 | filename ); |
389 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 393 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
390 | OContactAccess::List allList = access->allRecords(); | 394 | OContactAccess::List allList = access->allRecords(); |
391 | qWarning( "Found number of contacts in File: %d", allList.count() ); | 395 | qWarning( "Found number of contacts in File: %d", allList.count() ); |
392 | 396 | ||
393 | if ( !allList.count() ) { | 397 | if ( !allList.count() ) { |
394 | QMessageBox::information( this, "Import VCard", | 398 | QMessageBox::information( this, "Import VCard", |
395 | "It was impossible to import\nthe VCard.\n" | 399 | "It was impossible to import\nthe VCard.\n" |
396 | "The VCard may be corrupted!" ); | 400 | "The VCard may be corrupted!" ); |
397 | } | 401 | } |
398 | 402 | ||
399 | bool doAsk = true; | 403 | bool doAsk = true; |
400 | OContactAccess::List::Iterator it; | 404 | OContactAccess::List::Iterator it; |
401 | for ( it = allList.begin(); it != allList.end(); ++it ){ | 405 | for ( it = allList.begin(); it != allList.end(); ++it ){ |
402 | qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); | 406 | qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); |
403 | if ( doAsk ){ | 407 | if ( doAsk ){ |
404 | switch( QMessageBox::information( this, tr ( "Add Contact?" ), | 408 | switch( QMessageBox::information( this, tr ( "Add Contact?" ), |
405 | tr( "Do you really want add contact for \n%1?" ) | 409 | tr( "Do you really want add contact for \n%1?" ) |
406 | .arg( (*it).fullName().latin1() ), | 410 | .arg( (*it).fullName().latin1() ), |
407 | tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"), | 411 | tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"), |
408 | 0, // Enter == button 0 | 412 | 0, // Enter == button 0 |
409 | 2 ) ) { // Escape == button 2 | 413 | 2 ) ) { // Escape == button 2 |
410 | case 0: | 414 | case 0: |
411 | qWarning("YES clicked"); | 415 | qWarning("YES clicked"); |
412 | m_abView->addEntry( *it ); | 416 | m_abView->addEntry( *it ); |
413 | break; | 417 | break; |
414 | case 1: | 418 | case 1: |
415 | qWarning("NO clicked"); | 419 | qWarning("NO clicked"); |
416 | break; | 420 | break; |
417 | case 2: | 421 | case 2: |
418 | qWarning("YesAll clicked"); | 422 | qWarning("YesAll clicked"); |
419 | doAsk = false; | 423 | doAsk = false; |
420 | break; | 424 | break; |
421 | } | 425 | } |
422 | }else | 426 | }else |
423 | m_abView->addEntry( *it ); | 427 | m_abView->addEntry( *it ); |
424 | 428 | ||
425 | } | 429 | } |
426 | 430 | ||
427 | delete access; | 431 | delete access; |
428 | } | 432 | } |
429 | 433 | ||
430 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) | 434 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) |
431 | { | 435 | { |
432 | QMainWindow::resizeEvent( e ); | 436 | QMainWindow::resizeEvent( e ); |
433 | 437 | ||
434 | 438 | ||
435 | } | 439 | } |
436 | 440 | ||
437 | AddressbookWindow::~AddressbookWindow() | 441 | AddressbookWindow::~AddressbookWindow() |
438 | { | 442 | { |
439 | ToolBarDock dock; | 443 | ToolBarDock dock; |
440 | int dummy; | 444 | int dummy; |
441 | bool bDummy; | 445 | bool bDummy; |
442 | getLocation ( listTools, dock, dummy, bDummy, dummy ); | 446 | getLocation ( listTools, dock, dummy, bDummy, dummy ); |
443 | m_config.setToolBarDock( dock ); | 447 | m_config.setToolBarDock( dock ); |
444 | m_config.save(); | 448 | m_config.save(); |
445 | } | 449 | } |
446 | 450 | ||
447 | void AddressbookWindow::slotUpdateToolbar() | 451 | void AddressbookWindow::slotUpdateToolbar() |
448 | { | 452 | { |
449 | OContact ce = m_abView->currentEntry(); | 453 | OContact ce = m_abView->currentEntry(); |
450 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); | 454 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); |
451 | } | 455 | } |
452 | 456 | ||
453 | void AddressbookWindow::slotListNew() | 457 | void AddressbookWindow::slotListNew() |
454 | { | 458 | { |
455 | OContact cnt; | 459 | OContact cnt; |
456 | if( !syncing ) { | 460 | if( !syncing ) { |
457 | editEntry( NewEntry ); | 461 | editEntry( NewEntry ); |
458 | } else { | 462 | } else { |
459 | QMessageBox::warning(this, tr("Contacts"), | 463 | QMessageBox::warning(this, tr("Contacts"), |
460 | tr("Can not edit data, currently syncing")); | 464 | tr("Can not edit data, currently syncing")); |
461 | } | 465 | } |
462 | } | 466 | } |
463 | 467 | ||
464 | // void AddressbookWindow::slotListView() | 468 | // void AddressbookWindow::slotListView() |
465 | // { | 469 | // { |
466 | // m_abView -> init( abList->currentEntry() ); | 470 | // m_abView -> init( abList->currentEntry() ); |
467 | // // :SX mView->sync(); | 471 | // // :SX mView->sync(); |
468 | // //:SXshowView(); | 472 | // //:SXshowView(); |
469 | // } | 473 | // } |
470 | 474 | ||
471 | void AddressbookWindow::slotListDelete() | 475 | void AddressbookWindow::slotListDelete() |
472 | { | 476 | { |
473 | if(!syncing) { | 477 | if(!syncing) { |
474 | OContact tmpEntry = m_abView ->currentEntry(); | 478 | OContact tmpEntry = m_abView ->currentEntry(); |
475 | 479 | ||
476 | // get a name, do the best we can... | 480 | // get a name, do the best we can... |
477 | QString strName = tmpEntry.fullName(); | 481 | QString strName = tmpEntry.fullName(); |
478 | if ( strName.isEmpty() ) { | 482 | if ( strName.isEmpty() ) { |
479 | strName = tmpEntry.company(); | 483 | strName = tmpEntry.company(); |
480 | if ( strName.isEmpty() ) | 484 | if ( strName.isEmpty() ) |
481 | strName = "No Name"; | 485 | strName = "No Name"; |
482 | } | 486 | } |
483 | 487 | ||
484 | 488 | ||
485 | if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), | 489 | if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), |
486 | strName ) ) { | 490 | strName ) ) { |
487 | m_abView->removeEntry( tmpEntry.uid() ); | 491 | m_abView->removeEntry( tmpEntry.uid() ); |
488 | } | 492 | } |
489 | } else { | 493 | } else { |
490 | QMessageBox::warning( this, tr("Contacts"), | 494 | QMessageBox::warning( this, tr("Contacts"), |
491 | tr("Can not edit data, currently syncing") ); | 495 | tr("Can not edit data, currently syncing") ); |
492 | } | 496 | } |
493 | } | 497 | } |
494 | 498 | ||
495 | void AddressbookWindow::slotFindOpen() | 499 | void AddressbookWindow::slotFindOpen() |
496 | { | 500 | { |
497 | searchBar->show(); | 501 | searchBar->show(); |
498 | m_abView -> inSearch(); | 502 | m_abView -> inSearch(); |
499 | searchEdit->setFocus(); | 503 | searchEdit->setFocus(); |
500 | } | 504 | } |
501 | void AddressbookWindow::slotFindClose() | 505 | void AddressbookWindow::slotFindClose() |
502 | { | 506 | { |
503 | searchBar->hide(); | 507 | searchBar->hide(); |
504 | m_abView -> offSearch(); | 508 | m_abView -> offSearch(); |
505 | // m_abView->setFocus(); | 509 | // m_abView->setFocus(); |
506 | } | 510 | } |
507 | 511 | ||
508 | 512 | ||
509 | void AddressbookWindow::slotFind() | 513 | void AddressbookWindow::slotFind() |
510 | { | 514 | { |
511 | m_abView->slotDoFind( searchEdit->text(), m_config.beCaseSensitive(), m_config.useRegExp(), false); | 515 | m_abView->slotDoFind( searchEdit->text(), m_config.beCaseSensitive(), m_config.useRegExp(), false); |
512 | 516 | ||
513 | searchEdit->clearFocus(); | 517 | searchEdit->clearFocus(); |
514 | // m_abView->setFocus(); | 518 | // m_abView->setFocus(); |
515 | 519 | ||
516 | } | 520 | } |
517 | 521 | ||
518 | void AddressbookWindow::slotViewBack() | 522 | void AddressbookWindow::slotViewBack() |
519 | { | 523 | { |
520 | // :SX showList(); | 524 | // :SX showList(); |
521 | } | 525 | } |
522 | 526 | ||
523 | void AddressbookWindow::slotViewEdit() | 527 | void AddressbookWindow::slotViewEdit() |
524 | { | 528 | { |
525 | if(!syncing) { | 529 | if(!syncing) { |
526 | if (actionPersonal->isOn()) { | 530 | if (actionPersonal->isOn()) { |
527 | editPersonal(); | 531 | editPersonal(); |
528 | } else { | 532 | } else { |
529 | editEntry( EditEntry ); | 533 | editEntry( EditEntry ); |
530 | } | 534 | } |
531 | } else { | 535 | } else { |
532 | QMessageBox::warning( this, tr("Contacts"), | 536 | QMessageBox::warning( this, tr("Contacts"), |
533 | tr("Can not edit data, currently syncing") ); | 537 | tr("Can not edit data, currently syncing") ); |
534 | } | 538 | } |
535 | } | 539 | } |
536 | 540 | ||
537 | 541 | ||
538 | 542 | ||
539 | void AddressbookWindow::writeMail() | 543 | void AddressbookWindow::writeMail() |
540 | { | 544 | { |
541 | OContact c = m_abView -> currentEntry(); | 545 | OContact c = m_abView -> currentEntry(); |
542 | QString name = c.fileAs(); | 546 | QString name = c.fileAs(); |
543 | QString email = c.defaultEmail(); | 547 | QString email = c.defaultEmail(); |
544 | 548 | ||
545 | // I prefer the OPIE-Environment variable before the | 549 | // I prefer the OPIE-Environment variable before the |
546 | // QPE-one.. | 550 | // QPE-one.. |
547 | QString basepath = QString::fromLatin1( getenv("OPIEDIR") ); | 551 | QString basepath = QString::fromLatin1( getenv("OPIEDIR") ); |
548 | if ( basepath.isEmpty() ) | 552 | if ( basepath.isEmpty() ) |
549 | basepath = QString::fromLatin1( getenv("QPEDIR") ); | 553 | basepath = QString::fromLatin1( getenv("QPEDIR") ); |
550 | 554 | ||
551 | // Try to access the preferred. If not possible, try to | 555 | // Try to access the preferred. If not possible, try to |
552 | // switch to the other one.. | 556 | // switch to the other one.. |
553 | if ( m_config.useQtMail() ){ | 557 | if ( m_config.useQtMail() ){ |
554 | qWarning ("Accessing: %s", (basepath + "/bin/qtmail").latin1()); | 558 | qWarning ("Accessing: %s", (basepath + "/bin/qtmail").latin1()); |
555 | if ( QFile::exists( basepath + "/bin/qtmail" ) ){ | 559 | if ( QFile::exists( basepath + "/bin/qtmail" ) ){ |
556 | qWarning ("QCop"); | 560 | qWarning ("QCop"); |
557 | QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)"); | 561 | QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)"); |
558 | e << name << email; | 562 | e << name << email; |
559 | return; | 563 | return; |
560 | } else | 564 | } else |
561 | m_config.setUseOpieMail( true ); | 565 | m_config.setUseOpieMail( true ); |
562 | } | 566 | } |
563 | if ( m_config.useOpieMail() ){ | 567 | if ( m_config.useOpieMail() ){ |
564 | qWarning ("Accessing: %s", (basepath + "/bin/mail").latin1()); | 568 | qWarning ("Accessing: %s", (basepath + "/bin/mail").latin1()); |
565 | if ( QFile::exists( basepath + "/bin/mail" ) ){ | 569 | if ( QFile::exists( basepath + "/bin/mail" ) ){ |
566 | qWarning ("QCop"); | 570 | qWarning ("QCop"); |
567 | QCopEnvelope e("QPE/Application/mail", "writeMail(QString,QString)"); | 571 | QCopEnvelope e("QPE/Application/mail", "writeMail(QString,QString)"); |
568 | e << name << email; | 572 | e << name << email; |
569 | return; | 573 | return; |
570 | } else | 574 | } else |
571 | m_config.setUseQtMail( true ); | 575 | m_config.setUseQtMail( true ); |
572 | } | 576 | } |
573 | 577 | ||
574 | } | 578 | } |
575 | 579 | ||
576 | static const char * beamfile = "/tmp/obex/contact.vcf"; | 580 | static const char * beamfile = "/tmp/obex/contact.vcf"; |
577 | 581 | ||
578 | void AddressbookWindow::slotBeam() | 582 | void AddressbookWindow::slotBeam() |
579 | { | 583 | { |
580 | QString beamFilename; | 584 | QString beamFilename; |
581 | OContact c; | 585 | OContact c; |
582 | if ( actionPersonal->isOn() ) { | 586 | if ( actionPersonal->isOn() ) { |
583 | beamFilename = addressbookPersonalVCardName(); | 587 | beamFilename = addressbookPersonalVCardName(); |
584 | if ( !QFile::exists( beamFilename ) ) | 588 | if ( !QFile::exists( beamFilename ) ) |
585 | return; // can't beam a non-existent file | 589 | return; // can't beam a non-existent file |
586 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 590 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
587 | beamFilename ); | 591 | beamFilename ); |
588 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 592 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
589 | OContactAccess::List allList = access->allRecords(); | 593 | OContactAccess::List allList = access->allRecords(); |
590 | OContactAccess::List::Iterator it = allList.begin(); // Just take first | 594 | OContactAccess::List::Iterator it = allList.begin(); // Just take first |
591 | c = *it; | 595 | c = *it; |
592 | 596 | ||
593 | delete access; | 597 | delete access; |
594 | } else { | 598 | } else { |
595 | unlink( beamfile ); // delete if exists | 599 | unlink( beamfile ); // delete if exists |
596 | mkdir("/tmp/obex/", 0755); | 600 | mkdir("/tmp/obex/", 0755); |
597 | c = m_abView -> currentEntry(); | 601 | c = m_abView -> currentEntry(); |
598 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 602 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
599 | beamfile ); | 603 | beamfile ); |
600 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 604 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
601 | access->add( c ); | 605 | access->add( c ); |
602 | access->save(); | 606 | access->save(); |
603 | delete access; | 607 | delete access; |
604 | 608 | ||
605 | beamFilename = beamfile; | 609 | beamFilename = beamfile; |
606 | } | 610 | } |
607 | 611 | ||
608 | qWarning("Beaming: %s", beamFilename.latin1() ); | 612 | qWarning("Beaming: %s", beamFilename.latin1() ); |
609 | 613 | ||
610 | Ir *ir = new Ir( this ); | 614 | Ir *ir = new Ir( this ); |
611 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 615 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
612 | QString description = c.fullName(); | 616 | QString description = c.fullName(); |
613 | ir->send( beamFilename, description, "text/x-vCard" ); | 617 | ir->send( beamFilename, description, "text/x-vCard" ); |
614 | } | 618 | } |
615 | 619 | ||
616 | void AddressbookWindow::beamDone( Ir *ir ) | 620 | void AddressbookWindow::beamDone( Ir *ir ) |
617 | { | 621 | { |
618 | 622 | ||
619 | delete ir; | 623 | delete ir; |
620 | unlink( beamfile ); | 624 | unlink( beamfile ); |
621 | } | 625 | } |
622 | 626 | ||
623 | 627 | ||
624 | static void parseName( const QString& name, QString *first, QString *middle, | 628 | static void parseName( const QString& name, QString *first, QString *middle, |
625 | QString * last ) | 629 | QString * last ) |
626 | { | 630 | { |
627 | 631 | ||
628 | int comma = name.find ( "," ); | 632 | int comma = name.find ( "," ); |
629 | QString rest; | 633 | QString rest; |
630 | if ( comma > 0 ) { | 634 | if ( comma > 0 ) { |
631 | *last = name.left( comma ); | 635 | *last = name.left( comma ); |
632 | comma++; | 636 | comma++; |
633 | while ( comma < int(name.length()) && name[comma] == ' ' ) | 637 | while ( comma < int(name.length()) && name[comma] == ' ' ) |
634 | comma++; | 638 | comma++; |
635 | rest = name.mid( comma ); | 639 | rest = name.mid( comma ); |
636 | } else { | 640 | } else { |
637 | int space = name.findRev( ' ' ); | 641 | int space = name.findRev( ' ' ); |
638 | *last = name.mid( space+1 ); | 642 | *last = name.mid( space+1 ); |
639 | rest = name.left( space ); | 643 | rest = name.left( space ); |
640 | } | 644 | } |
641 | int space = rest.find( ' ' ); | 645 | int space = rest.find( ' ' ); |
642 | if ( space <= 0 ) { | 646 | if ( space <= 0 ) { |
643 | *first = rest; | 647 | *first = rest; |
644 | } else { | 648 | } else { |
645 | *first = rest.left( space ); | 649 | *first = rest.left( space ); |
646 | *middle = rest.mid( space+1 ); | 650 | *middle = rest.mid( space+1 ); |
647 | } | 651 | } |
648 | 652 | ||
649 | } | 653 | } |
650 | 654 | ||
651 | 655 | ||
652 | void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) | 656 | void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) |
653 | { | 657 | { |
654 | bool needShow = FALSE; | 658 | bool needShow = FALSE; |
655 | qWarning("Receiving QCop-Call with message %s", QString( msg ).latin1() ); | 659 | qWarning("Receiving QCop-Call with message %s", QString( msg ).latin1() ); |
656 | 660 | ||
657 | 661 | ||
658 | if (msg == "editPersonal()") { | 662 | if (msg == "editPersonal()") { |
659 | editPersonal(); | 663 | editPersonal(); |
660 | } else if (msg == "editPersonalAndClose()") { | 664 | } else if (msg == "editPersonalAndClose()") { |
661 | editPersonal(); | 665 | editPersonal(); |
662 | close(); | 666 | close(); |
663 | } else if ( msg == "addContact(QString,QString)" ) { | 667 | } else if ( msg == "addContact(QString,QString)" ) { |
664 | QDataStream stream(data,IO_ReadOnly); | 668 | QDataStream stream(data,IO_ReadOnly); |
665 | QString name, email; | 669 | QString name, email; |
666 | stream >> name >> email; | 670 | stream >> name >> email; |
667 | 671 | ||
668 | OContact cnt; | 672 | OContact cnt; |
669 | QString fn, mn, ln; | 673 | QString fn, mn, ln; |
670 | parseName( name, &fn, &mn, &ln ); | 674 | parseName( name, &fn, &mn, &ln ); |
671 | // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() ); | 675 | // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() ); |
672 | cnt.setFirstName( fn ); | 676 | cnt.setFirstName( fn ); |
673 | cnt.setMiddleName( mn ); | 677 | cnt.setMiddleName( mn ); |
674 | cnt.setLastName( ln ); | 678 | cnt.setLastName( ln ); |
675 | cnt.insertEmails( email ); | 679 | cnt.insertEmails( email ); |
676 | cnt.setDefaultEmail( email ); | 680 | cnt.setDefaultEmail( email ); |
677 | cnt.setFileAs(); | 681 | cnt.setFileAs(); |
678 | 682 | ||
679 | m_abView -> addEntry( cnt ); | 683 | m_abView -> addEntry( cnt ); |
680 | 684 | ||
681 | // :SXm_abView()->init( cnt ); | 685 | // :SXm_abView()->init( cnt ); |
682 | editEntry( EditEntry ); | 686 | editEntry( EditEntry ); |
683 | } else if ( msg == "beamBusinessCard()" ) { | 687 | } else if ( msg == "beamBusinessCard()" ) { |
684 | QString beamFilename = addressbookPersonalVCardName(); | 688 | QString beamFilename = addressbookPersonalVCardName(); |
685 | if ( !QFile::exists( beamFilename ) ) | 689 | if ( !QFile::exists( beamFilename ) ) |
686 | return; // can't beam a non-existent file | 690 | return; // can't beam a non-existent file |
687 | 691 | ||
688 | Ir *ir = new Ir( this ); | 692 | Ir *ir = new Ir( this ); |
689 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 693 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
690 | QString description = "mycard.vcf"; | 694 | QString description = "mycard.vcf"; |
691 | ir->send( beamFilename, description, "text/x-vCard" ); | 695 | ir->send( beamFilename, description, "text/x-vCard" ); |
692 | } else if ( msg == "show(int)" ) { | 696 | } else if ( msg == "show(int)" ) { |
693 | raise(); | 697 | raise(); |
694 | QDataStream stream(data,IO_ReadOnly); | 698 | QDataStream stream(data,IO_ReadOnly); |
695 | int uid; | 699 | int uid; |
696 | stream >> uid; | 700 | stream >> uid; |
697 | 701 | ||
698 | qWarning( "Showing uid: %d" , uid ); | 702 | qWarning( "Showing uid: %d" , uid ); |
699 | 703 | ||
700 | // Deactivate Personal View.. | 704 | // Deactivate Personal View.. |
701 | if ( actionPersonal->isOn() ){ | 705 | if ( actionPersonal->isOn() ){ |
702 | actionPersonal->setOn( false ); | 706 | actionPersonal->setOn( false ); |
703 | slotPersonalView(); | 707 | slotPersonalView(); |
704 | } | 708 | } |
705 | 709 | ||
706 | // Reset category and show as card.. | 710 | // Reset category and show as card.. |
707 | m_abView -> setShowByCategory( QString::null ); | 711 | m_abView -> setShowByCategory( QString::null ); |
708 | m_abView -> setCurrentUid( uid ); | 712 | m_abView -> setCurrentUid( uid ); |
709 | slotViewSwitched ( AbView::CardView ); | 713 | slotViewSwitched ( AbView::CardView ); |
710 | 714 | ||
711 | needShow = true; | 715 | needShow = true; |
712 | 716 | ||
713 | 717 | ||
714 | } else if ( msg == "edit(int)" ) { | 718 | } else if ( msg == "edit(int)" ) { |
715 | QDataStream stream(data,IO_ReadOnly); | 719 | QDataStream stream(data,IO_ReadOnly); |
716 | int uid; | 720 | int uid; |
717 | stream >> uid; | 721 | stream >> uid; |
718 | 722 | ||
719 | // Deactivate Personal View.. | 723 | // Deactivate Personal View.. |
720 | if ( actionPersonal->isOn() ){ | 724 | if ( actionPersonal->isOn() ){ |
721 | actionPersonal->setOn( false ); | 725 | actionPersonal->setOn( false ); |
722 | slotPersonalView(); | 726 | slotPersonalView(); |
723 | } | 727 | } |
724 | 728 | ||
725 | // Reset category and edit.. | 729 | // Reset category and edit.. |
726 | m_abView -> setShowByCategory( QString::null ); | 730 | m_abView -> setShowByCategory( QString::null ); |
727 | m_abView -> setCurrentUid( uid ); | 731 | m_abView -> setCurrentUid( uid ); |
728 | slotViewEdit(); | 732 | slotViewEdit(); |
729 | } | 733 | } |
730 | 734 | ||
731 | if (needShow) | 735 | if (needShow) |
732 | QPEApplication::setKeepRunning(); | 736 | QPEApplication::setKeepRunning(); |
733 | 737 | ||
734 | } | 738 | } |
735 | 739 | ||
736 | void AddressbookWindow::editEntry( EntryMode entryMode ) | 740 | void AddressbookWindow::editEntry( EntryMode entryMode ) |
737 | { | 741 | { |
738 | OContact entry; | 742 | OContact entry; |
739 | if ( !abEditor ) { | 743 | if ( !abEditor ) { |
740 | abEditor = new ContactEditor( entry, this, "editor" ); | 744 | abEditor = new ContactEditor( entry, this, "editor" ); |
741 | } | 745 | } |
742 | if ( entryMode == EditEntry ) | 746 | if ( entryMode == EditEntry ) |
743 | abEditor->setEntry( m_abView -> currentEntry() ); | 747 | abEditor->setEntry( m_abView -> currentEntry() ); |
744 | else if ( entryMode == NewEntry ) | 748 | else if ( entryMode == NewEntry ) |
745 | abEditor->setEntry( entry ); | 749 | abEditor->setEntry( entry ); |
746 | // other things may change the caption. | 750 | // other things may change the caption. |
747 | abEditor->setCaption( tr("Edit Address") ); | 751 | abEditor->setCaption( tr("Edit Address") ); |
748 | 752 | ||
749 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 753 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
750 | abEditor->showMaximized(); | 754 | abEditor->showMaximized(); |
751 | #endif | 755 | #endif |
752 | // fix the foxus... | 756 | // fix the foxus... |
753 | abEditor->setNameFocus(); | 757 | abEditor->setNameFocus(); |
754 | if ( abEditor->exec() ) { | 758 | if ( abEditor->exec() ) { |
755 | setFocus(); | 759 | setFocus(); |
756 | if ( entryMode == NewEntry ) { | 760 | if ( entryMode == NewEntry ) { |
757 | OContact insertEntry = abEditor->entry(); | 761 | OContact insertEntry = abEditor->entry(); |
758 | insertEntry.assignUid(); | 762 | insertEntry.assignUid(); |
759 | m_abView -> addEntry( insertEntry ); | 763 | m_abView -> addEntry( insertEntry ); |
760 | m_abView -> setCurrentUid( insertEntry.uid() ); | 764 | m_abView -> setCurrentUid( insertEntry.uid() ); |
761 | } else { | 765 | } else { |
762 | OContact replEntry = abEditor->entry(); | 766 | OContact replEntry = abEditor->entry(); |
763 | 767 | ||
764 | if ( !replEntry.isValidUid() ) | 768 | if ( !replEntry.isValidUid() ) |
765 | replEntry.assignUid(); | 769 | replEntry.assignUid(); |
766 | 770 | ||
767 | m_abView -> replaceEntry( replEntry ); | 771 | m_abView -> replaceEntry( replEntry ); |
768 | } | 772 | } |
769 | } | 773 | } |
770 | // populateCategories(); | 774 | // populateCategories(); |
771 | 775 | ||
772 | } | 776 | } |
773 | 777 | ||
774 | void AddressbookWindow::editPersonal() | 778 | void AddressbookWindow::editPersonal() |
775 | { | 779 | { |
776 | OContact entry; | 780 | OContact entry; |
777 | 781 | ||
778 | // Switch to personal view if not selected | 782 | // Switch to personal view if not selected |
779 | // but take care of the menu, too | 783 | // but take care of the menu, too |
780 | if ( ! actionPersonal->isOn() ){ | 784 | if ( ! actionPersonal->isOn() ){ |
781 | qWarning("*** ++++"); | 785 | qWarning("*** ++++"); |
782 | actionPersonal->setOn( true ); | 786 | actionPersonal->setOn( true ); |
783 | slotPersonalView(); | 787 | slotPersonalView(); |
784 | } | 788 | } |
785 | 789 | ||
786 | if ( !abEditor ) { | 790 | if ( !abEditor ) { |
787 | abEditor = new ContactEditor( entry, this, "editor" ); | 791 | abEditor = new ContactEditor( entry, this, "editor" ); |
788 | } | 792 | } |
789 | 793 | ||
790 | abEditor->setCaption(tr("Edit My Personal Details")); | 794 | abEditor->setCaption(tr("Edit My Personal Details")); |
791 | abEditor->setPersonalView( true ); | 795 | abEditor->setPersonalView( true ); |
792 | editEntry( EditEntry ); | 796 | editEntry( EditEntry ); |
793 | abEditor->setPersonalView( false ); | 797 | abEditor->setPersonalView( false ); |
794 | 798 | ||
795 | } | 799 | } |
796 | 800 | ||
797 | 801 | ||
798 | void AddressbookWindow::slotPersonalView() | 802 | void AddressbookWindow::slotPersonalView() |
799 | { | 803 | { |
800 | qWarning("slotPersonalView()"); | 804 | qWarning("slotPersonalView()"); |
801 | if (!actionPersonal->isOn()) { | 805 | if (!actionPersonal->isOn()) { |
802 | // we just turned it off | 806 | // we just turned it off |
803 | qWarning("slotPersonalView()-> OFF"); | 807 | qWarning("slotPersonalView()-> OFF"); |
804 | setCaption( tr("Contacts") ); | 808 | setCaption( tr("Contacts") ); |
805 | actionNew->setEnabled(TRUE); | 809 | actionNew->setEnabled(TRUE); |
806 | actionTrash->setEnabled(TRUE); | 810 | actionTrash->setEnabled(TRUE); |
807 | actionFind->setEnabled(TRUE); | 811 | actionFind->setEnabled(TRUE); |
808 | actionMail->setEnabled(TRUE); | 812 | actionMail->setEnabled(TRUE); |
809 | // slotUpdateToolbar(); | 813 | // slotUpdateToolbar(); |
810 | 814 | ||
811 | m_abView->showPersonal( false ); | 815 | m_abView->showPersonal( false ); |
812 | 816 | ||
813 | return; | 817 | return; |
814 | } | 818 | } |
815 | 819 | ||
816 | qWarning("slotPersonalView()-> ON"); | 820 | qWarning("slotPersonalView()-> ON"); |
817 | // XXX need to disable some QActions. | 821 | // XXX need to disable some QActions. |
818 | actionNew->setEnabled(FALSE); | 822 | actionNew->setEnabled(FALSE); |
819 | actionTrash->setEnabled(FALSE); | 823 | actionTrash->setEnabled(FALSE); |
820 | actionFind->setEnabled(FALSE); | 824 | actionFind->setEnabled(FALSE); |
821 | actionMail->setEnabled(FALSE); | 825 | actionMail->setEnabled(FALSE); |
822 | 826 | ||
823 | setCaption( tr("Contacts - My Personal Details") ); | 827 | setCaption( tr("Contacts - My Personal Details") ); |
824 | 828 | ||
825 | m_abView->showPersonal( true ); | 829 | m_abView->showPersonal( true ); |
826 | 830 | ||
827 | } | 831 | } |
828 | 832 | ||
829 | 833 | ||
830 | void AddressbookWindow::listIsEmpty( bool empty ) | 834 | void AddressbookWindow::listIsEmpty( bool empty ) |
831 | { | 835 | { |
832 | if ( !empty ) { | 836 | if ( !empty ) { |
833 | deleteButton->setEnabled( TRUE ); | 837 | deleteButton->setEnabled( TRUE ); |
834 | } | 838 | } |
835 | } | 839 | } |
836 | 840 | ||
837 | void AddressbookWindow::reload() | 841 | void AddressbookWindow::reload() |
838 | { | 842 | { |
839 | syncing = FALSE; | 843 | syncing = FALSE; |
840 | m_abView->clear(); | 844 | m_abView->clear(); |
841 | m_abView->reload(); | 845 | m_abView->reload(); |
842 | } | 846 | } |
843 | 847 | ||
844 | void AddressbookWindow::flush() | 848 | void AddressbookWindow::flush() |
845 | { | 849 | { |
846 | syncing = TRUE; | 850 | syncing = TRUE; |
847 | m_abView->save(); | 851 | m_abView->save(); |
848 | } | 852 | } |
849 | 853 | ||
850 | 854 | ||
851 | void AddressbookWindow::closeEvent( QCloseEvent *e ) | 855 | void AddressbookWindow::closeEvent( QCloseEvent *e ) |
852 | { | 856 | { |
853 | if(active_view == AbView::CardView){ | 857 | if(active_view == AbView::CardView){ |
854 | slotViewSwitched( AbView::TableView ); | 858 | slotViewSwitched( AbView::TableView ); |
855 | e->ignore(); | 859 | e->ignore(); |
856 | return; | 860 | return; |
857 | } | 861 | } |
858 | if(syncing) { | 862 | if(syncing) { |
859 | /* shouldn't we save, I hear you say? well its already been set | 863 | /* shouldn't we save, I hear you say? well its already been set |
860 | so that an edit can not occur during a sync, and we flushed | 864 | so that an edit can not occur during a sync, and we flushed |
861 | at the start of the sync, so there is no need to save | 865 | at the start of the sync, so there is no need to save |
862 | Saving however itself would cause problems. */ | 866 | Saving however itself would cause problems. */ |
863 | e->accept(); | 867 | e->accept(); |
864 | return; | 868 | return; |
865 | } | 869 | } |
866 | //################## shouldn't always save | 870 | //################## shouldn't always save |
867 | // True, but the database handles this automatically ! (se) | 871 | // True, but the database handles this automatically ! (se) |
868 | if ( save() ) | 872 | if ( save() ) |
869 | e->accept(); | 873 | e->accept(); |
870 | else | 874 | else |
871 | e->ignore(); | 875 | e->ignore(); |
872 | } | 876 | } |
873 | 877 | ||
874 | /* | 878 | /* |
875 | Returns TRUE if it is OK to exit | 879 | Returns TRUE if it is OK to exit |
876 | */ | 880 | */ |
877 | 881 | ||
878 | bool AddressbookWindow::save() | 882 | bool AddressbookWindow::save() |
879 | { | 883 | { |
880 | if ( !m_abView->save() ) { | 884 | if ( !m_abView->save() ) { |
881 | if ( QMessageBox::critical( 0, tr( "Out of space" ), | 885 | if ( QMessageBox::critical( 0, tr( "Out of space" ), |
882 | tr("Unable to save information.\n" | 886 | tr("Unable to save information.\n" |
883 | "Free up some space\n" | 887 | "Free up some space\n" |
884 | "and try again.\n" | 888 | "and try again.\n" |
885 | "\nQuit anyway?"), | 889 | "\nQuit anyway?"), |
886 | QMessageBox::Yes|QMessageBox::Escape, | 890 | QMessageBox::Yes|QMessageBox::Escape, |
887 | QMessageBox::No|QMessageBox::Default ) | 891 | QMessageBox::No|QMessageBox::Default ) |
888 | != QMessageBox::No ) | 892 | != QMessageBox::No ) |
889 | return TRUE; | 893 | return TRUE; |
890 | else | 894 | else |
891 | return FALSE; | 895 | return FALSE; |
892 | } | 896 | } |
893 | return TRUE; | 897 | return TRUE; |
894 | } | 898 | } |
895 | 899 | ||
896 | #ifdef __DEBUG_RELEASE | 900 | #ifdef __DEBUG_RELEASE |
897 | void AddressbookWindow::slotSave() | 901 | void AddressbookWindow::slotSave() |
898 | { | 902 | { |
899 | save(); | 903 | save(); |
900 | } | 904 | } |
901 | #endif | 905 | #endif |
902 | 906 | ||
903 | 907 | ||
904 | void AddressbookWindow::slotNotFound() | 908 | void AddressbookWindow::slotNotFound() |
905 | { | 909 | { |
906 | qWarning("Got notfound signal!"); | 910 | qWarning("Got notfound signal!"); |
907 | QMessageBox::information( this, tr( "Not Found" ), | 911 | QMessageBox::information( this, tr( "Not Found" ), |
908 | "<qt>" + tr( "Unable to find a contact for this search pattern!" ) + "</qt>" ); | 912 | "<qt>" + tr( "Unable to find a contact for this search pattern!" ) + "</qt>" ); |
909 | 913 | ||
910 | 914 | ||
911 | } | 915 | } |
912 | void AddressbookWindow::slotWrapAround() | 916 | void AddressbookWindow::slotWrapAround() |
913 | { | 917 | { |
914 | qWarning("Got wrap signal!"); | 918 | qWarning("Got wrap signal!"); |
915 | // if ( doNotifyWrapAround ) | 919 | // if ( doNotifyWrapAround ) |
916 | // QMessageBox::information( this, tr( "End of list" ), | 920 | // QMessageBox::information( this, tr( "End of list" ), |
917 | // tr( "End of list. Wrap around now...!" ) + "\n" ); | 921 | // tr( "End of list. Wrap around now...!" ) + "\n" ); |
918 | 922 | ||
919 | } | 923 | } |
920 | 924 | ||
921 | void AddressbookWindow::slotSetCategory( int c ) | 925 | void AddressbookWindow::slotSetCategory( int c ) |
922 | { | 926 | { |
923 | qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() ); | 927 | qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() ); |
924 | 928 | ||
925 | QString cat, book; | 929 | QString cat, book; |
926 | AbView::Views view = AbView::TableView; | 930 | AbView::Views view = AbView::TableView; |
927 | 931 | ||
928 | if ( c <= 0 ) | 932 | if ( c <= 0 ) |
929 | return; | 933 | return; |
930 | 934 | ||
931 | // Switch view | 935 | // Switch view |
932 | if ( c < 3 ) | 936 | if ( c < 3 ) |
933 | for ( unsigned int i = 1; i < 3; i++ ){ | 937 | for ( unsigned int i = 1; i < 3; i++ ){ |
934 | if ( catMenu ) | 938 | if ( catMenu ) |
935 | catMenu->setItemChecked( i, c == (int)i ); | 939 | catMenu->setItemChecked( i, c == (int)i ); |
936 | } | 940 | } |
937 | else | 941 | else |
938 | // Checkmark Category Menu Item Selected | 942 | // Checkmark Category Menu Item Selected |
939 | for ( unsigned int i = 3; i < catMenu->count(); i++ ) | 943 | for ( unsigned int i = 3; i < catMenu->count(); i++ ) |
940 | catMenu->setItemChecked( i, c == (int)i ); | 944 | catMenu->setItemChecked( i, c == (int)i ); |
941 | 945 | ||
942 | // Now switch to the selected category | 946 | // Now switch to the selected category |
943 | for ( unsigned int i = 1; i < catMenu->count(); i++ ) { | 947 | for ( unsigned int i = 1; i < catMenu->count(); i++ ) { |
944 | if (catMenu->isItemChecked( i )) { | 948 | if (catMenu->isItemChecked( i )) { |
945 | if ( i == 1 ){ // default List view | 949 | if ( i == 1 ){ // default List view |
946 | book = QString::null; | 950 | book = QString::null; |
947 | view = AbView::TableView; | 951 | view = AbView::TableView; |
948 | }else if ( i == 2 ){ | 952 | }else if ( i == 2 ){ |
949 | book = tr( "Cards" ); | 953 | book = tr( "Cards" ); |
950 | view = AbView::CardView; | 954 | view = AbView::CardView; |
951 | // }else if ( i == 3 ){ | 955 | // }else if ( i == 3 ){ |
952 | // book = tr( "Personal" ); | 956 | // book = tr( "Personal" ); |
953 | // view = AbView:: PersonalView; | 957 | // view = AbView:: PersonalView; |
954 | }else if ( i == 3 ){ // default All Categories | 958 | }else if ( i == 3 ){ // default All Categories |
955 | cat = QString::null; | 959 | cat = QString::null; |
956 | }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled | 960 | }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled |
957 | cat = "Unfiled"; | 961 | cat = "Unfiled"; |
958 | qWarning ("Unfiled selected!"); | 962 | qWarning ("Unfiled selected!"); |
959 | }else{ | 963 | }else{ |
960 | cat = m_abView->categories()[i - 4]; | 964 | cat = m_abView->categories()[i - 4]; |
961 | } | 965 | } |
962 | } | 966 | } |
963 | } | 967 | } |
964 | 968 | ||
965 | // Switch to the selected View | 969 | // Switch to the selected View |
966 | slotViewSwitched( view ); | 970 | slotViewSwitched( view ); |
967 | 971 | ||
968 | // Tell the view about the selected category | 972 | // Tell the view about the selected category |
969 | m_abView -> setShowByCategory( cat ); | 973 | m_abView -> setShowByCategory( cat ); |
970 | 974 | ||
971 | if ( book.isEmpty() ) | 975 | if ( book.isEmpty() ) |
972 | book = "List"; | 976 | book = "List"; |
973 | if ( cat.isEmpty() ) | 977 | if ( cat.isEmpty() ) |
974 | cat = "All"; | 978 | cat = "All"; |
975 | 979 | ||
976 | setCaption( tr( "Contacts" ) + " - " + book + " - " + tr( cat ) ); | 980 | setCaption( tr( "Contacts" ) + " - " + book + " - " + tr( cat ) ); |
977 | } | 981 | } |
978 | 982 | ||
979 | void AddressbookWindow::slotViewSwitched( int view ) | 983 | void AddressbookWindow::slotViewSwitched( int view ) |
980 | { | 984 | { |
981 | qWarning( "void AddressbookWindow::slotViewSwitched( %d )", view ); | 985 | qWarning( "void AddressbookWindow::slotViewSwitched( %d )", view ); |
982 | int menu = 0; | 986 | int menu = 0; |
983 | 987 | ||
984 | // Switch to selected view | 988 | // Switch to selected view |
985 | switch ( view ){ | 989 | switch ( view ){ |
986 | case AbView::TableView: | 990 | case AbView::TableView: |
987 | menu = 1; | 991 | menu = 1; |
988 | m_tableViewButton->setOn(true); | 992 | m_tableViewButton->setOn(true); |
989 | m_cardViewButton->setOn(false); | 993 | m_cardViewButton->setOn(false); |
990 | break; | 994 | break; |
991 | case AbView::CardView: | 995 | case AbView::CardView: |
992 | menu = 2; | 996 | menu = 2; |
993 | m_tableViewButton->setOn(false); | 997 | m_tableViewButton->setOn(false); |
994 | m_cardViewButton->setOn(true); | 998 | m_cardViewButton->setOn(true); |
995 | break; | 999 | break; |
996 | } | 1000 | } |
997 | for ( unsigned int i = 1; i < 3; i++ ){ | 1001 | for ( unsigned int i = 1; i < 3; i++ ){ |
998 | if ( catMenu ) | 1002 | if ( catMenu ) |
999 | catMenu->setItemChecked( i, menu == (int)i ); | 1003 | catMenu->setItemChecked( i, menu == (int)i ); |
1000 | } | 1004 | } |
1001 | 1005 | ||
1002 | // Tell the view about the selected view | 1006 | // Tell the view about the selected view |
1003 | m_abView -> setShowToView ( (AbView::Views) view ); | 1007 | m_abView -> setShowToView ( (AbView::Views) view ); |
1004 | active_view = view; | 1008 | active_view = view; |
1005 | } | 1009 | } |
1006 | 1010 | ||
1007 | 1011 | ||
1008 | void AddressbookWindow::slotListView() | 1012 | void AddressbookWindow::slotListView() |
1009 | { | 1013 | { |
1010 | slotViewSwitched( AbView::TableView ); | 1014 | slotViewSwitched( AbView::TableView ); |
1011 | } | 1015 | } |
1012 | 1016 | ||
1013 | void AddressbookWindow::slotCardView() | 1017 | void AddressbookWindow::slotCardView() |
1014 | { | 1018 | { |
1015 | slotViewSwitched( AbView::CardView ); | 1019 | slotViewSwitched( AbView::CardView ); |
1016 | } | 1020 | } |
1017 | 1021 | ||
1018 | void AddressbookWindow::slotSetLetter( char c ) { | 1022 | void AddressbookWindow::slotSetLetter( char c ) { |
1019 | 1023 | ||
1020 | m_abView->setShowByLetter( c, m_config.letterPickerSearch() ); | 1024 | m_abView->setShowByLetter( c, m_config.letterPickerSearch() ); |
1021 | 1025 | ||
1022 | } | 1026 | } |
1023 | 1027 | ||
1024 | 1028 | ||
1025 | void AddressbookWindow::populateCategories() | 1029 | void AddressbookWindow::populateCategories() |
1026 | { | 1030 | { |
1027 | catMenu->clear(); | 1031 | catMenu->clear(); |
1028 | 1032 | ||
1029 | int id, rememberId; | 1033 | int id, rememberId; |
1030 | id = 1; | 1034 | id = 1; |
1031 | rememberId = 0; | 1035 | rememberId = 0; |
1032 | 1036 | ||
1033 | catMenu->insertItem( Resource::loadPixmap( "addressbook/listview" ), tr( "List" ), id++ ); | 1037 | catMenu->insertItem( Resource::loadPixmap( "addressbook/listview" ), tr( "List" ), id++ ); |
1034 | catMenu->insertItem( Resource::loadPixmap( "addressbook/cardview" ), tr( "Cards" ), id++ ); | 1038 | catMenu->insertItem( Resource::loadPixmap( "addressbook/cardview" ), tr( "Cards" ), id++ ); |
1035 | // catMenu->insertItem( tr( "Personal" ), id++ ); | 1039 | // catMenu->insertItem( tr( "Personal" ), id++ ); |
1036 | catMenu->insertSeparator(); | 1040 | catMenu->insertSeparator(); |
1037 | 1041 | ||
1038 | catMenu->insertItem( tr( "All" ), id++ ); | 1042 | catMenu->insertItem( tr( "All" ), id++ ); |
1039 | QStringList categories = m_abView->categories(); | 1043 | QStringList categories = m_abView->categories(); |
1040 | categories.append( tr( "Unfiled" ) ); | 1044 | categories.append( tr( "Unfiled" ) ); |
1041 | for ( QStringList::Iterator it = categories.begin(); | 1045 | for ( QStringList::Iterator it = categories.begin(); |
1042 | it != categories.end(); ++it ) { | 1046 | it != categories.end(); ++it ) { |
1043 | catMenu->insertItem( *it, id ); | 1047 | catMenu->insertItem( *it, id ); |
1044 | if ( *it == m_abView -> showCategory() ) | 1048 | if ( *it == m_abView -> showCategory() ) |
1045 | rememberId = id; | 1049 | rememberId = id; |
1046 | ++id; | 1050 | ++id; |
1047 | } | 1051 | } |
1048 | 1052 | ||
1049 | 1053 | ||
1050 | if ( m_abView -> showCategory().isEmpty() ) { | 1054 | if ( m_abView -> showCategory().isEmpty() ) { |
1051 | slotSetCategory( 3 ); | 1055 | slotSetCategory( 3 ); |
1052 | } | 1056 | } |
1053 | else { | 1057 | else { |
1054 | slotSetCategory( rememberId ); | 1058 | slotSetCategory( rememberId ); |
1055 | } | 1059 | } |
1056 | } | 1060 | } |
1057 | 1061 | ||
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index f7a560a..34bcb2a 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h | |||
@@ -1,136 +1,137 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef Addressbook_H | 20 | #ifndef Addressbook_H |
21 | #define Addressbook_H | 21 | #define Addressbook_H |
22 | 22 | ||
23 | // Remove this for OPIE releae 1.0 ! | 23 | // Remove this for OPIE releae 1.0 ! |
24 | // #define __DEBUG_RELEASE | 24 | // #define __DEBUG_RELEASE |
25 | 25 | ||
26 | #include <qmainwindow.h> | 26 | #include <qmainwindow.h> |
27 | #include <qvaluelist.h> | 27 | #include <qvaluelist.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include "ofloatbar.h" | 30 | #include "ofloatbar.h" |
31 | #include "abview.h" | 31 | #include "abview.h" |
32 | #include "abconfig.h" | 32 | #include "abconfig.h" |
33 | 33 | ||
34 | class ContactEditor; | 34 | class ContactEditor; |
35 | class AbLabel; | 35 | class AbLabel; |
36 | class AbTable; | 36 | class AbTable; |
37 | class QPEToolBar; | 37 | class QPEToolBar; |
38 | class QPopupMenu; | 38 | class QPopupMenu; |
39 | class QToolButton; | 39 | class QToolButton; |
40 | class QDialog; | 40 | class QDialog; |
41 | class Ir; | 41 | class Ir; |
42 | class QAction; | 42 | class QAction; |
43 | class LetterPicker; | 43 | class LetterPicker; |
44 | 44 | ||
45 | class AddressbookWindow: public QMainWindow | 45 | class AddressbookWindow: public QMainWindow |
46 | { | 46 | { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | public: | 48 | public: |
49 | enum EntryMode { NewEntry=0, EditEntry }; | 49 | enum EntryMode { NewEntry=0, EditEntry }; |
50 | 50 | ||
51 | static QString appName() { return QString::fromLatin1("addressbook"); } | ||
51 | AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 52 | AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
52 | ~AddressbookWindow(); | 53 | ~AddressbookWindow(); |
53 | 54 | ||
54 | protected: | 55 | protected: |
55 | void resizeEvent( QResizeEvent * e ); | 56 | void resizeEvent( QResizeEvent * e ); |
56 | 57 | ||
57 | void editPersonal(); | 58 | void editPersonal(); |
58 | void editEntry( EntryMode ); | 59 | void editEntry( EntryMode ); |
59 | void closeEvent( QCloseEvent *e ); | 60 | void closeEvent( QCloseEvent *e ); |
60 | bool save(); | 61 | bool save(); |
61 | 62 | ||
62 | public slots: | 63 | public slots: |
63 | void flush(); | 64 | void flush(); |
64 | void reload(); | 65 | void reload(); |
65 | void appMessage(const QCString &, const QByteArray &); | 66 | void appMessage(const QCString &, const QByteArray &); |
66 | void setDocument( const QString & ); | 67 | void setDocument( const QString & ); |
67 | #ifdef __DEBUG_RELEASE | 68 | #ifdef __DEBUG_RELEASE |
68 | // void slotSave(); | 69 | // void slotSave(); |
69 | #endif | 70 | #endif |
70 | 71 | ||
71 | private slots: | 72 | private slots: |
72 | void importvCard(); | 73 | void importvCard(); |
73 | void exportvCard(); | 74 | void exportvCard(); |
74 | void slotListNew(); | 75 | void slotListNew(); |
75 | /* void slotListView(); */ | 76 | /* void slotListView(); */ |
76 | void slotListDelete(); | 77 | void slotListDelete(); |
77 | void slotViewBack(); | 78 | void slotViewBack(); |
78 | void slotViewEdit(); | 79 | void slotViewEdit(); |
79 | void slotPersonalView(); | 80 | void slotPersonalView(); |
80 | void listIsEmpty( bool ); | 81 | void listIsEmpty( bool ); |
81 | /* void slotSettings(); */ | 82 | /* void slotSettings(); */ |
82 | void writeMail(); | 83 | void writeMail(); |
83 | void slotBeam(); | 84 | void slotBeam(); |
84 | void beamDone( Ir * ); | 85 | void beamDone( Ir * ); |
85 | void slotSetCategory( int ); | 86 | void slotSetCategory( int ); |
86 | void slotSetLetter( char ); | 87 | void slotSetLetter( char ); |
87 | void slotUpdateToolbar(); | 88 | void slotUpdateToolbar(); |
88 | void slotSetFont(int); | 89 | void slotSetFont(int); |
89 | 90 | ||
90 | void slotFindOpen(); | 91 | void slotFindOpen(); |
91 | void slotFindClose(); | 92 | void slotFindClose(); |
92 | void slotFind(); | 93 | void slotFind(); |
93 | void slotNotFound(); | 94 | void slotNotFound(); |
94 | void slotWrapAround(); | 95 | void slotWrapAround(); |
95 | 96 | ||
96 | void slotViewSwitched( int ); | 97 | void slotViewSwitched( int ); |
97 | void slotListView(); | 98 | void slotListView(); |
98 | void slotCardView(); | 99 | void slotCardView(); |
99 | 100 | ||
100 | void slotConfig(); | 101 | void slotConfig(); |
101 | 102 | ||
102 | private: | 103 | private: |
103 | void populateCategories(); | 104 | void populateCategories(); |
104 | 105 | ||
105 | QPopupMenu *catMenu; | 106 | QPopupMenu *catMenu; |
106 | QPEToolBar *listTools; | 107 | QPEToolBar *listTools; |
107 | QToolButton *deleteButton; | 108 | QToolButton *deleteButton; |
108 | enum Panes { paneList=0, paneView, paneEdit }; | 109 | enum Panes { paneList=0, paneView, paneEdit }; |
109 | ContactEditor *abEditor; | 110 | ContactEditor *abEditor; |
110 | LetterPicker *pLabel; | 111 | LetterPicker *pLabel; |
111 | AbView* m_abView; | 112 | AbView* m_abView; |
112 | QWidget *listContainer; | 113 | QWidget *listContainer; |
113 | 114 | ||
114 | // Searching stuff | 115 | // Searching stuff |
115 | OFloatBar* searchBar; | 116 | OFloatBar* searchBar; |
116 | QLineEdit* searchEdit; | 117 | QLineEdit* searchEdit; |
117 | 118 | ||
118 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; | 119 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; |
119 | 120 | ||
120 | int viewMargin; | 121 | int viewMargin; |
121 | 122 | ||
122 | bool syncing; | 123 | bool syncing; |
123 | QFont *defaultFont; | 124 | QFont *defaultFont; |
124 | int m_curFontSize; | 125 | int m_curFontSize; |
125 | 126 | ||
126 | bool isLoading; | 127 | bool isLoading; |
127 | 128 | ||
128 | AbConfig m_config; | 129 | AbConfig m_config; |
129 | 130 | ||
130 | QAction* m_tableViewButton; | 131 | QAction* m_tableViewButton; |
131 | QAction* m_cardViewButton; | 132 | QAction* m_cardViewButton; |
132 | 133 | ||
133 | int active_view; | 134 | int active_view; |
134 | }; | 135 | }; |
135 | 136 | ||
136 | #endif | 137 | #endif |
diff --git a/core/pim/addressbook/addressbook.pro b/core/pim/addressbook/addressbook.pro index c90568a..6a04e22 100644 --- a/core/pim/addressbook/addressbook.pro +++ b/core/pim/addressbook/addressbook.pro | |||
@@ -1,51 +1,49 @@ | |||
1 | TEMPLATE= app | 1 | #CONFIG = qt warn_on release quick-app |
2 | #CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on debug quick-app |
3 | CONFIG = qt warn_on debug | ||
4 | DESTDIR = $(OPIEDIR)/bin | ||
5 | HEADERS= addressbook.h \ | 3 | HEADERS= addressbook.h \ |
6 | contacteditor.h \ | 4 | contacteditor.h \ |
7 | ablabel.h \ | 5 | ablabel.h \ |
8 | abtable.h \ | 6 | abtable.h \ |
9 | picker.h \ | 7 | picker.h \ |
10 | ofloatbar.h \ | 8 | ofloatbar.h \ |
11 | configdlg.h \ | 9 | configdlg.h \ |
12 | abconfig.h \ | 10 | abconfig.h \ |
13 | abview.h | 11 | abview.h |
14 | SOURCES= main.cpp \ | 12 | SOURCES= main.cpp \ |
15 | addressbook.cpp \ | 13 | addressbook.cpp \ |
16 | contacteditor.cpp \ | 14 | contacteditor.cpp \ |
17 | ablabel.cpp \ | 15 | ablabel.cpp \ |
18 | abtable.cpp \ | 16 | abtable.cpp \ |
19 | picker.cpp \ | 17 | picker.cpp \ |
20 | configdlg.cpp \ | 18 | configdlg.cpp \ |
21 | abconfig.cpp \ | 19 | abconfig.cpp \ |
22 | abview.cpp | 20 | abview.cpp |
23 | 21 | ||
24 | INTERFACES= configdlg_base.ui | 22 | INTERFACES= configdlg_base.ui |
25 | TARGET = addressbook | 23 | TARGET = addressbook |
26 | INCLUDEPATH += $(OPIEDIR)/include | 24 | INCLUDEPATH += $(OPIEDIR)/include |
27 | DEPENDPATH+= $(OPIEDIR)/include | 25 | DEPENDPATH+= $(OPIEDIR)/include |
28 | LIBS += -lqpe -lopie | 26 | LIBS += -lqpe -lopie |
29 | 27 | ||
30 | TRANSLATIONS = ../../../i18n/de/addressbook.ts \ | 28 | TRANSLATIONS = ../../../i18n/de/addressbook.ts \ |
31 | ../../../i18n/nl/addressbook.ts \ | 29 | ../../../i18n/nl/addressbook.ts \ |
32 | ../../../i18n/da/addressbook.ts \ | 30 | ../../../i18n/da/addressbook.ts \ |
33 | ../../../i18n/xx/addressbook.ts \ | 31 | ../../../i18n/xx/addressbook.ts \ |
34 | ../../../i18n/en/addressbook.ts \ | 32 | ../../../i18n/en/addressbook.ts \ |
35 | ../../../i18n/es/addressbook.ts \ | 33 | ../../../i18n/es/addressbook.ts \ |
36 | ../../../i18n/fr/addressbook.ts \ | 34 | ../../../i18n/fr/addressbook.ts \ |
37 | ../../../i18n/hu/addressbook.ts \ | 35 | ../../../i18n/hu/addressbook.ts \ |
38 | ../../../i18n/ja/addressbook.ts \ | 36 | ../../../i18n/ja/addressbook.ts \ |
39 | ../../../i18n/ko/addressbook.ts \ | 37 | ../../../i18n/ko/addressbook.ts \ |
40 | ../../../i18n/no/addressbook.ts \ | 38 | ../../../i18n/no/addressbook.ts \ |
41 | ../../../i18n/pl/addressbook.ts \ | 39 | ../../../i18n/pl/addressbook.ts \ |
42 | ../../../i18n/pt/addressbook.ts \ | 40 | ../../../i18n/pt/addressbook.ts \ |
43 | ../../../i18n/pt_BR/addressbook.ts \ | 41 | ../../../i18n/pt_BR/addressbook.ts \ |
44 | ../../../i18n/sl/addressbook.ts \ | 42 | ../../../i18n/sl/addressbook.ts \ |
45 | ../../../i18n/zh_CN/addressbook.ts \ | 43 | ../../../i18n/zh_CN/addressbook.ts \ |
46 | ../../../i18n/it/addressbook.ts \ | 44 | ../../../i18n/it/addressbook.ts \ |
47 | ../../../i18n/zh_TW/addressbook.ts | 45 | ../../../i18n/zh_TW/addressbook.ts |
48 | 46 | ||
49 | 47 | ||
50 | 48 | ||
51 | include ( $(OPIEDIR)/include.pro ) | 49 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/pim/addressbook/main.cpp b/core/pim/addressbook/main.cpp index 2ea1819..97bfa6d 100644 --- a/core/pim/addressbook/main.cpp +++ b/core/pim/addressbook/main.cpp | |||
@@ -1,41 +1,28 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "addressbook.h" | 21 | #include "addressbook.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/qcopenvelope_qws.h> | ||
25 | #include <qstring.h> | ||
26 | 24 | ||
27 | int main( int argc, char ** argv ) | 25 | #include <opie/oapplicationfactory.h> |
28 | { | ||
29 | QPEApplication a( argc, argv ); | ||
30 | 26 | ||
31 | AddressbookWindow mw; | 27 | OPIE_EXPORT_APP( OApplicationFactory<AddressbookWindow> ) |
32 | QObject::connect( &a, SIGNAL( flush() ), &mw, SLOT( flush() ) ); | ||
33 | QObject::connect( &a, SIGNAL( reload() ), &mw, SLOT( reload() ) ); | ||
34 | QObject::connect( &a, SIGNAL( appMessage(const QCString &, const QByteArray &) ), | ||
35 | &mw, SLOT( appMessage(const QCString &, const QByteArray &) ) ); | ||
36 | 28 | ||
37 | mw.setCaption( AddressbookWindow::tr("Contacts") ); | ||
38 | a.showMainDocumentWidget(&mw); | ||
39 | |||
40 | return a.exec(); | ||
41 | } | ||
diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h index eeb8666..d7cfb33 100644 --- a/core/pim/datebook/datebook.h +++ b/core/pim/datebook/datebook.h | |||
@@ -1,138 +1,139 @@ | |||
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 | #ifndef DATEBOOK_H | 20 | #ifndef DATEBOOK_H |
21 | #define DATEBOOK_H | 21 | #define DATEBOOK_H |
22 | 22 | ||
23 | #include <qpe/datebookdb.h> | 23 | #include <qpe/datebookdb.h> |
24 | 24 | ||
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | 26 | ||
27 | enum { DAY=1,WEEK,WEEKLST,MONTH };// defaultView values | 27 | enum { DAY=1,WEEK,WEEKLST,MONTH };// defaultView values |
28 | enum { NONE=0,NORMAL,EXTENDED };// WeekLstView's modes. | 28 | enum { NONE=0,NORMAL,EXTENDED };// WeekLstView's modes. |
29 | 29 | ||
30 | class QAction; | 30 | class QAction; |
31 | class QWidgetStack; | 31 | class QWidgetStack; |
32 | class DateBookDay; | 32 | class DateBookDay; |
33 | class DateBookWeek; | 33 | class DateBookWeek; |
34 | class DateBookWeekLst; | 34 | class DateBookWeekLst; |
35 | class DateBookMonth; | 35 | class DateBookMonth; |
36 | class Event; | 36 | class Event; |
37 | class QDate; | 37 | class QDate; |
38 | class Ir; | 38 | class Ir; |
39 | 39 | ||
40 | class DateBookDBHack : public DateBookDB { | 40 | class DateBookDBHack : public DateBookDB { |
41 | public: | 41 | public: |
42 | Event eventByUID(int id); | 42 | Event eventByUID(int id); |
43 | }; | 43 | }; |
44 | 44 | ||
45 | class DateBook : public QMainWindow | 45 | class DateBook : public QMainWindow |
46 | { | 46 | { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | 48 | ||
49 | public: | 49 | public: |
50 | static QString appName() { return QString::fromLatin1("datebook"); } | ||
50 | DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 51 | DateBook( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
51 | ~DateBook(); | 52 | ~DateBook(); |
52 | 53 | ||
53 | signals: | 54 | signals: |
54 | void newEvent(); | 55 | void newEvent(); |
55 | void signalNotFound(); | 56 | void signalNotFound(); |
56 | void signalWrapAround(); | 57 | void signalWrapAround(); |
57 | 58 | ||
58 | protected: | 59 | protected: |
59 | QDate currentDate(); | 60 | QDate currentDate(); |
60 | void timerEvent( QTimerEvent *e ); | 61 | void timerEvent( QTimerEvent *e ); |
61 | void closeEvent( QCloseEvent *e ); | 62 | void closeEvent( QCloseEvent *e ); |
62 | 63 | ||
63 | void view(int v, const QDate &d); | 64 | void view(int v, const QDate &d); |
64 | 65 | ||
65 | public slots: | 66 | public slots: |
66 | void flush(); | 67 | void flush(); |
67 | void reload(); | 68 | void reload(); |
68 | 69 | ||
69 | private slots: | 70 | private slots: |
70 | void fileNew(); | 71 | void fileNew(); |
71 | void slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str, const QString &location=0); | 72 | void slotNewEntry(const QDateTime &start, const QDateTime &end, const QString &str, const QString &location=0); |
72 | void slotSettings(); | 73 | void slotSettings(); |
73 | void slotToday();// view today | 74 | void slotToday();// view today |
74 | void changeClock( bool newClock ); | 75 | void changeClock( bool newClock ); |
75 | void changeWeek( bool newDay ); | 76 | void changeWeek( bool newDay ); |
76 | void appMessage(const QCString& msg, const QByteArray& data); | 77 | void appMessage(const QCString& msg, const QByteArray& data); |
77 | // handle key events in the day view... | 78 | // handle key events in the day view... |
78 | void slotNewEventFromKey( const QString &str ); | 79 | void slotNewEventFromKey( const QString &str ); |
79 | void slotFind(); | 80 | void slotFind(); |
80 | void slotDoFind( const QString &, const QDate &, bool, bool, int ); | 81 | void slotDoFind( const QString &, const QDate &, bool, bool, int ); |
81 | 82 | ||
82 | void viewDefault(const QDate &d); | 83 | void viewDefault(const QDate &d); |
83 | 84 | ||
84 | void viewDay(); | 85 | void viewDay(); |
85 | void viewWeek(); | 86 | void viewWeek(); |
86 | void viewWeekLst(); | 87 | void viewWeekLst(); |
87 | void viewMonth(); | 88 | void viewMonth(); |
88 | 89 | ||
89 | void showDay( int y, int m, int d ); | 90 | void showDay( int y, int m, int d ); |
90 | 91 | ||
91 | void insertEvent( const Event &e ); | 92 | void insertEvent( const Event &e ); |
92 | void editEvent( const Event &e ); | 93 | void editEvent( const Event &e ); |
93 | void duplicateEvent( const Event &e ); | 94 | void duplicateEvent( const Event &e ); |
94 | void removeEvent( const Event &e ); | 95 | void removeEvent( const Event &e ); |
95 | 96 | ||
96 | void receive( const QCString &msg, const QByteArray &data ); | 97 | void receive( const QCString &msg, const QByteArray &data ); |
97 | void setDocument( const QString & ); | 98 | void setDocument( const QString & ); |
98 | void beamEvent( const Event &e ); | 99 | void beamEvent( const Event &e ); |
99 | void beamDone( Ir *ir ); | 100 | void beamDone( Ir *ir ); |
100 | 101 | ||
101 | private: | 102 | private: |
102 | void addEvent( const Event &e ); | 103 | void addEvent( const Event &e ); |
103 | void initDay(); | 104 | void initDay(); |
104 | void initWeek(); | 105 | void initWeek(); |
105 | void initWeekLst(); | 106 | void initWeekLst(); |
106 | void initMonth(); | 107 | void initMonth(); |
107 | void loadSettings(); | 108 | void loadSettings(); |
108 | void saveSettings(); | 109 | void saveSettings(); |
109 | 110 | ||
110 | private: | 111 | private: |
111 | DateBookDBHack *db; | 112 | DateBookDBHack *db; |
112 | QWidgetStack *views; | 113 | QWidgetStack *views; |
113 | DateBookDay *dayView; | 114 | DateBookDay *dayView; |
114 | DateBookWeek *weekView; | 115 | DateBookWeek *weekView; |
115 | DateBookMonth *monthView; | 116 | DateBookMonth *monthView; |
116 | DateBookWeekLst *weekLstView; | 117 | DateBookWeekLst *weekLstView; |
117 | QAction *dayAction, *weekAction, *weekLstAction, *monthAction; | 118 | QAction *dayAction, *weekAction, *weekLstAction, *monthAction; |
118 | int weeklistviewconfig; | 119 | int weeklistviewconfig; |
119 | bool aPreset; // have everything set to alarm? | 120 | bool aPreset; // have everything set to alarm? |
120 | int presetTime; // the standard time for the alarm | 121 | int presetTime; // the standard time for the alarm |
121 | int startTime; | 122 | int startTime; |
122 | int rowStyle; | 123 | int rowStyle; |
123 | int defaultView; | 124 | int defaultView; |
124 | QArray<int> defaultCategories; | 125 | QArray<int> defaultCategories; |
125 | QString defaultLocation; | 126 | QString defaultLocation; |
126 | bool bJumpToCurTime; //should jump to current time in dayview? | 127 | bool bJumpToCurTime; //should jump to current time in dayview? |
127 | bool ampm; | 128 | bool ampm; |
128 | bool onMonday; | 129 | bool onMonday; |
129 | 130 | ||
130 | bool syncing; | 131 | bool syncing; |
131 | bool inSearch; | 132 | bool inSearch; |
132 | 133 | ||
133 | int alarmCounter; | 134 | int alarmCounter; |
134 | 135 | ||
135 | QString checkEvent(const Event &); | 136 | QString checkEvent(const Event &); |
136 | }; | 137 | }; |
137 | 138 | ||
138 | #endif | 139 | #endif |
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro index ae30c8d..6f2d775 100644 --- a/core/pim/datebook/datebook.pro +++ b/core/pim/datebook/datebook.pro | |||
@@ -1,63 +1,61 @@ | |||
1 | TEMPLATE= app | 1 | CONFIG += qt warn_on release quick-app |
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS= datebookday.h \ | 2 | HEADERS= datebookday.h \ |
5 | datebook.h \ | 3 | datebook.h \ |
6 | dateentryimpl.h \ | 4 | dateentryimpl.h \ |
7 | datebookdayheaderimpl.h \ | 5 | datebookdayheaderimpl.h \ |
8 | datebooksettings.h \ | 6 | datebooksettings.h \ |
9 | datebookweek.h \ | 7 | datebookweek.h \ |
10 | datebookweeklst.h \ | 8 | datebookweeklst.h \ |
11 | datebookweekheaderimpl.h \ | 9 | datebookweekheaderimpl.h \ |
12 | repeatentry.h \ | 10 | repeatentry.h \ |
13 | noteentryimpl.h \ | 11 | noteentryimpl.h \ |
14 | onoteedit.h \ | 12 | onoteedit.h \ |
15 | datebookdayallday.h | 13 | datebookdayallday.h |
16 | SOURCES= main.cpp \ | 14 | SOURCES= main.cpp \ |
17 | datebookday.cpp \ | 15 | datebookday.cpp \ |
18 | datebook.cpp \ | 16 | datebook.cpp \ |
19 | dateentryimpl.cpp \ | 17 | dateentryimpl.cpp \ |
20 | datebookdayheaderimpl.cpp \ | 18 | datebookdayheaderimpl.cpp \ |
21 | datebooksettings.cpp \ | 19 | datebooksettings.cpp \ |
22 | datebookweek.cpp \ | 20 | datebookweek.cpp \ |
23 | datebookweeklst.cpp \ | 21 | datebookweeklst.cpp \ |
24 | datebookweekheaderimpl.cpp \ | 22 | datebookweekheaderimpl.cpp \ |
25 | repeatentry.cpp \ | 23 | repeatentry.cpp \ |
26 | noteentryimpl.cpp \ | 24 | noteentryimpl.cpp \ |
27 | onoteedit.cpp \ | 25 | onoteedit.cpp \ |
28 | datebookdayallday.cpp | 26 | datebookdayallday.cpp |
29 | INTERFACES= dateentry.ui \ | 27 | INTERFACES= dateentry.ui \ |
30 | datebookdayheader.ui \ | 28 | datebookdayheader.ui \ |
31 | datebookweekheader.ui \ | 29 | datebookweekheader.ui \ |
32 | datebookweeklstheader.ui \ | 30 | datebookweeklstheader.ui \ |
33 | datebookweeklstdayhdr.ui \ | 31 | datebookweeklstdayhdr.ui \ |
34 | repeatentrybase.ui \ | 32 | repeatentrybase.ui \ |
35 | datebooksettingsbase.ui \ | 33 | datebooksettingsbase.ui \ |
36 | noteentry.ui | 34 | noteentry.ui |
37 | INCLUDEPATH += $(OPIEDIR)/include | 35 | INCLUDEPATH += $(OPIEDIR)/include |
38 | DEPENDPATH+= $(OPIEDIR)/include | 36 | DEPENDPATH+= $(OPIEDIR)/include |
39 | LIBS += -lqpe -lopie | 37 | LIBS += -lqpe -lopie |
40 | TARGET = datebook | 38 | TARGET = datebook |
41 | 39 | ||
42 | TRANSLATIONS = ../../../i18n/de/datebook.ts \ | 40 | TRANSLATIONS = ../../../i18n/de/datebook.ts \ |
43 | ../../../i18n/nl/datebook.ts \ | 41 | ../../../i18n/nl/datebook.ts \ |
44 | ../../../i18n/xx/datebook.ts \ | 42 | ../../../i18n/xx/datebook.ts \ |
45 | ../../../i18n/en/datebook.ts \ | 43 | ../../../i18n/en/datebook.ts \ |
46 | ../../../i18n/es/datebook.ts \ | 44 | ../../../i18n/es/datebook.ts \ |
47 | ../../../i18n/fr/datebook.ts \ | 45 | ../../../i18n/fr/datebook.ts \ |
48 | ../../../i18n/hu/datebook.ts \ | 46 | ../../../i18n/hu/datebook.ts \ |
49 | ../../../i18n/ja/datebook.ts \ | 47 | ../../../i18n/ja/datebook.ts \ |
50 | ../../../i18n/ko/datebook.ts \ | 48 | ../../../i18n/ko/datebook.ts \ |
51 | ../../../i18n/no/datebook.ts \ | 49 | ../../../i18n/no/datebook.ts \ |
52 | ../../../i18n/pl/datebook.ts \ | 50 | ../../../i18n/pl/datebook.ts \ |
53 | ../../../i18n/pt/datebook.ts \ | 51 | ../../../i18n/pt/datebook.ts \ |
54 | ../../../i18n/pt_BR/datebook.ts \ | 52 | ../../../i18n/pt_BR/datebook.ts \ |
55 | ../../../i18n/sl/datebook.ts \ | 53 | ../../../i18n/sl/datebook.ts \ |
56 | ../../../i18n/zh_CN/datebook.ts \ | 54 | ../../../i18n/zh_CN/datebook.ts \ |
57 | ../../../i18n/it/datebook.ts \ | 55 | ../../../i18n/it/datebook.ts \ |
58 | ../../../i18n/zh_TW/datebook.ts \ | 56 | ../../../i18n/zh_TW/datebook.ts \ |
59 | ../../../i18n/da/datebook.ts | 57 | ../../../i18n/da/datebook.ts |
60 | 58 | ||
61 | 59 | ||
62 | 60 | ||
63 | include ( $(OPIEDIR)/include.pro ) | 61 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/pim/datebook/main.cpp b/core/pim/datebook/main.cpp index caa5fb6..8004690 100644 --- a/core/pim/datebook/main.cpp +++ b/core/pim/datebook/main.cpp | |||
@@ -1,38 +1,25 @@ | |||
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> | 22 | #include <qpe/qpeapplication.h> |
23 | 23 | #include <opie/oapplicationfactory.h> | |
24 | 24 | ||
25 | int main( int argc, char **argv ) | 25 | OPIE_EXPORT_APP( OApplicationFactory<DateBook> ) |
26 | { | ||
27 | QPEApplication a( argc, argv ); | ||
28 | |||
29 | DateBook e; | ||
30 | QObject::connect( &a, SIGNAL( flush() ), &e, SLOT( flush() ) ); | ||
31 | QObject::connect( &a, SIGNAL( reload() ), &e, SLOT( reload() ) ); | ||
32 | |||
33 | |||
34 | e.setCaption( DateBook::tr("Calendar") ); | ||
35 | a.showMainWidget(&e); | ||
36 | |||
37 | return a.exec(); | ||
38 | } | ||
diff --git a/core/pim/osearch/main.cpp b/core/pim/osearch/main.cpp index 6c18adb..9a03818 100644 --- a/core/pim/osearch/main.cpp +++ b/core/pim/osearch/main.cpp | |||
@@ -1,14 +1,7 @@ | |||
1 | 1 | ||
2 | #include "mainwindow.h" | 2 | #include "mainwindow.h" |
3 | 3 | ||
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <opie/oapplicationfactory.h> | ||
5 | 6 | ||
6 | int main( int argc, char ** argv ) | 7 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
7 | { | ||
8 | |||
9 | QPEApplication a( argc, argv ); | ||
10 | MainWindow mw; | ||
11 | mw.showMaximized(); | ||
12 | a.showMainDocumentWidget( &mw ); | ||
13 | return a.exec(); | ||
14 | } | ||
diff --git a/core/pim/osearch/osearch.pro b/core/pim/osearch/osearch.pro index 2e571e3..c988f48 100644 --- a/core/pim/osearch/osearch.pro +++ b/core/pim/osearch/osearch.pro | |||
@@ -1,40 +1,39 @@ | |||
1 | DEPENDPATH += $(OPIEDIR)/include | 1 | CONFIG += qt release warn_on quick-app |
2 | LIBS += -lqpe -lopie | ||
3 | INTERFACES = | ||
4 | include ( $(OPIEDIR)/include.pro ) | ||
5 | TEMPLATE = app | ||
6 | CONFIG += debug warn_on qt | ||
7 | DESTDIR = $(OPIEDIR)/bin | ||
8 | TARGET = osearch | ||
9 | INCLUDEPATH = $(OPIEDIR)/include | ||
10 | SOURCES += main.cpp \ | 2 | SOURCES += main.cpp \ |
11 | mainwindow.cpp \ | 3 | mainwindow.cpp \ |
12 | olistview.cpp \ | 4 | olistview.cpp \ |
13 | olistviewitem.cpp \ | 5 | olistviewitem.cpp \ |
14 | adresssearch.cpp \ | 6 | adresssearch.cpp \ |
15 | todosearch.cpp \ | 7 | todosearch.cpp \ |
16 | datebooksearch.cpp \ | 8 | datebooksearch.cpp \ |
17 | searchgroup.cpp \ | 9 | searchgroup.cpp \ |
18 | resultitem.cpp \ | 10 | resultitem.cpp \ |
19 | todoitem.cpp \ | 11 | todoitem.cpp \ |
20 | contactitem.cpp \ | 12 | contactitem.cpp \ |
21 | eventitem.cpp \ | 13 | eventitem.cpp \ |
22 | applnksearch.cpp \ | 14 | applnksearch.cpp \ |
23 | applnkitem.cpp \ | 15 | applnkitem.cpp \ |
24 | doclnkitem.cpp \ | 16 | doclnkitem.cpp \ |
25 | doclnksearch.cpp | 17 | doclnksearch.cpp |
26 | HEADERS += mainwindow.h \ | 18 | HEADERS += mainwindow.h \ |
27 | olistview.h \ | 19 | olistview.h \ |
28 | olistviewitem.h \ | 20 | olistviewitem.h \ |
29 | adresssearch.h \ | 21 | adresssearch.h \ |
30 | todosearch.h \ | 22 | todosearch.h \ |
31 | datebooksearch.h \ | 23 | datebooksearch.h \ |
32 | searchgroup.h \ | 24 | searchgroup.h \ |
33 | resultitem.h \ | 25 | resultitem.h \ |
34 | todoitem.h \ | 26 | todoitem.h \ |
35 | contactitem.h \ | 27 | contactitem.h \ |
36 | eventitem.h \ | 28 | eventitem.h \ |
37 | applnksearch.h \ | 29 | applnksearch.h \ |
38 | applnkitem.h \ | 30 | applnkitem.h \ |
39 | doclnkitem.h \ | 31 | doclnkitem.h \ |
40 | doclnksearch.h | 32 | doclnksearch.h |
33 | |||
34 | TARGET= osearch | ||
35 | |||
36 | INCLUDEPATH = $(OPIEDIR)/include | ||
37 | DEPENDPATH += $(OPIEDIR)/include | ||
38 | LIBS += -lqpe -lopie | ||
39 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/core/pim/today/today.pro b/core/pim/today/today.pro index 218cab8..26692cc 100644 --- a/core/pim/today/today.pro +++ b/core/pim/today/today.pro | |||
@@ -1,46 +1,30 @@ | |||
1 | CONFIG = qt warn_on | 1 | CONFIG += qt warn on release quick-app |
2 | #CONFIG = qt warn_on release | ||
3 | 2 | ||
4 | HEADERS = today.h todaybase.h todayconfig.h | 3 | HEADERS = today.h todaybase.h todayconfig.h |
5 | SOURCES = today.cpp todaybase.cpp todayconfig.cpp | 4 | SOURCES = today.cpp todaybase.cpp todayconfig.cpp |
6 | INCLUDEPATH+= $(OPIEDIR)/include | 5 | INCLUDEPATH+= $(OPIEDIR)/include |
7 | DEPENDPATH+= $(OPIEDIR)/include | 6 | DEPENDPATH+= $(OPIEDIR)/include |
8 | LIBS += -lqpe -lopie | 7 | LIBS += -lqpe -lopie |
9 | INTERFACES= | 8 | INTERFACES= |
10 | TARGET = today | 9 | TARGET = today |
11 | 10 | ||
12 | TRANSLATIONS = ../../../i18n/de/today.ts \ | 11 | TRANSLATIONS = ../../../i18n/de/today.ts \ |
13 | ../../../i18n/nl/today.ts \ | 12 | ../../../i18n/nl/today.ts \ |
14 | ../../../i18n/xx/today.ts \ | 13 | ../../../i18n/xx/today.ts \ |
15 | ../../../i18n/en/today.ts \ | 14 | ../../../i18n/en/today.ts \ |
16 | ../../../i18n/es/today.ts \ | 15 | ../../../i18n/es/today.ts \ |
17 | ../../../i18n/fr/today.ts \ | 16 | ../../../i18n/fr/today.ts \ |
18 | ../../../i18n/hu/today.ts \ | 17 | ../../../i18n/hu/today.ts \ |
19 | ../../../i18n/ja/today.ts \ | 18 | ../../../i18n/ja/today.ts \ |
20 | ../../../i18n/ko/today.ts \ | 19 | ../../../i18n/ko/today.ts \ |
21 | ../../../i18n/no/today.ts \ | 20 | ../../../i18n/no/today.ts \ |
22 | ../../../i18n/pl/today.ts \ | 21 | ../../../i18n/pl/today.ts \ |
23 | ../../../i18n/pt/today.ts \ | 22 | ../../../i18n/pt/today.ts \ |
24 | ../../../i18n/pt_BR/today.ts \ | 23 | ../../../i18n/pt_BR/today.ts \ |
25 | ../../../i18n/sl/today.ts \ | 24 | ../../../i18n/sl/today.ts \ |
26 | ../../../i18n/zh_CN/today.ts \ | 25 | ../../../i18n/zh_CN/today.ts \ |
27 | ../../../i18n/zh_TW/today.ts \ | 26 | ../../../i18n/zh_TW/today.ts \ |
28 | ../../../i18n/it/today.ts \ | 27 | ../../../i18n/it/today.ts \ |
29 | ../../../i18n/da/today.ts | 28 | ../../../i18n/da/today.ts |
30 | 29 | ||
31 | include ( $(OPIEDIR)/include.pro ) | 30 | include ( $(OPIEDIR)/include.pro ) |
32 | |||
33 | oapp { | ||
34 | TEMPLATE= lib | ||
35 | SOURCES += plugin.cpp | ||
36 | LIBS += -loapp | ||
37 | |||
38 | DESTDIR = $(OPIEDIR)/plugins/app | ||
39 | INCLUDEPATH+= $(OPIEDIR)/core/apps/oapp | ||
40 | DEPENDPATH+= $(OPIEDIR)/core/apps/oapp | ||
41 | } | ||
42 | else { | ||
43 | TEMPLATE= app | ||
44 | SOURCES += main.cpp | ||
45 | DESTDIR = $(OPIEDIR)/bin | ||
46 | } | ||
diff --git a/noncore/apps/opie-reader/opie-reader.control b/noncore/apps/opie-reader/opie-reader.control index eab3ef0..841b040 100644 --- a/noncore/apps/opie-reader/opie-reader.control +++ b/noncore/apps/opie-reader/opie-reader.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-reader | 1 | Package: opie-reader |
2 | Files: plugins/application/libreader.so* bin/reader apps/Applications/opie-reader.desktop pics/opie-reader/* | 2 | Files: bin/reader bin/reader apps/Applications/opie-reader.desktop pics/opie-reader/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: applications | 4 | Section: applications |
5 | Maintainer: Tim Wentford <timwentford@hotmail.com> | 5 | Maintainer: Tim Wentford <timwentford@hotmail.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
8 | License: GPL | 8 | License: GPL |
9 | Description: E-Book reader | 9 | Description: E-Book reader |
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |
diff --git a/noncore/multimedia/opierec/main.cpp b/noncore/multimedia/opierec/main.cpp index 5f7c02f..4a94800 100644 --- a/noncore/multimedia/opierec/main.cpp +++ b/noncore/multimedia/opierec/main.cpp | |||
@@ -1,22 +1,16 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | main.cpp - main routine | 2 | main.cpp - main routine |
3 | ***************************************************************************/ | 3 | ***************************************************************************/ |
4 | //// main.cpp | 4 | //// main.cpp |
5 | //// copyright 2001, 2002, by L. J. Potter <ljp@llornkcor.com> | 5 | //// copyright 2001, 2002, by L. J. Potter <ljp@llornkcor.com> |
6 | /*************************************************************************** | 6 | /*************************************************************************** |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "qtrec.h" | 12 | #include "qtrec.h" |
13 | #include <qpe/qpeapplication.h> | 13 | #include <qpe/qpeapplication.h> |
14 | 14 | #include <opie/oapplicationfactory.h> | |
15 | int main(int argc, char* argv[]) { | 15 | |
16 | QPEApplication a(argc, argv); | 16 | OPIE_EXPORT_APP( OApplicationFactory<QtRec> ) |
17 | QtRec qtrec; | ||
18 | a.showMainWidget( &qtrec); | ||
19 | return a.exec(); | ||
20 | } | ||
21 | |||
22 | |||
diff --git a/noncore/multimedia/opierec/opierec.pro b/noncore/multimedia/opierec/opierec.pro index 3447f99..aa14864 100644 --- a/noncore/multimedia/opierec/opierec.pro +++ b/noncore/multimedia/opierec/opierec.pro | |||
@@ -1,13 +1,11 @@ | |||
1 | TEMPLATE = app | ||
2 | #CONFIG = qt warn_on debug | 1 | #CONFIG = qt warn_on debug |
3 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release quick-app |
4 | HEADERS = adpcm.h pixmaps.h helpwindow.h qtrec.h device.h wavFile.h | 3 | HEADERS = adpcm.h pixmaps.h helpwindow.h qtrec.h device.h wavFile.h |
5 | SOURCES = adpcm.c helpwindow.cpp main.cpp qtrec.cpp device.cpp wavFile.cpp | 4 | SOURCES = adpcm.c helpwindow.cpp main.cpp qtrec.cpp device.cpp wavFile.cpp |
6 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
8 | LIBS += -lqpe -lstdc++ -lpthread | 7 | LIBS += -lqpe -lstdc++ -lpthread |
9 | INTERFACES = | 8 | INTERFACES = |
10 | TARGET = opierec | 9 | TARGET = opierec |
11 | DESTDIR = $(OPIEDIR)/bin | ||
12 | #TMAKE_CXXFLAGS += -DQT_QWS_VERCEL_IDR -DQWS -fno-exceptions -fno-rtti | 10 | #TMAKE_CXXFLAGS += -DQT_QWS_VERCEL_IDR -DQWS -fno-exceptions -fno-rtti |
13 | include ( $(OPIEDIR)/include.pro ) | 11 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/multimedia/opierec/qtrec.h b/noncore/multimedia/opierec/qtrec.h index 7965c74..5d6ed62 100644 --- a/noncore/multimedia/opierec/qtrec.h +++ b/noncore/multimedia/opierec/qtrec.h | |||
@@ -1,185 +1,186 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Created: Thu Jan 17 11:19:45 2002 | 2 | ** Created: Thu Jan 17 11:19:45 2002 |
3 | copyright 2002 by L.J. Potter ljp@llornkcor.com | 3 | copyright 2002 by L.J. Potter ljp@llornkcor.com |
4 | ****************************************************************************/ | 4 | ****************************************************************************/ |
5 | #ifndef QTREC_H | 5 | #ifndef QTREC_H |
6 | #define QTREC_H | 6 | #define QTREC_H |
7 | #define VERSION 1.0 | 7 | #define VERSION 1.0 |
8 | 8 | ||
9 | #include <qpe/ir.h> | 9 | #include <qpe/ir.h> |
10 | 10 | ||
11 | #include <iostream.h> | 11 | #include <iostream.h> |
12 | #include <qfile.h> | 12 | #include <qfile.h> |
13 | #include <qimage.h> | 13 | #include <qimage.h> |
14 | #include <qlineedit.h> | 14 | #include <qlineedit.h> |
15 | #include <qpixmap.h> | 15 | #include <qpixmap.h> |
16 | #include <qvariant.h> | 16 | #include <qvariant.h> |
17 | #include <qwidget.h> | 17 | #include <qwidget.h> |
18 | #include <stdio.h> | 18 | #include <stdio.h> |
19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
20 | 20 | ||
21 | #include "device.h" | 21 | #include "device.h" |
22 | #include "wavFile.h" | 22 | #include "wavFile.h" |
23 | 23 | ||
24 | class QButtonGroup; | 24 | class QButtonGroup; |
25 | class QCheckBox; | 25 | class QCheckBox; |
26 | class QComboBox; | 26 | class QComboBox; |
27 | class QGridLayout; | 27 | class QGridLayout; |
28 | class QGroupBox; | 28 | class QGroupBox; |
29 | class QHBoxLayout; | 29 | class QHBoxLayout; |
30 | class QIconView; | 30 | class QIconView; |
31 | class QIconViewItem; | 31 | class QIconViewItem; |
32 | class QLabel; | 32 | class QLabel; |
33 | class QLabel; | 33 | class QLabel; |
34 | class QListView; | 34 | class QListView; |
35 | class QListViewItem; | 35 | class QListViewItem; |
36 | class QPushButton; | 36 | class QPushButton; |
37 | class QSlider; | 37 | class QSlider; |
38 | class QTabWidget; | 38 | class QTabWidget; |
39 | class QTimer; | 39 | class QTimer; |
40 | class QVBoxLayout; | 40 | class QVBoxLayout; |
41 | class QLineEdit; | 41 | class QLineEdit; |
42 | 42 | ||
43 | #define MAX_TRACKS 2 | 43 | #define MAX_TRACKS 2 |
44 | //#define BUFSIZE 4096 | 44 | //#define BUFSIZE 4096 |
45 | // #define BUFSIZE 8182 //Z default buffer size | 45 | // #define BUFSIZE 8182 //Z default buffer size |
46 | #define BUFSIZE 1024 | 46 | #define BUFSIZE 1024 |
47 | //#define BUFSIZE 2048 | 47 | //#define BUFSIZE 2048 |
48 | #define FRAGSIZE 0x7fff000A; | 48 | #define FRAGSIZE 0x7fff000A; |
49 | 49 | ||
50 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) | 50 | #define WAVE_FORMAT_DVI_ADPCM (0x0011) |
51 | #define WAVE_FORMAT_PCM (0x0001) | 51 | #define WAVE_FORMAT_PCM (0x0001) |
52 | //AFMT_IMA_ADPCM | 52 | //AFMT_IMA_ADPCM |
53 | 53 | ||
54 | class QtRec : public QWidget | 54 | class QtRec : public QWidget |
55 | { | 55 | { |
56 | Q_OBJECT | 56 | Q_OBJECT |
57 | 57 | ||
58 | public: | 58 | public: |
59 | static QString appName() { return QString::fromLatin1("opierec"); } | ||
59 | QtRec( QWidget* parent=0, const char* name=0, WFlags fl=0 ); | 60 | QtRec( QWidget* parent=0, const char* name=0, WFlags fl=0 ); |
60 | ~QtRec(); | 61 | ~QtRec(); |
61 | QSlider *OutputSlider,*InputSlider; | 62 | QSlider *OutputSlider,*InputSlider; |
62 | 63 | ||
63 | public slots: | 64 | public slots: |
64 | private: | 65 | private: |
65 | // int fragment; | 66 | // int fragment; |
66 | int fd1; | 67 | int fd1; |
67 | int secCount; | 68 | int secCount; |
68 | QString timeString; | 69 | QString timeString; |
69 | 70 | ||
70 | QLineEdit *renameBox; | 71 | QLineEdit *renameBox; |
71 | QGroupBox* GroupBox1; | 72 | QGroupBox* GroupBox1; |
72 | QString currentFile; | 73 | QString currentFile; |
73 | QString date, currentFileName, tmpFileName; | 74 | QString date, currentFileName, tmpFileName; |
74 | QTimer *t_timer; | 75 | QTimer *t_timer; |
75 | bool needsStereoOut, paused, playing; | 76 | bool needsStereoOut, paused, playing; |
76 | bool useTmpFile, autoMute; | 77 | bool useTmpFile, autoMute; |
77 | 78 | ||
78 | bool eventFilter( QObject * , QEvent * ); | 79 | bool eventFilter( QObject * , QEvent * ); |
79 | void okRename(); | 80 | void okRename(); |
80 | void cancelRename(); | 81 | void cancelRename(); |
81 | QString getStorage(const QString &); | 82 | QString getStorage(const QString &); |
82 | bool rec(); | 83 | bool rec(); |
83 | int getCurrentSizeLimit(); | 84 | int getCurrentSizeLimit(); |
84 | long checkDiskSpace(const QString &); | 85 | long checkDiskSpace(const QString &); |
85 | void doMute(bool); | 86 | void doMute(bool); |
86 | void errorStop(); | 87 | void errorStop(); |
87 | void fillDirectoryCombo(); | 88 | void fillDirectoryCombo(); |
88 | void getInVol(); | 89 | void getInVol(); |
89 | void getOutVol(); | 90 | void getOutVol(); |
90 | void init(); | 91 | void init(); |
91 | void initConfig(); | 92 | void initConfig(); |
92 | void initConnections(); | 93 | void initConnections(); |
93 | void selectItemByName(const QString &); | 94 | void selectItemByName(const QString &); |
94 | void setRecordButton(bool); | 95 | void setRecordButton(bool); |
95 | void start(); | 96 | void start(); |
96 | void stop(); | 97 | void stop(); |
97 | void timerEvent( QTimerEvent *e ); | 98 | void timerEvent( QTimerEvent *e ); |
98 | 99 | ||
99 | private slots: | 100 | private slots: |
100 | 101 | ||
101 | 102 | ||
102 | void FastforwardPressed(); | 103 | void FastforwardPressed(); |
103 | void FastforwardReleased(); | 104 | void FastforwardReleased(); |
104 | void changeDirCombo(int); | 105 | void changeDirCombo(int); |
105 | void changeSizeLimitCombo(int); | 106 | void changeSizeLimitCombo(int); |
106 | void changeTimeSlider(int); | 107 | void changeTimeSlider(int); |
107 | void changebitrateCombo(int); | 108 | void changebitrateCombo(int); |
108 | void changedInVolume(); | 109 | void changedInVolume(); |
109 | void changedOutVolume(); | 110 | void changedOutVolume(); |
110 | void changesamplerateCombo(int); | 111 | void changesamplerateCombo(int); |
111 | void cleanUp(); | 112 | void cleanUp(); |
112 | void compressionSelected(bool); | 113 | void compressionSelected(bool); |
113 | void deleteSound(); | 114 | void deleteSound(); |
114 | void doBeam(); | 115 | void doBeam(); |
115 | void doMenuPlay(); | 116 | void doMenuPlay(); |
116 | void doMicMuting(bool); | 117 | void doMicMuting(bool); |
117 | void doPlayBtn(); | 118 | void doPlayBtn(); |
118 | void doRename(); | 119 | void doRename(); |
119 | void doVolMuting(bool); | 120 | void doVolMuting(bool); |
120 | void forwardTimerTimeout(); | 121 | void forwardTimerTimeout(); |
121 | void itClick(QListViewItem *item); | 122 | void itClick(QListViewItem *item); |
122 | void listPressed(int, QListViewItem *, const QPoint&, int); | 123 | void listPressed(int, QListViewItem *, const QPoint&, int); |
123 | void newSound(); | 124 | void newSound(); |
124 | void rewindPressed(); | 125 | void rewindPressed(); |
125 | void rewindReleased(); | 126 | void rewindReleased(); |
126 | void rewindTimerTimeout(); | 127 | void rewindTimerTimeout(); |
127 | void slotAutoMute(bool); | 128 | void slotAutoMute(bool); |
128 | void thisTab(QWidget*); | 129 | void thisTab(QWidget*); |
129 | void timeSliderPressed(); | 130 | void timeSliderPressed(); |
130 | void timeSliderReleased(); | 131 | void timeSliderReleased(); |
131 | void timerBreak(); | 132 | void timerBreak(); |
132 | /* void changedOutVolume(int); */ | 133 | /* void changedOutVolume(int); */ |
133 | /* void changedInVolume(int); */ | 134 | /* void changedInVolume(int); */ |
134 | 135 | ||
135 | protected: | 136 | protected: |
136 | 137 | ||
137 | Device *soundDevice; | 138 | Device *soundDevice; |
138 | WavFile *wavFile; | 139 | WavFile *wavFile; |
139 | 140 | ||
140 | QButtonGroup *ButtonGroup1; | 141 | QButtonGroup *ButtonGroup1; |
141 | QCheckBox *outMuteCheckBox, *inMuteCheckBox, *compressionCheckBox, *autoMuteCheckBox; | 142 | QCheckBox *outMuteCheckBox, *inMuteCheckBox, *compressionCheckBox, *autoMuteCheckBox; |
142 | QComboBox* sampleRateComboBox, * bitRateComboBox, *directoryComboBox, *sizeLimitCombo; | 143 | QComboBox* sampleRateComboBox, * bitRateComboBox, *directoryComboBox, *sizeLimitCombo; |
143 | QHBoxLayout* Layout12; | 144 | QHBoxLayout* Layout12; |
144 | QHBoxLayout* Layout13; | 145 | QHBoxLayout* Layout13; |
145 | QHBoxLayout* Layout14; | 146 | QHBoxLayout* Layout14; |
146 | QHBoxLayout* Layout16; | 147 | QHBoxLayout* Layout16; |
147 | QHBoxLayout* Layout17; | 148 | QHBoxLayout* Layout17; |
148 | QHBoxLayout* Layout19; | 149 | QHBoxLayout* Layout19; |
149 | QIconView *IconView1; | 150 | QIconView *IconView1; |
150 | QLabel *NewSoundLabel,*playLabel2; | 151 | QLabel *NewSoundLabel,*playLabel2; |
151 | QLabel *TextLabel3, *TextLabel1, *TextLabel2; | 152 | QLabel *TextLabel3, *TextLabel1, *TextLabel2; |
152 | QListView *ListView1; | 153 | QListView *ListView1; |
153 | QPushButton *Stop_PushButton, *Play_PushButton, *Rec_PushButton, *NewSoundButton, *deleteSoundButton, *toBeginningButton, *toEndButton; | 154 | QPushButton *Stop_PushButton, *Play_PushButton, *Rec_PushButton, *NewSoundButton, *deleteSoundButton, *toBeginningButton, *toEndButton; |
154 | QString recDir; | 155 | QString recDir; |
155 | QTabWidget *TabWidget; | 156 | QTabWidget *TabWidget; |
156 | QTimer *t, *rewindTimer, *forwardTimer; | 157 | QTimer *t, *rewindTimer, *forwardTimer; |
157 | QVBoxLayout* Layout15; | 158 | QVBoxLayout* Layout15; |
158 | QVBoxLayout* Layout15b; | 159 | QVBoxLayout* Layout15b; |
159 | QVBoxLayout* Layout18; | 160 | QVBoxLayout* Layout18; |
160 | QWidget *tab, *tab_2, *tab_3, *tab_4, *tab_5; | 161 | QWidget *tab, *tab_2, *tab_3, *tab_4, *tab_5; |
161 | int sliderPos, total; | 162 | int sliderPos, total; |
162 | // short inbuffer[BUFSIZE], outbuffer[BUFSIZE]; | 163 | // short inbuffer[BUFSIZE], outbuffer[BUFSIZE]; |
163 | // unsigned short unsigned_inbuffer[BUFSIZE], unsigned_outbuffer[BUFSIZE]; | 164 | // unsigned short unsigned_inbuffer[BUFSIZE], unsigned_outbuffer[BUFSIZE]; |
164 | QGroupBox *sampleGroup, *bitGroup, *dirGroup, *sizeGroup; | 165 | QGroupBox *sampleGroup, *bitGroup, *dirGroup, *sizeGroup; |
165 | /* short inbuffer[65536], outbuffer[65536]; */ | 166 | /* short inbuffer[65536], outbuffer[65536]; */ |
166 | /* unsigned short unsigned_inbuffer[65536], unsigned_outbuffer[65536]; */ | 167 | /* unsigned short unsigned_inbuffer[65536], unsigned_outbuffer[65536]; */ |
167 | 168 | ||
168 | 169 | ||
169 | bool doPlay(); | 170 | bool doPlay(); |
170 | bool openPlayFile(); | 171 | bool openPlayFile(); |
171 | bool setUpFile(); | 172 | bool setUpFile(); |
172 | bool setupAudio( bool b); | 173 | bool setupAudio( bool b); |
173 | void endPlaying(); | 174 | void endPlaying(); |
174 | void endRecording(); | 175 | void endRecording(); |
175 | void fileBeamFinished( Ir *ir); | 176 | void fileBeamFinished( Ir *ir); |
176 | void initIconView(); | 177 | void initIconView(); |
177 | void keyPressEvent( QKeyEvent *e); | 178 | void keyPressEvent( QKeyEvent *e); |
178 | void keyReleaseEvent( QKeyEvent *e); | 179 | void keyReleaseEvent( QKeyEvent *e); |
179 | void receive( const QCString &, const QByteArray & ); | 180 | void receive( const QCString &, const QByteArray & ); |
180 | void showListMenu(QListViewItem * ); | 181 | void showListMenu(QListViewItem * ); |
181 | // void quickRec(); | 182 | // void quickRec(); |
182 | 183 | ||
183 | }; | 184 | }; |
184 | 185 | ||
185 | #endif // QTREC_H | 186 | #endif // QTREC_H |