diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bd7930..91ca9a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,8 @@ set (PPIC_HEADER_FILES set (PPIC_UI_FILES app/settingsdialog.ui + app/aboutdialog.ui + app/metadatadialog.ui ) set (PPIC_QRC_FILES diff --git a/app/aboutdialog.cpp b/app/aboutdialog.cpp index 5912bc5..cda0f0c 100644 --- a/app/aboutdialog.cpp +++ b/app/aboutdialog.cpp @@ -18,7 +18,7 @@ static QString loadEmbeddedHtml(QString&& path) { } AboutDialog::AboutDialog(QWidget *parent) - : QDialog(parent), ui(new Ui::AboutDialog) + : QDialog(parent), ui(new QT_PREPEND_NAMESPACE(Ui::AboutDialog)) { ui->setupUi(this); setWindowFlag(Qt::WindowContextHelpButtonHint, false); diff --git a/app/aboutdialog.h b/app/aboutdialog.h index 9db9aaa..3405ca7 100644 --- a/app/aboutdialog.h +++ b/app/aboutdialog.h @@ -7,7 +7,6 @@ #include - QT_BEGIN_NAMESPACE namespace Ui { class AboutDialog; diff --git a/app/metadatadialog.cpp b/app/metadatadialog.cpp index ebd065f..fb5fb05 100644 --- a/app/metadatadialog.cpp +++ b/app/metadatadialog.cpp @@ -3,12 +3,12 @@ // SPDX-License-Identifier: MIT #include "metadatadialog.h" +#include "ui_metadatadialog.h" #include #include #include #include -#include #include #include "metadatamodel.h" @@ -73,30 +73,33 @@ protected: }; MetadataDialog::MetadataDialog(QWidget *parent) - : QDialog(parent) - , m_treeView(new PropertyTreeView(this)) + : QDialog(parent), ui(new QT_PREPEND_NAMESPACE(Ui::MetadataDialog)) { + ui->setupUi(this); + setWindowFlag(Qt::WindowContextHelpButtonHint, false); + + // YYC MARK: + // Because we use custom QTreeView and we do not want to expose it to public domain. + // So I have to use this way as the compromise. + + // Create our custom QTreeView and insert them + m_treeView = new PropertyTreeView(this); + auto* layout = ui->verticalLayout; + const int index = layout->indexOf(ui->m_buttonBox); + layout->insertWidget(index, m_treeView); + + // Setup our custom QTreeView m_treeView->setRootIsDecorated(false); m_treeView->setIndentation(0); m_treeView->setItemDelegate(new PropertyTreeItemDelegate(m_treeView)); m_treeView->header()->resizeSection(0, sizeHint().width() / 2); - setWindowTitle(tr("Image Metadata")); - - QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - - setLayout(new QVBoxLayout); - layout()->addWidget(m_treeView); - layout()->addWidget(buttonBox); - - connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::close); - - setWindowFlag(Qt::WindowContextHelpButtonHint, false); + connect(ui->m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::close); } MetadataDialog::~MetadataDialog() { - + delete ui; } void MetadataDialog::setMetadataModel(MetadataModel * model) diff --git a/app/metadatadialog.h b/app/metadatadialog.h index f4b53e6..05c13d0 100644 --- a/app/metadatadialog.h +++ b/app/metadatadialog.h @@ -11,6 +11,12 @@ QT_BEGIN_NAMESPACE class QTreeView; QT_END_NAMESPACE +QT_BEGIN_NAMESPACE +namespace Ui { +class MetadataDialog; +} +QT_END_NAMESPACE + class MetadataModel; class MetadataDialog : public QDialog { @@ -25,6 +31,7 @@ public: private: QTreeView * m_treeView = nullptr; + QT_PREPEND_NAMESPACE(Ui::MetadataDialog) *ui; }; #endif // METADATADIALOG_H diff --git a/app/metadatadialog.ui b/app/metadatadialog.ui new file mode 100644 index 0000000..0e248a5 --- /dev/null +++ b/app/metadatadialog.ui @@ -0,0 +1,23 @@ + + + MetadataDialog + + + Qt::NonModal + + + Image Metadata + + + + + + QDialogButtonBox::Close + + + + + + + + diff --git a/app/settingsdialog.cpp b/app/settingsdialog.cpp index a38a19f..f418e46 100644 --- a/app/settingsdialog.cpp +++ b/app/settingsdialog.cpp @@ -83,7 +83,7 @@ static EnumComboBoxTransformer HI }; SettingsDialog::SettingsDialog(QWidget *parent) - : QDialog(parent), ui(new Ui::SettingsDialog) + : QDialog(parent), ui(new QT_PREPEND_NAMESPACE(Ui::SettingsDialog)) { ui->setupUi(this); setWindowFlag(Qt::WindowContextHelpButtonHint, false); diff --git a/assets/plain/translators.html b/assets/plain/translators.html deleted file mode 100644 index 036f6b3..0000000 --- a/assets/plain/translators.html +++ /dev/null @@ -1,21 +0,0 @@ -
    -
  • Catalan: Toni Estévez
  • -
  • Chinese (Simplified): Percy Hong
  • -
  • Dutch: Heimen Stoffels
  • -
  • French: J. Lavoie, K. Herbert, Maxime Leroy
  • -
  • German: K. Herbert, J. Lavoie, sal0max
  • -
  • Indonesian: liimee, Reza Almanda
  • -
  • Italian: albanobattistella
  • -
  • Japanese: Black Cat, mmahhi, Percy Hong
  • -
  • Korean: VenusGirl
  • -
  • Norwegian Bokmål: Allan Nordhøy, ovl-1
  • -
  • Punjabi (Pakistan): bgo-eiu
  • -
  • Russian: Sergey Shornikov, Artem, Andrey
  • -
  • Sinhala: HelaBasa
  • -
  • Slovenian: Andrej Poženel - SDT
  • -
  • Spanish: Toni Estévez, Génesis Toxical, William(ѕ)ⁿ, gallegonovato
  • -
  • Tamil: தமிழ்நேரம் (TamilNeram)
  • -
  • Turkish: E-Akcaer, Oğuz Ersen, Sabri Ünal
  • -
  • Ukrainian: Dan, volkov, Сергій
  • -
  • Vietnamese: Loc Huynh
  • -