Skip to content

Commit

Permalink
new version 1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
prrvchr committed Aug 31, 2024
1 parent 89b0a4c commit 52d2a55
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 136 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions source/HyperSQLOOo/OptionsDialog.xcu
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<node oor:name="Nodes">
<node oor:name="io.github.prrvchr.HyperSQLOOo" oor:op="fuse">
<prop oor:name="Label">
<value xml:lang="en-US">Base drivers</value>
<value xml:lang="fr-FR">Pilotes Base</value>
<value xml:lang="en-US">LibreOffice Base</value>
<value xml:lang="fr-FR">LibreOffice Base</value>
</prop>
<prop oor:name="AllModules">
<value>true</value>
Expand Down
105 changes: 0 additions & 105 deletions uno/lib/uno/embedded/options/optionshandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import unohelper

from com.sun.star.awt import XContainerWindowEventHandler
from com.sun.star.lang import XEventListener

import traceback
Expand All @@ -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')

19 changes: 4 additions & 15 deletions uno/lib/uno/embedded/options/optionsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -38,34 +35,26 @@
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
import sys
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()
Expand Down
4 changes: 1 addition & 3 deletions uno/lib/uno/embedded/options/optionsmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
╚════════════════════════════════════════════════════════════════════════════════════╝
"""

import unohelper

from com.sun.star.logging.LogLevel import INFO
from com.sun.star.logging.LogLevel import SEVERE

Expand All @@ -46,7 +44,7 @@
import traceback


class OptionsModel(unohelper.Base):
class OptionsModel():

_level = False
_reboot = False
Expand Down
12 changes: 2 additions & 10 deletions uno/lib/uno/embedded/options/optionsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion uno/lib/uno/logger/dialog/logmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 52d2a55

Please sign in to comment.