GUI: merge: set certain line edits to dropped file names

Implements #1344.
This commit is contained in:
Moritz Bunkus 2015-08-12 16:34:14 +02:00
parent e576c139b1
commit 6ec6b5b3f4
8 changed files with 254 additions and 120 deletions

View File

@ -1,5 +1,10 @@
2015-08-12 Moritz Bunkus <moritz@bunkus.org>
* MKVToolNix GUI: new merge tool feature: dragging & dropping
files onto line edit controls that expect file names (e.g. the
»chapter file« control) will set that line edit's test to the
dropped file name. Implements #1344.
* mkvmerge: bug fix: track statistics tags can be kept with the
option »--engage keep_track_statistics_tags«. This allows
outputting them in verbose identification mode for easier

View File

@ -396,7 +396,7 @@
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLineEdit" name="trackTags"/>
<widget class="mtx::gui::Util::BasicLineEdit" name="trackTags"/>
</item>
<item>
<widget class="QPushButton" name="browseTrackTags">
@ -526,7 +526,7 @@
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLineEdit" name="timecodes"/>
<widget class="mtx::gui::Util::BasicLineEdit" name="timecodes"/>
</item>
<item>
<widget class="QPushButton" name="browseTimecodes">
@ -834,7 +834,7 @@
<item row="1" column="1">
<layout class="QHBoxLayout" name="hlOutput">
<item>
<widget class="QLineEdit" name="output"/>
<widget class="mtx::gui::Util::BasicLineEdit" name="output"/>
</item>
<item>
<widget class="QPushButton" name="browseOutput">
@ -859,7 +859,7 @@
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLineEdit" name="globalTags"/>
<widget class="mtx::gui::Util::BasicLineEdit" name="globalTags"/>
</item>
<item>
<widget class="QPushButton" name="browseGlobalTags">
@ -884,7 +884,7 @@
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLineEdit" name="segmentInfo"/>
<widget class="mtx::gui::Util::BasicLineEdit" name="segmentInfo"/>
</item>
<item>
<widget class="QPushButton" name="browseSegmentInfo">
@ -1099,7 +1099,7 @@
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLineEdit" name="chapters"/>
<widget class="mtx::gui::Util::BasicLineEdit" name="chapters"/>
</item>
<item>
<widget class="QPushButton" name="browseChapters">
@ -1479,6 +1479,11 @@
<header>mkvtoolnix-gui/util/files_drag_drop_widget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>mtx::gui::Util::BasicLineEdit</class>
<extends>QLineEdit</extends>
<header>mkvtoolnix-gui/util/basic_line_edit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabs</tabstop>
@ -1587,9 +1592,9 @@
</connection>
<connection>
<sender>trackName</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onTrackNameEdited(QString)</slot>
<slot>onTrackNameChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>845</x>
@ -1683,9 +1688,9 @@
</connection>
<connection>
<sender>trackTags</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onTrackTagsEdited(QString)</slot>
<slot>onTrackTagsChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>802</x>
@ -1701,7 +1706,7 @@
<sender>delay</sender>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onDelayEdited(QString)</slot>
<slot>onDelayChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>844</x>
@ -1717,7 +1722,7 @@
<sender>stretchBy</sender>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onStretchByEdited(QString)</slot>
<slot>onStretchByChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>844</x>
@ -1733,7 +1738,7 @@
<sender>defaultDuration</sender>
<signal>editTextChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onDefaultDurationEdited(QString)</slot>
<slot>onDefaultDurationChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>844</x>
@ -1747,9 +1752,9 @@
</connection>
<connection>
<sender>timecodes</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onTimecodesEdited(QString)</slot>
<slot>onTimecodesChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>801</x>
@ -1829,7 +1834,7 @@
<sender>aspectRatio</sender>
<signal>editTextChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAspectRatioEdited(QString)</slot>
<slot>onAspectRatioChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>845</x>
@ -1845,7 +1850,7 @@
<sender>aspectRatio</sender>
<signal>currentIndexChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAspectRatioEdited(QString)</slot>
<slot>onAspectRatioChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>845</x>
@ -1861,7 +1866,7 @@
<sender>defaultDuration</sender>
<signal>currentIndexChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onDefaultDurationEdited(QString)</slot>
<slot>onDefaultDurationChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>844</x>
@ -1875,9 +1880,9 @@
</connection>
<connection>
<sender>displayWidth</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onDisplayWidthEdited(QString)</slot>
<slot>onDisplayWidthChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>697</x>
@ -1891,9 +1896,9 @@
</connection>
<connection>
<sender>displayHeight</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onDisplayHeightEdited(QString)</slot>
<slot>onDisplayHeightChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>844</x>
@ -1923,9 +1928,9 @@
</connection>
<connection>
<sender>cropping</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onCroppingEdited(QString)</slot>
<slot>onCroppingChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>845</x>
@ -1971,9 +1976,9 @@
</connection>
<connection>
<sender>additionalTrackOptions</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAdditionalTrackOptionsEdited(QString)</slot>
<slot>onAdditionalTrackOptionsChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>845</x>
@ -2003,9 +2008,9 @@
</connection>
<connection>
<sender>title</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onTitleEdited(QString)</slot>
<slot>onTitleChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>228</x>
@ -2019,7 +2024,7 @@
</connection>
<connection>
<sender>output</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>setDestination(QString)</slot>
<hints>
@ -2035,9 +2040,9 @@
</connection>
<connection>
<sender>globalTags</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onGlobalTagsEdited(QString)</slot>
<slot>onGlobalTagsChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>229</x>
@ -2051,9 +2056,9 @@
</connection>
<connection>
<sender>segmentInfo</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onSegmentInfoEdited(QString)</slot>
<slot>onSegmentInfoChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>333</x>
@ -2147,9 +2152,9 @@
</connection>
<connection>
<sender>segmentUIDs</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onSegmentUIDsEdited(QString)</slot>
<slot>onSegmentUIDsChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>740</x>
@ -2163,9 +2168,9 @@
</connection>
<connection>
<sender>previousSegmentUID</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onPreviousSegmentUIDEdited(QString)</slot>
<slot>onPreviousSegmentUIDChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>740</x>
@ -2179,9 +2184,9 @@
</connection>
<connection>
<sender>nextSegmentUID</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onNextSegmentUIDEdited(QString)</slot>
<slot>onNextSegmentUIDChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>740</x>
@ -2195,9 +2200,9 @@
</connection>
<connection>
<sender>chapters</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onChaptersEdited(QString)</slot>
<slot>onChaptersChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>829</x>
@ -2259,7 +2264,7 @@
</connection>
<connection>
<sender>chapterCueNameFormat</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onChapterCueNameFormatChanged(QString)</slot>
<hints>
@ -2291,9 +2296,9 @@
</connection>
<connection>
<sender>additionalOptions</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAdditionalOptionsEdited(QString)</slot>
<slot>onAdditionalOptionsChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>781</x>
@ -2323,9 +2328,9 @@
</connection>
<connection>
<sender>attachmentName</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAttachmentNameEdited(QString)</slot>
<slot>onAttachmentNameChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>205</x>
@ -2341,7 +2346,7 @@
<sender>attachmentMIMEType</sender>
<signal>editTextChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAttachmentMIMETypeEdited(QString)</slot>
<slot>onAttachmentMIMETypeChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>186</x>
@ -2357,7 +2362,7 @@
<sender>attachmentMIMEType</sender>
<signal>currentIndexChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAttachmentMIMETypeEdited(QString)</slot>
<slot>onAttachmentMIMETypeChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>186</x>
@ -2371,9 +2376,9 @@
</connection>
<connection>
<sender>attachmentDescription</sender>
<signal>textEdited(QString)</signal>
<signal>textChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onAttachmentDescriptionEdited(QString)</slot>
<slot>onAttachmentDescriptionChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>634</x>
@ -2485,7 +2490,7 @@
<sender>splitOptions</sender>
<signal>editTextChanged(QString)</signal>
<receiver>mtx::gui::Merge::Tab</receiver>
<slot>onSplitOptionsEdited(QString)</slot>
<slot>onSplitOptionsChanged(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>451</x>
@ -2551,10 +2556,10 @@
<slot>onAddAttachment()</slot>
<slot>onAddFiles()</slot>
<slot>onAddToJobQueue()</slot>
<slot>onAspectRatioEdited(QString)</slot>
<slot>onAttachmentDescriptionEdited(QString)</slot>
<slot>onAttachmentMIMETypeEdited(QString)</slot>
<slot>onAttachmentNameEdited(QString)</slot>
<slot>onAspectRatioChanged(QString)</slot>
<slot>onAttachmentDescriptionChanged(QString)</slot>
<slot>onAttachmentMIMETypeChanged(QString)</slot>
<slot>onAttachmentNameChanged(QString)</slot>
<slot>onAttachmentSelectionChanged()</slot>
<slot>onAttachmentStyleChanged(int)</slot>
<slot>onBrowseChapters()</slot>
@ -2566,48 +2571,48 @@
<slot>onChapterCharacterSetChanged(QString)</slot>
<slot>onChapterCueNameFormatChanged(QString)</slot>
<slot>onChapterLanguageChanged(int)</slot>
<slot>onChaptersEdited(QString)</slot>
<slot>onChaptersChanged(QString)</slot>
<slot>onCompressionChanged(int)</slot>
<slot>onCroppingEdited(QString)</slot>
<slot>onCroppingChanged(QString)</slot>
<slot>onCuesChanged(int)</slot>
<slot>onDefaultDurationEdited(QString)</slot>
<slot>onDefaultDurationChanged(QString)</slot>
<slot>onDefaultTrackFlagChanged(int)</slot>
<slot>onDelayEdited(QString)</slot>
<slot>onDisplayHeightEdited(QString)</slot>
<slot>onDisplayWidthEdited(QString)</slot>
<slot>onDelayChanged(QString)</slot>
<slot>onDisplayHeightChanged(QString)</slot>
<slot>onDisplayWidthChanged(QString)</slot>
<slot>onEditAdditionalOptions()</slot>
<slot>onFilesContextMenu()</slot>
<slot>onForcedTrackFlagChanged(int)</slot>
<slot>onGlobalTagsEdited(QString)</slot>
<slot>onGlobalTagsChanged(QString)</slot>
<slot>onLinkFilesClicked(bool)</slot>
<slot>onMuxThisChanged(int)</slot>
<slot>onNew()</slot>
<slot>onNextSegmentUIDEdited(QString)</slot>
<slot>onNextSegmentUIDChanged(QString)</slot>
<slot>onOpenConfig()</slot>
<slot>setDestination(QString)</slot>
<slot>onPreviousSegmentUIDEdited(QString)</slot>
<slot>onPreviousSegmentUIDChanged(QString)</slot>
<slot>onRemoveAttachments()</slot>
<slot>onSaveConfig()</slot>
<slot>onSaveConfigAs()</slot>
<slot>onSegmentUIDsEdited(QString)</slot>
<slot>onSegmentInfoEdited(QString)</slot>
<slot>onSegmentUIDsChanged(QString)</slot>
<slot>onSegmentInfoChanged(QString)</slot>
<slot>onSetAspectRatio()</slot>
<slot>onSetDisplayDimensions()</slot>
<slot>onSplitMaxFilesChanged(int)</slot>
<slot>onSplitModeChanged(int)</slot>
<slot>onSplitOptionsEdited(QString)</slot>
<slot>onSplitOptionsChanged(QString)</slot>
<slot>onStartMuxing()</slot>
<slot>onStereoscopyChanged(int)</slot>
<slot>onStretchByEdited(QString)</slot>
<slot>onStretchByChanged(QString)</slot>
<slot>onSubtitleCharacterSetChanged(int)</slot>
<slot>onTimecodesEdited(QString)</slot>
<slot>onTitleEdited(QString)</slot>
<slot>onTimecodesChanged(QString)</slot>
<slot>onTitleChanged(QString)</slot>
<slot>onTrackLanguageChanged(int)</slot>
<slot>onTrackNameEdited(QString)</slot>
<slot>onTrackTagsEdited(QString)</slot>
<slot>onTrackNameChanged(QString)</slot>
<slot>onTrackTagsChanged(QString)</slot>
<slot>onTracksContextMenu()</slot>
<slot>onAdditionalOptionsEdited(QString)</slot>
<slot>onAdditionalTrackOptionsEdited(QString)</slot>
<slot>onAdditionalOptionsChanged(QString)</slot>
<slot>onAdditionalTrackOptionsChanged(QString)</slot>
<slot>onWebmClicked(bool)</slot>
<slot>resizeAttachmentsColumnsToContents()</slot>
<slot>resizeFilesColumnsToContents()</slot>

View File

@ -83,17 +83,17 @@ Tab::selectAttachments(QList<Attachment *> const &attachments) {
}
void
Tab::onAttachmentNameEdited(QString newValue) {
Tab::onAttachmentNameChanged(QString newValue) {
withSelectedAttachments([&](Attachment *attachment) { attachment->m_name = newValue; });
}
void
Tab::onAttachmentDescriptionEdited(QString newValue) {
Tab::onAttachmentDescriptionChanged(QString newValue) {
withSelectedAttachments([&](Attachment *attachment) { attachment->m_description = newValue; });
}
void
Tab::onAttachmentMIMETypeEdited(QString newValue) {
Tab::onAttachmentMIMETypeChanged(QString newValue) {
withSelectedAttachments([&](Attachment *attachment) { attachment->m_MIMEType = newValue; });
}

View File

@ -504,7 +504,7 @@ Tab::withSelectedTracks(std::function<void(Track *)> code,
}
void
Tab::onTrackNameEdited(QString newValue) {
Tab::onTrackNameChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_name = newValue; }, true);
}
@ -619,27 +619,27 @@ Tab::onCompressionChanged(int newValue) {
}
void
Tab::onTrackTagsEdited(QString newValue) {
Tab::onTrackTagsChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_tags = newValue; }, true);
}
void
Tab::onDelayEdited(QString newValue) {
Tab::onDelayChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_delay = newValue; });
}
void
Tab::onStretchByEdited(QString newValue) {
Tab::onStretchByChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_stretchBy = newValue; });
}
void
Tab::onDefaultDurationEdited(QString newValue) {
Tab::onDefaultDurationChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_defaultDuration = newValue; }, true);
}
void
Tab::onTimecodesEdited(QString newValue) {
Tab::onTimecodesChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_timecodes = newValue; });
}
@ -673,17 +673,17 @@ Tab::onSetDisplayDimensions() {
}
void
Tab::onAspectRatioEdited(QString newValue) {
Tab::onAspectRatioChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_aspectRatio = newValue; }, true);
}
void
Tab::onDisplayWidthEdited(QString newValue) {
Tab::onDisplayWidthChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_displayWidth = newValue; }, true);
}
void
Tab::onDisplayHeightEdited(QString newValue) {
Tab::onDisplayHeightChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_displayHeight = newValue; }, true);
}
@ -708,7 +708,7 @@ Tab::onNaluSizeLengthChanged(int newValue) {
}
void
Tab::onCroppingEdited(QString newValue) {
Tab::onCroppingChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_cropping = newValue; }, true);
}
@ -747,7 +747,7 @@ Tab::onCuesChanged(int newValue) {
}
void
Tab::onAdditionalTrackOptionsEdited(QString newValue) {
Tab::onAdditionalTrackOptionsChanged(QString newValue) {
withSelectedTracks([&](Track *track) { track->m_additionalOptions = newValue; }, true);
}

View File

@ -155,7 +155,7 @@ Tab::setupOutputToolTips() {
}
void
Tab::onTitleEdited(QString newValue) {
Tab::onTitleChanged(QString newValue) {
m_config.m_title = newValue;
}
@ -205,7 +205,7 @@ Tab::onBrowseOutput() {
}
void
Tab::onGlobalTagsEdited(QString newValue) {
Tab::onGlobalTagsChanged(QString newValue) {
m_config.m_globalTags = newValue;
}
@ -217,7 +217,7 @@ Tab::onBrowseGlobalTags() {
}
void
Tab::onSegmentInfoEdited(QString newValue) {
Tab::onSegmentInfoChanged(QString newValue) {
m_config.m_segmentInfo = newValue;
}
@ -348,7 +348,7 @@ Tab::onSplitModeChanged(int newMode) {
}
void
Tab::onSplitOptionsEdited(QString newValue) {
Tab::onSplitOptionsChanged(QString newValue) {
m_config.m_splitOptions = newValue;
}
@ -363,22 +363,22 @@ Tab::onSplitMaxFilesChanged(int newValue) {
}
void
Tab::onSegmentUIDsEdited(QString newValue) {
Tab::onSegmentUIDsChanged(QString newValue) {
m_config.m_segmentUIDs = newValue;
}
void
Tab::onPreviousSegmentUIDEdited(QString newValue) {
Tab::onPreviousSegmentUIDChanged(QString newValue) {
m_config.m_previousSegmentUID = newValue;
}
void
Tab::onNextSegmentUIDEdited(QString newValue) {
Tab::onNextSegmentUIDChanged(QString newValue) {
m_config.m_nextSegmentUID = newValue;
}
void
Tab::onChaptersEdited(QString newValue) {
Tab::onChaptersChanged(QString newValue) {
m_config.m_chapters = newValue;
}
@ -418,7 +418,7 @@ Tab::onWebmClicked(bool newValue) {
}
void
Tab::onAdditionalOptionsEdited(QString newValue) {
Tab::onAdditionalOptionsChanged(QString newValue) {
m_config.m_additionalOptions = newValue;
}

View File

@ -102,34 +102,34 @@ public slots:
virtual void setupMoveUpDownButtons();
virtual void enableMoveFilesButtons();
virtual void onTrackNameEdited(QString newValue);
virtual void onTrackNameChanged(QString newValue);
virtual void onTrackItemChanged(QStandardItem *item);
virtual void onMuxThisChanged(int selected);
virtual void onTrackLanguageChanged(int newValue);
virtual void onDefaultTrackFlagChanged(int newValue);
virtual void onForcedTrackFlagChanged(int newValue);
virtual void onCompressionChanged(int newValue);
virtual void onTrackTagsEdited(QString newValue);
virtual void onDelayEdited(QString newValue);
virtual void onStretchByEdited(QString newValue);
virtual void onDefaultDurationEdited(QString newValue);
virtual void onTimecodesEdited(QString newValue);
virtual void onTrackTagsChanged(QString newValue);
virtual void onDelayChanged(QString newValue);
virtual void onStretchByChanged(QString newValue);
virtual void onDefaultDurationChanged(QString newValue);
virtual void onTimecodesChanged(QString newValue);
virtual void onBrowseTimecodes();
virtual void onFixBitstreamTimingInfoChanged(bool newValue);
virtual void onBrowseTrackTags();
virtual void onSetAspectRatio();
virtual void onSetDisplayDimensions();
virtual void onAspectRatioEdited(QString newValue);
virtual void onDisplayWidthEdited(QString newValue);
virtual void onDisplayHeightEdited(QString newValue);
virtual void onAspectRatioChanged(QString newValue);
virtual void onDisplayWidthChanged(QString newValue);
virtual void onDisplayHeightChanged(QString newValue);
virtual void onStereoscopyChanged(int newValue);
virtual void onNaluSizeLengthChanged(int newValue);
virtual void onCroppingEdited(QString newValue);
virtual void onCroppingChanged(QString newValue);
virtual void onAacIsSBRChanged(int newValue);
virtual void onReduceAudioToCoreChanged(bool newValue);
virtual void onSubtitleCharacterSetChanged(int newValue);
virtual void onCuesChanged(int newValue);
virtual void onAdditionalTrackOptionsEdited(QString newValue);
virtual void onAdditionalTrackOptionsChanged(QString newValue);
virtual void resizeFilesColumnsToContents() const;
virtual void resizeTracksColumnsToContents() const;
@ -153,33 +153,33 @@ public slots:
virtual void clearTitle();
virtual void clearTitleMaybe();
virtual void onTitleEdited(QString newValue);
virtual void onTitleChanged(QString newValue);
virtual void onBrowseOutput();
virtual void onGlobalTagsEdited(QString newValue);
virtual void onGlobalTagsChanged(QString newValue);
virtual void onBrowseGlobalTags();
virtual void onSegmentInfoEdited(QString newValue);
virtual void onSegmentInfoChanged(QString newValue);
virtual void onBrowseSegmentInfo();
virtual void onSplitModeChanged(int newMode);
virtual void onSplitOptionsEdited(QString newValue);
virtual void onSplitOptionsChanged(QString newValue);
virtual void onLinkFilesClicked(bool newValue);
virtual void onSplitMaxFilesChanged(int newValue);
virtual void onSegmentUIDsEdited(QString newValue);
virtual void onPreviousSegmentUIDEdited(QString newValue);
virtual void onNextSegmentUIDEdited(QString newValue);
virtual void onChaptersEdited(QString newValue);
virtual void onSegmentUIDsChanged(QString newValue);
virtual void onPreviousSegmentUIDChanged(QString newValue);
virtual void onNextSegmentUIDChanged(QString newValue);
virtual void onChaptersChanged(QString newValue);
virtual void onBrowseChapters();
virtual void onChapterLanguageChanged(int newValue);
virtual void onChapterCharacterSetChanged(QString newValue);
virtual void onChapterCueNameFormatChanged(QString newValue);
virtual void onWebmClicked(bool newValue);
virtual void onAdditionalOptionsEdited(QString newValue);
virtual void onAdditionalOptionsChanged(QString newValue);
virtual void onEditAdditionalOptions();
// Attachments tab:
virtual void onAttachmentSelectionChanged();
virtual void onAttachmentNameEdited(QString newValue);
virtual void onAttachmentDescriptionEdited(QString newValue);
virtual void onAttachmentMIMETypeEdited(QString newValue);
virtual void onAttachmentNameChanged(QString newValue);
virtual void onAttachmentDescriptionChanged(QString newValue);
virtual void onAttachmentMIMETypeChanged(QString newValue);
virtual void onAttachmentStyleChanged(int newValue);
virtual void onAddAttachments();
virtual void onRemoveAttachments();

View File

@ -0,0 +1,83 @@
#include "common/common_pch.h"
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include "common/list_utils.h"
#include "mkvtoolnix-gui/util/basic_line_edit.h"
namespace mtx { namespace gui { namespace Util {
using namespace mtx::gui;
class BasicLineEditPrivate {
friend class BasicLineEdit;
bool m_acceptDroppedFiles{true}, m_setTextToDroppedFileName{true};
FilesDragDropHandler m_filesDDHandler{FilesDragDropHandler::Mode::Remember};
};
BasicLineEdit::BasicLineEdit(QWidget *parent)
: QLineEdit{parent}
, d_ptr{new BasicLineEditPrivate}
{
}
BasicLineEdit::~BasicLineEdit() {
}
BasicLineEdit &
BasicLineEdit::acceptDroppedFiles(bool enable) {
Q_D(BasicLineEdit);
d->m_acceptDroppedFiles = enable;
return *this;
}
BasicLineEdit &
BasicLineEdit::setTextToDroppedFileName(bool enable) {
Q_D(BasicLineEdit);
d->m_setTextToDroppedFileName = enable;
return *this;
}
void
BasicLineEdit::dragEnterEvent(QDragEnterEvent *event) {
Q_D(BasicLineEdit);
if (d->m_acceptDroppedFiles && d->m_filesDDHandler.handle(event, false))
return;
QLineEdit::dragEnterEvent(event);
}
void
BasicLineEdit::dragMoveEvent(QDragMoveEvent *event) {
Q_D(BasicLineEdit);
if (d->m_acceptDroppedFiles && d->m_filesDDHandler.handle(event, false))
return;
QLineEdit::dragMoveEvent(event);
}
void
BasicLineEdit::dropEvent(QDropEvent *event) {
Q_D(BasicLineEdit);
if (d->m_acceptDroppedFiles && d->m_filesDDHandler.handle(event, true)) {
auto fileNames = d->m_filesDDHandler.fileNames();
if (d->m_setTextToDroppedFileName && !fileNames.isEmpty())
setText(fileNames[0]);
emit filesDropped(fileNames);
return;
}
QLineEdit::dropEvent(event);
}
}}}

View File

@ -0,0 +1,41 @@
#ifndef MTX_MKVTOOLNIX_GUI_UTIL_BASIC_LINE_EDIT_H
#define MTX_MKVTOOLNIX_GUI_UTIL_BASIC_LINE_EDIT_H
#include "common/common_pch.h"
#include <QLineEdit>
#include "mkvtoolnix-gui/util/files_drag_drop_handler.h"
class QDragEnterEvent;
class QDragMoveEvent;
class QDropEvent;
namespace mtx { namespace gui { namespace Util {
class BasicLineEditPrivate;
class BasicLineEdit : public QLineEdit {
Q_OBJECT;
Q_DECLARE_PRIVATE(BasicLineEdit);
QScopedPointer<BasicLineEditPrivate> const d_ptr;
public:
BasicLineEdit(QWidget *parent);
virtual ~BasicLineEdit();
BasicLineEdit &acceptDroppedFiles(bool enable);
BasicLineEdit &setTextToDroppedFileName(bool enable);
signals:
void filesDropped(QStringList const &fileNames);
protected:
virtual void dragEnterEvent(QDragEnterEvent *event) override;
virtual void dragMoveEvent(QDragMoveEvent *event) override;
virtual void dropEvent(QDropEvent *event) override;
};
}}}
#endif // MTX_MKVTOOLNIX_GUI_UTIL_BASIC_LINE_EDIT_H