/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/org/waxworlds/edam/importcontacts/Doit.java

  • Committer: edam
  • Date: 2011-03-13 18:58:52 UTC
  • Revision ID: edam@waxworlds.org-20110313185852-s74kvkbv8k0v0lwc
- accept parameters that are quoted (this doesn't appear to be part of the standards AFAICT, but Evolution apparently quotes parameter values)

Show diffs side-by-side

added added

removed removed

99
99
                                ( (Button)findViewById( R.id.back ) ).setEnabled( false );
100
100
                                updateNext( NEXT_CLOSE );
101
101
                                findViewById( R.id.doit_abort_disp ).setVisibility(
102
 
                                        View.GONE );
 
102
                                                View.GONE );
103
103
                                break;
104
104
                        case MESSAGE_ABORT:
105
105
                                manualAbort();
114
114
                                break;
115
115
                        case MESSAGE_SETPROGRESSMESSAGE:
116
116
                                ( (TextView)findViewById( R.id.doit_percentage ) ).
117
 
                                        setText( (String)msg.obj );
 
117
                                                setText( (String)msg.obj );
118
118
                                break;
119
119
                        case MESSAGE_SETMAXPROGRESS:
120
120
                                if( _maxProgress > 0 ) {
293
293
                        // else, response (just check we haven't aborted already!)
294
294
                        else if( Doit.this._importer != null ) {
295
295
                                int responseExtra = _mergePromptAlwaysSelected?
296
 
                                        Importer.RESPONSEEXTRA_ALWAYS : Importer.RESPONSEEXTRA_NONE;
 
296
                                                Importer.RESPONSEEXTRA_ALWAYS : Importer.RESPONSEEXTRA_NONE;
297
297
                                Doit.this._importer.wake( convertIdToAction( view.getId() ),
298
 
                                        responseExtra );
 
298
                                                responseExtra );
299
299
                        }
300
300
 
301
301
                        // close dialog and free (don't keep a reference)
344
344
                        dismissDialog( _currentDialogId );
345
345
                }
346
346
                catch( Exception e ) {
347
 
                        // ignore errors
348
347
                }
349
348
        }
350
349
 
409
408
                case DIALOG_MERGEPROMPT:
410
409
                        // set contact's name
411
410
                        ( (TextView)dialog.findViewById( R.id.mergeprompt_name ) ).setText(
412
 
                                _dialogMessage );
 
411
                                        _dialogMessage );
413
412
                        // and set up reference to dialog
414
413
                        _mergePromptDialog = dialog;
415
414
                        break;
447
446
                        if( _startedProgress )
448
447
                        {
449
448
                                ( (TextView)findViewById( R.id.doit_percentage ) ).setText(
450
 
                                        (int)Math.round( 100 * _progress / _maxProgress ) + "%" );
 
449
                                                (int)Math.round( 100 * _progress / _maxProgress ) + "%" );
451
450
                                outOf.setText( _progress + "/" + _maxProgress );
452
451
                                bar.setProgress( _progress );
453
452
                        }
457
456
        private void updateStats()
458
457
        {
459
458
                ( (TextView)findViewById( R.id.doit_overwrites ) ).setText(
460
 
                        "" + _countOverwrites );
 
459
                                "" + _countOverwrites );
461
460
                ( (TextView)findViewById( R.id.doit_creates ) ).setText(
462
 
                        "" + _countCreates );
 
461
                                "" + _countCreates );
463
462
                ( (TextView)findViewById( R.id.doit_merges ) ).setText(
464
 
                        "" + _countMerges );
 
463
                                "" + _countMerges );
465
464
                ( (TextView)findViewById( R.id.doit_skips ) ).setText(
466
 
                        "" + _countSkips );
 
465
                                "" + _countSkips );
467
466
        }
468
467
 
469
468
        private void abortImport( boolean showToasterPopup )
485
484
                                // notify the user
486
485
                                if( showToasterPopup )
487
486
                                        Toast.makeText( this, R.string.doit_importaborted,
488
 
                                                Toast.LENGTH_LONG ).show();
 
487
                                                        Toast.LENGTH_LONG ).show();
489
488
                        }
490
489
                }
491
490