diff options
author | robotbrain <robotbrainify@gmail.com> | 2014-02-23 16:14:24 -0500 |
---|---|---|
committer | robotbrain <robotbrainify@gmail.com> | 2014-02-23 16:14:24 -0500 |
commit | 4a77524b059c12165e20b38de6c0d4ed08e56419 (patch) | |
tree | 72212e305886d4cf37a387bb816b3397a0e56e31 /gui/dialogs | |
parent | 5cf599673db88b39100ffca78e10bbe5e10200d7 (diff) | |
download | PrismLauncher-4a77524b059c12165e20b38de6c0d4ed08e56419.tar.gz PrismLauncher-4a77524b059c12165e20b38de6c0d4ed08e56419.tar.bz2 PrismLauncher-4a77524b059c12165e20b38de6c0d4ed08e56419.zip |
Initial stuff. It doesnt work.
Diffstat (limited to 'gui/dialogs')
-rw-r--r-- | gui/dialogs/ScreenshotDialog.cpp | 28 | ||||
-rw-r--r-- | gui/dialogs/ScreenshotDialog.h | 29 | ||||
-rw-r--r-- | gui/dialogs/ScreenshotDialog.ui | 93 |
3 files changed, 150 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; +} 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 <QDialog> +#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<ScreenShot *> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ScreenshotDialog</class> + <widget class="QDialog" name="ScreenshotDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>470</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="geometry"> + <rect> + <x>10</x> + <y>260</y> + <width>441</width> + <height>31</height> + </rect> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + <widget class="QListView" name="listView"> + <property name="geometry"> + <rect> + <x>10</x> + <y>10</y> + <width>439</width> + <height>241</height> + </rect> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::MultiSelection</enum> + </property> + <property name="iconSize"> + <size> + <width>480</width> + <height>360</height> + </size> + </property> + <property name="flow"> + <enum>QListView::LeftToRight</enum> + </property> + <property name="isWrapping" stdset="0"> + <bool>true</bool> + </property> + <property name="viewMode"> + <enum>QListView::ListMode</enum> + </property> + </widget> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>ScreenshotDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>ScreenshotDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> |