Index: trunk/src/gui/dialogs/qmessagebox.cpp
===================================================================
--- trunk/src/gui/dialogs/qmessagebox.cpp	(revision 5)
+++ trunk/src/gui/dialogs/qmessagebox.cpp	(revision 561)
@@ -2,5 +2,6 @@
 **
 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
 **
 ** This file is part of the QtGui module of the Qt Toolkit.
@@ -21,8 +22,7 @@
 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 **
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 **
 ** GNU General Public License Usage
@@ -34,6 +34,6 @@
 ** met: http://www.gnu.org/copyleft/gpl.html.
 **
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
 ** $QT_END_LICENSE$
 **
@@ -46,4 +46,5 @@
 #include <QtGui/qdialogbuttonbox.h>
 #include "private/qlabel_p.h"
+#include "private/qapplication_p.h"
 #include <QtCore/qlist.h>
 #include <QtCore/qdebug.h>
@@ -64,5 +65,5 @@
 #include <QtGui/qclipboard.h>
 
-#ifdef Q_OS_WINCE
+#ifdef Q_WS_WINCE
 extern bool qt_wince_is_mobile();    //defined in qguifunctions_wince.cpp
 extern bool qt_wince_is_smartphone();//defined in qguifunctions_wince.cpp
@@ -73,6 +74,4 @@
 
 QT_BEGIN_NAMESPACE
-
-extern QHash<QByteArray, QFont> *qt_app_fonts_hash();
 
 enum Button { Old_Ok = 1, Old_Cancel = 2, Old_Yes = 3, Old_No = 4, Old_Abort = 5, Old_Retry = 6,
@@ -153,5 +152,5 @@
     void retranslateStrings();
 
-#ifdef Q_OS_WINCE
+#ifdef Q_WS_WINCE
     void hideSpecial();
 #endif
@@ -190,4 +189,7 @@
     QAbstractButton *detectedEscapeButton;
     QLabel *informativeLabel;
+#ifdef Q_OS_SYMBIAN
+    QTextEdit *textEdit;
+#endif
     QPointer<QObject> receiverToDisconnectOnClose;
     QByteArray memberToDisconnectOnClose;
@@ -259,8 +261,6 @@
 int QMessageBoxPrivate::layoutMinimumWidth()
 {
-    Q_Q(QMessageBox);
-
-    q->layout()->activate();
-    return q->layout()->totalMinimumSize().width();
+    layout->activate();
+    return layout->totalMinimumSize().width();
 }
 
@@ -273,12 +273,12 @@
 
     QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
-#ifdef Q_WS_QWS
-    // the width of the screen, less the window border.
-    int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
-#elif defined(Q_OS_WINCE)
+#if defined(Q_WS_QWS) || defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN)
     // the width of the screen, less the window border.
     int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
 #else
     int hardLimit = qMin(screenSize.width() - 480, 1000); // can never get bigger than this
+    // on small screens allows the messagebox be the same size as the screen
+    if (screenSize.width() <= 1024)
+        hardLimit = screenSize.width();
 #endif
 #ifdef Q_WS_MAC
@@ -288,9 +288,9 @@
 #else
     // note: ideally on windows, hard and soft limits but it breaks compat
-#ifndef Q_OS_WINCE
+#ifndef Q_WS_WINCE
     int softLimit = qMin(screenSize.width()/2, 500);
 #else
     int softLimit = qMin(screenSize.width() * 3 / 4, 500);
-#endif //Q_OS_WINCE
+#endif //Q_WS_WINCE
 #endif
 
@@ -314,4 +314,13 @@
             width = hardLimit;
         }
+#ifdef Q_WS_S60
+        // in S60 portait messageBoxes should always occupy maximum width
+        if (QApplication::desktop()->size().height() > QApplication::desktop()->size().width()){
+            width = hardLimit;
+        } else {
+            // in landscape the messageBoxes should be of same width as in portrait
+            width = qMin(QApplication::desktop()->size().height(), hardLimit);
+        }
+#endif
     }
 
@@ -335,13 +344,13 @@
     }
 
-    QFontMetrics fm(qApp->font("QWorkspaceTitleBar"));
+    QFontMetrics fm(QApplication::font("QWorkspaceTitleBar"));
     int windowTitleWidth = qMin(fm.width(q->windowTitle()) + 50, hardLimit);
     if (windowTitleWidth > width)
         width = windowTitleWidth;
 
-    q->layout()->activate();
-    int height = (q->layout()->hasHeightForWidth())
-                     ? q->layout()->totalHeightForWidth(width)
-                     : q->layout()->totalMinimumSize().height();
+    layout->activate();
+    int height = (layout->hasHeightForWidth())
+                     ? layout->totalHeightForWidth(width)
+                     : layout->totalMinimumSize().height();
     q->setFixedSize(width, height);
     QCoreApplication::removePostedEvents(q, QEvent::LayoutRequest);
@@ -349,5 +358,5 @@
 
 
-#ifdef Q_OS_WINCE
+#ifdef Q_WS_WINCE
 /*!
   \internal
@@ -364,5 +373,5 @@
             QString text = pb->text();
             text.remove(QChar::fromLatin1('&'));
-            if (text == qApp->translate("QMessageBox", "OK" ))
+            if (text == QApplication::translate("QMessageBox", "OK" ))
                 pb->setFixedSize(0,0);
         }
@@ -438,6 +447,6 @@
     the user or for asking the user a question and receiving an answer.
 
-    \ingroup dialogs
-    \mainclass
+    \ingroup standard-dialogs
+
 
     A message box displays a primary \l{QMessageBox::text}{text} to
@@ -704,13 +713,8 @@
     passed to the QDialog constructor.
 
-    If \a parent is 0, the message box is an \l{Qt::ApplicationModal}
-    {application modal} dialog box. If \a parent is a widget, the
-    message box is \l{Qt::WindowModal} {window modal} relative to \a
-    parent.
-
-    On Mac OS X, if \a parent is not 0 and you want your message box
-    to appear as a Qt::Sheet of that parent, set the message box's
-    \l{setWindowModality()} {window modality} to Qt::WindowModal
-    (default). Otherwise, the message box will be a standard dialog.
+    On Mac OS X, if you want your message box to appear
+    as a Qt::Sheet of its \a parent, set the message box's
+    \l{setWindowModality()} {window modality} to Qt::WindowModal or use open().
+    Otherwise, the message box will be a standard dialog.
 
 */
@@ -1211,11 +1215,11 @@
             d_func()->retranslateStrings();
             break;
-#ifdef Q_OS_WINCE
+#ifdef Q_WS_WINCE
         case QEvent::OkRequest:
         case QEvent::HelpRequest: {
           QString bName =
               (e->type() == QEvent::OkRequest)
-              ? qApp->translate("QMessageBox", "OK")
-              : qApp->translate("QMessageBox", "Help");
+              ? QApplication::translate("QMessageBox", "OK")
+              : QApplication::translate("QMessageBox", "Help");
           QList<QPushButton*> list = qFindChildren<QPushButton*>(this);
           for (int i=0; i<list.size(); ++i) {
@@ -1316,5 +1320,5 @@
             QString separator = QString::fromLatin1("---------------------------\n");
             QString textToCopy = separator;
-            separator.prepend(QLatin1String("\n"));
+            separator.prepend(QLatin1Char('\n'));
             textToCopy += windowTitle() + separator; // title
             textToCopy += d->label->text() + separator; // text
@@ -1330,5 +1334,5 @@
             textToCopy += buttonTexts + separator;
 
-            qApp->clipboard()->setText(textToCopy);
+            QApplication::clipboard()->setText(textToCopy);
             return;
         }
@@ -1354,5 +1358,5 @@
 }
 
-#ifdef Q_OS_WINCE
+#ifdef Q_WS_WINCE
 /*!
     \reimp
@@ -1371,6 +1375,8 @@
     \overload
 
-    Opens the dialog and connects its accepted() signal to the slot specified
-    by \a receiver and \a member.
+    Opens the dialog and connects its finished() or buttonClicked() signal to
+    the slot specified by \a receiver and \a member. If the slot in \a member
+    has a pointer for its first parameter the connection is to buttonClicked(),
+    otherwise the connection is to finished().
 
     The signal will be disconnected from the slot when the dialog is closed.
@@ -1423,5 +1429,5 @@
     if (d->autoAddOkButton) {
         addButton(Ok);
-#if defined(Q_OS_WINCE)
+#if defined(Q_WS_WINCE)
         d->hideSpecial();
 #endif
@@ -1690,8 +1696,11 @@
 #endif
 
-    QString translatedTextAboutQt;
-    translatedTextAboutQt = QMessageBox::tr(
+    QString translatedTextAboutQtCaption;
+    translatedTextAboutQtCaption = QMessageBox::tr(
         "<h3>About Qt</h3>"
         "<p>This program uses Qt version %1.</p>"
+        ).arg(QLatin1String(QT_VERSION_STR));
+    QString translatedTextAboutQtText;
+    translatedTextAboutQtText = QMessageBox::tr(
         "<p>Qt is a C++ toolkit for cross-platform application "
         "development.</p>"
@@ -1702,5 +1711,5 @@
         "<p>Qt is available under three different licensing options designed "
         "to accommodate the needs of our various users.</p>"
-        "Qt licensed under our commercial license agreement is appropriate "
+        "<p>Qt licensed under our commercial license agreement is appropriate "
         "for development of proprietary/commercial software where you do not "
         "want to share any source code with third parties or otherwise cannot "
@@ -1716,20 +1725,20 @@
         "terms of the GNU GPL version 3.0 or where you are otherwise willing "
         "to comply with the terms of the GNU GPL version 3.0.</p>"
-        "<p>Please see <a href=\"http://www.qtsoftware.com/products/licensing\">www.qtsoftware.com/products/licensing</a> "
+        "<p>Please see <a href=\"http://qt.nokia.com/products/licensing\">qt.nokia.com/products/licensing</a> "
         "for an overview of Qt licensing.</p>"
         "<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p>"
-        "<p>Qt is a Nokia product. See <a href=\"http://www.qtsoftware.com/qt/\">www.qtsoftware.com/qt</a> "
+        "<p>Qt is a Nokia product. See <a href=\"http://qt.nokia.com/\">qt.nokia.com</a> "
         "for more information.</p>"
-       ).arg(QLatin1String(QT_VERSION_STR));
-
+        );
     QMessageBox *msgBox = new QMessageBox(parent);
     msgBox->setAttribute(Qt::WA_DeleteOnClose);
     msgBox->setWindowTitle(title.isEmpty() ? tr("About Qt") : title);
-    msgBox->setText(translatedTextAboutQt);
+    msgBox->setText(translatedTextAboutQtCaption);
+    msgBox->setInformativeText(translatedTextAboutQtText);
 
     QPixmap pm(QLatin1String(":/trolltech/qmessagebox/images/qtlogo-64.png"));
     if (!pm.isNull())
         msgBox->setIconPixmap(pm);
-#if defined(Q_OS_WINCE)
+#if defined(Q_WS_WINCE)
     msgBox->setDefaultButton(msgBox->addButton(QMessageBox::Ok));
 #endif
@@ -2454,8 +2463,22 @@
         label->setWordWrap(true);
         QGridLayout *grid = static_cast<QGridLayout *>(layout());
+#ifdef Q_OS_SYMBIAN
+        label->hide();
+        QTextEdit *textEdit = new QTextEdit(this);
+        textEdit->setReadOnly(true);
+        grid->addWidget(textEdit, 1, 1, 1, 1);
+        d->textEdit = textEdit;
+#else
         grid->addWidget(label, 1, 1, 1, 1);
+#endif
         d->informativeLabel = label;
     }
     d->informativeLabel->setText(text);
+
+#ifdef Q_OS_SYMBIAN
+    //We need to put the informative label inside textEdit to enable scrolling of long texts.
+    d->textEdit->setText(d->informativeLabel->text());
+#endif
+
     d->updateSize();
 }
