File indexing completed on 2024-12-22 04:40:07

0001 /*
0002     SPDX-FileCopyrightText: 2007-2009 Sergio Pistone <sergio_pistone@yahoo.com.ar>
0003     SPDX-FileCopyrightText: 2010-2022 Mladen Milinkovic <max@smoothware.net>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #include "syncsubtitlesdialog.h"
0009 
0010 #include <QGroupBox>
0011 #include <QRadioButton>
0012 #include <QGridLayout>
0013 
0014 using namespace SubtitleComposer;
0015 
0016 SyncSubtitlesDialog::SyncSubtitlesDialog(QWidget *parent) :
0017     SelectableSubtitleDialog(i18n("Synchronize with Subtitle"), parent)
0018 {
0019     createSubtitleGroupBox(i18n("Reference Subtitle"));
0020 
0021     QGroupBox *syncModeGroupBox = createGroupBox(i18nc("@title:group", "Synchronization Mode"));
0022 
0023     m_adjustRadioButton = new QRadioButton(syncModeGroupBox);
0024     m_adjustRadioButton->setText(i18n("Adjust to reference's first and last lines"));
0025     m_adjustRadioButton->setChecked(true);
0026 
0027     m_synchronizeRadioButton = new QRadioButton(syncModeGroupBox);
0028     m_synchronizeRadioButton->setText(i18n("Copy timing information from reference line by line"));
0029 
0030     QGridLayout *syncModeLayout = createLayout(syncModeGroupBox);
0031     syncModeLayout->addWidget(m_adjustRadioButton, 0, 0);
0032     syncModeLayout->addWidget(m_synchronizeRadioButton, 1, 0);
0033 }
0034 
0035 bool
0036 SyncSubtitlesDialog::adjustToReferenceSubtitle() const
0037 {
0038     return m_adjustRadioButton->isChecked();
0039 }
0040 
0041 bool
0042 SyncSubtitlesDialog::synchronizeToReferenceTimes() const
0043 {
0044     return m_synchronizeRadioButton->isChecked();
0045 }
0046 
0047