~berthold-daum/zora/trunk

« back to all changes in this revision

Viewing changes to com.bdaum.zoom.ui/src/com/bdaum/zoom/ui/internal/dialogs/SlideshowEditDialog.java

  • Committer: bdaum
  • Date: 2015-12-26 10:21:51 UTC
  • Revision ID: berthold.daum@bdaum.de-20151226102151-44f1j5113167thb9
VersionĀ 2.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
import com.bdaum.zoom.cat.model.group.webGallery.WebGalleryImpl;
61
61
import com.bdaum.zoom.core.Constants;
62
62
import com.bdaum.zoom.core.QueryField;
63
 
import com.bdaum.zoom.core.db.ICollectionProcessor;
64
63
import com.bdaum.zoom.ui.dialogs.ZTitleAreaDialog;
65
64
import com.bdaum.zoom.ui.internal.HelpContextIds;
66
65
import com.bdaum.zoom.ui.internal.UiActivator;
83
82
 
84
83
        public static final String FROMPREVIEW = "fromPreview"; //$NON-NLS-1$
85
84
 
 
85
        public static final String VOICENOTES = "voicenotes"; //$NON-NLS-1$
 
86
 
86
87
        private static final String SKIP_DUBLETTES = "skipDublettes"; //$NON-NLS-1$
87
88
 
88
89
        public static final String[] EFFECTS = new String[] {
124
125
        private Text durationField;
125
126
        private Text fadingField;
126
127
        private boolean fromPreview = false;
 
128
        private boolean voiceNotes = false;
127
129
        private int fading = 1000;
128
130
        private int effect = Constants.SLIDE_TRANSITION_RANDOM;
129
131
        private int duration = 7000;
130
132
 
 
133
        private Combo titleContentField;
 
134
 
 
135
        private Button voiceButton;
 
136
 
131
137
        private Button fromPreviewButton;
132
138
 
133
139
        private int titleDisplay = 1500;
182
188
                }
183
189
        };
184
190
 
185
 
        private Combo titleContentField;
186
 
 
187
191
        @Override
188
192
        protected Control createDialogArea(Composite parent) {
189
193
                Composite area = (Composite) super.createDialogArea(parent);
230
234
                final Composite pcomp = new Composite(comp, SWT.NONE);
231
235
                pcomp.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2,
232
236
                                1));
233
 
                final GridLayout gridLayout_2 = new GridLayout();
234
 
                gridLayout_2.numColumns = 2;
235
 
                pcomp.setLayout(gridLayout_2);
 
237
                pcomp.setLayout(new GridLayout(3, false));
236
238
                fromPreviewButton = WidgetFactory.createCheckButton(pcomp,
237
239
                                Messages.SlideshowEditDialog_use_preview_where_possible, null);
238
240
                if (adhoc)
239
241
                        skipDubletteswButton = WidgetFactory.createCheckButton(pcomp,
240
242
                                        Messages.SlideshowEditDialog_skip_duplkcates, null);
241
 
 
 
243
                voiceButton = WidgetFactory.createCheckButton(pcomp,
 
244
                                Messages.SlideshowEditDialog_voicenotes, null);
242
245
                final Label defaultTimingForLabel = new Label(comp, SWT.NONE);
243
246
                defaultTimingForLabel
244
247
                                .setText(Messages.SlideshowEditDialog_default_timing);
391
394
                } catch (Exception e) {
392
395
                        // ignore
393
396
                }
394
 
                if (show != null) {
 
397
                try {
 
398
                        voiceNotes = settings.getBoolean(VOICENOTES);
 
399
                } catch (Exception e) {
 
400
                        // ignore
 
401
                }
 
402
                if (show != null && !adhoc) {
395
403
                        if (!template) {
396
404
                                if (nameField != null)
397
405
                                        nameField.setText(show.getName());
403
411
                        titleDisplay = show.getTitleDisplay();
404
412
                        titleContent = show.getTitleContent();
405
413
                        fromPreview = show.getFromPreview();
 
414
                        voiceNotes = show.getVoiceNotes();
406
415
                }
407
416
                af.setMaximumFractionDigits(1);
408
417
                durationField.setText(af.format(duration / 1000d));
411
420
                titleDisplayField.setText(af.format(titleDisplay / 1000d));
412
421
                titleContentField.select(titleContent);
413
422
                fromPreviewButton.setSelection(fromPreview);
 
423
                voiceButton.setSelection(voiceNotes);
414
424
                if (skipDubletteswButton != null) {
415
425
                        try {
416
426
                                skipDublettes = settings.getBoolean(SKIP_DUBLETTES);
471
481
                                result.setTitleContent(titleContent);
472
482
                                settings.put(TITLECONTENT, titleContent);
473
483
                                fromPreview = fromPreviewButton.getSelection();
 
484
                                voiceNotes = voiceButton.getSelection();
474
485
                                settings.put(FROMPREVIEW, fromPreview);
 
486
                                settings.put(VOICENOTES, voiceNotes);
475
487
                                result.setFromPreview(fromPreview);
 
488
                                result.setVoiceNotes(voiceNotes);
476
489
                                if (skipDubletteswButton != null) {
477
490
                                        skipDublettes = skipDubletteswButton.getSelection();
478
491
                                        settings.put(SKIP_DUBLETTES, skipDublettes);
526
539
                                SlideImpl slide = dbManager
527
540
                                                .obtainById(SlideImpl.class, slideId);
528
541
                                if (slide != null) {
529
 
                                        SlideImpl newSlide = new SlideImpl(slide.getCaption(),
530
 
                                                        slide.getSequenceNo(), slide.getDescription(),
531
 
                                                        slide.getLayout(), slide.getDelay(),
532
 
                                                        slide.getFadeIn(), slide.getDuration(),
533
 
                                                        slide.getFadeOut(), slide.getEffect(),
534
 
                                                        slide.getAsset());
 
542
                                        SlideImpl newSlide = SlideshowView.cloneSlide(slide);
535
543
                                        dbManager.store(newSlide);
536
544
                                        show.addEntry(newSlide.getStringId());
537
545
                                }
546
554
                                                        seqNo++,
547
555
                                                        "", Constants.SLIDE_NO_THUMBNAILS, show.getFading(), //$NON-NLS-1$
548
556
                                                        show.getFading(), show.getDuration(), show
549
 
                                                                        .getFading(), show.getEffect(), null);
 
557
                                                                        .getFading(), show.getEffect(), true, null);
550
558
                                        dbManager.store(newSlide);
551
559
                                        show.addEntry(newSlide.getStringId());
552
560
                                        for (String exhibitId : wall.getExhibit()) {
562
570
                                                                        Constants.SLIDE_NO_THUMBNAILS,
563
571
                                                                        show.getFading(), show.getFading(),
564
572
                                                                        show.getDuration(), show.getFading(),
565
 
                                                                        show.getEffect(), assetId);
 
573
                                                                        show.getEffect(), false, assetId);
566
574
                                                        dbManager.store(newSlide);
567
575
                                                        show.addEntry(newSlide.getStringId());
568
576
                                                }
577
585
                                                        seqNo++, storyboard.getDescription(),
578
586
                                                        Constants.SLIDE_NO_THUMBNAILS, show.getFading(),
579
587
                                                        show.getFading(), show.getDuration(),
580
 
                                                        show.getFading(), show.getEffect(), null);
 
588
                                                        show.getFading(), show.getEffect(), true, null);
581
589
                                        dbManager.store(newSlide);
582
590
                                        show.addEntry(newSlide.getStringId());
583
591
                                        for (String exhibitId : storyboard.getExhibit()) {
593
601
                                                                        Constants.SLIDE_NO_THUMBNAILS,
594
602
                                                                        show.getFading(), show.getFading(),
595
603
                                                                        show.getDuration(), show.getFading(),
596
 
                                                                        show.getEffect(), assetId);
 
604
                                                                        show.getEffect(), false, assetId);
597
605
                                                        dbManager.store(newSlide);
598
606
                                                        show.addEntry(newSlide.getStringId());
599
607
                                                }
601
609
                                }
602
610
                        } else if (obj instanceof SmartCollectionImpl) {
603
611
                                int seqNo = 1;
604
 
                                ICollectionProcessor processor = dbManager
605
 
                                                .createCollectionProcessor((SmartCollection) obj);
606
 
                                List<Asset> select = processor.select(true);
607
 
                                for (Asset asset : select) {
 
612
                                for (Asset asset : dbManager.createCollectionProcessor(
 
613
                                                (SmartCollection) obj).select(true)) {
608
614
                                        if (!SlideshowView.accepts(asset))
609
615
                                                continue;
610
616
                                        SlideImpl newSlide = new SlideImpl(
611
617
                                                        UiUtilities.createSlideTitle(asset), seqNo++, null,
612
618
                                                        Constants.SLIDE_NO_THUMBNAILS, show.getFading(),
613
619
                                                        show.getFading(), show.getDuration(),
614
 
                                                        show.getFading(), show.getEffect(),
 
620
                                                        show.getFading(), show.getEffect(), false,
615
621
                                                        asset.getStringId());
616
622
                                        dbManager.store(newSlide);
617
623
                                        show.addEntry(newSlide.getStringId());