1 #pragma once 2 3 #include "common/common_pch.h" 4 5 #include <QDialog> 6 7 #include "common/qt.h" 8 #include "mkvtoolnix-gui/util/settings.h" 9 10 class QListWidget; 11 class QVariant; 12 13 namespace mtx::gui { 14 15 class SelectCharacterSetDialogPrivate; 16 class SelectCharacterSetDialog : public QDialog { 17 Q_OBJECT 18 19 protected: 20 MTX_DECLARE_PRIVATE(SelectCharacterSetDialogPrivate) 21 22 std::unique_ptr<SelectCharacterSetDialogPrivate> const p_ptr; 23 24 explicit SelectCharacterSetDialog(SelectCharacterSetDialogPrivate &p); 25 26 public: 27 explicit SelectCharacterSetDialog(QWidget *parent, QString const &fileName, QString const &initialCharacterSet = QString{}, QStringList const &additionalCharacterSets = QStringList{}); 28 virtual ~SelectCharacterSetDialog(); 29 30 void setUserData(QVariant const &data); 31 QVariant const &userData() const; 32 33 Q_SIGNALS: 34 void characterSetSelected(QString const &characterSet); 35 36 public Q_SLOTS: 37 virtual void updatePreview(); 38 virtual void emitResult(); 39 virtual void retranslateUi(); 40 41 protected: 42 QString selectedCharacterSet() const; 43 }; 44 45 } 46