diff options
author | Tobias Markmann <tm@ayena.de> | 2017-04-07 09:17:07 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2017-04-07 10:42:24 (GMT) |
commit | ed2226782ac15345aeb8e615b41d30e5aab67b51 (patch) | |
tree | a519ef4b314570fb134b969bb5fcff0e1f2be6e9 /Swift/QtUI/QtChatWindow.h | |
parent | 7d2e5e200d8449a4492c6fafa4811197e6fbe40b (diff) | |
download | swift-ed2226782ac15345aeb8e615b41d30e5aab67b51.zip swift-ed2226782ac15345aeb8e615b41d30e5aab67b51.tar.bz2 |
Make day change chat system message DST aware
Moved the code for day change message handling from
Swift/Controllers to Swift/QtUI. Use QDateTime in local
time time spec, which allows DST aware calculation of the
duration to the next midnight.
Added Swift Qt UI unit tests, which are build when Qt has
been successfully detected.
Test-Information:
Added unit tests for duration to next midnight calculation.
Set clock shortly before midnight and verified that a single
day change message is added to the chat log at midnight.
Tested on macOS 10.12.4 with Qt 5.4.2.
Change-Id: I34d69eaa3272981fd220a7963a0417f73ff78e68
Diffstat (limited to 'Swift/QtUI/QtChatWindow.h')
-rw-r--r-- | Swift/QtUI/QtChatWindow.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h index 46186ba..361d7c6 100644 --- a/Swift/QtUI/QtChatWindow.h +++ b/Swift/QtUI/QtChatWindow.h @@ -165,78 +165,81 @@ namespace Swift { protected: void showEvent(QShowEvent* event); private slots: void handleLogCleared(); void returnPressed(); void handleInputChanged(); void handleCursorPositionChanged(); void handleKeyPressEvent(QKeyEvent* event); void handleSplitterMoved(int pos, int index); void handleAlertButtonClicked(); void handleActionButtonClicked(); void handleAffiliationEditorAccepted(); void handleCurrentLabelChanged(int); void handleEmojisButtonClicked(); void handleTextInputReceivedFocus(); void handleTextInputLostFocus(); private: void updateTitleWithUnreadCount(); void tabComplete(); void beginCorrection(); void cancelCorrection(); void handleSettingChanged(const std::string& setting); void handleOccupantSelectionChanged(RosterItem* item); void handleAppendedToLog(); static std::vector<JID> jidListFromQByteArray(const QByteArray& dataBytes); + void resetDayChangeTimer(); + private: int unreadCount_; bool contactIsTyping_; LastLineTracker lastLineTracker_; std::string id_; QString contact_; QString lastSentMessage_; QTextCursor tabCompleteCursor_; QtChatView* messageLog_; QtChatTheme* theme_; QtTextEdit* input_; QWidget* midBar_; QBoxLayout* subjectLayout_; QComboBox* labelsWidget_; QtOccupantListWidget* treeWidget_; QLabel* correctingLabel_; boost::optional<AlertID> correctingAlert_; QVBoxLayout* alertLayout_; std::map<AlertID, QWidget*> alertWidgets_; AlertID nextAlertId_; TabComplete* completer_; QLineEdit* subject_; bool isCorrection_; bool inputClearing_; bool tabCompletion_; UIEventStream* eventStream_; bool isOnline_; - QSplitter *logRosterSplitter_; + QSplitter* logRosterSplitter_; Tristate correctionEnabled_; Tristate fileTransferEnabled_; QString alertStyleSheet_; QPointer<QtMUCConfigurationWindow> mucConfigurationWindow_; QPointer<QtAffiliationEditor> affiliationEditor_; SettingsProvider* settings_ = nullptr; QtSettingsProvider* qtOnlySettings_ = nullptr; std::vector<ChatWindow::RoomAction> availableRoomActions_; QPalette defaultLabelsPalette_; LabelModel* labelModel_; BlockingState blockingState_; bool impromptu_; bool isMUC_; bool supportsImpromptuChat_; RoomBookmarkState roomBookmarkState_; std::unique_ptr<QMenu> emojisMenu_; QPointer<QtEmojisSelector> emojisGrid_; std::map<std::string, std::string> emoticonsMap_; + QTimer* dayChangeTimer = nullptr; }; } |