/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: 2010-10-28 15:49:21 UTC
  • Revision ID: edam@waxworlds.org-20101028154921-98svlxlpno3cpzb8
- added file chooser
- changed file/dir entry box for a button that opens the file chooser
- added dialog to ask if you want to select a dir to scan or a file
- fixed bug where you could abort as dialog opened and the dialog wasn't cancelled
- fixed crash where you could abort as the merge prompt opened and it would try to use the just-destroyed importer
- fixed bug where closing the application at the end would show "aborted!" erroniously

Show diffs side-by-side

added added

removed removed

200
200
        {
201
201
                super.onPause();
202
202
 
203
 
                // close any open dialogs
204
 
                try {
205
 
                        dismissDialog( _currentDialogId );
206
 
                }
207
 
                catch( Exception e ) {
208
 
                }
209
 
 
210
203
                // saving the state of an import sounds complicated! Lets just abort!
211
 
                manualAbort( true );
 
204
                if( _nextAction != NEXT_CLOSE )
 
205
                        manualAbort( true );
212
206
        }
213
207
 
214
208
        @Override
296
290
                        if( view.getId() == R.id.abort )
297
291
                                manualAbort();
298
292
 
299
 
                        // else, response
300
 
                        else {
 
293
                        // else, response (just check we haven't aborted already!)
 
294
                        else if( Doit.this._importer != null ) {
301
295
                                int responseExtra = _mergePromptAlwaysSelected?
302
296
                                                Importer.RESPONSEEXTRA_ALWAYS : Importer.RESPONSEEXTRA_NONE;
303
297
                                Doit.this._importer.wake( convertIdToAction( view.getId() ),
344
338
                        setVisibility( View.VISIBLE );
345
339
                ( (TextView)findViewById( R.id.doit_alldone ) ).
346
340
                        setVisibility( View.GONE );
 
341
 
 
342
                // close any open dialogs
 
343
                try {
 
344
                        dismissDialog( _currentDialogId );
 
345
                }
 
346
                catch( Exception e ) {
 
347
                }
347
348
        }
348
349
 
349
350
        private void updateNext( int nextAction )
378
379
        private DialogInterface.OnCancelListener _dialogOnCancelListener =
379
380
                        new DialogInterface.OnCancelListener() {
380
381
                public void onCancel( DialogInterface dialog ) {
381
 
                        setResult( RESULT_CANCELED );
382
 
                        finish();
 
382
                        manualAbort();
383
383
                }
384
384
        };
385
385
 
 
386
 
386
387
        @Override
387
388
        protected void onActivityResult( int requestCode, int resultCode,
388
389
                        Intent data )