Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Export/Import (to file) Reading List #1163

Merged
merged 5 commits into from
Aug 11, 2024
Merged

Conversation

ShaopengLin
Copy link
Collaborator

Fix #61

Changes:

  • User can Export to or Import from a file.
  • Added Menu Button to File section of Main Menu for Ex/Import Reading List.
  • Added UI on Reading List Bar for Ex/Import.

@ShaopengLin
Copy link
Collaborator Author

@veloman-yunkan The readBookmarkFile simply appends all bookmarks to the library. This can create duplicate bookmark entries. Should we do the elimination on Kiwix-Desktop or libkiwix?

@kelson42
Copy link
Collaborator

@ShaopengLin Thank you for the PR, I will give a try today.

Copy link
Collaborator

@kelson42 kelson42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but please use OS "Download" directory instead of current directory for the default filepicker location
@veloman-yunkan ready for code review

@kelson42
Copy link
Collaborator

kelson42 commented Aug 7, 2024

@veloman-yunkan We need urgently a code review.

src/readinglistbar.cpp Outdated Show resolved Hide resolved
Comment on lines 157 to 164
void PortMenu::showEvent(QShowEvent* event)
{
Q_UNUSED(event);

QPoint p = this->pos();
QRect geo = b->geometry();
this->move(p.x()+geo.width() - 4, p.y() - b->iconSize().height());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be solved via styling instead?

Copy link
Collaborator Author

@ShaopengLin ShaopengLin Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think its possible as the position seems to be hardcoded by Qt. Found no style exported to change this. We can also choose to use the default popup menu behavior instead of the subclassing.

src/readinglistbar.cpp Outdated Show resolved Hide resolved
@veloman-yunkan
Copy link
Collaborator

@veloman-yunkan The readBookmarkFile simply appends all bookmarks to the library. This can create duplicate bookmark entries. Should we do the elimination on Kiwix-Desktop or libkiwix?

@kelson42 Should we address the above issue in this PR?

src/readinglistbar.cpp Outdated Show resolved Hide resolved
src/readinglistbar.cpp Outdated Show resolved Hide resolved
"zim-path": "Zim File Path"
"zim-path": "Zim File Path",
"export-reading-list": "Export reading list",
"export-reading-list-error": "An error has occured during export."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kelson42 Are you fine with such an error message? I don't like that "reading list" is missing from the error text. Also no details about the error are provided, but addressing that one will require changes to libkiwix, and most likely that part won't be translated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the message as requested and waiting for confirmation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veloman-yunkan Yes, message should be "An error has occured during reading list export."

"export-reading-list-error": "An error has occured during export."
"export-reading-list-error": "An error has occured during export.",
"import-reading-list": "Import reading list",
"import-reading-list-error": "An error has occured during import."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kelson42 Are you fine with such an error message? I don't like that "reading list" is missing from the error text. Also no details about the error are provided, but addressing that one will require changes to libkiwix, and most likely that part won't be translated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the message as requested and waiting for confirmation.

@ShaopengLin ShaopengLin force-pushed the Issue#61-export-bookmark branch 2 times, most recently from 230c287 to bc71850 Compare August 10, 2024 17:44
Copy link
Collaborator

@veloman-yunkan veloman-yunkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Not approving yet, since there is an unanswered question.

@kelson42
Copy link
Collaborator

@veloman-yunkan The readBookmarkFile simply appends all bookmarks to the library. This can create duplicate bookmark entries. Should we do the elimination on Kiwix-Desktop or libkiwix?

@kelson42 Should we address the above issue in this PR?

@kelson42
Copy link
Collaborator

@veloman-yunkan The readBookmarkFile simply appends all bookmarks to the library. This can create duplicate bookmark entries. Should we do the elimination on Kiwix-Desktop or libkiwix?

@kelson42 Should we address the above issue in this PR?

@veloman-yunkan Very good point, I have open a dedicated issue as this is not trivial to fix and we can leave IMHO with this weakness #1171

Added Menu button to export reading list to file
Add menu button to import/append reading list from file
Document folder is the default folder to ex/import.
@kelson42 kelson42 changed the title Introduce Ex/Import Reading List Introduce Export/Import (to file) Reading List Aug 11, 2024
@kelson42 kelson42 merged commit 5cc48d7 into main Aug 11, 2024
4 checks passed
@kelson42 kelson42 deleted the Issue#61-export-bookmark branch August 11, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow option to export bookmarks
3 participants