# HG changeset patch # User Teemu Piippo # Date 1376179524 -10800 # Node ID 755bd43b2f9bd1cd4d8ec6abb8abdd590dcd6894 # Parent 3ddebf76105efdc6b040e316c4000d6caca0fd19 added missing files diff -r 3ddebf76105e -r 755bd43b2f9b src/prompts.cpp --- /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 ("", basename (fileName)); + text.replace ("", 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 diff -r 3ddebf76105e -r 755bd43b2f9b src/prompts.h --- /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 +#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 diff -r 3ddebf76105e -r 755bd43b2f9b src/ui/unknownversion.ui --- /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 @@ + + + UnknownVersion + + + + 0 + 0 + 400 + 246 + + + + Unknown Zandronum Version + + + + + + 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. + + + true + + + + + + + Qt::Horizontal + + + + + + + + + Zandronum binary path: + + + + + + + + + + + + ... + + + + + + + + + + + Qt::Horizontal + + + + + + + Add Zandronum version and launch the demo + + + + + + + Cancel and exit + + + + + + + + + + + + m_cancel + clicked() + UnknownVersion + reject() + + + 118 + 210 + + + 394 + 73 + + + + +