Skip to content

Commit

Permalink
Add Open Data Folder menu option
Browse files Browse the repository at this point in the history
  • Loading branch information
1over137 committed Feb 27, 2024
1 parent 4984846 commit fc08fa6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vocabsieve/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def setupMenu(self) -> None:
self.export_known_words_action = QAction("Export known words to JSON")
self.export_word_scores_action = QAction("Export word scores to JSON")
self.open_logs_action = QAction("View session logs")
self.open_data_folder_action = QAction("Open data folder")

if not self.settings.value("reader_enabled", True, type=bool):
self.open_reader_action.setEnabled(False)
Expand All @@ -242,6 +243,7 @@ def setupMenu(self) -> None:
helpmenu.addAction(self.help_action)
helpmenu.addAction(self.about_action)
helpmenu.addAction(self.open_logs_action)
helpmenu.addAction(self.open_data_folder_action)
recordmenu.addAction(self.content_manager_action)
recordmenu.addAction(self.mark_words_action)
analyzemenu.addAction(self.analyze_book_action)
Expand Down Expand Up @@ -273,6 +275,7 @@ def setupMenu(self) -> None:
self.export_known_words_action.triggered.connect(self.exportKnownWords)
self.export_word_scores_action.triggered.connect(self.exportWordData)
self.mark_words_action.triggered.connect(self.markWords)
self.open_data_folder_action.triggered.connect(self.onOpenDataFolder)

importmenu.addActions(
[
Expand All @@ -299,7 +302,8 @@ def markWords(self):
dialog = WordMarkingDialog(self, words)
dialog.exec()


def onOpenDataFolder(self):
QDesktopServices.openUrl(QUrl.fromLocalFile(datapath))

def onAnalyzeBook(self):
if self.checkAnkiConnect() and self.known_data is not None:
Expand Down

0 comments on commit fc08fa6

Please sign in to comment.