duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

setupwizarddialog.h (2227B)


      1 // SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>.
      2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
      3 
      4 #pragma once
      5 
      6 #include "biossettingswidget.h"
      7 
      8 #include "ui_setupwizarddialog.h"
      9 
     10 #include "core/bios.h"
     11 
     12 #include <QtCore/QList>
     13 #include <QtCore/QString>
     14 #include <QtCore/QVector>
     15 #include <QtWidgets/QDialog>
     16 #include <string>
     17 #include <utility>
     18 #include <vector>
     19 
     20 class SetupWizardDialog final : public QDialog
     21 {
     22   Q_OBJECT
     23 
     24 public:
     25   SetupWizardDialog();
     26   ~SetupWizardDialog();
     27 
     28 private Q_SLOTS:
     29   bool canShowNextPage();
     30   void previousPage();
     31   void nextPage();
     32   void confirmCancel();
     33 
     34   void themeChanged();
     35   void languageChanged();
     36 
     37   void refreshBiosList();
     38   // void biosListItemChanged(const QTreeWidgetItem* current, const QTreeWidgetItem* previous);
     39   // void listRefreshed(const QVector<BIOSInfo>& items);
     40 
     41   void onDirectoryListContextMenuRequested(const QPoint& point);
     42   void onAddSearchDirectoryButtonClicked();
     43   void onRemoveSearchDirectoryButtonClicked();
     44   void onSearchDirectoryListSelectionChanged();
     45   void refreshDirectoryList();
     46   void resizeDirectoryListColumns();
     47 
     48   void onInputDevicesEnumerated(const std::vector<std::pair<std::string, std::string>>& devices);
     49   void onInputDeviceConnected(const std::string& identifier, const std::string& device_name);
     50   void onInputDeviceDisconnected(const std::string& identifier);
     51 
     52 protected:
     53   void resizeEvent(QResizeEvent* event);
     54 
     55 private:
     56   enum Page : u32
     57   {
     58     Page_Language,
     59     Page_BIOS,
     60     Page_GameList,
     61     Page_Controller,
     62     Page_Complete,
     63     Page_Count,
     64   };
     65 
     66   void setupUi();
     67   void setupLanguagePage();
     68   void setupBIOSPage();
     69   void setupGameListPage();
     70   void setupControllerPage(bool initial);
     71   void updateStylesheets();
     72 
     73   void pageChangedTo(int page);
     74   void updatePageLabels(int prev_page);
     75   void updatePageButtons();
     76 
     77   void addPathToTable(const std::string& path, bool recursive);
     78 
     79   void openAutomaticMappingMenu(u32 port, QLabel* update_label);
     80   void doDeviceAutomaticBinding(u32 port, QLabel* update_label, const QString& device);
     81 
     82   Ui::SetupWizardDialog m_ui;
     83 
     84   std::array<QLabel*, Page_Count> m_page_labels;
     85 
     86   std::vector<std::pair<std::string, std::string>> m_device_list;
     87 };