3 Gestione delle toolbars di LeenO
5 from com.sun.star.awt
import Point
10 from LeenoConfig
import Config
14 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar',
15 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_ELENCO',
16 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_ANALISI',
17 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_COMPUTO',
18 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_CATEG',
19 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_CONTABILITA',
26 accende tutte le toolbars (se non sono richieste quelle contestuali)
27 oppure solo quelle relative alla pagina visualizzata, se richieste le contestuali
31 if sys.platform ==
'linux' or sys.platform ==
'darwin':
36 if 'giuserpe' in os.getlogin():
37 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_DEV', 1)
39 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_DEV', 0)
43 oLayout = oDoc.CurrentController.getFrame().LayoutManager
45 if Config().read(
'Generale',
'toolbar_contestuali') ==
'0':
52 oLayout.showElement(
"private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar")
53 nSheet = oDoc.CurrentController.ActiveSheet.Name
55 if nSheet ==
'Elenco Prezzi':
56 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_ELENCO', 1)
57 elif nSheet ==
'Analisi di Prezzo':
58 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_ANALISI', 1)
59 elif nSheet
in (
'COMPUTO',
'VARIANTE'):
60 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_COMPUTO', 1)
61 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_CATEG', 1)
62 elif nSheet ==
'CONTABILITA':
63 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_COMPUTO', 1)
64 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_CONTABILITA', 1)
66 if 'giuserpe' in os.getlogin():
67 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_CATEG', 1)
69 On(
'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_CATEG', 0)
76 def On(toolbarURL, flag):
78 toolbarURL { string } : indirizzo toolbar
79 flag { integer } : 1 = acceso; 0 = spento
80 Visualizza o nascondi una toolbar
83 oLayout = oDoc.CurrentController.getFrame().LayoutManager
85 oLayout.showElement(toolbarURL)
87 oLayout.hideElement(toolbarURL)
96 oLayout = oDoc.CurrentController.getFrame().LayoutManager
98 for aBar
in _TOOLBAR_NAMES:
99 oLayout.dockWindow(aBar,
'DOCKINGAREA_TOP', Point(i, 4))
102 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_DEV',
103 'DOCKINGAREA_RIGHT', Point(0, 0))
108 Accende o spegne tutte le toolbar di LeenO
110 for aBar
in _TOOLBAR_NAMES:
116 Spegne tutte le toolbar di LeenO
123 Nasconde o mostra le toolbar di Libreoffice.
126 oLayout = oDoc.CurrentController.getFrame().LayoutManager
127 for el
in oLayout.Elements:
128 if el.ResourceURL
not in _TOOLBAR_NAMES + (
129 'private:resource/menubar/menubar',
130 'private:resource/toolbar/addon_ULTIMUS_3.OfficeToolBar_DEV',
131 'private:resource/toolbar/findbar',
132 'private:resource/statusbar/statusbar',
136 oLayout.showElement(el.ResourceURL)
138 oLayout.hideElement(el.ResourceURL)