~ted/ubuntu/lucid/tomboy/with-patch

« back to all changes in this revision

Viewing changes to Tomboy/Synchronization/SyncDialog.cs

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2008-01-15 11:32:52 UTC
  • mfrom: (1.1.31 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080115113252-p59wg7nqkl6vcg7a
Tags: 0.9.4-0ubuntu1
* New upstream release (LP: #181798)
  - Fix crash during note deletion 
  - Fix null reference exception 
  - Fix mnemonics in sync preferences dialog 
  - Fix fuse mount timeout for sync 
  - New port option for SSH sync 
  - New multi-select notes support in Search All Notes window
  - New config dialog for Insert Timestamp Add-in 
  - New gconf preference, middle-click paste on Tomboy icon
  - New gconf preference, disable ESC closing notes 
  - New paragraph within a bullet with SHIFT + ENTER
  - New bug numbers as links in Export to HTML 
  - New notebook notes can be created off notebook's context menu.
  - New sketching add-in (still incomplete, --enable-sketching)
  - New "Unfiled Notes" item to notebook list 
  - New drag note to "Unfiled Notes" to remove from notebook 
 * debian/tomboy.menu: updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
                private Gtk.Label messageLabel;
15
15
                private Gtk.ProgressBar progressBar;
16
16
                private Gtk.Label progressLabel;
17
 
                
 
17
 
18
18
                private Gtk.Expander expander;
19
19
                private Gtk.Button closeButton;
20
20
                private uint progressBarTimeoutId;
21
 
                
 
21
 
22
22
                private Gtk.TreeStore model;
23
 
                
 
23
 
24
24
                // TODO: Possible to make Tomboy not crash if quit while dialog is up?
25
25
                public SyncDialog ()
26
 
                        : base (string.Empty, 
27
 
                                        null,
28
 
                                        Gtk.DialogFlags.DestroyWithParent)
 
26
: base (string.Empty,
 
27
                        null,
 
28
                        Gtk.DialogFlags.DestroyWithParent)
29
29
                {
30
30
                        progressBarTimeoutId = 0;
31
31
 
90
90
                        expander.Spacing = 6;
91
91
                        expander.Activated += OnExpanderActivated;
92
92
                        expander.Show ();
93
 
                        outerVBox.PackStart (expander, true, true, 0);                  
 
93
                        outerVBox.PackStart (expander, true, true, 0);
94
94
 
95
95
                        // Contents of expander
96
96
                        Gtk.VBox expandVBox = new Gtk.VBox ();
116
116
 
117
117
                        // Set up TreeViewColumns
118
118
                        Gtk.TreeViewColumn column = new Gtk.TreeViewColumn (
119
 
                        Catalog.GetString ("Note Title"),
120
 
                        new Gtk.CellRendererText (), "text", 0);
 
119
                                Catalog.GetString ("Note Title"),
 
120
                                new Gtk.CellRendererText (), "text", 0);
121
121
                        column.SortColumnId = 0;
122
122
                        column.Resizable = true;
123
123
                        treeView.AppendColumn (column);
124
124
 
125
125
                        column = new Gtk.TreeViewColumn (
126
 
                        Catalog.GetString ("Status"),
127
 
                        new Gtk.CellRendererText (), "text", 1);
 
126
                                Catalog.GetString ("Status"),
 
127
                                new Gtk.CellRendererText (), "text", 1);
128
128
                        column.SortColumnId = 1;
129
129
                        column.Resizable = true;
130
130
                        treeView.AppendColumn (column);
133
133
                        closeButton = (Gtk.Button) AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close);
134
134
                        closeButton.Sensitive = false;
135
135
                }
136
 
                
 
136
 
137
137
                public override void Destroy ()
138
138
                {
139
139
                        SyncManager.StateChanged -= OnSyncStateChanged;
141
141
                        SyncManager.NoteConflictDetected -= OnNoteConflictDetected;
142
142
                        base.Destroy ();
143
143
                }
144
 
                
 
144
 
145
145
                protected override void OnRealized ()
146
146
                {
147
147
                        base.OnRealized ();
148
 
                        
 
148
 
149
149
                        SyncManager.StateChanged += OnSyncStateChanged;
150
150
                        SyncManager.NoteSynchronized += OnNoteSynchronized;
151
151
                        SyncManager.NoteConflictDetected += OnNoteConflictDetected;
154
154
                        if (state == SyncState.Idle) {
155
155
                                // Kick off a timer to keep the progress bar going
156
156
                                progressBarTimeoutId = GLib.Timeout.Add (500, OnPulseProgressBar);
157
 
                        
 
157
 
158
158
                                // Kick off a new synchronization
159
159
                                SyncManager.PerformSynchronization ();
160
160
                        } else {
162
162
                                OnSyncStateChanged (state);
163
163
                        }
164
164
                }
165
 
                
 
165
 
166
166
                private void OnExpanderActivated (object sender, EventArgs e)
167
167
                {
168
168
                        if (expander.Expanded)
175
175
                {
176
176
                        // TODO: Store GUID hidden in model; use instead of title
177
177
                        Gtk.TreeIter iter;
178
 
                        if (!model.GetIter (out iter, args.Path)) 
 
178
                        if (!model.GetIter (out iter, args.Path))
179
179
                                return;
180
180
 
181
181
                        string noteTitle = (string) model.GetValue (iter, 0 /* note title */);
182
 
                        
183
 
                        Note note = Tomboy.DefaultNoteManager.Find (noteTitle); 
 
182
 
 
183
                        Note note = Tomboy.DefaultNoteManager.Find (noteTitle);
184
184
                        if (note != null)
185
185
                                note.Window.Present ();
186
186
                }
187
 
                
 
187
 
188
188
                public string HeaderText
189
189
                {
190
190
                        set {
191
191
                                headerLabel.Markup = string.Format (
192
 
                                        "<span size=\"large\" weight=\"bold\">{0}</span>",
193
 
                                        value);
 
192
                                        "<span size=\"large\" weight=\"bold\">{0}</span>",
 
193
                                        value);
194
194
                        }
195
195
                }
196
 
                
 
196
 
197
197
                public string MessageText
198
198
                {
199
 
                        set { messageLabel.Text = value; }
 
199
                        set {
 
200
                                messageLabel.Text = value;
 
201
                        }
200
202
                }
201
 
                
 
203
 
202
204
                public string ProgressText
203
205
                {
204
 
                        get { return progressLabel.Text; }
 
206
                        get {
 
207
                                return progressLabel.Text;
 
208
                        }
205
209
                        set {
206
210
                                progressLabel.Markup =
207
 
                                        string.Format ("<span style=\"italic\">{0}</span>",
208
 
                                                value);
 
211
                                        string.Format ("<span style=\"italic\">{0}</span>",
 
212
                                                       value);
209
213
                        }
210
214
                }
211
 
                
 
215
 
212
216
                public void AddUpdateItem (string title, string status)
213
217
                {
214
218
                        model.AppendValues (title, status);
219
223
                {
220
224
                        if (SyncManager.State == SyncState.Idle)
221
225
                                return false;
222
 
                        
 
226
 
223
227
                        progressBar.Pulse ();
224
 
                        
 
228
 
225
229
                        // Return true to keep things going well
226
230
                        return true;
227
231
                }
292
296
                                        Title = Catalog.GetString ("Synchronization Complete");
293
297
                                        HeaderText = Catalog.GetString ("Synchronization is complete");
294
298
                                        string numNotesUpdated =
295
 
                                                string.Format (Catalog.GetPluralString ("{0} note updated.",
296
 
                                                                                        "{0} notes updated.",
297
 
                                                                                        count),
298
 
                                                               count);
 
299
                                                string.Format (Catalog.GetPluralString ("{0} note updated.",
 
300
                                                                                        "{0} notes updated.",
 
301
                                                                                        count),
 
302
                                                               count);
299
303
                                        MessageText = numNotesUpdated + "  " +
300
 
                                                Catalog.GetString ("Your notes are now up to date.");
 
304
                                                      Catalog.GetString ("Your notes are now up to date.");
301
305
                                        ProgressText = string.Empty;
302
306
                                        break;
303
307
                                case SyncState.UserCancelled:
321
325
                                }
322
326
                        });
323
327
                }
324
 
                
 
328
 
325
329
                void OnNoteSynchronized (string noteTitle, NoteSyncType type)
326
330
                {
327
331
                        // This event handler will be called by the synchronization thread
353
357
                                AddUpdateItem (noteTitle, statusText);
354
358
                        });
355
359
                }
356
 
                
 
360
 
357
361
                void OnNoteConflictDetected (NoteManager manager,
358
362
                                             Note localConflictNote,
359
363
                                             NoteUpdate remoteNote,
363
367
                        object dlgBehaviorPref = Preferences.Get (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR);
364
368
                        if (dlgBehaviorPref != null && dlgBehaviorPref is int) // TODO: Check range of this int
365
369
                                savedBehavior = (SyncTitleConflictResolution)dlgBehaviorPref;
366
 
                        
 
370
 
367
371
                        SyncTitleConflictResolution resolution = SyncTitleConflictResolution.OverwriteExisting;
368
372
                        // This event handler will be called by the synchronization thread
369
373
                        // so we have to use the delegate here to manipulate the GUI.
372
376
                        Exception mainThreadException = null;
373
377
                        Gtk.Application.Invoke (delegate {
374
378
                                try {
375
 
                                SyncTitleConflictDialog conflictDlg =
 
379
                                        SyncTitleConflictDialog conflictDlg =
376
380
                                        new SyncTitleConflictDialog (localConflictNote, noteUpdateTitles);
377
 
                                Gtk.ResponseType reponse = Gtk.ResponseType.Ok;
378
 
                                
379
 
                                bool noteSyncBitsMatch =
380
 
                                        SyncManager.SynchronizedNoteXmlMatches (localConflictNote.GetCompleteNoteXml (),
381
 
                                                                                remoteNote.XmlContent);
382
 
                                
383
 
                                // If the synchronized note content is in conflict
384
 
                                // and there is no saved conflict handling behavior, show the dialog
385
 
                                if (!noteSyncBitsMatch && savedBehavior == 0)
386
 
                                        reponse = (Gtk.ResponseType) conflictDlg.Run ();
387
 
                                        
388
 
                                
389
 
                                if (reponse == Gtk.ResponseType.Cancel)
390
 
                                        resolution = SyncTitleConflictResolution.Cancel;
391
 
                                else {
392
 
                                        if (noteSyncBitsMatch)
393
 
                                                resolution = SyncTitleConflictResolution.OverwriteExisting;
394
 
                                        else if (savedBehavior == 0)
395
 
                                                resolution = conflictDlg.Resolution;
396
 
                                        else
397
 
                                                resolution = savedBehavior;
398
 
 
399
 
                                        switch (resolution) {
400
 
                                        case SyncTitleConflictResolution.OverwriteExisting:
401
 
                                                if (conflictDlg.AlwaysPerformThisAction)
402
 
                                                        savedBehavior = resolution;
403
 
                                                // No need to delete if sync will overwrite
404
 
                                                if (localConflictNote.Id != remoteNote.UUID)
405
 
                                                        manager.Delete (localConflictNote);
406
 
                                                break;
407
 
                                        case SyncTitleConflictResolution.RenameExistingAndUpdate:
408
 
                                                if (conflictDlg.AlwaysPerformThisAction)
409
 
                                                        savedBehavior = resolution;
410
 
                                                RenameNote (localConflictNote, conflictDlg.RenamedTitle, true);
411
 
                                                break;
412
 
                                        case SyncTitleConflictResolution.RenameExistingNoUpdate:
413
 
                                                if (conflictDlg.AlwaysPerformThisAction)
414
 
                                                        savedBehavior = resolution;
415
 
                                                RenameNote (localConflictNote, conflictDlg.RenamedTitle, false);
416
 
                                                break;
 
381
                                        Gtk.ResponseType reponse = Gtk.ResponseType.Ok;
 
382
 
 
383
                                        bool noteSyncBitsMatch =
 
384
                                                SyncManager.SynchronizedNoteXmlMatches (localConflictNote.GetCompleteNoteXml (),
 
385
                                                                                        remoteNote.XmlContent);
 
386
 
 
387
                                        // If the synchronized note content is in conflict
 
388
                                        // and there is no saved conflict handling behavior, show the dialog
 
389
                                        if (!noteSyncBitsMatch && savedBehavior == 0)
 
390
                                                reponse = (Gtk.ResponseType) conflictDlg.Run ();
 
391
 
 
392
 
 
393
                                        if (reponse == Gtk.ResponseType.Cancel)
 
394
                                                resolution = SyncTitleConflictResolution.Cancel;
 
395
                                        else {
 
396
                                                if (noteSyncBitsMatch)
 
397
                                                        resolution = SyncTitleConflictResolution.OverwriteExisting;
 
398
                                                else if (savedBehavior == 0)
 
399
                                                        resolution = conflictDlg.Resolution;
 
400
                                                else
 
401
                                                        resolution = savedBehavior;
 
402
 
 
403
                                                switch (resolution) {
 
404
                                                case SyncTitleConflictResolution.OverwriteExisting:
 
405
                                                        if (conflictDlg.AlwaysPerformThisAction)
 
406
                                                                savedBehavior = resolution;
 
407
                                                        // No need to delete if sync will overwrite
 
408
                                                        if (localConflictNote.Id != remoteNote.UUID)
 
409
                                                                manager.Delete (localConflictNote);
 
410
                                                        break;
 
411
                                                case SyncTitleConflictResolution.RenameExistingAndUpdate:
 
412
                                                        if (conflictDlg.AlwaysPerformThisAction)
 
413
                                                                savedBehavior = resolution;
 
414
                                                        RenameNote (localConflictNote, conflictDlg.RenamedTitle, true);
 
415
                                                        break;
 
416
                                                case SyncTitleConflictResolution.RenameExistingNoUpdate:
 
417
                                                        if (conflictDlg.AlwaysPerformThisAction)
 
418
                                                                savedBehavior = resolution;
 
419
                                                        RenameNote (localConflictNote, conflictDlg.RenamedTitle, false);
 
420
                                                        break;
 
421
                                                }
417
422
                                        }
418
 
                                }
419
 
                                
420
 
                                Preferences.Set (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR,
421
 
                                                 (int) savedBehavior); // TODO: Clean up
422
 
                                
423
 
                                conflictDlg.Hide ();
424
 
                                conflictDlg.Destroy ();
425
 
                        
426
 
                                // Let the SyncManager continue
427
 
                                SyncManager.ResolveConflict (/*localConflictNote, */resolution);
 
423
 
 
424
                                        Preferences.Set (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR,
 
425
                                                         (int) savedBehavior); // TODO: Clean up
 
426
 
 
427
                                        conflictDlg.Hide ();
 
428
                                        conflictDlg.Destroy ();
 
429
 
 
430
                                        // Let the SyncManager continue
 
431
                                        SyncManager.ResolveConflict (/*localConflictNote, */resolution);
428
432
                                } catch (Exception e) {
429
433
                                        mainThreadException = e;
430
434
                                }
434
438
                }
435
439
 
436
440
                #endregion // Private Event Handlers
437
 
                
438
 
#region Private Methods
 
441
 
 
442
                #region Private Methods
439
443
                // TODO: This appears to add <link:internal> around the note title
440
444
                //       in the content.
441
445
                private void RenameNote (Note note, string newTitle, bool updateReferencingNotes)
443
447
                        string oldTitle = note.Title;
444
448
                        // Rename the note (skip for now...never using updateReferencingNotes option)
445
449
                        //if (updateReferencingNotes) // NOTE: This might never work, or lead to a ton of conflicts
446
 
                        //      note.Title = newTitle;
 
450
                        // note.Title = newTitle;
447
451
                        //else
448
 
                        //      note.RenameWithoutLinkUpdate (newTitle);
 
452
                        // note.RenameWithoutLinkUpdate (newTitle);
449
453
                        //string oldContent = note.XmlContent;
450
454
                        //note.XmlContent = NoteArchiver.Instance.GetRenamedNoteXml (oldContent, oldTitle, newTitle);
451
455
 
453
457
                        note.Save (); // Write to file
454
458
                        bool noteOpen = note.IsOpened;
455
459
                        string newContent = //note.XmlContent;
456
 
                                NoteArchiver.Instance.GetRenamedNoteXml (note.XmlContent, oldTitle, newTitle);
 
460
                                NoteArchiver.Instance.GetRenamedNoteXml (note.XmlContent, oldTitle, newTitle);
457
461
                        string newCompleteContent = //note.GetCompleteNoteXml ();
458
 
                                NoteArchiver.Instance.GetRenamedNoteXml (note.GetCompleteNoteXml (), oldTitle, newTitle);
 
462
                                NoteArchiver.Instance.GetRenamedNoteXml (note.GetCompleteNoteXml (), oldTitle, newTitle);
459
463
                        //Logger.Debug ("RenameNote: newContent: " + newContent);
460
464
                        //Logger.Debug ("RenameNote: newCompleteContent: " + newCompleteContent);
461
 
                        
 
465
 
462
466
                        // We delete and recreate the note to simplify content conflict handling
463
467
                        Tomboy.DefaultNoteManager.Delete (note);
464
 
                        
 
468
 
465
469
                        // Create note with old XmlContent just in case GetCompleteNoteXml failed
466
470
                        Logger.Debug ("RenameNote: about to create " + newTitle);
467
471
                        Note renamedNote = Tomboy.DefaultNoteManager.Create (newTitle, newContent);
468
472
                        if (newCompleteContent != null) {// TODO: Anything to do if it is null?
469
473
                                try {
470
474
                                        renamedNote.LoadForeignNoteXml (newCompleteContent);
471
 
                                } catch {} // TODO: Handle exception in case that newCompleteContent is invalid XML 
 
475
                                } catch {} // TODO: Handle exception in case that newCompleteContent is invalid XML
472
476
                        }
473
 
                        if (noteOpen)
 
477
                if (noteOpen)
474
478
                                renamedNote.Window.Present ();
475
479
                }
476
 
#endregion // Private Methods
477
 
                
 
480
                #endregion // Private Methods
 
481
 
478
482
        }
479
483
 
480
484
 
482
486
        {
483
487
                private Note existingNote;
484
488
                private IList<string> noteUpdateTitles;
485
 
                
 
489
 
486
490
                private Gtk.Button continueButton;
487
 
                
 
491
 
488
492
                private Gtk.Entry renameEntry;
489
493
                private Gtk.CheckButton renameUpdateCheck;
490
494
                private Gtk.RadioButton renameRadio;
491
495
                private Gtk.RadioButton deleteExistingRadio;
492
496
                private Gtk.CheckButton alwaysDoThisCheck;
493
 
                
 
497
 
494
498
                private Gtk.Label headerLabel;
495
499
                private Gtk.Label messageLabel;
496
500
 
497
 
                public SyncTitleConflictDialog (Note existingNote, IList<string> noteUpdateTitles) :
498
 
                        base (Catalog.GetString ("Note Conflict"), null, Gtk.DialogFlags.Modal)
 
501
public SyncTitleConflictDialog (Note existingNote, IList<string> noteUpdateTitles) :
 
502
                base (Catalog.GetString ("Note Conflict"), null, Gtk.DialogFlags.Modal)
499
503
                {
500
504
                        this.existingNote = existingNote;
501
505
                        this.noteUpdateTitles = noteUpdateTitles;
502
 
                        
 
506
 
503
507
                        // Suggest renaming note by appending " (old)" to the existing title
504
508
                        string suggestedRenameBase = existingNote.Title + Catalog.GetString (" (old)");
505
509
                        string suggestedRename = suggestedRenameBase;
506
510
                        for (int i = 1; !IsNoteTitleAvailable (suggestedRename); i++)
507
511
                                suggestedRename = suggestedRenameBase + " " + i.ToString();
508
 
                        
 
512
 
509
513
                        VBox outerVBox = new VBox (false, 12);
510
514
                        outerVBox.BorderWidth = 12;
511
515
                        outerVBox.Spacing = 8;
512
 
                        
 
516
 
513
517
                        HBox hbox = new HBox (false, 8);
514
518
                        Image image = new Image (GuiUtils.GetIcon (Gtk.Stock.DialogWarning, 48)); // TODO: Is this the right icon?
515
519
                        image.Show ();
516
520
                        hbox.PackStart (image, false, false, 0);
517
 
                        
 
521
 
518
522
                        VBox vbox = new VBox (false, 8);
519
 
                        
 
523
 
520
524
                        headerLabel = new Label ();
521
525
                        headerLabel.UseMarkup = true;
522
526
                        headerLabel.Xalign = 0;
523
527
                        headerLabel.UseUnderline = false;
524
528
                        headerLabel.Show ();
525
529
                        vbox.PackStart (headerLabel, false, false, 0);
526
 
                        
 
530
 
527
531
                        messageLabel = new Label ();
528
532
                        messageLabel.Xalign = 0;
529
533
                        messageLabel.UseUnderline = false;
531
535
                        messageLabel.Wrap = true;
532
536
                        messageLabel.Show ();
533
537
                        vbox.PackStart (messageLabel, false, false, 0);
534
 
                        
 
538
 
535
539
                        vbox.Show ();
536
540
                        hbox.PackStart (vbox, true, true, 0);
537
 
                        
 
541
 
538
542
                        hbox.Show ();
539
543
                        outerVBox.PackStart (hbox);
540
544
                        VBox.PackStart (outerVBox);
541
 
                        
 
545
 
542
546
                        Gtk.HBox renameHBox = new Gtk.HBox ();
543
547
                        renameRadio = new Gtk.RadioButton (Catalog.GetString ("Rename local note:"));
544
548
                        renameRadio.Toggled += radio_Toggled;
545
549
                        Gtk.VBox renameOptionsVBox = new Gtk.VBox ();
546
 
                        
 
550
 
547
551
                        renameEntry = new Gtk.Entry (suggestedRename);
548
552
                        renameEntry.Changed += renameEntry_Changed;
549
553
                        renameUpdateCheck = new Gtk.CheckButton (Catalog.GetString ("Update links in referencing notes"));
552
556
                        renameHBox.PackStart (renameRadio);
553
557
                        renameHBox.PackStart (renameOptionsVBox);
554
558
                        VBox.PackStart (renameHBox);
555
 
                        
 
559
 
556
560
                        deleteExistingRadio = new Gtk.RadioButton (renameRadio, Catalog.GetString ("Overwrite local note"));
557
561
                        deleteExistingRadio.Toggled += radio_Toggled;
558
562
                        VBox.PackStart (deleteExistingRadio);
559
 
                        
 
563
 
560
564
                        alwaysDoThisCheck = new Gtk.CheckButton (Catalog.GetString ("Always perform this action"));
561
565
                        VBox.PackStart (alwaysDoThisCheck);
562
 
                        
 
566
 
563
567
                        continueButton = (Gtk.Button) AddButton (Gtk.Stock.GoForward, Gtk.ResponseType.Accept);
564
 
                        
 
568
 
565
569
                        // Set initial dialog text
566
570
                        HeaderText = Catalog.GetString ("Note conflict detected");
567
571
                        MessageText = string.Format (Catalog.GetString ("The server version of \"{0}\" conflicts with your local note."
568
 
                                                                        + "  What do you want to do with your local note?"),
 
572
                                                     + "  What do you want to do with your local note?"),
569
573
                                                     existingNote.Title);
570
 
                        
 
574
 
571
575
                        ShowAll ();
572
576
                }
573
 
                
 
577
 
574
578
                private void renameEntry_Changed (object sender, System.EventArgs e)
575
579
                {
576
580
                        if (renameRadio.Active &&
577
 
                            !IsNoteTitleAvailable (RenamedTitle))
 
581
                                        !IsNoteTitleAvailable (RenamedTitle))
578
582
                                continueButton.Sensitive = false;
579
583
                        else
580
584
                                continueButton.Sensitive = true;
581
585
                }
582
 
                
 
586
 
583
587
                private bool IsNoteTitleAvailable (string renamedTitle)
584
588
                {
585
589
                        return !noteUpdateTitles.Contains (renamedTitle) &&
586
 
                                existingNote.Manager.Find (renamedTitle) == null;
 
590
                               existingNote.Manager.Find (renamedTitle) == null;
587
591
                }
588
 
                
 
592
 
589
593
                // Handler for each radio button's Toggled event
590
594
                private void radio_Toggled (object sender, System.EventArgs e)
591
595
                {
596
600
                        renameEntry.Sensitive = renameRadio.Active;
597
601
                        renameUpdateCheck.Sensitive = renameRadio.Active;
598
602
                }
599
 
                
 
603
 
600
604
                public string HeaderText
601
605
                {
602
606
                        set {
603
607
                                headerLabel.Markup = string.Format (
604
 
                                        "<span size=\"large\" weight=\"bold\">{0}</span>",
605
 
                                        value);
 
608
                                        "<span size=\"large\" weight=\"bold\">{0}</span>",
 
609
                                        value);
606
610
                        }
607
611
                }
608
 
                
 
612
 
609
613
                public string MessageText
610
614
                {
611
 
                        set { messageLabel.Text = value; }
 
615
                        set {
 
616
                                messageLabel.Text = value;
 
617
                        }
612
618
                }
613
 
                
 
619
 
614
620
                public string RenamedTitle
615
621
                {
616
 
                        get { return renameEntry.Text; }
 
622
                        get {
 
623
                                return renameEntry.Text;
 
624
                        }
617
625
                }
618
 
                
 
626
 
619
627
                public bool AlwaysPerformThisAction
620
628
                {
621
 
                        get { return alwaysDoThisCheck.Active; }
 
629
                        get {
 
630
                                return alwaysDoThisCheck.Active;
 
631
                        }
622
632
                }
623
 
                
 
633
 
624
634
                public SyncTitleConflictResolution Resolution
625
635
                {
626
636
                        get
627
637
                        {
628
638
                                if (renameRadio.Active) {
629
639
                                        if (renameUpdateCheck.Active)
630
 
                                                return SyncTitleConflictResolution.RenameExistingAndUpdate;
 
640
                                                return SyncTitleConflictResolution.RenameExistingAndUpdate;
631
641
                                        else
632
642
                                                return SyncTitleConflictResolution.RenameExistingNoUpdate;
633
643
                                }
635
645
                                        return SyncTitleConflictResolution.OverwriteExisting;
636
646
                        }
637
647
                }
638
 
        }       
 
648
        }
639
649
 
640
650
        // NOTE: These enum int values are used to save the default behavior for this dialog
641
651
        public enum SyncTitleConflictResolution