From 373de0f137e4b7f7e8b348cabd6151573bd80a74 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 30 Nov 2009 19:16:33 +0000 Subject: Graphical identification of the current master file. --- dgedit/filelist.cc | 12 +++++++++--- dgedit/icons/file.png | Bin 0 -> 173 bytes dgedit/icons/master.png | Bin 0 -> 325 bytes 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 dgedit/icons/file.png create mode 100644 dgedit/icons/master.png diff --git a/dgedit/filelist.cc b/dgedit/filelist.cc index aca1f5d..5326eef 100644 --- a/dgedit/filelist.cc +++ b/dgedit/filelist.cc @@ -38,7 +38,7 @@ FileList::FileList() void FileList::addFiles() { QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"), - "", tr("Audio Files (*.wav)")); + "", tr("Audio Files (*.wav)")); QStringList::Iterator i = files.begin(); while(i != files.end()) { QString file = *i; @@ -48,6 +48,7 @@ void FileList::addFiles() QListWidgetItem *item = new QListWidgetItem(); item->setText(file); item->setData(Qt::UserRole, name); + item->setIcon(QPixmap("icons/file.png")); addItem(item); emit fileAdded(file, name); @@ -56,8 +57,13 @@ void FileList::addFiles() } } -void FileList::selectionChanged(QListWidgetItem *item) +void FileList::selectionChanged(QListWidgetItem *i) { - QString filename = item->text(); + QString filename = i->text(); + + for(int idx = 0; idx < count(); idx++) + item(idx)->setIcon(QPixmap("icons/file.png")); + + i->setIcon(QPixmap("icons/master.png")); emit masterFileChanged(filename); } diff --git a/dgedit/icons/file.png b/dgedit/icons/file.png new file mode 100644 index 0000000..fc8fc40 Binary files /dev/null and b/dgedit/icons/file.png differ diff --git a/dgedit/icons/master.png b/dgedit/icons/master.png new file mode 100644 index 0000000..27fe9c4 Binary files /dev/null and b/dgedit/icons/master.png differ -- cgit v1.2.3