summaryrefslogtreecommitdiffstats
path: root/application/pages/modplatform
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-10-14 02:31:53 +0200
committerPetr Mrázek <peterix@gmail.com>2019-10-14 02:31:53 +0200
commit9cc5ebcdd15736d648554c81e250cd6ce21f6e98 (patch)
tree8a3ee8329208e1324d278e1f21c826e33b00ba53 /application/pages/modplatform
parentc60647523e0a19adff994ff165410e5f0438d718 (diff)
downloadMultiMC-9cc5ebcdd15736d648554c81e250cd6ce21f6e98.tar
MultiMC-9cc5ebcdd15736d648554c81e250cd6ce21f6e98.tar.gz
MultiMC-9cc5ebcdd15736d648554c81e250cd6ce21f6e98.tar.lz
MultiMC-9cc5ebcdd15736d648554c81e250cd6ce21f6e98.tar.xz
MultiMC-9cc5ebcdd15736d648554c81e250cd6ce21f6e98.zip
GH-2859 improve UI for twitch pack import with drag&drop
Diffstat (limited to 'application/pages/modplatform')
-rw-r--r--application/pages/modplatform/TwitchPage.cpp5
-rw-r--r--application/pages/modplatform/TwitchPage.ui43
2 files changed, 35 insertions, 13 deletions
diff --git a/application/pages/modplatform/TwitchPage.cpp b/application/pages/modplatform/TwitchPage.cpp
index ea0f9267..389e3194 100644
--- a/application/pages/modplatform/TwitchPage.cpp
+++ b/application/pages/modplatform/TwitchPage.cpp
@@ -10,6 +10,11 @@ TwitchPage::TwitchPage(NewInstanceDialog* dialog, QWidget *parent)
{
ui->setupUi(this);
connect(ui->checkButton, &QPushButton::clicked, this, &TwitchPage::triggerCheck);
+ connect(ui->twitchLabel, &DropLabel::droppedURLs, [this](QList<QUrl> urls){
+ if(urls.size()) {
+ setUrl(urls[0].toString());
+ }
+ });
}
TwitchPage::~TwitchPage()
diff --git a/application/pages/modplatform/TwitchPage.ui b/application/pages/modplatform/TwitchPage.ui
index 0db2484d..f87af421 100644
--- a/application/pages/modplatform/TwitchPage.ui
+++ b/application/pages/modplatform/TwitchPage.ui
@@ -6,23 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
- <width>546</width>
- <height>405</height>
+ <width>666</width>
+ <height>424</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="0" column="1">
- <widget class="QLineEdit" name="lineEdit"/>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Twitch URL:</string>
- </property>
- </widget>
- </item>
<item row="1" column="0" colspan="3">
- <widget class="QLabel" name="twitchLabel">
+ <widget class="DropLabel" name="twitchLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
@@ -49,8 +39,35 @@
</property>
</widget>
</item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Twitch URL:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ <item row="2" column="0" colspan="3">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Drag and drop an Install button from CurseForge into the are above.</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>DropLabel</class>
+ <extends>QLabel</extends>
+ <header>widgets/DropLabel.h</header>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>lineEdit</tabstop>
<tabstop>checkButton</tabstop>