Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
30f899f37d | |||
9dc3647f32 | |||
3f3c5ea247 | |||
541e2f0d8d | |||
fa98ed3ccd | |||
9579231ccc | |||
9cc168c526 | |||
94fdf13f4a | |||
3efcccf334 | |||
5e909a4e85 | |||
e7b90a9a3c | |||
0c177b1086 | |||
a6e59cb4f4 | |||
1f21d84fdc | |||
be029ab360 | |||
6fe07561fe | |||
f42c3a953c | |||
4063a496d7 | |||
01e4e62de3 | |||
b1b615e17f | |||
95c9a6d8f4 | |||
3bc450a6d7 | |||
fce98f5e16 | |||
7179e75e70 |
10
BUILD.md
10
BUILD.md
@ -193,11 +193,19 @@ zlib1.dll
|
||||
# macOS
|
||||
|
||||
### Install prerequisites:
|
||||
- Install XCode and set it up to the point where you can build things from a terminal
|
||||
- Install XCode Command Line tools
|
||||
- Install the official build of CMake (https://cmake.org/download/)
|
||||
- Install JDK 8 (https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html)
|
||||
- Get Qt 5.6 and install it (https://download.qt.io/new_archive/qt/5.6/5.6.3/)
|
||||
|
||||
### XCode Command Line tools
|
||||
|
||||
If you don't have XCode CommandLine tools installed, you can install them by using this command in the Terminal App
|
||||
|
||||
```bash
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
Pick an installation path - this is where the final `.app` will be constructed when you run `make install`. Supply it as the `CMAKE_INSTALL_PREFIX` argument during CMake configuration.
|
||||
|
@ -24,6 +24,7 @@ endif()
|
||||
|
||||
##################################### Set CMake options #####################################
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
|
||||
@ -47,6 +48,9 @@ if(UNIX AND APPLE)
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type")
|
||||
|
||||
# Fix build with Qt 5.13
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
|
||||
|
||||
##################################### Set Application options #####################################
|
||||
|
||||
######## Set URLs ########
|
||||
@ -213,7 +217,7 @@ elseif(Launcher_LAYOUT_REAL STREQUAL "lin-system")
|
||||
MESSAGE(STATUS "Compiling for linux system with ${Launcher_SHARE_DEST_DIR} and LAUNCHER_LINUX_DATADIR")
|
||||
SET(Launcher_APP_BINARY_DEFS "-DMULTIMC_JARS_LOCATION=${CMAKE_INSTALL_PREFIX}/${JARS_DEST_DIR}" "-DLAUNCHER_LINUX_DATADIR")
|
||||
|
||||
install(FILES ${Launcher_Desktop} DESTINATION ${Launcher_DESKTOP_DEST_DIR})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_Desktop} DESTINATION ${Launcher_DESKTOP_DEST_DIR})
|
||||
|
||||
# install as bundle with no dependencies included
|
||||
set(INSTALL_BUNDLE "nodeps")
|
||||
|
@ -20,6 +20,7 @@ Several source build packages are available, along with experimental pre-built g
|
||||
- [Linux (AMD64) System](https://packages.polymc.org/latest/lin64-system/lin64-system.tar.zst) ([SHA256](https://packages.polymc.org/latest/lin64-system/lin64-system.tar.zst.sha256)) - this is a generic system package intended to be used as a base for making distro-specific packages.
|
||||
- [Windows (32-bit)](https://packages.polymc.org/latest/win32/win32.zip) ([SHA256](https://packages.polymc.org/latest/win32/win32.zip.sha256)) - this is a portable package, you can extract it anywhere and run it. This package needs testing.
|
||||
- [Debian (AMD64)](https://packages.polymc.org/latest/deb/polymc-amd64.deb) ([SHA256](https://packages.polymc.org/latest/deb/polymc-amd64.deb.sha256)) - this is intended to be installed with `dpkg -i`. Alternatively, you may build the `.deb` yourself, by going to `packages/debian` and running `./makedeb.sh`.
|
||||
- [AppImage (AMD64)](https://packages.polymc.org/latest/appimage/PolyMC-latest-x86_64.AppImage) ([SHA256](https://packages.polymc.org/latest/appimage/PolyMC-latest-x86_64.AppImage.sha256)) - `chmod +x` must be run on this file before usage. This should work on any distribution
|
||||
- MacOS currently does not have any packages. We are still working on setting up MacOS packaging.
|
||||
|
||||
## Development
|
||||
|
@ -523,7 +523,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
||||
// Set up paths
|
||||
{
|
||||
// Root path is used for updates.
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
QDir foo(FS::PathCombine(binPath, ".."));
|
||||
m_rootPath = foo.absolutePath();
|
||||
#elif defined(Q_OS_WIN32)
|
||||
@ -1148,7 +1148,7 @@ void Application::setIconTheme(const QString& name)
|
||||
QIcon Application::getThemedIcon(const QString& name)
|
||||
{
|
||||
if(name == "logo") {
|
||||
return QIcon(":/logo.svg");
|
||||
return QIcon(":/polymc.svg");
|
||||
}
|
||||
return XdgIcon::fromTheme(name);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
/**
|
||||
* This shouldn't exist, but until QTBUG-9328 and other unreported bugs are fixed, it needs to be a thing.
|
||||
*/
|
||||
#if defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
@ -83,7 +83,7 @@ bool openDirectory(const QString &path, bool ensureExists)
|
||||
{
|
||||
return QDesktopServices::openUrl(QUrl::fromLocalFile(dir.absolutePath()));
|
||||
};
|
||||
#if defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
return IndirectOpen(f);
|
||||
#else
|
||||
return f();
|
||||
@ -97,7 +97,7 @@ bool openFile(const QString &path)
|
||||
{
|
||||
return QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||
};
|
||||
#if defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
return IndirectOpen(f);
|
||||
#else
|
||||
return f();
|
||||
@ -107,7 +107,7 @@ bool openFile(const QString &path)
|
||||
bool openFile(const QString &application, const QString &path, const QString &workingDirectory, qint64 *pid)
|
||||
{
|
||||
qDebug() << "Opening file" << path << "using" << application;
|
||||
#if defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
|
||||
return IndirectOpen([&]()
|
||||
{
|
||||
@ -121,7 +121,7 @@ bool openFile(const QString &application, const QString &path, const QString &wo
|
||||
bool run(const QString &application, const QStringList &args, const QString &workingDirectory, qint64 *pid)
|
||||
{
|
||||
qDebug() << "Running" << application << "with args" << args.join(' ');
|
||||
#if defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
|
||||
return IndirectOpen([&]()
|
||||
{
|
||||
@ -139,7 +139,7 @@ bool openUrl(const QUrl &url)
|
||||
{
|
||||
return QDesktopServices::openUrl(url);
|
||||
};
|
||||
#if defined(Q_OS_LINUX)
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
return IndirectOpen(f);
|
||||
#else
|
||||
return f();
|
||||
|
@ -403,7 +403,7 @@ QString getDesktopDir()
|
||||
bool createShortCut(QString location, QString dest, QStringList args, QString name,
|
||||
QString icon)
|
||||
{
|
||||
#if defined Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
location = PathCombine(location, name + ".desktop");
|
||||
|
||||
QFile f(location);
|
||||
|
@ -55,14 +55,14 @@ void InstanceImportTask::executeTask()
|
||||
const QString path = m_sourceUrl.host() + '/' + m_sourceUrl.path();
|
||||
auto entry = APPLICATION->metacache()->resolveEntry("general", path);
|
||||
entry->setStale(true);
|
||||
m_filesNetJob.reset(new NetJob(tr("Modpack download")));
|
||||
m_filesNetJob = new NetJob(tr("Modpack download"), APPLICATION->network());
|
||||
m_filesNetJob->addNetAction(Net::Download::makeCached(m_sourceUrl, entry));
|
||||
m_archivePath = entry->getFullPath();
|
||||
auto job = m_filesNetJob.get();
|
||||
connect(job, &NetJob::succeeded, this, &InstanceImportTask::downloadSucceeded);
|
||||
connect(job, &NetJob::progress, this, &InstanceImportTask::downloadProgressChanged);
|
||||
connect(job, &NetJob::failed, this, &InstanceImportTask::downloadFailed);
|
||||
m_filesNetJob->start(APPLICATION->network());
|
||||
m_filesNetJob->start();
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,7 +337,7 @@ void InstanceImportTask::processFlame()
|
||||
connect(m_modIdResolver.get(), &Flame::FileResolvingTask::succeeded, [&]()
|
||||
{
|
||||
auto results = m_modIdResolver->getResults();
|
||||
m_filesNetJob.reset(new NetJob(tr("Mod download")));
|
||||
m_filesNetJob = new NetJob(tr("Mod download"), APPLICATION->network());
|
||||
for(auto result: results.files)
|
||||
{
|
||||
QString filename = result.fileName;
|
||||
@ -391,7 +391,7 @@ void InstanceImportTask::processFlame()
|
||||
setProgress(current, total);
|
||||
});
|
||||
setStatus(tr("Downloading mods..."));
|
||||
m_filesNetJob->start(APPLICATION->network());
|
||||
m_filesNetJob->start();
|
||||
}
|
||||
);
|
||||
connect(m_modIdResolver.get(), &Flame::FileResolvingTask::failed, [&](QString reason)
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <QHostInfo>
|
||||
#include <QList>
|
||||
#include <QHostAddress>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "BuildConfig.h"
|
||||
#include "JavaCommon.h"
|
||||
@ -145,36 +146,44 @@ void LaunchController::login() {
|
||||
m_session->MakeOffline(usedname);
|
||||
// offline flavored game from here :3
|
||||
}
|
||||
if(m_accountToUse->ownsMinecraft() && !m_accountToUse->hasProfile()) {
|
||||
auto entitlement = m_accountToUse->accountData()->minecraftEntitlement;
|
||||
QString errorString;
|
||||
if(!entitlement.canPlayMinecraft) {
|
||||
errorString = tr("The account does not own Minecraft. You need to purchase the game first to play it.");
|
||||
QMessageBox::warning(
|
||||
nullptr,
|
||||
tr("Missing Minecraft profile"),
|
||||
errorString,
|
||||
QMessageBox::StandardButton::Ok,
|
||||
QMessageBox::StandardButton::Ok
|
||||
);
|
||||
emitFailed(errorString);
|
||||
return;
|
||||
}
|
||||
// Now handle setting up a profile name here...
|
||||
ProfileSetupDialog dialog(m_accountToUse, m_parentWidget);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
tryagain = true;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
emitFailed(tr("Received undetermined session status during login."));
|
||||
return;
|
||||
if(m_accountToUse->ownsMinecraft()) {
|
||||
if(!m_accountToUse->hasProfile()) {
|
||||
// Now handle setting up a profile name here...
|
||||
ProfileSetupDialog dialog(m_accountToUse, m_parentWidget);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
tryagain = true;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
emitFailed(tr("Received undetermined session status during login."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// we own Minecraft, there is a profile, it's all ready to go!
|
||||
launchInstance();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
launchInstance();
|
||||
// play demo ?
|
||||
QMessageBox box(m_parentWidget);
|
||||
box.setWindowTitle(tr("Play demo?"));
|
||||
box.setText(tr("This account does not own Minecraft.\nYou need to purchase the game first to play it.\n\nDo you want to play the demo?"));
|
||||
box.setIcon(QMessageBox::Warning);
|
||||
auto demoButton = box.addButton(tr("Play Demo"), QMessageBox::ButtonRole::YesRole);
|
||||
auto cancelButton = box.addButton(tr("Cancel"), QMessageBox::ButtonRole::NoRole);
|
||||
box.setDefaultButton(cancelButton);
|
||||
|
||||
box.exec();
|
||||
if(box.clickedButton() == demoButton) {
|
||||
// play demo here
|
||||
m_session->MakeDemo();
|
||||
launchInstance();
|
||||
}
|
||||
else {
|
||||
emitFailed(tr("Launch cancelled - account does not own Minecraft."));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ void UpdateController::installUpdates()
|
||||
qDebug() << "Installing updates.";
|
||||
#ifdef Q_OS_WIN
|
||||
QString finishCmd = QApplication::applicationFilePath();
|
||||
#elif defined Q_OS_LINUX
|
||||
#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
QString finishCmd = FS::PathCombine(m_root, BuildConfig.LAUNCHER_NAME);
|
||||
#elif defined Q_OS_MAC
|
||||
QString finishCmd = QApplication::applicationFilePath();
|
||||
|
@ -78,7 +78,7 @@ void Version::parse()
|
||||
// FIXME: this is bad. versions can contain a lot more separators...
|
||||
QStringList parts = m_string.split('.');
|
||||
|
||||
for (const auto &part : parts)
|
||||
for (const auto& part : parts)
|
||||
{
|
||||
m_sections.append(Section(part));
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ JavaUtils::JavaUtils()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
static QString processLD_LIBRARY_PATH(const QString & LD_LIBRARY_PATH)
|
||||
{
|
||||
QDir mmcBin(QCoreApplication::applicationDirPath());
|
||||
@ -83,7 +83,7 @@ QProcessEnvironment CleanEnviroment()
|
||||
qDebug() << "Env: ignoring" << key << value;
|
||||
continue;
|
||||
}
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
// Do not pass LD_* variables to java. They were intended for MultiMC
|
||||
if(key.startsWith("LD_"))
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ int main(int argc, char *argv[])
|
||||
Q_INIT_RESOURCE(multimc);
|
||||
Q_INIT_RESOURCE(backgrounds);
|
||||
Q_INIT_RESOURCE(documents);
|
||||
Q_INIT_RESOURCE(logo);
|
||||
Q_INIT_RESOURCE(polymc);
|
||||
|
||||
Q_INIT_RESOURCE(pe_dark);
|
||||
Q_INIT_RESOURCE(pe_light);
|
||||
|
@ -117,7 +117,7 @@ void Meta::BaseEntity::load(Net::Mode loadType)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_updateTask = new NetJob(QObject::tr("Download of meta file %1").arg(localFilename()));
|
||||
m_updateTask = new NetJob(QObject::tr("Download of meta file %1").arg(localFilename()), APPLICATION->network());
|
||||
auto url = this->url();
|
||||
auto entry = APPLICATION->metacache()->resolveEntry("meta", localFilename());
|
||||
entry->setStale(true);
|
||||
@ -140,7 +140,7 @@ void Meta::BaseEntity::load(Net::Mode loadType)
|
||||
m_updateStatus = UpdateStatus::Failed;
|
||||
m_updateTask.reset();
|
||||
});
|
||||
m_updateTask->start(APPLICATION->network());
|
||||
m_updateTask->start();
|
||||
}
|
||||
|
||||
bool Meta::BaseEntity::isLoaded() const
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "net/ChecksumValidator.h"
|
||||
#include "BuildConfig.h"
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
namespace {
|
||||
QSet<QString> collectPathsFromDir(QString dirPath)
|
||||
{
|
||||
@ -318,7 +320,7 @@ QString AssetObject::getRelPath()
|
||||
|
||||
NetJob::Ptr AssetsIndex::getDownloadJob()
|
||||
{
|
||||
auto job = new NetJob(QObject::tr("Assets for %1").arg(id));
|
||||
auto job = new NetJob(QObject::tr("Assets for %1").arg(id), APPLICATION->network());
|
||||
for (auto &object : objects.values())
|
||||
{
|
||||
auto dl = object.getDownloadAction();
|
||||
|
@ -431,8 +431,7 @@ QStringList MinecraftInstance::processMinecraftArgs(
|
||||
|
||||
QMap<QString, QString> token_mapping;
|
||||
// yggdrasil!
|
||||
if(session)
|
||||
{
|
||||
if(session) {
|
||||
// token_mapping["auth_username"] = session->username;
|
||||
token_mapping["auth_session"] = session->session;
|
||||
token_mapping["auth_access_token"] = session->access_token;
|
||||
@ -440,6 +439,9 @@ QStringList MinecraftInstance::processMinecraftArgs(
|
||||
token_mapping["auth_uuid"] = session->uuid;
|
||||
token_mapping["user_properties"] = session->serializeUserProperties();
|
||||
token_mapping["user_type"] = session->user_type;
|
||||
if(session->demo) {
|
||||
args_pattern += " --demo";
|
||||
}
|
||||
}
|
||||
|
||||
// blatant self-promotion.
|
||||
@ -872,7 +874,9 @@ shared_qobject_ptr<LaunchTask> MinecraftInstance::createLaunchTask(AuthSessionPt
|
||||
// if we aren't in offline mode,.
|
||||
if(session->status != AuthSession::PlayableOffline)
|
||||
{
|
||||
process->appendStep(new ClaimAccount(pptr, session));
|
||||
if(!session->demo) {
|
||||
process->appendStep(new ClaimAccount(pptr, session));
|
||||
}
|
||||
process->appendStep(new Update(pptr, Net::Mode::Online));
|
||||
}
|
||||
else
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
OpSys OpSys_fromString(QString name)
|
||||
{
|
||||
if (name == "freebsd")
|
||||
return Os_FreeBSD;
|
||||
if (name == "linux")
|
||||
return Os_Linux;
|
||||
if (name == "windows")
|
||||
@ -30,6 +32,8 @@ QString OpSys_toString(OpSys name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case Os_FreeBSD:
|
||||
return "freebsd";
|
||||
case Os_Linux:
|
||||
return "linux";
|
||||
case Os_OSX:
|
||||
|
@ -18,6 +18,7 @@
|
||||
enum OpSys
|
||||
{
|
||||
Os_Windows,
|
||||
Os_FreeBSD,
|
||||
Os_Linux,
|
||||
Os_OSX,
|
||||
Os_Other
|
||||
@ -27,11 +28,11 @@ OpSys OpSys_fromString(QString);
|
||||
QString OpSys_toString(OpSys);
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
#define currentSystem Os_Windows
|
||||
#define currentSystem Os_Windows
|
||||
#elif defined Q_OS_MAC
|
||||
#define currentSystem Os_OSX
|
||||
#elif defined Q_OS_FREEBSD
|
||||
#define currentSystem Os_FreeBSD
|
||||
#else
|
||||
#ifdef Q_OS_MAC
|
||||
#define currentSystem Os_OSX
|
||||
#else
|
||||
#define currentSystem Os_Linux
|
||||
#define currentSystem Os_Linux
|
||||
#endif
|
||||
#endif
|
@ -30,3 +30,8 @@ bool AuthSession::MakeOffline(QString offline_playername)
|
||||
status = PlayableOffline;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AuthSession::MakeDemo() {
|
||||
player_name = "Player";
|
||||
demo = true;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ class QNetworkAccessManager;
|
||||
struct AuthSession
|
||||
{
|
||||
bool MakeOffline(QString offline_playername);
|
||||
void MakeDemo();
|
||||
|
||||
QString serializeUserProperties();
|
||||
|
||||
@ -43,6 +44,9 @@ struct AuthSession
|
||||
bool auth_server_online = false;
|
||||
// Did the user request online mode?
|
||||
bool wants_online = true;
|
||||
|
||||
//Is this a demo session?
|
||||
bool demo = false;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<AuthSession> AuthSessionPtr;
|
||||
|
@ -226,6 +226,8 @@ bool parseMinecraftEntitlements(QByteArray & data, MinecraftEntitlement &output)
|
||||
}
|
||||
|
||||
auto obj = doc.object();
|
||||
output.canPlayMinecraft = false;
|
||||
output.ownsMinecraft = false;
|
||||
|
||||
auto itemsArray = obj.value("items").toArray();
|
||||
for(auto item: itemsArray) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
ClaimAccount::ClaimAccount(LaunchTask* parent, AuthSessionPtr session): LaunchStep(parent)
|
||||
{
|
||||
if(session->status == AuthSession::Status::PlayableOnline)
|
||||
if(session->status == AuthSession::Status::PlayableOnline && !session->demo)
|
||||
{
|
||||
auto accounts = APPLICATION->accounts();
|
||||
m_account = accounts->getAccountByProfileName(session->player_name);
|
||||
|
@ -23,6 +23,13 @@
|
||||
#include "FileSystem.h"
|
||||
#include <QDir>
|
||||
|
||||
#ifdef major
|
||||
#undef major
|
||||
#endif
|
||||
#ifdef minor
|
||||
#undef minor
|
||||
#endif
|
||||
|
||||
static QString replaceSuffix (QString target, const QString &suffix, const QString &replacement)
|
||||
{
|
||||
if (!target.endsWith(suffix))
|
||||
|
@ -19,8 +19,9 @@
|
||||
#include "PrintInstanceInfo.h"
|
||||
#include <launch/LaunchTask.h>
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
namespace {
|
||||
#if defined(Q_OS_LINUX)
|
||||
void probeProcCpuinfo(QStringList &log)
|
||||
{
|
||||
std::ifstream cpuin("/proc/cpuinfo");
|
||||
@ -66,7 +67,43 @@ void runLspci(QStringList &log)
|
||||
}
|
||||
pclose(lspci);
|
||||
}
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
void runSysctlHwModel(QStringList &log)
|
||||
{
|
||||
char buff[512];
|
||||
FILE *hwmodel = popen("sysctl hw.model", "r");
|
||||
while (fgets(buff, 512, hwmodel) != NULL)
|
||||
{
|
||||
log << QString::fromUtf8(buff);
|
||||
break;
|
||||
}
|
||||
pclose(hwmodel);
|
||||
}
|
||||
|
||||
void runPciconf(QStringList &log)
|
||||
{
|
||||
char buff[512];
|
||||
std::string strcard;
|
||||
FILE *pciconf = popen("pciconf -lv -a vgapci0", "r");
|
||||
while (fgets(buff, 512, pciconf) != NULL)
|
||||
{
|
||||
if (strncmp(buff, " vendor", 10) == 0)
|
||||
{
|
||||
std::string str(buff);
|
||||
strcard.append(str.substr(str.find_first_of("'") + 1, str.find_last_not_of("'") - (str.find_first_of("'") + 2)));
|
||||
strcard.append(" ");
|
||||
}
|
||||
else if (strncmp(buff, " device", 10) == 0)
|
||||
{
|
||||
std::string str2(buff);
|
||||
strcard.append(str2.substr(str2.find_first_of("'") + 1, str2.find_last_not_of("'") - (str2.find_first_of("'") + 2)));
|
||||
}
|
||||
log << QString::fromStdString(strcard);
|
||||
break;
|
||||
}
|
||||
pclose(pciconf);
|
||||
}
|
||||
#endif
|
||||
void runGlxinfo(QStringList & log)
|
||||
{
|
||||
// FIXME: fixed size buffers...
|
||||
@ -94,10 +131,14 @@ void PrintInstanceInfo::executeTask()
|
||||
auto instance = m_parent->instance();
|
||||
QStringList log;
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX)
|
||||
::probeProcCpuinfo(log);
|
||||
::runLspci(log);
|
||||
::runGlxinfo(log);
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
::runSysctlHwModel(log);
|
||||
::runPciconf(log);
|
||||
::runGlxinfo(log);
|
||||
#endif
|
||||
|
||||
logLines(log, MessageLevel::Launcher);
|
||||
|
@ -5,6 +5,13 @@
|
||||
#include <minecraft/PackProfile.h>
|
||||
#include <minecraft/VersionFilterData.h>
|
||||
|
||||
#ifdef major
|
||||
#undef major
|
||||
#endif
|
||||
#ifdef minor
|
||||
#undef minor
|
||||
#endif
|
||||
|
||||
void VerifyJavaInstall::executeTask() {
|
||||
auto m_inst = std::dynamic_pointer_cast<MinecraftInstance>(m_parent->instance());
|
||||
|
||||
|
@ -24,7 +24,10 @@ void AssetUpdateTask::executeTask()
|
||||
auto assets = profile->getMinecraftAssets();
|
||||
QUrl indexUrl = assets->url;
|
||||
QString localPath = assets->id + ".json";
|
||||
auto job = new NetJob(tr("Asset index for %1").arg(m_inst->name()));
|
||||
auto job = new NetJob(
|
||||
tr("Asset index for %1").arg(m_inst->name()),
|
||||
APPLICATION->network()
|
||||
);
|
||||
|
||||
auto metacache = APPLICATION->metacache();
|
||||
auto entry = metacache->resolveEntry("asset_indexes", localPath);
|
||||
@ -43,7 +46,7 @@ void AssetUpdateTask::executeTask()
|
||||
connect(downloadJob.get(), &NetJob::progress, this, &AssetUpdateTask::progress);
|
||||
|
||||
qDebug() << m_inst->name() << ": Starting asset index download";
|
||||
downloadJob->start(APPLICATION->network());
|
||||
downloadJob->start();
|
||||
}
|
||||
|
||||
bool AssetUpdateTask::canAbort() const
|
||||
@ -78,7 +81,7 @@ void AssetUpdateTask::assetIndexFinished()
|
||||
connect(downloadJob.get(), &NetJob::succeeded, this, &AssetUpdateTask::emitSucceeded);
|
||||
connect(downloadJob.get(), &NetJob::failed, this, &AssetUpdateTask::assetsFailed);
|
||||
connect(downloadJob.get(), &NetJob::progress, this, &AssetUpdateTask::progress);
|
||||
downloadJob->start(APPLICATION->network());
|
||||
downloadJob->start();
|
||||
return;
|
||||
}
|
||||
emitSucceeded();
|
||||
|
@ -61,7 +61,7 @@ void FMLLibrariesTask::executeTask()
|
||||
|
||||
// download missing libs to our place
|
||||
setStatus(tr("Downloading FML libraries..."));
|
||||
auto dljob = new NetJob("FML libraries");
|
||||
auto dljob = new NetJob("FML libraries", APPLICATION->network());
|
||||
auto metacache = APPLICATION->metacache();
|
||||
for (auto &lib : fmlLibsToProcess)
|
||||
{
|
||||
@ -74,7 +74,7 @@ void FMLLibrariesTask::executeTask()
|
||||
connect(dljob, &NetJob::failed, this, &FMLLibrariesTask::fmllibsFailed);
|
||||
connect(dljob, &NetJob::progress, this, &FMLLibrariesTask::progress);
|
||||
downloadJob.reset(dljob);
|
||||
downloadJob->start(APPLICATION->network());
|
||||
downloadJob->start();
|
||||
}
|
||||
|
||||
bool FMLLibrariesTask::canAbort() const
|
||||
|
@ -20,7 +20,7 @@ void LibrariesTask::executeTask()
|
||||
auto components = inst->getPackProfile();
|
||||
auto profile = components->getProfile();
|
||||
|
||||
auto job = new NetJob(tr("Libraries for instance %1").arg(inst->name()));
|
||||
auto job = new NetJob(tr("Libraries for instance %1").arg(inst->name()), APPLICATION->network());
|
||||
downloadJob.reset(job);
|
||||
|
||||
auto metacache = APPLICATION->metacache();
|
||||
@ -65,7 +65,7 @@ void LibrariesTask::executeTask()
|
||||
connect(downloadJob.get(), &NetJob::succeeded, this, &LibrariesTask::emitSucceeded);
|
||||
connect(downloadJob.get(), &NetJob::failed, this, &LibrariesTask::jarlibFailed);
|
||||
connect(downloadJob.get(), &NetJob::progress, this, &LibrariesTask::progress);
|
||||
downloadJob->start(APPLICATION->network());
|
||||
downloadJob->start();
|
||||
}
|
||||
|
||||
bool LibrariesTask::canAbort() const
|
||||
|
@ -58,12 +58,12 @@ bool PackInstallTask::abort()
|
||||
void PackInstallTask::executeTask()
|
||||
{
|
||||
qDebug() << "PackInstallTask::executeTask: " << QThread::currentThreadId();
|
||||
auto *netJob = new NetJob("ATLauncher::VersionFetch");
|
||||
auto *netJob = new NetJob("ATLauncher::VersionFetch", APPLICATION->network());
|
||||
auto searchUrl = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "packs/%1/versions/%2/Configs.json")
|
||||
.arg(m_pack).arg(m_version_name);
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &PackInstallTask::onDownloadSucceeded);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &PackInstallTask::onDownloadFailed);
|
||||
@ -424,7 +424,7 @@ void PackInstallTask::installConfigs()
|
||||
{
|
||||
qDebug() << "PackInstallTask::installConfigs: " << QThread::currentThreadId();
|
||||
setStatus(tr("Downloading configs..."));
|
||||
jobPtr.reset(new NetJob(tr("Config download")));
|
||||
jobPtr = new NetJob(tr("Config download"), APPLICATION->network());
|
||||
|
||||
auto path = QString("Configs/%1/%2.zip").arg(m_pack).arg(m_version_name);
|
||||
auto url = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "packs/%1/versions/%2/Configs.zip")
|
||||
@ -458,7 +458,7 @@ void PackInstallTask::installConfigs()
|
||||
setProgress(current, total);
|
||||
});
|
||||
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
}
|
||||
|
||||
void PackInstallTask::extractConfigs()
|
||||
@ -508,7 +508,7 @@ void PackInstallTask::downloadMods()
|
||||
setStatus(tr("Downloading mods..."));
|
||||
|
||||
jarmods.clear();
|
||||
jobPtr.reset(new NetJob(tr("Mod download")));
|
||||
jobPtr = new NetJob(tr("Mod download"), APPLICATION->network());
|
||||
for(const auto& mod : m_version.mods) {
|
||||
// skip non-client mods
|
||||
if(!mod.client) continue;
|
||||
@ -613,7 +613,7 @@ void PackInstallTask::downloadMods()
|
||||
setProgress(current, total);
|
||||
});
|
||||
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
}
|
||||
|
||||
void PackInstallTask::onModsDownloaded() {
|
||||
|
@ -14,7 +14,7 @@ void Flame::FileResolvingTask::executeTask()
|
||||
{
|
||||
setStatus(tr("Resolving mod IDs..."));
|
||||
setProgress(0, m_toProcess.files.size());
|
||||
m_dljob = new NetJob("Mod id resolver");
|
||||
m_dljob = new NetJob("Mod id resolver", m_network);
|
||||
results.resize(m_toProcess.files.size());
|
||||
int index = 0;
|
||||
for(auto & file: m_toProcess.files)
|
||||
@ -27,7 +27,7 @@ void Flame::FileResolvingTask::executeTask()
|
||||
index ++;
|
||||
}
|
||||
connect(m_dljob.get(), &NetJob::finished, this, &Flame::FileResolvingTask::netJobFinished);
|
||||
m_dljob->start(m_network);
|
||||
m_dljob->start();
|
||||
}
|
||||
|
||||
void Flame::FileResolvingTask::netJobFinished()
|
||||
|
@ -12,7 +12,7 @@ void PackFetchTask::fetch()
|
||||
publicPacks.clear();
|
||||
thirdPartyPacks.clear();
|
||||
|
||||
jobPtr = new NetJob("LegacyFTB::ModpackFetch");
|
||||
jobPtr = new NetJob("LegacyFTB::ModpackFetch", m_network);
|
||||
|
||||
QUrl publicPacksUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/modpacks.xml");
|
||||
qDebug() << "Downloading public version info from" << publicPacksUrl.toString();
|
||||
@ -25,7 +25,7 @@ void PackFetchTask::fetch()
|
||||
QObject::connect(jobPtr.get(), &NetJob::succeeded, this, &PackFetchTask::fileDownloadFinished);
|
||||
QObject::connect(jobPtr.get(), &NetJob::failed, this, &PackFetchTask::fileDownloadFailed);
|
||||
|
||||
jobPtr->start(m_network);
|
||||
jobPtr->start();
|
||||
}
|
||||
|
||||
void PackFetchTask::fetchPrivate(const QStringList & toFetch)
|
||||
@ -35,7 +35,7 @@ void PackFetchTask::fetchPrivate(const QStringList & toFetch)
|
||||
for (auto &packCode: toFetch)
|
||||
{
|
||||
QByteArray *data = new QByteArray();
|
||||
NetJob *job = new NetJob("Fetching private pack");
|
||||
NetJob *job = new NetJob("Fetching private pack", m_network);
|
||||
job->addNetAction(Net::Download::makeByteArray(privatePackBaseUrl.arg(packCode), data));
|
||||
|
||||
QObject::connect(job, &NetJob::succeeded, this, [this, job, data, packCode]
|
||||
@ -63,7 +63,7 @@ void PackFetchTask::fetchPrivate(const QStringList & toFetch)
|
||||
delete data;
|
||||
});
|
||||
|
||||
job->start(m_network);
|
||||
job->start();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ void PackInstallTask::downloadPack()
|
||||
|
||||
auto packoffset = QString("%1/%2/%3").arg(m_pack.dir, m_version.replace(".", "_"), m_pack.file);
|
||||
auto entry = APPLICATION->metacache()->resolveEntry("FTBPacks", packoffset);
|
||||
netJobContainer = new NetJob("Download FTB Pack");
|
||||
netJobContainer = new NetJob("Download FTB Pack", m_network);
|
||||
|
||||
entry->setStale(true);
|
||||
QString url;
|
||||
@ -51,7 +51,7 @@ void PackInstallTask::downloadPack()
|
||||
connect(netJobContainer.get(), &NetJob::succeeded, this, &PackInstallTask::onDownloadSucceeded);
|
||||
connect(netJobContainer.get(), &NetJob::failed, this, &PackInstallTask::onDownloadFailed);
|
||||
connect(netJobContainer.get(), &NetJob::progress, this, &PackInstallTask::onDownloadProgress);
|
||||
netJobContainer->start(m_network);
|
||||
netJobContainer->start();
|
||||
|
||||
progress(1, 4);
|
||||
}
|
||||
|
@ -63,12 +63,11 @@ void PackInstallTask::executeTask()
|
||||
return;
|
||||
}
|
||||
|
||||
auto *netJob = new NetJob("ModpacksCH::VersionFetch");
|
||||
auto searchUrl = QString(BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/%1/%2")
|
||||
.arg(m_pack.id).arg(version.id);
|
||||
auto *netJob = new NetJob("ModpacksCH::VersionFetch", APPLICATION->network());
|
||||
auto searchUrl = QString(BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/%1/%2").arg(m_pack.id).arg(version.id);
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &PackInstallTask::onDownloadSucceeded);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &PackInstallTask::onDownloadFailed);
|
||||
@ -113,7 +112,7 @@ void PackInstallTask::downloadPack()
|
||||
{
|
||||
setStatus(tr("Downloading mods..."));
|
||||
|
||||
jobPtr = new NetJob(tr("Mod download"));
|
||||
jobPtr = new NetJob(tr("Mod download"), APPLICATION->network());
|
||||
for(auto file : m_version.files) {
|
||||
if(file.serverOnly) continue;
|
||||
|
||||
@ -159,7 +158,7 @@ void PackInstallTask::downloadPack()
|
||||
setProgress(current, total);
|
||||
});
|
||||
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
}
|
||||
|
||||
void PackInstallTask::install()
|
||||
|
@ -44,14 +44,14 @@ void Technic::SingleZipPackInstallTask::executeTask()
|
||||
const QString path = m_sourceUrl.host() + '/' + m_sourceUrl.path();
|
||||
auto entry = APPLICATION->metacache()->resolveEntry("general", path);
|
||||
entry->setStale(true);
|
||||
m_filesNetJob.reset(new NetJob(tr("Modpack download")));
|
||||
m_filesNetJob = new NetJob(tr("Modpack download"), APPLICATION->network());
|
||||
m_filesNetJob->addNetAction(Net::Download::makeCached(m_sourceUrl, entry));
|
||||
m_archivePath = entry->getFullPath();
|
||||
auto job = m_filesNetJob.get();
|
||||
connect(job, &NetJob::succeeded, this, &Technic::SingleZipPackInstallTask::downloadSucceeded);
|
||||
connect(job, &NetJob::progress, this, &Technic::SingleZipPackInstallTask::downloadProgressChanged);
|
||||
connect(job, &NetJob::failed, this, &Technic::SingleZipPackInstallTask::downloadFailed);
|
||||
m_filesNetJob->start(APPLICATION->network());
|
||||
m_filesNetJob->start();
|
||||
}
|
||||
|
||||
void Technic::SingleZipPackInstallTask::downloadSucceeded()
|
||||
|
@ -42,12 +42,12 @@ bool Technic::SolderPackInstallTask::abort() {
|
||||
void Technic::SolderPackInstallTask::executeTask()
|
||||
{
|
||||
setStatus(tr("Finding recommended version:\n%1").arg(m_sourceUrl.toString()));
|
||||
m_filesNetJob.reset(new NetJob(tr("Finding recommended version")));
|
||||
m_filesNetJob = new NetJob(tr("Finding recommended version"), m_network);
|
||||
m_filesNetJob->addNetAction(Net::Download::makeByteArray(m_sourceUrl, &m_response));
|
||||
auto job = m_filesNetJob.get();
|
||||
connect(job, &NetJob::succeeded, this, &Technic::SolderPackInstallTask::versionSucceeded);
|
||||
connect(job, &NetJob::failed, this, &Technic::SolderPackInstallTask::downloadFailed);
|
||||
m_filesNetJob->start(m_network);
|
||||
m_filesNetJob->start();
|
||||
}
|
||||
|
||||
void Technic::SolderPackInstallTask::versionSucceeded()
|
||||
@ -67,12 +67,12 @@ void Technic::SolderPackInstallTask::versionSucceeded()
|
||||
}
|
||||
|
||||
setStatus(tr("Resolving modpack files:\n%1").arg(m_sourceUrl.toString()));
|
||||
m_filesNetJob.reset(new NetJob(tr("Resolving modpack files")));
|
||||
m_filesNetJob = new NetJob(tr("Resolving modpack files"), m_network);
|
||||
m_filesNetJob->addNetAction(Net::Download::makeByteArray(m_sourceUrl, &m_response));
|
||||
auto job = m_filesNetJob.get();
|
||||
connect(job, &NetJob::succeeded, this, &Technic::SolderPackInstallTask::fileListSucceeded);
|
||||
connect(job, &NetJob::failed, this, &Technic::SolderPackInstallTask::downloadFailed);
|
||||
m_filesNetJob->start(m_network);
|
||||
m_filesNetJob->start();
|
||||
}
|
||||
|
||||
void Technic::SolderPackInstallTask::fileListSucceeded()
|
||||
@ -99,7 +99,7 @@ void Technic::SolderPackInstallTask::fileListSucceeded()
|
||||
m_filesNetJob.reset();
|
||||
return;
|
||||
}
|
||||
m_filesNetJob.reset(new NetJob(tr("Downloading modpack")));
|
||||
m_filesNetJob = new NetJob(tr("Downloading modpack"), m_network);
|
||||
int i = 0;
|
||||
for (auto &modUrl: modUrls)
|
||||
{
|
||||
@ -113,7 +113,7 @@ void Technic::SolderPackInstallTask::fileListSucceeded()
|
||||
connect(m_filesNetJob.get(), &NetJob::succeeded, this, &Technic::SolderPackInstallTask::downloadSucceeded);
|
||||
connect(m_filesNetJob.get(), &NetJob::progress, this, &Technic::SolderPackInstallTask::downloadProgressChanged);
|
||||
connect(m_filesNetJob.get(), &NetJob::failed, this, &Technic::SolderPackInstallTask::downloadFailed);
|
||||
m_filesNetJob->start(m_network);
|
||||
m_filesNetJob->start();
|
||||
}
|
||||
|
||||
void Technic::SolderPackInstallTask::downloadSucceeded()
|
||||
|
@ -29,7 +29,7 @@ class NetJob : public Task
|
||||
public:
|
||||
using Ptr = shared_qobject_ptr<NetJob>;
|
||||
|
||||
explicit NetJob(QString job_name) : Task()
|
||||
explicit NetJob(QString job_name, shared_qobject_ptr<QNetworkAccessManager> network) : Task(), m_network(network)
|
||||
{
|
||||
setObjectName(job_name);
|
||||
}
|
||||
@ -65,19 +65,6 @@ private slots:
|
||||
public slots:
|
||||
virtual void executeTask() override;
|
||||
virtual bool abort() override;
|
||||
virtual void start(shared_qobject_ptr<QNetworkAccessManager> network) {
|
||||
m_network = network;
|
||||
start();
|
||||
}
|
||||
|
||||
protected slots:
|
||||
void start() override {
|
||||
if(!m_network) {
|
||||
throw "Missing network while trying to start " + objectName();
|
||||
return;
|
||||
}
|
||||
Task::start();
|
||||
}
|
||||
|
||||
private slots:
|
||||
void partProgress(int index, qint64 bytesReceived, qint64 bytesTotal);
|
||||
|
@ -37,12 +37,12 @@ void NewsChecker::reloadNews()
|
||||
|
||||
qDebug() << "Reloading news.";
|
||||
|
||||
NetJob* job = new NetJob("News RSS Feed");
|
||||
NetJob* job = new NetJob("News RSS Feed", m_network);
|
||||
job->addNetAction(Net::Download::makeByteArray(m_feedUrl, &newsData));
|
||||
QObject::connect(job, &NetJob::succeeded, this, &NewsChecker::rssDownloadFinished);
|
||||
QObject::connect(job, &NetJob::failed, this, &NewsChecker::rssDownloadFailed);
|
||||
m_newsNetJob.reset(job);
|
||||
job->start(m_network);
|
||||
job->start();
|
||||
}
|
||||
|
||||
void NewsChecker::rssDownloadFinished()
|
||||
|
@ -52,12 +52,12 @@ void NotificationChecker::checkForNotifications()
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_checkJob.reset(new NetJob("Checking for notifications"));
|
||||
m_checkJob = new NetJob("Checking for notifications", APPLICATION->network());
|
||||
auto entry = APPLICATION->metacache()->resolveEntry("root", "notifications.json");
|
||||
entry->setStale(true);
|
||||
m_checkJob->addNetAction(m_download = Net::Download::makeCached(m_notificationsUrl, entry));
|
||||
connect(m_download.get(), &Net::Download::succeeded, this, &NotificationChecker::downloadSucceeded);
|
||||
m_checkJob->start(APPLICATION->network());
|
||||
m_checkJob->start();
|
||||
}
|
||||
|
||||
void NotificationChecker::downloadSucceeded(int)
|
||||
|
@ -52,7 +52,7 @@ QString MCEditTool::getProgramPath()
|
||||
#else
|
||||
const QString mceditPath = path();
|
||||
QDir mceditDir(mceditPath);
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
if (mceditDir.exists("mcedit.sh"))
|
||||
{
|
||||
return mceditDir.absoluteFilePath("mcedit.sh");
|
||||
|
@ -573,14 +573,14 @@ void TranslationsModel::downloadIndex()
|
||||
return;
|
||||
}
|
||||
qDebug() << "Downloading Translations Index...";
|
||||
d->m_index_job.reset(new NetJob("Translations Index"));
|
||||
d->m_index_job = new NetJob("Translations Index", APPLICATION->network());
|
||||
MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("translations", "index_v2.json");
|
||||
entry->setStale(true);
|
||||
d->m_index_task = Net::Download::makeCached(QUrl("https://files.multimc.org/translations/index_v2.json"), entry);
|
||||
d->m_index_job->addNetAction(d->m_index_task);
|
||||
connect(d->m_index_job.get(), &NetJob::failed, this, &TranslationsModel::indexFailed);
|
||||
connect(d->m_index_job.get(), &NetJob::succeeded, this, &TranslationsModel::indexReceived);
|
||||
d->m_index_job->start(APPLICATION->network());
|
||||
d->m_index_job->start();
|
||||
}
|
||||
|
||||
void TranslationsModel::updateLanguage(QString key)
|
||||
@ -625,13 +625,13 @@ void TranslationsModel::downloadTranslation(QString key)
|
||||
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawHash));
|
||||
dl->m_total_progress = lang->file_size;
|
||||
|
||||
d->m_dl_job.reset(new NetJob("Translation for " + key));
|
||||
d->m_dl_job = new NetJob("Translation for " + key, APPLICATION->network());
|
||||
d->m_dl_job->addNetAction(dl);
|
||||
|
||||
connect(d->m_dl_job.get(), &NetJob::succeeded, this, &TranslationsModel::dlGood);
|
||||
connect(d->m_dl_job.get(), &NetJob::failed, this, &TranslationsModel::dlFailed);
|
||||
|
||||
d->m_dl_job->start(APPLICATION->network());
|
||||
d->m_dl_job->start();
|
||||
}
|
||||
|
||||
void TranslationsModel::downloadNext()
|
||||
|
@ -133,10 +133,10 @@ AboutDialog::~AboutDialog()
|
||||
|
||||
void AboutDialog::loadPatronList()
|
||||
{
|
||||
netJob = new NetJob("Patreon Patron List");
|
||||
netJob = new NetJob("Patreon Patron List", APPLICATION->network());
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl("https://files.multimc.org/patrons.txt"), &dataSink));
|
||||
connect(netJob.get(), &NetJob::succeeded, this, &AboutDialog::patronListLoaded);
|
||||
netJob->start(APPLICATION->network());
|
||||
netJob->start();
|
||||
}
|
||||
|
||||
void AboutDialog::patronListLoaded()
|
||||
|
@ -34,7 +34,7 @@ UpdateDialog::~UpdateDialog()
|
||||
void UpdateDialog::loadChangelog()
|
||||
{
|
||||
auto channel = APPLICATION->settings()->get("UpdateChannel").toString();
|
||||
dljob.reset(new NetJob("Changelog"));
|
||||
dljob = new NetJob("Changelog", APPLICATION->network());
|
||||
QString url;
|
||||
if(channel == "stable")
|
||||
{
|
||||
@ -49,7 +49,7 @@ void UpdateDialog::loadChangelog()
|
||||
dljob->addNetAction(Net::Download::makeByteArray(QUrl(url), &changelogData));
|
||||
connect(dljob.get(), &NetJob::succeeded, this, &UpdateDialog::changelogLoaded);
|
||||
connect(dljob.get(), &NetJob::failed, this, &UpdateDialog::changelogFailed);
|
||||
dljob->start(APPLICATION->network());
|
||||
dljob->start();
|
||||
}
|
||||
|
||||
QString reprocessMarkdown(QByteArray markdown)
|
||||
|
@ -304,7 +304,7 @@ void ScreenshotsPage::on_actionUpload_triggered()
|
||||
return;
|
||||
|
||||
QList<ScreenShot::Ptr> uploaded;
|
||||
auto job = NetJob::Ptr(new NetJob("Screenshot Upload"));
|
||||
auto job = NetJob::Ptr(new NetJob("Screenshot Upload", APPLICATION->network()));
|
||||
if(selection.size() < 2)
|
||||
{
|
||||
auto item = selection.at(0);
|
||||
@ -314,6 +314,7 @@ void ScreenshotsPage::on_actionUpload_triggered()
|
||||
|
||||
m_uploadActive = true;
|
||||
ProgressDialog dialog(this);
|
||||
|
||||
if(dialog.execWithTask(job.get()) != QDialog::Accepted)
|
||||
{
|
||||
CustomMessageBox::selectable(this, tr("Failed to upload screenshots!"),
|
||||
@ -345,7 +346,7 @@ void ScreenshotsPage::on_actionUpload_triggered()
|
||||
job->addNetAction(ImgurUpload::make(screenshot));
|
||||
}
|
||||
SequentialTask task;
|
||||
auto albumTask = NetJob::Ptr(new NetJob("Imgur Album Creation"));
|
||||
auto albumTask = NetJob::Ptr(new NetJob("Imgur Album Creation", APPLICATION->network()));
|
||||
auto imgurAlbum = ImgurAlbumCreation::make(uploaded);
|
||||
albumTask->addNetAction(imgurAlbum);
|
||||
task.addTask(job);
|
||||
@ -354,8 +355,12 @@ void ScreenshotsPage::on_actionUpload_triggered()
|
||||
ProgressDialog prog(this);
|
||||
if (prog.execWithTask(&task) != QDialog::Accepted)
|
||||
{
|
||||
CustomMessageBox::selectable(this, tr("Failed to upload screenshots!"),
|
||||
tr("Unknown error"), QMessageBox::Warning)->exec();
|
||||
CustomMessageBox::selectable(
|
||||
this,
|
||||
tr("Failed to upload screenshots!"),
|
||||
tr("Unknown error"),
|
||||
QMessageBox::Warning
|
||||
)->exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -86,11 +86,11 @@ void ListModel::request()
|
||||
modpacks.clear();
|
||||
endResetModel();
|
||||
|
||||
auto *netJob = new NetJob("Atl::Request");
|
||||
auto *netJob = new NetJob("Atl::Request", APPLICATION->network());
|
||||
auto url = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "launcher/json/packsnew.json");
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(url), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::requestFinished);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &ListModel::requestFailed);
|
||||
@ -183,7 +183,7 @@ void ListModel::requestLogo(QString file, QString url)
|
||||
}
|
||||
|
||||
MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("ATLauncherPacks", QString("logos/%1").arg(file.section(".", 0, 0)));
|
||||
NetJob *job = new NetJob(QString("ATLauncher Icon Download %1").arg(file));
|
||||
NetJob *job = new NetJob(QString("ATLauncher Icon Download %1").arg(file), APPLICATION->network());
|
||||
job->addNetAction(Net::Download::makeCached(QUrl(url), entry));
|
||||
|
||||
auto fullPath = entry->getFullPath();
|
||||
@ -201,7 +201,7 @@ void ListModel::requestLogo(QString file, QString url)
|
||||
emit logoFailed(file);
|
||||
});
|
||||
|
||||
job->start(APPLICATION->network());
|
||||
job->start();
|
||||
|
||||
m_loadingLogos.append(file);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ void ListModel::requestLogo(QString logo, QString url)
|
||||
}
|
||||
|
||||
MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("FlamePacks", QString("logos/%1").arg(logo.section(".", 0, 0)));
|
||||
NetJob *job = new NetJob(QString("Flame Icon Download %1").arg(logo));
|
||||
NetJob *job = new NetJob(QString("Flame Icon Download %1").arg(logo), APPLICATION->network());
|
||||
job->addNetAction(Net::Download::makeCached(QUrl(url), entry));
|
||||
|
||||
auto fullPath = entry->getFullPath();
|
||||
@ -118,7 +118,7 @@ void ListModel::requestLogo(QString logo, QString url)
|
||||
emit logoFailed(logo);
|
||||
});
|
||||
|
||||
job->start(APPLICATION->network());
|
||||
job->start();
|
||||
|
||||
m_loadingLogos.append(logo);
|
||||
}
|
||||
@ -158,7 +158,7 @@ void ListModel::fetchMore(const QModelIndex& parent)
|
||||
|
||||
void ListModel::performPaginatedSearch()
|
||||
{
|
||||
NetJob *netJob = new NetJob("Flame::Search");
|
||||
NetJob *netJob = new NetJob("Flame::Search", APPLICATION->network());
|
||||
auto searchUrl = QString(
|
||||
"https://addons-ecs.forgesvc.net/api/v2/addon/search?"
|
||||
"categoryId=0&"
|
||||
@ -171,7 +171,7 @@ void ListModel::performPaginatedSearch()
|
||||
).arg(nextSearchOffset).arg(currentSearchTerm).arg(currentSort);
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::searchRequestFinished);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &ListModel::searchRequestFailed);
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ void FlamePage::onSelectionChanged(QModelIndex first, QModelIndex second)
|
||||
if (current.versionsLoaded == false)
|
||||
{
|
||||
qDebug() << "Loading flame modpack versions";
|
||||
NetJob *netJob = new NetJob(QString("Flame::PackVersions(%1)").arg(current.name));
|
||||
NetJob *netJob = new NetJob(QString("Flame::PackVersions(%1)").arg(current.name), APPLICATION->network());
|
||||
std::shared_ptr<QByteArray> response = std::make_shared<QByteArray>();
|
||||
int addonId = current.addonId;
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QString("https://addons-ecs.forgesvc.net/api/v2/addon/%1/files").arg(addonId), response.get()));
|
||||
@ -140,7 +140,7 @@ void FlamePage::onSelectionChanged(QModelIndex first, QModelIndex second)
|
||||
|
||||
suggestCurrent();
|
||||
});
|
||||
netJob->start(APPLICATION->network());
|
||||
netJob->start();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -107,11 +107,11 @@ void ListModel::request()
|
||||
modpacks.clear();
|
||||
endResetModel();
|
||||
|
||||
auto *netJob = new NetJob("Ftb::Request");
|
||||
auto *netJob = new NetJob("Ftb::Request", APPLICATION->network());
|
||||
auto url = QString(BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/all");
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(url), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::requestFinished);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &ListModel::requestFailed);
|
||||
@ -150,12 +150,11 @@ void ListModel::requestFailed(QString reason)
|
||||
|
||||
void ListModel::requestPack()
|
||||
{
|
||||
auto *netJob = new NetJob("Ftb::Search");
|
||||
auto searchUrl = QString(BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/%1")
|
||||
.arg(currentPack);
|
||||
auto *netJob = new NetJob("Ftb::Search", APPLICATION->network());
|
||||
auto searchUrl = QString(BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/%1").arg(currentPack);
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::packRequestFinished);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &ListModel::packRequestFailed);
|
||||
@ -271,7 +270,7 @@ void ListModel::requestLogo(QString logo, QString url)
|
||||
|
||||
bool stale = entry->isStale();
|
||||
|
||||
NetJob *job = new NetJob(QString("FTB Icon Download %1").arg(logo));
|
||||
NetJob *job = new NetJob(QString("FTB Icon Download %1").arg(logo), APPLICATION->network());
|
||||
job->addNetAction(Net::Download::makeCached(QUrl(url), entry));
|
||||
|
||||
auto fullPath = entry->getFullPath();
|
||||
@ -288,7 +287,7 @@ void ListModel::requestLogo(QString logo, QString url)
|
||||
auto &newLogoEntry = m_logoMap[logo];
|
||||
newLogoEntry.downloadJob = job;
|
||||
newLogoEntry.fullpath = fullPath;
|
||||
job->start(APPLICATION->network());
|
||||
job->start();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ void ListModel::requestLogo(QString file)
|
||||
}
|
||||
|
||||
MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("FTBPacks", QString("logos/%1").arg(file.section(".", 0, 0)));
|
||||
NetJob *job = new NetJob(QString("FTB Icon Download for %1").arg(file));
|
||||
NetJob *job = new NetJob(QString("FTB Icon Download for %1").arg(file), APPLICATION->network());
|
||||
job->addNetAction(Net::Download::makeCached(QUrl(QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/%1").arg(file)), entry));
|
||||
|
||||
auto fullPath = entry->getFullPath();
|
||||
@ -234,7 +234,7 @@ void ListModel::requestLogo(QString file)
|
||||
emit logoFailed(file);
|
||||
});
|
||||
|
||||
job->start(APPLICATION->network());
|
||||
job->start();
|
||||
|
||||
m_loadingLogos.append(file);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ void Technic::ListModel::searchWithTerm(const QString& term)
|
||||
|
||||
void Technic::ListModel::performSearch()
|
||||
{
|
||||
NetJob *netJob = new NetJob("Technic::Search");
|
||||
NetJob *netJob = new NetJob("Technic::Search", APPLICATION->network());
|
||||
QString searchUrl = "";
|
||||
if (currentSearchTerm.isEmpty()) {
|
||||
searchUrl = "https://api.technicpack.net/trending?build=multimc";
|
||||
@ -104,7 +104,7 @@ void Technic::ListModel::performSearch()
|
||||
}
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start(APPLICATION->network());
|
||||
jobPtr->start();
|
||||
QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::searchRequestFinished);
|
||||
QObject::connect(netJob, &NetJob::failed, this, &ListModel::searchRequestFailed);
|
||||
}
|
||||
@ -216,7 +216,7 @@ void Technic::ListModel::requestLogo(QString logo, QString url)
|
||||
}
|
||||
|
||||
MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("TechnicPacks", QString("logos/%1").arg(logo));
|
||||
NetJob *job = new NetJob(QString("Technic Icon Download %1").arg(logo));
|
||||
NetJob *job = new NetJob(QString("Technic Icon Download %1").arg(logo), APPLICATION->network());
|
||||
job->addNetAction(Net::Download::makeCached(QUrl(url), entry));
|
||||
|
||||
auto fullPath = entry->getFullPath();
|
||||
@ -231,7 +231,7 @@ void Technic::ListModel::requestLogo(QString logo, QString url)
|
||||
logoFailed(logo);
|
||||
});
|
||||
|
||||
job->start(APPLICATION->network());
|
||||
job->start();
|
||||
|
||||
m_loadingLogos.append(logo);
|
||||
}
|
||||
|
@ -110,8 +110,8 @@ void TechnicPage::suggestCurrent()
|
||||
metadataLoaded();
|
||||
return;
|
||||
}
|
||||
|
||||
NetJob *netJob = new NetJob(QString("Technic::PackMeta(%1)").arg(current.name));
|
||||
|
||||
NetJob *netJob = new NetJob(QString("Technic::PackMeta(%1)").arg(current.name), APPLICATION->network());
|
||||
std::shared_ptr<QByteArray> response = std::make_shared<QByteArray>();
|
||||
QString slug = current.slug;
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QString("https://api.technicpack.net/modpack/%1?build=multimc").arg(slug), response.get()));
|
||||
@ -167,7 +167,7 @@ void TechnicPage::suggestCurrent()
|
||||
current.metadataLoaded = true;
|
||||
metadataLoaded();
|
||||
});
|
||||
netJob->start(APPLICATION->network());
|
||||
netJob->start();
|
||||
}
|
||||
|
||||
// expects current.metadataLoaded to be true
|
||||
|
@ -319,7 +319,7 @@ void JavaSettingsWidget::on_javaStatusBtn_clicked()
|
||||
}
|
||||
CustomMessageBox::selectable(
|
||||
this,
|
||||
failed ? QObject::tr("Java test success") : QObject::tr("Java test failure"),
|
||||
failed ? QObject::tr("Java test failure") : QObject::tr("Java test success"),
|
||||
text,
|
||||
failed ? QMessageBox::Critical : QMessageBox::Information
|
||||
)->show();
|
||||
|
@ -47,7 +47,7 @@ void DownloadTask::loadVersionInfo()
|
||||
{
|
||||
setStatus(tr("Loading version information..."));
|
||||
|
||||
NetJob *netJob = new NetJob("Version Info");
|
||||
NetJob *netJob = new NetJob("Version Info", m_network);
|
||||
|
||||
// Find the index URL.
|
||||
QUrl newIndexUrl = QUrl(m_status.newRepoUrl).resolved(QString::number(m_status.newVersionId) + ".json");
|
||||
@ -67,7 +67,7 @@ void DownloadTask::loadVersionInfo()
|
||||
connect(netJob, &NetJob::succeeded, this, &DownloadTask::processDownloadedVersionInfo);
|
||||
connect(netJob, &NetJob::failed, this, &DownloadTask::vinfoDownloadFailed);
|
||||
m_vinfoNetJob.reset(netJob);
|
||||
netJob->start(m_network);
|
||||
netJob->start();
|
||||
}
|
||||
|
||||
void DownloadTask::vinfoDownloadFailed()
|
||||
@ -121,7 +121,7 @@ void DownloadTask::processDownloadedVersionInfo()
|
||||
setStatus(tr("Processing file lists - figuring out how to install the update..."));
|
||||
|
||||
// make a new netjob for the actual update files
|
||||
NetJob::Ptr netJob (new NetJob("Update Files"));
|
||||
NetJob::Ptr netJob = new NetJob("Update Files", m_network);
|
||||
|
||||
// fill netJob and operationList
|
||||
if (!processFileLists(m_currentVersionFileList, m_newVersionFileList, m_status.rootPath, m_updateFilesDir.path(), netJob, m_operations))
|
||||
@ -145,7 +145,7 @@ void DownloadTask::processDownloadedVersionInfo()
|
||||
}
|
||||
qDebug() << "Begin downloading update files to" << m_updateFilesDir.path();
|
||||
m_filesNetJob = netJob;
|
||||
m_filesNetJob->start(m_network);
|
||||
m_filesNetJob->start();
|
||||
}
|
||||
|
||||
void DownloadTask::fileDownloadFinished()
|
||||
|
@ -179,7 +179,8 @@ slots:
|
||||
|
||||
OperationList operations;
|
||||
|
||||
processFileLists(currentVersion, newVersion, QDir::currentPath(), tempFolder, new NetJob("Dummy"), operations);
|
||||
shared_qobject_ptr<QNetworkAccessManager> network = new QNetworkAccessManager();
|
||||
processFileLists(currentVersion, newVersion, QDir::currentPath(), tempFolder, new NetJob("Dummy", network), operations);
|
||||
qDebug() << (operations == expectedOperations);
|
||||
qDebug() << operations;
|
||||
qDebug() << expectedOperations;
|
||||
|
@ -104,11 +104,11 @@ void UpdateChecker::checkForUpdate(QString updateChannel, bool notifyNoUpdate)
|
||||
|
||||
QUrl indexUrl = QUrl(m_newRepoUrl).resolved(QUrl("index.json"));
|
||||
|
||||
indexJob = new NetJob("GoUpdate Repository Index");
|
||||
indexJob = new NetJob("GoUpdate Repository Index", m_network);
|
||||
indexJob->addNetAction(Net::Download::makeByteArray(indexUrl, &indexData));
|
||||
connect(indexJob.get(), &NetJob::succeeded, [this, notifyNoUpdate](){ updateCheckFinished(notifyNoUpdate); });
|
||||
connect(indexJob.get(), &NetJob::failed, this, &UpdateChecker::updateCheckFailed);
|
||||
indexJob->start(m_network);
|
||||
indexJob->start();
|
||||
}
|
||||
|
||||
void UpdateChecker::updateCheckFinished(bool notifyNoUpdate)
|
||||
@ -191,11 +191,11 @@ void UpdateChecker::updateChanList(bool notifyNoUpdate)
|
||||
}
|
||||
|
||||
m_chanListLoading = true;
|
||||
chanListJob = new NetJob("Update System Channel List");
|
||||
chanListJob = new NetJob("Update System Channel List", m_network);
|
||||
chanListJob->addNetAction(Net::Download::makeByteArray(QUrl(m_channelUrl), &chanlistData));
|
||||
connect(chanListJob.get(), &NetJob::succeeded, [this, notifyNoUpdate]() { chanListDownloadFinished(notifyNoUpdate); });
|
||||
connect(chanListJob.get(), &NetJob::failed, this, &UpdateChecker::chanListDownloadFailed);
|
||||
chanListJob->start(m_network);
|
||||
chanListJob->start();
|
||||
}
|
||||
|
||||
void UpdateChecker::chanListDownloadFinished(bool notifyNoUpdate)
|
||||
|
@ -320,7 +320,7 @@ Description: Make it so that the QIcon loader honors /usr/share/pixmaps
|
||||
icon theme specification.
|
||||
Bug: https://bugreports.qt.nokia.com/browse/QTBUG-12874
|
||||
*********************************************************************/
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
|
||||
/* Freedesktop standard says to look in /usr/share/pixmaps last */
|
||||
if (entries.isEmpty())
|
||||
{
|
||||
|
@ -47,6 +47,7 @@ Sys::KernelInfo Sys::getKernelInfo()
|
||||
uint64_t Sys::getSystemRam()
|
||||
{
|
||||
std::string token;
|
||||
#ifdef Q_OS_LINUX
|
||||
std::ifstream file("/proc/meminfo");
|
||||
while(file >> token)
|
||||
{
|
||||
@ -65,6 +66,19 @@ uint64_t Sys::getSystemRam()
|
||||
// ignore rest of the line
|
||||
file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
}
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
char buff[512];
|
||||
FILE *fp = popen("sysctl hw.physmem", "r");
|
||||
if (fp != NULL)
|
||||
{
|
||||
while(fgets(buff, 512, fp) != NULL)
|
||||
{
|
||||
std::string str(buff);
|
||||
uint64_t mem = std::stoull(str.substr(12, std::string::npos));
|
||||
return mem * 1024ull;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0; // nothing found
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@ set(Launcher_ConfigFile "polymc.cfg" PARENT_SCOPE)
|
||||
set(Launcher_Git "https://github.com/PolyMC/PolyMC" PARENT_SCOPE)
|
||||
|
||||
set(Launcher_Desktop "program_info/polymc.desktop" PARENT_SCOPE)
|
||||
set(Launcher_Branding_ICNS "program_info/Launcher.icns" PARENT_SCOPE)
|
||||
set(Launcher_Branding_WindowsRC "program_info/launcher.rc" PARENT_SCOPE)
|
||||
set(Launcher_Branding_LogoQRC "program_info/logo.qrc" PARENT_SCOPE)
|
||||
set(Launcher_Branding_ICNS "program_info/polymc.icns" PARENT_SCOPE)
|
||||
set(Launcher_Branding_WindowsRC "program_info/polymc.rc" PARENT_SCOPE)
|
||||
set(Launcher_Branding_LogoQRC "program_info/polymc.qrc" PARENT_SCOPE)
|
||||
|
||||
configure_file(polymc.desktop.in polymc.desktop)
|
||||
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 100 KiB |
@ -3,3 +3,4 @@
|
||||
This is PolyMC's program info which contains information about:
|
||||
- Application name and logo (and branding in general)
|
||||
- Various URLs and API endpoints
|
||||
- Desktop file
|
||||
|
@ -1,18 +1,19 @@
|
||||
#/bin/bash
|
||||
|
||||
inkscape -w 16 -h 16 -o logo_16.png logo.svg
|
||||
inkscape -w 24 -h 24 -o logo_24.png logo.svg
|
||||
inkscape -w 32 -h 32 -o logo_32.png logo.svg
|
||||
inkscape -w 48 -h 48 -o logo_48.png logo.svg
|
||||
inkscape -w 64 -h 64 -o logo_64.png logo.svg
|
||||
inkscape -w 128 -h 128 -o logo_128.png logo.svg
|
||||
inkscape -w 16 -h 16 -o polymc_16.png polymc.svg
|
||||
inkscape -w 24 -h 24 -o polymc_24.png polymc.svg
|
||||
inkscape -w 32 -h 32 -o polymc_32.png polymc.svg
|
||||
inkscape -w 48 -h 48 -o polymc_48.png polymc.svg
|
||||
inkscape -w 64 -h 64 -o polymc_64.png polymc.svg
|
||||
inkscape -w 128 -h 128 -o polymc_128.png polymc.svg
|
||||
|
||||
convert logo_128.png logo_64.png logo_48.png logo_32.png logo_24.png logo_16.png Launcher.ico
|
||||
convert polymc_128.png polymc_64.png polymc_48.png polymc_32.png polymc_24.png polymc_16.png polymc.ico
|
||||
|
||||
inkscape -w 256 -h 256 -o logo_256.png logo.svg
|
||||
inkscape -w 512 -h 512 -o logo_512.png logo.svg
|
||||
inkscape -w 1024 -h 1024 -o logo_1024.png logo.svg
|
||||
inkscape -w 256 -h 256 -o polymc_256.png polymc.svg
|
||||
inkscape -w 512 -h 512 -o polymc_512.png polymc.svg
|
||||
inkscape -w 1024 -h 1024 -o polymc_1024.png polymc.svg
|
||||
|
||||
png2icns Launcher.icns logo_1024.png logo_512.png logo_256.png logo_128.png logo_32.png logo_16.png
|
||||
png2icns polymc.icns polymc_1024.png polymc_512.png polymc_256.png polymc_128.png polymc_32.png polymc_16.png
|
||||
|
||||
rm -f logo_*.png
|
||||
rm -f polymc_*.png
|
||||
rm -rf polymc.iconset
|
||||
|
@ -1,271 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="68.26667"
|
||||
height="68.26667"
|
||||
id="svg4427"
|
||||
version="1.1"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
sodipodi:docname="logo.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs4429">
|
||||
<linearGradient
|
||||
id="linearGradient5668"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop5670"
|
||||
offset="0"
|
||||
style="stop-color:#75b54b;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop5672"
|
||||
offset="1"
|
||||
style="stop-color:#75b54b;stop-opacity:0.6" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5084"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop5086"
|
||||
offset="0"
|
||||
style="stop-color:#000000;stop-opacity:0.8" />
|
||||
<stop
|
||||
id="stop5088"
|
||||
offset="1"
|
||||
style="stop-color:#000000;stop-opacity:0.35" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5668"
|
||||
id="linearGradient5072"
|
||||
x1="6.7342591"
|
||||
y1="28.510933"
|
||||
x2="50.506943"
|
||||
y2="61.773685"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-0.01532073,-0.00938002)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5084"
|
||||
id="linearGradient5082"
|
||||
x1="14.312115"
|
||||
y1="9.7948904"
|
||||
x2="44.097023"
|
||||
y2="82.973114"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5668"
|
||||
id="linearGradient3281"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-0.01532073,-0.00938002)"
|
||||
x1="6.7342591"
|
||||
y1="28.510933"
|
||||
x2="50.506943"
|
||||
y2="61.773685" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5668"
|
||||
id="linearGradient3283"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-0.01532073,-0.00938002)"
|
||||
x1="6.7342591"
|
||||
y1="28.510933"
|
||||
x2="50.506943"
|
||||
y2="61.773685" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5084"
|
||||
id="linearGradient3288"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="14.312115"
|
||||
y1="9.7948904"
|
||||
x2="44.097023"
|
||||
y2="82.973114" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5084"
|
||||
id="linearGradient3290"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="14.312115"
|
||||
y1="9.7948904"
|
||||
x2="44.097023"
|
||||
y2="82.973114" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5580">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:0.0627451"
|
||||
offset="0"
|
||||
id="stop5576" />
|
||||
<stop
|
||||
style="stop-color:#252424;stop-opacity:0.58823532"
|
||||
offset="1"
|
||||
id="stop5578" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3999"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3995"
|
||||
offset="0"
|
||||
style="stop-color:#777777;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop3997"
|
||||
offset="1"
|
||||
style="stop-color:#4f4e4e;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2727"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop2723"
|
||||
offset="0"
|
||||
style="stop-color:#7f8080;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop2725"
|
||||
offset="1"
|
||||
style="stop-color:#404040;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2727"
|
||||
id="linearGradient2050"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="36.546478"
|
||||
y1="33.80484"
|
||||
x2="86.415741"
|
||||
y2="97.065842"
|
||||
gradientTransform="translate(-0.0016031,-4.5764148e-4)" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3999"
|
||||
id="radialGradient2052"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-0.00142193,-4.5702768e-4)"
|
||||
cx="34.133331"
|
||||
cy="34.133335"
|
||||
fx="34.133331"
|
||||
fy="34.133335"
|
||||
r="29.866665" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5580"
|
||||
id="linearGradient2140"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-0.0010513,-9.083059e-4)"
|
||||
x1="29.866674"
|
||||
y1="29.867579"
|
||||
x2="38.400005"
|
||||
y2="38.400913" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8.0000001"
|
||||
inkscape:cx="-15.9375"
|
||||
inkscape:cy="15.75"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:window-width="3840"
|
||||
inkscape:window-height="2129"
|
||||
inkscape:window-x="1200"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:snap-smooth-nodes="true"
|
||||
inkscape:snap-midpoints="false"
|
||||
inkscape:snap-intersection-paths="true"
|
||||
inkscape:object-paths="true"
|
||||
inkscape:snap-object-midpoints="true"
|
||||
inkscape:snap-text-baseline="true"
|
||||
inkscape:snap-center="true"
|
||||
inkscape:pagecheckerboard="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4446"
|
||||
empspacing="16"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true"
|
||||
spacingx="4.2666667"
|
||||
spacingy="4.2666667"
|
||||
originx="0"
|
||||
originy="0" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata4432">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
id="g2048"
|
||||
transform="translate(9.113e-4,0.00104183)">
|
||||
<rect
|
||||
rx="8.5333338"
|
||||
ry="8.5333338"
|
||||
style="fill:url(#linearGradient2050);fill-opacity:1;stroke:none;stroke-width:17.0667"
|
||||
id="rect2026"
|
||||
width="68.266998"
|
||||
height="68.26667"
|
||||
x="-0.0016037956"
|
||||
y="-0.00045376646" />
|
||||
<rect
|
||||
rx="4.2666626"
|
||||
y="4.2662144"
|
||||
x="4.2652307"
|
||||
height="59.733334"
|
||||
width="59.73333"
|
||||
id="rect2028"
|
||||
style="opacity:0.5;fill:url(#radialGradient2052);fill-opacity:1;stroke:none;stroke-width:14.9333"
|
||||
ry="4.2666669" />
|
||||
<path
|
||||
style="opacity:1;fill:url(#linearGradient2140);fill-opacity:1;stroke:none;stroke-width:17.06666756"
|
||||
d="m 8.5322887,-9.083059e-4 c -4.72747,0 -8.5332,3.8057359059 -8.5332,8.5332029059 V 59.731515 c 0,4.727467 3.80573,8.535156 8.5332,8.535156 H 59.731502 c 4.72747,0 8.5332,-3.807689 8.5332,-8.535156 V 8.5322946 c 0,-4.727467 -3.80573,-8.5332029059 -8.5332,-8.5332029059 z m 0,4.2675779059 H 59.731502 c 2.36373,0 4.26758,1.901892 4.26758,4.265625 V 59.731515 c 0,2.363733 -1.90385,4.267578 -4.26758,4.267578 H 8.5322887 c -2.36373,0 -4.26758,-1.903845 -4.26758,-4.267578 V 8.5322946 c 0,-2.363733 1.90385,-4.265625 4.26758,-4.265625 z"
|
||||
id="path2046"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:#000000;fill-opacity:0.494118;fill-rule:evenodd;stroke:none;stroke-width:0.999996px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 17.343575,15.030602 -1e-6,43.517002 38.229105,-21.758501 z"
|
||||
id="path1382"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:#00ff66;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.999996px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 16.888808,11.986385 -1e-6,43.517003 38.229104,-21.758501 z"
|
||||
id="path1059"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
id="path13539"
|
||||
style="fill:#ff00ff;fill-opacity:0.992157;fill-rule:evenodd;stroke:none;stroke-width:0.999996px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 19.576616,50.882478 C 29.612077,45.170295 39.647539,39.458112 49.682999,33.745928 39.647539,28.032869 29.612077,22.319811 19.576616,16.606753 c 0,11.425241 0,22.850484 0,34.275725 z" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 8.9 KiB |
@ -4,7 +4,7 @@ Name=PolyMC
|
||||
Comment=A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once.
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Exec=polymc
|
||||
Exec=@Launcher_APP_BINARY_NAME@
|
||||
StartupNotify=true
|
||||
Icon=polymc
|
||||
Categories=Game;
|
BIN
program_info/polymc.icns
Normal file
BIN
program_info/polymc.icns
Normal file
Binary file not shown.
BIN
program_info/polymc.ico
Normal file
BIN
program_info/polymc.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<assemblyIdentity name="MultiMC.Application.5" type="win32" version="5.0.0.0" />
|
||||
<assemblyIdentity name="PolyMC.Application.5" type="win32" version="5.0.0.0" />
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
@ -26,6 +26,6 @@
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!--The ID below indicates app support for Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
</application>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
@ -1,8 +1,6 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>logo.svg</file>
|
||||
<file>polymc.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "Launcher.ico"
|
||||
1 RT_MANIFEST "Launcher.manifest"
|
||||
IDI_ICON1 ICON DISCARDABLE "polymc.ico"
|
||||
1 RT_MANIFEST "polymc.manifest"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
@ -15,10 +15,10 @@ BEGIN
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "MultiMC Contributors"
|
||||
VALUE "CompanyName", "MultiMC & PolyMC Contributors"
|
||||
VALUE "FileDescription", "A Minecraft Launcher"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
VALUE "ProductName", "Launcher"
|
||||
VALUE "ProductName", "PolyMC"
|
||||
VALUE "ProductVersion", "5"
|
||||
END
|
||||
END
|
17
program_info/polymc.svg
Normal file
17
program_info/polymc.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 47 KiB |
Reference in New Issue
Block a user