src/prompts.cpp

Sun, 11 Aug 2013 03:05:24 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 11 Aug 2013 03:05:24 +0300
changeset 12
755bd43b2f9b
child 13
9bdddd2ccde6
permissions
-rw-r--r--

added missing files

12
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 #include "prompts.h"
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 #include "ui_unknownversion.h"
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3 #include "misc.h"
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 #include "build/moc_prompts.cpp"
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 #include "config.h"
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 // =============================================================================
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 // -----------------------------------------------------------------------------
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 UnknownVersionPrompt::UnknownVersionPrompt (
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 str fileName,
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 str binaryName,
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 bool isRelease,
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 QWidget* parent,
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 Qt::WindowFlags f
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 ) :
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 QDialog (parent, f),
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 m_binaryString (binaryName),
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18 m_isRelease (isRelease)
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 {
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 ui = new Ui_UnknownVersion;
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 ui->setupUi (this);
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 // Replace the placeholders
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 str text = ui->m_description->text();
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 text.replace ("<DEMO>", basename (fileName));
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 text.replace ("<VERSION>", binaryName);
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 ui->m_description->setText (text);
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 connect (ui->m_addVersion, SIGNAL (clicked(bool)), this, SLOT (addBinary()));
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 connect (ui->m_findBinary, SIGNAL (clicked(bool)), this, SLOT (findBinary()));
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 }
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
32
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
33 // =============================================================================
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 // -----------------------------------------------------------------------------
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35 UnknownVersionPrompt::~UnknownVersionPrompt() {
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36 delete ui;
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
37 }
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39 // =============================================================================
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 // -----------------------------------------------------------------------------
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41 void UnknownVersionPrompt::addBinary() {
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42 addVersion (m_binaryString, m_isRelease, ui->m_binaryPath->text());
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
43 accept();
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
44 }
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
45
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
46 // =============================================================================
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
47 // -----------------------------------------------------------------------------
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
48 void UnknownVersionPrompt::findBinary() {
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
49 str path = ConfigBox::getBinaryPath (this);
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
50
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
51 if (path.isEmpty())
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
52 return;
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
53
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
54 ui->m_binaryPath->setText (path);
755bd43b2f9b added missing files
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
55 }

mercurial