summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/ModEditDialogCommon.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-05-11 23:48:01 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:30 +0200
commit439e17b149918df3fd11e0ee74f10d302a1e45cd (patch)
treee464e04c4e8960f6287b76718953f22bfef8dbd2 /gui/dialogs/ModEditDialogCommon.cpp
parent8c71a5d61f20642711bff081be9be3807418e618 (diff)
downloadMultiMC-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.cpp40
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