Пример #1
0
    def _build_treeview(self):
        list_store = self._build_list_store()

        treeview = gtk.TreeView(list_store)

        #create hidden id column
        col = gtk.TreeViewColumn('ID', gtk.CellRendererText(), text=0)
        col.set_visible(False)
        treeview.append_column(col)

        #create the rest of the columns
        column_names = [
            'Name', 'Created', 'Completed', 'Last Run', 'Input Filename',
            'WAV Filename', 'Default Context padding (sec)',
            'Pick Segs Randomly', 'Filters'
        ]
        for i in range(len(column_names)):
            col = gtk.TreeViewColumn(column_names[i],
                                     gtk.CellRendererText(),
                                     text=(i + 1))
            col.set_resizable(True)
            col.set_min_width(
                UIUtils.calc_treeview_col_min_width(column_names[i]))
            treeview.append_column(col)

        return treeview
Пример #2
0
    def _build_treeview(self):
        list_store = gtk.ListStore(
            gobject.TYPE_INT,
            gobject.TYPE_STRING,
            gobject.TYPE_STRING,
            gobject.TYPE_STRING,
            gobject.TYPE_STRING,
            gobject.TYPE_STRING,
        )

        db = BLLDatabase()
        check2s_list = Check2.db_select(db)

        for check2 in check2s_list:
            created = UIUtils.get_db_timestamp_str(check2.created)

            modified = '-'
            #don't display modification date if it is the same as creation date
            if check2.modified != None and check2.modified != check2.created:
                modified = UIUtils.get_db_timestamp_str(check2.modified)

            completed = '-'
            if check2.completed != None:
                completed = UIUtils.get_db_timestamp_str(check2.completed)

            list_store.append([
                check2.db_id,
                check2.csv_filename,
                check2.wav_foldername,
                completed,
                created,
                modified,
            ])

        db.close()
        treeview = gtk.TreeView(list_store)

        #create the hidden id column
        col = gtk.TreeViewColumn('ID', gtk.CellRendererText(), text=0)
        col.set_visible(False)
        treeview.append_column(col)

        #create the rest of the columns
        column_names = [
            'CSV File', 'WAV Folder', 'Completed', 'Created', 'Modified'
        ]
        for i in range(len(column_names)):
            col = gtk.TreeViewColumn(column_names[i],
                                     gtk.CellRendererText(),
                                     text=(i + 1))
            col.set_resizable(True)
            col.set_min_width(
                UIUtils.calc_treeview_col_min_width(column_names[i]))
            treeview.append_column(col)

        return treeview
Пример #3
0
    def _build_treeview(self):
        list_store = self._build_list_store()
        treeview = gtk.TreeView(list_store)

        col_names = ['Name', 'Description', 'Created', 'Outputs']
        for i in range(len(col_names)):
            col = gtk.TreeViewColumn(col_names[i],
                                     gtk.CellRendererText(),
                                     text=(i))
            col.set_resizable(True)
            col.set_min_width(UIUtils.calc_treeview_col_min_width(
                col_names[i]))
            treeview.append_column(col)

        return treeview
Пример #4
0
    def _build_outputs_treeview(self, existing_outputs=[]):
        list_store = self._build_list_store(existing_outputs)
        treeview = gtk.TreeView(list_store)

        #don't create any column for the PYOBJECT, which is the first element of the list_store rows
        col_names = ['Name', 'Description', 'Link Segs', 'Filters']
        for i in range(len(col_names)):
            col = gtk.TreeViewColumn(col_names[i],
                                     gtk.CellRendererText(),
                                     text=i)
            col.set_resizable(True)
            col.set_min_width(UIUtils.calc_treeview_col_min_width(
                col_names[i]))
            treeview.append_column(col)

        return treeview