From c9f52b7223685d2e7fca925594171f94dd8c6e3b Mon Sep 17 00:00:00 2001 From: TrickyLeifa Date: Wed, 15 May 2024 00:00:17 +0200 Subject: Ported to CMake, ... * Ported the project to CMake * Android and Mac support dropped for the time being. * Tests, BASS and Discord-RPC are now options * Restructured and reformated the project. * Merged `include` and `src` * Renamed `resource` to `data` * Renamed various files * External libraries headers are no longer included in `src` * Replaced header guards with #pragma once * Multiple refactors (keywords, headers) * Added Qt6 compatibility * Removed various unused functions and headers * Reworked AOPacket * When content is passed to AOPacket, it should be ensured that the content is already decoded. * Encoding/decoding are now static methods. * Fixed various memory leaks * Removed animation code for AOImage * AOImage is always using static images * Simplified ChatLogPiece --- include/widgets/add_server_dialog.h | 44 --------- include/widgets/aooptionsdialog.h | 160 -------------------------------- include/widgets/direct_connect_dialog.h | 46 --------- include/widgets/edit_server_dialog.h | 46 --------- 4 files changed, 296 deletions(-) delete mode 100644 include/widgets/add_server_dialog.h delete mode 100644 include/widgets/aooptionsdialog.h delete mode 100644 include/widgets/direct_connect_dialog.h delete mode 100644 include/widgets/edit_server_dialog.h (limited to 'include/widgets') diff --git a/include/widgets/add_server_dialog.h b/include/widgets/add_server_dialog.h deleted file mode 100644 index db999bf..0000000 --- a/include/widgets/add_server_dialog.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#ifndef ADD_SERVER_DIALOG_H -#define ADD_SERVER_DIALOG_H - -#include "interfaces/server_dialog.h" - -class QComboBox; -class QDialogButton; -class QDialogButtonBox; -class QLabel; -class QLineEdit; -class QPlainTextEdit; -class QPushButton; -class QSpinBox; - -class AddServerDialog : public AttorneyOnline::UI::FavoriteServerDialog { - Q_OBJECT -public: - AddServerDialog(); - ~AddServerDialog() = default; - -private: - QWidget *ui_widget; - - QLineEdit *ui_server_display_name_edit; - QLineEdit *ui_server_hostname_edit; - QSpinBox *ui_server_port_box; - QComboBox *ui_server_protocol_box; - QPlainTextEdit *ui_server_description_edit; - QDialogButtonBox *ui_server_dialog_button; - - // Legacy Server UI - QLabel *ui_server_legacy_lbl; - QLineEdit *ui_server_legacy_edit; - QPushButton *ui_server_legacy_load_button; - -private slots: - void onSavePressed() override; - void onCancelPressed() override; - void parseLegacyServerEntry(); -}; - -#endif // ADD_SERVER_DIALOG_H diff --git a/include/widgets/aooptionsdialog.h b/include/widgets/aooptionsdialog.h deleted file mode 100644 index ab36652..0000000 --- a/include/widgets/aooptionsdialog.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef AOOPTIONSDIALOG_H -#define AOOPTIONSDIALOG_H - -#include "options.h" - -#include -#include - -class QCheckBox; -class QComboBox; -class QDialogButtonBox; -class QLineEdit; -class QPlainTextEdit; -class QScrollArea; -class QSpinBox; -class QTabWidget; -class QLabel; -class QAbstractButton; - - -#include -#include -#include -#include -#include - -class AOApplication; - -struct OptionEntry { - std::function load; - std::function save; -}; - -class AOOptionsDialog : public QDialog { - Q_OBJECT -public: - explicit AOOptionsDialog(QDialog *parent = nullptr, - AOApplication *p_ao_app = nullptr); - -private: - AOApplication *ao_app; - - // Dialog interaction buttons. Save/Discard/Restore Defaults - QDialogButtonBox *ui_settings_buttons; - - // The gameplay tab - QWidget *ui_settings_widget; - QComboBox *ui_theme_combobox; - QComboBox *ui_subtheme_combobox; - QSpinBox *ui_theme_scaling_factor_sb; - QPushButton *ui_theme_reload_button; - QPushButton *ui_theme_folder_button; - QCheckBox *ui_evidence_double_click_cb; - QCheckBox *ui_animated_theme_cb; - QSpinBox *ui_stay_time_spinbox; - QCheckBox *ui_instant_objection_cb; - QSpinBox *ui_text_crawl_spinbox; - QSpinBox *ui_chat_ratelimit_spinbox; - QFrame *ui_log_names_divider; - QLineEdit *ui_username_textbox; - QCheckBox *ui_showname_cb; - QLineEdit *ui_default_showname_textbox; - QFrame *ui_net_divider; - QLineEdit *ui_ms_textbox; - QCheckBox *ui_discord_cb; - QLabel *ui_language_label; - QComboBox *ui_language_combobox; - QLabel *ui_scaling_label; - QComboBox *ui_scaling_combobox; - QCheckBox *ui_shake_cb; - QCheckBox *ui_effects_cb; - QCheckBox *ui_framenetwork_cb; - QCheckBox *ui_colorlog_cb; - QCheckBox *ui_stickysounds_cb; - QCheckBox *ui_stickyeffects_cb; - QCheckBox *ui_stickypres_cb; - QCheckBox *ui_customchat_cb; - QCheckBox *ui_sticker_cb; - QCheckBox *ui_continuous_cb; - QCheckBox *ui_category_stop_cb; - QCheckBox *ui_sfx_on_idle_cb; - - // The callwords tab - QPlainTextEdit *ui_callwords_textbox; - QCheckBox *ui_callwords_char_textbox; - - // The audio tab - QWidget *ui_audio_tab; - QWidget *ui_audio_widget; - QComboBox *ui_audio_device_combobox; - QSpinBox *ui_suppress_audio_spinbox; - QFrame *ui_volume_blip_divider; - QSpinBox *ui_bliprate_spinbox; - QCheckBox *ui_blank_blips_cb; - QCheckBox *ui_loopsfx_cb; - QCheckBox *ui_objectmusic_cb; - QCheckBox *ui_disablestreams_cb; - - // The asset tab - QListWidget *ui_mount_list; - QPushButton *ui_mount_add; - QPushButton *ui_mount_remove; - QPushButton *ui_mount_up; - QPushButton *ui_mount_down; - QPushButton *ui_mount_clear_cache; - - // The logging tab - QCheckBox *ui_downwards_cb; - QSpinBox *ui_length_spinbox; - QCheckBox *ui_log_newline_cb; - QSpinBox *ui_log_margin_spinbox; - QLabel *ui_log_timestamp_format_lbl; - QCheckBox *ui_log_timestamp_cb; - QComboBox *ui_log_timestamp_format_combobox; - QCheckBox *ui_desync_logs_cb; - QCheckBox *ui_log_ic_actions_cb; - QCheckBox *ui_log_text_cb; - QCheckBox *ui_log_demo_cb; - - /** - * Allows the AO2 master server hoster to go broke. - */ - QWidget *ui_privacy_tab; - QCheckBox *ui_privacy_optout_cb; - QFrame *ui_privacy_separator; - QTextBrowser *ui_privacy_policy; - - bool asset_cache_dirty = false; - - bool needsDefaultAudioDevice(); - void populateAudioDevices(); - void updateValues(); - - QVector optionEntries; - - template - void setWidgetData(T *widget, const V &value); - - template V widgetData(T *widget) const; - - template - void registerOption(const QString &widgetName, V (Options::*getter)() const, - void (Options::*setter)(V)); - -signals: - void reloadThemeRequest(); - -private slots: - void savePressed(); - void discardPressed(); - void buttonClicked(QAbstractButton *button); - void onTimestampFormatEdited(); - void timestampCbChanged(int state); - void onReloadThemeClicked(); - void themeChanged(int i); - void setupUI(); - -}; - -#endif // AOOPTIONSDIALOG_H diff --git a/include/widgets/direct_connect_dialog.h b/include/widgets/direct_connect_dialog.h deleted file mode 100644 index 9317524..0000000 --- a/include/widgets/direct_connect_dialog.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef DIRECT_CONNECT_DIALOG_H -#define DIRECT_CONNECT_DIALOG_H - -#include -#include -#include - -class QLabel; -class QSpinBox; -class QLineEdit; -class QPushButton; -class QComboBox; -class QLabel; -class NetworkManager; - -class DirectConnectDialog : public QDialog { - Q_OBJECT -public: - DirectConnectDialog(NetworkManager* p_net_manager); - ~DirectConnectDialog() = default; - -private slots: - void onConnectPressed(); - void onServerConnected(); - void onConnectTimeout(); - -private: - NetworkManager* net_manager; - - QLineEdit* ui_direct_hostname_edit; - - QLabel* ui_direct_connection_status_lbl; - QPushButton* ui_direct_connect_button; - QPushButton* ui_direct_cancel_button; - - QWidget* ui_widget; - QTimer connect_timeout; - - const int TCP_INDEX = 0; - const QRegularExpression SCHEME_PATTERN{"^\\w+://.+$"}; - const int CONNECT_TIMEOUT = 5 * 1000; - const QString DEFAULT_UI = "direct_connect_dialog.ui";; - -}; - -#endif // DIRECT_CONNECT_DIALOG_H diff --git a/include/widgets/edit_server_dialog.h b/include/widgets/edit_server_dialog.h deleted file mode 100644 index 3c4595e..0000000 --- a/include/widgets/edit_server_dialog.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#ifndef EDIT_SERVER_DIALOG_H -#define EDIT_SERVER_DIALOG_H - -#include "interfaces/server_dialog.h" - -class QPushButton; -class QDialogButton; -class QLabel; -class QLineEdit; -class QComboBox; -class QSpinBox; -class QPlainTextEdit; -class QDialogButtonBox; - -class EditServerDialog : public AttorneyOnline::UI::FavoriteServerDialog { - Q_OBJECT -public: - EditServerDialog(int index); - ~EditServerDialog() = default; - -private: - QWidget *ui_widget; - - QLineEdit *ui_server_display_name_edit; - QLineEdit *ui_server_hostname_edit; - QSpinBox *ui_server_port_box; - QComboBox *ui_server_protocol_box; - QPlainTextEdit *ui_server_description_edit; - QDialogButtonBox *ui_server_dialog_button; - - // Legacy Server UI - QLabel *ui_server_legacy_lbl; - QLineEdit *ui_server_legacy_edit; - QPushButton *ui_server_legacy_load_button; - - int index; - void loadEntry(); - -private slots: - void onSavePressed() override; - void onCancelPressed() override; -}; - -#endif // EDIT_SERVER_DIALOG_H -- cgit