Ejemplo n.º 1
0
    def doUI(self):
        # size
        self.resize(self.lw+self.lh,self.lh*2+self.ls*4)

        # toolbar buttons
        self.toolbar = self.addToolBar('nan')
        self.toolbar.setMovable(False)

        homeAction = gui.QAction(gui.QIcon('resources\\images\\home.png'),'Home',self)
        homeAction.setShortcut('Ctrl+H')
        homeAction.triggered.connect(self.home)

        upAction = gui.QAction(gui.QIcon('resources\\images\\up.png'),'Up',self)
        upAction.setShortcut('Ctrl+U')
        upAction.triggered.connect(self.up)

        searchAction = gui.QAction(gui.QIcon('resources\\images\\search.png'),'Search',self)
        searchAction.setShortcut('Ctrl+F')
        searchAction.triggered.connect(self.search)

        self.toolbar.addAction(homeAction)
        self.toolbar.addAction(upAction)
        self.toolbar.addAction(searchAction)

        # current directory label
        self.label_dir = simpleText(self,"current dir: root",[0,self.th,self.lw,self.ls])

        # current directory list
        dir_contents = self.dv.dir()
        self.label_folders = simpleText(self,"Folders",[0,self.th+self.ls*1,self.lw,self.ls])
        self.list_folders  = simpleList(self,[0,self.th+self.ls*2+self.lh*0,self.lw,self.lh],dir_contents[0])
        self.list_folders.itemDoubleClicked.connect(self.goto_folder)
        
        self.label_folders = simpleText(self,"Files",[0,self.th+self.ls*3+self.lh,self.lw,self.ls])
        self.list_files    = simpleList(self,[0,self.th+self.ls*4+self.lh*1,self.lw,self.lh],dir_contents[1])

        # folder info
        self.label_folder_info = simpleText(self,"Folder info",[self.lw+self.ls,self.th+self.ls*1,self.lw,self.ls])
        self.folder_info       = simpleList(self,              [self.lw+self.ls,self.th+self.ls*2,self.lw,self.lh],[])

        # file info
        self.label_file_info = simpleText(self,"File info",[self.lw+self.ls,self.th+self.ls*3+self.lh,self.lw-self.bl,self.ls])
        self.file_info       = simpleList(self,            [self.lw+self.ls,self.th+self.ls*4+self.lh,self.lw,self.lh],[])

        # Details button
        self.button_show_details = queryButton('Show details',self,'',[self.lw*2+self.ls-self.bl,self.th+self.ls*3+self.lh],self.show_details)

        # window title
        self.setWindowTitle("Data Vault Explorer")
        
        self.resize(self.lw*2 + self.ls,self.lh*2 + self.ls*4 + self.th)
        self.show()
        
        self.timer = core.QTimer(self)
        self.timer.setInterval(25)
        self.timer.timeout.connect(self.timer_event)
        self.timer.start()

        self.selected_folder = ""
        self.selected_file   = ""
Ejemplo n.º 2
0
    def doUI(self):
        self.label_searchfor = simpleText(self, 'Search for:',
                                          [0, 0, self.bw, self.ls])
        self.cb_files = checkBox(self, 'files', [0, self.ls * 1])
        self.cb_folders = checkBox(self, 'folders', [0, self.ls * 2])
        self.button_go = queryButton("Search", self, '', [0, self.ls * 3],
                                     self.go)
        self.setWindowTitle("Data Vault search engine")

        # list edits
        self.s_tags = stringListEdit(self, 'In tags',
                                     [self.lew * 1, self.leh * 0])
        self.s_filename = stringListEdit(self, 'In name',
                                         [self.lew * 2, self.leh * 0])

        self.s_units = stringListEdit(self, 'has units',
                                      [self.lew * 0, self.leh * 1])
        self.s_varname = stringListEdit(self, 'Variable name',
                                        [self.lew * 0, self.leh * 2])

        self.s_param_name = stringListEdit(self, "Parameter name",
                                           [self.lew * 1, self.leh * 1])
        self.s_param_units = stringListEdit(self, "Parameter units",
                                            [self.lew * 1, self.leh * 2])

        self.s_in_comment = stringListEdit(self, "In comment",
                                           [self.lew * 2, self.leh * 1])
        self.s_comment_user = stringListEdit(self, "Has comment user",
                                             [self.lew * 2, self.leh * 2])

        self.show()
Ejemplo n.º 3
0
    def doUI(self):
        self.cbEnabled   = checkBox(self,self.cbLabel,[0,0])
        self.activeList  = simpleList(self,[0,self.ch,self.lw,self.lh],[])
        self.inputString = simpleText(self,"",[0,self.ch+self.lh,self.lw-self.bw,self.ls])
        self.inputString.setReadOnly(False)

        self.buttonAdd = queryButton('remove',self,'',[self.lw,self.ch]                ,self.rem)
        self.buttonRem = queryButton('clear' ,self,'',[self.lw,self.lh+self.ch-self.ls],self.clr)
        self.buttonClr = queryButton('add'   ,self,'',[self.lw-self.bw,self.lh+self.ch],self.add)
Ejemplo n.º 4
0
    def doUI(self):
        self.cbEnabled = checkBox(self, self.cbLabel, [0, 0])
        self.activeList = simpleList(self, [0, self.ch, self.lw, self.lh], [])
        self.inputString = simpleText(
            self, "", [0, self.ch + self.lh, self.lw - self.bw, self.ls])
        self.inputString.setReadOnly(False)

        self.buttonAdd = queryButton('remove', self, '', [self.lw, self.ch],
                                     self.rem)
        self.buttonRem = queryButton('clear', self, '',
                                     [self.lw, self.lh + self.ch - self.ls],
                                     self.clr)
        self.buttonClr = queryButton('add', self, '',
                                     [self.lw - self.bw, self.lh + self.ch],
                                     self.add)
Ejemplo n.º 5
0
    def doUI(self):
        self.label_searchfor = simpleText(self,'Search for:',[0,0,self.bw,self.ls])
        self.cb_files   = checkBox(self,'files'  ,[0,self.ls*1])
        self.cb_folders = checkBox(self,'folders',[0,self.ls*2])
        self.button_go  = queryButton("Search",self,'',[0,self.ls*3],self.go)
        self.setWindowTitle("Data Vault search engine")

        # list edits
        self.s_tags     = stringListEdit(self,'In tags',[self.lew*1,self.leh*0])
        self.s_filename = stringListEdit(self,'In name',[self.lew*2,self.leh*0])

        self.s_units    = stringListEdit(self,'has units'    ,[self.lew*0,self.leh*1])
        self.s_varname  = stringListEdit(self,'Variable name',[self.lew*0,self.leh*2])

        self.s_param_name   = stringListEdit(self,"Parameter name"  ,[self.lew*1,self.leh*1])
        self.s_param_units  = stringListEdit(self,"Parameter units" ,[self.lew*1,self.leh*2])
        
        self.s_in_comment   = stringListEdit(self,"In comment"      ,[self.lew*2,self.leh*1])
        self.s_comment_user = stringListEdit(self,"Has comment user",[self.lew*2,self.leh*2])

        self.show()
Ejemplo n.º 6
0
    def doUI(self):
        # size
        self.resize(self.lw + self.lh, self.lh * 2 + self.ls * 4)

        # toolbar buttons
        self.toolbar = self.addToolBar('nan')
        self.toolbar.setMovable(False)

        homeAction = gui.QAction(gui.QIcon('resources\\images\\home.png'),
                                 'Home', self)
        homeAction.setShortcut('Ctrl+H')
        homeAction.triggered.connect(self.home)

        upAction = gui.QAction(gui.QIcon('resources\\images\\up.png'), 'Up',
                               self)
        upAction.setShortcut('Ctrl+U')
        upAction.triggered.connect(self.up)

        searchAction = gui.QAction(gui.QIcon('resources\\images\\search.png'),
                                   'Search', self)
        searchAction.setShortcut('Ctrl+F')
        searchAction.triggered.connect(self.search)

        self.toolbar.addAction(homeAction)
        self.toolbar.addAction(upAction)
        self.toolbar.addAction(searchAction)

        # current directory label
        self.label_dir = simpleText(self, "current dir: root",
                                    [0, self.th, self.lw, self.ls])

        # current directory list
        dir_contents = self.dv.dir()
        self.label_folders = simpleText(
            self, "Folders", [0, self.th + self.ls * 1, self.lw, self.ls])
        self.list_folders = simpleList(
            self, [0, self.th + self.ls * 2 + self.lh * 0, self.lw, self.lh],
            dir_contents[0])
        self.list_folders.itemDoubleClicked.connect(self.goto_folder)

        self.label_folders = simpleText(
            self, "Files",
            [0, self.th + self.ls * 3 + self.lh, self.lw, self.ls])
        self.list_files = simpleList(
            self, [0, self.th + self.ls * 4 + self.lh * 1, self.lw, self.lh],
            dir_contents[1])

        # folder info
        self.label_folder_info = simpleText(
            self, "Folder info",
            [self.lw + self.ls, self.th + self.ls * 1, self.lw, self.ls])
        self.folder_info = simpleList(
            self, [self.lw + self.ls, self.th + self.ls * 2, self.lw, self.lh],
            [])

        # file info
        self.label_file_info = simpleText(self, "File info", [
            self.lw + self.ls, self.th + self.ls * 3 + self.lh,
            self.lw - self.bl, self.ls
        ])
        self.file_info = simpleList(self, [
            self.lw + self.ls, self.th + self.ls * 4 + self.lh, self.lw,
            self.lh
        ], [])

        # Details button
        self.button_show_details = queryButton(
            'Show details', self, '',
            [self.lw * 2 + self.ls - self.bl, self.th + self.ls * 3 + self.lh],
            self.show_details)

        # window title
        self.setWindowTitle("Data Vault Explorer")

        self.resize(self.lw * 2 + self.ls, self.lh * 2 + self.ls * 4 + self.th)
        self.show()

        self.timer = core.QTimer(self)
        self.timer.setInterval(25)
        self.timer.timeout.connect(self.timer_event)
        self.timer.start()

        self.selected_folder = ""
        self.selected_file = ""