Changeset 561 for trunk/src/gui/dialogs/qprintdialog_unix.cpp
- 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/qprintdialog_unix.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 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 have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 45 45 46 46 #include "private/qabstractprintdialog_p.h" 47 #include "qfiledialog_p.h"48 47 #include <QtGui/qmessagebox.h> 49 48 #include "qprintdialog.h" 50 49 #include "qfiledialog.h" 51 50 #include <QtCore/qdir.h> 51 #include <QtGui/qevent.h> 52 52 #include <QtGui/qfilesystemmodel.h> 53 53 #include <QtGui/qstyleditemdelegate.h> … … 56 56 #include <QtGui/qdialogbuttonbox.h> 57 57 58 #include "qfscompleter_p.h" 58 59 #include "ui_qprintpropertieswidget.h" 59 60 #include "ui_qprintsettingsoutput.h" … … 193 194 selected(-1), 194 195 selDescription(0), 195 parentItem(pi) {} ;196 parentItem(pi) {} 196 197 197 198 ~QOptionTreeItem() { 198 199 while (!childItems.isEmpty()) 199 200 delete childItems.takeFirst(); 200 } ;201 } 201 202 202 203 ItemType type; … … 238 239 Q_OBJECT 239 240 public: 240 QPPDOptionsEditor(QObject* parent = 0) : QStyledItemDelegate(parent) {} ;241 ~QPPDOptionsEditor() {} ;241 QPPDOptionsEditor(QObject* parent = 0) : QStyledItemDelegate(parent) {} 242 ~QPPDOptionsEditor() {} 242 243 243 244 QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const; … … 670 671 QString printerName(QString::fromLocal8Bit(cupsPrinters[i].name)); 671 672 if (cupsPrinters[i].instance) 672 printerName += QLatin1 String("/") + QString::fromLocal8Bit(cupsPrinters[i].instance);673 printerName += QLatin1Char('/') + QString::fromLocal8Bit(cupsPrinters[i].instance); 673 674 674 675 widget.printers->addItem(printerName); … … 696 697 QFileSystemModel *fsm = new QFileSystemModel(widget.filename); 697 698 fsm->setRootPath(QDir::homePath()); 698 #if !defined(QT_NO_ COMPLETER) && !defined(QT_NO_FILEDIALOG)699 widget.filename->setCompleter(new QFSComplet or(fsm, widget.filename));699 #if !defined(QT_NO_FSCOMPLETER) && !defined(QT_NO_FILEDIALOG) 700 widget.filename->setCompleter(new QFSCompleter(fsm, widget.filename)); 700 701 #endif 701 702 #endif … … 728 729 filePrintersAdded = false; 729 730 } 730 if (printer && filePrintersAdded && printer->printerName().isEmpty()) { 731 if (printer && filePrintersAdded && (printer->outputFormat() != QPrinter::NativeFormat 732 || printer->printerName().isEmpty())) 733 { 731 734 if (printer->outputFormat() == QPrinter::PdfFormat) 732 735 widget.printers->setCurrentIndex(widget.printers->count() - 2); … … 812 815 #endif 813 816 if (lprPrinters.count() > 0) { 814 QString type = lprPrinters.at(index).name + QLatin1 String("@") + lprPrinters.at(index).host;817 QString type = lprPrinters.at(index).name + QLatin1Char('@') + lprPrinters.at(index).host; 815 818 if (!lprPrinters.at(index).comment.isEmpty()) 816 819 type += QLatin1String(", ") + lprPrinters.at(index).comment; … … 833 836 void QUnixPrintWidgetPrivate::_q_btnBrowseClicked() 834 837 { 835 const int prevPrinter = widget.printers->currentIndex();836 widget.printers->setCurrentIndex(widget.printers->count() - 2); // the pdf one837 838 838 QString filename = widget.filename->text(); 839 839 #ifndef QT_NO_FILEDIALOG … … 847 847 if (filename.endsWith(QString::fromLatin1(".ps"), Qt::CaseInsensitive)) 848 848 widget.printers->setCurrentIndex(widget.printers->count() - 1); // the postscript one 849 } 850 else 851 widget.printers->setCurrentIndex(prevPrinter); 849 else if (filename.endsWith(QString::fromLatin1(".pdf"), Qt::CaseInsensitive)) 850 widget.printers->setCurrentIndex(widget.printers->count() - 2); // the pdf one 851 else if (widget.printers->currentIndex() != widget.printers->count() - 1) // if ps is not selected, pdf is default 852 widget.printers->setCurrentIndex(widget.printers->count() - 2); // the pdf one 853 } 852 854 } 853 855 … … 1193 1195 switch(section){ 1194 1196 case 0: 1195 return QVariant(QApplication::translate("QPPDOptionsModel", "Name"));1197 return QVariant(QApplication::translate("QPPDOptionsModel", "Name")); 1196 1198 case 1: 1197 return QVariant(QApplication::translate("QPPDOptionsModel", "Value"));1199 return QVariant(QApplication::translate("QPPDOptionsModel", "Value")); 1198 1200 default: 1199 1201 return QVariant();
Note:
See TracChangeset
for help on using the changeset viewer.