author | pohly <pohly> | 2005-05-08 16:13:24 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-08 16:13:24 (UTC) |
commit | ea889d21f3b5bf846ff20a6fad9a756108a28ad7 (patch) (side-by-side diff) | |
tree | 3d0462ccf147fb95886657d8bb610caa168e01ea | |
parent | 2ccb0ad8b77eb3c62914f5df5b1bba3becb83617 (diff) | |
download | opie-ea889d21f3b5bf846ff20a6fad9a756108a28ad7.zip opie-ea889d21f3b5bf846ff20a6fad9a756108a28ad7.tar.gz opie-ea889d21f3b5bf846ff20a6fad9a756108a28ad7.tar.bz2 |
code change by tim: ask the user to confirm the remapping of the ESC key
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp index 6753698..8ef0674 100644 --- a/noncore/apps/opie-reader/QTReaderApp.cpp +++ b/noncore/apps/opie-reader/QTReaderApp.cpp @@ -3137,49 +3137,54 @@ void QTReaderApp::updateCaption() // if ( s.isEmpty() ) // s = tr( "Unnamed" ); setCaption( reader->m_string + " - " + tr(SHORTPROGNAME) ); // } } void QTReaderApp::setDocument(const QString& fileref) { //QMessageBox::information(0, "setDocument", fileref); openFile(fileref); // showEditTools(); } void QTReaderApp::closeEvent( QCloseEvent *e ) { // qDebug("Close event"); if (m_fullscreen) { m_fullscreen = false; showEditTools(); e->ignore(); } else if (editorStack->visibleWidget() == m_buttonprefs) { + int ret = QMessageBox::warning(this, PROGNAME, +tr("Do you wish to map this key?\n\nIf you proceed you will map\nthe escape key and you will\nneed to press the close box\ntwice to exit this program\n\nContinue?"), tr("Yes"), tr("No"), QString::null, 0, 1); + if (ret == 0) + { m_buttonprefs->mapkey(Qt::NoButton, Key_Escape); + } e->ignore(); } else if (m_dontSave) { e->accept(); } else { if (editorStack->visibleWidget() == reader) { if ((kmap.find(orKey(Qt::NoButton,Key_Escape,false)) != kmap.end()) && m_bcloseDisabled) { // qDebug("Close disabled"); m_bcloseDisabled = false; e->ignore(); } else { if (m_fontVisible) { m_fontBar->hide(); m_fontVisible = false; e->ignore(); return; |