Trees | Indices | Help |
|
---|
|
1 """ 2 This is a no-frills document display handler for the 3 GNUmed medical document database. 4 5 It knows nothing about the documents itself. All it does 6 is to let the user select a page to display and tries to 7 hand it over to an appropriate viewer. 8 9 For that it relies on proper mime type handling at the OS level. 10 """ 11 # $Source: /cvsroot/gnumed/gnumed/gnumed/client/wxpython/gui/gmShowMedDocs.py,v $ 12 __version__ = "$Revision: 1.78 $" 13 __author__ = "Karsten Hilbert <Karsten.Hilbert@gmx.net>" 14 #================================================================ 15 import os.path, sys, logging 16 17 18 import wx 19 20 21 from Gnumed.wxpython import gmMedDocWidgets, gmPlugin, images_Archive_plugin 22 23 24 _log = logging.getLogger('gm.ui') 25 _log.info(__version__) 26 #================================================================28 """Plugin to encapsulate document tree.""" 29 30 tab_name = _("Documents") 31 34 #-------------------------------------------------------- 38 #--------------------------------------------------------59 #-------------------------------------------------------- 60 # def populate_toolbar (self, tb, widget): 61 # wxID_TB_BTN_show_page = wx.NewId() 62 # tool1 = tb.AddTool( 63 # wxID_TB_BTN_show_page, 64 # images_Archive_plugin.getreportsBitmap(), 65 # shortHelpString=_("show document"), 66 # isToggle=False 67 # ) 68 # wx.EVT_TOOL(tb, wxID_TB_BTN_show_page, self._widget._doc_tree.display_selected_part) 69 # tb.AddControl(wx.StaticBitmap( 70 # tb, 71 # -1, 72 # images_Archive_plugin.getvertical_separator_thinBitmap(), 73 # wx.DefaultPosition, 74 # wx.DefaultSize 75 # )) 76 #================================================================ 77 # MAIN 78 #---------------------------------------------------------------- 79 if __name__ == '__main__': 80 pass 81 #================================================================ 82 # $Log: gmShowMedDocs.py,v $ 83 # Revision 1.78 2010/02/07 15:19:43 ncq 84 # - rename to Documents review in menu 85 # 86 # Revision 1.77 2009/08/08 21:12:17 ncq 87 # - protect against missing keyword argument 88 # 89 # Revision 1.76 2009/06/29 15:13:25 ncq 90 # - improved placement in menu hierarchy 91 # - add active letters 92 # 93 # Revision 1.75 2008/07/10 08:37:44 ncq 94 # - no more toolbar 95 # 96 # Revision 1.74 2008/01/28 16:14:34 ncq 97 # - missing import 98 # 99 # Revision 1.73 2007/12/26 18:35:57 ncq 100 # - cleanup++, no more standalone 101 # 102 # Revision 1.72 2007/12/23 21:19:17 ncq 103 # - cleanup 104 # 105 # Revision 1.71 2007/06/10 10:16:05 ncq 106 # - properly display doc from toolbar tool 107 # 108 # Revision 1.70 2007/03/08 11:54:44 ncq 109 # - cleanup 110 # 111 # Revision 1.69 2006/11/07 00:35:28 ncq 112 # - cleanup 113 # 114 # Revision 1.68 2006/10/25 07:23:30 ncq 115 # - no gmPG no more 116 # 117 # Revision 1.67 2006/05/28 16:17:58 ncq 118 # - cleanup 119 # - populate now handled by plugin base class already 120 # 121 # Revision 1.66 2006/05/20 18:56:03 ncq 122 # - use receive_focus() interface 123 # 124 # Revision 1.65 2006/05/12 22:02:25 ncq 125 # - override _on_raise_by_signal() 126 # 127 # Revision 1.64 2006/05/07 15:39:18 ncq 128 # - move plugin tree panel to wxpython/gmMedDocWidgets.py where it belongs 129 # 130 # Revision 1.63 2005/10/30 22:09:03 shilbert 131 # - more wx2.6-ification 132 # 133 # Revision 1.62 2005/09/28 21:27:30 ncq 134 # - a lot of wx2.6-ification 135 # 136 # Revision 1.61 2005/09/26 18:01:52 ncq 137 # - use proper way to import wx26 vs wx2.4 138 # - note: THIS WILL BREAK RUNNING THE CLIENT IN SOME PLACES 139 # - time for fixup 140 # 141 # Revision 1.60 2005/09/24 09:17:29 ncq 142 # - some wx2.6 compatibility fixes 143 # 144 # Revision 1.59 2005/01/31 10:37:26 ncq 145 # - gmPatient.py -> gmPerson.py 146 # 147 # Revision 1.58 2004/10/17 15:53:55 ncq 148 # - cleanup 149 # 150 # Revision 1.57 2004/10/17 00:05:36 sjtan 151 # 152 # fixup for paint event re-entry when notification dialog occurs over medDocTree graphics 153 # area, and triggers another paint event, and another notification dialog , in a loop. 154 # Fixup is set flag to stop _repopulate_tree, and to only unset this flag when 155 # patient activating signal gmMedShowDocs to schedule_reget, which is overridden 156 # to include resetting of flag, before calling mixin schedule_reget. 157 # 158 # Revision 1.56 2004/10/14 12:15:21 ncq 159 # - cleanup 160 # 161 # Revision 1.55 2004/09/19 15:12:26 ncq 162 # - cleanup 163 # 164 # Revision 1.54 2004/09/13 21:12:36 ncq 165 # - convert to use cRegetMixin so it plays really nice with xdt connector 166 # 167 # Revision 1.53 2004/08/04 17:16:02 ncq 168 # - wx.NotebookPlugin -> cNotebookPlugin 169 # - derive cNotebookPluginOld from cNotebookPlugin 170 # - make cNotebookPluginOld warn on use and implement old 171 # explicit "main.notebook.raised_plugin"/ReceiveFocus behaviour 172 # - ReceiveFocus() -> receive_focus() 173 # 174 # Revision 1.52 2004/07/18 20:30:54 ncq 175 # - wxPython.true/false -> Python.True/False as Python tells us to do 176 # 177 # Revision 1.51 2004/07/15 20:42:18 ncq 178 # - support if-needed updates again 179 # 180 # Revision 1.50 2004/07/15 07:57:21 ihaywood 181 # This adds function-key bindings to select notebook tabs 182 # (Okay, it's a bit more than that, I've changed the interaction 183 # between gmGuiMain and gmPlugin to be event-based.) 184 # 185 # Oh, and SOAPTextCtrl allows Ctrl-Enter 186 # 187 # Revision 1.49 2004/06/29 22:58:43 ncq 188 # - add missing gmMedDocWidgets. qualifiers 189 # 190 # Revision 1.48 2004/06/26 23:39:34 ncq 191 # - factored out widgets for re-use 192 # 193 # Revision 1.47 2004/06/20 16:50:51 ncq 194 # - carefully fool epydoc 195 # 196 # Revision 1.46 2004/06/20 06:49:21 ihaywood 197 # changes required due to Epydoc's OCD 198 # 199 # Revision 1.45 2004/06/17 11:43:18 ihaywood 200 # Some minor bugfixes. 201 # My first experiments with wxGlade 202 # changed gmPhraseWheel so the match provider can be added after instantiation 203 # (as wxGlade can't do this itself) 204 # 205 # Revision 1.44 2004/06/13 22:31:49 ncq 206 # - gb['main.toolbar'] -> gb['main.top_panel'] 207 # - self.internal_name() -> self.__class__.__name__ 208 # - remove set_widget_reference() 209 # - cleanup 210 # - fix lazy load in _on_patient_selected() 211 # - fix lazy load in ReceiveFocus() 212 # - use self._widget in self.GetWidget() 213 # - override populate_with_data() 214 # - use gb['main.notebook.raised_plugin'] 215 # 216 # Revision 1.43 2004/06/01 07:55:46 ncq 217 # - use cDocumentFolder 218 # 219 # Revision 1.42 2004/04/16 00:36:23 ncq 220 # - cleanup, constraints 221 # 222 # Revision 1.41 2004/03/25 11:03:23 ncq 223 # - getActiveName -> get_names 224 # 225 # Revision 1.40 2004/03/20 19:48:07 ncq 226 # - adapt to flat id list from get_patient_ids 227 # 228 # Revision 1.39 2004/03/20 18:30:54 shilbert 229 # - runs standalone again 230 # 231 # Revision 1.38 2004/03/19 21:26:15 shilbert 232 # - more module import fixes 233 # 234 # Revision 1.37 2004/03/19 08:29:21 ncq 235 # - fix spurious whitespace 236 # 237 # Revision 1.36 2004/03/19 08:08:41 ncq 238 # - fix import of gmLoginInfo 239 # - remove dead code 240 # 241 # Revision 1.35 2004/03/07 22:19:26 ncq 242 # - proper import 243 # - re-fix gmTmpPatient -> gmPatient (fallout from "Syan's commit") 244 # 245 # Revision 1.34 2004/03/06 21:52:02 shilbert 246 # - adapted code to new API since __set/getitem is gone 247 # 248 # Revision 1.33 2004/02/25 09:46:23 ncq 249 # - import from pycommon now, not python-common 250 # 251 # Revision 1.32 2004/01/06 23:19:52 ncq 252 # - use whoami 253 # 254 # Revision 1.31 2003/11/17 10:56:40 sjtan 255 # 256 # synced and commiting. 257 # 258 # Revision 1.30 2003/11/16 11:53:32 shilbert 259 # - fixed stanalone mode 260 # - makes use of toolbar 261 # 262 # Revision 1.29 2003/10/26 01:36:14 ncq 263 # - gmTmpPatient -> gmPatient 264 # 265 # Revision 1.28 2003/08/27 12:31:41 ncq 266 # - some cleanup 267 # 268 # Revision 1.27 2003/08/24 12:50:20 shilbert 269 # - converted from __show_error() to gmGUIHelpers.gm_show_error() 270 # 271 # Revision 1.26 2003/06/29 15:21:22 ncq 272 # - add can_receive_focus() on patient not selected 273 # 274 # Revision 1.25 2003/06/26 21:41:51 ncq 275 # - fatal->verbose 276 # 277 # Revision 1.24 2003/06/19 15:31:37 ncq 278 # - cleanup, page change vetoing 279 # 280 # Revision 1.23 2003/04/28 12:11:30 ncq 281 # - refactor name() to not directly return _(<name>) 282 # 283 # Revision 1.22 2003/04/20 15:39:36 ncq 284 # - call_viewer was moved to gmMimeLib 285 # 286 # Revision 1.21 2003/04/19 15:01:33 ncq 287 # - we need import re both standalone and plugin 288 # 289 # Revision 1.20 2003/04/18 22:34:44 ncq 290 # - document context menu, mainly for descriptions, currently 291 # 292 # Revision 1.19 2003/04/18 17:45:05 ncq 293 # - add quit button 294 # 295 # Revision 1.18 2003/04/18 16:40:04 ncq 296 # - works again as standalone 297 # 298 # Revision 1.17 2003/04/04 20:49:22 ncq 299 # - make plugin work with gmCurrentPatient 300 # 301 # Revision 1.16 2003/04/01 12:31:53 ncq 302 # - we can't use constant reference self.patient if we don't register interest 303 # in gmSignals.patient_changed, hence, acquire patient when needed 304 # 305 # Revision 1.15 2003/03/25 19:57:09 ncq 306 # - add helper __show_error() 307 # 308 # Revision 1.14 2003/03/23 02:38:46 ncq 309 # - updated Hilmar's fix 310 # 311 # Revision 1.13 2003/03/02 17:03:19 ncq 312 # - make sure metadata is retrieved 313 # 314 # Revision 1.12 2003/03/02 11:13:01 hinnef 315 # preliminary fix for crash on ReceiveFocus() 316 # 317 # Revision 1.11 2003/02/25 23:30:31 ncq 318 # - need sys.exc_info() in LogException 319 # 320 # Revision 1.10 2003/02/24 23:14:53 ncq 321 # - adapt to get_patient_ids actually returning a flat list of IDs now 322 # 323 # Revision 1.9 2003/02/21 13:54:17 ncq 324 # - added even more likely and unlikely user warnings 325 # 326 # Revision 1.8 2003/02/20 01:25:18 ncq 327 # - read login data from config file again 328 # 329 # Revision 1.7 2003/02/19 15:19:43 ncq 330 # - remove extra print() 331 # 332 # Revision 1.6 2003/02/18 02:45:21 ncq 333 # - almost fixed standalone mode again 334 # 335 # Revision 1.5 2003/02/17 16:10:50 ncq 336 # - plugin mode seems to be fully working, actually calls viewers on files 337 # 338 # Revision 1.4 2003/02/15 14:21:49 ncq 339 # - on demand loading of Manual 340 # - further pluginization of showmeddocs 341 # 342 # Revision 1.3 2003/02/11 18:26:16 ncq 343 # - fix exp_base buglet in OnActivate 344 # 345 # Revision 1.2 2003/02/09 23:41:09 ncq 346 # - reget doc list on receiving focus thus being able to react to selection of a different patient 347 # 348 # Revision 1.1 2003/02/09 20:07:31 ncq 349 # - works as a plugin, patient hardcoded, though 350 # 351 # Revision 1.8 2003/01/26 17:00:18 ncq 352 # - support chunked object retrieval 353 # 354 # Revision 1.7 2003/01/25 00:21:42 ncq 355 # - show nr of bytes on object in metadata :-) 356 # 35740 return ('emr', _('&Documents review'))41 #-------------------------------------------------------- 47 #--------------------------------------------------------49 if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds): 50 return False 51 52 try: 53 if kwds['sort_mode'] == 'review': 54 self._widget._on_sort_by_review_selected(None) 55 except KeyError: 56 pass 57 58 return True
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Feb 9 04:01:57 2010 | http://epydoc.sourceforge.net |