Skip to content

Commit

Permalink
show web view name in status bar (fix #346)
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Sep 24, 2024
1 parent fa8583a commit e03cdb9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions q3dwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ def __init__(self, qgisIface, settings, preview=True):
self.ui.setupUi(self)

self.webPage = self.ui.webView._page
viewName = ""

if self.webPage:
settings.jsonSerializable = self.webPage.isWebEnginePage
viewName = "WebEngine" if self.webPage.isWebEnginePage else "WebKit"
else:
preview = False

Expand All @@ -136,7 +138,7 @@ def __init__(self, qgisIface, settings, preview=True):

self.setupMenu()
self.setupConsole()
self.setupStatusBar(self.iface, preview)
self.setupStatusBar(self.iface, preview, viewName)
self.ui.treeView.setup(self.iface, self.icons)
self.ui.treeView.addLayers(settings.layers())

Expand Down Expand Up @@ -272,7 +274,7 @@ def setupConsole(self):

self.ui.lineEditInputBox.returnPressed.connect(self.runConsoleCommand)

def setupStatusBar(self, iface, previewEnabled=True):
def setupStatusBar(self, iface, previewEnabled=True, viewName=""):
w = QProgressBar(self.ui.statusbar)
w.setObjectName("progressBar")
w.setMaximumWidth(250)
Expand All @@ -283,7 +285,7 @@ def setupStatusBar(self, iface, previewEnabled=True):

w = QCheckBox(self.ui.statusbar)
w.setObjectName("checkBoxPreview")
w.setText("Preview") # _translate("Q3DWindow", "Preview"))
w.setText("Preview" + " ({})".format(viewName) if viewName else "") # _translate("Q3DWindow", "Preview"))
w.setChecked(previewEnabled)
self.ui.statusbar.addPermanentWidget(w)
self.ui.checkBoxPreview = w
Expand Down

0 comments on commit e03cdb9

Please sign in to comment.