src/prompts.cpp

changeset 26
9aab482c9125
parent 20
a5457405cc9b
child 30
6b82f6a3ad53
equal deleted inserted replaced
25:256bb5c6b77f 26:9aab482c9125
19 #include "prompts.h" 19 #include "prompts.h"
20 #include "ui_unknownversion.h" 20 #include "ui_unknownversion.h"
21 #include "misc.h" 21 #include "misc.h"
22 #include "config.h" 22 #include "config.h"
23 #include "build/moc_prompts.cpp" 23 #include "build/moc_prompts.cpp"
24 #include "ui_findfile.h"
25 #include <QFileDialog>
24 26
25 // ============================================================================= 27 // =============================================================================
26 // ----------------------------------------------------------------------------- 28 // -----------------------------------------------------------------------------
27 UnknownVersionPrompt::UnknownVersionPrompt ( 29 UnknownVersionPrompt::UnknownVersionPrompt (
28 str fileName, 30 str fileName,
44 text.replace ("<VERSION>", binaryName); 46 text.replace ("<VERSION>", binaryName);
45 ui->m_description->setText (text); 47 ui->m_description->setText (text);
46 48
47 connect (ui->m_addVersion, SIGNAL (clicked(bool)), this, SLOT (addBinary())); 49 connect (ui->m_addVersion, SIGNAL (clicked(bool)), this, SLOT (addBinary()));
48 connect (ui->m_findBinary, SIGNAL (clicked(bool)), this, SLOT (findBinary())); 50 connect (ui->m_findBinary, SIGNAL (clicked(bool)), this, SLOT (findBinary()));
51 setWindowTitle (versionSignature());
49 } 52 }
50 53
51 // ============================================================================= 54 // =============================================================================
52 // ----------------------------------------------------------------------------- 55 // -----------------------------------------------------------------------------
53 UnknownVersionPrompt::~UnknownVersionPrompt() { 56 UnknownVersionPrompt::~UnknownVersionPrompt() {
69 if (path.isEmpty()) 72 if (path.isEmpty())
70 return; 73 return;
71 74
72 ui->m_binaryPath->setText (path); 75 ui->m_binaryPath->setText (path);
73 } 76 }
77
78 // =============================================================================
79 // -----------------------------------------------------------------------------
80 FindFilePrompt::FindFilePrompt (QWidget* parent, Qt::WindowFlags f) :
81 QDialog (parent, f),
82 m_ui (new Ui_FindFile)
83 {
84 m_ui->setupUi (this);
85 connect (m_ui->m_find, SIGNAL (clicked()), this, SLOT (findDemo()));
86
87 setWindowTitle (versionSignature());
88 }
89
90 // =============================================================================
91 // -----------------------------------------------------------------------------
92 FindFilePrompt::~FindFilePrompt() {
93 delete m_ui;
94 }
95
96 // =============================================================================
97 // -----------------------------------------------------------------------------
98 void FindFilePrompt::findDemo() {
99 str path = QFileDialog::getOpenFileName (this, tr ("Open Demo File"),
100 QDir::homePath(), tr ("Demo files (*.cld);;All files (*.*)"));
101
102 if (!path.isEmpty())
103 m_ui->m_path->setText (path);
104 }
105
106 // =============================================================================
107 // -----------------------------------------------------------------------------
108 str FindFilePrompt::path() const {
109 return m_ui->m_path->text();
110 }

mercurial