src/dialogs.cpp

changeset 452
47cc663e4ff4
parent 436
4268a5507725
child 455
c5d14d112034
equal deleted inserted replaced
451:7ef26b45ed55 452:47cc663e4ff4
36 #include "file.h" 36 #include "file.h"
37 #include "dialogs.h" 37 #include "dialogs.h"
38 #include "ui_overlay.h" 38 #include "ui_overlay.h"
39 #include "ui_ldrawpath.h" 39 #include "ui_ldrawpath.h"
40 #include "ui_openprogress.h" 40 #include "ui_openprogress.h"
41 41 #include "ui_extprogpath.h"
42 #include "build/moc_dialogs.cpp"
43
44 extern const char* g_extProgPathFilter;
42 extern_cfg (str, io_ldpath); 45 extern_cfg (str, io_ldpath);
43 46
44 // ============================================================================= 47 // =============================================================================
45 OverlayDialog::OverlayDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { 48 OverlayDialog::OverlayDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) {
46 ui = new Ui_OverlayUI; 49 ui = new Ui_OverlayUI;
241 void OpenProgressDialog::updateProgress (int progress) { 244 void OpenProgressDialog::updateProgress (int progress) {
242 m_progress = progress; 245 m_progress = progress;
243 updateValues(); 246 updateValues();
244 } 247 }
245 248
246 #include "build/moc_dialogs.cpp" 249 ExtProgPathPrompt::ExtProgPathPrompt (str progName, QWidget* parent, Qt::WindowFlags f) :
247 // kate: indent-mode cstyle; indent-width 4; replace-tabs off; tab-width 4; 250 QDialog (parent, f),
251 ui (new Ui_ExtProgPath)
252 {
253 ui->setupUi (this);
254
255 str labelText = ui->m_label->text();
256 labelText.replace ("<PROGRAM>", progName);
257 ui->m_label->setText (labelText);
258
259 connect (ui->m_findPath, SIGNAL (clicked (bool)), this, SLOT (findPath()));
260 }
261
262 ExtProgPathPrompt::~ExtProgPathPrompt() {
263 delete ui;
264 }
265
266 void ExtProgPathPrompt::findPath() {
267 str path = QFileDialog::getOpenFileName (null, "", "", g_extProgPathFilter);
268
269 if (!path.isEmpty())
270 ui->m_path->setText (path);
271 }
272
273 str ExtProgPathPrompt::getPath() const {
274 return ui->m_path->text();
275 }

mercurial