diff --git a/organon.oxt b/organon.oxt index e9366f6..5f94e39 100644 Binary files a/organon.oxt and b/organon.oxt differ diff --git a/source/languages/lang_de.py b/source/languages/lang_de.py index a8d470b..1d1019e 100644 --- a/source/languages/lang_de.py +++ b/source/languages/lang_de.py @@ -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' diff --git a/source/languages/lang_en.py b/source/languages/lang_en.py index 61b2bfb..0cd19ab 100644 --- a/source/languages/lang_en.py +++ b/source/languages/lang_en.py @@ -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' diff --git a/source/py/export.py b/source/py/export.py index 9b826e1..9c95c1b 100644 --- a/source/py/export.py +++ b/source/py/export.py @@ -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) diff --git a/source/py/factory.py b/source/py/factory.py index c032728..db9631b 100644 --- a/source/py/factory.py +++ b/source/py/factory.py @@ -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' @@ -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) @@ -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" @@ -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": @@ -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] @@ -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: diff --git a/source/py/h_feld.py b/source/py/h_feld.py index 26c6d49..2ba394c 100644 --- a/source/py/h_feld.py +++ b/source/py/h_feld.py @@ -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: @@ -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) diff --git a/source/py/importX.py b/source/py/importX.py index 897212c..1f25c95 100644 --- a/source/py/importX.py +++ b/source/py/importX.py @@ -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 @@ -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('[','') @@ -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)) diff --git a/source/py/menu_bar.py b/source/py/menu_bar.py index f9d095a..cf2a14a 100644 --- a/source/py/menu_bar.py +++ b/source/py/menu_bar.py @@ -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' @@ -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: @@ -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) @@ -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) @@ -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 + \ @@ -331,8 +330,11 @@ 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 @@ -340,22 +342,51 @@ def erzeuge_Menu_DropDown_Eintraege_Optionen(self,window,cont): 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 @@ -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) @@ -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) @@ -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() @@ -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)