예제 #1
0
파일: columns.py 프로젝트: mrabbitt/calibre
 def add_custcol(self):
     model = self.gui.library_view.model()
     CreateCustomColumn(self, None, None, model.orig_headers, ALL_COLUMNS)
     if self.cc_column_key is None:
         return
     row = self.opt_columns.rowCount()
     self.opt_columns.setRowCount(row + 1)
     self.setup_row(self.field_metadata, row, self.cc_column_key)
     self.changed_signal.emit()
예제 #2
0
 def edit_custcol(self):
     model = self.gui.library_view.model()
     row = self.opt_columns.currentRow()
     try:
         key = unicode(self.opt_columns.item(row, 0).data(Qt.UserRole))
     except:
         key = ''
     CreateCustomColumn(self, row, key, model.orig_headers, ALL_COLUMNS)
     if self.cc_column_key is None:
         return
     self.setup_row(self.field_metadata, row, self.cc_column_key)
     self.changed_signal.emit()
예제 #3
0
 def edit_custcol(self):
     model = self.gui.library_view.model()
     row = self.opt_columns.currentRow()
     try:
         key = str(self.opt_columns.item(row, 0).data(Qt.ItemDataRole.UserRole))
     except:
         key = ''
     CreateCustomColumn(self.gui, self, key, model.orig_headers)
     if self.cc_column_key is None:
         return
     self.setup_row(self.field_metadata, row, self.cc_column_key,
                    None if self.cc_column_key == key else key)
     self.changed_signal.emit()
예제 #4
0
 def edit_custcol(self):
     model = self.gui.library_view.model()
     CreateCustomColumn(self, True, model.orig_headers, ALL_COLUMNS)
     self.changed_signal.emit()