From 5023d6918c8fef0db1ebe06b7d0d76dd304044c2 Mon Sep 17 00:00:00 2001 From: XRoemer Date: Fri, 13 Jun 2014 09:42:05 +0200 Subject: [PATCH] v0.6.6b --- organon.oxt | Bin 928878 -> 930486 bytes source/languages/lang_de.py | 2 + source/languages/lang_en.py | 2 + source/py/export.py | 7 +++- source/py/factory.py | 18 ++++----- source/py/h_feld.py | 4 +- source/py/importX.py | 13 ++++-- source/py/menu_bar.py | 76 ++++++++++++++++++++++++++---------- 8 files changed, 85 insertions(+), 37 deletions(-) diff --git a/organon.oxt b/organon.oxt index e9366f67c8e32cd58c69197aba288b600c9e2f85..5f94e3950beedc284f4da46e0d2e08ee0cd84a08 100644 GIT binary patch delta 2332 zcmaJ?4Nz3q6@L5nzV~()-gS{hfrZ_-EU>U3F1t2B6ct6Sra`MFrnME;x^5xM?pBt_ zwo?+OlakD&KgQB;)TUu3BQxg50ku50R;ptnO{!^~R@!Ew)>zGyq>MB*#?g`9{Q=yj zlQ(nTJ@?#uzx&;DzjxlmUu%c2*ABj6oBPeR=NnzIXEOqGIWBG{4p|mD@90IFowzrB zdHt5=%?)eZO1_EaNZB=$BT^|S8P05 zvglo{YkE}zZ_~F!yZG=Yl zNx%e8&*yp0MRd8B-HuA-TcKcNS16Ui12Ixz z^rS~UIDJ4cqh*(%$MS20NKvJtUU4r<+z2LmBoX&w|>hq%blBI8{AY!yv{091E zQK$Z-MEqSQPWOu2)#Gk4cU10r@?7Ijw=SRG`6kD8s+aDFdn{PIP@0PdNCiS5t`uDU zL{f_5f=P7cnU5nOxYg@t?kRww=Ow%Pey-#{DDP-H*EqVyRCwuCj=Q987?J*_xTZg< zovnd*k%>gZzD8f9%I}M;h&FlKePz>;RRLeSFBnlRSEP3}u<$w^2A`5L@b*TX#Sli!$@ zmKr&&PUC(d{gO4k!p2MY>@(ccfQ=T~z@rgYEHoEySg1=ghRYVZR(mU~0lmrRVWpM2 zv|DcS@t&<*!<$kVX%&`LS$P(i8}7M^Q&w7FO)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h z_%ygbl23pctNG!|Tnk^hOG_GeZs%3weuRw5g&zJFS>eirbFA|ApL~GnnlH@L0W}k$ zrb2k2T5)i{hUcIrDCD)7`*|t?m0?swDsfZ{in(91T+bwFP>@A@x{n~7MP6kF?!oaa; zNw>z%FhV3IC?6)<$OJb3DTb(xn6=uV!$w9h2VQ}%Y$TsC48S8Bv1p$3=dGdbF~krx za*&rz0!-_52xpVw&X|7Cp2S9<8RSs7#T#l4*EdFBmW?FapErOuA@(BUPw;ARRh=3< zM~eo=PD^ZA0v0=YnTa;QTstjw-cs0NCleU18T#yG5_9P^7<0%(CXx)Zb4URb2tvE6 zAAbQ?a>yih_mg2@a?pS!)8Q=#DPZkeMEKxS(FBJa#KGRaB|_<4x?Acc3BWpO#)D(P z>ZHuoQJC+fOx_=%!$}I6fpoY*arRiX0ptclDvWm#2eYypLM~Foq;jxV)xW<1cU<(; z{tj@tDNE@csCCoyr|!b%ZZeg**bfigq!52OAR!1w1S8DwP@2^bq1i*>OaDk{n+a 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)