From 8e3af100f9bec17be43a91266d0206b8f5036cf4 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 28 Sep 2019 17:01:42 -0500 Subject: Fix help text for optional ESP deactivate button --- src/modinfodialog.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modinfodialog.ui') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 5b559992..ba2db799 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -384,7 +384,7 @@ Most mods do not have optional esps, so chances are good you are looking at an e Move a file to the data directory. - This moves a esp to the esp directory so it can be enabled in the main window. Please note that the ESP merely becomes "available", it will not necessarily be loaded! That is configured in the main window of omo. + This moves a esp to the esp directory so it can be enabled in the main window. Please note that the ESP merely becomes "available", it will not necessarily be loaded! That is configured in the main window of MO. @@ -404,10 +404,10 @@ Most mods do not have optional esps, so chances are good you are looking at an e - Make the selected mod in the lower list unavailable. + Make the selected mod in the right list unavailable. - The selected esp (in the lower list) will be pushed into a subdirectory of the mod and will thus become "invisible" to the game. It can then no longer be activated. + The selected esp (in the right list) will be pushed into a subdirectory of the mod and will thus become "invisible" to the game. It can then no longer be activated. -- cgit v1.3.1 From 77a9c64fda9cb522aae35777df2b09e19441bab1 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sat, 19 Oct 2019 02:35:33 -0500 Subject: Add button in modinfo image preview to use preview plugin dialog - Disabled if no compatible preview is found - Now renders an image for unsupported formats instructing the user --- src/modinfodialog.ui | 7 +++++++ src/modinfodialogimages.cpp | 45 +++++++++++++++++++++++++++++++++++++++------ src/modinfodialogimages.h | 3 +++ 3 files changed, 49 insertions(+), 6 deletions(-) (limited to 'src/modinfodialog.ui') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index ba2db799..13a245f1 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -267,6 +267,13 @@ 0 + + + + Open with Preview Plugin + + + diff --git a/src/modinfodialogimages.cpp b/src/modinfodialogimages.cpp index c5b04538..48b3bb3b 100644 --- a/src/modinfodialogimages.cpp +++ b/src/modinfodialogimages.cpp @@ -53,6 +53,8 @@ ImagesTab::ImagesTab(ModInfoDialogTabContext cx) : ui->tabImagesSplitter->setStretchFactor(0, 0); ui->tabImagesSplitter->setStretchFactor(1, 1); + ui->previewPluginButton->setEnabled(false); + ui->imagesThumbnails->setTab(this); ui->imagesScrollerVBar->setTab(this); @@ -65,6 +67,7 @@ ImagesTab::ImagesTab(ModInfoDialogTabContext cx) : connect(ui->imagesExplore, &QAbstractButton::clicked, [&]{ onExplore(); }); connect(ui->imagesShowDDS, &QCheckBox::toggled, [&]{ onShowDDS(); }); + connect(ui->previewPluginButton, &QAbstractButton::clicked, [&] { onPreviewButton(); }); ui->imagesShowDDS->setEnabled(m_ddsAvailable); @@ -251,13 +254,34 @@ void ImagesTab::select(std::size_t i, Visibility v) ui->imagesPath->setText(QDir::toNativeSeparators(f->path())); ui->imagesExplore->setEnabled(true); + if (plugin().previewGenerator().previewSupported(QString::fromStdWString(std::filesystem::path(f->path().toStdWString()).extension().wstring()).remove(0,1))) + ui->previewPluginButton->setEnabled(true); + else + ui->previewPluginButton->setEnabled(false); ui->imagesSize->setText(dimensionString(f->original().size())); - m_image->setImage(f->original()); + if (f->original().isNull()) { + m_image->clear(); + + QImage image(300, 100, QImage::Format_RGBA64); + QPainter paint; + paint.begin(&image); + paint.fillRect(0, 0, 300, 100, QBrush(QColor(0, 0, 0, 255))); + paint.setPen(m_theme.textColor); + paint.setFont(m_theme.font); + paint.drawImage(QPoint(150-16, 50-20-16), QImage(":/MO/gui/warning")); + const auto flags = Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextWordWrap; + paint.drawText(0, 46, 300, 54, flags, "This image format is not supported by Qt, but the preview plugin may be able to display it. Use the button above."); + paint.end(); + + m_image->setImage(image); + } else + m_image->setImage(f->original()); ensureVisible(i, v); } else { ui->imagesPath->clear(); ui->imagesExplore->setEnabled(false); + ui->previewPluginButton->setEnabled(false); ui->imagesSize->clear(); m_image->clear(); } @@ -560,6 +584,11 @@ void ImagesTab::onShowDDS() } } +void ImagesTab::onPreviewButton() +{ + core().previewFileWithAlternatives(parentWidget(), m_files.selectedFile()->path()); +} + void ImagesTab::onFilterChanged() { update(); @@ -958,13 +987,17 @@ void File::load(const Geometry& geo) ensureOriginalLoaded(); if (m_failed) { - return; - } + QImage warning(":/MO/gui/warning"); + const auto scaledSize = geo.scaledImageSize(warning.size()); - const auto scaledSize = geo.scaledImageSize(m_original.size()); + m_thumbnail = warning.scaled( + scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + } else { + const auto scaledSize = geo.scaledImageSize(m_original.size()); - m_thumbnail = m_original.scaled( - scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + m_thumbnail = m_original.scaled( + scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + } } diff --git a/src/modinfodialogimages.h b/src/modinfodialogimages.h index 8d9b965b..5717b8b9 100644 --- a/src/modinfodialogimages.h +++ b/src/modinfodialogimages.h @@ -4,6 +4,8 @@ #include "modinfodialogtab.h" #include "filterwidget.h" #include +#include "plugincontainer.h" +#include "organizercore.h" class ImagesTab; @@ -359,6 +361,7 @@ private: void showTooltip(QHelpEvent* e); void onExplore(); void onShowDDS(); + void onPreviewButton(); void onFilterChanged(); void select(std::size_t i, Visibility v=Visibility::Full); -- cgit v1.3.1 From b8e1a45840a72e1e959f1fad2f00015a72500161 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 26 Nov 2019 10:05:48 -0500 Subject: sortable filetree, remember settings --- src/modinfodialog.ui | 3 +++ src/modinfodialogfiletree.cpp | 11 +++++++++++ src/modinfodialogfiletree.h | 2 ++ 3 files changed, 16 insertions(+) (limited to 'src/modinfodialog.ui') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 13a245f1..59263e1c 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -1258,6 +1258,9 @@ p, li { white-space: pre-wrap; } true + + true + diff --git a/src/modinfodialogfiletree.cpp b/src/modinfodialogfiletree.cpp index 71ea9210..ca007c1c 100644 --- a/src/modinfodialogfiletree.cpp +++ b/src/modinfodialogfiletree.cpp @@ -21,6 +21,7 @@ FileTreeTab::FileTreeTab(ModInfoDialogTabContext cx) m_fs->setReadOnly(false); ui->filetree->setModel(m_fs); ui->filetree->setColumnWidth(0, 300); + ui->filetree->sortByColumn(0, Qt::AscendingOrder); m_actions.newFolder = new QAction(tr("&New Folder"), ui->filetree); m_actions.open = new QAction(tr("&Open/Execute"), ui->filetree); @@ -55,6 +56,16 @@ void FileTreeTab::clear() setHasData(true); } +void FileTreeTab::saveState(Settings& s) +{ + s.geometry().saveState(ui->filetree->header()); +} + +void FileTreeTab::restoreState(const Settings& s) +{ + s.geometry().restoreState(ui->filetree->header()); +} + void FileTreeTab::update() { const auto rootPath = mod().absolutePath(); diff --git a/src/modinfodialogfiletree.h b/src/modinfodialogfiletree.h index 42773899..494a7e14 100644 --- a/src/modinfodialogfiletree.h +++ b/src/modinfodialogfiletree.h @@ -12,6 +12,8 @@ public: FileTreeTab(ModInfoDialogTabContext cx); void clear() override; + void saveState(Settings& s); + void restoreState(const Settings& s); void update() override; bool deleteRequested() override; -- cgit v1.3.1 From 923e514b0f01153a7938f88dfe6206075581e5ea Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 10 Dec 2019 14:56:56 -0600 Subject: Change the modinfo image preview button to a toolbutton --- src/modinfodialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modinfodialog.ui') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 59263e1c..d7b03d70 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -268,7 +268,7 @@ 0 - + Open with Preview Plugin -- cgit v1.3.1