mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Indicate when running in portable mode in the status bar. Fixes #1925108 [list calibre version in bottom left hand corner by version number](https://bugs.launchpad.net/calibre/+bug/1925108)
This commit is contained in:
parent
09470577fe
commit
1455f4dda1
@ -395,6 +395,13 @@ def get_version():
|
||||
return v
|
||||
|
||||
|
||||
def get_appname_for_display():
|
||||
ans = __appname__
|
||||
if isportable:
|
||||
ans = _('{} portable').format(ans)
|
||||
return ans
|
||||
|
||||
|
||||
def get_portable_base():
|
||||
'Return path to the directory that contains calibre-portable.exe or None'
|
||||
if isportable:
|
||||
|
@ -8,12 +8,12 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import functools
|
||||
from qt.core import (
|
||||
QAction, QApplication, QIcon, QLabel, QMenu, QPainter, QSizePolicy, QSplitter,
|
||||
QStackedWidget, QStatusBar, QStyle, QStyleOption, Qt, QTabBar, QTimer,
|
||||
QToolButton, QVBoxLayout, QWidget, QDialog, QEvent
|
||||
QAction, QApplication, QDialog, QEvent, QIcon, QLabel, QMenu, QPainter,
|
||||
QSizePolicy, QSplitter, QStackedWidget, QStatusBar, QStyle, QStyleOption, Qt,
|
||||
QTabBar, QTimer, QToolButton, QVBoxLayout, QWidget
|
||||
)
|
||||
|
||||
from calibre.constants import __appname__, get_version, ismacos
|
||||
from calibre.constants import get_appname_for_display, get_version, ismacos
|
||||
from calibre.customize.ui import find_plugin
|
||||
from calibre.gui2 import (
|
||||
config, error_dialog, gprefs, is_widescreen, open_local_file, open_url
|
||||
@ -266,7 +266,7 @@ class StatusBar(QStatusBar): # {{{
|
||||
def __init__(self, parent=None):
|
||||
QStatusBar.__init__(self, parent)
|
||||
self.version = get_version()
|
||||
self.base_msg = '%s %s' % (__appname__, self.version)
|
||||
self.base_msg = f'{get_appname_for_display()} {self.version}'
|
||||
self.device_string = ''
|
||||
self.update_label = UpdateLabel('')
|
||||
self.total = self.current = self.selected = self.library_total = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user