src/dialogs.cpp

changeset 472
8986414c6ad5
parent 461
fbcc91ae1dd2
child 473
2a84149fe642
equal deleted inserted replaced
471:fc58b67d445c 472:8986414c6ad5
25 #include <QPushButton> 25 #include <QPushButton>
26 #include <QBoxLayout> 26 #include <QBoxLayout>
27 #include <QGridLayout> 27 #include <QGridLayout>
28 #include <QProgressBar> 28 #include <QProgressBar>
29 #include <QCheckBox> 29 #include <QCheckBox>
30 #include <QDesktopServices>
31 #include <QUrl>
30 32
31 #include "dialogs.h" 33 #include "dialogs.h"
32 #include "widgets.h" 34 #include "widgets.h"
33 #include "gui.h" 35 #include "gui.h"
34 #include "gldraw.h" 36 #include "gldraw.h"
37 #include "dialogs.h" 39 #include "dialogs.h"
38 #include "ui_overlay.h" 40 #include "ui_overlay.h"
39 #include "ui_ldrawpath.h" 41 #include "ui_ldrawpath.h"
40 #include "ui_openprogress.h" 42 #include "ui_openprogress.h"
41 #include "ui_extprogpath.h" 43 #include "ui_extprogpath.h"
44 #include "ui_about.h"
42 #include "build/moc_dialogs.cpp" 45 #include "build/moc_dialogs.cpp"
43 46
44 extern const char* g_extProgPathFilter; 47 extern const char* g_extProgPathFilter;
45 extern_cfg (String, io_ldpath); 48 extern_cfg (String, io_ldpath);
46 49
306 // ============================================================================= 309 // =============================================================================
307 // ----------------------------------------------------------------------------- 310 // -----------------------------------------------------------------------------
308 str ExtProgPathPrompt::getPath() const { 311 str ExtProgPathPrompt::getPath() const {
309 return ui->m_path->text(); 312 return ui->m_path->text();
310 } 313 }
314
315 // =============================================================================
316 // -----------------------------------------------------------------------------
317 AboutDialog::AboutDialog (QWidget* parent, Qt::WindowFlags f) :
318 QDialog (parent, f)
319 {
320 Ui::AboutUI ui;
321 ui.setupUi (this);
322 ui.versionInfo->setText (fmt (tr ("LDForge %1"), fullVersionString()));
323
324 QPushButton* mailButton = new QPushButton;
325 mailButton->setText ("Contact");
326 mailButton->setIcon (getIcon ("mail"));
327 ui.buttonBox->addButton (static_cast<QAbstractButton*> (mailButton), QDialogButtonBox::HelpRole);
328 connect (ui.buttonBox, SIGNAL (helpRequested()), this, SLOT (slot_mail()));
329
330 setWindowTitle ("About " APPNAME);
331 }
332
333 // =============================================================================
334 // -----------------------------------------------------------------------------
335 void AboutDialog::slot_mail() {
336 QDesktopServices::openUrl (QUrl ("mailto:Santeri Piippo <slatenails64@gmail.com>?subject=LDForge"));
337 }

mercurial