Ejemplo n.º 1
0
    def _ConstructExperimental(self, column, columnWidth):
        lst = []
        if lst:
            uiprimitives.Container(name='toppush',
                                   align=uiconst.TOTOP,
                                   height=4,
                                   parent=column)
            uix.GetContainerHeader(localization.GetByLabel(
                'UI/SystemMenu/GeneralSettings/Experimental/Header'),
                                   column,
                                   xmargin=-5)
            uiprimitives.Container(name='toppush',
                                   align=uiconst.TOTOP,
                                   height=2,
                                   parent=column)
            scroll = uicontrols.Scroll(parent=column)
            scroll.name = 'experimentalFeatures'
            scroll.HideBackground()
            scroll.minimumHeight = 64
            scrollList = []
            for each in lst:
                scrollList.append(
                    listentry.Get(
                        'Button', {
                            'label': each['label'],
                            'caption': each['caption'],
                            'OnClick': each['OnClick'],
                            'args': (each['args'], ),
                            'maxLines': None,
                            'entryWidth': columnWidth - 16
                        }))

            scroll.Load(contentList=scrollList)
Ejemplo n.º 2
0
 def MakeColumn3(self, columnWidth):
     if session.charid:
         column = self.AddColumn(columnWidth, name='col3')
         uix.GetContainerHeader(localization.GetByLabel(
             'UI/SystemMenu/GeneralSettings/ColorTheme'),
                                column,
                                xmargin=1)
         self.AppendToColumn(
             [('slider', ('windowTransparency', ('user', 'ui'),
                          1.0), 'UI/SystemMenu/GeneralSettings/Transparent',
               (0.0, 1.0), 120), ('toppush', 6),
              ('checkbox', ('enableWindowBlur', ('char', 'windows'), 1),
               localization.GetByLabel(
                   'UI/SystemMenu/GeneralSettings/General/EnableWindowBlur')
               ),
              ('checkbox', ('shiptheme', ('char', 'windows'), 0),
               localization.GetByLabel(
                   'UI/SystemMenu/GeneralSettings/General/ShipTheme')),
              ('toppush', 8)], column)
         myScrollCont = ScrollContainer(name='myScrollCont',
                                        parent=column,
                                        align=uiconst.TOALL)
         if settings.char.windows.Get('shiptheme', False):
             myScrollCont.state = uiconst.UI_DISABLED
             myScrollCont.opacity = 0.3
         for themeID, _, _ in THEMES:
             ColorSettingEntry(parent=myScrollCont, themeID=themeID)
 def ConstructCrashesAndExperimentsUI(self, parent, columnWidth):
     column = parent
     uiprimitives.Container(name='toppush', align=uiconst.TOTOP, height=4, parent=column)
     uix.GetContainerHeader(localization.GetByLabel('UI/SystemMenu/GeneralSettings/Crashes/Header'), column, xmargin=-5)
     uiprimitives.Container(name='toppush', align=uiconst.TOTOP, height=2, parent=column)
     uicontrols.Checkbox(text=localization.GetByLabel('UI/SystemMenu/GeneralSettings/Crashes/UploadCrashDumpsToCCPEnabled'), parent=column, checked=blue.IsBreakpadEnabled(), callback=self.EnableDisableBreakpad)
     self._ConstructExperimental(column, columnWidth)
Ejemplo n.º 4
0
 def ConstructNotificationSection(self, column, columnWidth):
     uix.GetContainerHeader(localization.GetByLabel(
         'UI/SystemMenu/GeneralSettings/Notifications/Header'),
                            column,
                            xmargin=-5)
     uiprimitives.Container(name='toppush',
                            align=uiconst.TOTOP,
                            height=2,
                            parent=column)
     uicontrols.Checkbox(text=localization.GetByLabel(
         'UI/SystemMenu/GeneralSettings/Notifications/NotificationsEnabled'
     ),
                         parent=column,
                         checked=NotificationSettingHandler().
                         GetNotificationWidgetEnabled(),
                         callback=self.ToggleNotificationsEnabled)
Ejemplo n.º 5
0
    def AddSliders(self, *args):
        self.currentselection = None
        self.ribbonsliders = []
        self.medalsliders = []
        uix.Flush(self.sr.main)
        ribbondata = [
            xtriui.Ribbon,
            [('', None, None), ('', None, None), ('', None, None),
             ('', None, None), ('', None, None)]
        ]
        medaldata = [
            xtriui.Medal,
            [('', None, None), ('', None, None), ('', None, None),
             ('', None, None)]
        ]
        top = 0
        imgSize = 128
        self.sr.buttoncont = uicls.Container(name='Buttons',
                                             align=uiconst.TOBOTTOM,
                                             parent=self.sr.main)
        self.sr.mainpar = uicls.Container(name='MainPar',
                                          align=uiconst.TOALL,
                                          parent=self.sr.main,
                                          pos=(0, 0, 0, 0))
        mp = uicls.Container(name='Left',
                             align=uiconst.TOLEFT,
                             width=imgSize,
                             left=const.defaultPadding,
                             top=const.defaultPadding,
                             parent=self.sr.mainpar)
        medalribbonobject = xtriui.MedalRibbon(name='MedalRibbonParent',
                                               width=128,
                                               height=256,
                                               parent=mp,
                                               align=uiconst.CENTER)
        medalribbonobject.Startup([ribbondata, medaldata], imgSize * 2)
        self.sr.medalribbonobject = medalribbonobject
        btns = []
        btns.append([
            localization.GetByLabel(
                'UI/Corporations/CreateDecorationWindow/Submit'),
            self.SubmitData, None, None
        ])
        btns.append([
            localization.GetByLabel(
                'UI/Corporations/CreateDecorationWindow/Reset'),
            self.AddSliders, None, None
        ])
        buttons = uicls.ButtonGroup(btns=btns,
                                    parent=self.sr.buttoncont,
                                    unisize=0)
        self.sr.buttoncont.height = 20 if not len(btns) else buttons.height
        uicls.Line(parent=self.sr.mainpar, align=uiconst.TOLEFT)
        self.sr.mainselector = uicls.Container(name='MainSelector',
                                               align=uiconst.TOALL,
                                               parent=self.sr.mainpar,
                                               pos=(const.defaultPadding, 0,
                                                    const.defaultPadding, 0))
        uix.GetContainerHeader(
            localization.GetByLabel('UI/Contracts/BasicInfo'),
            self.sr.mainselector, 0, -4)
        uicls.Container(name='push',
                        align=uiconst.TOTOP,
                        height=6,
                        parent=self.sr.mainselector)
        medalnamecont = uicls.Container(parent=self.sr.mainselector,
                                        align=uiconst.TOTOP)
        uicls.Container(name='push',
                        align=uiconst.TOTOP,
                        height=24,
                        parent=medalnamecont)
        uicls.Container(name='push',
                        align=uiconst.TOLEFT,
                        width=4,
                        parent=medalnamecont)
        uicls.Container(name='push',
                        align=uiconst.TORIGHT,
                        width=4,
                        parent=medalnamecont)
        self.sr.medalname = uicls.SinglelineEdit(
            name='medalname',
            parent=medalnamecont,
            setvalue=None,
            pos=(0, 12, 284, 0),
            label=localization.GetByLabel(
                'UI/Corporations/CreateDecorationWindow/DecorationName'),
            maxLength=100)
        top = const.defaultPadding + self.sr.medalname.top + self.sr.medalname.height
        uicls.EveLabelSmall(text=localization.GetByLabel(
            'UI/Corporations/CreateDecorationWindow/Description'),
                            parent=medalnamecont,
                            top=top,
                            width=100)
        self.sr.medaldesc = uicls.EditPlainText(setvalue='',
                                                parent=medalnamecont,
                                                align=uiconst.TOPLEFT,
                                                name='medaldesc',
                                                maxLength=1000,
                                                top=top + 16,
                                                left=-1,
                                                width=286,
                                                height=64)
        medalnamecont.height = self.sr.medalname.height + self.sr.medaldesc.height + 8 + 23
        uicls.Container(name='push',
                        align=uiconst.TOTOP,
                        height=4,
                        parent=self.sr.mainselector)
        uix.GetContainerHeader(
            localization.GetByLabel(
                'UI/Corporations/CreateDecorationWindow/Ribbon'),
            self.sr.mainselector, 1, -4)
        labels = ['caldari', 'minmatar', 'gallente', 'amarr']
        data = []
        for label in labels:
            data.append([
                xtriui.Ribbon,
                [(label, '1_1', None), ('', None, None), ('', None, None),
                 ('', None, None), (label, '1_2', None)]
            ])

        slider = self.GetImageSlider(data)
        slider.SetParentListener(self.sr.medalribbonobject.sr.ribbon, None)
        slider.SetAlign(uiconst.TOPRIGHT)
        slider.PostOnClick = self.PostOnClick
        self.sr.baseribbonslider = slider
        self.ribbonsliders.append(slider)
        parent = slider.parent
        colorPreview = xtriui.ColorPreview(name='colorPreview',
                                           align=uiconst.TORIGHT,
                                           height=32,
                                           width=32)
        uicls.Frame(parent=colorPreview)
        colorPreview.Startup()
        colorPreview.sr.layerid = 4
        colorPreview.sr.dad = self.sr.medalribbonobject.sr.ribbon
        colorPreview.FromInt(-330271)
        colorPreview.state = uiconst.UI_HIDDEN
        push = uicls.Container(name='push',
                               align=uiconst.TORIGHT,
                               height=32,
                               width=4)
        slider.parent.children.insert(0, push)
        slider.parent.children.insert(0, colorPreview)
        ranger = range(1, 4)
        ranger.reverse()
        for x in ranger:
            data = []
            data = self.GetRibbonShapeData('Caldari')
            slider = self.GetImageSlider(data, True)
            slider.SetParentListener(self.sr.medalribbonobject.sr.ribbon, x)
            slider.SetAlign(uiconst.TOPRIGHT)
            slider.PostOnClick = self.PostOnClick
            parent = slider.parent
            self.AddSliderReset(slider)
            colorPreview = xtriui.ColorPreview(name='colorPreview',
                                               align=uiconst.TORIGHT,
                                               width=32,
                                               height=32)
            uicls.Frame(parent=colorPreview)
            colorPreview.Startup()
            colorPreview.sr.layerid = x
            colorPreview.sr.dad = self.sr.medalribbonobject.sr.ribbon
            colorPreview.FromInt(-330271)
            colorPreview.state = uiconst.UI_HIDDEN
            push = uicls.Container(name='push',
                                   align=uiconst.TORIGHT,
                                   height=32,
                                   width=4)
            slider.parent.children.insert(0, push)
            slider.parent.children.insert(0, colorPreview)
            slider.parent.state = uiconst.UI_HIDDEN
            self.ribbonsliders.append(slider)

        uicls.Container(name='push',
                        align=uiconst.TOTOP,
                        height=4,
                        parent=self.sr.mainselector)
        uix.GetContainerHeader(
            localization.GetByLabel(
                'UI/Corporations/CreateDecorationWindow/Medal'),
            self.sr.mainselector, 1, -4)
        labels = (('compass', 2), ('imperial', 2), ('pentagon', 1),
                  ('rombus', 1), ('round', 6), ('shield', 1), ('square',
                                                               2), ('star', 7))
        data = []
        for label, amount in labels:
            for x in xrange(0, amount * 4):
                icon = '%s_%s' % (x / 4 + 1, x % 4 + 1)
                data.append([xtriui.Medal, [(label, icon, None)]])

        slider = self.GetImageSlider(data)
        slider.SetParentListener(self.sr.medalribbonobject.sr.medal, 3)
        slider.SetAlign(uiconst.TOPRIGHT)
        slider.PostOnClick = self.PostOnClick
        self.sr.basemedalslider = slider
        self.medalsliders.append(slider)
        labels = (('elements', 33), )
        ranger = range(0, 3)
        ranger.reverse()
        for i in ranger:
            data = []
            for label, amount in labels:
                for x in xrange(0, amount * 4):
                    icon = '%s_%s' % (x / 4 + 1, x % 4 + 1)
                    data.append([xtriui.Medal, [(label, icon, None)]])

            slider = self.GetImageSlider(data)
            slider.SetParentListener(self.sr.medalribbonobject.sr.medal, i)
            slider.PostOnClick = self.PostOnClick
            slider.SetAlign(uiconst.TOPRIGHT)
            slider.parent.state = uiconst.UI_HIDDEN
            self.AddSliderReset(slider)
            self.medalsliders.append(slider)
Ejemplo n.º 6
0
    def Begin(self, *args):
        margin = const.defaultPadding
        btns = uicontrols.ButtonGroup(btns=[['Add',
          self.AddChannel,
          None,
          81], ['Begin',
          self.Start,
          None,
          81], ['Stop',
          self.Cease,
          None,
          81]])
        self.buttons = uiprimitives.Container(name='buttons', parent=self.sr.main, align=uiconst.TOBOTTOM, height=20)
        self.buttons.children.insert(0, btns)
        border = uiprimitives.Container(name='border', align=uiconst.TOALL, parent=self.sr.main, pos=(margin,
         margin,
         margin,
         margin))
        border.height = margin + 1
        uiprimitives.Line(parent=border, align=uiconst.TOTOP, color=(1.0, 1.0, 1.0, 0.2))
        uiprimitives.Line(parent=border, align=uiconst.TOLEFT, color=(1.0, 1.0, 1.0, 0.2))
        uiprimitives.Line(parent=border, align=uiconst.TORIGHT, color=(1.0, 1.0, 1.0, 0.2))
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TORIGHT, width=margin)
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOLEFT, width=margin)
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOTOP, height=margin)
        uix.GetContainerHeader('Twiddle my options...', self.sr.main, bothlines=0)
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TORIGHT, width=margin)
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOLEFT, width=margin)
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOTOP, height=margin)
        defaultval = '%s:%s' % (DEFAULTTMIN, DEFAULTTMAX)
        minVal, maxVal = str(prefs.GetValue('spamdelay', defaultval)).split(':')
        try:
            minVal = int(minVal)
        except ValueError:
            sys.exc_clear()
            minVal = DEFAULTTMIN

        try:
            maxVal = int(maxVal)
        except ValueError:
            sys.exc_clear()
            maxVal = DEFAULTTMAX

        amount = str(prefs.GetValue('spamcount', 0))
        gpMin = uiprimitives.Container(name='gpMin', parent=self.sr.main, align=uiconst.TOTOP, height=16)
        textMin = uicontrols.Label(text='Minimum Duration', name='textMin', parent=gpMin, align=uiconst.TOLEFT, height=12, top=5, left=margin - 1, fontsize=10, letterspace=1, linespace=9, uppercase=1, state=uiconst.UI_NORMAL)
        textMin.rectTop = -2
        self.min = uicontrols.SinglelineEdit(name='editMin', parent=gpMin, width=EDITWIDTH, height=20, align=uiconst.TORIGHT)
        self.min.SetValue(str(minVal))
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOTOP, height=margin)
        gpMax = uiprimitives.Container(name='gpMax', parent=self.sr.main, align=uiconst.TOTOP, height=16)
        textMax = uicontrols.Label(text='Maximum Duration', name='textMax', parent=gpMax, align=uiconst.TOLEFT, height=12, top=5, left=margin - 1, fontsize=10, letterspace=1, linespace=9, uppercase=1, state=uiconst.UI_NORMAL)
        textMax.rectTop = -2
        self.max = uicontrols.SinglelineEdit(name='editMax', parent=gpMax, width=EDITWIDTH, height=20, align=uiconst.TORIGHT)
        self.max.SetValue(str(maxVal))
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOTOP, height=margin)
        gpCount = uiprimitives.Container(name='gpCount', parent=self.sr.main, align=uiconst.TOTOP, height=16)
        textCount = uicontrols.Label(text='Amount', name='textCount', parent=gpCount, align=uiconst.TOLEFT, height=12, top=5, left=margin - 1, fontsize=10, letterspace=1, linespace=9, uppercase=1, state=uiconst.UI_NORMAL)
        textCount.rectTop = -2
        self.count = uicontrols.SinglelineEdit(name='editCount', parent=gpCount, width=EDITWIDTH, height=20, align=uiconst.TORIGHT)
        self.count.SetValue(amount)
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOTOP, height=margin)
        uix.GetContainerHeader('Spamming in...', self.sr.main, bothlines=1, xmargin=-margin)
        push = uiprimitives.Container(name='push', parent=self.sr.main, align=uiconst.TOTOP, height=margin)
        self.scroll = uicontrols.Scroll(parent=self.sr.main, height=145)
        self.scroll.height = margin * 2
        self.scroll.sr.id = 'chatchannels'
        self.scroll.Load(contentList=[], headers=['Channels', 'ID'])
        self.svc.ClearChannels()
Ejemplo n.º 7
0
    def Begin(self, *args):
        margin = const.defaultPadding
        btns = uicontrols.ButtonGroup(
            btns=[['Use Current', self.Current, None, 81],
                  ['Defaults', self.Defaults, None, 81],
                  ['Save', self.Save, None, 81]])
        self.buttons = uiprimitives.Container(name='buttons',
                                              parent=self.sr.main,
                                              align=uiconst.TOBOTTOM,
                                              height=20)
        self.buttons.children.insert(0, btns)
        self.currentBtn = uiutil.GetChild(self, 'Use Current_Btn')
        self.currentBtn.hint = 'This button sets the account details to the current logged in account'
        self.defaultBtn = uiutil.GetChild(self, 'Defaults_Btn')
        self.defaultBtn.hint = 'This resets all values to predetermined defaults'
        border = uiprimitives.Container(name='border',
                                        align=uiconst.TOALL,
                                        parent=self.sr.main,
                                        pos=(margin, margin, margin, margin))
        border.height = margin + 1
        uiprimitives.Line(parent=border,
                          align=uiconst.TOTOP,
                          color=(1.0, 1.0, 1.0, 0.2))
        uiprimitives.Line(parent=border,
                          align=uiconst.TOLEFT,
                          color=(1.0, 1.0, 1.0, 0.2))
        uiprimitives.Line(parent=border,
                          align=uiconst.TORIGHT,
                          color=(1.0, 1.0, 1.0, 0.2))
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TORIGHT,
                                      width=margin)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOLEFT,
                                      width=margin)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        uix.GetContainerHeader('Connect Options:', self.sr.main, bothlines=0)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TORIGHT,
                                      width=margin)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOLEFT,
                                      width=margin)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)

        def Logon(cb):
            checked = cb.GetValue()
            prefs.SetValue('bmnextrun', checked)
            if checked:
                cb.hint = 'This will auto connect the next time <b>exefile</b> is initiated.'
            else:
                cb.hint = 'No automated processes will be undertaken.'
            cb.state = uiconst.UI_HIDDEN
            cb.state = uiconst.UI_NORMAL

        def Loop(cb):
            checked = cb.GetValue()
            prefs.SetValue('csloopenabled', checked)
            if checked:
                count = 1
                if hasattr(self, 'count'):
                    count = self.count.GetValue()
                prefs.SetValue('cscount', count)
                cb.hint = 'Disables the loop ability of the connection tool.'
            else:
                cb.hint = 'Enables the loop ability of the connection tool.'
            cb.state = uiconst.UI_HIDDEN
            cb.state = uiconst.UI_NORMAL

        self.runcb = uicontrols.Checkbox(text='Run at next logon',
                                         parent=self.sr.main,
                                         retval=0,
                                         configName='cbLogon',
                                         checked=prefs.GetValue(
                                             'bmnextrun', 0),
                                         callback=Logon,
                                         pos=(0, 0, 145, 0))
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        gpCount = uiprimitives.Container(name='gpCount',
                                         parent=self.sr.main,
                                         align=uiconst.TOTOP,
                                         height=16)
        self.countcb = uicontrols.Checkbox(text="Loop for 'x' connections",
                                           parent=gpCount,
                                           retval=0,
                                           configName='cbLoopForXRuns',
                                           checked=prefs.GetValue(
                                               'csloopenabled', 0),
                                           callback=Loop,
                                           pos=(0, 0, 145, 0),
                                           align=uiconst.TOLEFT)
        self.count = uicontrols.SinglelineEdit(name='editLoopCount',
                                               parent=gpCount,
                                               width=80,
                                               height=20,
                                               align=uiconst.TORIGHT,
                                               ints=(1, 99999),
                                               maxLength=5)
        self.count.SetValue(prefs.GetValue('cscount', '1'))
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        uiprimitives.Line(parent=push,
                          align=uiconst.TOTOP,
                          color=(1.0, 1.0, 1.0, 0.2))
        gpDuration = uiprimitives.Container(name='gpDuration',
                                            parent=self.sr.main,
                                            align=uiconst.TOTOP,
                                            height=16)
        text = uicontrols.Label(text='Duration per cycle (seconds)',
                                name='textLoopDuration',
                                parent=gpDuration,
                                align=uiconst.TOLEFT,
                                top=5,
                                left=margin - 1,
                                width=170,
                                fontsize=10,
                                letterspace=1,
                                linespace=9,
                                uppercase=1,
                                state=uiconst.UI_NORMAL)
        text.rectTop = -2
        self.duration = uicontrols.SinglelineEdit(name='editLoopDuration',
                                                  parent=gpDuration,
                                                  width=80,
                                                  height=20,
                                                  align=uiconst.TORIGHT,
                                                  ints=(1, 99999),
                                                  maxLength=5)
        self.duration.SetValue(prefs.GetValue('csduration', '180'))
        Logon(self.runcb)
        Loop(self.countcb)
        EDITWIDTH = 150
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        uix.GetContainerHeader('Account Details:',
                               self.sr.main,
                               bothlines=1,
                               xmargin=-margin)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        gpServer = uiprimitives.Container(name='gpServer',
                                          parent=self.sr.main,
                                          align=uiconst.TOTOP,
                                          height=16)
        textServer = uicontrols.Label(text='Server IP',
                                      name='textServerIP',
                                      parent=gpServer,
                                      align=uiconst.TOLEFT,
                                      height=12,
                                      top=5,
                                      left=margin - 1,
                                      fontsize=10,
                                      letterspace=1,
                                      linespace=9,
                                      uppercase=1)
        textServer.rectTop = -2
        self.serverip = uicontrols.SinglelineEdit(name='editServerIP',
                                                  parent=gpServer,
                                                  width=EDITWIDTH,
                                                  height=20,
                                                  align=uiconst.TORIGHT)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        gpUserName = uiprimitives.Container(name='gpUserName',
                                            parent=self.sr.main,
                                            align=uiconst.TOTOP,
                                            height=16)
        textUserName = uicontrols.Label(text='Account Name',
                                        name='textUserName',
                                        parent=gpUserName,
                                        align=uiconst.TOLEFT,
                                        height=12,
                                        top=5,
                                        left=margin - 1,
                                        fontsize=10,
                                        letterspace=1,
                                        linespace=9,
                                        uppercase=1,
                                        state=uiconst.UI_NORMAL)
        textUserName.rectTop = -2
        self.username = uicontrols.SinglelineEdit(name='editUserName',
                                                  parent=gpUserName,
                                                  width=EDITWIDTH,
                                                  height=20,
                                                  align=uiconst.TORIGHT)
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        gpUserPass = uiprimitives.Container(name='gpUserPass',
                                            parent=self.sr.main,
                                            align=uiconst.TOTOP,
                                            height=16)
        textUserPass = uicontrols.Label(text='Account Password',
                                        name='textUserPass',
                                        parent=gpUserPass,
                                        align=uiconst.TOLEFT,
                                        height=12,
                                        top=5,
                                        left=margin - 1,
                                        fontsize=10,
                                        letterspace=1,
                                        linespace=9,
                                        uppercase=1,
                                        state=uiconst.UI_NORMAL)
        textUserPass.rectTop = -2
        self.userpass = uicontrols.SinglelineEdit(
            name='editUserPass',
            parent=gpUserPass,
            width=EDITWIDTH,
            height=20,
            align=uiconst.TORIGHT,
            passwordCharacter='\xe2\x80\xa2')
        push = uiprimitives.Container(name='push',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      height=margin)
        gpCharName = uiprimitives.Container(name='gpCharName',
                                            parent=self.sr.main,
                                            align=uiconst.TOTOP,
                                            height=16)
        textCharName = uicontrols.Label(text='Character Name',
                                        name='textCharName',
                                        parent=gpCharName,
                                        align=uiconst.TOLEFT,
                                        height=12,
                                        top=5,
                                        left=margin - 1,
                                        fontsize=10,
                                        letterspace=1,
                                        linespace=9,
                                        uppercase=1)
        textCharName.rectTop = -2
        self.charname = uicontrols.SinglelineEdit(name='editCharName',
                                                  parent=gpCharName,
                                                  width=EDITWIDTH,
                                                  height=20,
                                                  align=uiconst.TORIGHT)
        accdetails = hasattr(prefs, 'bmaccount')
        if accdetails:
            acc = prefs.GetValue('bmaccount', None)
            try:
                if acc is not None:
                    server, user, userpass, userchar = acc.split(':')
                    self.serverip.SetValue(server)
                    self.username.SetValue(user)
                    self.userpass.SetValue(userpass)
                    self.charname.SetValue(userchar)
            except:
                server = ''
                user = ''
                userpass = ''
                userchar = ''
                sys.exc_clear()
Ejemplo n.º 8
0
    def Begin(self):
        margin = const.defaultPadding
        self.main = main = uiprimitives.Container(name='main', parent=self.sr.main, padding=margin)
        uicontrols.Frame(parent=main, color=(1.0, 1.0, 1.0, 0.2))
        uix.GetContainerHeader('Random Item Spawn', main, bothlines=0)
        COMBOPADDING = 120
        self.categories = uicontrols.Combo(parent=main, options=self.cats, select=self.config['categoryID'], name='category', align=uiconst.TOTOP, callback=self.DoCategoryChange, padding=(COMBOPADDING,
         margin,
         margin,
         0))
        txt = uicontrols.Label(text='Category', parent=self.categories, align=uiconst.CENTERLEFT, left=-COMBOPADDING + margin, fontsize=10)
        self.groups = uicontrols.Combo(parent=main, options=self.grps, select=self.config['groupID'], name='group', align=uiconst.TOTOP, callback=self.DoGroupChange, padding=(COMBOPADDING,
         margin,
         margin,
         0))
        txt = uicontrols.Label(text='Group', parent=self.groups, align=uiconst.CENTERLEFT, left=-COMBOPADDING + margin, fontsize=10)
        self.pub = uicontrols.Checkbox(text='use only published items', parent=main, configName='pub', retval=0, checked=bool(self.config['published'] == 1), groupname='published', align=uiconst.TOTOP, callback=self.DoPublishChange, padding=(margin,
         0,
         margin,
         0))
        uiprimitives.Line(parent=main, align=uiconst.TOTOP)
        self.unpub = uicontrols.Checkbox(text='use only unpublished items', parent=main, configName='unpub', retval=0, checked=bool(self.config['published'] == 0), groupname='published', align=uiconst.TOTOP, callback=self.DoPublishChange, padding=(margin,
         0,
         margin,
         0))
        self.all = uicontrols.Checkbox(text='use all items', parent=main, configName='all', retval=0, checked=bool(self.config['published'] == -1), groupname='published', align=uiconst.TOTOP, callback=self.DoPublishChange, padding=(margin,
         0,
         margin,
         0))
        uiprimitives.Line(parent=main, align=uiconst.TOTOP)
        self.multimove = uicontrols.Checkbox(text='use multimove', parent=main, configName='multimove', retval=0, checked=self.config['multimove'], groupname=None, align=uiconst.TOTOP, callback=self.DoMoveChange, padding=(margin,
         0,
         margin,
         0))
        uiprimitives.Line(parent=main, align=uiconst.TOTOP)
        for checkbox in [self.pub,
         self.unpub,
         self.all,
         self.multimove]:
            checkbox.hint = 'Changing this is <color=0xffff0000>not advised<color=0xffffffff>.<br>Proceed with caution!'

        INPUTPADDING = 170
        self.min = uicontrols.SinglelineEdit(name='minQty', setvalue=str(self.config['minQty']), ints=(1, 100), parent=main, align=uiconst.TOTOP, padding=(INPUTPADDING,
         margin,
         margin,
         0))
        txt = uicontrols.Label(text='Minimum stack size', parent=self.min, align=uiconst.CENTERLEFT, left=-INPUTPADDING + margin, fontsize=10)
        self.max = uicontrols.SinglelineEdit(name='maxQty', setvalue=str(self.config['maxQty']), ints=(1, 1000), parent=main, align=uiconst.TOTOP, padding=(INPUTPADDING,
         margin,
         margin,
         0))
        txt = uicontrols.Label(text='Maximum stack size', parent=self.max, align=uiconst.CENTERLEFT, left=-INPUTPADDING + margin, fontsize=10)
        self.number = uicontrols.SinglelineEdit(name='number', setvalue=str(self.config['number']), ints=(1, 1000), parent=main, align=uiconst.TOTOP, padding=(INPUTPADDING,
         margin,
         margin,
         0))
        txt = uicontrols.Label(text='Number of Items', parent=self.number, align=uiconst.CENTERLEFT, left=-INPUTPADDING + margin, fontsize=10)
        self.volume = uicontrols.SinglelineEdit(name='volume', setvalue=str(self.config['volume']), floats=(0, MAX_VOLUME), parent=main, align=uiconst.TOTOP, padding=(INPUTPADDING,
         margin,
         margin,
         0))
        txt = uicontrols.Label(text='Maximum item volume', parent=self.volume, align=uiconst.CENTERLEFT, left=-INPUTPADDING + margin, fontsize=10)
        self.location = uicontrols.Combo(parent=main, options=self.locs, select=self.config['location'], name='location', align=uiconst.TOTOP, callback=self.DoLocationChange, padding=(COMBOPADDING,
         margin,
         margin,
         0))
        txt = uicontrols.Label(text='Location', parent=self.location, align=uiconst.CENTERLEFT, left=-COMBOPADDING + margin, fontsize=10)
        buttons = [['Spawn',
          self.DoFormSubmit,
          None,
          81]]
        btns = uicontrols.ButtonGroup(btns=buttons, line=1, parent=main, padTop=margin)
        btn = uiutil.GetChild(btns, 'Spawn_Btn')
        if eve.session.role & service.ROLE_WORLDMOD:
            btn.hint = 'Spawn using /createitem...'
        elif eve.session.role & service.ROLE_GML:
            btn.hint = 'Spawn using /load...'
        else:
            btn.hint = 'No <b>WORLDMOD</b> or <b>GML</b> role present.'
        self.SetHeight(sum([ each.height + each.padTop + each.padBottom + each.top for each in main.children ]) + self.GetHeaderHeight() + margin * 4)