Commit Graph

120 Commits

Author SHA1 Message Date
40ca07f8f8 Extract YACReaderNavigationController::exitSearchMode() 2021-12-29 11:01:35 +01:00
c5d3ebebc8 Remove commented code 2021-10-19 00:00:09 +02:00
86a31c0ea5 Use QRegularExpression 2021-10-19 00:00:09 +02:00
2c0dccd764 Use constructor explicitly 2021-10-19 00:00:09 +02:00
47e7eb3801 Remove unused includes 2021-10-19 00:00:09 +02:00
8173f9f94c Use setContentsMargins instead of setMargin 2021-10-19 00:00:09 +02:00
5aa02a19bb clang-format 2021-10-18 21:56:52 +02:00
def1cd56d0 Fix macos build 2021-09-27 17:45:29 +02:00
b4c90a8920 Add support for scanning xml info from the libraries context menu
This will let people to rescan their existing libraries.
2021-09-27 15:40:48 +02:00
f1e4396dc5 YACReaderLibrary: Convert a bunch of widgets/dialogs to new slot syntax 2021-06-29 13:53:12 +02:00
485ce1c9d8 Convert Mac toolbar to new slot syntax 2021-06-29 13:53:12 +02:00
8377de7c3e Clazy: Use fixits to refactor some old style signal connections 2021-06-29 13:53:12 +02:00
85677afc7b Merge pull request #203 from vedgy/fix-library-crash-at-exit-after-deletion
Library: don't crash at exit after a folder or a comic is deleted
2021-06-19 18:13:51 +02:00
91c9375dc1 Fix opening a comic from the current/next comic banner in the grid view 2021-06-19 07:24:29 +02:00
2acfbbfac7 Library: add Quit shortcut
The Ctrl+Q shortcut is assigned to Quit action in most applications on
GNU/Linux. Command+Q is used on macOS. The added shortcut should be
automatically mapped to Command+Q on macOS judging by the following
quote from QKeySequence class documentation:
Note: On macOS, references to "Ctrl", Qt::CTRL, Qt::Key_Control and
Qt::ControlModifier correspond to the Command keys on the Macintosh
keyboard

QKeySequence::Quit could be used as the default key sequence in place of
`Qt::CTRL | Qt::Key_Q`. This would leave the shortcut unassigned by
default on Windows. But YACReader doesn't use QKeySequence::StandardKey
anywhere, so perhaps this shortcut should be hard-coded too.

The shortcut is particularly useful when Close to tray option is
enabled, because in this case closing the Library window with a system
window manager shortcut simply hides it.
2021-05-28 19:34:24 +02:00
945b24a8f8 Extract opening a comic from YACReaderLibrary to its own file
And send a new param `--readingListId` to tell YACReader that the comic is opened from a reading list.
2021-05-27 18:48:52 +02:00
e2483217d9 Configure OpenGL settings earlier to avoid wrong state in the options dialog 2021-05-16 09:37:05 +02:00
13d0f5fc75 Do not show the what's new dialog when there are no libraries
No libraries probably means fresh installation.
2021-05-16 09:21:42 +02:00
13a29e2657 Make "delete" icon work properly in the "Reading" list
Only the "Favorites" special list was handled.
2021-05-16 09:01:35 +02:00
84c43e456e Merge pull request #209 from vedgy/add-focus-shortcuts
Add focus shortcuts
2021-03-13 17:09:46 +01:00
06814d066a Merge pull request #200 from vedgy/rename-processor-class-typo
Fix a typo in ComicQueryResultProcessor class name
2021-03-13 15:54:22 +01:00
8a54100804 Library: allow configuring a shortcut to focus comics view
Focusing the current comics view allows to use keyboard arrow keys to
choose among the visible comics.

The shortcut for this new action should not be a single character
without modifiers because it won't work when the search line has focus.

The Qt::FocusReason parameter in ComicsView::focusComicsNavigation()
allows to reuse this function for other keyboard navigation features.
For instance the search line can transfer focus to comics navigation
when the user presses Return or Enter key. In this case
Qt::OtherFocusReason can be used (an application-specific reason).
2021-03-13 15:08:33 +02:00
81e40dabec Library: add a shortcut to focus search line
The Ctrl+F shortcut gives focus to a search bar in many applications.
In this case it allows to search the library without touching a mouse.

YACReaderMacOSXSearchLineEdit::setFocus() will have to be implemented to
make the shortcut work on macOS.
2021-03-13 14:59:29 +02:00
3c9ed6ef8f Deprecated qSort => std::sort
This change gets rid of some GCC's -Wdeprecated-declarations warnings.
2021-03-09 21:32:23 +01:00
3fcf31d936 Enable/disable comics actions after updating search results
Before this commit starting a search when an empty folder or an empty
reading list was selected left all comics actions disabled. Fixes #213.

When search mode is exited, we always call either
YACReaderNavigationController::loadFolderInfo() or
YACReaderNavigationController::loadListInfo(). Both of them call
LibraryWindow::disableComicsActions(), so the enabled/disabled state of
the comics actions stays up-to-date at all times.
2021-03-06 21:01:20 +01:00
c4333915c9 Library: don't leak DB model objects at exit
Currently these objects are created once at program startup and are
never destroyed. Printing debug messages in the models' destructors
confirms the leaks and proves that with this fix the objects are
destroyed at Library exit.
2021-03-06 21:00:31 +01:00
aa9dd95d5d LibraryWindow: remove a duplicate signal-slot connection
QSqlDatabase::commit() in ComicModel::finishTransaction() returned false
(failed) when this slot was invoked the second time in a row.
2021-02-07 20:16:20 +02:00
5257dc88d6 Library: destroy the temporary thread when deleting finishes
finished() signal of both FoldersRemover and ComicsRemover was not
connected to their QThread's quit() slot. So the thread kept running
after the deletion completed. The QThread's parent is LibraryWindow.
Thus LibraryWindow's ~QObject() invokes the QThread's destructor.

As a result, when the user exited YACReader Library after deleting at
least one folder or comic, it printed the following FATAL message and
crashed at exit: "QThread: Destroyed while thread is still running".

Extract signal-slot connections between a remover and a QThread into
moveAndConnectRemoverToThread() to reduce code duplication.

Remove always true (thread != NULL) checks.
2021-02-07 19:46:15 +02:00
12c2ff027a ComicQueryResultProcessor: fix a typo in the class name 2021-02-06 20:08:44 +02:00
64d0e22fb5 Library: don't leak folderQueryResultProcessor at exit
FolderQueryResultProcessor has a ConcurrentQueue data member. The leak
meant that the thread was not joined before exit.
2021-02-04 17:58:33 +02:00
58fdf0af23 Add what's new dialog 2021-01-21 21:39:22 +01:00
20c772797b Fix typo 2021-01-16 18:59:53 +01:00
6461a4014e Add actions for setting folders as manga/normal 2021-01-16 18:31:48 +01:00
97c7723b17 Add support for setting issues as manga/normal in the comics view 2021-01-16 14:25:47 +01:00
5343d24f26 Run folder search filtering in the background
It uses the same approach used by the comics search filter
2021-01-14 11:37:17 +01:00
ccc382df7d Use ComicQueryResultProcesor 2021-01-14 09:17:18 +01:00
e1b0e7c96f Fix full screen mode in windows with qt 5.12.4+ 2019-09-28 10:11:44 +02:00
ef8216b338 Make closeApp work with no event
And exit using QApplication.exit so we don't mess with window events to exit the app
2019-09-21 12:11:03 +02:00
8e99d9e59f Extract the system tray functionality to its own class
LibraryWindow is already a monster, so we'll try to not make it bigger.
2019-09-21 10:47:01 +02:00
403e657062 A new trayicon is needed for macos 2019-09-20 13:41:26 +02:00
6031c81d81 Add better icons for the system tray in macos and windows
I would like to design specific icons for the system tray at some point, but for now this is what we have.
2019-09-20 10:07:20 +02:00
a0f682be7b Merge went bad
Hopefully this is all that got messed up
2019-09-19 22:32:07 +02:00
a632480422 Format 2019-09-19 21:16:56 +02:00
e587f59ddb Add support for minimize and start to tray. 2019-09-19 20:22:14 +02:00
bb334cfd50 Use auto to avoid duplicating the type name 2019-06-01 16:04:48 +02:00
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +02:00
c1810b9e54 Library: do not needlessly retrieve all comics from the DB
The siblings variable is unused. So the ComicModel::getAllComics() call
is redundant unless there is some unobvious side effect (I hope not).
2019-05-24 14:53:52 +03:00
c044e93446 Library: typecast in comparison of int and quint64 2019-04-01 11:25:16 +02:00
f7b4b7a5d1 Library: add missing 'case' to a 'switch' 2019-04-01 11:25:16 +02:00
3062d8826e Library: reorder initialization of LibraryWindow 2019-04-01 11:25:16 +02:00