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

215 Commits

Author SHA1 Message Date
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
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
1104417022
revert(chatlog): "edit load history in search"
This reverts commit 8c4b1e00a1.
2021-11-21 16:17:10 -08: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
TriKriSta
b11a09d3e4
refactor: delete classes that were used to reload theme 2020-08-28 10:26:26 -07:00
TriKriSta
3bf3128a4f
fix(ui): implement and connect reloadTheme in leaf classes
This allows leaf classes to update independently when the GUI has changed themes, without
their parent having to call updateTheme() manually.

Fix #5924
Fix #5592
2020-08-28 10:19:53 -07:00
sudden6
040a833d56
refactor: remove getInstance from filetransferwidget.cpp 2020-08-16 12:47:30 +02:00
Mick Sayson
99c1753a76 fix(preview): Fix exif orientations
Previous exif transformations were not valid. The exif spec defines the
orientations as where the 0th row and the 0th column should end. The
previous mappings used in qTox did not respect these mappings and needed
to be updated.
2020-05-16 16:53:14 -07:00
Anthony Bilinski
8abd4e47e9
refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
iphydf
58b4c19709
chore: remove extra ;
These are misleading in some cases, or at least not useful in others.
Most cases of Q_UNUSED in qtox don't have a ;, so this seems acceptable.
2020-04-22 23:55:51 +00:00
iphydf
e71225268f
chore: Various code cleanups.
* Reorder class data members and/or constructor initialisers to match,
  reducing confusion about when members will be initialised.
* Remove (most) unused variables. Not removed: some global variables with
  `TODO(sudden6)` on them for using them in the future. I don't know how
  far into the future sudden6 wants to use them, so I left them there for
  now.
* Distinguish different bootstrap nodes in the logs by index in the
  bootstrap node list. Originally, we used to log the address/port of the
  node we're bootstrapping to. This was removed out of privacy concerns
  (even though the bootstrap nodes are public). This made the logs much
  less useful when debugging why the client isn't connecting. Having
  indices makes it easier to see that different nodes are being selected,
  and makes it possible to determine which node was selected.
* Explicitly cast unused results of Tox API functions to `void` when all
  we want is to know whether the function succeeds or not.
* Don't try to `#include <unistd.h>` on Windows. It does not exist on
  MSVC.
* Remove extra `;` after function definitions.
* Remove reference indirection of QJsonValueRef, since a copy of that ref
  (small pointer-like object) has to be made anyway when iterating over
  QJsonArrays.
* Make some file-scope global state `static`.
* Use `nullptr` instead of `NULL`.
* Add `#if DESKTOP_NOTIFICATIONS` around the code that implements desktop
  notifications, so it becomes a bit easier to compile everything with a
  single compiler command - useful for manually running static analysers.
* Fix an error on MSVC where `disconnect` is looked up to be a non-static
  member function and the `this` capture is missing.
* Consistently use `struct` and `class` tags for types.
* Use references in ranged-for where it reduces copies.
* Move private static data members out of the Style class and into
  file-local scope. There is no need for them to be in the class. Also
  marked them `const` where possible.
* Removed unused lambda capture.
* Ensure qTox can compile under NDEBUG with `-Wunused-variable` by
  inlining the unused variable into the `assert` that was its only
  target.
* Minor reformatting in core_test.cpp.
2020-04-16 19:07:40 +00:00
Anthony Bilinski
2c1a86482a
chore(style): remove old style casts and cross sign comparisons
Enable warnings for both. Favour casting to signed rather than casting to
unsigend for comparisons. Per isocpp's core guidelines ES.102, signed
arithmetic gives more expected results. If we need one extra bit of range,
using longer signed types achives that.

Fix #6010
Fix #6012
2020-03-21 20:29:10 -07:00
Anthony Bilinski
f7d82a425d
Merge branch 'v1.17-dev' 2019-10-21 23:49:36 -07:00
Anthony Bilinski
1a726b54cd
fix(history): display broken messages UI with error icon
Allows users to still see their broken messages in the chatlog, but in a way
that's clear that they haven't been delivered and won't be sent.
2019-10-20 02:34:48 -07:00
Anthony Bilinski
1ad561ca4c
refactor(style): use only one of override, virtual, or final
following https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override

virtual means exactly and only "this is a new virtual function."
override means exactly and only "this is a non-final overrider."
final means exactly and only "this is a final overrider."

Nothing was changed from e.g. override to final, just reduced duplication of
these labels.
2019-10-19 12:26:50 -07:00
jessica181920
11b34c84ef fix(i18n): Various English fixes
Consistency, typos, grammatical corrections, capitalization, punctuation,
etc.
2019-09-14 15:00:59 -04:00
TriKriSta
8c4b1e00a1 feat: edit load history in search 2019-07-22 21:16:26 +03:00
jenli669
8a0197b37f
refactor(filetransfer): switch to Qt 5.13 compliant methods for OSX 2019-07-11 09:13:42 +02:00
jenli669
04a9bc46f4
docs(copyright): update and add copyright info
zealously updates and adds qTox copyright information.

Fixes #5713
2019-06-28 01:18:26 +02:00
Mick Sayson
ed514d7166 refactor(chatform): Remove message handling logic from gui path
Functional changes
* Offline messages are still sent when the chat log is cleared
* Spinner now does not wait for history to be complete, just a receipt
  from our friend
* Export chat and load chat history are now available in group chats
* Merged save chat log and export chat log
  * Note that we lost the info messages in the process

NonFunctional Changes
* FileTransferWidget slots only called for correct file
* Settings::getEnableGroupChatsColor now embedded in
GenericChatForm::colorizeNames
  * Settings::setEnableGroupChatscolor now emits signal connected to
GenericChatForm::setColorizedNames to keep state in sync
* Chatlog history not reloaded on setPassword()
  * I am pretty sure this had no purpose
* Removed a lot of responsibility from ChatForm
  * History moved to ChatHistory implementation of IChatLog
  * OfflineMsgEngine moved to FriendMessageDispatcher
  * Export chat and load chat history moved to GenericChatLog
    * Backed by IChatLog so can be used generically
  * Message processing moved to FriendMessageDispatcher
  * The action of sending files to coreFile is still handled by
  ChatForm, but displaying of the sent messages is done through IChatLog
  -> GenericChatForm
  * Search moved to ChatHistory/SessionChatLog
  * All insertion of chat log elements should be handled by
  GenericChatForm now
* Removed overlapping responsibilities from GroupChatForm
  * Search and message sending goes through ichatlog/messagedispatcher
  too
  * Lots of search functionality pushed down into IChatLog
* Some of the file logic was moved into Widget. This is mostly to avoid
  scope increase of this PR even further.
* History APIs removed that were no longer used
2019-06-21 11:01:35 -07:00
Monsterovich
1bbe210c25 fix(ui): Improved notifications 2019-05-22 19:48:23 +02:00
sudden6
a4ad8c71b8
refactor(core): make CoreFile its own independent class
This paves the way for better testability of Core as well as CoreFile.
2019-04-10 10:28:13 +02:00
TriKriSta
5ed1065230 style: edit colors for transfer widget 2019-03-23 14:58:44 +02:00
TriKriSta
f64bb48a92 refactor: edit styles
edit typing color and image,
move colors for background selected text and background searched text
in palette files
2019-03-02 01:58:58 +02:00
TriKriSta
c6142e4287 refactor: rename palette colors 2019-02-22 18:01:43 +02:00
TriKriSta
e146c11f0f feat: edit reload themes 2019-02-21 15:53:31 +02:00
TriKriSta
5bc27b08bc refactor: move palette colors in ini files 2019-02-20 15:42:53 +02:00
TriKriSta
87d6883a0f style: add dark style 2019-02-19 16:21:44 +02:00
Teemu Ikonen
c9f3830bc2 fix(ui): tighten idealSize() for chatlog Timestamps
Make Text::idealSize() a virtual function and override it in the derived
class Timestamp. The idealSize() function for Timestamps now returns a
tighter size to enable better right-alignment of the timestamps in
chatlog.

Fixes #3957. Note that this change assumes that timestamps do not
contain RTL text.
2019-01-14 00:07:18 +02:00
Mick Sayson
3615425234 refactor(transfer): Remove unnecessary split for pause send/recv 2018-12-16 13:51:04 -08:00
Mick Sayson
293a1d615c fix(transfer): Accurately represent pause state in UI
Toxcore has a 3 state pause, us, them, or both. Currently our UI
messes up if both parties pause. This changeset changes our UI behavior
to show whether we're paused, or if we are waiting on the remote to
unpause.
2018-12-16 13:51:03 -08:00
Mick Sayson
25005c5c19 feat(db): File transfer history review comments 2018-12-05 21:15:14 -08:00
Mick Sayson
d9b39b3102 feat(db): Hookup file history to the rest of the system 2018-12-02 14:40:53 -08:00
Mick Sayson
157be30b11 refactor(files): Refactor FileTransferWidget
Rational here is that the current FileTransferWidget is quite
entangled with core logic. If we are going to instantiate the
FileTransferWidget without an active file transfer the widget needs to
behave sanely without getting messages from toxcore. This changeset is
an attempt to allow us to move from any FileTransferWidget state to any
other state without having to go through the appropriate state
transitions.
2018-12-02 14:35:04 -08:00
sudden6
acc7058e65
refactor: remove another function from Nexus 2018-11-01 10:22:20 +01:00
Jimi Huotari
71d1fa6f24
refactor(themes): load css and images from themes folder
Original work by tox-user.

The default theme is now placed in a different path:
- C:\users\%username%\AppData\roaming\qtox\themes - for Windows
- ~/Library/Application Support/qtox/themes - for MacOS
- ~/.config/qtox/themes - for other Unix systems including GNU/Linux

Thanks to that it's no longer required to recompile the program to modify
the theme.

In addition to that the default theme is also included as a resource. If
the theme folder or some file inside it is missing, qTox will load it
from resource.
2018-10-24 14:04:03 +02:00
iphydf
52a5951d26
chore: Use nullptr instead of 0 for NULL pointer constants. 2018-09-07 21:38:59 +00:00
TriKriSta
706822123f refactor: delete sqlite in travis, edit some functions 2018-07-14 00:58:35 +03:00
TriKriSta
42f5ac67e7 refactor: edit generateFilterWordsOnly 2018-07-08 22:44:21 +03:00
TriKriSta
60a2c5e651 refactor: change QRegExp on QRegularExpression for some search functions 2018-07-07 20:56:02 +03:00
TriKriSta
610e04aa26 feat: use search settings 2018-06-24 21:11:20 +03:00
ezavod
4434253283
refactor(chatform): consistent usage of file dialogs
This makes the usage of QFileDialogs consistent by using he native
file picker in all cases. Also makes the usage of the last location
consistent. Furthermore this removes default parameter values and uses
Q_NULLPTR.
2018-05-29 12:51:50 +02:00
Anthony Bilinski
5dc4e6de81
chore(legal): update copyright date to 2018 for all source files 2018-04-25 17:33:38 -07:00
TriKriSta
7718734c9a feat: add search in text in group chats 2018-02-11 23:09:13 +02:00
TriKriSta
b881d32d1b feat: add text search 2018-02-10 17:56:16 +02:00
sudden6
1dce8f6468
refactor(core): rename corestructs to toxfile.cpp
It only contains this struct now.
2017-10-31 09:32:53 +01:00
anthony.bilinski
45b3575d79 fix(preview): only downscale preview images, never upscale
Fixes #4733
2017-10-20 12:01:34 -07:00
anthony.bilinski
414fa178b4 feat(exif): Honour exif orientation tag
Fixes #1848
2017-09-19 10:00:05 -07:00
Andrew Morgan
42a9534b24
fix(ui): Use native file picker dialog
The original reason that the Qt picker was used instead of the native
picker was that the native option would cause Nautilus/GNOME-based
pickers to hang.

This turned out to be due with a Qt bug with parenting Gtk windows. As a
result the parent of each file dialog window has been set to NULL,
eliminating the crash. As far as tests have shown, this produces no
adverse effects on either floating or tiling wms.

Fixes #3494
2017-07-06 06:40:33 -07:00
sudden6
a3b234e6dd
chore(formatting): run clang-format 2017-06-01 09:50:59 +02:00