1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
Commit Graph

4135 Commits

Author SHA1 Message Date
Anthony Bilinski
d1c86ffff9
refactor(ToxPk): Remove ability to construct ToxId from ToxPk
Construct ToxPk directly everywhere that used to construct through ToxId.

Now any ToxId should be a valid ToxId, and not possibly just a ToxPk.
2022-02-17 07:20:21 -08:00
Anthony Bilinski
3ac37a5496
fix(core): Track avatar offer file size to avoid cancelling transfers
When ToxFile is constructed with a file size of 0, it cancels the transfer as
soon as the first chunk is received due to the received size being
larger than expected.
2022-02-17 06:20:54 -08:00
Anthony Bilinski
a828b54be4
refactor(Paths): Remove portable state from Settings
It now duplicates the state in Paths where it is needed, creating the
chance for desync
2022-02-16 20:15:50 -08:00
Anthony Bilinski
557af80428
refactor(Paths): Remove Paths factory to enable copy construction
std::atomic disallows copy construction and the default constructor disables
the parameterized constructor.

Additionally the case where paths aren't writable isn't handled and would just
segfault in Settings previously, so no safety is lost.
2022-02-16 20:15:46 -08:00
Anthony Bilinski
0eb56fb9bb
fix(Paths): Track portable state in Paths to updates paths correctly
Paths must be aware of the "makeToxPortable" state to so that on shutdown,
saving saves to the new location.

This reverts to old behaviour which was broken in
5d56a3c039

Fix #6443
2022-02-16 19:48:11 -08:00
Anthony Bilinski
d0c120e0a8
fix(Paths): Default to auto paths detection mode
So that settings can be found in either the portable or system wide location.
2022-02-16 19:48:11 -08:00
Anthony Bilinski
15673a52b6
fix(macOS): Update video API usage for newer libavcodec
Newer version of avformat_open_input, av_find_input_format,
avcodec_find_decoder previously used non-const pointers that are now
const. Support both version for compatibiltiy with other platforms.
2022-02-16 18:04:57 -08:00
Anthony Bilinski
cea54c17c9
Merge pull request #6386
Mick Sayson (3):
      fix(filetransfer): Fix UI inconsistencies with pause/resume
      refactor(filetransfer): Move file transfer progress into ToxFile
      feat(filesform): Add in progress transfers to files form
2021-12-20 05:55:52 -08:00
Mick Sayson
257a19caaa feat(filesform): Add in progress transfers to files form
As part of #1532 it was identified that long running file transfers
could get lost deep in the chatlog. This could result in unexpected use
of bandwidth over time if users lose track of old/large transfers. This
commit updates the files form to show in progress file transfers and
offer a way to control them.

* FilesForm now works on ToxFiles instead of finished file paths
* FilesForm widgets have been replaced with an MV tree view with depth
  1. The existing QListWidget did not provide us the controls to render
  more complex items. The use of delegates allows us to efficiently draw
  progress bars and controls
* getHumanReadableSize has been extracted from FileTransferWidget into a
  more general utils file
2021-12-11 15:38:35 -08:00
Mick Sayson
c7efe320d2 refactor(filetransfer): Move file transfer progress into ToxFile
* Refactor/test ToxFileProgress to ensure that when it's moved it
  behaves well
* Notice problems with speed averaging. We were average speeds without
  keeping track of the times they were over. Adding samples of different
  lengths would result in incorrect speeds. Refactor whole class to correct
* Move ToxFileProgress to be a member of ToxFile
* Remove duplicated members between ToxFile and ToxFileProgress
* Move sample addition into CoreFile
2021-12-11 15:38:35 -08:00
Mick Sayson
3bc4aa52be fix(filetransfer): Fix UI inconsistencies with pause/resume 2021-12-11 13:56:08 -08:00
Maxim Biro
560751db88
chore(windows): update SQLCipher to 4.5.0 2021-12-07 04:56:17 -05:00
sudden6
3c58b992c6
perf: reduce repainting in animations
By profiling qTox using perf I discovered, that
NotificationIcon::updateGradient takes significant amount of CPU time
even though qTox is idle and no one is typing.

This commit fixes:

1) correctly determine visibility of NotificationIcon
2) only invalidate boundingRect in fixed intervals
3) apply the same fixes to Spinner since it has the same problem
2021-11-28 12:45:14 +01:00
Anthony Bilinski
54a2b8970b
chore(review): Copyright notice cleanup 2021-11-21 16:19:22 -08:00
Mick Sayson
ffef0e3796
refactor(chatlog): Rename ChatLog -> ChatWidget
* Makes the distinction between IChatLog (the model class) and
  ChatWidget (the view class) more clear
2021-11-21 16:18:45 -08:00
Mick Sayson
3757f733cc
refactor(chatlog): Remove unused getRow functions from ChatLine
* The getRow functions would not track correctly since the rows indexes
  cannot be fixed to the view anymore
2021-11-21 16:18:44 -08:00
Mick Sayson
b36a38e716
feat(chatlog): Re-implement sliding window ChatLog view
* Replace lines/messages with helper class to synchronize state between
  IChatLog and ChatLog more easily
* selection indexes have been replaced with ChatLine::Ptrs, this is to
  ensure consistency while the view slides around
    * This has another benefit of removing all the code that has to
      manually slide the selection boxes around
* Replaced all insertion/removal functions with single "insertAtIdx".
  This helps ensure that mappings between ChatLogIdx and position within
  the view are captured correctly as items in the view slide around
* workerTimeout replaced with more generic name "renderFinished" that is
  used in synchronous and asynchronous paths
* Removed unused function ChatForm::insertChatMessage
* Re-implemented "Go to current date" with new ChatLog APIs
* Removed unused GenericChatForm::addSystemDateMessage. This is handled
  by ChatLog now
* Resolves #6223
* Resolves #5878
* Resolves #5940
2021-11-21 16:18:44 -08:00
Mick Sayson
a9f7c0ca7e
refactor(chatlog): Store ChatLine::Ptr in messages instead of ChatMessage
* This simplifies future refactoring since the rest of ChatLog expects
  to be working with the base class
2021-11-21 16:18:40 -08:00
Mick Sayson
b7a88cde6e
refactor(chatlog): Move rendering of messages from GenericChatForm -> ChatLog
* Simplifies reasoning about who owns what functionality between
  GenericChatForm and ChatLog. GenericChatForm is now just a layout
  class and ChatLog handles all interactions with retrieving and
  displaying messages from the model
* Reasoning for work is described in more detail in #6223
2021-11-21 16:18:32 -08:00
Mick Sayson
dd7df35720
revert(chatlog): Revert cleanup
* Fix compilation issues caused by incorrect merges
2021-11-21 16:17:35 -08:00
Mick Sayson
00ab89c3ce
revert(chatlog): "feat: load messages from the database before date"
This reverts commit fb2957c5ee.
2021-11-21 16:17:35 -08:00
Anthony Bilinski
041b697e77
revert(chatlog): "load messages from the database after date"
This reverts commit b705ac8060.
2021-11-21 16:17:35 -08:00
Anthony Bilinski
31346423e1
revert(chatlog): "edit function "Load chat history""
This reverts commit 6de1173c17.
2021-11-21 16:17:34 -08:00
Mick Sayson
6c34fad9b6
fix(history): Fix qt deprecation warning
Qt 5.15 has QDateTime(QDate()) deprecated. Fix a usage of the deprecated
constructor introduced in parent commit
2021-11-21 16:17:15 -08:00
Anthony Bilinski
1104417022
revert(chatlog): "edit load history in search"
This reverts commit 8c4b1e00a1.
2021-11-21 16:17:10 -08:00
Anthony Bilinski
f29e948bed
revert(chatlog): "add action "Go to current date""
This reverts commit 2a9648d12c.
2021-11-21 16:17:10 -08:00
Anthony Bilinski
b9cf7f428d
revert(chatlog): "edit position chat after load history"
This reverts commit c2d5b422b3.
2021-11-21 16:17:10 -08:00
Anthony Bilinski
340496bd6e
revert(chatlog): "remove part messages from chat"
This reverts commit 4c7ecb6024.
2021-11-21 16:17:10 -08:00
Anthony Bilinski
bdbf1f61a8
revert(chatlog): "simple edit code"
This reverts commit b807998fe9.
2021-11-21 16:17:09 -08:00
Anthony Bilinski
b0b74cfe92
revert(chatlog): "edit load history when scrolling"
This reverts commit 0a9e72020e.
2021-11-21 16:17:09 -08:00
Anthony Bilinski
af3e0183b6
revert(chatlog): "prohibition to remove messages in group chat"
This reverts commit 5aeac56b76.
2021-11-21 16:17:09 -08:00
Anthony Bilinski
db3eaa8872
revert(chatlog): "fix a crash when there are no messages to load"
This reverts commit 040c6b95ae.
2021-11-21 16:17:09 -08:00
Anthony Bilinski
3a19eaddb5
revert(chatlog): "fix: data validation during the search"
This reverts commit acb91ed731.
2021-11-21 16:17:09 -08:00
Anthony Bilinski
59efeeb3e7
revert(chatlog): "feat: check chat status before start a search"
This reverts commit ce570927b1.
2021-11-21 16:17:09 -08:00
Anthony Bilinski
37b58ee8ee
revert(chatlog): "feat: save selected search text after scrolling up"
This reverts commit dbf880078e.
2021-11-21 16:17:09 -08:00
Anthony Bilinski
db0656a92c
revert(chatlog): "optimize load messages during the search"
This reverts commit 6de307e6b9.
2021-11-21 16:17:08 -08:00
Anthony Bilinski
cf76ae0869
revert(chatlog): "update workerStb"
This reverts commit 177bf12f11.
2021-11-21 16:17:08 -08:00
Anthony Bilinski
335ce790e9
revert(chatlog): "scroll bar stuck to bottom (fix #5755)"
This reverts commit 38df897e02.
2021-11-21 16:17:08 -08:00
Anthony Bilinski
146d93e159
revert(chatlog): "add comments for functions that load history"
This reverts commit 5fc1afbab5.
2021-11-21 16:17:08 -08:00
Anthony Bilinski
5fc273da94
revert(chatlog): partially revert "prevent invalid history access"
This partially reverts commit e3e6e1d9c4.
2021-11-21 16:17:08 -08:00
Anthony Bilinski
e18725c966
revert(chatlog): "fix stick to bottom behavior"
This reverts commit f2fa601073.
2021-11-21 16:17:08 -08:00
Brandon Mosher
1438f8f766 refactor: Provide a Virtual Method Anchor for Classes in Headers
Define at least one virtual method in polymorphic class cpp files to
improve link efficiency. Do so by defining a defaulted destructor or
another overridden virtual method in the class cpp file.
Also add explicitly defaulted copy/move constructors and assignment
operators to follow the rule of five and to avoid compiler suppression
of these functions due to the addition of a user-provided destructor.
Where neccessary, create new cpp files and add them to CMakeLists and
Testing.cmake. Set the -Wweak-vtables by default when compiling with
clang to issue warnings for new classes that do not comply with this
pattern.

See http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers.

Fixes #6036.
2021-10-26 16:47:40 +00:00
woxcab
d621d74511
fix(ui): reorder the window title 2021-10-24 23:30:30 -07:00
Anthony Bilinski
26f021e8bd
Merge pull request #6388
bodwok (1):
      fix(ui): contact list optimization
2021-10-24 22:29:14 -07:00
Mick Sayson
7c218b389d
feat(chatlog): Add image preview on paste
Reuse code from the file transfer widget to provide an image preview
on paste/grab. This prevents users from accidentally sending images they
did not mean to when their clipboard is not in the state they thought it
was.

Implementation exposes the genericchatlog vbox to the child classes and
chatform injects the imagepreview into it.
2021-10-24 22:06:58 -07:00
Anthony Bilinski
8462207a58
Merge pull request #6387
Jimi Huotari (2):
      fix(build): don't connect UpdateCheck when -DUPDATE_CHECK=OFF
      fix(UI): hide update related elements when -DUPDATE_CHECK=OFF
2021-10-24 20:45:52 -07:00
Anthony Bilinski
552cb0dc74
Merge pull request #6391
Mick Sayson (1):
      fix(toxext): Protect use of toxext modifying functions
2021-10-24 19:45:09 -07:00
Anthony Bilinski
69cd33b733
fix(chatform): Scroll to bottom on load, broken on refactor
Fix #6314
2021-10-24 16:42:46 -07:00
Anthony Bilinski
06195c0caf
Merge pull request #6311
Mick Sayson (1):
      feat(history): Save/load system messages to history
2021-10-24 05:37:44 -07:00
Anthony Bilinski
0d3be5aab3
Merge pull request #6310
Mick Sayson (1):
      feat(chatlog): Add SystemMessages to SessionChatLog
2021-10-24 05:35:22 -07:00