merged with dev

This commit is contained in:
Luke Campagnola 2012-05-14 22:08:19 -04:00
commit d0e5caac48
3 changed files with 9 additions and 4 deletions

View File

@ -51,7 +51,7 @@ def readConfigFile(fname):
try: try:
#os.chdir(newDir) ## bad. #os.chdir(newDir) ## bad.
fd = open(fname) fd = open(fname)
s = asUnicode(fd.read(), 'UTF-8') s = asUnicode(fd.read())
fd.close() fd.close()
s = s.replace("\r\n", "\n") s = s.replace("\r\n", "\n")
s = s.replace("\r", "\n") s = s.replace("\r", "\n")

View File

@ -64,6 +64,12 @@ class Dock(QtGui.QWidget, DockDrop):
self.setStretch(*size) self.setStretch(*size)
def implements(self, name=None):
if name is None:
return ['dock']
else:
return name == 'dock'
def setStretch(self, x=None, y=None): def setStretch(self, x=None, y=None):
#print "setStretch", self, x, y #print "setStretch", self, x, y
#self._stretch = (x, y) #self._stretch = (x, y)

View File

@ -20,7 +20,8 @@ class DockDrop(object):
self.overlay.raise_() self.overlay.raise_()
def dragEnterEvent(self, ev): def dragEnterEvent(self, ev):
if isinstance(ev.source(), Dock.Dock): src = ev.source()
if hasattr(src, 'implements') and src.implements('dock'):
#print "drag enter accept" #print "drag enter accept"
ev.accept() ev.accept()
else: else:
@ -125,5 +126,3 @@ class DropAreaOverlay(QtGui.QWidget):
p.setBrush(QtGui.QBrush(QtGui.QColor(100, 100, 255, 50))) p.setBrush(QtGui.QBrush(QtGui.QColor(100, 100, 255, 50)))
p.setPen(QtGui.QPen(QtGui.QColor(50, 50, 150), 3)) p.setPen(QtGui.QPen(QtGui.QColor(50, 50, 150), 3))
p.drawRect(rgn) p.drawRect(rgn)
from . import Dock