diff options
-rw-r--r-- | dgedit/filelist.cc | 7 | ||||
-rw-r--r-- | dgedit/filelist.h | 2 | ||||
-rw-r--r-- | dgedit/mainwindow.cc | 10 |
3 files changed, 10 insertions, 9 deletions
diff --git a/dgedit/filelist.cc b/dgedit/filelist.cc index 52e6757..aca1f5d 100644 --- a/dgedit/filelist.cc +++ b/dgedit/filelist.cc @@ -31,7 +31,8 @@ FileList::FileList() { - connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); + connect(this, SIGNAL(itemDoubleClicked(QListWidgetItem *)), + this, SLOT(selectionChanged(QListWidgetItem *))); } void FileList::addFiles() @@ -55,8 +56,8 @@ void FileList::addFiles() } } -void FileList::selectionChanged() +void FileList::selectionChanged(QListWidgetItem *item) { - QString filename = currentItem()->text(); + QString filename = item->text(); emit masterFileChanged(filename); } diff --git a/dgedit/filelist.h b/dgedit/filelist.h index b1b47a8..e148203 100644 --- a/dgedit/filelist.h +++ b/dgedit/filelist.h @@ -43,7 +43,7 @@ public slots: void addFiles(); private slots: - void selectionChanged(); + void selectionChanged(QListWidgetItem *item); }; diff --git a/dgedit/mainwindow.cc b/dgedit/mainwindow.cc index 390c436..e125dec 100644 --- a/dgedit/mainwindow.cc +++ b/dgedit/mainwindow.cc @@ -105,13 +105,9 @@ MainWindow::MainWindow() exportsel->setText("Export"); connect(exportsel, SIGNAL(clicked()), this, SLOT(doExport())); - QPushButton *loadbtn = new QPushButton(); - loadbtn->setText("Add files..."); - btns->addWidget(autosel); btns->addWidget(clearsel); btns->addWidget(exportsel); - btns->addWidget(loadbtn); QVBoxLayout *configs = new QVBoxLayout(); @@ -131,7 +127,11 @@ MainWindow::MainWindow() exportp->setText("/home/deva/tmp/drumgizmoexport"); configs->addWidget(exportp); - configs->addWidget(new QLabel("Files:")); + QPushButton *loadbtn = new QPushButton(); + loadbtn->setText("Add files..."); + configs->addWidget(loadbtn); + + configs->addWidget(new QLabel("Files: (double-click to set as master)")); filelist = new FileList(); connect(filelist, SIGNAL(masterFileChanged(QString)), this, SLOT(loadFile(QString))); connect(loadbtn, SIGNAL(clicked()), filelist, SLOT(addFiles())); |