src/prompts.cpp

changeset 44
d0bf58f3560f
parent 42
9528f8d06962
child 45
f5b526a3423a
equal deleted inserted replaced
43:1394901b557a 44:d0bf58f3560f
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19 #include <QTableWidgetItem>
20 #include <QFileDialog> 19 #include <QFileDialog>
21 #include "prompts.h" 20 #include "prompts.h"
21 #include "misc.h"
22 #include "ui_unknownversion.h" 22 #include "ui_unknownversion.h"
23 #include "misc.h"
24 #include "configwindow.h"
25 #include "ui_findfile.h" 23 #include "ui_findfile.h"
26 #include "ui_addversion.h"
27 24
28 // 25 //
29 // ------------------------------------------------------------------------------------------------- 26 // -------------------------------------------------------------------------------------------------
30 // 27 //
31 28
134 131
135 QString FindFilePrompt::path() const 132 QString FindFilePrompt::path() const
136 { 133 {
137 return m_ui->m_path->text(); 134 return m_ui->m_path->text();
138 } 135 }
139
140 //
141 // -------------------------------------------------------------------------------------------------
142 //
143
144 AddVersionPrompt::AddVersionPrompt (VersionGuiEntry* entry, QWidget* parent, Qt::WindowFlags f)
145 : QDialog (parent, f),
146 ui (*new Ui_AddVersion),
147 m_entry (entry)
148 {
149 ui.setupUi (this);
150 connect (ui.buttonBox, SIGNAL (accepted()), this, SLOT (acceptPressed()));
151 connect (ui.buttonBox, SIGNAL (rejected()), this, SLOT (reject()));
152 connect (ui.findExeButton, SIGNAL (clicked()), this, SLOT (findExePath()));
153
154 ui.nameField->setText (entry->name);
155 ui.exePathField->setText (entry->pathItem->text());
156 ui.releaseCheckbox->setChecked (entry->isRelease);
157 }
158
159 //
160 // -------------------------------------------------------------------------------------------------
161 //
162
163 void AddVersionPrompt::acceptPressed()
164 {
165 m_entry->name = ui.nameField->text();
166 m_entry->isRelease = ui.releaseCheckbox->isChecked();
167 m_entry->labelItem->setText (m_entry->name);
168 m_entry->pathItem->setText (ui.exePathField->text());
169 accept();
170 }
171
172 //
173 // -------------------------------------------------------------------------------------------------
174 //
175
176 AddVersionPrompt::~AddVersionPrompt()
177 {
178 delete &ui;
179 }
180
181 //
182 // -------------------------------------------------------------------------------------------------
183 //
184
185 void AddVersionPrompt::findExePath()
186 {
187 QString path = getBinaryPath (this);
188
189 if (not path.isEmpty())
190 ui.exePathField->setText (path);
191 }
192
193 //
194 // -------------------------------------------------------------------------------------------------
195 //
196
197 VersionGuiEntry* AddVersionPrompt::getVersionInfo()
198 {
199 return m_entry;
200 }

mercurial