1.1 --- a/examples/Common/QtConfigurator/Resources/config.ui Fri Nov 21 01:43:30 2008 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,664 +0,0 @@
1.4 -<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
1.5 -<class>Configurator</class>
1.6 -<widget class="QWidget">
1.7 - <property name="name">
1.8 - <cstring>configuration</cstring>
1.9 - </property>
1.10 - <property name="geometry">
1.11 - <rect>
1.12 - <x>0</x>
1.13 - <y>0</y>
1.14 - <width>1013</width>
1.15 - <height>693</height>
1.16 - </rect>
1.17 - </property>
1.18 - <property name="caption">
1.19 - <string>Form1</string>
1.20 - </property>
1.21 - <grid>
1.22 - <property name="name">
1.23 - <cstring>unnamed</cstring>
1.24 - </property>
1.25 - <widget class="QLabel" row="0" column="0" rowspan="1" colspan="5">
1.26 - <property name="name">
1.27 - <cstring>textLabel1</cstring>
1.28 - </property>
1.29 - <property name="text">
1.30 - <string><h1>System Configurator</h1></string>
1.31 - </property>
1.32 - </widget>
1.33 - <widget class="QLabel" row="1" column="0" rowspan="1" colspan="3">
1.34 - <property name="name">
1.35 - <cstring>textLabel2</cstring>
1.36 - </property>
1.37 - <property name="text">
1.38 - <string><h2>Base System</h2></string>
1.39 - </property>
1.40 - </widget>
1.41 - <spacer row="1" column="3">
1.42 - <property name="name">
1.43 - <cstring>spacer11</cstring>
1.44 - </property>
1.45 - <property name="orientation">
1.46 - <enum>Horizontal</enum>
1.47 - </property>
1.48 - <property name="sizeType">
1.49 - <enum>Expanding</enum>
1.50 - </property>
1.51 - <property name="sizeHint">
1.52 - <size>
1.53 - <width>130</width>
1.54 - <height>20</height>
1.55 - </size>
1.56 - </property>
1.57 - </spacer>
1.58 - <widget class="QLabel" row="1" column="4" rowspan="1" colspan="3">
1.59 - <property name="name">
1.60 - <cstring>textLabel2_5</cstring>
1.61 - </property>
1.62 - <property name="text">
1.63 - <string><h2>Hard Disks</h2></string>
1.64 - </property>
1.65 - </widget>
1.66 - <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="3">
1.67 - <item>
1.68 - <property name="text">
1.69 - <string>(Not selected)</string>
1.70 - </property>
1.71 - </item>
1.72 - <property name="name">
1.73 - <cstring>base_system</cstring>
1.74 - </property>
1.75 - </widget>
1.76 - <widget class="QLabel" row="2" column="0">
1.77 - <property name="name">
1.78 - <cstring>textLabel4</cstring>
1.79 - </property>
1.80 - <property name="text">
1.81 - <string>Model</string>
1.82 - </property>
1.83 - </widget>
1.84 - <spacer row="3" column="3">
1.85 - <property name="name">
1.86 - <cstring>spacer21</cstring>
1.87 - </property>
1.88 - <property name="orientation">
1.89 - <enum>Vertical</enum>
1.90 - </property>
1.91 - <property name="sizeType">
1.92 - <enum>Expanding</enum>
1.93 - </property>
1.94 - <property name="sizeHint">
1.95 - <size>
1.96 - <width>20</width>
1.97 - <height>30</height>
1.98 - </size>
1.99 - </property>
1.100 - </spacer>
1.101 - <widget class="QFrame" row="2" column="4" rowspan="2" colspan="3">
1.102 - <property name="name">
1.103 - <cstring>hard_disks</cstring>
1.104 - </property>
1.105 - <property name="frameShape">
1.106 - <enum>StyledPanel</enum>
1.107 - </property>
1.108 - <property name="frameShadow">
1.109 - <enum>Raised</enum>
1.110 - </property>
1.111 - <vbox>
1.112 - <property name="name">
1.113 - <cstring>unnamed</cstring>
1.114 - </property>
1.115 - <widget class="QFrame">
1.116 - <property name="name">
1.117 - <cstring>hard_disk</cstring>
1.118 - </property>
1.119 - <property name="frameShape">
1.120 - <enum>StyledPanel</enum>
1.121 - </property>
1.122 - <property name="frameShadow">
1.123 - <enum>Raised</enum>
1.124 - </property>
1.125 - <hbox>
1.126 - <property name="name">
1.127 - <cstring>unnamed</cstring>
1.128 - </property>
1.129 - <widget class="QLabel">
1.130 - <property name="name">
1.131 - <cstring>textLabel4_3_2</cstring>
1.132 - </property>
1.133 - <property name="text">
1.134 - <string>Hard disk drive</string>
1.135 - </property>
1.136 - </widget>
1.137 - <widget class="QComboBox">
1.138 - <item>
1.139 - <property name="text">
1.140 - <string>(Not selected)</string>
1.141 - </property>
1.142 - </item>
1.143 - <property name="name">
1.144 - <cstring>hard_disk_value</cstring>
1.145 - </property>
1.146 - </widget>
1.147 - <widget class="QPushButton">
1.148 - <property name="name">
1.149 - <cstring>remove_hard_disk</cstring>
1.150 - </property>
1.151 - <property name="text">
1.152 - <string>Remove</string>
1.153 - </property>
1.154 - </widget>
1.155 - </hbox>
1.156 - </widget>
1.157 - </vbox>
1.158 - </widget>
1.159 - <widget class="QComboBox" row="6" column="1" rowspan="1" colspan="3">
1.160 - <item>
1.161 - <property name="text">
1.162 - <string>(Not selected)</string>
1.163 - </property>
1.164 - </item>
1.165 - <property name="name">
1.166 - <cstring>cpu</cstring>
1.167 - </property>
1.168 - </widget>
1.169 - <spacer row="4" column="6">
1.170 - <property name="name">
1.171 - <cstring>spacer3</cstring>
1.172 - </property>
1.173 - <property name="orientation">
1.174 - <enum>Horizontal</enum>
1.175 - </property>
1.176 - <property name="sizeType">
1.177 - <enum>Expanding</enum>
1.178 - </property>
1.179 - <property name="sizeHint">
1.180 - <size>
1.181 - <width>230</width>
1.182 - <height>20</height>
1.183 - </size>
1.184 - </property>
1.185 - </spacer>
1.186 - <spacer row="4" column="0" rowspan="1" colspan="4">
1.187 - <property name="name">
1.188 - <cstring>spacer8</cstring>
1.189 - </property>
1.190 - <property name="orientation">
1.191 - <enum>Horizontal</enum>
1.192 - </property>
1.193 - <property name="sizeType">
1.194 - <enum>Expanding</enum>
1.195 - </property>
1.196 - <property name="sizeHint">
1.197 - <size>
1.198 - <width>350</width>
1.199 - <height>20</height>
1.200 - </size>
1.201 - </property>
1.202 - </spacer>
1.203 - <widget class="QLabel" row="6" column="0">
1.204 - <property name="name">
1.205 - <cstring>textLabel4_2</cstring>
1.206 - </property>
1.207 - <property name="text">
1.208 - <string>CPU</string>
1.209 - </property>
1.210 - </widget>
1.211 - <widget class="QPushButton" row="4" column="4" rowspan="1" colspan="2">
1.212 - <property name="name">
1.213 - <cstring>add_hard_disk</cstring>
1.214 - </property>
1.215 - <property name="text">
1.216 - <string>Add hard disk</string>
1.217 - </property>
1.218 - </widget>
1.219 - <widget class="QLabel" row="5" column="4" rowspan="1" colspan="3">
1.220 - <property name="name">
1.221 - <cstring>textLabel2_6</cstring>
1.222 - </property>
1.223 - <property name="text">
1.224 - <string><h2>Additional Storage</h2></string>
1.225 - </property>
1.226 - </widget>
1.227 - <widget class="QLabel" row="5" column="0" rowspan="1" colspan="3">
1.228 - <property name="name">
1.229 - <cstring>textLabel2_2</cstring>
1.230 - </property>
1.231 - <property name="text">
1.232 - <string><h2>Processor</h2></string>
1.233 - </property>
1.234 - </widget>
1.235 - <spacer row="7" column="3">
1.236 - <property name="name">
1.237 - <cstring>spacer22</cstring>
1.238 - </property>
1.239 - <property name="orientation">
1.240 - <enum>Vertical</enum>
1.241 - </property>
1.242 - <property name="sizeType">
1.243 - <enum>Expanding</enum>
1.244 - </property>
1.245 - <property name="sizeHint">
1.246 - <size>
1.247 - <width>20</width>
1.248 - <height>30</height>
1.249 - </size>
1.250 - </property>
1.251 - </spacer>
1.252 - <widget class="QLabel" row="9" column="0" rowspan="1" colspan="2">
1.253 - <property name="name">
1.254 - <cstring>textLabel2_3</cstring>
1.255 - </property>
1.256 - <property name="text">
1.257 - <string><h2>Memory</h2></string>
1.258 - </property>
1.259 - </widget>
1.260 - <widget class="QFrame" row="10" column="0" rowspan="1" colspan="4">
1.261 - <property name="name">
1.262 - <cstring>memory_units</cstring>
1.263 - </property>
1.264 - <property name="frameShape">
1.265 - <enum>StyledPanel</enum>
1.266 - </property>
1.267 - <property name="frameShadow">
1.268 - <enum>Raised</enum>
1.269 - </property>
1.270 - <vbox>
1.271 - <property name="name">
1.272 - <cstring>unnamed</cstring>
1.273 - </property>
1.274 - <widget class="QFrame">
1.275 - <property name="name">
1.276 - <cstring>memory_unit</cstring>
1.277 - </property>
1.278 - <property name="frameShape">
1.279 - <enum>StyledPanel</enum>
1.280 - </property>
1.281 - <property name="frameShadow">
1.282 - <enum>Raised</enum>
1.283 - </property>
1.284 - <hbox>
1.285 - <property name="name">
1.286 - <cstring>unnamed</cstring>
1.287 - </property>
1.288 - <widget class="QLabel">
1.289 - <property name="name">
1.290 - <cstring>textLabel4_3</cstring>
1.291 - </property>
1.292 - <property name="text">
1.293 - <string>Memory unit</string>
1.294 - </property>
1.295 - </widget>
1.296 - <widget class="QComboBox">
1.297 - <item>
1.298 - <property name="text">
1.299 - <string>(Not selected)</string>
1.300 - </property>
1.301 - </item>
1.302 - <property name="name">
1.303 - <cstring>memory_unit_value</cstring>
1.304 - </property>
1.305 - </widget>
1.306 - <widget class="QPushButton">
1.307 - <property name="name">
1.308 - <cstring>remove_memory_unit</cstring>
1.309 - </property>
1.310 - <property name="text">
1.311 - <string>Remove</string>
1.312 - </property>
1.313 - </widget>
1.314 - </hbox>
1.315 - </widget>
1.316 - </vbox>
1.317 - </widget>
1.318 - <widget class="QLabel" row="9" column="4" rowspan="1" colspan="3">
1.319 - <property name="name">
1.320 - <cstring>textLabel2_7</cstring>
1.321 - </property>
1.322 - <property name="text">
1.323 - <string><h2>Accessories</h2></string>
1.324 - </property>
1.325 - </widget>
1.326 - <widget class="QPushButton" row="8" column="4" rowspan="1" colspan="2">
1.327 - <property name="name">
1.328 - <cstring>add_storage_unit</cstring>
1.329 - </property>
1.330 - <property name="text">
1.331 - <string>Add storage</string>
1.332 - </property>
1.333 - </widget>
1.334 - <spacer row="8" column="6">
1.335 - <property name="name">
1.336 - <cstring>spacer4</cstring>
1.337 - </property>
1.338 - <property name="orientation">
1.339 - <enum>Horizontal</enum>
1.340 - </property>
1.341 - <property name="sizeType">
1.342 - <enum>Expanding</enum>
1.343 - </property>
1.344 - <property name="sizeHint">
1.345 - <size>
1.346 - <width>230</width>
1.347 - <height>20</height>
1.348 - </size>
1.349 - </property>
1.350 - </spacer>
1.351 - <spacer row="8" column="0" rowspan="1" colspan="4">
1.352 - <property name="name">
1.353 - <cstring>spacer9</cstring>
1.354 - </property>
1.355 - <property name="orientation">
1.356 - <enum>Horizontal</enum>
1.357 - </property>
1.358 - <property name="sizeType">
1.359 - <enum>Expanding</enum>
1.360 - </property>
1.361 - <property name="sizeHint">
1.362 - <size>
1.363 - <width>350</width>
1.364 - <height>20</height>
1.365 - </size>
1.366 - </property>
1.367 - </spacer>
1.368 - <widget class="QLabel" row="13" column="4">
1.369 - <property name="name">
1.370 - <cstring>textLabel4_2_2</cstring>
1.371 - </property>
1.372 - <property name="text">
1.373 - <string>Keyboard</string>
1.374 - </property>
1.375 - </widget>
1.376 - <spacer row="14" column="3">
1.377 - <property name="name">
1.378 - <cstring>spacer6</cstring>
1.379 - </property>
1.380 - <property name="orientation">
1.381 - <enum>Horizontal</enum>
1.382 - </property>
1.383 - <property name="sizeType">
1.384 - <enum>Expanding</enum>
1.385 - </property>
1.386 - <property name="sizeHint">
1.387 - <size>
1.388 - <width>40</width>
1.389 - <height>20</height>
1.390 - </size>
1.391 - </property>
1.392 - </spacer>
1.393 - <widget class="QComboBox" row="16" column="5" rowspan="1" colspan="2">
1.394 - <item>
1.395 - <property name="text">
1.396 - <string>(Not selected)</string>
1.397 - </property>
1.398 - </item>
1.399 - <property name="name">
1.400 - <cstring>screen</cstring>
1.401 - </property>
1.402 - </widget>
1.403 - <widget class="QLabel" row="12" column="0">
1.404 - <property name="name">
1.405 - <cstring>textLabel2_4</cstring>
1.406 - </property>
1.407 - <property name="text">
1.408 - <string><h2>Price</h2></string>
1.409 - </property>
1.410 - </widget>
1.411 - <widget class="QPushButton" row="14" column="1" rowspan="1" colspan="2">
1.412 - <property name="name">
1.413 - <cstring>export</cstring>
1.414 - </property>
1.415 - <property name="text">
1.416 - <string>Export</string>
1.417 - </property>
1.418 - </widget>
1.419 - <spacer row="15" column="0" rowspan="2" colspan="4">
1.420 - <property name="name">
1.421 - <cstring>spacer10</cstring>
1.422 - </property>
1.423 - <property name="orientation">
1.424 - <enum>Horizontal</enum>
1.425 - </property>
1.426 - <property name="sizeType">
1.427 - <enum>Expanding</enum>
1.428 - </property>
1.429 - <property name="sizeHint">
1.430 - <size>
1.431 - <width>346</width>
1.432 - <height>60</height>
1.433 - </size>
1.434 - </property>
1.435 - </spacer>
1.436 - <widget class="QPushButton" row="11" column="0" rowspan="1" colspan="2">
1.437 - <property name="name">
1.438 - <cstring>add_memory_unit</cstring>
1.439 - </property>
1.440 - <property name="text">
1.441 - <string>Add memory</string>
1.442 - </property>
1.443 - </widget>
1.444 - <widget class="QLabel" row="14" column="4">
1.445 - <property name="name">
1.446 - <cstring>textLabel4_2_3</cstring>
1.447 - </property>
1.448 - <property name="text">
1.449 - <string>Mouse</string>
1.450 - </property>
1.451 - </widget>
1.452 - <widget class="QLabel" row="15" column="4" rowspan="1" colspan="2">
1.453 - <property name="name">
1.454 - <cstring>textLabel2_9</cstring>
1.455 - </property>
1.456 - <property name="text">
1.457 - <string><h2>Display</h2></string>
1.458 - </property>
1.459 - </widget>
1.460 - <spacer row="11" column="2" rowspan="1" colspan="2">
1.461 - <property name="name">
1.462 - <cstring>spacer5</cstring>
1.463 - </property>
1.464 - <property name="orientation">
1.465 - <enum>Horizontal</enum>
1.466 - </property>
1.467 - <property name="sizeType">
1.468 - <enum>Expanding</enum>
1.469 - </property>
1.470 - <property name="sizeHint">
1.471 - <size>
1.472 - <width>180</width>
1.473 - <height>20</height>
1.474 - </size>
1.475 - </property>
1.476 - </spacer>
1.477 - <widget class="QComboBox" row="13" column="5" rowspan="1" colspan="2">
1.478 - <item>
1.479 - <property name="text">
1.480 - <string>(Not selected)</string>
1.481 - </property>
1.482 - </item>
1.483 - <property name="name">
1.484 - <cstring>keyboard</cstring>
1.485 - </property>
1.486 - </widget>
1.487 - <widget class="QLabel" row="16" column="4">
1.488 - <property name="name">
1.489 - <cstring>textLabel4_2_4</cstring>
1.490 - </property>
1.491 - <property name="text">
1.492 - <string>Screen</string>
1.493 - </property>
1.494 - </widget>
1.495 - <widget class="QPushButton" row="14" column="0">
1.496 - <property name="name">
1.497 - <cstring>update</cstring>
1.498 - </property>
1.499 - <property name="text">
1.500 - <string>Update</string>
1.501 - </property>
1.502 - </widget>
1.503 - <widget class="QLabel" row="12" column="4" rowspan="1" colspan="3">
1.504 - <property name="name">
1.505 - <cstring>textLabel2_8</cstring>
1.506 - </property>
1.507 - <property name="text">
1.508 - <string><h2>Input Devices</h2></string>
1.509 - </property>
1.510 - </widget>
1.511 - <widget class="QLabel" row="13" column="0" rowspan="1" colspan="4">
1.512 - <property name="name">
1.513 - <cstring>textLabel4_2_4_2</cstring>
1.514 - </property>
1.515 - <property name="text">
1.516 - <string>Total for this configuration: 0</string>
1.517 - </property>
1.518 - </widget>
1.519 - <widget class="QComboBox" row="14" column="5" rowspan="1" colspan="2">
1.520 - <item>
1.521 - <property name="text">
1.522 - <string>(Not selected)</string>
1.523 - </property>
1.524 - </item>
1.525 - <property name="name">
1.526 - <cstring>mouse</cstring>
1.527 - </property>
1.528 - </widget>
1.529 - <widget class="QListBox" row="10" column="4" rowspan="2" colspan="2">
1.530 - <item>
1.531 - <property name="text">
1.532 - <string>(Not selected)</string>
1.533 - </property>
1.534 - </item>
1.535 - <property name="name">
1.536 - <cstring>accessories</cstring>
1.537 - </property>
1.538 - </widget>
1.539 - <widget class="QFrame" row="6" column="4" rowspan="2" colspan="3">
1.540 - <property name="name">
1.541 - <cstring>storage_units</cstring>
1.542 - </property>
1.543 - <property name="frameShape">
1.544 - <enum>StyledPanel</enum>
1.545 - </property>
1.546 - <property name="frameShadow">
1.547 - <enum>Raised</enum>
1.548 - </property>
1.549 - <vbox>
1.550 - <property name="name">
1.551 - <cstring>unnamed</cstring>
1.552 - </property>
1.553 - <widget class="QFrame">
1.554 - <property name="name">
1.555 - <cstring>storage_unit</cstring>
1.556 - </property>
1.557 - <property name="frameShape">
1.558 - <enum>StyledPanel</enum>
1.559 - </property>
1.560 - <property name="frameShadow">
1.561 - <enum>Raised</enum>
1.562 - </property>
1.563 - <hbox>
1.564 - <property name="name">
1.565 - <cstring>unnamed</cstring>
1.566 - </property>
1.567 - <widget class="QLabel">
1.568 - <property name="name">
1.569 - <cstring>textLabel4_3_2_2</cstring>
1.570 - </property>
1.571 - <property name="text">
1.572 - <string>Storage unit</string>
1.573 - </property>
1.574 - </widget>
1.575 - <widget class="QComboBox">
1.576 - <item>
1.577 - <property name="text">
1.578 - <string>(Not selected)</string>
1.579 - </property>
1.580 - </item>
1.581 - <property name="name">
1.582 - <cstring>storage_unit_value</cstring>
1.583 - </property>
1.584 - </widget>
1.585 - <widget class="QPushButton">
1.586 - <property name="name">
1.587 - <cstring>remove_storage_unit</cstring>
1.588 - </property>
1.589 - <property name="text">
1.590 - <string>Remove</string>
1.591 - </property>
1.592 - </widget>
1.593 - </hbox>
1.594 - </widget>
1.595 - </vbox>
1.596 - </widget>
1.597 - </grid>
1.598 -</widget>
1.599 -<connections>
1.600 - <connection>
1.601 - <sender>base_system</sender>
1.602 - <signal>activated(const QString&)</signal>
1.603 - <receiver>configuration</receiver>
1.604 - <slot>baseSystemChanged(const QString&)</slot>
1.605 - </connection>
1.606 - <connection>
1.607 - <sender>add_hard_disk</sender>
1.608 - <signal>clicked()</signal>
1.609 - <receiver>configuration</receiver>
1.610 - <slot>addHardDisk()</slot>
1.611 - </connection>
1.612 - <connection>
1.613 - <sender>add_memory_unit</sender>
1.614 - <signal>clicked()</signal>
1.615 - <receiver>configuration</receiver>
1.616 - <slot>addMemoryUnit()</slot>
1.617 - </connection>
1.618 - <connection>
1.619 - <sender>add_storage_unit</sender>
1.620 - <signal>clicked()</signal>
1.621 - <receiver>configuration</receiver>
1.622 - <slot>addStorageUnit()</slot>
1.623 - </connection>
1.624 - <connection>
1.625 - <sender>remove_hard_disk</sender>
1.626 - <signal>clicked()</signal>
1.627 - <receiver>configuration</receiver>
1.628 - <slot>removeHardDisk()</slot>
1.629 - </connection>
1.630 - <connection>
1.631 - <sender>remove_memory_unit</sender>
1.632 - <signal>clicked()</signal>
1.633 - <receiver>configuration</receiver>
1.634 - <slot>removeMemoryUnit()</slot>
1.635 - </connection>
1.636 - <connection>
1.637 - <sender>remove_storage_unit</sender>
1.638 - <signal>clicked()</signal>
1.639 - <receiver>configuration</receiver>
1.640 - <slot>removeStorageUnit()</slot>
1.641 - </connection>
1.642 - <connection>
1.643 - <sender>update</sender>
1.644 - <signal>clicked()</signal>
1.645 - <receiver>configuration</receiver>
1.646 - <slot>updateConfig()</slot>
1.647 - </connection>
1.648 - <connection>
1.649 - <sender>export</sender>
1.650 - <signal>clicked()</signal>
1.651 - <receiver>configuration</receiver>
1.652 - <slot>exportConfig()</slot>
1.653 - </connection>
1.654 -</connections>
1.655 -<slots>
1.656 - <slot>baseSystemChanged(const QString&)</slot>
1.657 - <slot>removeMemoryUnit()</slot>
1.658 - <slot>addMemoryUnit()</slot>
1.659 - <slot>addStorageUnit()</slot>
1.660 - <slot>removeHardDisk()</slot>
1.661 - <slot>addHardDisk()</slot>
1.662 - <slot>removeStorageUnit()</slot>
1.663 - <slot>updateConfig()</slot>
1.664 - <slot>exportConfig()</slot>
1.665 -</slots>
1.666 -<layoutdefaults spacing="6" margin="11"/>
1.667 -</UI>
2.1 --- a/examples/Common/QtConfigurator/Resources/config_base_system.xml Fri Nov 21 01:43:30 2008 +0100
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,8 +0,0 @@
2.4 -<?xml version="1.0"?>
2.5 -<base-system>
2.6 - <base-system-enum value="(Not selected)" price="0"/>
2.7 - <base-system-enum value="Shuttle SB61G2V3" price="2174" cpu-socket="478" interface="SATA-150"/>
2.8 - <base-system-enum value="Shuttle SS56GV3" price="2000" cpu-socket="478" interface="ATA-133"/>
2.9 - <base-system-enum value="Shuttle ST62K" price="2000" cpu-socket="478" interface="ATA-100"/>
2.10 - <base-system-enum value="Soltek Qbic EQ3901" price="2500" cpu-socket="939" interface="SATA-150"/>
2.11 -</base-system>
3.1 --- a/examples/Common/QtConfigurator/Resources/config_cpu.xml Fri Nov 21 01:43:30 2008 +0100
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,7 +0,0 @@
3.4 -<?xml version="1.0"?>
3.5 -<cpu>
3.6 - <cpu-enum value="(Not selected)" price="0"/>
3.7 - <cpu-enum value="Pentium 4 3.0 GHz" price="1650" cpu-socket="478"/>
3.8 - <cpu-enum value="Athlon 3000+" price="1500" cpu-socket="A"/>
3.9 - <cpu-enum value="Athlon 64 3500+" price="2300" cpu-socket="939"/>
3.10 -</cpu>
4.1 --- a/examples/Common/QtConfigurator/Resources/config_hard_disk.xml Fri Nov 21 01:43:30 2008 +0100
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,10 +0,0 @@
4.4 -<?xml version="1.0"?>
4.5 -<hard-disk>
4.6 - <hard-disk-enum value="(Not selected)" price="0"/>
4.7 - <hard-disk-enum value="SATA-150 80GB" price="700" interface="SATA-150"/>
4.8 - <hard-disk-enum value="SATA-150 160GB" price="1200" interface="SATA-150"/>
4.9 - <hard-disk-enum value="ATA-133 80GB" price="600" interface="ATA-133"/>
4.10 - <hard-disk-enum value="ATA-133 160GB" price="1000" interface="ATA-133"/>
4.11 - <hard-disk-enum value="ATA-100 80GB" price="500" interface="ATA-100"/>
4.12 - <hard-disk-enum value="ATA-100 160GB" price="800" interface="ATA-100"/>
4.13 -</hard-disk>
5.1 --- a/examples/Common/QtConfigurator/Resources/config_keyboard.xml Fri Nov 21 01:43:30 2008 +0100
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,8 +0,0 @@
5.4 -<?xml version="1.0"?>
5.5 -<keyboard>
5.6 - <keyboard-enum value="(Not selected)" price="0"/>
5.7 - <keyboard-enum value="PS/2 Danish" price="50"/>
5.8 - <keyboard-enum value="PS/2 Norwegian" price="50"/>
5.9 - <keyboard-enum value="PS/2 Swedish" price="50"/>
5.10 - <keyboard-enum value="PS/2 United Kingdom" price="50"/>
5.11 -</keyboard>
6.1 --- a/examples/Common/QtConfigurator/Resources/config_memory_unit.xml Fri Nov 21 01:43:30 2008 +0100
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,6 +0,0 @@
6.4 -<?xml version="1.0"?>
6.5 -<memory-unit>
6.6 - <memory-unit-enum value="(Not selected)" price="0"/>
6.7 - <memory-unit-enum value="PC3200 DDR RAM 256MB" price="500"/>
6.8 - <memory-unit-enum value="PC3200 DDR RAM 512MB" price="800"/>
6.9 -</memory-unit>
7.1 --- a/examples/Common/QtConfigurator/Resources/config_mouse.xml Fri Nov 21 01:43:30 2008 +0100
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,6 +0,0 @@
7.4 -<?xml version="1.0"?>
7.5 -<mouse>
7.6 - <mouse-enum value="(Not selected)" price="0"/>
7.7 - <mouse-enum value="2 button PS/2" price="70"/>
7.8 - <mouse-enum value="3 button PS/2" price="80"/>
7.9 -</mouse>
8.1 --- a/examples/Common/QtConfigurator/Resources/config_screen.xml Fri Nov 21 01:43:30 2008 +0100
8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
8.3 @@ -1,6 +0,0 @@
8.4 -<?xml version="1.0"?>
8.5 -<screen>
8.6 - <screen-enum value="(Not selected)" price="0"/>
8.7 - <screen-enum value="17 inch LCD" price="2000"/>
8.8 - <screen-enum value="19 inch LCD" price="3000"/>
8.9 -</screen>
9.1 --- a/examples/Common/QtConfigurator/Resources/config_storage_unit.xml Fri Nov 21 01:43:30 2008 +0100
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,7 +0,0 @@
9.4 -<?xml version="1.0"?>
9.5 -<storage-unit>
9.6 - <storage-unit-enum value="(Not selected)" price="0"/>
9.7 - <storage-unit-enum value="CD-ROM 48x" price="200"/>
9.8 - <storage-unit-enum value="CD-RW 48x/24x/48x" price="400"/>
9.9 - <storage-unit-enum value="DVD+-RW 8x" price="750"/>
9.10 -</storage-unit>
10.1 --- a/examples/Common/QtConfigurator/Resources/config_tab.ui Fri Nov 21 01:43:30 2008 +0100
10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
10.3 @@ -1,622 +0,0 @@
10.4 -<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
10.5 -<class>Configurator</class>
10.6 -<widget class="QWidget">
10.7 - <property name="name">
10.8 - <cstring>configuration</cstring>
10.9 - </property>
10.10 - <property name="geometry">
10.11 - <rect>
10.12 - <x>0</x>
10.13 - <y>0</y>
10.14 - <width>871</width>
10.15 - <height>755</height>
10.16 - </rect>
10.17 - </property>
10.18 - <property name="caption">
10.19 - <string>Form1</string>
10.20 - </property>
10.21 - <grid>
10.22 - <property name="name">
10.23 - <cstring>unnamed</cstring>
10.24 - </property>
10.25 - <widget class="QPushButton" row="14" column="0">
10.26 - <property name="name">
10.27 - <cstring>update</cstring>
10.28 - </property>
10.29 - <property name="text">
10.30 - <string>Update</string>
10.31 - </property>
10.32 - </widget>
10.33 - <widget class="QComboBox" row="14" column="5" rowspan="1" colspan="2">
10.34 - <item>
10.35 - <property name="text">
10.36 - <string>(Not selected)</string>
10.37 - </property>
10.38 - </item>
10.39 - <property name="name">
10.40 - <cstring>mouse</cstring>
10.41 - </property>
10.42 - </widget>
10.43 - <widget class="QComboBox" row="13" column="5" rowspan="1" colspan="2">
10.44 - <item>
10.45 - <property name="text">
10.46 - <string>(Not selected)</string>
10.47 - </property>
10.48 - </item>
10.49 - <property name="name">
10.50 - <cstring>keyboard</cstring>
10.51 - </property>
10.52 - </widget>
10.53 - <widget class="QLabel" row="14" column="4">
10.54 - <property name="name">
10.55 - <cstring>textLabel4_2_3</cstring>
10.56 - </property>
10.57 - <property name="text">
10.58 - <string>Mouse</string>
10.59 - </property>
10.60 - </widget>
10.61 - <widget class="QLabel" row="16" column="4">
10.62 - <property name="name">
10.63 - <cstring>textLabel4_2_4</cstring>
10.64 - </property>
10.65 - <property name="text">
10.66 - <string>Screen</string>
10.67 - </property>
10.68 - </widget>
10.69 - <widget class="QComboBox" row="16" column="5" rowspan="1" colspan="2">
10.70 - <item>
10.71 - <property name="text">
10.72 - <string>(Not selected)</string>
10.73 - </property>
10.74 - </item>
10.75 - <property name="name">
10.76 - <cstring>screen</cstring>
10.77 - </property>
10.78 - </widget>
10.79 - <widget class="QPushButton" row="14" column="1" rowspan="1" colspan="2">
10.80 - <property name="name">
10.81 - <cstring>export</cstring>
10.82 - </property>
10.83 - <property name="text">
10.84 - <string>Export</string>
10.85 - </property>
10.86 - </widget>
10.87 - <spacer row="14" column="3">
10.88 - <property name="name">
10.89 - <cstring>spacer6</cstring>
10.90 - </property>
10.91 - <property name="orientation">
10.92 - <enum>Horizontal</enum>
10.93 - </property>
10.94 - <property name="sizeType">
10.95 - <enum>Expanding</enum>
10.96 - </property>
10.97 - <property name="sizeHint">
10.98 - <size>
10.99 - <width>40</width>
10.100 - <height>20</height>
10.101 - </size>
10.102 - </property>
10.103 - </spacer>
10.104 - <widget class="QLabel" row="13" column="0" rowspan="1" colspan="4">
10.105 - <property name="name">
10.106 - <cstring>textLabel4_2_4_2</cstring>
10.107 - </property>
10.108 - <property name="text">
10.109 - <string>Total for this configuration: 0</string>
10.110 - </property>
10.111 - </widget>
10.112 - <widget class="QLabel" row="13" column="4">
10.113 - <property name="name">
10.114 - <cstring>textLabel4_2_2</cstring>
10.115 - </property>
10.116 - <property name="text">
10.117 - <string>Keyboard</string>
10.118 - </property>
10.119 - </widget>
10.120 - <spacer row="15" column="0" rowspan="2" colspan="4">
10.121 - <property name="name">
10.122 - <cstring>spacer10</cstring>
10.123 - </property>
10.124 - <property name="orientation">
10.125 - <enum>Horizontal</enum>
10.126 - </property>
10.127 - <property name="sizeType">
10.128 - <enum>Expanding</enum>
10.129 - </property>
10.130 - <property name="sizeHint">
10.131 - <size>
10.132 - <width>346</width>
10.133 - <height>60</height>
10.134 - </size>
10.135 - </property>
10.136 - </spacer>
10.137 - <widget class="QListBox" row="10" column="4" rowspan="2" colspan="2">
10.138 - <item>
10.139 - <property name="text">
10.140 - <string>(Not selected)</string>
10.141 - </property>
10.142 - </item>
10.143 - <property name="name">
10.144 - <cstring>accessories</cstring>
10.145 - </property>
10.146 - </widget>
10.147 - <widget class="QPushButton" row="11" column="0" rowspan="1" colspan="2">
10.148 - <property name="name">
10.149 - <cstring>add_memory_unit</cstring>
10.150 - </property>
10.151 - <property name="text">
10.152 - <string>Add memory</string>
10.153 - </property>
10.154 - </widget>
10.155 - <spacer row="11" column="2" rowspan="1" colspan="2">
10.156 - <property name="name">
10.157 - <cstring>spacer5</cstring>
10.158 - </property>
10.159 - <property name="orientation">
10.160 - <enum>Horizontal</enum>
10.161 - </property>
10.162 - <property name="sizeType">
10.163 - <enum>Expanding</enum>
10.164 - </property>
10.165 - <property name="sizeHint">
10.166 - <size>
10.167 - <width>180</width>
10.168 - <height>20</height>
10.169 - </size>
10.170 - </property>
10.171 - </spacer>
10.172 - <widget class="QLabel" row="0" column="0" rowspan="1" colspan="5">
10.173 - <property name="name">
10.174 - <cstring>textLabel1</cstring>
10.175 - </property>
10.176 - <property name="text">
10.177 - <string><h1>System Configurator</h1></string>
10.178 - </property>
10.179 - </widget>
10.180 - <widget class="QTabWidget" row="10" column="0" rowspan="1" colspan="4">
10.181 - <property name="name">
10.182 - <cstring>memory_units</cstring>
10.183 - </property>
10.184 - <widget class="QWidget">
10.185 - <property name="name">
10.186 - <cstring>tab</cstring>
10.187 - </property>
10.188 - <attribute name="title">
10.189 - <string>Unit</string>
10.190 - </attribute>
10.191 - <hbox>
10.192 - <property name="name">
10.193 - <cstring>unnamed</cstring>
10.194 - </property>
10.195 - <widget class="QLabel">
10.196 - <property name="name">
10.197 - <cstring>textLabel4_3</cstring>
10.198 - </property>
10.199 - <property name="text">
10.200 - <string>Memory unit</string>
10.201 - </property>
10.202 - </widget>
10.203 - <widget class="QComboBox">
10.204 - <item>
10.205 - <property name="text">
10.206 - <string>(Not selected)</string>
10.207 - </property>
10.208 - </item>
10.209 - <property name="name">
10.210 - <cstring>memory_unit_value</cstring>
10.211 - </property>
10.212 - </widget>
10.213 - <widget class="QPushButton">
10.214 - <property name="name">
10.215 - <cstring>remove_memory_unit</cstring>
10.216 - </property>
10.217 - <property name="text">
10.218 - <string>Remove</string>
10.219 - </property>
10.220 - </widget>
10.221 - </hbox>
10.222 - </widget>
10.223 - </widget>
10.224 - <widget class="QPushButton" row="8" column="4" rowspan="1" colspan="2">
10.225 - <property name="name">
10.226 - <cstring>add_storage_unit</cstring>
10.227 - </property>
10.228 - <property name="text">
10.229 - <string>Add storage</string>
10.230 - </property>
10.231 - </widget>
10.232 - <spacer row="8" column="6">
10.233 - <property name="name">
10.234 - <cstring>spacer4</cstring>
10.235 - </property>
10.236 - <property name="orientation">
10.237 - <enum>Horizontal</enum>
10.238 - </property>
10.239 - <property name="sizeType">
10.240 - <enum>Expanding</enum>
10.241 - </property>
10.242 - <property name="sizeHint">
10.243 - <size>
10.244 - <width>230</width>
10.245 - <height>20</height>
10.246 - </size>
10.247 - </property>
10.248 - </spacer>
10.249 - <spacer row="8" column="0" rowspan="1" colspan="4">
10.250 - <property name="name">
10.251 - <cstring>spacer9</cstring>
10.252 - </property>
10.253 - <property name="orientation">
10.254 - <enum>Horizontal</enum>
10.255 - </property>
10.256 - <property name="sizeType">
10.257 - <enum>Expanding</enum>
10.258 - </property>
10.259 - <property name="sizeHint">
10.260 - <size>
10.261 - <width>350</width>
10.262 - <height>20</height>
10.263 - </size>
10.264 - </property>
10.265 - </spacer>
10.266 - <widget class="QTabWidget" row="6" column="4" rowspan="2" colspan="3">
10.267 - <property name="name">
10.268 - <cstring>storage_units</cstring>
10.269 - </property>
10.270 - <widget class="QWidget">
10.271 - <property name="name">
10.272 - <cstring>tab</cstring>
10.273 - </property>
10.274 - <attribute name="title">
10.275 - <string>Storage</string>
10.276 - </attribute>
10.277 - <hbox>
10.278 - <property name="name">
10.279 - <cstring>unnamed</cstring>
10.280 - </property>
10.281 - <widget class="QLabel">
10.282 - <property name="name">
10.283 - <cstring>textLabel4_3_2_2</cstring>
10.284 - </property>
10.285 - <property name="text">
10.286 - <string>Storage unit</string>
10.287 - </property>
10.288 - </widget>
10.289 - <widget class="QComboBox">
10.290 - <item>
10.291 - <property name="text">
10.292 - <string>(Not selected)</string>
10.293 - </property>
10.294 - </item>
10.295 - <property name="name">
10.296 - <cstring>storage_unit_value</cstring>
10.297 - </property>
10.298 - </widget>
10.299 - <widget class="QPushButton">
10.300 - <property name="name">
10.301 - <cstring>remove_storage_unit</cstring>
10.302 - </property>
10.303 - <property name="text">
10.304 - <string>Remove</string>
10.305 - </property>
10.306 - </widget>
10.307 - </hbox>
10.308 - </widget>
10.309 - </widget>
10.310 - <widget class="QLabel" row="1" column="0" rowspan="1" colspan="3">
10.311 - <property name="name">
10.312 - <cstring>textLabel2</cstring>
10.313 - </property>
10.314 - <property name="text">
10.315 - <string><h2>Base System</h2></string>
10.316 - </property>
10.317 - </widget>
10.318 - <spacer row="1" column="3">
10.319 - <property name="name">
10.320 - <cstring>spacer11</cstring>
10.321 - </property>
10.322 - <property name="orientation">
10.323 - <enum>Horizontal</enum>
10.324 - </property>
10.325 - <property name="sizeType">
10.326 - <enum>Expanding</enum>
10.327 - </property>
10.328 - <property name="sizeHint">
10.329 - <size>
10.330 - <width>130</width>
10.331 - <height>20</height>
10.332 - </size>
10.333 - </property>
10.334 - </spacer>
10.335 - <widget class="QTabWidget" row="2" column="4" rowspan="2" colspan="3">
10.336 - <property name="name">
10.337 - <cstring>hard_disks</cstring>
10.338 - </property>
10.339 - <widget class="QWidget">
10.340 - <property name="name">
10.341 - <cstring>tab</cstring>
10.342 - </property>
10.343 - <attribute name="title">
10.344 - <string>Disk</string>
10.345 - </attribute>
10.346 - <hbox>
10.347 - <property name="name">
10.348 - <cstring>unnamed</cstring>
10.349 - </property>
10.350 - <widget class="QLabel">
10.351 - <property name="name">
10.352 - <cstring>textLabel4_3_2</cstring>
10.353 - </property>
10.354 - <property name="text">
10.355 - <string>Hard disk drive</string>
10.356 - </property>
10.357 - </widget>
10.358 - <widget class="QComboBox">
10.359 - <item>
10.360 - <property name="text">
10.361 - <string>(Not selected)</string>
10.362 - </property>
10.363 - </item>
10.364 - <property name="name">
10.365 - <cstring>hard_disk_value</cstring>
10.366 - </property>
10.367 - </widget>
10.368 - <widget class="QPushButton">
10.369 - <property name="name">
10.370 - <cstring>remove_hard_disk</cstring>
10.371 - </property>
10.372 - <property name="text">
10.373 - <string>Remove</string>
10.374 - </property>
10.375 - </widget>
10.376 - </hbox>
10.377 - </widget>
10.378 - </widget>
10.379 - <widget class="QPushButton" row="4" column="4" rowspan="1" colspan="2">
10.380 - <property name="name">
10.381 - <cstring>add_hard_disk</cstring>
10.382 - </property>
10.383 - <property name="text">
10.384 - <string>Add hard disk</string>
10.385 - </property>
10.386 - </widget>
10.387 - <spacer row="4" column="6">
10.388 - <property name="name">
10.389 - <cstring>spacer3</cstring>
10.390 - </property>
10.391 - <property name="orientation">
10.392 - <enum>Horizontal</enum>
10.393 - </property>
10.394 - <property name="sizeType">
10.395 - <enum>Expanding</enum>
10.396 - </property>
10.397 - <property name="sizeHint">
10.398 - <size>
10.399 - <width>230</width>
10.400 - <height>20</height>
10.401 - </size>
10.402 - </property>
10.403 - </spacer>
10.404 - <spacer row="4" column="0" rowspan="1" colspan="4">
10.405 - <property name="name">
10.406 - <cstring>spacer8</cstring>
10.407 - </property>
10.408 - <property name="orientation">
10.409 - <enum>Horizontal</enum>
10.410 - </property>
10.411 - <property name="sizeType">
10.412 - <enum>Expanding</enum>
10.413 - </property>
10.414 - <property name="sizeHint">
10.415 - <size>
10.416 - <width>350</width>
10.417 - <height>20</height>
10.418 - </size>
10.419 - </property>
10.420 - </spacer>
10.421 - <widget class="QLabel" row="5" column="0" rowspan="1" colspan="3">
10.422 - <property name="name">
10.423 - <cstring>textLabel2_2</cstring>
10.424 - </property>
10.425 - <property name="text">
10.426 - <string><h2>Processor</h2></string>
10.427 - </property>
10.428 - </widget>
10.429 - <widget class="QLabel" row="9" column="4" rowspan="1" colspan="3">
10.430 - <property name="name">
10.431 - <cstring>textLabel2_7</cstring>
10.432 - </property>
10.433 - <property name="text">
10.434 - <string><h2>Accessories</h2></string>
10.435 - </property>
10.436 - </widget>
10.437 - <widget class="QLabel" row="9" column="0" rowspan="1" colspan="2">
10.438 - <property name="name">
10.439 - <cstring>textLabel2_3</cstring>
10.440 - </property>
10.441 - <property name="text">
10.442 - <string><h2>Memory</h2></string>
10.443 - </property>
10.444 - </widget>
10.445 - <widget class="QLabel" row="5" column="4" rowspan="1" colspan="3">
10.446 - <property name="name">
10.447 - <cstring>textLabel2_6</cstring>
10.448 - </property>
10.449 - <property name="text">
10.450 - <string><h2>Additional Storage</h2></string>
10.451 - </property>
10.452 - </widget>
10.453 - <widget class="QLabel" row="1" column="4" rowspan="1" colspan="3">
10.454 - <property name="name">
10.455 - <cstring>textLabel2_5</cstring>
10.456 - </property>
10.457 - <property name="text">
10.458 - <string><h2>Hard Disks</h2></string>
10.459 - </property>
10.460 - </widget>
10.461 - <widget class="QLabel" row="12" column="4" rowspan="1" colspan="3">
10.462 - <property name="name">
10.463 - <cstring>textLabel2_8</cstring>
10.464 - </property>
10.465 - <property name="text">
10.466 - <string><h2>Input Devices</h2></string>
10.467 - </property>
10.468 - </widget>
10.469 - <widget class="QLabel" row="12" column="0">
10.470 - <property name="name">
10.471 - <cstring>textLabel2_4</cstring>
10.472 - </property>
10.473 - <property name="text">
10.474 - <string><h2>Price</h2></string>
10.475 - </property>
10.476 - </widget>
10.477 - <widget class="QLabel" row="15" column="4" rowspan="1" colspan="2">
10.478 - <property name="name">
10.479 - <cstring>textLabel2_9</cstring>
10.480 - </property>
10.481 - <property name="text">
10.482 - <string><h2>Display</h2></string>
10.483 - </property>
10.484 - </widget>
10.485 - <widget class="QComboBox" row="6" column="1" rowspan="1" colspan="3">
10.486 - <item>
10.487 - <property name="text">
10.488 - <string>(Not selected)</string>
10.489 - </property>
10.490 - </item>
10.491 - <property name="name">
10.492 - <cstring>cpu</cstring>
10.493 - </property>
10.494 - </widget>
10.495 - <widget class="QLabel" row="6" column="0">
10.496 - <property name="name">
10.497 - <cstring>textLabel4_2</cstring>
10.498 - </property>
10.499 - <property name="text">
10.500 - <string>CPU</string>
10.501 - </property>
10.502 - </widget>
10.503 - <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="3">
10.504 - <item>
10.505 - <property name="text">
10.506 - <string>(Not selected)</string>
10.507 - </property>
10.508 - </item>
10.509 - <property name="name">
10.510 - <cstring>base_system</cstring>
10.511 - </property>
10.512 - </widget>
10.513 - <widget class="QLabel" row="2" column="0">
10.514 - <property name="name">
10.515 - <cstring>textLabel4</cstring>
10.516 - </property>
10.517 - <property name="text">
10.518 - <string>Model</string>
10.519 - </property>
10.520 - </widget>
10.521 - <spacer row="7" column="3">
10.522 - <property name="name">
10.523 - <cstring>spacer22</cstring>
10.524 - </property>
10.525 - <property name="orientation">
10.526 - <enum>Vertical</enum>
10.527 - </property>
10.528 - <property name="sizeType">
10.529 - <enum>Expanding</enum>
10.530 - </property>
10.531 - <property name="sizeHint">
10.532 - <size>
10.533 - <width>20</width>
10.534 - <height>131</height>
10.535 - </size>
10.536 - </property>
10.537 - </spacer>
10.538 - <spacer row="3" column="3">
10.539 - <property name="name">
10.540 - <cstring>spacer21</cstring>
10.541 - </property>
10.542 - <property name="orientation">
10.543 - <enum>Vertical</enum>
10.544 - </property>
10.545 - <property name="sizeType">
10.546 - <enum>Expanding</enum>
10.547 - </property>
10.548 - <property name="sizeHint">
10.549 - <size>
10.550 - <width>20</width>
10.551 - <height>131</height>
10.552 - </size>
10.553 - </property>
10.554 - </spacer>
10.555 - </grid>
10.556 -</widget>
10.557 -<connections>
10.558 - <connection>
10.559 - <sender>base_system</sender>
10.560 - <signal>activated(const QString&)</signal>
10.561 - <receiver>configuration</receiver>
10.562 - <slot>baseSystemChanged(const QString&)</slot>
10.563 - </connection>
10.564 - <connection>
10.565 - <sender>add_hard_disk</sender>
10.566 - <signal>clicked()</signal>
10.567 - <receiver>configuration</receiver>
10.568 - <slot>addHardDisk()</slot>
10.569 - </connection>
10.570 - <connection>
10.571 - <sender>add_memory_unit</sender>
10.572 - <signal>clicked()</signal>
10.573 - <receiver>configuration</receiver>
10.574 - <slot>addMemoryUnit()</slot>
10.575 - </connection>
10.576 - <connection>
10.577 - <sender>add_storage_unit</sender>
10.578 - <signal>clicked()</signal>
10.579 - <receiver>configuration</receiver>
10.580 - <slot>addStorageUnit()</slot>
10.581 - </connection>
10.582 - <connection>
10.583 - <sender>remove_hard_disk</sender>
10.584 - <signal>clicked()</signal>
10.585 - <receiver>configuration</receiver>
10.586 - <slot>removeHardDisk()</slot>
10.587 - </connection>
10.588 - <connection>
10.589 - <sender>remove_memory_unit</sender>
10.590 - <signal>clicked()</signal>
10.591 - <receiver>configuration</receiver>
10.592 - <slot>removeMemoryUnit()</slot>
10.593 - </connection>
10.594 - <connection>
10.595 - <sender>remove_storage_unit</sender>
10.596 - <signal>clicked()</signal>
10.597 - <receiver>configuration</receiver>
10.598 - <slot>removeStorageUnit()</slot>
10.599 - </connection>
10.600 - <connection>
10.601 - <sender>update</sender>
10.602 - <signal>clicked()</signal>
10.603 - <receiver>configuration</receiver>
10.604 - <slot>updateConfig()</slot>
10.605 - </connection>
10.606 - <connection>
10.607 - <sender>export</sender>
10.608 - <signal>clicked()</signal>
10.609 - <receiver>configuration</receiver>
10.610 - <slot>exportConfig()</slot>
10.611 - </connection>
10.612 -</connections>
10.613 -<slots>
10.614 - <slot>baseSystemChanged(const QString&)</slot>
10.615 - <slot>removeMemoryUnit()</slot>
10.616 - <slot>addMemoryUnit()</slot>
10.617 - <slot>addStorageUnit()</slot>
10.618 - <slot>removeHardDisk()</slot>
10.619 - <slot>addHardDisk()</slot>
10.620 - <slot>removeStorageUnit()</slot>
10.621 - <slot>updateConfig()</slot>
10.622 - <slot>exportConfig()</slot>
10.623 -</slots>
10.624 -<layoutdefaults spacing="6" margin="11"/>
10.625 -</UI>
11.1 --- a/examples/Common/QtConfigurator/Resources/scripts/XSLForms.js Fri Nov 21 01:43:30 2008 +0100
11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
11.3 @@ -1,178 +0,0 @@
11.4 -// Area update functions.
11.5 -
11.6 -function requestUpdateArea(url, sourceAreasStr, targetName, targetAreasStr, elementPath) {
11.7 -
11.8 - var fieldNames = new Array();
11.9 - var targetFieldNames = new Array();
11.10 -
11.11 - for (var i = 0; i < document.forms.length; i++) {
11.12 - var form = document.forms[i];
11.13 - for (var j = 0; j < form.elements.length; j++) {
11.14 - var fieldName = form.elements[j].name;
11.15 - checkField(fieldName, sourceAreasStr, fieldNames);
11.16 - checkField(fieldName, targetAreasStr, targetFieldNames);
11.17 - }
11.18 - }
11.19 -
11.20 - return _requestUpdate(url, fieldNames, targetName, targetFieldNames, elementPath);
11.21 -}
11.22 -
11.23 -// Field list update functions.
11.24 -
11.25 -function requestUpdate(url, fieldNamesStr, targetName, targetFieldNamesStr, elementPath) {
11.26 -
11.27 - return _requestUpdate(url, fieldNamesStr.split(","), targetName, targetFieldNamesStr.split(","), elementPath);
11.28 -}
11.29 -
11.30 -// Internal functions.
11.31 -
11.32 -function checkField(fieldName, areasStr, areaFieldNames) {
11.33 -
11.34 - // Process each area name.
11.35 -
11.36 - var areaArray = areasStr.split(",");
11.37 - for (var i = 0; i < areaArray.length; i++) {
11.38 - var areaName = areaArray[i];
11.39 -
11.40 - // Skip empty area names (arising through empty elements in the CSV list).
11.41 -
11.42 - if (areaName == "") {
11.43 - continue;
11.44 - }
11.45 -
11.46 - if (fieldName.indexOf(areaName) == 0) {
11.47 - areaFieldNames.push(fieldName);
11.48 - }
11.49 - }
11.50 -}
11.51 -
11.52 -function _requestUpdate(url, fieldNames, targetName, targetFieldNames, elementPath) {
11.53 -
11.54 - // Note that XMLHttpRequest access may be denied if Mozilla believes that
11.55 - // this resource's URL and the supplied URL are different.
11.56 -
11.57 - var xmlhttp = new XMLHttpRequest();
11.58 - xmlhttp.open("POST", url, false);
11.59 -
11.60 - // Add the element path specification.
11.61 -
11.62 - var requestBody = ("element-path=" + elementPath);
11.63 -
11.64 - // Send the controlling field value.
11.65 -
11.66 - requestBody += addFields(fieldNames, false);
11.67 - requestBody += addFields(targetFieldNames, true);
11.68 -
11.69 - // Load the remote document with the given parameters sent as text in the request body.
11.70 -
11.71 - xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
11.72 - xmlhttp.send(requestBody);
11.73 -
11.74 - // Parse the result document.
11.75 -
11.76 - var newDocument = Sarissa.getDomDocument();
11.77 - newDocument = (new DOMParser()).parseFromString(xmlhttp.responseText, "text/xml");
11.78 -
11.79 - // Find the definition of the affected field in the result document.
11.80 -
11.81 - var newElement = newDocument.getElementById(targetName);
11.82 - var targetElement = document.getElementById(targetName);
11.83 -
11.84 - // Insert the new definition into the current document.
11.85 -
11.86 - if (newElement != null && targetElement != null) {
11.87 - var importedElement = document.importNode(newElement, true);
11.88 - targetElement.parentNode.replaceChild(importedElement, targetElement);
11.89 - //importedElement.setAttribute("style", "background-color:red;");
11.90 - }
11.91 -
11.92 - // NOTE: Test Konqueror bug.
11.93 -
11.94 - //showMismatch(targetFieldNames);
11.95 -
11.96 - return false;
11.97 -}
11.98 -
11.99 -function addFields(fieldNames, disable) {
11.100 -
11.101 - var requestBody = "";
11.102 -
11.103 - // Process each target field name.
11.104 - // Add the values of the dependent fields.
11.105 -
11.106 - for (var i = 0; i < fieldNames.length; i++) {
11.107 - var fieldName = fieldNames[i];
11.108 -
11.109 - // Skip empty field names (arising through empty elements in the CSV list).
11.110 -
11.111 - if (fieldName == "") {
11.112 - continue;
11.113 - }
11.114 -
11.115 - // Find the values of the target field.
11.116 -
11.117 - var fieldValue;
11.118 - var fieldNodes = document.getElementsByName(fieldName);
11.119 - for (var v = 0; v < fieldNodes.length; v++) {
11.120 -
11.121 - // Test for different field types.
11.122 -
11.123 - if (fieldNodes[v].options) {
11.124 - for (var opt = 0; opt < fieldNodes[v].options.length; opt++) {
11.125 - if (fieldNodes[v].options[opt].selected) {
11.126 - fieldValue = fieldNodes[v].options[opt].value;
11.127 - requestBody += ("&" + encodeURIComponent(fieldName) + "=" + encodeURIComponent(fieldValue));
11.128 - }
11.129 - }
11.130 - } else if (fieldNodes[v].type != 'checkbox' && fieldNodes[v].type != 'radio' || fieldNodes[v].checked) {
11.131 - fieldValue = fieldNodes[v].value;
11.132 - requestBody += ("&" + encodeURIComponent(fieldName) + "=" + encodeURIComponent(fieldValue));
11.133 - }
11.134 - }
11.135 -
11.136 - // NOTE: Konqueror hack: disable fields.
11.137 -
11.138 - if (disable) {
11.139 - disableFields(fieldName);
11.140 - }
11.141 - }
11.142 -
11.143 - return requestBody;
11.144 -}
11.145 -
11.146 -function disableFields(targetFieldName) {
11.147 -
11.148 - for (var i = 0; i < document.forms.length; i++) {
11.149 - var form = document.forms[i];
11.150 - for (var j = 0; j < form.elements.length; j++) {
11.151 - if (form.elements[j].name == targetFieldName) {
11.152 - form.elements[j].name = "";
11.153 - }
11.154 - }
11.155 - }
11.156 -}
11.157 -
11.158 -function showMismatch(targetFieldNameArray) {
11.159 -
11.160 - // Show how the number of field elements with a given name can be different
11.161 - // from the number known to the DOM Level 0 part of the API.
11.162 -
11.163 - for (var h = 0; h < targetFieldNameArray.length; h++) {
11.164 - var targetFieldName = targetFieldNameArray[h];
11.165 - var targetFieldNodes = document.getElementsByName(targetFieldName);
11.166 - alert("Nodes for " + targetFieldName + ": " + targetFieldNodes.length);
11.167 -
11.168 - var count = 0;
11.169 - for (var i = 0; i < document.forms.length; i++) {
11.170 - var form = document.forms[i];
11.171 - for (var j = 0; j < form.elements.length; j++) {
11.172 - if (form.elements[j].name == targetFieldName) {
11.173 - count++;
11.174 - }
11.175 - }
11.176 - }
11.177 - alert("Fields for " + targetFieldName + ": " + count);
11.178 - }
11.179 -}
11.180 -
11.181 -// vim: tabstop=4 expandtab shiftwidth=4
12.1 --- a/examples/Common/QtConfigurator/Resources/scripts/sarissa.js Fri Nov 21 01:43:30 2008 +0100
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,688 +0,0 @@
12.4 -/**
12.5 - * ====================================================================
12.6 - * About
12.7 - * ====================================================================
12.8 - * Sarissa is an ECMAScript library acting as a cross-browser wrapper for native XML APIs.
12.9 - * The library supports Gecko based browsers like Mozilla and Firefox,
12.10 - * Internet Explorer (5.5+ with MSXML3.0+), Konqueror, Safari and a little of Opera
12.11 - * @version ${project.version}
12.12 - * @author: @author: Copyright 2004-2007 Emmanouil Batsis, mailto: mbatsis at users full stop sourceforge full stop net
12.13 - *
12.14 - * ====================================================================
12.15 - * Licence
12.16 - * ====================================================================
12.17 - * Sarissa is free software distributed under the GNU GPL version 2 (see <a href="gpl.txt">gpl.txt</a>) or higher,
12.18 - * GNU LGPL version 2.1 (see <a href="lgpl.txt">lgpl.txt</a>) or higher and Apache Software License 2.0 or higher
12.19 - * (see <a href="asl.txt">asl.txt</a>). This means you can choose one of the three and use that if you like. If
12.20 - * you make modifications under the ASL, i would appreciate it if you submitted those.
12.21 - * In case your copy of Sarissa does not include the license texts, you may find
12.22 - * them online in various formats at <a href="http://www.gnu.org">http://www.gnu.org</a> and
12.23 - * <a href="http://www.apache.org">http://www.apache.org</a>.
12.24 - *
12.25 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
12.26 - * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12.27 - * WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE
12.28 - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
12.29 - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12.30 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
12.31 - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
12.32 - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12.33 - */
12.34 -/**
12.35 - * <p>Sarissa is a utility class. Provides "static" methods for DOMDocument,
12.36 - * DOM Node serialization to XML strings and other utility goodies.</p>
12.37 - * @constructor
12.38 - */
12.39 -function Sarissa(){};
12.40 -Sarissa.VERSION = "${project.version}";
12.41 -Sarissa.PARSED_OK = "Document contains no parsing errors";
12.42 -Sarissa.PARSED_EMPTY = "Document is empty";
12.43 -Sarissa.PARSED_UNKNOWN_ERROR = "Not well-formed or other error";
12.44 -Sarissa.IS_ENABLED_TRANSFORM_NODE = false;
12.45 -var _sarissa_iNsCounter = 0;
12.46 -var _SARISSA_IEPREFIX4XSLPARAM = "";
12.47 -var _SARISSA_HAS_DOM_IMPLEMENTATION = document.implementation && true;
12.48 -var _SARISSA_HAS_DOM_CREATE_DOCUMENT = _SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.createDocument;
12.49 -var _SARISSA_HAS_DOM_FEATURE = _SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.hasFeature;
12.50 -var _SARISSA_IS_MOZ = _SARISSA_HAS_DOM_CREATE_DOCUMENT && _SARISSA_HAS_DOM_FEATURE;
12.51 -var _SARISSA_IS_SAFARI = navigator.userAgent.toLowerCase().indexOf("safari") != -1 || navigator.userAgent.toLowerCase().indexOf("konqueror") != -1;
12.52 -var _SARISSA_IS_SAFARI_OLD = _SARISSA_IS_SAFARI && parseInt((navigator.userAgent.match(/AppleWebKit\/(\d+)/)||{})[1]) < 420;
12.53 -var _SARISSA_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
12.54 -var _SARISSA_IS_OPERA = navigator.userAgent.toLowerCase().indexOf("opera") != -1;
12.55 -if(!window.Node || !Node.ELEMENT_NODE){
12.56 - Node = {ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12};
12.57 -};
12.58 -
12.59 -//This breaks for(x in o) loops in the old Safari
12.60 -if(_SARISSA_IS_SAFARI_OLD){
12.61 - HTMLHtmlElement = document.createElement("html").constructor;
12.62 - Node = HTMLElement = {};
12.63 - HTMLElement.prototype = HTMLHtmlElement.__proto__.__proto__;
12.64 - HTMLDocument = Document = document.constructor;
12.65 - var x = new DOMParser();
12.66 - XMLDocument = x.constructor;
12.67 - Element = x.parseFromString("<Single />", "text/xml").documentElement.constructor;
12.68 - x = null;
12.69 -}
12.70 -if(typeof XMLDocument == "undefined" && typeof Document !="undefined"){ XMLDocument = Document; }
12.71 -
12.72 -// IE initialization
12.73 -if(_SARISSA_IS_IE){
12.74 - // for XSLT parameter names, prefix needed by IE
12.75 - _SARISSA_IEPREFIX4XSLPARAM = "xsl:";
12.76 - // used to store the most recent ProgID available out of the above
12.77 - var _SARISSA_DOM_PROGID = "";
12.78 - var _SARISSA_XMLHTTP_PROGID = "";
12.79 - var _SARISSA_DOM_XMLWRITER = "";
12.80 - /**
12.81 - * Called when the Sarissa_xx.js file is parsed, to pick most recent
12.82 - * ProgIDs for IE, then gets destroyed.
12.83 - * @private
12.84 - * @param idList an array of MSXML PROGIDs from which the most recent will be picked for a given object
12.85 - * @param enabledList an array of arrays where each array has two items; the index of the PROGID for which a certain feature is enabled
12.86 - */
12.87 - Sarissa.pickRecentProgID = function (idList){
12.88 - // found progID flag
12.89 - var bFound = false, e;
12.90 - for(var i=0; i < idList.length && !bFound; i++){
12.91 - try{
12.92 - var oDoc = new ActiveXObject(idList[i]);
12.93 - var o2Store = idList[i];
12.94 - bFound = true;
12.95 - }catch (objException){
12.96 - // trap; try next progID
12.97 - e = objException;
12.98 - };
12.99 - };
12.100 - if (!bFound) {
12.101 - throw "Could not retrieve a valid progID of Class: " + idList[idList.length-1]+". (original exception: "+e+")";
12.102 - };
12.103 - idList = null;
12.104 - return o2Store;
12.105 - };
12.106 - // pick best available MSXML progIDs
12.107 - _SARISSA_DOM_PROGID = null;
12.108 - _SARISSA_THREADEDDOM_PROGID = null;
12.109 - _SARISSA_XSLTEMPLATE_PROGID = null;
12.110 - _SARISSA_XMLHTTP_PROGID = null;
12.111 - if(!window.XMLHttpRequest){
12.112 - /**
12.113 - * Emulate XMLHttpRequest
12.114 - * @constructor
12.115 - */
12.116 - XMLHttpRequest = function() {
12.117 - if(!_SARISSA_XMLHTTP_PROGID){
12.118 - _SARISSA_XMLHTTP_PROGID = Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]);
12.119 - };
12.120 - return new ActiveXObject(_SARISSA_XMLHTTP_PROGID);
12.121 - };
12.122 - };
12.123 - // we dont need this anymore
12.124 - //============================================
12.125 - // Factory methods (IE)
12.126 - //============================================
12.127 - // see non-IE version
12.128 - Sarissa.getDomDocument = function(sUri, sName){
12.129 - if(!_SARISSA_DOM_PROGID){
12.130 - _SARISSA_DOM_PROGID = Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"]);
12.131 - };
12.132 - var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID);
12.133 - // if a root tag name was provided, we need to load it in the DOM object
12.134 - if (sName){
12.135 - // create an artifical namespace prefix
12.136 - // or reuse existing prefix if applicable
12.137 - var prefix = "";
12.138 - if(sUri){
12.139 - if(sName.indexOf(":") > 1){
12.140 - prefix = sName.substring(0, sName.indexOf(":"));
12.141 - sName = sName.substring(sName.indexOf(":")+1);
12.142 - }else{
12.143 - prefix = "a" + (_sarissa_iNsCounter++);
12.144 - };
12.145 - };
12.146 - // use namespaces if a namespace URI exists
12.147 - if(sUri){
12.148 - oDoc.loadXML('<' + prefix+':'+sName + " xmlns:" + prefix + "=\"" + sUri + "\"" + " />");
12.149 - } else {
12.150 - oDoc.loadXML('<' + sName + " />");
12.151 - };
12.152 - };
12.153 - return oDoc;
12.154 - };
12.155 - // see non-IE version
12.156 - Sarissa.getParseErrorText = function (oDoc) {
12.157 - var parseErrorText = Sarissa.PARSED_OK;
12.158 - if(oDoc && oDoc.parseError && oDoc.parseError.errorCode && oDoc.parseError.errorCode != 0){
12.159 - parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason +
12.160 - "\nLocation: " + oDoc.parseError.url +
12.161 - "\nLine Number " + oDoc.parseError.line + ", Column " +
12.162 - oDoc.parseError.linepos +
12.163 - ":\n" + oDoc.parseError.srcText +
12.164 - "\n";
12.165 - for(var i = 0; i < oDoc.parseError.linepos;i++){
12.166 - parseErrorText += "-";
12.167 - };
12.168 - parseErrorText += "^\n";
12.169 - }
12.170 - else if(oDoc.documentElement == null){
12.171 - parseErrorText = Sarissa.PARSED_EMPTY;
12.172 - };
12.173 - return parseErrorText;
12.174 - };
12.175 - // see non-IE version
12.176 - Sarissa.setXpathNamespaces = function(oDoc, sNsSet) {
12.177 - oDoc.setProperty("SelectionLanguage", "XPath");
12.178 - oDoc.setProperty("SelectionNamespaces", sNsSet);
12.179 - };
12.180 - /**
12.181 - * Basic implementation of Mozilla's XSLTProcessor for IE.
12.182 - * Reuses the same XSLT stylesheet for multiple transforms
12.183 - * @constructor
12.184 - */
12.185 - XSLTProcessor = function(){
12.186 - if(!_SARISSA_XSLTEMPLATE_PROGID){
12.187 - _SARISSA_XSLTEMPLATE_PROGID = Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.6.0", "MSXML2.XSLTemplate.3.0"]);
12.188 - };
12.189 - this.template = new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID);
12.190 - this.processor = null;
12.191 - };
12.192 - /**
12.193 - * Imports the given XSLT DOM and compiles it to a reusable transform
12.194 - * <b>Note:</b> If the stylesheet was loaded from a URL and contains xsl:import or xsl:include elements,it will be reloaded to resolve those
12.195 - * @argument xslDoc The XSLT DOMDocument to import
12.196 - */
12.197 - XSLTProcessor.prototype.importStylesheet = function(xslDoc){
12.198 - if(!_SARISSA_THREADEDDOM_PROGID){
12.199 - _SARISSA_THREADEDDOM_PROGID = Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0", "MSXML2.FreeThreadedDOMDocument.3.0"]);
12.200 - };
12.201 - xslDoc.setProperty("SelectionLanguage", "XPath");
12.202 - xslDoc.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
12.203 - // convert stylesheet to free threaded
12.204 - var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);
12.205 - // make included/imported stylesheets work if exist and xsl was originally loaded from url
12.206 - try{
12.207 - converted.resolveExternals = true;
12.208 - converted.setProperty("AllowDocumentFunction", true);
12.209 - }
12.210 - catch(e){
12.211 - // Ignore. "AllowDocumentFunction" is only supported in MSXML 3.0 SP4 and later.
12.212 - };
12.213 - if(xslDoc.url && xslDoc.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']") != null){
12.214 - converted.async = false;
12.215 - converted.load(xslDoc.url);
12.216 - } else {
12.217 - converted.loadXML(xslDoc.xml);
12.218 - };
12.219 - converted.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
12.220 - var output = converted.selectSingleNode("//xsl:output");
12.221 - this.outputMethod = output ? output.getAttribute("method") : "html";
12.222 - this.template.stylesheet = converted;
12.223 - this.processor = this.template.createProcessor();
12.224 - // for getParameter and clearParameters
12.225 - this.paramsSet = [];
12.226 - };
12.227 -
12.228 - /**
12.229 - * Transform the given XML DOM and return the transformation result as a new DOM document
12.230 - * @argument sourceDoc The XML DOMDocument to transform
12.231 - * @return The transformation result as a DOM Document
12.232 - */
12.233 - XSLTProcessor.prototype.transformToDocument = function(sourceDoc){
12.234 - // fix for bug 1549749
12.235 - if(_SARISSA_THREADEDDOM_PROGID){
12.236 - this.processor.input=sourceDoc;
12.237 - var outDoc=new ActiveXObject(_SARISSA_DOM_PROGID);
12.238 - this.processor.output=outDoc;
12.239 - this.processor.transform();
12.240 - return outDoc;
12.241 - }
12.242 - else{
12.243 - if(!_SARISSA_DOM_XMLWRITER){
12.244 - _SARISSA_DOM_XMLWRITER = Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0", "Msxml2.MXXMLWriter.3.0", "MSXML2.MXXMLWriter", "MSXML.MXXMLWriter", "Microsoft.XMLDOM"]);
12.245 - };
12.246 - this.processor.input = sourceDoc;
12.247 - var outDoc = new ActiveXObject(_SARISSA_DOM_XMLWRITER);
12.248 - this.processor.output = outDoc;
12.249 - this.processor.transform();
12.250 - var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID);
12.251 - oDoc.loadXML(outDoc.output+"");
12.252 - return oDoc;
12.253 - };
12.254 - };
12.255 -
12.256 - /**
12.257 - * Transform the given XML DOM and return the transformation result as a new DOM fragment.
12.258 - * <b>Note</b>: The xsl:output method must match the nature of the owner document (XML/HTML).
12.259 - * @argument sourceDoc The XML DOMDocument to transform
12.260 - * @argument ownerDoc The owner of the result fragment
12.261 - * @return The transformation result as a DOM Document
12.262 - */
12.263 - XSLTProcessor.prototype.transformToFragment = function (sourceDoc, ownerDoc) {
12.264 - this.processor.input = sourceDoc;
12.265 - this.processor.transform();
12.266 - var s = this.processor.output;
12.267 - var f = ownerDoc.createDocumentFragment();
12.268 - if (this.outputMethod == 'text') {
12.269 - f.appendChild(ownerDoc.createTextNode(s));
12.270 - } else if (ownerDoc.body && ownerDoc.body.innerHTML) {
12.271 - var container = ownerDoc.createElement('div');
12.272 - container.innerHTML = s;
12.273 - while (container.hasChildNodes()) {
12.274 - f.appendChild(container.firstChild);
12.275 - }
12.276 - }
12.277 - else {
12.278 - var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID);
12.279 - if (s.substring(0, 5) == '<?xml') {
12.280 - s = s.substring(s.indexOf('?>') + 2);
12.281 - }
12.282 - var xml = ''.concat('<my>', s, '</my>');
12.283 - oDoc.loadXML(xml);
12.284 - var container = oDoc.documentElement;
12.285 - while (container.hasChildNodes()) {
12.286 - f.appendChild(container.firstChild);
12.287 - }
12.288 - }
12.289 - return f;
12.290 - };
12.291 -
12.292 - /**
12.293 - * Set global XSLT parameter of the imported stylesheet
12.294 - * @argument nsURI The parameter namespace URI
12.295 - * @argument name The parameter base name
12.296 - * @argument value The new parameter value
12.297 - */
12.298 - XSLTProcessor.prototype.setParameter = function(nsURI, name, value){
12.299 - // make value a zero length string if null to allow clearing
12.300 - value = value ? value : "";
12.301 - // nsURI is optional but cannot be null
12.302 - if(nsURI){
12.303 - this.processor.addParameter(name, value, nsURI);
12.304 - }else{
12.305 - this.processor.addParameter(name, value);
12.306 - };
12.307 - // update updated params for getParameter
12.308 - nsURI = "" + (nsURI || "");
12.309 - if(!this.paramsSet[nsURI]){
12.310 - this.paramsSet[nsURI] = new Array();
12.311 - };
12.312 - this.paramsSet[nsURI][name] = value;
12.313 - };
12.314 - /**
12.315 - * Gets a parameter if previously set by setParameter. Returns null
12.316 - * otherwise
12.317 - * @argument name The parameter base name
12.318 - * @argument value The new parameter value
12.319 - * @return The parameter value if reviously set by setParameter, null otherwise
12.320 - */
12.321 - XSLTProcessor.prototype.getParameter = function(nsURI, name){
12.322 - nsURI = "" + (nsURI || "");
12.323 - if(this.paramsSet[nsURI] && this.paramsSet[nsURI][name]){
12.324 - return this.paramsSet[nsURI][name];
12.325 - }else{
12.326 - return null;
12.327 - };
12.328 - };
12.329 - /**
12.330 - * Clear parameters (set them to default values as defined in the stylesheet itself)
12.331 - */
12.332 - XSLTProcessor.prototype.clearParameters = function(){
12.333 - for(var nsURI in this.paramsSet){
12.334 - for(var name in this.paramsSet[nsURI]){
12.335 - if(nsURI!=""){
12.336 - this.processor.addParameter(name, "", nsURI);
12.337 - }else{
12.338 - this.processor.addParameter(name, "");
12.339 - };
12.340 - };
12.341 - };
12.342 - this.paramsSet = new Array();
12.343 - };
12.344 -}else{ /* end IE initialization, try to deal with real browsers now ;-) */
12.345 - if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){
12.346 - /**
12.347 - * <p>Ensures the document was loaded correctly, otherwise sets the
12.348 - * parseError to -1 to indicate something went wrong. Internal use</p>
12.349 - * @private
12.350 - */
12.351 - Sarissa.__handleLoad__ = function(oDoc){
12.352 - Sarissa.__setReadyState__(oDoc, 4);
12.353 - };
12.354 - /**
12.355 - * <p>Attached by an event handler to the load event. Internal use.</p>
12.356 - * @private
12.357 - */
12.358 - _sarissa_XMLDocument_onload = function(){
12.359 - Sarissa.__handleLoad__(this);
12.360 - };
12.361 - /**
12.362 - * <p>Sets the readyState property of the given DOM Document object.
12.363 - * Internal use.</p>
12.364 - * @private
12.365 - * @argument oDoc the DOM Document object to fire the
12.366 - * readystatechange event
12.367 - * @argument iReadyState the number to change the readystate property to
12.368 - */
12.369 - Sarissa.__setReadyState__ = function(oDoc, iReadyState){
12.370 - oDoc.readyState = iReadyState;
12.371 - oDoc.readystate = iReadyState;
12.372 - if (oDoc.onreadystatechange != null && typeof oDoc.onreadystatechange == "function") {
12.373 - oDoc.onreadystatechange();
12.374 - }
12.375 - };
12.376 - Sarissa.getDomDocument = function(sUri, sName){
12.377 - var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null);
12.378 - if(!oDoc.onreadystatechange){
12.379 -
12.380 - /**
12.381 - * <p>Emulate IE's onreadystatechange attribute</p>
12.382 - */
12.383 - oDoc.onreadystatechange = null;
12.384 - };
12.385 - if(!oDoc.readyState){
12.386 - /**
12.387 - * <p>Emulates IE's readyState property, which always gives an integer from 0 to 4:</p>
12.388 - * <ul><li>1 == LOADING,</li>
12.389 - * <li>2 == LOADED,</li>
12.390 - * <li>3 == INTERACTIVE,</li>
12.391 - * <li>4 == COMPLETED</li></ul>
12.392 - */
12.393 - oDoc.readyState = 0;
12.394 - };
12.395 - oDoc.addEventListener("load", _sarissa_XMLDocument_onload, false);
12.396 - return oDoc;
12.397 - };
12.398 - if(window.XMLDocument){
12.399 - // do nothing
12.400 - }// TODO: check if the new document has content before trying to copynodes, check for error handling in DOM 3 LS
12.401 - else if(_SARISSA_HAS_DOM_FEATURE && window.Document && !Document.prototype.load && document.implementation.hasFeature('LS', '3.0')){
12.402 - //Opera 9 may get the XPath branch which gives creates XMLDocument, therefore it doesn't reach here which is good
12.403 - /**
12.404 - * <p>Factory method to obtain a new DOM Document object</p>
12.405 - * @argument sUri the namespace of the root node (if any)
12.406 - * @argument sUri the local name of the root node (if any)
12.407 - * @returns a new DOM Document
12.408 - */
12.409 - Sarissa.getDomDocument = function(sUri, sName){
12.410 - var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null);
12.411 - return oDoc;
12.412 - };
12.413 - }
12.414 - else {
12.415 - Sarissa.getDomDocument = function(sUri, sName){
12.416 - var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null);
12.417 - // looks like safari does not create the root element for some unknown reason
12.418 - if(oDoc && (sUri || sName) && !oDoc.documentElement){
12.419 - oDoc.appendChild(oDoc.createElementNS(sUri, sName));
12.420 - };
12.421 - return oDoc;
12.422 - };
12.423 - };
12.424 - };//if(_SARISSA_HAS_DOM_CREATE_DOCUMENT)
12.425 -};
12.426 -//==========================================
12.427 -// Common stuff
12.428 -//==========================================
12.429 -if(!window.DOMParser){
12.430 - if(_SARISSA_IS_SAFARI){
12.431 - /*
12.432 - * DOMParser is a utility class, used to construct DOMDocuments from XML strings
12.433 - * @constructor
12.434 - */
12.435 - DOMParser = function() { };
12.436 - /**
12.437 - * Construct a new DOM Document from the given XMLstring
12.438 - * @param sXml the given XML string
12.439 - * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml).
12.440 - * @return a new DOM Document from the given XML string
12.441 - */
12.442 - DOMParser.prototype.parseFromString = function(sXml, contentType){
12.443 - var xmlhttp = new XMLHttpRequest();
12.444 - xmlhttp.open("GET", "data:text/xml;charset=utf-8," + encodeURIComponent(sXml), false);
12.445 - xmlhttp.send(null);
12.446 - return xmlhttp.responseXML;
12.447 - };
12.448 - }else if(Sarissa.getDomDocument && Sarissa.getDomDocument() && Sarissa.getDomDocument(null, "bar").xml){
12.449 - DOMParser = function() { };
12.450 - DOMParser.prototype.parseFromString = function(sXml, contentType){
12.451 - var doc = Sarissa.getDomDocument();
12.452 - doc.loadXML(sXml);
12.453 - return doc;
12.454 - };
12.455 - };
12.456 -};
12.457 -
12.458 -if((typeof(document.importNode) == "undefined") && _SARISSA_IS_IE){
12.459 - try{
12.460 - /**
12.461 - * Implementation of importNode for the context window document in IE.
12.462 - * If <code>oNode</code> is a TextNode, <code>bChildren</code> is ignored.
12.463 - * @param oNode the Node to import
12.464 - * @param bChildren whether to include the children of oNode
12.465 - * @returns the imported node for further use
12.466 - */
12.467 - document.importNode = function(oNode, bChildren){
12.468 - var tmp;
12.469 - if (oNode.nodeName=='#text') {
12.470 - return document.createTextElement(oNode.data);
12.471 - }
12.472 - else {
12.473 - if(oNode.nodeName == "tbody" || oNode.nodeName == "tr"){
12.474 - tmp = document.createElement("table");
12.475 - }
12.476 - else if(oNode.nodeName == "td"){
12.477 - tmp = document.createElement("tr");
12.478 - }
12.479 - else if(oNode.nodeName == "option"){
12.480 - tmp = document.createElement("select");
12.481 - }
12.482 - else{
12.483 - tmp = document.createElement("div");
12.484 - };
12.485 - if(bChildren){
12.486 - tmp.innerHTML = oNode.xml ? oNode.xml : oNode.outerHTML;
12.487 - }else{
12.488 - tmp.innerHTML = oNode.xml ? oNode.cloneNode(false).xml : oNode.cloneNode(false).outerHTML;
12.489 - };
12.490 - return tmp.getElementsByTagName("*")[0];
12.491 - };
12.492 -
12.493 - };
12.494 - }catch(e){ };
12.495 -};
12.496 -if(!Sarissa.getParseErrorText){
12.497 - /**
12.498 - * <p>Returns a human readable description of the parsing error. Usefull
12.499 - * for debugging. Tip: append the returned error string in a <pre>
12.500 - * element if you want to render it.</p>
12.501 - * <p>Many thanks to Christian Stocker for the initial patch.</p>
12.502 - * @argument oDoc The target DOM document
12.503 - * @returns The parsing error description of the target Document in
12.504 - * human readable form (preformated text)
12.505 - */
12.506 - Sarissa.getParseErrorText = function (oDoc){
12.507 - var parseErrorText = Sarissa.PARSED_OK;
12.508 - if(!oDoc.documentElement){
12.509 - parseErrorText = Sarissa.PARSED_EMPTY;
12.510 - } else if(oDoc.documentElement.tagName == "parsererror"){
12.511 - parseErrorText = oDoc.documentElement.firstChild.data;
12.512 - parseErrorText += "\n" + oDoc.documentElement.firstChild.nextSibling.firstChild.data;
12.513 - } else if(oDoc.getElementsByTagName("parsererror").length > 0){
12.514 - var parsererror = oDoc.getElementsByTagName("parsererror")[0];
12.515 - parseErrorText = Sarissa.getText(parsererror, true)+"\n";
12.516 - } else if(oDoc.parseError && oDoc.parseError.errorCode != 0){
12.517 - parseErrorText = Sarissa.PARSED_UNKNOWN_ERROR;
12.518 - };
12.519 - return parseErrorText;
12.520 - };
12.521 -};
12.522 -Sarissa.getText = function(oNode, deep){
12.523 - var s = "";
12.524 - var nodes = oNode.childNodes;
12.525 - for(var i=0; i < nodes.length; i++){
12.526 - var node = nodes[i];
12.527 - var nodeType = node.nodeType;
12.528 - if(nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE){
12.529 - s += node.data;
12.530 - } else if(deep == true
12.531 - && (nodeType == Node.ELEMENT_NODE
12.532 - || nodeType == Node.DOCUMENT_NODE
12.533 - || nodeType == Node.DOCUMENT_FRAGMENT_NODE)){
12.534 - s += Sarissa.getText(node, true);
12.535 - };
12.536 - };
12.537 - return s;
12.538 -};
12.539 -if(!window.XMLSerializer
12.540 - && Sarissa.getDomDocument
12.541 - && Sarissa.getDomDocument("","foo", null).xml){
12.542 - /**
12.543 - * Utility class to serialize DOM Node objects to XML strings
12.544 - * @constructor
12.545 - */
12.546 - XMLSerializer = function(){};
12.547 - /**
12.548 - * Serialize the given DOM Node to an XML string
12.549 - * @param oNode the DOM Node to serialize
12.550 - */
12.551 - XMLSerializer.prototype.serializeToString = function(oNode) {
12.552 - return oNode.xml;
12.553 - };
12.554 -};
12.555 -
12.556 -/**
12.557 - * strips tags from a markup string
12.558 - */
12.559 -Sarissa.stripTags = function (s) {
12.560 - return s.replace(/<[^>]+>/g,"");
12.561 -};
12.562 -/**
12.563 - * <p>Deletes all child nodes of the given node</p>
12.564 - * @argument oNode the Node to empty
12.565 - */
12.566 -Sarissa.clearChildNodes = function(oNode) {
12.567 - // need to check for firstChild due to opera 8 bug with hasChildNodes
12.568 - while(oNode.firstChild) {
12.569 - oNode.removeChild(oNode.firstChild);
12.570 - };
12.571 -};
12.572 -/**
12.573 - * <p> Copies the childNodes of nodeFrom to nodeTo</p>
12.574 - * <p> <b>Note:</b> The second object's original content is deleted before
12.575 - * the copy operation, unless you supply a true third parameter</p>
12.576 - * @argument nodeFrom the Node to copy the childNodes from
12.577 - * @argument nodeTo the Node to copy the childNodes to
12.578 - * @argument bPreserveExisting whether to preserve the original content of nodeTo, default is false
12.579 - */
12.580 -Sarissa.copyChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) {
12.581 - if(_SARISSA_IS_SAFARI && nodeTo.nodeType == Node.DOCUMENT_NODE){ // SAFARI_OLD ??
12.582 - nodeTo = nodeTo.documentElement; //Appearantly there's a bug in safari where you can't appendChild to a document node
12.583 - }
12.584 -
12.585 - if((!nodeFrom) || (!nodeTo)){
12.586 - throw "Both source and destination nodes must be provided";
12.587 - };
12.588 - if(!bPreserveExisting){
12.589 - Sarissa.clearChildNodes(nodeTo);
12.590 - };
12.591 - var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument;
12.592 - var nodes = nodeFrom.childNodes;
12.593 - if(typeof(ownerDoc.importNode) != "undefined") {
12.594 - for(var i=0;i < nodes.length;i++) {
12.595 - nodeTo.appendChild(ownerDoc.importNode(nodes[i], true));
12.596 - };
12.597 - } else {
12.598 - for(var i=0;i < nodes.length;i++) {
12.599 - nodeTo.appendChild(nodes[i].cloneNode(true));
12.600 - };
12.601 - };
12.602 -};
12.603 -
12.604 -/**
12.605 - * <p> Moves the childNodes of nodeFrom to nodeTo</p>
12.606 - * <p> <b>Note:</b> The second object's original content is deleted before
12.607 - * the move operation, unless you supply a true third parameter</p>
12.608 - * @argument nodeFrom the Node to copy the childNodes from
12.609 - * @argument nodeTo the Node to copy the childNodes to
12.610 - * @argument bPreserveExisting whether to preserve the original content of nodeTo, default is
12.611 - */
12.612 -Sarissa.moveChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) {
12.613 - if((!nodeFrom) || (!nodeTo)){
12.614 - throw "Both source and destination nodes must be provided";
12.615 - };
12.616 - if(!bPreserveExisting){
12.617 - Sarissa.clearChildNodes(nodeTo);
12.618 - };
12.619 - var nodes = nodeFrom.childNodes;
12.620 - // if within the same doc, just move, else copy and delete
12.621 - if(nodeFrom.ownerDocument == nodeTo.ownerDocument){
12.622 - while(nodeFrom.firstChild){
12.623 - nodeTo.appendChild(nodeFrom.firstChild);
12.624 - };
12.625 - } else {
12.626 - var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument;
12.627 - if(typeof(ownerDoc.importNode) != "undefined") {
12.628 - for(var i=0;i < nodes.length;i++) {
12.629 - nodeTo.appendChild(ownerDoc.importNode(nodes[i], true));
12.630 - };
12.631 - }else{
12.632 - for(var i=0;i < nodes.length;i++) {
12.633 - nodeTo.appendChild(nodes[i].cloneNode(true));
12.634 - };
12.635 - };
12.636 - Sarissa.clearChildNodes(nodeFrom);
12.637 - };
12.638 -};
12.639 -
12.640 -/**
12.641 - * <p>Serialize any <strong>non</strong> DOM object to an XML string. All properties are serialized using the property name
12.642 - * as the XML element name. Array elements are rendered as <code>array-item</code> elements,
12.643 - * using their index/key as the value of the <code>key</code> attribute.</p>
12.644 - * @argument anyObject the object to serialize
12.645 - * @argument objectName a name for that object
12.646 - * @return the XML serialization of the given object as a string
12.647 - */
12.648 -Sarissa.xmlize = function(anyObject, objectName, indentSpace){
12.649 - indentSpace = indentSpace?indentSpace:'';
12.650 - var s = indentSpace + '<' + objectName + '>';
12.651 - var isLeaf = false;
12.652 - if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String
12.653 - || anyObject instanceof Boolean || anyObject instanceof Date){
12.654 - s += Sarissa.escape(""+anyObject);
12.655 - isLeaf = true;
12.656 - }else{
12.657 - s += "\n";
12.658 - var isArrayItem = anyObject instanceof Array;
12.659 - for(var name in anyObject){
12.660 - s += Sarissa.xmlize(anyObject[name], (isArrayItem?"array-item key=\""+name+"\"":name), indentSpace + " ");
12.661 - };
12.662 - s += indentSpace;
12.663 - };
12.664 - return (s += (objectName.indexOf(' ')!=-1?"</array-item>\n":"</" + objectName + ">\n"));
12.665 -};
12.666 -
12.667 -/**
12.668 - * Escape the given string chacters that correspond to the five predefined XML entities
12.669 - * @param sXml the string to escape
12.670 - */
12.671 -Sarissa.escape = function(sXml){
12.672 - return sXml.replace(/&/g, "&")
12.673 - .replace(/</g, "<")
12.674 - .replace(/>/g, ">")
12.675 - .replace(/"/g, """)
12.676 - .replace(/'/g, "'");
12.677 -};
12.678 -
12.679 -/**
12.680 - * Unescape the given string. This turns the occurences of the predefined XML
12.681 - * entities to become the characters they represent correspond to the five predefined XML entities
12.682 - * @param sXml the string to unescape
12.683 - */
12.684 -Sarissa.unescape = function(sXml){
12.685 - return sXml.replace(/'/g,"'")
12.686 - .replace(/"/g,"\"")
12.687 - .replace(/>/g,">")
12.688 - .replace(/</g,"<")
12.689 - .replace(/&/g,"&");
12.690 -};
12.691 -// EOF
14.1 --- a/examples/Common/QtConfigurator/__init__.py Fri Nov 21 01:43:30 2008 +0100
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,241 +0,0 @@
14.4 -#!/usr/bin/env python
14.5 -
14.6 -"An example of a system configurator which runs under PyQt and WebStack."
14.7 -
14.8 -import os
14.9 -
14.10 -class ConfiguratorResource:
14.11 -
14.12 - # Standard attributes.
14.13 -
14.14 - resource_dir = os.path.join(os.path.split(__file__)[0], "Resources")
14.15 -
14.16 - design_resources = {
14.17 - "configuration" : "config.ui"
14.18 - }
14.19 -
14.20 - widget_resources = {
14.21 - "hard_disk" : ("config_hard_disk.ui", "hard_disk"),
14.22 - "memory_unit" : ("config_memory_unit.ui", "memory_unit"),
14.23 - "storage_unit" : ("config_storage_unit.ui", "storage_unit")
14.24 - #"hard_disks" : ("config_hard_disks.ui", "hard_disks"),
14.25 - #"memory_units" : ("config_memory_units.ui", "memory_units"),
14.26 - #"storage_units" : ("config_storage_units.ui", "storage_units")
14.27 - }
14.28 -
14.29 - document_resources = {
14.30 - "base-system" : "config_base_system.xml",
14.31 - "cpu" : "config_cpu.xml",
14.32 - "hard-disk" : "config_hard_disk.xml",
14.33 - "keyboard" : "config_keyboard.xml",
14.34 - "memory-unit" : "config_memory_unit.xml",
14.35 - "mouse" : "config_mouse.xml",
14.36 - "screen" : "config_screen.xml",
14.37 - "storage-unit" : "config_storage_unit.xml"
14.38 - }
14.39 -
14.40 - # Initialisation.
14.41 -
14.42 - def __init__(self, *args, **kw):
14.43 - pass
14.44 -
14.45 - def form_init(self):
14.46 -
14.47 - self.reset_collection(self.child("hard_disks"))
14.48 - self.reset_collection(self.child("memory_units"))
14.49 - self.reset_collection(self.child("storage_units"))
14.50 -
14.51 - def form_populate(self):
14.52 -
14.53 - # Get field data.
14.54 - # NOTE: This would be done for whole page updates in a Web application.
14.55 -
14.56 - self.populate_list(self.child("base_system"), self.get_elements("base-system"))
14.57 - self.populate_list(self.child("keyboard"), self.get_elements("keyboard"))
14.58 - self.populate_list(self.child("mouse"), self.get_elements("mouse"))
14.59 - self.populate_list(self.child("screen"), self.get_elements("screen"))
14.60 -
14.61 - # General functionality.
14.62 -
14.63 - def form_refresh(self, current_text=None):
14.64 -
14.65 - # Ensure consistency.
14.66 - # NOTE: This would be done for whole page updates in a Web application.
14.67 - # NOTE: This would also be done for page updates where the information
14.68 - # NOTE: involved was important.
14.69 -
14.70 - current_text = current_text or self.child("base_system").currentText()
14.71 -
14.72 - # Find the CPU socket and the interface of the current base system.
14.73 - cpu_socket = None
14.74 - interface = None
14.75 - for element in self.get_elements("base-system"):
14.76 - text = element.getAttribute("value")
14.77 - if text == current_text:
14.78 - cpu_socket = element.getAttribute("cpu-socket")
14.79 - interface = element.getAttribute("interface")
14.80 -
14.81 - # Find all valid CPUs.
14.82 - valid = []
14.83 - for element in self.get_elements("cpu"):
14.84 - if not element.hasAttribute("cpu-socket") or element.getAttribute("cpu-socket") == cpu_socket:
14.85 - valid.append(element)
14.86 - self.populate_list(self.child("cpu"), valid)
14.87 -
14.88 - # Find all valid hard disks.
14.89 - valid = []
14.90 - for element in self.get_elements("hard-disk"):
14.91 - if not element.hasAttribute("interface") or element.getAttribute("interface") == interface:
14.92 - valid.append(element)
14.93 - for hard_disk_value in self.factory.find_widgets(self, "hard_disk_value"):
14.94 - self.populate_list(hard_disk_value, valid)
14.95 -
14.96 - # Find memory units.
14.97 - for memory_unit_value in self.factory.find_widgets(self, "memory_unit_value"):
14.98 - self.populate_list(memory_unit_value, self.get_elements("memory-unit"))
14.99 -
14.100 - # Find storage units.
14.101 - for storage_unit_value in self.factory.find_widgets(self, "storage_unit_value"):
14.102 - self.populate_list(storage_unit_value, self.get_elements("storage-unit"))
14.103 -
14.104 - # Slots.
14.105 -
14.106 - def baseSystemChanged(self, current_text):
14.107 - self.request_refresh(current_text)
14.108 -
14.109 - def addHardDisk(self):
14.110 - #hard_disks = self.prepare_widget("configuration", "hard_disks")
14.111 - #tab_pages = hard_disks.child("tab pages")
14.112 - #tab = tab_pages.child("tab")
14.113 - #self.child("hard_disks").addTab(tab, hard_disks.tabLabel(tab))
14.114 - #self.factory.connect(tab, self)
14.115 - hard_disk = self.prepare_widget("configuration", "hard_disk", self.child("hard_disks"))
14.116 - self.child("hard_disks").layout().add(hard_disk)
14.117 - hard_disk.show()
14.118 - self.factory.connect(hard_disk, self)
14.119 -
14.120 - # Perform the consistency check.
14.121 - # NOTE: This is not as efficient as it could be since the general check
14.122 - # NOTE: refreshes all fields, not just newly added ones.
14.123 - self.request_refresh()
14.124 -
14.125 - def addMemoryUnit(self):
14.126 - #memory_units = self.prepare_widget("configuration", "memory_units")
14.127 - #tab_pages = memory_units.child("tab pages")
14.128 - #tab = tab_pages.child("tab")
14.129 - #self.child("memory_units").addTab(tab, memory_units.tabLabel(tab))
14.130 - #self.factory.connect(tab, self)
14.131 - memory_unit = self.prepare_widget("configuration", "memory_unit", self.child("memory_units"))
14.132 - self.child("memory_units").layout().add(memory_unit)
14.133 - memory_unit.show()
14.134 - self.factory.connect(memory_unit, self)
14.135 -
14.136 - # Perform the consistency check.
14.137 - # NOTE: This is not as efficient as it could be since the general check
14.138 - # NOTE: refreshes all fields, not just newly added ones.
14.139 - self.request_refresh()
14.140 -
14.141 - def addStorageUnit(self):
14.142 - #storage_units = self.prepare_widget("configuration", "storage_units")
14.143 - #tab_pages = storage_units.child("tab pages")
14.144 - #tab = tab_pages.child("tab")
14.145 - #self.child("storage_units").addTab(tab, storage_units.tabLabel(tab))
14.146 - #self.factory.connect(tab, self)
14.147 - storage_unit = self.prepare_widget("configuration", "storage_unit", self.child("storage_units"))
14.148 - self.child("storage_units").layout().add(storage_unit)
14.149 - storage_unit.show()
14.150 - self.factory.connect(storage_unit, self)
14.151 -
14.152 - # Perform the consistency check.
14.153 - # NOTE: This is not as efficient as it could be since the general check
14.154 - # NOTE: refreshes all fields, not just newly added ones.
14.155 - self.request_refresh()
14.156 -
14.157 - def removeHardDisk(self):
14.158 - #page = self.hard_disks.currentPage()
14.159 - #self.hard_disks.removePage(page)
14.160 - #page.deleteLater()
14.161 - remove_hard_disk = self.sender()
14.162 - hard_disk = remove_hard_disk.parent()
14.163 - self.child("hard_disks").layout().remove(hard_disk)
14.164 - hard_disk.deleteLater()
14.165 -
14.166 - def removeMemoryUnit(self):
14.167 - #page = self.memory_units.currentPage()
14.168 - #self.memory_units.removePage(page)
14.169 - #page.deleteLater()
14.170 - remove_memory_unit = self.sender()
14.171 - memory_unit = remove_memory_unit.parent()
14.172 - self.child("memory_units").layout().remove(memory_unit)
14.173 - memory_unit.deleteLater()
14.174 -
14.175 - def removeStorageUnit(self):
14.176 - #page = self.storage_units.currentPage()
14.177 - #self.storage_units.removePage(page)
14.178 - #page.deleteLater()
14.179 - remove_storage_unit = self.sender()
14.180 - storage_unit = remove_storage_unit.parent()
14.181 - self.child("storage_units").layout().remove(storage_unit)
14.182 - storage_unit.deleteLater()
14.183 -
14.184 - def updateConfig(self):
14.185 - self.form_refresh()
14.186 -
14.187 - def exportConfig(self):
14.188 - print "configuration.exportConfig(): Not implemented yet"
14.189 -
14.190 -def get_resource(resource_type, *args, **kw):
14.191 -
14.192 - if resource_type == "PyQt":
14.193 - import XSLForms.Resources.PyQtResources
14.194 - try:
14.195 - import QtConfigurator.Forms
14.196 - except ImportError:
14.197 - print "*" * 60
14.198 - print "Please generate the following file before running this example:"
14.199 - print os.path.join(os.path.split(__file__)[0], "Forms.py")
14.200 - print "Use the pyuic program along with the form definition file:"
14.201 - print os.path.join(os.path.split(__file__)[0], "Resources", "config.ui")
14.202 - print "*" * 60
14.203 - print
14.204 - raise
14.205 - class Configurator(ConfiguratorResource, QtConfigurator.Forms.Configurator, XSLForms.Resources.PyQtResources.XSLFormsResource):
14.206 - def __init__(self, *args, **kw):
14.207 - QtConfigurator.Forms.Configurator.__init__(self, *args, **kw)
14.208 - XSLForms.Resources.PyQtResources.XSLFormsResource.__init__(self, "configuration")
14.209 - ConfiguratorResource.__init__(self, *args, **kw)
14.210 - resource = Configurator(*args, **kw)
14.211 - resource.form_init()
14.212 - resource.form_populate()
14.213 -
14.214 - else:
14.215 - import XSLForms.Resources.PyQtWebResources
14.216 - from WebStack.Resources.ResourceMap import MapResource
14.217 - from WebStack.Resources.Selectors import EncodingSelector
14.218 - from WebStack.Resources.Static import DirectoryResource
14.219 -
14.220 - # Configuration setting.
14.221 -
14.222 - encoding = "utf-8"
14.223 -
14.224 - class Configurator(ConfiguratorResource, XSLForms.Resources.PyQtWebResources.XSLFormsResource):
14.225 - def __init__(self, *args, **kw):
14.226 - XSLForms.Resources.PyQtWebResources.XSLFormsResource.__init__(self, "configuration")
14.227 - ConfiguratorResource.__init__(self, *args, **kw)
14.228 -
14.229 - configurator_resource = Configurator(*args, **kw)
14.230 - directory = configurator_resource.resource_dir
14.231 - root_resource = MapResource({
14.232 - "styles" : DirectoryResource(os.path.join(directory, "styles"), {"css" : "text/css"}),
14.233 - "scripts" : DirectoryResource(os.path.join(directory, "scripts"), {"js" : "text/javascript"}),
14.234 - "" : configurator_resource
14.235 - })
14.236 - resource = EncodingSelector(root_resource, encoding)
14.237 -
14.238 - # Do not initialise or populate the resource here: both happen when a
14.239 - # Web request is received (initialisation when no form document is
14.240 - # found; population when a form document is prepared for output).
14.241 -
14.242 - return resource
14.243 -
14.244 -# vim: tabstop=4 expandtab shiftwidth=4
15.1 --- a/examples/PyQt/QtConfiguratorApp.py Fri Nov 21 01:43:30 2008 +0100
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,19 +0,0 @@
15.4 -#!/usr/bin/env python
15.5 -
15.6 -from qt import QApplication, QMainWindow, QScrollView, QSizePolicy
15.7 -import QtConfigurator
15.8 -import sys
15.9 -
15.10 -if __name__ == "__main__":
15.11 - app = QApplication(sys.argv)
15.12 - window = QScrollView()
15.13 - configurator = QtConfigurator.get_resource("PyQt", window)
15.14 - window.addChild(configurator)
15.15 - window.show()
15.16 - window.resize(
15.17 - configurator.width(), # + window.verticalScrollBar().width(),
15.18 - configurator.height()) # + window.horizontalScrollBar().height())
15.19 - app.setMainWidget(window)
15.20 - app.exec_loop()
15.21 -
15.22 -# vim: tabstop=4 expandtab shiftwidth=4