}
@SuppressWarnings("unused")
private void editPressed() {
WatchFolderRecord record = new WatchFolderRecord();
QModelIndex index = table.currentIndex();
int row = index.row();
QTableWidgetItem item = table.item(row, 0);
record.folder = item.text();
item = table.item(row, 1);
record.notebook = item.text();
item = table.item(row,2);
if (item.data(ItemDataRole.UserRole).toString().equalsIgnoreCase("keep"))
record.keep = true;
else
record.keep = false;
WatchFolderAdd dialog = new WatchFolderAdd(record, notebooks);
dialog.exec();
if (dialog.okClicked()) {
String dir = dialog.directory.text();
String notebook = dialog.books.currentText();
boolean keep;
int idx = dialog.keep.currentIndex();
if (dialog.keep.itemData(idx, ItemDataRole.UserRole).toString().equalsIgnoreCase("keep"))
keep = true;
else
keep = false;
table.removeRow(row);
table.insertRow(table.rowCount());
addRow(table.rowCount()-1, dir, notebook, keep);
WatchFolderRecord newRecord = new WatchFolderRecord();
newRecord.folder = dir;
newRecord.notebook = notebook;
newRecord.keep = keep;
records.add(newRecord);
}