From 831a1031b14f4899905e54dd94fdff5d263eb609 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 13 Aug 2010 17:06:00 +0200 Subject: Implemented editing of file part numbers Added the possibility to edit file part numbers via context menu in FilesTreeWidget. This action triggers the edit event on the specific QModelIndex. --- filestreewidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'filestreewidget.cpp') diff --git a/filestreewidget.cpp b/filestreewidget.cpp index 2b28c93..4542ea8 100644 --- a/filestreewidget.cpp +++ b/filestreewidget.cpp @@ -200,6 +200,14 @@ void FilesTreeWidget::editQuality(){ } } +void FilesTreeWidget::editPart(){ + QModelIndex current = mView->selectionModel()->currentIndex(); + if(current.isValid()){ + QModelIndex qualityIndex = mView->model()->index(current.row(), FilesTreeModel::PartNo, current.parent()); + mView->edit(qualityIndex); + } +} + void FilesTreeWidget::fileSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous){ Q_UNUSED(previous); int seriesPartId = current.data(FilesTreeModel::SeriesPartIdRole).toInt(); -- cgit v1.2.3-70-g09d2