Example #1
0
class TDLBrowser(browsers.GriddedPlugin):
    _icon = pixmaps.text_tdl
    viewer_name = "TDL Browser"

    def __init__(self, gw, dataitem, cellspec={}, default_open=None, **opts):
        browsers.GriddedPlugin.__init__(self, gw, dataitem, cellspec=cellspec)
        self._wedit = TDLEditor(self.wparent())
        self.set_widgets(self.wtop(), dataitem.caption, icon=self.icon())
        if dataitem.data is not None:
            self.set_data(dataitem)
        QObject.connect(self.wtop(), PYSIGNAL("fontChanged()"),
                        self.wtop().adjust_editor_font)

    def wtop(self):
        return self._wedit

    def editor(self):
        return self._wedit

    def set_data(self, dataitem, default_open=None, **opts):
        _dprint(3, 'set_data ', dataitem.udi)
        pathname = getattr(dataitem, 'tdl_pathname', None)
        self._wedit.load_file(pathname, text=dataitem.data)

    def highlight(self, color=True):
        browsers.GriddedPlugin.highlight(self, color)
        self._wedit.has_focus(bool(color))
Example #2
0
class TDLBrowser(browsers.GriddedPlugin):
  _icon = pixmaps.text_tdl;
  viewer_name = "TDL Browser";

  def __init__(self,gw,dataitem,cellspec={},default_open=None,**opts):
    browsers.GriddedPlugin.__init__(self,gw,dataitem,cellspec=cellspec);
    self._wedit = TDLEditor(self.wparent());
    self.set_widgets(self.wtop(),dataitem.caption,icon=self.icon());
    if dataitem.data is not None:
      self.set_data(dataitem);
    QObject.connect(self.wtop(),PYSIGNAL("fontChanged()"),self.wtop().adjust_editor_font);

  def wtop (self):
    return self._wedit;
  def editor (self):
    return self._wedit;

  def set_data (self,dataitem,default_open=None,**opts):
    _dprint(3,'set_data ',dataitem.udi);
    pathname = getattr(dataitem,'tdl_pathname',None);
    self._wedit.load_file(pathname,text=dataitem.data);

  def highlight (self,color=True):
    browsers.GriddedPlugin.highlight(self,color);
    self._wedit.has_focus(bool(color));
Example #3
0
 def __init__(self, gw, dataitem, cellspec={}, default_open=None, **opts):
     browsers.GriddedPlugin.__init__(self, gw, dataitem, cellspec=cellspec)
     self._wedit = TDLEditor(self.wparent())
     self.set_widgets(self.wtop(), dataitem.caption, icon=self.icon())
     if dataitem.data is not None:
         self.set_data(dataitem)
     QObject.connect(self.wtop(), PYSIGNAL("fontChanged()"),
                     self.wtop().adjust_editor_font)
Example #4
0
 def __init__(self,gw,dataitem,cellspec={},default_open=None,**opts):
   browsers.GriddedPlugin.__init__(self,gw,dataitem,cellspec=cellspec);
   self._wedit = TDLEditor(self.wparent());
   self.set_widgets(self.wtop(),dataitem.caption,icon=self.icon());
   if dataitem.data is not None:
     self.set_data(dataitem);
   QObject.connect(self.wtop(),PYSIGNAL("fontChanged()"),self.wtop().adjust_editor_font);