summaryrefslogtreecommitdiffstats
path: root/vmchooser2/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vmchooser2/dialog.cpp')
-rw-r--r--vmchooser2/dialog.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/vmchooser2/dialog.cpp b/vmchooser2/dialog.cpp
deleted file mode 100644
index e3de820..0000000
--- a/vmchooser2/dialog.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "dialog.h"
-#include "ui_dialog.h"
-#include "model.h"
-#include "inc/DataEntry.h"
-#include "inc/functions.h"
-
-Dialog::Dialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::Dialog)
-{
- ui->setupUi(this);
- //QAbstractListModel *data = new Model(1000, ui->listView);
- //ui->listView->setModel(data);
-}
-
-Dialog::~Dialog()
-{
- delete ui;
-}
-
-void Dialog::changeEvent(QEvent *e)
-{
- QDialog::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-
-void Dialog::on_listView_activated(QModelIndex index)
-{
- //TODO handle failures
- printf ("Item %d has been activated\n", index.row());
- //TODO get rid of this->entries, storing them in the model should be enough
- // alternatively use references instead of copies?
- runImage(this->entries.at(index.row()));
- close();
-}
-
-void Dialog::addItems(const std::vector<DataEntry>& entries) {
- // TODO: this is not the right way to do this
- // we probably do not need a copy of the entries vector in Dialog and Model
- this->entries = entries;
- QAbstractListModel *data = new Model(entries, ui->listView);
- ui->listView->setModel(data);
-}
-
-void Dialog::on_pushButtonAbort_clicked()
-{
- close();
-}
-
-void Dialog::on_pushButtonStart_clicked()
-{
- // TODO: check if a model is selected
- this->on_listView_activated(ui->listView->selectionModel()->currentIndex());
-}