Changeset 292

Show
Ignore:
Timestamp:
08/16/11 10:15:26 (22 months ago)
Author:
mbutscher
Message:

branches/stable-2.1:
* Bug fixed: Problems with autocompletion if wiki word contains

question mark

branches/mbutscher/work:
* Bug fixed: Harmless exception when starting without wiki and opening

one then

* Bug fixed: WikidPad's own print dialog wasn't closed after starting

print of type "HTML (Webkit)"

* Bug fixed: Javascript wasn't processesd (correctly) if printing HTML

with Webkit (some problems persist)

* Option to suppress reaction of HTML preview on "updated wiki page"

events for IE to avoid automatic scrolling of preview window upward
to begin

* Bug fixed: Problems with autocompletion if wiki word contains

question mark

Location:
branches
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • branches/mbutscher/work/WikidPad.xrc

    r291 r292  
    24202420        <object class="wxCheckBox" name="cbMouseScrollUnderPointer"> 
    24212421          <label>Scroll under pointer (Windows only, exp.)</label> 
     2422        </object> 
     2423        <flag>wxALL|wxEXPAND|wxALIGN_CENTRE_VERTICAL</flag> 
     2424        <border>5</border> 
     2425      </object> 
     2426      <object class="sizeritem"> 
     2427        <object class="wxCheckBox" name="cbHtmlPreviewReduceUpdateHandling"> 
     2428          <label>Reduce update handling in HTML preview</label> 
    24222429        </object> 
    24232430        <flag>wxALL|wxEXPAND|wxALIGN_CENTRE_VERTICAL</flag> 
  • branches/mbutscher/work/lib/pwiki/Configuration.py

    r291 r292  
    574574    ("main", "html_preview_ieShowIframes"): u"False",  # Show iframes with external sources inside IE preview? 
    575575    ("main", "html_preview_webkitViKeys"): u"False",  # Allow shortcut keys of vi editor to move around in Webkit preview 
     576    ("main", "html_preview_reduceUpdateHandling"): u"False",  # Switch off reaction on "updated wiki page" events 
     577            # to avoid automatic scrolling of preview window upward to begin (especially for IE) 
    576578 
    577579    ("main", "html_body_link"): u"",  # for HTML preview/export, color for link or "" for default 
     
    731733            # this is only necessary for special layouts where ctrl-level uses fundamentally different layout 
    732734            # than base and shift level 
    733     ("main", "zombieCheck"): "True", # Check for alread running processes? Only active if "single_process" is True 
     735    ("main", "zombieCheck"): "True", # Check for already running processes? Only active if "single_process" is True 
    734736 
    735737    ("main", "tempHandling_preferMemory"): "False", # Prefer to store temporary data in memory where this is possible? 
  • branches/mbutscher/work/lib/pwiki/MainAreaPanel.py

    r277 r292  
    337337        """ 
    338338        current = self.currentPresenter 
     339        if current is None: 
     340            return 
     341 
    339342        if not isinstance(current, BasicDocPagePresenter): 
    340343            # Current presenter is not a doc page one, so take first doc page 
  • branches/mbutscher/work/lib/pwiki/OptionsDialog.py

    r291 r292  
    601601            ("editor_compatibility_ViKeys", "cbEditorCompatibilityViKeys", "b"), 
    602602            ("mouse_scrollUnderPointer", "cbMouseScrollUnderPointer", "b"), 
     603            ("html_preview_reduceUpdateHandling", 
     604                    "cbHtmlPreviewReduceUpdateHandling", "b"), 
    603605 
    604606            ("auto_save", "cbAutoSave", "b"), 
  • branches/mbutscher/work/lib/pwiki/Printing.py

    r285 r292  
    1111from wxHelper import * 
    1212 
    13 from StringOps import escapeHtml, unescapeWithRe 
     13from StringOps import escapeHtml, unescapeWithRe, urlFromPathname 
    1414 
    1515from TempFileSet import TempFileSet 
     
    728728        exporterInstance.styleSheet = u"" 
    729729         
     730        htpath = self.tempFileSet.createTempFile( 
     731                    u"", ".html", relativeTo="").decode("latin-1") 
     732 
    730733        realfp = StringIO.StringIO() 
    731         exporterInstance.exportHtmlMultiFile(realfp=realfp, tocMode=0) 
    732  
    733         return realfp.getvalue().decode("utf-8") 
     734        with open(htpath, "w") as realfp: 
     735            exporterInstance.exportHtmlMultiFile(realfp=realfp, tocMode=0) 
     736 
     737        return htpath  # realfp.getvalue().decode("utf-8") 
    734738 
    735739    def doPrint(self, doPreview=False): 
     
    742746        if self.checkWebkit(): 
    743747            import gtk 
    744             text = self._buildHtml() 
     748            htpath = self._buildHtml() 
    745749            frame = None 
    746750 
     
    760764                print_op.set_default_page_setup(page_setup) 
    761765 
    762                 frame = WKPrintFrame(text) 
     766                frame = WKPrintFrame(htpath) 
    763767                if doPreview: 
    764768                    opCode = gtk.PRINT_OPERATION_ACTION_PREVIEW 
     769                    frame.print_full(print_op, opCode) 
     770                    return False 
    765771                else: 
    766772                    opCode = gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG 
    767  
    768                 frame.print_full(print_op, opCode) 
    769  
     773                    result = frame.print_full(print_op, opCode) 
     774                    return result in (gtk.PRINT_OPERATION_RESULT_APPLY, 
     775                            gtk.PRINT_OPERATION_RESULT_IN_PROGRESS) 
    770776            finally: 
    771777                if frame: 
     
    793799 
    794800    class WKPrintPanel(wx.Panel): 
    795         def __init__(self, parent, html): 
     801        def __init__(self, parent, htpath): 
    796802            """Panel to contain webkit ctrl""" 
    797803            wx.Panel.__init__(self, parent) 
     
    799805            self.html_preview = WKHtmlWindow(self) 
    800806            self.html_preview.PizzaMagic() 
    801             self.html_preview.LoadHtmlString(html) 
     807            url = "file:" + urlFromPathname(htpath) 
     808            self.html_preview.LoadUrl(url) 
    802809             
    803810         
     
    808815    class WKPrintFrame(wx.Frame): 
    809816        """Frame to contain webkit ctrl panel""" 
    810         def __init__(self, html): 
     817        def __init__(self, htpath): 
    811818            wx.Frame.__init__(self, None) 
    812             self.html_panel = WKPrintPanel(self, html) 
     819            self.html_panel = WKPrintPanel(self, htpath) 
    813820         
    814821        def print_full(self, print_op, opCode): 
  • branches/mbutscher/work/lib/pwiki/WikiHtmlView.py

    r289 r292  
    357357 
    358358    def onUpdatedWikiPage(self, miscevt): 
     359        if self.presenter.getConfig().getboolean("main", 
     360                "html_preview_reduceUpdateHandling", False): 
     361            return 
     362 
    359363        self.outOfSync = True 
    360364        if self.visible: 
  • branches/mbutscher/work/lib/pwiki/WikiHtmlViewIE.py

    r279 r292  
    355355 
    356356    def onUpdatedWikiPage(self, miscevt): 
     357        if self.presenter.getConfig().getboolean("main", 
     358                "html_preview_reduceUpdateHandling", False): 
     359            return 
     360 
    357361        self.outOfSync = True 
    358362        if self.visible: 
     
    364368 
    365369    def OnSetFocus(self, evt): 
    366         # Trying to fix mysterious crashes (but doesn't help) 
    367370        try: 
    368371            if self.visible: 
  • branches/mbutscher/work/lib/pwiki/WikiHtmlViewWK.py

    r289 r292  
    330330        self.currentHtpath = 0 # index into self.htpaths 
    331331 
    332         self.normHtpaths = [os.path.normcase(getLongPath(self.htpaths[0])), 
    333                 os.path.normcase(getLongPath(self.htpaths[1]))] 
    334  
    335  
    336332        #wx.EVT_KEY_DOWN(self, self.OnKeyDown) 
    337333        #wx.EVT_KEY_UP(self, self.OnKeyUp) 
     
    12721268 
    12731269    def onUpdatedWikiPage(self, miscevt): 
     1270#         if self.presenter.getConfig().getboolean("main", 
     1271#                 "html_preview_reduceUpdateHandling", False): 
     1272#             return 
    12741273        #self.outOfSync = True 
    12751274        #if self.visible: 
  • branches/mbutscher/work/lib/pwiki/WikiTxtCtrl.py

    r291 r292  
    250250        # set the autocomplete separator 
    251251        self.AutoCompSetSeparator(1)   # ord('~') 
     252        self.AutoCompSetTypeSeparator(2)   # ord('?') 
    252253 
    253254        # register some event handlers 
  • branches/mbutscher/work/lib/pwiki/sqlite3api.py

    r247 r292  
    545545             
    546546 
    547 _GLOB_ESCAPE_RE = re.compile(r"([\[\]\*])") 
     547_GLOB_ESCAPE_RE = re.compile(r"([\[\]\*\?])") 
    548548 
    549549def escapeForGlob(s): 
  • branches/stable-2.1/lib/pwiki/WikiTxtCtrl.py

    r277 r292  
    230230        # set the autocomplete separator 
    231231        self.AutoCompSetSeparator(1)   # ord('~') 
     232        self.AutoCompSetTypeSeparator(2)   # ord('?') 
    232233 
    233234        # register some event handlers 
  • branches/stable-2.1/lib/pwiki/sqlite3api.py

    r247 r292  
    545545             
    546546 
    547 _GLOB_ESCAPE_RE = re.compile(r"([\[\]\*])") 
     547_GLOB_ESCAPE_RE = re.compile(r"([\[\]\*\?])") 
    548548 
    549549def escapeForGlob(s):