Limo
A simple mod manager
Loading...
Searching...
No Matches
settingsdialog.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "loot/api.h"
9#include <QDialog>
10#include <QIcon>
11#include <map>
12
13
14namespace Ui
15{
16class SettingsDialog;
17}
18
22class SettingsDialog : public QDialog
23{
24 Q_OBJECT
25
26public:
32 explicit SettingsDialog(QWidget* parent = nullptr);
35
37 void init();
38
43 bool askRemoveMod() const;
48 bool askRemoveFromDeployer() const;
53 bool askRemoveProfile() const;
58 bool deployAll() const;
63 bool logOnError() const;
68 bool logOnWarning() const;
73 bool askRemoveBackupTarget() const;
78 bool askRemoveBackup() const;
83 bool askRemoveTool() const;
90 static std::optional<std::tuple<std::string, std::string, std::string, bool>>
92
93private slots:
105
106public slots:
114 void setNexusCryptographyFields(const std::string& cipher,
115 const std::string& nonce,
116 const std::string& tag,
117 bool uses_default_pw);
118
119private:
121 Ui::SettingsDialog* ui;
123 bool ask_remove_mod_ = true;
129 bool deploy_all_ = true;
131 bool log_on_error_ = true;
133 bool log_on_warning_ = true;
139 bool ask_remove_tool_ = true;
141 bool dialog_completed_ = false;
143 const QIcon show_icon = QIcon::fromTheme("view-visible");
145 const QIcon hide_icon = QIcon::fromTheme("view-hidden");
147 const QString api_key_hidden_string = "API Key: ***";
148
149signals:
152};
bool askRemoveBackupTarget() const
Returns true if the ask when removing a backup target option has been selected.
Definition settingsdialog.cpp:267
bool ask_remove_backup_
True if the ask when removing a backup option has been selected.
Definition settingsdialog.h:137
void settingsDialogAccepted()
Signals dialog completion.
bool logOnWarning() const
Returns true if the log on warning option has been selected.
Definition settingsdialog.cpp:272
bool askRemoveProfile() const
Returns true if the ask when removing a profile option has been selected.
Definition settingsdialog.cpp:287
bool ask_remove_tool_
True if the ask when removing a tool option has been selected.
Definition settingsdialog.h:139
bool log_on_warning_
True if the log on warning option has been selected.
Definition settingsdialog.h:133
bool askRemoveMod() const
Returns true if the ask when removing a mod option has been selected.
Definition settingsdialog.cpp:297
bool deployAll() const
Returns true if the deploy for all option has been selected.
Definition settingsdialog.cpp:282
void init()
Initializes the dialog with the settings stored on disc.
Definition settingsdialog.cpp:34
bool askRemoveBackup() const
Returns true if the ask when removing a backup option has been selected.
Definition settingsdialog.cpp:176
const QIcon show_icon
Icon used to indicate that the password is to be shown.
Definition settingsdialog.h:143
void on_buttonBox_accepted()
Updates the settings on disc with the selection made in this dialog. Emits settingsDialogAccepted.
Definition settingsdialog.cpp:112
void on_change_api_pw_button_clicked()
Initializes and executes a ChangeApiPwDialog.
Definition settingsdialog.cpp:370
void setNexusCryptographyFields(const std::string &cipher, const std::string &nonce, const std::string &tag, bool uses_default_pw)
Writes details about the encrypted Nexus API key to the settings file.
Definition settingsdialog.cpp:235
bool askRemoveTool() const
Returns true if the ask when removing tool option has been selected.
Definition settingsdialog.cpp:181
bool deploy_all_
True if the deploy for all option has been selected.
Definition settingsdialog.h:129
bool ask_remove_from_deployer_
True if the ask when removing a mod from deployer option has been selected.
Definition settingsdialog.h:125
bool askRemoveFromDeployer() const
Returns true if the ask when removing a mod from deployer option has been selected.
Definition settingsdialog.cpp:292
void on_show_api_key_button_clicked()
Toggles visibility of the API key.
Definition settingsdialog.cpp:384
const QIcon hide_icon
Icon used to indicate that the password is to be hidden.
Definition settingsdialog.h:145
bool ask_remove_backup_target_
True if the ask when removing a backup target option has been selected.
Definition settingsdialog.h:135
bool dialog_completed_
Indicates whether the dialog has been completed.
Definition settingsdialog.h:141
~SettingsDialog()
Deletes the UI.
Definition settingsdialog.cpp:29
SettingsDialog(QWidget *parent=nullptr)
Initializes the UI.
Definition settingsdialog.cpp:21
static std::optional< std::tuple< std::string, std::string, std::string, bool > > getNexusApiKeyDetails()
Reads the key cipher, nonce, tag and the is_default flag for the Nexus API key from the settings file...
Definition settingsdialog.cpp:187
bool logOnError() const
Returns true if the log on error option has been selected.
Definition settingsdialog.cpp:277
bool log_on_error_
True if the log on error option has been selected.
Definition settingsdialog.h:131
const QString api_key_hidden_string
Text shown instead of an API key when the visibility is set to hidden.
Definition settingsdialog.h:147
Ui::SettingsDialog * ui
Contains auto-generated UI elements.
Definition settingsdialog.h:121
bool ask_remove_profile_
True if the ask when removing a profile option has been selected.
Definition settingsdialog.h:127
void on_set_api_key_button_clicked()
Opens a AddApiKeyDialog to add a new api key.
Definition settingsdialog.cpp:302
bool ask_remove_mod_
True if the ask when removing a mod option has been selected.
Definition settingsdialog.h:123