Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't remember the cancel response #7

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[![Build status](https://ci.appveyor.com/api/projects/status/g8c6tujn0pne6tsk?svg=true)](https://ci.appveyor.com/project/Modorganizer2/modorganizer-uibase)

# modorganizer-uibase
https://www.nexusmods.com/site/mods/874
1 change: 1 addition & 0 deletions src/questionboxmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ QuestionBoxMemory::QuestionBoxMemory(QWidget* parent, const QString& title,
QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion);
ui->iconLabel->setPixmap(icon.pixmap(128));
ui->messageLabel->setText(text);
ui->messageLabel->setOpenExternalLinks(true);

if (filename == nullptr) {
// delete the 2nd check box
Expand Down
2 changes: 2 additions & 0 deletions src/report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ void TaskDialog::rememberChoice()

const auto b = static_cast<QuestionBoxMemory::Button>(m_result);

if (b == QDialogButtonBox::Cancel) return;

if (m_rememberCheck) {
// action only
if (m_rememberCheck->isChecked()) {
Expand Down
2 changes: 1 addition & 1 deletion src/textviewer.ui
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<string>Show Whitespace</string>
</property>
<property name="checked">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
Expand Down
30 changes: 22 additions & 8 deletions src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <QApplication>
#include <QBuffer>
#include <QCollator>
#include <QDesktopServices>
#include <QDir>
#include <QImage>
#include <QScreen>
Expand Down Expand Up @@ -448,21 +449,34 @@ namespace shell
return Result::makeSuccess(process);
}

Result ExploreDirectory(const QFileInfo& info)
Result ExploreDirectory(const QFileInfo& info)
{
const auto path = QDir::toNativeSeparators(info.absoluteFilePath());
const auto ws_path = path.toStdWString();
const auto path = QDir::toNativeSeparators(info.absoluteFilePath());
const QUrl url = QUrl::fromLocalFile(path);

if (!QDesktopServices::openUrl(url)) {
const auto e = ::GetLastError();
LogShellFailure(L"openUrl", path.toStdWString().c_str(), nullptr, e);

return Result::makeFailure(e, QString::fromStdWString(formatSystemMessage(e)));
}

return ShellExecuteWrapper(L"explore", ws_path.c_str(), nullptr);
return Result::makeSuccess(INVALID_HANDLE_VALUE);
}

Result ExploreFileInDirectory(const QFileInfo& info)
{
const auto path = QDir::toNativeSeparators(info.absoluteFilePath());
const auto params = "/select,\"" + path + "\"";
const auto ws_params = params.toStdWString();
const auto dirPath = QDir::toNativeSeparators(info.absolutePath());
const QUrl dirUrl = QUrl::fromLocalFile(dirPath);

if (!QDesktopServices::openUrl(dirUrl)) {
const auto e = ::GetLastError();
LogShellFailure(L"openUrl", dirPath.toStdWString().c_str(), nullptr, e);

return Result::makeFailure(e, QString::fromStdWString(formatSystemMessage(e)));
}

return ShellExecuteWrapper(nullptr, L"explorer", ws_params.c_str());
return Result::makeSuccess(INVALID_HANDLE_VALUE);
}

Result Explore(const QFileInfo& info)
Expand Down
6 changes: 3 additions & 3 deletions src/version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// If VS_FF_PRERELEASE is not set, MO labels the build as a release and uses VER_FILEVERSION to determine version number.
// Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser
// Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha
#define VER_FILEVERSION 2,5.0
#define VER_FILEVERSION_STR "2.5.0\0"
#define VER_FILEVERSION 2,5,1
#define VER_FILEVERSION_STR "2.5.1rc2-ML1.4.1\0"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
Expand All @@ -24,7 +24,7 @@ BEGIN
VALUE "FileDescription", "MO2 Base UI plugin API library\0"
VALUE "OriginalFilename", "uibase.dll\0"
VALUE "InternalName", "uibase\0"
VALUE "LegalCopyright", "Copyright 2011-2016 Sebastian Herbord\r\nCopyright 2016-2023 Mod Organizer 2 contributors\0"
VALUE "LegalCopyright", "Copyright 2011-2016 Sebastian Herbord\r\nCopyright 2016-2024 Mod Organizer 2 contributors\0"
VALUE "ProductName", "Mod Organizer 2 UI Base\0"
VALUE "ProductVersion", VER_FILEVERSION_STR
END
Expand Down