mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-13 20:22:13 +00:00
Compare commits
50 Commits
0.6.7
...
feature/me
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2378c79ff | ||
|
|
08f85f1a93 | ||
|
|
bc98181ec2 | ||
|
|
6a095deea6 | ||
|
|
355e5e24da | ||
|
|
8bdff97ac0 | ||
|
|
6288805f37 | ||
|
|
0d157d86b5 | ||
|
|
f413e61cd8 | ||
|
|
3581f5384f | ||
|
|
480b298635 | ||
|
|
b54b25231e | ||
|
|
43628556ed | ||
|
|
b5adff14ab | ||
|
|
af5120c828 | ||
|
|
47ed2f48d4 | ||
|
|
0c9340a3d2 | ||
|
|
9cc5ebcdd1 | ||
|
|
c60647523e | ||
|
|
9165232ba4 | ||
|
|
31d0507e07 | ||
|
|
cca766cfd9 | ||
|
|
0d41bc5e13 | ||
|
|
e27309d08a | ||
|
|
dec6759e61 | ||
|
|
ce7917048a | ||
|
|
e6936212d6 | ||
|
|
1210d3abf1 | ||
|
|
ffe84d6ec7 | ||
|
|
19015de258 | ||
|
|
5c0c26cd25 | ||
|
|
4cc7427eb4 | ||
|
|
6531aaa7bc | ||
|
|
a35a2e877e | ||
|
|
4e93c4d012 | ||
|
|
7bb23b4142 | ||
|
|
b420f4bafb | ||
|
|
0e0a017175 | ||
|
|
137fe7e3c0 | ||
|
|
9689e5cea7 | ||
|
|
1ede75aa79 | ||
|
|
9ee3a84817 | ||
|
|
8750ca8b36 | ||
|
|
1747f413b9 | ||
|
|
6d975748c0 | ||
|
|
b050c7c075 | ||
|
|
84e0cb1daa | ||
|
|
5074a97cb3 | ||
|
|
441e8980b8 | ||
|
|
84c53273ce |
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"project_id": "MultiMC5",
|
||||
"conduit_uri": "http://ph.multimc.org"
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
UseTab: false
|
||||
IndentWidth: 4
|
||||
TabWidth: 4
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
AccessModifierOffset: -4
|
||||
IndentCaseLabels: false
|
||||
IndentFunctionDeclarationAfterType: false
|
||||
NamespaceIndentation: None
|
||||
|
||||
BreakBeforeBraces: Allman
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
ColumnLimit: 160
|
||||
MaxEmptyLinesToKeep: 1
|
||||
|
||||
Standard: Cpp11
|
||||
Cpp11BracedListStyle: true
|
||||
|
||||
SpacesInParentheses: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpaceAfterControlStatementKeyword: true
|
||||
|
||||
AlignTrailingComments: true
|
||||
SpacesBeforeTrailingComments: 1
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
Thumbs.db
|
||||
.kdev4
|
||||
*.kdev4
|
||||
.user
|
||||
.directory
|
||||
resources/CMakeFiles
|
||||
@@ -9,8 +9,7 @@ resources/MultiMCLauncher.jar
|
||||
html/
|
||||
|
||||
# Project Files
|
||||
MultiMC5.kdev4
|
||||
MultiMC.pro.user
|
||||
*.pro.user
|
||||
CMakeLists.txt.user
|
||||
CMakeLists.txt.user.*
|
||||
/.project
|
||||
|
||||
38
.travis.yml
38
.travis.yml
@@ -1,38 +0,0 @@
|
||||
# General set up
|
||||
language: cpp
|
||||
cache: apt
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: precise
|
||||
sudo: required
|
||||
compiler: gcc
|
||||
env: TRAVIS_DIST=precise QT_VERSION=5.4.2
|
||||
- os: linux
|
||||
dist: precise
|
||||
sudo: required
|
||||
compiler: gcc
|
||||
env: TRAVIS_DIST=precise QT_VERSION=5.6.2
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
compiler: gcc
|
||||
env: TRAVIS_DIST=trusty QT_VERSION=5.4.2
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
compiler: gcc
|
||||
env: TRAVIS_DIST=trusty QT_VERSION=5.6.2
|
||||
|
||||
# Install dependencies
|
||||
install:
|
||||
- source travis/prepare.sh # installs qt and cmake. need to source because some env vars are set from there
|
||||
|
||||
# Actual work
|
||||
before_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH ..
|
||||
script:
|
||||
- make -j4 && make test ARGS="-V"
|
||||
@@ -46,7 +46,7 @@ set(MultiMC_NEWS_RSS_URL "https://multimc.org/rss.xml" CACHE STRING "URL to fetc
|
||||
######## Set version numbers ########
|
||||
set(MultiMC_VERSION_MAJOR 0)
|
||||
set(MultiMC_VERSION_MINOR 6)
|
||||
set(MultiMC_VERSION_HOTFIX 7)
|
||||
set(MultiMC_VERSION_HOTFIX 8)
|
||||
|
||||
# Build number
|
||||
set(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.")
|
||||
@@ -77,6 +77,7 @@ set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MIN
|
||||
|
||||
#### Custom target to just print the version.
|
||||
add_custom_target(version echo "Version: ${MultiMC_RELEASE_VERSION_NAME}")
|
||||
add_custom_target(tcversion echo "\\#\\#teamcity[setParameter name=\\'env.MULTIMC_VERSION\\' value=\\'${MultiMC_RELEASE_VERSION_NAME}\\']")
|
||||
|
||||
################################ 3rd Party Libs ################################
|
||||
|
||||
@@ -87,6 +88,7 @@ find_package(Qt5Concurrent REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5Test REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5Multimedia REQUIRED)
|
||||
|
||||
# The Qt5 cmake files don't provide its install paths, so ask qmake.
|
||||
include(QMakeQuery)
|
||||
|
||||
48
README.md
48
README.md
@@ -13,21 +13,22 @@ The project uses C++ and Qt5 as the language and base framework. This might seem
|
||||
|
||||
We can do more, with less, on worse hardware and leave more resources for the game while keeping the launcher running and providing extra features.
|
||||
|
||||
If you want to contribute, either talk to us on [Discord](https://discord.gg/0k2zsXGNHs0fE4Wm), [IRC](http://webchat.esper.net/?nick=&channels=MultiMC)(esper.net/#MultiMC) or pick up some item from [workflowy](https://workflowy.com/s/2EyDMcp7CU) - there are many.
|
||||
If you want to contribute, either talk to us on [Discord](https://discord.gg/0k2zsXGNHs0fE4Wm), [IRC](http://webchat.esper.net/?nick=&channels=MultiMC)(esper.net/#MultiMC) or pick up some item from the github issues [workflowy](https://github.com/MultiMC/MultiMC5/issues) - there is always plenty of ideas around.
|
||||
|
||||
### Building
|
||||
If you want to build MultiMC yourself, check [BUILD.md](BUILD.md) for build instructions.
|
||||
|
||||
The ci server is running at [ci.multimc.org](http://ci.multimc.org), where you can watch the builds happen in (or very close to) real time. It can also serve as a nice reference on how to set up the build environment on your end.
|
||||
|
||||
According to travis.ci, the builds are currently [](https://travis-ci.org/MultiMC/MultiMC5)
|
||||
|
||||
### Code formatting
|
||||
We use [Clang Format](http://clang.llvm.org/docs/ClangFormat.html) to format the project. We highly recommend setting it up so the project stays well formatted.
|
||||
Just follow the existing formatting.
|
||||
|
||||
In general:
|
||||
* Indent with 4 space unless it's in a submodule
|
||||
* Keep lists (of arguments, parameters, initializators...) as lists, not paragraphs.
|
||||
* Prefer readability over dogma.
|
||||
|
||||
|
||||
## Translations
|
||||
Translations can be done either directly in the [translations repository](https://github.com/MultiMC/MultiMC5-translate). For more details, see: [Translating-MultiMC](https://github.com/MultiMC/MultiMC5/wiki/Translating-MultiMC).
|
||||
Translations can be done [on crowdin](https://translate.multimc.org).
|
||||
|
||||
## Forking/Redistributing
|
||||
We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.
|
||||
@@ -43,3 +44,36 @@ Copyright © 2013-2019 MultiMC Contributors
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this program except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
## Build status
|
||||
### Linux (Intel32)
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_Linux32_Build&guest=1">
|
||||
Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_Linux32_Build)/statusIcon"/>
|
||||
</a>
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_Linux32_Deploy&guest=1">
|
||||
Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_Linux32_Deploy)/statusIcon"/>
|
||||
</a>
|
||||
|
||||
### Linux (AMD64)
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_Linux64_Build&guest=1">
|
||||
Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_Linux64_Build)/statusIcon"/>
|
||||
</a>
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_Linux64_Deploy&guest=1">
|
||||
Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_Linux64_Deploy)/statusIcon"/>
|
||||
</a>
|
||||
|
||||
### macOS (AMD64)
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_MacOS_Build&guest=1">
|
||||
Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_MacOS_Build)/statusIcon"/>
|
||||
</a>
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_MacOS_Deploy&guest=1">
|
||||
Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_MacOS_Deploy)/statusIcon"/>
|
||||
</a>
|
||||
|
||||
### Windows (Intel32)
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_Windows_Build&guest=1">
|
||||
Build: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_Windows_Build)/statusIcon"/>
|
||||
</a>
|
||||
<a href="https://teamcity.multimc.org/viewType.html?buildTypeId=MultiMC_Launcher_Windows_Deploy&guest=1">
|
||||
Deploy: <img src="https://teamcity.multimc.org/app/rest/builds/buildType:(id:MultiMC_Launcher_Windows_Deploy)/statusIcon"/>
|
||||
</a>
|
||||
|
||||
@@ -439,15 +439,14 @@ set(META_SOURCES
|
||||
)
|
||||
|
||||
set(FTB_SOURCES
|
||||
modplatform/ftb/FtbPackFetchTask.h
|
||||
modplatform/ftb/FtbPackFetchTask.cpp
|
||||
modplatform/ftb/FtbPackInstallTask.h
|
||||
modplatform/ftb/FtbPackInstallTask.cpp
|
||||
modplatform/legacy_ftb/PackFetchTask.h
|
||||
modplatform/legacy_ftb/PackFetchTask.cpp
|
||||
modplatform/legacy_ftb/PackInstallTask.h
|
||||
modplatform/legacy_ftb/PackInstallTask.cpp
|
||||
modplatform/legacy_ftb/PrivatePackManager.h
|
||||
modplatform/legacy_ftb/PrivatePackManager.cpp
|
||||
|
||||
modplatform/ftb/FtbPrivatePackManager.h
|
||||
modplatform/ftb/FtbPrivatePackManager.cpp
|
||||
|
||||
modplatform/ftb/PackHelpers.h
|
||||
modplatform/legacy_ftb/PackHelpers.h
|
||||
)
|
||||
|
||||
set(FLAME_SOURCES
|
||||
@@ -456,8 +455,6 @@ set(FLAME_SOURCES
|
||||
modplatform/flame/PackManifest.cpp
|
||||
modplatform/flame/FileResolvingTask.h
|
||||
modplatform/flame/FileResolvingTask.cpp
|
||||
modplatform/flame/UrlResolvingTask.h
|
||||
modplatform/flame/UrlResolvingTask.cpp
|
||||
)
|
||||
|
||||
add_unit_test(Index
|
||||
|
||||
@@ -69,8 +69,8 @@ namespace ArgumentStyle
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
Space, /**< --option=value */
|
||||
Equals, /**< --option value */
|
||||
Space, /**< --option value */
|
||||
Equals, /**< --option=value */
|
||||
SpaceAndEquals, /**< --option[= ]value */
|
||||
#ifdef Q_OS_WIN32
|
||||
Default = Equals
|
||||
|
||||
@@ -299,7 +299,7 @@ QString NormalizePath(QString path)
|
||||
}
|
||||
}
|
||||
|
||||
QString badFilenameChars = "\"\\/?<>:*|!+\r\n";
|
||||
QString badFilenameChars = "\"\\/?<>:;*|!+\r\n";
|
||||
|
||||
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
|
||||
{
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
#include "pathmatcher/RegexpMatcher.h"
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, bool copySaves)
|
||||
InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, bool copySaves, bool keepPlaytime)
|
||||
{
|
||||
m_origInstance = origInstance;
|
||||
m_keepPlaytime = keepPlaytime;
|
||||
|
||||
if(!copySaves)
|
||||
{
|
||||
@@ -46,6 +47,9 @@ void InstanceCopyTask::copyFinished()
|
||||
InstancePtr inst(new NullInstance(m_globalSettings, instanceSettings, m_stagingPath));
|
||||
inst->setName(m_instName);
|
||||
inst->setIconKey(m_instIcon);
|
||||
if(!m_keepPlaytime) {
|
||||
inst->resetTimePlayed();
|
||||
}
|
||||
emitSucceeded();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class MULTIMC_LOGIC_EXPORT InstanceCopyTask : public InstanceTask
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InstanceCopyTask(InstancePtr origInstance, bool copySaves);
|
||||
explicit InstanceCopyTask(InstancePtr origInstance, bool copySaves, bool keepPlaytime);
|
||||
|
||||
protected:
|
||||
//! Entry point for tasks.
|
||||
@@ -28,4 +28,5 @@ private: /* data */
|
||||
QFuture<bool> m_copyFuture;
|
||||
QFutureWatcher<bool> m_copyFutureWatcher;
|
||||
std::unique_ptr<IPathMatcher> m_matcher;
|
||||
bool m_keepPlaytime;
|
||||
};
|
||||
|
||||
@@ -160,8 +160,8 @@ GroupId InstanceList::getInstanceGroup(const InstanceId& id) const
|
||||
{
|
||||
return GroupId();
|
||||
}
|
||||
auto iter = m_groupMap.find(inst->id());
|
||||
if(iter != m_groupMap.end())
|
||||
auto iter = m_instanceGroupIndex.find(inst->id());
|
||||
if(iter != m_instanceGroupIndex.end())
|
||||
{
|
||||
return *iter;
|
||||
}
|
||||
@@ -178,8 +178,8 @@ void InstanceList::setInstanceGroup(const InstanceId& id, const GroupId& name)
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
auto iter = m_groupMap.find(inst->id());
|
||||
if(iter != m_groupMap.end())
|
||||
auto iter = m_instanceGroupIndex.find(inst->id());
|
||||
if(iter != m_instanceGroupIndex.end())
|
||||
{
|
||||
if(*iter != name)
|
||||
{
|
||||
@@ -190,12 +190,12 @@ void InstanceList::setInstanceGroup(const InstanceId& id, const GroupId& name)
|
||||
else
|
||||
{
|
||||
changed = true;
|
||||
m_groupMap[id] = name;
|
||||
m_instanceGroupIndex[id] = name;
|
||||
}
|
||||
|
||||
if(changed)
|
||||
{
|
||||
m_groups.insert(name);
|
||||
m_groupNameCache.insert(name);
|
||||
auto idx = getInstIndex(inst.get());
|
||||
emit dataChanged(index(idx), index(idx), {GroupRole});
|
||||
saveGroupList();
|
||||
@@ -204,7 +204,7 @@ void InstanceList::setInstanceGroup(const InstanceId& id, const GroupId& name)
|
||||
|
||||
QStringList InstanceList::getGroups()
|
||||
{
|
||||
return m_groups.toList();
|
||||
return m_groupNameCache.toList();
|
||||
}
|
||||
|
||||
void InstanceList::deleteGroup(const QString& name)
|
||||
@@ -217,7 +217,7 @@ void InstanceList::deleteGroup(const QString& name)
|
||||
auto instGroupName = getInstanceGroup(instID);
|
||||
if(instGroupName == name)
|
||||
{
|
||||
m_groupMap.remove(instID);
|
||||
m_instanceGroupIndex.remove(instID);
|
||||
qDebug() << "Remove" << instID << "from group" << name;
|
||||
removed = true;
|
||||
auto idx = getInstIndex(instance.get());
|
||||
@@ -233,6 +233,11 @@ void InstanceList::deleteGroup(const QString& name)
|
||||
}
|
||||
}
|
||||
|
||||
bool InstanceList::isGroupCollapsed(const QString& group)
|
||||
{
|
||||
return m_collapsedGroups.contains(group);
|
||||
}
|
||||
|
||||
void InstanceList::deleteInstance(const InstanceId& id)
|
||||
{
|
||||
auto inst = getInstanceById(id);
|
||||
@@ -242,7 +247,7 @@ void InstanceList::deleteInstance(const InstanceId& id)
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_groupMap.remove(id))
|
||||
if(m_instanceGroupIndex.remove(id))
|
||||
{
|
||||
saveGroupList();
|
||||
}
|
||||
@@ -515,7 +520,7 @@ void InstanceList::saveGroupList()
|
||||
WatchLock foo(m_watcher, m_instDir);
|
||||
QString groupFileName = m_instDir + "/instgroups.json";
|
||||
QMap<QString, QSet<QString>> reverseGroupMap;
|
||||
for (auto iter = m_groupMap.begin(); iter != m_groupMap.end(); iter++)
|
||||
for (auto iter = m_instanceGroupIndex.begin(); iter != m_instanceGroupIndex.end(); iter++)
|
||||
{
|
||||
QString id = iter.key();
|
||||
QString group = iter.value();
|
||||
@@ -548,7 +553,7 @@ void InstanceList::saveGroupList()
|
||||
auto name = iter.key();
|
||||
QJsonObject groupObj;
|
||||
QJsonArray instanceArr;
|
||||
groupObj.insert("hidden", QJsonValue(QString("false")));
|
||||
groupObj.insert("hidden", QJsonValue(m_collapsedGroups.contains(name)));
|
||||
for (auto item : list)
|
||||
{
|
||||
instanceArr.append(QJsonValue(item));
|
||||
@@ -572,7 +577,6 @@ void InstanceList::saveGroupList()
|
||||
void InstanceList::loadGroupList()
|
||||
{
|
||||
qDebug() << "Will load group list now.";
|
||||
QSet<QString> groupSet;
|
||||
|
||||
QString groupFileName = m_instDir + "/instgroups.json";
|
||||
|
||||
@@ -623,7 +627,8 @@ void InstanceList::loadGroupList()
|
||||
return;
|
||||
}
|
||||
|
||||
m_groupMap.clear();
|
||||
QSet<QString> groupSet;
|
||||
m_instanceGroupIndex.clear();
|
||||
|
||||
// Iterate through all the groups.
|
||||
QJsonObject groupMapping = rootObj.value("groups").toObject();
|
||||
@@ -634,37 +639,35 @@ void InstanceList::loadGroupList()
|
||||
// If not an object, complain and skip to the next one.
|
||||
if (!iter.value().isObject())
|
||||
{
|
||||
qWarning() << QString("Group '%1' in the group list should "
|
||||
"be an object.")
|
||||
.arg(groupName)
|
||||
.toUtf8();
|
||||
qWarning() << QString("Group '%1' in the group list should be an object.").arg(groupName).toUtf8();
|
||||
continue;
|
||||
}
|
||||
|
||||
QJsonObject groupObj = iter.value().toObject();
|
||||
if (!groupObj.value("instances").isArray())
|
||||
{
|
||||
qWarning() << QString("Group '%1' in the group list is invalid. "
|
||||
"It should contain an array "
|
||||
"called 'instances'.")
|
||||
.arg(groupName)
|
||||
.toUtf8();
|
||||
qWarning() << QString("Group '%1' in the group list is invalid. It should contain an array called 'instances'.").arg(groupName).toUtf8();
|
||||
continue;
|
||||
}
|
||||
|
||||
// keep a list/set of groups for choosing
|
||||
groupSet.insert(groupName);
|
||||
|
||||
auto hidden = groupObj.value("hidden").toBool(false);
|
||||
if(hidden) {
|
||||
m_collapsedGroups.insert(groupName);
|
||||
}
|
||||
|
||||
// Iterate through the list of instances in the group.
|
||||
QJsonArray instancesArray = groupObj.value("instances").toArray();
|
||||
|
||||
for (QJsonArray::iterator iter2 = instancesArray.begin(); iter2 != instancesArray.end(); iter2++)
|
||||
{
|
||||
m_groupMap[(*iter2).toString()] = groupName;
|
||||
m_instanceGroupIndex[(*iter2).toString()] = groupName;
|
||||
}
|
||||
}
|
||||
m_groupsLoaded = true;
|
||||
m_groups.unite(groupSet);
|
||||
m_groupNameCache.unite(groupSet);
|
||||
qDebug() << "Group list loaded.";
|
||||
}
|
||||
|
||||
@@ -689,6 +692,17 @@ void InstanceList::on_InstFolderChanged(const Setting &setting, QVariant value)
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceList::on_GroupStateChanged(const QString& group, bool collapsed)
|
||||
{
|
||||
qDebug() << "Group" << group << (collapsed ? "collapsed" : "expanded");
|
||||
if(collapsed) {
|
||||
m_collapsedGroups.insert(group);
|
||||
} else {
|
||||
m_collapsedGroups.remove(group);
|
||||
}
|
||||
saveGroupList();
|
||||
}
|
||||
|
||||
class InstanceStaging : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -819,9 +833,9 @@ bool InstanceList::commitStagedInstance(const QString& path, const QString& inst
|
||||
qWarning() << "Failed to move" << path << "to" << destination;
|
||||
return false;
|
||||
}
|
||||
m_groupMap[instID] = groupName;
|
||||
m_instanceGroupIndex[instID] = groupName;
|
||||
instanceSet.insert(instID);
|
||||
m_groups.insert(groupName);
|
||||
m_groupNameCache.insert(groupName);
|
||||
emit instancesChanged();
|
||||
emit instanceSelectRequest(instID);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
InstancePtr getInstanceById(QString id) const;
|
||||
QModelIndex getInstanceIndexById(const QString &id) const;
|
||||
QStringList getGroups();
|
||||
bool isGroupCollapsed(const QString &groupName);
|
||||
|
||||
GroupId getInstanceGroup(const InstanceId & id) const;
|
||||
void setInstanceGroup(const InstanceId & id, const GroupId& name);
|
||||
|
||||
@@ -134,6 +136,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void on_InstFolderChanged(const Setting &setting, QVariant value);
|
||||
void on_GroupStateChanged(const QString &group, bool collapsed);
|
||||
|
||||
private slots:
|
||||
void propertiesChanged(BaseInstance *inst);
|
||||
@@ -154,12 +157,14 @@ private:
|
||||
int m_watchLevel = 0;
|
||||
bool m_dirty = false;
|
||||
QList<InstancePtr> m_instances;
|
||||
QSet<QString> m_groups;
|
||||
QSet<QString> m_groupNameCache;
|
||||
|
||||
SettingsObjectPtr m_globalSettings;
|
||||
QString m_instDir;
|
||||
QFileSystemWatcher * m_watcher;
|
||||
QMap<InstanceId, GroupId> m_groupMap;
|
||||
// FIXME: this is so inefficient that looking at it is almost painful.
|
||||
QSet<QString> m_collapsedGroups;
|
||||
QMap<InstanceId, GroupId> m_instanceGroupIndex;
|
||||
QSet<InstanceId> instanceSet;
|
||||
bool m_groupsLoaded = false;
|
||||
bool m_instancesProbed = false;
|
||||
|
||||
@@ -451,13 +451,17 @@ static bool getTrivialComponentChanges(const ComponentIndex & index, const Requi
|
||||
auto & comp = (*compIter);
|
||||
if(comp->getVersion() != req.equalsVersion)
|
||||
{
|
||||
if(comp->m_dependencyOnly)
|
||||
{
|
||||
decision = Decision::VersionNotSame;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(comp->isCustom()) {
|
||||
decision = Decision::LockedVersionNotSame;
|
||||
} else {
|
||||
if(comp->m_dependencyOnly)
|
||||
{
|
||||
decision = Decision::VersionNotSame;
|
||||
}
|
||||
else
|
||||
{
|
||||
decision = Decision::LockedVersionNotSame;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -85,6 +85,10 @@ public:
|
||||
{
|
||||
return mods[index];
|
||||
}
|
||||
const Mod &at(size_t index) const
|
||||
{
|
||||
return mods.at(index);
|
||||
}
|
||||
|
||||
/// Reloads the mod list and returns true if the list changed.
|
||||
bool update();
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
#include "UrlResolvingTask.h"
|
||||
#include <QtXml>
|
||||
#include <Json.h>
|
||||
|
||||
|
||||
namespace {
|
||||
const char * metabase = "https://cursemeta.dries007.net";
|
||||
}
|
||||
|
||||
Flame::UrlResolvingTask::UrlResolvingTask(const QString& toProcess)
|
||||
: m_url(toProcess)
|
||||
{
|
||||
}
|
||||
|
||||
void Flame::UrlResolvingTask::executeTask()
|
||||
{
|
||||
resolveUrl();
|
||||
}
|
||||
|
||||
void Flame::UrlResolvingTask::resolveUrl()
|
||||
{
|
||||
setStatus(tr("Resolving URL..."));
|
||||
setProgress(0, 1);
|
||||
QUrl actualUrl(m_url);
|
||||
if(actualUrl.host() != "www.curseforge.com") {
|
||||
emitFailed(tr("Not a Twitch URL."));
|
||||
return;
|
||||
}
|
||||
m_dljob.reset(new NetJob("URL resolver"));
|
||||
|
||||
bool weAreDigging = false;
|
||||
needle = QString();
|
||||
|
||||
if(m_url.startsWith("https://")) {
|
||||
if(m_url.endsWith("?client=y")) {
|
||||
// https://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download?client=y
|
||||
// https://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download/2697088?client=y
|
||||
m_url.chop(9);
|
||||
// https://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download
|
||||
// https://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download/2697088
|
||||
}
|
||||
if(m_url.endsWith("/download")) {
|
||||
// https://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download -> need to dig inside html...
|
||||
weAreDigging = true;
|
||||
needle = m_url;
|
||||
needle.replace("https://", "twitch://");
|
||||
needle.replace("/download", "/download-client/");
|
||||
m_url.append("?client=y");
|
||||
} else if (m_url.contains("/download/")) {
|
||||
// https://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download/2697088
|
||||
m_url.replace("/download/", "/download-client/");
|
||||
}
|
||||
}
|
||||
else if(m_url.startsWith("twitch://")) {
|
||||
// twitch://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download-client/2697088
|
||||
m_url.replace(0, 9, "https://");
|
||||
// https://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download-client/2697088
|
||||
}
|
||||
auto dl = Net::Download::makeByteArray(QUrl(m_url), &results);
|
||||
m_dljob->addNetAction(dl);
|
||||
if(weAreDigging) {
|
||||
connect(m_dljob.get(), &NetJob::finished, this, &Flame::UrlResolvingTask::processHTML);
|
||||
} else {
|
||||
connect(m_dljob.get(), &NetJob::finished, this, &Flame::UrlResolvingTask::processCCIP);
|
||||
}
|
||||
m_dljob->start();
|
||||
}
|
||||
|
||||
void Flame::UrlResolvingTask::processHTML()
|
||||
{
|
||||
QString htmlDoc = QString::fromUtf8(results);
|
||||
auto index = htmlDoc.indexOf(needle);
|
||||
if(index < 0) {
|
||||
emitFailed(tr("Couldn't find the needle in the haystack..."));
|
||||
return;
|
||||
}
|
||||
auto indexStart = index;
|
||||
int indexEnd = -1;
|
||||
while((index + 1) < htmlDoc.size() && htmlDoc[index] != '"') {
|
||||
index ++;
|
||||
if(htmlDoc[index] == '"') {
|
||||
indexEnd = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(indexEnd > 0) {
|
||||
QString found = htmlDoc.mid(indexStart, indexEnd - indexStart);
|
||||
qDebug() << "Found needle: " << found;
|
||||
// twitch://www.curseforge.com/minecraft/modpacks/ftb-sky-odyssey/download-client/2697088
|
||||
m_url = found;
|
||||
resolveUrl();
|
||||
return;
|
||||
}
|
||||
emitFailed(tr("Couldn't find the end of the needle in the haystack..."));
|
||||
return;
|
||||
}
|
||||
|
||||
void Flame::UrlResolvingTask::processCCIP()
|
||||
{
|
||||
QDomDocument doc;
|
||||
if (!doc.setContent(results)) {
|
||||
qDebug() << results;
|
||||
emitFailed(tr("Resolving failed."));
|
||||
return;
|
||||
}
|
||||
auto packageNode = doc.namedItem("package");
|
||||
if(!packageNode.isElement()) {
|
||||
emitFailed(tr("Resolving failed: missing package root element."));
|
||||
return;
|
||||
}
|
||||
auto projectNode = packageNode.namedItem("project");
|
||||
if(!projectNode.isElement()) {
|
||||
emitFailed(tr("Resolving failed: missing project element."));
|
||||
return;
|
||||
}
|
||||
auto attribs = projectNode.attributes();
|
||||
|
||||
auto projectIdNode = attribs.namedItem("id");
|
||||
if(!projectIdNode.isAttr()) {
|
||||
emitFailed(tr("Resolving failed: missing id attribute."));
|
||||
return;
|
||||
}
|
||||
auto fileIdNode = attribs.namedItem("file");
|
||||
if(!fileIdNode.isAttr()) {
|
||||
emitFailed(tr("Resolving failed: missing file attribute."));
|
||||
return;
|
||||
}
|
||||
|
||||
auto projectId = projectIdNode.nodeValue();
|
||||
auto fileId = fileIdNode.nodeValue();
|
||||
bool success = true;
|
||||
m_result.projectId = projectId.toInt(&success);
|
||||
if(!success) {
|
||||
emitFailed(tr("Failed to resove projectId as a number."));
|
||||
return;
|
||||
}
|
||||
m_result.fileId = fileId.toInt(&success);
|
||||
if(!success) {
|
||||
emitFailed(tr("Failed to resove fileId as a number."));
|
||||
return;
|
||||
}
|
||||
qDebug() << "Resolved" << m_url << "as" << m_result.projectId << "/" << m_result.fileId;
|
||||
resolveIDs();
|
||||
}
|
||||
|
||||
void Flame::UrlResolvingTask::resolveIDs()
|
||||
{
|
||||
setStatus(tr("Resolving mod IDs..."));
|
||||
m_dljob.reset(new NetJob("Mod id resolver"));
|
||||
auto projectIdStr = QString::number(m_result.projectId);
|
||||
auto fileIdStr = QString::number(m_result.fileId);
|
||||
QString metaurl = QString("%1/%2/%3.json").arg(metabase, projectIdStr, fileIdStr);
|
||||
auto dl = Net::Download::makeByteArray(QUrl(metaurl), &results);
|
||||
m_dljob->addNetAction(dl);
|
||||
connect(m_dljob.get(), &NetJob::finished, this, &Flame::UrlResolvingTask::processCursemeta);
|
||||
m_dljob->start();
|
||||
}
|
||||
|
||||
void Flame::UrlResolvingTask::processCursemeta()
|
||||
{
|
||||
try {
|
||||
if(m_result.parseFromBytes(results)) {
|
||||
emitSucceeded();
|
||||
qDebug() << results;
|
||||
return;
|
||||
}
|
||||
} catch (const JSONValidationError &e) {
|
||||
|
||||
qCritical() << "Resolving of" << m_result.projectId << m_result.fileId << "failed because of a parsing error:";
|
||||
qCritical() << e.cause();
|
||||
qCritical() << "JSON:";
|
||||
qCritical() << results;
|
||||
}
|
||||
emitFailed(tr("Failed to resolve the modpack file."));
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "tasks/Task.h"
|
||||
#include "net/NetJob.h"
|
||||
#include "PackManifest.h"
|
||||
|
||||
#include "multimc_logic_export.h"
|
||||
|
||||
namespace Flame
|
||||
{
|
||||
class MULTIMC_LOGIC_EXPORT UrlResolvingTask : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit UrlResolvingTask(const QString &toProcess);
|
||||
virtual ~UrlResolvingTask() {};
|
||||
|
||||
const Flame::File &getResults() const
|
||||
{
|
||||
return m_result;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void executeTask() override;
|
||||
|
||||
protected slots:
|
||||
void processCCIP();
|
||||
void processHTML();
|
||||
void processCursemeta();
|
||||
|
||||
private:
|
||||
void resolveUrl();
|
||||
void resolveIDs();
|
||||
|
||||
private: /* data */
|
||||
QString m_url;
|
||||
QString needle;
|
||||
Flame::File m_result;
|
||||
QByteArray results;
|
||||
NetJobPtr m_dljob;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,34 +1,36 @@
|
||||
#include "FtbPackFetchTask.h"
|
||||
#include <QDomDocument>
|
||||
#include "FtbPrivatePackManager.h"
|
||||
#include "PackFetchTask.h"
|
||||
#include "PrivatePackManager.h"
|
||||
|
||||
#include <QDomDocument>
|
||||
#include "net/URLConstants.h"
|
||||
|
||||
void FtbPackFetchTask::fetch()
|
||||
namespace LegacyFTB {
|
||||
|
||||
void PackFetchTask::fetch()
|
||||
{
|
||||
publicPacks.clear();
|
||||
thirdPartyPacks.clear();
|
||||
|
||||
NetJob *netJob = new NetJob("FtbModpackFetch");
|
||||
NetJob *netJob = new NetJob("LegacyFTB::ModpackFetch");
|
||||
|
||||
QUrl publicPacksUrl = QUrl(URLConstants::FTB_CDN_BASE_URL + "static/modpacks.xml");
|
||||
QUrl publicPacksUrl = QUrl(URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/modpacks.xml");
|
||||
qDebug() << "Downloading public version info from" << publicPacksUrl.toString();
|
||||
netJob->addNetAction(Net::Download::makeByteArray(publicPacksUrl, &publicModpacksXmlFileData));
|
||||
|
||||
QUrl thirdPartyUrl = QUrl(URLConstants::FTB_CDN_BASE_URL + "static/thirdparty.xml");
|
||||
QUrl thirdPartyUrl = QUrl(URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/thirdparty.xml");
|
||||
qDebug() << "Downloading thirdparty version info from" << thirdPartyUrl.toString();
|
||||
netJob->addNetAction(Net::Download::makeByteArray(thirdPartyUrl, &thirdPartyModpacksXmlFileData));
|
||||
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &FtbPackFetchTask::fileDownloadFinished);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &FtbPackFetchTask::fileDownloadFailed);
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &PackFetchTask::fileDownloadFinished);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &PackFetchTask::fileDownloadFailed);
|
||||
|
||||
jobPtr.reset(netJob);
|
||||
netJob->start();
|
||||
}
|
||||
|
||||
void FtbPackFetchTask::fetchPrivate(const QStringList & toFetch)
|
||||
void PackFetchTask::fetchPrivate(const QStringList & toFetch)
|
||||
{
|
||||
QString privatePackBaseUrl = URLConstants::FTB_CDN_BASE_URL + "static/%1.xml";
|
||||
QString privatePackBaseUrl = URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/%1.xml";
|
||||
|
||||
for (auto &packCode: toFetch)
|
||||
{
|
||||
@@ -38,9 +40,9 @@ void FtbPackFetchTask::fetchPrivate(const QStringList & toFetch)
|
||||
|
||||
QObject::connect(job, &NetJob::succeeded, this, [this, job, data, packCode]
|
||||
{
|
||||
FtbModpackList packs;
|
||||
parseAndAddPacks(*data, FtbPackType::Private, packs);
|
||||
foreach(FtbModpack currentPack, packs)
|
||||
ModpackList packs;
|
||||
parseAndAddPacks(*data, PackType::Private, packs);
|
||||
foreach(Modpack currentPack, packs)
|
||||
{
|
||||
currentPack.packCode = packCode;
|
||||
emit privateFileDownloadFinished(currentPack);
|
||||
@@ -65,18 +67,18 @@ void FtbPackFetchTask::fetchPrivate(const QStringList & toFetch)
|
||||
}
|
||||
}
|
||||
|
||||
void FtbPackFetchTask::fileDownloadFinished()
|
||||
void PackFetchTask::fileDownloadFinished()
|
||||
{
|
||||
jobPtr.reset();
|
||||
|
||||
QStringList failedLists;
|
||||
|
||||
if(!parseAndAddPacks(publicModpacksXmlFileData, FtbPackType::Public, publicPacks))
|
||||
if(!parseAndAddPacks(publicModpacksXmlFileData, PackType::Public, publicPacks))
|
||||
{
|
||||
failedLists.append(tr("Public Packs"));
|
||||
}
|
||||
|
||||
if(!parseAndAddPacks(thirdPartyModpacksXmlFileData, FtbPackType::ThirdParty, thirdPartyPacks))
|
||||
if(!parseAndAddPacks(thirdPartyModpacksXmlFileData, PackType::ThirdParty, thirdPartyPacks))
|
||||
{
|
||||
failedLists.append(tr("Third Party Packs"));
|
||||
}
|
||||
@@ -91,7 +93,7 @@ void FtbPackFetchTask::fileDownloadFinished()
|
||||
}
|
||||
}
|
||||
|
||||
bool FtbPackFetchTask::parseAndAddPacks(QByteArray &data, FtbPackType packType, FtbModpackList &list)
|
||||
bool PackFetchTask::parseAndAddPacks(QByteArray &data, PackType packType, ModpackList &list)
|
||||
{
|
||||
QDomDocument doc;
|
||||
|
||||
@@ -112,7 +114,7 @@ bool FtbPackFetchTask::parseAndAddPacks(QByteArray &data, FtbPackType packType,
|
||||
{
|
||||
QDomElement element = nodes.at(i).toElement();
|
||||
|
||||
FtbModpack modpack;
|
||||
Modpack modpack;
|
||||
modpack.name = element.attribute("name");
|
||||
modpack.currentVersion = element.attribute("version");
|
||||
modpack.mcVersion = element.attribute("mcVersion");
|
||||
@@ -161,8 +163,10 @@ bool FtbPackFetchTask::parseAndAddPacks(QByteArray &data, FtbPackType packType,
|
||||
return true;
|
||||
}
|
||||
|
||||
void FtbPackFetchTask::fileDownloadFailed(QString reason)
|
||||
void PackFetchTask::fileDownloadFailed(QString reason)
|
||||
{
|
||||
qWarning() << "Fetching FtbPacks failed:" << reason;
|
||||
qWarning() << "Fetching FTBPacks failed:" << reason;
|
||||
emit failed(reason);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,13 +6,15 @@
|
||||
#include <QObject>
|
||||
#include "PackHelpers.h"
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT FtbPackFetchTask : public QObject {
|
||||
namespace LegacyFTB {
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT PackFetchTask : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FtbPackFetchTask() = default;
|
||||
virtual ~FtbPackFetchTask() = default;
|
||||
PackFetchTask() = default;
|
||||
virtual ~PackFetchTask() = default;
|
||||
|
||||
void fetch();
|
||||
void fetchPrivate(const QStringList &toFetch);
|
||||
@@ -23,18 +25,20 @@ private:
|
||||
QByteArray publicModpacksXmlFileData;
|
||||
QByteArray thirdPartyModpacksXmlFileData;
|
||||
|
||||
bool parseAndAddPacks(QByteArray &data, FtbPackType packType, FtbModpackList &list);
|
||||
FtbModpackList publicPacks;
|
||||
FtbModpackList thirdPartyPacks;
|
||||
bool parseAndAddPacks(QByteArray &data, PackType packType, ModpackList &list);
|
||||
ModpackList publicPacks;
|
||||
ModpackList thirdPartyPacks;
|
||||
|
||||
protected slots:
|
||||
void fileDownloadFinished();
|
||||
void fileDownloadFailed(QString reason);
|
||||
|
||||
signals:
|
||||
void finished(FtbModpackList publicPacks, FtbModpackList thirdPartyPacks);
|
||||
void finished(ModpackList publicPacks, ModpackList thirdPartyPacks);
|
||||
void failed(QString reason);
|
||||
|
||||
void privateFileDownloadFinished(FtbModpack modpack);
|
||||
void privateFileDownloadFinished(Modpack modpack);
|
||||
void privateFileDownloadFailed(QString reason, QString packCode);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -5,15 +5,17 @@
|
||||
#include <QStringList>
|
||||
#include <QMetaType>
|
||||
|
||||
namespace LegacyFTB {
|
||||
|
||||
//Header for structs etc...
|
||||
enum class FtbPackType
|
||||
enum class PackType
|
||||
{
|
||||
Public,
|
||||
ThirdParty,
|
||||
Private
|
||||
};
|
||||
|
||||
struct FtbModpack
|
||||
struct Modpack
|
||||
{
|
||||
QString name;
|
||||
QString description;
|
||||
@@ -31,11 +33,13 @@ struct FtbModpack
|
||||
bool bugged = false;
|
||||
bool broken = false;
|
||||
|
||||
FtbPackType type;
|
||||
PackType type;
|
||||
QString packCode;
|
||||
};
|
||||
|
||||
//We need it for the proxy model
|
||||
Q_DECLARE_METATYPE(FtbModpack)
|
||||
typedef QList<Modpack> ModpackList;
|
||||
|
||||
typedef QList<FtbModpack> FtbModpackList;
|
||||
}
|
||||
|
||||
//We need it for the proxy model
|
||||
Q_DECLARE_METATYPE(LegacyFTB::Modpack)
|
||||
@@ -1,28 +1,32 @@
|
||||
#include "FtbPackInstallTask.h"
|
||||
#include "PackInstallTask.h"
|
||||
|
||||
#include "Env.h"
|
||||
#include "MMCZip.h"
|
||||
#include "QtConcurrent"
|
||||
|
||||
#include "BaseInstance.h"
|
||||
#include "FileSystem.h"
|
||||
#include "settings/INISettingsObject.h"
|
||||
#include "minecraft/MinecraftInstance.h"
|
||||
#include "minecraft/ComponentList.h"
|
||||
#include "minecraft/GradleSpecifier.h"
|
||||
|
||||
#include "net/URLConstants.h"
|
||||
|
||||
FtbPackInstallTask::FtbPackInstallTask(FtbModpack pack, QString version)
|
||||
#include <QtConcurrent>
|
||||
|
||||
namespace LegacyFTB {
|
||||
|
||||
PackInstallTask::PackInstallTask(Modpack pack, QString version)
|
||||
{
|
||||
m_pack = pack;
|
||||
m_version = version;
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::executeTask()
|
||||
void PackInstallTask::executeTask()
|
||||
{
|
||||
downloadPack();
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::downloadPack()
|
||||
void PackInstallTask::downloadPack()
|
||||
{
|
||||
setStatus(tr("Downloading zip for %1").arg(m_pack.name));
|
||||
|
||||
@@ -32,46 +36,46 @@ void FtbPackInstallTask::downloadPack()
|
||||
|
||||
entry->setStale(true);
|
||||
QString url;
|
||||
if(m_pack.type == FtbPackType::Private)
|
||||
if(m_pack.type == PackType::Private)
|
||||
{
|
||||
url = QString(URLConstants::FTB_CDN_BASE_URL + "privatepacks/%1").arg(packoffset);
|
||||
url = QString(URLConstants::LEGACY_FTB_CDN_BASE_URL + "privatepacks/%1").arg(packoffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
url = QString(URLConstants::FTB_CDN_BASE_URL + "modpacks/%1").arg(packoffset);
|
||||
url = QString(URLConstants::LEGACY_FTB_CDN_BASE_URL + "modpacks/%1").arg(packoffset);
|
||||
}
|
||||
job->addNetAction(Net::Download::makeCached(url, entry));
|
||||
archivePath = entry->getFullPath();
|
||||
|
||||
netJobContainer.reset(job);
|
||||
connect(job, &NetJob::succeeded, this, &FtbPackInstallTask::onDownloadSucceeded);
|
||||
connect(job, &NetJob::failed, this, &FtbPackInstallTask::onDownloadFailed);
|
||||
connect(job, &NetJob::progress, this, &FtbPackInstallTask::onDownloadProgress);
|
||||
connect(job, &NetJob::succeeded, this, &PackInstallTask::onDownloadSucceeded);
|
||||
connect(job, &NetJob::failed, this, &PackInstallTask::onDownloadFailed);
|
||||
connect(job, &NetJob::progress, this, &PackInstallTask::onDownloadProgress);
|
||||
job->start();
|
||||
|
||||
progress(1, 4);
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::onDownloadSucceeded()
|
||||
void PackInstallTask::onDownloadSucceeded()
|
||||
{
|
||||
abortable = false;
|
||||
unzip();
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::onDownloadFailed(QString reason)
|
||||
void PackInstallTask::onDownloadFailed(QString reason)
|
||||
{
|
||||
abortable = false;
|
||||
emitFailed(reason);
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::onDownloadProgress(qint64 current, qint64 total)
|
||||
void PackInstallTask::onDownloadProgress(qint64 current, qint64 total)
|
||||
{
|
||||
abortable = true;
|
||||
progress(current, total * 4);
|
||||
setStatus(tr("Downloading zip for %1 (%2%)").arg(m_pack.name).arg(current / 10));
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::unzip()
|
||||
void PackInstallTask::unzip()
|
||||
{
|
||||
progress(2, 4);
|
||||
setStatus(tr("Extracting modpack"));
|
||||
@@ -85,22 +89,22 @@ void FtbPackInstallTask::unzip()
|
||||
}
|
||||
|
||||
m_extractFuture = QtConcurrent::run(QThreadPool::globalInstance(), MMCZip::extractDir, archivePath, extractDir.absolutePath() + "/unzip");
|
||||
connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &FtbPackInstallTask::onUnzipFinished);
|
||||
connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, &FtbPackInstallTask::onUnzipCanceled);
|
||||
connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &PackInstallTask::onUnzipFinished);
|
||||
connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, &PackInstallTask::onUnzipCanceled);
|
||||
m_extractFutureWatcher.setFuture(m_extractFuture);
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::onUnzipFinished()
|
||||
void PackInstallTask::onUnzipFinished()
|
||||
{
|
||||
install();
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::onUnzipCanceled()
|
||||
void PackInstallTask::onUnzipCanceled()
|
||||
{
|
||||
emitAborted();
|
||||
}
|
||||
|
||||
void FtbPackInstallTask::install()
|
||||
void PackInstallTask::install()
|
||||
{
|
||||
progress(3, 4);
|
||||
setStatus(tr("Installing modpack"));
|
||||
@@ -197,7 +201,7 @@ void FtbPackInstallTask::install()
|
||||
emitSucceeded();
|
||||
}
|
||||
|
||||
bool FtbPackInstallTask::abort()
|
||||
bool PackInstallTask::abort()
|
||||
{
|
||||
if(abortable)
|
||||
{
|
||||
@@ -205,3 +209,5 @@ bool FtbPackInstallTask::abort()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,15 +6,17 @@
|
||||
#include "meta/Index.h"
|
||||
#include "meta/Version.h"
|
||||
#include "meta/VersionList.h"
|
||||
#include "modplatform/ftb/PackHelpers.h"
|
||||
#include "PackHelpers.h"
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT FtbPackInstallTask : public InstanceTask
|
||||
namespace LegacyFTB {
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT PackInstallTask : public InstanceTask
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FtbPackInstallTask(FtbModpack pack, QString version);
|
||||
virtual ~FtbPackInstallTask(){}
|
||||
explicit PackInstallTask(Modpack pack, QString version);
|
||||
virtual ~PackInstallTask(){}
|
||||
|
||||
bool abort() override;
|
||||
|
||||
@@ -43,6 +45,8 @@ private: /* data */
|
||||
NetJobPtr netJobContainer;
|
||||
QString archivePath;
|
||||
|
||||
FtbModpack m_pack;
|
||||
Modpack m_pack;
|
||||
QString m_version;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
#include "FtbPrivatePackManager.h"
|
||||
#include "PrivatePackManager.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "FileSystem.h"
|
||||
|
||||
void FtbPrivatePackManager::load()
|
||||
namespace LegacyFTB {
|
||||
|
||||
void PrivatePackManager::load()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -18,7 +20,7 @@ void FtbPrivatePackManager::load()
|
||||
}
|
||||
}
|
||||
|
||||
void FtbPrivatePackManager::save() const
|
||||
void PrivatePackManager::save() const
|
||||
{
|
||||
if(!dirty)
|
||||
{
|
||||
@@ -35,3 +37,5 @@ void FtbPrivatePackManager::save() const
|
||||
qWarning() << "Failed to write third party FTB pack codes to" << m_filename;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,10 +5,12 @@
|
||||
#include <QFile>
|
||||
#include "multimc_logic_export.h"
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT FtbPrivatePackManager
|
||||
namespace LegacyFTB {
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT PrivatePackManager
|
||||
{
|
||||
public:
|
||||
~FtbPrivatePackManager()
|
||||
~PrivatePackManager()
|
||||
{
|
||||
save();
|
||||
}
|
||||
@@ -38,3 +40,5 @@ private:
|
||||
QString m_filename = "private_packs.txt";
|
||||
mutable bool dirty = false;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -29,7 +29,8 @@ const QString IMGUR_BASE_URL("https://api.imgur.com/3/");
|
||||
const QString FMLLIBS_OUR_BASE_URL("https://files.multimc.org/fmllibs/");
|
||||
const QString FMLLIBS_FORGE_BASE_URL("https://files.minecraftforge.net/fmllibs/");
|
||||
const QString TRANSLATIONS_BASE_URL("https://files.multimc.org/translations/");
|
||||
const QString FTB_CDN_BASE_URL("https://ftb.forgecdn.net/FTB2/");
|
||||
|
||||
const QString LEGACY_FTB_CDN_BASE_URL("https://dist.creeper.host/FTB2/");
|
||||
|
||||
QString getJarPath(QString version);
|
||||
QString getLegacyJarUrl(QString version);
|
||||
|
||||
@@ -33,7 +33,12 @@ struct Language
|
||||
Language(const QString & _key)
|
||||
{
|
||||
key = _key;
|
||||
locale = QLocale(key);
|
||||
if(key == "pt") {
|
||||
locale = QLocale("pt_PT");
|
||||
}
|
||||
else {
|
||||
locale = QLocale(key);
|
||||
}
|
||||
updated = (key == defaultLangCode);
|
||||
}
|
||||
|
||||
|
||||
@@ -185,25 +185,6 @@ slots:
|
||||
qDebug() << expectedOperations;
|
||||
QCOMPARE(operations, expectedOperations);
|
||||
}
|
||||
|
||||
void test_OSXPathFixup()
|
||||
{
|
||||
QString path, pathOrig;
|
||||
bool result;
|
||||
// Proper OSX path
|
||||
pathOrig = path = "MultiMC.app/Foo/Bar/Baz";
|
||||
qDebug() << "Proper OSX path: " << path;
|
||||
result = fixPathForOSX(path);
|
||||
QCOMPARE(path, QString("Foo/Bar/Baz"));
|
||||
QCOMPARE(result, true);
|
||||
|
||||
// Bad OSX path
|
||||
pathOrig = path = "translations/klingon.lol";
|
||||
qDebug() << "Bad OSX path: " << path;
|
||||
result = fixPathForOSX(path);
|
||||
QCOMPARE(path, pathOrig);
|
||||
QCOMPARE(result, false);
|
||||
}
|
||||
};
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -33,13 +33,7 @@ bool parseVersionInfo(const QByteArray &data, VersionFileList &list, QString &er
|
||||
QJsonObject fileObj = fileValue.toObject();
|
||||
|
||||
QString file_path = fileObj.value("Path").toString();
|
||||
#ifdef Q_OS_MAC
|
||||
// On OSX, the paths for the updater need to be fixed.
|
||||
// basically, anything that isn't in the .app folder is ignored.
|
||||
// everything else is changed so the code that processes the files actually finds
|
||||
// them and puts the replacements in the right spots.
|
||||
fixPathForOSX(file_path);
|
||||
#endif
|
||||
|
||||
VersionFileEntry file{file_path, fileObj.value("Perms").toVariant().toInt(),
|
||||
FileSourceList(), fileObj.value("MD5").toString(), };
|
||||
qDebug() << "File" << file.path << "with perms" << file.mode;
|
||||
@@ -201,19 +195,4 @@ bool processFileLists
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fixPathForOSX(QString &path)
|
||||
{
|
||||
if (path.startsWith("MultiMC.app/"))
|
||||
{
|
||||
// remove the prefix and add a new, more appropriate one.
|
||||
path.remove(0, 12);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "Update path not within .app: " << path;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,14 +123,5 @@ bool MULTIMC_LOGIC_EXPORT processFileLists
|
||||
OperationList &ops
|
||||
);
|
||||
|
||||
/*!
|
||||
* This fixes destination paths for OSX - removes 'MultiMC.app' prefix
|
||||
* The updater runs in MultiMC.app/Contents/MacOs by default
|
||||
* The destination paths are such as this: MultiMC.app/blah/blah
|
||||
*
|
||||
* @return false if the path couldn't be fixed (is invalid)
|
||||
*/
|
||||
bool MULTIMC_LOGIC_EXPORT fixPathForOSX(QString &path);
|
||||
|
||||
}
|
||||
Q_DECLARE_METATYPE(GoUpdate::Status)
|
||||
|
||||
@@ -125,20 +125,14 @@ SET(MULTIMC_SOURCES
|
||||
pages/global/ProxyPage.h
|
||||
pages/global/PasteEEPage.cpp
|
||||
pages/global/PasteEEPage.h
|
||||
pages/global/PackagesPage.cpp
|
||||
pages/global/PackagesPage.h
|
||||
|
||||
# GUI - platform pages
|
||||
pages/modplatform/VanillaPage.cpp
|
||||
pages/modplatform/VanillaPage.h
|
||||
pages/modplatform/FTBPage.cpp
|
||||
pages/modplatform/FTBPage.h
|
||||
pages/modplatform/FtbListModel.h
|
||||
pages/modplatform/FtbListModel.cpp
|
||||
pages/modplatform/TwitchPage.cpp
|
||||
pages/modplatform/TwitchPage.h
|
||||
pages/modplatform/TechnicPage.cpp
|
||||
pages/modplatform/TechnicPage.h
|
||||
pages/modplatform/legacy_ftb/Page.cpp
|
||||
pages/modplatform/legacy_ftb/Page.h
|
||||
pages/modplatform/legacy_ftb/ListModel.h
|
||||
pages/modplatform/legacy_ftb/ListModel.cpp
|
||||
pages/modplatform/ImportPage.cpp
|
||||
pages/modplatform/ImportPage.h
|
||||
|
||||
@@ -182,6 +176,8 @@ SET(MULTIMC_SOURCES
|
||||
widgets/Common.h
|
||||
widgets/CustomCommands.cpp
|
||||
widgets/CustomCommands.h
|
||||
widgets/DropLabel.cpp
|
||||
widgets/DropLabel.h
|
||||
widgets/FocusLineEdit.cpp
|
||||
widgets/FocusLineEdit.h
|
||||
widgets/IconLabel.cpp
|
||||
@@ -251,13 +247,10 @@ SET(MULTIMC_UIS
|
||||
pages/global/MultiMCPage.ui
|
||||
pages/global/ProxyPage.ui
|
||||
pages/global/PasteEEPage.ui
|
||||
pages/global/PackagesPage.ui
|
||||
|
||||
# Platform pages
|
||||
pages/modplatform/VanillaPage.ui
|
||||
pages/modplatform/FTBPage.ui
|
||||
pages/modplatform/TwitchPage.ui
|
||||
pages/modplatform/TechnicPage.ui
|
||||
pages/modplatform/legacy_ftb/Page.ui
|
||||
pages/modplatform/ImportPage.ui
|
||||
|
||||
# Dialogs
|
||||
@@ -281,7 +274,6 @@ SET(MULTIMC_UIS
|
||||
)
|
||||
|
||||
set(MULTIMC_QRCS
|
||||
resources/assets/assets.qrc
|
||||
resources/backgrounds/backgrounds.qrc
|
||||
resources/multimc/multimc.qrc
|
||||
resources/pe_dark/pe_dark.qrc
|
||||
@@ -305,7 +297,7 @@ qt5_add_resources(MULTIMC_RESOURCES ${MULTIMC_QRCS})
|
||||
|
||||
# Add executable
|
||||
add_executable(MultiMC MACOSX_BUNDLE WIN32 ${MULTIMC_SOURCES} ${MULTIMC_UI} ${MULTIMC_RESOURCES} ${MULTIMC_RCS})
|
||||
target_link_libraries(MultiMC MultiMC_gui ${QUAZIP_LIBRARIES} hoedown MultiMC_rainbow LocalPeer ganalytics)
|
||||
target_link_libraries(MultiMC MultiMC_gui ${QUAZIP_LIBRARIES} hoedown MultiMC_rainbow LocalPeer ganalytics Qt5::Multimedia)
|
||||
if(DEFINED MultiMC_APP_BINARY_NAME)
|
||||
set_target_properties(MultiMC PROPERTIES OUTPUT_NAME "${MultiMC_APP_BINARY_NAME}")
|
||||
endif()
|
||||
|
||||
@@ -24,7 +24,7 @@ void LaunchController::executeTask()
|
||||
{
|
||||
if (!m_instance)
|
||||
{
|
||||
emitFailed(tr("No instance specified"));
|
||||
emitFailed(tr("No instance specified!"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void LaunchController::login()
|
||||
// if no account is selected, we bail
|
||||
if (!account.get())
|
||||
{
|
||||
emitFailed(tr("No account selected for launch"));
|
||||
emitFailed(tr("No account selected for launch."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -83,8 +83,7 @@ void LaunchController::login()
|
||||
// we loop until the user succeeds in logging in or gives up
|
||||
bool tryagain = true;
|
||||
// the failure. the default failure.
|
||||
const QString needLoginAgain = tr("Your account is currently not logged in. Please enter "
|
||||
"your password to log in again.");
|
||||
const QString needLoginAgain = tr("Your account is currently not logged in. Please enter your password to log in again. <br /> <br /> This could be caused by a password change.");
|
||||
QString failReason = needLoginAgain;
|
||||
|
||||
while (tryagain)
|
||||
@@ -193,7 +192,7 @@ void LaunchController::launchInstance()
|
||||
|
||||
if(!m_instance->reloadSettings())
|
||||
{
|
||||
QMessageBox::critical(m_parentWidget, tr("Error"), tr("Couldn't load the instance profile."));
|
||||
QMessageBox::critical(m_parentWidget, tr("Error!"), tr("Couldn't load the instance profile."));
|
||||
emitFailed(tr("Couldn't load the instance profile."));
|
||||
return;
|
||||
}
|
||||
@@ -233,8 +232,8 @@ void LaunchController::readyForLaunch()
|
||||
if (!m_profiler->check(&error))
|
||||
{
|
||||
m_launcher->abort();
|
||||
QMessageBox::critical(m_parentWidget, tr("Error"), tr("Couldn't start profiler: %1").arg(error));
|
||||
emitFailed("Profiler startup failed");
|
||||
QMessageBox::critical(m_parentWidget, tr("Error!"), tr("Couldn't start profiler: %1").arg(error));
|
||||
emitFailed("Profiler startup failed!");
|
||||
return;
|
||||
}
|
||||
BaseProfiler *profilerInstance = m_profiler->createProfiler(m_launcher->instance(), this);
|
||||
@@ -245,7 +244,7 @@ void LaunchController::readyForLaunch()
|
||||
msg.setText(tr("The game launch is delayed until you press the "
|
||||
"button. This is the right time to setup the profiler, as the "
|
||||
"profiler server is running now.\n\n%1").arg(message));
|
||||
msg.setWindowTitle(tr("Waiting"));
|
||||
msg.setWindowTitle(tr("Waiting."));
|
||||
msg.setIcon(QMessageBox::Information);
|
||||
msg.addButton(tr("Launch"), QMessageBox::AcceptRole);
|
||||
msg.setModal(true);
|
||||
@@ -262,7 +261,7 @@ void LaunchController::readyForLaunch()
|
||||
msg.setModal(true);
|
||||
msg.exec();
|
||||
m_launcher->abort();
|
||||
emitFailed("Profiler startup failed");
|
||||
emitFailed("Profiler startup failed!");
|
||||
});
|
||||
profilerInstance->beginProfiling(m_launcher);
|
||||
}
|
||||
|
||||
@@ -575,9 +575,10 @@ public:
|
||||
{
|
||||
MainWindow->setObjectName(QStringLiteral("MainWindow"));
|
||||
}
|
||||
MainWindow->resize(694, 563);
|
||||
MainWindow->resize(800, 600);
|
||||
MainWindow->setWindowIcon(MMC->getThemedIcon("logo"));
|
||||
MainWindow->setWindowTitle("MultiMC 5");
|
||||
MainWindow->setAccessibleName("MultiMC");
|
||||
|
||||
createMainToolbar(MainWindow);
|
||||
|
||||
@@ -682,6 +683,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
|
||||
connect(proxymodel, &InstanceProxyModel::dataChanged, this, &MainWindow::instanceDataChanged);
|
||||
|
||||
view->setModel(proxymodel);
|
||||
view->setSourceOfGroupCollapseStatus([](const QString & groupName)->bool {
|
||||
return MMC->instances()->isGroupCollapsed(groupName);
|
||||
});
|
||||
connect(view, &GroupView::groupStateChanged, MMC->instances().get(), &InstanceList::on_GroupStateChanged);
|
||||
ui->horizontalLayout->addWidget(view);
|
||||
}
|
||||
// The cat background
|
||||
@@ -1280,7 +1285,7 @@ void MainWindow::downloadUpdates(GoUpdate::Status status)
|
||||
|
||||
void MainWindow::onCatToggled(bool state)
|
||||
{
|
||||
setCatBackground(state);
|
||||
setCatBackground(state, false);
|
||||
MMC->settings()->set("TheCat", state);
|
||||
}
|
||||
|
||||
@@ -1294,8 +1299,9 @@ T non_stupid_abs(T in)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setCatBackground(bool enabled)
|
||||
void MainWindow::setCatBackground(bool enabled, bool initial)
|
||||
{
|
||||
static int currentMeow = 0;
|
||||
if (enabled)
|
||||
{
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
@@ -1312,9 +1318,28 @@ GroupView
|
||||
background-repeat: none;
|
||||
background-color:palette(base);
|
||||
})").arg(cat));
|
||||
if(!initial) {
|
||||
const char * sounds[] = {
|
||||
"/home/peterix/meows/Fiona52fixed.wav",
|
||||
"/home/peterix/meows/Fiona72.wav",
|
||||
"/home/peterix/meows/Fiona76.wav",
|
||||
"/home/peterix/meows/Fiona81.wav",
|
||||
"/home/peterix/meows/Fiona85.wav"
|
||||
};
|
||||
qDebug() << "PLAY MEOW" << currentMeow;
|
||||
meow.setSource(QUrl::fromLocalFile(sounds[currentMeow]));
|
||||
meow.setLoopCount(1);
|
||||
meow.play();
|
||||
int newMeow = qrand() % 4;
|
||||
if(newMeow == currentMeow) {
|
||||
newMeow++;
|
||||
}
|
||||
currentMeow = newMeow;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meow.stop();
|
||||
view->setStyleSheet(QString());
|
||||
}
|
||||
}
|
||||
@@ -1353,7 +1378,7 @@ void MainWindow::on_actionCopyInstance_triggered()
|
||||
if (!copyInstDlg.exec())
|
||||
return;
|
||||
|
||||
auto copyTask = new InstanceCopyTask(m_selectedInstance, copyInstDlg.shouldCopySaves());
|
||||
auto copyTask = new InstanceCopyTask(m_selectedInstance, copyInstDlg.shouldCopySaves(), copyInstDlg.shouldKeepPlaytime());
|
||||
copyTask->setName(copyInstDlg.instName());
|
||||
copyTask->setGroup(copyInstDlg.instGroup());
|
||||
copyTask->setIcon(copyInstDlg.iconKey());
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <QMainWindow>
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
#include <QtMultimedia/QSoundEffect>
|
||||
|
||||
#include "BaseInstance.h"
|
||||
#include "minecraft/auth/MojangAccount.h"
|
||||
@@ -189,7 +190,7 @@ private slots:
|
||||
private:
|
||||
void addInstance(QString url = QString());
|
||||
void activateInstance(InstancePtr instance);
|
||||
void setCatBackground(bool enabled);
|
||||
void setCatBackground(bool enabled, bool initial = true);
|
||||
void updateInstanceToolIcon(QString new_icon);
|
||||
void setSelectedInstanceById(const QString &id);
|
||||
|
||||
@@ -200,6 +201,8 @@ private:
|
||||
private:
|
||||
std::unique_ptr<Ui> ui;
|
||||
|
||||
QSoundEffect meow;
|
||||
|
||||
// these are managed by Qt's memory management model!
|
||||
GroupView *view = nullptr;
|
||||
InstanceProxyModel *proxymodel = nullptr;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "pages/global/ExternalToolsPage.h"
|
||||
#include "pages/global/AccountListPage.h"
|
||||
#include "pages/global/PasteEEPage.h"
|
||||
#include "pages/global/PackagesPage.h"
|
||||
#include "pages/global/CustomCommandsPage.h"
|
||||
|
||||
#include "themes/ITheme.h"
|
||||
@@ -157,23 +156,23 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
||||
// --help
|
||||
parser.addSwitch("help");
|
||||
parser.addShortOpt("help", 'h');
|
||||
parser.addDocumentation("help", "display this help and exit.");
|
||||
parser.addDocumentation("help", "Display this help and exit.");
|
||||
// --version
|
||||
parser.addSwitch("version");
|
||||
parser.addShortOpt("version", 'V');
|
||||
parser.addDocumentation("version", "display program version and exit.");
|
||||
parser.addDocumentation("version", "Display program version and exit.");
|
||||
// --dir
|
||||
parser.addOption("dir");
|
||||
parser.addShortOpt("dir", 'd');
|
||||
parser.addDocumentation("dir", "use the supplied folder as MultiMC root instead of "
|
||||
parser.addDocumentation("dir", "Use the supplied folder as MultiMC root instead of "
|
||||
"the binary location (use '.' for current)");
|
||||
// --launch
|
||||
parser.addOption("launch");
|
||||
parser.addShortOpt("launch", 'l');
|
||||
parser.addDocumentation("launch", "launch the specified instance (by instance ID)");
|
||||
parser.addDocumentation("launch", "Launch the specified instance (by instance ID)");
|
||||
// --alive
|
||||
parser.addSwitch("alive");
|
||||
parser.addDocumentation("alive", "write a small '" + liveCheckFile + "' file after MultiMC starts");
|
||||
parser.addDocumentation("alive", "Write a small '" + liveCheckFile + "' file after MultiMC starts");
|
||||
|
||||
// parse the arguments
|
||||
try
|
||||
@@ -382,7 +381,7 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
||||
auto payload = appID.toString().toUtf8();
|
||||
if(check.write(payload) != payload.size())
|
||||
{
|
||||
qWarning() << "Could not write into" << liveCheckFile;
|
||||
qWarning() << "Could not write into" << liveCheckFile << "!";
|
||||
check.remove();
|
||||
break;
|
||||
}
|
||||
@@ -527,7 +526,6 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
||||
m_globalSettingsProvider->addPage<LanguagePage>();
|
||||
m_globalSettingsProvider->addPage<CustomCommandsPage>();
|
||||
m_globalSettingsProvider->addPage<ProxyPage>();
|
||||
// m_globalSettingsProvider->addPage<PackagesPage>();
|
||||
m_globalSettingsProvider->addPage<ExternalToolsPage>();
|
||||
m_globalSettingsProvider->addPage<AccountListPage>();
|
||||
m_globalSettingsProvider->addPage<PasteEEPage>();
|
||||
@@ -535,7 +533,9 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
||||
qDebug() << "<> Settings loaded.";
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QAccessible::installFactory(groupViewAccessibleFactory);
|
||||
#endif /* !QT_NO_ACCESSIBILITY */
|
||||
|
||||
// load translations
|
||||
{
|
||||
@@ -600,12 +600,12 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
||||
{
|
||||
auto InstDirSetting = m_settings->getSetting("InstanceDir");
|
||||
// instance path: check for problems with '!' in instance path and warn the user in the log
|
||||
// and rememer that we have to show him a dialog when the gui starts (if it does so)
|
||||
// and remember that we have to show him a dialog when the gui starts (if it does so)
|
||||
QString instDir = InstDirSetting->get().toString();
|
||||
qDebug() << "Instance path : " << instDir;
|
||||
if (FS::checkProblemticPathJava(QDir(instDir)))
|
||||
{
|
||||
qWarning() << "Your instance path contains \'!\' and this is known to cause java problems";
|
||||
qWarning() << "Your instance path contains \'!\' and this is known to cause java problems!";
|
||||
}
|
||||
m_instances.reset(new InstanceList(m_settings, instDir, this));
|
||||
connect(InstDirSetting.get(), &Setting::SettingChanged, m_instances.get(), &InstanceList::on_InstFolderChanged);
|
||||
@@ -947,7 +947,7 @@ bool MultiMC::launch(InstancePtr instance, bool online, BaseProfilerFactory *pro
|
||||
{
|
||||
if(m_updateRunning)
|
||||
{
|
||||
qDebug() << "Cannot launch instances while an update is running.";
|
||||
qDebug() << "Cannot launch instances while an update is running. Please try again when updates are completed.";
|
||||
}
|
||||
else if(instance->canLaunch())
|
||||
{
|
||||
@@ -996,7 +996,7 @@ bool MultiMC::kill(InstancePtr instance)
|
||||
{
|
||||
if (!instance->isRunning())
|
||||
{
|
||||
qWarning() << "Attempted to kill instance" << instance->id() << "which isn't running.";
|
||||
qWarning() << "Attempted to kill instance" << instance->id() << ", which isn't running.";
|
||||
return false;
|
||||
}
|
||||
auto & extras = m_instanceExtras[instance->id()];
|
||||
|
||||
@@ -23,56 +23,43 @@
|
||||
|
||||
#include "HoeDown.h"
|
||||
|
||||
namespace {
|
||||
// Credits
|
||||
// This is a hack, but I can't think of a better way to do this easily without screwing with QTextDocument...
|
||||
static QString getCreditsHtml(QStringList patrons)
|
||||
QString getCreditsHtml(QStringList patrons)
|
||||
{
|
||||
QString creditsHtml = QObject::tr(
|
||||
"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN' 'http://www.w3.org/TR/REC-html40/strict.dtd'>"
|
||||
"<html>"
|
||||
""
|
||||
"<head>"
|
||||
"<meta name='qrichtext' content='1' />"
|
||||
"<style type='text/css'>"
|
||||
"p { white-space: pre-wrap; margin-top:2px; margin-bottom:2px; }"
|
||||
"</style>"
|
||||
"</head>"
|
||||
""
|
||||
"<body style=' font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;'>"
|
||||
""
|
||||
"<h3>MultiMC Developers</h3>"
|
||||
"<p>Andrew Okin <<a href='mailto:forkk@forkk.net'>forkk@forkk.net</a>></p>"
|
||||
"<p>Petr Mrázek <<a href='mailto:peterix@gmail.com'>peterix@gmail.com</a>></p>"
|
||||
"<p>Sky Welch <<a href='mailto:multimc@bunnies.io'>multimc@bunnies.io</a>></p>"
|
||||
"<p>Jan (02JanDal) <<a href='mailto:02jandal@gmail.com'>02jandal@gmail.com</a>></p>"
|
||||
"<p>RoboSky <<a href='https://twitter.com/RoboSky_'>@RoboSky_</a>></p>"
|
||||
""
|
||||
"<h3>With thanks to</h3>"
|
||||
"<p>Orochimarufan <<a href='mailto:orochimarufan.x3@gmail.com'>orochimarufan.x3@gmail.com</a>></p>"
|
||||
"<p>TakSuyu <<a href='mailto:taksuyu@gmail.com'>taksuyu@gmail.com</a>></p>"
|
||||
"<p>Kilobyte <<a href='mailto:stiepen22@gmx.de'>stiepen22@gmx.de</a>></p>"
|
||||
"<p>Rootbear75 <<a href='https://twitter.com/rootbear75'>@rootbear75</a>></p>"
|
||||
""
|
||||
"<h3>Patrons</h3>"
|
||||
"%1"
|
||||
""
|
||||
"</body>"
|
||||
"</html>");
|
||||
if (patrons.isEmpty())
|
||||
return creditsHtml.arg(QObject::tr("<p>Loading...</p>"));
|
||||
else
|
||||
{
|
||||
QString patronsStr;
|
||||
QString patronsHeading = QObject::tr("Patrons", "About Credits");
|
||||
QString output;
|
||||
QTextStream stream(&output);
|
||||
stream << "<center>\n";
|
||||
// TODO: possibly retrieve from git history at build time?
|
||||
stream << "<h3>" << QObject::tr("MultiMC Developers", "About Credits") << "</h3>\n";
|
||||
stream << "<p>Andrew Okin <<a href='mailto:forkk@forkk.net'>forkk@forkk.net</a>></p>\n";
|
||||
stream << "<p>Petr Mrázek <<a href='mailto:peterix@gmail.com'>peterix@gmail.com</a>></p>\n";
|
||||
stream << "<p>Sky Welch <<a href='mailto:multimc@bunnies.io'>multimc@bunnies.io</a>></p>\n";
|
||||
stream << "<p>Jan (02JanDal) <<a href='mailto:02jandal@gmail.com'>02jandal@gmail.com</a>></p>\n";
|
||||
stream << "<p>RoboSky <<a href='https://twitter.com/RoboSky_'>@RoboSky_</a>></p>\n";
|
||||
stream << "<br />\n";
|
||||
|
||||
stream << "<h3>" << QObject::tr("With thanks to", "About Credits") << "</h3>\n";
|
||||
stream << "<p>Orochimarufan <<a href='mailto:orochimarufan.x3@gmail.com'>orochimarufan.x3@gmail.com</a>></p>\n";
|
||||
stream << "<p>TakSuyu <<a href='mailto:taksuyu@gmail.com'>taksuyu@gmail.com</a>></p>\n";
|
||||
stream << "<p>Kilobyte <<a href='mailto:stiepen22@gmx.de'>stiepen22@gmx.de</a>></p>\n";
|
||||
stream << "<p>Rootbear75 <<a href='https://twitter.com/rootbear75'>@rootbear75</a>></p>\n";
|
||||
stream << "<br />\n";
|
||||
|
||||
if(!patrons.isEmpty()) {
|
||||
stream << "<h3>" << QObject::tr("Patrons", "About Credits") << "</h3>\n";
|
||||
for (QString patron : patrons)
|
||||
{
|
||||
patronsStr.append(QString("<p>%1</p>").arg(patron));
|
||||
stream << "<p>" << patron << "</p>\n";
|
||||
}
|
||||
|
||||
return creditsHtml.arg(patronsStr);
|
||||
}
|
||||
stream << "</center>\n";
|
||||
return output;
|
||||
}
|
||||
|
||||
static QString getLicenseHtml()
|
||||
QString getLicenseHtml()
|
||||
{
|
||||
HoeDown hoedown;
|
||||
QFile dataFile(":/documents/COPYING.md");
|
||||
@@ -81,6 +68,8 @@ static QString getLicenseHtml()
|
||||
return output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -109,6 +98,15 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
|
||||
else
|
||||
ui->channelLabel->setVisible(false);
|
||||
|
||||
ui->redistributionText->setHtml(tr(
|
||||
"<p>We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.</p>\n"
|
||||
"<p>Part of the reason for using the Apache license is we don't want people using the "MultiMC" name when redistributing the project. "
|
||||
"This means people must take the time to go through the source code and remove all references to "MultiMC", including but not limited to the project "
|
||||
"icon and the title of windows, (no <b>MultiMC-fork</b> in the title).</p>\n"
|
||||
"<p>The Apache license covers reasonable use for the name - a mention of the project's origins in the About dialog and the license is acceptable. "
|
||||
"However, it should be abundantly clear that the project is a fork <b>without</b> implying that you have our blessing.</p>"
|
||||
));
|
||||
|
||||
connect(ui->closeButton, SIGNAL(clicked()), SLOT(close()));
|
||||
|
||||
connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt);
|
||||
|
||||
@@ -212,28 +212,11 @@
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="translationInfo">
|
||||
<property name="text">
|
||||
<string extracomment="Hey, Translator, feel free to put credit to you here">No Language file loaded.</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="licenseTab">
|
||||
@@ -257,13 +240,6 @@ p, li { white-space: pre-wrap; }
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:12pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
@@ -277,18 +253,7 @@ p, li { white-space: pre-wrap; }
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:11pt;">We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans'; font-size:11pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:11pt;">Part of the reason for using the Apache license is we don't want people using the &quot;MultiMC&quot; name when redistributing the project. This means people must take the time to go through the source code and remove all references to &quot;MultiMC&quot;, including but not limited to the project icon and the title of windows, (no *MultiMC-fork* in the title).</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans'; font-size:11pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:11pt;">The Apache license covers reasonable use for the name - a mention of the project's origins in the About dialog and the license is acceptable. However, it should be abundantly clear that the project is a fork </span><span style=" font-family:'Bitstream Vera Sans'; font-size:11pt; font-weight:600;">without</span><span style=" font-family:'Bitstream Vera Sans'; font-size:11pt;"> implying that you have our blessing.</span></p></body></html></string>
|
||||
</property>
|
||||
<widget class="QTextEdit" name="redistributionText">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
@@ -337,14 +302,11 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>creditsText</tabstop>
|
||||
<tabstop>translationInfo</tabstop>
|
||||
<tabstop>licenseText</tabstop>
|
||||
<tabstop>textEdit</tabstop>
|
||||
<tabstop>redistributionText</tabstop>
|
||||
<tabstop>aboutQt</tabstop>
|
||||
<tabstop>closeButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../resources/multimc/multimc.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -53,6 +53,7 @@ CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent)
|
||||
ui->groupBox->setCurrentIndex(index);
|
||||
ui->groupBox->lineEdit()->setPlaceholderText(tr("No group"));
|
||||
ui->copySavesCheckbox->setChecked(m_copySaves);
|
||||
ui->keepPlaytimeCheckbox->setChecked(m_keepPlaytime);
|
||||
}
|
||||
|
||||
CopyInstanceDialog::~CopyInstanceDialog()
|
||||
@@ -123,3 +124,21 @@ void CopyInstanceDialog::on_copySavesCheckbox_stateChanged(int state)
|
||||
m_copySaves = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool CopyInstanceDialog::shouldKeepPlaytime() const
|
||||
{
|
||||
return m_keepPlaytime;
|
||||
}
|
||||
|
||||
|
||||
void CopyInstanceDialog::on_keepPlaytimeCheckbox_stateChanged(int state)
|
||||
{
|
||||
if(state == Qt::Unchecked)
|
||||
{
|
||||
m_keepPlaytime = false;
|
||||
}
|
||||
else if(state == Qt::Checked)
|
||||
{
|
||||
m_keepPlaytime = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,16 +40,19 @@ public:
|
||||
QString instGroup() const;
|
||||
QString iconKey() const;
|
||||
bool shouldCopySaves() const;
|
||||
bool shouldKeepPlaytime() const;
|
||||
|
||||
private
|
||||
slots:
|
||||
void on_iconButton_clicked();
|
||||
void on_instNameTextBox_textChanged(const QString &arg1);
|
||||
void on_copySavesCheckbox_stateChanged(int state);
|
||||
void on_keepPlaytimeCheckbox_stateChanged(int state);
|
||||
|
||||
private:
|
||||
Ui::CopyInstanceDialog *ui;
|
||||
QString InstIconKey;
|
||||
InstancePtr m_original;
|
||||
bool m_copySaves = true;
|
||||
bool m_keepPlaytime = true;
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>345</width>
|
||||
<height>240</height>
|
||||
<height>323</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -116,6 +116,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="keepPlaytimeCheckbox">
|
||||
<property name="text">
|
||||
<string>Keep play time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
@@ -128,6 +135,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>iconButton</tabstop>
|
||||
<tabstop>instNameTextBox</tabstop>
|
||||
<tabstop>groupBox</tabstop>
|
||||
<tabstop>copySavesCheckbox</tabstop>
|
||||
<tabstop>keepPlaytimeCheckbox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../graphics.qrc"/>
|
||||
</resources>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<item>
|
||||
<widget class="QLineEdit" name="userTextBox">
|
||||
<property name="placeholderText">
|
||||
<string>Email / Username</string>
|
||||
<string>Email</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<item>
|
||||
<widget class="QLineEdit" name="userTextBox">
|
||||
<property name="placeholderText">
|
||||
<string>Email / Username</string>
|
||||
<string>Email</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -34,11 +34,8 @@
|
||||
|
||||
#include "widgets/PageContainer.h"
|
||||
#include <pages/modplatform/VanillaPage.h>
|
||||
#include <pages/modplatform/FTBPage.h>
|
||||
#include <pages/modplatform/TwitchPage.h>
|
||||
#include <pages/modplatform/legacy_ftb/Page.h>
|
||||
#include <pages/modplatform/ImportPage.h>
|
||||
#include <pages/modplatform/TechnicPage.h>
|
||||
|
||||
|
||||
|
||||
NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString & url, QWidget *parent)
|
||||
@@ -97,14 +94,8 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString
|
||||
if(!url.isEmpty())
|
||||
{
|
||||
QUrl actualUrl(url);
|
||||
if(actualUrl.host() == "www.curseforge.com") {
|
||||
m_container->selectPage("twitch");
|
||||
twitchPage->setUrl(url);
|
||||
}
|
||||
else {
|
||||
m_container->selectPage("import");
|
||||
importPage->setUrl(url);
|
||||
}
|
||||
m_container->selectPage("import");
|
||||
importPage->setUrl(url);
|
||||
}
|
||||
|
||||
updateDialogState();
|
||||
@@ -128,13 +119,11 @@ void NewInstanceDialog::accept()
|
||||
QList<BasePage *> NewInstanceDialog::getPages()
|
||||
{
|
||||
importPage = new ImportPage(this);
|
||||
twitchPage = new TwitchPage(this);
|
||||
return
|
||||
{
|
||||
new VanillaPage(this),
|
||||
importPage,
|
||||
twitchPage,
|
||||
new FTBPage(this)
|
||||
new LegacyFTB::Page(this),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ class NewInstanceDialog;
|
||||
class PageContainer;
|
||||
class QDialogButtonBox;
|
||||
class ImportPage;
|
||||
class TwitchPage;
|
||||
|
||||
class NewInstanceDialog : public QDialog, public BasePageProvider
|
||||
{
|
||||
@@ -68,7 +67,6 @@ private:
|
||||
|
||||
QString InstIconKey;
|
||||
ImportPage *importPage = nullptr;
|
||||
TwitchPage *twitchPage = nullptr;
|
||||
std::unique_ptr<InstanceTask> creationTask;
|
||||
|
||||
bool importIcon = false;
|
||||
|
||||
@@ -22,6 +22,7 @@ UpdateDialog::UpdateDialog(bool hasUpdate, QWidget *parent) : QDialog(parent), u
|
||||
ui->btnUpdateNow->setHidden(true);
|
||||
ui->btnUpdateLater->setText(tr("Close"));
|
||||
}
|
||||
ui->changelogBrowser->setHtml(tr("<center><h1>Loading changelog...</h1></center>"));
|
||||
loadChangelog();
|
||||
restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("UpdateDialogGeometry").toByteArray()));
|
||||
}
|
||||
|
||||
@@ -42,13 +42,6 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="changelogBrowser">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:22pt;">Loading changelog...</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <qaccessible.h>
|
||||
#include <qheaderview.h>
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
||||
QAccessibleInterface *groupViewAccessibleFactory(const QString &classname, QObject *object)
|
||||
{
|
||||
QAccessibleInterface *iface = 0;
|
||||
@@ -772,3 +774,5 @@ QAccessibleInterface *AccessibleGroupViewItem::child(int) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* !QT_NO_ACCESSIBILITY */
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "GroupView.h"
|
||||
#include "QtCore/qpointer.h"
|
||||
#include <QtGui/qaccessible.h>
|
||||
#include <QAccessibleWidget>
|
||||
#include <QAbstractItemView>
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include "GroupView.h"
|
||||
// #include <QHeaderView>
|
||||
|
||||
class QAccessibleTableCell;
|
||||
@@ -114,3 +115,4 @@ private:
|
||||
|
||||
friend class AccessibleGroupView;
|
||||
};
|
||||
#endif /* !QT_NO_ACCESSIBILITY */
|
||||
|
||||
@@ -93,11 +93,13 @@ void GroupView::currentChanged(const QModelIndex& current, const QModelIndex& pr
|
||||
{
|
||||
QAbstractItemView::currentChanged(current, previous);
|
||||
// TODO: for accessibility support, implement+register a factory, steal QAccessibleTable from Qt and return an instance of it for GroupView.
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
if (QAccessible::isActive() && current.isValid()) {
|
||||
QAccessibleEvent event(this, QAccessible::Focus);
|
||||
event.setChild(current.row());
|
||||
QAccessible::updateAccessibility(&event);
|
||||
}
|
||||
#endif /* !QT_NO_ACCESSIBILITY */
|
||||
}
|
||||
|
||||
|
||||
@@ -175,6 +177,9 @@ void GroupView::updateGeometries()
|
||||
else
|
||||
{
|
||||
auto cat = new VisualGroup(groupName, this);
|
||||
if(fVisibility) {
|
||||
cat->collapsed = fVisibility(groupName);
|
||||
}
|
||||
cats.insert(groupName, cat);
|
||||
cat->update();
|
||||
}
|
||||
@@ -384,17 +389,25 @@ void GroupView::mouseReleaseEvent(QMouseEvent *event)
|
||||
if (state() == ExpandingState)
|
||||
{
|
||||
m_pressedCategory->collapsed = false;
|
||||
emit groupStateChanged(m_pressedCategory->text, false);
|
||||
|
||||
updateGeometries();
|
||||
viewport()->update();
|
||||
event->accept();
|
||||
m_pressedCategory = nullptr;
|
||||
setState(NoState);
|
||||
return;
|
||||
}
|
||||
else if (state() == CollapsingState)
|
||||
{
|
||||
m_pressedCategory->collapsed = true;
|
||||
emit groupStateChanged(m_pressedCategory->text, true);
|
||||
|
||||
updateGeometries();
|
||||
viewport()->update();
|
||||
event->accept();
|
||||
m_pressedCategory = nullptr;
|
||||
setState(NoState);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -607,8 +620,7 @@ void GroupView::dropEvent(QDropEvent *event)
|
||||
const QString categoryText = category->text;
|
||||
if (model()->dropMimeData(event->mimeData(), Qt::MoveAction, row, 0, QModelIndex()))
|
||||
{
|
||||
model()->setData(model()->index(row, 0), categoryText,
|
||||
GroupViewRoles::GroupRole);
|
||||
model()->setData(model()->index(row, 0), categoryText, GroupViewRoles::GroupRole);
|
||||
event->setDropAction(Qt::MoveAction);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <QScrollBar>
|
||||
#include <QCache>
|
||||
#include "VisualGroup.h"
|
||||
#include <functional>
|
||||
|
||||
struct GroupViewRoles
|
||||
{
|
||||
@@ -41,6 +42,11 @@ public:
|
||||
|
||||
void setModel(QAbstractItemModel *model) override;
|
||||
|
||||
using visibilityFunction = std::function<bool(const QString &)>;
|
||||
void setSourceOfGroupCollapseStatus(visibilityFunction f) {
|
||||
fVisibility = f;
|
||||
}
|
||||
|
||||
/// return geometry rectangle occupied by the specified model item
|
||||
QRect geometryRect(const QModelIndex &index) const;
|
||||
/// return visual rectangle occupied by the specified model item
|
||||
@@ -48,8 +54,7 @@ public:
|
||||
/// get the model index at the specified visual point
|
||||
virtual QModelIndex indexAt(const QPoint &point) const override;
|
||||
QString groupNameAt(const QPoint &point);
|
||||
void setSelection(const QRect &rect,
|
||||
const QItemSelectionModel::SelectionFlags commands) override;
|
||||
void setSelection(const QRect &rect, const QItemSelectionModel::SelectionFlags commands) override;
|
||||
|
||||
virtual int horizontalOffset() const override;
|
||||
virtual int verticalOffset() const override;
|
||||
@@ -80,6 +85,7 @@ protected slots:
|
||||
|
||||
signals:
|
||||
void droppedURLs(QList<QUrl> urls);
|
||||
void groupStateChanged(QString group, bool collapsed);
|
||||
|
||||
protected:
|
||||
virtual bool isIndexHidden(const QModelIndex &index) const override;
|
||||
@@ -103,6 +109,8 @@ private:
|
||||
friend struct VisualGroup;
|
||||
QList<VisualGroup *> m_groups;
|
||||
|
||||
visibilityFunction fVisibility;
|
||||
|
||||
// geometry
|
||||
int m_leftMargin = 5;
|
||||
int m_rightMargin = 5;
|
||||
|
||||
@@ -43,7 +43,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(multimc);
|
||||
Q_INIT_RESOURCE(backgrounds);
|
||||
Q_INIT_RESOURCE(assets);
|
||||
|
||||
Q_INIT_RESOURCE(pe_dark);
|
||||
Q_INIT_RESOURCE(pe_light);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
Package: multimc
|
||||
Version: 1.3-1
|
||||
Version: 1.4-1
|
||||
Architecture: all
|
||||
Maintainer: Petr Mrázek <peterix@gmail.com>
|
||||
Section: games
|
||||
Priority: optional
|
||||
Installed-Size: 75
|
||||
Depends: zenity, desktop-file-utils, qt5-default
|
||||
Depends: zenity, desktop-file-utils, qt5-default, wget
|
||||
Recommends: openjdk-8-jre
|
||||
Homepage: http://multimc.org
|
||||
Description: A local install wrapper for MultiMC
|
||||
|
||||
@@ -103,8 +103,7 @@ void AccountListPage::listChanged()
|
||||
|
||||
void AccountListPage::on_actionAdd_triggered()
|
||||
{
|
||||
addAccount(tr("Please enter your Mojang or Minecraft account username and password to add "
|
||||
"your account."));
|
||||
addAccount(tr("Please enter your Minecraft account email and password to add your account."));
|
||||
}
|
||||
|
||||
void AccountListPage::on_actionRemove_triggered()
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
@@ -33,9 +30,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="WideBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>RightToolBarArea</enum>
|
||||
</attribute>
|
||||
|
||||
@@ -83,6 +83,7 @@ MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCP
|
||||
MultiMCPage::~MultiMCPage()
|
||||
{
|
||||
delete ui;
|
||||
delete defaultFormat;
|
||||
}
|
||||
|
||||
bool MultiMCPage::apply()
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
/* Copyright 2015-2019 MultiMC Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "PackagesPage.h"
|
||||
#include "ui_PackagesPage.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "dialogs/ProgressDialog.h"
|
||||
#include "VersionProxyModel.h"
|
||||
|
||||
#include "meta/Index.h"
|
||||
#include "meta/VersionList.h"
|
||||
#include "meta/Version.h"
|
||||
#include "Env.h"
|
||||
#include "MultiMC.h"
|
||||
|
||||
using namespace Meta;
|
||||
|
||||
static QString formatRequires(const VersionPtr &version)
|
||||
{
|
||||
QStringList lines;
|
||||
auto & reqs = version->requires();
|
||||
auto iter = reqs.begin();
|
||||
while (iter != reqs.end())
|
||||
{
|
||||
auto &uid = iter->uid;
|
||||
auto &version = iter->equalsVersion;
|
||||
const QString readable = ENV.metadataIndex()->hasUid(uid) ? ENV.metadataIndex()->get(uid)->humanReadable() : uid;
|
||||
if(!version.isEmpty())
|
||||
{
|
||||
lines.append(QString("%1 (%2)").arg(readable, version));
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.append(QString("%1").arg(readable));
|
||||
}
|
||||
iter++;
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
PackagesPage::PackagesPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::PackagesPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->tabBar()->hide();
|
||||
|
||||
m_fileProxy = new QSortFilterProxyModel(this);
|
||||
m_fileProxy->setSortRole(Qt::DisplayRole);
|
||||
m_fileProxy->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
m_fileProxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
m_fileProxy->setFilterRole(Qt::DisplayRole);
|
||||
m_fileProxy->setFilterKeyColumn(0);
|
||||
m_fileProxy->sort(0);
|
||||
m_fileProxy->setSourceModel(ENV.metadataIndex().get());
|
||||
ui->indexView->setModel(m_fileProxy);
|
||||
|
||||
m_filterProxy = new QSortFilterProxyModel(this);
|
||||
m_filterProxy->setSortRole(VersionList::SortRole);
|
||||
m_filterProxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
m_filterProxy->setFilterRole(Qt::DisplayRole);
|
||||
m_filterProxy->setFilterKeyColumn(0);
|
||||
m_filterProxy->sort(0, Qt::DescendingOrder);
|
||||
ui->versionsView->setModel(m_filterProxy);
|
||||
|
||||
m_versionProxy = new VersionProxyModel(this);
|
||||
m_filterProxy->setSourceModel(m_versionProxy);
|
||||
|
||||
connect(ui->indexView->selectionModel(), &QItemSelectionModel::currentChanged, this, &PackagesPage::updateCurrentVersionList);
|
||||
connect(ui->versionsView->selectionModel(), &QItemSelectionModel::currentChanged, this, &PackagesPage::updateVersion);
|
||||
connect(m_filterProxy, &QSortFilterProxyModel::dataChanged, this, &PackagesPage::versionListDataChanged);
|
||||
|
||||
updateCurrentVersionList(QModelIndex());
|
||||
updateVersion();
|
||||
}
|
||||
|
||||
PackagesPage::~PackagesPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QIcon PackagesPage::icon() const
|
||||
{
|
||||
return MMC->getThemedIcon("packages");
|
||||
}
|
||||
|
||||
void PackagesPage::on_refreshIndexBtn_clicked()
|
||||
{
|
||||
ENV.metadataIndex()->load(Net::Mode::Online);
|
||||
}
|
||||
void PackagesPage::on_refreshFileBtn_clicked()
|
||||
{
|
||||
VersionListPtr list = ui->indexView->currentIndex().data(Index::ListPtrRole).value<VersionListPtr>();
|
||||
if (!list)
|
||||
{
|
||||
return;
|
||||
}
|
||||
list->load(Net::Mode::Online);
|
||||
}
|
||||
void PackagesPage::on_refreshVersionBtn_clicked()
|
||||
{
|
||||
VersionPtr version = ui->versionsView->currentIndex().data(VersionList::VersionPtrRole).value<VersionPtr>();
|
||||
if (!version)
|
||||
{
|
||||
return;
|
||||
}
|
||||
version->load(Net::Mode::Online);
|
||||
}
|
||||
|
||||
void PackagesPage::on_fileSearchEdit_textChanged(const QString &search)
|
||||
{
|
||||
if (search.isEmpty())
|
||||
{
|
||||
m_fileProxy->setFilterFixedString(QString());
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList parts = search.split(' ');
|
||||
std::transform(parts.begin(), parts.end(), parts.begin(), &QRegularExpression::escape);
|
||||
m_fileProxy->setFilterRegExp(".*" + parts.join(".*") + ".*");
|
||||
}
|
||||
}
|
||||
void PackagesPage::on_versionSearchEdit_textChanged(const QString &search)
|
||||
{
|
||||
if (search.isEmpty())
|
||||
{
|
||||
m_filterProxy->setFilterFixedString(QString());
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList parts = search.split(' ');
|
||||
std::transform(parts.begin(), parts.end(), parts.begin(), &QRegularExpression::escape);
|
||||
m_filterProxy->setFilterRegExp(".*" + parts.join(".*") + ".*");
|
||||
}
|
||||
}
|
||||
|
||||
void PackagesPage::updateCurrentVersionList(const QModelIndex &index)
|
||||
{
|
||||
if (index.isValid())
|
||||
{
|
||||
VersionListPtr list = index.data(Index::ListPtrRole).value<VersionListPtr>();
|
||||
ui->versionsBox->setEnabled(true);
|
||||
ui->refreshFileBtn->setEnabled(true);
|
||||
ui->fileUidLabel->setEnabled(true);
|
||||
ui->fileUid->setText(list->uid());
|
||||
ui->fileNameLabel->setEnabled(true);
|
||||
ui->fileName->setText(list->name());
|
||||
m_versionProxy->setSourceModel(list.get());
|
||||
ui->refreshFileBtn->setText(tr("Refresh %1").arg(list->humanReadable()));
|
||||
list->load(Net::Mode::Offline);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->versionsBox->setEnabled(false);
|
||||
ui->refreshFileBtn->setEnabled(false);
|
||||
ui->fileUidLabel->setEnabled(false);
|
||||
ui->fileUid->clear();
|
||||
ui->fileNameLabel->setEnabled(false);
|
||||
ui->fileName->clear();
|
||||
m_versionProxy->setSourceModel(nullptr);
|
||||
ui->refreshFileBtn->setText(tr("Refresh"));
|
||||
}
|
||||
}
|
||||
|
||||
void PackagesPage::versionListDataChanged(const QModelIndex &tl, const QModelIndex &br)
|
||||
{
|
||||
if (QItemSelection(tl, br).contains(ui->versionsView->currentIndex()))
|
||||
{
|
||||
updateVersion();
|
||||
}
|
||||
}
|
||||
|
||||
void PackagesPage::updateVersion()
|
||||
{
|
||||
VersionPtr version = std::dynamic_pointer_cast<Version>(
|
||||
ui->versionsView->currentIndex().data(VersionList::VersionPointerRole).value<BaseVersionPtr>());
|
||||
if (version)
|
||||
{
|
||||
ui->refreshVersionBtn->setEnabled(true);
|
||||
ui->versionVersionLabel->setEnabled(true);
|
||||
ui->versionVersion->setText(version->version());
|
||||
ui->versionTimeLabel->setEnabled(true);
|
||||
ui->versionTime->setText(version->time().toString("yyyy-MM-dd HH:mm"));
|
||||
ui->versionTypeLabel->setEnabled(true);
|
||||
ui->versionType->setText(version->type());
|
||||
ui->versionRequiresLabel->setEnabled(true);
|
||||
ui->versionRequires->setText(formatRequires(version));
|
||||
ui->refreshVersionBtn->setText(tr("Refresh %1").arg(version->version()));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->refreshVersionBtn->setEnabled(false);
|
||||
ui->versionVersionLabel->setEnabled(false);
|
||||
ui->versionVersion->clear();
|
||||
ui->versionTimeLabel->setEnabled(false);
|
||||
ui->versionTime->clear();
|
||||
ui->versionTypeLabel->setEnabled(false);
|
||||
ui->versionType->clear();
|
||||
ui->versionRequiresLabel->setEnabled(false);
|
||||
ui->versionRequires->clear();
|
||||
ui->refreshVersionBtn->setText(tr("Refresh"));
|
||||
}
|
||||
}
|
||||
|
||||
void PackagesPage::openedImpl()
|
||||
{
|
||||
ENV.metadataIndex()->load(Net::Mode::Offline);
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/* Copyright 2015-2019 MultiMC Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "pages/BasePage.h"
|
||||
|
||||
namespace Ui {
|
||||
class PackagesPage;
|
||||
}
|
||||
|
||||
class QSortFilterProxyModel;
|
||||
class VersionProxyModel;
|
||||
|
||||
class PackagesPage : public QWidget, public BasePage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PackagesPage(QWidget *parent = 0);
|
||||
~PackagesPage();
|
||||
|
||||
QString id() const override { return "packages-global"; }
|
||||
QString displayName() const override { return tr("Packages"); }
|
||||
QIcon icon() const override;
|
||||
void openedImpl() override;
|
||||
|
||||
private slots:
|
||||
void on_refreshIndexBtn_clicked();
|
||||
void on_refreshFileBtn_clicked();
|
||||
void on_refreshVersionBtn_clicked();
|
||||
void on_fileSearchEdit_textChanged(const QString &search);
|
||||
void on_versionSearchEdit_textChanged(const QString &search);
|
||||
void updateCurrentVersionList(const QModelIndex &index);
|
||||
void versionListDataChanged(const QModelIndex &tl, const QModelIndex &br);
|
||||
|
||||
private:
|
||||
Ui::PackagesPage *ui;
|
||||
QSortFilterProxyModel *m_fileProxy;
|
||||
QSortFilterProxyModel *m_filterProxy;
|
||||
VersionProxyModel *m_versionProxy;
|
||||
|
||||
void updateVersion();
|
||||
};
|
||||
@@ -1,252 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PackagesPage</class>
|
||||
<widget class="QWidget" name="PackagesPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>636</width>
|
||||
<height>621</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="2">
|
||||
<widget class="QGroupBox" name="versionsBox">
|
||||
<property name="title">
|
||||
<string>Versions</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="versionSearchEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Search...</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeView" name="versionsView">
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshVersionBtn">
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="versionVersionLabel">
|
||||
<property name="text">
|
||||
<string>Version:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="versionVersion">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="versionTimeLabel">
|
||||
<property name="text">
|
||||
<string>Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="versionTime">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="versionTypeLabel">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="versionType">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="versionRequiresLabel">
|
||||
<property name="text">
|
||||
<string>Dependencies:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="versionRequires">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGroupBox" name="versionListsBox">
|
||||
<property name="title">
|
||||
<string>Resources</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="fileSearchEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Search...</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeView" name="indexView">
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshFileBtn">
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="fileUidLabel">
|
||||
<property name="text">
|
||||
<string>UID:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="fileUid">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="fileNameLabel">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="fileName">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QPushButton" name="refreshIndexBtn">
|
||||
<property name="text">
|
||||
<string>Refresh Index</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -51,6 +51,26 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const override {
|
||||
ModFolderModel *model = qobject_cast<ModFolderModel *>(sourceModel());
|
||||
if(!model) {
|
||||
return false;
|
||||
}
|
||||
const auto &mod = model->at(source_row);
|
||||
if(mod.name().contains(filterRegExp())) {
|
||||
return true;
|
||||
}
|
||||
if(mod.description().contains(filterRegExp())) {
|
||||
return true;
|
||||
}
|
||||
for(auto & author: mod.authors()) {
|
||||
if (author.contains(filterRegExp())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool lessThan(const QModelIndex & source_left, const QModelIndex & source_right) const override
|
||||
{
|
||||
ModFolderModel *model = qobject_cast<ModFolderModel *>(sourceModel());
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>501</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
@@ -41,7 +38,7 @@
|
||||
</widget>
|
||||
<widget class="WideBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextOnly</enum>
|
||||
|
||||
@@ -597,6 +597,7 @@ ServersPage::ServersPage(MinecraftInstance * inst, QWidget* parent)
|
||||
ServersPage::~ServersPage()
|
||||
{
|
||||
m_model->saveNow();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ServersPage::ShowContextMenu(const QPoint& pos)
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>879</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
@@ -130,7 +127,7 @@
|
||||
</widget>
|
||||
<widget class="WideBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::LeftToolBarArea|Qt::RightToolBarArea</set>
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "icons/IconList.h"
|
||||
#include "Exception.h"
|
||||
#include "Version.h"
|
||||
#include "DesktopServices.h"
|
||||
|
||||
#include <meta/Index.h>
|
||||
#include <meta/VersionList.h>
|
||||
@@ -379,7 +380,7 @@ void VersionPage::on_actionChange_version_triggered()
|
||||
m_container->refreshContainer();
|
||||
}
|
||||
|
||||
void VersionPage::on_actionDownload_triggered()
|
||||
void VersionPage::on_actionDownload_All_triggered()
|
||||
{
|
||||
if (!MMC->accounts()->anyAccountIsValid())
|
||||
{
|
||||
@@ -507,6 +508,16 @@ void VersionPage::on_actionInstall_LiteLoader_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
void VersionPage::on_actionLibrariesFolder_triggered()
|
||||
{
|
||||
DesktopServices::openDirectory(m_inst->getLocalLibraryPath(), true);
|
||||
}
|
||||
|
||||
void VersionPage::on_actionMinecraftFolder_triggered()
|
||||
{
|
||||
DesktopServices::openDirectory(m_inst->gameRoot(), true);
|
||||
}
|
||||
|
||||
void VersionPage::versionCurrent(const QModelIndex ¤t, const QModelIndex &previous)
|
||||
{
|
||||
currentIdx = current.row();
|
||||
|
||||
@@ -64,7 +64,10 @@ private slots:
|
||||
void on_actionEdit_triggered();
|
||||
void on_actionInstall_mods_triggered();
|
||||
void on_actionCustomize_triggered();
|
||||
void on_actionDownload_triggered();
|
||||
void on_actionDownload_All_triggered();
|
||||
|
||||
void on_actionMinecraftFolder_triggered();
|
||||
void on_actionLibrariesFolder_triggered();
|
||||
|
||||
void updateVersionControls();
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>1091</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
@@ -64,7 +61,7 @@
|
||||
</widget>
|
||||
<widget class="WideBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::LeftToolBarArea|Qt::RightToolBarArea</set>
|
||||
@@ -98,6 +95,10 @@
|
||||
<addaction name="actionAdd_to_Minecraft_jar"/>
|
||||
<addaction name="actionReplace_Minecraft_jar"/>
|
||||
<addaction name="actionAdd_Empty"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMinecraftFolder"/>
|
||||
<addaction name="actionLibrariesFolder"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionReload"/>
|
||||
<addaction name="actionDownload_All"/>
|
||||
</widget>
|
||||
@@ -226,6 +227,22 @@
|
||||
<string>Download the files needed to launch the instance now.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMinecraftFolder">
|
||||
<property name="text">
|
||||
<string>Open .minecraft</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the instance's .minecraft folder.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionLibrariesFolder">
|
||||
<property name="text">
|
||||
<string>Open libraries</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the instance's local libraries folder.</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
@@ -59,7 +56,7 @@
|
||||
</widget>
|
||||
<widget class="WideBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::LeftToolBarArea|Qt::RightToolBarArea</set>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#include "TechnicPage.h"
|
||||
#include "ui_TechnicPage.h"
|
||||
|
||||
#include "MultiMC.h"
|
||||
#include "dialogs/NewInstanceDialog.h"
|
||||
|
||||
TechnicPage::TechnicPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::TechnicPage), dialog(dialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
TechnicPage::~TechnicPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool TechnicPage::shouldDisplay() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void TechnicPage::openedImpl()
|
||||
{
|
||||
dialog->setSuggestedPack();
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/* Copyright 2013-2019 MultiMC Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
#include "tasks/Task.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class TechnicPage;
|
||||
}
|
||||
|
||||
class NewInstanceDialog;
|
||||
|
||||
class TechnicPage : public QWidget, public BasePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TechnicPage(NewInstanceDialog* dialog, QWidget *parent = 0);
|
||||
virtual ~TechnicPage();
|
||||
virtual QString displayName() const override
|
||||
{
|
||||
return tr("Technic");
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return MMC->getThemedIcon("technic");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
return "technic";
|
||||
}
|
||||
virtual QString helpPage() const override
|
||||
{
|
||||
return "Technic-platform";
|
||||
}
|
||||
virtual bool shouldDisplay() const override;
|
||||
|
||||
void openedImpl() override;
|
||||
|
||||
private:
|
||||
Ui::TechnicPage *ui = nullptr;
|
||||
NewInstanceDialog* dialog = nullptr;
|
||||
};
|
||||
@@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TechnicPage</class>
|
||||
<widget class="QWidget" name="TechnicPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>546</width>
|
||||
<height>405</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>40</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:#ffc000</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">UNDER</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../resources/assets/assets.qrc">:/assets/underconstruction</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>40</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:#7ca32b</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">CONSTRUCTION</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../resources/assets/assets.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,60 +0,0 @@
|
||||
#include "TwitchPage.h"
|
||||
#include "ui_TwitchPage.h"
|
||||
|
||||
#include "MultiMC.h"
|
||||
#include "dialogs/NewInstanceDialog.h"
|
||||
#include <InstanceImportTask.h>
|
||||
|
||||
TwitchPage::TwitchPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::TwitchPage), dialog(dialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->checkButton, &QPushButton::clicked, this, &TwitchPage::triggerCheck);
|
||||
}
|
||||
|
||||
TwitchPage::~TwitchPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool TwitchPage::shouldDisplay() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void TwitchPage::openedImpl()
|
||||
{
|
||||
dialog->setSuggestedPack();
|
||||
}
|
||||
|
||||
void TwitchPage::triggerCheck(bool)
|
||||
{
|
||||
if(m_modIdResolver) {
|
||||
return;
|
||||
}
|
||||
auto task = new Flame::UrlResolvingTask(ui->lineEdit->text());
|
||||
connect(task, &Task::finished, this, &TwitchPage::checkDone);
|
||||
m_modIdResolver.reset(task);
|
||||
task->start();
|
||||
}
|
||||
|
||||
void TwitchPage::setUrl(const QString& url)
|
||||
{
|
||||
ui->lineEdit->setText(url);
|
||||
triggerCheck(true);
|
||||
}
|
||||
|
||||
void TwitchPage::checkDone()
|
||||
{
|
||||
auto result = m_modIdResolver->getResults();
|
||||
auto formatted = QString("Project %1, File %2").arg(result.projectId).arg(result.fileId);
|
||||
if(result.resolved && result.type == Flame::File::Type::Modpack) {
|
||||
ui->twitchLabel->setText(formatted);
|
||||
QFileInfo fi(result.fileName);
|
||||
dialog->setSuggestedPack(fi.completeBaseName(), new InstanceImportTask(result.url));
|
||||
} else {
|
||||
ui->twitchLabel->setPixmap(QPixmap(QString::fromUtf8(":/assets/deadglitch")));
|
||||
dialog->setSuggestedPack();
|
||||
}
|
||||
m_modIdResolver.reset();
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/* Copyright 2013-2019 MultiMC Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
#include "tasks/Task.h"
|
||||
#include "modplatform/flame/UrlResolvingTask.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class TwitchPage;
|
||||
}
|
||||
|
||||
class NewInstanceDialog;
|
||||
|
||||
class TwitchPage : public QWidget, public BasePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TwitchPage(NewInstanceDialog* dialog, QWidget *parent = 0);
|
||||
virtual ~TwitchPage();
|
||||
virtual QString displayName() const override
|
||||
{
|
||||
return tr("Twitch URL");
|
||||
}
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
return MMC->getThemedIcon("twitch");
|
||||
}
|
||||
virtual QString id() const override
|
||||
{
|
||||
return "twitch";
|
||||
}
|
||||
virtual QString helpPage() const override
|
||||
{
|
||||
return "Twitch-platform";
|
||||
}
|
||||
virtual bool shouldDisplay() const override;
|
||||
|
||||
void openedImpl() override;
|
||||
|
||||
void setUrl(const QString & url);
|
||||
|
||||
private slots:
|
||||
void triggerCheck(bool checked);
|
||||
void checkDone();
|
||||
|
||||
private:
|
||||
Ui::TwitchPage *ui = nullptr;
|
||||
NewInstanceDialog* dialog = nullptr;
|
||||
shared_qobject_ptr<Flame::UrlResolvingTask> m_modIdResolver;
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TwitchPage</class>
|
||||
<widget class="QWidget" name="TwitchPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>546</width>
|
||||
<height>405</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">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>40</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../resources/assets/assets.qrc">:/assets/deadglitch</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="checkButton">
|
||||
<property name="text">
|
||||
<string>Check</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>lineEdit</tabstop>
|
||||
<tabstop>checkButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../resources/assets/assets.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "FtbListModel.h"
|
||||
#include "ListModel.h"
|
||||
#include "MultiMC.h"
|
||||
|
||||
#include <MMCStrings.h>
|
||||
@@ -12,17 +12,19 @@
|
||||
|
||||
#include "net/URLConstants.h"
|
||||
|
||||
FtbFilterModel::FtbFilterModel(QObject *parent) : QSortFilterProxyModel(parent)
|
||||
namespace LegacyFTB {
|
||||
|
||||
FilterModel::FilterModel(QObject *parent) : QSortFilterProxyModel(parent)
|
||||
{
|
||||
currentSorting = Sorting::ByGameVersion;
|
||||
sortings.insert(tr("Sort by name"), Sorting::ByName);
|
||||
sortings.insert(tr("Sort by game version"), Sorting::ByGameVersion);
|
||||
}
|
||||
|
||||
bool FtbFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
bool FilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
{
|
||||
FtbModpack leftPack = sourceModel()->data(left, Qt::UserRole).value<FtbModpack>();
|
||||
FtbModpack rightPack = sourceModel()->data(right, Qt::UserRole).value<FtbModpack>();
|
||||
Modpack leftPack = sourceModel()->data(left, Qt::UserRole).value<Modpack>();
|
||||
Modpack rightPack = sourceModel()->data(right, Qt::UserRole).value<Modpack>();
|
||||
|
||||
if(currentSorting == Sorting::ByGameVersion) {
|
||||
Version lv(leftPack.mcVersion);
|
||||
@@ -38,66 +40,66 @@ bool FtbFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FtbFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
bool FilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const QMap<QString, FtbFilterModel::Sorting> FtbFilterModel::getAvailableSortings()
|
||||
const QMap<QString, FilterModel::Sorting> FilterModel::getAvailableSortings()
|
||||
{
|
||||
return sortings;
|
||||
}
|
||||
|
||||
QString FtbFilterModel::translateCurrentSorting()
|
||||
QString FilterModel::translateCurrentSorting()
|
||||
{
|
||||
return sortings.key(currentSorting);
|
||||
}
|
||||
|
||||
void FtbFilterModel::setSorting(Sorting s)
|
||||
void FilterModel::setSorting(Sorting s)
|
||||
{
|
||||
currentSorting = s;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
FtbFilterModel::Sorting FtbFilterModel::getCurrentSorting()
|
||||
FilterModel::Sorting FilterModel::getCurrentSorting()
|
||||
{
|
||||
return currentSorting;
|
||||
}
|
||||
|
||||
FtbListModel::FtbListModel(QObject *parent) : QAbstractListModel(parent)
|
||||
ListModel::ListModel(QObject *parent) : QAbstractListModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
FtbListModel::~FtbListModel()
|
||||
ListModel::~ListModel()
|
||||
{
|
||||
}
|
||||
|
||||
QString FtbListModel::translatePackType(FtbPackType type) const
|
||||
QString ListModel::translatePackType(PackType type) const
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case FtbPackType::Public:
|
||||
case PackType::Public:
|
||||
return tr("Public Modpack");
|
||||
case FtbPackType::ThirdParty:
|
||||
case PackType::ThirdParty:
|
||||
return tr("Third Party Modpack");
|
||||
case FtbPackType::Private:
|
||||
case PackType::Private:
|
||||
return tr("Private Modpack");
|
||||
}
|
||||
qWarning() << "Unknown FTB modpack type:" << int(type);
|
||||
return QString();
|
||||
}
|
||||
|
||||
int FtbListModel::rowCount(const QModelIndex &parent) const
|
||||
int ListModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return modpacks.size();
|
||||
}
|
||||
|
||||
int FtbListModel::columnCount(const QModelIndex &parent) const
|
||||
int ListModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
QVariant FtbListModel::data(const QModelIndex &index, int role) const
|
||||
QVariant ListModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
int pos = index.row();
|
||||
if(pos >= modpacks.size() || pos < 0 || !index.isValid())
|
||||
@@ -105,7 +107,7 @@ QVariant FtbListModel::data(const QModelIndex &index, int role) const
|
||||
return QString("INVALID INDEX %1").arg(pos);
|
||||
}
|
||||
|
||||
FtbModpack pack = modpacks.at(pos);
|
||||
Modpack pack = modpacks.at(pos);
|
||||
if(role == Qt::DisplayRole)
|
||||
{
|
||||
return pack.name + "\n" + translatePackType(pack.type);
|
||||
@@ -129,7 +131,7 @@ QVariant FtbListModel::data(const QModelIndex &index, int role) const
|
||||
return (m_logoMap.value(pack.logo));
|
||||
}
|
||||
QIcon icon = MMC->getThemedIcon("screenshot-placeholder");
|
||||
((FtbListModel *)this)->requestLogo(pack.logo);
|
||||
((ListModel *)this)->requestLogo(pack.logo);
|
||||
return icon;
|
||||
}
|
||||
else if(role == Qt::TextColorRole)
|
||||
@@ -156,33 +158,33 @@ QVariant FtbListModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void FtbListModel::fill(FtbModpackList modpacks)
|
||||
void ListModel::fill(ModpackList modpacks)
|
||||
{
|
||||
beginResetModel();
|
||||
this->modpacks = modpacks;
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void FtbListModel::addPack(FtbModpack modpack)
|
||||
void ListModel::addPack(Modpack modpack)
|
||||
{
|
||||
beginResetModel();
|
||||
this->modpacks.append(modpack);
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void FtbListModel::clear()
|
||||
void ListModel::clear()
|
||||
{
|
||||
beginResetModel();
|
||||
modpacks.clear();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
FtbModpack FtbListModel::at(int row)
|
||||
Modpack ListModel::at(int row)
|
||||
{
|
||||
return modpacks.at(row);
|
||||
}
|
||||
|
||||
void FtbListModel::remove(int row)
|
||||
void ListModel::remove(int row)
|
||||
{
|
||||
if(row < 0 || row >= modpacks.size())
|
||||
{
|
||||
@@ -194,20 +196,20 @@ void FtbListModel::remove(int row)
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
void FtbListModel::logoLoaded(QString logo, QIcon out)
|
||||
void ListModel::logoLoaded(QString logo, QIcon out)
|
||||
{
|
||||
m_loadingLogos.removeAll(logo);
|
||||
m_logoMap.insert(logo, out);
|
||||
emit dataChanged(createIndex(0, 0), createIndex(1, 0));
|
||||
}
|
||||
|
||||
void FtbListModel::logoFailed(QString logo)
|
||||
void ListModel::logoFailed(QString logo)
|
||||
{
|
||||
m_failedLogos.append(logo);
|
||||
m_loadingLogos.removeAll(logo);
|
||||
}
|
||||
|
||||
void FtbListModel::requestLogo(QString file)
|
||||
void ListModel::requestLogo(QString file)
|
||||
{
|
||||
if(m_loadingLogos.contains(file) || m_failedLogos.contains(file))
|
||||
{
|
||||
@@ -216,7 +218,7 @@ void FtbListModel::requestLogo(QString file)
|
||||
|
||||
MetaEntryPtr entry = ENV.metacache()->resolveEntry("FTBPacks", QString("logos/%1").arg(file.section(".", 0, 0)));
|
||||
NetJob *job = new NetJob(QString("FTB Icon Download for %1").arg(file));
|
||||
job->addNetAction(Net::Download::makeCached(QUrl(QString(URLConstants::FTB_CDN_BASE_URL + "static/%1").arg(file)), entry));
|
||||
job->addNetAction(Net::Download::makeCached(QUrl(QString(URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/%1").arg(file)), entry));
|
||||
|
||||
auto fullPath = entry->getFullPath();
|
||||
QObject::connect(job, &NetJob::finished, this, [this, file, fullPath]
|
||||
@@ -238,7 +240,7 @@ void FtbListModel::requestLogo(QString file)
|
||||
m_loadingLogos.append(file);
|
||||
}
|
||||
|
||||
void FtbListModel::getLogo(const QString &logo, LogoCallback callback)
|
||||
void ListModel::getLogo(const QString &logo, LogoCallback callback)
|
||||
{
|
||||
if(m_logoMap.contains(logo))
|
||||
{
|
||||
@@ -250,7 +252,9 @@ void FtbListModel::getLogo(const QString &logo, LogoCallback callback)
|
||||
}
|
||||
}
|
||||
|
||||
Qt::ItemFlags FtbListModel::flags(const QModelIndex &index) const
|
||||
Qt::ItemFlags ListModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
return QAbstractListModel::flags(index);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <modplatform/ftb/PackHelpers.h>
|
||||
#include <modplatform/legacy_ftb/PackHelpers.h>
|
||||
#include <RWStorage.h>
|
||||
|
||||
#include <QAbstractListModel>
|
||||
@@ -11,14 +11,16 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
typedef QMap<QString, QIcon> FtbLogoMap;
|
||||
namespace LegacyFTB {
|
||||
|
||||
typedef QMap<QString, QIcon> FTBLogoMap;
|
||||
typedef std::function<void(QString)> LogoCallback;
|
||||
|
||||
class FtbFilterModel : public QSortFilterProxyModel
|
||||
class FilterModel : public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FtbFilterModel(QObject* parent = Q_NULLPTR);
|
||||
FilterModel(QObject* parent = Q_NULLPTR);
|
||||
enum Sorting {
|
||||
ByName,
|
||||
ByGameVersion
|
||||
@@ -38,18 +40,18 @@ private:
|
||||
|
||||
};
|
||||
|
||||
class FtbListModel : public QAbstractListModel
|
||||
class ListModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
FtbModpackList modpacks;
|
||||
ModpackList modpacks;
|
||||
QStringList m_failedLogos;
|
||||
QStringList m_loadingLogos;
|
||||
FtbLogoMap m_logoMap;
|
||||
FTBLogoMap m_logoMap;
|
||||
QMap<QString, LogoCallback> waitingCallbacks;
|
||||
|
||||
void requestLogo(QString file);
|
||||
QString translatePackType(FtbPackType type) const;
|
||||
QString translatePackType(PackType type) const;
|
||||
|
||||
|
||||
private slots:
|
||||
@@ -57,18 +59,20 @@ private slots:
|
||||
void logoLoaded(QString logo, QIcon out);
|
||||
|
||||
public:
|
||||
FtbListModel(QObject *parent);
|
||||
~FtbListModel();
|
||||
ListModel(QObject *parent);
|
||||
~ListModel();
|
||||
int rowCount(const QModelIndex &parent) const override;
|
||||
int columnCount(const QModelIndex &parent) const override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
||||
void fill(FtbModpackList modpacks);
|
||||
void addPack(FtbModpack modpack);
|
||||
void fill(ModpackList modpacks);
|
||||
void addPack(Modpack modpack);
|
||||
void clear();
|
||||
void remove(int row);
|
||||
|
||||
FtbModpack at(int row);
|
||||
Modpack at(int row);
|
||||
void getLogo(const QString &logo, LogoCallback callback);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,27 +1,29 @@
|
||||
#include "FTBPage.h"
|
||||
#include "ui_FTBPage.h"
|
||||
#include "Page.h"
|
||||
#include "ui_Page.h"
|
||||
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "MultiMC.h"
|
||||
#include "dialogs/CustomMessageBox.h"
|
||||
#include "dialogs/NewInstanceDialog.h"
|
||||
#include "modplatform/ftb/FtbPackFetchTask.h"
|
||||
#include "modplatform/ftb/FtbPackInstallTask.h"
|
||||
#include "modplatform/ftb/FtbPrivatePackManager.h"
|
||||
#include "FtbListModel.h"
|
||||
#include "modplatform/legacy_ftb/PackFetchTask.h"
|
||||
#include "modplatform/legacy_ftb/PackInstallTask.h"
|
||||
#include "modplatform/legacy_ftb/PrivatePackManager.h"
|
||||
#include "ListModel.h"
|
||||
|
||||
FTBPage::FTBPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||
: QWidget(parent), dialog(dialog), ui(new Ui::FTBPage)
|
||||
namespace LegacyFTB {
|
||||
|
||||
Page::Page(NewInstanceDialog* dialog, QWidget *parent)
|
||||
: QWidget(parent), dialog(dialog), ui(new Ui::Page)
|
||||
{
|
||||
ftbFetchTask.reset(new FtbPackFetchTask());
|
||||
ftbPrivatePacks.reset(new FtbPrivatePackManager());
|
||||
ftbFetchTask.reset(new PackFetchTask());
|
||||
ftbPrivatePacks.reset(new PrivatePackManager());
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
{
|
||||
publicFilterModel = new FtbFilterModel(this);
|
||||
publicListModel = new FtbListModel(this);
|
||||
publicFilterModel = new FilterModel(this);
|
||||
publicListModel = new ListModel(this);
|
||||
publicFilterModel->setSourceModel(publicListModel);
|
||||
|
||||
ui->publicPackList->setModel(publicFilterModel);
|
||||
@@ -39,8 +41,8 @@ FTBPage::FTBPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||
}
|
||||
|
||||
{
|
||||
thirdPartyFilterModel = new FtbFilterModel(this);
|
||||
thirdPartyModel = new FtbListModel(this);
|
||||
thirdPartyFilterModel = new FilterModel(this);
|
||||
thirdPartyModel = new ListModel(this);
|
||||
thirdPartyFilterModel->setSourceModel(thirdPartyModel);
|
||||
|
||||
ui->thirdPartyPackList->setModel(thirdPartyFilterModel);
|
||||
@@ -53,8 +55,8 @@ FTBPage::FTBPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||
}
|
||||
|
||||
{
|
||||
privateFilterModel = new FtbFilterModel(this);
|
||||
privateListModel = new FtbListModel(this);
|
||||
privateFilterModel = new FilterModel(this);
|
||||
privateListModel = new ListModel(this);
|
||||
privateFilterModel->setSourceModel(privateListModel);
|
||||
|
||||
ui->privatePackList->setModel(privateFilterModel);
|
||||
@@ -69,17 +71,17 @@ FTBPage::FTBPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||
ui->versionSelectionBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
ui->versionSelectionBox->view()->parentWidget()->setMaximumHeight(300);
|
||||
|
||||
connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &FTBPage::onSortingSelectionChanged);
|
||||
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &FTBPage::onVersionSelectionItemChanged);
|
||||
connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &Page::onSortingSelectionChanged);
|
||||
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &Page::onVersionSelectionItemChanged);
|
||||
|
||||
connect(ui->publicPackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &FTBPage::onPublicPackSelectionChanged);
|
||||
connect(ui->thirdPartyPackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &FTBPage::onThirdPartyPackSelectionChanged);
|
||||
connect(ui->privatePackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &FTBPage::onPrivatePackSelectionChanged);
|
||||
connect(ui->publicPackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &Page::onPublicPackSelectionChanged);
|
||||
connect(ui->thirdPartyPackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &Page::onThirdPartyPackSelectionChanged);
|
||||
connect(ui->privatePackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &Page::onPrivatePackSelectionChanged);
|
||||
|
||||
connect(ui->addPackBtn, &QPushButton::pressed, this, &FTBPage::onAddPackClicked);
|
||||
connect(ui->removePackBtn, &QPushButton::pressed, this, &FTBPage::onRemovePackClicked);
|
||||
connect(ui->addPackBtn, &QPushButton::pressed, this, &Page::onAddPackClicked);
|
||||
connect(ui->removePackBtn, &QPushButton::pressed, this, &Page::onRemovePackClicked);
|
||||
|
||||
connect(ui->tabWidget, &QTabWidget::currentChanged, this, &FTBPage::onTabChanged);
|
||||
connect(ui->tabWidget, &QTabWidget::currentChanged, this, &Page::onTabChanged);
|
||||
|
||||
// ui->modpackInfo->setOpenExternalLinks(true);
|
||||
|
||||
@@ -90,25 +92,25 @@ FTBPage::FTBPage(NewInstanceDialog* dialog, QWidget *parent)
|
||||
onTabChanged(ui->tabWidget->currentIndex());
|
||||
}
|
||||
|
||||
FTBPage::~FTBPage()
|
||||
Page::~Page()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool FTBPage::shouldDisplay() const
|
||||
bool Page::shouldDisplay() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void FTBPage::openedImpl()
|
||||
void Page::openedImpl()
|
||||
{
|
||||
if(!initialized)
|
||||
{
|
||||
connect(ftbFetchTask.get(), &FtbPackFetchTask::finished, this, &FTBPage::ftbPackDataDownloadSuccessfully);
|
||||
connect(ftbFetchTask.get(), &FtbPackFetchTask::failed, this, &FTBPage::ftbPackDataDownloadFailed);
|
||||
connect(ftbFetchTask.get(), &PackFetchTask::finished, this, &Page::ftbPackDataDownloadSuccessfully);
|
||||
connect(ftbFetchTask.get(), &PackFetchTask::failed, this, &Page::ftbPackDataDownloadFailed);
|
||||
|
||||
connect(ftbFetchTask.get(), &FtbPackFetchTask::privateFileDownloadFinished, this, &FTBPage::ftbPrivatePackDataDownloadSuccessfully);
|
||||
connect(ftbFetchTask.get(), &FtbPackFetchTask::privateFileDownloadFailed, this, &FTBPage::ftbPrivatePackDataDownloadFailed);
|
||||
connect(ftbFetchTask.get(), &PackFetchTask::privateFileDownloadFinished, this, &Page::ftbPrivatePackDataDownloadSuccessfully);
|
||||
connect(ftbFetchTask.get(), &PackFetchTask::privateFileDownloadFailed, this, &Page::ftbPrivatePackDataDownloadFailed);
|
||||
|
||||
ftbFetchTask->fetch();
|
||||
ftbPrivatePacks->load();
|
||||
@@ -118,13 +120,13 @@ void FTBPage::openedImpl()
|
||||
suggestCurrent();
|
||||
}
|
||||
|
||||
void FTBPage::suggestCurrent()
|
||||
void Page::suggestCurrent()
|
||||
{
|
||||
if(isOpened)
|
||||
{
|
||||
if(!selected.broken)
|
||||
{
|
||||
dialog->setSuggestedPack(selected.name, new FtbPackInstallTask(selected, selectedVersion));
|
||||
dialog->setSuggestedPack(selected.name, new PackInstallTask(selected, selectedVersion));
|
||||
QString editedLogoName;
|
||||
if(selected.logo.toLower().startsWith("ftb"))
|
||||
{
|
||||
@@ -137,21 +139,21 @@ void FTBPage::suggestCurrent()
|
||||
|
||||
editedLogoName = editedLogoName.left(editedLogoName.lastIndexOf(".png"));
|
||||
|
||||
if(selected.type == FtbPackType::Public)
|
||||
if(selected.type == PackType::Public)
|
||||
{
|
||||
publicListModel->getLogo(selected.logo, [this, editedLogoName](QString logo)
|
||||
{
|
||||
dialog->setSuggestedIconFromFile(logo, editedLogoName);
|
||||
});
|
||||
}
|
||||
else if (selected.type == FtbPackType::ThirdParty)
|
||||
else if (selected.type == PackType::ThirdParty)
|
||||
{
|
||||
thirdPartyModel->getLogo(selected.logo, [this, editedLogoName](QString logo)
|
||||
{
|
||||
dialog->setSuggestedIconFromFile(logo, editedLogoName);
|
||||
});
|
||||
}
|
||||
else if (selected.type == FtbPackType::Private)
|
||||
else if (selected.type == PackType::Private)
|
||||
{
|
||||
privateListModel->getLogo(selected.logo, [this, editedLogoName](QString logo)
|
||||
{
|
||||
@@ -166,23 +168,23 @@ void FTBPage::suggestCurrent()
|
||||
}
|
||||
}
|
||||
|
||||
void FTBPage::ftbPackDataDownloadSuccessfully(FtbModpackList publicPacks, FtbModpackList thirdPartyPacks)
|
||||
void Page::ftbPackDataDownloadSuccessfully(ModpackList publicPacks, ModpackList thirdPartyPacks)
|
||||
{
|
||||
publicListModel->fill(publicPacks);
|
||||
thirdPartyModel->fill(thirdPartyPacks);
|
||||
}
|
||||
|
||||
void FTBPage::ftbPackDataDownloadFailed(QString reason)
|
||||
void Page::ftbPackDataDownloadFailed(QString reason)
|
||||
{
|
||||
//TODO: Display the error
|
||||
}
|
||||
|
||||
void FTBPage::ftbPrivatePackDataDownloadSuccessfully(FtbModpack pack)
|
||||
void Page::ftbPrivatePackDataDownloadSuccessfully(Modpack pack)
|
||||
{
|
||||
privateListModel->addPack(pack);
|
||||
}
|
||||
|
||||
void FTBPage::ftbPrivatePackDataDownloadFailed(QString reason, QString packCode)
|
||||
void Page::ftbPrivatePackDataDownloadFailed(QString reason, QString packCode)
|
||||
{
|
||||
auto reply = QMessageBox::question(
|
||||
this,
|
||||
@@ -195,40 +197,40 @@ void FTBPage::ftbPrivatePackDataDownloadFailed(QString reason, QString packCode)
|
||||
}
|
||||
}
|
||||
|
||||
void FTBPage::onPublicPackSelectionChanged(QModelIndex now, QModelIndex prev)
|
||||
void Page::onPublicPackSelectionChanged(QModelIndex now, QModelIndex prev)
|
||||
{
|
||||
if(!now.isValid())
|
||||
{
|
||||
onPackSelectionChanged();
|
||||
return;
|
||||
}
|
||||
FtbModpack selectedPack = publicFilterModel->data(now, Qt::UserRole).value<FtbModpack>();
|
||||
Modpack selectedPack = publicFilterModel->data(now, Qt::UserRole).value<Modpack>();
|
||||
onPackSelectionChanged(&selectedPack);
|
||||
}
|
||||
|
||||
void FTBPage::onThirdPartyPackSelectionChanged(QModelIndex now, QModelIndex prev)
|
||||
void Page::onThirdPartyPackSelectionChanged(QModelIndex now, QModelIndex prev)
|
||||
{
|
||||
if(!now.isValid())
|
||||
{
|
||||
onPackSelectionChanged();
|
||||
return;
|
||||
}
|
||||
FtbModpack selectedPack = thirdPartyFilterModel->data(now, Qt::UserRole).value<FtbModpack>();
|
||||
Modpack selectedPack = thirdPartyFilterModel->data(now, Qt::UserRole).value<Modpack>();
|
||||
onPackSelectionChanged(&selectedPack);
|
||||
}
|
||||
|
||||
void FTBPage::onPrivatePackSelectionChanged(QModelIndex now, QModelIndex prev)
|
||||
void Page::onPrivatePackSelectionChanged(QModelIndex now, QModelIndex prev)
|
||||
{
|
||||
if(!now.isValid())
|
||||
{
|
||||
onPackSelectionChanged();
|
||||
return;
|
||||
}
|
||||
FtbModpack selectedPack = privateFilterModel->data(now, Qt::UserRole).value<FtbModpack>();
|
||||
Modpack selectedPack = privateFilterModel->data(now, Qt::UserRole).value<Modpack>();
|
||||
onPackSelectionChanged(&selectedPack);
|
||||
}
|
||||
|
||||
void FTBPage::onPackSelectionChanged(FtbModpack* pack)
|
||||
void Page::onPackSelectionChanged(Modpack* pack)
|
||||
{
|
||||
ui->versionSelectionBox->clear();
|
||||
if(pack)
|
||||
@@ -266,7 +268,7 @@ void FTBPage::onPackSelectionChanged(FtbModpack* pack)
|
||||
suggestCurrent();
|
||||
}
|
||||
|
||||
void FTBPage::onVersionSelectionItemChanged(QString data)
|
||||
void Page::onVersionSelectionItemChanged(QString data)
|
||||
{
|
||||
if(data.isNull() || data.isEmpty())
|
||||
{
|
||||
@@ -278,15 +280,15 @@ void FTBPage::onVersionSelectionItemChanged(QString data)
|
||||
suggestCurrent();
|
||||
}
|
||||
|
||||
void FTBPage::onSortingSelectionChanged(QString data)
|
||||
void Page::onSortingSelectionChanged(QString data)
|
||||
{
|
||||
FtbFilterModel::Sorting toSet = publicFilterModel->getAvailableSortings().value(data);
|
||||
FilterModel::Sorting toSet = publicFilterModel->getAvailableSortings().value(data);
|
||||
publicFilterModel->setSorting(toSet);
|
||||
thirdPartyFilterModel->setSorting(toSet);
|
||||
privateFilterModel->setSorting(toSet);
|
||||
}
|
||||
|
||||
void FTBPage::onTabChanged(int tab)
|
||||
void Page::onTabChanged(int tab)
|
||||
{
|
||||
if(tab == 1)
|
||||
{
|
||||
@@ -311,7 +313,7 @@ void FTBPage::onTabChanged(int tab)
|
||||
QModelIndex idx = currentList->currentIndex();
|
||||
if(idx.isValid())
|
||||
{
|
||||
auto pack = currentModel->data(idx, Qt::UserRole).value<FtbModpack>();
|
||||
auto pack = currentModel->data(idx, Qt::UserRole).value<Modpack>();
|
||||
onPackSelectionChanged(&pack);
|
||||
}
|
||||
else
|
||||
@@ -320,7 +322,7 @@ void FTBPage::onTabChanged(int tab)
|
||||
}
|
||||
}
|
||||
|
||||
void FTBPage::onAddPackClicked()
|
||||
void Page::onAddPackClicked()
|
||||
{
|
||||
bool ok;
|
||||
QString text = QInputDialog::getText(
|
||||
@@ -338,7 +340,7 @@ void FTBPage::onAddPackClicked()
|
||||
}
|
||||
}
|
||||
|
||||
void FTBPage::onRemovePackClicked()
|
||||
void Page::onRemovePackClicked()
|
||||
{
|
||||
auto index = ui->privatePackList->currentIndex();
|
||||
if(!index.isValid())
|
||||
@@ -346,7 +348,7 @@ void FTBPage::onRemovePackClicked()
|
||||
return;
|
||||
}
|
||||
auto row = index.row();
|
||||
FtbModpack pack = privateListModel->at(row);
|
||||
Modpack pack = privateListModel->at(row);
|
||||
auto answer = QMessageBox::question(
|
||||
this,
|
||||
tr("Remove pack"),
|
||||
@@ -362,3 +364,5 @@ void FTBPage::onRemovePackClicked()
|
||||
privateListModel->remove(row);
|
||||
onPackSelectionChanged();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,29 +22,32 @@
|
||||
#include "pages/BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
#include "tasks/Task.h"
|
||||
#include "modplatform/ftb/PackHelpers.h"
|
||||
#include "modplatform/ftb/FtbPackFetchTask.h"
|
||||
#include "modplatform/legacy_ftb/PackHelpers.h"
|
||||
#include "modplatform/legacy_ftb/PackFetchTask.h"
|
||||
#include "QObjectPtr.h"
|
||||
|
||||
class NewInstanceDialog;
|
||||
|
||||
namespace LegacyFTB {
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class FTBPage;
|
||||
class Page;
|
||||
}
|
||||
|
||||
class FtbListModel;
|
||||
class FtbFilterModel;
|
||||
class NewInstanceDialog;
|
||||
class FtbPrivatePackListModel;
|
||||
class FtbPrivatePackFilterModel;
|
||||
class FtbPrivatePackManager;
|
||||
class ListModel;
|
||||
class FilterModel;
|
||||
class PrivatePackListModel;
|
||||
class PrivatePackFilterModel;
|
||||
class PrivatePackManager;
|
||||
|
||||
class FTBPage : public QWidget, public BasePage
|
||||
class Page : public QWidget, public BasePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FTBPage(NewInstanceDialog * dialog, QWidget *parent = 0);
|
||||
virtual ~FTBPage();
|
||||
explicit Page(NewInstanceDialog * dialog, QWidget *parent = 0);
|
||||
virtual ~Page();
|
||||
QString displayName() const override
|
||||
{
|
||||
return tr("FTB Legacy");
|
||||
@@ -55,7 +58,7 @@ public:
|
||||
}
|
||||
QString id() const override
|
||||
{
|
||||
return "ftb";
|
||||
return "legacy_ftb";
|
||||
}
|
||||
QString helpPage() const override
|
||||
{
|
||||
@@ -66,13 +69,13 @@ public:
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
void onPackSelectionChanged(FtbModpack *pack = nullptr);
|
||||
void onPackSelectionChanged(Modpack *pack = nullptr);
|
||||
|
||||
private slots:
|
||||
void ftbPackDataDownloadSuccessfully(FtbModpackList publicPacks, FtbModpackList thirdPartyPacks);
|
||||
void ftbPackDataDownloadSuccessfully(ModpackList publicPacks, ModpackList thirdPartyPacks);
|
||||
void ftbPackDataDownloadFailed(QString reason);
|
||||
|
||||
void ftbPrivatePackDataDownloadSuccessfully(FtbModpack pack);
|
||||
void ftbPrivatePackDataDownloadSuccessfully(Modpack pack);
|
||||
void ftbPrivatePackDataDownloadFailed(QString reason, QString packCode);
|
||||
|
||||
void onSortingSelectionChanged(QString data);
|
||||
@@ -88,27 +91,29 @@ private slots:
|
||||
void onRemovePackClicked();
|
||||
|
||||
private:
|
||||
FtbFilterModel* currentModel = nullptr;
|
||||
FilterModel* currentModel = nullptr;
|
||||
QTreeView* currentList = nullptr;
|
||||
QTextBrowser* currentModpackInfo = nullptr;
|
||||
|
||||
bool initialized = false;
|
||||
FtbModpack selected;
|
||||
Modpack selected;
|
||||
QString selectedVersion;
|
||||
|
||||
FtbListModel* publicListModel = nullptr;
|
||||
FtbFilterModel* publicFilterModel = nullptr;
|
||||
ListModel* publicListModel = nullptr;
|
||||
FilterModel* publicFilterModel = nullptr;
|
||||
|
||||
FtbListModel *thirdPartyModel = nullptr;
|
||||
FtbFilterModel *thirdPartyFilterModel = nullptr;
|
||||
ListModel *thirdPartyModel = nullptr;
|
||||
FilterModel *thirdPartyFilterModel = nullptr;
|
||||
|
||||
FtbListModel *privateListModel = nullptr;
|
||||
FtbFilterModel *privateFilterModel = nullptr;
|
||||
ListModel *privateListModel = nullptr;
|
||||
FilterModel *privateFilterModel = nullptr;
|
||||
|
||||
unique_qobject_ptr<FtbPackFetchTask> ftbFetchTask;
|
||||
std::unique_ptr<FtbPrivatePackManager> ftbPrivatePacks;
|
||||
unique_qobject_ptr<PackFetchTask> ftbFetchTask;
|
||||
std::unique_ptr<PrivatePackManager> ftbPrivatePacks;
|
||||
|
||||
NewInstanceDialog* dialog = nullptr;
|
||||
|
||||
Ui::FTBPage *ui = nullptr;
|
||||
Ui::Page *ui = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FTBPage</class>
|
||||
<widget class="QWidget" name="FTBPage">
|
||||
<class>LegacyFTB::Page</class>
|
||||
<widget class="QWidget" name="LegacyFTB::Page">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -1,7 +0,0 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="/assets">
|
||||
<file alias="underconstruction">underconstruction.png</file>
|
||||
<file alias="deadglitch">deadglitch.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
class="tw-svg__asset tw-svg__asset--deadglitch tw-svg__asset--inherit"
|
||||
width="92px"
|
||||
height="96px"
|
||||
version="1.1"
|
||||
viewBox="0 0 30 30"
|
||||
x="0px"
|
||||
y="0px"
|
||||
id="svg8"
|
||||
sodipodi:docname="deadglitch.svg"
|
||||
inkscape:version="0.92.2 2405546, 2018-03-11">
|
||||
<metadata
|
||||
id="metadata14">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs12" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1353"
|
||||
inkscape:window-height="828"
|
||||
id="namedview10"
|
||||
showgrid="false"
|
||||
inkscape:zoom="4.9166667"
|
||||
inkscape:cx="44.285787"
|
||||
inkscape:cy="52.833458"
|
||||
inkscape:window-x="2958"
|
||||
inkscape:window-y="702"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg8" />
|
||||
<g
|
||||
id="g6"
|
||||
style="fill:#898395;fill-opacity:1">
|
||||
<path
|
||||
d="M26,17.4589613 L26,3 L4,3 L4,22.0601057 L10.0032868,22.0601057 L10.0032868,26 L14.0004537,22.0601057 L21.3322933,22.0601057 L26,17.4589613 L26,17.4589613 Z M21.0896458,26.0850335 L15.1583403,26.0850335 L11.2051771,30 L7.24798611,30 L7.24798611,26.0850335 L0,26.0850335 L0,5.21746493 L1.97773958,0 L29,0 L29,18.2620736 L21.0896458,26.0850335 L21.0896458,26.0850335 Z"
|
||||
id="path2"
|
||||
style="fill:#898395;fill-opacity:1" />
|
||||
<path
|
||||
d="M20.8587626,12.1710126 L22.4052753,13.7175252 L23.7175252,12.4052753 L22.1710126,10.8587626 L23.7175252,9.31224999 L22.4052753,8 L20.8587626,9.54651264 L19.31225,8 L18,9.31224999 L19.5465126,10.8587626 L18,12.4052753 L19.31225,13.7175252 L20.8587626,12.1710126 Z M11.8587626,12.1710126 L13.4052753,13.7175252 L14.7175252,12.4052753 L13.1710126,10.8587626 L14.7175252,9.31224999 L13.4052753,8 L11.8587626,9.54651264 L10.31225,8 L9,9.31224999 L10.5465126,10.8587626 L9,12.4052753 L10.31225,13.7175252 L11.8587626,12.1710126 Z"
|
||||
id="path4"
|
||||
style="fill:#898395;fill-opacity:1" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
@@ -310,5 +310,6 @@
|
||||
<file>50x50/instances/enderman.png</file>
|
||||
|
||||
<file>scalable/instances/fox.svg</file>
|
||||
<file>scalable/instances/bee.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
159
application/resources/multimc/scalable/instances/bee.svg
Normal file
159
application/resources/multimc/scalable/instances/bee.svg
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
viewBox="0 0 25.399999 25.4"
|
||||
height="96"
|
||||
width="96">
|
||||
<g transform="translate(-33.928467,-255.46043)">
|
||||
<g transform="rotate(-9.9635201,-96.932986,622.95265)">
|
||||
<path style="fill:#f1f2e0;fill-opacity:1;fill-rule:evenodd;stroke:#999999;stroke-width:0.28753757px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="m 101.98199,286.42583 -1.1502,0.57512 1.14992,0.5755 2.30058,1.14996 1.15019,-0.57514 -2.30058,-1.14995 z m 2.3003,2.30058 -1.1502,0.57512 1.15002,0.57493 1.15019,-0.57513 z m -1.8e-4,1.15005 -1.1502,0.57512 1.15057,0.57502 1.15019,-0.57512 z m 3.7e-4,1.15014 -1.15019,0.57514 -1.1502,0.57512 1.15001,0.57493 1.1502,-0.57513 1.15019,-0.57512 z m -2.30039,1.15026 -1.15001,-0.57494 -1.150566,-0.57502 -1.150193,0.57512 1.150565,0.57502 1.150014,0.57494 z m -2.300576,-1.14996 1.150196,-0.57513 -1.150014,-0.57493 -1.150097,0.57456 z m -1.149915,-0.5755 1.150193,-0.57512 -1.150012,-0.57492 -1.150194,0.57512 z m 1.81e-4,-1.15004 1.150194,-0.57513 -1.150567,-0.57503 -1.150193,0.57512 z m -3.73e-4,-1.15016 1.150194,-0.57512 1.150189,-0.57513 -1.150008,-0.57492 -1.150193,0.57512 -1.150194,0.57512 z m 1.150567,0.57503 1.149916,0.57548 1.15001,0.57494 1.15019,-0.57512 -1.15001,-0.57494 -1.15047,-0.57558 z" />
|
||||
</g>
|
||||
<g style="fill:none;stroke:#999999" transform="matrix(1.0012918,0.26829532,-0.26829532,1.0012918,86.112205,-31.978257)">
|
||||
<path style="stroke:#999999;stroke-width:1.03661346px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 85.501953 51.128906 C 82.473901 51.748417 79.445938 52.368362 76.417969 52.988281 L 79.886719 56.064453 C 82.914656 55.444381 85.942682 54.824742 88.970703 54.205078 L 85.501953 51.128906 z "
|
||||
transform="matrix(0.24654113,-0.06606049,0.06606049,0.24654113,23.141685,280.86706)" />
|
||||
<path style="stroke:#999999;stroke-width:1.03661346px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 79.636719 40.972656 L 75.095703 41.902344 C 78.563735 44.978675 82.032556 48.054115 85.501953 51.128906 L 90.042969 50.201172 L 79.636719 40.972656 z "
|
||||
transform="matrix(0.24654113,-0.06606049,0.06606049,0.24654113,23.141685,280.86706)" />
|
||||
</g>
|
||||
<path style="fill:#fed668" d="m 41.865965,262.07502 -4.233333,2.11667 7.408333,3.70417 4.233334,-2.11667 z" />
|
||||
<path style="fill:#0a0707" d="m 50.332633,272.39378 v 1.32291 l 1.058333,0.52917 v -1.32292 z" />
|
||||
<path style="fill:#422117" d="m 50.332633,273.7167 v 1.32291 l 1.058333,0.52917 v -1.32292 z" />
|
||||
<path style="fill:#0a0707" d="m 48.215966,273.45211 v 1.32291 l 1.058333,0.52917 v -1.32292 z" />
|
||||
<path style="fill:#422117" d="m 48.215966,274.77503 v 1.32291 l 1.058333,0.52917 v -1.32292 z" />
|
||||
<path style="fill:#422117" d="m 45.040966,275.3042 v 1.32291 l 1.058333,0.52917 v -1.32292 z" />
|
||||
<path style="fill:#78621d" d="m 45.040965,277.15626 4.233334,-2.11665 v -9.26042 l -4.233334,2.11667 z" />
|
||||
<path style="fill:#1d0c08" d="m 50.332632,265.25002 -1.058333,0.52917 v 9.26042 l 1.058333,-0.52917 z" />
|
||||
<path style="fill:#1d0c08" d="m 52.449299,264.19169 -1.058333,0.52917 v 9.26042 l 1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 38.690965,263.66252 1.058334,0.52917 1.058333,-0.52917 1.058333,0.52917 2.116667,-1.05834 -2.116667,-1.05833 z" />
|
||||
<path style="fill:#fed668" d="m 42.924299,261.54586 7.408334,3.70417 1.058333,-0.52917 -7.408334,-3.70417 z" />
|
||||
<path style="fill:#e4ae3b" d="m 40.807633,262.60419 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#fed668" d="m 45.040966,260.48752 7.408333,3.70417 1.058333,-0.52917 -7.408333,-3.70417 z" />
|
||||
<path style="fill:#5f3225" d="m 42.924299,261.54585 -1.058334,0.52917 7.408333,3.70417 1.058334,-0.52917 z" />
|
||||
<path style="fill:#e4ae3b" d="m 42.9243,261.54585 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#5f3225" d="m 45.040965,260.48752 -1.058333,0.52917 7.408333,3.70416 1.058333,-0.52916 z" />
|
||||
<path style="fill:#e4ae3b" d="m 45.040966,260.48752 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#5f3225" d="m 46.099299,259.95835 7.408333,3.70417 2.116666,-1.05833 -7.408333,-3.70417 z" />
|
||||
<path style="fill:#552e22" d="m 47.157633,259.42919 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 43.982633,262.07502 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 46.099299,261.01669 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 40.807633,264.72086 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#e4ae3b" d="m 45.040967,262.60419 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#552e22" d="m 49.2743,260.48753 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 48.215966,262.07502 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 41.865966,266.30836 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#552e22" d="m 50.332633,262.07502 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 46.099299,265.25002 -1.058334,0.52917 1.058334,0.52916 -2.116667,1.05834 1.058333,0.52916 3.175,-1.5875 z" />
|
||||
<path style="fill:#edc343" d="m 48.215967,264.19169 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 50.332633,263.13336 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#e4ae3b" d="m 47.157633,265.77919 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#e4ae3b" d="m 49.2743,264.72085 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#e4ae3b" d="m 51.390966,263.66252 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#edc343" d="m 38.690966,264.72086 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#ac8d2e" d="m 37.632633,273.45211 7.408333,3.70415 v -9.2604 l -7.408333,-3.70417 z" />
|
||||
<path style="fill:#12121a" d="m 37.632633,268.16044 2.116666,1.05834 v 3.96875 l -2.116666,-1.05834 z" />
|
||||
<path style="fill:#78621d" d="m 50.332633,265.25002 v 9.26041 l 1.058333,-0.52916 v -9.26042 z" />
|
||||
<path style="fill:#78621d" d="m 52.449299,264.19169 v 9.26041 l 1.058333,-0.52916 v -9.26042 z" />
|
||||
<path style="fill:#27120b" d="m 49.274299,265.77919 v 2.64583 l 1.058333,-0.52916 v -2.64584 z" />
|
||||
<path style="fill:#09090e" d="m 45.040966,271.86461 1.058333,-0.52917 v 3.96875 l -1.058333,0.52917 -2.116667,-1.05834 v -3.96875 z" />
|
||||
<path style="fill:#150704" d="m 49.2743,271.07085 v 2.64583 l 1.058333,-0.52916 v -2.64584 z" />
|
||||
<path style="fill:#050303" d="m 49.2743,273.71669 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#150704" d="m 51.390966,268.68961 v 2.64583 l 1.058333,-0.52916 v -2.64584 z" />
|
||||
<path style="fill:#050303" d="m 51.390966,271.33544 v 2.64583 l 1.058333,-0.52916 v -2.64584 z" />
|
||||
<path style="fill:#2c140d" d="m 51.390966,264.72086 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#1d0c08" d="m 55.624299,262.60419 -2.116666,1.05833 v 9.26042 l 2.116666,-1.05833 z" />
|
||||
<path style="fill:#150704" d="m 53.507633,268.95419 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#050303" d="m 53.507633,270.2771 v 2.64583 l 1.058333,-0.52916 v -2.64584 z" />
|
||||
<path style="fill:#2c140d" d="m 53.507633,263.66252 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#27120b" d="m 54.565966,263.13335 v 2.64583 l 1.058333,-0.52916 v -2.64584 z" />
|
||||
<path style="fill:#150704" d="m 54.565966,269.74794 v 2.64583 l 1.058333,-0.52916 v -2.64584 z" />
|
||||
<path style="fill:#27120b" d="m 54.565966,267.10211 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#633f19" d="m 45.040965,277.15626 3.175,-1.58749 v -1.32291 l -3.175,1.5875 z" />
|
||||
<path style="fill:#55300a" d="m 48.215966,274.24586 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#694520" d="m 48.215966,272.92294 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#735619" d="m 48.215966,271.60002 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#735619" d="m 47.157633,273.45211 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#131016" d="m 45.040966,271.86461 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#131016" d="m 45.040966,274.51044 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#694520" d="m 45.040966,270.54169 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#735619" d="m 46.0993,270.01252 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#816c31" d="m 45.040966,267.89586 v 1.32291 l 1.058333,-0.52916 v 1.32291 l 1.058334,-0.52916 v -1.32292 l 2.116666,-1.05833 v -1.32292 z" />
|
||||
<path style="fill:#49250c" d="m 50.332633,273.18752 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#633f19" d="m 50.332633,271.86461 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#735619" d="m 50.332633,269.21878 v 2.64582 l 1.058333,-0.52916 v -2.64583 z" />
|
||||
<path style="fill:#816c31" d="m 50.332633,265.25002 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#49250c" d="m 52.449299,270.80627 10e-7,2.64583 1.058333,-0.52916 -10e-7,-2.64584 z" />
|
||||
<path style="fill:#55300a" d="m 52.4493,269.48336 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#694520" d="m 52.4493,268.16044 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#755719" d="m 52.4493,266.83752 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#816c31" d="m 52.4493,264.19169 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#b89b49" d="m 37.632632,265.51461 2.116667,1.05833 v -1.32292 l -2.116667,-1.05833 z" />
|
||||
<path style="fill:#b89b49" d="m 40.807633,267.10211 2.116667,1.05833 v -1.32292 l -2.116667,-1.05833 z" />
|
||||
<path style="fill:#b89b49" d="m 43.982633,270.01253 1.058333,0.52916 v -2.64584 l -1.058333,-0.52916 z" />
|
||||
<path style="fill:#966531" d="m 43.982632,271.33545 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#a57d28" d="m 42.924299,270.80627 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#b89b49" d="m 41.865965,270.27712 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#966531" d="m 43.982632,271.33545 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#a57d28" d="m 39.749299,273.18753 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#a57d28" d="m 41.865965,274.24587 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#a57d28" d="m 40.807633,275.03961 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#8e5c28" d="m 43.982633,276.62711 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#966531" d="m 41.865966,275.56877 2.116667,1.05833 v -1.32292 l -2.116667,-1.05833 z" />
|
||||
<path style="fill:#966531" d="m 38.690966,273.98128 2.116667,1.05833 v -1.32292 l -2.116667,-1.05833 z" />
|
||||
<path style="fill:#8e5c28" d="m 37.632632,273.45212 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#956531" d="m 37.632633,268.16044 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#b89b49" d="m 39.749299,267.89587 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#1f1c25" d="m 38.690966,267.36669 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#1f1c25" d="m 42.924299,269.48337 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#589197" d="m 42.924299,272.12919 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#589197" d="m 38.690966,270.01252 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#12121a" d="m 43.982633,272.65836 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#12121a" d="m 42.924299,273.45211 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#12121a" d="m 43.982633,275.30419 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#1f1c25" d="m 43.982633,273.98127 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#1f1c25" d="m 42.924299,274.77503 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#1f1c25" d="m 38.690966,272.65836 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#1f1c25" d="m 37.632633,270.80627 1.058334,0.52916 v -1.32292 l -1.058334,-0.52916 z" />
|
||||
<path style="fill:#131016" d="m 38.690966,267.10211 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#131016" d="m 36.574299,266.83752 v 1.32291 l 2.116667,-1.05832 v -1.32292 z" />
|
||||
<path style="fill:#131016" d="m 41.865966,268.68961 v 1.32291 l 1.058333,-0.52916 v -1.32292 z" />
|
||||
<path style="fill:#131016" d="m 39.749299,268.42502 v 1.32291 l 2.116667,-1.05832 v -1.32292 z" />
|
||||
<g transform="matrix(1.0012918,0.26829532,-0.26829532,1.0012918,86.112205,-31.978257)">
|
||||
<path style="fill:#f1f2e0" d="m 38.073986,286.23688 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#5f3225" d="m 37.015652,286.76606 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#5f3225" d="m 37.015652,287.82438 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 38.073986,288.35355 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 40.190652,286.23689 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 42.307319,286.23688 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 42.307319,287.29521 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 43.365653,287.82437 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 43.365653,288.88271 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 41.248986,288.88271 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 40.190653,288.35354 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 45.482319,288.88271 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 46.540653,288.35355 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 46.540653,287.29521 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 44.423986,286.23688 2.116667,1.05833 1.058333,-0.52917 -2.116667,-1.05833 z" />
|
||||
</g>
|
||||
<g transform="matrix(1.0703659,-0.18803179,0.18803179,1.0703659,-63.348962,-38.123102)">
|
||||
<path style="fill:#f1f2e0" d="m 48.392735,288.88271 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#5f3225" d="m 47.334402,289.41187 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#5f3225" d="m 45.217735,289.41188 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 44.159402,288.8827 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 43.101069,286.23687 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 43.101068,285.17854 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 46.276068,284.64938 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 45.217735,286.23688 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 44.159402,284.64937 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 43.101068,287.2952 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 44.159402,287.82438 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 48.392735,286.76604 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 48.392735,287.82438 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f1f2e0" d="m 46.276068,286.76604 1.058333,0.52917 1.058333,-0.52917 -1.058333,-0.52917 z" />
|
||||
<path style="fill:#f7fdfd" d="m 47.334402,285.17854 2.116667,1.05833 1.058333,-0.52917 -2.116667,-1.05833 z" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 17 KiB |
@@ -3,6 +3,7 @@
|
||||
|
||||
CustomCommands::~CustomCommands()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
CustomCommands::CustomCommands(QWidget* parent):
|
||||
|
||||
@@ -28,7 +28,7 @@ class CustomCommands : public QWidget
|
||||
|
||||
public:
|
||||
explicit CustomCommands(QWidget *parent = 0);
|
||||
~CustomCommands();
|
||||
virtual ~CustomCommands();
|
||||
void initialize(bool checkable, bool checked, const QString & prelaunch, const QString & wrapper, const QString & postexit);
|
||||
|
||||
bool checked() const;
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>646</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
|
||||
41
application/widgets/DropLabel.cpp
Normal file
41
application/widgets/DropLabel.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "DropLabel.h"
|
||||
|
||||
#include <QMimeData>
|
||||
#include <QDropEvent>
|
||||
|
||||
DropLabel::DropLabel(QWidget *parent) : QLabel(parent)
|
||||
{
|
||||
setAcceptDrops(true);
|
||||
}
|
||||
|
||||
void DropLabel::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
void DropLabel::dragMoveEvent(QDragMoveEvent *event)
|
||||
{
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
void DropLabel::dragLeaveEvent(QDragLeaveEvent *event)
|
||||
{
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void DropLabel::dropEvent(QDropEvent *event)
|
||||
{
|
||||
const QMimeData *mimeData = event->mimeData();
|
||||
|
||||
if (!mimeData)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mimeData->hasUrls()) {
|
||||
auto urls = mimeData->urls();
|
||||
emit droppedURLs(urls);
|
||||
}
|
||||
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
20
application/widgets/DropLabel.h
Normal file
20
application/widgets/DropLabel.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class DropLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DropLabel(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void droppedURLs(QList<QUrl> urls);
|
||||
|
||||
protected:
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||
void dragLeaveEvent(QDragLeaveEvent *event) override;
|
||||
};
|
||||
@@ -10,9 +10,6 @@
|
||||
<height>118</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QToolButton" name="iconButton">
|
||||
|
||||
@@ -47,10 +47,8 @@ QString LanguageSelectionWidget::getSelectedLanguageKey() const
|
||||
|
||||
void LanguageSelectionWidget::retranslate()
|
||||
{
|
||||
QString text =
|
||||
tr("Don't see your language or the quality is poor?") +
|
||||
"<br/>" +
|
||||
QString("<a href=\"https://github.com/MultiMC/MultiMC5/wiki/Translating-MultiMC\">%1</a>").arg(tr("Help us with translations!"));
|
||||
QString text = tr("Don't see your language or the quality is poor?<br/><a href=\"%1\">Help us with translations!</a>")
|
||||
.arg("https://github.com/MultiMC/MultiMC5/wiki/Translating-MultiMC");
|
||||
helpUsLabel->setText(text);
|
||||
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ void ServerStatus::addStatus(QString key, QString name)
|
||||
|
||||
void ServerStatus::clicked()
|
||||
{
|
||||
DesktopServices::openUrl(QUrl("https://help.mojang.com/"));
|
||||
DesktopServices::openUrl(QUrl("https://github.com/MultiMC/MultiMC5/wiki/Mojang-Services-Status"));
|
||||
}
|
||||
|
||||
void ServerStatus::setStatus(QString key, int value)
|
||||
|
||||
@@ -82,7 +82,9 @@ void VersionListView::setEmptyMode(VersionListView::EmptyMode mode)
|
||||
|
||||
void VersionListView::updateEmptyViewPort()
|
||||
{
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
setAccessibleDescription(currentEmptyString());
|
||||
#endif /* !QT_NO_ACCESSIBILITY */
|
||||
|
||||
if(!m_itemCount)
|
||||
{
|
||||
|
||||
58
changelog.md
58
changelog.md
@@ -1,4 +1,52 @@
|
||||
# MultiMC 0.6.7
|
||||
# MultiMC 0.6.8
|
||||
|
||||
This is mostly about removal of the 'curse URL' related features, because they were of low quality and generally unreliable.
|
||||
|
||||
There are some bug fixes included.
|
||||
|
||||
MultiMC also migrated to a new continuous deployment system, which makes everything that much smoother.
|
||||
|
||||
### New or changed features
|
||||
|
||||
- GH-852: Instance group expansion status now saves/loads as expected.
|
||||
|
||||
- The bees have invaded the launcher. We now have a bee icon.
|
||||
|
||||
- Translations have been overhauled, yet again...
|
||||
|
||||
- We now have a [crowdin site](https://translate.multimc.org/) for all the translation work.
|
||||
|
||||
- Translations are made based on the development version, and for the development version.
|
||||
|
||||
- Many strings have been tweaked to make translating the application easier.
|
||||
|
||||
- When selecting languages, European Portuguese is now displaying properly.
|
||||
|
||||
- Accessibility has been further improved - the main window reads as `MultiMC`, not a long string of nonsensical version numbers, when announced by a screen reader.
|
||||
|
||||
- Removed the unimplemented Technic page from instance creation dialog.
|
||||
|
||||
- GH-2859: Broken twitch URL import method was removed.
|
||||
|
||||
- GH-2819: Filter bar in mod lists now also works with descriptions and author lists.
|
||||
|
||||
- GH-2832: Version page now has buttons for opening the Minecraft and internal libraries folders of the instance.
|
||||
|
||||
- GH-2769: When copying an instance, there's now an option to keep or remove the total play time from the copy.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- GH-2880: Clicking the service status indicators now opens a valid site again, instead of going nowhere.
|
||||
|
||||
- GH-2853: When collapsing groups in instance view, the action no longer becomes 'sticky' and doesn't apply to items clicked afterwards.
|
||||
|
||||
- GH-2787: "Download All" button works again.
|
||||
|
||||
- When dependencies are customized, the la ncher will not try to update them in an infinite loop when something else requires a different version.
|
||||
|
||||
# Previous releases
|
||||
|
||||
## MultiMC 0.6.7
|
||||
|
||||
The previous release introduced some extra buttons that made the instance window way too big for some displays. This release is aimed at fixing that, along with other UI and performance improvements.
|
||||
|
||||
@@ -47,8 +95,6 @@ There are some accessibility fixes thrown in too.
|
||||
Sorting cascades from 'Enabled' to 'Name' and then 'Version'. This means that if you sort 'Enabled', the enabled and disabled mods are still sorted
|
||||
by name and mods with the same name will be also sorted by version.
|
||||
|
||||
# Previous releases
|
||||
|
||||
## MultiMC 0.6.6
|
||||
|
||||
This release is mostly the smaller things that have accumulated over time, along with a big change in linux packaging.
|
||||
@@ -70,7 +116,7 @@ MultiMC on linux is built with Qt 5.4 and older versions of Qt will not work.
|
||||
|
||||
This should be a massive improvement to system integration on linux and resolves GH-1784, GH-2605, GH-1979, GH-2271, GH-1992, GH-1816 and their many duplicates.
|
||||
|
||||
#### New or changed features
|
||||
### New or changed features
|
||||
|
||||
- GH-2487: No is now the default button when deleting instances.
|
||||
|
||||
@@ -100,7 +146,7 @@ This should be a massive improvement to system integration on linux and resolves
|
||||
|
||||
You can now drag the purple download buttons from CurseForge into MultiMC and get a modpack out of it. Much easier!
|
||||
|
||||
#### Bugfixes
|
||||
### Bugfixes
|
||||
|
||||
- Translation folder is now created sooner, making first launch translation fetch work again.
|
||||
|
||||
@@ -134,7 +180,7 @@ This should be a massive improvement to system integration on linux and resolves
|
||||
|
||||
Finalizing the translation workflow improvements and adding fixes for sounds missing in old game versions.
|
||||
|
||||
#### New or changed features
|
||||
### New or changed features
|
||||
|
||||
- UI for the language settings has been unified across the application
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
set -e
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]
|
||||
then
|
||||
QT_WITHOUT_DOTS=qt$(echo $QT_VERSION | grep -oP "[^\.]*" | tr -d '\n' | tr '[:upper:]' '[:lower]')
|
||||
QT_PKG_PREFIX=$(echo $QT_WITHOUT_DOTS | cut -c1-4)
|
||||
QT_PKG_INSTALL=$QT_PKG_PREFIX
|
||||
if [ "$QT_PKG_PREFIX" = "qt50" ]; then QT_PKG_PREFIX=qt QT_PKG_INSTALL=qt5; fi
|
||||
echo $QT_WITHOUT_DOTS
|
||||
echo $QT_PKG_PREFIX
|
||||
echo $QT_PKG_INSTALL
|
||||
if [ "$TRAVIS_DIST" = "precise" ]; then
|
||||
sudo add-apt-repository -y ppa:beineri/opt-${QT_WITHOUT_DOTS}
|
||||
else
|
||||
sudo add-apt-repository -y ppa:beineri/opt-${QT_WITHOUT_DOTS}-$TRAVIS_DIST
|
||||
fi
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test # for a recent GCC
|
||||
sudo add-apt-repository "deb http://llvm.org/apt/${TRAVIS_DIST}/ llvm-toolchain-${TRAVIS_DIST}-3.5 main"
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install ${QT_PKG_PREFIX}base ${QT_PKG_PREFIX}svg ${QT_PKG_PREFIX}tools
|
||||
|
||||
sudo mkdir -p /opt/cmake-3/
|
||||
wget --no-check-certificate http://www.cmake.org/files/v3.9/cmake-3.9.3-Linux-x86_64.sh
|
||||
sudo sh cmake-3.9.3-Linux-x86_64.sh --skip-license --prefix=/opt/cmake-3/
|
||||
|
||||
export CMAKE_PREFIX_PATH=/opt/$QT_PKG_INSTALL/lib/cmake
|
||||
export PATH=/opt/cmake-3/bin:/opt/$QT_PKG_INSTALL/bin:$PATH
|
||||
|
||||
if [ "$CXX" = "g++" ]; then
|
||||
sudo apt-get install -y -qq g++-5
|
||||
export CXX='g++-5' CC='gcc-5'
|
||||
fi
|
||||
if [ "$CXX" = "clang++" ]; then
|
||||
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
|
||||
sudo apt-get install -y -qq clang-3.5 liblldb-3.5 libclang1-3.5 libllvm3.5 lldb-3.5 llvm-3.5 llvm-3.5-runtime
|
||||
export CXX='clang++-3.5' CC='clang-3.5'
|
||||
fi
|
||||
else
|
||||
brew update
|
||||
brew install qt5
|
||||
brew install cmake
|
||||
export CMAKE_PREFIX_PATH=/usr/local/lib/cmake
|
||||
fi
|
||||
|
||||
# Output versions
|
||||
cmake -version
|
||||
qmake -version
|
||||
$CXX -v
|
||||
echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH"
|
||||
Reference in New Issue
Block a user