-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 7 |
1 files changed, 6 insertions, 1 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 | |||
@@ -3145,33 +3145,38 @@ void QTReaderApp::setDocument(const QString& fileref) | |||
3145 | //QMessageBox::information(0, "setDocument", fileref); | 3145 | //QMessageBox::information(0, "setDocument", fileref); |
3146 | openFile(fileref); | 3146 | openFile(fileref); |
3147 | // showEditTools(); | 3147 | // showEditTools(); |
3148 | } | 3148 | } |
3149 | 3149 | ||
3150 | void QTReaderApp::closeEvent( QCloseEvent *e ) | 3150 | void QTReaderApp::closeEvent( QCloseEvent *e ) |
3151 | { | 3151 | { |
3152 | // qDebug("Close event"); | 3152 | // qDebug("Close event"); |
3153 | if (m_fullscreen) | 3153 | if (m_fullscreen) |
3154 | { | 3154 | { |
3155 | m_fullscreen = false; | 3155 | m_fullscreen = false; |
3156 | showEditTools(); | 3156 | showEditTools(); |
3157 | e->ignore(); | 3157 | e->ignore(); |
3158 | } | 3158 | } |
3159 | else if (editorStack->visibleWidget() == m_buttonprefs) | 3159 | else if (editorStack->visibleWidget() == m_buttonprefs) |
3160 | { | 3160 | { |
3161 | m_buttonprefs->mapkey(Qt::NoButton, Key_Escape); | 3161 | int ret = QMessageBox::warning(this, PROGNAME, |
3162 | 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); | ||
3163 | if (ret == 0) | ||
3164 | { | ||
3165 | m_buttonprefs->mapkey(Qt::NoButton, Key_Escape); | ||
3166 | } | ||
3162 | e->ignore(); | 3167 | e->ignore(); |
3163 | } | 3168 | } |
3164 | else if (m_dontSave) | 3169 | else if (m_dontSave) |
3165 | { | 3170 | { |
3166 | e->accept(); | 3171 | e->accept(); |
3167 | } | 3172 | } |
3168 | else | 3173 | else |
3169 | { | 3174 | { |
3170 | if (editorStack->visibleWidget() == reader) | 3175 | if (editorStack->visibleWidget() == reader) |
3171 | { | 3176 | { |
3172 | if ((kmap.find(orKey(Qt::NoButton,Key_Escape,false)) != kmap.end()) && m_bcloseDisabled) | 3177 | if ((kmap.find(orKey(Qt::NoButton,Key_Escape,false)) != kmap.end()) && m_bcloseDisabled) |
3173 | { | 3178 | { |
3174 | //qDebug("Close disabled"); | 3179 | //qDebug("Close disabled"); |
3175 | m_bcloseDisabled = false; | 3180 | m_bcloseDisabled = false; |
3176 | e->ignore(); | 3181 | e->ignore(); |
3177 | } | 3182 | } |