Changeset 292
- Timestamp:
- 08/16/11 10:15:26 (22 months ago)
- Location:
- branches
- Files:
-
- 12 modified
-
mbutscher/work/WikidPad.xrc (modified) (1 diff)
-
mbutscher/work/lib/pwiki/Configuration.py (modified) (2 diffs)
-
mbutscher/work/lib/pwiki/MainAreaPanel.py (modified) (1 diff)
-
mbutscher/work/lib/pwiki/OptionsDialog.py (modified) (1 diff)
-
mbutscher/work/lib/pwiki/Printing.py (modified) (7 diffs)
-
mbutscher/work/lib/pwiki/WikiHtmlView.py (modified) (1 diff)
-
mbutscher/work/lib/pwiki/WikiHtmlViewIE.py (modified) (2 diffs)
-
mbutscher/work/lib/pwiki/WikiHtmlViewWK.py (modified) (2 diffs)
-
mbutscher/work/lib/pwiki/WikiTxtCtrl.py (modified) (1 diff)
-
mbutscher/work/lib/pwiki/sqlite3api.py (modified) (1 diff)
-
stable-2.1/lib/pwiki/WikiTxtCtrl.py (modified) (1 diff)
-
stable-2.1/lib/pwiki/sqlite3api.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/mbutscher/work/WikidPad.xrc
r291 r292 2420 2420 <object class="wxCheckBox" name="cbMouseScrollUnderPointer"> 2421 2421 <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> 2422 2429 </object> 2423 2430 <flag>wxALL|wxEXPAND|wxALIGN_CENTRE_VERTICAL</flag> -
branches/mbutscher/work/lib/pwiki/Configuration.py
r291 r292 574 574 ("main", "html_preview_ieShowIframes"): u"False", # Show iframes with external sources inside IE preview? 575 575 ("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) 576 578 577 579 ("main", "html_body_link"): u"", # for HTML preview/export, color for link or "" for default … … 731 733 # this is only necessary for special layouts where ctrl-level uses fundamentally different layout 732 734 # than base and shift level 733 ("main", "zombieCheck"): "True", # Check for alread running processes? Only active if "single_process" is True735 ("main", "zombieCheck"): "True", # Check for already running processes? Only active if "single_process" is True 734 736 735 737 ("main", "tempHandling_preferMemory"): "False", # Prefer to store temporary data in memory where this is possible? -
branches/mbutscher/work/lib/pwiki/MainAreaPanel.py
r277 r292 337 337 """ 338 338 current = self.currentPresenter 339 if current is None: 340 return 341 339 342 if not isinstance(current, BasicDocPagePresenter): 340 343 # Current presenter is not a doc page one, so take first doc page -
branches/mbutscher/work/lib/pwiki/OptionsDialog.py
r291 r292 601 601 ("editor_compatibility_ViKeys", "cbEditorCompatibilityViKeys", "b"), 602 602 ("mouse_scrollUnderPointer", "cbMouseScrollUnderPointer", "b"), 603 ("html_preview_reduceUpdateHandling", 604 "cbHtmlPreviewReduceUpdateHandling", "b"), 603 605 604 606 ("auto_save", "cbAutoSave", "b"), -
branches/mbutscher/work/lib/pwiki/Printing.py
r285 r292 11 11 from wxHelper import * 12 12 13 from StringOps import escapeHtml, unescapeWithRe 13 from StringOps import escapeHtml, unescapeWithRe, urlFromPathname 14 14 15 15 from TempFileSet import TempFileSet … … 728 728 exporterInstance.styleSheet = u"" 729 729 730 htpath = self.tempFileSet.createTempFile( 731 u"", ".html", relativeTo="").decode("latin-1") 732 730 733 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") 734 738 735 739 def doPrint(self, doPreview=False): … … 742 746 if self.checkWebkit(): 743 747 import gtk 744 text= self._buildHtml()748 htpath = self._buildHtml() 745 749 frame = None 746 750 … … 760 764 print_op.set_default_page_setup(page_setup) 761 765 762 frame = WKPrintFrame( text)766 frame = WKPrintFrame(htpath) 763 767 if doPreview: 764 768 opCode = gtk.PRINT_OPERATION_ACTION_PREVIEW 769 frame.print_full(print_op, opCode) 770 return False 765 771 else: 766 772 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) 770 776 finally: 771 777 if frame: … … 793 799 794 800 class WKPrintPanel(wx.Panel): 795 def __init__(self, parent, ht ml):801 def __init__(self, parent, htpath): 796 802 """Panel to contain webkit ctrl""" 797 803 wx.Panel.__init__(self, parent) … … 799 805 self.html_preview = WKHtmlWindow(self) 800 806 self.html_preview.PizzaMagic() 801 self.html_preview.LoadHtmlString(html) 807 url = "file:" + urlFromPathname(htpath) 808 self.html_preview.LoadUrl(url) 802 809 803 810 … … 808 815 class WKPrintFrame(wx.Frame): 809 816 """Frame to contain webkit ctrl panel""" 810 def __init__(self, ht ml):817 def __init__(self, htpath): 811 818 wx.Frame.__init__(self, None) 812 self.html_panel = WKPrintPanel(self, ht ml)819 self.html_panel = WKPrintPanel(self, htpath) 813 820 814 821 def print_full(self, print_op, opCode): -
branches/mbutscher/work/lib/pwiki/WikiHtmlView.py
r289 r292 357 357 358 358 def onUpdatedWikiPage(self, miscevt): 359 if self.presenter.getConfig().getboolean("main", 360 "html_preview_reduceUpdateHandling", False): 361 return 362 359 363 self.outOfSync = True 360 364 if self.visible: -
branches/mbutscher/work/lib/pwiki/WikiHtmlViewIE.py
r279 r292 355 355 356 356 def onUpdatedWikiPage(self, miscevt): 357 if self.presenter.getConfig().getboolean("main", 358 "html_preview_reduceUpdateHandling", False): 359 return 360 357 361 self.outOfSync = True 358 362 if self.visible: … … 364 368 365 369 def OnSetFocus(self, evt): 366 # Trying to fix mysterious crashes (but doesn't help)367 370 try: 368 371 if self.visible: -
branches/mbutscher/work/lib/pwiki/WikiHtmlViewWK.py
r289 r292 330 330 self.currentHtpath = 0 # index into self.htpaths 331 331 332 self.normHtpaths = [os.path.normcase(getLongPath(self.htpaths[0])),333 os.path.normcase(getLongPath(self.htpaths[1]))]334 335 336 332 #wx.EVT_KEY_DOWN(self, self.OnKeyDown) 337 333 #wx.EVT_KEY_UP(self, self.OnKeyUp) … … 1272 1268 1273 1269 def onUpdatedWikiPage(self, miscevt): 1270 # if self.presenter.getConfig().getboolean("main", 1271 # "html_preview_reduceUpdateHandling", False): 1272 # return 1274 1273 #self.outOfSync = True 1275 1274 #if self.visible: -
branches/mbutscher/work/lib/pwiki/WikiTxtCtrl.py
r291 r292 250 250 # set the autocomplete separator 251 251 self.AutoCompSetSeparator(1) # ord('~') 252 self.AutoCompSetTypeSeparator(2) # ord('?') 252 253 253 254 # register some event handlers -
branches/mbutscher/work/lib/pwiki/sqlite3api.py
r247 r292 545 545 546 546 547 _GLOB_ESCAPE_RE = re.compile(r"([\[\]\* ])")547 _GLOB_ESCAPE_RE = re.compile(r"([\[\]\*\?])") 548 548 549 549 def escapeForGlob(s): -
branches/stable-2.1/lib/pwiki/WikiTxtCtrl.py
r277 r292 230 230 # set the autocomplete separator 231 231 self.AutoCompSetSeparator(1) # ord('~') 232 self.AutoCompSetTypeSeparator(2) # ord('?') 232 233 233 234 # register some event handlers -
branches/stable-2.1/lib/pwiki/sqlite3api.py
r247 r292 545 545 546 546 547 _GLOB_ESCAPE_RE = re.compile(r"([\[\]\* ])")547 _GLOB_ESCAPE_RE = re.compile(r"([\[\]\*\?])") 548 548 549 549 def escapeForGlob(s):
