|
|
|
@ -848,7 +848,21 @@ class MultipleChoiceDialog (QtGui.QWidget):
|
|
|
|
|
|
|
|
|
|
p_m_wgt = QtGui.QWidget(self)
|
|
|
|
|
p_m_layout = QtGui.QVBoxLayout(p_m_wgt)
|
|
|
|
|
# add '+' button
|
|
|
|
|
|
|
|
|
|
# add '++' button
|
|
|
|
|
self.plus_all_Button = QtGui.QPushButton(self)
|
|
|
|
|
plus_all_icons = ['go-last-view', 'go-last']
|
|
|
|
|
for icon in plus_all_icons:
|
|
|
|
|
icon_next = QtGui.QIcon.fromTheme(icon)
|
|
|
|
|
if not icon_next.isNull():
|
|
|
|
|
self.plus_all_Button.setIcon(icon_next)
|
|
|
|
|
break
|
|
|
|
|
if icon_next.isNull():
|
|
|
|
|
self.plus_all_Button.setText('->\n->')
|
|
|
|
|
self.plus_all_Button.clicked.connect(self.plus_all_items)
|
|
|
|
|
p_m_layout.addWidget(self.plus_all_Button)
|
|
|
|
|
|
|
|
|
|
# add '+' button
|
|
|
|
|
self.plus_Button = QtGui.QPushButton(self)
|
|
|
|
|
plus_icons = ['go-next-view','go-next']
|
|
|
|
|
for icon in plus_icons:
|
|
|
|
@ -876,6 +890,19 @@ class MultipleChoiceDialog (QtGui.QWidget):
|
|
|
|
|
|
|
|
|
|
self.layout.addWidget(p_m_wgt, 2, 2, 2, 1)
|
|
|
|
|
|
|
|
|
|
# add '--' button
|
|
|
|
|
self.minus_all_Button = QtGui.QPushButton(self)
|
|
|
|
|
minus_all_icons = ['go-first-view', 'go-first']
|
|
|
|
|
for icon in minus_all_icons:
|
|
|
|
|
icon_next = QtGui.QIcon.fromTheme(icon)
|
|
|
|
|
if not icon_next.isNull():
|
|
|
|
|
self.minus_all_Button.setIcon(icon_next)
|
|
|
|
|
break
|
|
|
|
|
if icon_next.isNull():
|
|
|
|
|
self.minus_all_Button.setText('<-\n<-')
|
|
|
|
|
self.minus_all_Button.clicked.connect(self.minus_all_items)
|
|
|
|
|
p_m_layout.addWidget(self.minus_all_Button)
|
|
|
|
|
|
|
|
|
|
#add right list
|
|
|
|
|
self.right_ListWidget = ListWidget(self)
|
|
|
|
|
self.right_ListWidget.itemDoubleClicked.connect(self.minus_item)
|
|
|
|
@ -919,6 +946,14 @@ class MultipleChoiceDialog (QtGui.QWidget):
|
|
|
|
|
self.add_LineEdit.setText('')
|
|
|
|
|
self.add_LineEdit.setFocus()
|
|
|
|
|
|
|
|
|
|
def plus_all_items(self):
|
|
|
|
|
# get item in left_ListWidget and set this item in right_ListWidget
|
|
|
|
|
while True:
|
|
|
|
|
temp_item = self.left_ListWidget.takeItem(0)
|
|
|
|
|
if not temp_item:
|
|
|
|
|
return
|
|
|
|
|
self.right_ListWidget.addItem(temp_item)
|
|
|
|
|
|
|
|
|
|
def plus_item(self):
|
|
|
|
|
# get item in left_ListWidget and set this item in right_ListWidget
|
|
|
|
|
temp_item = self.left_ListWidget.takeItem \
|
|
|
|
@ -931,6 +966,14 @@ class MultipleChoiceDialog (QtGui.QWidget):
|
|
|
|
|
(self.right_ListWidget.currentRow())
|
|
|
|
|
self.left_ListWidget.addItem(temp_item)
|
|
|
|
|
|
|
|
|
|
def minus_all_items(self):
|
|
|
|
|
# get item in left_ListWidget and set this item in right_ListWidget
|
|
|
|
|
while True:
|
|
|
|
|
temp_item = self.right_ListWidget.takeItem(0)
|
|
|
|
|
if not temp_item:
|
|
|
|
|
return
|
|
|
|
|
self.left_ListWidget.addItem(temp_item)
|
|
|
|
|
|
|
|
|
|
def ok_pressed(self):
|
|
|
|
|
# save all lists and close this widget
|
|
|
|
|
self._parent.Selected = []
|
|
|
|
@ -962,7 +1005,7 @@ class MultipleButton(QtGui.QPushButton):
|
|
|
|
|
def __init__(self, text, parent):
|
|
|
|
|
QtGui.QPushButton.__init__(self, text, parent)
|
|
|
|
|
self.setStyleSheet ("text-align: left;")
|
|
|
|
|
self.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
self.setContentsMargins(3, 3, 3, 3)
|
|
|
|
|
|
|
|
|
|
def mousePressEvent(self, button = None):
|
|
|
|
|
self.parent().mousePressEvent()
|
|
|
|
|