예제 #1
0
 def buildPane(self):
     ''' '''
     minutes = ['00', '15', '30', '45']
     windows, sections, hour = 96, 3, 0
     l = pyqt.QHBoxLayout()
     for section in range(sections):
         l0 = pyqt.QVBoxLayout()
         cnt = 1
         for i in range(int(windows / sections)):
             thour = str(hour)
             if len(str(hour)) == 1:
                 thour = f'0{hour}'
             minute = minutes[i % 4]
             if log: print('TODO Action', self.config.dikt)
             l1 = pyqt.QHBoxLayout()
             l1.addWidget(annotations.NchantdLabel(f'{thour}:{minute}'))
             l1.addWidget(annotations.NchantdEntryBox(self).initWidget())
             l0.addLayout(l1)
             if cnt == 4:
                 hour += 1
                 cnt = 0
             cnt += 1
         l.addLayout(l0)
     self.setLayout(l)
     return self
예제 #2
0
 def __init__(self, parent=None, cfg={}):
     ''' '''
     self.config = condor.instruct(pxcfg).override(cfg)
     self.config.select('NchantdSubmissionButtons')
     if parent:
         self.config.override(parent.config)
     self.parent = parent
     pyqt.QWidget.__init__(self)
     self.layout = pyqt.QHBoxLayout()
     if log: print('Nchantd Submission Buttons', self.config.dikt)
     self.config.dikt['buttons']['new']['text'] = 'New'
     self.newbutton = NchantdButton(self,
                                    self.config.dikt['buttons']['new'])
     self.newbutton.initWidget()
     self.layout.addWidget(self.newbutton)
     self.config.dikt['buttons']['submit']['text'] = 'Submit'
     self.submitbutton = NchantdButton(
         self, self.config.dikt['buttons']['submit'])
     self.submitbutton.initWidget()
     self.layout.addWidget(self.submitbutton)
     self.config.dikt['buttons']['delete']['text'] = 'Delete'
     self.deletebutton = NchantdButton(
         self, self.config.dikt['buttons']['delete'])
     self.deletebutton.initWidget()
     self.layout.addWidget(self.deletebutton)
     self.setLayout(self.layout)
예제 #3
0
    def initView(self):  #															||
        '''Initialize UI setting the main application layout and building
		 	landing widgets'''
        dtop = self.config.dikt['gui']['desktop']  #										||
        self.parent.main.setWindowTitle(dtop['title'])  #								||
        self.parent.main.setGeometry(
            dtop['size']['left'],
            dtop['size']['top'],  #		||
            dtop['size']['width'],
            dtop['size']['height'])  #		||
        #self.parent.main.setMaximumSize(1000, 1000)
        importTheme(self.parent.main)  #								||
        self.mainWDGT = pyqt.QWidget(self.parent.main)  #							||
        self.layout = pyqt.QHBoxLayout(self.mainWDGT)  #									||
        #self.layout = pyqt.QGridLayout(self.mainWDGT)
        self.parent.main.setCentralWidget(self.mainWDGT)  #						||
        #url = f'{here}/data/img/worldofnfts.png'
        #self.parent.main.setStyleSheet(f"background-image: url({url});")
        self.parent.main.setAttribute(pyqt.Qt.WA_DeleteOnClose)  #							||
        self.parent.main.setAutoFillBackground(True)  #										||
        self.parent.main.MaxRecentFiles = 10  #												||
        self.parent.main.windowList = []  #													||
        self.parent.main.recentFileActs = []  #												||
        if dtop['menubar']:
            self.initMenuBar(dtop['menubar'])
        if dtop.get('toolbars'):
            self.initToolBars(dtop['toolbars'])
        return self
예제 #4
0
 def buildTab(self):
     ''' '''
     self.editors = {}
     self.forms = {}
     layout_b = pyqt.QVBoxLayout()
     labels = [
         'Yesterday - Monday 2022/01/30', 'Today - Tuesday 2022/01/31',
         'Tommorrow - Wednesday 2022/02/01', 'Thursday 2022/02/02',
         'Friday 2022/02/03', 'Saturday 2022/01/04', 'Sunday 2022/01/05',
         'Monday 2022/01/06 - Sunday 2022/01/13',
         'Monday 2022/01/06 - Sunday 2022/01/13',
         'Monday 2022/01/06 - Sunday 2022/01/13',
         'Monday 2022/01/06 - Sunday 2022/01/13'
     ]
     cnt = 0
     for label in labels:
         layout_b.addWidget(annotations.NchantdLabel(label))
         self.editors[cnt] = editors.NchandDocEditor(self).initWidget()
         layout_b.addWidget(self.editors[cnt])
         cnt += 1
     layout_c = pyqt.QVBoxLayout()
     self.forms[0] = NchantdTODOEntryForm(self).initWidget()
     self.editors[cnt] = editors.NchandDocEditor(self).initWidget()
     layout_c.addWidget(self.editors[cnt])
     layout_a = pyqt.QHBoxLayout()
     layout_a.addWidget(layout_b)
     layout_a.addWidget(layout_c)
     return self
예제 #5
0
    def __init__(self, cfg: dict = {}):
        ''' '''
        self.config = condor.instruct(pxcfg)
        self.config.select('nchantdrecordnavigationtoolbar').override(cfg)
        super(NchantdRecordNavigationToolbar, self).__init__()

        self.model = NchantdTableModel(app, self.config.dikt, parent)

        self.layout = pyqt.QHBoxLayout()
        self.config.dikt['text'] = 'Backward'
        self.backBTN = NchantdToolButton(self, self.config.dikt['text'])
        self.backBTN.clicked.connect(self.prevRecord())
        self.layout.addWidget(self.backBTN)
        self.config.dikt['Label'] = 'Go To:'
        self.gotoLineEditor = NchantdLineEditor()
        self.layout.addWidget(self.gotoLineEditor)
        self.goBTN = NchantdButton()
        self.goBTN.clicked.connect(self.findRecord())
        self.layout.addWidget(self.goBTN)
        self.config.dikt['text'] = 'Forward'
        self.foreBTN = NchantdToolButton(self, self.config.dikt['text'])
        self.foreBTN.clicked.connect(self.nextRecord)
        self.layout.addWidget(self.foreBTN)
        self.setLayout(self.layout)