Exemple #1
0
    def setupUi(self):
        """ Метод настройки вида диалога. """
        UiDlgTemplate.setupUi(self)

        # границы действия элементов диалога
        rangeBegin = (QTime(8, 0), QTime(23, 30))
        rangeEnd = (QTime(8, 29), QTime(23, 59))
        # назначение границ действия для элементов диалога
        self.set_timeedit(self.editBegin, self.sliderBegin, rangeBegin)
        self.set_timeedit(self.editEnd, self.sliderEnd, rangeEnd)
        self.set_slider(self.sliderBegin, self.editBegin, rangeBegin, 'begin')
        self.set_slider(self.sliderEnd, self.editEnd, rangeEnd, 'end')

        # время начала должно быть меньше времени завершения
        def tune_end_widget(t):
            new_time = datetime.combine(datetime.today(), t.toPyTime()) + timedelta(minutes=29)
            self.editEnd.setMinimumTime(QTime(new_time.time()))
        self.editBegin.timeChanged.connect(tune_end_widget)

        # заполнение выпадашек
        self.fill_combo_days()
        self.fill_combo_rooms()

        # подключение обработчиков событий
        self.connect(self.buttonOK, SIGNAL('clicked()'), self.apply_dialog)
        self.connect(self.buttonCancel,  SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #2
0
    def setupUi(self):
        """ Метод настройки вида диалога. """
        UiDlgTemplate.setupUi(self)

        # границы действия элементов диалога
        rangeBegin = (QTime(8, 0), QTime(23, 30))
        rangeEnd = (QTime(8, 29), QTime(23, 59))
        # назначение границ действия для элементов диалога
        self.set_timeedit(self.editBegin, self.sliderBegin, rangeBegin)
        self.set_timeedit(self.editEnd, self.sliderEnd, rangeEnd)
        self.set_slider(self.sliderBegin, self.editBegin, rangeBegin, 'begin')
        self.set_slider(self.sliderEnd, self.editEnd, rangeEnd, 'end')

        # время начала должно быть меньше времени завершения
        def tune_end_widget(t):
            new_time = datetime.combine(datetime.today(),
                                        t.toPyTime()) + timedelta(minutes=29)
            self.editEnd.setMinimumTime(QTime(new_time.time()))

        self.editBegin.timeChanged.connect(tune_end_widget)

        # заполнение выпадашек
        self.fill_combo_days()
        self.fill_combo_rooms()

        # подключение обработчиков событий
        self.connect(self.buttonOK, SIGNAL('clicked()'), self.apply_dialog)
        self.connect(self.buttonCancel, SIGNAL('clicked()'), self,
                     SLOT('reject()'))
Exemple #3
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableCoaches.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.connect(self.buttonApply, SIGNAL('clicked()'), self.apply)
        self.connect(self.buttonClose,  SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #4
0
 def __init__(self, parent, params=dict()):
     self.mode = params.get('mode', 'client')
     self.apply_title = params.get('apply_title', _('Show'))
     if self.mode == 'client':
         self.title = _('Search client')
     else:
         self.title = _('Search renter')
     UiDlgTemplate.__init__(self, parent, params)
Exemple #5
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.labelText.setText(_('Put the RFID on the reader'))
        self.connect(self.buttonCancel, SIGNAL('clicked()'), self, SLOT('reject()'))

        self.reader = ThreadRFID(self)
        self.reader.start()
Exemple #6
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.groupName = 'printer'

        self.defaults = {
            'device_file': '/dev/usblp0',
            }
Exemple #7
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.groupName = 'printer'

        self.defaults = {
            'device_file': '/dev/usblp0',
        }
Exemple #8
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableVisitors.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tableVisitors.setContextMenuPolicy(Qt.CustomContextMenu)
        self.tableVisitors.customContextMenuRequested.connect(self.context_menu)

        self.connect(self.buttonClose, SIGNAL("clicked()"), self, SLOT("reject()"))
Exemple #9
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableCoaches.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.connect(self.buttonApply, SIGNAL('clicked()'), self.apply)
        self.connect(self.buttonClose, SIGNAL('clicked()'), self,
                     SLOT('reject()'))
Exemple #10
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        if self.connecting_to:
            self.editConnecting.setText(self.connecting_to)

        self.connect(self.buttonOk, SIGNAL('clicked()'), self.applyDialog)
        self.connect(self.buttonCancel, SIGNAL('clicked()'), self,
                     SLOT('reject()'))
Exemple #11
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.labelText.setText(self.tr('Put the RFID on the reader'))
        self.connect(self.buttonCancel, SIGNAL('clicked()'), self,
                     SLOT('reject()'))

        self.reader = ThreadRFID(self)
        self.reader.start()
Exemple #12
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        if self.connecting_to:
            self.editConnecting.setText(self.connecting_to)

        self.connect(self.buttonOk, SIGNAL('clicked()'),
                     self.applyDialog)
        self.connect(self.buttonCancel, SIGNAL('clicked()'),
                     self, SLOT('reject()'))
Exemple #13
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableVisitors.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tableVisitors.setContextMenuPolicy(Qt.CustomContextMenu)
        self.tableVisitors.customContextMenuRequested.connect(
            self.context_menu)

        self.connect(self.buttonClose, SIGNAL('clicked()'), self,
                     SLOT('reject()'))
Exemple #14
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableUsers.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.buttonApply.setText(self.apply_title)
        self.buttonApply.setDisabled(True)

        self.connect(self.buttonSearch, SIGNAL('clicked()'), self.searchFor)
        self.connect(self.buttonApply, SIGNAL('clicked()'), self.applyDialog)
        self.connect(self.buttonClose,  SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #15
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.connect(self.buttonClose,       SIGNAL('clicked()'), self.close)
        self.connect(self.buttonVisitors,    SIGNAL('clicked()'), self.showVisitors)
        self.connect(self.buttonVisitRFID,   SIGNAL('clicked()'), self.visitEventRFID)
        self.connect(self.buttonVisitManual, SIGNAL('clicked()'), self.visitEventManual)
        self.connect(self.buttonRemove,      SIGNAL('clicked()'), self.removeEvent)
        self.connect(self.buttonFix,         SIGNAL('clicked()'), self.fixEvent)
        self.connect(self.buttonChange,      SIGNAL('clicked()'), self.changeCoaches)
        self.connect(self.comboFix, SIGNAL('currentIndexChanged(int)'),
                     lambda: self.buttonFix.setDisabled(False))
Exemple #16
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.connect(self.buttonClose,       SIGNAL('clicked()'), self.close)
        self.connect(self.buttonVisitors,    SIGNAL('clicked()'), self.show_visitors)
        self.connect(self.buttonVisitRFID,   SIGNAL('clicked()'), self.search_by_rfid)
        self.connect(self.buttonVisitManual, SIGNAL('clicked()'), self.search_by_name)
        self.connect(self.buttonRemove,      SIGNAL('clicked()'), self.removeEvent)
        self.connect(self.buttonChange,      SIGNAL('clicked()'), self.change_coaches)

        # временно отключим кнопку удаления
        self.buttonRemove.setDisabled(True)
        self.buttonChange.setDisabled(True)
Exemple #17
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.groupName = 'general'

        self.defaults = {
            'borderWidth': 2,
            'borderColor': '#ff0000',
            }

        self.connect(self.borderColor, SIGNAL('clicked()'), self.getBorderColor)

        self.borderWidth.setRange(0, 4)
Exemple #18
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableUsers.setSelectionBehavior(QAbstractItemView.SelectRows)

        header = self.tableUsers.horizontalHeader()
        header.setStretchLastSection(False)
        header.setResizeMode(QHeaderView.ResizeToContents)
        header.setResizeMode(0, QHeaderView.Stretch)

        self.buttonApply.setText(self.tr('Show'))
        self.buttonApply.setDisabled(True)

        self.connect(self.buttonSearch, SIGNAL('clicked()'), self.searchFor)
        self.connect(self.buttonApply, SIGNAL('clicked()'), self.applyDialog)
        self.connect(self.buttonClose,  SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #19
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableUsers.setSelectionBehavior(QAbstractItemView.SelectRows)

        header = self.tableUsers.horizontalHeader()
        header.setStretchLastSection(False)
        header.setResizeMode(QHeaderView.ResizeToContents)
        header.setResizeMode(0, QHeaderView.Stretch)

        self.buttonApply.setText(self.tr('Show'))
        self.buttonApply.setDisabled(True)

        self.connect(self.buttonSearch, SIGNAL('clicked()'), self.searchFor)
        self.connect(self.buttonApply, SIGNAL('clicked()'), self.applyDialog)
        self.connect(self.buttonClose, SIGNAL('clicked()'), self,
                     SLOT('reject()'))
Exemple #20
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.connect(self.buttonClose, SIGNAL('clicked()'), self.close)
        self.connect(self.buttonVisitors, SIGNAL('clicked()'),
                     self.show_visitors)
        self.connect(self.buttonVisitRFID, SIGNAL('clicked()'),
                     self.search_by_rfid)
        self.connect(self.buttonVisitManual, SIGNAL('clicked()'),
                     self.search_by_name)
        self.connect(self.buttonRemove, SIGNAL('clicked()'), self.removeEvent)
        self.connect(self.buttonChange, SIGNAL('clicked()'),
                     self.change_coaches)

        # временно отключим кнопку удаления
        self.buttonRemove.setDisabled(True)
        self.buttonChange.setDisabled(True)
Exemple #21
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.tableHistory.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.card_model = CardListModel(self)
        self.tableHistory.setModel(self.card_model)
        self.tableHistory.setContextMenuPolicy(Qt.CustomContextMenu)
        self.tableHistory.customContextMenuRequested.connect(self.context_menu)

        for i in self.static.get('discounts', list()): # see params
            title = u'%(title)s - %(percent)s%%' % i
            self.comboDiscount.addItem(title, QVariant(i['id']))

        self.connect(self.buttonAssign, SIGNAL('clicked()'), self.assign_card)
        self.connect(self.buttonRFID,   SIGNAL('clicked()'), self.assignRFID)
        self.connect(self.buttonApply,  SIGNAL('clicked()'), self.applyDialog)
        self.connect(self.buttonClose,  SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #22
0
    def setupUi(self, *args, **kwargs):
        UiDlgTemplate.setupUi(self)

        self.tableHistory.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tableHistory.setContextMenuPolicy(Qt.CustomContextMenu)
        self.tableHistory.customContextMenuRequested.connect(self.context_menu)

        # добавляем на диалог все зарегистрированные виды скидок
        discount_list = kwargs.get('discount', [])
        for index, item in enumerate(discount_list):
            checkbox = QCheckBox('%(title)s (%(percent)s%%)' % item)
            self.discounts_by_index[index] = (checkbox, item)
            self.discounts_by_uuid[item.get('uuid')] = (checkbox, item)
            self.discountLayout.addWidget(checkbox)
        self.discountLayout.addStretch(10)

        self.connect(self.buttonAssign, SIGNAL('clicked()'), self.assign_item)
        self.connect(self.buttonRFID,   SIGNAL('clicked()'), self.assign_rfid)
        self.connect(self.buttonSave,   SIGNAL('clicked()'), self.save_dialog)
        self.connect(self.buttonClose,  SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #23
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        # настраиваем отображение событий аренды
        self.model = RentEvent(self)
        self.tableItems.setModel(self.model)
        self.tableItems.setSelectionBehavior(QAbstractItemView.SelectRows)

        header = self.tableItems.horizontalHeader()
        header.setStretchLastSection(False)
        header.setResizeMode(QHeaderView.ResizeToContents)
        header.setResizeMode(0, QHeaderView.Stretch)

        self.connect(self.toolBegin, SIGNAL('clicked()'), lambda: self.show_calendar(self.dateBegin))
        self.connect(self.toolEnd, SIGNAL('clicked()'), lambda: self.show_calendar(self.dateEnd))
        self.connect(self.buttonToday, SIGNAL('clicked()'), self.set_date_today)

        self.connect(self.buttonAdd, SIGNAL('clicked()'), self.add_item)
        self.connect(self.buttonSave, SIGNAL('clicked()'), self.save_rent)
        self.connect(self.buttonClose,  SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #24
0
    def setupUi(self, *args, **kwargs):
        UiDlgTemplate.setupUi(self)

        self.tableHistory.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tableHistory.setContextMenuPolicy(Qt.CustomContextMenu)
        self.tableHistory.customContextMenuRequested.connect(self.context_menu)

        # добавляем на диалог все зарегистрированные виды скидок
        discount_list = kwargs.get('discount', [])
        for index, item in enumerate(discount_list):
            checkbox = QCheckBox('%(title)s (%(percent)s%%)' % item)
            self.discounts_by_index[index] = (checkbox, item)
            self.discounts_by_uuid[item.get('uuid')] = (checkbox, item)
            self.discountLayout.addWidget(checkbox)
        self.discountLayout.addStretch(10)

        self.connect(self.buttonAssign, SIGNAL('clicked()'), self.assign_item)
        self.connect(self.buttonRFID, SIGNAL('clicked()'), self.assign_rfid)
        self.connect(self.buttonSave, SIGNAL('clicked()'), self.save_dialog)
        self.connect(self.buttonClose, SIGNAL('clicked()'), self,
                     SLOT('reject()'))
Exemple #25
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        # настраиваем отображение событий аренды
        self.model = RentEvent(self)
        self.tableItems.setModel(self.model)
        self.tableItems.setSelectionBehavior(QAbstractItemView.SelectRows)

        header = self.tableItems.horizontalHeader()
        header.setStretchLastSection(False)
        header.setResizeMode(QHeaderView.ResizeToContents)
        header.setResizeMode(0, QHeaderView.Stretch)

        self.connect(self.toolBegin, SIGNAL('clicked()'),
                     lambda: self.show_calendar(self.dateBegin))
        self.connect(self.toolEnd, SIGNAL('clicked()'),
                     lambda: self.show_calendar(self.dateEnd))
        self.connect(self.buttonToday, SIGNAL('clicked()'),
                     self.set_date_today)

        self.connect(self.buttonAdd, SIGNAL('clicked()'), self.add_item)
        self.connect(self.buttonSave, SIGNAL('clicked()'), self.save_rent)
        self.connect(self.buttonClose, SIGNAL('clicked()'), self,
                     SLOT('reject()'))
Exemple #26
0
 def setupUi(self):
     UiDlgTemplate.setupUi(self)
     self.connect(self.borderColor, SIGNAL('clicked()'),
                  self.getBorderColor)
     self.borderWidth.setRange(0, 4)
Exemple #27
0
    def __init__(self, parent, *args, **kwargs):
        UiDlgTemplate.__init__(self, parent)

        self.title = self.tr('Registered visitors')
        self.callback = kwargs.get('callback')
Exemple #28
0
    def __init__(self, parent, *args, **kwargs):
        UiDlgTemplate.__init__(self, parent)

        self.title = self.tr('RFID Reader')
        self.callback = kwargs.get('callback')
Exemple #29
0
 def __init__(self, parent=None):
     self.stream = self.params.http
     UiDlgTemplate.__init__(self, parent)
Exemple #30
0
    def __init__(self, parent, *args, **kwargs):
        UiDlgTemplate.__init__(self, parent)

        self.title = self.tr('RFID Reader')
        self.callback = kwargs.get('callback')
Exemple #31
0
    def __init__(self, parent, callback):
        self.callback = callback
        self.params = ParamStorage()

        UiDlgTemplate.__init__(self, parent)
Exemple #32
0
 def __init__(self, parent, *args, **kwargs):
     self.user_id = kwargs.get('renter')
     UiDlgTemplate.__init__(self, parent)
Exemple #33
0
 def __init__(self, parent=None, params=dict()):
     UiDlgTemplate.__init__(self, parent, params)
Exemple #34
0
 def __init__(self, parent=None):
     self.stream = self.params.http
     UiDlgTemplate.__init__(self, parent)
Exemple #35
0
    def setupUi(self):
        UiDlgTemplate.setupUi(self)

        self.connect(self.buttonClose, SIGNAL('clicked()'), self, SLOT('reject()'))
Exemple #36
0
    def __init__(self, parent, callback):
        self.callback = callback
        self.params = ParamStorage()

        UiDlgTemplate.__init__(self, parent)
Exemple #37
0
 def setupUi(self):
     UiDlgTemplate.setupUi(self)
     self.connect(self.borderColor, SIGNAL('clicked()'), self.getBorderColor)
     self.borderWidth.setRange(0, 4)
Exemple #38
0
    def __init__(self, parent, *args, **kwargs):
        UiDlgTemplate.__init__(self, parent)

        self.title = self.tr('Registered visitors')
        self.callback = kwargs.get('callback')
Exemple #39
0
 def __init__(self, parent=None, params=dict()):
     self.static = params['static']
     UiDlgTemplate.__init__(self, parent, params)
Exemple #40
0
 def __init__(self, parent, *args, **kwargs):
     self.user_id = kwargs.get('renter')
     UiDlgTemplate.__init__(self, parent)
Exemple #41
0
    def __init__(self, parent, *args, **kwargs):

        self.mode = kwargs.get('mode', 'client')
        UiDlgTemplate.__init__(self, parent)
Exemple #42
0
 def __init__(self, parent=None, **kwargs):
     self.stream = self.params.http
     self.connecting_to = kwargs.get('connecting_to')
     UiDlgTemplate.__init__(self, parent)
Exemple #43
0
 def __init__(self, parent=None, **kwargs):
     self.stream = self.params.http
     self.connecting_to = kwargs.get('connecting_to')
     UiDlgTemplate.__init__(self, parent)
Exemple #44
0
 def __init__(self, parent):
     UiDlgTemplate.__init__(self, parent)
Exemple #45
0
 def __init__(self, parent=None):
     UiDlgTemplate.__init__(self, parent)
Exemple #46
0
 def __init__(self, parent, params=dict()):
     UiDlgTemplate.__init__(self, parent, params)
     self.callback = params.get('callback', None)
Exemple #47
0
    def __init__(self, parent, *args, **kwargs):

        self.mode = kwargs.get('mode', 'client')
        UiDlgTemplate.__init__(self, parent)