Skip to content

Commit

Permalink
Added value() functions to transcription search
Browse files Browse the repository at this point in the history
  • Loading branch information
YuHsiangLo committed Oct 1, 2019
1 parent bbc7ed0 commit bd3c2b5
Show file tree
Hide file tree
Showing 5 changed files with 483 additions and 45 deletions.
31 changes: 31 additions & 0 deletions slpa/gui/helperwidgets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from imports import QGroupBox, QVBoxLayout, QHBoxLayout, QButtonGroup, QRadioButton

class LogicRadioButtonGroup(QGroupBox):
def __init__(self, direction, default, title='', **kwarg):
super().__init__(title)

if direction == 'vertical':
buttonLayout = QVBoxLayout()
else: # direction == 'horizontal'
buttonLayout = QHBoxLayout()

self.buttonGroup = QButtonGroup()
self.setLayout(buttonLayout)

for short_name, text in kwarg.items():
button = QRadioButton(text)
if short_name == default:
button.setChecked(True)
self.buttonGroup.addButton(button)
buttonLayout.addWidget(button)

def setToDefault(self, default_option):
for option in self.buttonGroup.buttons():
if option.text() == default_option:
option.setChecked(True)
else:
option.setChecked(False)

def value(self):
checked = self.buttonGroup.checkedButton()
return checked.text()
6 changes: 0 additions & 6 deletions slpa/gui/phonological_search.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,6 @@ def __init__(self, corpus, parent, settings, recent):

mainLayout.addWidget(self.searchTab, 0, 0)

#####This part should be removed later#####
#self.testButton = QPushButton('test')
#mainLayout.addWidget(self.testButton, 1, 0)
#self.testButton.clicked.connect(self.test)
#####This part should be removed later#####

self.layout().insertLayout(0, mainLayout)

#def test(self):
Expand Down
Loading

0 comments on commit bd3c2b5

Please sign in to comment.