class DesignerWindow(QMainWindow): def __init__(self): super(DesignerWindow, self).__init__() # Set up the user interface from Designer. self.ui = Ui_DesignerWindow() self.ui.setupUi(self) # Load the content from the file -- relative paths don't seem to work in Qt f = open(globals.application_path + 'LEDgoesDrawingTool.html', 'r') html = f.read() self.ui.webView.setHtml(html) #self.setWindowIcon(QIcon('LEDgoes-Icon.ico')) # Set listeners self.ui.actionAbout_LEDgoes_PC_Interface.toggled.connect(self.showAbout) # Set up a monitor so things running in other threads can write to the Designer too self.ui.webView.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) self.ui.webView.linkClicked.connect(self.reactToLinkClicked) def reactToLinkClicked(self, link): print "Link clicked: ", link # Get rid of the extra class identifier stuff that __str__() puts on link = link.__str__()[20:-2] if not "action://done_creating_layout/" in link: console.cwrite("Invalid link returned from the Designer.") return # Get rid of the main part of the URI link = link[30:] # Convert the returned data into a deque of tuples globals.boards = deque([tuple([int(s) for s in x.split(",")]) for x in link.split(";")]) def showAbout(self, event): print "LEDgoes Designer v1.0\nCopyleft 2013-14 OpenBrite, LLC\n\nSee our GitHub repository at https://github.com/ledgoes/"
def __init__(self): super(DesignerWindow, self).__init__() # Set up the user interface from Designer. self.ui = Ui_DesignerWindow() self.ui.setupUi(self) # Load the content from the file -- relative paths don't seem to work in Qt f = open(globals.application_path + 'LEDgoesDrawingTool.html', 'r') html = f.read() self.ui.webView.setHtml(html) #self.setWindowIcon(QIcon('LEDgoes-Icon.ico')) # Set listeners self.ui.actionAbout_LEDgoes_PC_Interface.toggled.connect( self.showAbout) # Set up a monitor so things running in other threads can write to the Designer too self.ui.webView.page().setLinkDelegationPolicy( QWebPage.DelegateAllLinks) self.ui.webView.linkClicked.connect(self.reactToLinkClicked)
class DesignerWindow(QMainWindow): def __init__(self): super(DesignerWindow, self).__init__() # Set up the user interface from Designer. self.ui = Ui_DesignerWindow() self.ui.setupUi(self) # Load the content from the file -- relative paths don't seem to work in Qt f = open(globals.application_path + 'LEDgoesDrawingTool.html', 'r') html = f.read() self.ui.webView.setHtml(html) #self.setWindowIcon(QIcon('LEDgoes-Icon.ico')) # Set listeners self.ui.actionAbout_LEDgoes_PC_Interface.toggled.connect( self.showAbout) # Set up a monitor so things running in other threads can write to the Designer too self.ui.webView.page().setLinkDelegationPolicy( QWebPage.DelegateAllLinks) self.ui.webView.linkClicked.connect(self.reactToLinkClicked) def reactToLinkClicked(self, link): print "Link clicked: ", link # Get rid of the extra class identifier stuff that __str__() puts on link = link.__str__()[20:-2] if not "action://done_creating_layout/" in link: console.cwrite("Invalid link returned from the Designer.") return # Get rid of the main part of the URI link = link[30:] # Convert the returned data into a deque of tuples globals.boards = deque( [tuple([int(s) for s in x.split(",")]) for x in link.split(";")]) def showAbout(self, event): print "LEDgoes Designer v1.0\nCopyleft 2013-14 OpenBrite, LLC\n\nSee our GitHub repository at https://github.com/ledgoes/"
def __init__(self): super(DesignerWindow, self).__init__() # Set up the user interface from Designer. self.ui = Ui_DesignerWindow() self.ui.setupUi(self) # Load the content from the file -- relative paths don't seem to work in Qt f = open(globals.application_path + 'LEDgoesDrawingTool.html', 'r') html = f.read() self.ui.webView.setHtml(html) #self.setWindowIcon(QIcon('LEDgoes-Icon.ico')) # Set listeners self.ui.actionAbout_LEDgoes_PC_Interface.toggled.connect(self.showAbout) # Set up a monitor so things running in other threads can write to the Designer too self.ui.webView.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) self.ui.webView.linkClicked.connect(self.reactToLinkClicked)