From ae28b8538b9bb2648fa750cfa1d094a05fc63f55 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Tue, 23 Jun 2009 20:49:18 +0000 Subject: [PATCH] Fixed Utils.open_file_with_default_application() to gui.utils instead of Utils now. Works again. svn: r12699 --- src/DataViews/MediaView.py | 4 ++-- src/DisplayTabs/_GalleryTab.py | 3 ++- src/Editors/_EditMedia.py | 3 ++- src/Editors/_EditMediaRef.py | 3 ++- src/Editors/_EditPerson.py | 4 ++-- src/ReportBase/_GraphvizReportDialog.py | 20 ++++++++++---------- src/plugins/docgen/AsciiDoc.py | 3 ++- src/plugins/docgen/HtmlDoc.py | 3 ++- src/plugins/docgen/LaTeXDoc.py | 4 ++-- src/plugins/docgen/ODFDoc.py | 3 ++- src/plugins/docgen/PSDrawDoc.py | 3 ++- src/plugins/docgen/PdfDoc.py | 3 ++- src/plugins/docgen/RTFDoc.py | 3 ++- 13 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/DataViews/MediaView.py b/src/DataViews/MediaView.py index 4331be1f0..a446e6f2b 100644 --- a/src/DataViews/MediaView.py +++ b/src/DataViews/MediaView.py @@ -46,7 +46,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import PageView +from gui.utils import open_file_with_default_applicationimport PageView import DisplayModels import ThumbNails import const @@ -226,7 +226,7 @@ class MediaView(PageView.ListView): for handle in self.selected_handles(): ref_obj = self.dbstate.db.get_object_from_handle(handle) mpath = Utils.media_path_full(self.dbstate.db, ref_obj.get_path()) - Utils.open_file_with_default_application(mpath) + open_file_with_default_application(mpath) def _column_editor(self, obj): """ diff --git a/src/DisplayTabs/_GalleryTab.py b/src/DisplayTabs/_GalleryTab.py index 874f93bfe..eca213d99 100644 --- a/src/DisplayTabs/_GalleryTab.py +++ b/src/DisplayTabs/_GalleryTab.py @@ -45,6 +45,7 @@ import gobject # GRAMPS classes # #------------------------------------------------------------------------- +from gui.utils import open_file_with_default_application import gen.lib import Utils import ThumbNails @@ -59,7 +60,7 @@ from DisplayTabs._ButtonTab import ButtonTab # #------------------------------------------------------------------------- def make_launcher(path): - return lambda x: Utils.open_file_with_default_application(path) + return lambda x: open_file_with_default_application(path) #------------------------------------------------------------------------- # diff --git a/src/Editors/_EditMedia.py b/src/Editors/_EditMedia.py index cf82387a1..69a9c1f53 100644 --- a/src/Editors/_EditMedia.py +++ b/src/Editors/_EditMedia.py @@ -40,6 +40,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- +from gui.utils import open_file_with_default_application import const import Config import gen.lib @@ -219,7 +220,7 @@ class EditMedia(EditPrimary): if ref_obj: media_path = Utils.media_path_full(self.dbstate.db, ref_obj.get_path()) - Utils.open_file_with_default_application(media_path) + open_file_with_default_application(media_path) def select_file(self, val): self.determine_mime() diff --git a/src/Editors/_EditMediaRef.py b/src/Editors/_EditMediaRef.py index d9b7de0d6..83ce84aa6 100644 --- a/src/Editors/_EditMediaRef.py +++ b/src/Editors/_EditMediaRef.py @@ -41,6 +41,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- +from gui.utils import open_file_with_default_application import const import Config import Mime @@ -370,7 +371,7 @@ class EditMediaRef(EditReference): def button_press_event(self, obj, event): if event.button==1 and event.type == gtk.gdk._2BUTTON_PRESS: photo_path = Utils.media_path_full(self.db, self.source.get_path()) - Utils.open_file_with_default_application(photo_path) + open_file_with_default_application(photo_path) def button_press_event_ref(self, widget, event): """ diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index d861c32c8..c964b28e4 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -48,7 +48,7 @@ import gtk #------------------------------------------------------------------------- import const import Utils -from gui.utils import add_menuitem +from gui.utils import add_menuitem, open_file_with_default_application import Mime import gen.lib import widgets @@ -512,7 +512,7 @@ class EditPerson(EditPrimary): object_handle = photo.get_reference_handle() ref_obj = self.db.get_object_from_handle(object_handle) photo_path = Utils.media_path_full(self.db, ref_obj.get_path()) - Utils.open_file_with_default_application(photo_path) + open_file_with_default_application(photo_path) def _popup_change_description(self, obj): """ diff --git a/src/ReportBase/_GraphvizReportDialog.py b/src/ReportBase/_GraphvizReportDialog.py index be62886c4..0ba24fc78 100644 --- a/src/ReportBase/_GraphvizReportDialog.py +++ b/src/ReportBase/_GraphvizReportDialog.py @@ -48,7 +48,7 @@ import gobject # #------------------------------------------------------------------------------- import Utils -from gui.utils import ProgressMeter +from gui.utils import ProgressMeter, open_file_with_default_application from gen.plug.docgen import BaseDoc, GVDoc import Config from ReportBase import CATEGORY_GRAPHVIZ @@ -380,7 +380,7 @@ class GVDotDoc(GVDocBase): dotfile.close() if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -441,7 +441,7 @@ class GVPsDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -487,7 +487,7 @@ class GVSvgDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -533,7 +533,7 @@ class GVSvgzDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -579,7 +579,7 @@ class GVPngDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -625,7 +625,7 @@ class GVJpegDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -671,7 +671,7 @@ class GVGifDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -720,7 +720,7 @@ class GVPdfGvDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # @@ -782,7 +782,7 @@ class GVPdfGsDoc(GVDocBase): os.remove(tmp_dot) if self.open_req: - Utils.open_file_with_default_application(self._filename) + open_file_with_default_application(self._filename) #------------------------------------------------------------------------------- # diff --git a/src/plugins/docgen/AsciiDoc.py b/src/plugins/docgen/AsciiDoc.py index 5715ba53f..b9fba0bec 100644 --- a/src/plugins/docgen/AsciiDoc.py +++ b/src/plugins/docgen/AsciiDoc.py @@ -34,6 +34,7 @@ from gettext import gettext as _ # Gramps modules # #------------------------------------------------------------------------ +from gui.utils import open_file_with_default_application from gen.plug.docgen import BaseDoc, TextDoc,\ PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER from gen.plug import PluginManager, DocGenPlugin @@ -154,7 +155,7 @@ class AsciiDoc(BaseDoc,TextDoc): self.f.close() if self.open_req: - Utils.open_file_with_default_application(self.filename) + open_file_with_default_application(self.filename) def get_usable_width(self): return _WIDTH_IN_CHARS diff --git a/src/plugins/docgen/HtmlDoc.py b/src/plugins/docgen/HtmlDoc.py index 5bddecaa1..dc391f6ae 100644 --- a/src/plugins/docgen/HtmlDoc.py +++ b/src/plugins/docgen/HtmlDoc.py @@ -42,6 +42,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------ +from gui.utils import open_file_with_default_application from gen.plug import PluginManager, DocGenPlugin import ImgManip import const @@ -240,7 +241,7 @@ class HtmlDoc(BaseDoc, TextDoc): if self.open_req: import Utils - Utils.open_file_with_default_application(self._backend.getf()) + open_file_with_default_application(self._backend.getf()) def copy_file(self, from_fname, to_fname, to_dir=''): """ diff --git a/src/plugins/docgen/LaTeXDoc.py b/src/plugins/docgen/LaTeXDoc.py index df266c5f4..85614bf5a 100644 --- a/src/plugins/docgen/LaTeXDoc.py +++ b/src/plugins/docgen/LaTeXDoc.py @@ -39,7 +39,7 @@ from gettext import gettext as _ # gramps modules # #------------------------------------------------------------------------ - +from gui.utils import open_file_with_default_application from gen.plug import PluginManager, DocGenPlugin from gen.plug.docgen import BaseDoc, TextDoc, PAPER_LANDSCAPE, FONT_SANS_SERIF from gen.plug.docbackend import DocBackend @@ -417,7 +417,7 @@ class LaTeXDoc(BaseDoc, TextDoc): self._backend.write('\n\\end{document}\n') self._backend.close() if self.open_req: - Utils.open_file_with_default_application(self._backend.filename) + open_file_with_default_application(self._backend.filename) def end_page(self): """Issue a new page command""" diff --git a/src/plugins/docgen/ODFDoc.py b/src/plugins/docgen/ODFDoc.py index dd03b9220..1115b0169 100644 --- a/src/plugins/docgen/ODFDoc.py +++ b/src/plugins/docgen/ODFDoc.py @@ -44,6 +44,7 @@ from xml.sax.saxutils import escape # Gramps modules # #------------------------------------------------------------------------- +from gui.utils import open_file_with_default_application from gen.plug import PluginManager, DocGenPlugin from gen.plug.docgen import (BaseDoc, TextDoc, DrawDoc, FONT_SANS_SERIF, DASHED, PAPER_PORTRAIT, @@ -435,7 +436,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): self._write_mimetype_file() self._write_zip() if self.open_req: - Utils.open_file_with_default_application(self.filename) + open_file_with_default_application(self.filename) def add_media_object(self, file_name, pos, x_cm, y_cm, alt=''): diff --git a/src/plugins/docgen/PSDrawDoc.py b/src/plugins/docgen/PSDrawDoc.py index 36ab78293..ac9fc4698 100644 --- a/src/plugins/docgen/PSDrawDoc.py +++ b/src/plugins/docgen/PSDrawDoc.py @@ -31,6 +31,7 @@ from gettext import gettext as _ #------------------------------------------------------------------------- #Gramps modules #------------------------------------------------------------------------- +from gui.utils import open_file_with_default_application from ReportBase import ReportUtils from gen.plug import PluginManager, DocGenPlugin from gen.plug.docgen import BaseDoc, DrawDoc, FONT_SERIF, PAPER_PORTRAIT, SOLID @@ -135,7 +136,7 @@ class PSDrawDoc(BaseDoc,DrawDoc): self.f.write('%%EOF\n') self.f.close() if self.open_req: - Utils.open_file_with_default_application(self.filename) + open_file_with_default_application(self.filename) def write_text(self,text,mark=None): pass diff --git a/src/plugins/docgen/PdfDoc.py b/src/plugins/docgen/PdfDoc.py index bf9547cb2..09fe12754 100644 --- a/src/plugins/docgen/PdfDoc.py +++ b/src/plugins/docgen/PdfDoc.py @@ -36,6 +36,7 @@ from gettext import gettext as _ # Gramps modules # #------------------------------------------------------------------------ +from gui.utils import open_file_with_default_application import libcairodoc from gen.plug import PluginManager, DocGenPlugin import Utils @@ -125,7 +126,7 @@ class PdfDoc(libcairodoc.CairoDoc): # load the result into an external viewer if self.open_req: - Utils.open_file_with_default_application(self._backend.filename) + open_file_with_default_application(self._backend.filename) #------------------------------------------------------------------------ # diff --git a/src/plugins/docgen/RTFDoc.py b/src/plugins/docgen/RTFDoc.py index 09d09f1ac..fc857ceb4 100644 --- a/src/plugins/docgen/RTFDoc.py +++ b/src/plugins/docgen/RTFDoc.py @@ -34,6 +34,7 @@ from gettext import gettext as _ # Load the base BaseDoc class # #------------------------------------------------------------------------ +from gui.utils import open_file_with_default_application from gen.plug.docgen import (BaseDoc, TextDoc, FONT_SERIF, PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER, PARA_ALIGN_JUSTIFY) from gen.plug import PluginManager, DocGenPlugin @@ -129,7 +130,7 @@ class RTFDoc(BaseDoc,TextDoc): self.f.close() if self.open_req: - Utils.open_file_with_default_application(self.filename) + open_file_with_default_application(self.filename) #-------------------------------------------------------------------- #