From 4a77524b059c12165e20b38de6c0d4ed08e56419 Mon Sep 17 00:00:00 2001 From: robotbrain Date: Sun, 23 Feb 2014 16:14:24 -0500 Subject: Initial stuff. It doesnt work. --- gui/dialogs/ScreenshotDialog.cpp | 28 ++++++++++++ gui/dialogs/ScreenshotDialog.h | 29 +++++++++++++ gui/dialogs/ScreenshotDialog.ui | 93 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 gui/dialogs/ScreenshotDialog.cpp create mode 100644 gui/dialogs/ScreenshotDialog.h create mode 100644 gui/dialogs/ScreenshotDialog.ui (limited to 'gui/dialogs') 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 ScreenshotDialog::selected() +{ + QList list; + QList first = m_list->screenshots(); + for (QModelIndex index : ui->listView->selectionModel()->selectedIndexes()) + { + list.append(first.at(index.row())); + } + return list; +} diff --git a/gui/dialogs/ScreenshotDialog.h b/gui/dialogs/ScreenshotDialog.h new file mode 100644 index 00000000..d3f629e7 --- /dev/null +++ b/gui/dialogs/ScreenshotDialog.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include "logic/lists/ScreenshotList.h" + +class BaseInstance; + +namespace Ui +{ +class ScreenshotDialog; +} + +class ScreenshotDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ScreenshotDialog(ScreenshotList *list, QWidget *parent = 0); + ~ScreenshotDialog(); + + QList selected(); + +private +slots: + +private: + Ui::ScreenshotDialog *ui; + ScreenshotList *m_list; +}; diff --git a/gui/dialogs/ScreenshotDialog.ui b/gui/dialogs/ScreenshotDialog.ui new file mode 100644 index 00000000..c912dffe --- /dev/null +++ b/gui/dialogs/ScreenshotDialog.ui @@ -0,0 +1,93 @@ + + + ScreenshotDialog + + + + 0 + 0 + 470 + 300 + + + + Dialog + + + + + 10 + 260 + 441 + 31 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 439 + 241 + + + + QAbstractItemView::MultiSelection + + + + 480 + 360 + + + + QListView::LeftToRight + + + true + + + QListView::ListMode + + + + + + + buttonBox + accepted() + ScreenshotDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ScreenshotDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + -- cgit