Add version info. Add linter
This commit is contained in:
parent
c191d9f35c
commit
d338033333
7 changed files with 67 additions and 0 deletions
|
|
@ -59,6 +59,7 @@
|
|||
"documentation": "Documentation",
|
||||
"couldnt_open": "Couldn't open",
|
||||
"report_a_bug": "Report a bug",
|
||||
"version": "Version",
|
||||
"navigate": "Navigate",
|
||||
"current": "current",
|
||||
"selected": "selected",
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
"documentation": "Documentation",
|
||||
"couldnt_open": "Impossible d’ouvrir",
|
||||
"report_a_bug": "Signaler un bug",
|
||||
"version": "Version",
|
||||
"navigate": "Naviguer",
|
||||
"current": "actuel",
|
||||
"selected": "sélectionné",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
import importlib.metadata
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
|
|
@ -263,6 +264,12 @@ class MainWindow(QMainWindow):
|
|||
act_bugs.triggered.connect(self._open_bugs)
|
||||
help_menu.addAction(act_bugs)
|
||||
self.addAction(act_bugs)
|
||||
act_version = QAction(strings._("version"), self)
|
||||
act_version.setShortcut("Ctrl+V")
|
||||
act_version.setShortcutContext(Qt.ApplicationShortcut)
|
||||
act_version.triggered.connect(self._open_version)
|
||||
help_menu.addAction(act_version)
|
||||
self.addAction(act_version)
|
||||
|
||||
# Autosave
|
||||
self._dirty = False
|
||||
|
|
@ -1177,6 +1184,11 @@ class MainWindow(QMainWindow):
|
|||
strings._("couldnt_open") + url.toDisplayString(),
|
||||
)
|
||||
|
||||
def _open_version(self):
|
||||
version = importlib.metadata.version("bouquin")
|
||||
version_formatted = f"{APP_NAME} {version}"
|
||||
QMessageBox.information(self, strings._("version"), version_formatted)
|
||||
|
||||
# ----------------- Idle handlers ----------------- #
|
||||
def _apply_idle_minutes(self, minutes: int):
|
||||
minutes = max(0, int(minutes))
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ _DEFAULT = "en"
|
|||
strings = {}
|
||||
translations = {}
|
||||
|
||||
|
||||
def load_strings(current_locale: str) -> None:
|
||||
global strings, translations
|
||||
translations = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue