Beispiel #1
0
 def __init__(self, parent, editable=True,  icons=default_icons, **kwargs):
     CustomDelegate.__init__(self,
                             parent=parent,
                             editable=editable,
                             icons=icons,
                             **kwargs)
     self.icons_by_name = dict(icons)
Beispiel #2
0
 def __init__(self, parent=None, editable=True, maximum=5, **kwargs):
     CustomDelegate.__init__(self,
                             parent=parent,
                             editable=editable,
                             maximum=maximum,
                             **kwargs)
     self.maximum = maximum
Beispiel #3
0
 def __init__(self, parent=None, editable=True, maximum=5, **kwargs):
     CustomDelegate.__init__(self,
                             parent=parent,
                             editable=editable,
                             maximum=maximum,
                             **kwargs)
     self.maximum = maximum
 def __init__(
     self, parent=None, length=20,
     editable=True, translate_content=False, **kw
 ):
     CustomDelegate.__init__(self, parent, editable, length=length, **kw)
     self.length = length
     self.editable = editable
     self._translate_content = translate_content
Beispiel #5
0
   def __init__(self,
                parent=None,
                unicode_format = None,
                **kwargs):
 
       CustomDelegate.__init__(self, parent=parent, **kwargs)
       self.unicode_format = unicode_format
       self.locale = QtCore.QLocale()
 def __init__( self, 
               parent = None, 
               length = DEFAULT_COLUMN_WIDTH,
               translate_content=False, 
               **kw ):
     CustomDelegate.__init__( self, parent, length = length, **kw )
     self._translate_content = translate_content
     char_width = self._font_metrics.averageCharWidth()
     self._width = char_width * min( DEFAULT_COLUMN_WIDTH, length or DEFAULT_COLUMN_WIDTH )
 def __init__(self,
              parent=None,
              length=20,
              editable=True,
              translate_content=False,
              **kw):
     CustomDelegate.__init__(self, parent, editable, length=length, **kw)
     self.length = length
     self.editable = editable
     self._translate_content = translate_content
Beispiel #8
0
   def __init__(self,
                minimum=constants.camelot_minint,
                maximum=constants.camelot_maxint,
                parent=None,
                unicode_format = None,
                **kwargs):
 
       CustomDelegate.__init__(self, parent=parent, minimum=minimum, maximum=maximum, **kwargs)
       self.minimum = minimum
       self.maximum = maximum
       self.unicode_format = unicode_format
 def __init__(self,
              parent=None,
              admin=None,
              editable=True,
              **kwargs):
     logger.debug('create many2onecolumn delegate')
     assert admin != None
     CustomDelegate.__init__(self, parent, editable, **kwargs)
     self.admin = admin
     self._kwargs = kwargs
     self._width = self._width * 2
Beispiel #10
0
 def __init__(self, parent=None,
     precision=2, reverse=False, neutral=False,
     unicode_format=None, **kwargs
 ):
     CustomDelegate.__init__(self, parent=parent,
         reverse=reverse, neutral=neutral,
         precision=precision, unicode_format=unicode_format, **kwargs
     )
     self.precision = precision
     self.reverse = reverse
     self.neutral = neutral
     self.unicode_format = unicode_format
     self._locale = QtCore.QLocale()
Beispiel #11
0
 def __init__(self,
              parent=None,
              editable=True,
              yes='Yes',
              no='No',
              color_yes=None,
              color_no=None,
              **kwargs):
     CustomDelegate.__init__(self, parent, editable, **kwargs)
     self.yes = yes
     self.no = no
     self.color_no = color_no
     self.color_yes = color_yes
Beispiel #12
0
 def __init__( self,
              minimum=constants.camelot_minfloat,
              maximum=constants.camelot_maxfloat,
              parent=None,
              unicode_format=None,
              **kwargs ):
     CustomDelegate.__init__(self,
                             parent=parent,
                             minimum=minimum, maximum=maximum,
                             **kwargs )                   
     self.minimum = minimum
     self.maximum = maximum
     self.unicode_format = unicode_format
     self._locale = QtCore.QLocale()
Beispiel #13
0
 def __init__(self,
              minimum=constants.camelot_minfloat,
              maximum=constants.camelot_maxfloat,
              parent=None,
              unicode_format=None,
              **kwargs):
     CustomDelegate.__init__(self,
                             parent=parent,
                             minimum=minimum,
                             maximum=maximum,
                             **kwargs)
     self.minimum = minimum
     self.maximum = maximum
     self.unicode_format = unicode_format
     self._locale = QtCore.QLocale()
Beispiel #14
0
    def __init__(self,
                 minimum=constants.camelot_minint,
                 maximum=constants.camelot_maxint,
                 parent=None,
                 unicode_format=None,
                 **kwargs):

        CustomDelegate.__init__(self,
                                parent=parent,
                                minimum=minimum,
                                maximum=maximum,
                                **kwargs)
        self.minimum = minimum
        self.maximum = maximum
        self.unicode_format = unicode_format
Beispiel #15
0
 def __init__(self, parent=None, minimum=-1e15, maximum=1e15,
     precision=2, editable=True, reverse=False, neutral=False,
     unicode_format=None, **kwargs
 ):
     CustomDelegate.__init__(self, parent=parent, editable=editable,
         minimum=minimum, maximum=maximum, reverse=reverse, neutral=neutral,
         precision=precision, unicode_format=unicode_format, **kwargs
     )
     self.minimum = minimum
     self.maximum = maximum
     self.precision = precision
     self.editable = editable
     self.reverse = reverse
     self.neutral = neutral
     self.unicode_format = unicode_format
 def __init__(self,
              parent=None,
              precision=2,
              reverse=False,
              neutral=False,
              unicode_format=None,
              **kwargs):
     CustomDelegate.__init__(self,
                             parent=parent,
                             reverse=reverse,
                             neutral=neutral,
                             precision=precision,
                             unicode_format=unicode_format,
                             **kwargs)
     self.precision = precision
     self.reverse = reverse
     self.neutral = neutral
     self.unicode_format = unicode_format
     self._locale = QtCore.QLocale()
Beispiel #17
0
 def __init__( self,
              minimum=constants.camelot_minfloat,
              maximum=constants.camelot_maxfloat,
              precision=2,
              parent=None,
              unicode_format=None,
              **kwargs ):
     """
     :param precision:  The number of digits after the decimal point displayed.  This defaults
     to the precision specified in the definition of the Field.     
     
     """
     
     CustomDelegate.__init__(self,
                             parent=parent,
                             precision=precision,
                             minimum=minimum, maximum=maximum,
                             **kwargs )                   
     self.minimum = minimum
     self.maximum = maximum
     self.precision = precision
     self.unicode_format = unicode_format
Beispiel #18
0
    def __init__(self,
                 minimum=constants.camelot_minfloat,
                 maximum=constants.camelot_maxfloat,
                 precision=2,
                 parent=None,
                 unicode_format=None,
                 **kwargs):
        """
        :param precision:  The number of digits after the decimal point displayed.  This defaults
        to the precision specified in the definition of the Field.     
        
        """

        CustomDelegate.__init__(self,
                                parent=parent,
                                precision=precision,
                                minimum=minimum,
                                maximum=maximum,
                                **kwargs)
        self.minimum = minimum
        self.maximum = maximum
        self.precision = precision
        self.unicode_format = unicode_format
Beispiel #19
0
 def __init__(self, parent=None, parts=[], separator=u'.', **kwargs):
     CustomDelegate.__init__(self, parent=parent, parts=parts, **kwargs)
     self.parts = parts
     self.separator = separator
Beispiel #20
0
 def __init__(self, parent=None, editable=True, **kwargs):
     CustomDelegate.__init__(self, parent, editable)
     locale = QtCore.QLocale()
     self.time_format = locale.timeFormat(locale.ShortFormat)
Beispiel #21
0
 def __init__(self, parent=None, editable=True, **kwargs):
     CustomDelegate.__init__(self, parent, editable)
     self.editable = editable
     self._height = self._height * 10
     self._width = self._width * 3
 def __init__(self, parent=None, **kwargs):
     CustomDelegate.__init__(self, parent, **kwargs)
Beispiel #23
0
 def __init__(self, parent=None, **kwargs):
     CustomDelegate.__init__(self, parent, **kwargs)
     self.date_format = local_date_format()
     self._width = self._font_metrics.averageCharWidth() * (len(self.date_format) + 2)  + (camelot_small_icon_width*2)
 def __init__(self, parent=None, choices=[], editable=True, **kwargs):
     CustomDelegate.__init__(self, parent, editable=editable, **kwargs)
     self.choices = choices
     self._choices_dict = dict(choices)
Beispiel #25
0
 def __init__(self, parent=None, parts=[], separator=u'.', **kwargs):
     CustomDelegate.__init__(self, parent=parent, parts=parts, **kwargs)
     self.parts = parts
     self.separator = separator
 def __init__(self, parent=None, choices=[], editable=True, **kwargs):
     CustomDelegate.__init__(self, parent, editable=editable, **kwargs)
     self.choices = choices
     self._choices_dict = dict(choices)
Beispiel #27
0
        if stop():
            break
        thingy.waitForNotifications(1)
    print('- sensor loop stopping')


stop_thread = False
sensorLoopThread = threading.Thread(target=sensorLoopMethod,
                                    args=(id, lambda: stop_thread))

deviceAddress = "CA:9E:A7:DB:F4:D0"
thingy = Thingy52(deviceAddress)

print('Initializing device...')
try:
    thingy.setDelegate(CustomDelegate())
    thingy.ui.enable()
    thingy.ui.set_btn_notification(True)

    sensorLoopThread.start()
    print('Waiting user action')

    cfg.inactivityTimer = time.time()  # initialize inactivity timer
    while (time.time() - cfg.inactivityTimer) < 10:
        time.sleep(1.0)
        print(str(int(time.time() - cfg.inactivityTimer)))

    print('Timeout received.')
    stop_thread = True  # stopping thread
    sensorLoopThread.join()  # waiting thread to stop
Beispiel #28
0
 def __init__(
     self, 
     parent=None,
     **kw
 ):
     CustomDelegate.__init__(self, parent, **kw)
Beispiel #29
0
 def __init__(self, parent, editable=True, **kwargs):
     CustomDelegate.__init__(self,
                             parent=parent,
                             editable=editable,
                             maximum=1,
                             **kwargs)
Beispiel #30
0
 def __init__(self, parent=None, editable=True, yes='Yes', no='No', color_yes=None, color_no=None, **kwargs):
     CustomDelegate.__init__(self, parent, editable, **kwargs)
     self.yes = yes
     self.no = no
     self.color_no = color_no
     self.color_yes = color_yes
Beispiel #31
0
 def __init__(self, parent=None, editable=True, **kwargs):
     CustomDelegate.__init__(self, parent, editable)
     self.editable = editable
     self._height = self._height * 10
     self._width = self._width * 3
Beispiel #32
0
 def __init__(self, parent, editable=True,  **kwargs):
     CustomDelegate.__init__(self,
                             parent=parent,
                             editable=editable,
                             maximum=1,
                             **kwargs)
Beispiel #33
0
 def __init__(self, parent=None, editable=True, **kwargs):
     CustomDelegate.__init__(self, parent, editable)
     locale = QtCore.QLocale()
     self.time_format = locale.timeFormat(locale.ShortFormat)
    def __init__(self, parent=None, unicode_format=None, **kwargs):

        CustomDelegate.__init__(self, parent=parent, **kwargs)
        self.unicode_format = unicode_format
        self.locale = QtCore.QLocale()