From 52d2a553a321cd57e9e5bb42856b54ae4489387b Mon Sep 17 00:00:00 2001 From: prrvchr Date: Sat, 31 Aug 2024 06:29:32 +0200 Subject: [PATCH] new version 1.1.5 --- README.md | 1 + README_fr.md | 1 + source/HyperSQLOOo/OptionsDialog.xcu | 4 +- .../uno/embedded/options/optionshandler.py | 105 ------------------ .../uno/embedded/options/optionsmanager.py | 19 +--- uno/lib/uno/embedded/options/optionsmodel.py | 4 +- uno/lib/uno/embedded/options/optionsview.py | 12 +- uno/lib/uno/logger/dialog/logmanager.py | 2 +- 8 files changed, 12 insertions(+), 136 deletions(-) diff --git a/README.md b/README.md index 7f8afae4..89786b88 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,7 @@ ___ - Fixed [issue #2][50] which appears to be a regression related to the release of JaybirdOOo. Thanks to TeddyBoomer for reporting it. - Updated the [Python setuptools][49] package to version 73.0.1. - Logging accessible in extension options now displays correctly on Windows. +- The extension options are now accessible via: **Tools -> Options... -> LibreOffice Base -> Embedded HsqlDB Driver** ### What remains to be done for version 1.1.5: diff --git a/README_fr.md b/README_fr.md index 50178ee2..72f56ab2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -266,6 +266,7 @@ ___ - Correction du [problème n°2][50] qui semble être une régression liée à la sortie de JaybirdOOo. Merci à TeddyBoomer de l'avoir signalé. - Mise à jour du paquet [Python setuptools][49] vers la version 73.0.1. - La journalisation accessible dans les options de l’extension s’affiche désormais correctement sous Windows. +- Les options de l'extension sont désormais accessibles via: **Outils -> Options... -> LibreOffice Base -> Pilote HsqlDB intégré** ### Que reste-t-il à faire pour la version 1.1.5: diff --git a/source/HyperSQLOOo/OptionsDialog.xcu b/source/HyperSQLOOo/OptionsDialog.xcu index 035bb79f..ea2f4ae3 100644 --- a/source/HyperSQLOOo/OptionsDialog.xcu +++ b/source/HyperSQLOOo/OptionsDialog.xcu @@ -8,8 +8,8 @@ - Base drivers - Pilotes Base + LibreOffice Base + LibreOffice Base true diff --git a/uno/lib/uno/embedded/options/optionshandler.py b/uno/lib/uno/embedded/options/optionshandler.py index d9849556..0650571a 100644 --- a/uno/lib/uno/embedded/options/optionshandler.py +++ b/uno/lib/uno/embedded/options/optionshandler.py @@ -29,7 +29,6 @@ import unohelper -from com.sun.star.awt import XContainerWindowEventHandler from com.sun.star.lang import XEventListener import traceback @@ -48,107 +47,3 @@ def disposing(self, source): msg = "OptionsHandler.disposing() Error: %s" % traceback.format_exc() print(msg) - -class Tab1Handler(unohelper.Base, - XContainerWindowEventHandler): - def __init__(self, manager): - self._manager = manager - - # XContainerWindowEventHandler - def callHandlerMethod(self, window, event, method): - try: - handled = False - if method == 'Base': - self._manager.setDriverService(0) - handled = True - elif method == 'Enhanced': - self._manager.setDriverService(1) - handled = True - elif method == 'Level0': - self._manager.setConnectionService(0) - handled = True - elif method == 'Level1': - self._manager.setConnectionService(1) - handled = True - elif method == 'Level2': - self._manager.setConnectionService(2) - handled = True - return handled - except Exception as e: - msg = "Tab1Handler.callHandlerMethod() Error: %s" % traceback.format_exc() - print(msg) - - def getSupportedMethodNames(self): - return ('Base', - 'Enhanced', - 'Level0', - 'Level1', - 'Level2') - - -class Tab2Handler(unohelper.Base, - XContainerWindowEventHandler): - def __init__(self, manager): - self._manager = manager - - # XContainerWindowEventHandler - def callHandlerMethod(self, window, event, method): - try: - handled = False - if method == 'SetDriver': - if self._manager.isHandlerEnabled(): - driver = event.Source.getSelectedItem() - self._manager.setDriver(driver) - handled = True - elif method == 'New': - self._manager.newDriver() - handled = True - elif method == 'Remove': - self._manager.removeDriver() - handled = True - elif method == 'Save': - self._manager.saveDriver() - handled = True - elif method == 'Cancel': - self._manager.cancelDriver() - handled = True - elif method == 'Check': - self._manager.checkDriver() - handled = True - elif method == 'Update': - self._manager.updateArchive() - handled = True - elif method == 'Search': - self._manager.searchArchive() - handled = True - elif method == 'ToggleLogger': - control = event.Source - enabled = control.Model.Enabled - state = control.State == 1 - self._manager.toggleLogger(enabled, state) - handled = True - elif method == 'SetLogger': - control = event.Source - enabled = control.Model.Enabled - # XXX: There is nothing to do if logging is not supported - if enabled: - level = control.getSelectedItemPos() - self._manager.setLogger(level) - handled = True - return handled - except Exception as e: - msg = "Tab2Handler.callHandlerMethod() Error: %s" % traceback.format_exc() - print(msg) - - def getSupportedMethodNames(self): - return ('SetDriver', - 'New', - 'Remove', - 'Save', - 'Cancel', - 'Check', - 'Update', - 'Search', - 'ToggleLogger', - 'SetLogger') - diff --git a/uno/lib/uno/embedded/options/optionsmanager.py b/uno/lib/uno/embedded/options/optionsmanager.py index 171f1c8c..cbc0e5fa 100644 --- a/uno/lib/uno/embedded/options/optionsmanager.py +++ b/uno/lib/uno/embedded/options/optionsmanager.py @@ -27,9 +27,6 @@ ╚════════════════════════════════════════════════════════════════════════════════════╝ """ -import uno -import unohelper - from com.sun.star.ui.dialogs.ExecutableDialogResults import OK from com.sun.star.logging.LogLevel import INFO @@ -38,18 +35,9 @@ from .optionsmodel import OptionsModel from .optionsview import OptionsView from .optionshandler import OptionsListener -from .optionshandler import Tab1Handler -from .optionshandler import Tab2Handler - -from ..unotool import createService -from ..unotool import getFilePicker -from ..unotool import getSimpleFile -from ..unotool import getUrl from ..logger import LogManager -from ..configuration import g_extension -from ..configuration import g_identifier from ..configuration import g_defaultlog import os @@ -57,15 +45,16 @@ import traceback -class OptionsManager(unohelper.Base): +class OptionsManager(): def __init__(self, ctx, window, url=None): self._ctx = ctx self._disposed = False self._disabled = False self._model = OptionsModel(ctx, url) window.addEventListener(OptionsListener(self)) - self._view = OptionsView(window, *self._model.getViewData()) - self._logmanager = LogManager(ctx, window.getPeer(), 'requirements.txt', g_identifier, g_defaultlog) + self._view = OptionsView(window) + self._view.initView(*self._model.getViewData()) + self._logmanager = LogManager(ctx, window.getPeer(), 'requirements.txt', g_defaultlog) def dispose(self): self._logmanager.dispose() diff --git a/uno/lib/uno/embedded/options/optionsmodel.py b/uno/lib/uno/embedded/options/optionsmodel.py index 7cfc89bc..5cb327f6 100644 --- a/uno/lib/uno/embedded/options/optionsmodel.py +++ b/uno/lib/uno/embedded/options/optionsmodel.py @@ -27,8 +27,6 @@ ╚════════════════════════════════════════════════════════════════════════════════════╝ """ -import unohelper - from com.sun.star.logging.LogLevel import INFO from com.sun.star.logging.LogLevel import SEVERE @@ -46,7 +44,7 @@ import traceback -class OptionsModel(unohelper.Base): +class OptionsModel(): _level = False _reboot = False diff --git a/uno/lib/uno/embedded/options/optionsview.py b/uno/lib/uno/embedded/options/optionsview.py index 95726163..b48cd776 100644 --- a/uno/lib/uno/embedded/options/optionsview.py +++ b/uno/lib/uno/embedded/options/optionsview.py @@ -27,20 +27,12 @@ ╚════════════════════════════════════════════════════════════════════════════════════╝ """ -import uno -import unohelper - -from ..unotool import getContainerWindow - -from ..configuration import g_extension - import traceback -class OptionsView(unohelper.Base): - def __init__(self, window, driver, connection, updated, enabled, version, reboot): +class OptionsView(): + def __init__(self, window): self._window = window - self.initView(driver, connection, updated, enabled, version, reboot) # OptionsView setter methods def initView(self, driver, connection, updated, enabled, version, reboot): diff --git a/uno/lib/uno/logger/dialog/logmanager.py b/uno/lib/uno/logger/dialog/logmanager.py index de6d1f8f..2b08652f 100644 --- a/uno/lib/uno/logger/dialog/logmanager.py +++ b/uno/lib/uno/logger/dialog/logmanager.py @@ -79,7 +79,7 @@ def saveSetting(self): # LogManager setter methods called by OptionsHandler def loadSetting(self): self.disableHandler() - self._view.setLogSetting(self._model.loadSetting()) + self._view.setLogSetting(*self._model.loadSetting()) # LogManager setter methods called by LoggerListener def updateLoggers(self):