mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-30 20:27:02 +00:00
@@ -578,7 +578,9 @@ public:
|
||||
MainWindow->resize(800, 600);
|
||||
MainWindow->setWindowIcon(MMC->getThemedIcon("logo"));
|
||||
MainWindow->setWindowTitle("MultiMC 5");
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
MainWindow->setAccessibleName("MultiMC");
|
||||
#endif
|
||||
|
||||
createMainToolbar(MainWindow);
|
||||
|
||||
|
||||
@@ -146,6 +146,27 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
||||
|
||||
startTime = QDateTime::currentDateTime();
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
{
|
||||
QFile osrelease("/proc/sys/kernel/osrelease");
|
||||
if (osrelease.open(QFile::ReadOnly | QFile::Text)) {
|
||||
QTextStream in(&osrelease);
|
||||
auto contents = in.readAll();
|
||||
if(
|
||||
contents.contains("WSL", Qt::CaseInsensitive) ||
|
||||
contents.contains("Microsoft", Qt::CaseInsensitive)
|
||||
) {
|
||||
showFatalErrorMessage(
|
||||
"Unsupported system detected!",
|
||||
"Linux-on-Windows distributions are not supported.\n\n"
|
||||
"Please use the Windows MultiMC binary when playing on Windows."
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Don't quit on hiding the last window
|
||||
this->setQuitOnLastWindowClosed(false);
|
||||
|
||||
@@ -867,8 +888,7 @@ void MultiMC::messageReceived(const QString& message)
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList args = message.split(' ');
|
||||
QString command = args.takeFirst();
|
||||
QString command = message.section(' ', 0, 0);
|
||||
|
||||
if(command == "activate")
|
||||
{
|
||||
@@ -876,21 +896,23 @@ void MultiMC::messageReceived(const QString& message)
|
||||
}
|
||||
else if(command == "import")
|
||||
{
|
||||
if(args.isEmpty())
|
||||
QString arg = message.section(' ', 1);
|
||||
if(arg.isEmpty())
|
||||
{
|
||||
qWarning() << "Received" << command << "message without a zip path/URL.";
|
||||
return;
|
||||
}
|
||||
m_mainWindow->droppedURLs({ QUrl(args.takeFirst()) });
|
||||
m_mainWindow->droppedURLs({ QUrl(arg) });
|
||||
}
|
||||
else if(command == "launch")
|
||||
{
|
||||
if(args.isEmpty())
|
||||
QString arg = message.section(' ', 1);
|
||||
if(arg.isEmpty())
|
||||
{
|
||||
qWarning() << "Received" << command << "message without an instance ID.";
|
||||
return;
|
||||
}
|
||||
auto inst = instances()->getInstanceById(args.takeFirst());
|
||||
auto inst = instances()->getInstanceById(arg);
|
||||
if(inst)
|
||||
{
|
||||
launch(inst, true, nullptr);
|
||||
|
||||
@@ -95,7 +95,7 @@ void ProxyPage::loadSettings()
|
||||
ui->proxyHTTPBtn->setChecked(true);
|
||||
|
||||
ui->proxyAddrEdit->setText(s->get("ProxyAddr").toString());
|
||||
ui->proxyPortEdit->setValue(s->get("ProxyPort").value<qint16>());
|
||||
ui->proxyPortEdit->setValue(s->get("ProxyPort").value<uint16_t>());
|
||||
ui->proxyUserEdit->setText(s->get("ProxyUser").toString());
|
||||
ui->proxyPassEdit->setText(s->get("ProxyPass").toString());
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override
|
||||
{
|
||||
QVariant var = QIdentityProxyModel::data(mapToSource(proxyIndex), role);
|
||||
QVariant var = QIdentityProxyModel::data(proxyIndex, role);
|
||||
int column = proxyIndex.column();
|
||||
if(column == 0 && role == Qt::DecorationRole && m_parentWidget)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user