diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-05-11 23:48:01 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-09 01:38:30 +0200 |
commit | 439e17b149918df3fd11e0ee74f10d302a1e45cd (patch) | |
tree | e464e04c4e8960f6287b76718953f22bfef8dbd2 /gui/dialogs/ModEditDialogCommon.cpp | |
parent | 8c71a5d61f20642711bff081be9be3807418e618 (diff) | |
download | MultiMC-439e17b149918df3fd11e0ee74f10d302a1e45cd.tar MultiMC-439e17b149918df3fd11e0ee74f10d302a1e45cd.tar.gz MultiMC-439e17b149918df3fd11e0ee74f10d302a1e45cd.tar.lz MultiMC-439e17b149918df3fd11e0ee74f10d302a1e45cd.tar.xz MultiMC-439e17b149918df3fd11e0ee74f10d302a1e45cd.zip |
Add back legacy mod edit, add checksums for all legacy jars
Diffstat (limited to 'gui/dialogs/ModEditDialogCommon.cpp')
-rw-r--r-- | gui/dialogs/ModEditDialogCommon.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gui/dialogs/ModEditDialogCommon.cpp b/gui/dialogs/ModEditDialogCommon.cpp new file mode 100644 index 00000000..35942374 --- /dev/null +++ b/gui/dialogs/ModEditDialogCommon.cpp @@ -0,0 +1,40 @@ +#include "ModEditDialogCommon.h" +#include "CustomMessageBox.h" +#include <QUrl> + +bool lastfirst(QModelIndexList &list, int &first, int &last) +{ + if (!list.size()) + return false; + first = last = list[0].row(); + for (auto item : list) + { + int row = item.row(); + if (row < first) + first = row; + if (row > last) + last = row; + } + return true; +} + +void showWebsiteForMod(QWidget *parentDlg, Mod &m) +{ + QString url = m.homeurl(); + if (url.size()) + { + // catch the cases where the protocol is missing + if (!url.startsWith("http")) + { + url = "http://" + url; + } + QDesktopServices::openUrl(url); + } + else + { + CustomMessageBox::selectable( + parentDlg, QObject::tr("How sad!"), + QObject::tr("The mod author didn't provide a website link for this mod."), + QMessageBox::Warning); + } +}
\ No newline at end of file |