Skip to content

Commit

Permalink
v0.6.6b
Browse files Browse the repository at this point in the history
  • Loading branch information
XRoemer committed Jun 13, 2014
1 parent 38630c1 commit 5023d69
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 37 deletions.
Binary file modified organon.oxt
Binary file not shown.
2 changes: 2 additions & 0 deletions source/languages/lang_de.py
Expand Up @@ -27,6 +27,8 @@
NEW_DIR = 'Neuer Ordner'
UNFOLD_PROJ_DIR = 'Projektordner ausklappen'
SHOW_TAG1 = 'zeige Tag 1'
SHOW_TAG2 = 'zeige Tag 2'
SHOW_TAG3 = 'zeige Tag 3'
CREATE_NEW_PROJECT = 'Neues Projekt anlegen'
CANCEL = 'Abbrechen'
OK = 'OK'
Expand Down
2 changes: 2 additions & 0 deletions source/languages/lang_en.py
Expand Up @@ -28,6 +28,8 @@
NEW_DIR = 'New Folder'
UNFOLD_PROJ_DIR = 'Unfold Project Folder'
SHOW_TAG1 = 'Show Tag 1'
SHOW_TAG2 = 'Show Tag 2'
SHOW_TAG3 = 'Show Tag 3'
CREATE_NEW_PROJECT = 'Create New Project'
CANCEL = 'Cancel'
OK = 'OK'
Expand Down
7 changes: 5 additions & 2 deletions source/py/export.py
Expand Up @@ -221,8 +221,11 @@ def erzeuge_exportfenster(self):
modelFO.HelpText = 'URL'
#modelF.Border = True
label = decode_utf(set['speicherort'])
if label != '':
modelFO.Label = uno.fileUrlToSystemPath(label)
try:
l = uno.fileUrlToSystemPath(label)
except:
l = label
modelFO.Label = l
fenster_cont.addControl('Speicherort', controlFO)

listener = Speicherordner_Button_Listener(self.mb,modelFO)
Expand Down
18 changes: 9 additions & 9 deletions source/py/factory.py
Expand Up @@ -6,12 +6,12 @@
import unohelper


oxt = False
debug = False

tb = traceback.print_exc
platform = sys.platform

if oxt:
if debug:
pyPath = 'H:\\Programmierung\\Eclipse_Workspace\\Organon\\source\\py'
if platform == 'linux':
pyPath = '/home/xgr/Arbeitsordner/organon/py'
Expand Down Expand Up @@ -51,13 +51,13 @@ def get_imple(klass):

def __init__(self, ctx, *args):
self.ctx = ctx
if oxt:print("factory init")
if debug:print("factory init")
#pydevBrk()
def do(self):
return

def createInstanceWithArgumentsAndContext(self, args, ctx):
#if oxt:print('createInstanceWithArgumentsAndContext in Factory')
#if debug:print('createInstanceWithArgumentsAndContext in Factory')
try:

CWHandler = ContainerWindowHandler(ctx)
Expand Down Expand Up @@ -93,7 +93,7 @@ def createInstanceWithArgumentsAndContext(self, args, ctx):
EXT_ID = "xaver.roemers.organon"

def create_window(ctx,factory):
#if oxt: print('create_window')
#if debug: print('create_window')

dialog1 = "vnd.sun.star.extension://xaver.roemers.organon/factory/Dialog1.xdl"

Expand All @@ -118,14 +118,14 @@ def create_window(ctx,factory):
class ContainerWindowHandler(unohelper.Base, XContainerWindowEventHandler):

def __init__(self, ctx):
#if oxt:print('init ContainerWindowHandler')
#if debug:print('init ContainerWindowHandler')
self.ctx = ctx
self.window2 = None
#pydevBrk()

# XContainerWindowEventHandler
def callHandlerMethod(self, window, obj, name):
#if oxt:print('callHandlerMethod')
#if debug:print('callHandlerMethod')
#pydevBrk()
if name == "external_event":
if obj == "initialize":
Expand All @@ -136,7 +136,7 @@ def getSupportedMethodNames(self):
return "external_event",

def _initialize(self, window):
#if oxt:print('_initialize in ContainerWindowHandler')
#if debug:print('_initialize in ContainerWindowHandler')

path_to_current = __file__.decode("utf-8")
pyPath = path_to_current.split('factory.py')[0]
Expand All @@ -153,7 +153,7 @@ def start_main(pd,window,ctx,tabs,path_to_extension):

dialog = window

if oxt:
if debug:
modul = 'menu_bar'
menu_bar = load_reload_modul(modul,pyPath) # gleichbedeutend mit: import menu_bar
else:
Expand Down
4 changes: 2 additions & 2 deletions source/py/h_feld.py
Expand Up @@ -210,7 +210,7 @@ def korrigiere_scrollbar(self):

def erzeuge_neue_Zeile(self,ordner_oder_datei,erzeuge_File = True):

self.mb.timer_start = self.mb.time.clock()
#self.mb.timer_start = self.mb.time.clock()
if self.mb.debug: print(self.mb.debug_time(),'erzeuge_neue_Zeile')

if self.mb.selektierte_zeile == None:
Expand Down Expand Up @@ -293,7 +293,7 @@ def kontrolle(self):


def leere_Papierkorb(self):
self.mb.timer_start = self.mb.time.clock()
#self.mb.timer_start = self.mb.time.clock()
if self.mb.debug: print(self.mb.debug_time(),'leere_Papierkorb')
try:
self.mb.current_Contr.removeSelectionChangeListener(self.mb.VC_selection_listener)
Expand Down
13 changes: 10 additions & 3 deletions source/py/importX.py
Expand Up @@ -230,6 +230,7 @@ def erzeuge_filter(self):
# wird zuerst nach den richtigen Positionen gesucht

fil = FF.getByName(FilterNames[0])
fil2 = typeDet.getByName(typeDet.ElementNames[0])

i = 0

Expand All @@ -246,8 +247,15 @@ def erzeuge_filter(self):
flags_pos = i

i += 1


i = 0

for fil in fil2:
if fil.Name == 'Extensions':
extensions_pos = i

i += 1

def formatiere(term):
term = term.replace("'","")
term = term.replace('[','')
Expand Down Expand Up @@ -280,8 +288,7 @@ def formatiere2(term):
uiName = f[uiName_pos].Value
filter_typeDet = typeDet.getByName(f[type_pos].Value)

# in LO und OO gleich
extensions = filter_typeDet[5].Value
extensions = filter_typeDet[extensions_pos].Value
label2 = formatiere2(extensions)
label2.insert(0,str(uiName))

Expand Down
76 changes: 55 additions & 21 deletions source/py/menu_bar.py
Expand Up @@ -15,12 +15,10 @@
tb = traceback.print_exc
platform = sys.platform

debug = False


oxt = False


if oxt:
if debug:
pyPath = 'H:\\Programmierung\\Eclipse_Workspace\\Organon\\source\\py'
if platform == 'linux':
pyPath = '/home/xgr/Arbeitsordner/organon/py'
Expand All @@ -35,7 +33,7 @@ def __init__(self,pdk,dialog,ctx,tabs,path_to_extension):
self.pd = pdk
global pd,IMPORTS
pd = pdk

IMPORTS = ('traceback','uno','unohelper','sys','os','ElementTree','time','codecs','math','re','tb','platform','KONST','pd','copy')

if 'LibreOffice' in sys.executable:
Expand Down Expand Up @@ -109,10 +107,11 @@ def __init__(self,pdk,dialog,ctx,tabs,path_to_extension):


# fuers debugging
self.debug = True
if self.debug: print('Debug = True')
self.time = time
self.timer_start = self.time.clock()
self.debug = debug
if self.debug:
print('Debug = True')
self.time = time
self.timer_start = self.time.clock()


self.dialog.addWindowListener(self.w_listener)
Expand Down Expand Up @@ -149,7 +148,7 @@ def erzeuge_Menu(self):
self.erzeuge_Menu_Kopf_Datei(listener)
self.erzeuge_Menu_Kopf_Optionen(listener)

if oxt:
if debug:
self.erzeuge_Menu_Kopf_Test(listener)

self.erzeuge_Menu_neuer_Ordner(listener2)
Expand Down Expand Up @@ -246,7 +245,7 @@ def erzeuge_Menu_DropDown_Container(self,ev):
oWindowDesc.WindowAttributes = 32

# Set Window Attributes
gnDefaultWindowAttributes = 1 + 16 # + 32 +64+128
gnDefaultWindowAttributes = 1 # + 16 + 32 + 64 + 128
# com_sun_star_awt_WindowAttribute_SHOW + \
# com_sun_star_awt_WindowAttribute_BORDER + \
# com_sun_star_awt_WindowAttribute_MOVEABLE + \
Expand Down Expand Up @@ -331,31 +330,63 @@ def erzeuge_Menu_DropDown_Eintraege_Datei(self,window,cont):

def erzeuge_Menu_DropDown_Eintraege_Optionen(self,window,cont):
try:

y = 10

# Tag1
control_tag1, model_tag1 = self.createControl(self.ctx, "CheckBox", 10, 10,
control_tag1, model_tag1 = self.createControl(self.ctx, "CheckBox", 10, y,
KONST.Breite_Menu_DropDown_Eintraege-6, 30-6, (), ())
model_tag1.Label = self.lang.SHOW_TAG1

if self.settings_proj['tag1']:
model_tag1.State = 1
else:
model_tag1.State = 0

y += 16

# Tag2
control_tag2, model_tag2 = self.createControl(self.ctx, "CheckBox", 10, y,
KONST.Breite_Menu_DropDown_Eintraege-6, 30-6, (), ())
model_tag2.Label = self.lang.SHOW_TAG2
control_tag2.Enable = False

if self.settings_proj['tag2']:
model_tag2.State = 1
else:
model_tag2.State = 0

y += 16

# Tag3
control_tag3, model_tag3 = self.createControl(self.ctx, "CheckBox", 10, y,
KONST.Breite_Menu_DropDown_Eintraege-6, 30-6, (), ())
model_tag3.Label = self.lang.SHOW_TAG3
control_tag3.Enable = False

if self.settings_proj['tag3']:
model_tag3.State = 1
else:
model_tag3.State = 0


tag1_listener = Tag1_Item_Listener(self,model_tag1)
control_tag1.addItemListener(tag1_listener)
cont.addControl('Checkbox_Tag1', control_tag1)
cont.addControl('Checkbox_Tag2', control_tag2)
cont.addControl('Checkbox_Tag3', control_tag3)


y += 24


# ListBox
control, model = self.createControl(self.ctx, "ListBox", 10, 34, KONST.Breite_Menu_DropDown_Eintraege-6,
control, model = self.createControl(self.ctx, "ListBox", 10, y, KONST.Breite_Menu_DropDown_Eintraege-6,
KONST.Hoehe_Menu_DropDown_Eintraege - 30, (), ())
control.setMultipleMode(False)

items = ( self.lang.UNFOLD_PROJ_DIR,
'-------',
'#Homepage',
'#Updates',
'#Etc.')
'#Homepage')

control.addItems(items, 0)
model.BackgroundColor = KONST.MENU_DIALOG_FARBE
Expand All @@ -382,7 +413,7 @@ def get_speicherort(self):

def get_Klasse_Hauptfeld(self):

if oxt:
if debug:
modul = 'h_feld'
h_feld = load_reload_modul(modul,pyPath,self)

Expand All @@ -401,7 +432,7 @@ def get_Klasse_Hauptfeld(self):
def lade_modul(self,modul,arg = None):

try:
if oxt:
if debug:
load_reload_modul(modul,pyPath,self)
exec('import '+modul)

Expand Down Expand Up @@ -456,7 +487,10 @@ def erzeuge_neue_Projekte(self):
traceback.print_exc()

def erzeuge_Zeile(self,ordner_oder_datei):
self.class_Hauptfeld.erzeuge_neue_Zeile(ordner_oder_datei)
try:
self.class_Hauptfeld.erzeuge_neue_Zeile(ordner_oder_datei)
except:
tb()

def leere_Papierkorb(self):
self.class_Hauptfeld.leere_Papierkorb()
Expand Down Expand Up @@ -771,7 +805,7 @@ def mache_tag1_sichtbar(self,sichtbar):
class Key_Handler(unohelper.Base, XKeyHandler):

def __init__(self,mb):
#if oxt:print('init Keyhandler')
#if debug:print('init Keyhandler')
self.mb = mb
self.mb.keyhandler = self
mb.current_Contr.addKeyHandler(self)
Expand Down

0 comments on commit 5023d69

Please sign in to comment.