Rev 5674 | Rev 5685 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4430 | cbradney | 1 | /* |
2 | For general Scribus (>=1.3.2) copyright and licensing information please refer |
||
3 | to the COPYING file provided with the program. Following this notice may exist |
||
4 | a copyright and/or license notice that predates the release of Scribus 1.3.2 |
||
5 | for which a new license (GPL+exception) is in place. |
||
6 | */ |
||
1232 | fschmid | 7 | #include "checkDocument.h" |
8 | #include "checkDocument.moc" |
||
9 | |||
10 | #include <qvariant.h> |
||
11 | #include <qheader.h> |
||
12 | #include <qlistview.h> |
||
13 | #include <qlayout.h> |
||
14 | #include <qtooltip.h> |
||
15 | #include <qwhatsthis.h> |
||
16 | #include <qimage.h> |
||
17 | #include <qpixmap.h> |
||
1235 | fschmid | 18 | #include <qmap.h> |
1261 | fschmid | 19 | #include <qlabel.h> |
1525 | cbradney | 20 | |
3543 | avox | 21 | #include "sccombobox.h" |
1268 | fschmid | 22 | #include "scribus.h" |
1232 | fschmid | 23 | #include "scribusdoc.h" |
24 | #include "page.h" |
||
2111 | cbradney | 25 | #include "documentchecker.h" |
1525 | cbradney | 26 | |
1232 | fschmid | 27 | extern QPixmap loadIcon(QString nam); |
28 | |||
3205 | craig | 29 | |
1232 | fschmid | 30 | static const unsigned char image0_data[] = |
31 | { |
||
32 | 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, |
||
33 | 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0b, |
||
34 | 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0xac, 0x77, 0x26, 0x00, 0x00, 0x00, |
||
35 | 0xff, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0x75, 0x91, 0x31, 0x4e, 0xc3, |
||
36 | 0x40, 0x10, 0x45, 0x9f, 0xad, 0x2d, 0xe6, 0x0a, 0xdc, 0xc2, 0x8e, 0x44, |
||
37 | 0x91, 0x83, 0x50, 0x51, 0x91, 0x58, 0x29, 0x42, 0xba, 0x80, 0x28, 0x10, |
||
38 | 0x55, 0xe4, 0x02, 0x45, 0x74, 0x18, 0x24, 0x64, 0xdc, 0xe5, 0x28, 0x31, |
||
39 | 0x92, 0xd1, 0xe2, 0x74, 0x5c, 0x83, 0x72, 0x0a, 0x4b, 0x43, 0xe1, 0x78, |
||
40 | 0xb1, 0x22, 0xb1, 0xcd, 0x6a, 0x67, 0xde, 0xfc, 0x9d, 0x99, 0x1f, 0xf9, |
||
41 | 0xc6, 0x43, 0x07, 0x38, 0xd0, 0x4e, 0x11, 0x27, 0xff, 0xbe, 0xdd, 0x10, |
||
42 | 0xd0, 0x4e, 0x59, 0x2d, 0xdf, 0x8d, 0xd1, 0x29, 0xdf, 0xae, 0xa3, 0x71, |
||
43 | 0xde, 0x89, 0x13, 0x8a, 0x57, 0xec, 0xbb, 0xdd, 0x51, 0x1e, 0x2a, 0x00, |
||
44 | 0x14, 0x10, 0x20, 0x5b, 0x60, 0xd3, 0xf3, 0x35, 0x97, 0x57, 0x3f, 0x91, |
||
45 | 0x38, 0x21, 0xd6, 0x4e, 0x69, 0xdb, 0x82, 0xfa, 0xe2, 0x8c, 0x49, 0xbe, |
||
46 | 0x0d, 0xa0, 0x02, 0xe5, 0xa1, 0xe2, 0xe3, 0xf3, 0x29, 0x28, 0xc7, 0x37, |
||
47 | 0xcb, 0x9d, 0x95, 0x87, 0x0a, 0x5c, 0x8f, 0xc8, 0xb1, 0x85, 0x71, 0x41, |
||
48 | 0xb6, 0x28, 0x4c, 0x9c, 0xe0, 0x14, 0x05, 0xa0, 0xbe, 0xbb, 0x0d, 0xc0, |
||
49 | 0xe9, 0x0d, 0xfd, 0xb0, 0x31, 0x48, 0x48, 0x70, 0x02, 0x4e, 0xf2, 0xcd, |
||
50 | 0x5f, 0xdc, 0x09, 0xf1, 0xf0, 0x75, 0x50, 0x18, 0x81, 0x83, 0xd0, 0xa0, |
||
51 | 0x8c, 0x6f, 0x3c, 0x69, 0x32, 0x33, 0x0f, 0xb6, 0x07, 0xf3, 0x60, 0x96, |
||
52 | 0x6f, 0xcc, 0x1e, 0xb7, 0xb6, 0x07, 0x9b, 0x26, 0x4b, 0xf3, 0xb5, 0xc7, |
||
53 | 0x37, 0xbe, 0xdf, 0x73, 0x9a, 0xae, 0xc9, 0x8e, 0xc3, 0x28, 0xf0, 0x75, |
||
54 | 0xff, 0x80, 0x02, 0xab, 0x64, 0x46, 0x9a, 0xce, 0x83, 0x41, 0x91, 0x6f, |
||
55 | 0x7c, 0x70, 0x2a, 0x5b, 0x14, 0x36, 0x74, 0x2d, 0x08, 0xcf, 0x2f, 0xf3, |
||
56 | 0x68, 0xec, 0xe4, 0x2f, 0x90, 0x07, 0x8c, 0x36, 0xce, 0xc2, 0x57, 0x47, |
||
57 | 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 |
||
58 | }; |
||
59 | |||
60 | static const unsigned char image1_data[] = |
||
61 | { |
||
62 | 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, |
||
63 | 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0b, |
||
64 | 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0xac, 0x77, 0x26, 0x00, 0x00, 0x00, |
||
65 | 0xfa, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0x75, 0x91, 0x31, 0x6e, 0x83, |
||
66 | 0x40, 0x10, 0x45, 0x1f, 0x68, 0x8b, 0xb9, 0x4a, 0x3a, 0x63, 0xc9, 0x05, |
||
67 | 0x25, 0xe7, 0x48, 0x15, 0x8c, 0x28, 0x88, 0x3b, 0xe7, 0x1a, 0xe9, 0x02, |
||
68 | 0x91, 0x2c, 0x42, 0xe7, 0x73, 0x50, 0x19, 0x24, 0xac, 0x35, 0xa5, 0xaf, |
||
69 | 0x91, 0x72, 0x0b, 0xa4, 0x49, 0x41, 0xb2, 0x46, 0x48, 0x99, 0x66, 0x35, |
||
70 | 0x33, 0x7f, 0xdf, 0xd7, 0xee, 0x0f, 0xec, 0x60, 0x61, 0x02, 0x0c, 0xb8, |
||
71 | 0xc9, 0x21, 0x46, 0xfe, 0xed, 0xcd, 0xdf, 0xc0, 0x4d, 0x8e, 0x43, 0xf1, |
||
72 | 0xa5, 0x2c, 0xaa, 0x3e, 0xbd, 0x06, 0xcb, 0xbd, 0x11, 0x23, 0x94, 0x9f, |
||
73 | 0xe8, 0x7d, 0x3c, 0x53, 0x57, 0xcd, 0x2f, 0x11, 0xc4, 0x40, 0x96, 0xa3, |
||
74 | 0xf1, 0xee, 0xc8, 0xf3, 0xcb, 0x77, 0x20, 0x46, 0x08, 0xdd, 0xe4, 0x18, |
||
75 | 0xc7, 0x92, 0x6e, 0xbc, 0xb3, 0x8d, 0x13, 0x2f, 0x74, 0x13, 0xd4, 0xa7, |
||
76 | 0x86, 0xfe, 0xfa, 0xee, 0xc9, 0xe1, 0x5b, 0x71, 0xd6, 0xba, 0x6a, 0xbc, |
||
77 | 0xb5, 0x18, 0x60, 0x75, 0x21, 0xcb, 0x4b, 0x15, 0x23, 0x18, 0x87, 0x03, |
||
78 | 0x03, 0x5d, 0xdf, 0x7a, 0xc1, 0xfa, 0x84, 0xf9, 0xb1, 0x21, 0x88, 0x5f, |
||
79 | 0xb0, 0x12, 0x6e, 0x77, 0xc9, 0x3c, 0x07, 0xc4, 0x08, 0x21, 0xb8, 0x07, |
||
80 | 0x61, 0x25, 0x9c, 0x89, 0x0f, 0x32, 0x76, 0xb0, 0x44, 0x9b, 0x54, 0xed, |
||
81 | 0x80, 0x5e, 0x3a, 0xd4, 0x0e, 0xa8, 0x6a, 0xa2, 0xaa, 0x89, 0x5e, 0x3a, |
||
82 | 0x34, 0xde, 0x14, 0x6a, 0x3b, 0x8b, 0x1d, 0xec, 0xfc, 0x1b, 0x51, 0x74, |
||
83 | 0x24, 0xcb, 0x53, 0xef, 0x70, 0xbb, 0xb6, 0x74, 0x7d, 0xcb, 0xa1, 0x48, |
||
84 | 0x79, 0x8a, 0xf6, 0x3e, 0xa0, 0xc0, 0x0e, 0xd6, 0x27, 0x95, 0xe5, 0xa5, |
||
85 | 0x82, 0x00, 0x0e, 0x41, 0xf8, 0xa8, 0xf6, 0xc1, 0x32, 0xc9, 0x1f, 0x9e, |
||
86 | 0x1c, 0x9d, 0xca, 0x9e, 0x4f, 0x38, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x49, |
||
87 | 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 |
||
88 | }; |
||
89 | |||
90 | static const unsigned char image2_data[] = |
||
91 | { |
||
92 | 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, |
||
93 | 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0b, |
||
94 | 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0xac, 0x77, 0x26, 0x00, 0x00, 0x01, |
||
95 | 0x02, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0x75, 0x91, 0xb1, 0x4a, 0xc4, |
||
96 | 0x40, 0x10, 0x86, 0xbf, 0x84, 0x29, 0xc6, 0x37, 0xb8, 0xd6, 0xf2, 0xca, |
||
97 | 0x10, 0xae, 0xc8, 0x2b, 0xf8, 0x0a, 0xa9, 0x84, 0xa4, 0x08, 0xd8, 0x1c, |
||
98 | 0xa4, 0xb4, 0x13, 0xbb, 0x80, 0x85, 0x4a, 0xe0, 0x12, 0xb8, 0x46, 0x4b, |
||
99 | 0x5b, 0x3b, 0xeb, 0xc0, 0x49, 0xd8, 0xd2, 0x57, 0x48, 0x69, 0x21, 0xb8, |
||
100 | 0xc5, 0x42, 0x2c, 0x72, 0xc9, 0xad, 0x88, 0xdb, 0x2c, 0x33, 0x3b, 0xf3, |
||
101 | 0xfd, 0x3f, 0xfb, 0x07, 0xfd, 0xa1, 0x07, 0x07, 0x08, 0x58, 0x67, 0x51, |
||
102 | 0xd1, 0x7f, 0x6b, 0x99, 0x1b, 0xd6, 0x59, 0xae, 0x9b, 0xab, 0x11, 0xef, |
||
103 | 0x54, 0x45, 0x1b, 0xf8, 0xef, 0xa2, 0xa2, 0x74, 0xf2, 0x38, 0xbe, 0x36, |
||
104 | 0x1f, 0x0c, 0xb9, 0x01, 0x01, 0x1c, 0xa8, 0x40, 0x59, 0x67, 0x63, 0xba, |
||
105 | 0x4d, 0x58, 0x7f, 0xa5, 0x81, 0x8a, 0x12, 0x5a, 0x67, 0x79, 0xb9, 0x37, |
||
106 | 0x3c, 0xed, 0x2c, 0x7d, 0x12, 0x79, 0x16, 0x60, 0x28, 0x0c, 0xcf, 0x77, |
||
107 | 0xdd, 0x42, 0x0e, 0x6f, 0xf7, 0xe5, 0x38, 0xe4, 0x06, 0x3d, 0x4a, 0xeb, |
||
108 | 0x91, 0x3c, 0x2b, 0x7c, 0x16, 0x86, 0xb2, 0xce, 0x46, 0x15, 0x45, 0xbe, |
||
109 | 0x9d, 0x05, 0x81, 0xb8, 0x3b, 0x59, 0xf0, 0x6f, 0xeb, 0x26, 0x88, 0x75, |
||
110 | 0x96, 0xd0, 0xf7, 0xe8, 0x0f, 0xaa, 0x40, 0xbf, 0x89, 0xa6, 0x1a, 0x50, |
||
111 | 0x51, 0xc2, 0x5f, 0x04, 0x6f, 0xe1, 0x6d, 0x13, 0x4d, 0x53, 0x3e, 0xb9, |
||
112 | 0x2a, 0xda, 0x60, 0x55, 0x47, 0x7f, 0x88, 0xca, 0x64, 0xed, 0x7c, 0x9f, |
||
113 | 0x50, 0xe5, 0xed, 0xe9, 0x37, 0xd2, 0x6d, 0xc4, 0xbc, 0x60, 0x1d, 0xc4, |
||
114 | 0xef, 0x86, 0xb8, 0x33, 0xac, 0x9a, 0x88, 0x8b, 0x62, 0xbd, 0x04, 0x14, |
||
115 | 0xf4, 0x87, 0x7e, 0x49, 0xaa, 0xac, 0xb3, 0x71, 0x56, 0x38, 0x13, 0xe5, |
||
116 | 0xe6, 0xf2, 0x21, 0xf0, 0x93, 0xfc, 0x01, 0x78, 0x2a, 0x84, 0x98, 0x28, |
||
117 | 0xe8, 0xa9, 0x58, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, |
||
118 | 0x42, 0x60, 0x82 |
||
119 | }; |
||
120 | |||
5357 | cbradney | 121 | CheckDocument::CheckDocument( QWidget* parent, bool modal ) : ScrPaletteBase( parent, "checkDocument", modal, 0 ), |
122 | document(0) |
||
1232 | fschmid | 123 | { |
124 | QImage img; |
||
125 | img.loadFromData( image0_data, sizeof( image0_data ), "PNG" ); |
||
126 | graveError = img; |
||
127 | img.loadFromData( image1_data, sizeof( image1_data ), "PNG" ); |
||
128 | onlyWarning = img; |
||
129 | img.loadFromData( image2_data, sizeof( image2_data ), "PNG" ); |
||
130 | noErrors = img; |
||
131 | setIcon(loadIcon("AppIcon.png")); |
||
5674 | fschmid | 132 | checkDocumentLayout = new QVBoxLayout( this, 5, 5, "checkDocumentLayout"); |
1232 | fschmid | 133 | |
1261 | fschmid | 134 | layout1 = new QHBoxLayout( 0, 0, 5, "layout1"); |
135 | textLabel1 = new QLabel( this, "textLabel1" ); |
||
136 | layout1->addWidget( textLabel1 ); |
||
3680 | cbradney | 137 | curCheckProfile = new ScComboBox( false, this, "Profiles" ); |
1261 | fschmid | 138 | layout1->addWidget( curCheckProfile ); |
139 | checkDocumentLayout->addLayout( layout1 ); |
||
1232 | fschmid | 140 | reportDisplay = new QListView( this, "reportDisplay" ); |
2198 | cbradney | 141 | reportDisplay->addColumn("Items"); |
1232 | fschmid | 142 | reportDisplay->header()->setClickEnabled( false, reportDisplay->header()->count() - 1 ); |
143 | reportDisplay->header()->setResizeEnabled( false, reportDisplay->header()->count() - 1 ); |
||
2198 | cbradney | 144 | reportDisplay->addColumn("Problems"); |
1232 | fschmid | 145 | reportDisplay->header()->setClickEnabled( false, reportDisplay->header()->count() - 1 ); |
146 | reportDisplay->header()->setResizeEnabled( false, reportDisplay->header()->count() - 1 ); |
||
147 | reportDisplay->setSorting(-1); |
||
148 | checkDocumentLayout->addWidget( reportDisplay ); |
||
1816 | fschmid | 149 | layout2 = new QHBoxLayout( 0, 0, 5, "layou2"); |
5237 | fschmid | 150 | reScan = new QPushButton(this, "reScan" ); |
151 | layout2->addWidget( reScan ); |
||
5674 | fschmid | 152 | QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
1816 | fschmid | 153 | layout2->addItem( spacer ); |
2198 | cbradney | 154 | ignoreErrors = new QPushButton(this, "ignoreErrors" ); |
1816 | fschmid | 155 | layout2->addWidget( ignoreErrors ); |
156 | checkDocumentLayout->addLayout( layout2 ); |
||
4510 | subik | 157 | setIgnoreEnabled(false); |
158 | checkMode = checkNULL; |
||
1232 | fschmid | 159 | languageChange(); |
1235 | fschmid | 160 | itemMap.clear(); |
1268 | fschmid | 161 | pageMap.clear(); |
2093 | cbradney | 162 | masterPageMap.clear(); |
163 | masterPageItemMap.clear(); |
||
5237 | fschmid | 164 | resize( QSize(320, 260).expandedTo(minimumSizeHint()) ); |
1232 | fschmid | 165 | clearWState( WState_Polished ); |
1816 | fschmid | 166 | connect(ignoreErrors, SIGNAL(clicked()), this, SIGNAL(ignoreAllErrors())); |
1261 | fschmid | 167 | connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(newScan(const QString&))); |
5237 | fschmid | 168 | connect(reScan, SIGNAL(clicked()), this, SLOT(doReScan())); |
1232 | fschmid | 169 | } |
1525 | cbradney | 170 | /* |
1232 | fschmid | 171 | void CheckDocument::closeEvent(QCloseEvent *ce) |
172 | { |
||
1265 | cbradney | 173 | emit closePal(false); |
1367 | cbradney | 174 | QDialog::closeEvent(ce); |
1232 | fschmid | 175 | } |
176 | |||
1367 | cbradney | 177 | void CheckDocument::keyPressEvent(QKeyEvent *ke) |
178 | { |
||
1493 | cbradney | 179 | QDialog::keyPressEvent(ke); |
1367 | cbradney | 180 | } |
1525 | cbradney | 181 | */ |
5269 | subik | 182 | |
1235 | fschmid | 183 | void CheckDocument::slotSelect(QListViewItem* ite) |
184 | { |
||
185 | if (itemMap.contains(ite)) |
||
1244 | fschmid | 186 | { |
4026 | craig | 187 | ScMW->closeActiveWindowMasterPageEditor(); |
1268 | fschmid | 188 | emit selectElement(document->DocItems.at(itemMap[ite])->OwnPage, itemMap[ite]); |
1244 | fschmid | 189 | return; |
190 | } |
||
191 | if (pageMap.contains(ite)) |
||
192 | { |
||
4026 | craig | 193 | ScMW->closeActiveWindowMasterPageEditor(); |
1244 | fschmid | 194 | emit selectPage(pageMap[ite]); |
195 | return; |
||
196 | } |
||
2093 | cbradney | 197 | if (masterPageMap.contains(ite)) |
1268 | fschmid | 198 | { |
2093 | cbradney | 199 | emit selectMasterPage(masterPageMap[ite]); |
1268 | fschmid | 200 | return; |
201 | } |
||
2093 | cbradney | 202 | if (masterPageItemMap.contains(ite)) |
1268 | fschmid | 203 | { |
3724 | cbradney | 204 | if (!document->masterPageMode()) |
2093 | cbradney | 205 | emit selectMasterPage(document->MasterItems.at(masterPageItemMap[ite])->OnMasterPage); |
206 | emit selectElement(-1, masterPageItemMap[ite]); |
||
1268 | fschmid | 207 | return; |
208 | } |
||
1235 | fschmid | 209 | } |
210 | |||
5237 | fschmid | 211 | void CheckDocument::doReScan() |
212 | { |
||
213 | clearErrorList(); |
||
5357 | cbradney | 214 | if (document==0) |
215 | return; |
||
5237 | fschmid | 216 | document->curCheckProfile = curCheckProfile->currentText();; |
217 | DocumentChecker::checkDocument(document); |
||
218 | buildErrorList(document); |
||
219 | } |
||
220 | |||
1261 | fschmid | 221 | void CheckDocument::newScan(const QString& name) |
1232 | fschmid | 222 | { |
223 | clearErrorList(); |
||
5357 | cbradney | 224 | if (document==0) |
225 | return; |
||
1261 | fschmid | 226 | document->curCheckProfile = name; |
4512 | cbradney | 227 | DocumentChecker::checkDocument(document); |
2111 | cbradney | 228 | buildErrorList(document); |
1232 | fschmid | 229 | } |
230 | |||
231 | void CheckDocument::clearErrorList() |
||
232 | { |
||
1235 | fschmid | 233 | disconnect(reportDisplay, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelect(QListViewItem*))); |
1232 | fschmid | 234 | reportDisplay->clear(); |
4047 | cbradney | 235 | reportDisplay->setSorting(-1); |
1235 | fschmid | 236 | itemMap.clear(); |
1244 | fschmid | 237 | pageMap.clear(); |
2093 | cbradney | 238 | masterPageMap.clear(); |
239 | masterPageItemMap.clear(); |
||
1232 | fschmid | 240 | } |
241 | |||
242 | void CheckDocument::buildErrorList(ScribusDoc *doc) |
||
243 | { |
||
4510 | subik | 244 | bool resultError = false; |
1235 | fschmid | 245 | document = doc; |
1261 | fschmid | 246 | disconnect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(newScan(const QString&))); |
247 | curCheckProfile->clear(); |
||
4047 | cbradney | 248 | clearErrorList(); |
4510 | subik | 249 | |
4047 | cbradney | 250 | if (document==0) |
251 | return; |
||
4510 | subik | 252 | |
3033 | cbradney | 253 | CheckerPrefsList::Iterator it; |
254 | CheckerPrefsList::Iterator itend=doc->checkerProfiles.end(); |
||
255 | for (it = doc->checkerProfiles.begin(); it != itend ; ++it) |
||
1261 | fschmid | 256 | curCheckProfile->insertItem(it.key()); |
257 | curCheckProfile->setCurrentText(doc->curCheckProfile); |
||
4510 | subik | 258 | |
5237 | fschmid | 259 | int minRes = qRound(doc->checkerProfiles[doc->curCheckProfile].minResolution); |
5239 | fschmid | 260 | int maxRes = qRound(doc->checkerProfiles[doc->curCheckProfile].maxResolution); |
5237 | fschmid | 261 | int xres, yres; |
5269 | subik | 262 | |
1232 | fschmid | 263 | QListViewItem * item = new QListViewItem( reportDisplay, 0 ); |
264 | item->setText( 0, tr( "Document" ) ); |
||
5674 | fschmid | 265 | if ((doc->docItemErrors.count() == 0) && (doc->masterItemErrors.count() == 0) && (doc->docLayerErrors.count() == 0)) |
1232 | fschmid | 266 | { |
267 | item->setPixmap( 0, noErrors ); |
||
268 | item->setText( 1, tr( "No Problems found" ) ); |
||
5676 | fschmid | 269 | ignoreErrors->setText( tr("OK")); |
1232 | fschmid | 270 | } |
271 | else |
||
272 | { |
||
4510 | subik | 273 | resultError = true; |
1232 | fschmid | 274 | bool hasError = false; |
275 | bool hasGraveError = false; |
||
276 | QListViewItem * pagep = 0; |
||
5674 | fschmid | 277 | if (doc->docLayerErrors.count() != 0) |
278 | { |
||
279 | QMap<int, errorCodes>::Iterator it01; |
||
280 | for (it01 = doc->docLayerErrors.begin(); it01 != doc->docLayerErrors.end(); ++it01) |
||
281 | { |
||
282 | QListViewItem * layer = new QListViewItem( item, pagep ); |
||
283 | errorCodes::Iterator it03; |
||
284 | for (it03 = it01.data().begin(); it03 != it01.data().end(); ++it03) |
||
285 | { |
||
286 | QListViewItem * errorText = new QListViewItem( layer, 0 ); |
||
287 | switch (it03.key()) |
||
288 | { |
||
289 | case Transparency: |
||
290 | errorText->setText(0, tr("Transparency used")); |
||
291 | break; |
||
292 | case BlendMode: |
||
293 | errorText->setText(0, tr("Blendmode used")); |
||
294 | break; |
||
295 | default: |
||
296 | break; |
||
297 | } |
||
298 | errorText->setPixmap( 0, graveError ); |
||
299 | } |
||
5676 | fschmid | 300 | layer->setText(0, QString( tr("Layer \"%1\"")).arg(doc->layerName(it01.key()))); |
5674 | fschmid | 301 | layer->setPixmap( 0, graveError ); |
302 | pagep = layer; |
||
303 | hasGraveError = true; |
||
304 | } |
||
305 | } |
||
1232 | fschmid | 306 | for (int a = 0; a < static_cast<int>(doc->MasterPages.count()); ++a) |
307 | { |
||
308 | QString tmp; |
||
309 | hasError = false; |
||
310 | bool pageGraveError = false; |
||
311 | QListViewItem * page = new QListViewItem( item, pagep ); |
||
2093 | cbradney | 312 | masterPageMap.insert(page, doc->MasterPages.at(a)->PageNam); |
1232 | fschmid | 313 | pagep = page; |
314 | QMap<int, errorCodes>::Iterator it2; |
||
315 | for (it2 = doc->masterItemErrors.begin(); it2 != doc->masterItemErrors.end(); ++it2) |
||
316 | { |
||
317 | if ((doc->MasterItems.at(it2.key())->OwnPage == a) || (doc->MasterItems.at(it2.key())->OnMasterPage == doc->MasterPages.at(a)->PageNam)) |
||
318 | { |
||
319 | hasError = true; |
||
320 | bool itemError = false; |
||
321 | QListViewItem * object = new QListViewItem( page, 0 ); |
||
2093 | cbradney | 322 | masterPageItemMap.insert(object, doc->MasterItems.at(it2.key())->ItemNr); |
1361 | tsoots | 323 | object->setText(0, doc->MasterItems.at(it2.key())->itemName()); |
1232 | fschmid | 324 | errorCodes::Iterator it3; |
325 | if (it2.data().count() == 1) |
||
326 | { |
||
327 | it3 = it2.data().begin(); |
||
328 | switch (it3.key()) |
||
329 | { |
||
4512 | cbradney | 330 | case MissingGlyph: |
1232 | fschmid | 331 | object->setText(1, missingGlyph); |
332 | hasGraveError = true; |
||
333 | pageGraveError = true; |
||
334 | itemError = true; |
||
335 | break; |
||
4512 | cbradney | 336 | case TextOverflow: |
1232 | fschmid | 337 | object->setText(1, textOverflow); |
338 | break; |
||
4512 | cbradney | 339 | case ObjectNotOnPage: |
1232 | fschmid | 340 | object->setText(1, notOnPage); |
341 | break; |
||
4512 | cbradney | 342 | case MissingImage: |
1232 | fschmid | 343 | object->setText(1, missingImg); |
344 | hasGraveError = true; |
||
345 | pageGraveError = true; |
||
346 | itemError = true; |
||
347 | break; |
||
4512 | cbradney | 348 | case ImageDPITooLow: |
5237 | fschmid | 349 | xres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageXScale()); |
350 | yres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageYScale()); |
||
351 | object->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres)); |
||
1232 | fschmid | 352 | break; |
5239 | fschmid | 353 | case ImageDPITooHigh: |
354 | xres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageXScale()); |
||
355 | yres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageYScale()); |
||
356 | object->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres)); |
||
357 | break; |
||
4512 | cbradney | 358 | case Transparency: |
1235 | fschmid | 359 | object->setText(1, transpar); |
360 | hasGraveError = true; |
||
361 | pageGraveError = true; |
||
362 | itemError = true; |
||
363 | break; |
||
4512 | cbradney | 364 | case PDFAnnotField: |
1284 | fschmid | 365 | object->setText(1, annot); |
366 | break; |
||
4512 | cbradney | 367 | case PlacedPDF: |
1284 | fschmid | 368 | object->setText(1, rasterPDF); |
369 | break; |
||
5269 | subik | 370 | case ImageIsGIF: |
371 | object->setText(1, isGIF); |
||
372 | //QToolTip::add(object, isGIFtoolTip); |
||
373 | break; |
||
5676 | fschmid | 374 | default: |
375 | break; |
||
1232 | fschmid | 376 | } |
377 | } |
||
378 | else |
||
379 | { |
||
380 | for (it3 = it2.data().begin(); it3 != it2.data().end(); ++it3) |
||
381 | { |
||
382 | QListViewItem * errorText = new QListViewItem( object, 0 ); |
||
383 | switch (it3.key()) |
||
384 | { |
||
4512 | cbradney | 385 | case MissingGlyph: |
1232 | fschmid | 386 | errorText->setText(1, missingGlyph); |
387 | errorText->setPixmap( 0, graveError ); |
||
388 | hasGraveError = true; |
||
389 | pageGraveError = true; |
||
390 | itemError = true; |
||
391 | break; |
||
4512 | cbradney | 392 | case TextOverflow: |
1232 | fschmid | 393 | errorText->setText(1, textOverflow); |
394 | errorText->setPixmap( 0, onlyWarning ); |
||
395 | break; |
||
4512 | cbradney | 396 | case ObjectNotOnPage: |
1232 | fschmid | 397 | errorText->setText(1, notOnPage); |
398 | errorText->setPixmap( 0, onlyWarning ); |
||
399 | break; |
||
4512 | cbradney | 400 | case MissingImage: |
1232 | fschmid | 401 | errorText->setText(1, missingImg); |
402 | errorText->setPixmap( 0, graveError ); |
||
403 | hasGraveError = true; |
||
404 | pageGraveError = true; |
||
405 | itemError = true; |
||
406 | break; |
||
4512 | cbradney | 407 | case ImageDPITooLow: |
5237 | fschmid | 408 | xres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageXScale()); |
409 | yres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageYScale()); |
||
410 | errorText->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres)); |
||
1232 | fschmid | 411 | errorText->setPixmap( 0, onlyWarning ); |
412 | break; |
||
5239 | fschmid | 413 | case ImageDPITooHigh: |
414 | xres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageXScale()); |
||
415 | yres = qRound(72.0 / doc->MasterItems.at(it2.key())->imageYScale()); |
||
416 | errorText->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres)); |
||
417 | errorText->setPixmap( 0, onlyWarning ); |
||
418 | break; |
||
4512 | cbradney | 419 | case Transparency: |
1235 | fschmid | 420 | errorText->setText(1, transpar); |
421 | errorText->setPixmap( 0, graveError ); |
||
422 | hasGraveError = true; |
||
423 | pageGraveError = true; |
||
424 | itemError = true; |
||
425 | break; |
||
4512 | cbradney | 426 | case PDFAnnotField: |
1284 | fschmid | 427 | errorText->setText(1, annot); |
428 | errorText->setPixmap( 0, onlyWarning ); |
||
429 | break; |
||
4512 | cbradney | 430 | case PlacedPDF: |
1284 | fschmid | 431 | errorText->setText(1, rasterPDF); |
432 | errorText->setPixmap( 0, onlyWarning ); |
||
433 | break; |
||
5269 | subik | 434 | case ImageIsGIF: |
435 | errorText->setText(1, isGIF); |
||
436 | errorText->setPixmap(0, onlyWarning); |
||
437 | //QToolTip::add(errorText, isGIFtoolTip); |
||
438 | break; |
||
5676 | fschmid | 439 | default: |
440 | break; |
||
1232 | fschmid | 441 | } |
442 | } |
||
1268 | fschmid | 443 | object->setOpen( true ); |
1232 | fschmid | 444 | } |
445 | if (itemError) |
||
446 | object->setPixmap( 0, graveError ); |
||
447 | else |
||
448 | object->setPixmap( 0, onlyWarning ); |
||
449 | } |
||
450 | } |
||
451 | if (hasError) |
||
452 | { |
||
453 | if (pageGraveError) |
||
454 | page->setPixmap( 0, graveError ); |
||
455 | else |
||
456 | page->setPixmap( 0, onlyWarning ); |
||
1268 | fschmid | 457 | page->setOpen( true ); |
1232 | fschmid | 458 | } |
459 | else |
||
460 | page->setPixmap( 0, noErrors ); |
||
461 | page->setText(0, doc->MasterPages.at(a)->PageNam); |
||
462 | } |
||
463 | for (int a = 0; a < static_cast<int>(doc->DocPages.count()); ++a) |
||
464 | { |
||
465 | QString tmp; |
||
466 | hasError = false; |
||
467 | bool pageGraveError = false; |
||
468 | QListViewItem * page = new QListViewItem( item, pagep ); |
||
1244 | fschmid | 469 | pageMap.insert(page, a); |
1232 | fschmid | 470 | pagep = page; |
471 | QMap<int, errorCodes>::Iterator it2; |
||
472 | for (it2 = doc->docItemErrors.begin(); it2 != doc->docItemErrors.end(); ++it2) |
||
473 | { |
||
474 | if (doc->DocItems.at(it2.key())->OwnPage == a) |
||
475 | { |
||
476 | hasError = true; |
||
477 | bool itemError = false; |
||
478 | QListViewItem * object = new QListViewItem( page, 0 ); |
||
1361 | tsoots | 479 | object->setText(0, doc->DocItems.at(it2.key())->itemName()); |
1235 | fschmid | 480 | itemMap.insert(object, doc->DocItems.at(it2.key())->ItemNr); |
1232 | fschmid | 481 | errorCodes::Iterator it3; |
482 | if (it2.data().count() == 1) |
||
483 | { |
||
484 | it3 = it2.data().begin(); |
||
485 | switch (it3.key()) |
||
486 | { |
||
4512 | cbradney | 487 | case MissingGlyph: |
1232 | fschmid | 488 | object->setText(1, missingGlyph); |
489 | hasGraveError = true; |
||
490 | pageGraveError = true; |
||
491 | itemError = true; |
||
492 | break; |
||
4512 | cbradney | 493 | case TextOverflow: |
1232 | fschmid | 494 | object->setText(1, textOverflow); |
495 | break; |
||
4512 | cbradney | 496 | case ObjectNotOnPage: |
1232 | fschmid | 497 | object->setText(1, notOnPage); |
498 | break; |
||
4512 | cbradney | 499 | case MissingImage: |
1232 | fschmid | 500 | object->setText(1, missingImg); |
501 | hasGraveError = true; |
||
502 | pageGraveError = true; |
||
503 | itemError = true; |
||
504 | break; |
||
4512 | cbradney | 505 | case ImageDPITooLow: |
5237 | fschmid | 506 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
507 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
508 | object->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres)); |
||
1232 | fschmid | 509 | break; |
5239 | fschmid | 510 | case ImageDPITooHigh: |
511 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
||
512 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
513 | object->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres)); |
||
514 | break; |
||
4512 | cbradney | 515 | case Transparency: |
1235 | fschmid | 516 | object->setText(1, transpar); |
517 | hasGraveError = true; |
||
518 | pageGraveError = true; |
||
519 | itemError = true; |
||
520 | break; |
||
4512 | cbradney | 521 | case PDFAnnotField: |
1284 | fschmid | 522 | object->setText(1, annot); |
523 | break; |
||
4512 | cbradney | 524 | case PlacedPDF: |
1284 | fschmid | 525 | object->setText(1, rasterPDF); |
526 | break; |
||
5269 | subik | 527 | case ImageIsGIF: |
528 | object->setText(1, isGIF); |
||
529 | //QToolTip::add(object, isGIFtoolTip); |
||
530 | break; |
||
5676 | fschmid | 531 | default: |
532 | break; |
||
1232 | fschmid | 533 | } |
534 | } |
||
535 | else |
||
536 | { |
||
537 | for (it3 = it2.data().begin(); it3 != it2.data().end(); ++it3) |
||
538 | { |
||
539 | QListViewItem * errorText = new QListViewItem( object, 0 ); |
||
540 | switch (it3.key()) |
||
541 | { |
||
5239 | fschmid | 542 | case MissingGlyph: |
1232 | fschmid | 543 | errorText->setText(1, missingGlyph); |
544 | errorText->setPixmap( 0, graveError ); |
||
545 | hasGraveError = true; |
||
546 | pageGraveError = true; |
||
547 | itemError = true; |
||
548 | break; |
||
5239 | fschmid | 549 | case TextOverflow: |
1232 | fschmid | 550 | errorText->setText(1, textOverflow); |
551 | errorText->setPixmap( 0, onlyWarning ); |
||
552 | break; |
||
5239 | fschmid | 553 | case ObjectNotOnPage: |
1232 | fschmid | 554 | errorText->setText(1, notOnPage); |
555 | errorText->setPixmap( 0, onlyWarning ); |
||
556 | break; |
||
5239 | fschmid | 557 | case MissingImage: |
1232 | fschmid | 558 | errorText->setText(1, missingImg); |
559 | errorText->setPixmap( 0, graveError ); |
||
560 | hasGraveError = true; |
||
561 | pageGraveError = true; |
||
562 | itemError = true; |
||
563 | break; |
||
5239 | fschmid | 564 | case ImageDPITooLow: |
5237 | fschmid | 565 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
566 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
567 | errorText->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres)); |
||
1232 | fschmid | 568 | errorText->setPixmap( 0, onlyWarning ); |
569 | break; |
||
5239 | fschmid | 570 | case ImageDPITooHigh: |
571 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
||
572 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
573 | errorText->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres)); |
||
574 | errorText->setPixmap( 0, onlyWarning ); |
||
575 | break; |
||
576 | case Transparency: |
||
1235 | fschmid | 577 | errorText->setText(1, transpar); |
578 | errorText->setPixmap( 0, graveError ); |
||
579 | hasGraveError = true; |
||
580 | pageGraveError = true; |
||
581 | itemError = true; |
||
582 | break; |
||
5239 | fschmid | 583 | case PDFAnnotField: |
1284 | fschmid | 584 | errorText->setText(1, annot); |
585 | errorText->setPixmap( 0, onlyWarning ); |
||
586 | break; |
||
5239 | fschmid | 587 | case PlacedPDF: |
1284 | fschmid | 588 | errorText->setText(1, rasterPDF); |
589 | errorText->setPixmap( 0, onlyWarning ); |
||
590 | break; |
||
5269 | subik | 591 | case ImageIsGIF: |
592 | errorText->setText(1, isGIF); |
||
593 | errorText->setPixmap(0, onlyWarning); |
||
594 | //QToolTip::add(errorText, isGIFtoolTip); |
||
595 | break; |
||
5676 | fschmid | 596 | default: |
597 | break; |
||
1232 | fschmid | 598 | } |
599 | } |
||
1268 | fschmid | 600 | object->setOpen( true ); |
1232 | fschmid | 601 | } |
602 | if (itemError) |
||
603 | object->setPixmap( 0, graveError ); |
||
604 | else |
||
605 | object->setPixmap( 0, onlyWarning ); |
||
606 | } |
||
607 | } |
||
608 | if (hasError) |
||
609 | { |
||
610 | if (pageGraveError) |
||
611 | page->setPixmap( 0, graveError ); |
||
612 | else |
||
613 | page->setPixmap( 0, onlyWarning ); |
||
1268 | fschmid | 614 | page->setOpen( true ); |
1232 | fschmid | 615 | } |
616 | else |
||
617 | page->setPixmap( 0, noErrors ); |
||
618 | page->setText(0, tr("Page ")+tmp.setNum(a+1)); |
||
619 | } |
||
620 | QMap<int, errorCodes>::Iterator it2; |
||
621 | bool hasfreeItems = false; |
||
622 | for (it2 = doc->docItemErrors.begin(); it2 != doc->docItemErrors.end(); ++it2) |
||
623 | { |
||
624 | if (doc->DocItems.at(it2.key())->OwnPage == -1) |
||
625 | { |
||
626 | hasfreeItems = true; |
||
627 | break; |
||
628 | } |
||
629 | } |
||
630 | if (hasfreeItems) |
||
631 | { |
||
632 | bool hasError = false; |
||
633 | bool pageGraveError = false; |
||
634 | QListViewItem * page = new QListViewItem( item, pagep ); |
||
635 | pagep = page; |
||
636 | for (it2 = doc->docItemErrors.begin(); it2 != doc->docItemErrors.end(); ++it2) |
||
637 | { |
||
638 | if (doc->DocItems.at(it2.key())->OwnPage == -1) |
||
639 | { |
||
640 | hasError = true; |
||
641 | QListViewItem * object = new QListViewItem( page, 0 ); |
||
1361 | tsoots | 642 | object->setText(0, doc->DocItems.at(it2.key())->itemName()); |
1235 | fschmid | 643 | itemMap.insert(object, doc->DocItems.at(it2.key())->ItemNr); |
1232 | fschmid | 644 | errorCodes::Iterator it3; |
645 | if (it2.data().count() == 1) |
||
646 | { |
||
647 | it3 = it2.data().begin(); |
||
648 | switch (it3.key()) |
||
649 | { |
||
5239 | fschmid | 650 | case MissingGlyph: |
1232 | fschmid | 651 | object->setText(1, missingGlyph); |
652 | hasGraveError = true; |
||
653 | pageGraveError = true; |
||
654 | break; |
||
5239 | fschmid | 655 | case TextOverflow: |
1232 | fschmid | 656 | object->setText(1, textOverflow); |
657 | break; |
||
5239 | fschmid | 658 | case ObjectNotOnPage: |
1232 | fschmid | 659 | object->setText(1, notOnPage); |
660 | break; |
||
5239 | fschmid | 661 | case MissingImage: |
1232 | fschmid | 662 | object->setText(1, missingImg); |
663 | hasGraveError = true; |
||
664 | pageGraveError = true; |
||
665 | break; |
||
5239 | fschmid | 666 | case ImageDPITooLow: |
5237 | fschmid | 667 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
668 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
669 | object->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres)); |
||
1232 | fschmid | 670 | break; |
5239 | fschmid | 671 | case ImageDPITooHigh: |
672 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
||
673 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
674 | object->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres)); |
||
675 | break; |
||
676 | case Transparency: |
||
1235 | fschmid | 677 | object->setText(1, transpar); |
678 | hasGraveError = true; |
||
679 | pageGraveError = true; |
||
680 | break; |
||
5239 | fschmid | 681 | case PDFAnnotField: |
1284 | fschmid | 682 | object->setText(1, annot); |
683 | break; |
||
5239 | fschmid | 684 | case PlacedPDF: |
1284 | fschmid | 685 | object->setText(1, rasterPDF); |
686 | break; |
||
5269 | subik | 687 | case ImageIsGIF: |
688 | object->setText(1, isGIF); |
||
689 | //QToolTip::add(object, isGIFtoolTip); |
||
690 | break; |
||
5676 | fschmid | 691 | default: |
692 | break; |
||
1232 | fschmid | 693 | } |
694 | } |
||
695 | else |
||
696 | { |
||
697 | for (it3 = it2.data().begin(); it3 != it2.data().end(); ++it3) |
||
698 | { |
||
699 | QListViewItem * errorText = new QListViewItem( object, 0 ); |
||
700 | switch (it3.key()) |
||
701 | { |
||
5239 | fschmid | 702 | case MissingGlyph: |
1232 | fschmid | 703 | errorText->setText(1, missingGlyph); |
704 | errorText->setPixmap( 0, graveError ); |
||
705 | hasGraveError = true; |
||
706 | pageGraveError = true; |
||
707 | break; |
||
5239 | fschmid | 708 | case TextOverflow: |
1232 | fschmid | 709 | errorText->setText(1, textOverflow); |
710 | errorText->setPixmap( 0, onlyWarning ); |
||
711 | break; |
||
5239 | fschmid | 712 | case ObjectNotOnPage: |
1232 | fschmid | 713 | errorText->setText(1, notOnPage); |
714 | errorText->setPixmap( 0, onlyWarning ); |
||
715 | break; |
||
5239 | fschmid | 716 | case MissingImage: |
1232 | fschmid | 717 | errorText->setText(1, missingImg); |
718 | errorText->setPixmap( 0, graveError ); |
||
719 | hasGraveError = true; |
||
720 | pageGraveError = true; |
||
721 | break; |
||
5239 | fschmid | 722 | case ImageDPITooLow: |
5237 | fschmid | 723 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
724 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
725 | errorText->setText(1, lowDPI.arg(minRes).arg(xres).arg(yres)); |
||
1232 | fschmid | 726 | errorText->setPixmap( 0, onlyWarning ); |
727 | break; |
||
5239 | fschmid | 728 | case ImageDPITooHigh: |
729 | xres = qRound(72.0 / doc->DocItems.at(it2.key())->imageXScale()); |
||
730 | yres = qRound(72.0 / doc->DocItems.at(it2.key())->imageYScale()); |
||
731 | errorText->setText(1, highDPI.arg(maxRes).arg(xres).arg(yres)); |
||
732 | errorText->setPixmap( 0, onlyWarning ); |
||
733 | break; |
||
734 | case Transparency: |
||
1235 | fschmid | 735 | errorText->setText(1, transpar); |
736 | errorText->setPixmap( 0, graveError ); |
||
737 | hasGraveError = true; |
||
738 | pageGraveError = true; |
||
739 | break; |
||
5239 | fschmid | 740 | case PDFAnnotField: |
1284 | fschmid | 741 | errorText->setText(1, annot); |
742 | errorText->setPixmap( 0, onlyWarning ); |
||
743 | break; |
||
5239 | fschmid | 744 | case PlacedPDF: |
1284 | fschmid | 745 | errorText->setText(1, rasterPDF); |
746 | errorText->setPixmap( 0, onlyWarning ); |
||
747 | break; |
||
5269 | subik | 748 | case ImageIsGIF: |
749 | errorText->setText(1, isGIF); |
||
750 | errorText->setPixmap(0, onlyWarning); |
||
751 | //QToolTip::add(errorText, isGIFtoolTip); |
||
752 | break; |
||
5676 | fschmid | 753 | default: |
754 | break; |
||
1232 | fschmid | 755 | } |
756 | } |
||
1268 | fschmid | 757 | object->setOpen( true ); |
1232 | fschmid | 758 | } |
759 | if (pageGraveError) |
||
760 | object->setPixmap( 0, graveError ); |
||
761 | else |
||
762 | object->setPixmap( 0, onlyWarning ); |
||
763 | } |
||
764 | } |
||
765 | if (hasError) |
||
766 | { |
||
767 | if (pageGraveError) |
||
768 | page->setPixmap( 0, graveError ); |
||
769 | else |
||
770 | page->setPixmap( 0, onlyWarning ); |
||
1268 | fschmid | 771 | page->setOpen( true ); |
1232 | fschmid | 772 | } |
773 | else |
||
774 | page->setPixmap( 0, noErrors ); |
||
775 | page->setText(0, tr("Free Objects")); |
||
776 | } |
||
777 | if (hasGraveError) |
||
778 | item->setPixmap( 0, graveError ); |
||
779 | else |
||
780 | item->setPixmap( 0, onlyWarning ); |
||
781 | item->setText( 1, tr( "Problems found" ) ); |
||
782 | item->setOpen( true ); |
||
5676 | fschmid | 783 | ignoreErrors->setText( tr("&Ignore Errors")); |
1232 | fschmid | 784 | } |
4049 | cbradney | 785 | connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(newScan(const QString&))); |
1235 | fschmid | 786 | connect(reportDisplay, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelect(QListViewItem*))); |
1232 | fschmid | 787 | } |
788 | |||
789 | /* |
||
790 | * Sets the strings of the subwidgets using the current |
||
791 | * language. |
||
792 | */ |
||
793 | void CheckDocument::languageChange() |
||
794 | { |
||
1245 | fschmid | 795 | setCaption( tr( "Preflight Verifier" ) ); |
1232 | fschmid | 796 | reportDisplay->header()->setLabel( 0, tr( "Items" ) ); |
797 | reportDisplay->header()->setLabel( 1, tr( "Problems" ) ); |
||
4510 | subik | 798 | |
2397 | cbradney | 799 | textLabel1->setText( tr("Current Profile:")); |
5237 | fschmid | 800 | ignoreErrors->setText( tr("&Ignore Errors")); |
801 | reScan->setText( tr("Check again")); |
||
5287 | cbradney | 802 | |
803 | missingGlyph = tr("Glyphs missing"); |
||
804 | textOverflow = tr("Text overflow"); |
||
805 | notOnPage = tr("Object is not on a Page"); |
||
806 | missingImg = tr("Missing Image"); |
||
807 | lowDPI = tr("Image resolution below %1 DPI, currently %2 x %3 DPI"); |
||
808 | highDPI = tr("Image resolution above %1 DPI, currently %2 x %3 DPI"); |
||
809 | transpar = tr("Object has transparency"); |
||
810 | annot = tr("Object is a PDF Annotation or Field"); |
||
811 | rasterPDF = tr("Object is a placed PDF"); |
||
812 | isGIF = tr("Image is GIF"); |
||
813 | //isGIFtoolTip = "<qt>" + tr("GIF images are not reccomended for print. See the online docs for more info") + "</qt>"; |
||
1232 | fschmid | 814 | } |
815 | |||
4510 | subik | 816 | void CheckDocument::setIgnoreEnabled(bool state) |
817 | { |
||
818 | noButton = !state; |
||
819 | if (state) |
||
820 | ignoreErrors->show(); |
||
821 | else |
||
822 | ignoreErrors->hide(); |
||
823 | } |
||
824 | |||
825 | bool CheckDocument::isIgnoreEnabled() |
||
826 | { |
||
827 | return !noButton; |
||
828 | } |