Skip to content

Commit

Permalink
new version 1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
prrvchr committed Nov 17, 2024
1 parent a8b4ef3 commit 200debc
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 29 deletions.
6 changes: 3 additions & 3 deletions mDriveOOo.update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
xmlns="http://openoffice.org/extensions/update/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="io.github.prrvchr.mDriveOOo"/>
<version value="1.1.5"/>
<version value="1.1.6"/>
<update-download>
<src xlink:href="https://github.com/prrvchr/mDriveOOo/releases/latest/download/mDriveOOo.oxt"/>
</update-download>
Expand All @@ -40,7 +40,7 @@
<name xlink:href="https://prrvchr.github.io/mDriveOOo/README_fr" lang="fr">mDriveOOo</name>
</publisher>
<release-notes>
<src xlink:href="https://prrvchr.github.io/mDriveOOo/#what-has-been-done-for-version-115" lang="en"/>
<src xlink:href="https://prrvchr.github.io/mDriveOOo/README_fr#ce-qui-a-%C3%A9t%C3%A9-fait-pour-la-version-115" lang="fr"/>
<src xlink:href="https://prrvchr.github.io/mDriveOOo/#what-has-been-done-for-version-116" lang="en"/>
<src xlink:href="https://prrvchr.github.io/mDriveOOo/README_fr#ce-qui-a-%C3%A9t%C3%A9-fait-pour-la-version-116" lang="fr"/>
</release-notes>
</description>
2 changes: 1 addition & 1 deletion source/mDriveOOo/Options.xcu
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<value xml:lang="fr">Documents partagés</value>
</prop>
<prop oor:name="ReplicateTimeout">
<value>60</value>
<value>600</value>
</prop>
<prop oor:name="SynchronizePolicy">
<value>CLIENT_IS_MASTER</value>
Expand Down
8 changes: 8 additions & 0 deletions source/mDriveOOo/service/OptionsHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ def callHandlerMethod(self, window, event, method):
elif method == 'DisableSync':
self._manager.enableSync(False)
handled = True
elif method == 'Reset':
self._manager.setReset(bool(event.Source.State))
handled = True
elif method == 'ViewData':
self._manager.viewData()
handled = True
elif method == 'ViewFile':
self._manager.viewFile()
handled = True
elif method == 'Download':
self._manager.download()
handled = True
Expand Down Expand Up @@ -110,7 +116,9 @@ def getSupportedMethodNames(self):
'EnableShare',
'EnableSync',
'DisableSync',
'Reset',
'ViewData',
'ViewFile',
'Download',
'Upload',
'SpinUp1',
Expand Down
2 changes: 1 addition & 1 deletion uno/lib/uno/dbtool/dbtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def checkDataBase(ctx, connection):
logger = getLogger(ctx, g_errorlog, g_basename)
state = logger.resolveString(101)
msg = logger.resolveString(102, g_jar, g_version, version)
logger.logp(SEVERE, g_basename, 'checkDataBase()', msg)
logger.logp(SEVERE, g_basename, 'checkDataBase', msg)
error = getSqlException(state, 1112, msg)
return version, error

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 @@ -115,7 +115,7 @@ def viewLog(self):

# LogManager setter methods called by DialogHandler
def logInfos(self):
self._model.logInfos(INFO, 'LogManager', 'logInfos()', self._requirements)
self._model.logInfos(INFO, 'LogManager', 'logInfos', self._requirements)

# LogManager setter methods called by LoggerListener
def updateLogger(self):
Expand Down
2 changes: 1 addition & 1 deletion uno/lib/uno/logger/logcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def clearLogger(self):
msg = resolver.resolveString(111)
handler = RollerHandler(self._ctx, self.Name)
self.addRollerHandler(handler)
self._logger.logp(SEVERE, 'Logger', 'clearLogger()', msg)
self._logger.logp(SEVERE, 'Logger', 'clearLogger', msg)
self.removeRollerHandler(handler)

def addModifyListener(self, listener):
Expand Down
16 changes: 13 additions & 3 deletions uno/lib/uno/options/ucb/optionsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

from ..unotool import executeDispatch
from ..unotool import getDesktop
from ..unotool import getFilePicker

from ..logger import getLogger
from ..logger import LogManager
Expand All @@ -54,14 +55,14 @@ def __init__(self, ctx, window):
self._logmanager = LogManager(ctx, window, 'requirements.txt', g_defaultlog, g_synclog)
self._view = OptionsView(window, *self._model.getInitData())
self._view.setViewData(*self._model.getViewData(OptionsManager._restart))
self._logger.logprb(INFO, 'OptionsManager', '__init__()', 151)
self._logger.logprb(INFO, 'OptionsManager', '__init__', 151)

_restart = False

def loadSetting(self):
self._view.setViewData(*self._model.getViewData(OptionsManager._restart))
self._logmanager.loadSetting()
self._logger.logprb(INFO, 'OptionsManager', 'loadSetting()', 161)
self._logger.logprb(INFO, 'OptionsManager', 'loadSetting', 161)

def saveSetting(self):
reset, share, name, index, timeout, download, upload = self._view.getViewData()
Expand All @@ -70,18 +71,27 @@ def saveSetting(self):
if changed:
OptionsManager._restart = True
self._view.setRestart(True)
self._logger.logprb(INFO, 'OptionsManager', 'saveSetting()', 171, option, changed)
self._logger.logprb(INFO, 'OptionsManager', 'saveSetting', 171, option, changed)

def enableShare(self, enabled):
self._view.enableShare(enabled)

def enableSync(self, enabled):
self._view.enableSync(enabled, OptionsManager._restart, self._model.hasDataBase())

def setReset(self, enabled):
self._view.enableResetFile(enabled)

def viewData(self):
url = self._model.getDatasourceUrl()
getDesktop(self._ctx).loadComponentFromURL(url, '_default', 0, ())

def viewFile(self):
fp = getFilePicker(self._ctx)
fp.setDisplayDirectory(self._model.getFileUrl())
fp.execute()
fp.dispose()

def download(self):
self._view.setStep(1, OptionsManager._restart)

Expand Down
21 changes: 13 additions & 8 deletions uno/lib/uno/options/ucb/optionsmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
class OptionsModel():
def __init__(self, ctx):
self._config = getConfiguration(ctx, g_identifier, True)
folder = g_folder + g_ucbseparator + g_scheme
location = getResourceLocation(ctx, g_identifier, folder)
self._url = location + '.odb'
self._exist = getSimpleFile(ctx).exists(self._url)
self._url = getResourceLocation(ctx, g_identifier)
self._policies = {'SERVER_IS_MASTER': 1, 'CLIENT_IS_MASTER': 2, 'NONE_IS_MASTER': 3}
self._factors = {'Timeout': 60, 'Chunk': 1024}
sf = getSimpleFile(ctx)
self._hasdatabase = sf.exists(self.getDatasourceUrl())
self._hasfile = sf.exists(self.getFileUrl())

@property
def _ResetSync(self):
Expand Down Expand Up @@ -87,18 +87,23 @@ def _SupportShare(self):
# OptionsModel getter methods
def getInitData(self):
resumable = self._config.getByName('ResumableUpload')
return self._exist, resumable
return self._hasdatabase, self._hasfile, resumable

def hasDataBase(self):
return self._exist
return self._hasdatabase

def getViewData(self, restart):
return (self._exist, self._ResetSync, self._SupportShare,
return (self._hasdatabase, self._ResetSync, self._SupportShare,
self._IsShared, self._ShareName, self._Policy,
self._Timeout, self._Download, self._Upload, restart)

def getDatasourceUrl(self):
return self._url
folder = g_ucbseparator + g_folder + g_ucbseparator + g_scheme
return self._url + folder + '.odb'

def getFileUrl(self):
folder = g_ucbseparator + g_scheme
return self._url + folder

# OptionsModel setter methods
def setViewData(self, reset, share, name, index, timeout, download, upload):
Expand Down
35 changes: 26 additions & 9 deletions uno/lib/uno/options/ucb/optionsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@


class OptionsView():
def __init__(self, window, exist, resumable):
def __init__(self, window, exist, hasfile, resumable):
self._window = window
if exist:
self._disableShare()
self._getReset().Model.Enabled = exist
self._getResetSync().Model.Enabled = exist
self._getResetFile().Model.Enabled = exist
self._getDatasource().Model.Enabled = exist
self._getFile().Model.Enabled = hasfile
self._getUpload().Model.Enabled = resumable

# OptionsView getter methods
def getViewData(self):
reset = bool(self._getReset().State)
reset = self._getResetSync().State
reset += self._getResetFile().State
share = bool(self._getShare().State)
name = self._getShareName().Text
index = self._getOptionIndex()
Expand All @@ -61,9 +64,12 @@ def setStep(self, step, restart):
self.setRestart(restart)

def setViewData(self, exist, reset, support, share, name, index, timeout, download, upload, restart):
self._getReset().State = int(reset)
self._getResetSync().State = int(reset != 0)
self._getResetFile().State = int(reset == 2)
self.enableResetFile(reset != 0)
if support:
self._getShare().State = int(share)
self._getShare().Model.Enabled = True
self._getShareName().Text = name
self.enableShare(share)
else:
Expand All @@ -82,11 +88,16 @@ def enableShare(self, enabled):
self._getShareName().Model.Enabled = enabled

def enableSync(self, enabled, restart, exist):
self._getReset().Model.Enabled = enabled and exist
self._getResetSync().Model.Enabled = enabled and exist
self._getTimeoutLabel().Model.Enabled = enabled
self._getTimeout().Model.Enabled = enabled
self._enableUpload(enabled, restart)

def enableResetFile(self, enabled):
self._getResetFile().Model.Enabled = enabled
if not enabled:
self._getResetFile().State = 0

def setRestart(self, enabled):
self._getRestart().setVisible(enabled)

Expand Down Expand Up @@ -128,12 +139,15 @@ def _enableUpload(self, enabled, restart):
control.Model.Enabled = enabled

# OptionsView private control methods
def _getReset(self):
def _getResetSync(self):
return self._window.getControl('CheckBox1')

def _getShare(self):
def _getResetFile(self):
return self._window.getControl('CheckBox2')

def _getShare(self):
return self._window.getControl('CheckBox3')

def _getShareName(self):
return self._window.getControl('TextField1')

Expand All @@ -149,12 +163,15 @@ def _getTimeout(self):
def _getDatasource(self):
return self._window.getControl('CommandButton1')

def _getFile(self):
return self._window.getControl('CommandButton2')

def _getSpinUp(self, index):
index += 2
index += 3
return self._window.getControl('CommandButton%s' % index)

def _getSpinDown(self, index):
index += 4
index += 5
return self._window.getControl('CommandButton%s' % index)

def _getDownload(self):
Expand Down
4 changes: 2 additions & 2 deletions uno/lib/uno/unolib/unolib.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def getProperties(self):
return tuple(self.properties.values())
def getPropertyByName(self, name):
if self._logger is not None:
self._logger.logprb(INFO, 'PropertySetInfo', 'getPropertyByName()', 711, name)
self._logger.logprb(INFO, 'PropertySetInfo', 'getPropertyByName', 711, name)
if name in self.properties:
return self.properties[name]
raise UnknownPropertyException("UnknownPropertyException", None)
def hasPropertyByName(self, name):
has = name in self.properties
if self._logger is not None:
self._logger.logprb(INFO, 'PropertySetInfo', 'hasPropertyByName()', 721, name, has)
self._logger.logprb(INFO, 'PropertySetInfo', 'hasPropertyByName', 721, name, has)
return has


Expand Down

0 comments on commit 200debc

Please sign in to comment.