diff options
| author | Trial97 <alexandru.tripon97@gmail.com> | 2023-05-31 20:12:12 +0300 | 
|---|---|---|
| committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-05-31 20:12:12 +0300 | 
| commit | 29c3dc40ef7f5b1fce5ab5970a39613d0f7f5089 (patch) | |
| tree | ce92f8a86d08531879105a16194a14391c0ae2ea /launcher/ui/pages/global | |
| parent | e8ee4497f77a571b305a48b70f84c8729b800859 (diff) | |
| parent | 954d4d701a136e79c25b58f9680d26a555a6e6fe (diff) | |
| download | PrismLauncher-29c3dc40ef7f5b1fce5ab5970a39613d0f7f5089.tar.gz PrismLauncher-29c3dc40ef7f5b1fce5ab5970a39613d0f7f5089.tar.bz2 PrismLauncher-29c3dc40ef7f5b1fce5ab5970a39613d0f7f5089.zip | |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into logdir
Diffstat (limited to 'launcher/ui/pages/global')
| -rw-r--r-- | launcher/ui/pages/global/APIPage.cpp | 7 | ||||
| -rw-r--r-- | launcher/ui/pages/global/APIPage.ui | 51 | ||||
| -rw-r--r-- | launcher/ui/pages/global/LauncherPage.cpp | 239 | ||||
| -rw-r--r-- | launcher/ui/pages/global/LauncherPage.h | 13 | ||||
| -rw-r--r-- | launcher/ui/pages/global/LauncherPage.ui | 257 | ||||
| -rw-r--r-- | launcher/ui/pages/global/MinecraftPage.cpp | 1 | ||||
| -rw-r--r-- | launcher/ui/pages/global/MinecraftPage.ui | 133 | 
7 files changed, 213 insertions, 488 deletions
| diff --git a/launcher/ui/pages/global/APIPage.cpp b/launcher/ui/pages/global/APIPage.cpp index e3d30475..f662ee1c 100644 --- a/launcher/ui/pages/global/APIPage.cpp +++ b/launcher/ui/pages/global/APIPage.cpp @@ -1,9 +1,10 @@  // SPDX-License-Identifier: GPL-3.0-only  /* - *  PolyMC - Minecraft Launcher + *  Prism Launcher - Minecraft Launcher   *  Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>   *  Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>   *  Copyright (c) 2022 Lenny McLennington <lenny@sneed.church> + *  Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>   *   *  This program is free software: you can redistribute it and/or modify   *  it under the terms of the GNU General Public License as published by @@ -147,6 +148,8 @@ void APIPage::loadSettings()      ui->metaURL->setText(metaURL);      QString flameKey = s->get("FlameKeyOverride").toString();      ui->flameKey->setText(flameKey); +    QString modrinthToken = s->get("ModrinthToken").toString(); +    ui->modrinthToken->setText(modrinthToken);      QString customUserAgent = s->get("UserAgentOverride").toString();      ui->userAgentLineEdit->setText(customUserAgent);  } @@ -177,6 +180,8 @@ void APIPage::applySettings()      s->set("MetaURLOverride", metaURL);      QString flameKey = ui->flameKey->text();      s->set("FlameKeyOverride", flameKey); +    QString modrinthToken = ui->modrinthToken->text(); +    s->set("ModrinthToken", modrinthToken);      s->set("UserAgentOverride", ui->userAgentLineEdit->text());  } diff --git a/launcher/ui/pages/global/APIPage.ui b/launcher/ui/pages/global/APIPage.ui index d56a9ef6..40b89d91 100644 --- a/launcher/ui/pages/global/APIPage.ui +++ b/launcher/ui/pages/global/APIPage.ui @@ -196,24 +196,69 @@          </widget>         </item>         <item> -        <widget class="QGroupBox" name="groupBox_flame"> +        <widget class="QGroupBox" name="groupBox_modrinth">           <property name="enabled">            <bool>true</bool>           </property>           <property name="title"> -          <string>&CurseForge Core API</string> +          <string>&Modrinth API</string>           </property>           <layout class="QGridLayout" name="gridLayout">            <item row="0" column="0">             <widget class="QLabel" name="label_8">              <property name="text"> -             <string>Note: you probably don't need to set this if CurseForge already works.</string> +             <string><html><head/><body><p>Note: you only need to set this to access private data. Read the <a href="https://docs.modrinth.com/api-spec/#section/Authentication">documentation</a> for more information.</p></body></html></string>              </property>             </widget>            </item>            <item row="2" column="0">             <widget class="QLabel" name="label_7">              <property name="text"> +             <string>Enter a custom API token for Modrinth here.</string> +            </property> +            <property name="textFormat"> +             <enum>Qt::RichText</enum> +            </property> +            <property name="wordWrap"> +             <bool>true</bool> +            </property> +            <property name="openExternalLinks"> +             <bool>true</bool> +            </property> +           </widget> +          </item> +          <item row="1" column="0"> +           <widget class="QLineEdit" name="modrinthToken"> +            <property name="enabled"> +             <bool>true</bool> +            </property> +            <property name="placeholderText"> +             <string>(None)</string> +            </property> +           </widget> +          </item> +         </layout> +        </widget> +       </item> +       <item> +        <widget class="QGroupBox" name="groupBox_flame"> +         <property name="enabled"> +          <bool>true</bool> +         </property> +         <property name="title"> +          <string>&CurseForge Core API</string> +         </property> +         <layout class="QGridLayout" name="gridLayout_2"> +          <item row="0" column="0"> +           <widget class="QLabel" name="label_10"> +            <property name="text"> +             <string>Note: you probably don't need to set this if CurseForge already works.</string> +            </property> +           </widget> +          </item> +          <item row="2" column="0"> +           <widget class="QLabel" name="label_9"> +            <property name="text">               <string>Enter a custom API Key for CurseForge here.</string>              </property>              <property name="textFormat"> diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index cae0635f..816dde72 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -44,14 +44,13 @@  #include <QTextCharFormat>  #include <QMenuBar> -#include "updater/UpdateChecker.h" -  #include "settings/SettingsObject.h"  #include <FileSystem.h>  #include "Application.h"  #include "BuildConfig.h"  #include "DesktopServices.h"  #include "ui/themes/ITheme.h" +#include "updater/ExternalUpdater.h"  #include <QApplication>  #include <QProcess> @@ -80,32 +79,12 @@ LauncherPage::LauncherPage(QWidget *parent) : QWidget(parent), ui(new Ui::Launch      m_languageModel = APPLICATION->translations();      loadSettings(); -    if(BuildConfig.UPDATER_ENABLED) -    { -        QObject::connect(APPLICATION->updateChecker().get(), &UpdateChecker::channelListLoaded, this, &LauncherPage::refreshUpdateChannelList); - -        if (APPLICATION->updateChecker()->hasChannels()) -        { -            refreshUpdateChannelList(); -        } -        else -        { -            APPLICATION->updateChecker()->updateChanList(false); -        } +    ui->updateSettingsBox->setHidden(!APPLICATION->updater()); -        if (APPLICATION->updateChecker()->getExternalUpdater()) -        { -            ui->updateChannelComboBox->setVisible(false); -            ui->updateChannelDescLabel->setVisible(false); -            ui->updateChannelLabel->setVisible(false); -        } -    } -    else -    { -        ui->updateSettingsBox->setHidden(true); -    }      connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), SLOT(refreshFontPreview()));      connect(ui->consoleFont, SIGNAL(currentFontChanged(QFont)), SLOT(refreshFontPreview())); + +    connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentCatChanged, APPLICATION, &Application::currentCatChanged);  }  LauncherPage::~LauncherPage() @@ -161,8 +140,8 @@ void LauncherPage::on_instDirBrowseBtn_clicked()              if (result == QMessageBox::Ok)              {                  ui->instDirTextBox->setText(cooked_dir); -            }  -        }  +            } +        }          else          {              ui->instDirTextBox->setText(cooked_dir); @@ -181,6 +160,7 @@ void LauncherPage::on_iconsDirBrowseBtn_clicked()          ui->iconsDirTextBox->setText(cooked_dir);      }  } +  void LauncherPage::on_modsDirBrowseBtn_clicked()  {      QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Mods Folder"), ui->modsDirTextBox->text()); @@ -193,81 +173,20 @@ void LauncherPage::on_modsDirBrowseBtn_clicked()      }  } -void LauncherPage::on_metadataDisableBtn_clicked() +void LauncherPage::on_downloadsDirBrowseBtn_clicked()  { -    ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked()); -} +    QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Downloads Folder"), ui->downloadsDirTextBox->text()); -void LauncherPage::refreshUpdateChannelList() -{ -    // Stop listening for selection changes. It's going to change a lot while we update it and -    // we don't need to update the -    // description label constantly. -    QObject::disconnect(ui->updateChannelComboBox, SIGNAL(currentIndexChanged(int)), this, -                        SLOT(updateChannelSelectionChanged(int))); - -    QList<UpdateChecker::ChannelListEntry> channelList = APPLICATION->updateChecker()->getChannelList(); -    ui->updateChannelComboBox->clear(); -    int selection = -1; -    for (int i = 0; i < channelList.count(); i++) +    if (!raw_dir.isEmpty() && QDir(raw_dir).exists())      { -        UpdateChecker::ChannelListEntry entry = channelList.at(i); - -        // When it comes to selection, we'll rely on the indexes of a channel entry being the -        // same in the -        // combo box as it is in the update checker's channel list. -        // This probably isn't very safe, but the channel list doesn't change often enough (or -        // at all) for -        // this to be a big deal. Hope it doesn't break... -        ui->updateChannelComboBox->addItem(entry.name); - -        // If the update channel we just added was the selected one, set the current index in -        // the combo box to it. -        if (entry.id == m_currentUpdateChannel) -        { -            qDebug() << "Selected index" << i << "channel id" << m_currentUpdateChannel; -            selection = i; -        } +        QString cooked_dir = FS::NormalizePath(raw_dir); +        ui->downloadsDirTextBox->setText(cooked_dir);      } - -    ui->updateChannelComboBox->setCurrentIndex(selection); - -    // Start listening for selection changes again and update the description label. -    QObject::connect(ui->updateChannelComboBox, SIGNAL(currentIndexChanged(int)), this, -                     SLOT(updateChannelSelectionChanged(int))); -    refreshUpdateChannelDesc(); - -    // Now that we've updated the channel list, we can enable the combo box. -    // It starts off disabled so that if the channel list hasn't been loaded, it will be -    // disabled. -    ui->updateChannelComboBox->setEnabled(true); -} - -void LauncherPage::updateChannelSelectionChanged(int index) -{ -    refreshUpdateChannelDesc();  } -void LauncherPage::refreshUpdateChannelDesc() +void LauncherPage::on_metadataDisableBtn_clicked()  { -    // Get the channel list. -    QList<UpdateChecker::ChannelListEntry> channelList = APPLICATION->updateChecker()->getChannelList(); -    int selectedIndex = ui->updateChannelComboBox->currentIndex(); -    if (selectedIndex < 0) -    { -        return; -    } -    if (selectedIndex < channelList.count()) -    { -        // Find the channel list entry with the given index. -        UpdateChecker::ChannelListEntry selected = channelList.at(selectedIndex); - -        // Set the description text. -        ui->updateChannelDescLabel->setText(selected.description); - -        // Set the currently selected channel ID. -        m_currentUpdateChannel = selected.id; -    } +    ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());  }  void LauncherPage::applySettings() @@ -275,82 +194,9 @@ void LauncherPage::applySettings()      auto s = APPLICATION->settings();      // Updates -    if (BuildConfig.UPDATER_ENABLED && APPLICATION->updateChecker()->getExternalUpdater()) +    if (APPLICATION->updater())      { -        APPLICATION->updateChecker()->getExternalUpdater()->setAutomaticallyChecksForUpdates( -                ui->autoUpdateCheckBox->isChecked()); -    } -    else -    { -        s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked()); -    } - -    s->set("UpdateChannel", m_currentUpdateChannel); -    auto original = s->get("IconTheme").toString(); -    //FIXME: make generic -    switch (ui->themeComboBox->currentIndex()) -    { -    case 0: -        s->set("IconTheme", "pe_colored"); -        break; -    case 1: -        s->set("IconTheme", "pe_light"); -        break; -    case 2: -        s->set("IconTheme", "pe_dark"); -        break; -    case 3: -        s->set("IconTheme", "pe_blue"); -        break; -    case 4: -        s->set("IconTheme", "breeze_light"); -        break; -    case 5: -        s->set("IconTheme", "breeze_dark"); -        break; -    case 6: -        s->set("IconTheme", "OSX"); -        break; -    case 7: -        s->set("IconTheme", "iOS"); -        break; -    case 8: -        s->set("IconTheme", "flat"); -        break; -    case 9: -        s->set("IconTheme", "flat_white"); -        break; -    case 10: -        s->set("IconTheme", "multimc"); -        break; -    case 11: -        s->set("IconTheme", "custom"); -        break; -    } - -    if(original != s->get("IconTheme")) -    { -        APPLICATION->setIconTheme(s->get("IconTheme").toString()); -    } - -    auto originalAppTheme = s->get("ApplicationTheme").toString(); -    auto newAppTheme = ui->themeComboBoxColors->currentData().toString(); -    if(originalAppTheme != newAppTheme) -    { -        s->set("ApplicationTheme", newAppTheme); -        APPLICATION->setApplicationTheme(newAppTheme, false); -    } - -    switch (ui->themeBackgroundCat->currentIndex()) { -    case 0: // original cat -        s->set("BackgroundCat", "kitteh"); -        break; -    case 1: // rory the cat -        s->set("BackgroundCat", "rory"); -        break; -    case 2: // rory the cat flat edition -        s->set("BackgroundCat", "rory-flat"); -        break; +        APPLICATION->updater()->setAutomaticallyChecksForUpdates(ui->autoUpdateCheckBox->isChecked());      }      s->set("MenuBarInsteadOfToolBar", ui->preferMenuBarCheckBox->isChecked()); @@ -370,6 +216,8 @@ void LauncherPage::applySettings()      s->set("InstanceDir", ui->instDirTextBox->text());      s->set("CentralModsDir", ui->modsDirTextBox->text());      s->set("IconsDir", ui->iconsDirTextBox->text()); +    s->set("DownloadsDir", ui->downloadsDirTextBox->text()); +    s->set("DownloadsDirWatchRecursive", ui->downloadsDirWatchRecursiveCheckBox->isChecked());      auto sortMode = (InstSortMode)ui->sortingModeGroup->checkedId();      switch (sortMode) @@ -390,56 +238,11 @@ void LauncherPage::loadSettings()  {      auto s = APPLICATION->settings();      // Updates -    if (BuildConfig.UPDATER_ENABLED && APPLICATION->updateChecker()->getExternalUpdater()) -    { -        ui->autoUpdateCheckBox->setChecked( -                APPLICATION->updateChecker()->getExternalUpdater()->getAutomaticallyChecksForUpdates()); -    } -    else +    if (APPLICATION->updater())      { -        ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool()); +        ui->autoUpdateCheckBox->setChecked(APPLICATION->updater()->getAutomaticallyChecksForUpdates());      } -    m_currentUpdateChannel = s->get("UpdateChannel").toString(); -    //FIXME: make generic -    auto theme = s->get("IconTheme").toString(); -    QStringList iconThemeOptions{"pe_colored",  -                                 "pe_light",  -                                 "pe_dark",  -                                 "pe_blue",  -                                 "breeze_light",  -                                 "breeze_dark",  -                                 "OSX",  -                                 "iOS",  -                                 "flat",  -                                 "flat_white",  -                                 "multimc",  -                                 "custom"}; -    ui->themeComboBox->setCurrentIndex(iconThemeOptions.indexOf(theme)); - -    auto cat = s->get("BackgroundCat").toString(); -    if (cat == "kitteh") { -        ui->themeBackgroundCat->setCurrentIndex(0); -    } else if (cat == "rory") { -        ui->themeBackgroundCat->setCurrentIndex(1); -    } else if (cat == "rory-flat") { -        ui->themeBackgroundCat->setCurrentIndex(2); -    } - -    { -        auto currentTheme = s->get("ApplicationTheme").toString(); -        auto themes = APPLICATION->getValidApplicationThemes(); -        int idx = 0; -        for(auto &theme: themes) -        { -            ui->themeComboBoxColors->addItem(theme->name(), theme->id()); -            if(currentTheme == theme->id()) -            { -                ui->themeComboBoxColors->setCurrentIndex(idx); -            } -            idx++; -        } -    }      // Toolbar/menu bar settings (not applicable if native menu bar is present)      ui->toolsBox->setEnabled(!QMenuBar().isNativeMenuBar()); @@ -471,6 +274,8 @@ void LauncherPage::loadSettings()      ui->instDirTextBox->setText(s->get("InstanceDir").toString());      ui->modsDirTextBox->setText(s->get("CentralModsDir").toString());      ui->iconsDirTextBox->setText(s->get("IconsDir").toString()); +    ui->downloadsDirTextBox->setText(s->get("DownloadsDir").toString()); +    ui->downloadsDirWatchRecursiveCheckBox->setChecked(s->get("DownloadsDirWatchRecursive").toBool());      QString sortMode = s->get("InstSortMode").toString(); diff --git a/launcher/ui/pages/global/LauncherPage.h b/launcher/ui/pages/global/LauncherPage.h index f38c922e..33f66f1b 100644 --- a/launcher/ui/pages/global/LauncherPage.h +++ b/launcher/ui/pages/global/LauncherPage.h @@ -88,25 +88,14 @@ slots:      void on_instDirBrowseBtn_clicked();      void on_modsDirBrowseBtn_clicked();      void on_iconsDirBrowseBtn_clicked(); +    void on_downloadsDirBrowseBtn_clicked();      void on_metadataDisableBtn_clicked();      /*! -     * Updates the list of update channels in the combo box. -     */ -    void refreshUpdateChannelList(); - -    /*! -     * Updates the channel description label. -     */ -    void refreshUpdateChannelDesc(); - -    /*!       * Updates the font preview       */      void refreshFontPreview(); -    void updateChannelSelectionChanged(int index); -  private:      Ui::LauncherPage *ui; diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index c44718a1..55bd3eea 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -6,7 +6,7 @@     <rect>      <x>0</x>      <y>0</y> -    <width>514</width> +    <width>511</width>      <height>629</height>     </rect>    </property> @@ -58,42 +58,54 @@              </property>             </widget>            </item> -          <item> -           <widget class="QLabel" name="updateChannelLabel"> +         </layout> +        </widget> +       </item> +       <item> +        <widget class="QGroupBox" name="foldersBox"> +         <property name="title"> +          <string>Folders</string> +         </property> +         <layout class="QGridLayout" name="foldersBoxLayout"> +          <item row="3" column="0"> +           <widget class="QLabel" name="labelDownloadsDir">              <property name="text"> -             <string>Up&date Channel:</string> +             <string>&Downloads:</string>              </property>              <property name="buddy"> -             <cstring>updateChannelComboBox</cstring> +             <cstring>downloadsDirTextBox</cstring>              </property>             </widget>            </item> -          <item> -           <widget class="QComboBox" name="updateChannelComboBox"> -            <property name="enabled"> -             <bool>false</bool> +          <item row="0" column="0"> +           <widget class="QLabel" name="labelInstDir"> +            <property name="text"> +             <string>I&nstances:</string> +            </property> +            <property name="buddy"> +             <cstring>instDirTextBox</cstring>              </property>             </widget>            </item> -          <item> -           <widget class="QLabel" name="updateChannelDescLabel"> +          <item row="0" column="1"> +           <widget class="QLineEdit" name="instDirTextBox"/> +          </item> +          <item row="3" column="1"> +           <widget class="QLineEdit" name="downloadsDirTextBox"/> +          </item> +          <item row="2" column="1"> +           <widget class="QLineEdit" name="iconsDirTextBox"/> +          </item> +          <item row="3" column="2"> +           <widget class="QToolButton" name="downloadsDirBrowseBtn">              <property name="text"> -             <string>No channel selected.</string> -            </property> -            <property name="wordWrap"> -             <bool>true</bool> +             <string notr="true">...</string>              </property>             </widget>            </item> -         </layout> -        </widget> -       </item> -       <item> -        <widget class="QGroupBox" name="foldersBox"> -         <property name="title"> -          <string>Folders</string> -         </property> -         <layout class="QGridLayout" name="foldersBoxLayout"> +          <item row="1" column="1"> +           <widget class="QLineEdit" name="modsDirTextBox"/> +          </item>            <item row="1" column="2">             <widget class="QToolButton" name="modsDirBrowseBtn">              <property name="text"> @@ -101,6 +113,16 @@              </property>             </widget>            </item> +          <item row="1" column="0"> +           <widget class="QLabel" name="labelModsDir"> +            <property name="text"> +             <string>&Mods:</string> +            </property> +            <property name="buddy"> +             <cstring>modsDirTextBox</cstring> +            </property> +           </widget> +          </item>            <item row="0" column="2">             <widget class="QToolButton" name="instDirBrowseBtn">              <property name="text"> @@ -115,9 +137,6 @@              </property>             </widget>            </item> -          <item row="0" column="1"> -           <widget class="QLineEdit" name="instDirTextBox"/> -          </item>            <item row="2" column="0">             <widget class="QLabel" name="labelIconsDir">              <property name="text"> @@ -128,29 +147,13 @@              </property>             </widget>            </item> -          <item row="1" column="1"> -           <widget class="QLineEdit" name="modsDirTextBox"/> -          </item> -          <item row="0" column="0"> -           <widget class="QLabel" name="labelInstDir"> -            <property name="text"> -             <string>I&nstances:</string> -            </property> -            <property name="buddy"> -             <cstring>instDirTextBox</cstring> +          <item row="4" column="1" colspan="2"> +           <widget class="QCheckBox" name="downloadsDirWatchRecursiveCheckBox"> +            <property name="toolTip"> +             <string>When enabled, in addition to the downloads folder, its sub folders will also be searched when looking for resources (e.g. when looking for blocked mods on CurseForge).</string>              </property> -           </widget> -          </item> -          <item row="2" column="1"> -           <widget class="QLineEdit" name="iconsDirTextBox"/> -          </item> -          <item row="1" column="0"> -           <widget class="QLabel" name="labelModsDir">              <property name="text"> -             <string>&Mods:</string> -            </property> -            <property name="buddy"> -             <cstring>modsDirTextBox</cstring> +             <string>Check downloads folder recursively</string>              </property>             </widget>            </item> @@ -243,150 +246,9 @@           <property name="title">            <string>Theme</string>           </property> -         <layout class="QFormLayout" name="formLayout"> -          <item row="0" column="0"> -           <widget class="QLabel" name="label_3"> -            <property name="text"> -             <string>&Icons</string> -            </property> -            <property name="buddy"> -             <cstring>themeComboBox</cstring> -            </property> -           </widget> -          </item> -          <item row="0" column="1"> -           <widget class="QComboBox" name="themeComboBox"> -            <property name="sizePolicy"> -             <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> -              <horstretch>0</horstretch> -              <verstretch>0</verstretch> -             </sizepolicy> -            </property> -            <property name="focusPolicy"> -             <enum>Qt::StrongFocus</enum> -            </property> -            <item> -             <property name="text"> -              <string>Simple (Colored Icons)</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Simple (Light Icons)</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Simple (Dark Icons)</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Simple (Blue Icons)</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Breeze Light</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Breeze Dark</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string notr="true">OSX</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string notr="true">iOS</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Flat</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Flat (White)</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Legacy</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Custom</string> -             </property> -            </item> -           </widget> -          </item> -          <item row="1" column="0"> -           <widget class="QLabel" name="label_4"> -            <property name="text"> -             <string>&Colors</string> -            </property> -            <property name="buddy"> -             <cstring>themeComboBoxColors</cstring> -            </property> -           </widget> -          </item> -          <item row="1" column="1"> -           <widget class="QComboBox" name="themeComboBoxColors"> -            <property name="sizePolicy"> -             <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> -              <horstretch>0</horstretch> -              <verstretch>0</verstretch> -             </sizepolicy> -            </property> -            <property name="focusPolicy"> -             <enum>Qt::StrongFocus</enum> -            </property> -           </widget> -          </item> -          <item row="2" column="0"> -           <widget class="QLabel" name="label_5"> -            <property name="text"> -             <string>C&at</string> -            </property> -            <property name="buddy"> -             <cstring>themeBackgroundCat</cstring> -            </property> -           </widget> -          </item> -          <item row="2" column="1"> -           <widget class="QComboBox" name="themeBackgroundCat"> -            <property name="sizePolicy"> -             <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> -              <horstretch>0</horstretch> -              <verstretch>0</verstretch> -             </sizepolicy> -            </property> -            <property name="focusPolicy"> -             <enum>Qt::StrongFocus</enum> -            </property> -            <item> -             <property name="text"> -              <string>Background Cat (from MultiMC)</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Rory ID 11 (drawn by Ashtaka)</string> -             </property> -            </item> -            <item> -             <property name="text"> -              <string>Rory ID 11 (flat edition, drawn by Ashtaka)</string> -             </property> -            </item> -           </widget> +         <layout class="QVBoxLayout" name="verticalLayout_5"> +          <item> +           <widget class="ThemeCustomizationWidget" name="themeCustomizationWidget" native="true"/>            </item>           </layout>          </widget> @@ -570,10 +432,17 @@     </item>    </layout>   </widget> + <customwidgets> +  <customwidget> +   <class>ThemeCustomizationWidget</class> +   <extends>QWidget</extends> +   <header>ui/widgets/ThemeCustomizationWidget.h</header> +   <container>1</container> +  </customwidget> + </customwidgets>   <tabstops>    <tabstop>tabWidget</tabstop>    <tabstop>autoUpdateCheckBox</tabstop> -  <tabstop>updateChannelComboBox</tabstop>    <tabstop>instDirTextBox</tabstop>    <tabstop>instDirBrowseBtn</tabstop>    <tabstop>modsDirTextBox</tabstop> @@ -582,8 +451,6 @@    <tabstop>iconsDirBrowseBtn</tabstop>    <tabstop>sortLastLaunchedBtn</tabstop>    <tabstop>sortByNameBtn</tabstop> -  <tabstop>themeComboBox</tabstop> -  <tabstop>themeComboBoxColors</tabstop>    <tabstop>showConsoleCheck</tabstop>    <tabstop>autoCloseConsoleCheck</tabstop>    <tabstop>showConsoleErrorCheck</tabstop> diff --git a/launcher/ui/pages/global/MinecraftPage.cpp b/launcher/ui/pages/global/MinecraftPage.cpp index cc597fe0..eca3e865 100644 --- a/launcher/ui/pages/global/MinecraftPage.cpp +++ b/launcher/ui/pages/global/MinecraftPage.cpp @@ -46,7 +46,6 @@  MinecraftPage::MinecraftPage(QWidget *parent) : QWidget(parent), ui(new Ui::MinecraftPage)  {      ui->setupUi(this); -    ui->tabWidget->tabBar()->hide();      loadSettings();      updateCheckboxStuff();  } diff --git a/launcher/ui/pages/global/MinecraftPage.ui b/launcher/ui/pages/global/MinecraftPage.ui index 640f436d..103881b5 100644 --- a/launcher/ui/pages/global/MinecraftPage.ui +++ b/launcher/ui/pages/global/MinecraftPage.ui @@ -7,7 +7,7 @@      <x>0</x>      <y>0</y>      <width>936</width> -    <height>1134</height> +    <height>541</height>     </rect>    </property>    <property name="sizePolicy"> @@ -39,7 +39,7 @@       </property>       <widget class="QWidget" name="minecraftTab">        <attribute name="title"> -       <string notr="true">Minecraft</string> +       <string notr="true">General</string>        </attribute>        <layout class="QVBoxLayout" name="verticalLayout_3">         <item> @@ -112,22 +112,29 @@          </widget>         </item>         <item> -        <widget class="QGroupBox" name="nativeLibWorkaroundGroupBox"> +        <widget class="QGroupBox" name="gameTimeGroupBox">           <property name="title"> -          <string>Native library workarounds</string> +          <string>Game time</string>           </property> -         <layout class="QVBoxLayout" name="verticalLayout_5"> +         <layout class="QVBoxLayout" name="verticalLayout_6">            <item> -           <widget class="QCheckBox" name="useNativeGLFWCheck"> +           <widget class="QCheckBox" name="showGameTime">              <property name="text"> -             <string>Use system installation of &GLFW</string> +             <string>Show time spent &playing instances</string>              </property>             </widget>            </item>            <item> -           <widget class="QCheckBox" name="useNativeOpenALCheck"> +           <widget class="QCheckBox" name="showGlobalGameTime">              <property name="text"> -             <string>Use system installation of &OpenAL</string> +             <string>Show time spent playing across &all instances</string> +            </property> +           </widget> +          </item> +          <item> +           <widget class="QCheckBox" name="recordGameTime"> +            <property name="text"> +             <string>&Record time spent playing instances</string>              </property>             </widget>            </item> @@ -135,38 +142,28 @@          </widget>         </item>         <item> -        <widget class="QGroupBox" name="perfomanceGroupBox"> +        <widget class="QGroupBox" name="groupBox">           <property name="title"> -          <string>Performance</string> +          <string>Miscellaneous</string>           </property> -         <layout class="QVBoxLayout" name="verticalLayout_2"> -          <item> -           <widget class="QCheckBox" name="enableFeralGamemodeCheck"> -            <property name="toolTip"> -             <string><html><head/><body><p>Enable Feral Interactive's GameMode, to potentially improve gaming performance.</p></body></html></string> -            </property> -            <property name="text"> -             <string>Enable Feral GameMode</string> -            </property> -           </widget> -          </item> +         <layout class="QVBoxLayout" name="verticalLayout">            <item> -           <widget class="QCheckBox" name="enableMangoHud"> +           <widget class="QCheckBox" name="closeAfterLaunchCheck">              <property name="toolTip"> -             <string><html><head/><body><p>Enable MangoHud's advanced performance overlay.</p></body></html></string> +             <string><html><head/><body><p>The launcher will automatically reopen when the game crashes or exits.</p></body></html></string>              </property>              <property name="text"> -             <string>Enable MangoHud</string> +             <string>&Close the launcher after game window opens</string>              </property>             </widget>            </item>            <item> -           <widget class="QCheckBox" name="useDiscreteGpuCheck"> +           <widget class="QCheckBox" name="quitAfterGameStopCheck">              <property name="toolTip"> -             <string><html><head/><body><p>Use the discrete GPU instead of the primary GPU.</p></body></html></string> +             <string><html><head/><body><p>The launcher will automatically quit after the game exits or crashes.</p></body></html></string>              </property>              <property name="text"> -             <string>Use discrete GPU</string> +             <string>&Quit the launcher after game window closes</string>              </property>             </widget>            </item> @@ -174,29 +171,42 @@          </widget>         </item>         <item> -        <widget class="QGroupBox" name="gameTimeGroupBox"> +        <spacer name="verticalSpacerMinecraft"> +         <property name="orientation"> +          <enum>Qt::Vertical</enum> +         </property> +         <property name="sizeHint" stdset="0"> +          <size> +           <width>0</width> +           <height>0</height> +          </size> +         </property> +        </spacer> +       </item> +      </layout> +     </widget> +     <widget class="QWidget" name="tab"> +      <attribute name="title"> +       <string>Tweaks</string> +      </attribute> +      <layout class="QVBoxLayout" name="verticalLayout_12"> +       <item> +        <widget class="QGroupBox" name="nativeLibWorkaroundGroupBox">           <property name="title"> -          <string>Game time</string> +          <string>Native library workarounds</string>           </property> -         <layout class="QVBoxLayout" name="verticalLayout_6"> +         <layout class="QVBoxLayout" name="verticalLayout_11">            <item> -           <widget class="QCheckBox" name="showGameTime"> -            <property name="text"> -             <string>Show time spent &playing instances</string> -            </property> -           </widget> -          </item> -          <item> -           <widget class="QCheckBox" name="showGlobalGameTime"> +           <widget class="QCheckBox" name="useNativeGLFWCheck">              <property name="text"> -             <string>Show time spent playing across &all instances</string> +             <string>Use system installation of &GLFW</string>              </property>             </widget>            </item>            <item> -           <widget class="QCheckBox" name="recordGameTime"> +           <widget class="QCheckBox" name="useNativeOpenALCheck">              <property name="text"> -             <string>&Record time spent playing instances</string> +             <string>Use system installation of &OpenAL</string>              </property>             </widget>            </item> @@ -204,28 +214,38 @@          </widget>         </item>         <item> -        <widget class="QGroupBox" name="groupBox"> +        <widget class="QGroupBox" name="perfomanceGroupBox">           <property name="title"> -          <string>Miscellaneous</string> +          <string>Performance</string>           </property> -         <layout class="QVBoxLayout" name="verticalLayout"> +         <layout class="QVBoxLayout" name="verticalLayout_2">            <item> -           <widget class="QCheckBox" name="closeAfterLaunchCheck"> +           <widget class="QCheckBox" name="enableFeralGamemodeCheck">              <property name="toolTip"> -             <string><html><head/><body><p>The launcher will automatically reopen when the game crashes or exits.</p></body></html></string> +             <string><html><head/><body><p>Enable Feral Interactive's GameMode, to potentially improve gaming performance.</p></body></html></string>              </property>              <property name="text"> -             <string>&Close the launcher after game window opens</string> +             <string>Enable Feral GameMode</string>              </property>             </widget>            </item>            <item> -           <widget class="QCheckBox" name="quitAfterGameStopCheck"> +           <widget class="QCheckBox" name="enableMangoHud">              <property name="toolTip"> -             <string><html><head/><body><p>The launcher will automatically quit after the game exits or crashes.</p></body></html></string> +             <string><html><head/><body><p>Enable MangoHud's advanced performance overlay.</p></body></html></string>              </property>              <property name="text"> -             <string>&Quit the launcher after game window closes</string> +             <string>Enable MangoHud</string> +            </property> +           </widget> +          </item> +          <item> +           <widget class="QCheckBox" name="useDiscreteGpuCheck"> +            <property name="toolTip"> +             <string><html><head/><body><p>Use the discrete GPU instead of the primary GPU.</p></body></html></string> +            </property> +            <property name="text"> +             <string>Use discrete GPU</string>              </property>             </widget>            </item> @@ -233,14 +253,14 @@          </widget>         </item>         <item> -        <spacer name="verticalSpacerMinecraft"> +        <spacer name="verticalSpacer">           <property name="orientation">            <enum>Qt::Vertical</enum>           </property>           <property name="sizeHint" stdset="0">            <size> -           <width>0</width> -           <height>0</height> +           <width>20</width> +           <height>40</height>            </size>           </property>          </spacer> @@ -255,11 +275,6 @@    <tabstop>maximizedCheckBox</tabstop>    <tabstop>windowWidthSpinBox</tabstop>    <tabstop>windowHeightSpinBox</tabstop> -  <tabstop>useNativeGLFWCheck</tabstop> -  <tabstop>useNativeOpenALCheck</tabstop> -  <tabstop>enableFeralGamemodeCheck</tabstop> -  <tabstop>enableMangoHud</tabstop> -  <tabstop>useDiscreteGpuCheck</tabstop>   </tabstops>   <resources/>   <connections/> | 
