/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-05-30 19:20:17 UTC
  • Revision ID: edam@waxworlds.org-20110530192017-5c09k4kgpov02gja
- added checks for Doit.this == null when handling dialog buttons (I managed to abort an import as a duplicate contacts dialog was shown, but can't reproduce it now)
- added line no.s to vcard parsing errors
- update progress bar after a contact is imported, not before
- fixed bug introduced in last commit where a contacts were imported after finaliseVcard()ing failed
- don't show unknown encoding errors for vcard fields that we don't care about (which ignores base64 encoded photos, for example)

Show diffs side-by-side

added added

removed removed

220
220
                                                public void onClick( DialogInterface dialog,
221
221
                                                        int whichButton )
222
222
                                                {
223
 
                                                        Doit.this._importer.wake();
 
223
                                                        if( Doit.this != null )
 
224
                                                                Doit.this._importer.wake();
224
225
                                                }
225
226
                                        } )
226
227
                                .setOnCancelListener( _dialog_on_cancel_listener )
235
236
                                                public void onClick( DialogInterface dialog,
236
237
                                                        int which_button )
237
238
                                                {
238
 
                                                        Doit.this._importer.wake(
239
 
                                                                Importer.RESPONSE_POSITIVE );
 
239
                                                        if( Doit.this != null )
 
240
                                                                Doit.this._importer.wake(
 
241
                                                                        Importer.RESPONSE_POSITIVE );
240
242
                                                }
241
243
                                        } )
242
244
                                .setNegativeButton( R.string.error_abort,
244
246
                                                public void onClick( DialogInterface dialog,
245
247
                                                        int which_button )
246
248
                                                {
247
 
                                                        Doit.this._importer.wake(
248
 
                                                                Importer.RESPONSE_NEGATIVE );
 
249
                                                        if( Doit.this != null )
 
250
                                                                Doit.this._importer.wake(
 
251
                                                                        Importer.RESPONSE_NEGATIVE );
249
252
                                                }
250
253
                                        } )
251
254
                                .setOnCancelListener( _dialog_on_cancel_listener )
261
264
                                                public void onCheckedChanged(
262
265
                                                        CompoundButton button_view, boolean is_checked )
263
266
                                                {
264
 
                                                        Doit.this._merge_prompt_always_selected =
265
 
                                                                is_checked;
 
267
                                                        if( Doit.this != null )
 
268
                                                                Doit.this._merge_prompt_always_selected =
 
269
                                                                        is_checked;
266
270
                                                }
267
271
                                        } );
268
272
                        ( (Button)dialog_view.findViewById( R.id.merge_keep ) ).
289
293
        {
290
294
                public void onClick( View view )
291
295
                {
 
296
                        if( Doit.this == null ) return;
 
297
 
292
298
                        // handle abort
293
299
                        if( view.getId() == R.id.abort )
294
300
                                manualAbort();