/[gentoo-x86]/net-print/kink/files/kink-0.2.1-libinklevel-0.6.6.patch
Gentoo

Contents of /net-print/kink/files/kink-0.2.1-libinklevel-0.6.6.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Dec 4 18:19:26 2009 UTC (7 years, 4 months ago) by ssuominen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Remove masked kink.

1 # Marcus D. Hanwell <cryos@gentoo.org> 6 January 2007.
2 # Fixes to allow kink to compile against the new API in libinklevel-0.6.6
3 diff -u ../kink-0.2.1-orig/kink/kink.cpp kink/kink.cpp
4 --- ../kink-0.2.1-orig/kink/kink.cpp 2007-01-06 14:04:45.000000000 +0000
5 +++ kink/kink.cpp 2007-01-06 18:47:06.000000000 +0000
6 @@ -80,10 +80,10 @@
7 switch(callback)
8 {
9 case OK:
10 - add_device_to_list(PARPORT,i,level.model);
11 + add_device_to_list(PARPORT, i, level.model);
12 break;
13 case PRINTER_NOT_SUPPORTED:
14 - add_device_to_list(PARPORT,i,(unsigned char *)"Unsupported device");
15 + add_device_to_list(PARPORT,i,(char *)"Unsupported device");
16 break;
17 }
18 }
19 @@ -95,10 +95,10 @@
20 switch(callback)
21 {
22 case OK:
23 - add_device_to_list(USB,i,level.model);
24 + add_device_to_list(USB , i, (level.model));
25 break;
26 case PRINTER_NOT_SUPPORTED:
27 - add_device_to_list(USB,i,(unsigned char *)"Unsupported device");
28 + add_device_to_list(USB, i, (char *)"Unsupported device");
29 break;
30 }
31 }
32 @@ -150,7 +150,7 @@
33 \fn KInk::add_device_to_list(void)
34 Add a device to the combo box list
35 */
36 -void KInk::add_device_to_list(int type, int port, unsigned char *model)
37 +void KInk::add_device_to_list(int type, int port, char *model)
38 {
39 listed_devices[listed_count].device_type = type;
40 listed_devices[listed_count].device_port = port;
41 @@ -203,116 +203,79 @@
42 grpLevels->show();
43
44 callback=get_ink_level(last_type,last_port,&level);
45 - switch(callback)
46 + if (callback == OK)
47 {
48 - case OK:
49 -
50 - if(level.black == 0 &&
51 - level.color == 0 &&
52 - level.cyan == 0 &&
53 - level.magenta == 0 &&
54 - level.yellow == 0 &&
55 - level.photo == 0 &&
56 - level.photocyan == 0 &&
57 - level.photomagenta == 0 &&
58 - level.photoyellow == 0)
59 - level.type = RESPONSE_INVALID;
60 -
61 - switch (level.type) {
62 - case ONE_COLOR_FOUND:
63 - barColor->setEnabled(true);
64 - barColor->setProgress(level.color);
65 - break;
66 - case ONE_BLACK_COLOR_FOUND:
67 - barBlack->setEnabled(true);
68 - barBlack->setProgress(level.black);
69 - break;
70 - case TWO_COLORS_FOUND:
71 - barBlack->setEnabled(true);
72 - barColor->setEnabled(true);
73 - barBlack->setProgress(level.black);
74 - barColor->setProgress(level.color);
75 - break;
76 - case TWO_PHOTO_COLORS_FOUND:
77 - barPhoto->setEnabled(true);
78 - barColor->setEnabled(true);
79 - barPhoto->setProgress(level.photo);
80 - barColor->setProgress(level.color);
81 - break;
82 - case THREE_COLORS_FOUND:
83 - barCyan->setEnabled(true);
84 - barMagenta->setEnabled(true);
85 - barYellow->setEnabled(true);
86 - barCyan->setProgress(level.cyan);
87 - barMagenta->setProgress(level.magenta);
88 - barYellow->setProgress(level.yellow);
89 - break;
90 - case FOUR_COLORS_FOUND:
91 - barBlack->setEnabled(true);
92 - barCyan->setEnabled(true);
93 - barMagenta->setEnabled(true);
94 - barYellow->setEnabled(true);
95 - barBlack->setProgress(level.black);
96 - barCyan->setProgress(level.cyan);
97 - barMagenta->setProgress(level.magenta);
98 - barYellow->setProgress(level.yellow);
99 - break;
100 - case SIX_COLORS_FOUND:
101 - barBlack->setEnabled(true);
102 - barPhotoCyan->setEnabled(true);
103 - barPhotoMagenta->setEnabled(true);
104 - barCyan->setEnabled(true);
105 - barMagenta->setEnabled(true);
106 - barYellow->setEnabled(true);
107 - barBlack->setProgress(level.black);
108 - barPhotoCyan->setProgress(level.photocyan);
109 - barPhotoMagenta->setProgress(level.photomagenta);
110 - barCyan->setProgress(level.cyan);
111 - barMagenta->setProgress(level.magenta);
112 - barYellow->setProgress(level.yellow);
113 - break;
114 - case SEVEN_COLORS_FOUND:
115 - barBlack->setEnabled(true);
116 - barPhotoCyan->setEnabled(true);
117 - barPhotoMagenta->setEnabled(true);
118 - barPhotoYellow->setEnabled(true);
119 - barCyan->setEnabled(true);
120 - barMagenta->setEnabled(true);
121 - barYellow->setEnabled(true);
122 - barBlack->setProgress(level.black);
123 - barPhotoCyan->setProgress(level.photocyan);
124 - barPhotoMagenta->setProgress(level.photomagenta);
125 - barPhotoYellow->setProgress(level.photoyellow);
126 - barCyan->setProgress(level.cyan);
127 - barMagenta->setProgress(level.magenta);
128 - barYellow->setProgress(level.yellow);
129 - break;
130 - case RESPONSE_INVALID:
131 - show_error(tr2i18n("<b>Invalid response read from device</b><br><br>Your printer reported that all ink tanks are empty or your printer is currently switched-off.<br><br>Power-on your device and verify the correct installation of cartdriges, then try again clicking <b>Update</b>."));
132 + QProgressBar* ptrBar = 0;
133 + for (int i = 0; i < MAX_CARTRIDGE_TYPES; i++)
134 + {
135 + switch (level.levels[i][INDEX_TYPE])
136 + {
137 + case CARTRIDGE_BLACK:
138 + ptrBar = barBlack;
139 + break;
140 + case CARTRIDGE_COLOR:
141 + ptrBar = barColor;
142 + break;
143 + case CARTRIDGE_PHOTO:
144 + ptrBar = barPhoto;
145 + break;
146 + case CARTRIDGE_CYAN:
147 + ptrBar = barCyan;
148 + break;
149 + case CARTRIDGE_MAGENTA:
150 + ptrBar = barMagenta;
151 + break;
152 + case CARTRIDGE_YELLOW:
153 + ptrBar = barYellow;
154 + break;
155 + case CARTRIDGE_PHOTOBLACK:
156 + // Not implemented yet - add it?
157 + break;
158 + case CARTRIDGE_PHOTOCYAN:
159 + ptrBar = barPhotoCyan;
160 + break;
161 + case CARTRIDGE_PHOTOMAGENTA:
162 + ptrBar = barPhotoMagenta;
163 + break;
164 + case CARTRIDGE_PHOTOYELLOW:
165 + ptrBar = barPhotoYellow;
166 + break;
167 + }
168 + if (ptrBar)
169 + {
170 + ptrBar->setEnabled(true);
171 + ptrBar->setProgress(level.levels[i][INDEX_LEVEL]);
172 + }
173 + ptrBar = 0;
174 }
175 - break;
176 + }
177 + else
178 + {
179 +// show_error(tr2i18n("<b>Invalid response read from device</b><br><br>Your printer reported that all ink tanks are empty or your printer is currently switched-off.<br><br>Power-on your device and verify the correct installation of cartdriges, then try again clicking <b>Update</b>."));
180 + switch(callback)
181 + {
182 + case DEV_PARPORT_INACCESSIBLE:
183 + case DEV_LP_INACCESSIBLE:
184 + case COULD_NOT_GET_DEVICE_ID:
185 + case DEV_USB_LP_INACCESSIBLE:
186 + case COULD_NOT_WRITE_TO_PRINTER:
187 + case COULD_NOT_READ_FROM_PRINTER:
188 + case ERROR:
189 + case UNKNOWN_PORT_SPECIFIED:
190 + case NO_DEVICE_CLASS_FOUND:
191 + case NO_CMD_TAG_FOUND:
192 + case NO_PRINTER_FOUND:
193 + case COULD_NOT_PARSE_RESPONSE_FROM_PRINTER:
194 + show_error(tr2i18n("<b>Generic error</b><br><br>An error has occured communicating with the selected device. Click <b>Detect</b> and <b>Update</b> to refresh KInk status and try again. If the problem persists, e-mail me a description of the situation and all that can be helpful to me for reconstructing your execution environment."));
195 + break;
196 +
197 + case NO_INK_LEVEL_FOUND:
198 + show_error(tr2i18n("<b>Cannot read ink level from device</b><br><br>Cannot retrieve ink levels from the selected device. Ensure your printer is switched on and click on <b>Update</b> to try again."));
199 + break;
200
201 - case DEV_PARPORT_INACCESSIBLE:
202 - case DEV_LP_INACCESSIBLE:
203 - case COULD_NOT_GET_DEVICE_ID:
204 - case DEV_USB_LP_INACCESSIBLE:
205 - case COULD_NOT_WRITE_TO_PRINTER:
206 - case COULD_NOT_READ_FROM_PRINTER:
207 - case ERROR:
208 - case UNKNOWN_PORT_SPECIFIED:
209 - case NO_DEVICE_CLASS_FOUND:
210 - case NO_CMD_TAG_FOUND:
211 - case NO_PRINTER_FOUND:
212 - case COULD_NOT_PARSE_RESPONSE_FROM_PRINTER:
213 - show_error(tr2i18n("<b>Generic error</b><br><br>An error has occured communicating with the selected device. Click <b>Detect</b> and <b>Update</b> to refresh KInk status and try again. If the problem persists, e-mail me a description of the situation and all that can be helpful to me for reconstructing your execution environment."));
214 - break;
215 -
216 - case NO_INK_LEVEL_FOUND:
217 - show_error(tr2i18n("<b>Cannot read ink level from device</b><br><br>Cannot retrieve ink levels from the selected device. Ensure your printer is switched on and click on <b>Update</b> to try again."));
218 - break;
219 -
220 - case PRINTER_NOT_SUPPORTED:
221 - show_error(tr2i18n("<b>Unsupported printer!</b><br><br>Selected printer is not supported by this version of libinklevel. Take a look to <a href='http://home.arcor.de/markusheinz'>http://home.arcor.de/markusheinz</a> for a complete list of devices supported by your version of libinklevel."));
222 - break;
223 - }
224 + case PRINTER_NOT_SUPPORTED:
225 + show_error(tr2i18n("<b>Unsupported printer!</b><br><br>Selected printer is not supported by this version of libinklevel. Take a look to <a href='http://home.arcor.de/markusheinz'>http://home.arcor.de/markusheinz</a> for a complete list of devices supported by your version of libinklevel."));
226 + break;
227 + }
228 + }
229 }
230 diff -u ../kink-0.2.1-orig/kink/kink.h kink/kink.h
231 --- ../kink-0.2.1-orig/kink/kink.h 2007-01-06 14:04:45.000000000 +0000
232 +++ kink/kink.h 2007-01-06 18:20:59.000000000 +0000
233 @@ -67,7 +67,7 @@
234 DEVICE_INFO listed_devices[PARPORT_LAST_PORT + USB_LAST_PORT];
235
236 private:
237 - void add_device_to_list(int type, int port, unsigned char *model);
238 + void add_device_to_list(int type, int port, char *model);
239 void show_error(QString errStr);
240 void update_view(void);
241 };

  ViewVC Help
Powered by ViewVC 1.1.20