-void ProjectListView::editItem(QTreeWidgetItem * item, int column) {
- kDebug() << "//////////////// EDIT ITEM, COL: " << column;
+
+void ProjectListView::configureColumns(const QPoint& pos) {
+ KMenu popup(this);
+ popup.addTitle(i18nc("@title:menu", "Columns"));
+
+ QHeaderView* headerView = header();
+ for (int i = 2; i < headerView->count(); ++i) {
+ const int logicalIndex = headerView->logicalIndex(i);
+ const QString text = model()->headerData(i, Qt::Horizontal).toString();
+ QAction* action = popup.addAction(text);
+ action->setCheckable(true);
+ action->setChecked(!headerView->isSectionHidden(logicalIndex));
+ action->setData(i);
+ }
+
+ QAction* activatedAction = popup.exec(header()->mapToGlobal(pos));
+ if (activatedAction != 0) {
+ const bool show = activatedAction->isChecked();
+
+ // remember the changed column visibility in the settings
+ const int columnIndex = activatedAction->data().toInt();
+ switch (columnIndex) {
+ case 2:
+ KdenliveSettings::setShowdescriptioncolumn(show);
+ break;
+ case 3:
+ KdenliveSettings::setShowratingcolumn(show);
+ break;
+ default:
+ break;
+ }
+
+ // apply the changed column visibility
+ if (show) {
+ showColumn(columnIndex);
+ } else {
+ hideColumn(columnIndex);
+ }
+ }