Changeset 561 for trunk/src/gui/dialogs/qfiledialog_mac.mm
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/dialogs/qfiledialog_mac.mm
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 63 63 #include <qdesktopwidget.h> 64 64 #include <stdlib.h> 65 65 66 #include "ui_qfiledialog.h" 66 67 … … 246 247 runModalForDirectory:mCurrentDir 247 248 file:selectable ? filename : @"untitled"]; 249 250 248 251 return (mReturnCode == NSOKButton); 249 252 } … … 278 281 { 279 282 Q_UNUSED(sender); 283 284 285 286 280 287 QString qtFileName = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString)(filename); 281 288 QFileInfo info(qtFileName.normalized(QT_PREPEND_NAMESPACE(QString::NormalizationForm_C))); … … 393 400 { 394 401 Q_UNUSED(sender); 395 *mCurrentSelection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename])); 396 if (mPriv) 397 mPriv->QNSOpenSavePanelDelegate_selectionChanged(*mCurrentSelection); 402 if (mPriv) { 403 QString selection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename])); 404 if (selection != mCurrentSelection) { 405 *mCurrentSelection = selection; 406 mPriv->QNSOpenSavePanelDelegate_selectionChanged(selection); 407 } 408 } 398 409 } 399 410 … … 820 831 // When changing directory, the current selection is cleared if 821 832 // we are supposed to be selecting files only: 822 fileDialogPrivate->mCurrentSelectionList.clear();823 833 if (!fileDialogPrivate->mCurrentSelection.isEmpty()){ 834 824 835 fileDialogPrivate->mCurrentSelection.clear(); 825 836 emit fileDialogPrivate->q_func()->currentChanged(fileDialogPrivate->mCurrentSelection); … … 912 923 navOptions.windowTitle = QCFString::toCFStringRef(q->windowTitle()); 913 924 914 static const int w = 450, h = 350; 915 navOptions.location.h = navOptions.location.v = -1; 925 navOptions.location.h = -1; 926 navOptions.location.v = -1; 927 916 928 QWidget *parent = q->parentWidget(); 917 929 if (parent && parent->isVisible()) { … … 921 933 QString s = parent->windowTitle(); 922 934 navOptions.clientName = QCFString::toCFStringRef(s); 923 navOptions.location.h = (parent->x() + (parent->width() / 2)) - (w / 2);924 navOptions.location.v = (parent->y() + (parent->height() / 2)) - (h / 2);925 926 QRect r = QApplication::desktop()->screenGeometry(927 QApplication::desktop()->screenNumber(parent));928 const int border = 10;929 if (navOptions.location.h + w > r.right())930 navOptions.location.h -= (navOptions.location.h + w) - r.right() + border;931 if (navOptions.location.v + h > r.bottom())932 navOptions.location.v -= (navOptions.location.v + h) - r.bottom() + border;933 if (navOptions.location.h < r.left())934 navOptions.location.h = r.left() + border;935 if (navOptions.location.v < r.top())936 navOptions.location.v = r.top() + border;937 935 } 938 936
Note:
See TracChangeset
for help on using the changeset viewer.