Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ncssar/radiolog
Browse files Browse the repository at this point in the history
  • Loading branch information
caver456 committed Dec 22, 2023
2 parents 4a236e0 + f7ec5d3 commit a3d1c35
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions radiolog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5132,7 +5132,7 @@ def addTab(self,extTeamName):
self.showTeamTabsMoreButtonIfNeeded()
niceTeamName=getNiceTeamName(extTeamName)
shortNiceTeamName=getShortNiceTeamName(niceTeamName)
# rprint("new team: extTeamName="+extTeamName+" niceTeamName="+niceTeamName+" shortNiceTeamName="+shortNiceTeamName)
# rprint("addTab: extTeamName="+extTeamName+" niceTeamName="+niceTeamName+" shortNiceTeamName="+shortNiceTeamName)
i=self.extTeamNameList.index(extTeamName) # i is zero-based
self.ui.tabList.insert(i,QWidget())
self.ui.tabList[i].setStyleSheet('font-size:'+str(self.menuFontSize)+'pt')
Expand All @@ -5152,9 +5152,10 @@ def addTab(self,extTeamName):
self.ui.tableViewList[i].setPalette(self.teamTablePalette)
# self.ui.tableViewList[i].horizontalHeader().setMinimumSectionSize(10) # allow tiny column for operator initials
# self.ui.tabGridLayoutList[i].addWidget(self.ui.tableViewList[i],0,0,1,1)
notes=QLabel('No notes for this callsign')
self.ui.tabGridLayoutList[i].addWidget(notes,0,0,1,1)
self.ui.tabGridLayoutList[i].addWidget(self.ui.tableViewList[i],1,0,1,1)
if 'spacer' not in extTeamName.lower(): #717 - widgets for spacer tabs should be blank
notes=QLabel('No notes for this callsign')
self.ui.tabGridLayoutList[i].addWidget(notes,0,0,1,1)
self.ui.tabGridLayoutList[i].addWidget(self.ui.tableViewList[i],1,0,1,1)
self.ui.tabWidget.insertTab(i,self.ui.tabList[i],'')
label=QLabel(" "+shortNiceTeamName+" ")
if len(shortNiceTeamName)<2:
Expand Down Expand Up @@ -5870,8 +5871,19 @@ def deleteTeamTab(self,teamName,ext=False):
for n in range(len(self.extTeamNameList)-1):
if self.extTeamNameList[n].lower().startswith("spacer"):
if self.extTeamNameList[n+1].lower().startswith("spacer"):
rprint(" found back-to-back spacers at indices "+str(n)+" and "+str(n+1))
self.deleteTeamTab(self.extTeamNameList[n+1],True)
if len(self.extTeamNameList)>2: # but not if there are no visible tabs
rprint(" found back-to-back spacers at indices "+str(n)+" and "+str(n+1))
self.deleteTeamTab(self.extTeamNameList[n+1],True)
#717 if all tabs are hidden, keep the same look as at startup
if len(self.extTeamNameList)==2:
rprint('all teams hidden; clearing tabWidget')
self.ui.tabWidget.clear()
#717 if rightmost tab was hidden, select the new rightmost visible tab if one exists
i=self.ui.tabWidget.currentIndex()
count=self.ui.tabWidget.count()
if i==count-1 and count>2:
rprint('last tab was hidden; backselecting')
self.ui.tabWidget.setCurrentIndex(i-1)
#715 - redraw sidebar now, regardless of visibility
# if self.sidebarIsVisible: #.isVisible would always return True - it's slid left when 'hidden'
# self.sidebar.resizeEvent()
Expand Down

0 comments on commit a3d1c35

Please sign in to comment.