Sun, 11 Aug 2013 03:05:24 +0300
added missing files
src/prompts.cpp | file | annotate | diff | comparison | revisions | |
src/prompts.h | file | annotate | diff | comparison | revisions | |
src/ui/unknownversion.ui | file | annotate | diff | comparison | revisions |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/prompts.cpp Sun Aug 11 03:05:24 2013 +0300 @@ -0,0 +1,55 @@ +#include "prompts.h" +#include "ui_unknownversion.h" +#include "misc.h" +#include "build/moc_prompts.cpp" +#include "config.h" + +// ============================================================================= +// ----------------------------------------------------------------------------- +UnknownVersionPrompt::UnknownVersionPrompt ( + str fileName, + str binaryName, + bool isRelease, + QWidget* parent, + Qt::WindowFlags f +) : + QDialog (parent, f), + m_binaryString (binaryName), + m_isRelease (isRelease) +{ + ui = new Ui_UnknownVersion; + ui->setupUi (this); + + // Replace the placeholders + str text = ui->m_description->text(); + text.replace ("<DEMO>", basename (fileName)); + text.replace ("<VERSION>", binaryName); + ui->m_description->setText (text); + + connect (ui->m_addVersion, SIGNAL (clicked(bool)), this, SLOT (addBinary())); + connect (ui->m_findBinary, SIGNAL (clicked(bool)), this, SLOT (findBinary())); +} + +// ============================================================================= +// ----------------------------------------------------------------------------- +UnknownVersionPrompt::~UnknownVersionPrompt() { + delete ui; +} + +// ============================================================================= +// ----------------------------------------------------------------------------- +void UnknownVersionPrompt::addBinary() { + addVersion (m_binaryString, m_isRelease, ui->m_binaryPath->text()); + accept(); +} + +// ============================================================================= +// ----------------------------------------------------------------------------- +void UnknownVersionPrompt::findBinary() { + str path = ConfigBox::getBinaryPath (this); + + if (path.isEmpty()) + return; + + ui->m_binaryPath->setText (path); +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/prompts.h Sun Aug 11 03:05:24 2013 +0300 @@ -0,0 +1,29 @@ +#ifndef PROMPTS_H +#define PROMPTS_H + +#include <QDialog> +#include "main.h" +#include "types.h" + +class QAbstractButton; +class Ui_UnknownVersion; + +class UnknownVersionPrompt : public QDialog { + Q_OBJECT + +public: + explicit UnknownVersionPrompt (str fileName, str binaryName, bool isRelease, + QWidget* parent = null, Qt::WindowFlags f = 0); + virtual ~UnknownVersionPrompt(); + +public slots: + void findBinary(); + void addBinary(); + +private: + Ui_UnknownVersion* ui; + QString m_binaryString; + bool m_isRelease; +}; + +#endif // PROMPTS_H \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ui/unknownversion.ui Sun Aug 11 03:05:24 2013 +0300 @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>UnknownVersion</class> + <widget class="QDialog" name="UnknownVersion"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>246</height> + </rect> + </property> + <property name="windowTitle"> + <string>Unknown Zandronum Version</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="m_description"> + <property name="text"> + <string>The demo <DEMO> has been recorded with unknown version <VERSION>. You can add this to the list of known Zandronum versions and specify a binary for it here.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Zandronum binary path:</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLineEdit" name="m_binaryPath"/> + </item> + <item> + <widget class="QPushButton" name="m_findBinary"> + <property name="text"> + <string>...</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="Line" name="line_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QCommandLinkButton" name="m_addVersion"> + <property name="text"> + <string>Add Zandronum version and launch the demo</string> + </property> + </widget> + </item> + <item> + <widget class="QCommandLinkButton" name="m_cancel"> + <property name="text"> + <string>Cancel and exit</string> + </property> + <property name="description"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>m_cancel</sender> + <signal>clicked()</signal> + <receiver>UnknownVersion</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>118</x> + <y>210</y> + </hint> + <hint type="destinationlabel"> + <x>394</x> + <y>73</y> + </hint> + </hints> + </connection> + </connections> +</ui>