Commit Graph

47930 Commits

Author SHA1 Message Date
Charles Haley 671d84037f Context menu items for import and export. Also fixed the context menu not appearing when a disabled widget is right-clicked. 2023-11-13 19:21:31 +05:30
Kovid Goyal d1be987b01 Sanitize suggested file name for notes export 2023-11-13 19:21:31 +05:30
Kovid Goyal c8acbec3d1 Finish implementation of import/export of notes in note edit dialog 2023-11-13 19:21:31 +05:30
Kovid Goyal 10af00f3b3 Start work on export/import in edit notes dialog 2023-11-13 19:21:31 +05:30
Kovid Goyal 33072bf70e ... 2023-11-13 19:21:31 +05:30
Kovid Goyal 0f76bf19f8 Test re-import of exported note 2023-11-13 19:21:31 +05:30
Kovid Goyal d3ae36a965 Export notes as a single HTML file with embedded images 2023-11-13 19:21:31 +05:30
Kovid Goyal 7df0ec7bee Handle URL quoting when importing notes 2023-11-13 19:21:31 +05:30
Kovid Goyal 2076fa282d Add basic tests for export/import of notes 2023-11-13 19:21:31 +05:30
Kovid Goyal 721d13a809 API to export/import notes to HTML 2023-11-13 19:21:31 +05:30
Kovid Goyal 1fb3b9ea28 Sanitize filenames for notes resources 2023-11-13 19:21:31 +05:30
Kovid Goyal fa83be4192 unretiring notes should not duplicate item value at the top of the searchable text 2023-11-13 19:21:30 +05:30
Charles Haley ba2de90d00 First try at the template functions for notes. 2023-11-13 19:21:30 +05:30
Kovid Goyal e6e5f0fe9f Make loading of notes resources in HTMLDisplay opt-in
HTMLDisplay is a generic class so its not appropriate for it
to try to load notes resources everywhere.
2023-11-13 19:21:30 +05:30
Charles Haley 2856922aeb Add fetching calres: resources to HTMLDisplay. This permits a copy of a note in a composite column to display properly. 2023-11-13 19:21:30 +05:30
Kovid Goyal b0766d7a62 Track creation and modified timestamps for notes 2023-11-13 19:21:30 +05:30
Kovid Goyal 652fb651cb Remove retired entry when setting a note value
Useful since the number of reired entries is capped, no need to use up
one slot for a note that has a value set
2023-11-13 19:21:30 +05:30
Kovid Goyal 07a77403a8 Fix retiring a note with a resource throwing an error if a version of the note with the same resource is already retired 2023-11-13 19:21:30 +05:30
Charles Haley b9dcc6ee85 Add the undo button. Clean up some code. 2023-11-13 19:21:30 +05:30
Charles Haley 36f65e9187 Some refactoring and improvements:
1) Add a context menu to the notes widget. Remove the keyboard handler as it isn't needed.
2) Allow passing an item string value instead of an item_id to __init__
3) Make the notes widget self contained, making the signal advisory instead of mandatory
4) Add a delete note button to the widget.
2023-11-13 19:21:30 +05:30
Kovid Goyal 8e8f038896 Add API to get all data associated with a note including searchable_text 2023-11-13 19:21:30 +05:30
Charles Haley 50019962b1 Edit Authors dialog 2023-11-13 19:21:30 +05:30
Charles Haley a240ef62ec Add editing notes to manage categories, and to the context menu of the tag browser.
Still to do: adding notes to manage authors.
2023-11-13 19:21:30 +05:30
Charles Haley c11c051309 Fix set_note updating all notes when one is changed. 2023-11-13 19:21:30 +05:30
Kovid Goyal 3b37b5270a Implement removal of images by right clicking on them 2023-11-13 19:21:30 +05:30
Kovid Goyal f0cacfdf44 Dont bother implementing browse_existing
It's painful to implement in a performant way and not too useful
2023-11-13 19:21:30 +05:30
Kovid Goyal 9250613998 Ensure searchable_text and references_resources exist 2023-11-13 19:21:29 +05:30
Kovid Goyal 99478d5209 Implement commit of edited note to db 2023-11-13 19:21:29 +05:30
Kovid Goyal 29435392c6 Also implement caching of images for the comments editor 2023-11-13 19:21:29 +05:30
Kovid Goyal d540c6db88 Properly cache image resources
Also use a unique name per image placement
2023-11-13 19:21:29 +05:30
Kovid Goyal 5082280c0e Fix extra qpainter end() call 2023-11-13 19:21:29 +05:30
Kovid Goyal 705c174271 Better handling of image alignment change on right click 2023-11-13 19:21:29 +05:30
Kovid Goyal 9240af7d40 allow changing image alignment for floating images as well 2023-11-13 19:21:29 +05:30
Kovid Goyal 0be966db4a Draw a border for the image preview widget even when empty 2023-11-13 19:21:29 +05:30
Kovid Goyal e26df3b529 Allow right click to adjust image alignment 2023-11-13 19:21:29 +05:30
Kovid Goyal 6a3d7388d7 Get basic image insertion working 2023-11-13 19:21:29 +05:30
Kovid Goyal 54c43bc7ef When doing FTS on notes also match on item values 2023-11-13 19:21:29 +05:30
Kovid Goyal 00936dbafb Future proof backing up of resource metadata
Store the metadata as json instead of plain text so we can add more
fields if needed in the future.
2023-11-13 19:21:29 +05:30
Kovid Goyal d120efdced Implement link insertion 2023-11-13 19:21:29 +05:30
Kovid Goyal a52f03fa5c More work on note editing UI 2023-11-13 19:21:29 +05:30
Kovid Goyal bf723cd34d Start on GUI for editing notes 2023-11-13 19:21:29 +05:30
Kovid Goyal d7c88aaf01 Increase wait time for restore test 2023-11-13 19:21:28 +05:30
Kovid Goyal fe4292c3cc Implement database rebuild for notes data 2023-11-13 19:21:28 +05:30
Kovid Goyal 6017bafe48 Use hashes as primary key for resources
This will allow rebuild of database as the backup documents will refer
to resource hashes not ids (its very difficult to restore resources with
ids unchanged). Also this allows docs to be migrated between databases
easily.
2023-11-13 19:21:28 +05:30
Kovid Goyal 713f1af61e Implement vacuuming for notes db 2023-11-13 19:21:28 +05:30
Kovid Goyal bdcd3b6203 Handle reopen in the notes backend
Also dont use colons in filenames as they cause problems on windows
2023-11-13 19:21:28 +05:30
Kovid Goyal 08116c8c88 See if explicitly closing importers fixes CI failure on windows 2023-11-13 19:21:28 +05:30
Kovid Goyal 611356ddb0 Bloody windows and its insane file semantics 2023-11-13 19:21:28 +05:30
Kovid Goyal 5d67c74add Implement ex/im for notes 2023-11-13 19:21:28 +05:30
Kovid Goyal cfadc5fc4d ... 2023-11-13 19:21:28 +05:30