Remove all the pyqtSlot decorators

This commit is contained in:
Florian Bruhin 2014-01-19 18:45:14 +01:00
parent bba3696630
commit 3fa18c5599

View File

@ -14,7 +14,6 @@ class TabbedBrowser(TabWidget):
self.currentChanged.connect(self.index_changed)
self.tabopen("http://ddg.gg/")
@pyqtSlot(str)
def tabopen(self, url):
tab = BrowserTab(self)
tab.openurl(url)
@ -25,17 +24,14 @@ class TabbedBrowser(TabWidget):
tab.loadFinished.connect(self.load_finished)
tab.titleChanged.connect(self.update_title)
@pyqtSlot(str)
def openurl(self, url):
tab = self.currentWidget()
tab.openurl(url)
@pyqtSlot()
def undo_close(self):
if self.url_stack:
self.tabopen(self.url_stack.pop())
@pyqtSlot()
def close_act(self):
if self.count() > 1:
idx = self.currentIndex()
@ -48,65 +44,49 @@ class TabbedBrowser(TabWidget):
# FIXME
pass
@pyqtSlot()
def reload_act(self):
self.currentWidget().reload()
@pyqtSlot()
def stop_act(self):
self.currentWidget().stop()
@pyqtSlot()
def print_act(self):
# FIXME that does not what I expect
preview = QPrintPreviewDialog()
preview.paintRequested.connect(self.currentWidget().print)
preview.exec_()
@pyqtSlot()
def back_act(self):
# FIXME display warning if beginning of history
self.currentWidget().back()
@pyqtSlot()
def forward_act(self):
# FIXME display warning if end of history
self.currentWidget().forward()
@pyqtSlot()
@pyqtSlot(int)
def scroll_down_act(self, count=50):
self.currentWidget().page().mainFrame().scroll(0, count)
@pyqtSlot()
@pyqtSlot(int)
def scroll_up_act(self, count=50):
self.currentWidget().page().mainFrame().scroll(0, -count)
@pyqtSlot()
@pyqtSlot(int)
def scroll_left_act(self, count=50):
self.currentWidget().page().mainFrame().scroll(-count, 0)
@pyqtSlot()
@pyqtSlot(int)
def scroll_right_act(self, count=50):
self.currentWidget().page().mainFrame().scroll(count, 0)
@pyqtSlot()
def scroll_start_act(self):
frame = self.currentWidget().page().mainFrame()
cur_pos = frame.scrollPosition()
frame.setScrollPosition(QPoint(cur_pos.x(), 0))
@pyqtSlot()
def scroll_end_act(self):
frame = self.currentWidget().page().mainFrame()
cur_pos = frame.scrollPosition()
size = frame.contentsSize()
frame.setScrollPosition(QPoint(cur_pos.x(), size.height()))
@pyqtSlot()
def switch_prev(self):
idx = self.currentIndex()
if idx > 0:
@ -115,7 +95,6 @@ class TabbedBrowser(TabWidget):
# FIXME
pass
@pyqtSlot()
def switch_next(self):
idx = self.currentIndex()
if idx < self.count() - 1:
@ -124,15 +103,12 @@ class TabbedBrowser(TabWidget):
# FIXME
pass
@pyqtSlot(int)
def progress_changed(self, prog):
self.filter_signals(self.cur_progress, prog)
@pyqtSlot(bool)
def load_finished(self, ok):
self.filter_signals(self.cur_load_finished, ok)
@pyqtSlot(str)
def update_title(self, text):
if text:
self.setTabText(self.indexOf(self.sender()), text)
@ -146,7 +122,6 @@ class TabbedBrowser(TabWidget):
else:
logging.debug('{} - ignoring'.format(dbgstr))
@pyqtSlot(int)
def index_changed(self, idx):
tab = self.widget(idx)
self.cur_progress.emit(tab.progress)