mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-05-06 21:44:20 -05:00
Back in 2018, a Presets system was added to DolphinQt's GameConfigEdit. Presets was a dropdown menu where you could select a particular setting to add to your custom game INI. Only a small number of settings were made available, with the intent that more would be added over time. 8 years later, the set of available settings hasn't been expanded at all, and I don't know of anyone who uses these presets. On top of this, we have now made good progress in exposing per-game settings graphically. I think the Presets system is best off removed. In place of the Presets menu, we now have "Refresh" and "Open in External Editor" buttons. These more useful actions were previously hidden away in the Presets menu.
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
// Copyright 2018 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QMap>
|
|
#include <QPushButton>
|
|
#include <QString>
|
|
#include <QStringList>
|
|
#include <QWidget>
|
|
|
|
class QCompleter;
|
|
class QMenu;
|
|
class QTextEdit;
|
|
|
|
class GameConfigEdit : public QWidget
|
|
{
|
|
public:
|
|
explicit GameConfigEdit(QWidget* parent, QString path, bool read_only);
|
|
|
|
protected:
|
|
void keyPressEvent(QKeyEvent* e) override;
|
|
void focusInEvent(QFocusEvent* e) override;
|
|
|
|
private:
|
|
void CreateWidgets();
|
|
void ConnectWidgets();
|
|
|
|
void LoadFile();
|
|
void SaveFile();
|
|
|
|
void OnSelectionChanged();
|
|
void OnAutoComplete(const QString& completion);
|
|
void OpenExternalEditor();
|
|
|
|
QString GetTextUnderCursor();
|
|
|
|
void AddDescription(const QString& keyword, const QString& description);
|
|
|
|
QCompleter* m_completer;
|
|
QStringList m_completions;
|
|
QPushButton* m_refresh_button;
|
|
QPushButton* m_external_editor_button;
|
|
QTextEdit* m_edit;
|
|
|
|
const QString m_path;
|
|
|
|
bool m_read_only;
|
|
|
|
QMap<QString, QString> m_keyword_map;
|
|
};
|