--- /dev/null
+#include "episodevotedialog.h"
+#include "ui_episodevotedialog.h"
+
+EpisodeVoteDialog::EpisodeVoteDialog(QWidget *parent) :
+ QDialog(parent),
+ m_ui(new Ui::EpisodeVoteDialog)
+{
+ m_ui->setupUi(this);
+}
+
+EpisodeVoteDialog::~EpisodeVoteDialog()
+{
+ delete m_ui;
+}
+
+int EpisodeVoteDialog::vote() const
+{
+ return qBound(1, int(tm_ui->vote.value() * 10.0), 100);
+}
+
+void EpisodeVoteDialog::setVote(int value)
+{
+ m_ui->vote->setValue(double(value) / 10.0);
+}
+
+void EpisodeVoteDialog::changeEvent(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ m_ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
--- /dev/null
+#ifndef EPISODEVOTEDIALOG_H
+#define EPISODEVOTEDIALOG_H
+
+#include <QtGui/QDialog>
+
+namespace Ui {
+ class EpisodeVoteDialog;
+}
+
+class EpisodeVoteDialog : public QDialog {
+ Q_OBJECT
+ Q_DISABLE_COPY(EpisodeVoteDialog)
+public:
+ explicit EpisodeVoteDialog(QWidget *parent = 0);
+ virtual ~EpisodeVoteDialog();
+
+protected:
+ virtual void changeEvent(QEvent *e);
+
+private:
+ Ui::EpisodeVoteDialog *m_ui;
+};
+
+#endif // EPISODEVOTEDIALOG_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>EpisodeVoteDialog</class>
+ <widget class="QDialog" name="EpisodeVoteDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>134</width>
+ <height>65</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Ep Vote</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Vote:</string>
+ </property>
+ <property name="buddy">
+ <cstring>doubleSpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="doubleSpinBox">
+ <property name="minimum">
+ <double>1.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>10.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>0.500000000000000</double>
+ </property>
+ <property name="value">
+ <double>5.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>doubleSpinBox</tabstop>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>EpisodeVoteDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>129</x>
+ <y>50</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>133</x>
+ <y>64</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>EpisodeVoteDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>129</x>
+ <y>56</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>133</x>
+ <y>64</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>