Skip to content

Commit

Permalink
When a tab is added, automatically switch to it
Browse files Browse the repository at this point in the history
  • Loading branch information
jaj42 committed Apr 19, 2019
1 parent 4d5db7f commit e80a925
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions graphysio/mainui.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def wrapped():
return wrapped

def addTab(self, *args,**kwargs):
return self.tabWidget.addTab(*args,**kwargs)
tabindex = self.tabWidget.addTab(*args,**kwargs)
self.tabWidget.setCurrentIndex(tabindex)

def closeTab(self, i):
w = self.tabWidget.widget(i)
Expand Down Expand Up @@ -113,6 +114,5 @@ def appendToPlotWithData(self, plotdata, destidx=None):

def createNewPlotWithData(self, plotdata):
plotwidget = TSWidget(plotdata=plotdata, parent=self)
tabindex = self.tabWidget.addTab(plotwidget, plotdata.name)
self.tabWidget.setCurrentIndex(tabindex)
self.addTab(plotwidget, plotdata.name)
self.statusBar.showMessage("Loading... done")

0 comments on commit e80a925

Please sign in to comment.