src/dialogs.cc

changeset 739
152b33a6d51b
parent 662
2f1bd9112408
child 757
8ab9fa53142b
equal deleted inserted replaced
738:16b63398aa1f 739:152b33a6d51b
110 } 110 }
111 } 111 }
112 112
113 // ============================================================================= 113 // =============================================================================
114 // ============================================================================= 114 // =============================================================================
115 QString OverlayDialog::fpath() const 115 String OverlayDialog::fpath() const
116 { 116 {
117 return ui->filename->text(); 117 return ui->filename->text();
118 } 118 }
119 119
120 int OverlayDialog::ofsx() const 120 int OverlayDialog::ofsx() const
176 cancelButton()->setIcon (getIcon ("exit")); 176 cancelButton()->setIcon (getIcon ("exit"));
177 } 177 }
178 178
179 okButton()->setEnabled (false); 179 okButton()->setEnabled (false);
180 180
181 connect (ui->path, SIGNAL (textEdited (QString)), this, SLOT (slot_tryConfigure())); 181 connect (ui->path, SIGNAL (textEdited (String)), this, SLOT (slot_tryConfigure()));
182 connect (ui->searchButton, SIGNAL (clicked()), this, SLOT (slot_findPath())); 182 connect (ui->searchButton, SIGNAL (clicked()), this, SLOT (slot_findPath()));
183 connect (ui->buttonBox, SIGNAL (rejected()), this, validDefault ? SLOT (reject()) : SLOT (slot_exit())); 183 connect (ui->buttonBox, SIGNAL (rejected()), this, validDefault ? SLOT (reject()) : SLOT (slot_exit()));
184 connect (ui->buttonBox, SIGNAL (accepted()), this, SLOT (slot_accept())); 184 connect (ui->buttonBox, SIGNAL (accepted()), this, SLOT (slot_accept()));
185 185
186 setPath (io_ldpath); 186 setPath (io_ldpath);
204 QPushButton* LDrawPathDialog::cancelButton() 204 QPushButton* LDrawPathDialog::cancelButton()
205 { 205 {
206 return ui->buttonBox->button (QDialogButtonBox::Cancel); 206 return ui->buttonBox->button (QDialogButtonBox::Cancel);
207 } 207 }
208 208
209 void LDrawPathDialog::setPath (QString path) 209 void LDrawPathDialog::setPath (String path)
210 { 210 {
211 ui->path->setText (path); 211 ui->path->setText (path);
212 } 212 }
213 213
214 QString LDrawPathDialog::filename() const 214 String LDrawPathDialog::filename() const
215 { 215 {
216 return ui->path->text(); 216 return ui->path->text();
217 } 217 }
218 218
219 // ============================================================================= 219 // =============================================================================
220 // ============================================================================= 220 // =============================================================================
221 void LDrawPathDialog::slot_findPath() 221 void LDrawPathDialog::slot_findPath()
222 { 222 {
223 QString newpath = QFileDialog::getExistingDirectory (this, "Find LDraw Path"); 223 String newpath = QFileDialog::getExistingDirectory (this, "Find LDraw Path");
224 224
225 if (newpath.length() > 0 && newpath != filename()) 225 if (newpath.length() > 0 && newpath != filename())
226 { 226 {
227 setPath (newpath); 227 setPath (newpath);
228 slot_tryConfigure(); 228 slot_tryConfigure();
302 updateValues(); 302 updateValues();
303 } 303 }
304 304
305 // ============================================================================= 305 // =============================================================================
306 // ============================================================================= 306 // =============================================================================
307 ExtProgPathPrompt::ExtProgPathPrompt (QString progName, QWidget* parent, Qt::WindowFlags f) : 307 ExtProgPathPrompt::ExtProgPathPrompt (String progName, QWidget* parent, Qt::WindowFlags f) :
308 QDialog (parent, f), 308 QDialog (parent, f),
309 ui (new Ui_ExtProgPath) 309 ui (new Ui_ExtProgPath)
310 { 310 {
311 ui->setupUi (this); 311 ui->setupUi (this);
312 QString labelText = ui->m_label->text(); 312 String labelText = ui->m_label->text();
313 labelText.replace ("<PROGRAM>", progName); 313 labelText.replace ("<PROGRAM>", progName);
314 ui->m_label->setText (labelText); 314 ui->m_label->setText (labelText);
315 connect (ui->m_findPath, SIGNAL (clicked (bool)), this, SLOT (findPath())); 315 connect (ui->m_findPath, SIGNAL (clicked (bool)), this, SLOT (findPath()));
316 } 316 }
317 317
324 324
325 // ============================================================================= 325 // =============================================================================
326 // ============================================================================= 326 // =============================================================================
327 void ExtProgPathPrompt::findPath() 327 void ExtProgPathPrompt::findPath()
328 { 328 {
329 QString path = QFileDialog::getOpenFileName (null, "", "", g_extProgPathFilter); 329 String path = QFileDialog::getOpenFileName (null, "", "", g_extProgPathFilter);
330 330
331 if (not path.isEmpty()) 331 if (not path.isEmpty())
332 ui->m_path->setText (path); 332 ui->m_path->setText (path);
333 } 333 }
334 334
335 // ============================================================================= 335 // =============================================================================
336 // ============================================================================= 336 // =============================================================================
337 QString ExtProgPathPrompt::getPath() const 337 String ExtProgPathPrompt::getPath() const
338 { 338 {
339 return ui->m_path->text(); 339 return ui->m_path->text();
340 } 340 }
341 341
342 // ============================================================================= 342 // =============================================================================
344 AboutDialog::AboutDialog (QWidget* parent, Qt::WindowFlags f) : 344 AboutDialog::AboutDialog (QWidget* parent, Qt::WindowFlags f) :
345 QDialog (parent, f) 345 QDialog (parent, f)
346 { 346 {
347 Ui::AboutUI ui; 347 Ui::AboutUI ui;
348 ui.setupUi (this); 348 ui.setupUi (this);
349 ui.versionInfo->setText (APPNAME " " + QString (fullVersionString())); 349 ui.versionInfo->setText (APPNAME " " + String (fullVersionString()));
350 350
351 QPushButton* mailButton = new QPushButton; 351 QPushButton* mailButton = new QPushButton;
352 mailButton->setText (tr ("Contact")); 352 mailButton->setText (tr ("Contact"));
353 mailButton->setIcon (getIcon ("mail")); 353 mailButton->setIcon (getIcon ("mail"));
354 ui.buttonBox->addButton (static_cast<QAbstractButton*> (mailButton), QDialogButtonBox::HelpRole); 354 ui.buttonBox->addButton (static_cast<QAbstractButton*> (mailButton), QDialogButtonBox::HelpRole);
364 QDesktopServices::openUrl (QUrl ("mailto:Santeri Piippo <arezey@gmail.com>?subject=LDForge")); 364 QDesktopServices::openUrl (QUrl ("mailto:Santeri Piippo <arezey@gmail.com>?subject=LDForge"));
365 } 365 }
366 366
367 // ============================================================================= 367 // =============================================================================
368 // ============================================================================= 368 // =============================================================================
369 void bombBox (const QString& message) 369 void bombBox (const String& message)
370 { 370 {
371 QDialog dlg (g_win); 371 QDialog dlg (g_win);
372 Ui_BombBox ui; 372 Ui_BombBox ui;
373 373
374 ui.setupUi (&dlg); 374 ui.setupUi (&dlg);

mercurial