Ejemplo n.º 1
0
    def on_weap_select(self, text = ''):
        # list stats
        self.stats.setText('')

        selected = self.cb2.currentIndex()
        if selected < 0:
            return
        weap_nm = self.cb2.itemData(selected)
        sk_uuid = self.cb1.itemData(self.cb1.currentIndex())

        self.item = models.weapon_outfit_from_db(self.dstore, weap_nm, sk_uuid)
        lines = []

        # pylint: disable-msg=E1103
        if self.item.dr is not None:
            lines.append( '<pre>%-24s %s</pre>' % (self.tr("Primary DR"  ), self.item.dr      ))
        if self.item.dr_alt is not None:
            lines.append( '<pre>%-24s %s</pre>' % (self.tr("Secondary DR"), self.item.dr_alt  ))
        if self.item.range is not None:
           lines.append( '<pre>%-24s %s</pre>' % (self.tr("Range"        ), self.item.range   ))
        if self.item.strength is not None:
           lines.append( '<pre>%-24s %s</pre>' % (self.tr("Strength"     ), self.item.strength))
        if self.item.min_str is not None:
           lines.append( '<pre>%-24s %s</pre>' % (self.tr("Min. Strength"), self.item.min_str ))
        if self.item.cost is not None:
           lines.append( '<pre>%-24s %s</pre>' % (self.tr("Cost"         ), self.item.cost    ))
        if self.item.rule is not None:
           lines.append( '<i>%s</i>' % self.item.rule )

        self.stats.setText( '<p>' + '\n'.join(lines) + '</p>' )

        self.stats.setSizePolicy( QtGui.QSizePolicy.Minimum,
                                  QtGui.QSizePolicy.Minimum )
    def on_base_weap_change(self, text=''):
        selected = self.cb_base_weap.currentIndex()
        if selected < 0:
            return

        weap_uuid = self.cb_base_weap.itemData(selected)
        self.item = itm = models.weapon_outfit_from_db(self.dstore, weap_uuid)

        self.tx_str    .setText(str(itm.strength))
        self.tx_min_str.setText(str(itm.min_str))

        self.tx_dr     .setText(itm.dr)
        self.tx_dr_alt .setText(itm.dr_alt)
        self.tx_rng    .setText(itm.range)
        self.tx_name   .setText(itm.name)
        self.tx_notes  .setText(itm.desc)
Ejemplo n.º 3
0
    def on_base_weap_change(self, text=''):
        selected = self.cb_base_weap.currentIndex()
        if selected < 0:
            return

        weap_uuid = self.cb_base_weap.itemData(selected)
        self.item = itm = models.weapon_outfit_from_db(weap_uuid)

        self.tx_str.setText(str(itm.strength))
        self.tx_min_str.setText(str(itm.min_str))

        self.tx_dr.setText(itm.dr)
        self.tx_dr_alt.setText(itm.dr_alt)
        self.tx_rng.setText(itm.range)
        self.tx_name.setText(itm.name)
        self.tx_notes.setText(itm.desc)
Ejemplo n.º 4
0
    def on_weap_select(self, text=''):
        # list stats
        self.stats.setText('')

        selected = self.cb2.currentIndex()
        if selected < 0:
            return
        weap_nm = self.cb2.itemData(selected)
        sk_uuid = self.cb1.itemData(self.cb1.currentIndex())

        self.item = models.weapon_outfit_from_db(weap_nm, sk_uuid)
        lines = []

        # pylint: disable-msg=E1103
        if self.item.dr is not None:
            lines.append('<pre>%-24s %s</pre>' %
                         (self.tr("Primary DR"), self.item.dr))
        if self.item.dr_alt is not None:
            lines.append('<pre>%-24s %s</pre>' %
                         (self.tr("Secondary DR"), self.item.dr_alt))
        if self.item.range is not None:
            lines.append('<pre>%-24s %s</pre>' %
                         (self.tr("Range"), self.item.range))
        if self.item.strength is not None:
            lines.append('<pre>%-24s %s</pre>' %
                         (self.tr("Strength"), self.item.strength))
        if self.item.min_str is not None:
            lines.append('<pre>%-24s %s</pre>' %
                         (self.tr("Min. Strength"), self.item.min_str))
        if self.item.cost is not None:
            lines.append('<pre>%-24s %s</pre>' %
                         (self.tr("Cost"), self.item.cost))
        if self.item.rule is not None:
            lines.append('<i>%s</i>' % self.item.rule)

        self.stats.setText('<p>' + '\n'.join(lines) + '</p>')

        self.stats.setSizePolicy(QtGui.QSizePolicy.Minimum,
                                 QtGui.QSizePolicy.Minimum)