Commit Graph

115 Commits (c7efe320d2e4493feafdce0d4c2ee3471c9a32f6)

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
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
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
jessica181920 11b34c84ef fix(i18n): Various English fixes
Consistency, typos, grammatical corrections, capitalization, punctuation,
etc.
2019-09-14 15:00:59 -04: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
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 c6142e4287 refactor: rename palette colors 2019-02-22 18:01:43 +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
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
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
sudden6 bf0e6817af
refactor: correct indentation in filetransferwidget.cpp 2017-03-08 17:49:37 +01:00
Jimi Huotari 9322f29ef4 feat(UI): Move filetransferwidget buttons side-by-side.
This aims to prevent accidental clicks on the incorrect button in
cases where the chatlog moves at the time of the click.

Closes #2597.
2017-03-01 23:44:49 +02:00
Zetok Zalbavar 80f5de31b3
style: reformat current C++ codebase using clang-format 2017-02-26 11:52:45 +00:00
Diadlo fcd8eed7cd
style: Fix style of a lot of pointers 2017-01-06 23:03:58 +03:00
Zetok Zalbavar d4ac13dbf4
revert: "refactor: Added to include path and exclude it from all includes"
Revert needed, since otherwise there is no way to do automatic sorting
of includes.
Also reverted change to the docs, as leaving it would make incorrect
docs.

In case of conflicts, includes were sorted according to the coding
standards from #3839.

This reverts commit b4a9f04f92.
This reverts commit 5921122960.
2016-12-29 16:10:53 +00:00
Zetok Zalbavar 7b60a5dd36
chore: explicitly mention that copyright belongs to qTox contributors 2016-11-29 11:12:06 +00:00
Diadlo b4a9f04f92
refactor: Added to include path and exclude it from all includes 2016-11-28 23:28:42 +03:00
Zetok Zalbavar 64bbc6cfbb
style: change postfix increment to prefix increment 2016-11-03 07:57:14 +00:00
Diadlo 72780e6c7a
docs(todo): Changed todo format 2016-08-19 00:20:24 +03:00
Diadlo 1332abed11
docs(chatlog): Added leading stars 2016-08-19 00:20:23 +03:00
Diadlo 233cc412ac
refactor(filetransferwidget): Added ability to check activity 2016-07-31 11:20:57 +03:00
Andrew Morgan 881409b91f
fix(profile): Fix for opening file dialog using Nautilus file manager
Importing a profile, saving a QR code image or setting an auto-accept directory using Nautilus as the default file manager, which many users use, was causing a hang in Qt's  method. Setting Qt to use it's own file manager in this circumstance fixes the issue. Closes #3436, closes #3443.
2016-07-02 15:17:02 -07:00
Vincas Dargis 32d588a499 fix(file transfer widget): QPushButton allows image to overflow
Introduced in 857dfbcd4c

Regression was due to fact that QPushButton allows icon to overflow.
This patch does:
1. Scale and crop icon to fit into button.
2. Avoid upscaling small images.
3. Refactor FileTransferWidget::showPreview() to load image from file
   only once.

Closes #3042
2016-04-17 12:45:39 +03:00
Vincas Dargis 857dfbcd4c Open downloaded image with mouse click on thumbnail 2016-02-14 17:20:11 +02:00
tux3 f0e29a1d46
Fix #1180: Oversized file transfer bubbles 2016-01-21 05:19:30 +01:00
Andrey S d69139bf4a Remove extra spaces 2016-01-04 14:02:37 +03:00
Andrey S 8ce16ad399 Fixes #2484 - Error message inside the chat 2016-01-02 00:00:05 +03:00
Johannes Löthberg e5baa403e0 Add SVG support to filetransfer preview
Only requires Qt SVG which is already a dependency of qTox.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2015-12-21 06:02:32 +01:00
Nils Fenner d14e93ef91
fix faulty parented QFileDialog
closes issue #2205
2015-09-13 23:09:21 +02:00
agilob 602143068c
fix opening directory/file in file transfer widger 2015-08-31 13:59:39 +01:00
agilob db5903c2fe
set one global initial file accept directory for all file transfers 2015-08-30 20:36:39 +01:00