From a023657348051cbc7c8ea29e3b37f3e2e3fd16d8 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 29 May 2021 10:43:53 -0500 Subject: Partial: Add mount list to options dialog --- include/aoapplication.h | 1 - include/aooptionsdialog.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 9fa8c75..b0a87b5 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -130,7 +130,6 @@ public: // implementation in path_functions.cpp QString get_base_path(); - QString get_data_path(); QString get_theme_path(QString p_file, QString p_theme=""); QString get_character_path(QString p_char, QString p_file); QString get_misc_path(QString p_misc, QString p_file); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index e88ce54..62ce2f7 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -23,6 +23,7 @@ #include #include +#include #include class Lobby; @@ -170,6 +171,16 @@ private: QLabel *ui_log_lbl; QCheckBox *ui_log_cb; + QWidget *ui_assets_tab; + QVBoxLayout *ui_assets_tab_layout; + QGridLayout *ui_mount_buttons_layout; + QLabel *ui_asset_lbl; + QListWidget *ui_mount_list; + QPushButton *ui_mount_add; + QPushButton *ui_mount_remove; + QPushButton *ui_mount_up; + QPushButton *ui_mount_down; + bool needs_default_audiodev(); void update_values(); -- cgit From d27501313cae78b838c1e738ebfaeae4740a23b4 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 5 Jun 2021 14:58:40 -0500 Subject: Finish mounting feature To pull this one off, a new class called VPath was created that denotes "virtual" paths that can exist anywhere among the list of mount points. It is functionally identical to QString, except that implicit conversion between QString and VPath is not allowed. This makes it easy to spot errors in path resolution at compile time, since get_real_path must be called to resolve a VPath into an absolute path that can be passed into a Qt function as a QString. Other functions, such as the get_*_suffix functions, also return an absolute path QString for convenience. As for the rest of the functions that return a VPath, you will need to call get_real_path yourself. Finally, a path resolution cache was added to try to avoid blowing up what is already a massive lookup cost for assets. The cache is invalidated when the mount path list is changed. Currently, this cache isn't bounded. Might need to write an LRU cache if issues arise. --- include/aoapplication.h | 62 +++++++++++++++++++++++++++++++++++------------ include/aolayer.h | 1 + include/aooptionsdialog.h | 3 +++ 3 files changed, 50 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index b0a87b5..0c61d7b 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -37,6 +37,25 @@ class NetworkManager; class Lobby; class Courtroom; +class VPath : QString { + using QString::QString; + +public: + explicit VPath(const QString &str) : QString(str) {} + inline QString const &toQString() const { return *this; } + inline bool operator==(const VPath &str) const { + return this->toQString() == str.toQString(); + } + inline VPath operator+(const VPath &str) const { + return VPath(this->toQString() + str.toQString()); + } +}; + +inline uint qHash(const VPath &key, uint seed) +{ + return qHash(key.toQString(), seed); +} + class AOApplication : public QApplication { Q_OBJECT @@ -130,23 +149,25 @@ public: // implementation in path_functions.cpp QString get_base_path(); - QString get_theme_path(QString p_file, QString p_theme=""); - QString get_character_path(QString p_char, QString p_file); - QString get_misc_path(QString p_misc, QString p_file); - QString get_sounds_path(QString p_file); - QString get_music_path(QString p_song); - QString get_background_path(QString p_file); - QString get_default_background_path(QString p_file); - QString get_evidence_path(QString p_file); - QStringList get_asset_paths(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder=""); - QString get_asset_path(QStringList pathlist); - QString get_image_path(QStringList pathlist, bool static_image=false); - QString get_sfx_path(QStringList pathlist); + VPath get_theme_path(QString p_file, QString p_theme=""); + VPath get_character_path(QString p_char, QString p_file); + VPath get_misc_path(QString p_misc, QString p_file); + VPath get_sounds_path(QString p_file); + VPath get_music_path(QString p_song); + VPath get_background_path(QString p_file); + VPath get_default_background_path(QString p_file); + VPath get_evidence_path(QString p_file); + QVector get_asset_paths(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder=""); + QString get_asset_path(QVector pathlist); + QString get_image_path(QVector pathlist, bool static_image=false); + QString get_sfx_path(QVector pathlist); QString get_config_value(QString p_identifier, QString p_config, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc=""); QString get_asset(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder=""); - QString get_image(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder=""); + QString get_image(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder="", bool static_image=false); QString get_sfx(QString p_sfx, QString p_misc="", QString p_character=""); QString get_case_sensitive_path(QString p_file); + QString get_real_path(const VPath &vpath); + void invalidate_lookup_cache(); ////// Functions for reading and writing files ////// // Implementations file_functions.cpp @@ -281,6 +302,7 @@ public: QStringList get_call_words(); // returns all of the file's lines in a QStringList + QStringList get_list_file(VPath path); QStringList get_list_file(QString p_file); // Process a file and return its text as a QString @@ -304,6 +326,7 @@ public: QVector read_serverlist_txt(); // Returns the value of p_identifier in the design.ini file in p_design_path + QString read_design_ini(QString p_identifier, VPath p_design_path); QString read_design_ini(QString p_identifier, QString p_design_path); // Returns the coordinates of widget with p_identifier from p_file @@ -332,19 +355,22 @@ public: // Returns the sfx with p_identifier from courtroom_sounds.ini in the current theme path QString get_court_sfx(QString p_identifier, QString p_misc=""); + // Find the correct suffix for a given file + QString get_suffix(VPath file_to_check, QStringList suffixes); + // Figure out if we can opus this or if we should fall back to wav - QString get_sfx_suffix(QString sound_to_check); + QString get_sfx_suffix(VPath sound_to_check); // Can we use APNG for this? If not, WEBP? If not, GIF? If not, fall back to // PNG. - QString get_image_suffix(QString path_to_check, bool static_image=false); + QString get_image_suffix(VPath path_to_check, bool static_image=false); // Returns the value of p_search_line within target_tag and terminator_tag QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); // Returns a QStringList of all key=value definitions on a given tag. - QStringList read_ini_tags(QString p_file, QString target_tag = ""); + QStringList read_ini_tags(VPath p_file, QString target_tag = ""); // Sets the char.ini p_search_line key under tag target_tag to value. void set_char_ini(QString p_char, QString value, QString p_search_line, @@ -489,6 +515,9 @@ public: // Get if the theme is animated bool get_animated_theme(); + // Get a list of custom mount paths + QStringList get_mount_paths(); + // Currently defined subtheme QString subtheme; @@ -514,6 +543,7 @@ private: QVector server_list; QVector favorite_list; + QHash asset_lookup_cache; private slots: void ms_connect_finished(bool connected, bool will_retry); diff --git a/include/aolayer.h b/include/aolayer.h index 1984b77..90108af 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -9,6 +9,7 @@ #include class AOApplication; +class VPath; // "Brief" explanation of what the hell this is: // diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 62ce2f7..3ea8ccc 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -180,6 +180,9 @@ private: QPushButton *ui_mount_remove; QPushButton *ui_mount_up; QPushButton *ui_mount_down; + QPushButton *ui_mount_clear_cache; + + bool asset_cache_dirty = false; bool needs_default_audiodev(); void update_values(); -- cgit From 037d96a5d96bae6e341d8f7ca4f485d519cde02b Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 5 Jun 2021 20:28:55 -0500 Subject: Use intuitive behavior for loading assets with ambiguous extensions --- include/aoapplication.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 0c61d7b..24a09ec 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -167,6 +167,7 @@ public: QString get_sfx(QString p_sfx, QString p_misc="", QString p_character=""); QString get_case_sensitive_path(QString p_file); QString get_real_path(const VPath &vpath); + QString get_real_suffixed_path(const VPath &vpath, const QStringList &suffixes); void invalidate_lookup_cache(); ////// Functions for reading and writing files ////// @@ -355,9 +356,6 @@ public: // Returns the sfx with p_identifier from courtroom_sounds.ini in the current theme path QString get_court_sfx(QString p_identifier, QString p_misc=""); - // Find the correct suffix for a given file - QString get_suffix(VPath file_to_check, QStringList suffixes); - // Figure out if we can opus this or if we should fall back to wav QString get_sfx_suffix(VPath sound_to_check); -- cgit From 387233e9e3603eb7d346eb351f0c70c84a956a10 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sun, 6 Jun 2021 22:41:40 -0500 Subject: Don't store key in asset lookup cache --- include/aoapplication.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 24a09ec..e800bb5 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -51,7 +51,7 @@ public: } }; -inline uint qHash(const VPath &key, uint seed) +inline uint qHash(const VPath &key, uint seed = qGlobalQHashSeed()) { return qHash(key.toQString(), seed); } @@ -541,7 +541,7 @@ private: QVector server_list; QVector favorite_list; - QHash asset_lookup_cache; + QHash asset_lookup_cache; private slots: void ms_connect_finished(bool connected, bool will_retry); -- cgit From 2f50cd55281cfa963ea2d6fb566b1eee675c643f Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Tue, 8 Jun 2021 23:11:28 -0500 Subject: Clear case sensitive cache as well on vpath cache flush --- include/aoapplication.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index b0ab972..90364db 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -554,6 +554,8 @@ private: QVector server_list; QVector favorite_list; QHash asset_lookup_cache; + QHash dir_listing_cache; + QSet dir_listing_exist_cache; private slots: void ms_connect_finished(bool connected, bool will_retry); -- cgit From 097bc3d4f7c5664ac54cd16b289660b03c7fdceb Mon Sep 17 00:00:00 2001 From: in1tiate Date: Wed, 9 Jun 2021 14:50:47 -0500 Subject: stupidly simple fix --- include/lobby.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/lobby.h b/include/lobby.h index 0f066ab..0f1610f 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -84,7 +84,7 @@ private: QProgressBar *ui_progress_bar; AOButton *ui_cancel; - int last_index; + int last_index = -1; void set_size_and_pos(QWidget *p_widget, QString p_identifier); -- cgit From 15f0ee38383fef3c140752345b4aa57628ad2e53 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Thu, 29 Jul 2021 08:54:34 -0500 Subject: swap out custom UNUSED macro for Q_UNUSED --- include/aoapplication.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 90364db..718029a 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -1,8 +1,6 @@ #ifndef AOAPPLICATION_H #define AOAPPLICATION_H -#define UNUSED(x) (void)(x) - #include "aopacket.h" #include "datatypes.h" #include "demoserver.h" -- cgit From ce94cd2d1e75738b53f7ab990a49e75a01b80394 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Wed, 11 Aug 2021 09:20:00 -0500 Subject: preload next frame before ticking over --- include/aolayer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/aolayer.h b/include/aolayer.h index 7a8e2fd..4b95ddb 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -7,6 +7,7 @@ #include #include #include +#include class AOApplication; class VPath; @@ -139,6 +140,9 @@ protected: // Center the QLabel in the viewport based on the dimensions of f_pixmap void center_pixmap(QPixmap f_pixmap); + // Populate the frame and delay vectors. Done asynchronously. + void load_next_frame(); + signals: void done(); -- cgit From 42760bc3f86e1d38acbf6c3c9f675dbf6acc37c8 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Wed, 11 Aug 2021 09:40:11 -0500 Subject: more accurate comment --- include/aolayer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aolayer.h b/include/aolayer.h index 4b95ddb..1216b32 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -140,7 +140,7 @@ protected: // Center the QLabel in the viewport based on the dimensions of f_pixmap void center_pixmap(QPixmap f_pixmap); - // Populate the frame and delay vectors. Done asynchronously. + // Populates the frame and delay vectors with the next frame's data. void load_next_frame(); signals: -- cgit From 2a18c1cdec54a324c6ba9834d6e6b05cc46f2535 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Wed, 11 Aug 2021 20:14:35 -0500 Subject: wait for thread to finish before starting new one --- include/aolayer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/aolayer.h b/include/aolayer.h index 1216b32..ffbd6da 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -143,6 +143,9 @@ protected: // Populates the frame and delay vectors with the next frame's data. void load_next_frame(); + // used in load_next_frame + QFuture future; + signals: void done(); -- cgit From 3bcf01bb21c60c05d52bf53828bf8361b3234a2b Mon Sep 17 00:00:00 2001 From: in1tiate Date: Fri, 13 Aug 2021 03:23:12 -0500 Subject: asynchronously load animations for bigly performant gainz --- include/aolayer.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aolayer.h b/include/aolayer.h index ffbd6da..b890715 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -8,6 +8,8 @@ #include #include #include +#include +#include class AOApplication; class VPath; @@ -140,11 +142,17 @@ protected: // Center the QLabel in the viewport based on the dimensions of f_pixmap void center_pixmap(QPixmap f_pixmap); - // Populates the frame and delay vectors with the next frame's data. +private: + // Populates the frame and delay vectors. + void populate_vectors(); + + // used in populate_vectors void load_next_frame(); + bool exit_loop; //awful solution but i'm not fucking using QThread + QFuture frame_loader; + QMutex mutex; + QWaitCondition frameAdded; - // used in load_next_frame - QFuture future; signals: void done(); @@ -243,4 +251,5 @@ public: StickerLayer(QWidget *p_parent, AOApplication *p_ao_app); void load_image(QString p_charname); }; + #endif // AOLAYER_H -- cgit From 7ce4dd6f618b64341c9d9520dfc98ede5a7500a7 Mon Sep 17 00:00:00 2001 From: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com> Date: Mon, 30 Aug 2021 21:23:11 -0500 Subject: Use event filters instead of subclassing QLineEdit and QPlainTextEdit (#587) * replace aolineedit and aotextedit with event filters * use a button to make evidence editable instead of double click --- include/CMakeLists.txt | 3 +-- include/aolineedit.h | 26 -------------------------- include/aotextedit.h | 21 --------------------- include/courtroom.h | 19 +++++++++++-------- include/eventfilters.h | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 48 insertions(+), 57 deletions(-) delete mode 100644 include/aolineedit.h delete mode 100644 include/aotextedit.h create mode 100644 include/eventfilters.h (limited to 'include') diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 18cf23b..e74a49b 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -10,13 +10,11 @@ aoevidencebutton.h aoevidencedisplay.h aoimage.h aolayer.h -aolineedit.h aomusicplayer.h aooptionsdialog.h aopacket.h aosfxplayer.h aotextarea.h -aotextedit.h bass.h bassopus.h chatlogpiece.h @@ -28,6 +26,7 @@ discord-rpc.h discord_register.h discord_rich_presence.h discord_rpc.h +eventfilters.h file_functions.h hardware_functions.h lobby.h diff --git a/include/aolineedit.h b/include/aolineedit.h deleted file mode 100644 index 5dce3aa..0000000 --- a/include/aolineedit.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef AOLINEEDIT_H -#define AOLINEEDIT_H - -#include -#include - -class AOLineEdit : public QLineEdit { - Q_OBJECT - -public: - AOLineEdit(QWidget *parent); - - void preserve_selection(bool toggle) { p_selection = toggle; } - -private: - bool p_selection = false; - -protected: - void mouseDoubleClickEvent(QMouseEvent *e); - void focusOutEvent(QFocusEvent *ev); - -signals: - void double_clicked(); -}; - -#endif // AOLINEEDIT_H diff --git a/include/aotextedit.h b/include/aotextedit.h deleted file mode 100644 index 8d876f1..0000000 --- a/include/aotextedit.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef AOTEXTEDIT_H -#define AOTEXTEDIT_H - -#include - -class AOTextEdit : public QPlainTextEdit { - Q_OBJECT -public: - AOTextEdit(QWidget *parent); - -protected: - void mouseDoubleClickEvent(QMouseEvent *e); - -signals: - void double_clicked(); - -private slots: - void on_enter_pressed(); -}; - -#endif // AOTEXTEDIT_H diff --git a/include/courtroom.h b/include/courtroom.h index e814514..09ec486 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -11,13 +11,11 @@ #include "aoevidencedisplay.h" #include "aoimage.h" #include "aolayer.h" -#include "aolineedit.h" #include "aomusicplayer.h" #include "aooptionsdialog.h" #include "aopacket.h" #include "aosfxplayer.h" #include "aotextarea.h" -#include "aotextedit.h" #include "chatlogpiece.h" #include "datatypes.h" #include "debug_functions.h" @@ -25,6 +23,7 @@ #include "hardware_functions.h" #include "lobby.h" #include "scrolltext.h" +#include "eventfilters.h" #include #include @@ -648,7 +647,8 @@ private: QComboBox *ui_pair_order_dropdown; - AOLineEdit *ui_ic_chat_message; + QLineEdit *ui_ic_chat_message; + AOLineEditFilter *ui_ic_chat_message_filter; QLineEdit *ui_ic_chat_name; QLineEdit *ui_ooc_chat_message; @@ -730,7 +730,8 @@ private: AOButton *ui_evidence_button; AOImage *ui_evidence; - AOLineEdit *ui_evidence_name; + QLineEdit *ui_evidence_name; + AOLineEditFilter *ui_evidence_name_filter; QWidget *ui_evidence_buttons; QVector ui_evidence_list; AOButton *ui_evidence_left; @@ -738,7 +739,8 @@ private: AOButton *ui_evidence_present; AOImage *ui_evidence_overlay; AOButton *ui_evidence_delete; - AOLineEdit *ui_evidence_image_name; + QLineEdit *ui_evidence_image_name; + AOLineEditFilter *ui_evidence_image_name_filter; AOButton *ui_evidence_image_button; AOButton *ui_evidence_x; AOButton *ui_evidence_ok; @@ -746,7 +748,9 @@ private: AOButton *ui_evidence_transfer; AOButton *ui_evidence_save; AOButton *ui_evidence_load; - AOTextEdit *ui_evidence_description; + AOButton *ui_evidence_edit; + QPlainTextEdit *ui_evidence_description; + AOImage *ui_char_select_background; @@ -873,6 +877,7 @@ private slots: void on_evidence_image_button_clicked(); void on_evidence_clicked(int p_id); void on_evidence_double_clicked(int p_id); + void on_evidence_edit_clicked(); void on_evidence_hover(int p_id, bool p_state); @@ -928,8 +933,6 @@ private slots: void on_showname_enable_clicked(); - void on_evidence_name_double_clicked(); - void on_evidence_image_name_double_clicked(); void on_evidence_button_clicked(); void on_evidence_delete_clicked(); diff --git a/include/eventfilters.h b/include/eventfilters.h new file mode 100644 index 0000000..7847608 --- /dev/null +++ b/include/eventfilters.h @@ -0,0 +1,36 @@ +#ifndef EVENTFILTERS_H +#define EVENTFILTERS_H + +#include +#include + +class AOLineEditFilter : public QObject +{ + Q_OBJECT +public: + bool preserve_selection = false; + +protected: + bool eventFilter(QObject *obj, QEvent *event) override { + QLineEdit *lineEdit = qobject_cast(obj); + if (event->type() == QEvent::FocusOut && lineEdit != nullptr && preserve_selection) { // lost focus + int start = lineEdit->selectionStart(); + #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + int len = lineEdit->selectionLength(); + #else + int len = lineEdit->selectedText().length(); + #endif + if (start != -1 && len != -1) { + lineEdit->setSelection(start, len);\ + return true; + } + } + return false; + } +signals: + void double_clicked(); +}; + + + +#endif // EVENTFILTERS_H -- cgit From c163aab671b9590910039a7031ed4f02ff989ed8 Mon Sep 17 00:00:00 2001 From: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com> Date: Wed, 22 Sep 2021 18:59:59 -0500 Subject: Allow user to configure log timestamp format (#590) * user configurable timestamp format * fix label making the entire settings window move jankily * add a dropdown for sane timestamp formats * streamline adding options to log timestamp format --- include/aoapplication.h | 3 +++ include/aooptionsdialog.h | 4 ++++ include/courtroom.h | 3 +++ 3 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 718029a..0c5359a 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -285,6 +285,9 @@ public: // Returns whether the log should have a timestamp. bool get_log_timestamp(); + // Returns the format string for the log timestamp + QString get_log_timestamp_format(); + // Returns whether to log IC actions. bool get_log_ic_actions(); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 4568b1e..77d19a4 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -62,6 +62,8 @@ private: QSpinBox *ui_log_margin_spinbox; QLabel *ui_log_timestamp_lbl; QCheckBox *ui_log_timestamp_cb; + QLabel *ui_log_timestamp_format_lbl; + QComboBox *ui_log_timestamp_format_combobox; QLabel *ui_stay_time_lbl; QSpinBox *ui_stay_time_spinbox; QLabel *ui_desync_logs_lbl; @@ -197,6 +199,8 @@ public slots: void save_pressed(); void discard_pressed(); void button_clicked(QAbstractButton *button); + void on_timestamp_format_edited(); + void timestamp_cb_changed(int state); void on_reload_theme_clicked(); void theme_changed(int i); }; diff --git a/include/courtroom.h b/include/courtroom.h index 09ec486..4bc8624 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -416,6 +416,9 @@ private: // True, if the log should have a timestamp. bool log_timestamp = false; + // format string for aforementioned log timestamp + QString log_timestamp_format; + // How long in miliseconds should the objection wait before appearing. int objection_threshold = 1500; -- cgit