7 from PySide import QtCore, QtGui
8 from Ui_Qt import Ui_MainWindow
9 from wlSearch import Search
13 class WienerLinienQt(QtGui.QMainWindow, Ui_MainWindow):
14 types = ('stop', 'address', 'poi')
17 QtGui.QMainWindow.__init__(self)
20 self.connect(self.btnSearch, QtCore.SIGNAL("clicked()"), self.search)
23 origin = self.editOrigin.currentText()
24 destination = self.editDestination.currentText()
25 if not origin and destination:
26 self.btnSearch.setText("Search - Missing input")
28 s = Search(origin, destination, \
29 origin_type=self.types[self.comboOrigin.currentIndex()], \
30 destination_type=self.types[self.comboDestination.currentIndex()])
33 except webbrowser.Error:
34 self.btnSearch.setText("Error starting webbrowser")
36 self.btnSearch.setText("Search - Opening webbrowser")
39 if __name__ == "__main__":
40 app = QtGui.QApplication(sys.argv)