void ResetWidget::clearActivated () { MDialog *dialog; MLocale locale; QString question; if (m_ResetBusinessLogic->isUsbConnected ()) { showMassStorageWarning (); return; } //% "Clear all user data and restore original settings?" question = qtTrId("qtn_rset_clear_query").arg(locale.formatNumber(15)); question.replace ("\\n", "<br>"); question.replace ("\n", "<br>"); //% "Clear all data?" dialog = new MMessageBox (qtTrId ("qtn_rset_clear_query_title"), question, M::YesButton | M::NoButton); connect (dialog, SIGNAL (accepted ()), SLOT (clearConfirmed ())); connect (dialog, SIGNAL (rejected ()), SLOT (operationCancelled ())); dialog->appear (MApplication::instance ()->activeWindow (), MSceneWindow::DestroyWhenDone); }
void ResetWidget::restoreActivated () { MDialog *dialog; if (m_ResetBusinessLogic->isUsbConnected ()) { showMassStorageWarning (); return; } //% "Restore original settings?" QString question = qtTrId ("qtn_rset_restore_query"); // It is a bit ugly, but translations contains \n stuffs: question.replace ("\\n", "<br>"); question.replace ("\n", "<br>"); //% "Restore original settings?" dialog = new MMessageBox (qtTrId ("qtn_rset_restore_query_title"), question, M::YesButton | M::NoButton); connect (dialog, SIGNAL (accepted ()), SLOT (restoreConfirmed ())); connect (dialog, SIGNAL (rejected ()), SLOT (operationCancelled ())); dialog->appear (MApplication::instance ()->activeWindow (), MSceneWindow::DestroyWhenDone); }
ResetWidget::ResetWidget ( ResetBusinessLogic *resetBusinessLogic, QGraphicsWidget *parent) : DcpWidget (parent), m_ResetBusinessLogic (resetBusinessLogic), m_currentPlan (None) { createContent(); connect (resetBusinessLogic, SIGNAL (gotAccess ()), this, SLOT (doTheWork ())); connect (resetBusinessLogic, SIGNAL (accessDenied ()), this, SLOT (operationCancelled ())); }
void ProgressDialog::on_cancelButton_pressed() { emit operationCancelled(); this->close(); }