author | cniehaus <cniehaus> | 2002-12-13 16:17:10 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-12-13 16:17:10 (UTC) |
commit | 33513c771164337da46c65f379c98b06adb6f704 (patch) (unidiff) | |
tree | 425faf58b3921eabf359bf9cbeaf6d2f03aa7708 | |
parent | 841d22f7678efa02bb73476e7f5214e4323ef260 (diff) | |
download | opie-33513c771164337da46c65f379c98b06adb6f704.zip opie-33513c771164337da46c65f379c98b06adb6f704.tar.gz opie-33513c771164337da46c65f379c98b06adb6f704.tar.bz2 |
i18n-fixes
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index a1ce5a0..5ce90a9 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -222,195 +222,195 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
222 | // Create Views | 222 | // Create Views |
223 | listContainer = new QWidget( this ); | 223 | listContainer = new QWidget( this ); |
224 | QVBoxLayout *vb = new QVBoxLayout( listContainer ); | 224 | QVBoxLayout *vb = new QVBoxLayout( listContainer ); |
225 | 225 | ||
226 | m_abView = new AbView( listContainer, m_config.orderList() ); | 226 | m_abView = new AbView( listContainer, m_config.orderList() ); |
227 | vb->addWidget( m_abView ); | 227 | vb->addWidget( m_abView ); |
228 | // abList->setHScrollBarMode( QScrollView::AlwaysOff ); | 228 | // abList->setHScrollBarMode( QScrollView::AlwaysOff ); |
229 | connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), | 229 | connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), |
230 | this, SLOT( slotViewSwitched( int ) ) ); | 230 | this, SLOT( slotViewSwitched( int ) ) ); |
231 | 231 | ||
232 | 232 | ||
233 | QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); | 233 | QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); |
234 | 234 | ||
235 | m_abView->load(); | 235 | m_abView->load(); |
236 | 236 | ||
237 | // Letter Picker | 237 | // Letter Picker |
238 | pLabel = new LetterPicker( listContainer ); | 238 | pLabel = new LetterPicker( listContainer ); |
239 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); | 239 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); |
240 | connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); | 240 | connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); |
241 | 241 | ||
242 | vb->addWidget( pLabel ); | 242 | vb->addWidget( pLabel ); |
243 | 243 | ||
244 | // Category Menu | 244 | // Category Menu |
245 | catMenu = new QPopupMenu( this ); | 245 | catMenu = new QPopupMenu( this ); |
246 | catMenu->setCheckable( TRUE ); | 246 | catMenu->setCheckable( TRUE ); |
247 | connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); | 247 | connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); |
248 | populateCategories(); | 248 | populateCategories(); |
249 | mbList->insertItem( tr("View"), catMenu ); | 249 | mbList->insertItem( tr("View"), catMenu ); |
250 | 250 | ||
251 | defaultFont = new QFont( m_abView->font() ); | 251 | defaultFont = new QFont( m_abView->font() ); |
252 | slotSetFont(m_config.fontSize()); | 252 | slotSetFont(m_config.fontSize()); |
253 | m_curFontSize = m_config.fontSize(); | 253 | m_curFontSize = m_config.fontSize(); |
254 | 254 | ||
255 | setCentralWidget(listContainer); | 255 | setCentralWidget(listContainer); |
256 | 256 | ||
257 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); | 257 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); |
258 | 258 | ||
259 | 259 | ||
260 | isLoading = false; | 260 | isLoading = false; |
261 | } | 261 | } |
262 | 262 | ||
263 | 263 | ||
264 | void AddressbookWindow::slotConfig() | 264 | void AddressbookWindow::slotConfig() |
265 | { | 265 | { |
266 | ConfigDlg* dlg = new ConfigDlg( this, "Config" ); | 266 | ConfigDlg* dlg = new ConfigDlg( this, "Config" ); |
267 | dlg -> setConfig( m_config ); | 267 | dlg -> setConfig( m_config ); |
268 | dlg -> showMaximized(); | 268 | dlg -> showMaximized(); |
269 | if ( dlg -> exec() ) { | 269 | if ( dlg -> exec() ) { |
270 | qWarning ("Config Dialog accepted !"); | 270 | qWarning ("Config Dialog accepted!"); |
271 | m_config = dlg -> getConfig(); | 271 | m_config = dlg -> getConfig(); |
272 | if ( m_curFontSize != m_config.fontSize() ){ | 272 | if ( m_curFontSize != m_config.fontSize() ){ |
273 | qWarning("Font was changed!"); | 273 | qWarning("Font was changed!"); |
274 | m_curFontSize = m_config.fontSize(); | 274 | m_curFontSize = m_config.fontSize(); |
275 | emit slotSetFont( m_curFontSize ); | 275 | emit slotSetFont( m_curFontSize ); |
276 | } | 276 | } |
277 | m_abView -> setListOrder( m_config.orderList() ); | 277 | m_abView -> setListOrder( m_config.orderList() ); |
278 | } | 278 | } |
279 | 279 | ||
280 | delete dlg; | 280 | delete dlg; |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
284 | void AddressbookWindow::slotSetFont( int size ) | 284 | void AddressbookWindow::slotSetFont( int size ) |
285 | { | 285 | { |
286 | qWarning("void AddressbookWindow::slotSetFont( %d )", size); | 286 | qWarning("void AddressbookWindow::slotSetFont( %d )", size); |
287 | 287 | ||
288 | if (size > 2 || size < 0) | 288 | if (size > 2 || size < 0) |
289 | size = 1; | 289 | size = 1; |
290 | 290 | ||
291 | m_config.setFontSize( size ); | 291 | m_config.setFontSize( size ); |
292 | 292 | ||
293 | QFont *currentFont; | 293 | QFont *currentFont; |
294 | 294 | ||
295 | switch (size) { | 295 | switch (size) { |
296 | case 0: | 296 | case 0: |
297 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); | 297 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); |
298 | currentFont = new QFont (m_abView->font()); | 298 | currentFont = new QFont (m_abView->font()); |
299 | // abList->resizeRows(currentFont->pixelSize() + 7); :SX | 299 | // abList->resizeRows(currentFont->pixelSize() + 7); :SX |
300 | // abList->resizeRows(); | 300 | // abList->resizeRows(); |
301 | break; | 301 | break; |
302 | case 1: | 302 | case 1: |
303 | m_abView->setFont( *defaultFont ); | 303 | m_abView->setFont( *defaultFont ); |
304 | currentFont = new QFont (m_abView->font()); | 304 | currentFont = new QFont (m_abView->font()); |
305 | // // abList->resizeRows(currentFont->pixelSize() + 7); | 305 | // // abList->resizeRows(currentFont->pixelSize() + 7); |
306 | // abList->resizeRows(); | 306 | // abList->resizeRows(); |
307 | break; | 307 | break; |
308 | case 2: | 308 | case 2: |
309 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); | 309 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); |
310 | currentFont = new QFont (m_abView->font()); | 310 | currentFont = new QFont (m_abView->font()); |
311 | // //abList->resizeRows(currentFont->pixelSize() + 7); | 311 | // //abList->resizeRows(currentFont->pixelSize() + 7); |
312 | // abList->resizeRows(); | 312 | // abList->resizeRows(); |
313 | break; | 313 | break; |
314 | } | 314 | } |
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | void AddressbookWindow::importvCard() { | 319 | void AddressbookWindow::importvCard() { |
320 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | 320 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); |
321 | if(!str.isEmpty() ){ | 321 | if(!str.isEmpty() ){ |
322 | setDocument((const QString&) str ); | 322 | setDocument((const QString&) str ); |
323 | } | 323 | } |
324 | 324 | ||
325 | } | 325 | } |
326 | 326 | ||
327 | void AddressbookWindow::setDocument( const QString &filename ) | 327 | void AddressbookWindow::setDocument( const QString &filename ) |
328 | { | 328 | { |
329 | qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); | 329 | qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); |
330 | 330 | ||
331 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ | 331 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ |
332 | 332 | ||
333 | 333 | ||
334 | 334 | ||
335 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), | 335 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), |
336 | tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), | 336 | tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), |
337 | tr( "&Yes" ), tr( "&No" ), QString::null, | 337 | tr( "&Yes" ), tr( "&No" ), QString::null, |
338 | 0, // Enter == button 0 | 338 | 0, // Enter == button 0 |
339 | 2 ) ) { // Escape == button 2 | 339 | 2 ) ) { // Escape == button 2 |
340 | case 0: | 340 | case 0: |
341 | qWarning("YES clicked"); | 341 | qWarning("YES clicked"); |
342 | break; | 342 | break; |
343 | case 1: | 343 | case 1: |
344 | qWarning("NO clicked"); | 344 | qWarning("NO clicked"); |
345 | return; | 345 | return; |
346 | break; | 346 | break; |
347 | } | 347 | } |
348 | } | 348 | } |
349 | 349 | ||
350 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 350 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
351 | filename ); | 351 | filename ); |
352 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 352 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
353 | OContactAccess::List allList = access->allRecords(); | 353 | OContactAccess::List allList = access->allRecords(); |
354 | qWarning( "Found number of contacts in File: %d", allList.count() ); | 354 | qWarning( "Found number of contacts in File: %d", allList.count() ); |
355 | 355 | ||
356 | if ( !allList.count() ) { | 356 | if ( !allList.count() ) { |
357 | QMessageBox::information( this, "Import VCard", | 357 | QMessageBox::information( this, "Import VCard", |
358 | "It was impossible to import the VCard.\n" | 358 | "It was impossible to import the VCard.\n" |
359 | "The VCard may be corrupted !" ); | 359 | "The VCard may be corrupted!" ); |
360 | } | 360 | } |
361 | 361 | ||
362 | bool doAsk = true; | 362 | bool doAsk = true; |
363 | OContactAccess::List::Iterator it; | 363 | OContactAccess::List::Iterator it; |
364 | for ( it = allList.begin(); it != allList.end(); ++it ){ | 364 | for ( it = allList.begin(); it != allList.end(); ++it ){ |
365 | qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); | 365 | qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); |
366 | if ( doAsk ){ | 366 | if ( doAsk ){ |
367 | switch( QMessageBox::information( this, tr ( "Add Contact ?" ), | 367 | switch( QMessageBox::information( this, tr ( "Add Contact?" ), |
368 | tr( "Do you really want add contact for \n%1 ?" ) | 368 | tr( "Do you really want add contact for \n%1?" ) |
369 | .arg( (*it).fullName().latin1() ), | 369 | .arg( (*it).fullName().latin1() ), |
370 | tr( "&Yes" ), tr( "&No" ), tr( "&AllYes"), | 370 | tr( "&Yes" ), tr( "&No" ), tr( "&AllYes"), |
371 | 0, // Enter == button 0 | 371 | 0, // Enter == button 0 |
372 | 2 ) ) { // Escape == button 2 | 372 | 2 ) ) { // Escape == button 2 |
373 | case 0: | 373 | case 0: |
374 | qWarning("YES clicked"); | 374 | qWarning("YES clicked"); |
375 | m_abView->addEntry( *it ); | 375 | m_abView->addEntry( *it ); |
376 | break; | 376 | break; |
377 | case 1: | 377 | case 1: |
378 | qWarning("NO clicked"); | 378 | qWarning("NO clicked"); |
379 | break; | 379 | break; |
380 | case 2: | 380 | case 2: |
381 | qWarning("YesAll clicked"); | 381 | qWarning("YesAll clicked"); |
382 | doAsk = false; | 382 | doAsk = false; |
383 | break; | 383 | break; |
384 | } | 384 | } |
385 | }else | 385 | }else |
386 | m_abView->addEntry( *it ); | 386 | m_abView->addEntry( *it ); |
387 | 387 | ||
388 | } | 388 | } |
389 | 389 | ||
390 | delete access; | 390 | delete access; |
391 | } | 391 | } |
392 | 392 | ||
393 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) | 393 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) |
394 | { | 394 | { |
395 | QMainWindow::resizeEvent( e ); | 395 | QMainWindow::resizeEvent( e ); |
396 | 396 | ||
397 | 397 | ||
398 | } | 398 | } |
399 | 399 | ||
400 | AddressbookWindow::~AddressbookWindow() | 400 | AddressbookWindow::~AddressbookWindow() |
401 | { | 401 | { |
402 | ToolBarDock dock; | 402 | ToolBarDock dock; |
403 | int dummy; | 403 | int dummy; |
404 | bool bDummy; | 404 | bool bDummy; |
405 | getLocation ( listTools, dock, dummy, bDummy, dummy ); | 405 | getLocation ( listTools, dock, dummy, bDummy, dummy ); |
406 | m_config.setToolBarDock( dock ); | 406 | m_config.setToolBarDock( dock ); |
407 | m_config.save(); | 407 | m_config.save(); |
408 | } | 408 | } |
409 | 409 | ||
410 | void AddressbookWindow::slotUpdateToolbar() | 410 | void AddressbookWindow::slotUpdateToolbar() |
411 | { | 411 | { |
412 | OContact ce = m_abView->currentEntry(); | 412 | OContact ce = m_abView->currentEntry(); |
413 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); | 413 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); |
414 | } | 414 | } |
415 | 415 | ||
416 | void AddressbookWindow::slotListNew() | 416 | void AddressbookWindow::slotListNew() |
@@ -785,105 +785,105 @@ void AddressbookWindow::closeEvent( QCloseEvent *e ) | |||
785 | if(syncing) { | 785 | if(syncing) { |
786 | /* shouldn't we save, I hear you say? well its already been set | 786 | /* shouldn't we save, I hear you say? well its already been set |
787 | so that an edit can not occur during a sync, and we flushed | 787 | so that an edit can not occur during a sync, and we flushed |
788 | at the start of the sync, so there is no need to save | 788 | at the start of the sync, so there is no need to save |
789 | Saving however itself would cause problems. */ | 789 | Saving however itself would cause problems. */ |
790 | e->accept(); | 790 | e->accept(); |
791 | return; | 791 | return; |
792 | } | 792 | } |
793 | //################## shouldn't always save | 793 | //################## shouldn't always save |
794 | // True, but the database handles this automatically ! (se) | 794 | // True, but the database handles this automatically ! (se) |
795 | if ( save() ) | 795 | if ( save() ) |
796 | e->accept(); | 796 | e->accept(); |
797 | else | 797 | else |
798 | e->ignore(); | 798 | e->ignore(); |
799 | } | 799 | } |
800 | 800 | ||
801 | /* | 801 | /* |
802 | Returns TRUE if it is OK to exit | 802 | Returns TRUE if it is OK to exit |
803 | */ | 803 | */ |
804 | 804 | ||
805 | bool AddressbookWindow::save() | 805 | bool AddressbookWindow::save() |
806 | { | 806 | { |
807 | if ( !m_abView->save() ) { | 807 | if ( !m_abView->save() ) { |
808 | if ( QMessageBox::critical( 0, tr( "Out of space" ), | 808 | if ( QMessageBox::critical( 0, tr( "Out of space" ), |
809 | tr("Unable to save information.\n" | 809 | tr("Unable to save information.\n" |
810 | "Free up some space\n" | 810 | "Free up some space\n" |
811 | "and try again.\n" | 811 | "and try again.\n" |
812 | "\nQuit anyway?"), | 812 | "\nQuit anyway?"), |
813 | QMessageBox::Yes|QMessageBox::Escape, | 813 | QMessageBox::Yes|QMessageBox::Escape, |
814 | QMessageBox::No|QMessageBox::Default ) | 814 | QMessageBox::No|QMessageBox::Default ) |
815 | != QMessageBox::No ) | 815 | != QMessageBox::No ) |
816 | return TRUE; | 816 | return TRUE; |
817 | else | 817 | else |
818 | return FALSE; | 818 | return FALSE; |
819 | } | 819 | } |
820 | return TRUE; | 820 | return TRUE; |
821 | } | 821 | } |
822 | 822 | ||
823 | #ifdef __DEBUG_RELEASE | 823 | #ifdef __DEBUG_RELEASE |
824 | void AddressbookWindow::slotSave() | 824 | void AddressbookWindow::slotSave() |
825 | { | 825 | { |
826 | save(); | 826 | save(); |
827 | } | 827 | } |
828 | #endif | 828 | #endif |
829 | 829 | ||
830 | 830 | ||
831 | void AddressbookWindow::slotNotFound() | 831 | void AddressbookWindow::slotNotFound() |
832 | { | 832 | { |
833 | qWarning("Got notfound signal !"); | 833 | qWarning("Got notfound signal!"); |
834 | QMessageBox::information( this, tr( "Not Found" ), | 834 | QMessageBox::information( this, tr( "Not Found" ), |
835 | tr( "Unable to find a contact for this \n search pattern!" ) ); | 835 | tr( "Unable to find a contact for this \n search pattern!" ) ); |
836 | 836 | ||
837 | 837 | ||
838 | } | 838 | } |
839 | void AddressbookWindow::slotWrapAround() | 839 | void AddressbookWindow::slotWrapAround() |
840 | { | 840 | { |
841 | qWarning("Got wrap signal !"); | 841 | qWarning("Got wrap signal!"); |
842 | // if ( doNotifyWrapAround ) | 842 | // if ( doNotifyWrapAround ) |
843 | // QMessageBox::information( this, tr( "End of list" ), | 843 | // QMessageBox::information( this, tr( "End of list" ), |
844 | // tr( "End of list. Wrap around now...!" ) + "\n" ); | 844 | // tr( "End of list. Wrap around now...!" ) + "\n" ); |
845 | 845 | ||
846 | } | 846 | } |
847 | 847 | ||
848 | void AddressbookWindow::slotSetCategory( int c ) | 848 | void AddressbookWindow::slotSetCategory( int c ) |
849 | { | 849 | { |
850 | qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() ); | 850 | qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() ); |
851 | 851 | ||
852 | QString cat, book; | 852 | QString cat, book; |
853 | AbView::Views view = AbView::TableView; | 853 | AbView::Views view = AbView::TableView; |
854 | 854 | ||
855 | if ( c <= 0 ) | 855 | if ( c <= 0 ) |
856 | return; | 856 | return; |
857 | 857 | ||
858 | // Switch view | 858 | // Switch view |
859 | if ( c < 3 ) | 859 | if ( c < 3 ) |
860 | for ( unsigned int i = 1; i < 3; i++ ){ | 860 | for ( unsigned int i = 1; i < 3; i++ ){ |
861 | if ( catMenu ) | 861 | if ( catMenu ) |
862 | catMenu->setItemChecked( i, c == (int)i ); | 862 | catMenu->setItemChecked( i, c == (int)i ); |
863 | } | 863 | } |
864 | else | 864 | else |
865 | // Checkmark Category Menu Item Selected | 865 | // Checkmark Category Menu Item Selected |
866 | for ( unsigned int i = 3; i < catMenu->count(); i++ ) | 866 | for ( unsigned int i = 3; i < catMenu->count(); i++ ) |
867 | catMenu->setItemChecked( i, c == (int)i ); | 867 | catMenu->setItemChecked( i, c == (int)i ); |
868 | 868 | ||
869 | // Now switch to the selected category | 869 | // Now switch to the selected category |
870 | for ( unsigned int i = 1; i < catMenu->count(); i++ ) { | 870 | for ( unsigned int i = 1; i < catMenu->count(); i++ ) { |
871 | if (catMenu->isItemChecked( i )) { | 871 | if (catMenu->isItemChecked( i )) { |
872 | if ( i == 1 ){ // default List view | 872 | if ( i == 1 ){ // default List view |
873 | book = QString::null; | 873 | book = QString::null; |
874 | view = AbView::TableView; | 874 | view = AbView::TableView; |
875 | }else if ( i == 2 ){ | 875 | }else if ( i == 2 ){ |
876 | book = tr( "Cards" ); | 876 | book = tr( "Cards" ); |
877 | view = AbView::CardView; | 877 | view = AbView::CardView; |
878 | // }else if ( i == 3 ){ | 878 | // }else if ( i == 3 ){ |
879 | // book = tr( "Personal" ); | 879 | // book = tr( "Personal" ); |
880 | // view = AbView:: PersonalView; | 880 | // view = AbView:: PersonalView; |
881 | }else if ( i == 3 ){ // default All Categories | 881 | }else if ( i == 3 ){ // default All Categories |
882 | cat = QString::null; | 882 | cat = QString::null; |
883 | }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled | 883 | }else if ( i == (unsigned int)catMenu->count() - 1 ){ // last menu option (seperator is counted, too) will be Unfiled |
884 | cat = "Unfiled"; | 884 | cat = "Unfiled"; |
885 | qWarning ("Unfiled selected!!!"); | 885 | qWarning ("Unfiled selected!!!"); |
886 | }else{ | 886 | }else{ |
887 | cat = m_abView->categories()[i - 4]; | 887 | cat = m_abView->categories()[i - 4]; |
888 | } | 888 | } |
889 | } | 889 | } |