summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2009-11-30 15:03:50 +0000
committerdeva <deva>2009-11-30 15:03:50 +0000
commit6e715b6a7816d5db31c0078cf99d13aaf811472f (patch)
tree352e27e414d73b595d6304a3b0f44ad9bf7df03a
parentbb8e2b6be1c05fc41132724d1f48a285f104418c (diff)
Some gui cleanups
-rw-r--r--dgedit/filelist.cc7
-rw-r--r--dgedit/filelist.h2
-rw-r--r--dgedit/mainwindow.cc10
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()));