summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/ScreenshotDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/dialogs/ScreenshotDialog.cpp')
-rw-r--r--gui/dialogs/ScreenshotDialog.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/gui/dialogs/ScreenshotDialog.cpp b/gui/dialogs/ScreenshotDialog.cpp
new file mode 100644
index 00000000..662c9e84
--- /dev/null
+++ b/gui/dialogs/ScreenshotDialog.cpp
@@ -0,0 +1,28 @@
+#include "ScreenshotDialog.h"
+#include "ui_ScreenshotDialog.h"
+#include "QModelIndex"
+
+ScreenshotDialog::ScreenshotDialog(ScreenshotList *list, QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::ScreenshotDialog),
+ m_list(list)
+{
+ ui->setupUi(this);
+ ui->listView->setModel(m_list);
+}
+
+ScreenshotDialog::~ScreenshotDialog()
+{
+ delete ui;
+}
+
+QList<ScreenShot*> ScreenshotDialog::selected()
+{
+ QList<ScreenShot*> list;
+ QList<ScreenShot*> first = m_list->screenshots();
+ for (QModelIndex index : ui->listView->selectionModel()->selectedIndexes())
+ {
+ list.append(first.at(index.row()));
+ }
+ return list;
+}