summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/tools
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
commitdda8474928bd7276e1fad8fb7a601e7c83ff2bc2 (patch)
tree7f83910598b33b12730035f086df20b5a53ab99c /tqtinterface/qt4/tools
parent6260b6178868c03aab1644bf93b0ef043654bdb0 (diff)
downloadexperimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.tar.gz
experimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.zip
Added TQt4 HEAD
Diffstat (limited to 'tqtinterface/qt4/tools')
-rw-r--r--tqtinterface/qt4/tools/assistant/LICENSE.GPL280
-rw-r--r--tqtinterface/qt4/tools/assistant/assistant.icnsbin0 -> 58954 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/assistant.icobin0 -> 10134 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/assistant.pro72
-rw-r--r--tqtinterface/qt4/tools/assistant/assistant.rc1
-rw-r--r--tqtinterface/qt4/tools/assistant/assistant_de.qmbin0 -> 13929 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/assistant_de.ts1084
-rw-r--r--tqtinterface/qt4/tools/assistant/assistant_fr.ts426
-rw-r--r--tqtinterface/qt4/tools/assistant/book/assistant.book6
-rw-r--r--tqtinterface/qt4/tools/assistant/book/assistant.leaf563
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/assistant.pngbin0 -> 53805 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/docwindow.pngbin0 -> 9727 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/general.pngbin0 -> 11239 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/pdf1.pngbin0 -> 8610 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/search.pngbin0 -> 6284 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/sidebar.pngbin0 -> 5041 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/toolbar1.pngbin0 -> 4184 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/book/images/web.pngbin0 -> 11826 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/config.cpp379
-rw-r--r--tqtinterface/qt4/tools/assistant/config.h152
-rw-r--r--tqtinterface/qt4/tools/assistant/docuparser.cpp397
-rw-r--r--tqtinterface/qt4/tools/assistant/docuparser.h151
-rw-r--r--tqtinterface/qt4/tools/assistant/finddialog.ui292
-rw-r--r--tqtinterface/qt4/tools/assistant/finddialog.ui.h108
-rw-r--r--tqtinterface/qt4/tools/assistant/helpdialog.ui506
-rw-r--r--tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp1161
-rw-r--r--tqtinterface/qt4/tools/assistant/helpdialogimpl.h173
-rw-r--r--tqtinterface/qt4/tools/assistant/helpwindow.cpp282
-rw-r--r--tqtinterface/qt4/tools/assistant/helpwindow.h88
-rw-r--r--tqtinterface/qt4/tools/assistant/images/addtab.pngbin0 -> 469 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/appicon.pngbin0 -> 2353 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/assistant.pngbin0 -> 1349 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/book.pngbin0 -> 861 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/closetab.pngbin0 -> 533 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/d_closetab.pngbin0 -> 396 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/designer.pngbin0 -> 1367 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/editcopy.pngbin0 -> 491 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/find.pngbin0 -> 856 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/home.pngbin0 -> 1081 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/linguist.pngbin0 -> 1157 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/next.pngbin0 -> 541 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/previous.pngbin0 -> 542 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/print.pngbin0 -> 766 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/qt.pngbin0 -> 975 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/splash.pngbin0 -> 50661 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/whatsthis.xpm26
-rw-r--r--tqtinterface/qt4/tools/assistant/images/zoomin.pngbin0 -> 900 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/images/zoomout.pngbin0 -> 919 bytes
-rw-r--r--tqtinterface/qt4/tools/assistant/index.cpp526
-rw-r--r--tqtinterface/qt4/tools/assistant/index.h132
-rw-r--r--tqtinterface/qt4/tools/assistant/lib/lib.pro23
-rw-r--r--tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp334
-rw-r--r--tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h81
-rw-r--r--tqtinterface/qt4/tools/assistant/main.cpp344
-rw-r--r--tqtinterface/qt4/tools/assistant/mainwindow.ui670
-rw-r--r--tqtinterface/qt4/tools/assistant/mainwindow.ui.h697
-rw-r--r--tqtinterface/qt4/tools/assistant/profile.cpp124
-rw-r--r--tqtinterface/qt4/tools/assistant/profile.h130
-rw-r--r--tqtinterface/qt4/tools/assistant/settingsdialog.ui516
-rw-r--r--tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp122
-rw-r--r--tqtinterface/qt4/tools/assistant/settingsdialogimpl.h64
-rw-r--r--tqtinterface/qt4/tools/assistant/tabbedbrowser.ui141
-rw-r--r--tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h347
-rw-r--r--tqtinterface/qt4/tools/assistant/topicchooser.ui182
-rw-r--r--tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp70
-rw-r--r--tqtinterface/qt4/tools/assistant/topicchooserimpl.h60
-rw-r--r--tqtinterface/qt4/tools/designer/LICENSE.GPL280
-rw-r--r--tqtinterface/qt4/tools/designer/app/app.pro26
-rw-r--r--tqtinterface/qt4/tools/designer/app/designer.icnsbin0 -> 56873 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/app/designer.icobin0 -> 10134 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/app/designer.rc2
-rw-r--r--tqtinterface/qt4/tools/designer/app/main.cpp228
-rw-r--r--tqtinterface/qt4/tools/designer/designer.pro12
-rw-r--r--tqtinterface/qt4/tools/designer/designer/about.ui222
-rw-r--r--tqtinterface/qt4/tools/designer/designer/actiondnd.cpp743
-rw-r--r--tqtinterface/qt4/tools/designer/designer/actiondnd.h248
-rw-r--r--tqtinterface/qt4/tools/designer/designer/actioneditor.ui230
-rw-r--r--tqtinterface/qt4/tools/designer/designer/actioneditorimpl.cpp325
-rw-r--r--tqtinterface/qt4/tools/designer/designer/actioneditorimpl.h88
-rw-r--r--tqtinterface/qt4/tools/designer/designer/actionlistview.cpp115
-rw-r--r--tqtinterface/qt4/tools/designer/designer/actionlistview.h89
-rw-r--r--tqtinterface/qt4/tools/designer/designer/asciivalidator.cpp101
-rw-r--r--tqtinterface/qt4/tools/designer/designer/asciivalidator.h59
-rw-r--r--tqtinterface/qt4/tools/designer/designer/command.cpp2402
-rw-r--r--tqtinterface/qt4/tools/designer/designer/command.h1267
-rw-r--r--tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui329
-rw-r--r--tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui.h222
-rw-r--r--tqtinterface/qt4/tools/designer/designer/connectiondialog.ui226
-rw-r--r--tqtinterface/qt4/tools/designer/designer/connectiondialog.ui.h318
-rw-r--r--tqtinterface/qt4/tools/designer/designer/connectionitems.cpp524
-rw-r--r--tqtinterface/qt4/tools/designer/designer/connectionitems.h233
-rw-r--r--tqtinterface/qt4/tools/designer/designer/connectiontable.cpp61
-rw-r--r--tqtinterface/qt4/tools/designer/designer/connectiontable.h54
-rw-r--r--tqtinterface/qt4/tools/designer/designer/createtemplate.ui236
-rw-r--r--tqtinterface/qt4/tools/designer/designer/customwidgeteditor.ui1385
-rw-r--r--tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.cpp845
-rw-r--r--tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.h106
-rw-r--r--tqtinterface/qt4/tools/designer/designer/database.cpp129
-rw-r--r--tqtinterface/qt4/tools/designer/designer/database.h92
-rw-r--r--tqtinterface/qt4/tools/designer/designer/database2.h95
-rw-r--r--tqtinterface/qt4/tools/designer/designer/dbconnection.ui229
-rw-r--r--tqtinterface/qt4/tools/designer/designer/dbconnectioneditor.ui154
-rw-r--r--tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.cpp87
-rw-r--r--tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.h65
-rw-r--r--tqtinterface/qt4/tools/designer/designer/dbconnections.ui328
-rw-r--r--tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.cpp201
-rw-r--r--tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.h68
-rw-r--r--tqtinterface/qt4/tools/designer/designer/defs.cpp91
-rw-r--r--tqtinterface/qt4/tools/designer/designer/defs.h49
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designer.pro443
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designer_de.ts4969
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designer_fr.ts4969
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designer_pch.h44
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designerapp.cpp181
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designerapp.h65
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designerappiface.cpp1100
-rw-r--r--tqtinterface/qt4/tools/designer/designer/designerappiface.h284
-rw-r--r--tqtinterface/qt4/tools/designer/designer/editfunctions.ui721
-rw-r--r--tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.cpp536
-rw-r--r--tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.h102
-rw-r--r--tqtinterface/qt4/tools/designer/designer/finddialog.ui281
-rw-r--r--tqtinterface/qt4/tools/designer/designer/finddialog.ui.h68
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formfile.cpp924
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formfile.h154
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formsettings.ui556
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formsettingsimpl.cpp125
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formsettingsimpl.h57
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formwindow.cpp2754
-rw-r--r--tqtinterface/qt4/tools/designer/designer/formwindow.h329
-rw-r--r--tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui176
-rw-r--r--tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui.h57
-rw-r--r--tqtinterface/qt4/tools/designer/designer/hierarchyview.cpp1498
-rw-r--r--tqtinterface/qt4/tools/designer/designer/hierarchyview.h254
-rw-r--r--tqtinterface/qt4/tools/designer/designer/iconvieweditor.ui464
-rw-r--r--tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.cpp170
-rw-r--r--tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.h66
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_adjustsize.pngbin0 -> 495 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_appicon.pngbin0 -> 2341 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_arrow.pngbin0 -> 216 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_background.pngbin0 -> 6724 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_book.pngbin0 -> 825 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_buttongroup.pngbin0 -> 648 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_checkbox.pngbin0 -> 817 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_combobox.pngbin0 -> 549 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_connecttool.pngbin0 -> 553 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_cross.pngbin0 -> 164 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_customwidget.pngbin0 -> 1133 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_adjustsize.pngbin0 -> 527 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_book.pngbin0 -> 557 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_buttongroup.pngbin0 -> 482 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_checkbox.pngbin0 -> 547 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_combobox.pngbin0 -> 420 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_connecttool.pngbin0 -> 450 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_customwidget.pngbin0 -> 629 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_databrowser.pngbin0 -> 600 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_datatable.pngbin0 -> 592 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_dataview.pngbin0 -> 663 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_dateedit.pngbin0 -> 452 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_datetimeedit.pngbin0 -> 665 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_dial.pngbin0 -> 706 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_down.pngbin0 -> 441 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editbreaklayout.pngbin0 -> 635 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editcopy.pngbin0 -> 515 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editcut.pngbin0 -> 800 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editdelete.pngbin0 -> 682 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editgrid.pngbin0 -> 425 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayout.pngbin0 -> 272 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayoutsplit.pngbin0 -> 328 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editlower.pngbin0 -> 450 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editpaste.pngbin0 -> 598 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editraise.pngbin0 -> 454 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editslots.pngbin0 -> 534 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayout.pngbin0 -> 272 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayoutsplit.pngbin0 -> 333 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_filenew.pngbin0 -> 298 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_fileopen.pngbin0 -> 406 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_filesave.pngbin0 -> 267 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_folder.pngbin0 -> 841 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_form.pngbin0 -> 274 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_frame.pngbin0 -> 427 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_groupbox.pngbin0 -> 465 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_help.pngbin0 -> 786 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_home.pngbin0 -> 743 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_iconview.pngbin0 -> 547 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_image.pngbin0 -> 482 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_label.pngbin0 -> 670 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_layout.pngbin0 -> 496 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_lcdnumber.pngbin0 -> 452 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_left.pngbin0 -> 422 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_line.pngbin0 -> 327 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_lineedit.pngbin0 -> 445 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_listbox.pngbin0 -> 410 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_listview.pngbin0 -> 639 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_multilineedit.pngbin0 -> 479 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_newform.pngbin0 -> 443 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_ordertool.pngbin0 -> 533 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_pixlabel.pngbin0 -> 619 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_pointer.pngbin0 -> 476 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_print.pngbin0 -> 589 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_progress.pngbin0 -> 375 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_project.pngbin0 -> 915 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_pushbutton.pngbin0 -> 445 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_radiobutton.pngbin0 -> 605 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_redo.pngbin0 -> 465 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_richtextedit.pngbin0 -> 562 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_right.pngbin0 -> 425 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_scrollbar.pngbin0 -> 364 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_searchfind.pngbin0 -> 501 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_setbuddy.pngbin0 -> 427 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_slider.pngbin0 -> 548 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_spacer.pngbin0 -> 519 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_spinbox.pngbin0 -> 477 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_table.pngbin0 -> 512 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_tabwidget.pngbin0 -> 404 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textbold.pngbin0 -> 517 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textbrowser.pngbin0 -> 534 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textcenter.pngbin0 -> 453 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textedit.pngbin0 -> 526 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textfont.pngbin0 -> 412 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_texth1.pngbin0 -> 475 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_texth2.pngbin0 -> 537 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_texth3.pngbin0 -> 508 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textitalic.pngbin0 -> 452 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textjustify.pngbin0 -> 442 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textlarger.pngbin0 -> 537 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textleft.pngbin0 -> 442 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textlinebreak.pngbin0 -> 526 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textparagraph.pngbin0 -> 543 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textright.pngbin0 -> 443 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textsmaller.pngbin0 -> 512 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textteletext.pngbin0 -> 462 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textunderline.pngbin0 -> 497 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_textview.pngbin0 -> 529 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_timeedit.pngbin0 -> 827 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbox.pngbin0 -> 465 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbutton.pngbin0 -> 670 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_undo.pngbin0 -> 471 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_up.pngbin0 -> 444 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_widgetstack.pngbin0 -> 558 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddata.pngbin0 -> 294 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddialog.pngbin0 -> 421 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_d_wordwrap.pngbin0 -> 506 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_databrowser.pngbin0 -> 907 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_datatable.pngbin0 -> 923 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_dataview.pngbin0 -> 1039 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_dateedit.pngbin0 -> 505 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_datetimeedit.pngbin0 -> 1074 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_dial.pngbin0 -> 994 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_down.pngbin0 -> 595 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editbreaklayout.pngbin0 -> 744 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editcopy.pngbin0 -> 485 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editcut.pngbin0 -> 649 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editdelete.pngbin0 -> 833 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editgrid.pngbin0 -> 513 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_edithlayout.pngbin0 -> 295 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_edithlayoutsplit.pngbin0 -> 344 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editlower.pngbin0 -> 609 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editpaste.pngbin0 -> 907 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editraise.pngbin0 -> 614 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editslots.pngbin0 -> 690 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editvlayout.pngbin0 -> 289 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_editvlayoutsplit.pngbin0 -> 355 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_filenew.pngbin0 -> 313 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_fileopen.pngbin0 -> 681 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_filesave.pngbin0 -> 328 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_folder.pngbin0 -> 1366 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_form.pngbin0 -> 301 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_frame.pngbin0 -> 400 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_groupbox.pngbin0 -> 439 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_hand.pngbin0 -> 197 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_help.pngbin0 -> 1561 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_home.pngbin0 -> 1083 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_hsplit.pngbin0 -> 203 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_ibeam.pngbin0 -> 162 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_iconview.pngbin0 -> 613 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_image.pngbin0 -> 769 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_label.pngbin0 -> 953 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_layout.pngbin0 -> 706 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_lcdnumber.pngbin0 -> 558 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_left.pngbin0 -> 678 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_line.pngbin0 -> 287 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_lineedit.pngbin0 -> 405 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_listbox.pngbin0 -> 384 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_listview.pngbin0 -> 759 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_multilineedit.pngbin0 -> 452 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_newform.pngbin0 -> 531 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_no.pngbin0 -> 230 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_object.pngbin0 -> 1065 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_ordertool.pngbin0 -> 587 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_pixlabel.pngbin0 -> 1228 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_pointer.pngbin0 -> 586 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_print.pngbin0 -> 742 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_progress.pngbin0 -> 559 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_project.pngbin0 -> 1275 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_pushbutton.pngbin0 -> 408 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_qtlogo.pngbin0 -> 12615 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_radiobutton.pngbin0 -> 586 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_redo.pngbin0 -> 592 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_resetproperty.pngbin0 -> 184 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_richtextedit.pngbin0 -> 834 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_right.pngbin0 -> 656 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_s_down.pngbin0 -> 574 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_s_editcut.pngbin0 -> 444 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_s_left.pngbin0 -> 564 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_s_right.pngbin0 -> 557 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_s_up.pngbin0 -> 586 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_scrollbar.pngbin0 -> 408 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_searchfind.pngbin0 -> 843 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_setbuddy.pngbin0 -> 427 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_sizeall.pngbin0 -> 208 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_sizeb.pngbin0 -> 203 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_sizef.pngbin0 -> 203 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_sizeh.pngbin0 -> 179 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_sizev.pngbin0 -> 177 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_slider.pngbin0 -> 729 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_spacer.pngbin0 -> 715 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_spinbox.pngbin0 -> 455 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_splash.pngbin0 -> 123917 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_table.pngbin0 -> 483 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_tabwidget.pngbin0 -> 572 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textbold.pngbin0 -> 494 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textbrowser.pngbin0 -> 514 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textcenter.pngbin0 -> 429 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textedit.pngbin0 -> 495 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textfont.pngbin0 -> 494 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_texth1.pngbin0 -> 462 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_texth2.pngbin0 -> 511 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_texth3.pngbin0 -> 485 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textitalic.pngbin0 -> 442 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textjustify.pngbin0 -> 408 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textlarger.pngbin0 -> 710 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textleft.pngbin0 -> 409 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textlinebreak.pngbin0 -> 509 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textparagraph.pngbin0 -> 527 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textright.pngbin0 -> 408 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textsmaller.pngbin0 -> 654 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textteletext.pngbin0 -> 445 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textunderline.pngbin0 -> 471 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_textview.pngbin0 -> 498 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_timeedit.pngbin0 -> 1520 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_toolbox.pngbin0 -> 783 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_toolbutton.pngbin0 -> 1261 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_undo.pngbin0 -> 572 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_up.pngbin0 -> 692 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_uparrow.pngbin0 -> 169 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_vsplit.pngbin0 -> 192 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_wait.pngbin0 -> 216 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_widgetstack.pngbin0 -> 831 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_wizarddata.pngbin0 -> 323 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_wizarddialog.pngbin0 -> 632 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/images/designer_wordwrap.pngbin0 -> 643 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/designer/layout.cpp1024
-rw-r--r--tqtinterface/qt4/tools/designer/designer/layout.h198
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listboxdnd.cpp312
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listboxdnd.h71
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listboxeditor.ui461
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.cpp250
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.h69
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listboxrename.cpp164
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listboxrename.h65
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listdnd.cpp149
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listdnd.h70
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listeditor.ui182
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listeditor.ui.h72
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listviewdnd.cpp439
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listviewdnd.h74
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listvieweditor.ui938
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.cpp655
-rw-r--r--tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.h110
-rw-r--r--tqtinterface/qt4/tools/designer/designer/mainwindow.cpp3784
-rw-r--r--tqtinterface/qt4/tools/designer/designer/mainwindow.h505
-rw-r--r--tqtinterface/qt4/tools/designer/designer/mainwindowactions.cpp2061
-rw-r--r--tqtinterface/qt4/tools/designer/designer/menubareditor.cpp1134
-rw-r--r--tqtinterface/qt4/tools/designer/designer/menubareditor.h207
-rw-r--r--tqtinterface/qt4/tools/designer/designer/metadatabase.cpp1693
-rw-r--r--tqtinterface/qt4/tools/designer/designer/metadatabase.h276
-rw-r--r--tqtinterface/qt4/tools/designer/designer/multilineeditor.ui188
-rw-r--r--tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.cpp417
-rw-r--r--tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.h119
-rw-r--r--tqtinterface/qt4/tools/designer/designer/newform.ui245
-rw-r--r--tqtinterface/qt4/tools/designer/designer/newformimpl.cpp418
-rw-r--r--tqtinterface/qt4/tools/designer/designer/newformimpl.h172
-rw-r--r--tqtinterface/qt4/tools/designer/designer/orderindicator.cpp119
-rw-r--r--tqtinterface/qt4/tools/designer/designer/orderindicator.h65
-rw-r--r--tqtinterface/qt4/tools/designer/designer/outputwindow.cpp214
-rw-r--r--tqtinterface/qt4/tools/designer/designer/outputwindow.h106
-rw-r--r--tqtinterface/qt4/tools/designer/designer/paletteeditor.ui503
-rw-r--r--tqtinterface/qt4/tools/designer/designer/paletteeditoradvanced.ui755
-rw-r--r--tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.cpp650
-rw-r--r--tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.h104
-rw-r--r--tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.cpp311
-rw-r--r--tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.h84
-rw-r--r--tqtinterface/qt4/tools/designer/designer/pixmapchooser.cpp206
-rw-r--r--tqtinterface/qt4/tools/designer/designer/pixmapchooser.h79
-rw-r--r--tqtinterface/qt4/tools/designer/designer/pixmapcollection.cpp187
-rw-r--r--tqtinterface/qt4/tools/designer/designer/pixmapcollection.h87
-rw-r--r--tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui225
-rw-r--r--tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui.h156
-rw-r--r--tqtinterface/qt4/tools/designer/designer/pixmapfunction.ui937
-rw-r--r--tqtinterface/qt4/tools/designer/designer/popupmenueditor.cpp1468
-rw-r--r--tqtinterface/qt4/tools/designer/designer/popupmenueditor.h244
-rw-r--r--tqtinterface/qt4/tools/designer/designer/preferences.ui670
-rw-r--r--tqtinterface/qt4/tools/designer/designer/previewframe.cpp64
-rw-r--r--tqtinterface/qt4/tools/designer/designer/previewframe.h66
-rw-r--r--tqtinterface/qt4/tools/designer/designer/previewwidget.ui311
-rw-r--r--tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.cpp72
-rw-r--r--tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.h51
-rw-r--r--tqtinterface/qt4/tools/designer/designer/project.cpp1598
-rw-r--r--tqtinterface/qt4/tools/designer/designer/project.h281
-rw-r--r--tqtinterface/qt4/tools/designer/designer/projectsettings.ui308
-rw-r--r--tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.cpp132
-rw-r--r--tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.h64
-rw-r--r--tqtinterface/qt4/tools/designer/designer/propertyeditor.cpp4307
-rw-r--r--tqtinterface/qt4/tools/designer/designer/propertyeditor.h898
-rw-r--r--tqtinterface/qt4/tools/designer/designer/propertyobject.cpp165
-rw-r--r--tqtinterface/qt4/tools/designer/designer/propertyobject.h43
-rw-r--r--tqtinterface/qt4/tools/designer/designer/qcompletionedit.cpp217
-rw-r--r--tqtinterface/qt4/tools/designer/designer/qcompletionedit.h87
-rw-r--r--tqtinterface/qt4/tools/designer/designer/replacedialog.ui325
-rw-r--r--tqtinterface/qt4/tools/designer/designer/replacedialog.ui.h82
-rw-r--r--tqtinterface/qt4/tools/designer/designer/resource.cpp3367
-rw-r--r--tqtinterface/qt4/tools/designer/designer/resource.h172
-rw-r--r--tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui354
-rw-r--r--tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui.h49
-rw-r--r--tqtinterface/qt4/tools/designer/designer/sizehandle.cpp394
-rw-r--r--tqtinterface/qt4/tools/designer/designer/sizehandle.h105
-rw-r--r--tqtinterface/qt4/tools/designer/designer/sourceeditor.cpp325
-rw-r--r--tqtinterface/qt4/tools/designer/designer/sourceeditor.h114
-rw-r--r--tqtinterface/qt4/tools/designer/designer/sourcefile.cpp302
-rw-r--r--tqtinterface/qt4/tools/designer/designer/sourcefile.h94
-rw-r--r--tqtinterface/qt4/tools/designer/designer/startdialog.ui331
-rw-r--r--tqtinterface/qt4/tools/designer/designer/startdialogimpl.cpp177
-rw-r--r--tqtinterface/qt4/tools/designer/designer/startdialogimpl.h89
-rw-r--r--tqtinterface/qt4/tools/designer/designer/styledbutton.cpp302
-rw-r--r--tqtinterface/qt4/tools/designer/designer/styledbutton.h111
-rw-r--r--tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.cpp167
-rw-r--r--tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.h67
-rw-r--r--tqtinterface/qt4/tools/designer/designer/tableeditor.ui831
-rw-r--r--tqtinterface/qt4/tools/designer/designer/tableeditorimpl.cpp501
-rw-r--r--tqtinterface/qt4/tools/designer/designer/tableeditorimpl.h90
-rw-r--r--tqtinterface/qt4/tools/designer/designer/timestamp.cpp93
-rw-r--r--tqtinterface/qt4/tools/designer/designer/timestamp.h71
-rw-r--r--tqtinterface/qt4/tools/designer/designer/variabledialog.ui301
-rw-r--r--tqtinterface/qt4/tools/designer/designer/variabledialogimpl.cpp185
-rw-r--r--tqtinterface/qt4/tools/designer/designer/variabledialogimpl.h64
-rw-r--r--tqtinterface/qt4/tools/designer/designer/widgetaction.cpp65
-rw-r--r--tqtinterface/qt4/tools/designer/designer/widgetaction.h72
-rw-r--r--tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp1829
-rw-r--r--tqtinterface/qt4/tools/designer/designer/widgetfactory.h523
-rw-r--r--tqtinterface/qt4/tools/designer/designer/wizardeditor.ui345
-rw-r--r--tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.cpp258
-rw-r--r--tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.h82
-rw-r--r--tqtinterface/qt4/tools/designer/designer/workspace.cpp713
-rw-r--r--tqtinterface/qt4/tools/designer/designer/workspace.h159
-rw-r--r--tqtinterface/qt4/tools/designer/editor/arghintwidget.cpp239
-rw-r--r--tqtinterface/qt4/tools/designer/editor/arghintwidget.h69
-rw-r--r--tqtinterface/qt4/tools/designer/editor/browser.cpp149
-rw-r--r--tqtinterface/qt4/tools/designer/editor/browser.h66
-rw-r--r--tqtinterface/qt4/tools/designer/editor/cindent.cpp163
-rw-r--r--tqtinterface/qt4/tools/designer/editor/cindent.h63
-rw-r--r--tqtinterface/qt4/tools/designer/editor/completion.cpp714
-rw-r--r--tqtinterface/qt4/tools/designer/editor/completion.h110
-rw-r--r--tqtinterface/qt4/tools/designer/editor/conf.cpp269
-rw-r--r--tqtinterface/qt4/tools/designer/editor/conf.h75
-rw-r--r--tqtinterface/qt4/tools/designer/editor/editor.cpp251
-rw-r--r--tqtinterface/qt4/tools/designer/editor/editor.h111
-rw-r--r--tqtinterface/qt4/tools/designer/editor/editor.pro40
-rw-r--r--tqtinterface/qt4/tools/designer/editor/markerwidget.cpp491
-rw-r--r--tqtinterface/qt4/tools/designer/editor/markerwidget.h75
-rw-r--r--tqtinterface/qt4/tools/designer/editor/paragdata.h65
-rw-r--r--tqtinterface/qt4/tools/designer/editor/parenmatcher.cpp215
-rw-r--r--tqtinterface/qt4/tools/designer/editor/parenmatcher.h78
-rw-r--r--tqtinterface/qt4/tools/designer/editor/preferences.ui510
-rw-r--r--tqtinterface/qt4/tools/designer/editor/preferences.ui.h181
-rw-r--r--tqtinterface/qt4/tools/designer/editor/viewmanager.cpp276
-rw-r--r--tqtinterface/qt4/tools/designer/editor/viewmanager.h100
-rw-r--r--tqtinterface/qt4/tools/designer/editor/yyindent.cpp1170
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.pro14
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui324
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui.h137
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui243
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui.h24
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/images/editcut.pngbin0 -> 163 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/images/filenew.pngbin0 -> 150 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/images/fileopen.pngbin0 -> 179 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/images/filesave.pngbin0 -> 157 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/images/searchfind.pngbin0 -> 587 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/main.cpp11
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/search.ui136
-rw-r--r--tqtinterface/qt4/tools/designer/examples/addressbook/search.ui.h13
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book.sql42
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book1/book.ui71
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book1/book.ui.h5
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book1/book1.pro8
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book1/main.cpp27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book2/book.ui77
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book2/book.ui.h10
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book2/book2.pro8
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book2/main.cpp27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book3/book.ui141
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book3/book.ui.h16
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book3/book3.pro8
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book3/main.cpp27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book4/book.ui179
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book4/book.ui.h16
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book4/book4.pro8
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book4/main.cpp29
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book5/book.ui188
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book5/book.ui.h23
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book5/book5.pro8
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui291
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui.h10
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book5/main.cpp27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book6/book.ui189
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book6/book.ui.h33
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book6/book6.pro8
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui300
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui.h10
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book6/main.cpp27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book7/book.ui189
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book7/book.ui.h33
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book7/book7.pro7
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui384
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui.h42
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book7/main.cpp27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book8/book.ui189
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book8/book.ui.h33
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book8/book8.pro7
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui386
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui.h47
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/book8/main.cpp27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/connection.cpp52
-rw-r--r--tqtinterface/qt4/tools/designer/examples/book/connection.h18
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui168
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui.h27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/colortool.pro27
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/findform.ui141
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/findform.ui.h18
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/editcopy.pngbin0 -> 187 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/editcut.pngbin0 -> 163 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/editraise.pngbin0 -> 489 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/filenew.pngbin0 -> 127 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/fileopen.pngbin0 -> 178 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/filesave.pngbin0 -> 158 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/iconview.pngbin0 -> 898 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/richtextedit.pngbin0 -> 878 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/searchfind.pngbin0 -> 554 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/table.pngbin0 -> 371 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/tabwidget.pngbin0 -> 545 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/images/widgetstack.pngbin0 -> 662 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/main.cpp10
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui601
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui.h585
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui153
-rw-r--r--tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui.h7
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/credit.pro11
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/creditform.cpp20
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/creditform.h12
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/creditformbase.cpp122
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/creditformbase.h48
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui212
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui.h5
-rw-r--r--tqtinterface/qt4/tools/designer/examples/credit/main.cpp25
-rw-r--r--tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.cpp95
-rw-r--r--tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.h16
-rw-r--r--tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.pro14
-rw-r--r--tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.cpp62
-rw-r--r--tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.h48
-rw-r--r--tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.pro9
-rw-r--r--tqtinterface/qt4/tools/designer/examples/filechooser/widget/main.cpp10
-rw-r--r--tqtinterface/qt4/tools/designer/examples/metric/main.cpp12
-rw-r--r--tqtinterface/qt4/tools/designer/examples/metric/metric.pro12
-rw-r--r--tqtinterface/qt4/tools/designer/examples/metric/metric.ui366
-rw-r--r--tqtinterface/qt4/tools/designer/examples/metric/metric.ui.h72
-rw-r--r--tqtinterface/qt4/tools/designer/examples/multiclip/main.cpp25
-rw-r--r--tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.pro9
-rw-r--r--tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui206
-rw-r--r--tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui.h70
-rw-r--r--tqtinterface/qt4/tools/designer/examples/opengl/glwidget.cpp170
-rw-r--r--tqtinterface/qt4/tools/designer/examples/opengl/glwidget.h75
-rw-r--r--tqtinterface/qt4/tools/designer/examples/opengl/main.cpp305
-rw-r--r--tqtinterface/qt4/tools/designer/examples/opengl/opengl.pro11
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver1/main.cpp24
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui87
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui.h25
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver1/receiver.pro11
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver2/main.cpp25
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui82
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui.h20
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver2/receiver.cpp29
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver2/receiver.h13
-rw-r--r--tqtinterface/qt4/tools/designer/examples/receiver2/receiver.pro12
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/editcopy.pngbin0 -> 187 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/editcut.pngbin0 -> 163 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/editpaste.pngbin0 -> 209 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/filenew.pngbin0 -> 127 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/fileopen.pngbin0 -> 178 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/filesave.pngbin0 -> 158 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/redo.pngbin0 -> 149 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/textbold.pngbin0 -> 119 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/textcenter.pngbin0 -> 92 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/textitalic.pngbin0 -> 102 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/textleft.pngbin0 -> 90 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/textright.pngbin0 -> 93 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/textunder.pngbin0 -> 115 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/images/undo.pngbin0 -> 150 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/main.cpp25
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/richedit.pro10
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui612
-rw-r--r--tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui.h120
-rw-r--r--tqtinterface/qt4/tools/designer/examples/sizeaware/main.cpp11
-rw-r--r--tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.cpp38
-rw-r--r--tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.h23
-rw-r--r--tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.pro6
-rw-r--r--tqtinterface/qt4/tools/designer/examples/vcr/main.cpp10
-rw-r--r--tqtinterface/qt4/tools/designer/examples/vcr/play.xpm23
-rw-r--r--tqtinterface/qt4/tools/designer/examples/vcr/vcr.cpp117
-rw-r--r--tqtinterface/qt4/tools/designer/examples/vcr/vcr.h17
-rw-r--r--tqtinterface/qt4/tools/designer/examples/vcr/vcr.pro8
-rw-r--r--tqtinterface/qt4/tools/designer/integration/designer.el19
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/actioninterface.h85
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/classbrowserinterface.h70
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/designerinterface.h268
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/editorinterface.h109
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/filterinterface.h75
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/interpreterinterface.h66
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/languageinterface.h138
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/preferenceinterface.h75
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/projectsettingsiface.h76
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/sourcetemplateiface.h72
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/templatewizardiface.h67
-rw-r--r--tqtinterface/qt4/tools/designer/interfaces/widgetinterface.h42
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/common.cpp111
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp78
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.h50
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp220
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.h60
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.cpp168
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.h78
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.pro21
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp338
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h107
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp249
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.h90
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui211
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui.h36
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.cpp102
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.h64
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui347
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h106
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.cpp106
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.h62
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp117
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.h54
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp550
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.h73
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp800
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.h88
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/dlg/dlg.pro13
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.cpp1632
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.h144
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/dlg/main.cpp108
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/glade/glade.pro13
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.cpp2203
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.h169
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/glade/main.cpp109
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg.pro11
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.cpp524
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.h90
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/kdevdlg/main.cpp120
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/plugins.pro9
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/rc/main.cpp117
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/rc/rc.pro11
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.cpp888
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.h103
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_1.pngbin0 -> 10172 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_2.pngbin0 -> 12582 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_3.pngbin0 -> 11653 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_1.pngbin0 -> 13382 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_2.pngbin0 -> 15245 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_3.pngbin0 -> 16105 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_4.pngbin0 -> 7894 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/re-sort.pngbin0 -> 254 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcopy.pngbin0 -> 172 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcut.pngbin0 -> 157 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editpaste.pngbin0 -> 199 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filenew.pngbin0 -> 119 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/fileopen.pngbin0 -> 165 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filesave.pngbin0 -> 150 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/print.pngbin0 -> 586 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/redo.pngbin0 -> 137 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/searchfind.pngbin0 -> 534 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/images/small/undo.pngbin0 -> 137 bytes
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/main.cpp142
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui757
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui.h321
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizard.ui1776
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.cpp624
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.h87
-rw-r--r--tqtinterface/qt4/tools/designer/plugins/wizards/wizards.pro21
-rw-r--r--tqtinterface/qt4/tools/designer/shared/domtool.cpp460
-rw-r--r--tqtinterface/qt4/tools/designer/shared/domtool.h60
-rw-r--r--tqtinterface/qt4/tools/designer/shared/globaldefs.h69
-rw-r--r--tqtinterface/qt4/tools/designer/shared/parser.cpp79
-rw-r--r--tqtinterface/qt4/tools/designer/shared/parser.h46
-rw-r--r--tqtinterface/qt4/tools/designer/shared/ui2uib.cpp900
-rw-r--r--tqtinterface/qt4/tools/designer/shared/ui2uib.h42
-rw-r--r--tqtinterface/qt4/tools/designer/shared/uib.cpp49
-rw-r--r--tqtinterface/qt4/tools/designer/shared/uib.h159
-rw-r--r--tqtinterface/qt4/tools/designer/shared/widgetdatabase.cpp960
-rw-r--r--tqtinterface/qt4/tools/designer/shared/widgetdatabase.h103
-rw-r--r--tqtinterface/qt4/tools/designer/templates/Configuration_Dialog.ui162
-rw-r--r--tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Bottom).ui122
-rw-r--r--tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Right).ui122
-rw-r--r--tqtinterface/qt4/tools/designer/templates/Tab_Dialog.ui146
-rw-r--r--tqtinterface/qt4/tools/designer/tools/conv2ui/conv2ui.pro10
-rw-r--r--tqtinterface/qt4/tools/designer/tools/conv2ui/main.cpp220
-rw-r--r--tqtinterface/qt4/tools/designer/tools/createcw/README18
-rw-r--r--tqtinterface/qt4/tools/designer/tools/createcw/createcw.pro5
-rw-r--r--tqtinterface/qt4/tools/designer/tools/createcw/main.cpp190
-rw-r--r--tqtinterface/qt4/tools/designer/uic/embed.cpp316
-rw-r--r--tqtinterface/qt4/tools/designer/uic/form.cpp1462
-rw-r--r--tqtinterface/qt4/tools/designer/uic/main.cpp358
-rw-r--r--tqtinterface/qt4/tools/designer/uic/object.cpp759
-rw-r--r--tqtinterface/qt4/tools/designer/uic/subclassing.cpp353
-rw-r--r--tqtinterface/qt4/tools/designer/uic/uic.cpp1129
-rw-r--r--tqtinterface/qt4/tools/designer/uic/uic.h176
-rw-r--r--tqtinterface/qt4/tools/designer/uic/uic.pro42
-rw-r--r--tqtinterface/qt4/tools/designer/uilib/test/main.cpp50
-rw-r--r--tqtinterface/qt4/tools/designer/uilib/test/test.pro7
-rw-r--r--tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.cpp2623
-rw-r--r--tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.h188
-rw-r--r--tqtinterface/qt4/tools/designer/uilib/uilib.pro30
-rw-r--r--tqtinterface/qt4/tools/linguist/LICENSE.GPL280
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/doneandnext.pngbin0 -> 445 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/editcopy.pngbin0 -> 587 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/editcut.pngbin0 -> 480 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/editfind.pngbin0 -> 776 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/editpaste.pngbin0 -> 664 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/editredo.pngbin0 -> 362 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/editundo.pngbin0 -> 353 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/fileopen.pngbin0 -> 523 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/fileprint.pngbin0 -> 767 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/filesave.pngbin0 -> 510 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/finddialog.pngbin0 -> 3165 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/linguist.pngbin0 -> 22819 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/menubar.pngbin0 -> 511 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/next.pngbin0 -> 418 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/nextunfinished.pngbin0 -> 456 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/phrasebookdialog.pngbin0 -> 4857 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/phrasebookopen.pngbin0 -> 883 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/prev.pngbin0 -> 412 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/prevunfinished.pngbin0 -> 449 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/toolbar.pngbin0 -> 5397 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt1_en.pngbin0 -> 872 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt1_la.pngbin0 -> 894 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt2_en.pngbin0 -> 1615 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt2_fr.pngbin0 -> 1854 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt2_nl.pngbin0 -> 1881 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt3_10_en.pngbin0 -> 2286 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_bad.pngbin0 -> 2411 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_good.pngbin0 -> 2485 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt3_11_about_pt.pngbin0 -> 2720 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt3_11_en.pngbin0 -> 2368 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/tt3_11_pt.pngbin0 -> 2537 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/validateaccelerators.pngbin0 -> 387 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/validatephrases.pngbin0 -> 293 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/images/validatepunctuation.pngbin0 -> 373 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/book/linguist-manager.leaf138
-rw-r--r--tqtinterface/qt4/tools/linguist/book/linguist-manual.book90
-rw-r--r--tqtinterface/qt4/tools/linguist/book/linguist-programmer.leaf1145
-rw-r--r--tqtinterface/qt4/tools/linguist/book/linguist-translator.leaf582
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist.pro11
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/about.ui223
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/finddialog.cpp183
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/finddialog.h69
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/accelerator.pngbin0 -> 782 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/appicon.pngbin0 -> 1936 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/book.pngbin0 -> 825 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_accelerator.pngbin0 -> 487 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_book.pngbin0 -> 557 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_doneandnext.pngbin0 -> 457 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_editcopy.pngbin0 -> 526 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_editcut.pngbin0 -> 800 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_editpaste.pngbin0 -> 610 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_fileopen.pngbin0 -> 406 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_filesave.pngbin0 -> 267 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_next.pngbin0 -> 446 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_nextunfinished.pngbin0 -> 522 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_phrase.pngbin0 -> 290 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_prev.pngbin0 -> 425 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_prevunfinished.pngbin0 -> 542 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_print.pngbin0 -> 595 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_punctuation.pngbin0 -> 356 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_redo.pngbin0 -> 465 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_danger.pngbin0 -> 270 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_obs.pngbin0 -> 220 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_off.pngbin0 -> 348 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_on.pngbin0 -> 220 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_searchfind.pngbin0 -> 501 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/d_undo.pngbin0 -> 471 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/doneandnext.pngbin0 -> 532 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/editcopy.pngbin0 -> 491 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/editcut.pngbin0 -> 649 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/editpaste.pngbin0 -> 864 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/fileopen.pngbin0 -> 681 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/filesave.pngbin0 -> 328 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/next.pngbin0 -> 541 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/nextunfinished.pngbin0 -> 649 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/pagecurl.pngbin0 -> 1247 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/phrase.pngbin0 -> 366 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/prev.pngbin0 -> 542 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/prevunfinished.pngbin0 -> 725 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/print.pngbin0 -> 766 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/punctuation.pngbin0 -> 502 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/redo.pngbin0 -> 592 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/s_check_danger.pngbin0 -> 326 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/s_check_obs.pngbin0 -> 245 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/s_check_off.pngbin0 -> 439 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/s_check_on.pngbin0 -> 235 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/searchfind.pngbin0 -> 843 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/splash.pngbin0 -> 31939 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/undo.pngbin0 -> 572 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/images/whatsthis.xpm24
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/linguist.icnsbin0 -> 47620 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/linguist.icobin0 -> 10134 bytes
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/linguist.pro109
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/linguist.rc1
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/linguist_de.ts993
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/linguist_fr.ts993
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/listviews.cpp350
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/listviews.h135
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/main.cpp89
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/msgedit.cpp835
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/msgedit.h247
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/phrase.cpp189
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/phrase.h74
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.cpp244
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.h85
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/phraselv.cpp171
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/phraselv.h83
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/printout.cpp182
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/printout.h126
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/simtexth.cpp239
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/simtexth.h64
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/statistics.ui259
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/statistics.ui.h53
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/trwindow.cpp2072
-rw-r--r--tqtinterface/qt4/tools/linguist/linguist/trwindow.h238
-rw-r--r--tqtinterface/qt4/tools/linguist/lrelease/lrelease.pro17
-rw-r--r--tqtinterface/qt4/tools/linguist/lrelease/main.cpp203
-rw-r--r--tqtinterface/qt4/tools/linguist/lupdate/fetchtr.cpp824
-rw-r--r--tqtinterface/qt4/tools/linguist/lupdate/lupdate.pro21
-rw-r--r--tqtinterface/qt4/tools/linguist/lupdate/main.cpp241
-rw-r--r--tqtinterface/qt4/tools/linguist/lupdate/merge.cpp129
-rw-r--r--tqtinterface/qt4/tools/linguist/lupdate/numberh.cpp248
-rw-r--r--tqtinterface/qt4/tools/linguist/lupdate/sametexth.cpp97
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/danish.qph1018
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/dutch.qph1044
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/finnish.qph1033
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/french.qph1104
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/german.qph1075
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/italian.qph1105
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/norwegian.qph1004
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/russian.qph982
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/spanish.qph1086
-rw-r--r--tqtinterface/qt4/tools/linguist/phrasebooks/swedish.qph1010
-rw-r--r--tqtinterface/qt4/tools/linguist/qdoc.conf15
-rw-r--r--tqtinterface/qt4/tools/linguist/qm2ts/main.cpp128
-rw-r--r--tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.155
-rw-r--r--tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.pro15
-rw-r--r--tqtinterface/qt4/tools/linguist/shared/metatranslator.cpp601
-rw-r--r--tqtinterface/qt4/tools/linguist/shared/metatranslator.h120
-rw-r--r--tqtinterface/qt4/tools/linguist/shared/proparser.cpp217
-rw-r--r--tqtinterface/qt4/tools/linguist/shared/proparser.h42
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt1/main.cpp25
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt1/tt1.pro4
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.cpp31
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.h22
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt2/main.cpp26
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.cpp26
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.h19
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt2/tt2.pro9
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt3/main.cpp26
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.cpp47
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.h24
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.cpp37
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.h19
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3.pro8
-rw-r--r--tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3_pt.ts65
-rw-r--r--tqtinterface/qt4/tools/makeqpf/main.cpp322
-rwxr-xr-xtqtinterface/qt4/tools/makeqpf/makeall4
-rw-r--r--tqtinterface/qt4/tools/makeqpf/makeqpf.pro7
-rw-r--r--tqtinterface/qt4/tools/mergetr/mergetr.cpp347
-rw-r--r--tqtinterface/qt4/tools/mergetr/mergetr.pro6
-rw-r--r--tqtinterface/qt4/tools/msg2qm/msg2qm.cpp236
-rw-r--r--tqtinterface/qt4/tools/msg2qm/msg2qm.pro7
-rw-r--r--tqtinterface/qt4/tools/qconfig/LICENSE.GPL280
-rw-r--r--tqtinterface/qt4/tools/qconfig/main.cpp734
-rw-r--r--tqtinterface/qt4/tools/qconfig/main.h86
-rw-r--r--tqtinterface/qt4/tools/qconfig/qconfig.pro7
-rw-r--r--tqtinterface/qt4/tools/qembed/qembed.cpp338
-rw-r--r--tqtinterface/qt4/tools/qembed/qembed.pro4
-rw-r--r--tqtinterface/qt4/tools/qtconfig/LICENSE.GPL280
-rw-r--r--tqtinterface/qt4/tools/qtconfig/colorbutton.cpp177
-rw-r--r--tqtinterface/qt4/tools/qtconfig/colorbutton.h83
-rw-r--r--tqtinterface/qt4/tools/qtconfig/images/appicon.pngbin0 -> 714 bytes
-rw-r--r--tqtinterface/qt4/tools/qtconfig/main.cpp45
-rw-r--r--tqtinterface/qt4/tools/qtconfig/mainwindow.cpp1074
-rw-r--r--tqtinterface/qt4/tools/qtconfig/mainwindow.h104
-rw-r--r--tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui1827
-rw-r--r--tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.cpp615
-rw-r--r--tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.h99
-rw-r--r--tqtinterface/qt4/tools/qtconfig/paletteeditoradvancedbase.ui682
-rw-r--r--tqtinterface/qt4/tools/qtconfig/previewframe.cpp63
-rw-r--r--tqtinterface/qt4/tools/qtconfig/previewframe.h69
-rw-r--r--tqtinterface/qt4/tools/qtconfig/previewwidget.cpp75
-rw-r--r--tqtinterface/qt4/tools/qtconfig/previewwidget.h51
-rw-r--r--tqtinterface/qt4/tools/qtconfig/previewwidgetbase.ui311
-rw-r--r--tqtinterface/qt4/tools/qtconfig/qtconfig.pro18
-rw-r--r--tqtinterface/qt4/tools/qvfb/LICENSE.GPL280
-rw-r--r--tqtinterface/qt4/tools/qvfb/README55
-rw-r--r--tqtinterface/qt4/tools/qvfb/config.ui1684
-rw-r--r--tqtinterface/qt4/tools/qvfb/gammaview.h49
-rw-r--r--tqtinterface/qt4/tools/qvfb/images/logo.pngbin0 -> 714 bytes
-rw-r--r--tqtinterface/qt4/tools/qvfb/main.cpp97
-rw-r--r--tqtinterface/qt4/tools/qvfb/pda.skin15
-rw-r--r--tqtinterface/qt4/tools/qvfb/pda_down.pngbin0 -> 94345 bytes
-rw-r--r--tqtinterface/qt4/tools/qvfb/pda_up.pngbin0 -> 92698 bytes
-rw-r--r--tqtinterface/qt4/tools/qvfb/qanimationwriter.cpp414
-rw-r--r--tqtinterface/qt4/tools/qvfb/qanimationwriter.h59
-rw-r--r--tqtinterface/qt4/tools/qvfb/qvfb.cpp389
-rw-r--r--tqtinterface/qt4/tools/qvfb/qvfb.h91
-rw-r--r--tqtinterface/qt4/tools/qvfb/qvfb.pro11
-rw-r--r--tqtinterface/qt4/tools/qvfb/qvfbratedlg.cpp80
-rw-r--r--tqtinterface/qt4/tools/qvfb/qvfbratedlg.h59
-rw-r--r--tqtinterface/qt4/tools/qvfb/qvfbview.cpp615
-rw-r--r--tqtinterface/qt4/tools/qvfb/qvfbview.h126
-rw-r--r--tqtinterface/qt4/tools/qvfb/skin.cpp174
-rw-r--r--tqtinterface/qt4/tools/qvfb/skin.h78
-rw-r--r--tqtinterface/qt4/tools/tools.pro19
941 files changed, 168348 insertions, 0 deletions
diff --git a/tqtinterface/qt4/tools/assistant/LICENSE.GPL b/tqtinterface/qt4/tools/assistant/LICENSE.GPL
new file mode 100644
index 0000000..149f4ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/LICENSE.GPL
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which tqcontains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part tqcontains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it tqcontains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/tqtinterface/qt4/tools/assistant/assistant.icns b/tqtinterface/qt4/tools/assistant/assistant.icns
new file mode 100644
index 0000000..a6dbcdd
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/assistant.icns
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/assistant.ico b/tqtinterface/qt4/tools/assistant/assistant.ico
new file mode 100644
index 0000000..eb43249
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/assistant.ico
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/assistant.pro b/tqtinterface/qt4/tools/assistant/assistant.pro
new file mode 100644
index 0000000..1d8ba5c
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/assistant.pro
@@ -0,0 +1,72 @@
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = assistant
+
+CONFIG += qt warn_off
+
+PROJECTNAME = Assistant
+DESTDIR = ../../bin
+
+SOURCES += main.cpp \
+ helpwindow.cpp \
+ topicchooserimpl.cpp \
+ docuparser.cpp \
+ helpdialogimpl.cpp \
+ settingsdialogimpl.cpp \
+ index.cpp \
+ profile.cpp \
+ config.cpp
+
+HEADERS += helpwindow.h \
+ topicchooserimpl.h \
+ docuparser.h \
+ helpdialogimpl.h \
+ settingsdialogimpl.h \
+ index.h \
+ profile.h \
+ config.h
+
+#DEFINES += QT_PALMTOPCENTER_DOCS
+DEFINES += QT_INTERNAL_NETWORK QT_INTERNAL_XML
+include( ../../src/qt_professional.pri )
+
+win32:RC_FILE = assistant.rc
+mac:RC_FILE = assistant.icns
+
+target.path = $$bins.path
+INSTALLS += target
+
+assistanttranslations.files = *.qm
+assistanttranslations.path = $$translations.path
+INSTALLS += assistanttranslations
+
+TRANSLATIONS = assistant_de.ts \
+ assistant_fr.ts
+
+unix:!zlib:LIBS += -lz
+
+FORMS = mainwindow.ui \
+ topicchooser.ui \
+ finddialog.ui \
+ helpdialog.ui \
+ settingsdialog.ui \
+ tabbedbrowser.ui
+IMAGES = images/editcopy.png \
+ images/find.png \
+ images/home.png \
+ images/next.png \
+ images/previous.png \
+ images/print.png \
+ images/whatsthis.xpm \
+ images/book.png \
+ images/designer.png \
+ images/assistant.png \
+ images/linguist.png \
+ images/qt.png \
+ images/zoomin.png \
+ images/zoomout.png \
+ images/splash.png \
+ images/appicon.png \
+ images/addtab.png \
+ images/closetab.png \
+ images/d_closetab.png
diff --git a/tqtinterface/qt4/tools/assistant/assistant.rc b/tqtinterface/qt4/tools/assistant/assistant.rc
new file mode 100644
index 0000000..b4786ce
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/assistant.rc
@@ -0,0 +1 @@
+IDI_ICON1 ICON DISCARDABLE "assistant.ico"
diff --git a/tqtinterface/qt4/tools/assistant/assistant_de.qm b/tqtinterface/qt4/tools/assistant/assistant_de.qm
new file mode 100644
index 0000000..c50e90f
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/assistant_de.qm
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/assistant_de.ts b/tqtinterface/qt4/tools/assistant/assistant_de.ts
new file mode 100644
index 0000000..ed4c994
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/assistant_de.ts
@@ -0,0 +1,1084 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>Assistant</name>
+ <message>
+ <source>Welcome to the &lt;b&gt;Qt Assistant&lt;/b&gt;. Qt Assistant will give you quicker access to help and tips while using applications like Qt Designer.</source>
+ <translation type="obsolete">Wilkommen bei &lt;b&gt;Qt Assistant&lt;/b&gt;. Qt Assistant ermöglicht einen schnellen Zugriff der Onlinehilfe während dem Arbeiten mit Programmen wie dem Qt Designer.</translation>
+ </message>
+ <message>
+ <source>Qt Assistant</source>
+ <translation type="obsolete">Qt Assistant</translation>
+ </message>
+</context>
+<context>
+ <name>AssistantServer</name>
+ <message>
+ <source>Qt Assistant</source>
+ <translation>Qt Assistant</translation>
+ </message>
+ <message>
+ <source>Failed to bind to port %1</source>
+ <translation>Kann Port %1 nicht binden</translation>
+ </message>
+</context>
+<context>
+ <name>FindDialog</name>
+ <message>
+ <source>Find Text</source>
+ <translation type="obsolete">Textsuche</translation>
+ </message>
+ <message>
+ <source>&amp;Find:</source>
+ <translation type="obsolete">&amp;Suchen:</translation>
+ </message>
+ <message>
+ <source>&amp;Find</source>
+ <translation>&amp;Suchen</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="obsolete">Schließen</translation>
+ </message>
+ <message>
+ <source>&amp;Direction</source>
+ <translation>Rich&amp;tung</translation>
+ </message>
+ <message>
+ <source>Forwar&amp;d</source>
+ <translation type="obsolete">&amp;Vorwärts</translation>
+ </message>
+ <message>
+ <source>&amp;Backward</source>
+ <translation>&amp;Rückwärts</translation>
+ </message>
+ <message>
+ <source>&amp;Options</source>
+ <translation>&amp;Optionen</translation>
+ </message>
+ <message>
+ <source>&amp;Whole words only</source>
+ <translation>&amp;Ganze Wörter</translation>
+ </message>
+ <message>
+ <source>&amp;Case sensitive</source>
+ <translation>Groß- und &amp;Kleinschreibung beachten</translation>
+ </message>
+ <message>
+ <source>Qt Assistant - Find Text</source>
+ <translation>Qt Assistant - Textsuche</translation>
+ </message>
+ <message>
+ <source>Enter the text you are looking for.</source>
+ <translation>Geben Sie den Suchtext ein.</translation>
+ </message>
+ <message>
+ <source>Search reached end of the document</source>
+ <translation>Die Suche hat das Ende des Dokuments erreicht</translation>
+ </message>
+ <message>
+ <source>Search reached start of the document</source>
+ <translation>Die Suche hat den Anfang des Dokuments erreicht</translation>
+ </message>
+ <message>
+ <source>Text not found</source>
+ <translation>Text nicht gefunden</translation>
+ </message>
+ <message>
+ <source>Fo&amp;rward</source>
+ <translation>Vo&amp;rwärts</translation>
+ </message>
+ <message>
+ <source>F&amp;ind:</source>
+ <translation>Su&amp;chen:</translation>
+ </message>
+ <message>
+ <source>C&amp;lose</source>
+ <translation>Sch&amp;ließen</translation>
+ </message>
+ <message>
+ <source>Alt+L</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Alt+F</source>
+ <translation></translation>
+ </message>
+</context>
+<context>
+ <name>HelpDialog</name>
+ <message>
+ <source>Index</source>
+ <translation>Index</translation>
+ </message>
+ <message>
+ <source>Bookmarks</source>
+ <translation>Lesezeichen</translation>
+ </message>
+ <message>
+ <source>Con&amp;tents</source>
+ <translation type="obsolete">Inhal&amp;t</translation>
+ </message>
+ <message>
+ <source>Qt Reference Documentation</source>
+ <translation type="obsolete">Qt Referenzdokumentation</translation>
+ </message>
+ <message>
+ <source>Qt Designer Manual</source>
+ <translation type="obsolete">Qt Designer Handbuch</translation>
+ </message>
+ <message>
+ <source>Qt Linguist Manual</source>
+ <translation type="obsolete">Qt Linguist Handbuch</translation>
+ </message>
+ <message>
+ <source>Qt Assistant Manual</source>
+ <translation type="obsolete">Qt Assistant Handbuch</translation>
+ </message>
+ <message>
+ <source>Qt Assistant</source>
+ <translation>Qt Assistant</translation>
+ </message>
+ <message>
+ <source>Open Link in Current Window</source>
+ <translation type="obsolete">Öffne Link im aktuellen Fenster</translation>
+ </message>
+ <message>
+ <source>Open Link in New Window</source>
+ <translation>Öffne Link in neuem Fenster</translation>
+ </message>
+ <message>
+ <source>Contents</source>
+ <translation>Inhalt</translation>
+ </message>
+ <message>
+ <source>Search</source>
+ <translation>Suche</translation>
+ </message>
+ <message>
+ <source>Prepare...</source>
+ <translation>Initialisiere...</translation>
+ </message>
+ <message>
+ <source>Cannot open the index file %1</source>
+ <translation>Kann Indexdatei %1 nicht öffnen</translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation>Warnung</translation>
+ </message>
+ <message>
+ <source>Documentation file %1 does not exist!
+Skipping file.</source>
+ <translation>Dokumentation %1 existiert nicht!
+Überspringe Datei.</translation>
+ </message>
+ <message>
+ <source>Parse Error</source>
+ <translation>Syntaxfehler</translation>
+ </message>
+ <message>
+ <source>Done</source>
+ <translation>Fertig</translation>
+ </message>
+ <message>
+ <source>Indexing files...</source>
+ <translation>Indiziere Dokumentation...</translation>
+ </message>
+ <message>
+ <source>Reading dictionary...</source>
+ <translation>Lese Suchindex...</translation>
+ </message>
+ <message>
+ <source>Full Text Search</source>
+ <translation>Volltextsuche</translation>
+ </message>
+ <message>
+ <source>Using a wildcard within phrases is not allowed.</source>
+ <translation>Wildcards innerhalb von Phrasen sind nicht zugelassen.</translation>
+ </message>
+ <message>
+ <source>The closing quotation mark is missing.</source>
+ <translation>Das schließende Anführungszeichen fehlt.</translation>
+ </message>
+ <message>
+ <source>Open Link in Current Tab</source>
+ <translation>Link im Aktuellen Tab öffnen</translation>
+ </message>
+ <message>
+ <source>Open Link in New Tab</source>
+ <translation>Link in einem neuen Tab öffnen</translation>
+ </message>
+ <message>
+ <source>Failed to load keyword index file
+Assistant will not work!</source>
+ <translation>Die Indexdatei konnte nicht geladen werden.
+Der Assistent ist nicht einsatzbereit!</translation>
+ </message>
+ <message>
+ <source>Documentation file %1 is not compatible!
+Skipping file.</source>
+ <translation>Dokumentation %1 ist nicht kompatibel! Datei wird übersprungen.</translation>
+ </message>
+ <message>
+ <source>Failed to save fulltext search index
+Assistant will not work!</source>
+ <translation>Der Index für die Volltextsuche konnte nicht gespeichert werden.
+Der Assistent ist nicht einsatzbereit!</translation>
+ </message>
+</context>
+<context>
+ <name>HelpDialogBase</name>
+ <message>
+ <source>Help</source>
+ <translation>Hilfe</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Help&lt;/b&gt;&lt;p&gt;Choose the topic you need help for from the contents list, or search the index for keywords.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;b&gt;Hilfe&lt;/b&gt;&lt;p&gt;Wählen Sie ein Thema vom Inhaltsverzeichnis oder suchen Sie im Index nach Schlüsselwörtern.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>Displays help topics organized by category, index or bookmarks</source>
+ <translation type="obsolete">Zeigt die Hilfethemen unterteilt in Kategorien, Indizes oder Lesezeichen an</translation>
+ </message>
+ <message>
+ <source>Con&amp;tents</source>
+ <translation>Inhal&amp;t</translation>
+ </message>
+ <message>
+ <source>Column 1</source>
+ <translation>Spalte 1</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Help topics organized by category.&lt;/b&gt;&lt;p&gt;Double-click an item to see which topics are in that category. To view a topic, select it, and then click &lt;b&gt;Display&lt;/b&gt;.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;b&gt;Die Hilfethemen sind nach Kategorien organisiert.&lt;/b&gt;&lt;p&gt;Ein Doppelklick auf einen Eintrag zeigt die Themen dieser Kategorie an. Um ein Thema anzuzeigen, wählen Sie es aus und drücken Sie &lt;b&gt;Anzeigen&lt;/b&gt;.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&amp;Index</source>
+ <translation>&amp;Index</translation>
+ </message>
+ <message>
+ <source>&amp;Look For:</source>
+ <translation>Suchen &amp;nach:</translation>
+ </message>
+ <message>
+ <source>Enter keyword</source>
+ <translation>Geben Sie ein Schlüsselwort ein</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Enter a keyword.&lt;/b&gt;&lt;p&gt;The list will select an item that matches the entered string best.&lt;/p&gt;</source>
+ <translation>&lt;b&gt;Geben Sie ein Schlüsselwort ein.&lt;/b&gt;&lt;p&gt;Es wird dann der Eintrag aus der Liste ausgewählt, der am besten mit dem eingegebenen Begriff übereinstimmt.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;List of available help topics.&lt;/b&gt;&lt;p&gt;Double-click on an item to open up the help page for this topic. You will have to choose the right page if more than one are found.&lt;/p&gt;</source>
+ <translation type="obsolete">&lt;b&gt;Liste aller verfügbaren Hilfethemen.&lt;/b&gt;&lt;p&gt;Ein Doppelklick auf einen Eintrag öffnet die dazugehörige Hilfeseite. Wenn es mehrere Seiten zu einem Eintrag gibt, wählen Sie die gewünschte aus.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&amp;Bookmarks</source>
+ <translation>L&amp;esezeichen</translation>
+ </message>
+ <message>
+ <source>Displays the list of bookmarks.</source>
+ <translation>Zeigt alle Lesezeichen an.</translation>
+ </message>
+ <message>
+ <source>&amp;New Bookmark</source>
+ <translation type="obsolete">&amp;Neues Lesezeichen</translation>
+ </message>
+ <message>
+ <source>Add new bookmark</source>
+ <translation>Füge neues Lesezeichen hinzu</translation>
+ </message>
+ <message>
+ <source>Add the current displayed page as new bookmark to the list.</source>
+ <translation type="obsolete">Füge die aktuelle Seite als Lesezeichen hinzu.</translation>
+ </message>
+ <message>
+ <source>D&amp;elete Bookmark</source>
+ <translation type="obsolete">&amp;Lösche Lesezeichen</translation>
+ </message>
+ <message>
+ <source>Delete bookmark</source>
+ <translation>Lösche Lesezeichen</translation>
+ </message>
+ <message>
+ <source>Delete the selected bookmark from the list.</source>
+ <translation type="obsolete">Lösche markiertes Lesezeichen.</translation>
+ </message>
+ <message>
+ <source>Preparing...</source>
+ <translation>Initialisiere...</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Help&lt;/b&gt;&lt;p&gt;Choose the topic you want help on from the contents list, or search the index for keywords.&lt;/p&gt;</source>
+ <translation>&lt;b&gt;Hilfe&lt;/b&gt;&lt;p&gt;Wählen Sie ein Hilfethema aus dem Inhalt oder suchen Sie im Index nach Schlüsselwörtern.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</source>
+ <translation>Zeigt Hilfethemen geordnet nach Kategorie, Index oder Lesezeichen an. Ein weiterer Abschnitt enthält die Volltextsuche.</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Help topics organized by category.&lt;/b&gt;&lt;p&gt;Double-click an item to see the topics in that category. To view a topic, just double-click it.&lt;/p&gt;</source>
+ <translation>&lt;b&gt;Hilfethemen geordnet nach Kategorie.&lt;/b&gt;&lt;p&gt;Doppelklicken Sie einen Eintrag, um die Themen dieser Kategorie zu sehen. Doppelklicken Sie ein Thema, um es angezeigt zu bekommen.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;List of available help topics.&lt;/b&gt;&lt;p&gt;Double-click on an item to open its help page. If more than one is found, you must specify which page you want.&lt;/p&gt;</source>
+ <translation>&lt;b&gt;Liste aller verfügbaren Hilfethemen.&lt;/b&gt;&lt;p&gt;Doppelklicken Sie auf einen Eintrag, um die Hilfe zu öffnen. Wenn mehr als eine Seite gefunden wurde, wählen Sie die gewünschte Seite aus.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&amp;New</source>
+ <translation>&amp;Neu</translation>
+ </message>
+ <message>
+ <source>Add the currently displayed page as a new bookmark.</source>
+ <translation>Füge aktuelle Seite zu den Lesezeichen hinzu.</translation>
+ </message>
+ <message>
+ <source>&amp;Delete</source>
+ <translation>&amp;Löschen</translation>
+ </message>
+ <message>
+ <source>Delete the selected bookmark.</source>
+ <translation>Lösche markiertes Lesezeichen.</translation>
+ </message>
+ <message>
+ <source>&amp;Search</source>
+ <translation>&amp;Suche</translation>
+ </message>
+ <message>
+ <source>Searching f&amp;or:</source>
+ <translation>Suche &amp;nach:</translation>
+ </message>
+ <message>
+ <source>Enter searchword(s).</source>
+ <translation>Suchebegriff(e).</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Enter search word(s).&lt;/b&gt;&lt;p&gt;Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.&lt;/p&gt;</source>
+ <translation>&lt;b&gt;Geben Sie Suchbegriffe ein.&lt;/b&gt;&lt;p&gt;Geben Sie hier die gesuchten Begriffe ein. Die Begriffe können Wildcards (*) enthalten. Eine Phrase muß in Anführungszeichen stehen.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Found documents&lt;/b&gt;&lt;p&gt;This list tqcontains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.&lt;/p&gt;</source>
+ <translation>&lt;b&gt;Gefundene Dokumente&lt;/b&gt;&lt;p&gt;Diese Liste beinhaltet alle gefundenen Dokumente der letzten Suche. Die Dokumente sind nach der Häufigkeit der Treffer geordnet.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>Found &amp;Documents:</source>
+ <translation>Gefundene &amp;Dokumente:</translation>
+ </message>
+ <message>
+ <source>He&amp;lp</source>
+ <translation>Hi&amp;lfe</translation>
+ </message>
+ <message>
+ <source>Display the help page.</source>
+ <translation>Zeigt die Hilfe an.</translation>
+ </message>
+ <message>
+ <source>Display the help page for the full text search.</source>
+ <translation>Zeigt die Hilfeseite für die Volltextsuche an.</translation>
+ </message>
+ <message>
+ <source>Start searching.</source>
+ <translation>Starte Suche.</translation>
+ </message>
+ <message>
+ <source>Pressing this button starts the search.</source>
+ <translation>Startet die Suche.</translation>
+ </message>
+</context>
+<context>
+ <name>HelpWindow</name>
+ <message>
+ <source>Qt Assistant by Trolltech - %1</source>
+ <translation type="obsolete">Qt Assistant von Trolltech - %1</translation>
+ </message>
+ <message>
+ <source>Help</source>
+ <translation>Hilfe</translation>
+ </message>
+ <message>
+ <source>Can&apos;t load and display non-local file
+%1</source>
+ <translation>Kann gewünschte Datei nicht laden:
+%1</translation>
+ </message>
+ <message>
+ <source>Open Link in New Window<byte value="x9"/>Shift+LMB</source>
+ <translation>Öffne Link in neuem Fenster</translation>
+ </message>
+ <message>
+ <source>Currently no Web browser is selected.
+Please use the settings dialog to specify one!
+</source>
+ <translation>Es ist kein Webbrowser ausgewählt.
+Öffnen Sie bitten den &quot;Einstellungen&quot; Dialog um einen Webbrowser auszuwählen.
+</translation>
+ </message>
+ <message>
+ <source>Qt Assistant by Trolltech - %1%2</source>
+ <translation type="obsolete">Qt Assistant von Trolltech - %1%2</translation>
+ </message>
+ <message>
+ <source>No PDF Viewer has been specified
+Please use the settings dialog to specify one!
+</source>
+ <translation>Es wurde kein PDF Betrachter angegeben.
+Bitte diesen im Menue Einstellungen festlegen!
+</translation>
+ </message>
+ <message>
+ <source>Qt Assistant is unable to start the PDF Viewer
+
+%1
+
+Please make sure that the executable exists and is located at
+the specified location.</source>
+ <translation>Der Qt Assistent konnte den PDF betrachter
+%1 nicht laden.
+Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translation>
+ </message>
+ <message>
+ <source>Open Link in New Tab</source>
+ <translation>Link in einenm neuen Tab öffnen</translation>
+ </message>
+</context>
+<context>
+ <name>Index</name>
+ <message>
+ <source>Untitled</source>
+ <translation>Unbenannt</translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Qt Assistant by Trolltech</source>
+ <translation>Qt Assistant von Trolltech</translation>
+ </message>
+ <message>
+ <source>Toolbar</source>
+ <translation>Werkzeugleiste</translation>
+ </message>
+ <message>
+ <source>Print</source>
+ <translation>Drucken</translation>
+ </message>
+ <message>
+ <source>&amp;Print...</source>
+ <translation>&amp;Drucken...</translation>
+ </message>
+ <message>
+ <source>Exit</source>
+ <translation>Beenden</translation>
+ </message>
+ <message>
+ <source>E&amp;xit</source>
+ <translation>&amp;Beenden</translation>
+ </message>
+ <message>
+ <source>Copy</source>
+ <translation>Kopieren</translation>
+ </message>
+ <message>
+ <source>&amp;Copy</source>
+ <translation>&amp;Kopieren</translation>
+ </message>
+ <message>
+ <source>Find in Text</source>
+ <translation>Textsuche</translation>
+ </message>
+ <message>
+ <source>&amp;Find in Text...</source>
+ <translation>Text&amp;suche...</translation>
+ </message>
+ <message>
+ <source>Home</source>
+ <translation>Startseite</translation>
+ </message>
+ <message>
+ <source>&amp;Home</source>
+ <translation>St&amp;artseite</translation>
+ </message>
+ <message>
+ <source>Previous</source>
+ <translation>Vorherige</translation>
+ </message>
+ <message>
+ <source>&amp;Previous</source>
+ <translation>&amp;Vorherige</translation>
+ </message>
+ <message>
+ <source>Next</source>
+ <translation>Nächste</translation>
+ </message>
+ <message>
+ <source>&amp;Next</source>
+ <translation>&amp;Nächste</translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="obsolete">Über</translation>
+ </message>
+ <message>
+ <source>About Qt</source>
+ <translation type="obsolete">Über Qt</translation>
+ </message>
+ <message>
+ <source>Qt Class Reference</source>
+ <translation type="obsolete">Qt Klassenreferenz</translation>
+ </message>
+ <message>
+ <source>Qt Designer Manual</source>
+ <translation type="obsolete">Qt Designer Handbuch</translation>
+ </message>
+ <message>
+ <source>Zoom in</source>
+ <translation>Vergrößern</translation>
+ </message>
+ <message>
+ <source>Zoom &amp;in</source>
+ <translation>Ver&amp;größern</translation>
+ </message>
+ <message>
+ <source>Zoom out</source>
+ <translation>Verkleinern</translation>
+ </message>
+ <message>
+ <source>Zoom &amp;out</source>
+ <translation>Ver&amp;kleinern</translation>
+ </message>
+ <message>
+ <source>Qt Linguist Manual</source>
+ <translation type="obsolete">Qt Linguist Handbuch</translation>
+ </message>
+ <message>
+ <source>&amp;Settings</source>
+ <translation type="obsolete">&amp;Einstellungen</translation>
+ </message>
+ <message>
+ <source>&amp;Settings...</source>
+ <translation>&amp;Einstellungen...</translation>
+ </message>
+ <message>
+ <source>New Window</source>
+ <translation>Neues Fenster</translation>
+ </message>
+ <message>
+ <source>New Window...</source>
+ <translation type="obsolete">Neues Fenster...</translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation>Schließen</translation>
+ </message>
+ <message>
+ <source>Vie&amp;ws</source>
+ <translation>A&amp;nsicht</translation>
+ </message>
+ <message>
+ <source>Ctrl+T</source>
+ <translation>Strg+T
+</translation>
+ </message>
+ <message>
+ <source>Ctrl+I</source>
+ <translation>Strg+I</translation>
+ </message>
+ <message>
+ <source>Ctrl+B</source>
+ <translation>Strg+E</translation>
+ </message>
+ <message>
+ <source>Qt Assistant</source>
+ <translation>Qt Assistant</translation>
+ </message>
+ <message>
+ <source>&amp;Add Bookmark</source>
+ <translation>&amp;Füge Lesezeichen hinzu</translation>
+ </message>
+ <message>
+ <source>Qt Reference Documentation</source>
+ <translation type="obsolete">Qt Referenzdokumention</translation>
+ </message>
+ <message>
+ <source>&amp;File</source>
+ <translation>&amp;Datei</translation>
+ </message>
+ <message>
+ <source>&amp;Edit</source>
+ <translation>&amp;Bearbeiten</translation>
+ </message>
+ <message>
+ <source>&amp;View</source>
+ <translation>&amp;Ansicht</translation>
+ </message>
+ <message>
+ <source>&amp;Go</source>
+ <translation>&amp;Gehe zu</translation>
+ </message>
+ <message>
+ <source>Boo&amp;kmarks</source>
+ <translation>&amp;Lesezeichen</translation>
+ </message>
+ <message>
+ <source>&amp;Help</source>
+ <translation>&amp;Hilfe</translation>
+ </message>
+ <message>
+ <source>Print the currently displayed page.</source>
+ <translation>Drucke aktuelle Seite.</translation>
+ </message>
+ <message>
+ <source>Ctrl+P</source>
+ <translation>Strg+P</translation>
+ </message>
+ <message>
+ <source>Quit Qt Assistant.</source>
+ <translation>Beende Qt Assistant.</translation>
+ </message>
+ <message>
+ <source>Ctrl+Q</source>
+ <translation>Strg+Q</translation>
+ </message>
+ <message>
+ <source>Copy the selected text to the clipboard.</source>
+ <translation>Kopiere den markierten Text in die Zwischenablage.</translation>
+ </message>
+ <message>
+ <source>Ctrl+C</source>
+ <translation>Strg+C</translation>
+ </message>
+ <message>
+ <source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source>
+ <translation>Öffne den Suchdialog. Qt Assistant sucht in der aktuellen Seite nach dem eingegebenen Text.</translation>
+ </message>
+ <message>
+ <source>Ctrl+F</source>
+ <translation>Strg+F</translation>
+ </message>
+ <message>
+ <source>Go to the home page. Qt Assistant&apos;s home page is the Qt Reference Documentation.</source>
+ <translation>Gehe zur Startseite. Qt Assistants Startseite ist die Qt Referenzdokumentation.</translation>
+ </message>
+ <message>
+ <source>Ctrl+Home</source>
+ <translation>Strg+Pos1</translation>
+ </message>
+ <message>
+ <source>Go to the previous page.</source>
+ <translation>Gehe zur vorherigen Seite.</translation>
+ </message>
+ <message>
+ <source>Alt+Left</source>
+ <translation>Alt+Links</translation>
+ </message>
+ <message>
+ <source>Go to the next page.</source>
+ <translation>Gehe zur nächsten Seite.</translation>
+ </message>
+ <message>
+ <source>Alt+Right</source>
+ <translation>Alt+Rechts</translation>
+ </message>
+ <message>
+ <source>Display further information about Qt Assistant.</source>
+ <translation>Zeigt weitere Informationen zu Qt Assistant an.</translation>
+ </message>
+ <message>
+ <source>Display further information about Qt.</source>
+ <translation type="obsolete">Zeigt weitere Informationen zu Qt an.</translation>
+ </message>
+ <message>
+ <source>Display the Qt Reference Documentation.</source>
+ <translation type="obsolete">Zeigt die Qt Referenzdokumentation an.</translation>
+ </message>
+ <message>
+ <source>Display the Qt Designer manual.</source>
+ <translation type="obsolete">Zeigt das Qt Designer Handbuch an.</translation>
+ </message>
+ <message>
+ <source>Zoom in on the document, i.e. increase the font size.</source>
+ <translation>Vergrößert die Schrift.</translation>
+ </message>
+ <message>
+ <source>Ctrl++</source>
+ <translation>Strg++</translation>
+ </message>
+ <message>
+ <source>Zoom out on the document, i.e. decrease the font size.</source>
+ <translation>Verkleinert die Schrift.</translation>
+ </message>
+ <message>
+ <source>Ctrl+-</source>
+ <translation>Strg+-</translation>
+ </message>
+ <message>
+ <source>Display the Guide to the Qt Translation Tools.</source>
+ <translation type="obsolete">Zeigt die Anleitung zu den Qt Übersetzungswerkzeugen an.</translation>
+ </message>
+ <message>
+ <source>Open the settings dialog.</source>
+ <translation>Öffnet den &quot;Einstellungen&quot; Dialog.</translation>
+ </message>
+ <message>
+ <source>Open a new window.</source>
+ <translation>Öffnet ein neues Fenster.</translation>
+ </message>
+ <message>
+ <source>Ctrl+N</source>
+ <translation>Strg+N</translation>
+ </message>
+ <message>
+ <source>&amp;Close</source>
+ <translation>&amp;Schließen</translation>
+ </message>
+ <message>
+ <source>Close the current window.</source>
+ <translation>Schließt das aktuelle Fenster.</translation>
+ </message>
+ <message>
+ <source>Qt Assistant Manual</source>
+ <translation>Qt Assistant Handbuch</translation>
+ </message>
+ <message>
+ <source>Display the Qt Assistant manual.</source>
+ <translation type="obsolete">Zeigt das Qt Assistant Handbuch an.</translation>
+ </message>
+ <message>
+ <source>F1</source>
+ <translation>F1</translation>
+ </message>
+ <message>
+ <source>Add the currently displayed page as a new bookmark.</source>
+ <translation>Füge aktuelle Seite zu den Lesezeichen hinzu.</translation>
+ </message>
+ <message>
+ <source>What&apos;s This?</source>
+ <translation>Direkthilfe</translation>
+ </message>
+ <message>
+ <source>&quot;What&apos;s This?&quot; context sensitive help.</source>
+ <translation>Kontextbezogene Direkthilfe.</translation>
+ </message>
+ <message>
+ <source>Shift+F1</source>
+ <translation>Umschalt+F1</translation>
+ </message>
+ <message>
+ <source>Ctrl+S</source>
+ <translation>Strg+S</translation>
+ </message>
+ <message>
+ <source>Initializing Qt Assistant...</source>
+ <translation>Initialisiere Qt Assistant...</translation>
+ </message>
+ <message>
+ <source>Go</source>
+ <translation>Gehe zu</translation>
+ </message>
+ <message>
+ <source>Find &amp;Next</source>
+ <translation>&amp;Nächste tqfinden</translation>
+ </message>
+ <message>
+ <source>Find Next</source>
+ <translation>Nächste tqfinden</translation>
+ </message>
+ <message>
+ <source>F3</source>
+ <translation>F3</translation>
+ </message>
+ <message>
+ <source>Find &amp;Previous</source>
+ <translation>&amp;Vorigen tqfinden</translation>
+ </message>
+ <message>
+ <source>Find Previous</source>
+ <translation>Vorigen tqfinden</translation>
+ </message>
+ <message>
+ <source>Shift+F3</source>
+ <translation>Umschalt+F3</translation>
+ </message>
+ <message>
+ <source>About Qt Assistant</source>
+ <translation>Über den Qt Assistent</translation>
+ </message>
+ <message>
+ <source>Settings</source>
+ <translation>Einstellungen</translation>
+ </message>
+ <message>
+ <source>Add Bookmark</source>
+ <translation>Lesezeichen einfügen</translation>
+ </message>
+ <message>
+ <source>Add Tab</source>
+ <translation>Tab einfügen</translation>
+ </message>
+ <message>
+ <source>Ctrl+Alt+N</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Next Tab</source>
+ <translation>Nächster Tab</translation>
+ </message>
+ <message>
+ <source>Ctrl+Alt+Right</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Previous Tab</source>
+ <translation>Voriger Tab</translation>
+ </message>
+ <message>
+ <source>Ctrl+Alt+Left</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Close Tab</source>
+ <translation>Tab schließen</translation>
+ </message>
+ <message>
+ <source>Ctrl+Alt+Q</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Failed to open about application contents in file: &apos;%1&apos;</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Failed to open link: &apos;%1&apos;</source>
+ <translation>Der Link &apos;%1&apos; konnte nicht geöffnet werden</translation>
+ </message>
+ <message>
+ <source>&lt;div align=&quot;center&quot;&gt;&lt;h1&gt;The page could not be found!&lt;/h1&gt;&lt;br&gt;&lt;h3&gt;&apos;%1&apos;&lt;/h3&gt;&lt;/div&gt;</source>
+ <translation>&lt;div align=&quot;Hauptseite nicht gefunden!&lt;/h1&gt;</translation>
+ </message>
+ <message>
+ <source>Error...</source>
+ <translation>Fehler ...</translation>
+ </message>
+</context>
+<context>
+ <name>SettingsDialog</name>
+ <message>
+ <source>all</source>
+ <translation type="obsolete">Alle</translation>
+ </message>
+ <message>
+ <source>Qt Assistant - Add Documentation</source>
+ <translation type="obsolete">Qt Assistant - Hinzufügen von Dokumentation</translation>
+ </message>
+ <message>
+ <source>Qt Assistant</source>
+ <translation type="obsolete">Qt Assistant</translation>
+ </message>
+ <message>
+ <source>Parse Error</source>
+ <translation type="obsolete">Syntaxfehler</translation>
+ </message>
+ <message>
+ <source>This item can not be deleted!</source>
+ <translation type="obsolete">Dieser Eintrag kann nicht gelöscht werden!</translation>
+ </message>
+ <message>
+ <source>This branch is not empty!
+Firstly, all contents have to be removed.</source>
+ <translation type="obsolete">Dieser Zweig ist nicht leer!
+Es müssen zuerst alle Inhalte gelöscht werden.</translation>
+ </message>
+ <message>
+ <source>Qt Assistant - Set Web Browser</source>
+ <translation>Qt Assistant - Setze Webbrowser</translation>
+ </message>
+ <message>
+ <source>Qt Assistant - Set PDF Browser</source>
+ <translation>Qt Assistent - Setze PDF Betrachter</translation>
+ </message>
+ <message>
+ <source>Qt Assistant - Set Homepage</source>
+ <translation>Qt Assistent - Setzte Startseite</translation>
+ </message>
+</context>
+<context>
+ <name>SettingsDialogBase</name>
+ <message>
+ <source>Settings</source>
+ <translation type="obsolete">Einstellungen</translation>
+ </message>
+ <message>
+ <source>Font:</source>
+ <translation type="obsolete">Schriften:</translation>
+ </message>
+ <message>
+ <source>Link color:</source>
+ <translation>Linkfarbe:</translation>
+ </message>
+ <message>
+ <source>Underline links</source>
+ <translation type="obsolete">Unterstreiche Links</translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="obsolete">OK</translation>
+ </message>
+ <message>
+ <source>Cancel</source>
+ <translation type="obsolete">Abbrechen</translation>
+ </message>
+ <message>
+ <source>Fixed font:</source>
+ <translation type="obsolete">Nicht-proportionale Schrift:</translation>
+ </message>
+ <message>
+ <source>Qt Assistant - Settings</source>
+ <translation>Qt Assistant - Einstellungen</translation>
+ </message>
+ <message>
+ <source>General</source>
+ <translation type="obsolete">Allgemein</translation>
+ </message>
+ <message>
+ <source>Fix&amp;ed font:</source>
+ <translation>&amp;Nicht-proportionale Schrift:</translation>
+ </message>
+ <message>
+ <source>&amp;Font:</source>
+ <translation>&amp;Schrift:</translation>
+ </message>
+ <message>
+ <source>&amp;Underline links</source>
+ <translation>&amp;Unterstreiche Links</translation>
+ </message>
+ <message>
+ <source>Web</source>
+ <translation type="obsolete">Web</translation>
+ </message>
+ <message>
+ <source>&amp;Web Browser Application:</source>
+ <translation type="obsolete">&amp;Webbrowser Anwendung:</translation>
+ </message>
+ <message>
+ <source>...</source>
+ <translation>...</translation>
+ </message>
+ <message>
+ <source>Documentation</source>
+ <translation type="obsolete">Dokumentation</translation>
+ </message>
+ <message>
+ <source>&amp;Delete</source>
+ <translation type="obsolete">&amp;Lösche</translation>
+ </message>
+ <message>
+ <source>&amp;Add...</source>
+ <translation type="obsolete">&amp;Hinzufügen...</translation>
+ </message>
+ <message>
+ <source>Categories</source>
+ <translation type="obsolete">Kategorien</translation>
+ </message>
+ <message>
+ <source>Category &amp;Name:</source>
+ <translation type="obsolete">Kategorie&amp;name:</translation>
+ </message>
+ <message>
+ <source>&amp;Add</source>
+ <translation type="obsolete">&amp;Hinzufügen</translation>
+ </message>
+ <message>
+ <source>&amp;OK</source>
+ <translation>&amp;OK</translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation>&amp;Abbrechen</translation>
+ </message>
+ <message>
+ <source>&amp;General</source>
+ <translation>&amp;Haupt</translation>
+ </message>
+ <message>
+ <source>&amp;Web</source>
+ <translation>&amp;Web</translation>
+ </message>
+ <message>
+ <source>Web &amp;Browser Application:</source>
+ <translation>Web&amp;browser:</translation>
+ </message>
+ <message>
+ <source>&amp;Home page</source>
+ <translation>&amp;Startseite</translation>
+ </message>
+ <message>
+ <source>&amp;PDF</source>
+ <translation>&amp;PDF</translation>
+ </message>
+ <message>
+ <source>PDF &amp;Application</source>
+ <translation>PDF &amp;Betrachter</translation>
+ </message>
+</context>
+<context>
+ <name>TabbedBrowser</name>
+ <message>
+ <source>TabbedBrowser</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>Untitled</source>
+ <translation>Unbenannt</translation>
+ </message>
+ <message>
+ <source>Add page</source>
+ <translation>Seite einfügen</translation>
+ </message>
+ <message>
+ <source>Close page</source>
+ <translation>Seite schließen</translation>
+ </message>
+</context>
+<context>
+ <name>TopicChooser</name>
+ <message>
+ <source>Choose a topic for &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation>Wählen Sie ein Thema für &lt;b&gt;%1&lt;/b&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>TopicChooserBase</name>
+ <message>
+ <source>Choose Topic</source>
+ <translation>Thema wählen</translation>
+ </message>
+ <message>
+ <source>Select a topic from the list and click the &lt;b&gt;Display&lt;/b&gt;-button to open the online help.</source>
+ <translation>Wählen Sie ein Thema aus der Liste aus und klicken Sie &lt;b&gt;Anzeigen&lt;/b&gt; um die Hilfe zu öffnen.</translation>
+ </message>
+ <message>
+ <source>&amp;Topics</source>
+ <translation>&amp;Themen</translation>
+ </message>
+ <message>
+ <source>Displays a list of available help topics for the keyword.</source>
+ <translation>Zeigt eine Liste der verfügbaren Hilfethemen für diesen Begriff an.</translation>
+ </message>
+ <message>
+ <source>&amp;Display</source>
+ <translation>&amp;Anzeigen</translation>
+ </message>
+ <message>
+ <source>Open the topic selected in the list.</source>
+ <translation>Öffne das gewählte Thema aus der Liste.</translation>
+ </message>
+ <message>
+ <source>&amp;Close</source>
+ <translation>&amp;Schließen</translation>
+ </message>
+ <message>
+ <source>Close the Dialog.</source>
+ <translation>Schließt den Dialog.</translation>
+ </message>
+</context>
+</TS>
diff --git a/tqtinterface/qt4/tools/assistant/assistant_fr.ts b/tqtinterface/qt4/tools/assistant/assistant_fr.ts
new file mode 100644
index 0000000..0dfa69f
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/assistant_fr.ts
@@ -0,0 +1,426 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>Assistant</name>
+ <message>
+ <source>Welcome to the &lt;b&gt;Qt Assistant&lt;/b&gt;. Qt Assistant will give you quicker access to help and tips while using applications like Qt Designer.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Assistant</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>FindDialog</name>
+ <message encoding="UTF-8">
+ <source>Find Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Direction</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Forwar&amp;d</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Backward</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Whole words only</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Case sensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>HelpDialog</name>
+ <message>
+ <source>Index</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bookmarks</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Con&amp;tents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Reference Documentation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Assistant Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Assistant</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>HelpDialogBase</name>
+ <message encoding="UTF-8">
+ <source>Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Help&lt;/b&gt;&lt;p&gt;Choose the topic you need help for from the contents list, or search the index for keywords.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays help topics organized by category, index or bookmarks</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Con&amp;tents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Column 1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Help topics organized by category.&lt;/b&gt;&lt;p&gt;Double-click an item to see which topics are in that category. To view a topic, select it, and then click &lt;b&gt;Display&lt;/b&gt;.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Index</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Look For:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter keyword</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter a keyword.&lt;/b&gt;&lt;p&gt;The list will select an item that matches the entered string best.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;List of available help topics.&lt;/b&gt;&lt;p&gt;Double-click on an item to open up the help page for this topic. You will have to choose the right page if more than one are found.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Bookmarks</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays the list of bookmarks.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Bookmark</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new bookmark</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add the current displayed page as new bookmark to the list.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>D&amp;elete Bookmark</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete bookmark</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the selected bookmark from the list.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Preparing...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>HelpWindow</name>
+ <message>
+ <source>Qt Assistant by Trolltech - %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Can&apos;t load and display non-local file
+%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open Link in New Window<byte value="x9"/>Shift+LMB</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message encoding="UTF-8">
+ <source>Qt Assistant by Trolltech</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Toolbar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Print</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Print...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Exit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>E&amp;xit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Find in Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find in Text...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Home</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Home</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Previous</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Previous</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>About Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>About Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Qt Class Reference</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Zoom in</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Zoom &amp;in</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Zoom out</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Zoom &amp;out</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Settings...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>New Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>New Window...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Vie&amp;ws</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+T</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+I</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Assistant</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Add Bookmark</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Reference Documentation</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>SettingsDialogBase</name>
+ <message encoding="UTF-8">
+ <source>Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Font:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Link color:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Underline links</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Fixed font:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TopicChooser</name>
+ <message>
+ <source>Choose a topic for &lt;b&gt;%1&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>TopicChooserBase</name>
+ <message encoding="UTF-8">
+ <source>Choose Topic</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a topic from the list and click the &lt;b&gt;Display&lt;/b&gt;-button to open the online help.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Topics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays a list of available help topics for the keyword.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Display</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Open the topic selected in the list.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close the Dialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tqtinterface/qt4/tools/assistant/book/assistant.book b/tqtinterface/qt4/tools/assistant/book/assistant.book
new file mode 100644
index 0000000..feb6588
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/assistant.book
@@ -0,0 +1,6 @@
+\title Qt Assistant Manual
+
+\granularity chapter
+
+\input assistant.leaf
+
diff --git a/tqtinterface/qt4/tools/assistant/book/assistant.leaf b/tqtinterface/qt4/tools/assistant/book/assistant.leaf
new file mode 100644
index 0000000..e978b03
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/assistant.leaf
@@ -0,0 +1,563 @@
+\chapter Introduction
+
+This document introduces \QA, a tool for presenting on-line
+documentation. It also introduces the Qt Reference Documentation which
+is accessible using \QA, or with a web browser. The document is
+divided into the following sections:
+
+\list
+\i Introduction to the Qt Reference Documentation
+\i The 1 Minute Guide to using Qt Assistant
+\i Qt Assistant in More Detail
+\i Full Text Searching
+\i Customizing Qt Assistant
+\endlist
+
+\chapter Introduction to the Qt Reference Documentation
+
+The documentation for the Qt library is written in-line in the \File
+.cpp files by the developers themselves. The documentation team
+revises the documentation to ensure that it is accurate and usable,
+and to provide quality control. The documentation team also writes the
+larger texts, such as the class descriptions that introduce a class
+along with the concepts the class uses, as well as introducing the
+functions and properties that the class provides.
+
+The documentation focuses on the API rather than the internals, since
+we make great efforts to keep our API consistent and compatible with
+each new version, but we may change the internals considerably to improve
+performance and enhance functionality.
+
+The Qt Reference Documentation consists of almost 1,500 HTML pages
+(over 2,500 printed pages). The overwhelming majority of pages
+document Qt classes. Since developers differ in the way they
+think and work we provide a variety of approaches to navigating the
+documentation set:
+
+\list
+
+\i The \link classes.html All Classes\endlink page lists every class
+in Qt's public API, and consists of several hundred classes.
+
+\i The \link mainclasses.html Main Classes\endlink page lists the
+classes you're most likely to use most often, and provides a much
+shorter and more managable list than the All Classes list.
+
+\i The \link groups.html Grouped Classes\endlink page presents a list
+of groups, each of which leads to a list of related classes, for
+example, the \link advanced.html Advanced Widgets\endlink list.
+
+\i The \link hierarchy.html Inheritance Hierarchy\endlink page
+presents a list of classes in terms of the hierarchy of Qt classes.
+
+\i The \link functions.html All Functions\endlink page lists all the
+functions provided by Qt classes, each one with links to the class(es)
+in which it appears.
+
+\endlist
+
+No matter where you tqfind yourself in the Qt documentation, you will
+tqfind extensive cross-referencing. Even snippets of example code
+contain clickable links, so that for example, if you come across a
+class declaration in a code example, the class name will be a
+clickable link to the class's documentation.
+
+In addition to the class documentation some of Qt's modules have
+extensive descriptions, and there are many overview documents which
+describe various aspects of the Qt library; all these are linked from
+the reference documentation home page. There are also two tutorials
+and numerous example programs in the examples subdirectory of the Qt
+distribution.
+
+\chapter The 1 Minute Guide to Using Qt Assistant
+
+Under Windows, \QA is available as a menu option on the Qt menu. On
+Unix, run \c{assistant} from an xterm.
+
+When you start up \QA, you will be presented with a standard
+main-window style application, with a menu bar and toolbar. Below
+these, on the left hand side is a navigation window called the \e
+Sidebar, and on the right, taking up most of the space, is the
+documentation window. By default, the Qt Reference Documentation's home
+page is shown in the documentation window.
+
+\QA works in a similar way to a web browser. If you click underlined
+text (which signifies a cross-reference), the documentation window will
+present the relevant page. You can bookmark pages of particular
+interest and you can click the \Toolbutton Previous and \Toolbutton
+Next toolbar buttons to navigate within the pages you've visited.
+
+Although \QA can be used just like a web browser to navigate through
+the Qt documentation set, \QA offers a powerful means of navigation
+that web browsers don't provide. \QA uses an intelligent algorithm to
+index all the pages in the documentation sets that it presents so that
+you can search for particular words and phrases.
+
+To perform an index search, click the \Toolbutton Index tab on the Sidebar
+(or click \Key Ctrl+I). In the 'Look For' line edit enter a word, e.g.
+'homedirpath'. As you type, words are found and highlighted in a list
+beneath the line edit. If the highlighted text matches what you're
+looking for, double click it, (or press \Key Enter) and the
+documentation window will display the relevant page. You rarely have
+to type in the whole word before \QA tqfinds a match. Note that for some
+words there may be more than one possible page that is relevant.
+
+\QA also provides full text searching for tqfinding specific words in
+the documentation. Documents with the highest occurrences of the word
+that you are looking for appear first, and every occurrence of the
+word within the documentation is highlighted.
+
+\omit
+For example, enter 'setenabled' in the 'Look For' line edit.
+As you type, words are found and highlighted in the list beneath the
+line edit, as before. Once the highlighted text matches what you're
+looking for, double click it, (or press \Key Enter). In the case of
+setEnabled, it is a function name which occurs in several classes, so
+a dialog pops up listing the possible choices. Click the choice you're
+interested in (or move to it using the \Key Up and \Key Down arrow
+keys and press \Key Enter). The relevant page will display in the
+documentation window.
+\endomit
+
+\QA can be customized by creating profiles, a collection of
+documentation. Profiles can be created for your own use, or for an
+application you will distribute. With profiles, you can select which
+documentation you want the end user of your application to be able to
+view.
+
+\chapter Qt Assistant in More Detail
+
+\img assistant.png
+\caption Qt Assistant
+
+\section1 The Sidebar
+
+\img sidebar.png
+
+The sidebar provides four ways of navigating documentation:
+\list 1
+\i The \Toolbutton Contents tab presents a tree view of the
+documentation sets that are available. If you click an item, its
+documentation will appear in the documentation window. If you double
+click an item or click a '+' sign to the left of an item, the item's
+sub-items will appear. Click a sub-item to make its page appear in the
+documentation window. Click a '-' sign to the left of an item to hide
+its sub-items.
+\i The \Toolbutton Index tab is used to look up key words or phrases.
+See \l{The 1 Minute Guide to using Qt Assistant} for how to use this
+tab.
+\i The \Toolbutton Bookmarks tab lists any bookmarks you've made.
+Double click a bookmark to make its page appear in the documentation
+window. The \Toolbutton Bookmarks tab has a \Button{New Bookmark}
+button and a \Button{Delete Bookmark} button at the bottom. Click
+\Button{New Bookmark} to bookmark the page that is showing in the
+documentation window. Click a bookmark in the list, then click
+\Button{Delete Bookmark} to delete the highlighted bookmark.
+\i The \Toolbutton Search tab provides full text search of \e all
+the documents. See \l{Full Text Searching} for more information about
+this feature.
+\endlist
+
+If you want the documentation window to use as much space as possible,
+you can easily hide or show the Sidebar. If the Sidebar is showing,
+press \Key Ctrl+T, \Key Ctrl+I, \Key Ctrl+B or \Key Ctrl+S to hide it.
+If the Sidebar is hidden, press \Key Ctrl+T to show it on the Contents
+tab, or press \Key Ctrl+I to show it on the Index tab (with the focus
+in the 'Look For' line edit box), or press \Key Ctrl+B to show it on
+the Bookmarks tab, or press \Key Ctrl+S to show it on the (full text)
+Search tab.
+
+The Sidebar is a dock window, so you can drag it to the top, left,
+right or bottom of \QA's window, or you can drag it outside \QA to
+float it.
+
+\section1 The Documentation Window
+
+\img docwindow.png
+
+The documentation window offers a feature for viewing documentation by
+enabling you to create tabs for each documentation page that you view.
+Click the \Button {Add Tab} button and a new tab will appear with the
+page name as the tab's caption. This makes it convenient to switch
+between pages when you are working with different documentation. You
+can delete a tab by clicking the \Button {Close Tab} button located
+on the right side of the documentation window.
+
+\section1 The Toolbar
+
+\img toolbar1.png
+
+The toolbar provides fast access to the most common actions.
+\list
+\i \Toolbutton Previous takes you to the previous page. The menu
+option is \Menu Go|Previous and the keyboard shortcut is \Key{Alt+Left
+Arrow}.
+\i \Toolbutton Next takes you to the next page. The menu
+option is \Menu Go|Next and the keyboard shortcut is \Key{Alt+Right
+Arrow}.
+\i \Toolbutton Home takes you to the home page (normally the home page
+of the Qt Reference Documentation). The menu
+option is \Menu Go|Home and the keyboard shortcut is \Key{Ctrl+Home}.
+\i \Toolbutton Copy copies any selected text to the clipboard. The menu
+option is \Menu Edit|Copy and the keyboard shortcut is \Key{Ctrl+C}.
+\i \Toolbutton{Find in Text} invokes the \Dialog{Find Text} dialog. The menu
+option is \Menu{Edit|Find in Text} and the keyboard shortcut is \Key{Ctrl+F}.
+\i \Toolbutton{Print} invokes the \Dialog{Print} dialog. The menu
+option is \Menu{File|Print} and the keyboard shortcut is \Key{Ctrl+P}.
+\i \Toolbutton{Zoom in} increases the font size. The menu
+option is \Menu{View|Zoom in} and the keyboard shortcut is \Key{Ctrl++}.
+\i \Toolbutton{Zoom out} decreases the font size. The menu
+option is \Menu{View|Zoom out} and the keyboard shortcut is \Key{Ctrl+-}.
+\i \Toolbutton{What's This?} provides a description of a \QA feature.
+The menu option is \Menu{Help|What's This?} and the keyboard shortcut
+is \Key{Shift+F1}.
+\endlist
+
+The remaining toolbar buttons are bookmarks and will vary depending on
+your configuration.
+
+\section1 The Menus
+
+\section2 The File Menu
+
+\list
+\i \Menu{File|Print} invokes the \Dialog{Print} dialog.
+\i \Menu{File|Exit} terminates \QA.
+\endlist
+
+\section2 The Edit Menu
+
+\list
+\i \Menu{Edit|Copy} copies any selected text to the clipboard.
+\i \Menu{Edit|Find in Text} invokes the \Dialog{Find Text} dialog.
+\i \Menu{Edit|Settings} invokes the \Dialog{Settings} dialog.
+\endlist
+
+\section2 The View Menu
+
+\list
+\i \Menu{View|Zoom in} increases the font size.
+\i \Menu{View|Zoom out} decreases the font size.
+\i \Menu{View|Views|Sidebar} toggles the display of the Sidebar.
+\i \Menu{View|Views|Toolbar} toggles the display of the Toolbar.
+\i \Menu{View|Views|Line up} lines up the toolbar buttons in the
+Toolbar.
+\endlist
+
+\section2 The Go Menu
+
+\list
+\i \Menu{Go|Previous} displays the previous page.
+\i \Menu{Go|Next} displays the next page.
+\i \Menu{Go|home} goes to the home page.
+\endlist
+This menu also has additional items; these are pre-defined bookmarks
+that vary depending on your configuration.
+
+\section2 The Bookmarks Menu
+
+\list
+\i \Menu{Bookmarks|Add} adds the current page to the list of bookmarks.
+\endlist
+This menu may have additional items, i.e. any bookmarks that you have
+already made. If you want to delete a bookmark go to the Bookmarks tab
+on the Sidebar.
+
+\section1 The Dialogs
+
+\section2 The Print Dialog
+
+This dialog is platform-specific. It gives access to various printer
+options and can be used to print the current page.
+
+\section2 The Find Text Dialog
+
+This dialog is used to tqfind text in the current page. Enter the text
+you want to tqfind in the Find line edit. If you check the 'Whole words
+only' checkbox, the search will only consider whole words, i.e. if you
+search for 'spin' with this checkbox checked it will not match
+'spinbox', but will match 'spin'. If you check the 'Case sensitive'
+check box then, for example, 'spin' will match 'spin' but not 'Spin'.
+You can search Forward or Backward from your current position in the
+page by clicking one of the Direction radio buttons. Click the \Button
+Find button to search (or search again), and click the \Button Close
+button to finish.
+
+\section2 The Settings Dialog
+
+The Settings dialog is used to set your preferences for \QA. The
+dialog has four tabs: General Settings, Web Settings, PDF Settings,
+and Profiles. \QA will remember your settings between sessions,
+including window sizes and positions, and which pages you have open.
+Each of the tabs is discussed as follows:
+
+\list
+\i General Settings
+
+\img general.png
+
+To change the base font used throughout \QA, select a
+font type from the Font combobox. To choose a new fixed-width
+font, for example, to show code snippets, choose a font type from
+the 'Fixed font' combobox. To change the color of hypertext
+links, click the 'Link color' color button. Uncheck the
+'Underline links' checkbox if you don't want underlined links.
+
+\i Web Settings
+
+\img web.png
+
+Some pages contain links to external web pages. In order to display
+these links, you must specify a web browser. Type the name of your
+browser's executable in the Web Browser Application line edit.
+Alternatively, click the \Button {(ellipsis)} button to invoke the
+\Widget {Set Web Browser} dialog and navigate until you tqfind the web
+browser you want to use. Click \Button {Save} to accept the selection.
+
+To change \QA's default home page, enter the file name in the Home
+Page line edit. Alternatively, click the \Button {(ellipsis)} button
+to invoke the \Widget {Set Homepage} dialog. Navigate until you tqfind
+the home page file you want to use and then click \Button {Save} to
+accept the selection.
+
+\i PDF Settings
+
+\img pdf1.png
+
+Some pages contain links to PDF documents. In order to display these
+links, you must specify a PDF viewer. Type in the name of your PDF viewer's
+executable in the line edit. Alternatively, click the \Button {(ellipsis)}
+button to invoke the \Widget {Set PDF Browser} dialog and navigate
+until you tqfind the PDF viewer you want to use. Click \Button Save to
+accept the selection.
+
+\chapter Full Text Searching
+
+\img search.png
+
+\QA provides a powerful full text search engine. To search
+for certain words or text, click the 'Search' tab in the sidebar. Then
+enter the text you want to look for and press \Key Enter or click
+\Button Search. The search is not case sensitive, so Foo, fOo and
+FOO are all treated as the same. The following are examples of common search
+patterns:
+
+\list
+\i \c deep -- lists all the documents that contain the word 'deep'
+
+\i \c{deep*} -- lists all the documents that contain a word beginning
+with 'deep'
+
+\i \c{deep copy} -- lists all documents that contain both 'deep' \e
+and 'copy'
+
+\i \c{"deep copy"} -- list all documents that contain the phrase 'deep copy'
+\endlist
+
+The wildcard (*) character cannot be used within quotes.
+
+The list of documents found is ordered according to the number of
+occurrences of the search text they contain, therefore those with the
+highest number of occurrences appearing first. Simply click any
+document in the list to display it in the document window.
+
+If the documentation has changed, i.e. if documents have been added or
+removed, \QA will reindex.
+
+\chapter Customizing Qt Assistant
+
+\QA can be customized by adding and removing documentation from its
+documentation set. In addition, \QA introduces the profiles option,
+which enables its properties to change, for example, the default
+startup page, and application icon.
+
+\section1 Modifying the Default Documentation Set
+
+When it is started without any options, \QA displays a default set of
+documentation. When Qt is installed, the default documentation set in
+\QA tqcontains the Qt reference documentation as well as the tools that
+come with Qt, such as \QD and qmake.
+
+Documentation can be added or removed from \QA by
+adding and removing the content files. The format of the content files are
+specified below. To add a content file, type the following command line
+option: \c{-addContentFile docfile}. To remove a content file from the
+default set, type the following command line option:
+\c{-removeContentFile docfile}. For example:
+
+\code
+1: > assistant -addContentFile file.dcf
+2: > assistant
+3: > assistant -removeContentFile file.dcf
+\endcode
+
+In line one, we add the content file \c file.dcf. In line two, we start
+\QA. The default set will now be extended with the doc file
+\c file.dcf. In line three we remove the file \c file.dcf from the default
+documentation set so that subsequent use of \QA will not contain this
+file.
+
+\section2 Documentation Content File Format
+
+The Documentation Content File must contain the documentation's table
+of contents and all important keywords for the index. In addition, it
+may inherit an icon for the documentation which is displayed in the
+\QA toolbar. You can also specify an extra directory path for
+additional images used in the documentation.
+
+An example of a content file that uses all the available tags and
+attributes is shown below:
+\code
+<assistantconfig version="3.2.0">
+ <DCF ref="demo.html" icon="handbook.png" imagedir="../img/"
+ title="Development Demo Handbook">
+ <section ref="./chap1/chap1.html" title="Chapter1">
+ <section ref="./chap1/section1.html" title="Section1">
+ <keyword ref="./chap1/section1.html#foo">foo</keyword>
+ <keyword ref="./chap1/section1.html#bla">bla</keyword>
+ <section ref="./chap1/section1.html#subsection1" title="Subsection 1"/>
+ <section ref="./chap1/section1.html#subsection2" title="Subsection 2"/>
+ <section ref="./chap1/section1.html#subsection3" title="Subsection 3"/>
+ </section>
+ <section ref="./chap1/section2" title="Section2">
+ <section ref="./chap1/section2.html#subsection1" title="Subsection 1"/>
+ <section ref="./chap1/section2.html#subsection2" title="Subsection 2"/>
+ <section ref="./chap1/section2.html#subsection3" title="Subsection 3"/>
+ </section>
+ </section>
+ <section ref="./chap2/chap2.html" title="Chapter2">
+ <keyword ref="./chap2/chap2.html#foo">foo</keyword>
+ <section ref="./chap2/section1.html" title="Section1"/>
+ </section>
+ </DCF>
+</assistantconfig>
+\endcode
+
+Sections may be nested as deeply as necessary. All references should
+be related.
+
+Note that any \c keyword tags for a given section must appear \e
+before any sections nested within the given section.
+
+The paths in the \c refs attribute are always written Unix-style
+(forward slashes) and are relative to the location of the
+documentation content file itself.
+
+Since the introduction of the new root tag \c assistantconfig in the
+fileformat from Qt version 3.2.0, it is possible to specify multiple DCF tags in
+one file. Note that the old document contents file format, used up to
+Qt 3.2 is still valid.
+
+\section1 Profiles
+
+Profiles enable \QA to act as a specialized help tool for displaying
+documentation for applications. With profiles, the documentation
+writer can change properties such as \QA's title, application icons, and
+'about' dialogs. In addition, profiles can be used to run specialized
+documentation sets that are separate from the Qt docs. \QA can be
+customized by changing the following properties:
+
+\list
+
+\i Name- This property is used to name the profile. If multiple
+profiles are used for the same installation of \QA, this
+parameter is crucial to keep their profile specific settings
+apart. The property name is \c name
+
+\i Title- This property is used to specify a caption for \QA. The
+property name is \c title
+
+\i Application Icon- This property describes an icon that will be used
+as \QA application icon. The location of the icon is relative to the
+location of the profile. The property name is \c applicationicon
+
+\i Start Page- This property specifies which page \QA should initially
+display when the profile is used. Usually, this is the HTML file which
+tqcontains the documentation's table of contents. This property also
+describes the default location to go to when pressing the home button
+in \QA's main user interface. The start page is specified relative to
+the location of the profile. The property name is \c startpage
+
+\i About Menu Text- This property describes the text that appears in
+the \Menu Help menu, e.g. About Application. The property name is \c
+aboutmenutext
+
+\i About URL- This property can be used to point to an HTML file that
+describes the contents in the About dialog that is opened for the
+\Menu Help menu, e.g. About Application. The url is specified relative
+to the location of the profile. The property name is \c abouturl
+
+\i \QA Documentation- This property describes the location of
+the \QA documentation. This is required since \QA provides
+self help, such as the full text search help and the \QA
+Manual option in the \Menu Help menu. The location is a directory
+relative to the location of the profile. The property name is \c
+assistantdocs.
+
+\endlist
+
+To define a profile, one needs to specify a \QA Document
+Profile, usually abbreviated \c{.adp}. The profile is an extension of
+the Documentation Content File described above. We add a \c profile
+tag containing \c property tags to the format.
+
+An example of a document profile file is shown below:
+
+\c helpdemo.adp
+
+\code
+<assistantconfig version="3.2.0">
+
+ <profile>
+ <property name="name">HelpExample</property>
+ <property name="title">Help Example</property>
+ <property name="applicationicon">logo.png</property>
+ <property name="startpage">index.html</property>
+ <property name="aboutmenutext">About Help</property>
+ <property name="abouturl">../about.txt</property>
+ <property name="assistantdocs">../../../doc/html</property>
+ </profile>
+
+ <DCF ref="index.html" icon="handbook.png" title="Help example">
+ <section ref="./manual.html" title="How to use this Example">
+ <keyword ref="./manual.html#installdocs">Install Docs</keyword>
+ <keyword ref="./manual.html#onlydoc">Example Profile</keyword>
+ <keyword ref="./manual.html#hide">Hide Sidebar</keyword>
+ <keyword ref="./manual.html#openqabutton">Open</keyword>
+ <keyword ref="./manual.html#closeqabutton">Close</keyword>
+ <keyword ref="./manual.html#display">Display</keyword>
+ </section>
+ </DCF>
+
+</assistantconfig>
+\endcode
+
+These files are XML files. Characters such as \c{<}, \c{>}, and \c{&}
+must be written as entities (e.g., \c{&lt;}, \c{&gt;}, \c{&amp;}).
+
+\section2 Using Profiles
+
+To use a profile, run \QA with the option \c {-profile filename}.
+This will load the profile specified in the file and will customize
+\QA accordingly. For example, to run \QA with the example
+file above, \c helpdemo.adp, we would run the command as follows:
+
+\code
+> assistant -profile helpdemo.adp
+\endcode
+
+See the HelpDemo example in the Qt distribution for a demonstration
+on how to use \QA with profiles for your own applications.
+
+When distributing \QA with your application, you will also need to
+copy the icon files from the \c QTDIR/tools/assistant/images
+directory so that \QA tqfinds its icons.
+
+\omit
+For small documentation sets, the sidebar may not be necessary. You
+can hide the sidebar on startup with the following:
+\code
+assistant -hideSidebar
+\endcode
+\endomit
+
diff --git a/tqtinterface/qt4/tools/assistant/book/images/assistant.png b/tqtinterface/qt4/tools/assistant/book/images/assistant.png
new file mode 100644
index 0000000..9401940
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/assistant.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/book/images/docwindow.png b/tqtinterface/qt4/tools/assistant/book/images/docwindow.png
new file mode 100644
index 0000000..18fa098
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/docwindow.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/book/images/general.png b/tqtinterface/qt4/tools/assistant/book/images/general.png
new file mode 100644
index 0000000..2fad053
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/general.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/book/images/pdf1.png b/tqtinterface/qt4/tools/assistant/book/images/pdf1.png
new file mode 100644
index 0000000..104ac16
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/pdf1.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/book/images/search.png b/tqtinterface/qt4/tools/assistant/book/images/search.png
new file mode 100644
index 0000000..667a4a6
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/search.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/book/images/sidebar.png b/tqtinterface/qt4/tools/assistant/book/images/sidebar.png
new file mode 100644
index 0000000..7e005cd
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/sidebar.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/book/images/toolbar1.png b/tqtinterface/qt4/tools/assistant/book/images/toolbar1.png
new file mode 100644
index 0000000..0f3358a
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/toolbar1.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/book/images/web.png b/tqtinterface/qt4/tools/assistant/book/images/web.png
new file mode 100644
index 0000000..5888f79
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/book/images/web.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/config.cpp b/tqtinterface/qt4/tools/assistant/config.cpp
new file mode 100644
index 0000000..56ac848
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/config.cpp
@@ -0,0 +1,379 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "config.h"
+#include "profile.h"
+#include "docuparser.h"
+
+#include <tqapplication.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqsettings.h>
+#include <tqxml.h>
+
+static Config *static_configuration = 0;
+
+inline TQString getVersionString()
+{
+ return TQString::number( (TQT_VERSION >> 16) & 0xff )
+ + "." + TQString::number( (TQT_VERSION >> 8) & 0xff );
+}
+
+Config::Config()
+ : hideSidebar( FALSE ), profil( 0 ), maximized(FALSE)
+{
+ fontSiz = tqApp->font().pointSize();
+ if( !static_configuration ) {
+ static_configuration = this;
+ } else {
+ qWarning( "Multiple configurations not allowed!" );
+ }
+}
+
+Config *Config::loadConfig(const TQString &profileFileName)
+{
+ Config *config = new Config();
+
+ if (profileFileName.isEmpty()) { // no profile
+ config->profil = Profile::createDefaultProfile();
+ config->load();
+ config->loadDefaultProfile();
+ return config;
+ }
+
+ TQFile file(profileFileName);
+ if (!file.exists()) {
+ qWarning( "File does not exist: " + profileFileName );
+ return 0;
+ }
+ DocuParser *parser = DocuParser::createParser( profileFileName );
+ if (!parser) {
+ qWarning( "Failed to create parser for file: " + profileFileName );
+ return 0;
+ }
+ if (parser->parserVersion() < DocuParser::TQt320) {
+ qWarning( "File does not contain profile information" );
+ return 0;
+ }
+ DocuParser320 *profileParser = static_cast<DocuParser320*>(parser);
+ parser->parse(&file);
+ config->profil = profileParser->profile();
+ if (!config->profil) {
+ qWarning( "Config::loadConfig(), no profile in: " + profileFileName );
+ return 0;
+ }
+ config->profil->setProfileType(Profile::UserProfile);
+ config->profil->setDocuParser(profileParser);
+ config->load();
+ return config;
+}
+
+Config *Config::configuration()
+{
+ TQ_ASSERT( static_configuration );
+ return static_configuration;
+}
+
+void Config::load()
+{
+ const TQString key = "/TQt Assistant/" + getVersionString() + "/";
+ const TQString profkey = key + "Profile/" + profil->props["name"] + "/";
+
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+
+ webBrows = settings.readEntry( key + "Webbrowser" );
+ home = settings.readEntry( profkey + "Homepage" );
+ pdfApp = settings.readEntry( key + "PDFApplication" );
+ linkUnder = settings.readBoolEntry( key + "LinkUnderline", TRUE );
+ linkCol = settings.readEntry( key + "LinkColor", "#0000FF" );
+ src = settings.readListEntry( profkey + "Source" );
+ sideBar = settings.readNumEntry( key + "SideBarPage" );
+ if (tqApp->type() != TQApplication::Tty) {
+ fontFam = settings.readEntry( key + "Family", tqApp->font().family() );
+
+ fontFix = settings.readEntry( key + "FixedFamily", "courier" );
+ fontSiz = settings.readNumEntry( key + "Size", -1 );
+ if ( fontSiz < 4 ) {
+ fontSiz = tqApp->font().pointSize();
+ }
+
+ geom.setRect( settings.readNumEntry( key + "GeometryX", TQApplication::desktop()->availableGeometry().x() ),
+ settings.readNumEntry( key + "GeometryY", TQApplication::desktop()->availableGeometry().y() ),
+ settings.readNumEntry( key + "GeometryWidth", 800 ),
+ settings.readNumEntry( key + "GeometryHeight", 600 ) );
+ maximized = settings.readBoolEntry( key + "GeometryMaximized", FALSE );
+ }
+ mainWinLayout = settings.readEntry( key + "MainwindowLayout" );
+ rebuildDocs = settings.readBoolEntry( key + "RebuildDocDB", TRUE );
+
+ profileNames = settings.entryList( key + "Profile" );
+}
+
+void Config::save()
+{
+ saveSettings();
+ saveProfile( profil );
+}
+
+void Config::saveSettings()
+{
+ const TQString key = "/TQt Assistant/" + getVersionString() + "/";
+ const TQString profkey = key + "Profile/" + profil->props["name"] + "/";
+
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+
+ settings.writeEntry( key + "Webbrowser", webBrows );
+ settings.writeEntry( profkey + "Homepage", home );
+ settings.writeEntry( key + "PDFApplication", pdfApp );
+ settings.writeEntry( key + "LinkUnderline", linkUnder );
+ settings.writeEntry( key + "LinkColor", linkCol );
+ settings.writeEntry( profkey + "Source", src );
+ settings.writeEntry( key + "SideBarPage", sideBarPage() );
+ if (tqApp->type() != TQApplication::Tty) {
+ settings.writeEntry( key + "GeometryX", geom.x() );
+ settings.writeEntry( key + "GeometryY", geom.y() );
+ settings.writeEntry( key + "GeometryWidth", geom.width() );
+ settings.writeEntry( key + "GeometryHeight", geom.height() );
+ settings.writeEntry( key + "GeometryMaximized", maximized );
+ settings.writeEntry( key + "Family", fontFam );
+ settings.writeEntry( key + "Size", fontSiz < 4 ? tqApp->font().pointSize() : fontSiz );
+ settings.writeEntry( key + "FixedFamily", fontFix );
+ }
+ if ( !hideSidebar )
+ settings.writeEntry( key + "MainwindowLayout", mainWinLayout );
+ settings.writeEntry( key + "RebuildDocDB", rebuildDocs );
+}
+
+#ifdef ASSISTANT_DEBUG
+static void dumpmap( const TQMap<TQString,TQString> &m, const TQString &header )
+{
+ qDebug( header );
+ TQMap<TQString,TQString>::ConstIterator it = m.begin();
+ while (it != m.end()) {
+ qDebug( " " + it.key() + ":\t\t" + *it );
+ ++it;
+ }
+}
+#endif
+
+void Config::loadDefaultProfile()
+{
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+ const TQString key = "/TQt Assistant/" + TQString(TQT_VERSION_STR) + "/Profile";
+ const TQString profKey = key + "/default/";
+
+ if( settings.entryList( key + "/default" ).count() == 0 ) {
+ return;
+ }
+
+ // Override the defaults with settings in registry.
+ profil->icons.clear();
+ profil->indexPages.clear();
+ profil->imageDirs.clear();
+ profil->docs.clear();
+ profil->dcfTitles.clear();
+
+ TQStringList titles = settings.readListEntry( profKey + "Titles" );
+ TQStringList iconLst = settings.readListEntry( profKey + "DocIcons" );
+ TQStringList indexLst = settings.readListEntry( profKey + "IndexPages" );
+ TQStringList imgDirLst = settings.readListEntry( profKey + "ImageDirs" );
+ TQStringList dcfs = settings.readListEntry( profKey + "DocFiles" );
+
+ TQStringList::ConstIterator it = titles.begin();
+ TQValueListConstIterator<TQString> iconIt = iconLst.begin();
+ TQValueListConstIterator<TQString> indexIt = indexLst.begin();
+ TQValueListConstIterator<TQString> imageIt = imgDirLst.begin();
+ TQValueListConstIterator<TQString> dcfIt = dcfs.begin();
+ for( ; it != titles.end();
+ ++it, ++iconIt, ++indexIt, ++imageIt, ++dcfIt )
+ {
+ profil->addDCFIcon( *it, *iconIt );
+ profil->addDCFIndexPage( *it, *indexIt );
+ profil->addDCFImageDir( *it, *imageIt );
+ profil->addDCFTitle( *dcfIt, *it );
+ }
+#if ASSISTANT_DEBUG
+ dumpmap( profil->icons, "Icons" );
+ dumpmap( profil->indexPages, "IndexPages" );
+ dumpmap( profil->imageDirs, "ImageDirs" );
+ dumpmap( profil->dcfTitles, "dcfTitles" );
+ qDebug( "Docfiles: \n " + profil->docs.join( "\n " ) );
+#endif
+}
+
+void Config::saveProfile( Profile *profile )
+{
+ if (profil && profil->profileType() == Profile::UserProfile)
+ return;
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+ TQString versionString = (profile->props["name"] == "default")
+ ? TQString(TQT_VERSION_STR)
+ : getVersionString();
+ const TQString key = "/TQt Assistant/" + versionString + "/";
+ const TQString profKey = key + "Profile/" + profile->props["name"] + "/";
+
+ TQStringList indexes, icons, imgDirs, dcfs;
+ TQValueList<TQString> titles = profile->dcfTitles.keys();
+ TQValueListConstIterator<TQString> it = titles.begin();
+ for ( ; it != titles.end(); ++it ) {
+ indexes << profile->indexPages[*it];
+ icons << profile->icons[*it];
+ imgDirs << profile->imageDirs[*it];
+ dcfs << profile->dcfTitles[*it];
+ }
+
+ settings.writeEntry( profKey + "Titles", titles );
+ settings.writeEntry( profKey + "DocFiles", dcfs );
+ settings.writeEntry( profKey + "IndexPages", indexes );
+ settings.writeEntry( profKey + "DocIcons", icons );
+ settings.writeEntry( profKey + "ImageDirs", imgDirs );
+
+#if ASSISTANT_DEBUG
+ qDebug( "Titles:\n - " + ( (TQStringList*) &titles )->join( "\n - " ) );
+ qDebug( "Docfiles:\n - " + dcfs.join( "\n - " ) );
+ qDebug( "IndexPages:\n - " + indexes.join( "\n - " ) );
+ qDebug( "DocIcons:\n - " + icons.join( "\n - " ) );
+ qDebug( "ImageDirs:\n - " + imgDirs.join( "\n - " ) );
+#endif
+}
+
+TQStringList Config::mimePaths()
+{
+ static TQStringList lst;
+
+ if( lst.count() > 0 )
+ return lst;
+
+ for (TQMap<TQString,TQString>::ConstIterator it = profil->dcfTitles.begin();
+ it != profil->dcfTitles.end(); ++it ) {
+
+ // Mime source for .dcf file path
+ TQFileInfo info( *it );
+ TQString dcfPath = info.dirPath(TRUE);
+ if (lst.tqcontains(dcfPath) == 0)
+ lst << dcfPath;
+
+ // Image dir for .dcf
+ TQString imgDir = TQDir::convertSeparators( dcfPath + TQDir::separator()
+ + profil->imageDirs[it.key()] );
+ if (lst.tqcontains(imgDir) == 0)
+ lst << imgDir;
+ }
+ return lst;
+}
+
+TQStringList Config::profiles() const
+{
+ return profileNames;
+}
+
+TQString Config::title() const
+{
+ return profil->props[ "title" ];
+}
+
+TQString Config::aboutApplicationMenuText() const
+{
+ return profil->props[ "aboutmenutext" ];
+}
+
+TQString Config::aboutURL() const
+{
+ return profil->props[ "abouturl" ];
+}
+
+TQString Config::homePage() const
+{
+ return home.isEmpty() ? profil->props["startpage"] : home;
+}
+
+TQStringList Config::source() const
+{
+ return src.size() == 0 ? TQStringList(profil->props["startpage"]) : src;
+}
+
+TQStringList Config::docFiles() const
+{
+ return profil->docs;
+}
+
+TQPixmap Config::docIcon( const TQString &title ) const
+{
+ // ### To allow qdoc generated dcf files to reference the doc icons from qmake_image_col
+ if (!TQFile::exists(profil->icons[title]))
+ return TQPixmap::fromMimeSource( TQFileInfo(profil->icons[title]).fileName() );
+ return TQPixmap::fromMimeSource( profil->icons[title] );
+}
+
+TQPixmap Config::applicationIcon() const
+{
+ return TQPixmap::fromMimeSource( profil->props["applicationicon"] );
+}
+
+TQStringList Config::docTitles() const
+{
+ return TQStringList(profil->indexPages.keys());
+}
+
+TQString Config::docImageDir( const TQString &docfile ) const
+{
+ return profil->imageDirs[docfile];
+}
+
+TQString Config::indexPage( const TQString &title ) const
+{
+ return profil->indexPages
+ [title];
+}
+
+void Config::hideSideBar( bool b )
+{
+ hideSidebar = b;
+}
+
+bool Config::sideBarHidden() const
+{
+ return hideSidebar;
+}
+
+TQString Config::assistantDocPath() const
+{
+ return profil->props["assistantdocs"].isEmpty()
+ ? TQString( qInstallPathDocs() ) + "/html"
+ : profil->props["assistantdocs"];
+}
diff --git a/tqtinterface/qt4/tools/assistant/config.h b/tqtinterface/qt4/tools/assistant/config.h
new file mode 100644
index 0000000..56e9f70
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/config.h
@@ -0,0 +1,152 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "profile.h"
+
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqpixmap.h>
+#include <tqmap.h>
+
+class Profile;
+
+class Config
+{
+public:
+
+ Config();
+
+ void load();
+ void save();
+ Profile *profile() const { return profil; }
+ TQString profileName() const { return profil->props["name"]; }
+ bool validProfileName() const;
+ void hideSideBar( bool b );
+ bool sideBarHidden() const;
+ TQStringList mimePaths();
+
+ // From profile, read only
+ TQStringList docFiles() const;
+ TQStringList docTitles() const;
+ TQString indexPage( const TQString &title ) const;
+ TQString docImageDir( const TQString &title ) const;
+ TQPixmap docIcon( const TQString &title ) const;
+
+ TQStringList profiles() const;
+ TQString title() const;
+ TQString aboutApplicationMenuText() const;
+ TQString aboutURL() const;
+ TQPixmap applicationIcon() const;
+
+ // From TQSettings, read / write
+ TQString webBrowser() const { return webBrows; }
+ void setWebBrowser( const TQString &cmd ) { webBrows = cmd; }
+
+ TQString homePage() const;
+ void setHomePage( const TQString &hom ) { home = hom; }
+
+ TQString pdfReader() const { return pdfApp; }
+ void setPdfReader( const TQString &cmd ) { pdfApp = cmd; }
+
+ int fontSize() const { return fontSiz; }
+ void setFontSize( int size ) { fontSiz = size; }
+
+ TQString fontFamily() const { return fontFam; }
+ void setFontFamily( const TQString &fam ) { fontFam = fam; }
+
+ TQString fontFixedFamily() const { return fontFix; }
+ void setFontFixedFamily( const TQString &fn ) { fontFix = fn; }
+
+ TQString linkColor() const { return linkCol; }
+ void setLinkColor( const TQString &col ) { linkCol = col; }
+
+ TQStringList source() const;
+ void setSource( const TQStringList &s ) { src = s; }
+
+ int sideBarPage() const { return sideBar; }
+ void setSideBarPage( int sbp ) { sideBar = sbp; }
+
+ TQRect tqgeometry() const { return geom; }
+ void setGeometry( const TQRect &geo ) { geom = geo; }
+
+ bool isMaximized() const { return maximized; }
+ void setMaximized( bool max ) { maximized = max; }
+
+ bool isLinkUnderline() const { return linkUnder; }
+ void setLinkUnderline( bool ul ) { linkUnder = ul; }
+
+ TQString mainWindowLayout() const { return mainWinLayout; }
+ void setMainWindowLayout( const TQString &tqlayout ) { mainWinLayout = tqlayout; }
+
+ TQString assistantDocPath() const;
+
+ bool docRebuild() const { return rebuildDocs; }
+ void setDocRebuild( bool rb ) { rebuildDocs = rb; }
+
+ void saveProfile( Profile *profile );
+ void loadDefaultProfile();
+
+ static Config *configuration();
+ static Config *loadConfig(const TQString &profileFileName);
+
+private:
+ Config( const Config &c );
+ Config& operator=( const Config &c );
+
+ void saveSettings();
+
+private:
+ Profile *profil;
+
+ TQStringList profileNames;
+ TQString webBrows;
+ TQString home;
+ TQString pdfApp;
+ TQString fontFam;
+ TQString fontFix;
+ TQString linkCol;
+ TQStringList src;
+ TQString mainWinLayout;
+ TQRect geom;
+ int sideBar;
+ int fontSiz;
+ bool maximized;
+ bool linkUnder;
+ bool hideSidebar;
+ bool rebuildDocs;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/assistant/docuparser.cpp b/tqtinterface/qt4/tools/assistant/docuparser.cpp
new file mode 100644
index 0000000..f1c2f01
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/docuparser.cpp
@@ -0,0 +1,397 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "docuparser.h"
+#include "profile.h"
+
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqxml.h>
+
+TQDataStream &operator>>( TQDataStream &s, ContentItem &ci )
+{
+ s >> ci.title;
+ s >> ci.reference;
+ s >> ci.depth;
+ return s;
+}
+
+TQDataStream &operator<<( TQDataStream &s, const ContentItem &ci )
+{
+ s << ci.title;
+ s << ci.reference;
+ s << ci.depth;
+ return s;
+}
+
+const TQString DocuParser::DocumentKey = "/TQt Assistant/" + TQString(TQT_VERSION_STR) + "/";
+
+DocuParser *DocuParser::createParser( const TQString &fileName )
+{
+ TQFile file( fileName );
+ if( !file.open( IO_ReadOnly ) ) {
+ return 0;
+ }
+
+ TQString str;
+ int read = 0;
+ int maxlen = 1024;
+ int majVer = 0, minVer = 0, serVer = 0;
+ static TQRegExp re( "assistantconfig +version=\"(\\d)\\.(\\d)\\.(\\d)\"", FALSE );
+ TQ_ASSERT( re.isValid() );
+ while( read != -1 ) {
+ read = file.readLine( str, maxlen );
+ if( re.search( str ) >= 0 ) {
+ majVer = re.cap( 1 ).toInt();
+ minVer = re.cap( 2 ).toInt();
+ serVer = re.cap( 3 ).toInt();
+ }
+ }
+
+ if( majVer == 3 && minVer >= 2 )
+ return new DocuParser320;
+
+ return new DocuParser310;
+}
+
+
+bool DocuParser::parse( TQFile *file )
+{
+ TQXmlInputSource source( TQT_TQIODEVICE(file) );
+ TQXmlSimpleReader reader;
+ reader.setContentHandler( this );
+ reader.setErrorHandler( this );
+ setFileName( TQFileInfo( *file ).absFilePath() );
+ return reader.parse( source );
+}
+
+
+TQString DocuParser::errorProtocol() const
+{
+ return errorProt;
+}
+
+
+TQValueList<ContentItem> DocuParser::getContentItems()
+{
+ return contentList;
+}
+
+
+TQPtrList<IndexItem> DocuParser::getIndexItems()
+{
+ return indexList;
+}
+
+TQString DocuParser::absolutify( const TQString &name ) const
+{
+ TQFileInfo orgPath( name );
+ if( orgPath.isRelative() )
+ return TQFileInfo( fname ).dirPath() + TQDir::separator() + name;
+ return name;
+}
+
+
+void DocuParser310::addTo( Profile *p )
+{
+ p->addDCFTitle( fname, docTitle );
+ p->addDCFIcon( docTitle, iconName );
+ p->addDCFIndexPage( docTitle, conURL );
+}
+
+
+bool DocuParser310::startDocument()
+{
+ state = StateInit;
+ errorProt = "";
+
+ contentRef = "";
+ indexRef = "";
+ depth = 0;
+ contentList.clear();
+ indexList.clear();
+
+ return TRUE;
+}
+
+
+bool DocuParser310::startElement( const TQString &, const TQString &,
+ const TQString &qname,
+ const TQXmlAttributes &attr )
+{
+ if (qname == "DCF" && state == StateInit) {
+ state = StateContent;
+ contentRef = absolutify( attr.value( "ref" ) );
+ conURL = contentRef;
+ docTitle = attr.value( "title" );
+ iconName = absolutify( attr.value( "icon" ) );
+ contentList.append( ContentItem( docTitle, contentRef, depth ) );
+ } else if (qname == "section" && (state == StateContent || state == StateSect)) {
+ state = StateSect;
+ contentRef = absolutify( attr.value( "ref" ) );
+ title = attr.value( "title" );
+ depth++;
+ contentList.append( ContentItem( title, contentRef, depth ) );
+ } else if (qname == "keyword" && state == StateSect) {
+ state = StateKeyword;
+ indexRef = absolutify( attr.value( "ref" ) );
+ } else
+ return FALSE;
+ return TRUE;
+}
+
+bool DocuParser310::endElement( const TQString &nameSpace, const TQString &localName,
+ const TQString &qName )
+{
+ switch( state ) {
+ case StateInit:
+ break;
+ case StateContent:
+ state = StateInit;
+ break;
+ case StateSect:
+ state = --depth ? StateSect : StateContent;
+ break;
+ case StateKeyword:
+ state = StateSect;
+ break;
+ }
+ return TRUE;
+}
+
+
+bool DocuParser310::characters( const TQString& ch )
+{
+ TQString str = ch.simplifyWhiteSpace();
+ if ( str.isEmpty() )
+ return TRUE;
+
+ switch ( state ) {
+ case StateInit:
+ case StateContent:
+ case StateSect:
+ return FALSE;
+ break;
+ case StateKeyword:
+ indexList.append( new IndexItem( str, indexRef ) );
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+bool DocuParser310::fatalError( const TQXmlParseException& exception )
+{
+ errorProt += TQString( "fatal parsing error: %1 in line %2, column %3\n" )
+ .arg( exception.message() )
+ .arg( exception.lineNumber() )
+ .arg( exception.columnNumber() );
+
+ return TQXmlDefaultHandler::fatalError( exception );
+}
+
+
+DocuParser320::DocuParser320()
+ : prof( new Profile )
+{
+}
+
+
+void DocuParser320::addTo( Profile *p )
+{
+ TQMap<TQString,TQString>::ConstIterator it;
+
+ for (it = prof->dcfTitles.begin(); it != prof->dcfTitles.end(); ++it)
+ p->dcfTitles[it.key()] = *it;
+
+ for (it = prof->icons.begin(); it != prof->icons.end(); ++it)
+ p->icons[it.key()] = *it;
+
+ for (it = prof->indexPages.begin(); it != prof->indexPages.end(); ++it)
+ p->indexPages[it.key()] = *it;
+}
+
+
+bool DocuParser320::startDocument()
+{
+ state = StateInit;
+ errorProt = "";
+
+ contentRef = "";
+ indexRef = "";
+ depth = 0;
+ contentList.clear();
+ indexList.clear();
+
+ prof->addDCF( fname );
+
+ return TRUE;
+}
+
+bool DocuParser320::startElement( const TQString &, const TQString &,
+ const TQString &qname,
+ const TQXmlAttributes &attr )
+{
+ TQString lower = qname.lower();
+
+ switch( state ) {
+
+ case StateInit:
+ if( lower == "assistantconfig" )
+ state = StateDocRoot;
+ break;
+
+ case StateDocRoot:
+ if( lower == "dcf" ) {
+ state = StateContent;
+ contentRef = absolutify( attr.value( "ref" ) );
+ conURL = contentRef;
+ docTitle = attr.value( "title" );
+ iconName = absolutify( attr.value( "icon" ) );
+ contentList.append( ContentItem( docTitle, contentRef, depth ) );
+ } else if( lower == "profile" ) {
+ state = StateProfile;
+ }
+ break;
+
+ case StateSect:
+ if ( lower == "keyword" && state == StateSect ) {
+ state = StateKeyword;
+ indexRef = absolutify( attr.value( "ref" ) );
+ break;
+ } // else if (lower == "section")
+ case StateContent:
+ if( lower == "section" ) {
+ state = StateSect;
+ contentRef = absolutify( attr.value( "ref" ) );
+ title = attr.value( "title" );
+ depth++;
+ contentList.append( ContentItem( title, contentRef, depth ) );
+ }
+ break;
+
+ case StateProfile:
+ if( lower == "property" ) {
+ state = StateProperty;
+ propertyName = attr.value( "name" );
+ }
+ break;
+
+ case StateProperty:
+ break;
+ }
+
+ return TRUE;
+}
+
+bool DocuParser320::endElement( const TQString &nameSpace,
+ const TQString &localName,
+ const TQString &qName )
+{
+ switch( state ) {
+ case StateInit:
+ break;
+ case StateDocRoot:
+ state = StateInit;
+ break;
+ case StateProfile:
+ state = StateDocRoot;
+ break;
+ case StateProperty:
+ state = StateProfile;
+ if( propertyName.isEmpty() || propertyValue.isEmpty() )
+ return FALSE;
+ {
+ static const TQStringList lst = TQStringList() << "startpage" << "abouturl"
+ << "applicationicon" << "assistantdocs";
+ if (lst.tqcontains(propertyName))
+ propertyValue = absolutify( propertyValue );
+ }
+ prof->addProperty( propertyName, propertyValue );
+ break;
+ case StateContent:
+ if( !iconName.isEmpty() ) prof->addDCFIcon( docTitle, iconName );
+ if( contentRef.isEmpty() )
+ return FALSE;
+ prof->addDCFIndexPage( docTitle, conURL );
+ prof->addDCFTitle( fname, docTitle );
+ state = StateDocRoot;
+ break;
+ case StateSect:
+ state = --depth ? StateSect : StateContent;
+ break;
+ case StateKeyword:
+ state = StateSect;
+ break;
+ }
+ return TRUE;
+}
+
+bool DocuParser320::characters( const TQString& ch )
+{
+ TQString str = ch.simplifyWhiteSpace();
+ if ( str.isEmpty() )
+ return TRUE;
+
+ switch ( state ) {
+ case StateInit:
+ case StateContent:
+ case StateSect:
+ return FALSE;
+ break;
+ case StateKeyword:
+ indexList.append( new IndexItem( str, indexRef ) );
+ break;
+ case StateProperty:
+ propertyValue = ch;
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+bool DocuParser320::fatalError( const TQXmlParseException& exception )
+{
+ errorProt += TQString( "fatal parsing error: %1 in line %2, column %3\n" )
+ .arg( exception.message() )
+ .arg( exception.lineNumber() )
+ .arg( exception.columnNumber() );
+
+ return TQXmlDefaultHandler::fatalError( exception );
+}
diff --git a/tqtinterface/qt4/tools/assistant/docuparser.h b/tqtinterface/qt4/tools/assistant/docuparser.h
new file mode 100644
index 0000000..0ca4d61
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/docuparser.h
@@ -0,0 +1,151 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DOCUPARSER_H
+#define DOCUPARSER_H
+
+#include <tqxml.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
+
+class Profile;
+
+struct ContentItem {
+ ContentItem()
+ : title( TQString() ), reference( TQString() ), depth( 0 ) {}
+ ContentItem( const TQString &t, const TQString &r, int d )
+ : title( t ), reference( r ), depth( d ) {}
+ TQString title;
+ TQString reference;
+ int depth;
+ TQ_DUMMY_COMPARISON_OPERATOR(ContentItem)
+};
+
+TQDataStream &operator>>( TQDataStream &s, ContentItem &ci );
+TQDataStream &operator<<( TQDataStream &s, const ContentItem &ci );
+
+struct IndexItem {
+ IndexItem( const TQString &k, const TQString &r )
+ : keyword( k ), reference( r ) {}
+ TQString keyword;
+ TQString reference;
+};
+
+
+
+class DocuParser : public TQXmlDefaultHandler
+{
+public:
+ enum ParserVersion { TQt310, TQt320 };
+ // Since We don't want problems with documentation
+ // from version to version, this string stores the correct
+ // version string to save documents.
+ static const TQString DocumentKey;
+
+ static DocuParser *createParser( const TQString &fileName );
+
+ virtual bool parse( TQFile *file );
+
+ TQValueList<ContentItem> getContentItems();
+ TQPtrList<IndexItem> getIndexItems();
+
+ TQString errorProtocol() const;
+ TQString contentsURL() const { return conURL; }
+
+ virtual ParserVersion parserVersion() const = 0;
+ virtual void addTo( Profile *p ) = 0;
+
+ TQString fileName() const { return fname; }
+ void setFileName( const TQString &file ) { fname = file; }
+
+protected:
+ TQString absolutify( const TQString &input ) const;
+
+ TQString contentRef, indexRef, errorProt, conURL;
+ TQString docTitle, title, iconName;
+ TQValueList<ContentItem> contentList;
+ TQPtrList<IndexItem> indexList;
+ TQString fname;
+};
+
+
+class DocuParser310 : public DocuParser
+{
+public:
+ enum States{ StateInit, StateContent, StateSect, StateKeyword };
+
+ bool startDocument();
+ bool startElement( const TQString&, const TQString&, const TQString& ,
+ const TQXmlAttributes& );
+ bool endElement( const TQString&, const TQString&, const TQString& );
+ bool characters( const TQString & );
+ bool fatalError( const TQXmlParseException& exception );
+
+ virtual ParserVersion parserVersion() const { return TQt310; }
+ virtual void addTo( Profile *p );
+
+private:
+ States state;
+ int depth;
+};
+
+
+class DocuParser320 : public DocuParser
+{
+public:
+ enum States { StateInit, StateDocRoot, StateProfile, StateProperty,
+ StateContent, StateSect, StateKeyword };
+
+ DocuParser320();
+
+ bool startDocument();
+ bool startElement( const TQString&, const TQString&, const TQString& ,
+ const TQXmlAttributes& );
+ bool endElement( const TQString&, const TQString&, const TQString& );
+ bool characters( const TQString & );
+ bool fatalError( const TQXmlParseException& exception );
+
+ virtual ParserVersion parserVersion() const { return TQt320; }
+ virtual void addTo( Profile *p );
+ Profile *profile() const { return prof; }
+
+private:
+
+ States state;
+ int depth;
+ int docfileCounter;
+ TQString propertyValue;
+ TQString propertyName;
+ Profile *prof;
+};
+#endif //DOCUPARSER_H
diff --git a/tqtinterface/qt4/tools/assistant/finddialog.ui b/tqtinterface/qt4/tools/assistant/finddialog.ui
new file mode 100644
index 0000000..56fd582
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/finddialog.ui
@@ -0,0 +1,292 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>FindDialog</class>
+<comment>*********************************************************************
+
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+
+**
+
+** This file is part of Qt Assistant.
+
+**
+
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>FindDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>362</width>
+ <height>156</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Qt Assistant - Find Text</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <widget class="TQButtonGroup" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Direction</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>radioForward</cstring>
+ </property>
+ <property name="text">
+ <string>Fo&amp;rward</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>radioBackward</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Backward</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>F&amp;ind:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFind</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>comboFind</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="2">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>31</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;lose</string>
+ </property>
+ <property name="accel">
+ <string>Alt+L</string>
+ </property>
+ </widget>
+ <widget class="TQButtonGroup" row="1" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkWords</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Whole words only</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkCase</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Case sensitive</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find</string>
+ </property>
+ <property name="accel">
+ <string>Alt+F</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDialog</receiver>
+ <slot>doFind()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>comboFind</tabstop>
+ <tabstop>checkWords</tabstop>
+ <tabstop>checkCase</tabstop>
+ <tabstop>radioForward</tabstop>
+ <tabstop>radioBackward</tabstop>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>PushButton2</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">tqstatusbar.h</include>
+ <include location="global" impldecl="in implementation">tqtextbrowser.h</include>
+ <include location="local" impldecl="in implementation">mainwindow.h</include>
+ <include location="local" impldecl="in implementation">tabbedbrowser.h</include>
+ <include location="local" impldecl="in implementation">finddialog.ui.h</include>
+</includes>
+<forwards>
+ <forward>class TQTextBrowser;</forward>
+ <forward>class TQStatusBar;</forward>
+ <forward>class MainWindow;</forward>
+</forwards>
+<variables>
+ <variable>TQStatusBar *sb;</variable>
+ <variable>bool onceFound;</variable>
+ <variable>TQString tqfindExpr;</variable>
+ <variable>TQTextBrowser *lastBrowser;</variable>
+</variables>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot>doFind()</slot>
+ <slot>doFind(bool)</slot>
+ <slot>statusMessage(const TQString &amp;message)</slot>
+</Q_SLOTS>
+<functions>
+ <function specifier="non virtual" returnType="MainWindow *">mainWindow()</function>
+ <function specifier="non virtual" returnType="bool">hasFindExpression()</function>
+</functions>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/assistant/finddialog.ui.h b/tqtinterface/qt4/tools/assistant/finddialog.ui.h
new file mode 100644
index 0000000..dc10393
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/finddialog.ui.h
@@ -0,0 +1,108 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqapplication.h>
+
+void FindDialog::init()
+{
+ lastBrowser = 0;
+ onceFound = FALSE;
+ tqfindExpr = "";
+ sb = new TQStatusBar( this );
+ FindDialogLayout->addWidget( sb );
+ sb->message( tr( "Enter the text you are looking for." ) );
+}
+
+void FindDialog::destroy()
+{
+}
+
+void FindDialog::doFind()
+{
+ doFind(radioForward->isChecked());
+}
+
+void FindDialog::doFind(bool forward)
+{
+ TQTextBrowser *browser = (TQTextBrowser*) mainWindow()->browsers()->currentBrowser();
+ sb->clear();
+
+ if (comboFind->currentText() != tqfindExpr || lastBrowser != browser)
+ onceFound = false;
+ tqfindExpr = comboFind->currentText();
+
+ bool found;
+ if (browser->hasSelectedText()) { // Search either forward or backward from cursor.
+ found = browser->tqfind(tqfindExpr, checkCase->isChecked(), checkWords->isChecked(),
+ forward);
+ } else {
+ int para = forward ? 0 : INT_MAX;
+ int index = forward ? 0 : INT_MAX;
+ found = browser->tqfind(tqfindExpr, checkCase->isChecked(), checkWords->isChecked(),
+ forward, &para, &index);
+ }
+
+ if (!found) {
+ if (onceFound) {
+ if (forward)
+ statusMessage(tr("Search reached end of the document"));
+ else
+ statusMessage(tr("Search reached start of the document"));
+ } else {
+ statusMessage(tr( "Text not found" ));
+ }
+ }
+ onceFound |= found;
+ lastBrowser = browser;
+}
+
+
+
+MainWindow* FindDialog::mainWindow()
+{
+ return (MainWindow*) tqparent();
+}
+
+bool FindDialog::hasFindExpression()
+{
+ return !tqfindExpr.isEmpty();
+}
+
+void FindDialog::statusMessage(const TQString &message)
+{
+ if (isVisible())
+ sb->message(message);
+ else
+ ((MainWindow*) tqparent())->statusBar()->message(message, 2000);
+
+}
diff --git a/tqtinterface/qt4/tools/assistant/helpdialog.ui b/tqtinterface/qt4/tools/assistant/helpdialog.ui
new file mode 100644
index 0000000..3f61572
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/helpdialog.ui
@@ -0,0 +1,506 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>HelpDialogBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>HelpDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>268</width>
+ <height>448</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Help</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Help&lt;/b&gt;&lt;p&gt;Choose the topic you want help on from the contents list, or search the index for keywords.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</string>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>contentPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Con&amp;tents</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListView">
+ <column>
+ <property name="text">
+ <string>Column 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listContents</cstring>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Help topics organized by category.&lt;/b&gt;&lt;p&gt;Double-click an item to see the topics in that category. To view a topic, just double-click it.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget8</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Index</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Look For:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editIndex</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>editIndex</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter keyword</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter a keyword.&lt;/b&gt;&lt;p&gt;The list will select an item that matches the entered string best.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQListBox">
+ <property name="name">
+ <cstring>listIndex</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;List of available help topics.&lt;/b&gt;&lt;p&gt;Double-click on an item to open its help page. If more than one is found, you must specify which page you want.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget9</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Bookmarks</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListView">
+ <column>
+ <property name="text">
+ <string>Column 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listBookmarks</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displays the list of bookmarks.</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonAdd</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new bookmark</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Add the currently displayed page as a new bookmark.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonRemove</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete bookmark</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected bookmark.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>searchTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Search</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>5</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Searching f&amp;or:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>termsEdit</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>termsEdit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter searchword(s).</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter search word(s).&lt;/b&gt;&lt;p&gt;Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="5" column="0">
+ <property name="name">
+ <cstring>resultBox</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Found documents&lt;/b&gt;&lt;p&gt;This list tqcontains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Found &amp;Documents:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>resultBox</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>He&amp;lp</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Display the help page.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Display the help page for the full text search.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>61</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>searchButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Search</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start searching.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Pressing this button starts the search.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="TQFrame">
+ <property name="name">
+ <cstring>framePrepare</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>3</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelPrepare</cstring>
+ </property>
+ <property name="text">
+ <string>Preparing...</string>
+ </property>
+ </widget>
+ <widget class="TQProgressBar">
+ <property name="name">
+ <cstring>progressPrepare</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>HelpDialogBase</receiver>
+ <slot>addBookmark()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemove</sender>
+ <signal>clicked()</signal>
+ <receiver>HelpDialogBase</receiver>
+ <slot>removeBookmark()</slot>
+ </connection>
+ <connection>
+ <sender>termsEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>searchButton</receiver>
+ <slot>animateClick()</slot>
+ </connection>
+ <connection>
+ <sender>helpButton</sender>
+ <signal>clicked()</signal>
+ <receiver>HelpDialogBase</receiver>
+ <slot>showSearchHelp()</slot>
+ </connection>
+ <connection>
+ <sender>searchButton</sender>
+ <signal>clicked()</signal>
+ <receiver>HelpDialogBase</receiver>
+ <slot>startSearch()</slot>
+ </connection>
+ <connection>
+ <sender>resultBox</sender>
+ <signal>returnPressed(TQListBoxItem*)</signal>
+ <receiver>HelpDialogBase</receiver>
+ <slot>showResultPage(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>resultBox</sender>
+ <signal>mouseButtonClicked(int, TQListBoxItem*, const TQPoint &amp;)</signal>
+ <receiver>HelpDialogBase</receiver>
+ <slot>showResultPage(int, TQListBoxItem*, const TQPoint &amp; )</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>listContents</tabstop>
+ <tabstop>editIndex</tabstop>
+ <tabstop>listIndex</tabstop>
+ <tabstop>listBookmarks</tabstop>
+ <tabstop>buttonAdd</tabstop>
+ <tabstop>buttonRemove</tabstop>
+ <tabstop>termsEdit</tabstop>
+ <tabstop>searchButton</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>resultBox</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">addBookmark()</slot>
+ <slot access="protected">currentBookmarkChanged( TQListViewItem * )</slot>
+ <slot access="protected">currentIndexChanged( TQListBoxItem * )</slot>
+ <slot access="protected">currentTabChanged( const TQString &amp; )</slot>
+ <slot access="protected">loadIndexFile()</slot>
+ <slot access="protected">currentContentsChanged( TQListViewItem * )</slot>
+ <slot access="protected">removeBookmark()</slot>
+ <slot access="protected">searchInIndex( const TQString &amp; )</slot>
+ <slot access="protected">showTopic()</slot>
+ <slot access="protected">showTopic( int, TQListBoxItem *, const TQPoint &amp; )</slot>
+ <slot access="protected">showSearchHelp()</slot>
+ <slot access="protected">startSearch()</slot>
+ <slot access="protected">showResultPage( TQListBoxItem * )</slot>
+ <slot access="protected">showResultPage( int, TQListBoxItem *, const TQPoint &amp; )</slot>
+ <slot access="protected">showResultPage( int, TQListViewItem *, const TQPoint &amp; )</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp b/tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp
new file mode 100644
index 0000000..b608d51
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/helpdialogimpl.cpp
@@ -0,0 +1,1161 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "helpdialogimpl.h"
+#include "helpwindow.h"
+#include "topicchooserimpl.h"
+#include "docuparser.h"
+#include "mainwindow.h"
+#include "config.h"
+#include "tabbedbrowser.h"
+
+#include <tqaccel.h>
+#include <tqapplication.h>
+#include <tqcursor.h>
+#include <tqdir.h>
+#include <tqeventloop.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqmessagebox.h>
+#include <tqpixmap.h>
+#include <tqprogressbar.h>
+#include <tqptrlist.h>
+#include <tqptrstack.h>
+#include <tqpushbutton.h>
+#include <tqregexp.h>
+#include <tqsettings.h>
+#include <tqstatusbar.h>
+#include <tqtabwidget.h>
+#include <tqtextbrowser.h>
+#include <tqtextstream.h>
+#include <tqtimer.h>
+#include <tqurl.h>
+#include <tqvalidator.h>
+
+#include <stdlib.h>
+#include <limits.h>
+
+static TQString stripAmpersand( const TQString &str )
+{
+ TQString s( str );
+ s = s.tqreplace( '&', "" );
+ return s;
+}
+
+static bool verifyDirectory(const TQString &str)
+{
+ TQFileInfo dirInfo(str);
+ if (!dirInfo.exists())
+ return TQDir().mkdir(str);
+ if (!dirInfo.isDir()) {
+ qWarning("'%s' exists but is not a directory", str.latin1());
+ return FALSE;
+ }
+ return TRUE;
+}
+
+struct IndexKeyword {
+ IndexKeyword( const TQString &kw, const TQString &l )
+ : keyword( kw ), link( l ) {}
+ IndexKeyword() : keyword( TQString() ), link( TQString() ) {}
+ bool operator<( const IndexKeyword &ik ) const {
+ return keyword.lower() < ik.keyword.lower();
+ }
+ bool operator<=( const IndexKeyword &ik ) const {
+ return keyword.lower() <= ik.keyword.lower();
+ }
+ bool operator>( const IndexKeyword &ik ) const {
+ return keyword.lower() > ik.keyword.lower();
+ }
+ TQ_DUMMY_COMPARISON_OPERATOR( IndexKeyword )
+ TQString keyword;
+ TQString link;
+};
+
+TQDataStream &operator>>( TQDataStream &s, IndexKeyword &ik )
+{
+ s >> ik.keyword;
+ s >> ik.link;
+ return s;
+}
+
+TQDataStream &operator<<( TQDataStream &s, const IndexKeyword &ik )
+{
+ s << ik.keyword;
+ s << ik.link;
+ return s;
+}
+
+TQValidator::State SearchValidator::validate( TQString &str, int & ) const
+{
+ for ( int i = 0; i < (int) str.length(); ++i ) {
+ TQChar c = str[i];
+ if ( !c.isLetterOrNumber() && c != '\'' && c != '`'
+ && c != '\"' && c != ' ' && c != '-' && c != '_'
+ && c!= '*' )
+ return TQValidator::Invalid;
+ }
+ return TQValidator::Acceptable;
+}
+
+HelpNavigationListItem::HelpNavigationListItem( TQListBox *ls, const TQString &txt )
+ : TQListBoxText( ls, txt )
+{
+}
+
+void HelpNavigationListItem::addLink( const TQString &link )
+{
+ int hash = link.tqfind( '#' );
+ if ( hash == -1 ) {
+ linkList << link;
+ return;
+ }
+
+ TQString preHash = link.left( hash );
+ if ( linkList.grep( preHash, FALSE ).count() > 0 )
+ return;
+ linkList << link;
+}
+
+HelpNavigationContentsItem::HelpNavigationContentsItem( TQListView *v, TQListViewItem *after )
+ : TQListViewItem( v, after )
+{
+}
+
+HelpNavigationContentsItem::HelpNavigationContentsItem( TQListViewItem *v, TQListViewItem *after )
+ : TQListViewItem( v, after )
+{
+}
+
+void HelpNavigationContentsItem::setLink( const TQString &lnk )
+{
+ theLink = lnk;
+}
+
+TQString HelpNavigationContentsItem::link() const
+{
+ return theLink;
+}
+
+
+
+HelpDialog::HelpDialog( TQWidget *tqparent, MainWindow *h )
+ : HelpDialogBase( tqparent, 0, FALSE ), lwClosed( FALSE ), help( h )
+{
+}
+
+void HelpDialog::initialize()
+{
+ connect( tabWidget, TQT_SIGNAL( selected(const TQString&) ),
+ this, TQT_SLOT( currentTabChanged(const TQString&) ) );
+ connect( listContents, TQT_SIGNAL( mouseButtonClicked(int, TQListViewItem*, const TQPoint &, int ) ),
+ this, TQT_SLOT( showTopic(int,TQListViewItem*, const TQPoint &) ) );
+ connect( listContents, TQT_SIGNAL( currentChanged(TQListViewItem*) ),
+ this, TQT_SLOT( currentContentsChanged(TQListViewItem*) ) );
+ connect( listContents, TQT_SIGNAL( selectionChanged(TQListViewItem*) ),
+ this, TQT_SLOT( currentContentsChanged(TQListViewItem*) ) );
+ connect( listContents, TQT_SIGNAL( doubleClicked(TQListViewItem*) ),
+ this, TQT_SLOT( showTopic(TQListViewItem*) ) );
+ connect( listContents, TQT_SIGNAL( returnPressed(TQListViewItem*) ),
+ this, TQT_SLOT( showTopic(TQListViewItem*) ) );
+ connect( listContents, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ),
+ this, TQT_SLOT( showItemMenu( TQListViewItem*, const TQPoint& ) ) );
+ connect( editIndex, TQT_SIGNAL( returnPressed() ),
+ this, TQT_SLOT( showTopic() ) );
+ connect( editIndex, TQT_SIGNAL( textChanged(const TQString&) ),
+ this, TQT_SLOT( searchInIndex(const TQString&) ) );
+
+ connect( listIndex, TQT_SIGNAL( selectionChanged(TQListBoxItem*) ),
+ this, TQT_SLOT( currentIndexChanged(TQListBoxItem*) ) );
+ connect( listIndex, TQT_SIGNAL( returnPressed(TQListBoxItem*) ),
+ this, TQT_SLOT( showTopic() ) );
+ connect( listIndex, TQT_SIGNAL( mouseButtonClicked(int, TQListBoxItem*, const TQPoint &) ),
+ this, TQT_SLOT( showTopic( int, TQListBoxItem *, const TQPoint & ) ) );
+ connect( listIndex, TQT_SIGNAL( currentChanged(TQListBoxItem*) ),
+ this, TQT_SLOT( currentIndexChanged(TQListBoxItem*) ) );
+ connect( listIndex, TQT_SIGNAL( contextMenuRequested( TQListBoxItem*, const TQPoint& ) ),
+ this, TQT_SLOT( showItemMenu( TQListBoxItem*, const TQPoint& ) ) );
+
+ connect( listBookmarks, TQT_SIGNAL( mouseButtonClicked(int, TQListViewItem*, const TQPoint&, int ) ),
+ this, TQT_SLOT( showTopic(int, TQListViewItem*, const TQPoint &) ) );
+ connect( listBookmarks, TQT_SIGNAL( returnPressed(TQListViewItem*) ),
+ this, TQT_SLOT( showTopic(TQListViewItem*) ) );
+ connect( listBookmarks, TQT_SIGNAL( selectionChanged(TQListViewItem*) ),
+ this, TQT_SLOT( currentBookmarkChanged(TQListViewItem*) ) );
+ connect( listBookmarks, TQT_SIGNAL( currentChanged(TQListViewItem*) ),
+ this, TQT_SLOT( currentBookmarkChanged(TQListViewItem*) ) );
+ connect( listBookmarks, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int ) ),
+ this, TQT_SLOT( showItemMenu( TQListViewItem*, const TQPoint& ) ) );
+ connect( resultBox, TQT_SIGNAL( contextMenuRequested( TQListBoxItem*, const TQPoint& ) ),
+ this, TQT_SLOT( showItemMenu( TQListBoxItem*, const TQPoint& ) ) );
+
+ cacheFilesPath = TQDir::homeDirPath() + "/.assistant/"; //### Find a better location for the dbs
+
+ editIndex->installEventFilter( this );
+ listBookmarks->header()->hide();
+ listBookmarks->header()->setStretchEnabled( TRUE );
+ listContents->header()->hide();
+ listContents->header()->setStretchEnabled( TRUE );
+ framePrepare->hide();
+ connect( tqApp, TQT_SIGNAL(lastWindowClosed()), TQT_SLOT(lastWinClosed()) );
+
+ termsEdit->setValidator( new SearchValidator( TQT_TQOBJECT(termsEdit) ) );
+
+ itemPopup = new TQPopupMenu( this );
+ itemPopup->insertItem( tr( "Open Link in Current Tab" ), 0 );
+ itemPopup->insertItem( tr( "Open Link in New Window" ), 1 );
+ itemPopup->insertItem( tr( "Open Link in New Tab" ), 2 );
+
+ contentList.setAutoDelete( TRUE );
+ contentList.clear();
+
+ initDoneMsgShown = FALSE;
+ fullTextIndex = 0;
+ indexDone = FALSE;
+ titleMapDone = FALSE;
+ contentsInserted = FALSE;
+ bookmarksInserted = FALSE;
+ setupTitleMap();
+}
+
+
+void HelpDialog::processEvents()
+{
+ tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput );
+}
+
+
+void HelpDialog::lastWinClosed()
+{
+ lwClosed = TRUE;
+}
+
+
+void HelpDialog::removeOldCacheFiles()
+{
+ TQString dir = cacheFilesPath; // ### remove the last '/' ?
+ if (!verifyDirectory(cacheFilesPath)) {
+ qWarning( "Failed to created assistant directory" );
+ return;
+ }
+ TQString pname = "." + Config::configuration()->profileName();
+
+ TQStringList fileList;
+ fileList << "indexdb" << "indexdb.dict" << "indexdb.doc" << "contentdb";
+ TQStringList::iterator it = fileList.begin();
+ for ( ; it != fileList.end(); ++it ) {
+ if ( TQFile::exists( cacheFilesPath + *it + pname ) ) {
+ TQFile f( cacheFilesPath + *it + pname );
+ f.remove();
+ }
+ }
+}
+
+void HelpDialog::timerEvent(TQTimerEvent *e)
+{
+ static int opacity = 255;
+ // To allow patching of 3.2.3 assistant for qsa.
+#if TQT_VERSION >= 0x030300
+ help->setWindowOpacity((opacity-=4)/255.0);
+ if (opacity<=0)
+#endif
+ tqApp->quit();
+}
+
+
+void HelpDialog::loadIndexFile()
+{
+ if ( indexDone )
+ return;
+
+ setCursor( Qt::WaitCursor );
+ indexDone = TRUE;
+ labelPrepare->setText( tr( "Prepare..." ) );
+ framePrepare->show();
+ processEvents();
+
+ TQProgressBar *bar = progressPrepare;
+ bar->setTotalSteps( 100 );
+ bar->setProgress( 0 );
+
+ keywordDocuments.clear();
+ TQValueList<IndexKeyword> lst;
+ TQFile indexFile( cacheFilesPath + "indexdb." +
+ Config::configuration()->profileName() );
+ if ( !indexFile.open( IO_ReadOnly ) ) {
+ buildKeywordDB();
+ processEvents();
+ if( lwClosed )
+ return;
+ if (!indexFile.open(IO_ReadOnly)) {
+ TQMessageBox::warning(help, tr("TQt Assistant"), tr("Failed to load keyword index file\n"
+ "Assistant will not work!"));
+#if defined TQ_WS_WIN || defined TQ_WS_MACX
+ startTimer(50);
+#endif
+ return;
+ }
+ }
+
+ editIndex->setEnabled(FALSE);
+
+ TQDataStream ds( &indexFile );
+ TQ_UINT32 fileAges;
+ ds >> fileAges;
+ if ( fileAges != getFileAges() ) {
+ indexFile.close();
+ buildKeywordDB();
+ if ( !indexFile.open( IO_ReadOnly ) ) {
+ TQMessageBox::warning( help, tr( "TQt Assistant" ),
+ tr( "Cannot open the index file %1" ).arg( TQFileInfo( indexFile ).absFilePath() ) );
+ editIndex->setEnabled(TRUE);
+ return;
+ }
+ ds.setDevice( &indexFile );
+ ds >> fileAges;
+ }
+ ds >> lst;
+ indexFile.close();
+
+ bar->setProgress( bar->totalSteps() );
+ processEvents();
+
+ listIndex->clear();
+ HelpNavigationListItem *lastItem = 0;
+ TQString lastKeyword = TQString();
+ TQValueList<IndexKeyword>::ConstIterator it = lst.begin();
+ for ( ; it != lst.end(); ++it ) {
+ if ( lastKeyword.lower() != (*it).keyword.lower() )
+ lastItem = new HelpNavigationListItem( listIndex, (*it).keyword );
+ lastItem->addLink( (*it).link );
+ lastKeyword = (*it).keyword;
+
+ TQString lnk = (*it).link;
+ int i = lnk.tqfindRev('#');
+ if ( i > -1 )
+ lnk = lnk.left( i );
+ if (!keywordDocuments.tqcontains(lnk))
+ keywordDocuments.append(lnk);
+ }
+ framePrepare->hide();
+ showInitDoneMessage();
+ setCursor( Qt::ArrowCursor );
+ editIndex->setEnabled(TRUE);
+}
+
+TQ_UINT32 HelpDialog::getFileAges()
+{
+ TQStringList addDocuFiles = Config::configuration()->docFiles();
+ TQStringList::const_iterator i = addDocuFiles.begin();
+
+ TQ_UINT32 fileAges = 0;
+ for( ; i != addDocuFiles.end(); ++i ) {
+ TQFileInfo fi( *i );
+ if ( fi.exists() )
+ fileAges += fi.lastModified().toTime_t();
+ }
+
+ return fileAges;
+}
+
+void HelpDialog::buildKeywordDB()
+{
+ TQStringList addDocuFiles = Config::configuration()->docFiles();
+ TQStringList::iterator i = addDocuFiles.begin();
+
+ int steps = 0;
+ for( ; i != addDocuFiles.end(); i++ )
+ steps += TQFileInfo( *i ).size();
+
+ labelPrepare->setText( tr( "Prepare..." ) );
+ progressPrepare->setTotalSteps( steps );
+ progressPrepare->setProgress( 0 );
+ processEvents();
+
+ TQValueList<IndexKeyword> lst;
+ TQ_UINT32 fileAges = 0;
+ for( i = addDocuFiles.begin(); i != addDocuFiles.end(); i++ ){
+ TQFile file( *i );
+ if ( !file.exists() ) {
+ TQMessageBox::warning( this, tr( "Warning" ),
+ tr( "Documentation file %1 does not exist!\n"
+ "Skipping file." ).arg( TQFileInfo( file ).absFilePath() ) );
+ continue;
+ }
+ fileAges += TQFileInfo( file ).lastModified().toTime_t();
+ DocuParser *handler = DocuParser::createParser( *i );
+ bool ok = handler->parse( &file );
+ file.close();
+ if( !ok ){
+ TQString msg = TQString( "In file %1:\n%2" )
+ .arg( TQFileInfo( file ).absFilePath() )
+ .arg( handler->errorProtocol() );
+ TQMessageBox::critical( this, tr( "Parse Error" ), tr( msg ) );
+ delete handler;
+ continue;
+ }
+
+ TQPtrList<IndexItem> indLst = handler->getIndexItems();
+ TQPtrListIterator<IndexItem> it( indLst );
+ IndexItem *indItem;
+ int counter = 0;
+ while ( ( indItem = it.current() ) != 0 ) {
+ TQFileInfo fi( indItem->reference );
+ lst.append( IndexKeyword( indItem->keyword, fi.absFilePath() ) );
+ if ( progressPrepare )
+ progressPrepare->setProgress( progressPrepare->progress() +
+ int(fi.absFilePath().length() * 1.6) );
+
+ if( ++counter%100 == 0 ) {
+ processEvents();
+ if( lwClosed ) {
+ return;
+ }
+ }
+ ++it;
+ }
+ delete handler;
+ }
+ if ( !lst.isEmpty() )
+ qHeapSort( lst );
+
+ TQFile indexout( cacheFilesPath + "indexdb." + Config::configuration()->profileName() );
+ if ( verifyDirectory(cacheFilesPath) && indexout.open( IO_WriteOnly ) ) {
+ TQDataStream s( &indexout );
+ s << fileAges;
+ s << lst;
+ indexout.close();
+ }
+}
+
+void HelpDialog::setupTitleMap()
+{
+ if ( titleMapDone )
+ return;
+ if ( Config::configuration()->docRebuild() ) {
+ removeOldCacheFiles();
+ Config::configuration()->setDocRebuild( FALSE );
+ Config::configuration()->saveProfile( Config::configuration()->profile() );
+ }
+ if ( contentList.isEmpty() )
+ getAllContents();
+
+ titleMapDone = TRUE;
+ titleMap.clear();
+ TQDictIterator<ContentList> lstIt( contentList );
+ for ( ; lstIt.current(); ++lstIt ) {
+ TQValueList<ContentItem> &lst = *(lstIt.current());
+ TQValueListConstIterator<ContentItem> it;
+ for ( it = lst.begin(); it != lst.end(); ++it ) {
+ TQFileInfo link( (*it).reference.simplifyWhiteSpace() );
+ titleMap[ link.absFilePath() ] = (*it).title.stripWhiteSpace();
+ }
+ }
+ processEvents();
+}
+
+void HelpDialog::getAllContents()
+{
+ TQFile contentFile( cacheFilesPath + "contentdb." + Config::configuration()->profileName() );
+ contentList.clear();
+ if ( !contentFile.open( IO_ReadOnly ) ) {
+ buildContentDict();
+ return;
+ }
+
+ TQDataStream ds( &contentFile );
+ TQ_UINT32 fileAges;
+ ds >> fileAges;
+ if ( fileAges != getFileAges() ) {
+ contentFile.close();
+ buildContentDict();
+ return;
+ }
+ TQString key;
+ TQValueList<ContentItem> lst;
+ while ( !ds.atEnd() ) {
+ ds >> key;
+ ds >> lst;
+ contentList.insert( key, new TQValueList<ContentItem>( lst ) );
+ }
+ contentFile.close();
+ processEvents();
+
+}
+
+void HelpDialog::buildContentDict()
+{
+ TQStringList docuFiles = Config::configuration()->docFiles();
+
+ TQ_UINT32 fileAges = 0;
+ for( TQStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++ ) {
+ TQFile file( *it );
+ if ( !file.exists() ) {
+ TQMessageBox::warning( this, tr( "Warning" ),
+ tr( "Documentation file %1 does not exist!\n"
+ "Skipping file." ).arg( TQFileInfo( file ).absFilePath() ) );
+ continue;
+ }
+ fileAges += TQFileInfo( file ).lastModified().toTime_t();
+ DocuParser *handler = DocuParser::createParser( *it );
+ if( !handler ) {
+ TQMessageBox::warning( this, tr( "Warning" ),
+ tr( "Documentation file %1 is not compatible!\n"
+ "Skipping file." ).arg( TQFileInfo( file ).absFilePath() ) );
+ continue;
+ }
+ bool ok = handler->parse( &file );
+ file.close();
+ if( ok ) {
+ contentList.insert( *it, new TQValueList<ContentItem>( handler->getContentItems() ) );
+ delete handler;
+ } else {
+ TQString msg = TQString( "In file %1:\n%2" )
+ .arg( TQFileInfo( file ).absFilePath() )
+ .arg( handler->errorProtocol() );
+ TQMessageBox::critical( this, tr( "Parse Error" ), tr( msg ) );
+ continue;
+ }
+ }
+
+ TQString pname = Config::configuration()->profileName();
+ TQFile contentOut( cacheFilesPath + "contentdb." + pname );
+ TQFile::remove( cacheFilesPath + "indexdb.dict." + pname );
+ TQFile::remove( cacheFilesPath + "indexdb.doc." + pname );
+ if ( contentOut.open( IO_WriteOnly ) ) {
+ TQDataStream s( &contentOut );
+ s << fileAges;
+ TQDictIterator<ContentList> it( contentList );
+ for ( ; it.current(); ++it ) {
+ s << it.currentKey();
+ s << *(it.current());
+ }
+ contentOut.close();
+ }
+}
+
+void HelpDialog::currentTabChanged( const TQString &s )
+{
+ if ( stripAmpersand( s ).tqcontains( tr( "Index" ) ) )
+ TQTimer::singleShot( 0, this, TQT_SLOT( loadIndexFile() ) );
+ else if ( stripAmpersand( s ).tqcontains( tr( "Bookmarks" ) ) )
+ insertBookmarks();
+ else if ( stripAmpersand( s ).tqcontains( tr( "Contents" ) ) )
+ TQTimer::singleShot( 0, this, TQT_SLOT( insertContents() ) );
+ else if ( stripAmpersand( s ).tqcontains( tr( "Search" ) ) )
+ TQTimer::singleShot( 0, this, TQT_SLOT( setupFullTextIndex() ) );
+}
+
+void HelpDialog::showInitDoneMessage()
+{
+ if ( initDoneMsgShown )
+ return;
+ initDoneMsgShown = TRUE;
+ help->statusBar()->message( tr( "Done" ), 3000 );
+}
+
+void HelpDialog::currentIndexChanged( TQListBoxItem * )
+{
+}
+
+
+void HelpDialog::showTopic( int button, TQListBoxItem *item,
+ const TQPoint & )
+{
+ if( button == Qt::LeftButton && item )
+ showTopic();
+}
+
+void HelpDialog::showTopic( int button, TQListViewItem *item,
+ const TQPoint & )
+{
+ if( button == Qt::LeftButton && item )
+ showTopic();
+}
+
+void HelpDialog::showTopic( TQListViewItem *item )
+{
+ if( item )
+ showTopic();
+}
+
+void HelpDialog::showTopic()
+{
+ if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).tqcontains( tr( "Index" ) ) )
+ showIndexTopic();
+ else if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).tqcontains( tr( "Bookmarks" ) ) )
+ showBookmarkTopic();
+ else if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).tqcontains( tr( "Contents" ) ) )
+ showContentsTopic();
+}
+
+void HelpDialog::showIndexTopic()
+{
+ TQListBoxItem *i = listIndex->item( listIndex->currentItem() );
+ if ( !i )
+ return;
+
+ editIndex->blockSignals( TRUE );
+ editIndex->setText( i->text() );
+ editIndex->blockSignals( FALSE );
+
+ HelpNavigationListItem *item = (HelpNavigationListItem*)i;
+
+ TQStringList links = item->links();
+ if ( links.count() == 1 ) {
+ emit showLink( links.first() );
+ } else {
+ qHeapSort( links );
+ TQStringList::Iterator it = links.begin();
+ TQStringList linkList;
+ TQStringList linkNames;
+ for ( ; it != links.end(); ++it ) {
+ linkList << *it;
+ linkNames << titleOfLink( *it );
+ }
+ TQString link = TopicChooser::getLink( this, linkNames, linkList, i->text() );
+ if ( !link.isEmpty() )
+ emit showLink( link );
+ }
+}
+
+void HelpDialog::searchInIndex( const TQString &s )
+{
+ TQListBoxItem *i = listIndex->firstItem();
+ TQString sl = s.lower();
+ while ( i ) {
+ TQString t = i->text();
+ if ( t.length() >= sl.length() &&
+ i->text().left(s.length()).lower() == sl ) {
+ listIndex->setCurrentItem( i );
+ listIndex->setTopItem(listIndex->index(i));
+ break;
+ }
+ i = i->next();
+ }
+}
+
+TQString HelpDialog::titleOfLink( const TQString &link )
+{
+ TQString s( link );
+ s.remove( s.tqfind( '#' ), s.length() );
+ s = titleMap[ s ];
+ if ( s.isEmpty() )
+ return link;
+ return s;
+}
+
+bool HelpDialog::eventFilter( TQObject * o, TQEvent * e )
+{
+ if ( !o || !e )
+ return TRUE;
+
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(editIndex) && e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if ( ke->key() == Qt::Key_Up ) {
+ int i = listIndex->currentItem();
+ if ( --i >= 0 ) {
+ listIndex->setCurrentItem( i );
+ editIndex->blockSignals( TRUE );
+ editIndex->setText( listIndex->currentText() );
+ editIndex->blockSignals( FALSE );
+ }
+ return TRUE;
+ } else if ( ke->key() == Qt::Key_Down ) {
+ int i = listIndex->currentItem();
+ if ( ++i < int(listIndex->count()) ) {
+ listIndex->setCurrentItem( i );
+ editIndex->blockSignals( TRUE );
+ editIndex->setText( listIndex->currentText() );
+ editIndex->blockSignals( FALSE );
+ }
+ return TRUE;
+ } else if ( ke->key() == TQt::Key_Next || ke->key() == TQt::Key_Prior ) {
+ TQApplication::sendEvent( listIndex, e);
+ editIndex->blockSignals( TRUE );
+ editIndex->setText( listIndex->currentText() );
+ editIndex->blockSignals( FALSE );
+ }
+ }
+
+ return TQWidget::eventFilter( o, e );
+}
+
+void HelpDialog::addBookmark()
+{
+ if ( !bookmarksInserted )
+ insertBookmarks();
+ TQString link = TQUrl( help->browsers()->currentBrowser()->context(),
+ help->browsers()->currentBrowser()->source() ).path();
+ TQString title = help->browsers()->currentBrowser()->documentTitle();
+ if ( title.isEmpty() )
+ title = titleOfLink( link );
+ HelpNavigationContentsItem *i = new HelpNavigationContentsItem( listBookmarks, 0 );
+ i->setText( 0, title );
+ i->setLink( link );
+ saveBookmarks();
+ help->updateBookmarkMenu();
+}
+
+void HelpDialog::removeBookmark()
+{
+ if ( !listBookmarks->currentItem() )
+ return;
+
+ delete listBookmarks->currentItem();
+ saveBookmarks();
+ if ( listBookmarks->firstChild() ) {
+ listBookmarks->setSelected( listBookmarks->firstChild(), TRUE );
+ }
+ help->updateBookmarkMenu();
+}
+
+void HelpDialog::insertBookmarks()
+{
+ if ( bookmarksInserted )
+ return;
+ bookmarksInserted = TRUE;
+ listBookmarks->clear();
+ TQFile f( cacheFilesPath + "bookmarks." + Config::configuration()->profileName() );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQTextStream ts( &f );
+ while ( !ts.atEnd() ) {
+ HelpNavigationContentsItem *i = new HelpNavigationContentsItem( listBookmarks, 0 );
+ i->setText( 0, ts.readLine() );
+ i->setLink( ts.readLine() );
+ }
+ help->updateBookmarkMenu();
+ showInitDoneMessage();
+}
+
+void HelpDialog::currentBookmarkChanged( TQListViewItem * )
+{
+}
+
+void HelpDialog::showBookmarkTopic()
+{
+ if ( !listBookmarks->currentItem() )
+ return;
+
+ HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)listBookmarks->currentItem();
+ TQString absPath = "";
+ if ( TQFileInfo( i->link() ).isRelative() )
+ absPath = documentationPath + "/";
+ emit showLink( absPath + i->link() );
+}
+
+void HelpDialog::saveBookmarks()
+{
+ TQFile f( cacheFilesPath + "bookmarks." + Config::configuration()->profileName() );
+ if ( !f.open( IO_WriteOnly ) )
+ return;
+ TQTextStream ts( &f );
+ TQListViewItemIterator it( listBookmarks );
+ for ( ; it.current(); ++it ) {
+ HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)it.current();
+ ts << i->text( 0 ) << endl;
+ ts << i->link() << endl;
+ }
+ f.close();
+}
+
+void HelpDialog::insertContents()
+{
+ if ( contentsInserted )
+ return;
+
+ if ( contentList.isEmpty() )
+ getAllContents();
+
+ contentsInserted = TRUE;
+ listContents->clear();
+ setCursor( Qt::WaitCursor );
+ if ( !titleMapDone )
+ setupTitleMap();
+
+ listContents->setSorting( -1 );
+
+ TQDictIterator<ContentList> lstIt( contentList );
+ for ( ; lstIt.current(); ++lstIt ) {
+ HelpNavigationContentsItem *newEntry;
+
+ HelpNavigationContentsItem *contentEntry = 0;
+ TQPtrStack<HelpNavigationContentsItem> stack;
+ stack.clear();
+ int depth = 0;
+ bool root = FALSE;
+
+ HelpNavigationContentsItem *lastItem[64];
+ for( int j = 0; j < 64; ++j )
+ lastItem[j] = 0;
+
+
+ TQValueList<ContentItem> &lst = *(lstIt.current());
+ TQValueListConstIterator<ContentItem> it;
+ for( it = lst.begin(); it != lst.end(); ++it ){
+ ContentItem item = *it;
+ if( item.depth == 0 ){
+ newEntry = new HelpNavigationContentsItem( listContents, 0 );
+ newEntry->setPixmap( 0, TQPixmap::fromMimeSource( "book.png" ) );
+ newEntry->setText( 0, item.title );
+ newEntry->setLink( item.reference );
+ stack.push( newEntry );
+ depth = 1;
+ root = TRUE;
+ }
+ else{
+ if( (item.depth > depth) && root ) {
+ depth = item.depth;
+ stack.push( contentEntry );
+ }
+ if( item.depth == depth ) {
+ contentEntry = new HelpNavigationContentsItem( stack.top(), lastItem[ depth ] );
+ lastItem[ depth ] = contentEntry;
+ contentEntry->setText( 0, item.title );
+ contentEntry->setLink( item.reference );
+ }
+ else if( item.depth < depth ) {
+ stack.pop();
+ depth--;
+ item = *(--it);
+ }
+ }
+ }
+ processEvents();
+ }
+ setCursor( Qt::ArrowCursor );
+ showInitDoneMessage();
+}
+
+void HelpDialog::currentContentsChanged( TQListViewItem * )
+{
+}
+
+void HelpDialog::showContentsTopic()
+{
+ HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)listContents->currentItem();
+ if ( !i )
+ return;
+ emit showLink( i->link() );
+}
+
+void HelpDialog::toggleContents()
+{
+ if ( !isVisible() || tabWidget->currentPageIndex() != 0 ) {
+ tabWidget->setCurrentPage( 0 );
+ parentWidget()->show();
+ }
+ else
+ parentWidget()->hide();
+}
+
+void HelpDialog::toggleIndex()
+{
+ if ( !isVisible() || tabWidget->currentPageIndex() != 1 || !editIndex->hasFocus() ) {
+ tabWidget->setCurrentPage( 1 );
+ parentWidget()->show();
+ editIndex->setFocus();
+ }
+ else
+ parentWidget()->hide();
+}
+
+void HelpDialog::toggleBookmarks()
+{
+ if ( !isVisible() || tabWidget->currentPageIndex() != 2 ) {
+ tabWidget->setCurrentPage( 2 );
+ parentWidget()->show();
+ }
+ else
+ parentWidget()->hide();
+}
+
+void HelpDialog::toggleSearch()
+{
+ if ( !isVisible() || tabWidget->currentPageIndex() != 3 ) {
+ tabWidget->setCurrentPage( 3 );
+ parentWidget()->show();
+ }
+ else
+ parentWidget()->hide();
+}
+
+void HelpDialog::setupFullTextIndex()
+{
+ if ( fullTextIndex )
+ return;
+
+ TQStringList documentList;
+ TQString pname = Config::configuration()->profileName();
+ fullTextIndex = new Index( documentList, TQDir::homeDirPath() ); // ### Is this correct ?
+ if (!verifyDirectory(cacheFilesPath)) {
+ TQMessageBox::warning(help, tr("TQt Assistant"),
+ tr("Failed to save fulltext search index\n"
+ "Assistant will not work!"));
+ return;
+ }
+ searchButton->setEnabled(FALSE);
+ helpButton->setEnabled(FALSE);
+ termsEdit->setEnabled(FALSE);
+
+ fullTextIndex->setDictionaryFile( cacheFilesPath + "indexdb.dict." + pname );
+ fullTextIndex->setDocListFile( cacheFilesPath + "indexdb.doc." + pname );
+ processEvents();
+
+ connect( fullTextIndex, TQT_SIGNAL( indexingProgress( int ) ),
+ this, TQT_SLOT( setIndexingProgress( int ) ) );
+ TQFile f( cacheFilesPath + "indexdb.dict." + pname );
+ if ( !f.exists() ) {
+ TQMap<TQString, TQString>::ConstIterator it = titleMap.begin();
+ TQString documentName;
+ for ( ; it != titleMap.end(); ++it ) {
+ documentName = it.key();
+ int i = documentName.tqfindRev('#');
+ if ( i > -1 )
+ documentName = documentName.left( i );
+
+ if (!documentList.tqcontains(documentName))
+ documentList << documentName;
+ }
+ loadIndexFile();
+ for (TQStringList::Iterator it2 = keywordDocuments.begin(); it2 != keywordDocuments.end(); ++it2) {
+ if (!documentList.tqcontains(*it2))
+ documentList << *it2;
+ }
+ fullTextIndex->setDocList( documentList );
+
+ help->statusBar()->clear();
+ setCursor( Qt::WaitCursor );
+ labelPrepare->setText( tr( "Indexing files..." ) );
+ progressPrepare->setTotalSteps( 100 );
+ progressPrepare->reset();
+ progressPrepare->show();
+ framePrepare->show();
+ processEvents();
+ if ( fullTextIndex->makeIndex() != -1 ) {
+ fullTextIndex->writeDict();
+ progressPrepare->setProgress( 100 );
+ framePrepare->hide();
+ setCursor( Qt::ArrowCursor );
+ showInitDoneMessage();
+ keywordDocuments.clear();
+ }
+ } else {
+ setCursor( Qt::WaitCursor );
+ help->statusBar()->message( tr( "Reading dictionary..." ) );
+ processEvents();
+ fullTextIndex->readDict();
+ help->statusBar()->message( tr( "Done" ), 3000 );
+ setCursor( Qt::ArrowCursor );
+ }
+ searchButton->setEnabled(TRUE);
+ termsEdit->setEnabled(TRUE);
+ helpButton->setEnabled(TRUE);
+}
+
+void HelpDialog::setIndexingProgress( int prog )
+{
+ progressPrepare->setProgress( prog );
+ processEvents();
+}
+
+void HelpDialog::startSearch()
+{
+ TQString str = termsEdit->text();
+ str = str.tqreplace( "\'", "\"" );
+ str = str.tqreplace( "`", "\"" );
+ TQString buf = str;
+ str = str.tqreplace( "-", " " );
+ str = str.tqreplace( TQRegExp( "\\s[\\S]?\\s" ), " " );
+ terms = TQStringList::split( " ", str );
+ TQStringList termSeq;
+ TQStringList seqWords;
+ TQStringList::iterator it = terms.begin();
+ for ( ; it != terms.end(); ++it ) {
+ (*it) = (*it).simplifyWhiteSpace();
+ (*it) = (*it).lower();
+ (*it) = (*it).tqreplace( "\"", "" );
+ }
+ if ( str.tqcontains( '\"' ) ) {
+ if ( (str.tqcontains( '\"' ))%2 == 0 ) {
+ int beg = 0;
+ int end = 0;
+ TQString s;
+ beg = str.tqfind( '\"', beg );
+ while ( beg != -1 ) {
+ beg++;
+ end = str.tqfind( '\"', beg );
+ s = str.mid( beg, end - beg );
+ s = s.lower();
+ s = s.simplifyWhiteSpace();
+ if ( s.tqcontains( '*' ) ) {
+ TQMessageBox::warning( this, tr( "Full Text Search" ),
+ tr( "Using a wildcard within phrases is not allowed." ) );
+ return;
+ }
+ seqWords += TQStringList::split( ' ', s );
+ termSeq << s;
+ beg = str.tqfind( '\"', end + 1);
+ }
+ } else {
+ TQMessageBox::warning( this, tr( "Full Text Search" ),
+ tr( "The closing quotation mark is missing." ) );
+ return;
+ }
+ }
+ setCursor( Qt::WaitCursor );
+ foundDocs.clear();
+ foundDocs = fullTextIndex->query( terms, termSeq, seqWords );
+ TQString msg( TQString( "%1 documents found." ).arg( foundDocs.count() ) );
+ help->statusBar()->message( tr( msg ), 3000 );
+ resultBox->clear();
+ for ( it = foundDocs.begin(); it != foundDocs.end(); ++it )
+ resultBox->insertItem( fullTextIndex->getDocumentTitle( *it ) );
+
+ terms.clear();
+ bool isPhrase = FALSE;
+ TQString s = "";
+ for ( int i = 0; i < (int)buf.length(); ++i ) {
+ if ( buf[i] == '\"' ) {
+ isPhrase = !isPhrase;
+ s = s.simplifyWhiteSpace();
+ if ( !s.isEmpty() )
+ terms << s;
+ s = "";
+ } else if ( buf[i] == ' ' && !isPhrase ) {
+ s = s.simplifyWhiteSpace();
+ if ( !s.isEmpty() )
+ terms << s;
+ s = "";
+ } else
+ s += buf[i];
+ }
+ if ( !s.isEmpty() )
+ terms << s;
+
+ setCursor( Qt::ArrowCursor );
+}
+
+void HelpDialog::showSearchHelp()
+{
+ emit showLink( Config::configuration()->assistantDocPath() + "/assistant-5.html" );
+}
+
+void HelpDialog::showResultPage( int button, TQListBoxItem *i, const TQPoint & )
+{
+ if( button == Qt::LeftButton ) {
+ showResultPage( i );
+ }
+}
+
+void HelpDialog::showResultPage( TQListBoxItem *i )
+{
+ if( !i )
+ return;
+ emit showSearchLink( foundDocs[resultBox->index( i )], terms );
+}
+
+void HelpDialog::showItemMenu( TQListBoxItem *item, const TQPoint &pos )
+{
+ if ( !item )
+ return;
+ int id = itemPopup->exec( pos );
+ if ( id == 0 ) {
+ if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).tqcontains( tr( "Index" ) ) )
+ showTopic();
+ else {
+ showResultPage( item );
+ }
+ } else if ( id > 0 ) {
+ HelpWindow *hw = help->browsers()->currentBrowser();
+ if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).tqcontains( tr( "Index" ) ) ) {
+ editIndex->blockSignals( TRUE );
+ editIndex->setText( item->text() );
+ editIndex->blockSignals( FALSE );
+
+ HelpNavigationListItem *hi = (HelpNavigationListItem*)item;
+
+ TQStringList links = hi->links();
+ if ( links.count() == 1 ) {
+ if ( id == 1 )
+ hw->openLinkInNewWindow( links.first() );
+ else
+ hw->openLinkInNewPage( links.first() );
+ } else {
+ TQStringList::Iterator it = links.begin();
+ TQStringList linkList;
+ TQStringList linkNames;
+ for ( ; it != links.end(); ++it ) {
+ linkList << *it;
+ linkNames << titleOfLink( *it );
+ }
+ TQString link = TopicChooser::getLink( this, linkNames, linkList, item->text() );
+ if ( !link.isEmpty() ) {
+ if ( id == 1 )
+ hw->openLinkInNewWindow( link );
+ else
+ hw->openLinkInNewPage( link );
+ }
+ }
+ } else {
+ TQString link = foundDocs[ resultBox->index( item ) ];
+ if ( id == 1 )
+ hw->openLinkInNewWindow( link );
+ else
+ hw->openLinkInNewPage( link );
+ }
+ }
+}
+
+void HelpDialog::showItemMenu( TQListViewItem *item, const TQPoint &pos )
+{
+ if ( !item )
+ return;
+ int id = itemPopup->exec( pos );
+ if ( id == 0 ) {
+ if ( stripAmpersand( tabWidget->tabLabel( tabWidget->currentPage() ) ).tqcontains( tr( "Contents" ) ) )
+ showContentsTopic();
+ else
+ showBookmarkTopic();
+ } else if ( id > 0 ) {
+ HelpNavigationContentsItem *i = (HelpNavigationContentsItem*)item;
+ if ( id == 1 )
+ help->browsers()->currentBrowser()->openLinkInNewWindow( i->link() );
+ else
+ help->browsers()->currentBrowser()->openLinkInNewPage( i->link() );
+ }
+}
diff --git a/tqtinterface/qt4/tools/assistant/helpdialogimpl.h b/tqtinterface/qt4/tools/assistant/helpdialogimpl.h
new file mode 100644
index 0000000..13b4c51
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/helpdialogimpl.h
@@ -0,0 +1,173 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef HELPDIALOGIMPL_H
+#define HELPDIALOGIMPL_H
+
+#include "helpdialog.h"
+#include "index.h"
+#include "helpwindow.h"
+#include "docuparser.h"
+
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
+#include <tqvalidator.h>
+#include <tqpopupmenu.h>
+#include <tqdict.h>
+#include <tqpopupmenu.h>
+
+class TQProgressBar;
+class MainWindow;
+class TQTextBrowser;
+
+class HelpNavigationListItem : public TQListBoxText
+{
+public:
+ HelpNavigationListItem( TQListBox *ls, const TQString &txt );
+
+ void addLink( const TQString &link );
+ TQStringList links() const { return linkList; }
+private:
+ TQStringList linkList;
+
+};
+
+class SearchValidator : public TQValidator
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ SearchValidator( TQObject *tqparent, const char *name = 0 )
+ : TQValidator( tqparent, name ) {}
+ ~SearchValidator() {}
+ TQValidator::State validate( TQString &str, int & ) const;
+};
+
+class HelpNavigationContentsItem : public TQListViewItem
+{
+public:
+ HelpNavigationContentsItem( TQListView *v, TQListViewItem *after );
+ HelpNavigationContentsItem( TQListViewItem *v, TQListViewItem *after );
+
+ void setLink( const TQString &lnk );
+ TQString link() const;
+
+private:
+ TQString theLink;
+};
+
+class HelpDialog : public HelpDialogBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ HelpDialog( TQWidget *tqparent, MainWindow *h );
+
+ TQString titleOfLink( const TQString &link );
+ bool eventFilter( TQObject *, TQEvent * );
+ bool lastWindowClosed() { return lwClosed; }
+
+ void timerEvent(TQTimerEvent *e);
+
+protected Q_SLOTS:
+ void showTopic( int, TQListBoxItem *, const TQPoint & );
+ void showTopic( int, TQListViewItem *, const TQPoint & );
+ void showTopic( TQListViewItem * );
+ void loadIndexFile();
+ void insertContents();
+ void setupFullTextIndex();
+ void currentTabChanged( const TQString &s );
+ void currentIndexChanged( TQListBoxItem *i );
+ void showTopic();
+ void searchInIndex( const TQString &s );
+ void addBookmark();
+ void removeBookmark();
+ void currentBookmarkChanged( TQListViewItem *i );
+ void currentContentsChanged( TQListViewItem *i );
+ void startSearch();
+ void showSearchHelp();
+
+public Q_SLOTS:
+ void initialize();
+ void toggleContents();
+ void toggleIndex();
+ void toggleBookmarks();
+ void toggleSearch();
+
+
+Q_SIGNALS:
+ void showLink( const TQString &s );
+ void showSearchLink( const TQString &s, const TQStringList &terms );
+
+private Q_SLOTS:
+ void lastWinClosed();
+ void showResultPage( int button, TQListBoxItem *i, const TQPoint &p );
+ void showResultPage( TQListBoxItem *i );
+ void setIndexingProgress( int prog );
+ void showItemMenu( TQListBoxItem *item, const TQPoint &pos );
+ void showItemMenu( TQListViewItem *item, const TQPoint &pos );
+ void insertBookmarks();
+ void processEvents();
+
+private:
+ typedef TQValueList<ContentItem> ContentList;
+ void removeOldCacheFiles();
+ void buildKeywordDB();
+ TQ_UINT32 getFileAges();
+ void showIndexTopic();
+ void showBookmarkTopic();
+ void setupTitleMap();
+ void saveBookmarks();
+ void showContentsTopic();
+ void showInitDoneMessage();
+ void buildContentDict();
+
+ TQMap<TQString, TQString> titleMap;
+ bool indexDone, bookmarksInserted, titleMapDone, contentsInserted;
+ bool lwClosed;
+ MainWindow *help;
+ TQString documentationPath;
+ Index *fullTextIndex;
+ TQStringList terms, foundDocs;
+ bool initDoneMsgShown;
+ void getAllContents();
+ TQDict<ContentList> contentList;
+ TQPopupMenu *itemPopup;
+ TQString cacheFilesPath;
+ TQStringList keywordDocuments;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/assistant/helpwindow.cpp b/tqtinterface/qt4/tools/assistant/helpwindow.cpp
new file mode 100644
index 0000000..7a57028
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/helpwindow.cpp
@@ -0,0 +1,282 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "helpwindow.h"
+#include "mainwindow.h"
+#include "tabbedbrowser.h"
+#include "helpdialogimpl.h"
+#include "config.h"
+
+#include <tqapplication.h>
+#include <tqclipboard.h>
+#include <tqurl.h>
+#include <tqmessagebox.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqprocess.h>
+#include <tqpopupmenu.h>
+#include <tqaction.h>
+#include <tqfileinfo.h>
+#include <tqevent.h>
+#include <tqtextstream.h>
+#include <tqtextcodec.h>
+
+#if defined(TQ_OS_WIN32)
+#include <windows.h>
+#endif
+
+HelpWindow::HelpWindow( MainWindow *w, TQWidget *tqparent, const char *name )
+ : TQTextBrowser( tqparent, name ), mw( w ), blockScroll( FALSE ),
+ shiftPressed( FALSE ), newWindow( FALSE )
+{
+ connect(this, TQT_SIGNAL(forwardAvailable(bool)), this, TQT_SLOT(updateForward(bool)));
+ connect(this, TQT_SIGNAL(backwardAvailable(bool)), this, TQT_SLOT(updateBackward(bool)));
+}
+
+void HelpWindow::setSource( const TQString &name )
+{
+ if ( name.isEmpty() )
+ return;
+
+ if (newWindow || shiftPressed) {
+ removeSelection();
+ mw->saveSettings();
+ mw->saveToolbarSettings();
+ MainWindow *nmw = new MainWindow;
+
+ TQFileInfo currentInfo( source() );
+ TQFileInfo linkInfo( name );
+ TQString target = name;
+ if( linkInfo.isRelative() )
+ target = currentInfo.dirPath( TRUE ) + "/" + name;
+
+ nmw->setup();
+ nmw->move( mw->tqgeometry().topLeft() );
+ if ( mw->isMaximized() )
+ nmw->showMaximized();
+ else
+ nmw->show();
+ nmw->showLink( target );
+ return;
+ }
+
+ if ( name.left( 7 ) == "http://" || name.left( 6 ) == "ftp://" ) {
+ TQString webbrowser = Config::configuration()->webBrowser();
+ if ( webbrowser.isEmpty() ) {
+#if defined(TQ_OS_WIN32)
+ TQT_WA( {
+ ShellExecute( winId(), 0, (TCHAR*)name.ucs2(), 0, 0, SW_SHOWNORMAL );
+ } , {
+ ShellExecuteA( winId(), 0, name.local8Bit(), 0, 0, SW_SHOWNORMAL );
+ } );
+#elif defined(TQ_OS_MACX)
+ webbrowser = "/usr/bin/open";
+#else
+ int result = TQMessageBox::information( mw, tr( "Help" ),
+ tr( "Currently no Web browser is selected.\nPlease use the settings dialog to specify one!\n" ),
+ "Open", "Cancel" );
+ if ( result == 0 ) {
+ emit chooseWebBrowser();
+ webbrowser = Config::configuration()->webBrowser();
+ }
+#endif
+ if ( webbrowser.isEmpty() )
+ return;
+ }
+ TQProcess *proc = new TQProcess(TQT_TQOBJECT(this));
+
+ proc->addArgument( webbrowser );
+ TQObject::connect(proc, TQT_SIGNAL(processExited()), proc, TQT_SLOT(deleteLater()));
+ proc->addArgument( name );
+ proc->start();
+ return;
+ }
+
+ if ( name.right( 3 ) == "pdf" ) {
+ TQString pdfbrowser = Config::configuration()->pdfReader();
+ if ( pdfbrowser.isEmpty() ) {
+#if defined(TQ_OS_MACX)
+ pdfbrowser = "/usr/bin/open";
+#else
+ TQMessageBox::information( mw,
+ tr( "Help" ),
+ tr( "No PDF Viewer has been specified\n"
+ "Please use the settings dialog to specify one!\n" ) );
+ return;
+#endif
+ }
+ TQFileInfo info( pdfbrowser );
+ if( !info.exists() ) {
+ TQMessageBox::information( mw,
+ tr( "Help" ),
+ tr( "TQt Assistant is unable to start the PDF Viewer\n\n"
+ "%1\n\n"
+ "Please make sure that the executable exists and is located at\n"
+ "the specified location." ).arg( pdfbrowser ) );
+ return;
+ }
+ TQProcess *proc = new TQProcess(TQT_TQOBJECT(this));
+ TQObject::connect(proc, TQT_SIGNAL(processExited()), proc, TQT_SLOT(deleteLater()));
+ proc->addArgument( pdfbrowser );
+ proc->addArgument( name );
+ proc->start();
+
+ return;
+ }
+
+ TQUrl u( context(), name );
+ if ( !u.isLocalFile() ) {
+ TQMessageBox::information( mw, tr( "Help" ), tr( "Can't load and display non-local file\n"
+ "%1" ).arg( name ) );
+ return;
+ }
+
+ setText("<body bgcolor=\"" + paletteBackgroundColor().name() + "\">");
+ TQTextBrowser::setSource( name );
+}
+
+
+void HelpWindow::openLinkInNewWindow()
+{
+ if ( lastAnchor.isEmpty() )
+ return;
+ newWindow = TRUE;
+ setSource(lastAnchor);
+ newWindow = FALSE;
+}
+
+void HelpWindow::openLinkInNewWindow( const TQString &link )
+{
+ lastAnchor = link;
+ openLinkInNewWindow();
+}
+
+void HelpWindow::openLinkInNewPage()
+{
+ if( lastAnchor.isEmpty() )
+ return;
+ mw->browsers()->newTab( lastAnchor );
+ lastAnchor = TQString();
+}
+
+void HelpWindow::openLinkInNewPage( const TQString &link )
+{
+ lastAnchor = link;
+ openLinkInNewPage();
+}
+
+TQPopupMenu *HelpWindow::createPopupMenu( const TQPoint& pos )
+{
+ TQPopupMenu *m = new TQPopupMenu(0);
+ lastAnchor = anchorAt( pos );
+ if ( !lastAnchor.isEmpty() ) {
+ if ( lastAnchor.at( 0 ) == '#' ) {
+ TQString src = source();
+ int hsh = src.tqfind( '#' );
+ lastAnchor = ( hsh>=0 ? src.left( hsh ) : src ) + lastAnchor;
+ }
+ m->insertItem( tr("Open Link in New Window\tShift+LMB"),
+ this, TQT_SLOT( openLinkInNewWindow() ) );
+ m->insertItem( tr("Open Link in New Tab"),
+ this, TQT_SLOT( openLinkInNewPage() ) );
+ }
+ mw->actionNewWindow->addTo( m );
+ mw->actionOpenPage->addTo( m );
+ mw->actionClosePage->addTo( m );
+ m->insertSeparator();
+ mw->actionGoPrevious->addTo( m );
+ mw->actionGoNext->addTo( m );
+ mw->actionGoHome->addTo( m );
+ m->insertSeparator();
+ mw->actionZoomIn->addTo( m );
+ mw->actionZoomOut->addTo( m );
+ m->insertSeparator();
+ mw->actionEditCopy->addTo( m );
+ mw->actionEditFind->addTo( m );
+ return m;
+}
+
+void HelpWindow::blockScrolling( bool b )
+{
+ blockScroll = b;
+}
+
+void HelpWindow::ensureCursorVisible()
+{
+ if ( !blockScroll )
+ TQTextBrowser::ensureCursorVisible();
+}
+
+void HelpWindow::contentsMousePressEvent(TQMouseEvent *e)
+{
+ shiftPressed = ( e->state() & ShiftButton );
+ TQTextBrowser::contentsMousePressEvent(e);
+}
+
+void HelpWindow::keyPressEvent(TQKeyEvent *e)
+{
+ shiftPressed = ( e->state() & ShiftButton );
+ TQTextBrowser::keyPressEvent(e);
+}
+
+void HelpWindow::copy()
+{
+ if (textFormat() == TQt::PlainText) {
+ TQTextEdit::copy();
+ } else {
+ TQt::TextFormat oldTf = textFormat();
+ setTextFormat(TQt::PlainText);
+ TQString selectText = selectedText();
+ selectText.tqreplace("<br>", "\n");
+ selectText.tqreplace("\xa0", " ");
+ selectText.tqreplace("&gt;", ">");
+ selectText.tqreplace("&lt;", "<");
+ selectText.tqreplace("&amp;", "&");
+
+ TQClipboard *cb = TQApplication::tqclipboard();
+ if (cb->supportsSelection())
+ cb->setText(selectText, TQClipboard::Selection);
+ cb->setText(selectText, TQClipboard::Clipboard);
+ setTextFormat(oldTf);
+ }
+}
+
+void HelpWindow::updateForward(bool fwd)
+{
+ fwdAvail = fwd;
+}
+
+void HelpWindow::updateBackward(bool back)
+{
+ backAvail = back;
+}
diff --git a/tqtinterface/qt4/tools/assistant/helpwindow.h b/tqtinterface/qt4/tools/assistant/helpwindow.h
new file mode 100644
index 0000000..a00774f
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/helpwindow.h
@@ -0,0 +1,88 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef HELPWINDOW_H
+#define HELPWINDOW_H
+
+#include <tqtextbrowser.h>
+
+class MainWindow;
+class TQKeyEvent;
+class TQMime;
+class TQMouseEvent;
+
+class HelpWindow : public TQTextBrowser
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ HelpWindow( MainWindow *m, TQWidget *tqparent = 0, const char *name = 0 );
+ void setSource( const TQString &name );
+ TQPopupMenu *createPopupMenu( const TQPoint& pos );
+ void blockScrolling( bool b );
+ void openLinkInNewWindow( const TQString &link );
+ void openLinkInNewPage( const TQString &link );
+ void addMimePath( const TQString &path );
+
+ void contentsMousePressEvent(TQMouseEvent *e);
+ void keyPressEvent(TQKeyEvent *);
+
+ bool isBackwardAvailable() const { return backAvail; }
+ bool isForwardAvailable() const { return fwdAvail; }
+
+Q_SIGNALS:
+ void chooseWebBrowser();
+
+public Q_SLOTS:
+ void copy();
+protected Q_SLOTS:
+ void ensureCursorVisible();
+
+private Q_SLOTS:
+ void openLinkInNewWindow();
+ void openLinkInNewPage();
+ void updateForward(bool);
+ void updateBackward(bool);
+
+private:
+ MainWindow *mw;
+ TQString lastAnchor;
+ bool blockScroll;
+ bool shiftPressed;
+ bool newWindow;
+ TQMimeSourceFactory *mimeSourceFactory;
+ bool fwdAvail;
+ bool backAvail;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/assistant/images/addtab.png b/tqtinterface/qt4/tools/assistant/images/addtab.png
new file mode 100644
index 0000000..a88697f
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/addtab.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/appicon.png b/tqtinterface/qt4/tools/assistant/images/appicon.png
new file mode 100644
index 0000000..a50dc9c
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/appicon.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/assistant.png b/tqtinterface/qt4/tools/assistant/images/assistant.png
new file mode 100644
index 0000000..461b883
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/assistant.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/book.png b/tqtinterface/qt4/tools/assistant/images/book.png
new file mode 100644
index 0000000..ede2b97
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/book.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/closetab.png b/tqtinterface/qt4/tools/assistant/images/closetab.png
new file mode 100644
index 0000000..61ac034
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/closetab.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/d_closetab.png b/tqtinterface/qt4/tools/assistant/images/d_closetab.png
new file mode 100644
index 0000000..f2ac158
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/d_closetab.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/designer.png b/tqtinterface/qt4/tools/assistant/images/designer.png
new file mode 100644
index 0000000..d808332
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/designer.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/editcopy.png b/tqtinterface/qt4/tools/assistant/images/editcopy.png
new file mode 100644
index 0000000..804c98c
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/find.png b/tqtinterface/qt4/tools/assistant/images/find.png
new file mode 100644
index 0000000..8d73ab0
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/find.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/home.png b/tqtinterface/qt4/tools/assistant/images/home.png
new file mode 100644
index 0000000..aa150a3
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/home.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/linguist.png b/tqtinterface/qt4/tools/assistant/images/linguist.png
new file mode 100644
index 0000000..1021804
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/linguist.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/next.png b/tqtinterface/qt4/tools/assistant/images/next.png
new file mode 100644
index 0000000..4b29ff4
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/next.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/previous.png b/tqtinterface/qt4/tools/assistant/images/previous.png
new file mode 100644
index 0000000..4e3556c
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/previous.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/print.png b/tqtinterface/qt4/tools/assistant/images/print.png
new file mode 100644
index 0000000..cc083ed
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/print.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/qt.png b/tqtinterface/qt4/tools/assistant/images/qt.png
new file mode 100644
index 0000000..29a1fa8
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/qt.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/splash.png b/tqtinterface/qt4/tools/assistant/images/splash.png
new file mode 100644
index 0000000..e121aa1
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/splash.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/whatsthis.xpm b/tqtinterface/qt4/tools/assistant/images/whatsthis.xpm
new file mode 100644
index 0000000..799b599
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/whatsthis.xpm
@@ -0,0 +1,26 @@
+/* XPM */
+static char *whatsthis[] = {
+/* width height ncolors chars_per_pixel */
+"16 16 3 1",
+/* colors */
+"# c None",
+". c #000000",
+"a c #000083",
+/* pixels */
+".########aaaaa##",
+"..######aaa#aaa#",
+"...####aaa###aaa",
+"....###aa#####aa",
+".....##aa#####aa",
+"......##a####aaa",
+".......#####aaa#",
+"........###aaa##",
+".........#aaa###",
+".....#####aaa###",
+"..#...##########",
+".##...####aaa###",
+"####...###aaa###",
+"####...#########",
+"#####...########",
+"#####...########"
+};
diff --git a/tqtinterface/qt4/tools/assistant/images/zoomin.png b/tqtinterface/qt4/tools/assistant/images/zoomin.png
new file mode 100644
index 0000000..667f2d6
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/zoomin.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/images/zoomout.png b/tqtinterface/qt4/tools/assistant/images/zoomout.png
new file mode 100644
index 0000000..8755f4c
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/images/zoomout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/assistant/index.cpp b/tqtinterface/qt4/tools/assistant/index.cpp
new file mode 100644
index 0000000..41e582f
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/index.cpp
@@ -0,0 +1,526 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "index.h"
+
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqstringlist.h>
+#include <tqdict.h>
+#include <tqapplication.h>
+
+#include <ctype.h>
+
+int TermList::compareItems( TQPtrCollection::Item i1, TQPtrCollection::Item i2 )
+{
+ if( ( (Term*)i1 )->frequency == ( (Term*)i2 )->frequency )
+ return 0;
+ if( ( (Term*)i1 )->frequency < ( (Term*)i2 )->frequency )
+ return -1;
+ return 1;
+}
+
+TQDataStream &operator>>( TQDataStream &s, Document &l )
+{
+ s >> l.docNumber;
+ s >> l.frequency;
+ return s;
+}
+
+TQDataStream &operator<<( TQDataStream &s, const Document &l )
+{
+ s << (TQ_INT16)l.docNumber;
+ s << (TQ_INT16)l.frequency;
+ return s;
+}
+
+Index::Index( const TQString &dp, const TQString &hp )
+ : TQObject( 0, 0 ), dict( 8999 ), docPath( dp )
+{
+ alreadyHaveDocList = FALSE;
+ lastWindowClosed = FALSE;
+ connect( tqApp, TQT_SIGNAL( lastWindowClosed() ),
+ this, TQT_SLOT( setLastWinClosed() ) );
+}
+
+Index::Index( const TQStringList &dl, const TQString &hp )
+ : TQObject( 0, 0 ), dict( 8999 )
+{
+ docList = dl;
+ alreadyHaveDocList = TRUE;
+ lastWindowClosed = FALSE;
+ connect( tqApp, TQT_SIGNAL( lastWindowClosed() ),
+ this, TQT_SLOT( setLastWinClosed() ) );
+}
+
+void Index::setLastWinClosed()
+{
+ lastWindowClosed = TRUE;
+}
+
+void Index::setDictionaryFile( const TQString &f )
+{
+ dictFile = f;
+}
+
+void Index::setDocListFile( const TQString &f )
+{
+ docListFile = f;
+}
+
+void Index::setDocList( const TQStringList &lst )
+{
+ docList = lst;
+}
+
+int Index::makeIndex()
+{
+ if ( !alreadyHaveDocList )
+ setupDocumentList();
+ if ( docList.isEmpty() )
+ return 1;
+ TQStringList::Iterator it = docList.begin();
+ int steps = docList.count() / 100;
+ if ( !steps )
+ steps++;
+ int prog = 0;
+ for ( int i = 0; it != docList.end(); ++it, ++i ) {
+ if ( lastWindowClosed ) {
+ return -1;
+ }
+ parseDocument( *it, i );
+ if ( i%steps == 0 ) {
+ prog++;
+ emit indexingProgress( prog );
+ }
+ }
+ return 0;
+}
+
+void Index::setupDocumentList()
+{
+ TQDir d( docPath );
+ TQStringList lst = d.entryList( "*.html" );
+ TQStringList::ConstIterator it = lst.begin();
+ for ( ; it != lst.end(); ++it )
+ docList.append( docPath + "/" + *it );
+}
+
+void Index::insertInDict( const TQString &str, int docNum )
+{
+ if ( strcmp( str, "amp" ) == 0 || strcmp( str, "nbsp" ) == 0 )
+ return;
+ Entry *e = 0;
+ if ( dict.count() )
+ e = dict[ str ];
+
+ if ( e ) {
+ if ( e->documents.first().docNumber != docNum )
+ e->documents.prepend( Document( docNum, 1 ) );
+ else
+ e->documents.first().frequency++;
+ } else {
+ dict.insert( str, new Entry( docNum ) );
+ }
+}
+
+void Index::parseDocument( const TQString &filename, int docNum )
+{
+ TQFile file( filename );
+ if ( !file.open( IO_ReadOnly ) ) {
+ qWarning( "can not open file " + filename );
+ return;
+ }
+
+ TQTextStream s( &file );
+ TQString text = s.read();
+ if (text.isNull())
+ return;
+
+ bool valid = TRUE;
+ const TQChar *buf = text.tqunicode();
+ TQChar str[64];
+ TQChar c = buf[0];
+ int j = 0;
+ int i = 0;
+ while ( (uint)j < text.length() ) {
+ if ( c == '<' || c == '&' ) {
+ valid = FALSE;
+ if ( i > 1 )
+ insertInDict( TQString(str,i), docNum );
+ i = 0;
+ c = buf[++j];
+ continue;
+ }
+ if ( ( c == '>' || c == ';' ) && !valid ) {
+ valid = TRUE;
+ c = buf[++j];
+ continue;
+ }
+ if ( !valid ) {
+ c = buf[++j];
+ continue;
+ }
+ if ( ( c.isLetterOrNumber() || c == '_' ) && i < 63 ) {
+ str[i] = c.lower();
+ ++i;
+ } else {
+ if ( i > 1 )
+ insertInDict( TQString(str,i), docNum );
+ i = 0;
+ }
+ c = buf[++j];
+ }
+ if ( i > 1 )
+ insertInDict( TQString(str,i), docNum );
+ file.close();
+}
+
+void Index::writeDict()
+{
+ TQDictIterator<Entry> it( dict );
+ TQFile f( dictFile );
+ if ( !f.open( IO_WriteOnly ) )
+ return;
+ TQDataStream s( &f );
+ for( ; it.current(); ++it ) {
+ Entry *e = it.current();
+ s << it.currentKey();
+ s << e->documents;
+ }
+ f.close();
+ writeDocumentList();
+}
+
+void Index::writeDocumentList()
+{
+ TQFile f( docListFile );
+ if ( !f.open( IO_WriteOnly ) )
+ return;
+ TQDataStream s( &f );
+ s << docList;
+}
+
+void Index::readDict()
+{
+ TQFile f( dictFile );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+
+ dict.clear();
+ TQDataStream s( &f );
+ TQString key;
+ TQValueList<Document> docs;
+ while ( !s.atEnd() ) {
+ s >> key;
+ s >> docs;
+ dict.insert( key, new Entry( docs ) );
+ }
+ f.close();
+ readDocumentList();
+}
+
+void Index::readDocumentList()
+{
+ TQFile f( docListFile );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQDataStream s( &f );
+ s >> docList;
+}
+
+TQStringList Index::query( const TQStringList &terms, const TQStringList &termSeq, const TQStringList &seqWords )
+{
+ TermList termList;
+
+ TQStringList::ConstIterator it = terms.begin();
+ for ( it = terms.begin(); it != terms.end(); ++it ) {
+ Entry *e = 0;
+ if ( (*it).tqcontains( '*' ) ) {
+ TQValueList<Document> wcts = setupDummyTerm( getWildcardTerms( *it ) );
+ termList.append( new Term( "dummy", wcts.count(), wcts ) );
+ } else if ( dict[ *it ] ) {
+ e = dict[ *it ];
+ termList.append( new Term( *it, e->documents.count(), e->documents ) );
+ } else {
+ return TQStringList();
+ }
+ }
+ termList.sort();
+
+ Term *minTerm = termList.first();
+ if ( !termList.count() )
+ return TQStringList();
+ termList.removeFirst();
+
+ TQValueList<Document> minDocs = minTerm->documents;
+ TQValueList<Document>::iterator C;
+ TQValueList<Document>::ConstIterator It;
+ Term *t = termList.first();
+ for ( ; t; t = termList.next() ) {
+ TQValueList<Document> docs = t->documents;
+ C = minDocs.begin();
+ while ( C != minDocs.end() ) {
+ bool found = FALSE;
+ for ( It = docs.begin(); It != docs.end(); ++It ) {
+ if ( (*C).docNumber == (*It).docNumber ) {
+ (*C).frequency += (*It).frequency;
+ found = TRUE;
+ break;
+ }
+ }
+ if ( !found )
+ C = minDocs.remove( C );
+ else
+ ++C;
+ }
+ }
+
+ TQStringList results;
+ qHeapSort( minDocs );
+ if ( termSeq.isEmpty() ) {
+ for ( C = minDocs.begin(); C != minDocs.end(); ++C )
+ results << docList[ (int)(*C).docNumber ];
+ return results;
+ }
+
+ TQString fileName;
+ for ( C = minDocs.begin(); C != minDocs.end(); ++C ) {
+ fileName = docList[ (int)(*C).docNumber ];
+ if ( searchForPattern( termSeq, seqWords, fileName ) )
+ results << fileName;
+ }
+ return results;
+}
+
+TQString Index::getDocumentTitle( const TQString &fileName )
+{
+ TQFile file( fileName );
+ if ( !file.open( IO_ReadOnly ) ) {
+ qWarning( "cannot open file " + fileName );
+ return fileName;
+ }
+ TQTextStream s( &file );
+ TQString text = s.read();
+
+ int start = text.tqfind( "<title>", 0, FALSE ) + 7;
+ int end = text.tqfind( "</title>", 0, FALSE );
+
+ TQString title = ( end - start <= 0 ? tr("Untitled") : text.mid( start, end - start ) );
+ return title;
+}
+
+TQStringList Index::getWildcardTerms( const TQString &term )
+{
+ TQStringList lst;
+ TQStringList terms = split( term );
+ TQValueList<TQString>::iterator iter;
+
+ TQDictIterator<Entry> it( dict );
+ for( ; it.current(); ++it ) {
+ int index = 0;
+ bool found = FALSE;
+ TQString text( it.currentKey() );
+ for ( iter = terms.begin(); iter != terms.end(); ++iter ) {
+ if ( *iter == "*" ) {
+ found = TRUE;
+ continue;
+ }
+ if ( iter == terms.begin() && (*iter)[0] != text[0] ) {
+ found = FALSE;
+ break;
+ }
+ index = text.tqfind( *iter, index );
+ if ( *iter == terms.last() && index != (int)text.length()-1 ) {
+ index = text.tqfindRev( *iter );
+ if ( index != (int)text.length() - (int)(*iter).length() ) {
+ found = FALSE;
+ break;
+ }
+ }
+ if ( index != -1 ) {
+ found = TRUE;
+ index += (*iter).length();
+ continue;
+ } else {
+ found = FALSE;
+ break;
+ }
+ }
+ if ( found )
+ lst << text;
+ }
+
+ return lst;
+}
+
+TQStringList Index::split( const TQString &str )
+{
+ TQStringList lst;
+ int j = 0;
+ int i = str.tqfind( '*', j );
+
+ while ( i != -1 ) {
+ if ( i > j && i <= (int)str.length() ) {
+ lst << str.mid( j, i - j );
+ lst << "*";
+ }
+ j = i + 1;
+ i = str.tqfind( '*', j );
+ }
+
+ int l = str.length() - 1;
+ if ( str.mid( j, l - j + 1 ).length() > 0 )
+ lst << str.mid( j, l - j + 1 );
+
+ return lst;
+}
+
+TQValueList<Document> Index::setupDummyTerm( const TQStringList &terms )
+{
+ TermList termList;
+ TQStringList::ConstIterator it = terms.begin();
+ for ( ; it != terms.end(); ++it ) {
+ Entry *e = 0;
+ if ( dict[ *it ] ) {
+ e = dict[ *it ];
+ termList.append( new Term( *it, e->documents.count(), e->documents ) );
+ }
+ }
+ termList.sort();
+
+ TQValueList<Document> maxList;
+
+ if ( !termList.count() )
+ return maxList;
+ maxList = termList.last()->documents;
+ termList.removeLast();
+
+ TQValueList<Document>::iterator docIt;
+ Term *t = termList.first();
+ while ( t ) {
+ TQValueList<Document> docs = t->documents;
+ for ( docIt = docs.begin(); docIt != docs.end(); ++docIt ) {
+ if ( maxList.tqfindIndex( *docIt ) == -1 )
+ maxList.append( *docIt );
+ }
+ t = termList.next();
+ }
+ return maxList;
+}
+
+void Index::buildMiniDict( const TQString &str )
+{
+ if ( miniDict[ str ] )
+ miniDict[ str ]->positions.append( wordNum );
+ ++wordNum;
+}
+
+bool Index::searchForPattern( const TQStringList &patterns, const TQStringList &words, const TQString &fileName )
+{
+ TQFile file( fileName );
+ if ( !file.open( IO_ReadOnly ) ) {
+ qWarning( "cannot open file " + fileName );
+ return FALSE;
+ }
+
+ wordNum = 3;
+ miniDict.clear();
+ TQStringList::ConstIterator cIt = words.begin();
+ for ( ; cIt != words.end(); ++cIt )
+ miniDict.insert( *cIt, new PosEntry( 0 ) );
+
+ TQTextStream s( &file );
+ TQString text = s.read();
+ bool valid = TRUE;
+ const TQChar *buf = text.tqunicode();
+ TQChar str[64];
+ TQChar c = buf[0];
+ int j = 0;
+ int i = 0;
+ while ( (uint)j < text.length() ) {
+ if ( c == '<' || c == '&' ) {
+ valid = FALSE;
+ if ( i > 1 )
+ buildMiniDict( TQString(str,i) );
+ i = 0;
+ c = buf[++j];
+ continue;
+ }
+ if ( ( c == '>' || c == ';' ) && !valid ) {
+ valid = TRUE;
+ c = buf[++j];
+ continue;
+ }
+ if ( !valid ) {
+ c = buf[++j];
+ continue;
+ }
+ if ( ( c.isLetterOrNumber() || c == '_' ) && i < 63 ) {
+ str[i] = c.lower();
+ ++i;
+ } else {
+ if ( i > 1 )
+ buildMiniDict( TQString(str,i) );
+ i = 0;
+ }
+ c = buf[++j];
+ }
+ if ( i > 1 )
+ buildMiniDict( TQString(str,i) );
+ file.close();
+
+ TQStringList::ConstIterator patIt = patterns.begin();
+ TQStringList wordLst;
+ TQValueList<uint> a, b;
+ TQValueList<uint>::iterator aIt;
+ for ( ; patIt != patterns.end(); ++patIt ) {
+ wordLst = TQStringList::split( ' ', *patIt );
+ a = miniDict[ wordLst[0] ]->positions;
+ for ( int j = 1; j < (int)wordLst.count(); ++j ) {
+ b = miniDict[ wordLst[j] ]->positions;
+ aIt = a.begin();
+ while ( aIt != a.end() ) {
+ if ( b.tqfind( *aIt + 1 ) != b.end() ) {
+ (*aIt)++;
+ ++aIt;
+ } else {
+ aIt = a.remove( aIt );
+ }
+ }
+ }
+ }
+ if ( a.count() )
+ return TRUE;
+ return FALSE;
+}
diff --git a/tqtinterface/qt4/tools/assistant/index.h b/tqtinterface/qt4/tools/assistant/index.h
new file mode 100644
index 0000000..8526ba0
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/index.h
@@ -0,0 +1,132 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef INDEX_H
+#define INDEX_H
+
+#include <tqstringlist.h>
+#include <tqdict.h>
+#include <tqdatastream.h>
+#include <tqobject.h>
+
+struct Document {
+ Document( int d, int f ) : docNumber( d ), frequency( f ) {}
+ Document() : docNumber( -1 ), frequency( 0 ) {}
+ bool operator==( const Document &doc ) const {
+ return docNumber == doc.docNumber;
+ }
+ bool operator<( const Document &doc ) const {
+ return frequency > doc.frequency;
+ }
+ bool operator<=( const Document &doc ) const {
+ return frequency >= doc.frequency;
+ }
+ bool operator>( const Document &doc ) const {
+ return frequency < doc.frequency;
+ }
+ TQ_INT16 docNumber;
+ TQ_INT16 frequency;
+};
+
+TQDataStream &operator>>( TQDataStream &s, Document &l );
+TQDataStream &operator<<( TQDataStream &s, const Document &l );
+
+class Index : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ struct Entry {
+ Entry( int d ) { documents.append( Document( d, 1 ) ); }
+ Entry( TQValueList<Document> l ) : documents( l ) {}
+ TQValueList<Document> documents;
+ };
+ struct PosEntry {
+ PosEntry( int p ) { positions.append( p ); }
+ TQValueList<uint> positions;
+ };
+
+ Index( const TQString &dp, const TQString &hp );
+ Index( const TQStringList &dl, const TQString &hp );
+ void writeDict();
+ void readDict();
+ int makeIndex();
+ TQStringList query( const TQStringList&, const TQStringList&, const TQStringList& );
+ TQString getDocumentTitle( const TQString& );
+ void setDictionaryFile( const TQString& );
+ void setDocListFile( const TQString& );
+ void setDocList( const TQStringList & );
+
+Q_SIGNALS:
+ void indexingProgress( int );
+
+private Q_SLOTS:
+ void setLastWinClosed();
+
+private:
+ void setupDocumentList();
+ void parseDocument( const TQString&, int );
+ void insertInDict( const TQString&, int );
+ void writeDocumentList();
+ void readDocumentList();
+ TQStringList getWildcardTerms( const TQString& );
+ TQStringList split( const TQString& );
+ TQValueList<Document> setupDummyTerm( const TQStringList& );
+ bool searchForPattern( const TQStringList&, const TQStringList&, const TQString& );
+ void buildMiniDict( const TQString& );
+ TQStringList docList;
+ TQDict<Entry> dict;
+ TQDict<PosEntry> miniDict;
+ uint wordNum;
+ TQString docPath;
+ TQString dictFile, docListFile;
+ bool alreadyHaveDocList;
+ bool lastWindowClosed;
+};
+
+struct Term {
+ Term( const TQString &t, int f, TQValueList<Document> l )
+ : term( t ), frequency( f ), documents( l ) {}
+ TQString term;
+ int frequency;
+ TQValueList<Document>documents;
+};
+
+class TermList : public TQPtrList<Term>
+{
+public:
+ TermList() : TQPtrList<Term>() {}
+ int compareItems( TQPtrCollection::Item i1, TQPtrCollection::Item i2 );
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/assistant/lib/lib.pro b/tqtinterface/qt4/tools/assistant/lib/lib.pro
new file mode 100644
index 0000000..d0a5d18
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/lib/lib.pro
@@ -0,0 +1,23 @@
+TEMPLATE = lib
+TARGET = tqassistantclient
+VERSION = 1.0
+
+CONFIG += qt warn_on release
+CONFIG += staticlib
+CONFIG -= dll
+
+SOURCES = tqassistantclient.cpp
+HEADERS += $$QT_SOURCE_TREE/include/tqassistantclient.h
+
+
+DEFINES += QT_INTERNAL_NETWORK
+include( ../../../src/qt_professional.pri )
+
+DESTDIR = ../../../lib
+
+unix {
+ target.path=$$libs.path
+ QMAKE_CFLAGS += $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SHLIB
+ INSTALLS += target
+}
diff --git a/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp b/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp
new file mode 100644
index 0000000..4478642
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.cpp
@@ -0,0 +1,334 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQAssistantClient library.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqassistantclient.h"
+
+#include <tqsocket.h>
+#include <tqtextstream.h>
+#include <tqprocess.h>
+#include <tqtimer.h>
+#include <tqfileinfo.h>
+
+class TQAssistantClientPrivate
+{
+ friend class TQAssistantClient;
+ TQStringList arguments;
+};
+
+static TQMap<const TQAssistantClient*,TQAssistantClientPrivate*> *dpointers = 0;
+
+static TQAssistantClientPrivate *data( const TQAssistantClient *client, bool create=FALSE )
+{
+ if( !dpointers )
+ dpointers = new TQMap<const TQAssistantClient*,TQAssistantClientPrivate*>;
+ TQAssistantClientPrivate *d = (*dpointers)[client];
+ if( !d && create ) {
+ d = new TQAssistantClientPrivate;
+ dpointers->insert( client, d );
+ }
+ return d;
+}
+
+/*!
+ \class TQAssistantClient
+ \brief The TQAssistantClient class provides a means of using TQt
+ Assistant as an application's help tool.
+
+ Using TQt Assistant is simple: Create a TQAssistantClient instance,
+ then call showPage() as often as necessary to show your help
+ pages. When you call showPage(), TQt Assistant will be launched if
+ it isn't already running.
+
+ The TQAssistantClient instance can open (openAssistant()) or close
+ (closeAssistant()) TQt Assistant whenever required. If TQt Assistant
+ is open, isOpen() returns TRUE.
+
+ One TQAssistantClient instance interacts with one TQt Assistant
+ instance, so every time you call openAssistant(), showPage() or
+ closeAssistant() they are applied to the particular TQt Assistant
+ instance associated with the TQAssistantClient.
+
+ When you call openAssistant() the assistantOpened() signal is
+ emitted. Similarly when closeAssistant() is called,
+ assistantClosed() is emitted. In either case, if an error occurs,
+ error() is emitted.
+
+ This class is not included in the TQt library itself. To use it you
+ must link against \c libqassistantclient.a (Unix) or \c
+ qassistantclient.lib (Windows), which is built into \c INSTALL/lib
+ if you built the TQt tools (\c INSTALL is the directory where TQt is
+ installed). If you use qmake, then you can simply add the following
+ line to your pro file:
+
+ \code
+ LIBS += -lqassistantclient
+ \endcode
+
+ See also "Adding Documentation to TQt Assistant" in the \link
+ assistant.book TQt Assistant manual\endlink.
+*/
+
+/*!
+ \fn void TQAssistantClient::assistantOpened()
+
+ This signal is emitted when TQt Assistant is open and the
+ client-server communication is set up.
+*/
+
+/*!
+ \fn void TQAssistantClient::assistantClosed()
+
+ This signal is emitted when the connection to TQt Assistant is
+ closed. This happens when the user exits TQt Assistant, or when an
+ error in the server or client occurs, or if closeAssistant() is
+ called.
+*/
+
+/*!
+ \fn void TQAssistantClient::error( const TQString &msg )
+
+ This signal is emitted if TQt Assistant cannot be started or if an
+ error occurs during the initialization of the connection between
+ TQt Assistant and the calling application. The \a msg provides an
+ explanation of the error.
+*/
+
+/*!
+ Constructs an assistant client object. The \a path specifies the
+ path to the TQt Assistant executable. If \a path is an empty
+ string the system path (\c{%PATH%} or \c $PATH) is used.
+
+ The assistant client object is a child of \a tqparent and is called
+ \a name.
+*/
+TQAssistantClient::TQAssistantClient( const TQString &path, TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ), host ( "localhost" )
+{
+ if ( path.isEmpty() )
+ assistantCommand = "assistant";
+ else {
+ TQFileInfo fi( path );
+ if ( fi.isDir() )
+ assistantCommand = path + "/assistant";
+ else
+ assistantCommand = path;
+ }
+
+#if defined(TQ_OS_MACX)
+ assistantCommand += ".app/Contents/MacOS/assistant";
+#elif defined(TQ_WS_WIN)
+ if (!assistantCommand.endsWith(".exe"))
+ assistantCommand += ".exe";
+#endif
+ socket = new TQSocket( this );
+ connect( socket, TQT_SIGNAL( connected() ),
+ TQT_SLOT( socketConnected() ) );
+ connect( socket, TQT_SIGNAL( connectionClosed() ),
+ TQT_SLOT( socketConnectionClosed() ) );
+ connect( socket, TQT_SIGNAL( error( int ) ),
+ TQT_SLOT( socketError( int ) ) );
+ opened = FALSE;
+ proc = new TQProcess( this );
+ port = 0;
+ pageBuffer = "";
+ connect( proc, TQT_SIGNAL( readyReadStderr() ),
+ this, TQT_SLOT( readStdError() ) );
+}
+
+/*!
+ Destroys the assistant client object and frees up all allocated
+ resources.
+*/
+TQAssistantClient::~TQAssistantClient()
+{
+ if ( proc && proc->isRunning() ) {
+ proc->tryTerminate();
+ proc->kill();
+ }
+
+ if( dpointers ) {
+ TQAssistantClientPrivate *d = (*dpointers)[ this ];
+ if( d ) {
+ dpointers->remove( this );
+ delete d;
+ if( dpointers->isEmpty() ) {
+ delete dpointers;
+ dpointers = 0;
+ }
+ }
+ }
+}
+
+/*!
+ This function opens TQt Assistant and sets up the client-server
+ communiction between the application and TQt Assistant. If it is
+ already open, this function does nothing. If an error occurs,
+ error() is emitted.
+
+ \sa assistantOpened()
+*/
+void TQAssistantClient::openAssistant()
+{
+ if ( proc->isRunning() )
+ return;
+ proc->clearArguments();
+ proc->addArgument( assistantCommand );
+ proc->addArgument( "-server" );
+ if( !pageBuffer.isEmpty() ) {
+ proc->addArgument( "-file" );
+ proc->addArgument( pageBuffer );
+ }
+
+ TQAssistantClientPrivate *d = data( this );
+ if( d ) {
+ TQStringList::ConstIterator it = d->arguments.begin();
+ while( it!=d->arguments.end() ) {
+ proc->addArgument( *it );
+ ++it;
+ }
+ }
+
+ if ( !proc->launch( TQString() ) ) {
+ emit error( tr( "Cannot start TQt Assistant '%1'" )
+ .arg( proc->arguments().join( " " ) ) );
+ return;
+ }
+ connect( proc, TQT_SIGNAL( readyReadStdout() ),
+ this, TQT_SLOT( readPort() ) );
+}
+
+void TQAssistantClient::readPort()
+{
+ TQString p = proc->readLineStdout();
+ TQ_UINT16 port = p.toUShort();
+ if ( port == 0 ) {
+ emit error( tr( "Cannot connect to TQt Assistant." ) );
+ return;
+ }
+ socket->connectToHost( host, port );
+ disconnect( proc, TQT_SIGNAL( readyReadStdout() ),
+ this, TQT_SLOT( readPort() ) );
+}
+
+/*!
+ Use this function to close TQt Assistant.
+
+ \sa assistantClosed()
+*/
+void TQAssistantClient::closeAssistant()
+{
+ if ( !opened )
+ return;
+ proc->tryTerminate();
+ proc->kill();
+}
+
+/*!
+ Call this function to make TQt Assistant show a particular \a page.
+ The \a page is a filename (e.g. \c myhelpfile.html). See "Adding
+ Documentation to TQt Assistant" in the \link assistant.book TQt
+ Assistant manual\endlink for further information.
+
+ If TQt Assistant hasn't been \link openAssistant() opened\endlink
+ yet, this function will do nothing. You can use isOpen() to
+ determine whether TQt Assistant is up and running, or you can
+ connect to the asssistantOpened() signal.
+
+ \sa isOpen(), assistantOpened()
+*/
+void TQAssistantClient::showPage( const TQString &page )
+{
+ if ( !opened ) {
+ pageBuffer = page;
+ openAssistant();
+ pageBuffer = TQString();
+ return;
+ }
+ TQTextStream os( socket );
+ os << page << "\n";
+}
+
+/*!
+ \property TQAssistantClient::open
+ \brief Whether TQt Assistant is open.
+
+*/
+bool TQAssistantClient::isOpen() const
+{
+ return opened;
+}
+
+void TQAssistantClient::socketConnected()
+{
+ opened = TRUE;
+ if ( !pageBuffer.isEmpty() )
+ showPage( pageBuffer );
+ emit assistantOpened();
+}
+
+void TQAssistantClient::socketConnectionClosed()
+{
+ opened = FALSE;
+ emit assistantClosed();
+}
+
+void TQAssistantClient::socketError( int i )
+{
+ if ( i == TQSocket::ErrConnectionRefused )
+ emit error( tr( "Could not connect to Assistant: Connection refused" ) );
+ else if ( i == TQSocket::ErrHostNotFound )
+ emit error( tr( "Could not connect to Assistant: Host not found" ) );
+ else
+ emit error( tr( "Communication error" ) );
+}
+
+void TQAssistantClient::readStdError()
+{
+ TQString errmsg;
+ while ( proc->canReadLineStderr() ) {
+ errmsg += proc->readLineStderr();
+ errmsg += "\n";
+ }
+ if (!errmsg.isEmpty())
+ emit error( tr( errmsg.simplifyWhiteSpace() ) );
+}
+
+/*!
+ Sets the command line arguments used when TQt Assistant is
+ started to \a args.
+*/
+void TQAssistantClient::setArguments( const TQStringList &args )
+{
+ TQAssistantClientPrivate *d = data( this, TRUE );
+ d->arguments = args;
+}
diff --git a/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h b/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h
new file mode 100644
index 0000000..64b95d9
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/lib/tqassistantclient.h
@@ -0,0 +1,81 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQAssistantClient library.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TQASSISTANTCLIENT_H
+#define TQASSISTANTCLIENT_H
+
+#include <tqobject.h>
+
+class TQSocket;
+class TQProcess;
+
+class TQAssistantClient : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( bool open READ isOpen )
+
+public:
+ TQAssistantClient( const TQString &path, TQObject *tqparent = 0, const char *name = 0 );
+ ~TQAssistantClient();
+
+ bool isOpen() const;
+
+ void setArguments( const TQStringList &args );
+
+public Q_SLOTS:
+ virtual void openAssistant();
+ virtual void closeAssistant();
+ virtual void showPage( const TQString &page );
+
+Q_SIGNALS:
+ void assistantOpened();
+ void assistantClosed();
+ void error( const TQString &msg );
+
+private Q_SLOTS:
+ void socketConnected();
+ void socketConnectionClosed();
+ void readPort();
+ void socketError( int );
+ void readStdError();
+
+private:
+ TQSocket *socket;
+ TQProcess *proc;
+ TQ_UINT16 port;
+ TQString host, assistantCommand, pageBuffer;
+ bool opened;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/assistant/main.cpp b/tqtinterface/qt4/tools/assistant/main.cpp
new file mode 100644
index 0000000..42b5819
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/main.cpp
@@ -0,0 +1,344 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "mainwindow.h"
+#include "helpdialogimpl.h"
+#include "config.h"
+
+#include <tqapplication.h>
+#include <tqserversocket.h>
+#include <tqsocket.h>
+#include <tqpixmap.h>
+#include <tqptrlist.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
+#include <tqmessagebox.h>
+#include <tqguardedptr.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <tqtextcodec.h>
+
+#ifdef TQ_WS_WIN
+#define INDEX_CHECK( text ) if( i+1 >= argc ) { TQMessageBox::information( 0, "TQt Assistant", text ); return 1; }
+#else
+#define INDEX_CHECK( text ) if( i+1 >= argc ) { fprintf( stderr, text "\n" ); return 1; }
+#endif
+
+static bool allowFirstRun = TRUE;
+
+class AssistantSocket : public TQSocket
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ AssistantSocket( int sock, TQObject *tqparent = 0 );
+ ~AssistantSocket() {}
+
+Q_SIGNALS:
+ void showLinkRequest( const TQString& );
+
+private Q_SLOTS:
+ void readClient();
+ void connectionClosed();
+};
+
+
+class AssistantServer : public TQServerSocket
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ AssistantServer( TQObject* tqparent = 0 );
+ void newConnection( int socket );
+ TQ_UINT16 getPort() const;
+
+Q_SIGNALS:
+ void showLinkRequest( const TQString& );
+ void newConnect();
+
+private:
+ TQ_UINT16 p;
+};
+
+
+AssistantSocket::AssistantSocket( int sock, TQObject *tqparent )
+ : TQSocket( tqparent, 0 )
+{
+ connect( this, TQT_SIGNAL( readyRead() ),
+ TQT_SLOT( readClient() ) );
+ connect( this, TQT_SIGNAL( connectionClosed() ),
+ TQT_SLOT( connectionClosed() ) );
+ setSocket( sock );
+}
+
+void AssistantSocket::readClient()
+{
+ TQString link = TQString();
+ while ( canReadLine() )
+ link = readLine();
+ if ( !link.isNull() ) {
+ link = link.tqreplace( "\n", "" );
+ link = link.tqreplace( "\r", "" );
+ emit showLinkRequest( link );
+ }
+}
+
+void AssistantSocket::connectionClosed()
+{
+ delete this;
+}
+
+AssistantServer::AssistantServer( TQObject *tqparent )
+ : TQServerSocket( 0x7f000001, 0, 1, tqparent )
+{
+ if ( !ok() ) {
+ TQMessageBox::critical( 0, tr( "TQt Assistant" ),
+ tr( "Failed to bind to port %1" ).arg( port() ) );
+ exit( 1 );
+ }
+ p = port();
+}
+
+TQ_UINT16 AssistantServer::getPort() const
+{
+ return p;
+}
+
+void AssistantServer::newConnection( int socket )
+{
+ AssistantSocket *as = new AssistantSocket( socket, this );
+ connect( as, TQT_SIGNAL( showLinkRequest( const TQString& ) ),
+ this, TQT_SIGNAL( showLinkRequest( const TQString& ) ) );
+ emit newConnect();
+}
+
+int main( int argc, char ** argv )
+{
+ bool withGUI = TRUE;
+ if ( argc > 1 ) {
+ TQString arg( argv[1] );
+ arg = arg.lower();
+ if ( arg == "-addcontentfile"
+ || arg == "-removecontentfile"
+#ifndef TQ_WS_WIN
+ || arg == "-help"
+#endif
+ )
+ withGUI = FALSE;
+ }
+ TQApplication a(argc, argv, withGUI);
+
+ TQString resourceDir;
+ AssistantServer *as = 0;
+ TQStringList catlist;
+ TQString file, profileName, aDocPath;
+ bool server = FALSE;
+ bool hideSidebar = FALSE;
+ bool startClean = FALSE;
+ bool configLoaded = FALSE;
+ if ( argc == 2 ) {
+ if ( (argv[1])[0] != '-' )
+ file = argv[1];
+ }
+ if ( file.isEmpty() ) {
+ for ( int i = 1; i < argc; i++ ) {
+ if ( TQString( argv[i] ).lower() == "-file" ) {
+ INDEX_CHECK( "Missing file argument!" );
+ i++;
+ file = argv[i];
+ } else if ( TQString( argv[i] ).lower() == "-server" ) {
+ server = TRUE;
+ } else if ( TQString( argv[i] ).lower() == "-profile" ) {
+ INDEX_CHECK( "Missing profile argument!" );
+ profileName = argv[++i];
+ } else if ( TQString( argv[i] ).lower() == "-addcontentfile" ) {
+ INDEX_CHECK( "Missing content file!" );
+ Config *c = Config::loadConfig( TQString() );
+ TQFileInfo file( argv[i+1] );
+ if( !file.exists() ) {
+ fprintf( stderr, "Could not locate content file: '%s'\n",
+ file.absFilePath().latin1() );
+ fflush( stderr );
+ return 1;
+ }
+ DocuParser *parser = DocuParser::createParser( file.absFilePath() );
+ if( parser ) {
+ TQFile f( argv[i+1] );
+ if( !parser->parse( &f ) ) {
+ fprintf( stderr, "Failed to parse file: '%s'\n, ",
+ file.absFilePath().latin1() );
+ fflush( stderr );
+ return 1;
+ }
+ parser->addTo( c->profile() );
+ c->setDocRebuild( TRUE );
+ c->save();
+ }
+ return 0;
+ } else if ( TQString( argv[i] ).lower() == "-removecontentfile" ) {
+ INDEX_CHECK( "Missing content file!" );
+ Config *c = Config::loadConfig( TQString() );
+ Profile *profile = c->profile();
+ TQStringList entries = profile->docs.grep(argv[i+1]);
+ if (entries.count() == 0) {
+ fprintf(stderr, "Could not locate content file: '%s'\n",
+ argv[i+1]);
+ fflush(stderr);
+ return 1;
+ } else if (entries.count() > 1) {
+ fprintf(stderr, "More than one entry matching file name found, "
+ "please specify full path to file");
+ fflush(stderr);
+ return 1;
+ } else {
+ TQFileInfo file(entries[0]);
+ if( !file.exists() ) {
+ fprintf( stderr, "Could not locate content file: '%s'\n",
+ file.absFilePath().latin1() );
+ fflush( stderr );
+ return 1;
+ }
+ profile->removeDocFileEntry( file.absFilePath() );
+ c->setDocRebuild( TRUE );
+ c->save();
+ }
+ return 0;
+ } else if ( TQString( argv[i] ).lower() == "-docpath" ) {
+ INDEX_CHECK( "Missing path!" );
+ TQDir dir( argv[i+1] );
+ if ( dir.exists() ) {
+ Config *c = Config::loadConfig( TQString() );
+ c->saveProfile(Profile::createDefaultProfile(dir.absPath()));
+ c->loadDefaultProfile();
+ c->setDocRebuild( TRUE );
+ c->save();
+ configLoaded = TRUE;
+ ++i;
+ } else {
+ fprintf( stderr, "The specified path does not exist!\n");
+ fflush( stderr );
+ return 1;
+ }
+ } else if ( TQString( argv[i] ).lower() == "-hidesidebar" ) {
+ hideSidebar = TRUE;
+ } else if ( TQString( argv[i] ).lower() == "-help" ) {
+ TQString helpText( "Usage: assistant [option]\n"
+ "Options:\n"
+ " -file Filename assistant opens the specified file\n"
+ " -server reads commands from a socket after\n"
+ " assistant has started\n"
+ " -profile fileName starts assistant and displays the\n"
+ " profile specified in the file fileName.\n"
+ " -addContentFile file adds the content file 'file' to the set of\n"
+ " documentation available by default\n"
+ " -removeContentFile file removes the content file 'file' from the\n"
+ " documentation available by default\n"
+ " -docPath path sets the TQt documentation root path to\n"
+ " 'path' and starts assistant\n"
+ " -hideSidebar assistant will hide the sidebar.\n"
+ " -resourceDir assistant will load translations from\n"
+ " this directory.\n"
+ " -help shows this help.");
+#ifdef TQ_WS_WIN
+ TQMessageBox::information( 0, "TQt Assistant", "<pre>" + helpText + "</pre>" );
+#else
+ printf( "%s\n", helpText.latin1() );
+#endif
+ exit( 0 );
+ } else if ( TQString( argv[i] ).lower() == "-resourcedir" ) {
+ INDEX_CHECK( "Missing resource directory argument!" );
+ resourceDir = TQString( argv[++i] );
+ } else {
+ fprintf( stderr, "Unrecognized option '%s'. Try -help to get help.\n",
+ argv[i] );
+ fflush( stderr );
+ return 1;
+ }
+ }
+ }
+
+ if( resourceDir.isNull() )
+ resourceDir = qInstallPathTranslations();
+
+ TQTranslator translator( 0 );
+ translator.load( TQString("assistant_") + TQTextCodec::locale(), resourceDir );
+ a.installTranslator( &translator );
+
+ TQTranslator qtTranslator( 0 );
+ qtTranslator.load( TQString("qt_") + TQTextCodec::locale(), resourceDir );
+ a.installTranslator( &qtTranslator );
+
+
+ Config *conf = 0;
+ if (configLoaded)
+ conf = Config::configuration();
+ else
+ conf = Config::loadConfig( profileName );
+ if (!conf) {
+ fprintf( stderr, "Profile '%s' does not exist!\n", profileName.latin1() );
+ fflush( stderr );
+ return -1;
+ }
+
+ bool max = conf->isMaximized();
+ TQStringList links = conf->source();
+ conf->hideSideBar( hideSidebar );
+
+ TQGuardedPtr<MainWindow> mw = new MainWindow( 0, "Assistant" );
+
+ if ( server ) {
+ as = new AssistantServer();
+ printf("%d\n", as->port() );
+ fflush( stdout );
+ as->connect( as, TQT_SIGNAL( showLinkRequest( const TQString& ) ),
+ mw, TQT_SLOT( showLinkFromClient( const TQString& ) ) );
+ }
+
+ if ( max )
+ mw->showMaximized();
+ else
+ mw->show();
+
+ if ( !file.isEmpty() )
+ mw->showLink( file );
+ else if ( file.isEmpty() )
+ mw->showLinks( links );
+
+ a.connect( &a, TQT_SIGNAL( lastWindowClosed() ), &a, TQT_SLOT( quit() ) );
+
+ int appExec = a.exec();
+ delete (MainWindow*)mw;
+ return appExec;
+}
+
+#include "main.tqmoc"
diff --git a/tqtinterface/qt4/tools/assistant/mainwindow.ui b/tqtinterface/qt4/tools/assistant/mainwindow.ui
new file mode 100644
index 0000000..d3dbdab
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/mainwindow.ui
@@ -0,0 +1,670 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>MainWindow</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQMainWindow">
+ <property name="name">
+ <cstring>MainWindow</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>949</width>
+ <height>670</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Qt Assistant by Trolltech</string>
+ </property>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>949</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <item text="&amp;File" name="fileMenu">
+ <action name="actionNewWindow"/>
+ <action name="actionOpenPage"/>
+ <action name="actionClosePage"/>
+ <separator/>
+ <action name="actionFilePrint"/>
+ <separator/>
+ <action name="actionClose"/>
+ <action name="actionFileExit"/>
+ </item>
+ <item text="&amp;Edit" name="editMenu">
+ <action name="actionEditCopy"/>
+ <action name="actionEditFind"/>
+ <action name="actionEditFindAgain"/>
+ <action name="actionEditFindAgainPrev"/>
+ <separator/>
+ <action name="actionSettings"/>
+ </item>
+ <item text="&amp;View" name="PopupMenu">
+ <action name="actionZoomIn"/>
+ <action name="actionZoomOut"/>
+ <separator/>
+ </item>
+ <item text="&amp;Go" name="goMenu">
+ <action name="actionGoPrevious"/>
+ <action name="actionGoNext"/>
+ <action name="actionGoHome"/>
+ <separator/>
+ <action name="actionNextPage"/>
+ <action name="actionPrevPage"/>
+ </item>
+ <item text="Boo&amp;kmarks" name="bookmarkMenu">
+ </item>
+ <item text="&amp;Help" name="helpMenu">
+ <action name="actionHelpAssistant"/>
+ <separator/>
+ <action name="helpAbout_Qt_AssistantAction"/>
+ <action name="actionAboutApplication"/>
+ <separator/>
+ <action name="actionHelpWhatsThis"/>
+ </item>
+</menubar>
+<toolbars>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>Toolbar</cstring>
+ </property>
+ <property name="label">
+ <string>Toolbar</string>
+ </property>
+ <action name="actionGoPrevious"/>
+ <action name="actionGoNext"/>
+ <action name="actionGoHome"/>
+ <separator/>
+ <action name="actionEditCopy"/>
+ <action name="actionEditFind"/>
+ <action name="actionFilePrint"/>
+ <separator/>
+ <action name="actionZoomIn"/>
+ <action name="actionZoomOut"/>
+ <separator/>
+ <action name="actionHelpWhatsThis"/>
+ </toolbar>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>goActionToolbar</cstring>
+ </property>
+ <property name="label">
+ <string>Go</string>
+ </property>
+ </toolbar>
+</toolbars>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>actionFilePrint</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>print.png</iconset>
+ </property>
+ <property name="text">
+ <string>Print</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Print...</string>
+ </property>
+ <property name="whatsThis">
+ <string>Print the currently displayed page.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+P</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionFileExit</cstring>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="menuText">
+ <string>E&amp;xit</string>
+ </property>
+ <property name="whatsThis">
+ <string>Quit Qt Assistant.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Q</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionEditCopy</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>editcopy.png</iconset>
+ </property>
+ <property name="text">
+ <string>Copy</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Copy</string>
+ </property>
+ <property name="whatsThis">
+ <string>Copy the selected text to the clipboard.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+C</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionEditFind</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>find.png</iconset>
+ </property>
+ <property name="text">
+ <string>Find in Text</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Find in Text...</string>
+ </property>
+ <property name="whatsThis">
+ <string>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+F</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionEditFindAgain</cstring>
+ </property>
+ <property name="menuText">
+ <string>Find &amp;Next</string>
+ </property>
+ <property name="text">
+ <string>Find Next</string>
+ </property>
+ <property name="accel">
+ <string>F3</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionEditFindAgainPrev</cstring>
+ </property>
+ <property name="menuText">
+ <string>Find &amp;Previous</string>
+ </property>
+ <property name="text">
+ <string>Find Previous</string>
+ </property>
+ <property name="accel">
+ <string>Shift+F3</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionGoHome</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>home.png</iconset>
+ </property>
+ <property name="text">
+ <string>Home</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Home</string>
+ </property>
+ <property name="whatsThis">
+ <string>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Home</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionGoPrevious</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>previous.png</iconset>
+ </property>
+ <property name="text">
+ <string>Previous</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Previous</string>
+ </property>
+ <property name="whatsThis">
+ <string>Go to the previous page.</string>
+ </property>
+ <property name="accel">
+ <string>Alt+Left</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionGoNext</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>next.png</iconset>
+ </property>
+ <property name="text">
+ <string>Next</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Next</string>
+ </property>
+ <property name="whatsThis">
+ <string>Go to the next page.</string>
+ </property>
+ <property name="accel">
+ <string>Alt+Right</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpAbout_Qt_AssistantAction</cstring>
+ </property>
+ <property name="text">
+ <string>About Qt Assistant</string>
+ </property>
+ <property name="menuText">
+ <string>About Qt Assistant</string>
+ </property>
+ <property name="whatsThis">
+ <string>Display further information about Qt Assistant.</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionAboutApplication</cstring>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionZoomIn</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>zoomin.png</iconset>
+ </property>
+ <property name="text">
+ <string>Zoom in</string>
+ </property>
+ <property name="menuText">
+ <string>Zoom &amp;in</string>
+ </property>
+ <property name="whatsThis">
+ <string>Zoom in on the document, i.e. increase the font size.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl++</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionZoomOut</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>zoomout.png</iconset>
+ </property>
+ <property name="text">
+ <string>Zoom out</string>
+ </property>
+ <property name="menuText">
+ <string>Zoom &amp;out</string>
+ </property>
+ <property name="whatsThis">
+ <string>Zoom out on the document, i.e. decrease the font size.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+-</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionSettings</cstring>
+ </property>
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Settings...</string>
+ </property>
+ <property name="whatsThis">
+ <string>Open the settings dialog.</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionNewWindow</cstring>
+ </property>
+ <property name="text">
+ <string>New Window</string>
+ </property>
+ <property name="menuText">
+ <string>New Window</string>
+ </property>
+ <property name="whatsThis">
+ <string>Open a new window.</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionClose</cstring>
+ </property>
+ <property name="text">
+ <string>Close</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Close</string>
+ </property>
+ <property name="whatsThis">
+ <string>Close the current window.</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionAddBookmark</cstring>
+ </property>
+ <property name="text">
+ <string>Add Bookmark</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Add Bookmark</string>
+ </property>
+ <property name="whatsThis">
+ <string>Add the currently displayed page as a new bookmark.</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionHelpWhatsThis</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>whatsthis.xpm</iconset>
+ </property>
+ <property name="text">
+ <string>What's This?</string>
+ </property>
+ <property name="statusTip">
+ <string>"What's This?" context sensitive help.</string>
+ </property>
+ <property name="whatsThis">
+ <string>"What's This?" context sensitive help.</string>
+ </property>
+ <property name="accel">
+ <string>Shift+F1</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionOpenPage</cstring>
+ </property>
+ <property name="text">
+ <string>Add Tab</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Alt+N</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionNextPage</cstring>
+ </property>
+ <property name="text">
+ <string>Next Tab</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Alt+Right</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionPrevPage</cstring>
+ </property>
+ <property name="text">
+ <string>Previous Tab</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Alt+Left</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionClosePage</cstring>
+ </property>
+ <property name="text">
+ <string>Close Tab</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Alt+Q</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionHelpAssistant</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>assistant.png</iconset>
+ </property>
+ <property name="text">
+ <string>Qt Assistant Manual</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ </action>
+</actions>
+<connections>
+ <connection>
+ <sender>actionGoHome</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>goHome()</slot>
+ </connection>
+ <connection>
+ <sender>helpAbout_Qt_AssistantAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>about()</slot>
+ </connection>
+ <connection>
+ <sender>actionEditFind</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>tqfind()</slot>
+ </connection>
+ <connection>
+ <sender>actionEditFindAgain</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>tqfindAgain()</slot>
+ </connection>
+ <connection>
+ <sender>actionEditFindAgainPrev</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>tqfindAgainPrev()</slot>
+ </connection>
+ <connection>
+ <sender>actionFilePrint</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>print()</slot>
+ </connection>
+ <connection>
+ <sender>actionSettings</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>showSettingsDialog()</slot>
+ </connection>
+ <connection>
+ <sender>actionNewWindow</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>newWindow()</slot>
+ </connection>
+ <connection>
+ <sender>actionClose</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ </connection>
+ <connection>
+ <sender>actionHelpWhatsThis</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>whatsThis()</slot>
+ </connection>
+ <connection>
+ <sender>actionHelpAssistant</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>showAssistantHelp()</slot>
+ </connection>
+ <connection>
+ <sender>actionAboutApplication</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>aboutApplication()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">tqtoolbutton.h</include>
+ <include location="local" impldecl="in implementation">settingsdialogimpl.h</include>
+ <include location="global" impldecl="in implementation">tqmessagebox.h</include>
+ <include location="global" impldecl="in implementation">tqfontdatabase.h</include>
+ <include location="global" impldecl="in implementation">tqaccel.h</include>
+ <include location="global" impldecl="in implementation">tqcombobox.h</include>
+ <include location="global" impldecl="in implementation">tqpaintdevicemetrics.h</include>
+ <include location="global" impldecl="in implementation">tqsimplerichtext.h</include>
+ <include location="global" impldecl="in implementation">tqfileinfo.h</include>
+ <include location="global" impldecl="in implementation">tqtextstream.h</include>
+ <include location="global" impldecl="in implementation">tqdockwindow.h</include>
+ <include location="global" impldecl="in implementation">stdlib.h</include>
+ <include location="global" impldecl="in implementation">tqmime.h</include>
+ <include location="local" impldecl="in implementation">helpwindow.h</include>
+ <include location="global" impldecl="in implementation">tqstylesheet.h</include>
+ <include location="global" impldecl="in implementation">tqapplication.h</include>
+ <include location="local" impldecl="in implementation">helpdialogimpl.h</include>
+ <include location="global" impldecl="in implementation">tqdir.h</include>
+ <include location="global" impldecl="in implementation">tqprinter.h</include>
+ <include location="global" impldecl="in implementation">tqpainter.h</include>
+ <include location="global" impldecl="in implementation">tqurl.h</include>
+ <include location="global" impldecl="in implementation">tqstatusbar.h</include>
+ <include location="global" impldecl="in implementation">tqlineedit.h</include>
+ <include location="global" impldecl="in implementation">tqsettings.h</include>
+ <include location="global" impldecl="in implementation">tqcheckbox.h</include>
+ <include location="local" impldecl="in implementation">tabbedbrowser.h</include>
+ <include location="global" impldecl="in declaration">tqptrlist.h</include>
+ <include location="global" impldecl="in declaration">tqguardedptr.h</include>
+ <include location="global" impldecl="in declaration">tqmap.h</include>
+ <include location="local" impldecl="in declaration">finddialog.h</include>
+ <include location="global" impldecl="in declaration">tqstringlist.h</include>
+ <include location="local" impldecl="in declaration">helpwindow.h</include>
+ <include location="local" impldecl="in implementation">mainwindow.ui.h</include>
+</includes>
+<forwards>
+ <forward>class SettingsDialog;</forward>
+ <forward>class HelpDialog;</forward>
+ <forward>class TabbedBrowser;</forward>
+ <forward>class TQTimerEvent;</forward>
+</forwards>
+<variables>
+ <variable>TQPtrList&lt;TQAction&gt; *goActions;</variable>
+ <variable>int setupCompleted:1;</variable>
+ <variable>TabbedBrowser *tabs;</variable>
+ <variable>SettingsDialog * settingsDia;</variable>
+ <variable>TQMap&lt;int, TQString&gt; bookmarks;</variable>
+ <variable>HelpDialog *helpDock;</variable>
+ <variable>TQDockWindow *dw;</variable>
+ <variable>TQGuardedPtr&lt;FindDialog&gt; tqfindDialog;</variable>
+ <variable>static TQPtrList&lt;MainWindow&gt; *windows;</variable>
+ <variable>TQMap&lt;TQAction*,TQString&gt; *goActionDocFiles;</variable>
+ <variable>TQStringList pendingLinks;</variable>
+ <variable>TQPtrList&lt;HelpWindow&gt; pendingBrowsers</variable>
+</variables>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>setup()</slot>
+ <slot>destroy()</slot>
+ <slot>about()</slot>
+ <slot>aboutApplication()</slot>
+ <slot>tqfind()</slot>
+ <slot>tqfindAgain()</slot>
+ <slot>tqfindAgainPrev()</slot>
+ <slot>goHome()</slot>
+ <slot>print()</slot>
+ <slot>updateBookmarkMenu()</slot>
+ <slot>setupBookmarkMenu()</slot>
+ <slot>showBookmark( int id )</slot>
+ <slot>showLinkFromClient( const TQString &amp; link )</slot>
+ <slot>showLink( const TQString &amp; link )</slot>
+ <slot>showLinks( const TQStringList &amp; links )</slot>
+ <slot>showQtHelp()</slot>
+ <slot>showSettingsDialog()</slot>
+ <slot>showWebBrowserSettings()</slot>
+ <slot>showSettingsDialog( int page )</slot>
+ <slot>hide()</slot>
+ <slot returnType="MainWindow *">newWindow()</slot>
+ <slot>saveSettings()</slot>
+ <slot>saveToolbarSettings()</slot>
+ <slot>showSearchLink( const TQString &amp; link, const TQStringList &amp; terms )</slot>
+ <slot>showGoActionLink()</slot>
+ <slot>showAssistantHelp()</slot>
+ <slot>updateProfileSettings()</slot>
+ <slot>backwardAvailable(bool)</slot>
+ <slot>forwardAvailable(bool)</slot>
+ <slot>browserTabChanged()</slot>
+</Q_SLOTS>
+<functions>
+ <function access="private">setupGoActions()</function>
+ <function access="private" returnType="bool">insertActionSeparator()</function>
+ <function returnType="bool">close( bool alsoDelete )</function>
+ <function specifier="non virtual" returnType="TabbedBrowser *">browsers()</function>
+ <function returnType="HelpDialog*">helpDialog()</function>
+ <function>timerEvent(TQTimerEvent *)</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/assistant/mainwindow.ui.h b/tqtinterface/qt4/tools/assistant/mainwindow.ui.h
new file mode 100644
index 0000000..cb079aa
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/mainwindow.ui.h
@@ -0,0 +1,697 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "config.h"
+
+#include <tqtabwidget.h>
+#include <tqfileinfo.h>
+#include <tqaccel.h>
+#include <tqobjectlist.h>
+#include <tqtimer.h>
+#include <tqdragobject.h>
+#include <tqfontinfo.h>
+#include <tqaccel.h>
+#include <tqmetaobject.h>
+#include <tqeventloop.h>
+
+TQPtrList<MainWindow> *MainWindow::windows = 0;
+
+#if defined(TQ_WS_WIN)
+extern TQ_EXPORT int qt_ntfs_permission_lookup;
+#endif
+
+void MainWindow::init()
+{
+#if defined(TQ_WS_WIN)
+ // Workaround for TQMimeSourceFactory failing in TQFileInfo::isReadable() for
+ // certain user configs. See task: 34372
+ qt_ntfs_permission_lookup = 0;
+#endif
+ setupCompleted = FALSE;
+
+ goActions = new TQPtrList<TQAction>;
+ goActionDocFiles = new TQMap<TQAction*,TQString>;
+ goActions->setAutoDelete( TRUE );
+
+ if ( !windows )
+ windows = new TQPtrList<MainWindow>;
+ windows->append( this );
+ tabs = new TabbedBrowser( this, "qt_assistant_tabbedbrowser" );
+ setCentralWidget( tabs );
+ settingsDia = 0;
+
+ Config *config = Config::configuration();
+
+ updateProfileSettings();
+
+ dw = new TQDockWindow( TQDockWindow::InDock, this );
+ helpDock = new HelpDialog( dw, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( TQDockWindow::Always );
+ addDockWindow( dw, TQt::DockLeft );
+ dw->setWidget( helpDock );
+ dw->setCaption( "Sidebar" );
+ dw->setFixedExtentWidth( 320 );
+
+ // read tqgeometry configuration
+ setupGoActions();
+
+ if ( !config->isMaximized() ) {
+ TQRect geom = config->tqgeometry();
+ if( geom.isValid() ) {
+ resize(geom.size());
+ move(geom.topLeft());
+ }
+ }
+
+ TQString mainWindowLayout = config->mainWindowLayout();
+
+ TQTextStream ts( &mainWindowLayout, IO_ReadOnly );
+ ts >> *this;
+
+ if ( config->sideBarHidden() )
+ dw->hide();
+
+ tabs->setup();
+ TQTimer::singleShot( 0, this, TQT_SLOT( setup() ) );
+#if defined(TQ_OS_MACX)
+ // Use the same forward and backward browser shortcuts as Safari and Internet Explorer do
+ // on the Mac. This means that if you have access to one of those cool Intellimice, the thing
+ // works just fine, since that's how Microsoft hacked it.
+ actionGoPrevious->setAccel(TQKeySequence(TQt::CTRL|TQt::Key_Left));
+ actionGoNext->setAccel(TQKeySequence(TQt::CTRL|TQt::Key_Right));
+#endif
+}
+
+void MainWindow::setup()
+{
+ if( setupCompleted )
+ return;
+
+ tqApp->setOverrideCursor( TQCursor( TQt::WaitCursor ) );
+ statusBar()->message( tr( "Initializing TQt Assistant..." ) );
+ setupCompleted = TRUE;
+ helpDock->initialize();
+ connect( actionGoPrevious, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( backward() ) );
+ connect( actionGoNext, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( forward() ) );
+ connect( actionEditCopy, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( copy() ) );
+ connect( actionFileExit, TQT_SIGNAL( activated() ), tqApp, TQT_SLOT( closeAllWindows() ) );
+ connect( actionAddBookmark, TQT_SIGNAL( activated() ),
+ helpDock, TQT_SLOT( addBookmark() ) );
+ connect( helpDock, TQT_SIGNAL( showLink( const TQString& ) ),
+ this, TQT_SLOT( showLink( const TQString& ) ) );
+ connect( helpDock, TQT_SIGNAL( showSearchLink( const TQString&, const TQStringList& ) ),
+ this, TQT_SLOT( showSearchLink( const TQString&, const TQStringList&) ) );
+
+ connect( bookmarkMenu, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( showBookmark( int ) ) );
+ connect( actionZoomIn, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( zoomIn() ) );
+ connect( actionZoomOut, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( zoomOut() ) );
+
+ connect( actionOpenPage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( newTab() ) );
+ connect( actionClosePage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( closeTab() ) );
+ connect( actionNextPage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( nextTab() ) );
+ connect( actionPrevPage, TQT_SIGNAL( activated() ), tabs, TQT_SLOT( previousTab() ) );
+
+
+
+#if defined(TQ_OS_WIN32) || defined(TQ_OS_WIN64)
+ TQAccel *acc = new TQAccel( this );
+// acc->connectItem( acc->insertItem( Key_F5 ), browser, TQT_SLOT( reload() ) );
+ acc->connectItem( acc->insertItem( TQKeySequence("SHIFT+CTRL+=") ), actionZoomIn, TQT_SIGNAL(activated()) );
+#endif
+
+ TQAccel *a = new TQAccel( this, dw );
+ a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+T") ) ),
+ helpDock, TQT_SLOT( toggleContents() ) );
+ a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+I") ) ),
+ helpDock, TQT_SLOT( toggleIndex() ) );
+ a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+B") ) ),
+ helpDock, TQT_SLOT( toggleBookmarks() ) );
+ a->connectItem( a->insertItem( TQAccel::stringToKey( tr("Ctrl+S") ) ),
+ helpDock, TQT_SLOT( toggleSearch() ) );
+
+ Config *config = Config::configuration();
+
+ setupBookmarkMenu();
+ PopupMenu->insertItem( tqtr( "Vie&ws" ), createDockWindowMenu() );
+ helpDock->tabWidget->setCurrentPage( config->sideBarPage() );
+
+ tqApp->restoreOverrideCursor();
+ actionGoPrevious->setEnabled( FALSE );
+ actionGoNext->setEnabled( FALSE );
+}
+
+void MainWindow::setupGoActions()
+{
+ Config *config = Config::configuration();
+ TQStringList titles = config->docTitles();
+ TQAction *action = 0;
+
+ static bool separatorInserted = FALSE;
+
+ TQAction *cur = goActions->first();
+ while( cur ) {
+ cur->removeFrom( goMenu );
+ cur->removeFrom( goActionToolbar );
+ cur = goActions->next();
+ }
+ goActions->clear();
+ goActionDocFiles->clear();
+
+ int addCount = 0;
+
+ TQStringList::ConstIterator it = titles.begin();
+ for ( ; it != titles.end(); ++it ) {
+ TQString title = *it;
+ TQPixmap pix = config->docIcon( title );
+ if( !pix.isNull() ) {
+ if( !separatorInserted ) {
+ goMenu->insertSeparator();
+ separatorInserted = TRUE;
+ }
+ action = new TQAction( title, TQIconSet( pix ), title, 0, 0 );
+ action->addTo( goMenu );
+ action->addTo( goActionToolbar );
+ goActions->append( action );
+ goActionDocFiles->insert( action, config->indexPage( title ) );
+ connect( action, TQT_SIGNAL( activated() ),
+ this, TQT_SLOT( showGoActionLink() ) );
+ ++addCount;
+ }
+ }
+ if( !addCount )
+ goActionToolbar->hide();
+ else
+ goActionToolbar->show();
+
+}
+
+void MainWindow::browserTabChanged()
+{
+ if (tabs->currentBrowser()) {
+ actionGoPrevious->setEnabled(tabs->currentBrowser()->isBackwardAvailable());
+ actionGoNext->setEnabled(tabs->currentBrowser()->isForwardAvailable());
+ }
+}
+
+bool MainWindow::insertActionSeparator()
+{
+ goMenu->insertSeparator();
+ Toolbar->addSeparator();
+ return TRUE;
+}
+
+bool MainWindow::close( bool alsoDelete )
+{
+ saveSettings();
+ return TQMainWindow::close( alsoDelete );
+}
+
+void MainWindow::destroy()
+{
+ windows->removeRef( this );
+ if ( windows->isEmpty() ) {
+ delete windows;
+ windows = 0;
+ }
+ delete goActions;
+ delete goActionDocFiles;
+}
+
+void MainWindow::about()
+{
+ TQMessageBox box( this );
+ box.setText( "<center><img src=\"splash.png\">"
+ "<p>Version " + TQString(TQT_VERSION_STR) + "</p>"
+ "<p>Copyright (C) 2000-2008 Trolltech ASA. All rights reserved."
+ "</p></center><p></p>"
+ "<p>TQt Commercial Edition license holders: This program is"
+ " licensed to you under the terms of the TQt Commercial License"
+ " Agreement. For details, see the file LICENSE that came with"
+ " this software distribution.</p><p></p>"
+ "<p>TQt Open Source Edition users: This program is licensed to you"
+ " under the terms of the GNU General Public License Version 2."
+ " For details, see the file LICENSE.GPL that came with this"
+ " software distribution.</p><p>The program is provided AS IS"
+ " with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF"
+ " DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE."
+ "</p>" );
+ box.setCaption( tr( "TQt Assistant" ) );
+ box.setIcon( TQMessageBox::NoIcon );
+ box.exec();
+}
+
+void MainWindow::aboutApplication()
+{
+ TQString url = Config::configuration()->aboutURL();
+ if ( url == "about_qt" ) {
+ TQMessageBox::aboutTQt( this, "TQt Assistant" );
+ return;
+ }
+ TQString text;
+ TQFile file( url );
+ if( file.exists() && file.open( IO_ReadOnly ) )
+ text = TQString( file.readAll() );
+ if( text.isNull() )
+ text = tr( "Failed to open about application contents in file: '%1'" ).arg( url );
+
+ TQMessageBox box( this );
+ box.setText( text );
+ box.setCaption( Config::configuration()->aboutApplicationMenuText() );
+ box.setIcon( TQMessageBox::NoIcon );
+ box.exec();
+}
+
+void MainWindow::tqfind()
+{
+ if ( !tqfindDialog )
+ tqfindDialog = new FindDialog( this );
+ tqfindDialog->comboFind->setFocus();
+ tqfindDialog->comboFind->lineEdit()->setSelection(
+ 0, tqfindDialog->comboFind->lineEdit()->text().length() );
+ tqfindDialog->show();
+}
+
+void MainWindow::tqfindAgain()
+{
+ if (!tqfindDialog || !tqfindDialog->hasFindExpression()) {
+ tqfind();
+ return;
+ }
+ tqfindDialog->doFind(TRUE);
+}
+
+void MainWindow::tqfindAgainPrev()
+{
+ if (!tqfindDialog || !tqfindDialog->hasFindExpression()) {
+ tqfind();
+ return;
+ }
+ tqfindDialog->doFind(FALSE);
+}
+
+void MainWindow::goHome()
+{
+ showLink( Config::configuration()->homePage() );
+}
+
+void MainWindow::print()
+{
+ TQPrinter printer( TQPrinter::HighResolution );
+ printer.setFullPage( TRUE );
+ if ( printer.setup( this ) ) {
+ TQPainter p;
+ if ( !p.begin( &printer ) )
+ return;
+
+ tqApp->setOverrideCursor( TQCursor( TQt::WaitCursor ) );
+ tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput );
+
+ TQPaintDeviceMetrics metrics(p.tqdevice());
+ TQTextBrowser *browser = tabs->currentBrowser();
+ int dpiy = metrics.logicalDpiY();
+ int margin = (int) ( (2/2.54)*dpiy );
+ TQRect view( margin,
+ margin,
+ metrics.width() - 2 * margin,
+ metrics.height() - 2 * margin );
+ TQSimpleRichText richText( browser->text(), browser->TQWidget::font(), browser->context(),
+ browser->styleSheet(), browser->mimeSourceFactory(),
+ view.height(), TQt::black, FALSE );
+ richText.setWidth( &p, view.width() );
+ int page = 1;
+ do {
+ tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput );
+
+ richText.draw( &p, margin, margin, view, tqpalette().active() );
+ view.moveBy( 0, view.height() );
+ p.translate( 0 , -view.height() );
+ p.drawText( view.right() - p.fontMetrics().width( TQString::number(page) ),
+ view.bottom() + p.fontMetrics().ascent() + 5, TQString::number(page) );
+ if ( view.top() - margin >= richText.height() )
+ break;
+ printer.newPage();
+ page++;
+ } while (TRUE);
+
+ tqApp->eventLoop()->processEvents( TQEventLoop::ExcludeUserInput );
+ tqApp->restoreOverrideCursor();
+ }
+}
+
+void MainWindow::updateBookmarkMenu()
+{
+ for ( MainWindow *mw = windows->first(); mw; mw = windows->next() )
+ mw->setupBookmarkMenu();
+}
+
+void MainWindow::setupBookmarkMenu()
+{
+ bookmarkMenu->clear();
+ bookmarks.clear();
+ actionAddBookmark->addTo( bookmarkMenu );
+
+ TQFile f( TQDir::homeDirPath() + "/.assistant/bookmarks." +
+ Config::configuration()->profileName() );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQTextStream ts( &f );
+ bookmarkMenu->insertSeparator();
+ while ( !ts.atEnd() ) {
+ TQString title = ts.readLine();
+ TQString link = ts.readLine();
+ bookmarks.insert( bookmarkMenu->insertItem( title ), link );
+ }
+}
+
+void MainWindow::showBookmark( int id )
+{
+ if ( bookmarks.tqfind( id ) != bookmarks.end() )
+ showLink( *bookmarks.tqfind( id ) );
+}
+
+void MainWindow::showLinkFromClient( const TQString &link )
+{
+ setWindowState(windowState() & ~TQt::WindowMinimized);
+ raise();
+ setActiveWindow();
+ showLink( link );
+}
+
+void MainWindow::showLink( const TQString &link )
+{
+ if( link.isEmpty() ) {
+ qWarning( "The link is empty!" );
+ }
+
+ int tqfind = link.tqfind( '#' );
+ TQString name = tqfind >= 0 ? link.left( tqfind ) : link;
+
+ TQString absLink = link;
+ TQFileInfo fi( name );
+ if ( fi.isRelative() ) {
+ if ( tqfind >= 0 )
+ absLink = fi.absFilePath() + link.right( link.length() - tqfind );
+ else
+ absLink = fi.absFilePath();
+ }
+ if( fi.exists() ) {
+ tabs->setSource( absLink );
+ tabs->currentBrowser()->setFocus();
+ } else {
+ // ### Default 404 site!
+ statusBar()->message( tr( "Failed to open link: '%1'" ).arg( link ), 5000 );
+ tabs->currentBrowser()->setText( tr( "<div align=\"center\"><h1>The page could not be found!</h1><br>"
+ "<h3>'%1'</h3></div>").arg( link ) );
+ tabs->updateTitle( tr( "Error..." ) );
+ }
+}
+
+void MainWindow::showLinks( const TQStringList &links )
+{
+ if ( links.size() == 0 ) {
+ qWarning( "MainWindow::showLinks() - Empty link" );
+ return;
+ }
+
+ if ( links.size() == 1 ) {
+ showLink( links.first() );
+ return;
+ }
+
+ pendingLinks = links;
+
+ TQStringList::ConstIterator it = pendingLinks.begin();
+ // Initial showing, The tab is empty so update that without creating it first
+ if ( tabs->currentBrowser()->source().isEmpty() ) {
+ pendingBrowsers.append(tabs->currentBrowser());
+ tabs->setTitle(tabs->currentBrowser(), pendingLinks.first());
+ }
+ ++it;
+
+ while( it != pendingLinks.end() ) {
+ pendingBrowsers.append( tabs->newBackgroundTab(*it) );
+ ++it;
+ }
+
+ startTimer(50);
+ return;
+}
+
+void MainWindow::timerEvent(TQTimerEvent *e)
+{
+ TQString link = pendingLinks.first();
+ HelpWindow *win = pendingBrowsers.first();
+ pendingLinks.pop_front();
+ pendingBrowsers.removeFirst();
+ if (pendingLinks.size() == 0)
+ killTimer(e->timerId());
+ win->setSource(link);
+}
+
+void MainWindow::showQtHelp()
+{
+ showLink( TQString( qInstallPathDocs() ) + "/html/index.html" );
+}
+
+void MainWindow::showSettingsDialog()
+{
+ showSettingsDialog( -1 );
+}
+
+void MainWindow::showWebBrowserSettings()
+{
+ showSettingsDialog( 1 );
+}
+
+void MainWindow::showSettingsDialog( int page )
+{
+ if ( !settingsDia ){
+ settingsDia = new SettingsDialog( this );
+ }
+ TQFontDatabase fonts;
+ settingsDia->fontCombo->clear();
+ settingsDia->fontCombo->insertStringList( TQT_TQSTRINGLIST_OBJECT(fonts.families()) );
+ settingsDia->fontCombo->lineEdit()->setText( tabs->browserFont().family() );
+ settingsDia->fixedfontCombo->clear();
+ settingsDia->fixedfontCombo->insertStringList( TQT_TQSTRINGLIST_OBJECT(fonts.families()) );
+ settingsDia->fixedfontCombo->lineEdit()->setText( tabs->styleSheet()->item( "pre" )->fontFamily() );
+ settingsDia->linkUnderlineCB->setChecked( tabs->linkUnderline() );
+ settingsDia->colorButton->setPaletteBackgroundColor( tabs->palette().color( TQPalette::Active, TQColorGroup::Link ) );
+ if ( page != -1 )
+ settingsDia->settingsTab->setCurrentPage( page );
+
+ int ret = settingsDia->exec();
+
+ if ( ret != TQDialog::Accepted )
+ return;
+
+ TQObject *obj;
+ for ( obj = Toolbar->childrenListObject().last(); obj; obj = Toolbar->childrenListObject().prev() ) {
+ if ( obj->isA( "TQToolBarSeparator" ) ) {
+ delete obj;
+ obj = 0;
+ break;
+ }
+ }
+
+ setupGoActions();
+
+ TQFont fnt( tabs->browserFont() );
+ fnt.setFamily( settingsDia->fontCombo->currentText() );
+ tabs->setBrowserFont( fnt );
+ tabs->setLinkUnderline( settingsDia->linkUnderlineCB->isChecked() );
+
+ TQPalette pal = tabs->palette();
+ TQColor lc = settingsDia->colorButton->paletteBackgroundColor();
+ pal.setColor( TQPalette::Active, TQColorGroup::Link, lc );
+ pal.setColor( TQPalette::Inactive, TQColorGroup::Link, lc );
+ pal.setColor( TQPalette::Disabled, TQColorGroup::Link, lc );
+ tabs->setPalette( pal );
+
+ TQString family = settingsDia->fixedfontCombo->currentText();
+
+ TQStyleSheet *sh = tabs->styleSheet();
+ sh->item( "pre" )->setFontFamily( family );
+ sh->item( "code" )->setFontFamily( family );
+ sh->item( "tt" )->setFontFamily( family );
+ tabs->currentBrowser()->setText( tabs->currentBrowser()->text() );
+ showLink( tabs->currentBrowser()->source() );
+}
+
+void MainWindow::hide()
+{
+ saveToolbarSettings();
+ TQMainWindow::hide();
+}
+
+MainWindow* MainWindow::newWindow()
+{
+ saveSettings();
+ saveToolbarSettings();
+ MainWindow *mw = new MainWindow;
+ mw->move( tqgeometry().topLeft() );
+ if ( isMaximized() )
+ mw->showMaximized();
+ else
+ mw->show();
+ mw->goHome();
+ return mw;
+}
+
+void MainWindow::saveSettings()
+{
+ Config *config = Config::configuration();
+ config->setFontFamily( tabs->browserFont().family() );
+ config->setFontSize( tabs->currentBrowser()->font().pointSize() );
+ config->setFontFixedFamily( tabs->styleSheet()->item( "pre" )->fontFamily() );
+ config->setLinkUnderline( tabs->linkUnderline() );
+ config->setLinkColor( tabs->palette().color( TQPalette::Active, TQColorGroup::Link ).name() );
+ config->setSideBarPage( helpDock->tabWidget->currentPageIndex() );
+ config->setGeometry( TQRect( x(), y(), width(), height() ) );
+ config->setMaximized( isMaximized() );
+
+ // Create list of the tab urls
+ TQStringList lst;
+ TQPtrList<HelpWindow> browsers = tabs->browsers();
+ HelpWindow *browser = browsers.first();
+ while (browser) {
+ lst << browser->source();
+ browser = browsers.next();
+ }
+ config->setSource(lst);
+ config->save();
+}
+
+void MainWindow::saveToolbarSettings()
+{
+ TQString mainWindowLayout;
+ TQTextStream ts( &mainWindowLayout, IO_WriteOnly );
+ ts << *this;
+ Config::configuration()->setMainWindowLayout( mainWindowLayout );
+}
+
+TabbedBrowser* MainWindow::browsers()
+{
+ return tabs;
+}
+
+void MainWindow::showSearchLink( const TQString &link, const TQStringList &terms )
+{
+ HelpWindow * hw = tabs->currentBrowser();
+ hw->blockScrolling( TRUE );
+ hw->setCursor( tqwaitCursor );
+ if ( hw->source() == link )
+ hw->reload();
+ else
+ showLink( link );
+ hw->sync();
+ hw->setCursor( tqarrowCursor );
+
+ hw->viewport()->setUpdatesEnabled( FALSE );
+ int minPar = INT_MAX;
+ int minIndex = INT_MAX;
+ TQStringList::ConstIterator it = terms.begin();
+ for ( ; it != terms.end(); ++it ) {
+ int para = 0;
+ int index = 0;
+ bool found = hw->tqfind( *it, FALSE, TRUE, TRUE, &para, &index );
+ while ( found ) {
+ if ( para < minPar ) {
+ minPar = para;
+ minIndex = index;
+ }
+ hw->setColor( Qt::red );
+ found = hw->tqfind( *it, FALSE, TRUE, TRUE );
+ }
+ }
+ hw->blockScrolling( FALSE );
+ hw->viewport()->setUpdatesEnabled( TRUE );
+ hw->setCursorPosition( minPar, minIndex );
+ hw->updateContents();
+}
+
+
+void MainWindow::showGoActionLink()
+{
+ const TQObject *origin = TQT_TQOBJECT(sender());
+ if( !origin ||
+ origin->tqmetaObject()->className() != TQString( "TQAction" ) )
+ return;
+
+ TQAction *action = (TQAction*) origin;
+ TQString docfile = *( goActionDocFiles->tqfind( action ) );
+ showLink( docfile );
+}
+
+void MainWindow::showAssistantHelp()
+{
+ showLink( Config::configuration()->assistantDocPath() + "/assistant.html" );
+}
+
+HelpDialog* MainWindow::helpDialog()
+{
+ return helpDock;
+}
+
+void MainWindow::backwardAvailable( bool enable )
+{
+ actionGoPrevious->setEnabled( enable );
+}
+
+void MainWindow::forwardAvailable( bool enable )
+{
+ actionGoNext->setEnabled( enable );
+}
+
+void MainWindow::updateProfileSettings()
+{
+ Config *config = Config::configuration();
+#ifndef TQ_WS_MACX
+ setIcon( config->applicationIcon() );
+#endif
+ helpMenu->clear();
+ actionHelpAssistant->addTo( helpMenu );
+ helpMenu->insertSeparator();
+ helpAbout_Qt_AssistantAction->addTo( helpMenu );
+ if ( !config->aboutApplicationMenuText().isEmpty() )
+ actionAboutApplication->addTo( helpMenu );
+ helpMenu->insertSeparator();
+ actionHelpWhatsThis->addTo( helpMenu );
+
+ actionAboutApplication->setMenuText( config->aboutApplicationMenuText() );
+
+ if( !config->title().isNull() )
+ setCaption( config->title() );
+}
diff --git a/tqtinterface/qt4/tools/assistant/profile.cpp b/tqtinterface/qt4/tools/assistant/profile.cpp
new file mode 100644
index 0000000..6215d39
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/profile.cpp
@@ -0,0 +1,124 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+#include "profile.h"
+#include <tqxml.h>
+#include <tqtextcodec.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqdir.h>
+
+#define TQT_TITLE "TQt Reference Documentation"
+#define DESIGNER_TITLE "TQt Designer Manual"
+#define ASSISTANT_TITLE "TQt Assistant Manual"
+#define LINGUIST_TITLE "Guide to the TQt Translation Tools"
+#define TQMAKE_TITLE "qmake User Guide"
+
+Profile *Profile::createDefaultProfile( const TQString &docPath )
+{
+ TQString path = qInstallPathDocs();
+ if ( !docPath.isEmpty() )
+ path = docPath;
+ path = path + "/html/";
+ Profile *profile = new Profile;
+ profile->valid = TRUE;
+ profile->type = DefaultProfile;
+ profile->props["name"] = "default";
+ profile->props["applicationicon"] = "appicon.png";
+ profile->props["aboutmenutext"] = "About TQt";
+ profile->props["abouturl"] = "about_qt";
+ profile->props["title"] = "TQt Assistant";
+ profile->props["basepath"] = path;
+ profile->props["startpage"] = path + "index.html";
+
+ profile->addDCFTitle( path + "qt.dcf", TQT_TITLE );
+ profile->addDCFTitle( path + "designer.dcf", DESIGNER_TITLE );
+ profile->addDCFTitle( path + "assistant.dcf", ASSISTANT_TITLE );
+ profile->addDCFTitle( path + "linguist.dcf", LINGUIST_TITLE );
+ profile->addDCFTitle( path + "qmake.dcf", TQMAKE_TITLE );
+
+ profile->addDCFIcon( TQT_TITLE, "qt.png" );
+ profile->addDCFIcon( DESIGNER_TITLE, "designer.png" );
+ profile->addDCFIcon( ASSISTANT_TITLE, "assistant.png" );
+ profile->addDCFIcon( LINGUIST_TITLE, "linguist.png" );
+
+ profile->addDCFIndexPage( TQT_TITLE, path + "index.html" );
+ profile->addDCFIndexPage( DESIGNER_TITLE, path + "designer-manual.html" );
+ profile->addDCFIndexPage( ASSISTANT_TITLE, path + "assistant.html" );
+ profile->addDCFIndexPage( LINGUIST_TITLE, path + "linguist-manual.html" );
+ profile->addDCFIndexPage( TQMAKE_TITLE, path + "qmake-manual.html" );
+
+ profile->addDCFImageDir( TQT_TITLE, "../../gif/" );
+ profile->addDCFImageDir( DESIGNER_TITLE, "../../gif/" );
+ profile->addDCFImageDir( ASSISTANT_TITLE, "../../gif/" );
+ profile->addDCFImageDir( LINGUIST_TITLE, "../../gif/" );
+ profile->addDCFImageDir( TQMAKE_TITLE, "../../gif/" );
+
+ return profile;
+}
+
+
+Profile::Profile()
+ : valid( TRUE ), dparser( 0 )
+{
+}
+
+
+void Profile::removeDocFileEntry( const TQString &docfile )
+{
+ docs.remove( docfile );
+
+ TQStringList titles;
+
+ for( TQMap<TQString,TQString>::Iterator it = dcfTitles.begin();
+ it != dcfTitles.end(); ++it ) {
+ if( (*it) == docfile ) {
+ indexPages.remove( *it );
+ icons.remove( *it );
+ imageDirs.remove( *it );
+ titles << it.key();
+ }
+ }
+
+ for( TQStringList::ConstIterator title = titles.begin();
+ title != titles.end(); ++title ) {
+
+ dcfTitles.remove( *title );
+ }
+
+#ifdef ASSISTANT_DEBUG
+ qDebug( "docs:\n - " + docs.join( "\n - " ) );
+ qDebug( "titles:\n - " + titles.join( "\n - " ) );
+ qDebug( "keys:\n - " + ( (TQStringList*) &(dcfTitles.keys()) )->join( "\n - " ) );
+ qDebug( "values:\n - " + ( (TQStringList*) &(dcfTitles.values()) )->join( "\n - " ) );
+#endif
+}
diff --git a/tqtinterface/qt4/tools/assistant/profile.h b/tqtinterface/qt4/tools/assistant/profile.h
new file mode 100644
index 0000000..f8482c7
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/profile.h
@@ -0,0 +1,130 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PROFILE_H
+#define PROFILE_H
+
+#include <tqfileinfo.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
+
+class DocuParser;
+
+class Profile
+{
+public:
+ enum ProfileType { DefaultProfile, UserProfile };
+ Profile();
+
+ inline bool isValid() const;
+
+ inline void addDCF( const TQString &docfile );
+ inline void addDCFIcon( const TQString title, const TQString &icon );
+ inline void addDCFIndexPage( const TQString title, const TQString &indexPage );
+ inline void addDCFImageDir( const TQString title, const TQString &imgDir );
+ inline void addDCFTitle( const TQString &dcf, const TQString &title );
+ inline void addProperty( const TQString &name, const TQString &value );
+ inline bool hasDocFile( const TQString &docFile );
+ void removeDocFileEntry( const TQString &title );
+
+ inline ProfileType profileType() const { return type; }
+ inline void setProfileType( ProfileType t ) { type = t; }
+
+ inline DocuParser *docuParser() const { return dparser; }
+ inline void setDocuParser( DocuParser *dp ) { dparser = dp; }
+
+ static Profile* createDefaultProfile( const TQString &docPath = TQString() );
+ static TQString makeRelativePath( const TQString &base, const TQString &path );
+
+ int valid:1;
+ ProfileType type;
+ DocuParser *dparser;
+ TQMap<TQString,TQString> props;
+ TQMap<TQString,TQString> icons;
+ TQMap<TQString,TQString> indexPages;
+ TQMap<TQString,TQString> imageDirs;
+ TQMap<TQString,TQString> dcfTitles;
+ TQStringList docs;
+};
+
+
+inline bool Profile::isValid() const
+{
+ return valid;
+}
+
+inline void Profile::addDCFTitle(const TQString &dcf, const TQString &title)
+{
+ TQString absdcf = TQFileInfo(dcf).absFilePath();
+ dcfTitles[title] = absdcf;
+ if (docs.tqcontains(absdcf) == 0)
+ docs << absdcf;
+}
+
+inline void Profile::addDCF( const TQString &docfile )
+{
+ if( !docs.tqcontains( docfile ) == 0 )
+ docs << docfile;
+}
+
+inline void Profile::addDCFIcon( const TQString docfile,
+ const TQString &icon )
+{
+ icons[docfile] = icon;
+}
+
+inline void Profile::addDCFIndexPage( const TQString title,
+ const TQString &indexPage )
+{
+ indexPages[title] = indexPage;
+}
+
+inline void Profile::addDCFImageDir( const TQString docfile,
+ const TQString &imgDir )
+{
+ imageDirs[docfile] = imgDir;
+}
+
+inline void Profile::addProperty( const TQString &name,
+ const TQString &value )
+{
+ props[name] = value;
+}
+
+inline bool Profile::hasDocFile( const TQString &name )
+{
+ return docs.tqcontains( name ) > 0;
+}
+
+#endif
diff --git a/tqtinterface/qt4/tools/assistant/settingsdialog.ui b/tqtinterface/qt4/tools/assistant/settingsdialog.ui
new file mode 100644
index 0000000..f2ae9b2
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/settingsdialog.ui
@@ -0,0 +1,516 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SettingsDialogBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>SettingsDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>389</width>
+ <height>253</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Qt Assistant - Settings</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>settingsTab</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;General</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>fixedfontCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Fix&amp;ed font:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fixedfontCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Link color:</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>fontCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>fontLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Font:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fontCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>linkUnderlineCB</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Underline links</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQToolButton" row="2" column="1">
+ <property name="name">
+ <cstring>colorButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Web</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>Spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Web &amp;Browser Application:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>browserApp</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>browserApp</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonBrowse</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel1_3_3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Home page</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>homePage</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>tqlayout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>homePage</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHome</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>pdfTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;PDF</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_3_2</cstring>
+ </property>
+ <property name="text">
+ <string>PDF &amp;Application</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>pdfApp</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>81</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>tqlayout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>pdfApp</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonPDF</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>colorButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>selectColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonBrowse</sender>
+ <signal>clicked()</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>browseWebApp()</slot>
+ </connection>
+ <connection>
+ <sender>buttonHome</sender>
+ <signal>clicked()</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>browseHomepage()</slot>
+ </connection>
+ <connection>
+ <sender>buttonPDF</sender>
+ <signal>clicked()</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>browsePDFApplication()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>settingsTab</tabstop>
+ <tabstop>fontCombo</tabstop>
+ <tabstop>fixedfontCombo</tabstop>
+ <tabstop>colorButton</tabstop>
+ <tabstop>linkUnderlineCB</tabstop>
+ <tabstop>browserApp</tabstop>
+ <tabstop>buttonBrowse</tabstop>
+ <tabstop>homePage</tabstop>
+ <tabstop>buttonHome</tabstop>
+ <tabstop>pdfApp</tabstop>
+ <tabstop>buttonPDF</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot>selectColor()</slot>
+ <slot>browseWebApp()</slot>
+ <slot>browsePDFApplication()</slot>
+ <slot>browseHomepage()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp b/tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp
new file mode 100644
index 0000000..39abaa7
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/settingsdialogimpl.cpp
@@ -0,0 +1,122 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "settingsdialogimpl.h"
+#include "docuparser.h"
+#include "config.h"
+
+#include <tqapplication.h>
+#include <tqpushbutton.h>
+#include <tqcheckbox.h>
+#include <tqcolordialog.h>
+#include <tqdir.h>
+#include <tqfiledialog.h>
+#include <tqfileinfo.h>
+#include <tqlineedit.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqmessagebox.h>
+#include <tqptrstack.h>
+#include <tqsettings.h>
+#include <tqtimer.h>
+#include <tqtoolbutton.h>
+#include <tqtabwidget.h>
+#include <tqmap.h>
+
+
+SettingsDialog::SettingsDialog( TQWidget *tqparent, const char* name )
+ : SettingsDialogBase( tqparent, name )
+{
+ init();
+}
+
+void SettingsDialog::init()
+{
+ Config *config = Config::configuration();
+
+ browserApp->setText( config->webBrowser() );
+ homePage->setText( config->homePage() );
+ pdfApp->setText( config->pdfReader() );
+}
+
+void SettingsDialog::selectColor()
+{
+ TQColor c = TQColorDialog::getColor( colorButton->paletteBackgroundColor(), this );
+ colorButton->setPaletteBackgroundColor( c );
+}
+
+void SettingsDialog::browseWebApp()
+{
+ setFile( browserApp, tr( "TQt Assistant - Set Web Browser" ) );
+}
+
+void SettingsDialog::browsePDFApplication()
+{
+ setFile( pdfApp, tr( "TQt Assistant - Set PDF Browser" ) );
+}
+
+void SettingsDialog::browseHomepage()
+{
+ setFile( homePage, tr( "TQt Assistant - Set Homepage" ) );
+}
+
+void SettingsDialog::setFile( TQLineEdit *le, const TQString &caption )
+{
+ TQFileDialog *fd = new TQFileDialog( this );
+ fd->setCaption( caption );
+ fd->setMode( TQFileDialog::AnyFile );
+ fd->setDir( TQDir::homeDirPath() );
+
+ if ( fd->exec() == TQDialog::Accepted ) {
+ if ( !fd->selectedFile().isEmpty() )
+ le->setText( fd->selectedFile() );
+ }
+}
+
+void SettingsDialog::accept()
+{
+ Config *config = Config::configuration();
+
+ config->setWebBrowser( browserApp->text() );
+ config->setHomePage( homePage->text() );
+ config->setPdfReader( pdfApp->text() );
+
+ hide();
+ done( Accepted );
+}
+
+void SettingsDialog::reject()
+{
+ init();
+ done( Rejected );
+}
diff --git a/tqtinterface/qt4/tools/assistant/settingsdialogimpl.h b/tqtinterface/qt4/tools/assistant/settingsdialogimpl.h
new file mode 100644
index 0000000..3865630
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/settingsdialogimpl.h
@@ -0,0 +1,64 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SETTINGSDIALOGIMPL_H
+#define SETTINGSDIALOGIMPL_H
+
+#include "settingsdialog.h"
+
+#include <tqstringlist.h>
+#include <tqptrlist.h>
+#include <tqlistview.h>
+
+class SettingsDialog : public SettingsDialogBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ SettingsDialog( TQWidget *tqparent, const char* name = 0 );
+
+protected Q_SLOTS:
+ void selectColor();
+ void browseWebApp();
+ void browsePDFApplication();
+ void browseHomepage();
+ void accept();
+ void reject();
+
+private:
+ void init();
+ void setFile( TQLineEdit *le, const TQString &caption );
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui b/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui
new file mode 100644
index 0000000..79fec26
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui
@@ -0,0 +1,141 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>TabbedBrowser</class>
+<comment>*********************************************************************
+** Copyright (C) 2003-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>TabbedBrowser</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>710</width>
+ <height>681</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>TabbedBrowser</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="TQTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>frontpage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Untitled</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<includes>
+ <include location="global" impldecl="in declaration">tqsettings.h</include>
+ <include location="local" impldecl="in implementation">helpwindow.h</include>
+ <include location="local" impldecl="in implementation">mainwindow.h</include>
+ <include location="global" impldecl="in implementation">tqstylesheet.h</include>
+ <include location="global" impldecl="in implementation">tqmime.h</include>
+ <include location="local" impldecl="in implementation">tabbedbrowser.ui.h</include>
+</includes>
+<forwards>
+ <forward>class HelpWindow;</forward>
+ <forward>class MainWindow;</forward>
+ <forward>class TQStyleSheet;</forward>
+ <forward>class TQMimeSourceFactory;</forward>
+</forwards>
+<variables>
+ <variable access="private">TQStyleSheet *tabStyleSheet;</variable>
+ <variable access="private">bool tabLinkUnderline;</variable>
+ <variable access="private">TQMimeSourceFactory *mimeSourceFactory;</variable>
+ <variable access="private">TQWidget *lastCurrentTab;</variable>
+ <variable access="private">TQFont tabFont;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>forward()</slot>
+ <slot>backward()</slot>
+ <slot>setSource( const TQString &amp; ref )</slot>
+ <slot>reload()</slot>
+ <slot>home()</slot>
+ <slot>nextTab()</slot>
+ <slot>previousTab()</slot>
+ <slot>newTab( const TQString &amp; lnk )</slot>
+ <slot>zoomIn()</slot>
+ <slot>zoomOut()</slot>
+ <slot>updateTitle( const TQString &amp; title )</slot>
+ <slot>newTab()</slot>
+ <slot>transferFocus()</slot>
+ <slot>initHelpWindow( HelpWindow * win )</slot>
+ <slot>setup()</slot>
+ <slot>setLinkUnderline( bool uline )</slot>
+ <slot>setPalette( const TQPalette &amp; pal )</slot>
+ <slot>copy()</slot>
+ <slot>closeTab()</slot>
+ <slot>sourceChanged()</slot>
+</Q_SLOTS>
+<functions>
+ <function returnType="HelpWindow *">currentBrowser()</function>
+ <function access="private">init()</function>
+ <function returnType="MainWindow *">mainWindow()</function>
+ <function specifier="non virtual" returnType="TQStyleSheet *">styleSheet()</function>
+ <function specifier="non virtual" returnType="bool">linkUnderline()</function>
+ <function specifier="non virtual" returnType="TQStringList">sources()</function>
+ <function specifier="non virtual">setMimePath( TQStringList lst )</function>
+ <function specifier="non virtual">setMimeExtension( const TQString &amp; ext )</function>
+ <function specifier="non virtual">setBrowserFont( const TQFont &amp; fnt )</function>
+ <function specifier="non virtual" returnType="TQFont">browserFont()</function>
+ <function specifier="non virtual" returnType="TQPtrList&lt;HelpWindow&gt;">browsers() const</function>
+ <function returnType="HelpWindow*">newBackgroundTab( const TQString &amp; url )</function>
+ <function returnType="HelpWindow*" access="private">createHelpWindow(const TQString &amp;)</function>
+ <function>setTitle(HelpWindow*, const TQString &amp;)</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h b/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h
new file mode 100644
index 0000000..b059b54
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/tabbedbrowser.ui.h
@@ -0,0 +1,347 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or Q_SLOTS use
+** TQt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+#include <tqfileinfo.h>
+#include <tqtoolbutton.h>
+#include <tqpixmap.h>
+#include <tqiconset.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
+
+#include "config.h"
+
+static TQString reduceLabelLength( const TQString &s )
+{
+ uint maxLength = 16;
+ TQString str = s;
+ if ( str.length() < maxLength )
+ return str;
+ str = str.left( maxLength - 3 );
+ str += "...";
+ return str;
+}
+
+void TabbedBrowser::forward()
+{
+ currentBrowser()->forward();
+}
+
+void TabbedBrowser::backward()
+{
+ currentBrowser()->backward();
+}
+
+void TabbedBrowser::setSource( const TQString &ref )
+{
+ HelpWindow * win = currentBrowser();
+ win->setSource(ref);
+}
+
+void TabbedBrowser::reload()
+{
+ currentBrowser()->reload();
+}
+
+void TabbedBrowser::home()
+{
+ currentBrowser()->home();
+}
+
+HelpWindow * TabbedBrowser::currentBrowser()
+{
+ return (HelpWindow*) tab->currentPage();
+}
+
+void TabbedBrowser::nextTab()
+{
+ if( tab->currentPageIndex()<=tab->count()-1 )
+ tab->setCurrentPage( tab->currentPageIndex()+1 );
+}
+
+void TabbedBrowser::previousTab()
+{
+ int idx = tab->currentPageIndex()-1;
+ if( idx>=0 )
+ tab->setCurrentPage( idx );
+}
+
+HelpWindow *TabbedBrowser::createHelpWindow(const TQString &title)
+{
+ MainWindow *mainWin = mainWindow();
+ HelpWindow *win = new HelpWindow( mainWin, this, "qt_assistant_helpwin" );
+ win->setFont( browserFont() );
+ win->setPalette( palette() );
+ win->setLinkUnderline( tabLinkUnderline );
+ win->setStyleSheet( tabStyleSheet );
+ win->setMimeSourceFactory( mimeSourceFactory );
+ tab->addTab(win, reduceLabelLength(title));
+ connect( win, TQT_SIGNAL( highlighted( const TQString & ) ),
+ (const TQObject*) (mainWin->statusBar()), TQT_SLOT( message( const TQString & ) ) );
+ connect( win, TQT_SIGNAL( chooseWebBrowser() ), mainWin, TQT_SLOT( showWebBrowserSettings() ) );
+ connect( win, TQT_SIGNAL( backwardAvailable(bool) ),
+ mainWin, TQT_SLOT( backwardAvailable(bool) ) );
+ connect( win, TQT_SIGNAL( forwardAvailable(bool) ),
+ mainWin, TQT_SLOT( forwardAvailable(bool) ) );
+ connect( win, TQT_SIGNAL( sourceChanged(const TQString &) ), this, TQT_SLOT( sourceChanged() ));
+
+ tab->cornerWidget( TQt::TopRight )->setEnabled( tab->count() > 1 );
+ return win;
+}
+
+HelpWindow *TabbedBrowser::newBackgroundTab( const TQString &url )
+{
+ HelpWindow *win = createHelpWindow(url);
+ return win;
+}
+
+void TabbedBrowser::newTab( const TQString &lnk )
+{
+ TQString link( lnk );
+ if( link.isNull() ) {
+ HelpWindow *w = currentBrowser();
+ if( w )
+ link = w->source();
+ }
+ HelpWindow *win = createHelpWindow(link);
+ tab->showPage( win );
+ if( !link.isNull() ) {
+ win->setSource( link );
+ }
+}
+
+void TabbedBrowser::zoomIn()
+{
+ currentBrowser()->zoomIn();
+}
+
+void TabbedBrowser::zoomOut()
+{
+ currentBrowser()->zoomOut();
+}
+
+void TabbedBrowser::init()
+{
+ tabLinkUnderline = FALSE;
+ tabStyleSheet = new TQStyleSheet( TQStyleSheet::defaultSheet() );
+ lastCurrentTab = 0;
+ while( tab->count() )
+ tab->removePage( tab->page(0) );
+
+ mimeSourceFactory = new TQMimeSourceFactory();
+ mimeSourceFactory->setExtensionType("html","text/html;charset=UTF-8");
+ mimeSourceFactory->setExtensionType("htm","text/html;charset=UTF-8");
+ mimeSourceFactory->setExtensionType("png", "image/png" );
+ mimeSourceFactory->setExtensionType("jpg", "image/jpeg" );
+ mimeSourceFactory->setExtensionType("jpeg", "image/jpeg" );
+ setMimePath( Config::configuration()->mimePaths() );
+
+ connect( tab, TQT_SIGNAL( currentChanged( TQWidget* ) ),
+ this, TQT_SLOT( transferFocus() ) );
+ connect( tab, TQT_SIGNAL( currentChanged( TQWidget* ) ),
+ mainWindow(), TQT_SLOT( browserTabChanged() ) );
+
+ TQTabBar *tabBar = (TQTabBar*)tab->child( 0, "TQTabBar", FALSE );
+ int m = ( tabBar ? tqstyle().tqpixelMetric( TQStyle::PM_TabBarTabVSpace, (TQWidget*)tabBar )
+ + tqstyle().tqpixelMetric( TQStyle::PM_TabBarBaseHeight, (TQWidget*)tabBar ) : 0 );
+ int s = tab->height() - m;
+
+ // workaround for sgi style
+ TQPalette pal = palette();
+ pal.setColor(TQPalette::Active, TQColorGroup::Button, pal.active().background());
+ pal.setColor(TQPalette::Disabled, TQColorGroup::Button, pal.disabled().background());
+ pal.setColor(TQPalette::Inactive, TQColorGroup::Button, pal.inactive().background());
+
+ TQToolButton *newTabButton = new TQToolButton( this );
+ newTabButton->setPalette(pal);
+ tab->setCornerWidget( newTabButton, TQt::TopLeft );
+ newTabButton->setCursor( tqarrowCursor );
+ newTabButton->setAutoRaise( TRUE );
+ newTabButton->setPixmap( TQPixmap::fromMimeSource( "addtab.png" ) );
+ newTabButton->setFixedSize( s, s );
+ TQObject::connect( newTabButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( newTab() ) );
+ TQToolTip::add( newTabButton, tr( "Add page" ) );
+
+ TQToolButton *closeTabButton = new TQToolButton( this );
+ closeTabButton->setPalette(pal);
+ tab->setCornerWidget( closeTabButton, TQt::TopRight );
+ closeTabButton->setCursor( tqarrowCursor );
+ closeTabButton->setAutoRaise( TRUE );
+ TQIconSet is( TQPixmap::fromMimeSource( "closetab.png") );
+ TQPixmap disabledPix = TQPixmap::fromMimeSource( "d_closetab.png" );
+ is.setPixmap( disabledPix, TQIconSet::Small, TQIconSet::Disabled );
+ closeTabButton->setIconSet( is );
+ closeTabButton->setFixedSize( s, s );
+ TQObject::connect( closeTabButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( closeTab() ) );
+ TQToolTip::add( closeTabButton, tr( "Close page" ) );
+ closeTabButton->setEnabled( FALSE );
+}
+
+void TabbedBrowser::setMimePath( TQStringList lst )
+{
+ mimeSourceFactory->setFilePath( lst );
+}
+
+void TabbedBrowser::setMimeExtension( const TQString &ext )
+{
+ mimeSourceFactory->setExtensionType( "html", ext );
+ mimeSourceFactory->setExtensionType( "htm", ext );
+}
+
+void TabbedBrowser::updateTitle( const TQString &title )
+{
+ tab->changeTab( currentBrowser(), title );
+}
+
+MainWindow* TabbedBrowser::mainWindow()
+{
+ return (MainWindow*) tqparent();
+}
+
+void TabbedBrowser::newTab()
+{
+ newTab( TQString() );
+}
+
+void TabbedBrowser::transferFocus()
+{
+ if( currentBrowser() ) {
+ currentBrowser()->setFocus();
+ }
+ mainWindow()->setCaption(Config::configuration()->title()
+ + " - " + currentBrowser()->documentTitle());
+}
+
+void TabbedBrowser::initHelpWindow( HelpWindow * /*win*/ )
+{
+}
+
+void TabbedBrowser::setup()
+{
+ Config *config = Config::configuration();
+
+ TQFont fnt( font() );
+ TQFontInfo fntInfo( fnt );
+ fnt.setFamily( config->fontFamily() );
+ fnt.setPointSize( config->fontSize() );
+ setBrowserFont( fnt );
+
+ TQPalette pal = palette();
+ TQColor lc( config->linkColor() );
+ pal.setColor( TQPalette::Active, TQColorGroup::Link, lc );
+ pal.setColor( TQPalette::Inactive, TQColorGroup::Link, lc );
+ pal.setColor( TQPalette::Disabled, TQColorGroup::Link, lc );
+ setPalette( pal );
+
+ tabLinkUnderline = config->isLinkUnderline();
+
+ TQString family = config->fontFixedFamily();
+ tabStyleSheet->item( "pre" )->setFontFamily( family );
+ tabStyleSheet->item( "code" )->setFontFamily( family );
+ tabStyleSheet->item( "tt" )->setFontFamily( family );
+
+ newTab( TQString() );
+}
+
+void TabbedBrowser::setLinkUnderline( bool uline )
+{
+ if( uline==tabLinkUnderline )
+ return;
+ tabLinkUnderline = uline;
+ int cnt = tab->count();
+ for( int i=0; i<cnt; i++ )
+ ( (TQTextBrowser*) tab->page( i ) )->setLinkUnderline( tabLinkUnderline );
+}
+
+TQFont TabbedBrowser::browserFont()
+{
+ return tabFont;
+}
+
+void TabbedBrowser::setBrowserFont( const TQFont &fnt )
+{
+ if( tabFont == fnt )
+ return;
+ tabFont = fnt;
+ int cnt = tab->count();
+ for( int i=0; i<cnt; i++ )
+ ( (TQTextBrowser*) tab->page( i ) )->setFont( fnt );
+}
+
+void TabbedBrowser::setPalette( const TQPalette &pal )
+{
+ if( palette()==pal )
+ return;
+ TQWidget::setPalette( pal );
+ int cnt = tab->count();
+ for( int i=0; i<cnt; i++ )
+ ( (TQTextBrowser*) tab->page( i ) )->setPalette( pal );
+}
+
+TQStyleSheet* TabbedBrowser::styleSheet()
+{
+ return tabStyleSheet;
+}
+
+bool TabbedBrowser::linkUnderline()
+{
+ return tabLinkUnderline;
+}
+
+void TabbedBrowser::copy()
+{
+ currentBrowser()->copy();
+}
+
+void TabbedBrowser::closeTab()
+{
+ if( tab->count()==1 )
+ return;
+ HelpWindow *win = currentBrowser();
+ tab->removePage( win );
+ TQTimer::singleShot(0, win, TQT_SLOT(deleteLater()));
+ tab->cornerWidget( TQt::TopRight )->setEnabled( tab->count() > 1 );
+}
+
+TQStringList TabbedBrowser::sources()
+{
+ TQStringList lst;
+ int cnt = tab->count();
+ for( int i=0; i<cnt; i++ ) {
+ lst.append( ( (TQTextBrowser*) tab->page(i) )->source() );
+ }
+ return lst;
+}
+
+TQPtrList<HelpWindow> TabbedBrowser::browsers() const
+{
+ TQPtrList<HelpWindow> list;
+ for (int i=0; i<tab->count(); ++i) {
+ TQ_ASSERT(::tqqt_cast<HelpWindow*>(tab->page(i)));
+ list.append(::tqqt_cast<HelpWindow*>(tab->page(i)));
+ }
+ return list;
+}
+
+void TabbedBrowser::sourceChanged()
+{
+ HelpWindow *win = ::tqqt_cast<HelpWindow *>( sender() );
+ TQ_ASSERT( win );
+ TQString docTitle(win->documentTitle());
+ if (docTitle.isEmpty())
+ docTitle = "...";
+ setTitle(win, docTitle);
+}
+
+void TabbedBrowser::setTitle(HelpWindow *win, const TQString &title)
+{
+ tab->setTabLabel(win, reduceLabelLength(title));
+ if (win == currentBrowser())
+ mainWindow()->setCaption(Config::configuration()->title() + " - " + title);
+}
+
diff --git a/tqtinterface/qt4/tools/assistant/topicchooser.ui b/tqtinterface/qt4/tools/assistant/topicchooser.ui
new file mode 100644
index 0000000..364e23f
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/topicchooser.ui
@@ -0,0 +1,182 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>TopicChooserBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>TopicChooserBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>391</width>
+ <height>223</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Choose Topic</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select a topic from the list and click the &lt;b&gt;Display&lt;/b&gt;-button to open the online help.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Topics</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listbox</cstring>
+ </property>
+ </widget>
+ <widget class="TQListBox">
+ <property name="name">
+ <cstring>listbox</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displays a list of available help topics for the keyword.</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout16</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonDisplay</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Display</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Open the topic selected in the list.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the Dialog.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonDisplay</sender>
+ <signal>clicked()</signal>
+ <receiver>TopicChooserBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>TopicChooserBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>listbox</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>TopicChooserBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>listbox</sender>
+ <signal>returnPressed(QListBoxItem*)</signal>
+ <receiver>TopicChooserBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp b/tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp
new file mode 100644
index 0000000..4cad976
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/topicchooserimpl.cpp
@@ -0,0 +1,70 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "topicchooserimpl.h"
+
+#include <tqlabel.h>
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+
+TopicChooser::TopicChooser( TQWidget *tqparent, const TQStringList &lnkNames,
+ const TQStringList &lnks, const TQString &title )
+ : TopicChooserBase( tqparent, 0, TRUE ), links( lnks ), linkNames( lnkNames )
+{
+ label->setText( tr( "Choose a topic for <b>%1</b>" ).arg( title ) );
+ listbox->insertStringList( linkNames );
+ listbox->setCurrentItem( listbox->firstItem() );
+ listbox->setFocus();
+}
+
+TQString TopicChooser::link() const
+{
+ if ( listbox->currentItem() == -1 )
+ return TQString();
+ TQString s = listbox->currentText();
+ if ( s.isEmpty() )
+ return s;
+ int i = linkNames.tqfindIndex( s );
+ return links[ i ];
+}
+
+TQString TopicChooser::getLink( TQWidget *tqparent, const TQStringList &lnkNames,
+ const TQStringList &lnks, const TQString &title )
+{
+ TopicChooser *dlg = new TopicChooser( tqparent, lnkNames, lnks, title );
+ TQString lnk;
+ if ( dlg->exec() == TQDialog::Accepted )
+ lnk = dlg->link();
+ delete dlg;
+ return lnk;
+}
diff --git a/tqtinterface/qt4/tools/assistant/topicchooserimpl.h b/tqtinterface/qt4/tools/assistant/topicchooserimpl.h
new file mode 100644
index 0000000..1bfd10b
--- /dev/null
+++ b/tqtinterface/qt4/tools/assistant/topicchooserimpl.h
@@ -0,0 +1,60 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Assistant.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TOPICCHOOSERIMPL_H
+#define TOPICCHOOSERIMPL_H
+
+#include "topicchooser.h"
+
+#include <tqstringlist.h>
+
+class TopicChooser : public TopicChooserBase
+{
+ TQ_OBJECT
+
+public:
+ TopicChooser( TQWidget *tqparent, const TQStringList &lnkNames,
+ const TQStringList &lnks, const TQString &title );
+
+ TQString link() const;
+
+ static TQString getLink( TQWidget *tqparent, const TQStringList &lnkNames,
+ const TQStringList &lnks, const TQString &title );
+
+private:
+ TQString theLink;
+ TQStringList links, linkNames;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/LICENSE.GPL b/tqtinterface/qt4/tools/designer/LICENSE.GPL
new file mode 100644
index 0000000..149f4ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/LICENSE.GPL
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which tqcontains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part tqcontains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it tqcontains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/tqtinterface/qt4/tools/designer/app/app.pro b/tqtinterface/qt4/tools/designer/app/app.pro
new file mode 100644
index 0000000..bbb592c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/app/app.pro
@@ -0,0 +1,26 @@
+TEMPLATE = app
+TARGET = designer
+
+CONFIG -= tqmoc
+DESTDIR = $$QT_BUILD_TREE/bin
+
+SOURCES += main.cpp
+INCLUDEPATH += ../designer
+LIBS += -ldesignercore -lqui -ltqassistantclient -L$$QT_BUILD_TREE/lib
+win32 {
+ RC_FILE = designer.rc
+ win32-g++ {
+ TARGETDEPS += $$QT_BUILD_TREE/lib/libdesignercore.a
+ } else {
+ TARGETDEPS += $$QT_BUILD_TREE/lib/designercore.lib
+ }
+}
+mac {
+ RC_FILE = designer.icns
+ QMAKE_INFO_PLIST = Info_mac.plist
+ staticlib:CONFIG -= global_init_link_order #yuck
+}
+
+
+target.path=$$bins.path
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/app/designer.icns b/tqtinterface/qt4/tools/designer/app/designer.icns
new file mode 100644
index 0000000..211cc24
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/app/designer.icns
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/app/designer.ico b/tqtinterface/qt4/tools/designer/app/designer.ico
new file mode 100644
index 0000000..7312d20
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/app/designer.ico
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/app/designer.rc b/tqtinterface/qt4/tools/designer/app/designer.rc
new file mode 100644
index 0000000..4b6324b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/app/designer.rc
@@ -0,0 +1,2 @@
+IDI_ICON1 ICON DISCARDABLE "designer.ico"
+
diff --git a/tqtinterface/qt4/tools/designer/app/main.cpp b/tqtinterface/qt4/tools/designer/app/main.cpp
new file mode 100644
index 0000000..5f31ff5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/app/main.cpp
@@ -0,0 +1,228 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqplatformdefs.h"
+
+// SCO OpenServer redefines raise -> kill
+#if defined(raise)
+# undef raise
+#endif
+
+#include "mainwindow.h"
+#include "formwindow.h"
+
+#include "designerapp.h"
+
+#include <tqtextstream.h>
+#include <tqobjectlist.h>
+#include <tqsettings.h>
+#include <tqsplashscreen.h>
+#include <tqdir.h>
+
+#include <stdlib.h>
+#include <signal.h>
+
+// SCO OpenServer redefines raise -> kill
+#if defined(raise)
+# undef raise
+#endif
+
+#if defined(TQ_WS_WIN)
+#include <tqt_windows.h>
+#include <process.h>
+#endif
+
+#if defined(TQ_OS_UNIX)
+#if defined(TQ_C_CALLBACKS)
+extern "C" {
+#endif
+
+static void signalHandler( TQT_SIGNAL_ARGS )
+{
+ TQFile f( TQDir::homeDirPath() + "/.designerargs" );
+ f.open( IO_ReadOnly );
+ TQString args;
+ f.readLine( args, f.size() );
+ TQStringList lst = TQStringList::split( " ", args );
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ TQString arg = (*it).stripWhiteSpace();
+ if ( arg[0] != '-' ) {
+ TQObjectList* l = MainWindow::self->queryList( "FormWindow" );
+ FormWindow* fw = (FormWindow*) l->first();
+#if 0 // ### what's this dead code for?
+ FormWindow* totop;
+#endif
+ bool haveit = FALSE;
+ while ( fw ) {
+ haveit = haveit || fw->fileName() == arg;
+#if 0 // ### what's this dead code for?
+ if ( haveit )
+ totop = fw;
+#endif
+ fw = (FormWindow*) l->next();
+ }
+ if ( !haveit )
+ MainWindow::self->openFormWindow( arg );
+ }
+ }
+ MainWindow::self->raise();
+ MainWindow::self->setActiveWindow();
+}
+
+#if defined(TQ_C_CALLBACKS)
+}
+#endif
+
+#endif
+
+#if defined(TQ_C_CALLBACKS)
+extern "C" {
+#endif
+
+static void exitHandler( TQT_SIGNAL_ARGS )
+{
+ TQDir d( TQDir::homeDirPath() );
+ d.remove( ".designerpid" );
+ exit( -1 );
+}
+
+#if defined(TQ_C_CALLBACKS)
+}
+#endif
+
+int main( int argc, char *argv[] )
+{
+ TQApplication::setColorSpec( TQApplication::ManyColor );
+
+ DesignerApplication a( argc, argv );
+
+ DesignerApplication::setOverrideCursor( TQt::WaitCursor );
+
+ bool creatPid = FALSE;
+ if ( a.argc() > 1 ) {
+ TQString arg1 = a.argv()[ 1 ];
+ if ( arg1 == "-client" ) {
+ TQFile pf( TQDir::homeDirPath() + "/.designerpid" );
+ if ( pf.exists() && pf.open( IO_ReadOnly ) ) {
+ TQString pidStr;
+ pf.readLine( pidStr, pf.size() );
+ TQFile f( TQDir::homeDirPath() + "/.designerargs" );
+ f.open( IO_WriteOnly );
+ TQTextStream ts( &f );
+ for ( int i = 1; i < a.argc(); ++i )
+ ts << a.argv()[ i ] << " ";
+ ts << endl;
+ f.close();
+#if defined(TQ_OS_UNIX)
+ if ( kill( pidStr.toInt(), SIGUSR1 ) == -1 )
+ creatPid = TRUE;
+ else
+ return 0;
+#elif defined(TQ_OS_WIN32)
+ if ( !GetProcessVersion( pidStr.toUInt() ) ) {
+ creatPid = TRUE;
+ } else {
+ if ( a.winVersion() & TQt::WV_NT_based )
+ SendMessage( HWND_BROADCAST, RegisterWindowMessage((TCHAR*)"TQT_DESIGNER_OPEN_FILE"), 0, 0 );
+ else
+ SendMessage( HWND_BROADCAST, RegisterWindowMessageA("TQT_DESIGNER_OPEN_FILE"), 0, 0 );
+ return 0;
+ }
+#endif
+ } else {
+ creatPid = TRUE;
+ }
+ } else if(arg1 == "-debug_stderr") {
+ extern bool debugToStderr; //outputwindow.cpp
+ debugToStderr = TRUE;
+ }
+ }
+
+ if ( creatPid ) {
+ TQFile pf( TQDir::homeDirPath() + "/.designerpid" );
+ pf.open( IO_WriteOnly );
+ TQTextStream ts( &pf );
+#if defined(TQ_OS_UNIX)
+ signal( SIGUSR1, signalHandler );
+#endif
+ ts << getpid() << endl;
+
+ pf.close();
+ signal( SIGABRT, exitHandler );
+ signal( SIGFPE, exitHandler );
+ signal( SIGILL, exitHandler );
+ signal( SIGINT, exitHandler );
+ signal( SIGSEGV, exitHandler );
+ signal( SIGTERM, exitHandler );
+ }
+
+ extern void qInitImages_designercore();
+ qInitImages_designercore();
+
+ TQSettings config;
+ TQString keybase = DesignerApplication::settingsKey();
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+ TQStringList pluginPaths = config.readListEntry( keybase + "PluginPaths" );
+ if (pluginPaths.count())
+ TQApplication::tqsetLibraryPaths(pluginPaths);
+
+ TQSplashScreen *splash = a.showSplash();
+
+ MainWindow *mw = new MainWindow( creatPid );
+ a.setMainWidget( mw );
+#if defined(TQT_NON_COMMERCIAL)
+ mw->setCaption( "TQt Designer by Trolltech for non-commercial use" );
+#else
+ mw->setCaption( "TQt Designer by Trolltech" );
+#endif
+ if ( config.readBoolEntry( keybase + "Geometries/MainwindowMaximized", FALSE ) ) {
+ int x = config.readNumEntry( keybase + "Geometries/MainwindowX", 0 );
+ int y = config.readNumEntry( keybase + "Geometries/MainwindowY", 0 );
+ mw->move( x, y );
+ mw->showMaximized();
+ } else {
+ mw->show();
+ }
+ if ( splash )
+ splash->finish( mw );
+ delete splash;
+
+ TQApplication::restoreOverrideCursor();
+ for ( int i = 1; i < a.argc(); ++i ) {
+ TQString arg = a.argv()[ i ];
+ if ( arg[0] != '-' )
+ mw->fileOpen( "", "", arg );
+ }
+
+ return a.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer.pro b/tqtinterface/qt4/tools/designer/designer.pro
new file mode 100644
index 0000000..98af8c9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer.pro
@@ -0,0 +1,12 @@
+TEMPLATE = subdirs
+
+CONFIG += ordered
+
+SUBDIRS = uic \
+ uilib \
+ designer #\
+# app
+
+dll:SUBDIRS *= editor plugins
+shared:SUBDIRS *= editor plugins
+REQUIRES=full-config nocrosscompiler
diff --git a/tqtinterface/qt4/tools/designer/designer/about.ui b/tqtinterface/qt4/tools/designer/designer/about.ui
new file mode 100644
index 0000000..db2e11b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/about.ui
@@ -0,0 +1,222 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AboutDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>AboutDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>544</width>
+ <height>667</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Qt Designer</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>aboutPixmap</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_splash.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="tqalignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>aboutVersion</cstring>
+ </property>
+ <property name="text">
+ <string>Version 3.2</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>aboutCopyright</cstring>
+ </property>
+ <property name="text">
+ <string>Copyright (C) 2000-2008 Trolltech ASA. All Rights Reserved.</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>aboutLicense</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Qt Commercial Edition license holders: This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Qt Open Source Edition users: This program is licensed to you under the terms of the GNU General Public License Version 2. For details, see the file LICENSE.GPL that came with this software distribution.&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</string>
+ </property>
+ <property name="tqalignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>AboutDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/actiondnd.cpp b/tqtinterface/qt4/tools/designer/designer/actiondnd.cpp
new file mode 100644
index 0000000..d52fad4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/actiondnd.cpp
@@ -0,0 +1,743 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "actiondnd.h"
+#include "command.h"
+#include "defs.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "widgetfactory.h"
+#include "hierarchyview.h"
+
+#include <tqaction.h>
+#include <tqapplication.h>
+#include <tqbitmap.h>
+#include <tqdragobject.h>
+#include <tqinputdialog.h>
+#include <tqlayout.h>
+#include <tqmainwindow.h>
+#include <tqmenudata.h>
+#include <tqmessagebox.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
+
+TQAction *ActionDrag::the_action = 0;
+
+ActionDrag::ActionDrag(TQAction *action, TQWidget *source)
+: TQStoredDrag("application/x-designer-actions", source)
+{
+ TQ_ASSERT(the_action == 0);
+ the_action = action;
+}
+
+ActionDrag::ActionDrag(TQActionGroup *group, TQWidget *source)
+: TQStoredDrag("application/x-designer-actiongroup", source)
+{
+ TQ_ASSERT(the_action == 0);
+ the_action = group;
+}
+
+ActionDrag::ActionDrag(const TQString &type, TQAction *action, TQWidget *source)
+: TQStoredDrag(type, source)
+{
+ TQ_ASSERT(the_action == 0);
+ the_action = action;
+}
+
+bool ActionDrag::canDecode(TQDropEvent *e)
+{
+ return e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-actiongroup" ) ||
+ e->provides( "application/x-designer-separator" );
+}
+
+ActionDrag::~ActionDrag()
+{
+ the_action = 0;
+}
+
+void TQDesignerAction::init()
+{
+ MetaDataBase::addEntry( this );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( this ) );
+ WidgetFactory::saveDefaultProperties( this, id );
+ WidgetFactory::saveChangedProperties( this, id );
+}
+
+void TQDesignerActionGroup::init()
+{
+ MetaDataBase::addEntry( this );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( this ) );
+ WidgetFactory::saveDefaultProperties( this, id );
+ WidgetFactory::saveChangedProperties( this, id );
+}
+
+bool TQDesignerAction::addTo( TQWidget *w )
+{
+ if ( !widgetToInsert )
+ return TQAction::addTo( w );
+
+ if ( ::tqqt_cast<TQPopupMenu*>(w) )
+ return FALSE;
+
+ widgetToInsert->reparent( w, TQPoint( 0, 0 ), FALSE );
+ widgetToInsert->show();
+ addedTo( widgetToInsert, w );
+ return TRUE;
+}
+
+bool TQDesignerAction::removeFrom( TQWidget *w )
+{
+ if ( !widgetToInsert )
+ return TQAction::removeFrom( w );
+
+ remove();
+ return TRUE;
+}
+
+void TQDesignerAction::remove()
+{
+ if ( !widgetToInsert )
+ return;
+ MainWindow::self->formWindow()->selectWidget( widgetToInsert, FALSE );
+ widgetToInsert->reparent( 0, TQPoint( 0, 0 ), FALSE );
+}
+
+class TQDesignerIndicatorWidget : public TQWidget
+{
+ TQ_OBJECT
+
+public:
+ TQDesignerIndicatorWidget( TQWidget *p )
+ : TQWidget( p, "qt_dockwidget_internal" ) {
+ setBackgroundColor( Qt::red );
+ }
+
+};
+
+TQDesignerToolBarSeparator::TQDesignerToolBarSeparator(Qt::Orientation o , TQToolBar *tqparent,
+ const char* name )
+ : TQWidget( tqparent, name )
+{
+ connect( tqparent, TQT_SIGNAL(orientationChanged(Qt::Orientation)),
+ this, TQT_SLOT(setOrientation(Qt::Orientation)) );
+ setOrientation( o );
+ setBackgroundMode( tqparent->backgroundMode() );
+ setBackgroundOrigin( ParentOrigin );
+ tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
+}
+
+void TQDesignerToolBarSeparator::setOrientation( Qt::Orientation o )
+{
+ orient = o;
+}
+
+void TQDesignerToolBarSeparator::styleChange( TQStyle& )
+{
+ setOrientation( orient );
+}
+
+TQSize TQDesignerToolBarSeparator::tqsizeHint() const
+{
+ int extent = tqstyle().tqpixelMetric( TQStyle::PM_DockWindowSeparatorExtent,
+ this );
+ if ( orient == Qt::Horizontal )
+ return TQSize( extent, 0 );
+ else
+ return TQSize( 0, extent );
+}
+
+void TQDesignerToolBarSeparator::paintEvent( TQPaintEvent * )
+{
+ TQPainter p( this );
+ TQStyle::SFlags flags = TQStyle::Style_Default;
+
+ if ( orientation() == Qt::Horizontal )
+ flags |= TQStyle::Style_Horizontal;
+
+ tqstyle().tqdrawPrimitive( TQStyle::PE_DockWindowSeparator, &p, rect(),
+ tqcolorGroup(), flags );
+}
+
+
+
+TQSeparatorAction::TQSeparatorAction( TQObject *tqparent )
+ : TQAction( tqparent, "qt_designer_separator" ), wid( 0 )
+{
+}
+
+bool TQSeparatorAction::addTo( TQWidget *w )
+{
+ if ( ::tqqt_cast<TQToolBar*>(w) ) {
+ TQToolBar *tb = (TQToolBar*)w;
+ wid = new TQDesignerToolBarSeparator( tb->orientation(), tb );
+ return TRUE;
+ } else if ( ::tqqt_cast<TQPopupMenu*>(w) ) {
+ idx = ( (TQPopupMenu*)w )->count();
+ ( (TQPopupMenu*)w )->insertSeparator( idx );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool TQSeparatorAction::removeFrom( TQWidget *w )
+{
+ if ( ::tqqt_cast<TQToolBar*>(w) ) {
+ delete wid;
+ return TRUE;
+ } else if ( ::tqqt_cast<TQPopupMenu*>(w) ) {
+ ( (TQPopupMenu*)w )->removeItemAt( idx );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+TQWidget *TQSeparatorAction::widget() const
+{
+ return wid;
+}
+
+
+
+TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw )
+ : TQToolBar( mw ), lastIndicatorPos( -1, -1 )
+{
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ setAcceptDrops( TRUE );
+ MetaDataBase::addEntry( this );
+ lastIndicatorPos = TQPoint( -1, -1 );
+ indicator = new TQDesignerIndicatorWidget( this );
+ indicator->hide();
+ installEventFilter( this );
+ widgetInserting = FALSE;
+ tqfindFormWindow();
+ mw->setDockEnabled( TQt::DockTornOff, FALSE );
+}
+
+TQDesignerToolBar::TQDesignerToolBar( TQMainWindow *mw, TQt::Dock dock )
+ : TQToolBar( TQString(), mw, dock), lastIndicatorPos( -1, -1 )
+{
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ setAcceptDrops( TRUE );
+ indicator = new TQDesignerIndicatorWidget( this );
+ indicator->hide();
+ MetaDataBase::addEntry( this );
+ installEventFilter( this );
+ widgetInserting = FALSE;
+ tqfindFormWindow();
+ mw->setDockEnabled( TQt::DockTornOff, FALSE );
+}
+
+void TQDesignerToolBar::tqfindFormWindow()
+{
+ TQWidget *w = this;
+ while ( w ) {
+ formWindow = ::tqqt_cast<FormWindow*>(w);
+ if ( formWindow )
+ break;
+ w = w->parentWidget();
+ }
+}
+
+void TQDesignerToolBar::addAction( TQAction *a )
+{
+ actionList.append( a );
+ connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( actionRemoved() ) );
+ if ( ::tqqt_cast<TQActionGroup*>(a) ) {
+ ( (TQDesignerActionGroup*)a )->widget()->installEventFilter( this );
+ actionMap.insert( ( (TQDesignerActionGroup*)a )->widget(), a );
+ } else if ( ::tqqt_cast<TQSeparatorAction*>(a) ) {
+ ( (TQSeparatorAction*)a )->widget()->installEventFilter( this );
+ actionMap.insert( ( (TQSeparatorAction*)a )->widget(), a );
+ } else {
+ ( (TQDesignerAction*)a )->widget()->installEventFilter( this );
+ actionMap.insert( ( (TQDesignerAction*)a )->widget(), a );
+ }
+}
+
+static void fixObject( TQObject *&o )
+{
+ while ( o && o->tqparent() && !::tqqt_cast<TQDesignerToolBar*>(o->tqparent()) )
+ o = o->tqparent();
+}
+
+bool TQDesignerToolBar::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( !o || !e || o->inherits( "TQDockWindowHandle" ) || o->inherits( "TQDockWindowTitleBar" ) )
+ return TQToolBar::eventFilter( o, e );
+
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) && e->type() == TQEvent::MouseButtonPress &&
+ ( ( TQMouseEvent*)e )->button() == Qt::LeftButton ) {
+ mousePressEvent( (TQMouseEvent*)e );
+ return TRUE;
+ }
+
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) )
+ return TQToolBar::eventFilter( o, e );
+
+ if ( e->type() == TQEvent::MouseButtonPress ) {
+ TQMouseEvent *ke = (TQMouseEvent*)e;
+ fixObject( o );
+ if ( !o )
+ return FALSE;
+ buttonMousePressEvent( ke, o );
+ return TRUE;
+ } else if(e->type() == TQEvent::ContextMenu ) {
+ TQContextMenuEvent *ce = (TQContextMenuEvent*)e;
+ fixObject( o );
+ if( !o )
+ return FALSE;
+ buttonContextMenuEvent( ce, o );
+ return TRUE;
+ } else if ( e->type() == TQEvent::MouseMove ) {
+ TQMouseEvent *ke = (TQMouseEvent*)e;
+ fixObject( o );
+ if ( !o )
+ return FALSE;
+ buttonMouseMoveEvent( ke, o );
+ return TRUE;
+ } else if ( e->type() == TQEvent::MouseButtonRelease ) {
+ TQMouseEvent *ke = (TQMouseEvent*)e;
+ fixObject( o );
+ if ( !o )
+ return FALSE;
+ buttonMouseReleaseEvent( ke, o );
+ return TRUE;
+ } else if ( e->type() == TQEvent::DragEnter ) {
+ TQDragEnterEvent *de = (TQDragEnterEvent*)e;
+ if (ActionDrag::canDecode(de))
+ de->accept();
+ } else if ( e->type() == TQEvent::DragMove ) {
+ TQDragMoveEvent *de = (TQDragMoveEvent*)e;
+ if (ActionDrag::canDecode(de))
+ de->accept();
+ }
+
+ return TQToolBar::eventFilter( o, e );
+}
+
+void TQDesignerToolBar::paintEvent( TQPaintEvent *e )
+{
+ TQToolBar::paintEvent( e );
+ if ( e->rect() != rect() )
+ return;
+ lastIndicatorPos = TQPoint( -1, -1 );
+}
+
+void TQDesignerToolBar::contextMenuEvent( TQContextMenuEvent *e )
+{
+ e->accept();
+ TQPopupMenu menu( 0 );
+ menu.insertItem( tr( "Delete Toolbar" ), 1 );
+ int res = menu.exec( e->globalPos() );
+ if ( res != -1 ) {
+ RemoveToolBarCommand *cmd = new RemoveToolBarCommand( tr( "Delete Toolbar '%1'" ).arg( name() ),
+ formWindow, 0, this );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void TQDesignerToolBar::mousePressEvent( TQMouseEvent *e )
+{
+ widgetInserting = FALSE;
+ if ( e->button() == Qt::LeftButton &&
+ MainWindow::self->currentTool() != POINTER_TOOL &&
+ MainWindow::self->currentTool() != ORDER_TOOL &&
+ MainWindow::self->currentTool() != CONNECT_TOOL &&
+ MainWindow::self->currentTool() != BUDDY_TOOL )
+ widgetInserting = TRUE;
+}
+
+void TQDesignerToolBar::mouseReleaseEvent( TQMouseEvent *e )
+{
+ if ( widgetInserting )
+ doInsertWidget( mapFromGlobal( e->globalPos() ) );
+ widgetInserting = FALSE;
+}
+
+void TQDesignerToolBar::buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *w )
+{
+ if ( widgetInserting )
+ doInsertWidget( mapFromGlobal( e->globalPos() ) );
+ else if ( w->isWidgetType() && formWindow->widgets()->tqfind( w ) ) {
+ formWindow->clearSelection( FALSE );
+ formWindow->selectWidget( w );
+ }
+ widgetInserting = FALSE;
+}
+
+void TQDesignerToolBar::buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *o )
+{
+ e->accept();
+ TQPopupMenu menu( 0 );
+ const int ID_DELETE = 1;
+ const int ID_SEP = 2;
+ const int ID_DELTOOLBAR = 3;
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( (TQWidget*)o );
+ if ( it != actionMap.end() && ::tqqt_cast<TQSeparatorAction*>(*it) )
+ menu.insertItem( tr( "Delete Separator" ), ID_DELETE );
+ else
+ menu.insertItem( tr( "Delete Item" ), ID_DELETE );
+ menu.insertItem( tr( "Insert Separator" ), ID_SEP );
+ menu.insertSeparator();
+ menu.insertItem( tr( "Delete Toolbar" ), ID_DELTOOLBAR );
+ int res = menu.exec( e->globalPos() );
+ if ( res == ID_DELETE ) {
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( (TQWidget*)o );
+ if ( it == actionMap.end() )
+ return;
+ TQAction *a = *it;
+ int index = actionList.tqfind( a );
+ RemoveActionFromToolBarCommand *cmd = new RemoveActionFromToolBarCommand(
+ tr( "Delete Action '%1' from Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( res == ID_SEP ) {
+ calcIndicatorPos( mapFromGlobal( e->globalPos() ) );
+ TQAction *a = new TQSeparatorAction( 0 );
+ int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) );
+ if ( index != -1 && afterAnchor )
+ ++index;
+ if ( !insertAnchor )
+ index = 0;
+
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand(
+ tr( "Add Separator to Toolbar '%1'" ).
+ arg( a->name() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( res == ID_DELTOOLBAR ) {
+ RemoveToolBarCommand *cmd = new RemoveToolBarCommand( tr( "Delete Toolbar '%1'" ).arg( name() ),
+ formWindow, 0, this );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void TQDesignerToolBar::buttonMousePressEvent( TQMouseEvent *e, TQObject * )
+{
+ widgetInserting = FALSE;
+
+ if ( e->button() == Qt::MidButton )
+ return;
+
+ if ( e->button() == Qt::LeftButton &&
+ MainWindow::self->currentTool() != POINTER_TOOL &&
+ MainWindow::self->currentTool() != ORDER_TOOL &&
+ MainWindow::self->currentTool() != CONNECT_TOOL &&
+ MainWindow::self->currentTool() != BUDDY_TOOL ) {
+ widgetInserting = TRUE;
+ return;
+ }
+
+ dragStartPos = e->pos();
+}
+
+void TQDesignerToolBar::removeWidget( TQWidget *w )
+{
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( w );
+ if ( it == actionMap.end() )
+ return;
+ TQAction *a = *it;
+ int index = actionList.tqfind( a );
+ RemoveActionFromToolBarCommand *cmd =
+ new RemoveActionFromToolBarCommand( tr( "Delete Action '%1' from Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ TQApplication::sendPostedEvents();
+ adjustSize();
+}
+
+void TQDesignerToolBar::buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o )
+{
+ if ( widgetInserting || ( e->state() & Qt::LeftButton ) == 0 )
+ return;
+ if ( TQABS( TQPoint( dragStartPos - e->pos() ).manhattanLength() ) < TQApplication::startDragDistance() )
+ return;
+ TQMap<TQWidget*, TQAction*>::Iterator it = actionMap.tqfind( (TQWidget*)o );
+ if ( it == actionMap.end() )
+ return;
+ TQAction *a = *it;
+ if ( !a )
+ return;
+ int index = actionList.tqfind( a );
+ RemoveActionFromToolBarCommand *cmd =
+ new RemoveActionFromToolBarCommand( tr( "Delete Action '%1' from Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ TQApplication::sendPostedEvents();
+ adjustSize();
+
+ TQString type = ::tqqt_cast<TQActionGroup*>(a) ? TQString( "application/x-designer-actiongroup" ) :
+ ::tqqt_cast<TQSeparatorAction*>(a) ? TQString( "application/x-designer-separator" ) : TQString( "application/x-designer-actions" );
+ TQStoredDrag *drag = new ActionDrag( type, a, this );
+ drag->setPixmap( a->iconSet().pixmap() );
+ if ( ::tqqt_cast<TQDesignerAction*>(a) ) {
+ if ( formWindow->widgets()->tqfind( ( (TQDesignerAction*)a )->widget() ) )
+ formWindow->selectWidget( ( (TQDesignerAction*)a )->widget(), FALSE );
+ }
+ if ( !drag->drag() ) {
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( tr( "Add Action '%1' to Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ lastIndicatorPos = TQPoint( -1, -1 );
+ indicator->hide();
+}
+
+#ifndef TQT_NO_DRAGANDDROP
+
+void TQDesignerToolBar::dragEnterEvent( TQDragEnterEvent *e )
+{
+ widgetInserting = FALSE;
+ lastIndicatorPos = TQPoint( -1, -1 );
+ if (ActionDrag::canDecode(e))
+ e->accept();
+}
+
+void TQDesignerToolBar::dragMoveEvent( TQDragMoveEvent *e )
+{
+ if (ActionDrag::canDecode(e)) {
+ e->accept();
+ drawIndicator( calcIndicatorPos( e->pos() ) );
+ }
+}
+
+void TQDesignerToolBar::dragLeaveEvent( TQDragLeaveEvent * )
+{
+ indicator->hide();
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+}
+
+void TQDesignerToolBar::dropEvent( TQDropEvent *e )
+{
+ if (!ActionDrag::canDecode(e))
+ return;
+
+ e->accept();
+
+ indicator->hide();
+ TQAction *a = 0;
+ int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) );
+ if ( index != -1 && afterAnchor )
+ ++index;
+ if ( !insertAnchor )
+ index = 0;
+ if ( e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-separator" ) ) {
+ if ( e->provides( "application/x-designer-actions" ) )
+ a = ::tqqt_cast<TQDesignerAction*>(ActionDrag::action());
+ else
+ a = ::tqqt_cast<TQSeparatorAction*>(ActionDrag::action());
+ } else {
+ a = ::tqqt_cast<TQDesignerActionGroup*>(ActionDrag::action());
+ }
+
+ if ( actionList.tqfindRef( a ) != -1 ) {
+ TQMessageBox::warning( MainWindow::self, tr( "Insert/Move Action" ),
+ tr( "Action '%1' has already been added to this toolbar.\n"
+ "An Action may only occur once in a given toolbar." ).
+ arg( a->name() ) );
+ return;
+ }
+
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( tr( "Add Action '%1' to Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+
+ lastIndicatorPos = TQPoint( -1, -1 );
+}
+
+#endif
+
+void TQDesignerToolBar::reInsert()
+{
+ TQAction *a = 0;
+ actionMap.clear();
+ clear();
+ for ( a = actionList.first(); a; a = actionList.next() ) {
+ a->addTo( this );
+ if ( ::tqqt_cast<TQActionGroup*>(a) ) {
+ actionMap.insert( ( (TQDesignerActionGroup*)a )->widget(), a );
+ if ( ( (TQDesignerActionGroup*)a )->widget() )
+ ( (TQDesignerActionGroup*)a )->widget()->installEventFilter( this );
+ } else if ( ::tqqt_cast<TQDesignerAction*>(a) ) {
+ actionMap.insert( ( (TQDesignerAction*)a )->widget(), a );
+ ( (TQDesignerAction*)a )->widget()->installEventFilter( this );
+ } else if ( ::tqqt_cast<TQSeparatorAction*>(a) ) {
+ actionMap.insert( ( (TQSeparatorAction*)a )->widget(), a );
+ ( (TQSeparatorAction*)a )->widget()->installEventFilter( this );
+ }
+ }
+ TQApplication::sendPostedEvents();
+ adjustSize();
+}
+
+void TQDesignerToolBar::actionRemoved()
+{
+ actionList.removeRef( (TQAction*)sender() );
+}
+
+TQPoint TQDesignerToolBar::calcIndicatorPos( const TQPoint &pos )
+{
+ if ( orientation() == Qt::Horizontal ) {
+ TQPoint pnt( width() - 2, 0 );
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ if ( childrenListObject().isEmpty() )
+ return pnt;
+ pnt = TQPoint( 13, 0 );
+ TQObjectListIt it( childrenListObject() );
+ TQObject * obj;
+ while( (obj=it.current()) != 0 ) {
+ ++it;
+ if ( obj->isWidgetType() &&
+ qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
+ TQWidget *w = (TQWidget*)obj;
+ if ( w->x() < pos.x() ) {
+ pnt.setX( w->x() + w->width() + 1 );
+ insertAnchor = w;
+ afterAnchor = TRUE;
+ }
+ }
+ }
+ return pnt;
+ } else {
+ TQPoint pnt( 0, height() - 2 );
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ if ( childrenListObject().isEmpty() )
+ return pnt;
+ pnt = TQPoint( 0, 13 );
+ TQObjectListIt it( childrenListObject() );
+ TQObject * obj;
+ while( (obj=it.current()) != 0 ) {
+ ++it;
+ if ( obj->isWidgetType() &&
+ qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
+ TQWidget *w = (TQWidget*)obj;
+ if ( w->y() < pos.y() ) {
+ pnt.setY( w->y() + w->height() + 1 );
+ insertAnchor = w;
+ afterAnchor = TRUE;
+ }
+ }
+ }
+ return pnt;
+ }
+}
+
+void TQDesignerToolBar::drawIndicator( const TQPoint &pos )
+{
+ if ( lastIndicatorPos == pos )
+ return;
+ bool wasVsisible = indicator->isVisible();
+ if ( orientation() == Qt::Horizontal ) {
+ indicator->resize( 3, height() );
+ if ( pos != TQPoint( -1, -1 ) )
+ indicator->move( pos.x() - 1, 0 );
+ indicator->show();
+ indicator->raise();
+ lastIndicatorPos = pos;
+ } else {
+ indicator->resize( width(), 3 );
+ if ( pos != TQPoint( -1, -1 ) )
+ indicator->move( 0, pos.y() - 1 );
+ indicator->show();
+ indicator->raise();
+ lastIndicatorPos = pos;
+ }
+ if ( !wasVsisible )
+ TQApplication::sendPostedEvents();
+}
+
+void TQDesignerToolBar::doInsertWidget( const TQPoint &p )
+{
+ if ( formWindow != MainWindow::self->formWindow() )
+ return;
+ calcIndicatorPos( p );
+ TQWidget *w = WidgetFactory::create( MainWindow::self->currentTool(), this, 0, TRUE );
+ installEventFilters( w );
+ MainWindow::self->formWindow()->insertWidget( w, TRUE );
+ TQDesignerAction *a = new TQDesignerAction( w, tqparent() );
+ int index = actionList.tqfindRef( *actionMap.tqfind( insertAnchor ) );
+ if ( index != -1 && afterAnchor )
+ ++index;
+ if ( !insertAnchor )
+ index = 0;
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( tr( "Add Widget '%1' to Toolbar '%2'" ).
+ arg( w->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ MainWindow::self->resetTool();
+}
+
+void TQDesignerToolBar::clear()
+{
+ for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
+ if ( ::tqqt_cast<TQDesignerAction*>(a) )
+ ( (TQDesignerAction*)a )->remove();
+ }
+ TQToolBar::clear();
+}
+
+void TQDesignerToolBar::installEventFilters( TQWidget *w )
+{
+ if ( !w )
+ return;
+ TQObjectList *l = w->queryList( "TQWidget" );
+ for ( TQObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( this );
+ delete l;
+}
+
+#include "actiondnd.tqmoc"
diff --git a/tqtinterface/qt4/tools/designer/designer/actiondnd.h b/tqtinterface/qt4/tools/designer/designer/actiondnd.h
new file mode 100644
index 0000000..adde1b4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/actiondnd.h
@@ -0,0 +1,248 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ACTIONDND_H
+#define ACTIONDND_H
+
+#include <tqaction.h>
+#include <tqdragobject.h>
+#include <tqmap.h>
+#include <tqmenubar.h>
+#include <tqpixmap.h>
+#include <tqpopupmenu.h>
+#include <tqptrlist.h>
+#include <tqtoolbar.h>
+#include <tqguardedptr.h>
+#include "../shared/widgetdatabase.h"
+
+//class TQDesignerPopupMenu;
+class TQDesignerIndicatorWidget;
+class FormWindow;
+class TQPopupMenu;
+
+class ActionDrag : public TQStoredDrag
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ActionDrag(const TQString &type, TQAction *action, TQWidget *source);
+ ActionDrag(TQAction *action, TQWidget *source);
+ ActionDrag(TQActionGroup *group, TQWidget *source);
+
+ ~ActionDrag();
+
+ static bool canDecode(TQDropEvent *e);
+
+ static TQAction *action()
+ {
+ return the_action;
+ }
+
+private:
+ static TQAction *the_action;
+};
+
+class TQDesignerActionGroup : public TQActionGroup
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQDesignerActionGroup( TQObject *tqparent )
+ : TQActionGroup( ::tqqt_cast<TQActionGroup*>(tqparent) ? tqparent : 0 ), wid( 0 ), idx( -1 ) { init(); }
+
+ void init();
+
+ TQWidget *widget() const { return wid; }
+ TQWidget *widget( TQAction *a ) const { return *widgets.tqfind( a ); }
+ int index() const { return idx; }
+
+protected:
+#if !defined(TQ_NO_USING_KEYWORD)
+ using TQActionGroup::addedTo;
+#endif
+ void addedTo( TQWidget *w, TQWidget * ) {
+ wid = w;
+ }
+ void addedTo( TQWidget *w, TQWidget *, TQAction *a ) {
+ widgets.insert( a, w );
+ }
+ void addedTo( int index, TQPopupMenu * ) {
+ idx = index;
+ }
+
+private:
+ TQWidget *wid;
+ TQMap<TQAction *, TQWidget *> widgets;
+ int idx;
+
+};
+
+class TQDesignerAction : public TQAction
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQDesignerAction( TQObject *tqparent )
+ : TQAction( ::tqqt_cast<TQActionGroup*>(tqparent) ? tqparent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( 0 ) { init(); }
+ TQDesignerAction( TQWidget *w, TQObject *tqparent )
+ : TQAction( ::tqqt_cast<TQActionGroup*>(tqparent) ? tqparent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( w ) { init(); }
+
+ void init();
+
+ TQWidget *widget() const { return wid; }
+ int index() const { return idx; }
+
+ bool addTo( TQWidget *w );
+ bool removeFrom( TQWidget *w );
+
+ void remove();
+ bool supportsMenu() const { return !widgetToInsert; }
+
+protected:
+ void addedTo( TQWidget *w, TQWidget * ) {
+ wid = w;
+ }
+ void addedTo( int index, TQPopupMenu * ) {
+ idx = index;
+ }
+
+private:
+ TQWidget *wid;
+ int idx;
+ TQWidget *widgetToInsert;
+
+};
+
+class TQDesignerToolBarSeparator : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQDesignerToolBarSeparator( Qt::Orientation, TQToolBar *tqparent, const char* name=0 );
+
+ TQSize tqsizeHint() const;
+ Qt::Orientation orientation() const { return orient; }
+public Q_SLOTS:
+ void setOrientation( Qt::Orientation );
+protected:
+ void styleChange( TQStyle& );
+ void paintEvent( TQPaintEvent * );
+private:
+ Qt::Orientation orient;
+};
+
+
+class TQSeparatorAction : public TQAction
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQSeparatorAction( TQObject *tqparent );
+
+ bool addTo( TQWidget *w );
+ bool removeFrom( TQWidget *w );
+ TQWidget *widget() const;
+ int index() const;
+
+private:
+ TQWidget *wid;
+ int idx;
+
+};
+
+
+class TQDesignerToolBar : public TQToolBar
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQDesignerToolBar( TQMainWindow *mw );
+ TQDesignerToolBar( TQMainWindow *mw, TQt::Dock dock );
+ TQPtrList<TQAction> insertedActions() const { return actionList; }
+ void addAction( TQAction *a );
+
+ void clear();
+ void installEventFilters( TQWidget *w );
+ void insertAction( TQWidget *w, TQAction *a ) { actionMap.insert( w, a ); }
+ void insertAction( int index, TQAction *a ) { actionList.insert( index, a ); }
+ void appendAction( TQAction *a ) { actionList.append( a ); }
+ void removeAction( TQAction *a ) { actionList.remove( a ); }
+ void reInsert();
+ void removeWidget( TQWidget *w );
+
+protected:
+ bool eventFilter( TQObject *, TQEvent * );
+ void paintEvent( TQPaintEvent * );
+#ifndef TQT_NO_DRAGANDDROP
+ void dragEnterEvent( TQDragEnterEvent * );
+ void dragMoveEvent( TQDragMoveEvent * );
+ void dragLeaveEvent( TQDragLeaveEvent * );
+ void dropEvent( TQDropEvent * );
+#endif
+ void contextMenuEvent( TQContextMenuEvent *e );
+ void mousePressEvent( TQMouseEvent *e );
+ void mouseReleaseEvent( TQMouseEvent *e );
+
+private Q_SLOTS:
+ void actionRemoved();
+
+private:
+ void drawIndicator( const TQPoint &pos );
+ TQPoint calcIndicatorPos( const TQPoint &pos );
+ void buttonContextMenuEvent( TQContextMenuEvent *e, TQObject *o );
+ void buttonMousePressEvent( TQMouseEvent *e, TQObject *o );
+ void buttonMouseMoveEvent( TQMouseEvent *e, TQObject *o );
+ void buttonMouseReleaseEvent( TQMouseEvent *e, TQObject *o );
+ void doInsertWidget( const TQPoint &p );
+ void tqfindFormWindow();
+
+private:
+ TQPoint lastIndicatorPos;
+ TQWidget *insertAnchor;
+ bool afterAnchor;
+ TQPtrList<TQAction> actionList;
+ TQMap<TQWidget*, TQAction*> actionMap;
+ TQPoint dragStartPos;
+ TQDesignerIndicatorWidget *indicator;
+ bool widgetInserting;
+ FormWindow *formWindow;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/actioneditor.ui b/tqtinterface/qt4/tools/designer/designer/actioneditor.ui
new file mode 100644
index 0000000..ce3f105
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/actioneditor.ui
@@ -0,0 +1,230 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ActionEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>ActionEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>206</width>
+ <height>227</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Actions</string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQToolButton">
+ <property name="name">
+ <cstring>buttonNewAction</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_filenew.png</pixmap>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Create new Action</string>
+ </property>
+ </widget>
+ <widget class="TQToolButton">
+ <property name="name">
+ <cstring>buttonDeleteAction</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_editcut.png</pixmap>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete current Action</string>
+ </property>
+ </widget>
+ <widget class="TQToolButton">
+ <property name="name">
+ <cstring>buttonConnect</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_connecttool.png</pixmap>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Connect current Action</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="ActionListView">
+ <property name="name">
+ <cstring>listActions</cstring>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>ActionListView</class>
+ <header location="local">actionlistview.h</header>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>selectionChanged( QListViewItem * )</signal>
+ <signal>currentChanged( QListViewItem * )</signal>
+ <signal>clicked( QListViewItem * )</signal>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>listActions</sender>
+ <signal>currentChanged( QListViewItem * )</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>currentActionChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listActions</sender>
+ <signal>clicked( QListViewItem * )</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>currentActionChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listActions</sender>
+ <signal>selectionChanged( QListViewItem * )</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>currentActionChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewAction</sender>
+ <signal>clicked()</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>newAction()</slot>
+ </connection>
+ <connection>
+ <sender>buttonConnect</sender>
+ <signal>clicked()</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>connectionsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteAction</sender>
+ <signal>clicked()</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>deleteAction()</slot>
+ </connection>
+</connections>
+<forwards>
+ <forward>class QListViewItem;</forward>
+</forwards>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">connectionsClicked()</slot>
+ <slot access="protected">currentActionChanged( QListViewItem * )</slot>
+ <slot access="protected">deleteAction()</slot>
+ <slot access="protected">newAction()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/actioneditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/actioneditorimpl.cpp
new file mode 100644
index 0000000..8f4851c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/actioneditorimpl.cpp
@@ -0,0 +1,325 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "actioneditorimpl.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "actionlistview.h"
+#include "connectiondialog.h"
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "formfile.h"
+
+#include <tqaction.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqtoolbutton.h>
+#include <tqlistview.h>
+#include <tqcheckbox.h>
+#include <tqpushbutton.h>
+#include <tqpopupmenu.h>
+#include <tqobjectlist.h>
+
+ActionEditor::ActionEditor( TQWidget* tqparent, const char* name, WFlags fl )
+ : ActionEditorBase( tqparent, name, fl ), currentAction( 0 ), formWindow( 0 ),
+ explicitlyClosed(false)
+{
+ listActions->addColumn( tr( "Actions" ) );
+ setEnabled( FALSE );
+ buttonConnect->setEnabled( FALSE );
+
+ TQPopupMenu *popup = new TQPopupMenu( this );
+ popup->insertItem( tr( "New &Action" ), this, TQT_SLOT( newAction() ) );
+ popup->insertItem( tr( "New Action &Group" ), this, TQT_SLOT( newActionGroup() ) );
+ popup->insertItem( tr( "New &Dropdown Action Group" ), this, TQT_SLOT( newDropDownActionGroup() ) );
+ buttonNewAction->setPopup( popup );
+ buttonNewAction->setPopupDelay( 0 );
+
+ connect( listActions, TQT_SIGNAL( insertAction() ), this, TQT_SLOT( newAction() ) );
+ connect( listActions, TQT_SIGNAL( insertActionGroup() ), this, TQT_SLOT( newActionGroup() ) );
+ connect( listActions, TQT_SIGNAL( insertDropDownActionGroup() ), this, TQT_SLOT( newDropDownActionGroup() ) );
+ connect( listActions, TQT_SIGNAL( deleteAction() ), this, TQT_SLOT( deleteAction() ) );
+ connect( listActions, TQT_SIGNAL( connectAction() ), this, TQT_SLOT( connectionsClicked() ) );
+}
+
+void ActionEditor::closeEvent( TQCloseEvent *e )
+{
+ emit hidden();
+ e->accept();
+}
+
+void ActionEditor::currentActionChanged( TQListViewItem *i )
+{
+ buttonConnect->setEnabled( i != 0 );
+ if ( !i )
+ return;
+ currentAction = ( (ActionItem*)i )->action();
+ if ( !currentAction )
+ currentAction = ( (ActionItem*)i )->actionGroup();
+ if ( formWindow && currentAction )
+ formWindow->setActiveObject( currentAction );
+ MainWindow::self->objectHierarchy()->hierarchyList()->setCurrent( currentAction );
+}
+
+void ActionEditor::setCurrentAction( TQAction *a )
+{
+ TQListViewItemIterator it( listActions );
+ while ( it.current() ) {
+ if ( ( (ActionItem*)it.current() )->action() == a || ( (ActionItem*)it.current() )->actionGroup() == a ) {
+ listActions->setCurrentItem( it.current() );
+ listActions->ensureItemVisible( it.current() );
+ break;
+ }
+ ++it;
+ }
+}
+
+TQAction *ActionEditor::newActionEx()
+{
+ ActionItem *i = new ActionItem( listActions, (bool)FALSE );
+ TQAction *a = i->action();
+ TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ),
+ this, TQT_SLOT( removeConnections( TQObject* ) ) );
+ MetaDataBase::addEntry( i->action() );
+ TQString n = "Action";
+ formWindow->unify( i->action(), n, TRUE );
+ i->setText( 0, n );
+ i->action()->setName( n );
+ i->action()->setText( i->action()->name() );
+ MetaDataBase::setPropertyChanged( i->action(), "text", TRUE );
+ MetaDataBase::setPropertyChanged( i->action(), "name", TRUE );
+ formWindow->actionList().append( i->action() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+ return i->action();
+}
+
+void ActionEditor::deleteAction()
+{
+ if ( !currentAction )
+ return;
+
+ TQListViewItemIterator it( listActions );
+ ActionItem *ai = 0;
+ while ( it.current() ) {
+ ai = (ActionItem*)it.current();
+ if ( ai->action() == currentAction || ai->actionGroup() == currentAction ) {
+ emit removing( currentAction );
+ formWindow->actionList().removeRef( currentAction );
+ delete currentAction;
+ currentAction = 0;
+ delete it.current();
+ break;
+ }
+ ++it;
+ }
+ if ( formWindow ) {
+ formWindow->setActiveObject( formWindow->mainContainer() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+ }
+}
+
+void ActionEditor::newAction()
+{
+ ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
+ if ( actionParent ) {
+ if ( !::tqqt_cast<TQActionGroup*>(actionParent->actionGroup()) )
+ actionParent = (ActionItem*)actionParent->tqparent();
+ }
+
+ ActionItem *i = 0;
+ if ( actionParent )
+ i = new ActionItem( actionParent );
+ else
+ i = new ActionItem( listActions, (bool)FALSE );
+ TQAction *a = i->action();
+ TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ),
+ this, TQT_SLOT( removeConnections( TQObject* ) ) );
+ MetaDataBase::addEntry( i->action() );
+ TQString n = "Action";
+ formWindow->unify( i->action(), n, TRUE );
+ i->setText( 0, n );
+ i->action()->setName( n );
+ i->action()->setText( i->action()->name() );
+ if ( actionParent && actionParent->actionGroup() &&
+ actionParent->actionGroup()->usesDropDown() ) {
+ i->action()->setToggleAction( TRUE );
+ MetaDataBase::setPropertyChanged( i->action(), "toggleAction", TRUE );
+ }
+ MetaDataBase::setPropertyChanged( i->action(), "text", TRUE );
+ MetaDataBase::setPropertyChanged( i->action(), "name", TRUE );
+ listActions->setCurrentItem( i );
+ if ( !actionParent )
+ formWindow->actionList().append( i->action() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+}
+
+void ActionEditor::newActionGroup()
+{
+ ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
+ if ( actionParent ) {
+ if ( !::tqqt_cast<TQActionGroup*>(actionParent->actionGroup()) )
+ actionParent = (ActionItem*)actionParent->tqparent();
+ }
+
+ ActionItem *i = 0;
+ if ( actionParent )
+ i = new ActionItem( actionParent, TRUE );
+ else
+ i = new ActionItem( listActions, TRUE );
+ TQAction *ag = i->actionGroup();
+ TQObject::connect( ag, TQT_SIGNAL( destroyed( TQObject * ) ),
+ this, TQT_SLOT( removeConnections( TQObject* ) ) );
+ MetaDataBase::addEntry( i->actionGroup() );
+ MetaDataBase::setPropertyChanged( i->actionGroup(), "usesDropDown", TRUE );
+ TQString n = "ActionGroup";
+ formWindow->unify( i->action(), n, TRUE );
+ i->setText( 0, n );
+ i->actionGroup()->setName( n );
+ i->actionGroup()->setText( i->actionGroup()->name() );
+ MetaDataBase::setPropertyChanged( i->actionGroup(), "text", TRUE );
+ MetaDataBase::setPropertyChanged( i->actionGroup(), "name", TRUE );
+ listActions->setCurrentItem( i );
+ i->setOpen( TRUE );
+ if ( !actionParent )
+ formWindow->actionList().append( i->actionGroup() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+}
+
+void ActionEditor::newDropDownActionGroup()
+{
+ newActionGroup();
+ ( (ActionItem*)listActions->currentItem() )->actionGroup()->setUsesDropDown( TRUE );
+}
+
+void ActionEditor::setFormWindow( FormWindow *fw )
+{
+ listActions->clear();
+ formWindow = fw;
+ if ( !formWindow ||
+ !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) {
+ setEnabled( FALSE );
+ } else {
+ setEnabled( TRUE );
+ for ( TQAction *a = formWindow->actionList().first(); a; a = formWindow->actionList().next() ) {
+ ActionItem *i = 0;
+ if ( ::tqqt_cast<TQAction*>(a->tqparent()) )
+ continue;
+ i = new ActionItem( listActions, a );
+ i->setText( 0, a->name() );
+ i->setPixmap( 0, a->iconSet().pixmap() );
+ // make sure we don't duplicate the connection
+ TQObject::disconnect( a, TQT_SIGNAL( destroyed( TQObject * ) ),
+ this, TQT_SLOT( removeConnections( TQObject * ) ) );
+ TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ),
+ this, TQT_SLOT( removeConnections( TQObject* ) ) );
+ if ( ::tqqt_cast<TQActionGroup*>(a) ) {
+ insertChildActions( i );
+ }
+ }
+ if ( listActions->firstChild() ) {
+ listActions->setCurrentItem( listActions->firstChild() );
+ listActions->setSelected( listActions->firstChild(), TRUE );
+ }
+ }
+}
+
+void ActionEditor::insertChildActions( ActionItem *i )
+{
+ if ( !i->actionGroup() || i->actionGroup()->childrenListObject().isEmpty() )
+ return;
+ TQObjectListIt it( i->actionGroup()->childrenListObject() );
+ while ( it.current() ) {
+ TQObject *o = it.current();
+ ++it;
+ if ( !::tqqt_cast<TQAction*>(o) )
+ continue;
+ TQAction *a = (TQAction*)o;
+ ActionItem *i2 = new ActionItem( (TQListViewItem*)i, a );
+ i->setOpen( TRUE );
+ i2->setText( 0, a->name() );
+ i2->setPixmap( 0, a->iconSet().pixmap() );
+ // make sure we don't duplicate the connection
+ TQObject::disconnect( o, TQT_SIGNAL( destroyed( TQObject * ) ),
+ this, TQT_SLOT( removeConnections( TQObject * ) ) );
+ TQObject::connect( o, TQT_SIGNAL( destroyed( TQObject * ) ),
+ this, TQT_SLOT( removeConnections( TQObject * ) ) );
+ if ( ::tqqt_cast<TQActionGroup*>(a) )
+ insertChildActions( i2 );
+ }
+}
+
+void ActionEditor::updateActionName( TQAction *a )
+{
+ TQListViewItemIterator it( listActions );
+ while ( it.current() ) {
+ if ( ( (ActionItem*)it.current() )->action() == a )
+ ( (ActionItem*)it.current() )->setText( 0, a->name() );
+ else if ( ( (ActionItem*)it.current() )->actionGroup() == a )
+ ( (ActionItem*)it.current() )->setText( 0, a->name() );
+ ++it;
+ }
+}
+
+void ActionEditor::updateActionIcon( TQAction *a )
+{
+ TQListViewItemIterator it( listActions );
+ while ( it.current() ) {
+ if ( ( (ActionItem*)it.current() )->action() == a )
+ ( (ActionItem*)it.current() )->setPixmap( 0, a->iconSet().pixmap() );
+ else if ( ( (ActionItem*)it.current() )->actionGroup() == a )
+ ( (ActionItem*)it.current() )->setPixmap( 0, a->iconSet().pixmap() );
+ ++it;
+ }
+}
+
+void ActionEditor::connectionsClicked()
+{
+ ConnectionDialog dlg( formWindow->mainWindow() );
+ dlg.setDefault( currentAction, formWindow );
+ dlg.addConnection();
+ dlg.exec();
+}
+
+void ActionEditor::removeConnections( TQObject *o )
+{
+ TQValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( formWindow, o );
+ for ( TQValueList<MetaDataBase::Connection>::Iterator it2 = conns.begin();
+ it2 != conns.end(); ++it2 )
+ MetaDataBase::removeConnection( formWindow, (*it2).sender, (*it2).signal,
+ (*it2).receiver, (*it2).slot );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/actioneditorimpl.h b/tqtinterface/qt4/tools/designer/designer/actioneditorimpl.h
new file mode 100644
index 0000000..791bfae
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/actioneditorimpl.h
@@ -0,0 +1,88 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ACTIONEDITORIMPL_H
+#define ACTIONEDITORIMPL_H
+
+#include "actioneditor.h"
+
+class TQAction;
+class FormWindow;
+class ActionItem;
+class TQListViewItem;
+
+class ActionEditor : public ActionEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ActionEditor( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );
+ void setFormWindow( FormWindow *fw );
+ void updateActionName( TQAction *a );
+ void updateActionIcon( TQAction *a );
+ FormWindow *form() const { return formWindow; }
+
+ bool wantToBeShown() const { return !explicitlyClosed; }
+ void setWantToBeShown( bool b ) { explicitlyClosed = !b; }
+
+ void setCurrentAction( TQAction *a );
+ TQAction *newActionEx();
+
+protected:
+ void closeEvent( TQCloseEvent *e );
+
+protected Q_SLOTS:
+ void currentActionChanged( TQListViewItem * );
+ void deleteAction();
+ void newAction();
+ void newActionGroup();
+ void newDropDownActionGroup();
+ void connectionsClicked();
+ void removeConnections( TQObject *o );
+
+Q_SIGNALS:
+ void hidden();
+ void removing( TQAction * );
+
+private:
+ void insertChildActions( ActionItem *i );
+
+private:
+ TQAction *currentAction;
+ FormWindow *formWindow;
+ bool explicitlyClosed;
+
+};
+
+#endif // ACTIONEDITORIMPL_H
diff --git a/tqtinterface/qt4/tools/designer/designer/actionlistview.cpp b/tqtinterface/qt4/tools/designer/designer/actionlistview.cpp
new file mode 100644
index 0000000..b3fb0d0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/actionlistview.cpp
@@ -0,0 +1,115 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "actiondnd.h"
+#include "actionlistview.h"
+#include <tqheader.h>
+
+ActionListView::ActionListView( TQWidget *tqparent, const char *name )
+ : TQListView( tqparent, name )
+{
+ setShowSortIndicator( TRUE );
+ setResizeMode( LastColumn );
+ setRootIsDecorated( TRUE );
+ connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint &, int ) ),
+ this, TQT_SLOT( rmbMenu( TQListViewItem *, const TQPoint & ) ) );
+}
+
+ActionItem::ActionItem( TQListView *lv, TQAction *ac )
+ : TQListViewItem( lv ), a( 0 ), g( 0 )
+{
+ g = ::tqqt_cast<TQDesignerActionGroup*>(ac);
+ if ( !g )
+ a = ::tqqt_cast<TQDesignerAction*>(ac);
+ setDragEnabled( TRUE );
+}
+
+ActionItem::ActionItem( TQListViewItem *i, TQAction *ac )
+ : TQListViewItem( i ), a( 0 ), g( 0 )
+{
+ g = ::tqqt_cast<TQDesignerActionGroup*>(ac);
+ if ( !g )
+ a = ::tqqt_cast<TQDesignerAction*>(ac);
+ setDragEnabled( TRUE );
+ moveToEnd();
+}
+
+void ActionItem::moveToEnd()
+{
+ TQListViewItem *i = this;
+ while ( i->nextSibling() )
+ i = i->nextSibling();
+ if ( i != this )
+ moveItem( i );
+}
+
+TQDragObject *ActionListView::dragObject()
+{
+ ActionItem *i = (ActionItem*)currentItem();
+ if ( !i )
+ return 0;
+ TQStoredDrag *drag = 0;
+ if ( i->action() ) {
+ drag = new ActionDrag( i->action(), viewport() );
+ drag->setPixmap( i->action()->iconSet().pixmap() );
+ } else {
+ drag = new ActionDrag( i->actionGroup(), viewport() );
+ drag->setPixmap( i->actionGroup()->iconSet().pixmap() );
+ }
+ return drag;
+}
+
+void ActionListView::rmbMenu( TQListViewItem *i, const TQPoint &p )
+{
+ TQPopupMenu *popup = new TQPopupMenu( this );
+ popup->insertItem( tr( "New &Action" ), 0 );
+ popup->insertItem( tr( "New Action &Group" ), 1 );
+ popup->insertItem( tr( "New &Dropdown Action Group" ), 2 );
+ if ( i ) {
+ popup->insertSeparator();
+ popup->insertItem( tr( "&Connect Action..." ), 3 );
+ popup->insertSeparator();
+ popup->insertItem( tr( "Delete Action" ), 4 );
+ }
+ int res = popup->exec( p );
+ if ( res == 0 )
+ emit insertAction();
+ else if ( res == 1 )
+ emit insertActionGroup();
+ else if ( res == 2 )
+ emit insertDropDownActionGroup();
+ else if ( res == 3 )
+ emit connectAction();
+ else if ( res == 4 )
+ emit deleteAction();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/actionlistview.h b/tqtinterface/qt4/tools/designer/designer/actionlistview.h
new file mode 100644
index 0000000..253761b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/actionlistview.h
@@ -0,0 +1,89 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ACTIONLISTVIEW_H
+#define ACTIONLISTVIEW_H
+
+#include <tqlistview.h>
+#include "actiondnd.h"
+
+class ActionItem : public TQListViewItem
+{
+public:
+ ActionItem( TQListView *lv, bool group )
+ : TQListViewItem( lv ),
+ a( group ? 0 : new TQDesignerAction( 0 ) ),
+ g( group ? new TQDesignerActionGroup( 0 ) : 0 ) { setDragEnabled( TRUE ); }
+ ActionItem( TQListView *lv, TQAction *ac );
+ ActionItem( TQListViewItem *i, TQAction *ac );
+ ActionItem( ActionItem *tqparent, bool group = FALSE )
+ : TQListViewItem( tqparent ),
+ a( group ? 0 : new TQDesignerAction( tqparent->actionGroup() ) ),
+ g( group ? new TQDesignerActionGroup( tqparent->actionGroup() ) : 0 ) { setDragEnabled( TRUE ); moveToEnd(); }
+
+ TQDesignerAction *action() const { return a; }
+ TQDesignerActionGroup *actionGroup() const { return g; }
+
+private:
+ void moveToEnd();
+
+private:
+ TQDesignerAction *a;
+ TQDesignerActionGroup *g;
+
+};
+
+class ActionListView : public TQListView
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ActionListView( TQWidget *tqparent = 0, const char *name = 0 );
+
+protected:
+ TQDragObject *dragObject();
+
+private Q_SLOTS:
+ void rmbMenu( TQListViewItem *i, const TQPoint &p );
+
+Q_SIGNALS:
+ void insertAction();
+ void insertActionGroup();
+ void insertDropDownActionGroup();
+ void deleteAction();
+ void connectAction();
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/asciivalidator.cpp b/tqtinterface/qt4/tools/designer/designer/asciivalidator.cpp
new file mode 100644
index 0000000..c135716
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/asciivalidator.cpp
@@ -0,0 +1,101 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "asciivalidator.h"
+
+#include <tqstring.h>
+
+AsciiValidator::AsciiValidator( TQObject * tqparent, const char *name )
+ : TQValidator( tqparent, name ), functionName( FALSE )
+{
+}
+
+AsciiValidator::AsciiValidator( bool funcName, TQObject * tqparent, const char *name )
+ : TQValidator( tqparent, name ), functionName( funcName )
+{
+}
+
+AsciiValidator::AsciiValidator( const TQString &allow, TQObject * tqparent, const char *name )
+ : TQValidator( tqparent, name ), functionName( FALSE ), allowedChars( allow )
+{
+}
+
+AsciiValidator::~AsciiValidator()
+{
+}
+
+TQValidator::State AsciiValidator::validate( TQString &s, int & ) const
+{
+ bool inParen = FALSE;
+ bool outParen = FALSE;
+ if ( !s.isEmpty() && s[0].row() == 0 && s[0].cell() >= '0' && s[0].cell() <= '9' )
+ s[0] = '_';
+ for ( int i = 0, j = 0; i < (int) s.length(); i++ ) {
+ uchar r = s[i].row();
+ uchar c = s[i].cell();
+
+ if ( outParen ) { // check if we have 'const' or 'volatile'
+ static const TQString con = " const";
+ static const TQString vol = " volatile";
+ TQString mid = s.mid( j );
+ if ( !( con.startsWith( mid ) || vol.startsWith( mid ) ) )
+ return TQValidator::Invalid;
+ }
+
+ if ( inParen && c != ')' )
+ continue;
+
+ if ( r == 0 && ( ( c >= '0' && c <= '9' ) ||
+ ( c >= 'a' && c <= 'z' ) ||
+ ( c >= 'A' && c <= 'Z' ) ) )
+ continue;
+
+ if ( functionName ) {
+ if ( c == '(' ) {
+ inParen = TRUE;
+ continue;
+ }
+ if ( c == ')' ) {
+ outParen = TRUE;
+ j = i + 1;
+ continue;
+ }
+ }
+
+ if ( allowedChars.tqfind( s[ i ] ) != -1 )
+ continue;
+
+ s[i] = '_';
+ }
+ return TQValidator::Acceptable;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/asciivalidator.h b/tqtinterface/qt4/tools/designer/designer/asciivalidator.h
new file mode 100644
index 0000000..7b92751
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/asciivalidator.h
@@ -0,0 +1,59 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ASCIIVALIDATOR_H
+#define ASCIIVALIDATOR_H
+
+
+#include <tqvalidator.h>
+
+
+class AsciiValidator: public TQValidator
+{
+ TQ_OBJECT
+public:
+ AsciiValidator( TQObject * tqparent, const char *name = 0 );
+ AsciiValidator( bool funcName, TQObject * tqparent, const char *name = 0 );
+ AsciiValidator( const TQString &allow, TQObject * tqparent, const char *name = 0 );
+ ~AsciiValidator();
+
+ TQValidator::State validate( TQString &, int & ) const;
+
+private:
+ bool functionName;
+ TQString allowedChars;
+
+};
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/command.cpp b/tqtinterface/qt4/tools/designer/designer/command.cpp
new file mode 100644
index 0000000..2f34892
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/command.cpp
@@ -0,0 +1,2402 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+#include "command.h"
+#include "formwindow.h"
+#include "widgetfactory.h"
+#include "propertyeditor.h"
+#include "metadatabase.h"
+#include <widgetdatabase.h>
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "workspace.h"
+#include "actioneditorimpl.h"
+#include "actiondnd.h"
+#include "formfile.h"
+#include "../interfaces/languageinterface.h"
+#include "menubareditor.h"
+#include "popupmenueditor.h"
+
+#include <tqfeatures.h>
+#include <tqwidget.h>
+#include <tqmetaobject.h>
+#include <tqapplication.h>
+#include <tqlayout.h>
+#include <tqmessagebox.h>
+#include <tqlistbox.h>
+#include <tqiconview.h>
+#include <tqtextedit.h>
+#include <tqptrstack.h>
+#include <tqheader.h>
+#include <tqsplitter.h>
+#ifndef TQT_NO_TABLE
+#include <tqtable.h>
+#endif
+#include <tqaction.h>
+
+CommandHistory::CommandHistory( int s )
+ : current( -1 ), steps( s ), savedAt( -1 )
+{
+ history.setAutoDelete( TRUE );
+ modified = FALSE;
+ compressedCommand = 0;
+}
+
+void CommandHistory::addCommand( Command *cmd, bool tryCompress )
+{
+ if ( tryCompress ) {
+ if ( !compressedCommand ||
+ compressedCommand->type() != cmd->type() ||
+ !compressedCommand->canMerge( cmd ) ) {
+ checkCompressedCommand();
+ compressedCommand = 0;
+ }
+
+ if ( compressedCommand ) {
+ compressedCommand->merge( cmd );
+ modified = TRUE;
+ modificationChanged( modified );
+ return;
+ }
+ compressedCommand = cmd;
+ } else {
+ checkCompressedCommand();
+ }
+
+ if ( current < (int)history.count() - 1 ) {
+ if ( current < savedAt )
+ savedAt = -2;
+
+ TQPtrList<Command> commands;
+ commands.setAutoDelete( FALSE );
+
+ for( int i = 0; i <= current; ++i ) {
+ commands.insert( i, history.at( 0 ) );
+ history.take( 0 );
+ }
+
+ commands.append( cmd );
+ history.clear();
+ history = commands;
+ history.setAutoDelete( TRUE );
+ } else {
+ history.append( cmd );
+ }
+
+ if ( (int)history.count() > steps ) {
+ savedAt--;
+ history.removeFirst();
+ } else {
+ ++current;
+ }
+
+ emitUndoRedo();
+ modified = TRUE;
+ modificationChanged( modified );
+}
+
+void CommandHistory::undo()
+{
+ checkCompressedCommand();
+ compressedCommand = 0;
+ if ( current > -1 ) {
+ history.at( current )->unexecute();
+ --current;
+ }
+ emitUndoRedo();
+ modified = savedAt != current;
+ modificationChanged( modified );
+}
+
+void CommandHistory::redo()
+{
+ checkCompressedCommand();
+ compressedCommand = 0;
+ if ( current > -1 ) {
+ if ( current < (int)history.count() - 1 ) {
+ ++current;
+ history.at( current )->execute();
+ }
+ } else {
+ if ( history.count() > 0 ) {
+ ++current;
+ history.at( current )->execute();
+ }
+ }
+ emitUndoRedo();
+ modified = savedAt != current;
+ modificationChanged( modified );
+}
+
+void CommandHistory::emitUndoRedo()
+{
+ Command *undoCmd = 0;
+ Command *redoCmd = 0;
+
+ if ( current >= 0 && current < (int)history.count() )
+ undoCmd = history.at( current );
+ if ( current + 1 >= 0 && current + 1 < (int)history.count() )
+ redoCmd = history.at( current + 1 );
+
+ bool ua = (undoCmd != 0);
+ TQString uc;
+ if ( ua )
+ uc = undoCmd->name();
+ bool ra = (redoCmd != 0);
+ TQString rc;
+ if ( ra )
+ rc = redoCmd->name();
+ emit undoRedoChanged( ua, ra, uc, rc );
+}
+
+void CommandHistory::setModified( bool m )
+{
+ modified = m;
+ if ( !modified )
+ savedAt = current;
+ modificationChanged( modified );
+}
+
+bool CommandHistory::isModified() const
+{
+ return modified;
+}
+
+void CommandHistory::checkCompressedCommand()
+{
+ if ( compressedCommand && compressedCommand->type() == Command::SetProperty ) {
+ Command *c = compressedCommand;
+ compressedCommand = 0;
+ if ( !( (SetPropertyCommand*)c )->checkProperty() ) {
+ history.remove( current );
+ --current;
+ emitUndoRedo();
+ }
+ }
+}
+
+// ------------------------------------------------------------
+
+Command::Command( const TQString &n, FormWindow *fw )
+ : cmdName( n ), formWin( fw )
+{
+}
+
+Command::~Command()
+{
+}
+
+TQString Command::name() const
+{
+ return cmdName;
+}
+
+FormWindow *Command::formWindow() const
+{
+ return formWin;
+}
+
+void Command::merge( Command * )
+{
+}
+
+bool Command::canMerge( Command * )
+{
+ return FALSE;
+}
+
+// ------------------------------------------------------------
+
+ResizeCommand::ResizeCommand( const TQString &n, FormWindow *fw,
+ TQWidget *w, const TQRect &oldr, const TQRect &nr )
+ : Command( n, fw ), widget( w ), oldRect( oldr ), newRect( nr )
+{
+}
+
+void ResizeCommand::execute()
+{
+ widget->setGeometry( newRect );
+ formWindow()->updateSelection( widget );
+ formWindow()->emitUpdateProperties( widget );
+ if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout )
+ formWindow()->updateChildSelections( widget );
+}
+
+void ResizeCommand::unexecute()
+{
+ widget->setGeometry( oldRect );
+ formWindow()->updateSelection( widget );
+ formWindow()->emitUpdateProperties( widget );
+ if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout )
+ formWindow()->updateChildSelections( widget );
+}
+
+// ------------------------------------------------------------
+
+InsertCommand::InsertCommand( const TQString &n, FormWindow *fw,
+ TQWidget *w, const TQRect &g )
+ : Command( n, fw ), widget( w ), tqgeometry( g )
+{
+}
+
+void InsertCommand::execute()
+{
+ if ( tqgeometry.size() == TQSize( 0, 0 ) ) {
+ widget->move( tqgeometry.topLeft() );
+ widget->adjustSize();
+ } else {
+ TQSize s = tqgeometry.size().expandedTo( widget->tqminimumSize() );
+ s = s.expandedTo( widget->tqminimumSizeHint() );
+ TQRect r( tqgeometry.topLeft(), s );
+ widget->setGeometry( r );
+ }
+ widget->show();
+ formWindow()->widgets()->insert( widget, widget );
+ formWindow()->clearSelection( FALSE );
+ formWindow()->selectWidget( widget );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( widget );
+}
+
+void InsertCommand::unexecute()
+{
+ widget->hide();
+ formWindow()->selectWidget( widget, FALSE );
+ formWindow()->widgets()->remove( widget );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( widget );
+ }
+
+// ------------------------------------------------------------
+
+MoveCommand::MoveCommand( const TQString &n, FormWindow *fw,
+ const TQWidgetList &w,
+ const TQValueList<TQPoint> op,
+ const TQValueList<TQPoint> np,
+ TQWidget *opr, TQWidget *npr )
+ : Command( n, fw ), widgets( w ), oldPos( op ), newPos( np ),
+ oldParent( opr ), newParent( npr )
+{
+ widgets.setAutoDelete( FALSE );
+}
+
+void MoveCommand::merge( Command *c )
+{
+ MoveCommand *cmd = (MoveCommand*)c;
+ newPos = cmd->newPos;
+}
+
+bool MoveCommand::canMerge( Command *c )
+{
+ MoveCommand *cmd = (MoveCommand*)c;
+ return widgets == cmd->widgets;
+}
+
+
+void MoveCommand::execute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) {
+ if ( newParent && oldParent && newParent != oldParent ) {
+ TQPoint pos = newParent->mapFromGlobal( w->mapToGlobal( TQPoint( 0,0 ) ) );
+ w->reparent( newParent, pos, TRUE );
+ formWindow()->raiseSelection( w );
+ formWindow()->raiseChildSelections( w );
+ formWindow()->widgetChanged( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w );
+ }
+ w->move( newPos[ widgets.at() ] );
+ }
+ formWindow()->updateSelection( w );
+ formWindow()->updateChildSelections( w );
+ formWindow()->emitUpdateProperties( w );
+ }
+}
+
+void MoveCommand::unexecute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) {
+ if ( newParent && oldParent && newParent != oldParent ) {
+ TQPoint pos = oldParent->mapFromGlobal( w->mapToGlobal( TQPoint( 0,0 ) ) );
+ w->reparent( oldParent, pos, TRUE );
+ formWindow()->raiseSelection( w );
+ formWindow()->raiseChildSelections( w );
+ formWindow()->widgetChanged( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w );
+ }
+ w->move( oldPos[ widgets.at() ] );
+ }
+ formWindow()->updateSelection( w );
+ formWindow()->updateChildSelections( w );
+ formWindow()->emitUpdateProperties( w );
+ }
+}
+
+// ------------------------------------------------------------
+
+DeleteCommand::DeleteCommand( const TQString &n, FormWindow *fw,
+ const TQWidgetList &wl )
+ : Command( n, fw ), widgets( wl )
+{
+ widgets.setAutoDelete( FALSE );
+ TQWidgetList copyOfWidgets = widgets;
+ copyOfWidgets.setAutoDelete(FALSE);
+
+ // Include the tqchildren of the selected items when deleting
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ TQObjectList *tqchildren = w->queryList( "TQWidget" );
+ for ( TQWidget *c = (TQWidget *)tqchildren->first(); c; c = (TQWidget *)tqchildren->next() ) {
+ if ( copyOfWidgets.tqfind( c ) == -1 && formWindow()->widgets()->tqfind( c ) ) {
+ widgets.insert(widgets.at() + 1, c);
+ widgets.prev();
+ copyOfWidgets.append(c);
+ }
+ }
+ delete tqchildren;
+ }
+}
+
+void DeleteCommand::execute()
+{
+ formWindow()->setPropertyShowingBlocked( TRUE );
+ connections.clear();
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->hide();
+ TQString s = w->name();
+ s.prepend( "qt_dead_widget_" );
+ w->setName( s );
+ formWindow()->selectWidget( w, FALSE );
+ formWindow()->widgets()->remove( w );
+ TQValueList<MetaDataBase::Connection> conns = MetaDataBase::connections( formWindow(), w );
+ connections.insert( w, conns );
+ TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ for ( ; it != conns.end(); ++it ) {
+ MetaDataBase::removeConnection( formWindow(), (*it).sender,
+ (*it).signal, (*it).receiver, (*it).slot );
+ }
+ }
+ formWindow()->setPropertyShowingBlocked( FALSE );
+ formWindow()->emitShowProperties();
+ formWindow()->mainWindow()->objectHierarchy()->widgetsRemoved( widgets );
+
+}
+
+void DeleteCommand::unexecute()
+{
+ formWindow()->setPropertyShowingBlocked( TRUE );
+ formWindow()->clearSelection( FALSE );
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->show();
+ TQString s = w->name();
+ s.remove( 0, TQString( "qt_dead_widget_" ).length() );
+ w->setName( s );
+ formWindow()->widgets()->insert( w, w );
+ formWindow()->selectWidget( w );
+ TQValueList<MetaDataBase::Connection> conns = *connections.tqfind( w );
+ TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ for ( ; it != conns.end(); ++it ) {
+ MetaDataBase::addConnection( formWindow(), (*it).sender,
+ (*it).signal, (*it).receiver, (*it).slot );
+ }
+ }
+ formWindow()->setPropertyShowingBlocked( FALSE );
+ formWindow()->emitShowProperties();
+ formWindow()->mainWindow()->objectHierarchy()->widgetsInserted( widgets );
+}
+
+// ------------------------------------------------------------
+
+SetPropertyCommand::SetPropertyCommand( const QString &n, FormWindow *fw,
+ TQT_BASE_OBJECT_NAME *w, PropertyEditor *e,
+ const QString &pn, const QVariant &ov,
+ const QVariant &nv, const QString &ncut,
+ const QString &ocut, bool reset )
+ : Command( n, fw ), widget( TQT_TQOBJECT(w) ), editor( e ), propName( pn ),
+ oldValue( TQT_TQVARIANT_OBJECT(ov) ), newValue( TQT_TQVARIANT_OBJECT(nv) ), oldCurrentItemText( ocut ), newCurrentItemText( ncut ),
+ wasChanged( TRUE ), isResetCommand( reset )
+{
+ wasChanged = MetaDataBase::isPropertyChanged( w, propName );
+ if ( oldCurrentItemText.isNull() )
+ oldCurrentItemText = "";
+ if ( newCurrentItemText.isNull() )
+ newCurrentItemText = "";
+}
+
+
+void SetPropertyCommand::execute()
+{
+ if ( !wasChanged )
+ MetaDataBase::setPropertyChanged( widget, propName, TRUE );
+ if ( isResetCommand ) {
+ MetaDataBase::setPropertyChanged( widget, propName, FALSE );
+ if ( WidgetFactory::resetProperty( widget, propName ) ) {
+ if ( !formWindow()->isWidgetSelected( widget ) && TQT_TQOBJECT(formWindow()) != (TQObject *)widget )
+ formWindow()->selectWidget( (TQObject *)widget );
+ if ( editor->widget() != widget )
+ editor->setWidget( widget, formWindow() );
+ editor->propertyList()->setCurrentProperty( propName );
+ PropertyItem *i = (PropertyItem*)editor->propertyList()->currentItem();
+ if ( !i )
+ return;
+ i->setValue( TQT_TQVARIANT_OBJECT(widget->property( propName )) );
+ i->setChanged( FALSE );
+ editor->refetchData();
+ editor->emitWidgetChanged();
+ return;
+ }
+ }
+ setProperty( newValue, newCurrentItemText );
+}
+
+void SetPropertyCommand::unexecute()
+{
+ if ( !wasChanged )
+ MetaDataBase::setPropertyChanged( widget, propName, FALSE );
+ if ( isResetCommand )
+ MetaDataBase::setPropertyChanged( widget, propName, TRUE );
+ setProperty( oldValue, oldCurrentItemText );
+}
+
+bool SetPropertyCommand::canMerge( Command *c )
+{
+ SetPropertyCommand *cmd = (SetPropertyCommand*)c;
+ if ( !widget )
+ return FALSE;
+ const TQMetaProperty *p =
+ widget->tqmetaObject()->property( widget->tqmetaObject()->tqfindProperty( propName, TRUE ), TRUE );
+ if ( !p ) {
+ if ( propName == "toolTip" || propName == "whatsThis" )
+ return TRUE;
+ if ( ::tqqt_cast<CustomWidget*>((TQObject *)widget) ) {
+ MetaDataBase::CustomWidget *cw = ((CustomWidget*)(TQObject*)widget)->customWidget();
+ if ( !cw )
+ return FALSE;
+ for ( TQValueList<MetaDataBase::Property>::Iterator it = cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) {
+ if ( TQString( (*it ).property ) == propName ) {
+ if ( (*it).type == "String" || (*it).type == "CString" || (*it).type == "Int" || (*it).type == "UInt" )
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+ }
+ TQVariant::Type t = TQVariant::nameToType( p->type() );
+ return ( (cmd->propName == propName) &&
+ (t == TQVariant::String || t == TQVariant::CString || t == TQVariant::Int || t == TQVariant::UInt) );
+}
+
+void SetPropertyCommand::merge( Command *c )
+{
+ SetPropertyCommand *cmd = (SetPropertyCommand*)c;
+ newValue = cmd->newValue;
+ newCurrentItemText = cmd->newCurrentItemText;
+}
+
+bool SetPropertyCommand::checkProperty()
+{
+ if ( propName == "name" /*|| propName == "itemName"*/ ) { // ### fix that
+ TQString s = newValue.toString();
+ if ( !formWindow()->unify( widget, s, FALSE ) ) {
+ TQMessageBox::information( formWindow()->mainWindow(),
+ FormWindow::tr( "Set 'name' property" ),
+ FormWindow::tr( "The name of a widget must be unique.\n"
+ "'%1' is already used in form '%2',\n"
+ "so the name has been reverted to '%3'." ).
+ arg( newValue.toString() ).
+ arg( formWindow()->name() ).
+ arg( oldValue.toString() ));
+ setProperty( oldValue, oldCurrentItemText, FALSE );
+ return FALSE;
+ }
+ if ( s.isEmpty() ) {
+ TQMessageBox::information( formWindow()->mainWindow(),
+ FormWindow::tr( "Set 'name' property" ),
+ FormWindow::tr( "The name of a widget must not be null.\n"
+ "The name has been reverted to '%1'." ).
+ arg( oldValue.toString() ));
+ setProperty( oldValue, oldCurrentItemText, FALSE );
+ return FALSE;
+ }
+
+ if ( ::tqqt_cast<FormWindow*>(widget->tqparent()) )
+ formWindow()->mainWindow()->formNameChanged( (FormWindow*)((TQWidget*)(TQObject*)widget)->parentWidget() );
+ }
+ return TRUE;
+}
+
+void SetPropertyCommand::setProperty( const TQVariant &v, const TQString &currentItemText, bool select )
+{
+ if ( !widget )
+ return;
+
+ if ( !formWindow()->isWidgetSelected( widget ) && !formWindow()->isMainContainer( widget ) && select )
+ formWindow()->selectWidget( widget );
+ if ( editor->widget() != widget && select )
+ editor->setWidget( widget, formWindow() );
+ if ( select )
+ editor->propertyList()->setCurrentProperty( propName );
+ const TQMetaProperty *p =
+ widget->tqmetaObject()->property( widget->tqmetaObject()->tqfindProperty( propName, TRUE ), TRUE );
+ if ( !p ) {
+ if ( propName == "hAlign" ) {
+ p = widget->tqmetaObject()->property( widget->tqmetaObject()->tqfindProperty( "tqalignment", TRUE ), TRUE );
+ int align = widget->property( "tqalignment" ).toInt();
+ align &= ~( AlignHorizontal_Mask );
+ align |= p->keyToValue( currentItemText );
+ widget->setProperty( "tqalignment", TQVariant( align ) );
+ } else if ( propName == "vAlign" ) {
+ p = widget->tqmetaObject()->property( widget->tqmetaObject()->tqfindProperty( "tqalignment", TRUE ), TRUE );
+ int align = widget->property( "tqalignment" ).toInt();
+ align &= ~( AlignVertical_Mask );
+ align |= p->keyToValue( currentItemText );
+ widget->setProperty( "tqalignment", TQVariant( align ) );
+ } else if ( propName == "wordwrap" ) {
+ int align = widget->property( "tqalignment" ).toInt();
+ align &= ~WordBreak;
+ if ( v.toBool() )
+ align |= WordBreak;
+ widget->setProperty( "tqalignment", TQVariant( align ) );
+ } else if ( propName == "layoutSpacing" ) {
+ TQVariant val = v;
+ if ( val.toString() == "default" )
+ val = -1;
+ MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ), val.toInt() );
+ } else if ( propName == "layoutMargin" ) {
+ TQVariant val = v;
+ if ( val.toString() == "default" )
+ val = -1;
+ MetaDataBase::setMargin( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ), val.toInt() );
+ } else if ( propName == "resizeMode" ) {
+ MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ), currentItemText );
+ } else if ( propName == "toolTip" || propName == "whatsThis" || propName == "database" || propName == "frameworkCode" ) {
+ MetaDataBase::setFakeProperty( editor->widget(), propName, v );
+ } else if ( ::tqqt_cast<CustomWidget*>(editor->widget()) ) {
+ MetaDataBase::CustomWidget *cw = ((CustomWidget *)(TQObject *)widget)->customWidget();
+ if ( cw ) {
+ MetaDataBase::setFakeProperty( editor->widget(), propName, v );
+ }
+ }
+ editor->refetchData();
+ editor->emitWidgetChanged();
+ ( ( PropertyItem* )editor->propertyList()->currentItem() )->setChanged( MetaDataBase::isPropertyChanged( widget, propName ) );
+#ifndef TQT_NO_SQL
+ if ( propName == "database" ) {
+ formWindow()->mainWindow()->objectHierarchy()->databasePropertyChanged( (TQWidget*)((TQObject *)widget), MetaDataBase::fakeProperty( widget, "database" ).toStringList() );
+ }
+#endif
+ return;
+ }
+
+ if ( p->isSetType() ) {
+ TQStrList strlst;
+ TQStringList lst = TQStringList::split( "|", currentItemText );
+ TQValueListConstIterator<TQString> it = lst.begin();
+ for ( ; it != lst.end(); ++it )
+ strlst.append( (*it).latin1() );
+ widget->setProperty( propName, p->keysToValue( strlst ) );
+ } else if ( p->isEnumType() ) {
+ widget->setProperty( propName, p->keyToValue( currentItemText ) );
+ } else if ( qstrcmp( p->name(), "buddy" ) == 0 ) {
+ widget->setProperty( propName, currentItemText );
+ } else {
+ TQVariant ov;
+ if ( propName == "name" || propName == "itemName" )
+ ov = TQT_TQVARIANT_OBJECT(widget->property( propName ));
+ int oldSerNum = -1;
+ if ( v.type() == TQVariant::Pixmap )
+ oldSerNum = v.toPixmap().serialNumber();
+ widget->setProperty( propName, v );
+ if ( oldSerNum != -1 && oldSerNum != TQT_TQVARIANT_OBJECT(widget->property( propName )).toPixmap().serialNumber() )
+ MetaDataBase::setPixmapKey( formWindow(),
+ TQT_TQVARIANT_OBJECT(widget->property( propName )).toPixmap().serialNumber(),
+ MetaDataBase::pixmapKey( formWindow(), oldSerNum ) );
+ if ( propName == "cursor" ) {
+ MetaDataBase::setCursor( (TQWidget*)((TQObject *)widget), v.toCursor() );
+ }
+ if ( propName == "name" && widget->isWidgetType() ) {
+ formWindow()->mainWindow()->objectHierarchy()->namePropertyChanged( ((TQWidget*)(TQObject *)widget), ov );
+ if ( formWindow()->isMainContainer( widget ) )
+ formWindow()->setName( v.toCString() );
+ }
+ if ( propName == "name" && ::tqqt_cast<TQAction*>((TQObject *)widget) && ::tqqt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) {
+ formWindow()->mainWindow()->actioneditor()->updateActionName( (TQAction*)(TQObject *)widget );
+ }
+ if ( propName == "iconSet" && ::tqqt_cast<TQAction*>((TQObject *)widget) && ::tqqt_cast<TQMainWindow*>(formWindow()->mainContainer()) ) {
+ formWindow()->mainWindow()->actioneditor()->updateActionIcon( (TQAction*)(TQObject *)widget );
+ }
+ if ( propName == "caption" ) {
+ if ( formWindow()->isMainContainer( widget ) )
+ formWindow()->setCaption( v.toString() );
+ }
+ if ( propName == "icon" ) {
+ if ( formWindow()->isMainContainer( widget ) )
+ formWindow()->setIcon( v.toPixmap() );
+ }
+ }
+ editor->refetchData();
+ if ( editor->propertyList()->currentItem() && select ) {
+ ( ( PropertyItem* )editor->propertyList()->currentItem() )->showEditor();
+ ( ( PropertyItem* )editor->propertyList()->currentItem() )->setChanged( MetaDataBase::isPropertyChanged( widget, propName ) );
+ }
+ editor->emitWidgetChanged();
+ formWindow()->killAccels( widget );
+}
+
+// ------------------------------------------------------------
+
+LayoutHorizontalCommand::LayoutHorizontalCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl )
+ : Command( n, fw ), tqlayout( wl, tqparent, fw, layoutBase )
+{
+}
+
+void LayoutHorizontalCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutHorizontalCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutHorizontalSplitCommand::LayoutHorizontalSplitCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl )
+ : Command( n, fw ), tqlayout( wl, tqparent, fw, layoutBase, TRUE, TRUE )
+{
+}
+
+void LayoutHorizontalSplitCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutHorizontalSplitCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutVerticalCommand::LayoutVerticalCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl )
+ : Command( n, fw ), tqlayout( wl, tqparent, fw, layoutBase )
+{
+}
+
+void LayoutVerticalCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutVerticalCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutVerticalSplitCommand::LayoutVerticalSplitCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl )
+ : Command( n, fw ), tqlayout( wl, tqparent, fw, layoutBase, TRUE, TRUE )
+{
+}
+
+void LayoutVerticalSplitCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutVerticalSplitCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutGridCommand::LayoutGridCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl, int xres, int yres )
+ : Command( n, fw ), tqlayout( wl, tqparent, fw, layoutBase, TQSize( TQMAX(5,xres), TQMAX(5,yres) ) )
+{
+}
+
+void LayoutGridCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutGridCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ tqlayout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+BreakLayoutCommand::BreakLayoutCommand( const TQString &n, FormWindow *fw,
+ TQWidget *layoutBase, const TQWidgetList &wl )
+ : Command( n, fw ), lb( layoutBase ), widgets( wl )
+{
+ WidgetFactory::LayoutType lay = WidgetFactory::layoutType( layoutBase );
+ spacing = MetaDataBase::spacing( layoutBase );
+ margin = MetaDataBase::margin( layoutBase );
+ tqlayout = 0;
+ if ( lay == WidgetFactory::HBox )
+ tqlayout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 );
+ else if ( lay == WidgetFactory::VBox )
+ tqlayout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::tqqt_cast<TQSplitter*>(layoutBase) != 0 );
+ else if ( lay == WidgetFactory::Grid )
+ tqlayout = new GridLayout( wl, layoutBase, fw, layoutBase, TQSize( TQMAX( 5, fw->grid().x()), TQMAX( 5, fw->grid().y()) ), FALSE );
+}
+
+void BreakLayoutCommand::execute()
+{
+ if ( !tqlayout )
+ return;
+ formWindow()->clearSelection( FALSE );
+ tqlayout->breakLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() )
+ w->resize( TQMAX( 16, w->width() ), TQMAX( 16, w->height() ) );
+}
+
+void BreakLayoutCommand::unexecute()
+{
+ if ( !tqlayout )
+ return;
+ formWindow()->clearSelection( FALSE );
+ tqlayout->doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+ MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( lb ), spacing );
+ MetaDataBase::setMargin( WidgetFactory::containerOfWidget( lb ), margin );
+}
+
+// ------------------------------------------------------------
+
+MacroCommand::MacroCommand( const TQString &n, FormWindow *fw,
+ const TQPtrList<Command> &cmds )
+ : Command( n, fw ), commands( cmds )
+{
+}
+
+void MacroCommand::execute()
+{
+ for ( Command *c = commands.first(); c; c = commands.next() )
+ c->execute();
+}
+
+void MacroCommand::unexecute()
+{
+ for ( Command *c = commands.last(); c; c = commands.prev() )
+ c->unexecute();
+}
+
+// ------------------------------------------------------------
+
+AddTabPageCommand::AddTabPageCommand( const TQString &n, FormWindow *fw,
+ TQTabWidget *tw, const TQString &label )
+ : Command( n, fw ), tabWidget( tw ), tabLabel( label )
+{
+ tabPage = new TQDesignerWidget( formWindow(), tabWidget, "TabPage" );
+ tabPage->hide();
+ index = -1;
+ MetaDataBase::addEntry( tabPage );
+}
+
+void AddTabPageCommand::execute()
+{
+ if ( index == -1 )
+ index = ( (TQDesignerTabWidget*)tabWidget )->count();
+ tabWidget->insertTab( tabPage, tabLabel, index );
+ tabWidget->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+void AddTabPageCommand::unexecute()
+{
+ tabWidget->removePage( tabPage );
+ tabPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+// ------------------------------------------------------------
+
+MoveTabPageCommand::MoveTabPageCommand( const TQString &n, FormWindow *fw,
+ TQTabWidget *tw, TQWidget* page, const TQString& label, int nIndex, int oIndex )
+ : Command( n, fw ), tabWidget( tw ), tabPage( page ), tabLabel( label )
+{
+ newIndex = nIndex;
+ oldIndex = oIndex;
+}
+
+void MoveTabPageCommand::execute()
+{
+ ((TQDesignerTabWidget*)tabWidget )->removePage( tabPage );
+ ((TQDesignerTabWidget*)tabWidget )->insertTab( tabPage, tabLabel, newIndex );
+ ((TQDesignerTabWidget*)tabWidget )->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+void MoveTabPageCommand::unexecute()
+{
+ ((TQDesignerTabWidget*)tabWidget )->removePage( tabPage );
+ ((TQDesignerTabWidget*)tabWidget )->insertTab( tabPage, tabLabel, oldIndex );
+ ((TQDesignerTabWidget*)tabWidget )->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+// ------------------------------------------------------------
+
+DeleteTabPageCommand::DeleteTabPageCommand( const TQString &n, FormWindow *fw,
+ TQTabWidget *tw, TQWidget *page )
+ : Command( n, fw ), tabWidget( tw ), tabPage( page )
+{
+ tabLabel = ( (TQDesignerTabWidget*)tabWidget )->pageTitle();
+ index = ( (TQDesignerTabWidget*)tabWidget )->currentPage();
+}
+
+void DeleteTabPageCommand::execute()
+{
+ tabWidget->removePage( tabPage );
+ tabPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+void DeleteTabPageCommand::unexecute()
+{
+ tabWidget->insertTab( tabPage, tabLabel, index );
+ tabWidget->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+// ------------------------------------------------------------
+
+AddWidgetStackPageCommand::AddWidgetStackPageCommand( const TQString &n, FormWindow *fw,
+ TQDesignerWidgetStack *ws )
+ : Command( n, fw ), widgetStack( ws )
+{
+ stackPage = new TQDesignerWidget( formWindow(), widgetStack, "WStackPage" );
+ stackPage->hide();
+ index = -1;
+ MetaDataBase::addEntry( stackPage );
+}
+
+void AddWidgetStackPageCommand::execute()
+{
+ index = widgetStack->insertPage( stackPage, index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( 0 );
+}
+
+void AddWidgetStackPageCommand::unexecute()
+{
+ index = widgetStack->removePage( stackPage );
+ stackPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( 0 );
+}
+
+DeleteWidgetStackPageCommand::DeleteWidgetStackPageCommand( const TQString &n, FormWindow *fw,
+ TQDesignerWidgetStack *ws, TQWidget *page )
+ : Command( n, fw), widgetStack( ws ), stackPage( page )
+{
+ index = -1;
+}
+
+void DeleteWidgetStackPageCommand::execute()
+{
+ index = widgetStack->removePage( stackPage );
+ stackPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( stackPage );
+}
+
+void DeleteWidgetStackPageCommand::unexecute()
+{
+ index = widgetStack->insertPage( stackPage, index );
+ widgetStack->raiseWidget( stackPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( stackPage );
+}
+
+// ------------------------------------------------------------
+
+AddWizardPageCommand::AddWizardPageCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, const TQString &label, int i, bool s )
+ : Command( n, fw ), wizard( w ), pageLabel( label )
+{
+ page = new TQDesignerWidget( formWindow(), wizard, "WizardPage" );
+ page->hide();
+ index = i;
+ show = s;
+ MetaDataBase::addEntry( page );
+}
+
+void AddWizardPageCommand::execute()
+{
+ if ( index == -1 )
+ index = wizard->pageCount();
+ wizard->insertPage( page, pageLabel, index );
+ if ( show )
+ ( (TQDesignerWizard*)wizard )->setCurrentPage( ( (TQDesignerWizard*)wizard )->pageNum( page ) );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void AddWizardPageCommand::unexecute()
+{
+ wizard->removePage( page );
+ page->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+// ------------------------------------------------------------
+
+DeleteWizardPageCommand::DeleteWizardPageCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, int i, bool s )
+ : Command( n, fw ), wizard( w ), index( i )
+{
+ show = s;
+}
+
+void DeleteWizardPageCommand::execute()
+{
+ page = wizard->page( index );
+ pageLabel = wizard->title( page );
+ wizard->removePage( page );
+ page->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void DeleteWizardPageCommand::unexecute()
+{
+ wizard->insertPage( page, pageLabel, index );
+ if ( show )
+ ( (TQDesignerWizard*)wizard )->setCurrentPage( ( (TQDesignerWizard*)wizard )->pageNum( page ) );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+// ------------------------------------------------------------
+
+RenameWizardPageCommand::RenameWizardPageCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, int i, const TQString& name )
+ : Command( n, fw ), wizard( w ), index( i ), label( name )
+{
+
+}
+
+void RenameWizardPageCommand::execute()
+{
+ page = wizard->page( index );
+ TQString oldLabel = wizard->title( page );
+
+ wizard->setTitle( page, label );
+ label = oldLabel;
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+}
+
+void RenameWizardPageCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+SwapWizardPagesCommand::SwapWizardPagesCommand( const TQString &n, FormWindow *fw, TQWizard *w, int i1, int i2 )
+ : Command( n, fw ), wizard( w ), index1( i1 ), index2( i2 )
+{
+}
+
+void SwapWizardPagesCommand::execute()
+{
+ TQWidget *page1 = wizard->page( index1 );
+ TQWidget *page2 = wizard->page( index2 );
+ TQString page1Label = wizard->title( page1 );
+ TQString page2Label = wizard->title( page2 );
+ wizard->removePage( page1 );
+ wizard->removePage( page2 );
+ wizard->insertPage( page1, page1Label, index2 );
+ wizard->insertPage( page2, page2Label, index1 );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void SwapWizardPagesCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+MoveWizardPageCommand::MoveWizardPageCommand( const TQString &n, FormWindow *fw, TQWizard *w, int i1, int i2 )
+ : Command( n, fw ), wizard( w ), index1( i1 ), index2( i2 )
+{
+}
+
+void MoveWizardPageCommand::execute()
+{
+ TQWidget *page = wizard->page( index1 );
+ TQString pageLabel = wizard->title( page );
+ wizard->removePage( page );
+ wizard->insertPage( page, pageLabel, index2 );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void MoveWizardPageCommand::unexecute()
+{
+ // ###FIX: index1 may be the wrong place
+ TQWidget *page = wizard->page( index2 );
+ TQString pageLabel = wizard->title( page );
+ wizard->removePage( page );
+ wizard->insertPage( page, pageLabel, index1 );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+// ------------------------------------------------------------
+
+AddConnectionCommand::AddConnectionCommand( const TQString &name, FormWindow *fw,
+ MetaDataBase::Connection c )
+ : Command( name, fw ), connection( c )
+{
+}
+
+void AddConnectionCommand::execute()
+{
+ MetaDataBase::addConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( TQT_BASE_OBJECT(connection.receiver) == TQT_BASE_OBJECT(formWindow()->mainContainer()) )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+void AddConnectionCommand::unexecute()
+{
+ MetaDataBase::removeConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( TQT_BASE_OBJECT(connection.receiver) == TQT_BASE_OBJECT(formWindow()->mainContainer()) )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+// ------------------------------------------------------------
+
+RemoveConnectionCommand::RemoveConnectionCommand( const TQString &name, FormWindow *fw,
+ MetaDataBase::Connection c )
+ : Command( name, fw ), connection( c )
+{
+}
+
+void RemoveConnectionCommand::execute()
+{
+ MetaDataBase::removeConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( TQT_BASE_OBJECT(connection.receiver) == TQT_BASE_OBJECT(formWindow()->mainContainer()) )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+void RemoveConnectionCommand::unexecute()
+{
+ MetaDataBase::addConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( TQT_BASE_OBJECT(connection.receiver) == TQT_BASE_OBJECT(formWindow()->mainContainer()) )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+// ------------------------------------------------------------
+
+AddFunctionCommand::AddFunctionCommand( const TQString &name, FormWindow *fw, const TQCString &f,
+ const TQString& spec, const TQString &a, const TQString &t,
+ const TQString &l, const TQString &rt )
+ : Command( name, fw ), function( f ), specifier( spec ), access( a ), functionType( t ), language( l ),
+ returnType( rt )
+{
+}
+
+void AddFunctionCommand::execute()
+{
+ MetaDataBase::addFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void AddFunctionCommand::unexecute()
+{
+ MetaDataBase::removeFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+ChangeFunctionAttribCommand::ChangeFunctionAttribCommand( const TQString &name, FormWindow *fw, MetaDataBase::Function f,
+ const TQString &on, const TQString &os,
+ const TQString &oa, const TQString &ot, const TQString &ol,
+ const TQString &ort )
+ : Command( name, fw ), oldName( on ), oldSpec( os ), oldAccess( oa ),
+ oldType( ot ), oldLang( ol ), oldReturnType( ort )
+{
+ newName = f.function;
+ newSpec = f.specifier;
+ newAccess = f.access;
+ newType = f.type;
+ newLang = f.language;
+ newReturnType = f.returnType;
+}
+
+void ChangeFunctionAttribCommand::execute()
+{
+ MetaDataBase::changeFunctionAttributes( formWindow(), oldName, newName, newSpec, newAccess,
+ newType, newLang, newReturnType );
+ formWindow()->formFile()->functionNameChanged( oldName, newName );
+ formWindow()->formFile()->functionRetTypeChanged( newName, oldReturnType, newReturnType );
+ formWindow()->mainWindow()->functionsChanged();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void ChangeFunctionAttribCommand::unexecute()
+{
+ MetaDataBase::changeFunctionAttributes( formWindow(), newName, oldName, oldSpec, oldAccess,
+ oldType, oldLang, oldReturnType );
+ formWindow()->formFile()->functionNameChanged( newName, oldName );
+ formWindow()->formFile()->functionRetTypeChanged( oldName, newReturnType, oldReturnType );
+ formWindow()->mainWindow()->functionsChanged();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+RemoveFunctionCommand::RemoveFunctionCommand( const TQString &name, FormWindow *fw, const TQCString &f,
+ const TQString& spec, const TQString &a, const TQString &t,
+ const TQString &l, const TQString &rt )
+ : Command( name, fw ), function( f ), specifier( spec ), access( a ), functionType( t ), language( l ),
+ returnType( rt )
+{
+ if ( spec.isNull() ) {
+ TQValueList<MetaDataBase::Function> lst = MetaDataBase::functionList( fw );
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).function ) ==
+ MetaDataBase::normalizeFunction( function ) ) {
+ specifier = (*it).specifier;
+ access = (*it).access;
+ functionType = (*it).type;
+ returnType = (*it).returnType;
+ language = (*it).language;
+ break;
+ }
+ }
+ }
+}
+
+void RemoveFunctionCommand::execute()
+{
+ MetaDataBase::removeFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void RemoveFunctionCommand::unexecute()
+{
+ if ( MetaDataBase::hasFunction( formWindow(), function ) )
+ return;
+ MetaDataBase::addFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+AddVariableCommand::AddVariableCommand( const TQString &name, FormWindow *fw, const TQString &vn, const TQString &a )
+ : Command( name, fw ), varName( vn ), access( a )
+{
+}
+
+void AddVariableCommand::execute()
+{
+ MetaDataBase::addVariable( formWindow(), varName, access );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void AddVariableCommand::unexecute()
+{
+ MetaDataBase::removeVariable( formWindow(), varName );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+SetVariablesCommand::SetVariablesCommand( const TQString &name, FormWindow *fw,
+ TQValueList<MetaDataBase::Variable> lst )
+ : Command( name, fw ), newList( lst )
+{
+ oldList = MetaDataBase::variables( formWindow() );
+}
+
+void SetVariablesCommand::execute()
+{
+ MetaDataBase::setVariables( formWindow(), newList );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void SetVariablesCommand::unexecute()
+{
+ MetaDataBase::setVariables( formWindow(), oldList );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+RemoveVariableCommand::RemoveVariableCommand( const TQString &name, FormWindow *fw, const TQString &vn )
+ : Command( name, fw ), varName( vn )
+{
+ TQValueList<MetaDataBase::Variable> lst = MetaDataBase::variables( fw );
+ for ( TQValueList<MetaDataBase::Variable>::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( (*it).varName == varName ) {
+ access = (*it).varAccess;
+ break;
+ }
+ }
+}
+
+void RemoveVariableCommand::execute()
+{
+ MetaDataBase::removeVariable( formWindow(), varName );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void RemoveVariableCommand::unexecute()
+{
+ MetaDataBase::addVariable( formWindow(), varName, access );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+EditDefinitionsCommand::EditDefinitionsCommand( const TQString &name, FormWindow *fw, LanguageInterface *lf,
+ const TQString &n, const TQStringList &nl )
+ : Command( name, fw ), lIface( lf ), defName( n ), newList( nl )
+{
+ oldList = lIface->definitionEntries( defName, formWindow()->mainWindow()->designerInterface() );
+}
+
+void EditDefinitionsCommand::execute()
+{
+ lIface->setDefinitionEntries( defName, newList, formWindow()->mainWindow()->designerInterface() );
+ lIface->release();
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void EditDefinitionsCommand::unexecute()
+{
+ lIface->setDefinitionEntries( defName, oldList, formWindow()->mainWindow()->designerInterface() );
+ lIface->release();
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+LowerCommand::LowerCommand( const TQString &name, FormWindow *fw, const TQWidgetList &w )
+ : Command( name, fw ), widgets( w )
+{
+}
+
+void LowerCommand::execute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->lower();
+ formWindow()->raiseSelection( w );
+ }
+
+}
+
+void LowerCommand::unexecute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->raise();
+ formWindow()->raiseSelection( w );
+ }
+}
+
+// ------------------------------------------------------------
+
+RaiseCommand::RaiseCommand( const TQString &name, FormWindow *fw, const TQWidgetList &w )
+ : Command( name, fw ), widgets( w )
+{
+}
+
+void RaiseCommand::execute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->raise();
+ formWindow()->raiseSelection( w );
+ }
+
+}
+
+void RaiseCommand::unexecute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->lower();
+ formWindow()->raiseSelection( w );
+ }
+}
+
+// ------------------------------------------------------------
+
+PasteCommand::PasteCommand( const TQString &n, FormWindow *fw,
+ const TQWidgetList &w )
+ : Command( n, fw ), widgets( w )
+{
+}
+
+void PasteCommand::execute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->show();
+ formWindow()->selectWidget( w );
+ formWindow()->widgets()->insert( w, w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w );
+ }
+}
+
+void PasteCommand::unexecute()
+{
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->hide();
+ formWindow()->selectWidget( w, FALSE );
+ formWindow()->widgets()->remove( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w );
+ }
+ }
+
+// ------------------------------------------------------------
+
+TabOrderCommand::TabOrderCommand( const TQString &n, FormWindow *fw,
+ const TQWidgetList &ol, const TQWidgetList &nl )
+ : Command( n, fw ), oldOrder( ol ), newOrder( nl )
+{
+}
+
+void TabOrderCommand::merge( Command *c )
+{
+ TabOrderCommand *cmd = (TabOrderCommand*)c;
+ newOrder = cmd->newOrder;
+}
+
+bool TabOrderCommand::canMerge( Command * )
+{
+ return TRUE;
+}
+
+void TabOrderCommand::execute()
+{
+ MetaDataBase::setTabOrder( formWindow(), newOrder );
+}
+
+void TabOrderCommand::unexecute()
+{
+ MetaDataBase::setTabOrder( formWindow(), oldOrder );
+}
+
+// ------------------------------------------------------------
+
+PopulateListBoxCommand::PopulateListBoxCommand( const TQString &n, FormWindow *fw,
+ TQListBox *lb, const TQValueList<Item> &items )
+ : Command( n, fw ), newItems( items ), listbox( lb )
+{
+ TQListBoxItem *i = 0;
+ for ( i = listbox->firstItem(); i; i = i->next() ) {
+ Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ oldItems.append( item );
+ }
+}
+
+void PopulateListBoxCommand::execute()
+{
+ listbox->clear();
+ for ( TQValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) {
+ Item i = *it;
+ if ( !i.pix.isNull() )
+ (void)new TQListBoxPixmap( listbox, i.pix, i.text );
+ else
+ (void)new TQListBoxText( listbox, i.text );
+ }
+ formWindow()->mainWindow()->propertyeditor()->refetchData();
+}
+
+void PopulateListBoxCommand::unexecute()
+{
+ listbox->clear();
+ for ( TQValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) {
+ Item i = *it;
+ if ( !i.pix.isNull() )
+ (void)new TQListBoxPixmap( listbox, i.pix, i.text );
+ else
+ (void)new TQListBoxText( listbox, i.text );
+ }
+ formWindow()->mainWindow()->propertyeditor()->refetchData();
+}
+
+// ------------------------------------------------------------
+
+PopulateIconViewCommand::PopulateIconViewCommand( const TQString &n, FormWindow *fw,
+ TQIconView *iv, const TQValueList<Item> &items )
+ : Command( n, fw ), newItems( items ), iconview( iv )
+{
+#ifndef TQT_NO_ICONVIEW
+ TQIconViewItem *i = 0;
+ for ( i = iconview->firstItem(); i; i = i->nextItem() ) {
+ Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ oldItems.append( item );
+ }
+#endif
+}
+
+void PopulateIconViewCommand::execute()
+{
+#ifndef TQT_NO_ICONVIEW
+ iconview->clear();
+ for ( TQValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) {
+ Item i = *it;
+ (void)new TQIconViewItem( iconview, i.text, i.pix );
+ }
+#endif
+}
+
+void PopulateIconViewCommand::unexecute()
+{
+#ifndef TQT_NO_ICONVIEW
+ iconview->clear();
+ for ( TQValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) {
+ Item i = *it;
+ (void)new TQIconViewItem( iconview, i.text, i.pix );
+ }
+#endif
+}
+
+// ------------------------------------------------------------
+
+PopulateListViewCommand::PopulateListViewCommand( const TQString &n, FormWindow *fw,
+ TQListView *lv, TQListView *from )
+ : Command( n, fw ), listview( lv )
+{
+ newItems = new TQListView();
+ newItems->hide();
+ transferItems( from, newItems );
+ oldItems = new TQListView();
+ oldItems->hide();
+ transferItems( listview, oldItems );
+}
+
+void PopulateListViewCommand::execute()
+{
+ listview->clear();
+ transferItems( newItems, listview );
+}
+
+void PopulateListViewCommand::unexecute()
+{
+ listview->clear();
+ transferItems( oldItems, listview );
+}
+
+void PopulateListViewCommand::transferItems( TQListView *from, TQListView *to )
+{
+ TQHeader *header = to->header();
+ while ( header->count() )
+ to->removeColumn( 0 );
+ TQHeader *h2 = from->header();
+ for ( int i = 0; i < h2->count(); ++i ) {
+ to->addColumn( h2->label( i ) );
+ if ( h2->iconSet( i ) && !h2->iconSet( i )->pixmap().isNull() )
+ header->setLabel( i, *h2->iconSet( i ), h2->label( i ) );
+ header->setResizeEnabled( h2->isResizeEnabled( i ), i );
+ header->setClickEnabled( h2->isClickEnabled( i ), i );
+ }
+
+ TQListViewItemIterator it( from );
+ TQPtrStack<TQListViewItem> fromParents, toParents;
+ fromParents.push( 0 );
+ toParents.push( 0 );
+ TQPtrStack<TQListViewItem> toLasts;
+ TQListViewItem *fromLast = 0;
+ toLasts.push( 0 );
+ int cols = from->columns();
+ to->setSorting( -1 );
+ from->setSorting( -1 );
+ for ( ; it.current(); ++it ) {
+ TQListViewItem *i = it.current();
+ if ( i->tqparent() == fromParents.top() ) {
+ TQListViewItem *pi = toParents.top();
+ TQListViewItem *ni = 0;
+ if ( pi )
+ ni = new TQListViewItem( pi, toLasts.top() );
+ else
+ ni = new TQListViewItem( to, toLasts.top() );
+ for ( int c = 0; c < cols; ++c ) {
+ ni->setText( c, i->text( c ) );
+ if ( i->pixmap( c ) )
+ ni->setPixmap( c, *i->pixmap( c ) );
+ }
+ toLasts.pop();
+ toLasts.push( ni );
+ if ( pi )
+ pi->setOpen( TRUE );
+ } else {
+ if ( i->tqparent() == fromLast ) {
+ fromParents.push( fromLast );
+ toParents.push( toLasts.top() );
+ toLasts.push( 0 );
+ TQListViewItem *pi = toParents.top();
+ TQListViewItem *ni = 0;
+ if ( pi )
+ ni = new TQListViewItem( pi );
+ else
+ ni = new TQListViewItem( to );
+ for ( int c = 0; c < cols; ++c ) {
+ ni->setText( c, i->text( c ) );
+ if ( i->pixmap( c ) )
+ ni->setPixmap( c, *i->pixmap( c ) );
+ }
+ toLasts.pop();
+ toLasts.push( ni );
+ if ( pi )
+ pi->setOpen( TRUE );
+ } else {
+ while ( fromParents.top() != i->tqparent() ) {
+ fromParents.pop();
+ toParents.pop();
+ toLasts.pop();
+ }
+
+ TQListViewItem *pi = toParents.top();
+ TQListViewItem *ni = 0;
+ if ( pi )
+ ni = new TQListViewItem( pi, toLasts.top() );
+ else
+ ni = new TQListViewItem( to, toLasts.top() );
+ for ( int c = 0; c < cols; ++c ) {
+ ni->setText( c, i->text( c ) );
+ if ( i->pixmap( c ) )
+ ni->setPixmap( c, *i->pixmap( c ) );
+ }
+ if ( pi )
+ pi->setOpen( TRUE );
+ toLasts.pop();
+ toLasts.push( ni );
+ }
+ }
+ fromLast = i;
+ }
+}
+
+
+
+// ------------------------------------------------------------
+
+PopulateMultiLineEditCommand::PopulateMultiLineEditCommand( const TQString &n, FormWindow *fw,
+ TQTextEdit *mle, const TQString &txt )
+ : Command( n, fw ), newText( txt ), mlined( mle )
+{
+ oldText = mlined->text();
+ wasChanged = MetaDataBase::isPropertyChanged( mlined, "text" );
+}
+
+void PopulateMultiLineEditCommand::execute()
+{
+ mlined->setText( newText );
+ MetaDataBase::setPropertyChanged( mlined, "text", TRUE );
+ formWindow()->emitUpdateProperties( mlined );
+}
+
+void PopulateMultiLineEditCommand::unexecute()
+{
+ mlined->setText( oldText );
+ MetaDataBase::setPropertyChanged( mlined, "text", wasChanged );
+ formWindow()->emitUpdateProperties( mlined );
+}
+
+// ------------------------------------------------------------
+
+PopulateTableCommand::PopulateTableCommand( const TQString &n, FormWindow *fw, TQTable *t,
+ const TQValueList<Row> &rows,
+ const TQValueList<Column> &columns )
+ : Command( n, fw ), newRows( rows ), newColumns( columns ), table( t )
+{
+#ifndef TQT_NO_TABLE
+ int i = 0;
+ TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( table );
+ for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
+ PopulateTableCommand::Column col;
+ col.text = table->horizontalHeader()->label( i );
+ if ( table->horizontalHeader()->iconSet( i ) )
+ col.pix = table->horizontalHeader()->iconSet( i )->pixmap();
+ col.field = *columnFields.tqfind( col.text );
+ oldColumns.append( col );
+ }
+ for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
+ PopulateTableCommand::Row row;
+ row.text = table->verticalHeader()->label( i );
+ if ( table->verticalHeader()->iconSet( i ) )
+ row.pix = table->verticalHeader()->iconSet( i )->pixmap();
+ oldRows.append( row );
+ }
+#endif
+}
+
+void PopulateTableCommand::execute()
+{
+#ifndef TQT_NO_TABLE
+ TQMap<TQString, TQString> columnFields;
+ table->setNumCols( (int)newColumns.count() );
+ int i = 0;
+ for ( TQValueList<Column>::Iterator cit = newColumns.begin(); cit != newColumns.end(); ++cit, ++i ) {
+ table->horizontalHeader()->setLabel( i, (*cit).pix, (*cit).text );
+ if ( !(*cit).field.isEmpty() )
+ columnFields.insert( (*cit).text, (*cit).field );
+ }
+ MetaDataBase::setColumnFields( table, columnFields );
+ table->setNumRows( (int)newRows.count() );
+ i = 0;
+ for ( TQValueList<Row>::Iterator rit = newRows.begin(); rit != newRows.end(); ++rit, ++i )
+ table->verticalHeader()->setLabel( i, (*rit).pix, (*rit).text );
+#endif
+}
+
+void PopulateTableCommand::unexecute()
+{
+#ifndef TQT_NO_TABLE
+ TQMap<TQString, TQString> columnFields;
+ table->setNumCols( (int)oldColumns.count() );
+ int i = 0;
+ for ( TQValueList<Column>::Iterator cit = oldColumns.begin(); cit != oldColumns.end(); ++cit, ++i ) {
+ table->horizontalHeader()->setLabel( i, (*cit).pix, (*cit).text );
+ if ( !(*cit).field.isEmpty() )
+ columnFields.insert( (*cit).text, (*cit).field );
+ }
+ MetaDataBase::setColumnFields( table, columnFields );
+ table->setNumRows( (int)oldRows.count() );
+ i = 0;
+ for ( TQValueList<Row>::Iterator rit = oldRows.begin(); rit != oldRows.end(); ++rit, ++i )
+ table->verticalHeader()->setLabel( i, (*rit).pix, (*rit).text );
+#endif
+}
+
+// ------------------------------------------------------------
+
+AddActionToToolBarCommand::AddActionToToolBarCommand( const TQString &n, FormWindow *fw,
+ TQAction *a, TQDesignerToolBar *tb, int idx )
+ : Command( n, fw ), action( a ), toolBar( tb ), index( idx )
+{
+}
+
+void AddActionToToolBarCommand::execute()
+{
+ action->addTo( toolBar );
+
+ if ( ::tqqt_cast<TQDesignerAction*>(action) ) {
+ TQString s = ( (TQDesignerAction*)action )->widget()->name();
+ if ( s.startsWith( "qt_dead_widget_" ) ) {
+ s.remove( 0, TQString( "qt_dead_widget_" ).length() );
+ ( (TQDesignerAction*)action )->widget()->setName( s );
+ }
+ toolBar->insertAction( ( (TQDesignerAction*)action )->widget(), action );
+ ( (TQDesignerAction*)action )->widget()->installEventFilter( toolBar );
+ } else if ( ::tqqt_cast<TQDesignerActionGroup*>(action) ) {
+ if ( ( (TQDesignerActionGroup*)action )->usesDropDown() ) {
+ toolBar->insertAction( ( (TQDesignerActionGroup*)action )->widget(), action );
+ ( (TQDesignerActionGroup*)action )->widget()->installEventFilter( toolBar );
+ }
+ } else if ( ::tqqt_cast<TQSeparatorAction*>(action) ) {
+ toolBar->insertAction( ( (TQSeparatorAction*)action )->widget(), action );
+ ( (TQSeparatorAction*)action )->widget()->installEventFilter( toolBar );
+ }
+ if ( !::tqqt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) {
+ if ( index == -1 )
+ toolBar->appendAction( action );
+ else
+ toolBar->insertAction( index, action );
+ toolBar->reInsert();
+ TQObject::connect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) );
+ } else {
+ if ( !action->childrenListObject().isEmpty() ) {
+ TQObjectListIt it( action->childrenListObject() );
+ int i = 0;
+ while ( it.current() ) {
+ TQObject *o = it.current();
+ ++it;
+ if ( !::tqqt_cast<TQAction*>(o) )
+ continue;
+ // ### fix it for nested actiongroups
+ if ( ::tqqt_cast<TQDesignerAction*>(o) ) {
+ TQDesignerAction *ac = (TQDesignerAction*)o;
+ toolBar->insertAction( ac->widget(), ac );
+ ac->widget()->installEventFilter( toolBar );
+ if ( index == -1 )
+ toolBar->appendAction( ac );
+ else
+ toolBar->insertAction( index + (i++), ac );
+ }
+ TQObject::connect( o, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) );
+ }
+ }
+ toolBar->reInsert();
+ TQObject::connect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) );
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddActionToToolBarCommand::unexecute()
+{
+ if ( ::tqqt_cast<TQDesignerAction*>(action) ) {
+ TQString s = ( (TQDesignerAction*)action )->widget()->name();
+ s.prepend( "qt_dead_widget_" );
+ ( (TQDesignerAction*)action )->widget()->setName( s );
+ }
+
+ toolBar->removeAction( action );
+ action->removeFrom( toolBar );
+ TQObject::disconnect( action, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) );
+ if ( !::tqqt_cast<TQActionGroup*>(action) || ( (TQActionGroup*)action )->usesDropDown()) {
+ action->removeEventFilter( toolBar );
+ } else {
+ if ( !action->childrenListObject().isEmpty() ) {
+ TQObjectListIt it( action->childrenListObject() );
+ while ( it.current() ) {
+ TQObject *o = it.current();
+ ++it;
+ if ( !::tqqt_cast<TQAction*>(o) )
+ continue;
+ if ( ::tqqt_cast<TQDesignerAction*>(o) ) {
+ o->removeEventFilter( toolBar );
+ toolBar->removeAction( (TQAction*)o );
+ }
+ TQObject::disconnect( o, TQT_SIGNAL( destroyed() ), toolBar, TQT_SLOT( actionRemoved() ) );
+ }
+ }
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+AddToolBarCommand::AddToolBarCommand( const TQString &n, FormWindow *fw, TQMainWindow *mw )
+ : Command( n, fw ), toolBar( 0 ), mainWindow( mw )
+{
+}
+
+void AddToolBarCommand::execute()
+{
+ if ( !toolBar ) {
+ toolBar = new TQDesignerToolBar( mainWindow );
+ TQString n = "Toolbar";
+ formWindow()->unify( toolBar, n, TRUE );
+ toolBar->setName( n );
+ mainWindow->addToolBar( toolBar, n );
+ } else {
+ toolBar->show();
+ TQString s = toolBar->name();
+ s.remove( 0, TQString( "qt_dead_widget_" ).length() );
+ toolBar->setName( s );
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddToolBarCommand::unexecute()
+{
+ toolBar->hide();
+ TQString s = toolBar->name();
+ s.prepend( "qt_dead_widget_" );
+ toolBar->setName( s );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+AddContainerPageCommand::AddContainerPageCommand( const TQString &n, FormWindow *fw,
+ TQWidget *c, const TQString &label )
+ : Command( n, fw ), container( c ), index( -1 ), pageLabel( label ), page( 0 )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( container ), &iface );
+ if ( !iface )
+ return;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&wiface );
+ if ( !wiface )
+ return;
+ wClassName = WidgetFactory::classNameOf( container );
+}
+
+AddContainerPageCommand::~AddContainerPageCommand()
+{
+ if ( wiface )
+ wiface->release();
+}
+
+void AddContainerPageCommand::execute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ if ( index == -1 )
+ index = wiface->count( wClassName, container );
+ if ( !page )
+ page = wiface->addPage( wClassName, container, pageLabel, index );
+ else
+ wiface->insertPage( wClassName, container, pageLabel, index, page );
+
+ MetaDataBase::addEntry( page );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+void AddContainerPageCommand::unexecute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ wiface->removePage( wClassName, container, index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+// ------------------------------------------------------------
+
+DeleteContainerPageCommand::DeleteContainerPageCommand( const TQString &n, FormWindow *fw,
+ TQWidget *c, int idx )
+ : Command( n, fw ), container( c ), index( idx )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( container ), &iface );
+ if ( !iface )
+ return;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&wiface );
+ if ( !wiface )
+ return;
+ wClassName = WidgetFactory::classNameOf( container );
+ page = wiface->page( wClassName, container, index );
+ pageLabel = wiface->pageLabel( wClassName, container, index );
+}
+
+DeleteContainerPageCommand::~DeleteContainerPageCommand()
+{
+ if ( wiface )
+ wiface->release();
+}
+
+void DeleteContainerPageCommand::execute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+
+ wiface->removePage( wClassName, container, index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+void DeleteContainerPageCommand::unexecute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ if ( index == -1 )
+ index = wiface->count( wClassName, container );
+
+ wiface->insertPage( wClassName, container, pageLabel, index, page );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+// ------------------------------------------------------------
+
+RenameContainerPageCommand::RenameContainerPageCommand( const TQString &n, FormWindow *fw,
+ TQWidget *c, int idx,
+ const TQString &label )
+ : Command( n, fw ), container( c ), index( idx ), newLabel( label )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( container ), &iface );
+ if ( !iface )
+ return;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&wiface );
+ if ( !wiface )
+ return;
+ wClassName = WidgetFactory::classNameOf( container );
+ oldLabel = wiface->pageLabel( wClassName, container, index );
+}
+
+RenameContainerPageCommand::~RenameContainerPageCommand()
+{
+ if ( wiface )
+ wiface->release();
+}
+
+void RenameContainerPageCommand::execute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ wiface->renamePage( wClassName, container, index, newLabel );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+void RenameContainerPageCommand::unexecute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ wiface->renamePage( wClassName, container, index, oldLabel );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+// ------------------------------------------------------------
+
+AddActionToPopupCommand::AddActionToPopupCommand( const TQString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ PopupMenuEditorItem *i,
+ int idx )
+ : Command( n, fw ), menu( m ), item( i ), index( idx )
+{ }
+
+void AddActionToPopupCommand::execute()
+{
+ menu->insert( item, index );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddActionToPopupCommand::unexecute()
+{
+ item->hideMenu();
+ int i = menu->tqfind( item->action() );
+ menu->remove( i );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+RemoveActionFromPopupCommand::RemoveActionFromPopupCommand( const TQString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int idx )
+ : AddActionToPopupCommand( n, fw, m, 0, idx )
+{
+ item = menu->at( index );
+}
+
+void RemoveActionFromPopupCommand::execute()
+{
+ AddActionToPopupCommand::unexecute();
+}
+
+void RemoveActionFromPopupCommand::unexecute()
+{
+ AddActionToPopupCommand::execute();
+}
+
+// ------------------------------------------------------------
+
+ExchangeActionInPopupCommand::ExchangeActionInPopupCommand( const TQString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int a,
+ int b )
+ : Command( n, fw ), menu( m ), c( a ), d( b )
+{ }
+
+void ExchangeActionInPopupCommand::execute()
+{
+ menu->exchange( c, d );
+}
+
+void ExchangeActionInPopupCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+ActionEditor *ActionCommand::actionEditor()
+{
+ // FIXME: handle multiple action editors
+ return (ActionEditor *) formWindow()->mainWindow()->child( 0, "ActionEditor" );
+}
+
+// ------------------------------------------------------------
+
+RenameActionCommand::RenameActionCommand( const TQString &n,
+ FormWindow *fw,
+ TQAction *a,
+ PopupMenuEditor *m,
+ TQString nm )
+ : ActionCommand( n, fw, a ), menu( m ), newName( nm )
+{
+ oldName = action->menuText();
+}
+
+void RenameActionCommand::execute()
+{
+ TQString actionText = newName;
+ actionText.tqreplace("&&", "&");
+ TQString menuText = newName;
+ action->setText( actionText );
+ action->setMenuText( menuText );
+
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void RenameActionCommand::unexecute()
+{
+ action->setMenuText( oldName );
+ action->setText( oldName );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+SetActionIconsCommand::SetActionIconsCommand( const TQString &n,
+ FormWindow *fw,
+ TQAction *a,
+ PopupMenuEditor *m,
+ TQIconSet &icons )
+ : ActionCommand( n, fw, a ), menu( m ), newIcons( icons )
+{
+ oldIcons = a->iconSet();
+}
+
+void SetActionIconsCommand::execute()
+{
+ action->setIconSet( newIcons );
+ ActionEditor *ae = actionEditor();
+ if ( ae )
+ ae->updateActionIcon( action );
+ MetaDataBase::setPropertyChanged( action, "iconSet", TRUE );
+}
+
+void SetActionIconsCommand::unexecute()
+{
+ action->setIconSet( oldIcons );
+ ActionEditor *ae = actionEditor();
+ if ( ae )
+ ae->updateActionIcon( action );
+ MetaDataBase::setPropertyChanged( action, "iconSet", TRUE );
+}
+
+// ------------------------------------------------------------
+
+AddMenuCommand::AddMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ MenuBarEditorItem *i,
+ int idx )
+ : Command( n, fw ), mb( b ), item( i ), name( 0 ), index( idx )
+{ }
+
+AddMenuCommand::AddMenuCommand( const TQString &n,
+ FormWindow *fw,
+ TQMainWindow *mw,
+ const TQString &nm )
+ : Command( n, fw ), mb( 0 ), item( 0 ), name( nm ), index( -1 )
+{
+ if ( mw )
+ mb = (MenuBarEditor *)mw->child( 0, "MenuBarEditor" );
+}
+
+void AddMenuCommand::execute()
+{
+ TQString n;
+ TQMainWindow *mw = (TQMainWindow*)formWindow()->mainContainer();
+ if ( !mb ) {
+ mb = new MenuBarEditor( formWindow(), mw );
+ mb->setName( "MenuBarEditor" );
+ formWindow()->insertWidget( mb, TRUE );
+ }
+ if ( !item ) {
+ PopupMenuEditor *popup = new PopupMenuEditor( formWindow(), mw );
+ popup->setName( "PopupMenuEditor" );
+ formWindow()->insertWidget( popup, TRUE );
+ mb->insertItem( name, popup, index );
+ index = mb->tqfindItem( popup );
+ item = mb->item( index );
+ } else {
+ PopupMenuEditor *popup = item->menu();
+ popup->setName( item->menuText() );
+ formWindow()->insertWidget( popup, TRUE );
+ mb->insertItem( item, index );
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddMenuCommand::unexecute()
+{
+ if ( !item ) {
+ qWarning( "The AddMenuCommand was created without a menu item." );
+ return;
+ }
+ item->menu()->hide();
+ int i = mb->tqfindItem( item );
+ formWindow()->removeWidget( item->menu() );
+ mb->removeItemAt( i );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+RemoveMenuCommand::RemoveMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int idx )
+ : AddMenuCommand( n, fw, b, 0, idx )
+{
+ item = mb->item( index );
+}
+
+void RemoveMenuCommand::execute()
+{
+ mb->hideItem( index );
+ AddMenuCommand::unexecute();
+}
+
+void RemoveMenuCommand::unexecute()
+{
+ AddMenuCommand::execute();
+}
+
+// ------------------------------------------------------------
+
+ExchangeMenuCommand::ExchangeMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j )
+ : Command( n, fw ), bar( b ), k( i ), l( j )
+{ }
+
+void ExchangeMenuCommand::execute()
+{
+ bar->exchange( k, l );
+}
+
+void ExchangeMenuCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+MoveMenuCommand::MoveMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j )
+ : Command( n, fw ), bar( b ), from( i ), to( j )
+{ }
+
+void MoveMenuCommand::execute()
+{
+ bar->hideItem( from );
+ MenuBarEditorItem * i = bar->item( from );
+ bar->removeItemAt( from );
+ int t = ( from > to ? to : to - 1 );
+ bar->insertItem( i, t );
+}
+
+void MoveMenuCommand::unexecute()
+{
+ bar->hideItem( to );
+ int t = ( from > to ? to : to - 1 );
+ MenuBarEditorItem * i = bar->item( t );
+ bar->removeItemAt( t );
+ bar->insertItem( i, from );
+}
+
+// ------------------------------------------------------------
+
+RenameMenuCommand::RenameMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ TQString nm,
+ MenuBarEditorItem *i )
+ : Command( n, fw ), bar( b ), item( i ), newName( nm )
+{
+ oldName = item->menu()->name();
+}
+
+TQString RenameMenuCommand::makeLegal( const TQString &str )
+{
+ // remove illegal characters
+ TQString d;
+ char c = 0, i = 0;
+ while ( !str.at(i).isNull() ) {
+ c = TQT_TQCHAR(str.at(i)).latin1();
+ if ( c == '-' || c == ' ' )
+ d += '_';
+ else if ( ( c >= '0' && c <= '9') || ( c >= 'A' && c <= 'Z' )
+ || c == '_' || ( c >= 'a' && c <= 'z' ) )
+ d += c;
+ ++i;
+ }
+ return d;
+}
+
+void RenameMenuCommand::execute()
+{
+ PopupMenuEditor *popup = item->menu();
+ item->setMenuText( newName );
+ TQString legal = makeLegal( newName );
+ formWindow()->unify( popup, legal, TRUE );
+ popup->setName( legal );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void RenameMenuCommand::unexecute()
+{
+ PopupMenuEditor *popup = item->menu();
+ item->setMenuText( oldName );
+ popup->setName( oldName );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+AddToolBoxPageCommand::AddToolBoxPageCommand( const TQString &n, FormWindow *fw,
+ TQToolBox *tw, const TQString &label )
+ : Command( n, fw ), toolBox( tw ), toolBoxLabel( label )
+{
+ toolBoxPage = new TQDesignerWidget( formWindow(), toolBox, "page" );
+ toolBoxPage->hide();
+ index = -1;
+ MetaDataBase::addEntry( toolBoxPage );
+}
+
+void AddToolBoxPageCommand::execute()
+{
+ index = toolBox->insertItem( index, toolBoxPage, toolBoxLabel);
+ toolBox->setCurrentIndex( index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddToolBoxPageCommand::unexecute()
+{
+ toolBox->removeItem( toolBoxPage );
+ toolBoxPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+DeleteToolBoxPageCommand::DeleteToolBoxPageCommand( const TQString &n, FormWindow *fw,
+ TQToolBox *tw, TQWidget *page )
+ : Command( n, fw ), toolBox( tw ), toolBoxPage( page )
+{
+ toolBoxLabel = toolBox->itemLabel( toolBox->currentIndex() );
+ index = toolBox->currentIndex();
+}
+
+void DeleteToolBoxPageCommand::execute()
+{
+ toolBox->removeItem( toolBoxPage );
+ toolBoxPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void DeleteToolBoxPageCommand::unexecute()
+{
+ index = toolBox->insertItem( index, toolBoxPage, toolBoxLabel );
+ toolBox->setCurrentIndex( index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/command.h b/tqtinterface/qt4/tools/designer/designer/command.h
new file mode 100644
index 0000000..33af7e4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/command.h
@@ -0,0 +1,1267 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef COMMAND_H
+#define COMMAND_H
+
+#include "metadatabase.h"
+#include "layout.h"
+
+#include <tqstring.h>
+#include <tqrect.h>
+#include <tqvaluelist.h>
+#include <tqvariant.h>
+#include <tqobject.h>
+#include <tqlistview.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
+#include <tqiconset.h>
+
+class TQWizard;
+class TQTabWidget;
+class Command;
+class TQWidget;
+class FormWindow;
+class PropertyEditor;
+class TQListBox;
+class TQIconView;
+class TQTable;
+class TQAction;
+class TQDesignerToolBar;
+class TQMainWindow;
+class TQTextEdit;
+struct LanguageInterface;
+class TQToolBox;
+
+class MenuBarEditor;
+class MenuBarEditorItem;
+class PopupMenuEditor;
+class PopupMenuEditorItem;
+class ActionEditor;
+
+class Command : public TQt
+{
+public:
+ Command( const TQString &n, FormWindow *fw );
+ virtual ~Command();
+
+ enum Type {
+ Resize,
+ Insert,
+ Move,
+ Delete,
+ SetProperty,
+ LayoutHorizontal,
+ LayoutVertical,
+ LayoutHorizontalSplitter,
+ LayoutVerticalSplitter,
+ LayoutGrid,
+ BreakLayout,
+ Macro,
+ AddTabPage,
+ DeleteTabPage,
+ MoveTabPage,
+ AddWidgetStackPage,
+ DeleteWidgetStackPage,
+ AddWizardPage,
+ DeleteWizardPage,
+ SwapWizardPages,
+ MoveWizardPage,
+ RenameWizardPage,
+ AddConnection,
+ RemoveConnection,
+ Lower,
+ Raise,
+ Paste,
+ TabOrder,
+ PopulateListBox,
+ PopulateIconView,
+ PopulateListView,
+ PopulateMultiLineEdit,
+ PopulateTable,
+ AddActionToToolBar,
+ RemoveActionFromToolBar,
+ AddToolBar,
+ RemoveToolBar,
+ AddFunction,
+ ChangeFunctionAttrib,
+ RemoveFunction,
+ AddVariable,
+ SetVariables,
+ RemoveVariable,
+ EditDefinitions,
+ AddContainerPage,
+ DeleteContainerPage,
+ RenameContainerPage,
+ AddActionToPopup,
+ RemoveActionFromPopup,
+ ExchangeActionInPopup,
+ //MoveActionInPopup,
+ RenameAction,
+ SetActionIcons,
+ AddMenu,
+ RemoveMenu,
+ ExchangeMenu,
+ MoveMenu,
+ RenameMenu,
+ AddToolBoxPage,
+ DeleteToolBoxPage
+ };
+
+ TQString name() const;
+
+ virtual void execute() = 0;
+ virtual void unexecute() = 0;
+ virtual Type type() const = 0;
+ virtual void merge( Command *c );
+ virtual bool canMerge( Command *c );
+
+ FormWindow *formWindow() const;
+
+private:
+ TQString cmdName;
+ FormWindow *formWin;
+
+};
+
+class CommandHistory : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ CommandHistory( int s );
+
+ void addCommand( Command *cmd, bool tryCompress = FALSE );
+ void undo();
+ void redo();
+
+ void emitUndoRedo();
+
+ void setModified( bool m );
+ bool isModified() const;
+
+public Q_SLOTS:
+ void checkCompressedCommand();
+
+Q_SIGNALS:
+ void undoRedoChanged( bool undoAvailable, bool redoAvailable,
+ const TQString &undoCmd, const TQString &redoCmd );
+ void modificationChanged( bool m );
+
+private:
+ TQPtrList<Command> history;
+ int current, steps;
+ bool modified;
+ int savedAt;
+ Command *compressedCommand;
+
+};
+
+class ResizeCommand : public Command
+{
+public:
+ ResizeCommand( const TQString &n, FormWindow *fw,
+ TQWidget *w, const TQRect &oldr, const TQRect &nr );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Resize; }
+
+private:
+ TQWidget *widget;
+ TQRect oldRect, newRect;
+
+};
+
+class InsertCommand : public Command
+{
+public:
+ InsertCommand( const TQString &n, FormWindow *fw, TQWidget *w, const TQRect &g );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Insert; }
+
+private:
+ TQWidget *widget;
+ TQRect tqgeometry;
+
+};
+
+class MoveCommand : public Command
+{
+public:
+ MoveCommand( const TQString &n, FormWindow *fw,
+ const TQWidgetList &w,
+ const TQValueList<TQPoint> op,
+ const TQValueList<TQPoint> np,
+ TQWidget *opr, TQWidget *npr );
+ void execute();
+ void unexecute();
+ Type type() const { return Move; }
+ void merge( Command *c );
+ bool canMerge( Command *c );
+
+private:
+ TQWidgetList widgets;
+ TQValueList<TQPoint> oldPos, newPos;
+ TQWidget *oldParent, *newParent;
+
+};
+
+class DeleteCommand : public Command
+{
+public:
+ DeleteCommand( const TQString &n, FormWindow *fw,
+ const TQWidgetList &w );
+ void execute();
+ void unexecute();
+ Type type() const { return Delete; }
+
+private:
+ TQWidgetList widgets;
+ TQMap< TQWidget*, TQValueList<MetaDataBase::Connection> > connections;
+
+};
+
+class SetPropertyCommand : public Command
+{
+public:
+ SetPropertyCommand( const QString &n, FormWindow *fw,
+ TQT_BASE_OBJECT_NAME *w, PropertyEditor *e,
+ const QString &pn, const QVariant &ov,
+ const QVariant &nv, const QString &ncut,
+ const QString &ocut,
+ bool reset = FALSE );
+
+ void execute();
+ void unexecute();
+ Type type() const { return SetProperty; }
+ void merge( Command *c );
+ bool canMerge( Command *c );
+ bool checkProperty();
+
+private:
+ void setProperty( const TQVariant &v, const TQString &currentItemText, bool select = TRUE );
+
+ TQGuardedPtr<TQObject> widget;
+ PropertyEditor *editor;
+ TQString propName;
+ TQVariant oldValue, newValue;
+ TQString oldCurrentItemText, newCurrentItemText;
+ bool wasChanged;
+ bool isResetCommand;
+
+};
+
+class LayoutHorizontalCommand : public Command
+{
+public:
+ LayoutHorizontalCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutHorizontal; }
+
+private:
+ HorizontalLayout tqlayout;
+
+};
+
+class LayoutHorizontalSplitCommand : public Command
+{
+public:
+ LayoutHorizontalSplitCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutHorizontalSplitter; }
+
+private:
+ HorizontalLayout tqlayout;
+
+};
+
+class LayoutVerticalCommand : public Command
+{
+public:
+ LayoutVerticalCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutVertical; }
+
+private:
+ VerticalLayout tqlayout;
+
+};
+
+class LayoutVerticalSplitCommand : public Command
+{
+public:
+ LayoutVerticalSplitCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutVerticalSplitter; }
+
+private:
+ VerticalLayout tqlayout;
+
+};
+
+class LayoutGridCommand : public Command
+{
+public:
+ LayoutGridCommand( const TQString &n, FormWindow *fw,
+ TQWidget *tqparent, TQWidget *layoutBase,
+ const TQWidgetList &wl, int xres, int yres );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutGrid; }
+
+private:
+ GridLayout tqlayout;
+
+};
+
+class BreakLayoutCommand : public Command
+{
+public:
+ BreakLayoutCommand( const TQString &n, FormWindow *fw,
+ TQWidget *layoutBase, const TQWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return BreakLayout; }
+
+private:
+ Layout *tqlayout;
+ int spacing;
+ int margin;
+ TQWidget *lb;
+ TQWidgetList widgets;
+
+};
+
+class MacroCommand : public Command
+{
+public:
+ MacroCommand( const TQString &n, FormWindow *fw,
+ const TQPtrList<Command> &cmds );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Macro; }
+
+private:
+ TQPtrList<Command> commands;
+
+};
+
+class AddTabPageCommand : public Command
+{
+public:
+ AddTabPageCommand( const TQString &n, FormWindow *fw,
+ TQTabWidget *tw, const TQString &label );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddTabPage; }
+
+private:
+ TQTabWidget *tabWidget;
+ int index;
+ TQWidget *tabPage;
+ TQString tabLabel;
+
+};
+
+class DeleteTabPageCommand : public Command
+{
+public:
+ DeleteTabPageCommand( const TQString &n, FormWindow *fw,
+ TQTabWidget *tw, TQWidget *page );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteTabPage; }
+
+private:
+ TQTabWidget *tabWidget;
+ int index;
+ TQWidget *tabPage;
+ TQString tabLabel;
+
+};
+
+class MoveTabPageCommand : public Command
+{
+public:
+ MoveTabPageCommand(const TQString &n, FormWindow *fw,
+ TQTabWidget *tw, TQWidget *page, const TQString& label, int nIndex, int oIndex );
+
+ void execute();
+ void unexecute();
+ Type type() const { return MoveTabPage; }
+
+private:
+ TQTabWidget *tabWidget;
+ int newIndex, oldIndex;
+ TQWidget *tabPage;
+ TQString tabLabel;
+
+};
+class TQDesignerWidgetStack;
+class AddWidgetStackPageCommand : public Command
+{
+public:
+ AddWidgetStackPageCommand( const TQString &n, FormWindow *fw,
+ TQDesignerWidgetStack *ws );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddWidgetStackPage; }
+
+private:
+ TQDesignerWidgetStack *widgetStack;
+ int index;
+ TQWidget *stackPage;
+};
+
+class DeleteWidgetStackPageCommand : public Command
+{
+public:
+ DeleteWidgetStackPageCommand( const TQString &n, FormWindow *fw,
+ TQDesignerWidgetStack *ws, TQWidget *page );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteWidgetStackPage; }
+
+private:
+ TQDesignerWidgetStack *widgetStack;
+ int index;
+ TQWidget *stackPage;
+};
+
+
+
+class AddWizardPageCommand : public Command
+{
+public:
+ AddWizardPageCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, const TQString &label, int index = -1, bool show = TRUE );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddWizardPage; }
+
+private:
+ TQWizard *wizard;
+ int index;
+ bool show;
+ TQWidget *page;
+ TQString pageLabel;
+
+};
+
+class DeleteWizardPageCommand : public Command
+{
+public:
+ DeleteWizardPageCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, int index, bool show = TRUE );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteWizardPage; }
+
+private:
+ TQWizard *wizard;
+ int index;
+ bool show;
+ TQWidget *page;
+ TQString pageLabel;
+
+};
+
+class RenameWizardPageCommand : public Command
+{
+public:
+ RenameWizardPageCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, int index, const TQString& name );
+
+ void execute();
+ void unexecute();
+ Type type() const { return RenameWizardPage; }
+
+private:
+ TQWizard *wizard;
+ int index;
+ TQWidget *page;
+ TQString label;
+
+};
+
+class SwapWizardPagesCommand : public Command
+{
+public:
+ SwapWizardPagesCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, int index1, int index2 );
+
+ void execute();
+ void unexecute();
+ Type type() const { return SwapWizardPages; }
+
+private:
+ TQWizard *wizard;
+ int index1, index2;
+
+};
+
+class MoveWizardPageCommand : public Command
+{
+public:
+ MoveWizardPageCommand( const TQString &n, FormWindow *fw,
+ TQWizard *w, int index1, int index2 );
+
+ void execute();
+ void unexecute();
+ Type type() const { return MoveWizardPage; }
+
+private:
+ TQWizard *wizard;
+ int index1, index2;
+
+};
+
+class AddConnectionCommand : public Command
+{
+public:
+ AddConnectionCommand( const TQString &name, FormWindow *fw,
+ MetaDataBase::Connection c );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddConnection; }
+
+private:
+ MetaDataBase::Connection connection;
+
+};
+
+class RemoveConnectionCommand : public Command
+{
+public:
+ RemoveConnectionCommand( const TQString &name, FormWindow *fw,
+ MetaDataBase::Connection c );
+
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveConnection; }
+
+private:
+ MetaDataBase::Connection connection;
+
+};
+
+
+class AddFunctionCommand : public Command
+{
+public:
+ AddFunctionCommand( const TQString &name, FormWindow *fw, const TQCString &f, const TQString& spec,
+ const TQString &a, const TQString &t, const TQString &l, const TQString &rt );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddFunction; }
+
+private:
+ TQCString function;
+ TQString specifier;
+ TQString access;
+ TQString functionType;
+ TQString language;
+ TQString returnType;
+};
+
+class ChangeFunctionAttribCommand : public Command
+{
+public:
+ ChangeFunctionAttribCommand( const TQString &name, FormWindow *fw, MetaDataBase::Function f,
+ const TQString &on, const TQString &os, const TQString &oa,
+ const TQString &ot, const TQString &ol, const TQString &ort );
+
+ void execute();
+ void unexecute();
+ Type type() const { return ChangeFunctionAttrib; }
+
+private:
+ TQString oldName, newName;
+ TQString oldSpec, newSpec;
+ TQString oldAccess, newAccess;
+ TQString oldType, newType;
+ TQString oldLang, newLang;
+ TQString oldReturnType, newReturnType;
+};
+
+class RemoveFunctionCommand : public Command
+{
+public:
+ RemoveFunctionCommand( const TQString &name, FormWindow *fw, const TQCString &f, const TQString& spec,
+ const TQString &a, const TQString &t, const TQString &l, const TQString &rt );
+
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveFunction; }
+
+private:
+ TQCString function;
+ TQString specifier;
+ TQString access;
+ TQString functionType;
+ TQString language;
+ TQString returnType;
+};
+
+class AddVariableCommand : public Command
+{
+public:
+ AddVariableCommand( const TQString &name, FormWindow *fw, const TQString &vn, const TQString &a );
+ void execute();
+ void unexecute();
+ Type type() const { return AddVariable; }
+
+private:
+ TQString varName;
+ TQString access;
+};
+
+class SetVariablesCommand : public Command
+{
+public:
+ SetVariablesCommand( const TQString &name, FormWindow *fw, TQValueList<MetaDataBase::Variable> lst );
+ void execute();
+ void unexecute();
+ Type type() const { return SetVariables; }
+
+private:
+ TQValueList<MetaDataBase::Variable> oldList, newList;
+};
+
+class RemoveVariableCommand : public Command
+{
+public:
+ RemoveVariableCommand( const TQString &name, FormWindow *fw, const TQString &vn );
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveVariable; }
+
+private:
+ TQString varName;
+ TQString access;
+};
+
+class EditDefinitionsCommand : public Command
+{
+public:
+ EditDefinitionsCommand( const TQString &name, FormWindow *fw, LanguageInterface *lf,
+ const TQString &n, const TQStringList &l );
+ void execute();
+ void unexecute();
+ Type type() const { return EditDefinitions; }
+
+private:
+ LanguageInterface *lIface;
+ TQString defName;
+ TQStringList newList, oldList;
+};
+
+class LowerCommand : public Command
+{
+public:
+ LowerCommand( const TQString &name, FormWindow *fw, const TQWidgetList &w );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Lower; }
+
+private:
+ TQWidgetList widgets;
+
+};
+
+class RaiseCommand : public Command
+{
+public:
+ RaiseCommand( const TQString &name, FormWindow *fw, const TQWidgetList &w );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Raise; }
+
+private:
+ TQWidgetList widgets;
+
+};
+
+class PasteCommand : public Command
+{
+public:
+ PasteCommand( const TQString &n, FormWindow *fw, const TQWidgetList &w );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Paste; }
+
+private:
+ TQWidgetList widgets;
+
+};
+
+class TabOrderCommand : public Command
+{
+public:
+ TabOrderCommand( const TQString &n, FormWindow *fw, const TQWidgetList &ol, const TQWidgetList &nl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return TabOrder; }
+ void merge( Command *c );
+ bool canMerge( Command *c );
+
+private:
+ TQWidgetList oldOrder, newOrder;
+
+};
+
+class PopulateListBoxCommand : public Command
+{
+public:
+ struct Item
+ {
+ TQString text;
+ TQPixmap pix;
+ TQ_DUMMY_COMPARISON_OPERATOR( Item )
+ };
+
+ PopulateListBoxCommand( const TQString &n, FormWindow *fw,
+ TQListBox *lb, const TQValueList<Item> &items );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateListBox; }
+
+ bool operator==( const PopulateListBoxCommand & ) const;
+
+private:
+ TQValueList<Item> oldItems, newItems;
+ TQListBox *listbox;
+
+};
+
+class PopulateIconViewCommand : public Command
+{
+public:
+ struct Item
+ {
+ TQString text;
+ TQPixmap pix;
+ TQ_DUMMY_COMPARISON_OPERATOR( Item )
+ };
+
+ PopulateIconViewCommand( const TQString &n, FormWindow *fw,
+ TQIconView *iv, const TQValueList<Item> &items );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateIconView; }
+
+ bool operator==( const PopulateIconViewCommand & ) const;
+
+private:
+ TQValueList<Item> oldItems, newItems;
+ TQIconView *iconview;
+
+};
+
+class PopulateListViewCommand : public Command
+{
+public:
+ PopulateListViewCommand( const TQString &n, FormWindow *fw,
+ TQListView *lv, TQListView *from );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateListView; }
+ static void transferItems( TQListView *from, TQListView *to );
+
+ bool operator==( const PopulateListViewCommand & ) const;
+
+private:
+ TQListView *oldItems, *newItems;
+ TQListView *listview;
+
+};
+
+class PopulateMultiLineEditCommand : public Command
+{
+public:
+ PopulateMultiLineEditCommand( const TQString &n, FormWindow *fw,
+ TQTextEdit *mle, const TQString &txt );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateMultiLineEdit; }
+
+private:
+ TQString newText, oldText;
+ TQTextEdit *mlined;
+ bool wasChanged;
+
+};
+
+class PopulateTableCommand : public Command
+{
+public:
+ struct Row
+ {
+ TQString text;
+ TQPixmap pix;
+ TQ_DUMMY_COMPARISON_OPERATOR( Row )
+ };
+
+ struct Column
+ {
+ TQString text;
+ TQPixmap pix;
+ TQString field;
+ TQ_DUMMY_COMPARISON_OPERATOR( Column )
+ };
+
+ PopulateTableCommand( const TQString &n, FormWindow *fw, TQTable *t,
+ const TQValueList<Row> &rows,
+ const TQValueList<Column> &columns );
+
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateTable; }
+
+private:
+ TQValueList<Row> oldRows, newRows;
+ TQValueList<Column> oldColumns, newColumns;
+ TQTable *table;
+
+};
+
+class AddActionToToolBarCommand : public Command
+{
+public:
+ AddActionToToolBarCommand( const TQString &n, FormWindow *fw,
+ TQAction *a, TQDesignerToolBar *tb, int idx );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddActionToToolBar; }
+
+private:
+ TQAction *action;
+ TQDesignerToolBar *toolBar;
+ int index;
+
+};
+
+class RemoveActionFromToolBarCommand : public AddActionToToolBarCommand
+{
+public:
+ RemoveActionFromToolBarCommand( const TQString &n, FormWindow *fw,
+ TQAction *a, TQDesignerToolBar *tb, int idx )
+ : AddActionToToolBarCommand( n, fw, a, tb, idx ) {}
+
+ void execute() { AddActionToToolBarCommand::unexecute(); }
+ void unexecute() { AddActionToToolBarCommand::execute(); }
+ Type type() const { return RemoveActionFromToolBar; }
+
+};
+
+// MenuCommands
+
+class AddToolBarCommand : public Command
+{
+public:
+ AddToolBarCommand( const TQString &n, FormWindow *fw, TQMainWindow *mw );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddToolBar; }
+
+protected:
+ TQDesignerToolBar *toolBar;
+ TQMainWindow *mainWindow;
+
+};
+
+class RemoveToolBarCommand : public AddToolBarCommand
+{
+public:
+ RemoveToolBarCommand( const TQString &n, FormWindow *fw, TQMainWindow *mw, TQDesignerToolBar *tb )
+ : AddToolBarCommand( n, fw, mw ) { toolBar = tb; }
+
+ void execute() { AddToolBarCommand::unexecute(); }
+ void unexecute() { AddToolBarCommand::execute(); }
+ Type type() const { return RemoveToolBar; }
+
+};
+
+struct TQWidgetContainerInterfacePrivate;
+
+class AddContainerPageCommand : public Command
+{
+public:
+ AddContainerPageCommand( const TQString &n, FormWindow *fw,
+ TQWidget *c, const TQString &label );
+
+ ~AddContainerPageCommand();
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddContainerPage; }
+
+private:
+ TQString wClassName;
+ TQWidget *container;
+ int index;
+ TQString pageLabel;
+ TQWidget *page;
+ TQWidgetContainerInterfacePrivate *wiface;
+
+};
+
+class DeleteContainerPageCommand : public Command
+{
+public:
+ DeleteContainerPageCommand( const TQString &n, FormWindow *fw,
+ TQWidget *container, int index );
+ ~DeleteContainerPageCommand();
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteContainerPage; }
+
+private:
+ TQString wClassName;
+ TQWidget *container;
+ int index;
+ TQString pageLabel;
+ TQWidget *page;
+ TQWidgetContainerInterfacePrivate *wiface;
+
+};
+
+class RenameContainerPageCommand : public Command
+{
+public:
+ RenameContainerPageCommand( const TQString &n, FormWindow *fw,
+ TQWidget *container, int index,
+ const TQString &label );
+ ~RenameContainerPageCommand();
+
+ void execute();
+ void unexecute();
+ Type type() const { return RenameContainerPage; }
+
+private:
+ TQString wClassName;
+ TQWidget *container;
+ int index;
+ TQString oldLabel, newLabel;
+ TQWidgetContainerInterfacePrivate *wiface;
+
+};
+
+class AddActionToPopupCommand : public Command
+{
+public:
+ AddActionToPopupCommand( const TQString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ PopupMenuEditorItem *i,
+ int idx = -1 );
+ void execute();
+ void unexecute();
+ Type type() const { return AddActionToPopup; }
+protected:
+ TQString constructName() const;
+ PopupMenuEditor *menu;
+ PopupMenuEditorItem *item;
+ int index;
+private:
+};
+
+class RemoveActionFromPopupCommand : public AddActionToPopupCommand
+{
+public:
+ RemoveActionFromPopupCommand( const TQString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int idx );
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveActionFromPopup; }
+protected:
+private:
+};
+
+class ExchangeActionInPopupCommand : public Command
+{
+public:
+ ExchangeActionInPopupCommand( const TQString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int a,
+ int b );
+ void execute();
+ void unexecute();
+ Type type() const { return ExchangeActionInPopup; }
+protected:
+private:
+ PopupMenuEditor *menu;
+ int c;
+ int d;
+};
+/*
+class MoveActionInPopupCommand : public Command
+{
+public:
+ MoveActionInPopupCommand( const TQString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int a,
+ int b );
+ void execute();
+ void unexecute();
+ Type type() const { return MoveActionInPopup; }
+protected:
+private:
+ PopupMenuEditor *menu;
+ int from;
+ int to;
+};
+*/
+class ActionCommand : public Command
+{
+public:
+ ActionCommand( const TQString &n,
+ FormWindow *fw,
+ TQAction *a )
+ : Command( n, fw ), action( a ) { }
+ virtual Type type() const = 0;
+protected:
+ ActionEditor *actionEditor();
+ TQAction *action;
+};
+
+class RenameActionCommand : public ActionCommand
+{
+public:
+ RenameActionCommand( const TQString &n,
+ FormWindow *fw,
+ TQAction *a,
+ PopupMenuEditor *m,
+ TQString nm );
+ void execute();
+ void unexecute();
+ Type type() const { return RenameAction; }
+private:
+ PopupMenuEditor *menu;
+ TQString newName;
+ TQString oldName;
+};
+
+class SetActionIconsCommand : public ActionCommand
+{
+public:
+ SetActionIconsCommand( const TQString &n,
+ FormWindow *fw,
+ TQAction *a,
+ PopupMenuEditor *m,
+ TQIconSet &icons );
+ void execute();
+ void unexecute();
+ Type type() const { return SetActionIcons; }
+protected:
+ void updateActionEditorItem();
+private:
+ PopupMenuEditor *menu;
+ TQIconSet newIcons;
+ TQIconSet oldIcons;
+};
+
+class AddMenuCommand : public Command
+{
+public:
+ AddMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ MenuBarEditorItem *i,
+ int idx = -1 );
+
+ AddMenuCommand( const TQString &n,
+ FormWindow *fw,
+ TQMainWindow *mw,
+ const TQString &nm = "Menu" );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddMenu; }
+protected:
+ MenuBarEditor *mb;
+ MenuBarEditorItem *item;
+ TQString name;
+ int index;
+private:
+};
+
+class RemoveMenuCommand : public AddMenuCommand
+{
+public:
+ RemoveMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int idx );
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveMenu; }
+protected:
+private:
+};
+
+class ExchangeMenuCommand : public Command
+{
+public:
+ ExchangeMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j );
+ void execute();
+ void unexecute();
+ Type type() const { return ExchangeMenu; }
+protected:
+private:
+ MenuBarEditor *bar;
+ int k;
+ int l;
+};
+
+
+class MoveMenuCommand : public Command
+{
+public:
+ MoveMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j );
+ void execute();
+ void unexecute();
+ Type type() const { return MoveMenu; }
+protected:
+private:
+ MenuBarEditor *bar;
+ int from;
+ int to;
+};
+
+class RenameMenuCommand : public Command
+{
+public:
+ RenameMenuCommand( const TQString &n,
+ FormWindow *fw,
+ MenuBarEditor *m,
+ TQString nm,
+ MenuBarEditorItem *i );
+ void execute();
+ void unexecute();
+ Type type() const { return RenameMenu; }
+ static TQString makeLegal( const TQString &str );
+private:
+ MenuBarEditor *bar;
+ MenuBarEditorItem *item;
+ TQString newName;
+ TQString oldName;
+};
+
+class AddToolBoxPageCommand : public Command
+{
+public:
+ AddToolBoxPageCommand( const TQString &n, FormWindow *fw,
+ TQToolBox *tw, const TQString &label );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddToolBoxPage; }
+
+private:
+ TQToolBox *toolBox;
+ int index;
+ TQWidget *toolBoxPage;
+ TQString toolBoxLabel;
+
+};
+
+class DeleteToolBoxPageCommand : public Command
+{
+public:
+ DeleteToolBoxPageCommand( const TQString &n, FormWindow *fw,
+ TQToolBox *tw, TQWidget *page );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteToolBoxPage; }
+
+private:
+ TQToolBox *toolBox;
+ int index;
+ TQWidget *toolBoxPage;
+ TQString toolBoxLabel;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui b/tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui
new file mode 100644
index 0000000..e3911bd
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui
@@ -0,0 +1,329 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConfigToolboxDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2002-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ConfigToolboxDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>403</width>
+ <height>467</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Configure Toolbox</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>342</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonAdd</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>111</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQListView" row="0" column="0" rowspan="1" colspan="2">
+ <column>
+ <property name="text">
+ <string>Available Tools</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listViewTools</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Extended</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>buttonRemove</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="TQListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Common Widgets Page</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listViewCommon</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Extended</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="TQToolButton" row="1" column="3">
+ <property name="name">
+ <cstring>buttonDown</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_down.png</pixmap>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>41</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQToolButton" row="1" column="2">
+ <property name="name">
+ <cstring>buttonUp</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_up.png</pixmap>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>addTool()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemove</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>removeTool()</slot>
+ </connection>
+ <connection>
+ <sender>buttonUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>moveToolUp()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>moveToolDown()</slot>
+ </connection>
+ <connection>
+ <sender>listViewTools</sender>
+ <signal>clicked(TQListViewItem*)</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>currentToolChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listViewCommon</sender>
+ <signal>clicked(TQListViewItem*)</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>currentCommonToolChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>ok()</slot>
+ </connection>
+ <connection>
+ <sender>listViewTools</sender>
+ <signal>doubleClicked(TQListViewItem*)</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>addTool()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">configtoolboxdialog.ui.h</include>
+</includes>
+<Q_SLOTS>
+ <slot>addTool()</slot>
+ <slot>removeTool()</slot>
+ <slot>moveToolUp()</slot>
+ <slot>moveToolDown()</slot>
+ <slot>currentToolChanged( TQListViewItem * i )</slot>
+ <slot>currentCommonToolChanged( TQListViewItem * i )</slot>
+ <slot>ok()</slot>
+</Q_SLOTS>
+<functions>
+ <function access="private">init()</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui.h b/tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui.h
new file mode 100644
index 0000000..4eb046b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/configtoolboxdialog.ui.h
@@ -0,0 +1,222 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "mainwindow.h"
+#include "widgetaction.h"
+#include "listviewdnd.h"
+#include <tqlistview.h>
+
+void ConfigToolboxDialog::init()
+{
+ listViewTools->setSorting( -1 );
+ listViewCommon->setSorting( -1 );
+
+ ListViewDnd *toolsDnd = new ListViewDnd( listViewTools );
+ toolsDnd->setDragMode( ListViewDnd::External | ListViewDnd::NullDrop | ListViewDnd::Flat );
+
+ ListViewDnd *commonDnd = new ListViewDnd( listViewCommon );
+ commonDnd->setDragMode( ListViewDnd::Both | ListViewDnd::Move | ListViewDnd::Flat );
+
+ TQObject::connect( toolsDnd, TQT_SIGNAL( dropped( TQListViewItem * ) ),
+ commonDnd, TQT_SLOT( confirmDrop( TQListViewItem * ) ) );
+ TQObject::connect( commonDnd, TQT_SIGNAL( dropped( TQListViewItem * ) ),
+ commonDnd, TQT_SLOT( confirmDrop( TQListViewItem * ) ) );
+
+ TQDict<TQListViewItem> groups;
+ TQAction *a;
+ for ( a = MainWindow::self->toolActions.last();
+ a;
+ a = MainWindow::self->toolActions.prev() ) {
+ TQString grp = ( (WidgetAction*)a )->group();
+ TQListViewItem *tqparent = groups.tqfind( grp );
+ if ( !tqparent ) {
+ tqparent = new TQListViewItem( listViewTools );
+ tqparent->setText( 0, grp );
+ tqparent->setOpen( TRUE );
+ groups.insert( grp, tqparent );
+ }
+ TQListViewItem *i = new TQListViewItem( tqparent );
+ i->setText( 0, a->text() );
+ i->setPixmap( 0, a->iconSet().pixmap() );
+ }
+ for ( a = MainWindow::self->commonWidgetsPage.last(); a;
+ a = MainWindow::self->commonWidgetsPage.prev() ) {
+ TQListViewItem *i = new TQListViewItem( listViewCommon );
+ i->setText( 0, a->text() );
+ i->setPixmap( 0, a->iconSet().pixmap() );
+ }
+
+}
+
+
+void ConfigToolboxDialog::addTool()
+{
+ TQListView *src = listViewTools;
+
+ bool addKids = FALSE;
+ TQListViewItem *nextSibling = 0;
+ TQListViewItem *nextParent = 0;
+ TQListViewItemIterator it = src->firstChild();
+ for ( ; *it; it++ ) {
+ // Hit the nextSibling, turn of child processing
+ if ( (*it) == nextSibling )
+ addKids = FALSE;
+
+ if ( (*it)->isSelected() ) {
+ if ( (*it)->childCount() == 0 ) {
+ // Selected, no tqchildren
+ TQListViewItem *i = new TQListViewItem( listViewCommon, listViewCommon->lastItem() );
+ i->setText( 0, (*it)->text(0) );
+ i->setPixmap( 0, *((*it)->pixmap(0)) );
+ listViewCommon->setCurrentItem( i );
+ listViewCommon->ensureItemVisible( i );
+ } else if ( !addKids ) {
+ // Children processing not set, so set it
+ // Also tqfind the item were we shall quit
+ // processing tqchildren...if any such item
+ addKids = TRUE;
+ nextSibling = (*it)->nextSibling();
+ nextParent = (*it)->tqparent();
+ while ( nextParent && !nextSibling ) {
+ nextSibling = nextParent->nextSibling();
+ nextParent = nextParent->tqparent();
+ }
+ }
+ } else if ( ((*it)->childCount() == 0) && addKids ) {
+ // Leaf node, and we _do_ process tqchildren
+ TQListViewItem *i = new TQListViewItem( listViewCommon, listViewCommon->lastItem() );
+ i->setText( 0, (*it)->text(0) );
+ i->setPixmap( 0, *((*it)->pixmap(0)) );
+ listViewCommon->setCurrentItem( i );
+ listViewCommon->ensureItemVisible( i );
+ }
+ }
+}
+
+
+void ConfigToolboxDialog::removeTool()
+{
+ TQListViewItemIterator it = listViewCommon->firstChild();
+ while ( *it ) {
+ if ( (*it)->isSelected() )
+ delete (*it);
+ else
+ it++;
+ }
+}
+
+
+void ConfigToolboxDialog::moveToolUp()
+{
+ TQListViewItem *next = 0;
+ TQListViewItem *item = listViewCommon->firstChild();
+ for ( int i = 0; i < listViewCommon->childCount(); ++i ) {
+ next = item->itemBelow();
+ if ( item->isSelected() && (i > 0) && !item->itemAbove()->isSelected() )
+ item->itemAbove()->moveItem( item );
+ item = next;
+ }
+}
+
+
+void ConfigToolboxDialog::moveToolDown()
+{
+ int count = listViewCommon->childCount();
+ TQListViewItem *next = 0;
+ TQListViewItem *item = listViewCommon->lastItem();
+ for ( int i = 0; i < count; ++i ) {
+ next = item->itemAbove();
+ if ( item->isSelected() && (i > 0) && !item->itemBelow()->isSelected() )
+ item->moveItem( item->itemBelow() );
+ item = next;
+ }
+
+ // TQListViewItem *item = listViewCommon->firstChild();
+ // for ( int i = 0; i < listViewCommon->childCount(); ++i ) {
+ //if ( item == listViewCommon->currentItem() ) {
+ // item->moveItem( item->itemBelow() );
+ // currentCommonToolChanged( item );
+ // break;
+ //}
+ //item = item->itemBelow();
+ // }
+}
+
+
+void ConfigToolboxDialog::currentToolChanged( TQListViewItem *i )
+{
+ bool canAdd = FALSE;
+ TQListViewItemIterator it = listViewTools->firstChild();
+ for ( ; *it; it++ ) {
+ if ( (*it)->isSelected() ) {
+ canAdd = TRUE;
+ break;
+ }
+ }
+ buttonAdd->setEnabled( canAdd || ( i && i->isSelected() ) );
+}
+
+
+void ConfigToolboxDialog::currentCommonToolChanged( TQListViewItem *i )
+{
+ buttonUp->setEnabled( (bool) (i && i->itemAbove()) );
+ buttonDown->setEnabled( (bool) (i && i->itemBelow()) );
+
+ bool canRemove = FALSE;
+ TQListViewItemIterator it = listViewCommon->firstChild();
+ for ( ; *it; it++ ) {
+ if ( (*it)->isSelected() ) {
+ canRemove = TRUE;
+ break;
+ }
+ }
+ buttonRemove->setEnabled( canRemove || ( i && i->isSelected() ) );
+}
+
+
+void ConfigToolboxDialog::ok()
+{
+ MainWindow::self->commonWidgetsPage.clear();
+ TQListViewItem *item = listViewCommon->firstChild();
+ for ( int j = 0; j < listViewCommon->childCount(); item = item->itemBelow(), ++j ) {
+ TQAction *a = 0;
+ for ( a = MainWindow::self->toolActions.last();
+ a;
+ a = MainWindow::self->toolActions.prev() ) {
+ if ( a->text() == item->text( 0 ) )
+ break;
+ }
+ if ( a )
+ MainWindow::self->commonWidgetsPage.insert( j, a );
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/connectiondialog.ui b/tqtinterface/qt4/tools/designer/designer/connectiondialog.ui
new file mode 100644
index 0000000..8497775
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/connectiondialog.ui
@@ -0,0 +1,226 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConnectionDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2002-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ConnectionDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>365</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>View and Edit Connections</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Connections:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>connectionsTable</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="6" column="1">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>PushButton7</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>buttonEditSlots</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Slots...</string>
+ </property>
+ </widget>
+ <widget class="ConnectionTable" row="1" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>connectionsTable</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>ConnectionTable</class>
+ <header location="local">connectiontable.h</header>
+ <sizehint>
+ <width>50</width>
+ <height>50</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="4830">789c9597c972e3480e40eff5158ec2ada203cd3549c6c41cbcc9b6bccabbddd1078014bdcb9b6449ee987f9f240072caac9e4357d6c1cf5812890490f4ef3f562e8ff6577efcfeed7d4ad3bb72a5bca5b7951fd5ece969f9c79ffffeebdbf7285a69fec7f14af4fdb76fdf47d39572e5e079326e00c10304f24ff8b9c7d463ee71d9e3aac7e31ed70d67dc2ce1cb9e7cd0e3c957863eaff778d4b3bfe8c97be781a71eaff5f8e82bf37ecfff4dc314364b58fdb966096ff6ecf77af6b70d1771b3841f1b8ef366099ff7ec17bdf8faf7970847cd12f9b2e344f8b563890f5e3a96fda0ea98c45fdc71299c765c354c67c249bb1fcd3a56ff271d8b3d9d1b271a0f1d742c725874acfe9d70eef3a9f65bc2e47fa3f16a7d55411d6a3e4e1b0e03bf349e8171144a7e49ceeb295239cb79c3384ccdff76c7b23f14c269e8ccdfa9716ef6b5b18f407857d88585e57bbf65b39f18971a0fc8fd7b6fc624f723e524f9e3d2b8d4f391d49ba74ae5bed585a3c8e49b1d6b7c929f701ca5e65feac10b9dd967c2519485a9dcaf33ce952110cea3caec23e53830f9863045b5ca79ae1c8741263cec58eb59ed390ecd3e378e8d651e44651c85527f20f51cd55eae5c1b27a1f823b9bf388c0b65b831a6b090fd24be384bc24098a6d65fb5ca29ed58fd5f35eccbaf34ff320f922819ab3e487e93d4b3d6eb9b711d4abda0f44352a685d5f39d709db2ca296c380dd2c238366ee5605c1acb3c96f2d3feff148ed25aeb0d1e955d60fd22f94a63178632df79d5d8fa95971d8b9cee5b8e647ec1d038567b40e1a4d567a9d73475b1f14ecb5a7f2cf94a9d4b343eba304e357e3814ce5c6afd22f33b2d5c6ee7295bb6fc4abda4e40af3f7d972a4f52df79bb223ebff79cb2a2736e650ce470fc2652b67b9cfb4726dff5d195776bead96adbf1e3bd67a9779928ebbfdc898357f34346ee7c3a0658d07359eba5922d7fbaebd3fdd6f6e3c567d96f9e4c22cb4780a63eb7f90f7c525596cf11c1a2791ce9bd8d869bd93e4dba55eaeefc781b1dd17ee1b9b3e4b3e9dcbfcc4107f9fc671a4ef9dcc139765763fa4f6943965947a7355b3c45eceebc65965fb851deb79655e662ecfcddf93716172999759966791f67f689ceb79e9a363951f1b9b3d1e76acf36fcf98544e529fdebc954b3f67d42ce1eb86f3465df3fb2e5c14a5d53b2b53a0f316773ad6f922f32c2fa9cd9fdc6f5e79d6f8768d13ebc79d96559fe47dcd6b8a63cdcfbb71126bfcd21f45e0f5f57dbb357691c63f342e2cbea063d597f7b808c9e6151e1993c573d1b2de0fc8fd1711151a1fdf187324f393671debfe92df22a134d67e93fb2a1cd93c05630ef4fe48f25d641c683de2b171a8f399ef3a56f989b1bd273c6dd9f697f7bcc85b7dca8da348be4f41fabf2838b1f7e9cc38d5f715e4fd2888439b9f53639ba72cf55a701b3f0c8cad3ff9de38b57c4bfd15a5678d6f646cfd87857166ef95f46b51f9fdf57c609cda7b756edcbee7ceb850a671c7faf7809e7fccb9d63b6c1b93d5f7ac63d5d7fcd41c245a8fabc685e68f1f8c49ef93e5bda4c0fbd7f9b16b4c5a9ff060ccf63e4b3d52c889c6433bc685da33195bbfc2bd31dbfc947aa5982bf37fddb1c623f39c7cbbda7c94f889cac4ea4df24f55c9367fe43da47159da3c907ea39ac74ebfdfe5fe39e0dac9f71f4abed87fb02993d42b475562effb5dcb36ff243fec3f3f327d4fd1384db5ffd68c9db1bc579cb6faf8619cdafe321f39f39f33721fb46bec4cfe699c19cf3bd6f3ad1ae7c6f2de71ce2549fe71a9dcc917c685324b7eb8aac6767ff27dc763cf92afd1b4590848c8586285e3deaafc6fd94b61346df5b1c61bbcc53bbcff9bf5808ff884136ff5acfadef70dbee02bbee13b4e71861f38c7052ef1d3af555cc375dcc04d1c6069fae47dbfe2166ee30e0e7117f7701f0ff0108f7084c77882a77886e7788197a6cf3e922baf7d8d018618618c895f293acc30c702478000403831fdd247f90e8c019450610c63a8e1066efd4f15dcc13d3cc0a3d77f8256bff2fa531cc233bcc02bbcc13b4c61061f3087052ce11356c5ff1aac9bfed8ebcf701736bc741306b005dbb00343d8853def611f0ee0d0eb1fc1e827fd0f38861338f5becfe01c2ee0d26b5ec13504de4708d12ffa7388bd2481141c64907bed020f0909604944fc8bfe924a4ca8a231d5e2fb956ee896eee8deeb3fd0e32ffa0b7ac29426f041fed4f442afdee28dde694a33faa0f9aff1d0829618d327add21aadd3066dfafd06b445dbb443c3be3eedd21eed7bfd033aa4231ad1319dd0299dd1395dd0255dfd8dff6b0a28c4042af27fcc907fafc879ed73ff199053f145bfc207463c666062e6d2dfd9d2db2db9a20b1e73cd377cfbe5be4a5fb1eb7cc7f7fcc08ffcc4137ee6177ee5377ee729cff883e7bcf8a91ed8d7f7069ef1923f7995d7789d37789307bc4557bccd3b3ce45ddefba9defc4fbebecfe1fffce305eff1fe4ff50c3ea2015e00f93dd7fcb9beae35ff5bf2da5dbf788b676f71891398c03a8c7a6b1d267effcbfff5e33fe8f7fffcebdb7f01520e2ea3</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>addConnection()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton7</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>deleteClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonEditSlots</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>editSlots()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in declaration">tqptrlist.h</include>
+ <include location="local" impldecl="in declaration">connectionitems.h</include>
+ <include location="local" impldecl="in implementation">connectiondialog.ui.h</include>
+</includes>
+<variables>
+ <variable>TQPtrList&lt;ConnectionContainer&gt; connections;</variable>
+ <variable>TQObject *defaultSender;</variable>
+ <variable>TQObject *defaultReceiver;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>addConnection()</slot>
+ <slot returnType="ConnectionContainer *">addConnection( TQT_BASE_OBJECT_NAME * sender, TQT_BASE_OBJECT_NAME * receiver, const QString &amp; signal, const QString &amp; slot )</slot>
+ <slot>updateConnectionState( ConnectionContainer * c )</slot>
+ <slot>okClicked()</slot>
+ <slot>cancelClicked()</slot>
+ <slot>deleteClicked()</slot>
+ <slot>editSlots()</slot>
+ <slot>setDefault( TQT_BASE_OBJECT_NAME * sender, TQT_BASE_OBJECT_NAME * receiver )</slot>
+ <slot>updateEditSlotsButton()</slot>
+ <slot>updateConnectionContainers()</slot>
+ <slot>ensureConnectionVisible()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/connectiondialog.ui.h b/tqtinterface/qt4/tools/designer/designer/connectiondialog.ui.h
new file mode 100644
index 0000000..0113b95
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/connectiondialog.ui.h
@@ -0,0 +1,318 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename Q_SLOTS use TQt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include "mainwindow.h"
+#include "formwindow.h"
+#include "editfunctionsimpl.h"
+
+static const char *valid_connection[] = {
+ "16 14 7 1",
+ ". c none",
+ "# c #00c000",
+ "a c #008000",
+ "b c #004000",
+ "c c #000000",
+ "d c #c0fcc0",
+ "e c #400000",
+ "...............d",
+ "..............d#",
+ ".............d#a",
+ "............d#ab",
+ "...........d#abc",
+ "..da......d#abc.",
+ ".d##a....d#abe..",
+ "cba##a..d#abc...",
+ ".cba##ad#abe....",
+ "..eba###abe.....",
+ "...cba#abc......",
+ "....cbabc.......",
+ ".....cec........",
+ "................"
+};
+
+static const char * invalid_connection[] = {
+ "17 18 7 1",
+ " c None",
+ ". c #000000",
+ "+ c #C3C3C3",
+ "@ c #FFFFFF",
+ "# c #C00000",
+ "$ c #FFC0C0",
+ "% c #FF0000",
+ " ",
+ " . ",
+ " ... ",
+ " .+.. ",
+ " ...+@+.. ",
+ "..+@@@+#.. ",
+ ".@@@@$#%#.. ",
+ ".@@$$#%##.. ",
+ " .$%%%##.... ",
+ " .%%%##. .. ",
+ " .%#.. .. ",
+ " .. .. ",
+ " .. ",
+ " .. ",
+ " .. ",
+ " .. ",
+ " ",
+ " "
+};
+
+static TQPixmap *invalidConnection = 0;
+static TQPixmap *validConnection = 0;
+
+void ConnectionDialog::init()
+{
+ connect( connectionsTable, TQT_SIGNAL( currentChanged( int, int ) ),
+ this, TQT_SLOT( updateEditSlotsButton() ) );
+ connect( connectionsTable, TQT_SIGNAL( resorted() ),
+ this, TQT_SLOT( updateConnectionContainers() ) );
+ buttonEditSlots->setEnabled( FALSE );
+
+ if ( !invalidConnection ) {
+ invalidConnection = new TQPixmap( invalid_connection );
+ validConnection = new TQPixmap( valid_connection );
+ }
+
+ TQValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( MainWindow::self->formWindow() );
+ for ( TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ it != conns.end(); ++it ) {
+ ConnectionContainer *c = addConnection( (*it).sender, (*it).receiver,
+ (*it).signal, (*it).slot );
+ c->setModified( FALSE );
+ updateConnectionState( c );
+ }
+
+ defaultSender = defaultReceiver = 0;
+ connectionsTable->setCurrentCell( 0, 0 );
+}
+
+void ConnectionDialog::addConnection()
+{
+ addConnection( defaultSender, defaultReceiver, TQString(), TQString() );
+ ensureConnectionVisible();
+}
+
+ConnectionContainer *ConnectionDialog::addConnection( TQT_BASE_OBJECT_NAME *sender, TQT_BASE_OBJECT_NAME *receiver,
+ const QString &signal,
+ const QString &slot )
+{
+ connectionsTable->insertRows( connectionsTable->numRows() );
+
+ int row = connectionsTable->numRows() - 1;
+ SenderItem *se;
+ SignalItem *si;
+ ReceiverItem *re;
+ SlotItem *sl;
+ connectionsTable->setItem( row, 0,
+ ( se = new SenderItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+ connectionsTable->setItem( row, 1,
+ ( si = new SignalItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+ connectionsTable->setItem( row, 2,
+ ( re = new ReceiverItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+ connectionsTable->setItem( row, 3,
+ ( sl = new SlotItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+
+ si->setSender( se );
+ re->setSender( se );
+ sl->setSender( se );
+ se->setSender( se );
+
+ se->setSignal( si );
+ re->setSignal( si );
+ sl->setSignal( si );
+ si->setSignal( si );
+
+ se->setReceiver( re );
+ si->setReceiver( re );
+ sl->setReceiver( re );
+ re->setReceiver( re );
+
+ se->setSlot( sl );
+ si->setSlot( sl );
+ re->setSlot( sl );
+ sl->setSlot( sl );
+
+ connect( re, TQT_SIGNAL( currentReceiverChanged( TQObject * ) ),
+ this, TQT_SLOT( updateEditSlotsButton() ) );
+
+ ConnectionContainer *c = new ConnectionContainer( TQT_TQOBJECT(this), se, si, re, sl, row );
+ connections.append( c );
+ connect( c, TQT_SIGNAL( changed( ConnectionContainer * ) ),
+ this, TQT_SLOT( updateConnectionState( ConnectionContainer * ) ) );
+
+ connectionsTable->setCurrentCell( row, 0 );
+
+ connectionsTable->verticalHeader()->setLabel( row, *invalidConnection, TQString() );
+
+ if ( sender )
+ se->setSenderEx( TQT_TQOBJECT(sender) );
+ defaultSender = TQT_TQOBJECT(sender);
+ if ( receiver )
+ re->setReceiverEx( TQT_TQOBJECT(receiver) );
+ defaultReceiver = TQT_TQOBJECT(receiver);
+
+ if ( !signal.isEmpty() && !slot.isEmpty() ) {
+ si->setCurrentItem( signal );
+ sl->signalChanged( signal );
+ sl->setCurrentItem( slot );
+ }
+
+ c->setModified( TRUE );
+ return c;
+}
+
+void ConnectionDialog::updateConnectionState( ConnectionContainer *c )
+{
+ c->tqrepaint();
+ if ( c->isValid() )
+ connectionsTable->verticalHeader()->setLabel( c->row(),
+ *validConnection, TQString() );
+ else
+ connectionsTable->verticalHeader()->setLabel( c->row(),
+ *invalidConnection, TQString() );
+}
+
+
+void ConnectionDialog::okClicked()
+{
+ TQValueList<MetaDataBase::Connection> oldConnections =
+ MetaDataBase::connections( MainWindow::self->formWindow() );
+ TQPtrList<Command> newConnectionCmds;
+ TQPtrList<Command> oldConnectionCmds;
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() ) {
+ MetaDataBase::Connection conn;
+
+ // tqfind sender widget
+ conn.sender = MainWindow::self->formWindow()->child( c->senderItem()->currentText() );
+ if ( !conn.sender ) // if no sender widget, tqfind sender action
+ conn.sender = MainWindow::self->formWindow()->tqfindAction( c->senderItem()->currentText() );
+
+ // tqfind receiver widget
+ conn.receiver = MainWindow::self->formWindow()->child( c->receiverItem()->currentText() );
+ if ( !conn.receiver ) // if no receiver widget, tqfind receiver action
+ conn.receiver = MainWindow::self->formWindow()->tqfindAction( c->receiverItem()->currentText() );
+
+ conn.signal = c->signalItem()->currentText();
+ conn.slot = c->slotItem()->currentText();
+ AddConnectionCommand *cmd = new AddConnectionCommand( tr( "Add Signal/Slot "
+ "Connection" ),
+ MainWindow::self->formWindow(),
+ conn );
+ newConnectionCmds.append( cmd );
+ }
+
+
+ TQValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( MainWindow::self->formWindow() );
+ for ( TQValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ it != conns.end(); ++it ) {
+ RemoveConnectionCommand *cmd = new RemoveConnectionCommand( tr( "Remove Signal/Slot "
+ "Connection" ),
+ MainWindow::self->
+ formWindow(), *it );
+ oldConnectionCmds.append( cmd );
+ }
+
+ MacroCommand *cmd1 = new MacroCommand( tr( "Add Signal/Slot Connections" ),
+ MainWindow::self->formWindow(),
+ newConnectionCmds );
+ MacroCommand *cmd2 = new MacroCommand( tr( "Remove Signal/Slot Connections" ),
+ MainWindow::self->formWindow(),
+ oldConnectionCmds );
+ TQPtrList<Command> cmds;
+ cmds.append( cmd2 );
+ cmds.append( cmd1 );
+ MacroCommand *cmd = new MacroCommand( tr( "Edit Signal/Slot Connections" ),
+ MainWindow::self->formWindow(),
+ cmds );
+ MainWindow::self->formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+
+ accept();
+}
+
+
+void ConnectionDialog::cancelClicked()
+{
+ reject();
+}
+
+
+void ConnectionDialog::deleteClicked()
+{
+ int cr = connectionsTable->currentRow();
+ connections.remove( cr );
+ connectionsTable->removeRow( cr );
+ int i = 0;
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() )
+ c->setRow( i++ );
+}
+
+
+void ConnectionDialog::editSlots()
+{
+ EditFunctions dlg( this, MainWindow::self->formWindow(), TRUE );
+ dlg.exec();
+ int currentCol = connectionsTable->currentColumn();
+ connectionsTable->setCurrentCell( connectionsTable->currentRow(), 0 );
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() ) {
+ if ( c->receiverItem()->currentText() !=
+ TQString( MainWindow::self->formWindow()->mainContainer()->name() ) )
+ continue;
+ c->slotItem()->customSlotsChanged();
+ }
+ connectionsTable->setCurrentCell( connectionsTable->currentRow(), currentCol );
+}
+
+void ConnectionDialog::setDefault( TQT_BASE_OBJECT_NAME *sender, TQT_BASE_OBJECT_NAME *receiver )
+{
+ defaultSender = TQT_TQOBJECT(sender);
+ defaultReceiver = TQT_TQOBJECT(receiver);
+}
+
+void ConnectionDialog::updateEditSlotsButton()
+{
+ if ( connectionsTable->currentRow() < 0 ||
+ connectionsTable->currentRow() > (int)connections.count() - 1 )
+ return;
+ ConnectionContainer *c = connections.at( connectionsTable->currentRow() );
+ if ( !c || !c->receiverItem() )
+ return;
+ buttonEditSlots->setEnabled( c->receiverItem()->currentText() ==
+ TQString( MainWindow::self->formWindow()->
+ mainContainer()->name() ) );
+}
+
+void ConnectionDialog::updateConnectionContainers()
+{
+ TQPtrList<ConnectionContainer> newContainers;
+ for ( int i = 0; i < connectionsTable->numRows(); ++i ) {
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() ) {
+ if ( c->senderItem() == connectionsTable->item( i, 0 ) ) {
+ newContainers.append( c );
+ c->setRow( i );
+ updateConnectionState(c);
+ break;
+ }
+ }
+ }
+ connections = newContainers;
+ updateEditSlotsButton();
+}
+
+void ConnectionDialog::ensureConnectionVisible()
+{
+ connectionsTable->ensureCellVisible( connectionsTable->numRows() - 1, 0 );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/connectionitems.cpp b/tqtinterface/qt4/tools/designer/designer/connectionitems.cpp
new file mode 100644
index 0000000..b6ab06a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/connectionitems.cpp
@@ -0,0 +1,524 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "connectionitems.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "widgetfactory.h"
+#include "project.h"
+#include <tqpainter.h>
+#include <tqcombobox.h>
+#include <tqmetaobject.h>
+#include <tqcombobox.h>
+#include <tqlistbox.h>
+#include <tqaction.h>
+#include <tqdatabrowser.h>
+
+static const char* const ignore_Q_SLOTS[] = {
+ "destroyed()",
+ "setCaption(const TQString&)",
+ "setIcon(const TQPixmap&)",
+ "setIconText(const TQString&)",
+ "setMouseTracking(bool)",
+ "clearFocus()",
+ "setUpdatesEnabled(bool)",
+ "update()",
+ "update(int,int,int,int)",
+ "update(const TQRect&)",
+ "tqrepaint()",
+ "tqrepaint(bool)",
+ "tqrepaint(int,int,int,int,bool)",
+ "tqrepaint(const TQRect&,bool)",
+ "tqrepaint(const TQRegion&,bool)",
+ "show()",
+ "hide()",
+ "iconify()",
+ "showMinimized()",
+ "showMaximized()",
+ "showFullScreen()",
+ "showNormal()",
+ "polish()",
+ "constPolish()",
+ "raise()",
+ "lower()",
+ "stackUnder(TQWidget*)",
+ "move(int,int)",
+ "move(const TQPoint&)",
+ "resize(int,int)",
+ "resize(const TQSize&)",
+ "setGeometry(int,int,int,int)",
+ "setGeometry(const TQRect&)",
+ "focusProxyDestroyed()",
+ "showExtension(bool)",
+ "setUpLayout()",
+ "showTQt::DockMenu(const TQPoint&)",
+ "init()",
+ "destroy()",
+ "deleteLater()",
+ 0
+};
+
+ConnectionItem::ConnectionItem( TQTable *table, FormWindow *fw )
+ : TQComboTableItem( table, TQStringList(), FALSE ), formWindow( fw ), conn( 0 )
+{
+ setReplaceable( FALSE );
+}
+
+void ConnectionItem::senderChanged( TQObject * )
+{
+ emit changed();
+ TQWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::receiverChanged( TQObject * )
+{
+ emit changed();
+ TQWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::signalChanged( const TQString & )
+{
+ emit changed();
+ TQWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::slotChanged( const TQString & )
+{
+ emit changed();
+ TQWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::setSender( SenderItem *i )
+{
+ connect( i, TQT_SIGNAL( currentSenderChanged( TQObject * ) ),
+ this, TQT_SLOT( senderChanged( TQObject * ) ) );
+}
+
+void ConnectionItem::setReceiver( ReceiverItem *i )
+{
+ connect( i, TQT_SIGNAL( currentReceiverChanged( TQObject * ) ),
+ this, TQT_SLOT( receiverChanged( TQObject * ) ) );
+}
+
+void ConnectionItem::setSignal( SignalItem *i )
+{
+ connect( i, TQT_SIGNAL( currentSignalChanged( const TQString & ) ),
+ this, TQT_SLOT( signalChanged( const TQString & ) ) );
+}
+
+void ConnectionItem::setSlot( SlotItem *i )
+{
+ connect( i, TQT_SIGNAL( currentSlotChanged( const TQString & ) ),
+ this, TQT_SLOT( slotChanged( const TQString & ) ) );
+}
+
+void ConnectionItem::paint( TQPainter *p, const TQColorGroup &cg,
+ const TQRect &cr, bool selected )
+{
+ p->fillRect( 0, 0, cr.width(), cr.height(),
+ selected ? cg.brush( TQColorGroup::Highlight )
+ : cg.brush( TQColorGroup::Base ) );
+
+ int w = cr.width();
+ int h = cr.height();
+
+ int x = 0;
+
+ if ( currentText()[0] == '<' )
+ p->setPen( Qt::red );
+ else if ( selected )
+ p->setPen( cg.highlightedText() );
+ else
+ p->setPen( cg.text() );
+
+ TQFont f( p->font() );
+ TQFont oldf( p->font() );
+ if ( conn && conn->isModified() ) {
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+
+ p->drawText( x + 2, 0, w - x - 4, h, tqalignment(), currentText() );
+ p->setFont( oldf );
+}
+
+void ConnectionItem::setConnection( ConnectionContainer *c )
+{
+ conn = c;
+}
+
+// ------------------------------------------------------------------
+
+static void appendChildActions( TQAction *action, TQStringList &lst )
+{
+ TQObjectListIt it( action->childrenListObject() );
+ while ( it.current() ) {
+ TQObject *o = it.current();
+ ++it;
+ if ( !::tqqt_cast<TQAction*>(o) )
+ continue;
+ lst << o->name();
+ if ( !o->childrenListObject().isEmpty() && ::tqqt_cast<TQActionGroup*>(o) )
+ appendChildActions( (TQAction*)o, lst );
+ }
+}
+
+static TQStringList flatActions( const TQPtrList<TQAction> &l )
+{
+ TQStringList lst;
+
+ TQPtrListIterator<TQAction> it( l );
+ while ( it.current() ) {
+ TQAction *action = it.current();
+ lst << action->name();
+ if ( !action->childrenListObject().isEmpty() && ::tqqt_cast<TQActionGroup*>(action) )
+ appendChildActions( action, lst );
+ ++it;
+ }
+
+ return lst;
+}
+
+// ------------------------------------------------------------------
+
+SenderItem::SenderItem( TQTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ TQStringList lst;
+
+ TQPtrDictIterator<TQWidget> it( *formWindow->widgets() );
+ while ( it.current() ) {
+ if ( lst.tqfind( it.current()->name() ) != lst.end() ) {
+ ++it;
+ continue;
+ }
+ if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
+ !::tqqt_cast<TQLayoutWidget*>(it.current()) &&
+ !::tqqt_cast<Spacer*>(it.current()) &&
+ !::tqqt_cast<SizeHandle*>(it.current()) &&
+ qstrcmp( it.current()->name(), "central widget" ) != 0 ) {
+ lst << it.current()->name();
+ }
+ ++it;
+ }
+
+ lst += flatActions( formWindow->actionList() );
+
+ lst.prepend( "<No Sender>" );
+ lst.sort();
+ setStringList( lst );
+}
+
+TQWidget *SenderItem::createEditor() const
+{
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SLOT( senderChanged( const TQString & ) ) );
+ return cb;
+}
+
+void SenderItem::setSenderEx( TQObject *sender )
+{
+ setCurrentItem( sender->name() );
+ emit currentSenderChanged( sender );
+}
+
+void SenderItem::senderChanged( const TQString &sender )
+{
+ TQObject *o = formWindow->child( sender, "TQObject" );
+ if ( !o )
+ o = formWindow->tqfindAction( sender );
+ if ( !o )
+ return;
+ emit currentSenderChanged( o );
+}
+
+
+
+// ------------------------------------------------------------------
+
+ReceiverItem::ReceiverItem( TQTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ TQStringList lst;
+
+ TQPtrDictIterator<TQWidget> it( *formWindow->widgets() );
+ while ( it.current() ) {
+ if ( lst.tqfind( it.current()->name() ) != lst.end() ) {
+ ++it;
+ continue;
+ }
+ if ( !TQString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
+ !::tqqt_cast<TQLayoutWidget*>(it.current()) &&
+ !::tqqt_cast<Spacer*>(it.current()) &&
+ !::tqqt_cast<SizeHandle*>(it.current()) &&
+ qstrcmp( it.current()->name(), "central widget" ) != 0 ) {
+ lst << it.current()->name();
+ }
+ ++it;
+ }
+
+ lst += flatActions( formWindow->actionList() );
+
+ lst.prepend( "<No Receiver>" );
+ lst.sort();
+ setStringList( lst );
+}
+
+TQWidget *ReceiverItem::createEditor() const
+{
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SLOT( receiverChanged( const TQString & ) ) );
+ return cb;
+}
+
+void ReceiverItem::setReceiverEx( TQObject *receiver )
+{
+ setCurrentItem( receiver->name() );
+ emit currentReceiverChanged( receiver );
+}
+
+void ReceiverItem::receiverChanged( const TQString &receiver )
+{
+ TQObject *o = formWindow->child( receiver, "TQObject" );
+ if ( !o )
+ o = formWindow->tqfindAction( receiver );
+ if ( !o )
+ return;
+ emit currentReceiverChanged( o );
+}
+
+
+
+// ------------------------------------------------------------------
+
+SignalItem::SignalItem( TQTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ TQStringList lst;
+ lst << "<No Signal>";
+ lst.sort();
+ setStringList( lst );
+}
+
+void SignalItem::senderChanged( TQObject *sender )
+{
+ TQStrList sigs = sender->tqmetaObject()->signalNames( TRUE );
+ sigs.remove( "destroyed()" );
+ sigs.remove( "destroyed(TQObject*)" );
+ sigs.remove( "accessibilityChanged(int)" );
+ sigs.remove( "accessibilityChanged(int,int)" );
+
+ TQStringList lst = TQStringList::fromStrList( sigs );
+
+ if ( ::tqqt_cast<CustomWidget*>(sender) ) {
+ MetaDataBase::CustomWidget *w = ( (CustomWidget*)sender )->customWidget();
+ for ( TQValueList<TQCString>::Iterator it = w->lstSignals.begin();
+ it != w->lstSignals.end(); ++it )
+ lst << MetaDataBase::normalizeFunction( *it );
+ }
+
+ if ( TQT_BASE_OBJECT(sender) == TQT_BASE_OBJECT(formWindow->mainContainer()) ) {
+ TQStringList extra = MetaDataBase::signalList( formWindow );
+ if ( !extra.isEmpty() )
+ lst += extra;
+ }
+
+ lst.prepend( "<No Signal>" );
+
+ lst.sort();
+ setStringList( lst );
+
+ ConnectionItem::senderChanged( sender );
+}
+
+TQWidget *SignalItem::createEditor() const
+{
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SIGNAL( currentSignalChanged( const TQString & ) ) );
+ return cb;
+}
+
+// ------------------------------------------------------------------
+
+SlotItem::SlotItem( TQTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ TQStringList lst;
+ lst << "<No Slot>";
+ lst.sort();
+ setStringList( lst );
+
+ lastReceiver = 0;
+ lastSignal = "<No Signal>";
+}
+
+void SlotItem::receiverChanged( TQObject *receiver )
+{
+ lastReceiver = receiver;
+ updateSlotList();
+ ConnectionItem::receiverChanged( receiver );
+}
+
+void SlotItem::signalChanged( const TQString &signal )
+{
+ lastSignal = signal;
+ updateSlotList();
+ ConnectionItem::signalChanged( signal );
+}
+
+bool SlotItem::ignoreSlot( const char* slot ) const
+{
+#ifndef TQT_NO_SQL
+ if ( qstrcmp( slot, "update()" ) == 0 &&
+ ::tqqt_cast<TQDataBrowser*>(lastReceiver) )
+ return FALSE;
+#endif
+
+ for ( int i = 0; ignore_Q_SLOTS[i]; i++ ) {
+ if ( qstrcmp( slot, ignore_Q_SLOTS[i] ) == 0 )
+ return TRUE;
+ }
+
+ if ( !formWindow->isMainContainer( (TQWidget*)lastReceiver ) ) {
+ if ( qstrcmp( slot, "close()" ) == 0 )
+ return TRUE;
+ }
+
+ if ( qstrcmp( slot, "setFocus()" ) == 0 )
+ if ( lastReceiver->isWidgetType() &&
+ ( (TQWidget*)lastReceiver )->focusPolicy() == Qt::NoFocus )
+ return TRUE;
+
+ return FALSE;
+}
+
+void SlotItem::updateSlotList()
+{
+ TQStringList lst;
+ if ( !lastReceiver || lastSignal == "<No Signal>" ) {
+ lst << "<No Slot>";
+ lst.sort();
+ setStringList( lst );
+ return;
+ }
+
+ TQString signal = MetaDataBase::normalizeFunction( lastSignal );
+ int n = lastReceiver->tqmetaObject()->numSlots( TRUE );
+ TQStringList slts;
+
+ for( int i = 0; i < n; ++i ) {
+ // accept only public Tslots. For the form window, also accept protected Q_SLOTS
+ const TQMetaData* md = lastReceiver->tqmetaObject()->slot( i, TRUE );
+ if ( ( (lastReceiver->tqmetaObject()->slot( i, TRUE )->access() == TQMetaData::Public) ||
+ (formWindow->isMainContainer( (TQWidget*)lastReceiver ) &&
+ lastReceiver->tqmetaObject()->slot(i, TRUE)->access() ==
+ TQMetaData::Protected) ) &&
+ !ignoreSlot( md->name() ) &&
+ checkConnectArgs( signal.latin1(), lastReceiver, md->name() ) )
+ if ( lst.tqfind( md->name() ) == lst.end() )
+ lst << MetaDataBase::normalizeFunction( md->name() );
+ }
+
+ LanguageInterface *iface =
+ MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( !iface || iface->supports( LanguageInterface::ConnectionsToCustomSlots ) ) {
+ if ( formWindow->isMainContainer( (TQWidget*)lastReceiver ) ) {
+ TQValueList<MetaDataBase::Function> moreSlots = MetaDataBase::slotList( formWindow );
+ if ( !moreSlots.isEmpty() ) {
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = moreSlots.begin();
+ it != moreSlots.end(); ++it ) {
+ TQCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ s = MetaDataBase::normalizeFunction( s );
+ if ( checkConnectArgs( signal.latin1(), lastReceiver, s ) ) {
+ if ( lst.tqfind( (*it).function ) == lst.end() )
+ lst << s;
+ }
+ }
+ }
+ }
+ }
+
+ if ( ::tqqt_cast<CustomWidget*>(lastReceiver) ) {
+ MetaDataBase::CustomWidget *w = ( (CustomWidget*)lastReceiver )->customWidget();
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin();
+ it != w->lstSlots.end(); ++it ) {
+ TQCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ s = MetaDataBase::normalizeFunction( s );
+ if ( checkConnectArgs( signal.latin1(), lastReceiver, s ) ) {
+ if ( lst.tqfind( (*it).function ) == lst.end() )
+ lst << s;
+ }
+ }
+ }
+
+ lst.prepend( "<No Slot>" );
+ lst.sort();
+ setStringList( lst );
+}
+
+TQWidget *SlotItem::createEditor() const
+{
+ TQComboBox *cb = (TQComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SIGNAL( currentSlotChanged( const TQString & ) ) );
+ return cb;
+}
+
+void SlotItem::customSlotsChanged()
+{
+ TQString currSlot = currentText();
+ updateSlotList();
+ setCurrentItem( "<No Slot>" );
+ setCurrentItem( currSlot );
+ emit currentSlotChanged( currentText() );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/connectionitems.h b/tqtinterface/qt4/tools/designer/designer/connectionitems.h
new file mode 100644
index 0000000..7cbb883
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/connectionitems.h
@@ -0,0 +1,233 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CONNECTIONITEMS_H
+#define CONNECTIONITEMS_H
+
+class FormWindow;
+
+#include <tqtable.h>
+
+class SenderItem;
+class ReceiverItem;
+class SignalItem;
+class SlotItem;
+class ConnectionContainer;
+
+
+class ConnectionItem : public TQObject,
+ public TQComboTableItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ConnectionItem( TQTable *table, FormWindow *fw );
+
+ void paint( TQPainter *p, const TQColorGroup &cg,
+ const TQRect &cr, bool selected );
+
+ void setSender( SenderItem *i );
+ void setReceiver( ReceiverItem *i );
+ void setSignal( SignalItem *i );
+ void setSlot( SlotItem *i );
+ void setConnection( ConnectionContainer *c );
+
+public Q_SLOTS:
+ virtual void senderChanged( TQObject *sender );
+ virtual void receiverChanged( TQObject *receiver );
+ virtual void signalChanged( const TQString &sig );
+ virtual void slotChanged( const TQString &slot );
+
+Q_SIGNALS:
+ void changed();
+
+protected:
+ FormWindow *formWindow;
+
+private:
+ ConnectionContainer *conn;
+
+};
+
+// ------------------------------------------------------------------
+
+class SenderItem : public ConnectionItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ SenderItem( TQTable *table, FormWindow *fw );
+ TQWidget *createEditor() const;
+ void setSenderEx( TQObject *sender );
+
+Q_SIGNALS:
+ void currentSenderChanged( TQObject *sender );
+
+private Q_SLOTS:
+ void senderChanged( const TQString &sender );
+
+};
+
+// ------------------------------------------------------------------
+
+class ReceiverItem : public ConnectionItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ReceiverItem( TQTable *table, FormWindow *fw );
+ TQWidget *createEditor() const;
+ void setReceiverEx( TQObject *receiver );
+
+Q_SIGNALS:
+ void currentReceiverChanged( TQObject *receiver );
+
+private Q_SLOTS:
+ void receiverChanged( const TQString &receiver );
+
+};
+
+// ------------------------------------------------------------------
+
+class SignalItem : public ConnectionItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ SignalItem( TQTable *table, FormWindow *fw );
+
+ void senderChanged( TQObject *sender );
+ TQWidget *createEditor() const;
+
+Q_SIGNALS:
+ void currentSignalChanged( const TQString & );
+
+};
+
+// ------------------------------------------------------------------
+
+class SlotItem : public ConnectionItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ SlotItem( TQTable *table, FormWindow *fw );
+
+ void receiverChanged( TQObject *receiver );
+ void signalChanged( const TQString &signal );
+ TQWidget *createEditor() const;
+
+ void customSlotsChanged();
+
+Q_SIGNALS:
+ void currentSlotChanged( const TQString & );
+
+private:
+ void updateSlotList();
+ bool ignoreSlot( const char* slot ) const;
+
+private:
+ TQObject *lastReceiver;
+ TQString lastSignal;
+
+};
+
+// ------------------------------------------------------------------
+
+class ConnectionContainer : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ConnectionContainer( TQObject *tqparent, SenderItem *i1, SignalItem *i2,
+ ReceiverItem *i3, SlotItem *i4, int r )
+ : TQObject( tqparent ), mod( FALSE ), se( i1 ), si( i2 ),
+ re( i3 ), sl( i4 ), rw ( r ) {
+ i1->setConnection( this );
+ i2->setConnection( this );
+ i3->setConnection( this );
+ i4->setConnection( this );
+ connect( i1, TQT_SIGNAL( changed() ), this, TQT_SLOT( somethingChanged() ) );
+ connect( i2, TQT_SIGNAL( changed() ), this, TQT_SLOT( somethingChanged() ) );
+ connect( i3, TQT_SIGNAL( changed() ), this, TQT_SLOT( somethingChanged() ) );
+ connect( i4, TQT_SIGNAL( changed() ), this, TQT_SLOT( somethingChanged() ) );
+ }
+
+ bool isModified() const { return mod; }
+ void setModified( bool b ) { mod = b; tqrepaint(); }
+ bool isValid() const {
+ return se->currentText()[0] != '<' &&
+ si->currentText()[0] != '<' &&
+ re->currentText()[0] != '<' &&
+ sl->currentText()[0] != '<';
+ }
+
+ void tqrepaint() {
+ se->table()->updateCell( se->row(), se->col() );
+ si->table()->updateCell( si->row(), si->col() );
+ re->table()->updateCell( re->row(), re->col() );
+ sl->table()->updateCell( sl->row(), sl->col() );
+ }
+
+ int row() const { return rw; }
+ void setRow( int r ) { rw = r; }
+
+ SenderItem *senderItem() const { return se; }
+ SignalItem *signalItem() const { return si; }
+ ReceiverItem *receiverItem() const { return re; }
+ SlotItem *slotItem() const { return sl; }
+
+public Q_SLOTS:
+ void somethingChanged() { mod = TRUE; emit changed( this ); }
+
+Q_SIGNALS:
+ void changed( ConnectionContainer *c );
+
+private:
+ bool mod;
+ SenderItem *se;
+ SignalItem *si;
+ ReceiverItem *re;
+ SlotItem *sl;
+ int rw;
+
+};
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/connectiontable.cpp b/tqtinterface/qt4/tools/designer/designer/connectiontable.cpp
new file mode 100644
index 0000000..529ff67
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/connectiontable.cpp
@@ -0,0 +1,61 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "connectiontable.h"
+
+ConnectionTable::ConnectionTable( TQWidget *tqparent, const char *name )
+ : TQTable( 0, 4, tqparent, name )
+{
+ setSorting( TRUE );
+ setShowGrid( FALSE );
+ setFocusStyle( FollowStyle );
+ setSelectionMode( SingleRow );
+ horizontalHeader()->setLabel( 0, tr( "Sender" ) );
+ horizontalHeader()->setLabel( 1, tr( "Signal" ) );
+ horizontalHeader()->setLabel( 2, tr( "Receiver" ) );
+ horizontalHeader()->setLabel( 3, tr( "Slot" ) );
+ setColumnStretchable( 0, TRUE );
+ setColumnStretchable( 1, TRUE );
+ setColumnStretchable( 2, TRUE );
+ setColumnStretchable( 3, TRUE );
+}
+
+void ConnectionTable::sortColumn( int col, bool ascending, bool )
+{
+ horizontalHeader()->setSortIndicator( col, ascending );
+ if ( isEditing() )
+ endEdit( currEditRow(), currEditCol(), FALSE, FALSE );
+ TQTable::sortColumn( col, ascending, TRUE );
+ setCurrentCell( 0, 0 );
+ emit resorted();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/connectiontable.h b/tqtinterface/qt4/tools/designer/designer/connectiontable.h
new file mode 100644
index 0000000..50f2731
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/connectiontable.h
@@ -0,0 +1,54 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CONNECTIONTABLE_H
+#define CONNECTIONTABLE_H
+
+#include <tqtable.h>
+
+class ConnectionTable : public TQTable
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ConnectionTable( TQWidget *tqparent, const char *name );
+
+ void sortColumn( int col, bool ascending, bool wholeRows );
+
+Q_SIGNALS:
+ void resorted();
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/createtemplate.ui b/tqtinterface/qt4/tools/designer/designer/createtemplate.ui
new file mode 100644
index 0000000..322fabc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/createtemplate.ui
@@ -0,0 +1,236 @@
+<!DOCTYPE UI><UI>
+<class>CreateTemplate</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget>
+ <class>TQDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>CreateTemplate</cstring>
+ </property>
+ <property stdset="1">
+ <name>tqgeometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>347</width>
+ <height>248</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Create Template</string>
+ </property>
+ <property stdset="1">
+ <name>sizeGripEnabled</name>
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>TQLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Template &amp;Name:</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>editName</cstring>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>TQLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>editName</cstring>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Name of the new template</string>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Enter the name of the new template</string>
+ </property>
+ </widget>
+ <widget row="1" column="1" rowspan="2" colspan="1" >
+ <class>TQListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>listClass</cstring>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Class of the new template</string>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Enter the name of the class which should be used as the template's base class</string>
+ </property>
+ </widget>
+ <widget row="3" column="0" rowspan="1" colspan="2" >
+ <class>TQLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer1</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>tqsizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>TQPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buttonCreate</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>C&amp;reate</string>
+ </property>
+ <property stdset="1">
+ <name>default</name>
+ <bool>true</bool>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Creates the new template</string>
+ </property>
+ </widget>
+ <widget>
+ <class>TQPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PushButton1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Cancel</string>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Closes the Dialog</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget row="1" column="0" >
+ <class>TQLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Baseclass for Template:</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>listClass</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="0" >
+ <property>
+ <name>name</name>
+ <cstring>Spacer2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>tqsizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonCreate</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateTemplate</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateTemplate</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/customwidgeteditor.ui b/tqtinterface/qt4/tools/designer/designer/customwidgeteditor.ui
new file mode 100644
index 0000000..f5d5a01
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/customwidgeteditor.ui
@@ -0,0 +1,1385 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>CustomWidgetEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>CustomWidgetEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>712</width>
+ <height>386</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Custom Widgets</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Custom Widgets&lt;/b&gt;&lt;p&gt;Add or delete custom widgets from &lt;i&gt;Qt Designer&lt;/i&gt;'s database, and edit the properties of existing widgets.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>boxWidgets</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of all custom widgets known to Qt Designer.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNewWidget</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Widget</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new custom widget.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Create an empty custom widget and add it to the list.&lt;/b&gt;&lt;p&gt;New custom widgets have a default name and header file, which must both be changed to appropriate values.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDeleteWidget</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Widget</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete custom widget</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected custom widget.&lt;/b&gt;&lt;p&gt;You can only delete widgets that are not used in any open form.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Closes the Dialog.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>buttonLoad</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Load Descriptions...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Loads widget description file</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Load Descriptions&lt;/b&gt;&lt;p&gt;Loads a file which tqcontains descriptions of custom widgets, so that these custom widgets can be used in the Qt Designer.&lt;/p&gt;
+&lt;p&gt;Since it is a lot of work to type in all the information for custom widgets, you should consider using the createcw tool which is in $QTDIR/tools/designer/tools/createcw. Using createcw you can create custom widget description files for your custom widgets without the need to type in all the information manually. For more information about the README file in the createcw directory&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>buttonSave</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Save Descriptions...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Saves widget description file</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Save Descriptions&lt;/b&gt;&lt;p&gt;Saves all the descriptions of the shown custom widgets to a file which can then be used to import the custom widgets elsewhere.</string>
+ </property>
+ </widget>
+ <widget class="TQTabWidget" row="0" column="2" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>TabWidget1</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Change the properties of the selected custom widget.</string>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget2</cstring>
+ </property>
+ <attribute name="title">
+ <string>De&amp;finition</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>previewPixmap</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonChoosePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file.&lt;/b&gt;&lt;p&gt;The pixmap will be used to represent the widget in forms.&lt;/b&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>editHeader</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter filename</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the header file's name for the selected custom widget.&lt;/b&gt;&lt;p&gt;The header file will be included by forms using the widget.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonChooseHeader</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose headerfile</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Look for the header file using a filedialog.</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Global</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Local</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>localGlobalCombo</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change how the include file will be included.&lt;/b&gt;&lt;p&gt;Global include files will be included using &amp;lt;&amp;gt;-brackets, while local files will included using quotation marks.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>editClass</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change classname</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter the classname for the selected custom widget.&lt;/b&gt;&lt;p&gt;A class of that name must be defined in the header file.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label11</cstring>
+ </property>
+ <property name="text">
+ <string>Heade&amp;rfile:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editHeader</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label10</cstring>
+ </property>
+ <property name="text">
+ <string>Cl&amp;ass:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editClass</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>Pixmap:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>Label7</cstring>
+ </property>
+ <property name="text">
+ <string>Si&amp;ze Hint:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinWidth</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Size P&amp;olicy</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>sizeHor</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="4" column="2">
+ <item>
+ <property name="text">
+ <string>Fixed</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Preferred</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>MinimumExpanding</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Expanding</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>sizeVer</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Vertical Sizepolicy</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the Vertical size policy</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="3" column="1">
+ <property name="name">
+ <cstring>spinWidth</cstring>
+ </property>
+ <property name="maxValue">
+ <number>32767</number>
+ </property>
+ <property name="minValue">
+ <number>-1</number>
+ </property>
+ <property name="value">
+ <number>-1</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Size hint width</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Set the size hint for the selected widget.&lt;/b&gt;&lt;p&gt;The size hint provides the recommended size for the widget. Enter a sizehint of -1/-1 if no size is recommended.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="3" column="2">
+ <property name="name">
+ <cstring>spinHeight</cstring>
+ </property>
+ <property name="maxValue">
+ <number>32767</number>
+ </property>
+ <property name="minValue">
+ <number>-1</number>
+ </property>
+ <property name="value">
+ <number>-1</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Size hint height</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Set the size hint for the selected widget.&lt;/b&gt;&lt;p&gt;The size hint provides the recommended size for the widget. Enter a sizehint of -1/-1 if no size is recommended.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="4" column="1">
+ <item>
+ <property name="text">
+ <string>Fixed</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Preferred</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>MinimumExpanding</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Expanding</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>sizeHor</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Horizontal Sizepolicy</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the horizontal size policy for the widget</string>
+ </property>
+ </widget>
+ <spacer row="6" column="2">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="5" column="1">
+ <property name="name">
+ <cstring>checkContainer</cstring>
+ </property>
+ <property name="text">
+ <string>Con&amp;tainer Widget</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Container Widget</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;p&gt;&lt;b&gt;Container Widget&lt;/b&gt;&lt;/p&gt;
+&lt;p&gt;If this custom widget is able to contain other widgets (tqchildren), check this checkbox.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget3</cstring>
+ </property>
+ <attribute name="title">
+ <string>Si&amp;gnals</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListBox">
+ <property name="name">
+ <cstring>listSignals</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of all the Q_SIGNALS that the selected widget can emit.</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout40</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonAddSignal</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ew Signal</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new signal</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new signal for the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonRemoveSignal</cstring>
+ </property>
+ <property name="text">
+ <string>Dele&amp;te Signal</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete signal</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the signal.&lt;/b&gt;&lt;p&gt;All connections using this signal will also be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout38</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;ignal:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editSignal</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>editSignal</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change signal name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget4</cstring>
+ </property>
+ <attribute name="title">
+ <string>S&amp;lots</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Slot</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listSlots</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of all the custom widget's slots.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Sl&amp;ot:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editSlot</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editSlot</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change slot name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="2">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Access:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboAccess</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="2" column="3">
+ <item>
+ <property name="text">
+ <string>public</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>protected</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboAccess</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change slot access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the slot's access policy.&lt;/b&gt;&lt;p&gt;You can only connect to the widget's public slots.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>Layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonAddSlot</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ew Slot</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new slot</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new slot to the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonRemoveSlot</cstring>
+ </property>
+ <property name="text">
+ <string>Dele&amp;te Slot</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete slot</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the slot.&lt;/b&gt;&lt;p&gt;All connections using this slot will also be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget5</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Properties</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>Layout7_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonAddProperty</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ew Property</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new property</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new property to the current custom widget.&lt;/b&gt;&lt;p&gt;The properties must be implemented in the class using Qt's property system.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonRemoveProperty</cstring>
+ </property>
+ <property name="text">
+ <string>Dele&amp;te Property</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete property</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Deletes the selected property.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQComboBox" row="2" column="3">
+ <item>
+ <property name="text">
+ <string>String</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>CString</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>StringList</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Bool</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Int</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>UInt</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Font</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Color</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Rect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Point</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Size</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Pixmap</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Cursor</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>SizePolicy</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboType</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select property type</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select the type of the property.&lt;/b&gt;&lt;p&gt;The propertiy must be implemented in the class using Qt's property system.&lt;/p&gt;&lt;p&gt;You can use integer types to support enumeration properties in the property editor.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Property</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listProperties</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;The list of the current widget's properties.&lt;/b&gt;&lt;p&gt;The properties of the custom widget can be changed in the property editor.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editProperty</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change property name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter a name for the property.&lt;/b&gt;&lt;p&gt;The properties must be implemented in the class using Qt's property system.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>P&amp;roperty Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editProperty</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="2">
+ <property name="name">
+ <cstring>TextLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>T&amp;ype:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboType</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>boxWidgets</sender>
+ <signal>selectionChanged(TQListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentWidgetChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>boxWidgets</sender>
+ <signal>currentChanged(TQListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentWidgetChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewWidget</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addWidgetClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteWidget</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>deleteWidgetClicked()</slot>
+ </connection>
+ <connection>
+ <sender>editClass</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>classNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>editHeader</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>headerFileChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>spinWidth</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>widthChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>spinHeight</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>heightChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>pixmapChoosen()</slot>
+ </connection>
+ <connection>
+ <sender>localGlobalCombo</sender>
+ <signal>highlighted(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>includePolicyChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonChooseHeader</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>chooseHeader()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>closeClicked()</slot>
+ </connection>
+ <connection>
+ <sender>listSignals</sender>
+ <signal>currentChanged(TQListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSignalChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listSignals</sender>
+ <signal>selectionChanged(TQListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSignalChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveSignal</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>removeSignal()</slot>
+ </connection>
+ <connection>
+ <sender>editSignal</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>signalNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listSlots</sender>
+ <signal>currentChanged(TQListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSlotChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listSlots</sender>
+ <signal>selectionChanged(TQListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSlotChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveSlot</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>removeSlot()</slot>
+ </connection>
+ <connection>
+ <sender>editSlot</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>slotNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>comboAccess</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>slotAccessChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listProperties</sender>
+ <signal>currentChanged(TQListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentPropertyChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listProperties</sender>
+ <signal>selectionChanged(TQListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentPropertyChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveProperty</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>removeProperty()</slot>
+ </connection>
+ <connection>
+ <sender>editProperty</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>propertyNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>comboType</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>propertyTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonLoad</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>loadDescription()</slot>
+ </connection>
+ <connection>
+ <sender>buttonSave</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>saveDescription()</slot>
+ </connection>
+ <connection>
+ <sender>sizeHor</sender>
+ <signal>activated(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>horDataChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>sizeVer</sender>
+ <signal>activated(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>verDataChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddProperty</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addProperty()</slot>
+ </connection>
+ <connection>
+ <sender>checkContainer</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>widgetIsContainer(bool)</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddSignal</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addSignal()</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddSlot</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addSlot()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">addProperty()</slot>
+ <slot access="public" language="C++" returnType="void">addSignal()</slot>
+ <slot access="protected" language="C++" returnType="void">addWidgetClicked()</slot>
+ <slot access="protected" language="C++" returnType="void">chooseHeader()</slot>
+ <slot access="protected" language="C++" returnType="void">classNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">closeClicked()</slot>
+ <slot access="protected" language="C++" returnType="void">currentPropertyChanged( TQListViewItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">currentSignalChanged( TQListBoxItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">currentSlotChanged( TQListViewItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">currentWidgetChanged( TQListBoxItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">deleteWidgetClicked()</slot>
+ <slot access="protected" language="C++" returnType="void">headerFileChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">heightChanged( int )</slot>
+ <slot access="protected" language="C++" returnType="void">horDataChanged(int)</slot>
+ <slot access="protected" language="C++" returnType="void">includePolicyChanged( int )</slot>
+ <slot access="public" language="C++" returnType="void">loadDescription()</slot>
+ <slot access="public" language="C++" returnType="void">addSlot()</slot>
+ <slot access="protected" language="C++" returnType="void">pixmapChoosen()</slot>
+ <slot access="protected" language="C++" returnType="void">propertyNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">propertyTypeChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">removeProperty()</slot>
+ <slot access="protected" language="C++" returnType="void">removeSignal()</slot>
+ <slot access="protected" language="C++" returnType="void">removeSlot()</slot>
+ <slot access="protected" language="C++" returnType="void">saveDescription()</slot>
+ <slot access="protected" language="C++" returnType="void">signalNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">slotAccessChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">slotNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">verDataChanged(int)</slot>
+ <slot access="protected" language="C++" returnType="void">widgetIsContainer(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">widthChanged( int )</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>boxWidgets</tabstop>
+ <tabstop>buttonNewWidget</tabstop>
+ <tabstop>buttonDeleteWidget</tabstop>
+ <tabstop>buttonLoad</tabstop>
+ <tabstop>buttonSave</tabstop>
+ <tabstop>TabWidget1</tabstop>
+ <tabstop>editClass</tabstop>
+ <tabstop>editHeader</tabstop>
+ <tabstop>buttonChooseHeader</tabstop>
+ <tabstop>localGlobalCombo</tabstop>
+ <tabstop>buttonChoosePixmap</tabstop>
+ <tabstop>spinWidth</tabstop>
+ <tabstop>spinHeight</tabstop>
+ <tabstop>sizeHor</tabstop>
+ <tabstop>sizeVer</tabstop>
+ <tabstop>checkContainer</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>listSignals</tabstop>
+ <tabstop>buttonAddSignal</tabstop>
+ <tabstop>buttonRemoveSignal</tabstop>
+ <tabstop>editSignal</tabstop>
+ <tabstop>listSlots</tabstop>
+ <tabstop>buttonAddSlot</tabstop>
+ <tabstop>buttonRemoveSlot</tabstop>
+ <tabstop>editSlot</tabstop>
+ <tabstop>comboAccess</tabstop>
+ <tabstop>listProperties</tabstop>
+ <tabstop>buttonAddProperty</tabstop>
+ <tabstop>buttonRemoveProperty</tabstop>
+ <tabstop>editProperty</tabstop>
+ <tabstop>comboType</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.cpp
new file mode 100644
index 0000000..91531c3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.cpp
@@ -0,0 +1,845 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "customwidgeteditorimpl.h"
+#include "defs.h"
+#include "pixmapchooser.h"
+#include "mainwindow.h"
+#include "asciivalidator.h"
+#include "resource.h"
+#include "widgetfactory.h"
+#include "widgetdatabase.h"
+
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqspinbox.h>
+#include <tqlabel.h>
+#include <tqmessagebox.h>
+#include <tqfiledialog.h>
+#include <tqmessagebox.h>
+#include <tqtimer.h>
+#include <tqapplication.h>
+#include <tqlistview.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqdom.h>
+#include <tqtextcodec.h>
+#include <tqcheckbox.h>
+
+CustomWidgetEditor::CustomWidgetEditor( TQWidget *tqparent, MainWindow *mw )
+ : CustomWidgetEditorBase( tqparent, 0, TRUE ), mainWindow( mw )
+{
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ checkTimer = new TQTimer( this );
+ connect( checkTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( checkWidgetName() ) );
+
+ editClass->setEnabled( FALSE );
+ editHeader->setEnabled( FALSE );
+ buttonChooseHeader->setEnabled( FALSE );
+ buttonChoosePixmap->setEnabled( FALSE );
+ spinWidth->setEnabled( FALSE );
+ spinHeight->setEnabled( FALSE );
+ sizeHor->setEnabled( FALSE );
+ sizeVer->setEnabled( FALSE );
+ checkContainer->setEnabled( FALSE );
+ localGlobalCombo->setEnabled( FALSE );
+ editClass->setValidator( new AsciiValidator( TQString(":"), TQT_TQOBJECT(editClass) ) );
+ editSignal->setValidator( new AsciiValidator( TRUE, TQT_TQOBJECT(editSignal) ) );
+ editSlot->setValidator( new AsciiValidator( TRUE, TQT_TQOBJECT(editSignal) ) );
+ editProperty->setValidator( new AsciiValidator( TQT_TQOBJECT(editSignal) ) );
+ editSignal->setEnabled( FALSE );
+ buttonRemoveSignal->setEnabled( FALSE );
+
+ setupDefinition();
+ setupSignals();
+ setupSlots();
+ setupProperties();
+}
+
+void CustomWidgetEditor::setupDefinition()
+{
+ TQPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ TQListBoxItem *i;
+ if ( w->pixmap )
+ i = new TQListBoxPixmap( boxWidgets, *w->pixmap, w->className );
+ else
+ i = new TQListBoxText( boxWidgets, w->className );
+ customWidgets.insert( i, w );
+ }
+
+ if ( boxWidgets->firstItem() ) {
+ boxWidgets->setCurrentItem( boxWidgets->firstItem() );
+ boxWidgets->setSelected( boxWidgets->firstItem(), TRUE );
+ }
+ oldItem = 0;
+}
+
+void CustomWidgetEditor::setupSignals()
+{
+ editSignal->setEnabled( FALSE );
+ buttonRemoveSignal->setEnabled( FALSE );
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w )
+ return;
+ listSignals->clear();
+ for ( TQValueList<TQCString>::Iterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ listSignals->insertItem( TQString( *it ) );
+ if ( listSignals->firstItem() ) {
+ listSignals->setCurrentItem( listSignals->firstItem() );
+ listSignals->setSelected( listSignals->firstItem(), TRUE );
+ }
+}
+
+void CustomWidgetEditor::setupSlots()
+{
+ editSlot->setEnabled( FALSE );
+ comboAccess->setEnabled( FALSE );
+ buttonRemoveSlot->setEnabled( FALSE );
+
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w )
+ return;
+ listSlots->clear();
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it )
+ (void)new TQListViewItem( listSlots, (*it).function, (*it).access );
+
+ if ( listSlots->firstChild() ) {
+ listSlots->setCurrentItem( listSlots->firstChild() );
+ listSlots->setSelected( listSlots->firstChild(), TRUE );
+ }
+}
+
+void CustomWidgetEditor::setupProperties()
+{
+ editProperty->setEnabled( FALSE );
+ comboType->setEnabled( FALSE );
+ buttonRemoveProperty->setEnabled( FALSE );
+
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w )
+ return;
+ listProperties->clear();
+ for ( TQValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.begin(); it != w->lstProperties.end(); ++it )
+ (void)new TQListViewItem( listProperties, (*it).property, (*it).type );
+
+ if ( listProperties->firstChild() ) {
+ listProperties->setCurrentItem( listProperties->firstChild() );
+ listProperties->setSelected( listProperties->firstChild(), TRUE );
+ }
+}
+
+void CustomWidgetEditor::currentWidgetChanged( TQListBoxItem *i )
+{
+ checkTimer->stop();
+ checkWidgetName();
+
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w ) {
+ buttonChooseHeader->setEnabled( FALSE );
+ editClass->setEnabled( FALSE );
+ editHeader->setEnabled( FALSE );
+ buttonChoosePixmap->setEnabled( FALSE );
+ spinWidth->setEnabled( FALSE );
+ spinHeight->setEnabled( FALSE );
+ localGlobalCombo->setEnabled( FALSE );
+ sizeHor->setEnabled( FALSE );
+ sizeVer->setEnabled( FALSE );
+ checkContainer->setEnabled( FALSE );
+ return;
+ }
+
+ buttonChooseHeader->setEnabled( TRUE );
+ editClass->setEnabled( TRUE );
+ editHeader->setEnabled( TRUE );
+ buttonChoosePixmap->setEnabled( TRUE );
+ spinWidth->setEnabled( TRUE );
+ spinHeight->setEnabled( TRUE );
+ localGlobalCombo->setEnabled( TRUE );
+ sizeHor->setEnabled( TRUE );
+ sizeVer->setEnabled( TRUE );
+ checkContainer->setEnabled( TRUE );
+
+ editClass->blockSignals( TRUE );
+ editClass->setText( w->className );
+ editClass->blockSignals( FALSE );
+ editHeader->setText( w->includeFile );
+ localGlobalCombo->setCurrentItem( (int)w->includePolicy );
+ if ( w->pixmap )
+ previewPixmap->setPixmap( *w->pixmap );
+ else
+ previewPixmap->setText( "" );
+ spinWidth->setValue( w->tqsizeHint.width() );
+ spinHeight->setValue( w->tqsizeHint.height() );
+ sizeHor->setCurrentItem( size_type_to_int( w->sizePolicy.horData() ) );
+ sizeVer->setCurrentItem( size_type_to_int( w->sizePolicy.verData() ) );
+ checkContainer->setChecked( w->isContainer );
+
+ setupSignals();
+ setupSlots();
+ setupProperties();
+}
+
+void CustomWidgetEditor::addWidgetClicked()
+{
+ oldItem = 0;
+ checkTimer->stop();
+ checkWidgetName();
+
+ MetaDataBase::CustomWidget *w = new MetaDataBase::CustomWidget;
+ TQString s = w->className;
+ if ( !MetaDataBase::addCustomWidget( w ) ) {
+ TQMessageBox::information( this, tr( "Adding a Custom Widget" ),
+ tr( "Custom widget names must be unique.\n"
+ "A custom widget called '%1' already exists, so it is not possible "
+ "to add another widget with this name." ).arg( s ) );
+ return;
+ }
+
+ TQListBoxPixmap *i = new TQListBoxPixmap( boxWidgets, *w->pixmap, w->className );
+ customWidgets.insert( i, w );
+
+ boxWidgets->setCurrentItem( i );
+ boxWidgets->setSelected( i, TRUE );
+}
+
+void CustomWidgetEditor::classNameChanged( const TQString &s )
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ WidgetDatabase::customWidgetClassNameChanged( w->className, s );
+
+ checkTimer->stop();
+ boxWidgets->blockSignals( TRUE );
+ oldName = w->className;
+ w->className = s;
+ TQListBoxItem *old = i;
+ if ( w->pixmap )
+ boxWidgets->changeItem( *w->pixmap, s, boxWidgets->currentItem() );
+ else
+ boxWidgets->changeItem( s, boxWidgets->currentItem() );
+ i = boxWidgets->item( boxWidgets->currentItem() );
+ oldItem = i;
+ customWidgets.insert( i, w );
+ customWidgets.remove( old );
+ boxWidgets->blockSignals( FALSE );
+ checkTimer->start( 1000, TRUE );
+}
+
+void CustomWidgetEditor::deleteWidgetClicked()
+{
+ oldItem = 0;
+ checkTimer->stop();
+ checkWidgetName();
+
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+
+ if ( mainWindow->isCustomWidgetUsed( w ) ) {
+ TQMessageBox::information( mainWindow, tr( "Removing Custom Widget" ),
+ tr( "The custom widget '%1' is in use, so it cannot be removed." ).
+ arg( w->className ) );
+ return;
+ }
+
+ if ( !i || !w )
+ return;
+
+ MetaDataBase::CustomWidget *cw = MetaDataBase::customWidget( mainWindow->currentTool() );
+ if ( cw == w )
+ mainWindow->resetTool();
+
+ MetaDataBase::removeCustomWidget( w );
+ customWidgets.remove( i );
+ delete i;
+
+ i = boxWidgets->item( boxWidgets->currentItem() );
+ if ( i ) {
+ boxWidgets->setCurrentItem( i );
+ boxWidgets->setSelected( i, TRUE );
+ }
+}
+
+void CustomWidgetEditor::headerFileChanged( const TQString &s )
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->includeFile = s;
+}
+
+void CustomWidgetEditor::heightChanged( int h )
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->tqsizeHint.setHeight( h );
+ updateCustomWidgetSizes();
+}
+
+void CustomWidgetEditor::includePolicyChanged( int p )
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->includePolicy = (MetaDataBase::CustomWidget::IncludePolicy)p;
+}
+
+void CustomWidgetEditor::pixmapChoosen()
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ TQPixmap pix = qChoosePixmap( this );
+ if ( pix.isNull() )
+ return;
+ delete w->pixmap;
+ w->pixmap = new TQPixmap( pix );
+
+ boxWidgets->blockSignals( TRUE );
+ TQListBoxItem *old = i;
+ boxWidgets->changeItem( *w->pixmap, w->className, boxWidgets->currentItem() );
+ i = boxWidgets->item( boxWidgets->currentItem() );
+ customWidgets.insert( i, w );
+ customWidgets.remove( old );
+ boxWidgets->blockSignals( FALSE );
+ previewPixmap->setPixmap( *w->pixmap );
+}
+
+void CustomWidgetEditor::widthChanged( int wid )
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->tqsizeHint.setWidth( wid );
+ updateCustomWidgetSizes();
+}
+
+MetaDataBase::CustomWidget *CustomWidgetEditor::tqfindWidget( TQListBoxItem *i )
+{
+ if ( !i )
+ return 0;
+
+ TQMap<TQListBoxItem*, MetaDataBase::CustomWidget*>::Iterator it = customWidgets.tqfind( i );
+ if ( it == customWidgets.end() )
+ return 0;
+ return *it;
+}
+
+void CustomWidgetEditor::chooseHeader()
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ TQString h = TQFileDialog::getOpenFileName( TQString(), tr( "Header Files (*.h *.h++ *.hxx *.hh)" ), this );
+ if ( h.isEmpty() )
+ return;
+ editHeader->setText( h );
+ localGlobalCombo->setCurrentItem( (int)MetaDataBase::CustomWidget::Global );
+}
+
+void CustomWidgetEditor::checkWidgetName()
+{
+ TQListBoxItem *i = oldItem ? oldItem : boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ oldItem = 0;
+ if ( !i || !w )
+ return;
+
+ if ( MetaDataBase::isWidgetNameUsed( w ) ) {
+ TQString s = w->className;
+ w->className = oldName;
+ TQMessageBox::information( this, tr( "Renaming a Custom Widget" ),
+ tr( "Custom widget names must be unique.\n"
+ "A custom widget called '%1' already exists, so it is not possible "
+ "to rename this widget with this name." ).arg( s ) );
+ if ( i != boxWidgets->item( boxWidgets->currentItem() ) ) {
+ boxWidgets->setCurrentItem( i );
+ tqApp->processEvents();
+ }
+ editClass->setText( w->className );
+ classNameChanged( w->className );
+ }
+}
+
+void CustomWidgetEditor::closeClicked()
+{
+ oldItem = 0;
+ checkTimer->stop();
+ checkWidgetName();
+ accept();
+}
+
+void CustomWidgetEditor::currentSignalChanged( TQListBoxItem *i )
+{
+ editSignal->blockSignals( TRUE );
+ editSignal->setText( "" );
+ editSignal->blockSignals( FALSE );
+
+ if ( !i ) {
+ editSignal->setEnabled( FALSE );
+ buttonRemoveSignal->setEnabled( FALSE );
+ return;
+ }
+
+ editSignal->blockSignals( TRUE );
+ editSignal->setEnabled( TRUE );
+ buttonRemoveSignal->setEnabled( TRUE );
+ editSignal->setText( i->text() );
+ editSignal->blockSignals( FALSE );
+}
+
+void CustomWidgetEditor::addSignal()
+{
+ TQListBoxItem *i = new TQListBoxText( listSignals, "signal()" );
+ listSignals->setCurrentItem( i );
+ listSignals->setSelected( i, TRUE );
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w )
+ w->lstSignals.append( i->text().latin1() );
+}
+
+void CustomWidgetEditor::removeSignal()
+{
+ TQString s = listSignals->currentText();
+ delete listSignals->item( listSignals->currentItem() );
+ if ( listSignals->currentItem() != -1 )
+ listSignals->setSelected( listSignals->currentItem(), TRUE );
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w )
+ w->lstSignals.remove( s.latin1() );
+}
+
+void CustomWidgetEditor::signalNameChanged( const TQString &s )
+{
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || listSignals->currentItem() == -1 )
+ return;
+
+ TQValueList<TQCString>::Iterator it = w->lstSignals.tqfind( listSignals->currentText().latin1() );
+ if ( it != w->lstSignals.end() )
+ w->lstSignals.remove( it );
+ listSignals->blockSignals( TRUE );
+ listSignals->changeItem( s, listSignals->currentItem() );
+ listSignals->blockSignals( FALSE );
+ w->lstSignals.append( s.latin1() );
+}
+
+void CustomWidgetEditor::slotAccessChanged( const TQString &s )
+{
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listSlots->currentItem() )
+ return;
+
+ MetaDataBase::Function slot;
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.tqfind( slot );
+ if ( it != w->lstSlots.end() )
+ w->lstSlots.remove( it );
+ listSlots->currentItem()->setText( 1, s );
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ w->lstSlots.append( slot );
+}
+
+void CustomWidgetEditor::slotNameChanged( const TQString &s )
+{
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listSlots->currentItem() )
+ return;
+
+ MetaDataBase::Function slot;
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ slot.type = "slot";
+ TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.tqfind( slot );
+ if ( it != w->lstSlots.end() )
+ w->lstSlots.remove( it );
+ listSlots->currentItem()->setText( 0, s );
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ w->lstSlots.append( slot );
+}
+
+void CustomWidgetEditor::addSlot()
+{
+ TQListViewItem *i = new TQListViewItem( listSlots, "slot()", "public" );
+ listSlots->setCurrentItem( i );
+ listSlots->setSelected( i, TRUE );
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w ) {
+ MetaDataBase::Function slot;
+ slot.function = "slot()";
+ slot.access = "public";
+ slot.type = "slot";
+ w->lstSlots.append( slot );
+ }
+}
+
+void CustomWidgetEditor::removeSlot()
+{
+ MetaDataBase::Function slot;
+ slot.function = "1 2 3";
+ if ( listSlots->currentItem() ) {
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ }
+ delete listSlots->currentItem();
+ if ( listSlots->currentItem() )
+ listSlots->setSelected( listSlots->currentItem(), TRUE );
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w && slot.function != "1 2 3" )
+ w->lstSlots.remove( slot );
+}
+
+void CustomWidgetEditor::currentSlotChanged( TQListViewItem *i )
+{
+ editSlot->blockSignals( TRUE );
+ editSlot->setText( "" );
+ editSignal->blockSignals( FALSE );
+
+ if ( !i ) {
+ editSlot->setEnabled( FALSE );
+ comboAccess->setEnabled( FALSE );
+ buttonRemoveSlot->setEnabled( FALSE );
+ return;
+ }
+
+ editSlot->setEnabled( TRUE );
+ comboAccess->setEnabled( TRUE );
+ buttonRemoveSlot->setEnabled( TRUE );
+ editSlot->blockSignals( TRUE );
+ comboAccess->blockSignals( TRUE );
+ editSlot->setText( i->text( 0 ) );
+ if ( i->text( 1 ) == tr( "protected" ) )
+ comboAccess->setCurrentItem( 1 );
+ else
+ comboAccess->setCurrentItem( 0 );
+ editSlot->blockSignals( FALSE );
+ comboAccess->blockSignals( FALSE );
+}
+
+void CustomWidgetEditor::propertyTypeChanged( const TQString &s )
+{
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listProperties->currentItem() )
+ return;
+
+ MetaDataBase::Property property;
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ TQValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.tqfind( property );
+ if ( it != w->lstProperties.end() )
+ w->lstProperties.remove( it );
+ listProperties->currentItem()->setText( 1, s );
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ w->lstProperties.append( property );
+}
+
+void CustomWidgetEditor::propertyNameChanged( const TQString &s )
+{
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listProperties->currentItem() )
+ return;
+
+ MetaDataBase::Property property;
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ TQValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.tqfind( property );
+ if ( it != w->lstProperties.end() )
+ w->lstProperties.remove( it );
+ listProperties->currentItem()->setText( 0, s );
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ w->lstProperties.append( property );
+}
+
+void CustomWidgetEditor::addProperty()
+{
+ TQListViewItem *i = new TQListViewItem( listProperties, "property", "String" );
+ listProperties->setCurrentItem( i );
+ listProperties->setSelected( i, TRUE );
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w ) {
+ MetaDataBase::Property prop;
+ prop.property = "property";
+ prop.type = "String";
+ w->lstProperties.append( prop );
+ }
+}
+
+void CustomWidgetEditor::removeProperty()
+{
+ MetaDataBase::Property property;
+ property.property = "1 2 3";
+ if ( listProperties->currentItem() ) {
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ }
+ delete listProperties->currentItem();
+ if ( listProperties->currentItem() )
+ listProperties->setSelected( listProperties->currentItem(), TRUE );
+ MetaDataBase::CustomWidget *w = tqfindWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w && property.property != "1 2 3" )
+ w->lstProperties.remove( property );
+}
+
+void CustomWidgetEditor::currentPropertyChanged( TQListViewItem *i )
+{
+ editProperty->blockSignals( TRUE );
+ editProperty->setText( "" );
+ editSignal->blockSignals( FALSE );
+
+ if ( !i ) {
+ editProperty->setEnabled( FALSE );
+ comboType->setEnabled( FALSE );
+ buttonRemoveProperty->setEnabled( FALSE );
+ return;
+ }
+
+ editProperty->setEnabled( TRUE );
+ comboType->setEnabled( TRUE );
+ buttonRemoveProperty->setEnabled( TRUE );
+ editProperty->blockSignals( TRUE );
+ comboType->blockSignals( TRUE );
+ editProperty->setText( i->text( 0 ) );
+
+ for ( int j = 0; j < comboType->count(); ++j ) {
+ if ( i->text( 1 ) == comboType->text( j ) ) {
+ comboType->setCurrentItem( j );
+ break;
+ }
+ }
+ editProperty->blockSignals( FALSE );
+ comboType->blockSignals( FALSE );
+}
+
+static TQString makeIndent2( int indent )
+{
+ TQString s;
+ s.fill( ' ', indent * 4 );
+ return s;
+}
+
+static TQString entitize2( const TQString &s )
+{
+ TQString s2 = s;
+ s2 = s2.tqreplace( "\"", "&quot;" );
+ s2 = s2.tqreplace( "&", "&amp;" );
+ s2 = s2.tqreplace( ">", "&gt;" );
+ s2 = s2.tqreplace( "<", "&lt;" );
+ s2 = s2.tqreplace( "'", "&apos;" );
+ return s2;
+}
+
+void CustomWidgetEditor::saveDescription()
+{
+ TQString fn = TQFileDialog::getSaveFileName( TQString(), tr( "Custom-Widget Description (*.cw);;All Files (*)" ), this );
+ if ( fn.isEmpty() )
+ return;
+
+ if ( TQFileInfo( fn ).extension() != "cw" )
+ fn += ".cw";
+ TQFile f( fn );
+ if ( !f.open( IO_WriteOnly ) )
+ return;
+
+ TQTextStream ts( &f );
+ ts.setCodec( TQTextCodec::codecForName( "UTF-8" ) );
+ int indent = 0;
+
+ ts << "<!DOCTYPE CW><CW>" << endl;
+
+ ts << makeIndent2( indent ) << "<customwidgets>" << endl;
+ indent++;
+
+ TQPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ ts << makeIndent2( indent ) << "<customwidget>" << endl;
+ indent++;
+ ts << makeIndent2( indent ) << "<class>" << w->className << "</class>" << endl;
+ ts << makeIndent2( indent ) << "<header location=\""
+ << ( w->includePolicy == MetaDataBase::CustomWidget::Local ? "local" : "global" )
+ << "\">" << w->includeFile << "</header>" << endl;
+ ts << makeIndent2( indent ) << "<sizehint>" << endl;
+ indent++;
+ ts << makeIndent2( indent ) << "<width>" << w->tqsizeHint.width() << "</width>" << endl;
+ ts << makeIndent2( indent ) << "<height>" << w->tqsizeHint.height() << "</height>" << endl;
+ indent--;
+ ts << makeIndent2( indent ) << "</sizehint>" << endl;
+ ts << makeIndent2( indent ) << "<container>" << (int)w->isContainer << "</container>" << endl;
+ ts << makeIndent2( indent ) << "<sizepolicy>" << endl;
+ indent++;
+ ts << makeIndent2( indent ) << "<hordata>" << (int)w->sizePolicy.horData() << "</hordata>" << endl;
+ ts << makeIndent2( indent ) << "<verdata>" << (int)w->sizePolicy.verData() << "</verdata>" << endl;
+ indent--;
+ ts << makeIndent2( indent ) << "</sizepolicy>" << endl;
+ ts << makeIndent2( indent ) << "<pixmap>" << endl;
+ indent++;
+ Resource::saveImageData( w->pixmap->convertToImage(), ts, indent );
+ indent--;
+ ts << makeIndent2( indent ) << "</pixmap>" << endl;
+ if ( !w->lstSignals.isEmpty() ) {
+ for ( TQValueList<TQCString>::Iterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ ts << makeIndent2( indent ) << "<signal>" << entitize2( *it ) << "</signal>" << endl;
+ }
+ if ( !w->lstSlots.isEmpty() ) {
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it )
+ ts << makeIndent2( indent ) << "<slot access=\"" << (*it).access << "\">" << entitize2( (*it).function ) << "</slot>" << endl;
+ }
+ if ( !w->lstProperties.isEmpty() ) {
+ for ( TQValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.begin(); it != w->lstProperties.end(); ++it )
+ ts << makeIndent2( indent ) << "<property type=\"" << (*it).type << "\">" << entitize2( (*it).property ) << "</property>" << endl;
+ }
+ indent--;
+ ts << makeIndent2( indent ) << "</customwidget>" << endl;
+ }
+
+ indent--;
+ ts << makeIndent2( indent ) << "</customwidgets>" << endl;
+ ts << "</CW>" << endl;
+}
+
+void CustomWidgetEditor::loadDescription()
+{
+ TQString fn = TQFileDialog::getOpenFileName( TQString(), tr( "Custom-Widget Description (*.cw);;All Files (*)" ), this );
+ if ( fn.isEmpty() )
+ return;
+
+ TQFile f( fn );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+
+ TQDomDocument doc;
+ TQString errMsg;
+ int errLine;
+ if ( !doc.setContent( &f, &errMsg, &errLine ) ) {
+ qDebug( TQString("Parse error: ") + errMsg + TQString(" in line %d"), errLine );
+ return;
+ }
+
+ TQDomElement firstWidget = doc.firstChild().toElement().firstChild().toElement();
+
+ while ( firstWidget.tagName() != "customwidgets" )
+ firstWidget = firstWidget.nextSibling().toElement();
+
+ Resource::loadCustomWidgets( firstWidget, 0 );
+ boxWidgets->clear();
+ setupDefinition();
+ setupSignals();
+ setupSlots();
+ setupProperties();
+}
+
+void CustomWidgetEditor::updateCustomWidgetSizes()
+{
+ if ( cwLst.isEmpty() )
+ cwLst = *mainWindow->queryList( "CustomWidget" );
+ for ( TQObject *o = cwLst.first(); o; o = cwLst.next() )
+ ( (TQWidget*)o )->updateGeometry();
+}
+
+void CustomWidgetEditor::horDataChanged( int a )
+{
+ TQSizePolicy::SizeType st = int_to_size_type( a );
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ TQSizePolicy osp = w->sizePolicy;
+ w->sizePolicy.setHorData( st );
+ if ( cwLst.isEmpty() )
+ cwLst = *mainWindow->queryList( "CustomWidget" );
+ for ( TQObject *o = cwLst.first(); o; o = cwLst.next() ) {
+ CustomWidget *cw = (CustomWidget*)o;
+ if ( cw->realClassName() == boxWidgets->currentText() ) {
+ if ( cw->sizePolicy() == osp )
+ cw->tqsetSizePolicy( w->sizePolicy );
+ }
+ }
+}
+
+void CustomWidgetEditor::verDataChanged( int a )
+{
+ TQSizePolicy::SizeType st = int_to_size_type( a );
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ TQSizePolicy osp = w->sizePolicy;
+ w->sizePolicy.setVerData( st );
+ if ( cwLst.isEmpty() )
+ cwLst = *mainWindow->queryList( "CustomWidget" );
+ for ( TQObject *o = cwLst.first(); o; o = cwLst.next() ) {
+ CustomWidget *cw = (CustomWidget*)o;
+ if ( cw->realClassName() == boxWidgets->currentText() ) {
+ if ( cw->sizePolicy() == osp )
+ cw->tqsetSizePolicy( w->sizePolicy );
+ }
+ }
+}
+
+void CustomWidgetEditor::widgetIsContainer( bool b )
+{
+ TQListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = tqfindWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->isContainer = b;
+ WidgetDatabaseRecord *r = WidgetDatabase::at( w->id );
+ if ( r )
+ r->isContainer = b;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.h b/tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.h
new file mode 100644
index 0000000..719b1c2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/customwidgeteditorimpl.h
@@ -0,0 +1,106 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CUSTOMWIDGETEDITORIMPL_H
+#define CUSTOMWIDGETEDITORIMPL_H
+
+#include "customwidgeteditor.h"
+#include "metadatabase.h"
+
+#include <tqmap.h>
+#include <tqobjectlist.h>
+
+class TQTimer;
+class TQListBoxItem;
+class MainWindow;
+
+class CustomWidgetEditor : public CustomWidgetEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ CustomWidgetEditor( TQWidget *tqparent , MainWindow *mw);
+
+protected Q_SLOTS:
+ void addWidgetClicked();
+ void classNameChanged( const TQString & );
+ void currentWidgetChanged( TQListBoxItem * );
+ void deleteWidgetClicked();
+ void headerFileChanged( const TQString & );
+ void heightChanged( int );
+ void includePolicyChanged( int );
+ void pixmapChoosen();
+ void widthChanged( int );
+ void chooseHeader();
+ void checkWidgetName();
+ void closeClicked();
+ void currentSignalChanged( TQListBoxItem *i );
+ void addSignal();
+ void removeSignal();
+ void signalNameChanged( const TQString &s );
+ void slotAccessChanged( const TQString & );
+ void slotNameChanged( const TQString & );
+ void addSlot();
+ void removeSlot();
+ void currentSlotChanged( TQListViewItem * );
+ void propertyTypeChanged( const TQString & );
+ void propertyNameChanged( const TQString & );
+ void addProperty();
+ void removeProperty();
+ void currentPropertyChanged( TQListViewItem * );
+ void saveDescription();
+ void loadDescription();
+ void horDataChanged( int );
+ void verDataChanged( int );
+ void widgetIsContainer( bool );
+
+private:
+ MetaDataBase::CustomWidget *tqfindWidget( TQListBoxItem *i );
+ void setupDefinition();
+ void setupSignals();
+ void setupSlots();
+ void setupProperties();
+ void updateCustomWidgetSizes();
+
+private:
+ TQMap<TQListBoxItem*, MetaDataBase::CustomWidget*> customWidgets;
+ TQString oldName;
+ TQTimer *checkTimer;
+ TQListBoxItem *oldItem;
+ MainWindow *mainWindow;
+ TQObjectList cwLst;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/database.cpp b/tqtinterface/qt4/tools/designer/designer/database.cpp
new file mode 100644
index 0000000..926528f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/database.cpp
@@ -0,0 +1,129 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#if defined(DESIGNER)
+#include "database.h"
+#else
+#include "database2.h"
+#endif
+
+#ifndef TQT_NO_SQL
+
+#if defined(DESIGNER)
+#include "formwindow.h"
+#include "mainwindow.h"
+#endif
+
+#include <tqsqldatabase.h>
+#include <tqsqlform.h>
+#include <tqsqlcursor.h>
+#include <tqsqlrecord.h>
+
+DatabaseSupport::DatabaseSupport()
+{
+ con = 0;
+ frm = 0;
+ tqparent = 0;
+}
+
+void DatabaseSupport::initPreview( const TQString &connection, const TQString &table, TQObject *o,
+ const TQMap<TQString, TQString> &databaseControls )
+{
+ tbl = table;
+ dbControls = databaseControls;
+ tqparent = o;
+
+ if ( connection != "(default)" )
+ con = TQSqlDatabase::database( connection );
+ else
+ con = TQSqlDatabase::database();
+ frm = new TQSqlForm( o, table );
+ for ( TQMap<TQString, TQString>::Iterator it = dbControls.begin(); it != dbControls.end(); ++it ) {
+ TQObject *chld = tqparent->child( it.key(), "TQWidget" );
+ if ( !chld )
+ continue;
+ frm->insert( (TQWidget*)chld, *it );
+ }
+}
+
+TQDesignerDataBrowser::TQDesignerDataBrowser( TQWidget *tqparent, const char *name )
+ : TQDataBrowser( tqparent, name )
+{
+}
+
+bool TQDesignerDataBrowser::event( TQEvent* e )
+{
+ bool b = TQDataBrowser::event( e );
+#if defined(DESIGNER)
+ if ( MainWindow::self->isPreviewing() ) {
+#endif
+ if ( e->type() == TQEvent::Show ) {
+ if ( con ) {
+ TQSqlCursor* cursor = new TQSqlCursor( tbl, TRUE, con );
+ setSqlCursor( cursor, TRUE );
+ setForm( frm );
+ refresh();
+ first();
+ }
+ return TRUE;
+ }
+#if defined(DESIGNER)
+ }
+#endif
+ return b;
+}
+
+TQDesignerDataView::TQDesignerDataView( TQWidget *tqparent, const char *name )
+ : TQDataView( tqparent, name )
+{
+}
+
+bool TQDesignerDataView::event( TQEvent* e )
+{
+ bool b = TQDataView::event( e );
+#if defined(DESIGNER)
+ if ( MainWindow::self->isPreviewing() ) {
+#endif
+ if ( e->type() == TQEvent::Show ) {
+ setForm( frm );
+ readFields();
+ return TRUE;
+ }
+#if defined(DESIGNER)
+ }
+#endif
+ return b;
+}
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/database.h b/tqtinterface/qt4/tools/designer/designer/database.h
new file mode 100644
index 0000000..35423a3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/database.h
@@ -0,0 +1,92 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DATABASE_H
+#define DATABASE_H
+
+#include "tqfeatures.h"
+
+#ifndef TQT_NO_SQL
+#include <tqdataview.h>
+#include <tqdatabrowser.h>
+#include <tqsqlcursor.h>
+#include <tqstring.h>
+
+class TQSqlDatabase;
+class TQSqlForm;
+
+class DatabaseSupport
+{
+public:
+ DatabaseSupport();
+ virtual ~DatabaseSupport() {}
+
+ void initPreview( const TQString &connection, const TQString &table, TQObject *o,
+ const TQMap<TQString, TQString> &databaseControls );
+
+protected:
+ TQSqlDatabase* con;
+ TQSqlForm* frm;
+ TQString tbl;
+ TQMap<TQString, TQString> dbControls;
+ TQObject *tqparent;
+
+};
+
+class TQDesignerDataBrowser : public TQDataBrowser, public DatabaseSupport
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQDesignerDataBrowser( TQWidget *tqparent, const char *name );
+
+protected:
+ bool event( TQEvent* e );
+};
+
+class TQDesignerDataView : public TQDataView, public DatabaseSupport
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQDesignerDataView( TQWidget *tqparent, const char *name );
+
+protected:
+ bool event( TQEvent* e );
+
+};
+#endif
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/database2.h b/tqtinterface/qt4/tools/designer/designer/database2.h
new file mode 100644
index 0000000..3beae9e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/database2.h
@@ -0,0 +1,95 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DATABASE2_H
+#define DATABASE2_H
+
+#include "tqfeatures.h"
+
+#ifndef TQT_NO_SQL
+#include <tqdataview.h>
+#include <tqdatabrowser.h>
+#include <tqsqlcursor.h>
+#include <tqstring.h>
+
+class TQSqlDatabase;
+class TQSqlForm;
+
+class DatabaseSupport2
+{
+public:
+ DatabaseSupport2();
+ virtual ~DatabaseSupport2() {}
+
+ void initPreview( const TQString &connection, const TQString &table, TQObject *o,
+ const TQMap<TQString, TQString> &databaseControls );
+
+protected:
+ TQSqlDatabase* con;
+ TQSqlForm* frm;
+ TQString tbl;
+ TQMap<TQString, TQString> dbControls;
+ TQObject *tqparent;
+
+};
+
+class TQDesignerDataBrowser2 : public TQDataBrowser, public DatabaseSupport2
+{
+ TQ_OBJECT
+
+public:
+ TQDesignerDataBrowser2( TQWidget *tqparent, const char *name );
+
+protected:
+ bool event( TQEvent* e );
+};
+
+class TQDesignerDataView2 : public TQDataView, public DatabaseSupport2
+{
+ TQ_OBJECT
+
+public:
+ TQDesignerDataView2( TQWidget *tqparent, const char *name );
+
+protected:
+ bool event( TQEvent* e );
+
+};
+
+#define DatabaseSupport DatabaseSupport2
+#define TQDesignerDataBrowser TQDesignerDataBrowser2
+#define TQDesignerDataView TQDesignerDataView2
+
+#endif
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/dbconnection.ui b/tqtinterface/qt4/tools/designer/designer/dbconnection.ui
new file mode 100644
index 0000000..e089d34
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/dbconnection.ui
@@ -0,0 +1,229 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>DatabaseConnectionWidget</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>DatabaseConnectionWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>199</width>
+ <height>185</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Database Connection</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Database Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editDatabase</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Username:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editUsername</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Password:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editPassword</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>D&amp;river</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboDriver</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editName</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Hostname:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editHostname</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboDriver</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editName</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="5" column="1">
+ <property name="name">
+ <cstring>editHostname</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="6" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>P&amp;ort</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editPort</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>editUsername</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>editPassword</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="echoMode">
+ <enum>Password</enum>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editDatabase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="6" column="1">
+ <property name="name">
+ <cstring>editPort</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="specialValueText">
+ <string>Default</string>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>-1</number>
+ </property>
+ <property name="value">
+ <number>-1</number>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+</connections>
+<tabstops>
+ <tabstop>editName</tabstop>
+ <tabstop>comboDriver</tabstop>
+ <tabstop>editDatabase</tabstop>
+ <tabstop>editUsername</tabstop>
+ <tabstop>editPassword</tabstop>
+ <tabstop>editHostname</tabstop>
+ <tabstop>editPort</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/dbconnectioneditor.ui b/tqtinterface/qt4/tools/designer/designer/dbconnectioneditor.ui
new file mode 100644
index 0000000..9e12f4e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/dbconnectioneditor.ui
@@ -0,0 +1,154 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>DatabaseConnectionEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>DatabaseConnectionEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>393</width>
+ <height>286</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Connect</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQGroupBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>grp</cstring>
+ </property>
+ <property name="title">
+ <string>Connection Details</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="0" column="0">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionEditorBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+</connections>
+<tabstops>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>PushButton2</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.cpp b/tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.cpp
new file mode 100644
index 0000000..c6d7d98
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.cpp
@@ -0,0 +1,87 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "dbconnectionimpl.h"
+#include "dbconnection.h"
+#include "project.h"
+#include "asciivalidator.h"
+#include <tqgroupbox.h>
+#include <tqcombobox.h>
+#include <tqspinbox.h>
+#include <tqlineedit.h>
+#include <tqlayout.h>
+#include <tqsqldatabase.h>
+
+DatabaseConnectionEditor::DatabaseConnectionEditor( DatabaseConnection* connection, TQWidget* tqparent,
+ const char* name, bool modal, WFlags fl )
+ : DatabaseConnectionEditorBase( tqparent, name, modal, fl ), conn( connection )
+{
+ connectionWidget = new DatabaseConnectionWidget( grp );
+ grpLayout->addWidget( connectionWidget, 0, 0 );
+ init();
+}
+
+DatabaseConnectionEditor::~DatabaseConnectionEditor()
+{
+}
+
+void DatabaseConnectionEditor::accept()
+{
+#ifndef TQT_NO_SQL
+ conn->setUsername( connectionWidget->editUsername->text() );
+ conn->setPassword( connectionWidget->editPassword->text() );
+ conn->setHostname( connectionWidget->editHostname->text() );
+#endif
+ DatabaseConnectionEditorBase::accept();
+}
+
+void DatabaseConnectionEditor::init()
+{
+ connectionWidget->editName->setEnabled( FALSE );
+ connectionWidget->editName->setValidator( new AsciiValidator( TQT_TQOBJECT(connectionWidget->editName) ) );
+ connectionWidget->editName->setText( conn->name() );
+ connectionWidget->comboDriver->setEnabled( FALSE );
+ connectionWidget->comboDriver->lineEdit()->setText( conn->driver() );
+ connectionWidget->editDatabase->setEnabled( FALSE );
+ connectionWidget->editDatabase->setText( conn->database() );
+ connectionWidget->editUsername->setEnabled( TRUE );
+ connectionWidget->editUsername->setText( conn->username() );
+ connectionWidget->editPassword->setEnabled( TRUE );
+ connectionWidget->editPassword->setText( "" );
+ connectionWidget->editHostname->setEnabled( TRUE );
+ connectionWidget->editHostname->setText( conn->hostname() );
+ connectionWidget->editPort->setEnabled( TRUE );
+ connectionWidget->editPort->setValue( conn->port() );
+ connectionWidget->editUsername->setFocus();
+ connectionWidget->editUsername->selectAll();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.h b/tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.h
new file mode 100644
index 0000000..3eecd01
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/dbconnectionimpl.h
@@ -0,0 +1,65 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DBCONNECTIONIMPL_H
+#define DBCONNECTIONIMPL_H
+
+#include "dbconnectioneditor.h"
+
+class DatabaseConnection;
+class DatabaseConnectionWidget;
+class TQGridLayout;
+
+class DatabaseConnectionEditor : public DatabaseConnectionEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ DatabaseConnectionEditor( DatabaseConnection* connection, TQWidget* tqparent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~DatabaseConnectionEditor();
+
+public Q_SLOTS:
+ void accept();
+private:
+ void init();
+
+private:
+ DatabaseConnection *conn;
+ TQGridLayout* lay;
+ DatabaseConnectionWidget* connectionWidget;
+
+};
+
+#endif // DBCONNECTIONIMPL_H
diff --git a/tqtinterface/qt4/tools/designer/designer/dbconnections.ui b/tqtinterface/qt4/tools/designer/designer/dbconnections.ui
new file mode 100644
index 0000000..1bf7426
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/dbconnections.ui
@@ -0,0 +1,328 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>DatabaseConnectionBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>DatabaseConnectionBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>512</width>
+ <height>309</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Database Connections</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Connection</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>listConnections</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Connection</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonClose</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="1" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQGroupBox" row="0" column="2" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>grp</cstring>
+ </property>
+ <property name="title">
+ <string>Connection</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="0" column="0">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="3" column="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonConnect</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Connec&amp;t</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer row="4" column="2">
+ <property name="name">
+ <cstring>Spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonClose</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonNew</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>newConnection()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>deleteConnection()</slot>
+ </connection>
+ <connection>
+ <sender>buttonConnect</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>doConnect()</slot>
+ </connection>
+ <connection>
+ <sender>listConnections</sender>
+ <signal>highlighted(const QString&amp;)</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>currentConnectionChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listConnections</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>currentConnectionChanged(const QString&amp;)</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">currentConnectionChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">deleteConnection()</slot>
+ <slot access="protected" language="C++" returnType="void">newConnection()</slot>
+ <slot access="protected" language="C++" returnType="void">connectionNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">doConnect()</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonClose</tabstop>
+ <tabstop>listConnections</tabstop>
+ <tabstop>buttonNew</tabstop>
+ <tabstop>buttonDelete</tabstop>
+ <tabstop>buttonConnect</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.cpp b/tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.cpp
new file mode 100644
index 0000000..0ee44bc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.cpp
@@ -0,0 +1,201 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "dbconnectionsimpl.h"
+#include <tqptrlist.h>
+#include <tqgroupbox.h>
+#include <tqlayout.h>
+#include "project.h"
+#include <tqlistbox.h>
+#include <tqcombobox.h>
+#include <tqspinbox.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqsqldatabase.h>
+#include <tqmessagebox.h>
+#include <tqapplication.h>
+#include "mainwindow.h"
+#include "asciivalidator.h"
+
+static bool blockChanges = FALSE;
+
+/*
+ * Constructs a DatabaseConnectionsEditor which is a child of 'tqparent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+DatabaseConnectionsEditor::DatabaseConnectionsEditor( Project *pro, TQWidget* tqparent, const char* name, bool modal, WFlags fl )
+ : DatabaseConnectionBase( tqparent, name, modal, fl ), project( pro )
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ connectionWidget = new DatabaseConnectionWidget( grp );
+ grpLayout->addWidget( connectionWidget, 0, 0 );
+#ifndef TQT_NO_SQL
+ TQPtrList<DatabaseConnection> lst = project->databaseConnections();
+ for ( DatabaseConnection *conn = lst.first(); conn; conn = lst.next() )
+ listConnections->insertItem( conn->name() );
+ connectionWidget->comboDriver->insertStringList( TQSqlDatabase::drivers() );
+#endif
+ connectionWidget->editName->setValidator( new AsciiValidator( TQT_TQOBJECT(connectionWidget->editName) ) );
+ enableAll( FALSE );
+}
+
+DatabaseConnectionsEditor::~DatabaseConnectionsEditor()
+{
+}
+
+void DatabaseConnectionsEditor::deleteConnection()
+{
+ if ( listConnections->currentItem() == -1 )
+ return;
+ project->removeDatabaseConnection( listConnections->currentText() );
+ delete listConnections->item( listConnections->currentItem() );
+ if ( listConnections->count() ) {
+ listConnections->setCurrentItem( 0 );
+ currentConnectionChanged( listConnections->currentText() );
+ } else {
+ enableAll( FALSE );
+ }
+ project->saveConnections();
+}
+
+void DatabaseConnectionsEditor::newConnection()
+{
+ blockChanges = TRUE;
+ enableAll( TRUE );
+ TQString n( "(default)" );
+ if ( project->databaseConnection( n ) ) {
+ n = "connection";
+ int i = 2;
+ while ( project->databaseConnection( n + TQString::number( i ) ) )
+ ++i;
+ n = n + TQString::number( i );
+ }
+ connectionWidget->editName->setText( n );
+ listConnections->clearSelection();
+ buttonConnect->setDefault( TRUE );
+ connectionWidget->editName->setFocus();
+ blockChanges = FALSE;
+}
+
+void DatabaseConnectionsEditor::doConnect()
+{
+#ifndef TQT_NO_SQL
+ if ( listConnections->currentItem() == -1 ||
+ !listConnections->item( listConnections->currentItem() )->isSelected() ) { // new connection
+ // ### do error checking for duplicated connection names
+ DatabaseConnection *conn = new DatabaseConnection( project );
+ conn->setName( connectionWidget->editName->text() );
+ conn->setDriver( connectionWidget->comboDriver->lineEdit()->text() );
+ conn->setDatabase( connectionWidget->editDatabase->text() );
+ conn->setUsername( connectionWidget->editUsername->text() );
+ conn->setPassword( connectionWidget->editPassword->text() );
+ conn->setHostname( connectionWidget->editHostname->text() );
+ conn->setPort( connectionWidget->editPort->value() );
+ if ( conn->refreshCatalog() ) {
+ project->addDatabaseConnection( conn );
+ listConnections->insertItem( conn->name() );
+ listConnections->setCurrentItem( listConnections->count() - 1 );
+ project->saveConnections();
+ } else {
+ TQMessageBox::warning( MainWindow::self, TQApplication::tr( "Connection" ),
+ TQApplication::tr( "Could not connect to the database.\n"
+ "Please ensure that the database server is running "
+ "and that all the connection information is correct.\n"
+ "[ " + conn->lastError() + " ]" ) );
+ delete conn;
+ }
+ } else { // sync // ### should this do something else? right now it just overwrites all info about the connection...
+ DatabaseConnection *conn = project->databaseConnection( listConnections->currentText() );
+ conn->setName( connectionWidget->editName->text() );
+ conn->setDriver( connectionWidget->comboDriver->lineEdit()->text() );
+ conn->setDatabase( connectionWidget->editDatabase->text() );
+ conn->setUsername( connectionWidget->editUsername->text() );
+ conn->setPassword( connectionWidget->editPassword->text() );
+ conn->setHostname( connectionWidget->editHostname->text() );
+ conn->setPort( connectionWidget->editPort->value() );
+ conn->refreshCatalog();
+ project->saveConnections();
+ }
+#endif
+}
+
+void DatabaseConnectionsEditor::currentConnectionChanged( const TQString &s )
+{
+#ifndef TQT_NO_SQL
+ DatabaseConnection *conn = project->databaseConnection( s );
+ blockChanges = TRUE;
+ enableAll( conn != 0 );
+ connectionWidget->editName->setEnabled( FALSE );
+ blockChanges = FALSE;
+ if ( !conn )
+ return;
+ blockChanges = TRUE;
+ connectionWidget->editName->setText( conn->name() );
+ blockChanges = FALSE;
+ connectionWidget->comboDriver->lineEdit()->setText( conn->driver() );
+ connectionWidget->editDatabase->setText( conn->database() );
+ connectionWidget->editUsername->setText( conn->username() );
+ connectionWidget->editPassword->setText( conn->password() );
+ connectionWidget->editHostname->setText( conn->hostname() );
+ connectionWidget->editPort->setValue( conn->port() );
+#endif
+}
+
+void DatabaseConnectionsEditor::connectionNameChanged( const TQString &s )
+{
+ if ( listConnections->currentItem() == 0 || blockChanges )
+ return;
+ listConnections->changeItem( s, listConnections->currentItem() );
+}
+
+void DatabaseConnectionsEditor::enableAll( bool b )
+{
+ connectionWidget->editName->setEnabled( b );
+ connectionWidget->editName->setText( "" );
+ connectionWidget->comboDriver->setEnabled( b );
+ connectionWidget->comboDriver->lineEdit()->setText( "" );
+ connectionWidget->editDatabase->setEnabled( b );
+ connectionWidget->editDatabase->setText( "" );
+ connectionWidget->editUsername->setEnabled( b );
+ connectionWidget->editUsername->setText( "" );
+ connectionWidget->editPassword->setEnabled( b );
+ connectionWidget->editPassword->setText( "" );
+ connectionWidget->editHostname->setEnabled( b );
+ connectionWidget->editHostname->setText( "" );
+ connectionWidget->editPort->setEnabled( b );
+ connectionWidget->editPort->setValue( -1 );
+ buttonConnect->setEnabled( b );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.h b/tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.h
new file mode 100644
index 0000000..aec4047
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/dbconnectionsimpl.h
@@ -0,0 +1,68 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DBCONNECTIONSIMPL_H
+#define DBCONNECTIONSIMPL_H
+
+#include "dbconnections.h"
+#include "dbconnection.h"
+
+class Project;
+
+class DatabaseConnectionsEditor : public DatabaseConnectionBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ DatabaseConnectionsEditor( Project *pro, TQWidget* tqparent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~DatabaseConnectionsEditor();
+
+protected Q_SLOTS:
+ void deleteConnection();
+ void newConnection();
+ void doConnect();
+ void currentConnectionChanged( const TQString & );
+ void connectionNameChanged( const TQString &s );
+
+private:
+ void enableAll( bool b );
+
+private:
+ Project *project;
+ DatabaseConnectionWidget* connectionWidget;
+
+};
+
+#endif // DBCONNECTIONSIMPL_H
diff --git a/tqtinterface/qt4/tools/designer/designer/defs.cpp b/tqtinterface/qt4/tools/designer/designer/defs.cpp
new file mode 100644
index 0000000..1b9a8e7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/defs.cpp
@@ -0,0 +1,91 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "defs.h"
+
+int size_type_to_int( TQSizePolicy::SizeType t )
+{
+ if ( t == TQSizePolicy::Fixed )
+ return 0;
+ if ( t == TQSizePolicy::Minimum )
+ return 1;
+ if ( t == TQSizePolicy::Maximum )
+ return 2;
+ if ( t == TQSizePolicy::Preferred )
+ return 3;
+ if ( t == TQSizePolicy::MinimumExpanding )
+ return 4;
+ if ( t == TQSizePolicy::Expanding )
+ return 5;
+ if ( t == TQSizePolicy::Ignored )
+ return 6;
+ return 0;
+}
+
+TQString size_type_to_string( TQSizePolicy::SizeType t )
+{
+ if ( t == TQSizePolicy::Fixed )
+ return "Fixed";
+ if ( t == TQSizePolicy::Minimum )
+ return "Minimum";
+ if ( t == TQSizePolicy::Maximum )
+ return "Maximum";
+ if ( t == TQSizePolicy::Preferred )
+ return "Preferred";
+ if ( t == TQSizePolicy::MinimumExpanding )
+ return "MinimumExpanding";
+ if ( t == TQSizePolicy::Expanding )
+ return "Expanding";
+ if ( t == TQSizePolicy::Ignored )
+ return "Ignored";
+ return TQString();
+}
+
+TQSizePolicy::SizeType int_to_size_type( int i )
+{
+ if ( i == 0 )
+ return TQSizePolicy::Fixed;
+ if ( i == 1 )
+ return TQSizePolicy::Minimum;
+ if ( i == 2 )
+ return TQSizePolicy::Maximum;
+ if ( i == 3 )
+ return TQSizePolicy::Preferred;
+ if ( i == 4 )
+ return TQSizePolicy::MinimumExpanding;
+ if ( i == 5 )
+ return TQSizePolicy::Expanding;
+ if ( i == 6 )
+ return TQSizePolicy::Ignored;
+ return TQSizePolicy::Preferred;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/defs.h b/tqtinterface/qt4/tools/designer/designer/defs.h
new file mode 100644
index 0000000..b6560d1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/defs.h
@@ -0,0 +1,49 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DEFS_H
+#define DEFS_H
+
+#include <tqsizepolicy.h>
+#include <tqstring.h>
+
+#define POINTER_TOOL 32000
+#define CONNECT_TOOL 32001
+#define ORDER_TOOL 32002
+#define BUDDY_TOOL 32004
+
+int size_type_to_int( TQSizePolicy::SizeType t );
+TQString size_type_to_string( TQSizePolicy::SizeType t );
+TQSizePolicy::SizeType int_to_size_type( int i );
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/designer.pro b/tqtinterface/qt4/tools/designer/designer/designer.pro
new file mode 100644
index 0000000..5cffc49
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designer.pro
@@ -0,0 +1,443 @@
+TEMPLATE = lib
+
+CONFIG += qt warn_on staticlib qmake_cache
+CONFIG -= dll
+!force_static:!win32:tqcontains(QT_PRODUCT,qt-internal) {
+ CONFIG -= staticlib
+ CONFIG += dll
+}
+
+TARGET = designercore
+
+DEFINES += DESIGNER
+DEFINES += QT_INTERNAL_XML
+DEFINES += QT_INTERNAL_WORKSPACE
+DEFINES += QT_INTERNAL_ICONVIEW
+DEFINES += QT_INTERNAL_TABLE
+table:win32-msvc:DEFINES+=QM_TEMPLATE_EXTERN_TABLE=extern
+
+unix {
+ QMAKE_CFLAGS += $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SHLIB
+}
+
+include( ../../../src/qt_professional.pri )
+
+SOURCES += command.cpp \
+ formwindow.cpp \
+ defs.cpp \
+ layout.cpp \
+ mainwindow.cpp \
+ mainwindowactions.cpp \
+ metadatabase.cpp \
+ pixmapchooser.cpp \
+ propertyeditor.cpp \
+ resource.cpp \
+ sizehandle.cpp \
+ orderindicator.cpp \
+ widgetfactory.cpp \
+ hierarchyview.cpp \
+ listboxeditorimpl.cpp \
+ newformimpl.cpp \
+ workspace.cpp \
+ listvieweditorimpl.cpp \
+ customwidgeteditorimpl.cpp \
+ paletteeditorimpl.cpp \
+ styledbutton.cpp \
+ iconvieweditorimpl.cpp \
+ multilineeditorimpl.cpp \
+ formsettingsimpl.cpp \
+ asciivalidator.cpp \
+ designerapp.cpp \
+ designerappiface.cpp \
+ actioneditorimpl.cpp \
+ actionlistview.cpp \
+ actiondnd.cpp \
+ project.cpp \
+ projectsettingsimpl.cpp \
+ sourceeditor.cpp \
+ outputwindow.cpp \
+ ../shared/widgetdatabase.cpp \
+ ../shared/parser.cpp \
+ pixmapcollection.cpp \
+ previewframe.cpp \
+ previewwidgetimpl.cpp \
+ paletteeditoradvancedimpl.cpp \
+ sourcefile.cpp \
+ wizardeditorimpl.cpp \
+ qcompletionedit.cpp \
+ timestamp.cpp \
+ formfile.cpp \
+ widgetaction.cpp \
+ propertyobject.cpp \
+ startdialogimpl.cpp \
+ syntaxhighlighter_html.cpp \
+ connectionitems.cpp \
+ editfunctionsimpl.cpp \
+ variabledialogimpl.cpp \
+ listviewdnd.cpp \
+ listboxdnd.cpp \
+ listdnd.cpp \
+ listboxrename.cpp \
+ connectiontable.cpp \
+ popupmenueditor.cpp \
+ menubareditor.cpp
+
+HEADERS += command.h \
+ defs.h \
+ formwindow.h \
+ layout.h \
+ mainwindow.h \
+ metadatabase.h \
+ pixmapchooser.h \
+ propertyeditor.h \
+ resource.h \
+ sizehandle.h \
+ orderindicator.h \
+ widgetfactory.h \
+ hierarchyview.h \
+ listboxeditorimpl.h \
+ newformimpl.h \
+ workspace.h \
+ listvieweditorimpl.h \
+ customwidgeteditorimpl.h \
+ paletteeditorimpl.h \
+ styledbutton.h \
+ iconvieweditorimpl.h \
+ multilineeditorimpl.h \
+ formsettingsimpl.h \
+ asciivalidator.h \
+ ../interfaces/widgetinterface.h \
+ ../interfaces/actioninterface.h \
+ ../interfaces/filterinterface.h \
+ ../interfaces/designerinterface.h \
+ designerapp.h \
+ designerappiface.h \
+ actioneditorimpl.h \
+ actionlistview.h \
+ actiondnd.h \
+ project.h \
+ projectsettingsimpl.h \
+ sourceeditor.h \
+ outputwindow.h \
+ ../shared/widgetdatabase.h \
+ ../shared/parser.h \
+ previewframe.h \
+ previewwidgetimpl.h \
+ paletteeditoradvancedimpl.h \
+ pixmapcollection.h \
+ sourcefile.h \
+ wizardeditorimpl.h \
+ qcompletionedit.h \
+ timestamp.h \
+ formfile.h \
+ widgetaction.h \
+ propertyobject.h \
+ startdialogimpl.h \
+ syntaxhighlighter_html.h \
+ connectionitems.h \
+ editfunctionsimpl.h \
+ variabledialogimpl.h \
+ listviewdnd.h \
+ listboxdnd.h \
+ listdnd.h \
+ listboxrename.h \
+ connectiontable.h \
+ popupmenueditor.h \
+ menubareditor.h
+
+FORMS += listboxeditor.ui \
+ editfunctions.ui \
+ newform.ui \
+ listvieweditor.ui \
+ customwidgeteditor.ui \
+ paletteeditor.ui \
+ iconvieweditor.ui \
+ preferences.ui \
+ multilineeditor.ui \
+ formsettings.ui \
+ about.ui \
+ pixmapfunction.ui \
+ createtemplate.ui \
+ actioneditor.ui \
+ projectsettings.ui \
+ finddialog.ui \
+ replacedialog.ui \
+ gotolinedialog.ui \
+ pixmapcollectioneditor.ui \
+ previewwidget.ui \
+ paletteeditoradvanced.ui \
+ wizardeditor.ui \
+ listeditor.ui \
+ startdialog.ui \
+ richtextfontdialog.ui \
+ connectiondialog.ui \
+ variabledialog.ui \
+ configtoolboxdialog.ui
+
+IMAGES += images/designer_adjustsize.png \
+ images/designer_edithlayoutsplit.png \
+ images/designer_left.png \
+ images/designer_sizeall.png \
+ images/designer_arrow.png \
+ images/designer_editlower.png \
+ images/designer_line.png \
+ images/designer_sizeb.png \
+ images/designer_background.png \
+ images/designer_editpaste.png \
+ images/designer_lineedit.png \
+ images/designer_sizef.png \
+ images/designer_book.png \
+ images/designer_editraise.png \
+ images/designer_listbox.png \
+ images/designer_sizeh.png \
+ images/designer_buttongroup.png \
+ images/designer_editslots.png \
+ images/designer_listview.png \
+ images/designer_sizev.png \
+ images/designer_checkbox.png \
+ images/designer_editvlayout.png \
+ images/designer_multilineedit.png \
+ images/designer_slider.png \
+ images/designer_combobox.png \
+ images/designer_editvlayoutsplit.png \
+ images/designer_newform.png \
+ images/designer_spacer.png \
+ images/designer_connecttool.png \
+ images/designer_filenew.png \
+ images/designer_no.png \
+ images/designer_spinbox.png \
+ images/designer_cross.png \
+ images/designer_fileopen.png \
+ images/designer_ordertool.png \
+ images/designer_splash.png \
+ images/designer_customwidget.png \
+ images/designer_filesave.png \
+ images/designer_pixlabel.png \
+ images/designer_table.png \
+ images/designer_databrowser.png \
+ images/designer_form.png \
+ images/designer_pointer.png \
+ images/designer_tabwidget.png \
+ images/designer_datatable.png \
+ images/designer_frame.png \
+ images/designer_print.png \
+ images/designer_textbrowser.png \
+ images/designer_dataview.png \
+ images/designer_groupbox.png \
+ images/designer_progress.png \
+ images/designer_textedit.png \
+ images/designer_dateedit.png \
+ images/designer_hand.png \
+ images/designer_project.png \
+ images/designer_textview.png \
+ images/designer_datetimeedit.png \
+ images/designer_help.png \
+ images/designer_pushbutton.png \
+ images/designer_timeedit.png \
+ images/designer_dial.png \
+ images/designer_home.png \
+ images/designer_qtlogo.png \
+ images/designer_toolbutton.png \
+ images/designer_toolbox.png \
+ images/designer_down.png \
+ images/designer_hsplit.png \
+ images/designer_radiobutton.png \
+ images/designer_undo.png \
+ images/designer_editbreaklayout.png \
+ images/designer_ibeam.png \
+ images/designer_redo.png \
+ images/designer_up.png \
+ images/designer_resetproperty.png \
+ images/designer_editcopy.png \
+ images/designer_iconview.png \
+ images/designer_resetproperty.png \
+ images/designer_uparrow.png \
+ images/designer_editcut.png \
+ images/designer_image.png \
+ images/designer_richtextedit.png \
+ images/designer_vsplit.png \
+ images/designer_editdelete.png \
+ images/designer_label.png \
+ images/designer_right.png \
+ images/designer_wait.png \
+ images/designer_editgrid.png \
+ images/designer_layout.png \
+ images/designer_scrollbar.png \
+ images/designer_widgetstack.png \
+ images/designer_edithlayout.png \
+ images/designer_lcdnumber.png \
+ images/designer_searchfind.png \
+ images/designer_folder.png \
+ images/designer_setbuddy.png \
+ images/designer_textbold.png \
+ images/designer_textcenter.png \
+ images/designer_texth1.png \
+ images/designer_texth2.png \
+ images/designer_texth3.png \
+ images/designer_textitalic.png \
+ images/designer_textjustify.png \
+ images/designer_textlarger.png \
+ images/designer_textleft.png \
+ images/designer_textlinebreak.png \
+ images/designer_textparagraph.png \
+ images/designer_textright.png \
+ images/designer_textsmaller.png \
+ images/designer_textteletext.png \
+ images/designer_textunderline.png \
+ images/designer_wizarddata.png \
+ images/designer_wizarddialog.png \
+ images/designer_d_adjustsize.png \
+ images/designer_d_label.png \
+ images/designer_d_book.png \
+ images/designer_d_layout.png \
+ images/designer_d_buttongroup.png \
+ images/designer_d_lcdnumber.png \
+ images/designer_d_checkbox.png \
+ images/designer_d_left.png \
+ images/designer_d_combobox.png \
+ images/designer_d_line.png \
+ images/designer_d_connecttool.png \
+ images/designer_d_lineedit.png \
+ images/designer_d_customwidget.png \
+ images/designer_d_listbox.png \
+ images/designer_d_databrowser.png \
+ images/designer_d_listview.png \
+ images/designer_d_datatable.png \
+ images/designer_d_multilineedit.png \
+ images/designer_d_dataview.png \
+ images/designer_d_newform.png \
+ images/designer_d_dateedit.png \
+ images/designer_d_ordertool.png \
+ images/designer_d_datetimeedit.png \
+ images/designer_d_pixlabel.png \
+ images/designer_d_dial.png \
+ images/designer_d_pointer.png \
+ images/designer_d_down.png \
+ images/designer_d_print.png \
+ images/designer_d_editbreaklayout.png \
+ images/designer_d_progress.png \
+ images/designer_d_editcopy.png \
+ images/designer_d_project.png \
+ images/designer_d_editcut.png \
+ images/designer_d_pushbutton.png \
+ images/designer_d_editdelete.png \
+ images/designer_d_radiobutton.png \
+ images/designer_d_editgrid.png \
+ images/designer_d_redo.png \
+ images/designer_d_edithlayout.png \
+ images/designer_d_richtextedit.png \
+ images/designer_d_edithlayoutsplit.png \
+ images/designer_d_right.png \
+ images/designer_d_editlower.png \
+ images/designer_d_scrollbar.png \
+ images/designer_d_editpaste.png \
+ images/designer_d_searchfind.png \
+ images/designer_d_editraise.png \
+ images/designer_d_slider.png \
+ images/designer_d_editslots.png \
+ images/designer_d_spacer.png \
+ images/designer_d_editvlayout.png \
+ images/designer_d_spinbox.png \
+ images/designer_d_editvlayoutsplit.png \
+ images/designer_d_table.png \
+ images/designer_d_filenew.png \
+ images/designer_d_folder.png \
+ images/designer_d_tabwidget.png \
+ images/designer_d_fileopen.png \
+ images/designer_d_textbrowser.png \
+ images/designer_d_filesave.png \
+ images/designer_d_textedit.png \
+ images/designer_d_form.png \
+ images/designer_d_textview.png \
+ images/designer_d_frame.png \
+ images/designer_d_timeedit.png \
+ images/designer_d_groupbox.png \
+ images/designer_d_toolbutton.png \
+ images/designer_d_toolbox.png \
+ images/designer_d_help.png \
+ images/designer_d_undo.png \
+ images/designer_d_home.png \
+ images/designer_d_up.png \
+ images/designer_d_iconview.png \
+ images/designer_d_widgetstack.png \
+ images/designer_d_setbuddy.png \
+ images/designer_d_textbold.png \
+ images/designer_d_texth1.png \
+ images/designer_d_texth2.png \
+ images/designer_d_texth3.png \
+ images/designer_d_textitalic.png \
+ images/designer_d_textjustify.png \
+ images/designer_d_textlarger.png \
+ images/designer_d_textleft.png \
+ images/designer_d_textlinebreak.png \
+ images/designer_d_textparagraph.png \
+ images/designer_d_textright.png \
+ images/designer_d_textsmaller.png \
+ images/designer_d_textteletext.png \
+ images/designer_d_textunderline.png \
+ images/designer_d_textcenter.png \
+ images/designer_d_wizarddata.png \
+ images/designer_d_wizarddialog.png \
+ images/designer_s_editcut.png \
+ images/designer_s_up.png \
+ images/designer_s_down.png \
+ images/designer_s_left.png \
+ images/designer_s_right.png \
+ images/designer_d_image.png \
+ images/designer_d_textfont.png \
+ images/designer_textfont.png \
+ images/designer_object.png \
+ images/designer_appicon.png \
+ images/designer_wordwrap.png \
+ images/designer_d_wordwrap.png
+
+
+OBJECTS_DIR = .
+
+DEPENDPATH += $$QT_SOURCE_TREE/include
+VERSION = 1.0.0
+DESTDIR = $$QT_BUILD_TREE/lib
+
+aix-g++ {
+ QMAKE_CFLAGS += -mminimal-toc
+ QMAKE_CXXFLAGS += -mminimal-toc
+}
+
+sql {
+ SOURCES += database.cpp dbconnectionimpl.cpp dbconnectionsimpl.cpp
+ HEADERS += database.h dbconnectionimpl.h dbconnectionsimpl.h
+ FORMS += dbconnections.ui dbconnection.ui dbconnectioneditor.ui
+}
+
+table {
+ HEADERS += tableeditorimpl.h
+ SOURCES += tableeditorimpl.cpp
+ FORMS += tableeditor.ui
+}
+
+INCLUDEPATH += ../shared ../uilib
+LIBS += -L$$QT_BUILD_TREE/lib -lqui
+
+hpux-acc* {
+ LIBS += $$QT_BUILD_TREE/lib/libtqassistantclient.a
+}
+
+!hpux-acc* {
+ LIBS += -ltqassistantclient
+}
+
+TRANSLATIONS = designer_de.ts designer_fr.ts
+
+target.path=$$libs.path
+INSTALLS += target
+
+templates.path=$$data.path/templates
+templates.files = ../templates/*
+INSTALLS += templates
+
+designertranlations.files = *.qm
+designertranlations.path = $$translations.path
+INSTALLS += designertranlations
+
+!macx-g++:PRECOMPILED_HEADER = designer_pch.h
diff --git a/tqtinterface/qt4/tools/designer/designer/designer_de.ts b/tqtinterface/qt4/tools/designer/designer/designer_de.ts
new file mode 100644
index 0000000..4fd54de
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designer_de.ts
@@ -0,0 +1,4969 @@
+<!DOCTYPE TS><TS>
+<context encoding="UTF-8">
+ <name>AboutDialog</name>
+ <message encoding="UTF-8">
+ <source>Qt Designer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Version 2.0</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Copyright (C) 2000-2008 Trolltech AS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;p&gt;This program is licensed to you under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation. This gives you legal permission to copy, distribute and/or modify this software under certain conditions. For details, see the file &apos;COPYING&apos; that came with this software distribution. If you did not get the file, send email to info@trolltech.com.&lt;/p&gt;
+&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ActionEditor</name>
+ <message>
+ <source>Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New &amp;Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Action &amp;Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New &amp;Dropdown Action Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ActionEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create new Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete current Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connect current action</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ActionListView</name>
+ <message>
+ <source>New &amp;Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Action &amp;Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New &amp;Dropdown Action Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Connect Action...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ConnectionEditor</name>
+ <message>
+ <source>Signals (%1):</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect/Disconnect Q_SIGNALS and Q_SLOTS of &apos;%1&apos; and &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ConnectionEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Connections&lt;/b&gt;&lt;p&gt;Add and remove connections in the current form .&lt;/p&gt;&lt;p&gt;Select a signal and a corresponding slot and press the &lt;b&gt;Connect&lt;/b&gt;-button to create a connection.&lt;/p&gt;&lt;p&gt;Select a connection from the list and press the &lt;b&gt;Disconnect&lt;/b&gt;-button to delete the connection.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sender</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Receiver</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays the connections between the sender and the receiver.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Si&amp;gnals:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;A list of Q_SLOTS for the receiver.&lt;/b&gt;&lt;p&gt;Only those Q_SLOTS are displayed that have arguments corresponding with the signal selected in the Signal-list.&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connec&amp;tions:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;nnect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create the connection between signal and slot.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Disconnect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Remove selected connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Remove the selected connection.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Edit Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays a list of Q_SIGNALS for the emitting widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Slots:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ConnectionViewer</name>
+ <message>
+ <source>Remove connection between %1 and %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ConnectionViewerBase</name>
+ <message encoding="UTF-8">
+ <source>View Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;View Connections&lt;/b&gt;&lt;p&gt;Displays all connections in the current form Select a connection from the list and click the &lt;b&gt;Edit&lt;/b&gt;-button to change the connection.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close the Dialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sender</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Receiver</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Displays a list of connections.&lt;/b&gt;&lt;p&gt;Select a connection and choose edit, or double-click on an item to change the connection.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Edit connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Opens a dialog to change the selected connection.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Disconnect</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>CreateTemplate</name>
+ <message encoding="UTF-8">
+ <source>Create Template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Template &amp;Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Name of the new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter the name of the new template here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Class of the new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the class which should be used as baseclass for the new template here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>C&amp;reate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Creates the new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Closes the Dialog</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Baseclass for Template:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CustomWidgetEditor</name>
+ <message>
+ <source>Adding a Custom Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>There exists already a custom widget with the name &apos;%1&apos;,
+so it is not possible to add another one with this name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Removing Custom Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The custom widget &apos;%1&apos; is currently used, so it can&apos;t be removed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Header Files (*.h *.h++ *.hxx *.hh)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Renaming a Custom Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The name &apos;%1&apos; is already use by another custom widget,
+so it is not possible to rename it to this name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Custom-Widget Description (*.cw);;All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>CustomWidgetEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Custom Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Custom Widgets&lt;/b&gt;&lt;p&gt;Add and remove custom widgets to the designer&apos;s database, and change the properties of existing widgets.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of all custom widgets known to the designer.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new custom widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Create an empty custom widget and add it to the list.&lt;/b&gt;&lt;p&gt;New custom widgets have a default name and header-file, which must both be provided.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete custom widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the selected custom widget.&lt;/b&gt;&lt;p&gt;You can only delete widgets that are not used in any open form.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Closes the Dialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Load Descriptions...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Loads widget description file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Load Descriptions&lt;/b&gt;&lt;p&gt;Loads a file which tqcontains descriptions of custom widgets, so that these custom widgets can be used in the Qt Designer.&lt;/p&gt;
+&lt;p&gt;As it is a lot of work to type in all the information for custom widgets, you should check the tool createcw which you can tqfind in $QTDIR/tools/designer/tools/createcw. Using that tool you can create custom widget description files for your custom widgets without the need of typing in all that information. For more information about that see the README file in that directory&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Save Descriptions...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Saves widget description file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Save Descriptions&lt;/b&gt;&lt;p&gt;Saves all descriptions of the shown custom widgets to file which can be used to import these custom widgets somewhere else.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change properties for the selected custom widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>De&amp;finition</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file.&lt;/b&gt;&lt;p&gt;The pixmap will be used to represent the widget in forms.&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the headerfile&apos;s name for the selected custom widget.&lt;/b&gt;&lt;p&gt;The headerfile will be included by forms using the widget.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose headerfile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Look for the headerfile in a filedialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Global</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Local</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change how the include file will be included.&lt;/b&gt;&lt;p&gt;Global include-files will be included using &amp;lt;&amp;gt;-brackets, while local files will included using quotation marks.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change classname</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the classname for the selected customwidget.&lt;/b&gt;&lt;p&gt;A class of that name has to be defined in the headerfile.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Heade&amp;rfile:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Cl&amp;ass:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Si&amp;ze Hint:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size P&amp;olicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Fixed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Minimum</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Maximum</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Preferred</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>MinimumExpanding</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Expanding</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Horizontal Sizepolicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the horizontal sizepolicy here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size hint width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Set the sizehint for the selected widget.&lt;/b&gt;&lt;p&gt;The sizehint provides the recommended size for the widget. Enter a sizehint of -1/-1 if no size is recommended.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size hint height</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Vertical Sizepolicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the verical sizepolicy for the widget here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Con&amp;tainer Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Container Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;p&gt;&lt;b&gt;Container Widget&lt;/b&gt;&lt;/p&gt;
+&lt;p&gt;If this customwidget should be able to contain other widgets (tqchildren), check this checkbox.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Si&amp;gnals</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of all Q_SIGNALS the selected widget can emit.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>N&amp;ew Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new signal for the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal&apos;s name, and the name has to be unique.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dele&amp;te Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the signal.&lt;/b&gt;&lt;p&gt;All connections using this signal will be deleted, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>S&amp;ignal:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change signal name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal&apos;s name, and the name has to be unique.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>S&amp;lots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of all Q_SLOTS of the selected custom widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sl&amp;ot:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Access:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>public</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the access policy of the slot.&lt;/b&gt;&lt;p&gt;You can only connect to public Q_SLOTS of the widget.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>N&amp;ew Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new slot to the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal&apos;s name, and the name has to be unique.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dele&amp;te Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the slot.&lt;/b&gt;&lt;p&gt;All connections using this slot will be deleted, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>N&amp;ew Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new property to the current customwidget.&lt;/b&gt;&lt;p&gt;The properties have to be implemented in the class using the property system of Qt.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dele&amp;te Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Deletes the selected property.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>String</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>CString</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>StringList</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Bool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Int</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>UInt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Font</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Rect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Point</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Cursor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>SizePolicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select property type</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select the type of the property.&lt;/b&gt;&lt;p&gt;The propertiy has to be implemented in the class using the property system of Qt.&lt;/p&gt;&lt;p&gt;You can use integer types to support enumeration properties in the property editor.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Type</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;The list of properties of the current custom widget.&lt;/b&gt;&lt;p&gt;The properties of the custom widget can be changed in the property editor.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change property name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter a name for the property.&lt;/b&gt;&lt;p&gt;The properties have to be implemented in the class using the property system of Qt.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>P&amp;roperty Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>T&amp;ype:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>DatabaseConnectionBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Database Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Conn&amp;ection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connec&amp;t</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>DatabaseConnectionEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Connect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connection Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>DatabaseConnectionWidget</name>
+ <message encoding="UTF-8">
+ <source>Edit Database Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Database Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Username:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Password:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>D&amp;river</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Hostname:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>P&amp;ort</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>EditSlots</name>
+ <message>
+ <source>Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add/Remove Q_SLOTS of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Q_SLOTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Q_SLOTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Some syntatically wrong Q_SLOTS defined.
+Remove these Q_SLOTS?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>EditSlotsBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Slots&lt;/b&gt;&lt;p&gt;Add, change and remove Q_SLOTS of the current form.&lt;/p&gt;&lt;p&gt;Press the &lt;b&gt;Add Slot&lt;/b&gt;-button to create a new slot, enter a slot name and choose an access mode.&lt;/p&gt;&lt;p&gt;Select an entry from the list and press the &lt;b&gt;Delete Slot&lt;/b&gt;-button to remove a slot. All connections using this slot will be removed, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Type</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Specifier</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>In Use</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;This form&apos;s slots.&lt;/b&gt;&lt;p&gt;Select the slot you want to change or delete.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new slot.&lt;/b&gt;&lt;p&gt;New Q_SLOTS have a default name and public access.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the selected slot.&lt;/b&gt;&lt;p&gt;All connections using this slot are removed, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Slot:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;The name should include the argument list and has to be syntactically correct.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Return type:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>S&amp;pecifier:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>non virtual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>virtual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>pure virtual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the access policy of the slot&lt;/b&gt;&lt;p&gt;All Q_SLOTS will be created virtual and should be reimplemented in subclasses.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Access:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>public</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>private</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>EventList</name>
+ <message>
+ <source>New Signal Handler</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete Signal Handler</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>FindDialog</name>
+ <message encoding="UTF-8">
+ <source>Find Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Direction</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Forwar&amp;d</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Backward</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Whole words only</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Case sensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Start at &amp;Beginning</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FormDefinitionView</name>
+ <message>
+ <source>Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>private</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>public</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Properties...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Goto Implementation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit...<byte value="x9"/>Alt+V</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Class Variables</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FormFile</name>
+ <message>
+ <source>Failed to save file %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 saved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt User-Interface Files (*.ui)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save form &apos;%1&apos; as ....</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes to the form &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The file %1 has been changed outside Qt Designer.
+Do you want to reload it?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Invalid Filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The project tqcontains already a form with the
+filename &apos;%1&apos;. Please choose a new filename.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>FormSettingsBase</name>
+ <message encoding="UTF-8">
+ <source>Form Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Form Settings&lt;/b&gt;&lt;p&gt;Change settings for the form. Settings like &lt;b&gt;Comment&lt;/b&gt; and &lt;b&gt;Author&lt;/b&gt; are for personal use and not required.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmaps</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Save In&amp;line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Save pixmaps into the .ui files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Save Inline&lt;/b&gt;&lt;p&gt;Saves the pixmaps you choose as binary data into the .ui files. Pixmaps are not shared between forms. We recommend using Project Imagefiles instead.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Project &amp;Imagefile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use the Project&apos;s Image file to load pixmaps</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Use the Project&apos;s Image file to open pixmaps&lt;/b&gt;
+&lt;p&gt;Each project has a collection of pixmaps. If you use a project, we recommend that you use this option since it shares images and is the fastest and most efficient way to use pixmaps in your forms.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Specify Pixmap-Loader function (only function-name, no parentheses!)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Specify Pixmap-Loader function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for loading a pixmap in the generated code. &lt;em&gt;Only enter the function-name, no parentheses!&lt;/em&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use &amp;Function:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a defined function to load pixmaps</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Use a defined function to open pixmaps&lt;/b&gt;&lt;p&gt;If you choose this option you must define a function in the line edit at the right which will be used in the generated code for loading pixmaps. When choosing a pixmap in &lt;i&gt;Qt Designer&lt;/i&gt; you will be asked to specify the arguments which will be passed to the function in the generated code.&lt;p&gt; This approach makes it possible to use your own icon-loader function for loading pixmaps. &lt;i&gt;Qt Designer&lt;/i&gt; can&apos;t preview the correct image if you use your own function.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change class name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the name of the class that will be created.&lt;/b&gt;&lt;p&gt;&lt;em&gt;classname.h&lt;/em&gt; and &lt;em&gt;classname.cpp&lt;/em&gt; will be generated as C++-output when it is compiled with the uic.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>A&amp;uthor:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter your name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter your name here.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Class &amp;Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;mment:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter a comment about the form.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>La&amp;youts</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Default Mar&amp;gin:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>D&amp;efault Spacing:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FormWindow</name>
+ <message>
+ <source>Set &apos;name&apos; property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The name of a widget has to be unique!
+&apos;%1&apos; is already used in the form &apos;%2&apos;,
+so the name has been changed back to &apos;%3&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The name of a widget must not be null!
+The name has been changed back to &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Horizontal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Vertical</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;A %1 (custom widget)&lt;/b&gt; &lt;p&gt;Select &lt;b&gt;Edit Custom Widgets...&lt;/b&gt; in the &lt;b&gt;Tools-&gt;Custom&lt;/b&gt; menu to add and change the custom widgets. You can add properties as well as Q_SIGNALS and Q_SLOTS to integrate them into the designer, and provide a pixmap which will be used to represent the widget on the form.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A %1 (custom widget)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Retqparent Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect &apos;%1&apos; with...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Change Tab Order</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1/%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect &apos;%1&apos; with &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Inserting a Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>You tried to insert a widget into the laid out Container Widget &apos;%1&apos;.
+This is not possible. In order to insert the widget, the tqlayout of &apos;%1&apos;
+has to be broken. Break the tqlayout or cancel the operation?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Use Size Hint</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjust Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click widgets to change tab order...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Drag a line to create a connection...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click on the form to insert a %1...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Following custom widgets are used in &apos;%1&apos;,
+but they are not known to the designer:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lower</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Check Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The accelerator &apos;%1&apos; is used %2 times.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Select</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No accelerator is used more than once!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Raise</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout horizontally (in splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout vertically (in splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout in a grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout tqchildren horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout tqchildren vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout tqchildren in a grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit connections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>GotoLineDialog</name>
+ <message encoding="UTF-8">
+ <source>Goto Line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Line:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Goto</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>HierarchyList</name>
+ <message>
+ <source>Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Class</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Database</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page to %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>HierarchyView</name>
+ <message>
+ <source>Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Classes</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>IconViewEditor</name>
+ <message>
+ <source>New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Items of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>IconViewEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Iconview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Iconview&lt;/b&gt;&lt;p&gt;Add, change and remove items in the icon view.&lt;/p&gt;&lt;p&gt;Press the &lt;b&gt;New Item&lt;/b&gt;-button to create a new entry, and enter a text or choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the view and press the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the view.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>All items in the view.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add an item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create a new item for the view.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Item Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change the text for the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the pixmap of the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a pixmap-file for the current item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ListBoxEditor</name>
+ <message>
+ <source>New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Items of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ListBoxEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Listbox</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Listbox&lt;/b&gt;&lt;p&gt;Add, change and remove items in the listbox.&lt;/p&gt;&lt;p&gt;Press the &lt;b&gt;New Item&lt;/b&gt;-button to create a new listbox entry, and enter text or choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and press the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of items.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Item Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the pixmap of the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a pixmap-file for the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change the text of the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add an item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new item.&lt;/b&gt;&lt;p&gt;New items are appended to the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the selected item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move up</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Moves the selected item up.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move down</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move the selected item down.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ListEditor</name>
+ <message encoding="UTF-8">
+ <source>Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Column 1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Re&amp;name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ListViewEditor</name>
+ <message>
+ <source>Edit Items and Columns of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Items</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ListViewEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Listview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Listview&lt;/b&gt;&lt;p&gt;Use the controls on the &lt;b&gt;Items&lt;/b&gt;-tab to add, change and remove items in the listview. Change the column configuration of the view using the controls on the &lt;b&gt;Columns&lt;/b&gt;-tab.&lt;/p&gt;Press the &lt;b&gt;New Item&lt;/b&gt;-button to create a new item and enter a text or provide a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and press the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Items</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Deletes the selected item.&lt;/b&gt;&lt;p&gt;Existing subitems are deleted, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Item &amp;Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pi&amp;xmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the text of the item.&lt;/b&gt;&lt;p&gt;The text will be changed in the current column of the selected item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select the current column.&lt;/b&gt;&lt;p&gt;Itemtext and pixmap will be changed for the current column&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Colu&amp;mn:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the pixmap of the selected item.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add an item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Adds a new item to the list.&lt;/b&gt;&lt;p&gt;The item will be inserted at the top of the list and can be moved using the up- and down-buttons.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of items.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>New &amp;Subitem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add a subitem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Create a new subitem for the selected item.&lt;/b&gt;&lt;p&gt;New subitems are inserted at the top of the list of subitems, and new levels will be created automatically.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move up</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The item will be moved within the hierarchy level.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move down</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The item will be moved within the hierarchy level.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item one level up.&lt;/b&gt;&lt;p&gt;This will also change the level of the tqparent item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item one level down.&lt;/b&gt;&lt;p&gt;This will also change the level of the tqparent item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;lumns</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Column Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the pixmap of the selected column.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file for the selected column.&lt;/b&gt;&lt;p&gt;The pixmap will be displayed in the header of the listview.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter column text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the text for the selected column.&lt;/b&gt;&lt;p&gt;The text will be displayed in the header of the listview.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Clicka&amp;ble</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>If this option is checked, the selected column will react on mouseclicks on the header.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Re&amp;sizable</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The column&apos;s width will be resizeable if this option is checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Deletes the selected Column.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add a Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Create a new column.&lt;/b&gt;&lt;p&gt;New columns are appended to the list and may be moved using the up- and down-buttons.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of columns.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Qt User-Interface Files (*.ui)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ready - This is the non-commercial version of Qt - For commercial evaluation purposes, use the help menu to register with Trolltech.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Property Editor/Signal Handlers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Property Editor&lt;/b&gt;&lt;p&gt;You can change the appearance and behaviour of the selected widget in the property editor.&lt;/p&gt;&lt;p&gt;You can set properties for components and forms at design time and see the changes immediately. Each property has its own editor which you can use to enter new values, open a special dialog or select values from a predefined list. Use &lt;b&gt;F1&lt;/b&gt; to get detailed help for the selected property.&lt;/p&gt;&lt;p&gt;You can resize the columns of the editor by dragging the separators of the list header.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Signal Handlers&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In the Signal Handlers tab you can define connections between Q_SIGNALS of widgets and Q_SLOTS of the form. That is just a convenience way, you can use the connection tool to do that as well.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Output Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Object Explorer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Object Explorer&lt;/b&gt;&lt;p&gt;The object explorer gives a quick overview about the relations between the widgets in your form. You can use the clipboard functions using a context menu for each item in the view.&lt;/p&gt;&lt;p&gt;The columns can be resized by dragging the separator in the list header.&lt;/p&gt;&lt;p&gt;On the second tab you can see all the declared Q_SLOTS, variables, includes, etc. of the form.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Start typing the buffer you want to switch to here (ALT+B)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File Overview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The File Overview box&lt;/b&gt;&lt;p&gt;The File Overview Box displays all files of all projects, including forms and source files.&lt;/p&gt;&lt;p&gt;Its search field allows rapid switching between files.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Action Editor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Action Editor&lt;/b&gt;&lt;p&gt;Todo Whatsthis&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Couldn&apos;t tqfind the Qt documentation property index file!
+Define the correct documentation path in the preferences dialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Form Window&lt;/b&gt;&lt;p&gt;Use the different tools to add widgets or to change the tqlayout and behaviour of the components in your form. Select one or multiple widgets and move them, or resize a single widget using the handles.&lt;/p&gt;&lt;p&gt;Changes in the &lt;b&gt;Property Editor&lt;/b&gt; can be seen at design time, and you can open a preview of your form in different styles.&lt;/p&gt;&lt;p&gt;You can change the grid resolution, or turn the grid off in the &lt;b&gt;Preferences&lt;/b&gt; dialog in the &lt;b&gt;Edit&lt;/b&gt; menu.&lt;p&gt;You can have several forms open, and all open forms are listed in the &lt;b&gt;Form List&lt;/b&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot create invalid project.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo: Not Available</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo: Not Available</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose Pixmap...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Text...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Title...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Page Title...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Pages...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Menu Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Toolbar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;text&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;title&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Page Title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New page title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;pageTitle&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;pixmap&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page to %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Toolbar to &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Menu to &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Project Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes to &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit %1...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restoring last session</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Qt Designer found some temporary saved files, which have been
+written when the Qt Designer crashed last time. Do you want to
+load these files?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>There is no help available for this dialog at the moment.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Could not open &apos;%1&apos;. File does not exist.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reverses the last action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redoes the last undone operation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cut</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cu&amp;t</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cuts the selected widgets and puts them on the clipboard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copies the selected widgets to the clipboard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pastes clipboard contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Deletes the selected widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects all widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bring to Front</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bring to &amp;Front</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Raises the selected widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Send to Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Send to &amp;Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lowers the selected widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Check Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Chec&amp;k Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Checks if the accelerators used in the form are unique</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>S&amp;lots...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit Q_SLOTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Co&amp;nnections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Source...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens an editor to edit the source of the form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Form Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Form Settings...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change the settings of the form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change preferences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Edit toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Find...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find Incremental</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find &amp;Incremental</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Replace...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Goto Line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Goto Line...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Incremetal Search (ALT+I)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Search</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjust Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjust &amp;Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjusts the size of the selected widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out &amp;Horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out &amp;Vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out in a Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out in a &amp;Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets in a grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Horizontally (in Splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Horizontally (in S&amp;plitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets horizontally in a splitter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Vertically (in Splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Vertically (in Sp&amp;litter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets vertically in a splitter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Breaks the selected tqlayout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert a %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Layout toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pointer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Pointer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects the pointer tool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect Signal/Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Connect Signal/Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects the connection tool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab Order</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab &amp;Order</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects the tab order tool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Tools toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tools</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Tools</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Custom Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit &amp;Custom Widgets...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change the custom widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The %1&lt;/b&gt;%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Click on a button to insert a single widget, or double click to insert multiple %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The %1 Widgets&lt;/b&gt;%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Click on a button to insert a single %1 widget, or double click to insert multiple widgets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;Double click on this tool to keep it selected.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Custom Widgets toolbar&lt;/b&gt;%1&lt;p&gt;Select &lt;b&gt;Edit Custom Widgets...&lt;/b&gt; in the &lt;b&gt;Tools-&gt;Custom&lt;/b&gt; menu to add and change custom widgets&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Click on the buttons to insert a single widget, or double click to insert multiple widgets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The File toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;New...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Creates a new project, form or source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens an existing project, form for source file </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Closes the current project or document</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Saves the current project or document</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save As</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save &amp;As...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Saves the current form with a new filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sa&amp;ve All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Saves all open documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create Template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create &amp;Template...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Creates a new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Recently opened files </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Recently opened projects</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Exit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E&amp;xit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quits the application and prompts to save changed forms, source files and project settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pr&amp;oject</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Active Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;No Project&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Add File...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adds a file to the current project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Image Collection...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Image Collection...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit the image collection of the current project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Database Connections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Database Connections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit the database connections of the current project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Project Settings...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Project Settings...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change the settings of the project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preview Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preview &amp;Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Motif Look&amp;Feel used as the default style on most UNIX-Systems.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Windows Look&amp;Feel used as the default style on Windows-Systems.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Platinum Look&amp;Feel resembling a Macinosh-like GUI style.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the CDE Look&amp;Feel which is similar to some versions of the Common Desktop Environment.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Motif Look&amp;Feel used as the default style on SGI-systems.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use an advanced Motif Look&amp;Feel as used by the GIMP toolkit (GTK) on Linux.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preview Form in %1 Style</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>... in %1 Style</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a preview in %1 style</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Open a preview in %1 style.&lt;/b&gt;&lt;p&gt;Use the preview to test the design and signal-slot connections of the current form. %2&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Tile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Arranges all windows tiled</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cascade</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cascade</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Arrange all windows cascaded</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cl&amp;ose</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Closes the active window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close Al&amp;l</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Closes all form windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ne&amp;xt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Activates the next window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Previous</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pre&amp;vious</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Activates the previous window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Vie&amp;ws</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tool&amp;bars</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens the online help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens the Qt Designer manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Displays information about this product</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About &amp;Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Displays information about the Qt Toolkit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Register Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Register Qt...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Launches web browser with evaluation form at www.trolltech.com</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Register with Trolltech</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>What&apos;s This?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&quot;What&apos;s This?&quot; context sensitive help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Help toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select new item ...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select a file...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Designer Files (*.ui *.pro)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>QMAKE Project Files (*.pro)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No import filter available for %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Importing %1 using import filter ...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Nothing to load in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reading file %1...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File %1 opened.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Failed to load file %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Load File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Couldn&apos;t load file %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Project &apos;%1&apos; saved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enter a filename...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer is crashing - attempting to save work...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NewTemplate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Couldn&apos;t create the template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Q_SLOTS of current form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit connections in current form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit settings of current form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit preferences...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit custom widgets...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Column 1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab 1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab 2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Load Template</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MultiLineEditor</name>
+ <message>
+ <source>Set text of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>MultiLineEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Multiline Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Multiline Edit&lt;/b&gt;&lt;p&gt;Enter the text and press the &lt;b&gt;OK&lt;/b&gt;-Button to apply the changes.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter your text here.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>NewForm</name>
+ <message>
+ <source>Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Dialog</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Wizard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Main Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>NewFormBase</name>
+ <message encoding="UTF-8">
+ <source>New File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;New Form&lt;/b&gt;&lt;p&gt;Select a template for the new form and click the &lt;b&gt;OK&lt;/b&gt;-button to open it.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Open a new form using the selected template.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and do not open a form.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays a list of available templates.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Insert into:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OutputWindow</name>
+ <message>
+ <source>Error Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Message</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Line</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PaletteEditorAdvancedBase</name>
+ <message encoding="UTF-8">
+ <source>Tune Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Palette&lt;/b&gt;&lt;p&gt;Change the palette of the current widget or form.&lt;/p&gt;&lt;p&gt;Use a generated palette or select colors for each color group and each color role.&lt;/p&gt;&lt;p&gt;The palette can be tested with different widget layouts in the preview section.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select &amp;Palette:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Active Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Inactive Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Disabled Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Auto</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build inactive palette from active.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build disabled palette from active.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Central color &amp;roles</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Background</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Foreground</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Button</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Base</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>BrightText</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ButtonText</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Highlight</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>HighlightText</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Link</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>LinkVisited</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose central color role</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available central roles are: &lt;ul&gt; &lt;li&gt;Background - general background color.&lt;/li&gt; &lt;li&gt;Foreground - general foreground color. &lt;/li&gt; &lt;li&gt;Base - used as background color for e.g. text entry widgets, usually white or another light color. &lt;/li&gt; &lt;li&gt;Text - the forground color used with Base. Usually this is the same as the Foreground, in what case it must provide good contrast both with Background and Base. &lt;/li&gt; &lt;li&gt;Button - general button background color, where buttons need a background different from Background, as in the Macintosh style. &lt;/li&gt; &lt;li&gt;ButtonText - a foreground color used with the Button color. &lt;/li&gt; &lt;li&gt;Highlight - a color to indicate a selected or highlighted item. &lt;/li&gt; &lt;li&gt;HighlightedText - a text color that contrasts to Highlight. &lt;/li&gt; &lt;li&gt;BrightText - a text color that is very different from Foreground and contrasts well with e.g. black. &lt;/li&gt; &lt;/ul&gt; &lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose Pi&amp;xmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a pixmap-file for the selected central color role.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Select Color:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color for the selected central color role.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>3-D shadow &amp;effects</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build &amp;from button color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Generate shadings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Check to let 3D-effect colors be calculated from button-color.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Light</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Midlight</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Mid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dark</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Shadow</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose 3D-effect color role</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available effect roles are: &lt;ul&gt; &lt;li&gt;Light - lighter than Button color. &lt;/li&gt; &lt;li&gt;Midlight - between Button and Light. &lt;/li&gt; &lt;li&gt;Mid - between Button and Dark. &lt;/li&gt; &lt;li&gt;Dark - darker than Button. &lt;/li&gt; &lt;li&gt;Shadow - a very dark color. &lt;/li&gt; &lt;/ul&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select Co&amp;lor:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color for the selected effect color role.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PaletteEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;3-D Effects:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the effect-color for the generated palette.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Back&amp;ground:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the background color for the generated palette.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Tune Palette...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select &amp;Palette:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Active Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Inactive Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Disabled Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PixmapCollectionEditor</name>
+ <message encoding="UTF-8">
+ <source>Manage Image Collection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Add...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose an Image</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PixmapFunction</name>
+ <message encoding="UTF-8">
+ <source>Choose Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Enter arguments for loading the pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>QPixmap(</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>Preferences</name>
+ <message encoding="UTF-8">
+ <source>Preferences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Preferences&lt;/b&gt;&lt;p&gt;Change the preferences of the designer application. There is always one tab with general preferenced. Depending on installed plugins, there might be more tabs for plugin preferences.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Backgro&amp;und</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a color in the colordialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;lor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background color.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background pixmap.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a pixmap-file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show &amp;Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Customize the grid appearance for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, all forms show a grid.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Gr&amp;id</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sn&amp;ap to Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Snap to the grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Snap to Grid&lt;/b&gt; is checked, the widgets snap to the grid using the the X/Y resolution.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Grid resolution</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, a grid is shown on all forms using the X/Y resolution.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Grid-&amp;X:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Grid-&amp;Y:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>A splashscreen is displayed when starting the designer if this option is checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Ge&amp;neral</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Restore Last &amp;Workspace on Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Restore last workspace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The current workspace settings will be restored next time you start the designer if this option is checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show &amp;Splash Screen on Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show Splashscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Disable Data&amp;base Auto-Edit in Preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Documentation Path:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the path to the documentation.&lt;/b&gt;&lt;p&gt;You may provide an $environment variable as first part of your pathname.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select path</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Look for the documentation path.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Toolbars</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show &amp;Big Icons</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Big Icons</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Uses big icons in the toolbars when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show Text Lab&amp;els</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Text Labels</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Shows textlabels in the toolbars when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PreviewWidgetBase</name>
+ <message encoding="UTF-8">
+ <source>Preview Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ButtonGroup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>RadioButton1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>RadioButton2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>RadioButton3</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ButtonGroup2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>CheckBox1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>CheckBox2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>LineEdit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ComboBox</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>PushButton</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;p&gt;
+&lt;a href=&quot;http://www.trolltech.com&quot;&gt; http://www.trolltech.com &lt;/a&gt;
+&lt;/p&gt;
+&lt;p&gt;
+&lt;a href=&quot;http://www.kde.org&quot;&gt; http://www.kde.org &lt;/a&gt;
+&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Project</name>
+ <message>
+ <source>&lt;No Project&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ProjectSettings</name>
+ <message>
+ <source>unnamed.pro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Database Files (*.db);;All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Project Files (*.pro);;All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ProjectSettingsBase</name>
+ <message encoding="UTF-8">
+ <source>Project Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Project File:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Description:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>For&amp;ms and Sources:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Database File:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyBoolItem</name>
+ <message>
+ <source>False</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>True</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyColorItem</name>
+ <message>
+ <source>Red</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Green</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Blue</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyCoordItem</name>
+ <message>
+ <source>x</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>y</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>height</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyCursorItem</name>
+ <message>
+ <source>Arrow</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Up-Arrow</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cross</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Waiting</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>iBeam</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Vertical</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Horizontal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Slash</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Backslash</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Blank</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Split Vertical</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Split Horizontal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pointing Hand</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Forbidden</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyDatabaseItem</name>
+ <message>
+ <source>Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Field</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyEditor</name>
+ <message>
+ <source>Reset property to its default value</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click this button to reset the property to its default value</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Property Editor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Signal Handlers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Property Editor (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyFontItem</name>
+ <message>
+ <source>Family</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Point Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bold</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Italic</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Underline</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Strikeout</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyList</name>
+ <message>
+ <source>Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Value</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;%1&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sort &amp;Categorized</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sort &amp;Alphabetically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reset &apos;%1&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;b&gt;QWidget::%1&lt;/b&gt;&lt;/p&gt;&lt;p&gt;There is no documentation available for this property.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertySizePolicyItem</name>
+ <message>
+ <source>hSizeType</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>vSizeType</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>horizontalStretch</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>verticalStretch</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1/%2/%2/%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyTextItem</name>
+ <message>
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QApplication</name>
+ <message>
+ <source>Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Could not connect to the database.
+Press &apos;OK&apos; to continue or &apos;Cancel&apos; to specify different
+connection information.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerMenuBar</name>
+ <message>
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename Item...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Menu &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename Menuitem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Menu Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename Menu &apos;%1&apos; to &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move menu &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerPopupMenu</name>
+ <message>
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert Separator</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Action &apos;%1&apos; from the Popup Menu &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Separator to the Popup Menu &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Action &apos;%1&apos; to the Popup Menu &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert/Move Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Action &apos;%1&apos; has already been added to this menu.
+An Action can only be added once to the same menu.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerTabWidget</name>
+ <message>
+ <source>Move Tab Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerToolBar</name>
+ <message>
+ <source>Delete Toolbar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Toolbar &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert Separator</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Action &apos;%1&apos; from Toolbar &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Separator to Toolbar &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Action &apos;%1&apos; to Toolbar &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert/Move Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Action &apos;%1&apos; has already been added to this toolbar.
+An Action can only be added once to the same toolbar.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Widget &apos;%1&apos; to Toolbar &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ReplaceDialog</name>
+ <message encoding="UTF-8">
+ <source>Replace Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>R&amp;eplace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Replace &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Whole words only</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Case sensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Start at Beginning</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Direction</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Forwar&amp;d</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Backward</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SizeHandle</name>
+ <message>
+ <source>%1/%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Resize</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SourceEditor</name>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SourceFile</name>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Code</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes to &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The file %1 has been changed outside Qt Designer.
+Do you want to reload it?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Invalid Filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The project tqcontains already a sourcefile with the
+filename &apos;%1&apos;. Please choose a new filename.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TableEditor</name>
+ <message>
+ <source>Edit Rows and Columns of &apos;%1&apos; </source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>TableEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;lumns</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move up</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move down</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Table:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the pixmap of the selected item.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Label:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Field:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;no table&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Row</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Row</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TextEditor</name>
+ <message>
+ <source>Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>WizardEditor</name>
+ <message>
+ <source>Edit Wizard Pages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page to %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Swap pages %1 and %2 of %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Page Title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New page title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>WizardEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Wizard Page Editor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Wizard Pages:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Workspace</name>
+ <message>
+ <source>Files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open source file...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Remove source file from project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Remove form from project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open form source...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>qChoosePixmap</name>
+ <message>
+ <source>All Pixmaps (</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1-Pixmaps (%2)
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>)
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose Images...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose a Pixmap...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tqtinterface/qt4/tools/designer/designer/designer_fr.ts b/tqtinterface/qt4/tools/designer/designer/designer_fr.ts
new file mode 100644
index 0000000..4fd54de
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designer_fr.ts
@@ -0,0 +1,4969 @@
+<!DOCTYPE TS><TS>
+<context encoding="UTF-8">
+ <name>AboutDialog</name>
+ <message encoding="UTF-8">
+ <source>Qt Designer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Version 2.0</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Copyright (C) 2000-2008 Trolltech AS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;p&gt;This program is licensed to you under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation. This gives you legal permission to copy, distribute and/or modify this software under certain conditions. For details, see the file &apos;COPYING&apos; that came with this software distribution. If you did not get the file, send email to info@trolltech.com.&lt;/p&gt;
+&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ActionEditor</name>
+ <message>
+ <source>Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New &amp;Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Action &amp;Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New &amp;Dropdown Action Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ActionEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create new Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete current Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connect current action</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ActionListView</name>
+ <message>
+ <source>New &amp;Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Action &amp;Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New &amp;Dropdown Action Group</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Connect Action...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ConnectionEditor</name>
+ <message>
+ <source>Signals (%1):</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect/Disconnect Q_SIGNALS and Q_SLOTS of &apos;%1&apos; and &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ConnectionEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Connections&lt;/b&gt;&lt;p&gt;Add and remove connections in the current form .&lt;/p&gt;&lt;p&gt;Select a signal and a corresponding slot and press the &lt;b&gt;Connect&lt;/b&gt;-button to create a connection.&lt;/p&gt;&lt;p&gt;Select a connection from the list and press the &lt;b&gt;Disconnect&lt;/b&gt;-button to delete the connection.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sender</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Receiver</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays the connections between the sender and the receiver.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Si&amp;gnals:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;A list of Q_SLOTS for the receiver.&lt;/b&gt;&lt;p&gt;Only those Q_SLOTS are displayed that have arguments corresponding with the signal selected in the Signal-list.&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connec&amp;tions:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;nnect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create the connection between signal and slot.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Disconnect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Remove selected connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Remove the selected connection.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Edit Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays a list of Q_SIGNALS for the emitting widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Slots:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ConnectionViewer</name>
+ <message>
+ <source>Remove connection between %1 and %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ConnectionViewerBase</name>
+ <message encoding="UTF-8">
+ <source>View Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;View Connections&lt;/b&gt;&lt;p&gt;Displays all connections in the current form Select a connection from the list and click the &lt;b&gt;Edit&lt;/b&gt;-button to change the connection.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close the Dialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sender</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Receiver</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Displays a list of connections.&lt;/b&gt;&lt;p&gt;Select a connection and choose edit, or double-click on an item to change the connection.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Edit connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Opens a dialog to change the selected connection.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Disconnect</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>CreateTemplate</name>
+ <message encoding="UTF-8">
+ <source>Create Template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Template &amp;Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Name of the new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter the name of the new template here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Class of the new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the class which should be used as baseclass for the new template here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>C&amp;reate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Creates the new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Closes the Dialog</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Baseclass for Template:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CustomWidgetEditor</name>
+ <message>
+ <source>Adding a Custom Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>There exists already a custom widget with the name &apos;%1&apos;,
+so it is not possible to add another one with this name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Removing Custom Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The custom widget &apos;%1&apos; is currently used, so it can&apos;t be removed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Header Files (*.h *.h++ *.hxx *.hh)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Renaming a Custom Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The name &apos;%1&apos; is already use by another custom widget,
+so it is not possible to rename it to this name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Custom-Widget Description (*.cw);;All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>CustomWidgetEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Custom Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Custom Widgets&lt;/b&gt;&lt;p&gt;Add and remove custom widgets to the designer&apos;s database, and change the properties of existing widgets.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of all custom widgets known to the designer.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new custom widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Create an empty custom widget and add it to the list.&lt;/b&gt;&lt;p&gt;New custom widgets have a default name and header-file, which must both be provided.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete custom widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the selected custom widget.&lt;/b&gt;&lt;p&gt;You can only delete widgets that are not used in any open form.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Closes the Dialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Load Descriptions...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Loads widget description file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Load Descriptions&lt;/b&gt;&lt;p&gt;Loads a file which tqcontains descriptions of custom widgets, so that these custom widgets can be used in the Qt Designer.&lt;/p&gt;
+&lt;p&gt;As it is a lot of work to type in all the information for custom widgets, you should check the tool createcw which you can tqfind in $QTDIR/tools/designer/tools/createcw. Using that tool you can create custom widget description files for your custom widgets without the need of typing in all that information. For more information about that see the README file in that directory&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Save Descriptions...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Saves widget description file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Save Descriptions&lt;/b&gt;&lt;p&gt;Saves all descriptions of the shown custom widgets to file which can be used to import these custom widgets somewhere else.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change properties for the selected custom widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>De&amp;finition</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file.&lt;/b&gt;&lt;p&gt;The pixmap will be used to represent the widget in forms.&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the headerfile&apos;s name for the selected custom widget.&lt;/b&gt;&lt;p&gt;The headerfile will be included by forms using the widget.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose headerfile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Look for the headerfile in a filedialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Global</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Local</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change how the include file will be included.&lt;/b&gt;&lt;p&gt;Global include-files will be included using &amp;lt;&amp;gt;-brackets, while local files will included using quotation marks.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change classname</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the classname for the selected customwidget.&lt;/b&gt;&lt;p&gt;A class of that name has to be defined in the headerfile.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Heade&amp;rfile:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Cl&amp;ass:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Si&amp;ze Hint:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size P&amp;olicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Fixed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Minimum</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Maximum</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Preferred</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>MinimumExpanding</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Expanding</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Horizontal Sizepolicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the horizontal sizepolicy here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size hint width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Set the sizehint for the selected widget.&lt;/b&gt;&lt;p&gt;The sizehint provides the recommended size for the widget. Enter a sizehint of -1/-1 if no size is recommended.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size hint height</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Vertical Sizepolicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the verical sizepolicy for the widget here</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Con&amp;tainer Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Container Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;p&gt;&lt;b&gt;Container Widget&lt;/b&gt;&lt;/p&gt;
+&lt;p&gt;If this customwidget should be able to contain other widgets (tqchildren), check this checkbox.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Si&amp;gnals</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of all Q_SIGNALS the selected widget can emit.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>N&amp;ew Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new signal for the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal&apos;s name, and the name has to be unique.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dele&amp;te Signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete signal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the signal.&lt;/b&gt;&lt;p&gt;All connections using this signal will be deleted, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>S&amp;ignal:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change signal name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal&apos;s name, and the name has to be unique.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>S&amp;lots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of all Q_SLOTS of the selected custom widget.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sl&amp;ot:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Access:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>public</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the access policy of the slot.&lt;/b&gt;&lt;p&gt;You can only connect to public Q_SLOTS of the widget.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>N&amp;ew Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new slot to the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal&apos;s name, and the name has to be unique.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dele&amp;te Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the slot.&lt;/b&gt;&lt;p&gt;All connections using this slot will be deleted, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>N&amp;ew Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new property to the current customwidget.&lt;/b&gt;&lt;p&gt;The properties have to be implemented in the class using the property system of Qt.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dele&amp;te Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Deletes the selected property.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>String</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>CString</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>StringList</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Bool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Int</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>UInt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Font</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Rect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Point</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Cursor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>SizePolicy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select property type</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select the type of the property.&lt;/b&gt;&lt;p&gt;The propertiy has to be implemented in the class using the property system of Qt.&lt;/p&gt;&lt;p&gt;You can use integer types to support enumeration properties in the property editor.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Type</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;The list of properties of the current custom widget.&lt;/b&gt;&lt;p&gt;The properties of the custom widget can be changed in the property editor.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change property name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter a name for the property.&lt;/b&gt;&lt;p&gt;The properties have to be implemented in the class using the property system of Qt.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>P&amp;roperty Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>T&amp;ype:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>DatabaseConnectionBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Database Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Conn&amp;ection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connec&amp;t</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>DatabaseConnectionEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Connect</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Connection Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>DatabaseConnectionWidget</name>
+ <message encoding="UTF-8">
+ <source>Edit Database Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Database Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Username:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Password:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>D&amp;river</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Hostname:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>P&amp;ort</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Default</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>EditSlots</name>
+ <message>
+ <source>Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add/Remove Q_SLOTS of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Q_SLOTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Q_SLOTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Some syntatically wrong Q_SLOTS defined.
+Remove these Q_SLOTS?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>EditSlotsBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Slots&lt;/b&gt;&lt;p&gt;Add, change and remove Q_SLOTS of the current form.&lt;/p&gt;&lt;p&gt;Press the &lt;b&gt;Add Slot&lt;/b&gt;-button to create a new slot, enter a slot name and choose an access mode.&lt;/p&gt;&lt;p&gt;Select an entry from the list and press the &lt;b&gt;Delete Slot&lt;/b&gt;-button to remove a slot. All connections using this slot will be removed, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Type</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Specifier</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>In Use</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;This form&apos;s slots.&lt;/b&gt;&lt;p&gt;Select the slot you want to change or delete.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add new slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new slot.&lt;/b&gt;&lt;p&gt;New Q_SLOTS have a default name and public access.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete slot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the selected slot.&lt;/b&gt;&lt;p&gt;All connections using this slot are removed, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Slot Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Slot:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;The name should include the argument list and has to be syntactically correct.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Return type:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>S&amp;pecifier:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>non virtual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>virtual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>pure virtual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change slot access</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the access policy of the slot&lt;/b&gt;&lt;p&gt;All Q_SLOTS will be created virtual and should be reimplemented in subclasses.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Access:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>public</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>private</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>EventList</name>
+ <message>
+ <source>New Signal Handler</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete Signal Handler</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>FindDialog</name>
+ <message encoding="UTF-8">
+ <source>Find Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Direction</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Forwar&amp;d</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Backward</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Whole words only</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Case sensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Start at &amp;Beginning</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FormDefinitionView</name>
+ <message>
+ <source>Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>private</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>protected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>public</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Properties...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Goto Implementation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit...<byte value="x9"/>Alt+V</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Class Variables</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FormFile</name>
+ <message>
+ <source>Failed to save file %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 saved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt User-Interface Files (*.ui)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save form &apos;%1&apos; as ....</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes to the form &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The file %1 has been changed outside Qt Designer.
+Do you want to reload it?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Invalid Filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The project tqcontains already a form with the
+filename &apos;%1&apos;. Please choose a new filename.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>FormSettingsBase</name>
+ <message encoding="UTF-8">
+ <source>Form Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Form Settings&lt;/b&gt;&lt;p&gt;Change settings for the form. Settings like &lt;b&gt;Comment&lt;/b&gt; and &lt;b&gt;Author&lt;/b&gt; are for personal use and not required.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmaps</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Save In&amp;line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Save pixmaps into the .ui files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Save Inline&lt;/b&gt;&lt;p&gt;Saves the pixmaps you choose as binary data into the .ui files. Pixmaps are not shared between forms. We recommend using Project Imagefiles instead.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Project &amp;Imagefile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use the Project&apos;s Image file to load pixmaps</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Use the Project&apos;s Image file to open pixmaps&lt;/b&gt;
+&lt;p&gt;Each project has a collection of pixmaps. If you use a project, we recommend that you use this option since it shares images and is the fastest and most efficient way to use pixmaps in your forms.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Specify Pixmap-Loader function (only function-name, no parentheses!)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Specify Pixmap-Loader function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for loading a pixmap in the generated code. &lt;em&gt;Only enter the function-name, no parentheses!&lt;/em&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use &amp;Function:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a defined function to load pixmaps</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Use a defined function to open pixmaps&lt;/b&gt;&lt;p&gt;If you choose this option you must define a function in the line edit at the right which will be used in the generated code for loading pixmaps. When choosing a pixmap in &lt;i&gt;Qt Designer&lt;/i&gt; you will be asked to specify the arguments which will be passed to the function in the generated code.&lt;p&gt; This approach makes it possible to use your own icon-loader function for loading pixmaps. &lt;i&gt;Qt Designer&lt;/i&gt; can&apos;t preview the correct image if you use your own function.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change class name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the name of the class that will be created.&lt;/b&gt;&lt;p&gt;&lt;em&gt;classname.h&lt;/em&gt; and &lt;em&gt;classname.cpp&lt;/em&gt; will be generated as C++-output when it is compiled with the uic.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>A&amp;uthor:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter your name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter your name here.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Class &amp;Name:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;mment:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter a comment about the form.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>La&amp;youts</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Default Mar&amp;gin:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>D&amp;efault Spacing:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FormWindow</name>
+ <message>
+ <source>Set &apos;name&apos; property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The name of a widget has to be unique!
+&apos;%1&apos; is already used in the form &apos;%2&apos;,
+so the name has been changed back to &apos;%3&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The name of a widget must not be null!
+The name has been changed back to &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Horizontal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Vertical</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;A %1 (custom widget)&lt;/b&gt; &lt;p&gt;Select &lt;b&gt;Edit Custom Widgets...&lt;/b&gt; in the &lt;b&gt;Tools-&gt;Custom&lt;/b&gt; menu to add and change the custom widgets. You can add properties as well as Q_SIGNALS and Q_SLOTS to integrate them into the designer, and provide a pixmap which will be used to represent the widget on the form.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A %1 (custom widget)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Retqparent Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect &apos;%1&apos; with...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Change Tab Order</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1/%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect &apos;%1&apos; with &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Inserting a Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>You tried to insert a widget into the laid out Container Widget &apos;%1&apos;.
+This is not possible. In order to insert the widget, the tqlayout of &apos;%1&apos;
+has to be broken. Break the tqlayout or cancel the operation?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Use Size Hint</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjust Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click widgets to change tab order...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Drag a line to create a connection...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click on the form to insert a %1...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Following custom widgets are used in &apos;%1&apos;,
+but they are not known to the designer:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lower</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Check Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The accelerator &apos;%1&apos; is used %2 times.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Select</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No accelerator is used more than once!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Raise</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout horizontally (in splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout vertically (in splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout in a grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout tqchildren horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout tqchildren vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout tqchildren in a grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit connections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>GotoLineDialog</name>
+ <message encoding="UTF-8">
+ <source>Goto Line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Line:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Goto</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>HierarchyList</name>
+ <message>
+ <source>Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Class</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Database</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page to %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>HierarchyView</name>
+ <message>
+ <source>Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Classes</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>IconViewEditor</name>
+ <message>
+ <source>New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Items of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>IconViewEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Iconview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Iconview&lt;/b&gt;&lt;p&gt;Add, change and remove items in the icon view.&lt;/p&gt;&lt;p&gt;Press the &lt;b&gt;New Item&lt;/b&gt;-button to create a new entry, and enter a text or choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the view and press the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the view.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>All items in the view.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add an item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Create a new item for the view.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Item Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change the text for the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the pixmap of the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a pixmap-file for the current item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ListBoxEditor</name>
+ <message>
+ <source>New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Items of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ListBoxEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Listbox</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Listbox&lt;/b&gt;&lt;p&gt;Add, change and remove items in the listbox.&lt;/p&gt;&lt;p&gt;Press the &lt;b&gt;New Item&lt;/b&gt;-button to create a new listbox entry, and enter text or choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and press the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of items.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Item Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the pixmap of the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a pixmap-file for the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change the text of the selected item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add an item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Add a new item.&lt;/b&gt;&lt;p&gt;New items are appended to the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the selected item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move up</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Moves the selected item up.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move down</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move the selected item down.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ListEditor</name>
+ <message encoding="UTF-8">
+ <source>Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Column 1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Re&amp;name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ListViewEditor</name>
+ <message>
+ <source>Edit Items and Columns of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Items</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ListViewEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Listview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Listview&lt;/b&gt;&lt;p&gt;Use the controls on the &lt;b&gt;Items&lt;/b&gt;-tab to add, change and remove items in the listview. Change the column configuration of the view using the controls on the &lt;b&gt;Columns&lt;/b&gt;-tab.&lt;/p&gt;Press the &lt;b&gt;New Item&lt;/b&gt;-button to create a new item and enter a text or provide a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and press the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Items</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Deletes the selected item.&lt;/b&gt;&lt;p&gt;Existing subitems are deleted, too.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Item &amp;Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pi&amp;xmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Change the text of the item.&lt;/b&gt;&lt;p&gt;The text will be changed in the current column of the selected item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Change column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select the current column.&lt;/b&gt;&lt;p&gt;Itemtext and pixmap will be changed for the current column&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Colu&amp;mn:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the pixmap of the selected item.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add an item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Adds a new item to the list.&lt;/b&gt;&lt;p&gt;The item will be inserted at the top of the list and can be moved using the up- and down-buttons.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of items.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>New &amp;Subitem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add a subitem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Create a new subitem for the selected item.&lt;/b&gt;&lt;p&gt;New subitems are inserted at the top of the list of subitems, and new levels will be created automatically.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move up</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The item will be moved within the hierarchy level.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move down</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The item will be moved within the hierarchy level.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item one level up.&lt;/b&gt;&lt;p&gt;This will also change the level of the tqparent item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item one level down.&lt;/b&gt;&lt;p&gt;This will also change the level of the tqparent item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;lumns</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Column Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete the pixmap of the selected column.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file for the selected column.&lt;/b&gt;&lt;p&gt;The pixmap will be displayed in the header of the listview.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter column text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the text for the selected column.&lt;/b&gt;&lt;p&gt;The text will be displayed in the header of the listview.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Clicka&amp;ble</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>If this option is checked, the selected column will react on mouseclicks on the header.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Re&amp;sizable</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The column&apos;s width will be resizeable if this option is checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Deletes the selected Column.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add a Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Create a new column.&lt;/b&gt;&lt;p&gt;New columns are appended to the list and may be moved using the up- and down-buttons.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The list of columns.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Qt User-Interface Files (*.ui)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ready - This is the non-commercial version of Qt - For commercial evaluation purposes, use the help menu to register with Trolltech.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Property Editor/Signal Handlers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Property Editor&lt;/b&gt;&lt;p&gt;You can change the appearance and behaviour of the selected widget in the property editor.&lt;/p&gt;&lt;p&gt;You can set properties for components and forms at design time and see the changes immediately. Each property has its own editor which you can use to enter new values, open a special dialog or select values from a predefined list. Use &lt;b&gt;F1&lt;/b&gt; to get detailed help for the selected property.&lt;/p&gt;&lt;p&gt;You can resize the columns of the editor by dragging the separators of the list header.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Signal Handlers&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In the Signal Handlers tab you can define connections between Q_SIGNALS of widgets and Q_SLOTS of the form. That is just a convenience way, you can use the connection tool to do that as well.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Output Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Object Explorer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Object Explorer&lt;/b&gt;&lt;p&gt;The object explorer gives a quick overview about the relations between the widgets in your form. You can use the clipboard functions using a context menu for each item in the view.&lt;/p&gt;&lt;p&gt;The columns can be resized by dragging the separator in the list header.&lt;/p&gt;&lt;p&gt;On the second tab you can see all the declared Q_SLOTS, variables, includes, etc. of the form.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Start typing the buffer you want to switch to here (ALT+B)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File Overview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The File Overview box&lt;/b&gt;&lt;p&gt;The File Overview Box displays all files of all projects, including forms and source files.&lt;/p&gt;&lt;p&gt;Its search field allows rapid switching between files.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Action Editor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Action Editor&lt;/b&gt;&lt;p&gt;Todo Whatsthis&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Couldn&apos;t tqfind the Qt documentation property index file!
+Define the correct documentation path in the preferences dialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Form Window&lt;/b&gt;&lt;p&gt;Use the different tools to add widgets or to change the tqlayout and behaviour of the components in your form. Select one or multiple widgets and move them, or resize a single widget using the handles.&lt;/p&gt;&lt;p&gt;Changes in the &lt;b&gt;Property Editor&lt;/b&gt; can be seen at design time, and you can open a preview of your form in different styles.&lt;/p&gt;&lt;p&gt;You can change the grid resolution, or turn the grid off in the &lt;b&gt;Preferences&lt;/b&gt; dialog in the &lt;b&gt;Edit&lt;/b&gt; menu.&lt;p&gt;You can have several forms open, and all open forms are listed in the &lt;b&gt;Form List&lt;/b&gt;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot create invalid project.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo: Not Available</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo: Not Available</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose Pixmap...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Text...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Title...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Page Title...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Pages...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Menu Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Toolbar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;text&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;title&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Page Title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New page title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;pageTitle&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;pixmap&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page to %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Toolbar to &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Menu to &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Project Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes to &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit %1...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restoring last session</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Qt Designer found some temporary saved files, which have been
+written when the Qt Designer crashed last time. Do you want to
+load these files?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>There is no help available for this dialog at the moment.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Could not open &apos;%1&apos;. File does not exist.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reverses the last action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redoes the last undone operation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cut</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cu&amp;t</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cuts the selected widgets and puts them on the clipboard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copies the selected widgets to the clipboard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pastes clipboard contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Deletes the selected widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects all widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bring to Front</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bring to &amp;Front</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Raises the selected widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Send to Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Send to &amp;Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lowers the selected widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Check Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Chec&amp;k Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Checks if the accelerators used in the form are unique</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>S&amp;lots...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit Q_SLOTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Co&amp;nnections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit connections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Source...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens an editor to edit the source of the form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Form Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Form Settings...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change the settings of the form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change preferences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Edit toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Find...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find Incremental</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find &amp;Incremental</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Replace...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Goto Line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Goto Line...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Incremetal Search (ALT+I)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Search</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjust Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjust &amp;Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adjusts the size of the selected widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out &amp;Horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets horizontally</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out &amp;Vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets vertically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out in a Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out in a &amp;Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets in a grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Horizontally (in Splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Horizontally (in S&amp;plitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets horizontally in a splitter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Vertically (in Splitter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lay Out Vertically (in Sp&amp;litter)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Lays out the selected widgets vertically in a splitter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Break Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Breaks the selected tqlayout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert a %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Layout toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Layout</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pointer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Pointer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects the pointer tool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Connect Signal/Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Connect Signal/Slots</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects the connection tool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab Order</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab &amp;Order</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Selects the tab order tool</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Tools toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tools</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Tools</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Custom Widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit &amp;Custom Widgets...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change the custom widgets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The %1&lt;/b&gt;%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Click on a button to insert a single widget, or double click to insert multiple %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The %1 Widgets&lt;/b&gt;%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Click on a button to insert a single %1 widget, or double click to insert multiple widgets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;Double click on this tool to keep it selected.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Custom Widgets toolbar&lt;/b&gt;%1&lt;p&gt;Select &lt;b&gt;Edit Custom Widgets...&lt;/b&gt; in the &lt;b&gt;Tools-&gt;Custom&lt;/b&gt; menu to add and change custom widgets&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> Click on the buttons to insert a single widget, or double click to insert multiple widgets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The File toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;New...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Creates a new project, form or source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens an existing project, form for source file </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Closes the current project or document</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Saves the current project or document</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save As</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save &amp;As...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Saves the current form with a new filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sa&amp;ve All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Saves all open documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create Template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create &amp;Template...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Creates a new template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Recently opened files </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Recently opened projects</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Exit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E&amp;xit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quits the application and prompts to save changed forms, source files and project settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pr&amp;oject</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Active Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;No Project&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Add File...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Adds a file to the current project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Image Collection...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Image Collection...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit the image collection of the current project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Database Connections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Database Connections...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to edit the database connections of the current project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Project Settings...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Project Settings...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a dialog to change the settings of the project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preview Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preview &amp;Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Motif Look&amp;Feel used as the default style on most UNIX-Systems.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Windows Look&amp;Feel used as the default style on Windows-Systems.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Platinum Look&amp;Feel resembling a Macinosh-like GUI style.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the CDE Look&amp;Feel which is similar to some versions of the Common Desktop Environment.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use the Motif Look&amp;Feel used as the default style on SGI-systems.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The preview will use an advanced Motif Look&amp;Feel as used by the GIMP toolkit (GTK) on Linux.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preview Form in %1 Style</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>... in %1 Style</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens a preview in %1 style</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Open a preview in %1 style.&lt;/b&gt;&lt;p&gt;Use the preview to test the design and signal-slot connections of the current form. %2&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Tile</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Arranges all windows tiled</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cascade</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cascade</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Arrange all windows cascaded</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cl&amp;ose</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Closes the active window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close Al&amp;l</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Closes all form windows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ne&amp;xt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Activates the next window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Previous</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pre&amp;vious</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Activates the previous window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Vie&amp;ws</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tool&amp;bars</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens the online help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Opens the Qt Designer manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Displays information about this product</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About &amp;Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Displays information about the Qt Toolkit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Register Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Register Qt...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Launches web browser with evaluation form at www.trolltech.com</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Register with Trolltech</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>What&apos;s This?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&quot;What&apos;s This?&quot; context sensitive help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;The Help toolbar&lt;/b&gt;%1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select new item ...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select a file...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Designer Files (*.ui *.pro)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>QMAKE Project Files (*.pro)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No import filter available for %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Importing %1 using import filter ...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Nothing to load in %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reading file %1...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File %1 opened.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Failed to load file %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Load File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Couldn&apos;t load file %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Project &apos;%1&apos; saved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enter a filename...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer is crashing - attempting to save work...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NewTemplate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Couldn&apos;t create the template</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Q_SLOTS of current form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit connections in current form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit settings of current form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit preferences...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit custom widgets...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Column 1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab 1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tab 2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Load Template</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MultiLineEditor</name>
+ <message>
+ <source>Set text of &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>MultiLineEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Multiline Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Multiline Edit&lt;/b&gt;&lt;p&gt;Enter the text and press the &lt;b&gt;OK&lt;/b&gt;-Button to apply the changes.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Text:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Enter your text here.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>NewForm</name>
+ <message>
+ <source>Project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Dialog</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Wizard</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Widget</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Main Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>NewFormBase</name>
+ <message encoding="UTF-8">
+ <source>New File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;New Form&lt;/b&gt;&lt;p&gt;Select a template for the new form and click the &lt;b&gt;OK&lt;/b&gt;-button to open it.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Open a new form using the selected template.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and do not open a form.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Displays a list of available templates.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Insert into:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>OutputWindow</name>
+ <message>
+ <source>Error Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Message</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Line</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PaletteEditorAdvancedBase</name>
+ <message encoding="UTF-8">
+ <source>Tune Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Edit Palette&lt;/b&gt;&lt;p&gt;Change the palette of the current widget or form.&lt;/p&gt;&lt;p&gt;Use a generated palette or select colors for each color group and each color role.&lt;/p&gt;&lt;p&gt;The palette can be tested with different widget layouts in the preview section.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select &amp;Palette:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Active Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Inactive Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Disabled Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Auto</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build inactive palette from active.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build disabled palette from active.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Central color &amp;roles</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Background</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Foreground</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Button</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Base</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>BrightText</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ButtonText</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Highlight</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>HighlightText</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Link</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>LinkVisited</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose central color role</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available central roles are: &lt;ul&gt; &lt;li&gt;Background - general background color.&lt;/li&gt; &lt;li&gt;Foreground - general foreground color. &lt;/li&gt; &lt;li&gt;Base - used as background color for e.g. text entry widgets, usually white or another light color. &lt;/li&gt; &lt;li&gt;Text - the forground color used with Base. Usually this is the same as the Foreground, in what case it must provide good contrast both with Background and Base. &lt;/li&gt; &lt;li&gt;Button - general button background color, where buttons need a background different from Background, as in the Macintosh style. &lt;/li&gt; &lt;li&gt;ButtonText - a foreground color used with the Button color. &lt;/li&gt; &lt;li&gt;Highlight - a color to indicate a selected or highlighted item. &lt;/li&gt; &lt;li&gt;HighlightedText - a text color that contrasts to Highlight. &lt;/li&gt; &lt;li&gt;BrightText - a text color that is very different from Foreground and contrasts well with e.g. black. &lt;/li&gt; &lt;/ul&gt; &lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose Pi&amp;xmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a pixmap-file for the selected central color role.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Select Color:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color for the selected central color role.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>3-D shadow &amp;effects</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build &amp;from button color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Generate shadings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Check to let 3D-effect colors be calculated from button-color.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Light</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Midlight</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Mid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Dark</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Shadow</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose 3D-effect color role</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available effect roles are: &lt;ul&gt; &lt;li&gt;Light - lighter than Button color. &lt;/li&gt; &lt;li&gt;Midlight - between Button and Light. &lt;/li&gt; &lt;li&gt;Mid - between Button and Dark. &lt;/li&gt; &lt;li&gt;Dark - darker than Button. &lt;/li&gt; &lt;li&gt;Shadow - a very dark color. &lt;/li&gt; &lt;/ul&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select Co&amp;lor:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color for the selected effect color role.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PaletteEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Build Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;3-D Effects:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the effect-color for the generated palette.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Back&amp;ground:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose the background color for the generated palette.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Tune Palette...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select &amp;Palette:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Active Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Inactive Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Disabled Palette</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PixmapCollectionEditor</name>
+ <message encoding="UTF-8">
+ <source>Manage Image Collection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Add...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose an Image</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PixmapFunction</name>
+ <message encoding="UTF-8">
+ <source>Choose Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Enter arguments for loading the pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>QPixmap(</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>Preferences</name>
+ <message encoding="UTF-8">
+ <source>Preferences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Preferences&lt;/b&gt;&lt;p&gt;Change the preferences of the designer application. There is always one tab with general preferenced. Depending on installed plugins, there might be more tabs for plugin preferences.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Backgro&amp;und</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a color in the colordialog.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;lor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background color</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background color.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Use a background pixmap.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Choose a pixmap-file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show &amp;Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Customize the grid appearance for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, all forms show a grid.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Gr&amp;id</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Sn&amp;ap to Grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Snap to the grid</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Snap to Grid&lt;/b&gt; is checked, the widgets snap to the grid using the the X/Y resolution.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Grid resolution</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, a grid is shown on all forms using the X/Y resolution.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Grid-&amp;X:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Grid-&amp;Y:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>A splashscreen is displayed when starting the designer if this option is checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Ge&amp;neral</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Restore Last &amp;Workspace on Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Restore last workspace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>The current workspace settings will be restored next time you start the designer if this option is checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show &amp;Splash Screen on Startup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show Splashscreen</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Disable Data&amp;base Auto-Edit in Preview</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Documentation Path:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Enter the path to the documentation.&lt;/b&gt;&lt;p&gt;You may provide an $environment variable as first part of your pathname.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select path</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Look for the documentation path.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Toolbars</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show &amp;Big Icons</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Big Icons</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Uses big icons in the toolbars when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Show Text Lab&amp;els</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Text Labels</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Shows textlabels in the toolbars when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>PreviewWidgetBase</name>
+ <message encoding="UTF-8">
+ <source>Preview Window</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ButtonGroup</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>RadioButton1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>RadioButton2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>RadioButton3</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ButtonGroup2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>CheckBox1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>CheckBox2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>LineEdit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>ComboBox</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>PushButton</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;p&gt;
+&lt;a href=&quot;http://www.trolltech.com&quot;&gt; http://www.trolltech.com &lt;/a&gt;
+&lt;/p&gt;
+&lt;p&gt;
+&lt;a href=&quot;http://www.kde.org&quot;&gt; http://www.kde.org &lt;/a&gt;
+&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Project</name>
+ <message>
+ <source>&lt;No Project&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ProjectSettings</name>
+ <message>
+ <source>unnamed.pro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Database Files (*.db);;All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Project Files (*.pro);;All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ProjectSettingsBase</name>
+ <message encoding="UTF-8">
+ <source>Project Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Project File:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Description:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>For&amp;ms and Sources:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Form</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Add...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Database File:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyBoolItem</name>
+ <message>
+ <source>False</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>True</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyColorItem</name>
+ <message>
+ <source>Red</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Green</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Blue</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyCoordItem</name>
+ <message>
+ <source>x</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>y</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>height</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyCursorItem</name>
+ <message>
+ <source>Arrow</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Up-Arrow</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cross</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Waiting</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>iBeam</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Vertical</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Horizontal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Slash</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size Backslash</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Blank</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Split Vertical</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Split Horizontal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Pointing Hand</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Forbidden</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyDatabaseItem</name>
+ <message>
+ <source>Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Field</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyEditor</name>
+ <message>
+ <source>Reset property to its default value</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click this button to reset the property to its default value</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Property Editor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Properties</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Signal Handlers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Property Editor (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyFontItem</name>
+ <message>
+ <source>Family</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Point Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bold</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Italic</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Underline</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Strikeout</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyList</name>
+ <message>
+ <source>Property</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Value</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set &apos;%1&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sort &amp;Categorized</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sort &amp;Alphabetically</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reset &apos;%1&apos; of &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;b&gt;QWidget::%1&lt;/b&gt;&lt;/p&gt;&lt;p&gt;There is no documentation available for this property.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertySizePolicyItem</name>
+ <message>
+ <source>hSizeType</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>vSizeType</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>horizontalStretch</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>verticalStretch</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1/%2/%2/%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PropertyTextItem</name>
+ <message>
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QApplication</name>
+ <message>
+ <source>Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Could not connect to the database.
+Press &apos;OK&apos; to continue or &apos;Cancel&apos; to specify different
+connection information.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerMenuBar</name>
+ <message>
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename Item...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Menu &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename Menuitem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Menu Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename Menu &apos;%1&apos; to &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move menu &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerPopupMenu</name>
+ <message>
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert Separator</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Action &apos;%1&apos; from the Popup Menu &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Separator to the Popup Menu &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Action &apos;%1&apos; to the Popup Menu &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert/Move Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Action &apos;%1&apos; has already been added to this menu.
+An Action can only be added once to the same menu.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerTabWidget</name>
+ <message>
+ <source>Move Tab Page</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QDesignerToolBar</name>
+ <message>
+ <source>Delete Toolbar</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Toolbar &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Delete Item</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert Separator</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Action &apos;%1&apos; from Toolbar &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Separator to Toolbar &apos;%1&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Action &apos;%1&apos; to Toolbar &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Insert/Move Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Action &apos;%1&apos; has already been added to this toolbar.
+An Action can only be added once to the same toolbar.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Widget &apos;%1&apos; to Toolbar &apos;%2&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>ReplaceDialog</name>
+ <message encoding="UTF-8">
+ <source>Replace Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>R&amp;eplace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Replace &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Whole words only</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Case sensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Start at Beginning</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Direction</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Forwar&amp;d</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Backward</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SizeHandle</name>
+ <message>
+ <source>%1/%2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Resize</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SourceEditor</name>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SourceFile</name>
+ <message>
+ <source>Edit %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Code</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes to &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Yes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;No</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Designer</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The file %1 has been changed outside Qt Designer.
+Do you want to reload it?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Invalid Filename</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The project tqcontains already a sourcefile with the
+filename &apos;%1&apos;. Please choose a new filename.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TableEditor</name>
+ <message>
+ <source>Edit Rows and Columns of &apos;%1&apos; </source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>TableEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Edit Table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Co&amp;lumns</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move up</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Move down</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The topmost column will be the first column of the list.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Column</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Table:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Label4</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Delete Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Delete the pixmap of the selected item.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Select a Pixmap</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;b&gt;Select a pixmap-file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Label:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Pixmap:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Field:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&lt;no table&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;New Row</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Delete Row</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TextEditor</name>
+ <message>
+ <source>Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>WizardEditor</name>
+ <message>
+ <source>Edit Wizard Pages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Page to %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Remove Page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Swap pages %1 and %2 of %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Page Title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New page title</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Rename page %1 of %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context encoding="UTF-8">
+ <name>WizardEditorBase</name>
+ <message encoding="UTF-8">
+ <source>Wizard Page Editor</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Wizard Pages:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Apply</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and apply all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>&amp;Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message encoding="UTF-8">
+ <source>Close dialog and discard all changes.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Workspace</name>
+ <message>
+ <source>Files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open source file...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Remove source file from project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open form...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Remove form from project</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open form source...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>qChoosePixmap</name>
+ <message>
+ <source>All Pixmaps (</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1-Pixmaps (%2)
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>)
+</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All Files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose Images...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Choose a Pixmap...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tqtinterface/qt4/tools/designer/designer/designer_pch.h b/tqtinterface/qt4/tools/designer/designer/designer_pch.h
new file mode 100644
index 0000000..fa84018
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designer_pch.h
@@ -0,0 +1,44 @@
+/*
+ * This is a precompiled header file for use in Xcode / Mac GCC /
+ * GCC >= 3.4 / VC to greatly speed the building of TQt Designer. It may
+ * also be of use to people developing their own project, but it is
+ * probably better to define your own header. Use of this header is
+ * currently UNSUPPORTED.
+ */
+
+#if defined __cplusplus
+
+#include <private/tqucomextra_p.h>
+#include <tqaction.h>
+#include <tqapplication.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqdialog.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqmap.h>
+#include <tqmessagebox.h>
+#include <tqmetaobject.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqpushbutton.h>
+#include <tqspinbox.h>
+#include <tqstring.h>
+#include <tqtooltip.h>
+#include <tqvariant.h>
+#include <tqwhatsthis.h>
+#include <tqwidget.h>
+
+#include "command.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "project.h"
+#include "widgetfactory.h"
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/designerapp.cpp b/tqtinterface/qt4/tools/designer/designer/designerapp.cpp
new file mode 100644
index 0000000..f16f4c6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designerapp.cpp
@@ -0,0 +1,181 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "designerappiface.h"
+#include "designerapp.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqsettings.h>
+#include <tqsplashscreen.h>
+
+#ifdef TQ_WS_WIN
+#include <tqt_windows.h>
+#include <process.h>
+#endif
+
+static TQSplashScreen *splash = 0;
+
+void set_splash_status( const TQString &txt )
+{
+ if ( !splash )
+ return;
+ TQString splashText = "Licensed to "
+ + TQString::tqfromLatin1( TQT_PRODUCT_LICENSEE ) + "\n"
+ + txt;
+ splash->message( splashText, TQt::AlignRight|TQt::AlignTop );
+}
+
+DesignerApplication::DesignerApplication( int &argc, char **argv )
+ : TQApplication( argc, argv )
+{
+#if defined(TQ_WS_WIN)
+ if ( winVersion() & TQt::WV_NT_based )
+ DESIGNER_OPENFILE = RegisterWindowMessage((TCHAR*)"TQT_DESIGNER_OPEN_FILE");
+ else
+ DESIGNER_OPENFILE = RegisterWindowMessageA("TQT_DESIGNER_OPEN_FILE");
+#endif
+}
+
+TQSplashScreen *DesignerApplication::showSplash()
+{
+ TQRect screen = TQApplication::desktop()->screenGeometry();
+ TQSettings config;
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+
+ TQRect mainRect;
+ TQString keybase = settingsKey();
+ bool show = config.readBoolEntry( keybase + "SplashScreen", TRUE );
+ mainRect.setX( config.readNumEntry( keybase + "Geometries/MainwindowX", 0 ) );
+ mainRect.setY( config.readNumEntry( keybase + "Geometries/MainwindowY", 0 ) );
+ mainRect.setWidth( config.readNumEntry( keybase + "Geometries/MainwindowWidth", 500 ) );
+ mainRect.setHeight( config.readNumEntry( keybase + "Geometries/MainwindowHeight", 500 ) );
+ screen = TQApplication::desktop()->screenGeometry( TQApplication::desktop()->screenNumber( mainRect.center() ) );
+
+ if ( show ) {
+ splash = new TQSplashScreen( TQPixmap::fromMimeSource("designer_splash.png") );
+ splash->show();
+ set_splash_status( "Initializing..." );
+ }
+
+ return splash;
+}
+
+void DesignerApplication::closeSplash()
+{
+ splash->hide();
+}
+
+static TQString *settings_key = 0;
+static TQString *old_settings_key = 0;
+
+TQString DesignerApplication::settingsKey()
+{
+ if ( !settings_key )
+ settings_key = new TQString( "/TQt Designer/" +
+ TQString::number( (TQT_VERSION >> 16) & 0xff ) +
+ "." + TQString::number( (TQT_VERSION >> 8) & 0xff ) + "/" );
+ return *settings_key;
+}
+
+TQString DesignerApplication::oldSettingsKey()
+{
+ if ( !old_settings_key ) {
+ int majorVer = (TQT_VERSION >> 16) & 0xff;
+ int minorVer = (TQT_VERSION >> 8) & 0xff;
+
+ // If minorVer is 0 (e.g. 4.0) then we don't want to read the
+ // old settings, too much might have changed.
+ if ( !minorVer == 0 )
+ minorVer--;
+
+ old_settings_key = new TQString( "/TQt Designer/" +
+ TQString::number( majorVer ) +
+ "." + TQString::number( minorVer ) + "/" );
+ }
+ return *old_settings_key;
+}
+
+void DesignerApplication::setSettingsKey( const TQString &key )
+{
+ if ( !settings_key )
+ settings_key = new TQString( key );
+ else
+ *settings_key = key;
+}
+
+#if defined(TQ_WS_WIN)
+bool DesignerApplication::winEventFilter( MSG *msg )
+{
+ if ( msg->message == DESIGNER_OPENFILE ) {
+ TQFile f( TQDir::homeDirPath() + "/.designerargs" );
+ TQFileInfo fi(f);
+ if ( fi.lastModified() == lastMod )
+ return TQApplication::winEventFilter( msg );
+ lastMod = fi.lastModified();
+ f.open( IO_ReadOnly );
+ TQString args;
+ f.readLine( args, f.size() );
+ TQStringList lst = TQStringList::split( " ", args );
+
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ TQString arg = (*it).stripWhiteSpace();
+ if ( arg[0] != '-' ) {
+ TQObjectList* l = MainWindow::self->queryList( "FormWindow" );
+ FormWindow* fw = (FormWindow*) l->first();
+ FormWindow* totop = 0;
+ bool haveit = FALSE;
+ while ( fw ) {
+ haveit = haveit || fw->fileName() == arg;
+ if ( haveit )
+ totop = fw;
+
+ fw = (FormWindow*) l->next();
+ }
+
+ if ( !haveit ) {
+ FlashWindow( MainWindow::self->winId(), TRUE );
+ MainWindow::self->openFormWindow( arg );
+ } else if ( totop ) {
+ totop->setFocus();
+ }
+ delete l;
+ }
+ }
+ return TRUE;
+ }
+ return TQApplication::winEventFilter( msg );
+}
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/designerapp.h b/tqtinterface/qt4/tools/designer/designer/designerapp.h
new file mode 100644
index 0000000..df5271a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designerapp.h
@@ -0,0 +1,65 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DESIGNERAPP_H
+#define DESIGNERAPP_H
+
+class TQSplashScreen;
+
+#include <tqapplication.h>
+
+class DesignerApplication : public TQApplication
+{
+public:
+ const char *className() const { return "DesignerApplication"; }
+
+ DesignerApplication( int &argc, char **argv );
+
+ TQSplashScreen *showSplash();
+ static void closeSplash();
+
+ static TQString settingsKey();
+ static TQString oldSettingsKey();
+ static void setSettingsKey( const TQString &key );
+
+protected:
+ TQDateTime lastMod;
+
+#if defined(TQ_WS_WIN)
+ bool winEventFilter( MSG *msg );
+ uint DESIGNER_OPENFILE;
+#endif
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/designerappiface.cpp b/tqtinterface/qt4/tools/designer/designer/designerappiface.cpp
new file mode 100644
index 0000000..5acbf58
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designerappiface.cpp
@@ -0,0 +1,1100 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqmenubar.h>
+#include <tqpopupmenu.h>
+#include "designerappiface.h"
+#include "mainwindow.h"
+#include "project.h"
+#include "formwindow.h"
+#include "workspace.h"
+#include "widgetfactory.h"
+#include "command.h"
+#include "outputwindow.h"
+#include "../shared/widgetdatabase.h"
+#include <tqvariant.h>
+#include <tqlistview.h>
+#include <tqtextedit.h>
+#include <tqstatusbar.h>
+#include "pixmapcollection.h"
+#include "hierarchyview.h"
+#include <stdlib.h>
+#include <tqmetaobject.h>
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+DesignerInterfaceImpl::DesignerInterfaceImpl( MainWindow *mw )
+ : mainWindow( mw )
+{
+}
+
+TQRESULT DesignerInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInterface** iface )
+{
+ *iface = 0;
+
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_TQComponentInformation )
+ *iface = (TQComponentInformationInterface*)this;
+ else if ( uuid == IID_Designer )
+ *iface = (DesignerInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+
+DesignerProject *DesignerInterfaceImpl::currentProject() const
+{
+ return mainWindow->currProject()->iFace();
+}
+
+DesignerFormWindow *DesignerInterfaceImpl::currentForm() const
+{
+ if ( mainWindow->formWindow() )
+ return mainWindow->formWindow()->iFace();
+ return 0;
+}
+
+DesignerSourceFile *DesignerInterfaceImpl::currentSourceFile() const
+{
+ if ( mainWindow->sourceFile() )
+ return mainWindow->sourceFile()->iFace();
+ return 0;
+}
+
+TQPtrList<DesignerProject> DesignerInterfaceImpl::projectList() const
+{
+ return mainWindow->projectList();
+}
+
+void DesignerInterfaceImpl::showtqStatusMessage( const TQString &text, int ms ) const
+{
+ if ( text.isEmpty() ) {
+ mainWindow->statusBar()->clear();
+ return;
+ }
+ if ( ms )
+ mainWindow->statusBar()->message( text, ms );
+ else
+ mainWindow->statusBar()->message( text );
+}
+
+DesignerDock *DesignerInterfaceImpl::createDock() const
+{
+ return 0;
+}
+
+DesignerOutputDock *DesignerInterfaceImpl::outputDock() const
+{
+ return mainWindow->outputWindow() ? mainWindow->outputWindow()->iFace() : 0;
+}
+
+void DesignerInterfaceImpl::setModified( bool b, TQWidget *window )
+{
+ mainWindow->setModified( b, window );
+}
+
+void DesignerInterfaceImpl::updateFunctionList()
+{
+ mainWindow->updateFunctionList();
+ if ( mainWindow->objectHierarchy()->sourceEditor() )
+ mainWindow->objectHierarchy()->updateClassBrowsers();
+}
+
+void DesignerInterfaceImpl::onProjectChange( TQObject *receiver, const char *slot )
+{
+ TQObject::connect( mainWindow, TQT_SIGNAL( projectChanged() ), receiver, slot );
+}
+
+void DesignerInterfaceImpl::onFormChange( TQObject *receiver, const char *slot )
+{
+ TQObject::connect( mainWindow, TQT_SIGNAL( formWindowChanged() ), receiver, slot );
+ TQObject::connect( mainWindow, TQT_SIGNAL( editorChanged() ), receiver, slot );
+}
+
+bool DesignerInterfaceImpl::singleProjectMode() const
+{
+ return mainWindow->singleProjectMode();
+}
+
+void DesignerInterfaceImpl::showError( TQWidget *widget,
+ int line, const TQString &message )
+{
+ mainWindow->showErrorMessage( TQT_TQOBJECT(widget), line, message );
+}
+
+void DesignerInterfaceImpl::runFinished()
+{
+ mainWindow->finishedRun();
+}
+
+void DesignerInterfaceImpl::showStackFrame( TQWidget *w, int line )
+{
+ mainWindow->showStackFrame( TQT_TQOBJECT(w), line );
+}
+
+void DesignerInterfaceImpl::showDebugStep( TQWidget *w, int line )
+{
+ mainWindow->showDebugStep( TQT_TQOBJECT(w), line );
+}
+
+void DesignerInterfaceImpl::runProjectPrecondition()
+{
+ mainWindow->runProjectPrecondition();
+}
+
+void DesignerInterfaceImpl::runProjectPostcondition( TQObjectList *l )
+{
+ mainWindow->runProjectPostcondition( l );
+}
+
+DesignerProjectImpl::DesignerProjectImpl( Project *pr )
+ : project( pr )
+{
+}
+
+TQPtrList<DesignerFormWindow> DesignerProjectImpl::formList() const
+{
+ TQPtrList<DesignerFormWindow> list;
+ TQObjectList *forms = project->formList();
+ if ( !forms )
+ return list;
+
+ TQPtrListIterator<TQObject> it( *forms );
+ while ( it.current() ) {
+ TQObject *obj = it.current();
+ ++it;
+ TQWidget *par = ::tqqt_cast<FormWindow*>(obj->tqparent());
+ if ( !obj->isWidgetType() || !par )
+ continue;
+
+ list.append( ((FormWindow*)par)->iFace() );
+ }
+
+ delete forms;
+ return list;
+}
+
+TQString DesignerProjectImpl::formFileName( const TQString &form ) const
+{
+ for ( TQPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ if ( TQString( forms.current()->formName() ) == form )
+ return forms.current()->fileName();
+ }
+ return TQString();
+}
+
+TQStringList DesignerProjectImpl::formNames() const
+{
+ TQStringList l;
+ for ( TQPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ FormFile* f = forms.current();
+ if ( f->isFake() )
+ continue;
+ l << f->formName();
+ }
+ return l;
+}
+
+void DesignerProjectImpl::addForm( DesignerFormWindow * )
+{
+}
+
+void DesignerProjectImpl::removeForm( DesignerFormWindow * )
+{
+}
+
+TQString DesignerProjectImpl::fileName() const
+{
+ return project->fileName();
+}
+
+void DesignerProjectImpl::setFileName( const TQString & )
+{
+}
+
+TQString DesignerProjectImpl::projectName() const
+{
+ return project->projectName();
+}
+
+void DesignerProjectImpl::setProjectName( const TQString & )
+{
+}
+
+TQString DesignerProjectImpl::databaseFile() const
+{
+ return TQString();
+}
+
+void DesignerProjectImpl::setDatabaseFile( const TQString & )
+{
+}
+
+void DesignerProjectImpl::setupDatabases() const
+{
+ MainWindow::self->editDatabaseConnections();
+}
+
+TQPtrList<DesignerDatabase> DesignerProjectImpl::databaseConnections() const
+{
+ TQPtrList<DesignerDatabase> lst;
+#ifndef TQT_NO_SQL
+ TQPtrList<DatabaseConnection> conns = project->databaseConnections();
+ for ( DatabaseConnection *d = conns.first(); d; d = conns.next() )
+ lst.append( d->iFace() );
+#endif
+ return lst;
+}
+
+void DesignerProjectImpl::addDatabase( DesignerDatabase * )
+{
+}
+
+void DesignerProjectImpl::removeDatabase( DesignerDatabase * )
+{
+}
+
+void DesignerProjectImpl::save() const
+{
+}
+
+void DesignerProjectImpl::setLanguage( const TQString &l )
+{
+ project->setLanguage( l );
+}
+
+TQString DesignerProjectImpl::language() const
+{
+ return project->language();
+}
+
+void DesignerProjectImpl::setCustomSetting( const TQString &key, const TQString &value )
+{
+ project->setCustomSetting( key, value );
+}
+
+TQString DesignerProjectImpl::customSetting( const TQString &key ) const
+{
+ if ( key == "TQTSCRIPT_PACKAGES" ) {
+ TQString s = getenv( "TQTSCRIPT_PACKAGES" );
+ TQString s2 = project->customSetting( "TQUICK_PACKAGES" );
+ if ( !s.isEmpty() && !s2.isEmpty() )
+#if defined(TQ_OS_WIN32)
+ s += ";";
+#else
+ s += ":";
+#endif
+ s += s2;
+ return s;
+ }
+ return project->customSetting( key );
+}
+
+DesignerPixmapCollection *DesignerProjectImpl::pixmapCollection() const
+{
+ return project->pixmapCollection()->iFace();
+}
+
+void DesignerProjectImpl::breakPoints( TQMap<TQString, TQValueList<uint> > &bps ) const
+{
+ MainWindow::self->saveAllBreakPoints();
+ for ( TQPtrListIterator<SourceFile> sources = project->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ bps.insert( project->makeRelative( f->fileName() ) + " <Source-File>", MetaDataBase::breakPoints( f ) );
+ }
+ for ( TQPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ if ( forms.current()->formWindow() )
+ bps.insert( TQString( forms.current()->formWindow()->name() ) + " <Form>", MetaDataBase::breakPoints( forms.current()->formWindow() ) );
+ }
+}
+
+TQString DesignerProjectImpl::breakPointCondition( TQObject *o, int line ) const
+{
+ return MetaDataBase::breakPointCondition( MainWindow::self->tqfindRealObject( o ), line );
+}
+
+void DesignerProjectImpl::setBreakPointCondition( TQObject *o, int line, const TQString &condition )
+{
+ MetaDataBase::setBreakPointCondition( MainWindow::self->tqfindRealObject( o ), line, condition );
+}
+
+void DesignerProjectImpl::clearAllBreakpoints() const
+{
+ TQValueList<uint> empty;
+ for ( TQPtrListIterator<SourceFile> sources = project->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ MetaDataBase::setBreakPoints( f, empty );
+ }
+ for ( TQPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ if ( forms.current()->formWindow() )
+ MetaDataBase::setBreakPoints( forms.current()->formWindow(), empty );
+ MainWindow::self->resetBreakPoints();
+ }
+}
+
+void DesignerProjectImpl::setIncludePath( const TQString &platform, const TQString &path )
+{
+ project->setIncludePath( platform, path );
+}
+
+void DesignerProjectImpl::setLibs( const TQString &platform, const TQString &path )
+{
+ project->setLibs( platform, path );
+}
+
+void DesignerProjectImpl::setDefines( const TQString &platform, const TQString &path )
+{
+ project->setDefines( platform, path );
+}
+
+void DesignerProjectImpl::setConfig( const TQString &platform, const TQString &config )
+{
+ project->setConfig( platform, config );
+}
+
+void DesignerProjectImpl::setTemplate( const TQString &t )
+{
+ project->setTemplate( t );
+}
+
+TQString DesignerProjectImpl::config( const TQString &platform ) const
+{
+ return project->config( platform );
+}
+
+TQString DesignerProjectImpl::libs( const TQString &platform ) const
+{
+ return project->libs( platform );
+}
+
+TQString DesignerProjectImpl::defines( const TQString &platform ) const
+{
+ return project->defines( platform );
+}
+
+TQString DesignerProjectImpl::includePath( const TQString &platform ) const
+{
+ return project->includePath( platform );
+}
+
+TQString DesignerProjectImpl::templte() const
+{
+ return project->templte();
+}
+
+bool DesignerProjectImpl::isGenericObject( TQObject *o ) const
+{
+ return !!project->fakeFormFileFor( o );
+}
+
+
+
+
+
+
+
+#ifndef TQT_NO_SQL
+DesignerDatabaseImpl::DesignerDatabaseImpl( DatabaseConnection *d )
+ : db( d )
+{
+}
+
+TQString DesignerDatabaseImpl::name() const
+{
+ return db->name();
+}
+
+void DesignerDatabaseImpl::setName( const TQString & )
+{
+}
+
+TQString DesignerDatabaseImpl::driver() const
+{
+ return db->driver();
+}
+
+void DesignerDatabaseImpl::setDriver( const TQString & )
+{
+}
+
+TQString DesignerDatabaseImpl::database() const
+{
+ return db->database();
+}
+
+void DesignerDatabaseImpl::setDatabase( const TQString & )
+{
+}
+
+TQString DesignerDatabaseImpl::userName() const
+{
+ return db->username();
+}
+
+void DesignerDatabaseImpl::setUserName( const TQString & )
+{
+}
+
+TQString DesignerDatabaseImpl::password() const
+{
+ return db->password();
+}
+
+void DesignerDatabaseImpl::setPassword( const TQString & )
+{
+}
+
+TQString DesignerDatabaseImpl::hostName() const
+{
+ return db->hostname();
+}
+
+void DesignerDatabaseImpl::setHostName( const TQString & )
+{
+}
+
+TQStringList DesignerDatabaseImpl::tables() const
+{
+ return db->tables();
+}
+
+TQMap<TQString, TQStringList> DesignerDatabaseImpl::fields() const
+{
+ return db->fields();
+}
+
+void DesignerDatabaseImpl::open( bool suppressDialog ) const
+{
+ db->open( suppressDialog );
+}
+
+void DesignerDatabaseImpl::close() const
+{
+ db->close();
+}
+
+void DesignerDatabaseImpl::setFields( const TQMap<TQString, TQStringList> & )
+{
+}
+
+void DesignerDatabaseImpl::setTables( const TQStringList & )
+{
+}
+
+TQSqlDatabase* DesignerDatabaseImpl::connection()
+{
+ return db->connection();
+}
+#endif
+
+
+
+DesignerPixmapCollectionImpl::DesignerPixmapCollectionImpl( PixmapCollection *coll )
+ : pixCollection( coll )
+{
+}
+
+void DesignerPixmapCollectionImpl::addPixmap( const TQPixmap &p, const TQString &name, bool force )
+{
+ PixmapCollection::Pixmap pix;
+ pix.pix = p;
+ pix.name = name;
+ pixCollection->addPixmap( pix, force );
+ FormWindow *fw = MainWindow::self->formWindow();
+ if ( fw )
+ MetaDataBase::setPixmapKey( fw, p.serialNumber(), name );
+}
+
+TQPixmap DesignerPixmapCollectionImpl::pixmap( const TQString &name ) const
+{
+ return pixCollection->pixmap( name );
+}
+
+
+
+DesignerFormWindowImpl::DesignerFormWindowImpl( FormWindow *fw )
+ : formWindow( fw )
+{
+}
+
+TQString DesignerFormWindowImpl::name() const
+{
+ return formWindow->name();
+ }
+
+void DesignerFormWindowImpl::setName( const TQString &n )
+{
+ formWindow->setName( n );
+}
+
+TQString DesignerFormWindowImpl::fileName() const
+{
+ return formWindow->fileName();
+}
+
+void DesignerFormWindowImpl::setFileName( const TQString & )
+{
+}
+
+void DesignerFormWindowImpl::save() const
+{
+}
+
+bool DesignerFormWindowImpl::isModified() const
+{
+ return formWindow->commandHistory()->isModified();
+}
+
+void DesignerFormWindowImpl::insertWidget( TQWidget * )
+{
+}
+
+TQWidget *DesignerFormWindowImpl::create( const char *className, TQWidget *tqparent, const char *name )
+{
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( className ), tqparent, name );
+ formWindow->insertWidget( w, TRUE );
+ formWindow->killAccels( formWindow->mainContainer() );
+ return w;
+}
+
+void DesignerFormWindowImpl::removeWidget( TQWidget * )
+{
+}
+
+TQWidgetList DesignerFormWindowImpl::widgets() const
+{
+ return TQWidgetList();
+}
+
+void DesignerFormWindowImpl::undo()
+{
+}
+
+void DesignerFormWindowImpl::redo()
+{
+}
+
+void DesignerFormWindowImpl::cut()
+{
+}
+
+void DesignerFormWindowImpl::copy()
+{
+}
+
+void DesignerFormWindowImpl::paste()
+{
+}
+
+void DesignerFormWindowImpl::adjustSize()
+{
+}
+
+void DesignerFormWindowImpl::editConnections()
+{
+}
+
+void DesignerFormWindowImpl::checkAccels()
+{
+}
+
+void DesignerFormWindowImpl::layoutH()
+{
+ formWindow->layoutHorizontal();
+}
+
+void DesignerFormWindowImpl::layoutV()
+{
+}
+
+void DesignerFormWindowImpl::layoutHSplit()
+{
+}
+
+void DesignerFormWindowImpl::layoutVSplit()
+{
+}
+
+void DesignerFormWindowImpl::layoutG()
+{
+ formWindow->layoutGrid();
+}
+
+void DesignerFormWindowImpl::layoutHContainer( TQWidget* w )
+{
+ formWindow->layoutHorizontalContainer( w );
+}
+
+void DesignerFormWindowImpl::layoutVContainer( TQWidget* w )
+{
+ formWindow->layoutVerticalContainer( w );
+}
+
+void DesignerFormWindowImpl::layoutGContainer( TQWidget* w )
+{
+ formWindow->layoutGridContainer( w );
+}
+
+void DesignerFormWindowImpl::breakLayout()
+{
+}
+
+void DesignerFormWindowImpl::selectWidget( TQWidget * w )
+{
+ formWindow->selectWidget( w, TRUE );
+}
+
+void DesignerFormWindowImpl::selectAll()
+{
+}
+
+void DesignerFormWindowImpl::clearSelection()
+{
+ formWindow->clearSelection();
+}
+
+bool DesignerFormWindowImpl::isWidgetSelected( TQWidget * ) const
+{
+ return FALSE;
+}
+
+TQWidgetList DesignerFormWindowImpl::selectedWidgets() const
+{
+ return formWindow->selectedWidgets();
+}
+
+TQWidget *DesignerFormWindowImpl::currentWidget() const
+{
+ return formWindow->currentWidget();
+}
+
+TQWidget *DesignerFormWindowImpl::form() const
+{
+ return formWindow;
+}
+
+
+void DesignerFormWindowImpl::setCurrentWidget( TQWidget * )
+{
+}
+
+TQPtrList<TQAction> DesignerFormWindowImpl::actionList() const
+{
+ return TQPtrList<TQAction>();
+}
+
+TQAction *DesignerFormWindowImpl::createAction( const TQString& text, const TQIconSet& icon, const TQString& menuText, int accel,
+ TQObject* tqparent, const char* name, bool toggle )
+{
+ TQDesignerAction *a = new TQDesignerAction( tqparent );
+ a->setName( name );
+ a->setText( text );
+ if ( !icon.isNull() && !icon.pixmap().isNull() )
+ a->setIconSet( icon );
+ a->setMenuText( menuText );
+ a->setAccel( accel );
+ a->setToggleAction( toggle );
+ return a;
+}
+
+void DesignerFormWindowImpl::addAction( TQAction *a )
+{
+ if ( formWindow->actionList().tqfindRef( a ) != -1 )
+ return;
+ formWindow->actionList().append( a );
+ MetaDataBase::addEntry( a );
+ setPropertyChanged( a, "name", TRUE );
+ setPropertyChanged( a, "text", TRUE );
+ setPropertyChanged( a, "menuText", TRUE );
+ setPropertyChanged( a, "accel", TRUE );
+ if ( !a->iconSet().isNull() && !a->iconSet().pixmap().isNull() )
+ setPropertyChanged( a, "iconSet", TRUE );
+}
+
+void DesignerFormWindowImpl::removeAction( TQAction *a )
+{
+ formWindow->actionList().removeRef( a );
+}
+
+void DesignerFormWindowImpl::preview() const
+{
+}
+
+void DesignerFormWindowImpl::addConnection( TQObject *sender, const char *signal, TQObject *receiver, const char *slot )
+{
+ MetaDataBase::addConnection( formWindow, sender, signal, receiver, slot );
+}
+
+void DesignerFormWindowImpl::addFunction( const TQCString &function, const TQString &specifier,
+ const TQString &access, const TQString &type,
+ const TQString &language, const TQString &returnType )
+{
+ MetaDataBase::addFunction( formWindow, function, specifier, access, type, language, returnType );
+ formWindow->mainWindow()->functionsChanged();
+}
+
+
+
+void DesignerFormWindowImpl::setProperty( TQObject *o, const char *property, const TQVariant &value )
+{
+ int id = o->tqmetaObject()->tqfindProperty( property, TRUE );
+ const TQMetaProperty* p = o->tqmetaObject()->property( id, TRUE );
+ if ( p && p->isValid() )
+ o->setProperty( property, value );
+ else
+ MetaDataBase::setFakeProperty( o, property, value );
+}
+
+TQVariant DesignerFormWindowImpl::property( TQObject *o, const char *prop ) const
+{
+ int id = o->tqmetaObject()->tqfindProperty( prop, TRUE );
+ const TQMetaProperty* p = o->tqmetaObject()->property( id, TRUE );
+ if ( p && p->isValid() )
+ return o->property( prop );
+ return MetaDataBase::fakeProperty( o, prop );
+}
+
+void DesignerFormWindowImpl::setPropertyChanged( TQObject *o, const char *property, bool changed )
+{
+ MetaDataBase::setPropertyChanged( o, property, changed );
+}
+
+bool DesignerFormWindowImpl::isPropertyChanged( TQObject *o, const char *property ) const
+{
+ return MetaDataBase::isPropertyChanged( o, property );
+}
+
+void DesignerFormWindowImpl::setColumnFields( TQObject *o, const TQMap<TQString, TQString> &f )
+{
+ MetaDataBase::setColumnFields( o, f );
+}
+
+TQStringList DesignerFormWindowImpl::implementationIncludes() const
+{
+ TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formWindow );
+ TQStringList lst;
+ for ( TQValueList<MetaDataBase::Include>::Iterator it = includes.begin(); it != includes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl != "in implementation" )
+ continue;
+ TQString s = inc.header;
+ if ( inc.location == "global" ) {
+ s.prepend( "<" );
+ s.append( ">" );
+ } else {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ lst << s;
+ }
+ return lst;
+}
+
+TQStringList DesignerFormWindowImpl::declarationIncludes() const
+{
+ TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formWindow );
+ TQStringList lst;
+ for ( TQValueList<MetaDataBase::Include>::Iterator it = includes.begin(); it != includes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl == "in implementation" )
+ continue;
+ TQString s = inc.header;
+ if ( inc.location == "global" ) {
+ s.prepend( "<" );
+ s.append( ">" );
+ } else {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ lst << s;
+ }
+ return lst;
+}
+
+void DesignerFormWindowImpl::setImplementationIncludes( const TQStringList &lst )
+{
+ TQValueList<MetaDataBase::Include> oldIncludes = MetaDataBase::includes( formWindow );
+ TQValueList<MetaDataBase::Include> includes;
+ for ( TQValueList<MetaDataBase::Include>::Iterator it = oldIncludes.begin(); it != oldIncludes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl == "in implementation" )
+ continue;
+ includes << inc;
+ }
+
+ for ( TQStringList::ConstIterator sit = lst.begin(); sit != lst.end(); ++sit ) {
+ TQString s = *sit;
+ if ( s.startsWith( "#include" ) )
+ s.remove( (uint)0, 8 );
+ s = s.simplifyWhiteSpace();
+ if ( s[ 0 ] != '<' && s[ 0 ] != '"' ) {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ if ( s[ 0 ] == '<' ) {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in implementation";
+ inc.location = "global";
+ includes << inc;
+ } else {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in implementation";
+ inc.location = "local";
+ includes << inc;
+ }
+ }
+ MetaDataBase::setIncludes( formWindow, includes );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+void DesignerFormWindowImpl::setDeclarationIncludes( const TQStringList &lst )
+{
+ TQValueList<MetaDataBase::Include> oldIncludes = MetaDataBase::includes( formWindow );
+ TQValueList<MetaDataBase::Include> includes;
+ for ( TQValueList<MetaDataBase::Include>::Iterator it = oldIncludes.begin(); it != oldIncludes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl == "in declaration" )
+ continue;
+ includes << inc;
+ }
+
+ for ( TQStringList::ConstIterator sit = lst.begin(); sit != lst.end(); ++sit ) {
+ TQString s = *sit;
+ if ( s.startsWith( "#include" ) )
+ s.remove( (uint)0, 8 );
+ s = s.simplifyWhiteSpace();
+ if ( s[ 0 ] != '<' && s[ 0 ] != '"' ) {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ if ( s[ 0 ] == '<' ) {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in declaration";
+ inc.location = "global";
+ includes << inc;
+ } else {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in declaration";
+ inc.location = "local";
+ includes << inc;
+ }
+ }
+ MetaDataBase::setIncludes( formWindow, includes );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+TQStringList DesignerFormWindowImpl::forwardDeclarations() const
+{
+ return MetaDataBase::forwards( formWindow );
+}
+
+void DesignerFormWindowImpl::setForwardDeclarations( const TQStringList &lst )
+{
+ MetaDataBase::setForwards( formWindow, lst );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+TQStringList DesignerFormWindowImpl::signalList() const
+{
+ return MetaDataBase::signalList( formWindow );
+}
+
+void DesignerFormWindowImpl::setSignalList( const TQStringList &lst )
+{
+ MetaDataBase::setSignalList( formWindow, lst );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+void DesignerFormWindowImpl::onModificationChange( TQObject *receiver, const char *slot )
+{
+ TQObject::connect( formWindow, TQT_SIGNAL( modificationChanged( bool, FormWindow * ) ), receiver, slot );
+}
+
+void DesignerFormWindowImpl::addMenu( const TQString &text, const TQString &name )
+{
+ if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
+ return;
+
+ TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
+ PopupMenuEditor *popup = new PopupMenuEditor( formWindow, mw );
+ TQString n = name;
+ formWindow->unify( popup, n, TRUE );
+ popup->setName( n );
+ MenuBarEditor *mb = (MenuBarEditor *)mw->child( 0, "MenuBarEditor" );
+ if ( !mb ) {
+ mb = new MenuBarEditor( formWindow, mw );
+ mb->setName( "MenuBar" );
+ MetaDataBase::addEntry( mb );
+ }
+ mb->insertItem( text, popup );
+ MetaDataBase::addEntry( popup );
+}
+
+void DesignerFormWindowImpl::addMenuAction( const TQString &menu, TQAction *a )
+{
+ if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
+ return;
+ TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
+ if ( !mw->child( 0, "MenuBarEditor" ) )
+ return;
+ PopupMenuEditor *popup = (PopupMenuEditor*)mw->child( menu, "PopupMenuEditor" );
+ if ( !popup )
+ return;
+ popup->insert( a );
+}
+
+void DesignerFormWindowImpl::addMenuSeparator( const TQString &menu )
+{
+ if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
+ return;
+ TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
+ if ( !mw->child( 0, "MenuBarEditor" ) )
+ return;
+ PopupMenuEditor *popup = (PopupMenuEditor*)mw->child( menu, "PopupMenuEditor" );
+ if ( !popup )
+ return;
+ TQAction *a = new TQSeparatorAction( 0 );
+ popup->insert( a );
+}
+
+void DesignerFormWindowImpl::addToolBar( const TQString &text, const TQString &name )
+{
+ if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
+ return;
+ TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
+ TQToolBar *tb = new TQDesignerToolBar( mw );
+ TQString n = name;
+ formWindow->unify( tb, n, TRUE );
+ tb->setName( n );
+ mw->addToolBar( tb, text );
+}
+
+void DesignerFormWindowImpl::addToolBarAction( const TQString &tbn, TQAction *a )
+{
+ if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
+ return;
+ TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
+ TQDesignerToolBar *tb = (TQDesignerToolBar*)mw->child( tbn, "TQDesignerToolBar" );
+ if ( !tb )
+ return;
+ a->addTo( tb );
+ tb->addAction( a );
+}
+
+void DesignerFormWindowImpl::addToolBarSeparator( const TQString &tbn )
+{
+ if ( !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) )
+ return;
+ TQMainWindow *mw = (TQMainWindow*)formWindow->mainContainer();
+ TQDesignerToolBar *tb = (TQDesignerToolBar*)mw->child( tbn, "TQDesignerToolBar" );
+ if ( !tb )
+ return;
+ TQAction *a = new TQSeparatorAction( 0 );
+ a->addTo( tb );
+ tb->addAction( a );
+}
+
+DesignerDockImpl::DesignerDockImpl()
+{
+}
+
+TQDockWindow *DesignerDockImpl::dockWindow() const
+{
+ return 0;
+}
+
+DesignerOutputDockImpl::DesignerOutputDockImpl( OutputWindow *ow )
+ : outWin( ow )
+{
+}
+
+TQWidget *DesignerOutputDockImpl::addView( const TQString &title )
+{
+ TQWidget *page = new TQWidget( outWin );
+ outWin->addTab( page, title );
+ return page;
+}
+
+void DesignerOutputDockImpl::appendDebug( const TQString &s )
+{
+ outWin->appendDebug( s );
+}
+
+void DesignerOutputDockImpl::clearDebug()
+{
+}
+
+void DesignerOutputDockImpl::appendError( const TQString &s, int l )
+{
+ TQStringList ls;
+ ls << s;
+ TQValueList<uint> ll;
+ ll << l;
+ outWin->setErrorMessages( ls, ll, FALSE, TQStringList(), TQObjectList() );
+}
+
+void DesignerOutputDockImpl::clearError()
+{
+}
+
+DesignerSourceFileImpl::DesignerSourceFileImpl( SourceFile *e )
+ : ed( e )
+{
+}
+
+TQString DesignerSourceFileImpl::fileName() const
+{
+ return ed->fileName();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/designerappiface.h b/tqtinterface/qt4/tools/designer/designer/designerappiface.h
new file mode 100644
index 0000000..7a58e23
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/designerappiface.h
@@ -0,0 +1,284 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DESIGNERAPPIFACE_H
+#define DESIGNERAPPIFACE_H
+
+#include "../interfaces/designerinterface.h"
+#include "project.h"
+
+class FormWindow;
+class MainWindow;
+class Project;
+class OutputWindow;
+class SourceFile;
+
+class DesignerInterfaceImpl : public DesignerInterface
+{
+public:
+ DesignerInterfaceImpl( MainWindow *mw );
+
+ DesignerProject *currentProject() const;
+ DesignerFormWindow *currentForm() const;
+ DesignerSourceFile *currentSourceFile() const;
+ TQPtrList<DesignerProject> projectList() const;
+ void showtqStatusMessage( const TQString &, int ms = 0 ) const;
+ DesignerDock *createDock() const;
+ DesignerOutputDock *outputDock() const;
+ void setModified( bool b, TQWidget *window );
+ void updateFunctionList();
+
+ void onProjectChange( TQObject *receiver, const char *slot );
+ void onFormChange( TQObject *receiver, const char *slot );
+
+ bool singleProjectMode() const;
+ void showError( TQWidget *widget, int line, const TQString &message );
+ void runFinished();
+ void showStackFrame( TQWidget *w, int line );
+ void showDebugStep( TQWidget *w, int line );
+ void runProjectPrecondition();
+ void runProjectPostcondition( TQObjectList *l );
+
+
+ TQRESULT queryInterface( const TQUuid &uuid, TQUnknownInterface** iface );
+ TQ_REFCOUNT
+
+private:
+ MainWindow *mainWindow;
+
+};
+
+class DesignerProjectImpl: public DesignerProject
+{
+public:
+ DesignerProjectImpl( Project *pr );
+
+ TQPtrList<DesignerFormWindow> formList() const;
+ TQStringList formNames() const;
+ TQString formFileName( const TQString &form ) const;
+ void addForm( DesignerFormWindow * );
+ void removeForm( DesignerFormWindow * );
+ TQString fileName() const;
+ void setFileName( const TQString & );
+ TQString projectName() const;
+ void setProjectName( const TQString & );
+ TQString databaseFile() const;
+ void setDatabaseFile( const TQString & );
+ void setupDatabases() const;
+ TQPtrList<DesignerDatabase> databaseConnections() const;
+ void addDatabase( DesignerDatabase * );
+ void removeDatabase( DesignerDatabase * );
+ void save() const;
+ void setLanguage( const TQString & );
+ TQString language() const;
+ void setCustomSetting( const TQString &key, const TQString &value );
+ TQString customSetting( const TQString &key ) const;
+ DesignerPixmapCollection *pixmapCollection() const;
+ void breakPoints( TQMap<TQString, TQValueList<uint> > &bps ) const;
+ TQString breakPointCondition( TQObject *o, int line ) const;
+ void setBreakPointCondition( TQObject *o, int line, const TQString &condition );
+ void clearAllBreakpoints() const;
+ void setIncludePath( const TQString &platform, const TQString &path );
+ void setLibs( const TQString &platform, const TQString &path );
+ void setDefines( const TQString &platform, const TQString &path );
+ void setConfig( const TQString &platform, const TQString &config );
+ void setTemplate( const TQString &t );
+ TQString config( const TQString &platform ) const;
+ TQString libs( const TQString &platform ) const;
+ TQString defines( const TQString &platform ) const;
+ TQString includePath( const TQString &platform ) const;
+ TQString templte() const;
+ bool isGenericObject( TQObject *o ) const;
+
+private:
+ Project *project;
+
+};
+
+#ifndef TQT_NO_SQL
+class TQSqlDatabase;
+
+class DesignerDatabaseImpl: public DesignerDatabase
+{
+public:
+ DesignerDatabaseImpl( DatabaseConnection *d );
+
+ TQString name() const;
+ void setName( const TQString & );
+ TQString driver() const;
+ void setDriver( const TQString & );
+ TQString database() const;
+ void setDatabase( const TQString & );
+ TQString userName() const;
+ void setUserName( const TQString & );
+ TQString password() const;
+ void setPassword( const TQString & );
+ TQString hostName() const;
+ void setHostName( const TQString & );
+ TQStringList tables() const;
+ void setTables( const TQStringList & );
+ TQMap<TQString, TQStringList> fields() const;
+ void setFields( const TQMap<TQString, TQStringList> & );
+ void open( bool suppressDialog = TRUE ) const;
+ void close() const;
+ TQSqlDatabase* connection();
+private:
+ DatabaseConnection *db;
+
+};
+#endif
+
+class DesignerPixmapCollectionImpl : public DesignerPixmapCollection
+{
+public:
+ DesignerPixmapCollectionImpl( PixmapCollection *coll );
+ void addPixmap( const TQPixmap &p, const TQString &name, bool force );
+ TQPixmap pixmap( const TQString &name ) const;
+
+private:
+ PixmapCollection *pixCollection;
+
+};
+
+class DesignerFormWindowImpl: public DesignerFormWindow
+{
+public:
+ DesignerFormWindowImpl( FormWindow *fw );
+
+ TQString name() const;
+ void setName( const TQString &n );
+ TQString fileName() const;
+ void setFileName( const TQString & );
+ void save() const;
+ bool isModified() const;
+ void insertWidget( TQWidget * );
+ TQWidget *create( const char *className, TQWidget *tqparent, const char *name );
+ void removeWidget( TQWidget * );
+ TQWidgetList widgets() const;
+ void undo();
+ void redo();
+ void cut();
+ void copy();
+ void paste();
+ void adjustSize();
+ void editConnections();
+ void checkAccels();
+ void layoutH();
+ void layoutV();
+ void layoutHSplit();
+ void layoutVSplit();
+ void layoutG();
+ void layoutHContainer( TQWidget* w );
+ void layoutVContainer( TQWidget* w );
+ void layoutGContainer( TQWidget* w );
+ void breakLayout();
+ void selectWidget( TQWidget * );
+ void selectAll();
+ void clearSelection();
+ bool isWidgetSelected( TQWidget * ) const;
+ TQWidgetList selectedWidgets() const;
+ TQWidget *currentWidget() const;
+ TQWidget *form() const;
+ void setCurrentWidget( TQWidget * );
+ TQPtrList<TQAction> actionList() const;
+ TQAction *createAction( const TQString& text, const TQIconSet& icon, const TQString& menuText, int accel,
+ TQObject* tqparent, const char* name = 0, bool toggle = FALSE );
+ void addAction( TQAction * );
+ void removeAction( TQAction * );
+ void preview() const;
+ void addFunction( const TQCString &function, const TQString& specifier, const TQString &access,
+ const TQString &type, const TQString &language, const TQString &returnType );
+ void addConnection( TQObject *sender, const char *signal, TQObject *receiver, const char *slot );
+ void setProperty( TQObject *o, const char *property, const TQVariant &value );
+ TQVariant property( TQObject *o, const char *property ) const;
+ void setPropertyChanged( TQObject *o, const char *property, bool changed );
+ bool isPropertyChanged( TQObject *o, const char *property ) const;
+ void setColumnFields( TQObject *o, const TQMap<TQString, TQString> & );
+ TQStringList implementationIncludes() const;
+ TQStringList declarationIncludes() const;
+ void setImplementationIncludes( const TQStringList &lst );
+ void setDeclarationIncludes( const TQStringList &lst );
+ TQStringList forwardDeclarations() const;
+ void setForwardDeclarations( const TQStringList &lst );
+ TQStringList signalList() const;
+ void setSignalList( const TQStringList &lst );
+ void addMenu( const TQString &text, const TQString &name );
+ void addMenuAction( const TQString &menu, TQAction *a );
+ void addMenuSeparator( const TQString &menu );
+ void addToolBar( const TQString &text, const TQString &name );
+ void addToolBarAction( const TQString &tb, TQAction *a );
+ void addToolBarSeparator( const TQString &tb );
+
+ void onModificationChange( TQObject *receiver, const char *slot );
+
+private:
+ FormWindow *formWindow;
+
+};
+
+class DesignerDockImpl: public DesignerDock
+{
+public:
+ DesignerDockImpl();
+
+ TQDockWindow *dockWindow() const;
+};
+
+class DesignerOutputDockImpl: public DesignerOutputDock
+{
+public:
+ DesignerOutputDockImpl( OutputWindow *ow );
+
+ TQWidget *addView( const TQString &pageName );
+ void appendDebug( const TQString & );
+ void clearDebug();
+ void appendError( const TQString &, int );
+ void clearError();
+
+private:
+ OutputWindow *outWin;
+
+};
+
+class DesignerSourceFileImpl : public DesignerSourceFile
+{
+public:
+ DesignerSourceFileImpl( SourceFile *e );
+ TQString fileName() const;
+
+private:
+ SourceFile *ed;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/editfunctions.ui b/tqtinterface/qt4/tools/designer/designer/editfunctions.ui
new file mode 100644
index 0000000..5d95587
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/editfunctions.ui
@@ -0,0 +1,721 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>EditFunctionsBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>EditFunctionsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>371</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Functions</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Functions&lt;/b&gt;&lt;p&gt;Add, edit or delete the current form's Q_SLOTS or functions.&lt;/p&gt;&lt;p&gt;Click the &lt;b&gt;Add Function&lt;/b&gt;-button to create a new function; enter a name, choose an access mode and specify if it should be a slot or normal function.&lt;/p&gt;&lt;p&gt;Select an entry from the list and click the &lt;b&gt;Delete Function&lt;/b&gt;-button to remove a function; in case of a slot all connections using this slot will also be removed.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListView">
+ <column>
+ <property name="text">
+ <string>Function</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Return Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Specifier</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>In Use</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>functionListView</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;This form's functions.&lt;/b&gt;&lt;p&gt;Select the function you want to change or delete.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>showOnlySlots</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="text">
+ <string>Only d&amp;isplay Q_SLOTS</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change displaying mode for functions</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Check this button if only the Q_SLOTS should be displayed&lt;/b&gt;&lt;p&gt;Otherwise all functions, i.e. normal C++ functions and Q_SLOTS are displayed.&lt;/p&gt;
+</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Vertical Spacing1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>addFunction</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Function</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new function</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new function.&lt;/b&gt;&lt;p&gt;New functions have a default name and public access.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>deleteFunction</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Function</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete function</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected function.&lt;/b&gt;&lt;p&gt;All connections using this function are also removed.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>boxProperties</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Function Properties</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout14</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>Label8</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Function:</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionName</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>functionName</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the name of the selected function.&lt;/b&gt;&lt;p&gt;The name should include the argument list and must be syntactically correct.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelType</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Return type:</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editType</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>editType</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change the return type of the function</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the return type of the selected function.&lt;/b&gt;&lt;p&gt;Specifiy here the datatype which should be returned by the function.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer6_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>Label9_2</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;pecifier:</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionSpecifier</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>non virtual</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>virtual</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>pure virtual</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>static</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>functionSpecifier</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the access policy of the function&lt;/b&gt;&lt;p&gt;All functions are created virtual and should be reimplemented in subclasses.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Access:</string>
+ </property>
+ <property name="tqalignment">
+ <set>WordBreak|AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionAccess</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>public</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>protected</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>private</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>functionAccess</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the access policy of the function&lt;/b&gt;&lt;p&gt;All functions are created virtual and should be reimplemented in subclasses.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Type:</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionType</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>slot</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>function</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>functionType</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function type</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the type of the function.&lt;/b&gt;&lt;p&gt;The type specifies if the function is either a slot or a normal C++ function.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>deleteFunction</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>functionRemove()</slot>
+ </connection>
+ <connection>
+ <sender>addFunction</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>functionAdd()</slot>
+ </connection>
+ <connection>
+ <sender>functionName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionListView</sender>
+ <signal>selectionChanged(TQListViewItem*)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentItemChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>functionListView</sender>
+ <signal>currentChanged(TQListViewItem*)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentItemChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>editType</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentReturnTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionSpecifier</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentSpecifierChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionAccess</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentAccessChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionType</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>showOnlySlots</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>displaySlots(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>functionName</tabstop>
+ <tabstop>editType</tabstop>
+ <tabstop>functionSpecifier</tabstop>
+ <tabstop>functionAccess</tabstop>
+ <tabstop>functionType</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ <tabstop>functionListView</tabstop>
+ <tabstop>showOnlySlots</tabstop>
+ <tabstop>addFunction</tabstop>
+ <tabstop>deleteFunction</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">currentItemChanged( TQListViewItem * )</slot>
+ <slot access="protected">currentSpecifierChanged( const QString &amp; )</slot>
+ <slot access="protected">currentTextChanged( const QString &amp; )</slot>
+ <slot access="protected">currentReturnTypeChanged( const QString &amp; )</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">init()</slot>
+ <slot access="protected">currentAccessChanged( const QString &amp; )</slot>
+ <slot access="protected">currentTypeChanged( const QString &amp; )</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">functionAdd()</slot>
+ <slot access="protected">functionRemove()</slot>
+ <slot access="protected">displaySlots( bool )</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.cpp b/tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.cpp
new file mode 100644
index 0000000..062a79c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.cpp
@@ -0,0 +1,536 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "editfunctionsimpl.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "asciivalidator.h"
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "project.h"
+
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqstrlist.h>
+#include <tqmessagebox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqgroupbox.h>
+#include <tqheader.h>
+#include <tqcheckbox.h>
+
+EditFunctions::EditFunctions( TQWidget *tqparent, FormWindow *fw, bool justSlots )
+ : EditFunctionsBase( tqparent, 0, TRUE ), formWindow( fw )
+{
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+
+ id = 0;
+ functList.clear();
+
+ TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( fw );
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = functionList.begin(); it != functionList.end(); ++it ) {
+ TQListViewItem *i = new TQListViewItem( functionListView );
+
+ i->setPixmap( 0, TQPixmap::fromMimeSource( "designer_editTslots.png" ) );
+ i->setText( 0, (*it).function );
+ i->setText( 1, (*it).returnType );
+ i->setText( 2, (*it).specifier );
+ i->setText( 3, (*it).access );
+ i->setText( 4, (*it).type );
+
+ FunctItem fui;
+ fui.id = id;
+ fui.oldName = (*it).function;
+ fui.newName = fui.oldName;
+ fui.oldRetTyp = (*it).returnType;
+ fui.retTyp = fui.oldRetTyp;
+ fui.oldSpec = (*it).specifier;
+ fui.spec = fui.oldSpec;
+ fui.oldAccess = (*it).access;
+ fui.access = fui.oldAccess;
+ fui.oldType = (*it).type;
+ fui.type = fui.oldType;
+ functList.append( fui );
+
+ functionIds.insert( i, id );
+ id++;
+
+ if ( (*it).type == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow, MetaDataBase::normalizeFunction( (*it).function ).latin1() ) )
+ i->setText( 5, tr( "Yes" ) );
+ else
+ i->setText( 5, tr( "No" ) );
+ } else {
+ i->setText( 5, "---" );
+ }
+ }
+
+ boxProperties->setEnabled( FALSE );
+ functionName->setValidator( new AsciiValidator( TRUE, TQT_TQOBJECT(functionName) ) );
+
+ if ( functionListView->firstChild() )
+ functionListView->setCurrentItem( functionListView->firstChild() );
+
+ showOnlySlots->setChecked( justSlots );
+ lastType = "function";
+
+ // Enable rename for all TQListViewItems
+ TQListViewItemIterator lvit = functionListView->firstChild();
+ for ( ; *lvit; lvit++ )
+ (*lvit)->setRenameEnabled( 0, TRUE );
+
+ // Connect listview signal to signal-relay
+ TQObject::connect( functionListView,
+ TQT_SIGNAL( itemRenamed( TQListViewItem*, int, const TQString & ) ),
+ this,
+ TQT_SLOT( emitItemRenamed(TQListViewItem*, int, const TQString&) ) );
+
+ // Connect signal-relay to TQLineEdit "functionName"
+ TQObjectList *l = tqparent->queryList( "TQLineEdit", "functionName" );
+ TQObject *obj;
+ TQObjectListIt itemsLineEditIt( *l );
+ while ( (obj = itemsLineEditIt.current()) != 0 ) {
+ ++itemsLineEditIt;
+ TQObject::connect( this,
+ TQT_SIGNAL( itemRenamed( const TQString & ) ),
+ obj,
+ TQT_SLOT( setText( const TQString & ) ) );
+ }
+ delete l;
+}
+
+void EditFunctions::okClicked()
+{
+ TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow );
+ TQString n = tr( "Add/Remove functions of '%1'" ).arg( formWindow->name() );
+ TQPtrList<Command> commands;
+ TQValueList<MetaDataBase::Function>::Iterator fit;
+ if ( !functionList.isEmpty() ) {
+ for ( fit = functionList.begin(); fit != functionList.end(); ++fit ) {
+ bool functionFound = FALSE;
+ TQValueList<FunctItem>::Iterator it = functList.begin();
+ for ( ; it != functList.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).oldName ) ==
+ MetaDataBase::normalizeFunction( (*fit).function ) ) {
+ functionFound = TRUE;
+ break;
+ }
+ }
+ if ( !functionFound )
+ commands.append( new RemoveFunctionCommand( tr( "Remove function" ),
+ formWindow, (*fit).function, (*fit).specifier,
+ (*fit).access,
+ (*fit).type,
+ formWindow->project()->language(),
+ (*fit).returnType ) );
+ }
+ }
+
+ bool invalidFunctions = FALSE;
+ TQValueList<FunctItem> invalidItems;
+
+ if ( !functList.isEmpty() ) {
+ TQStrList lst;
+ TQValueList<FunctItem>::Iterator it = functList.begin();
+ for ( ; it != functList.end(); ++it ) {
+ MetaDataBase::Function function;
+ function.function = (*it).newName;
+ function.returnType = (*it).retTyp;
+ function.specifier = (*it).spec;
+ function.access = (*it).access;
+ function.type = (*it).type;
+ function.language = formWindow->project()->language();
+ if ( function.returnType.isEmpty() )
+ function.returnType = "void";
+ TQString s = function.function;
+ s = s.simplifyWhiteSpace();
+ bool startNum = s[ 0 ] >= '0' && s[ 0 ] <= '9';
+ bool noParens = s.tqcontains( '(' ) != 1 || s.tqcontains( ')' ) != 1;
+ bool illegalSpace = s.tqfind( ' ' ) != -1 && s.tqfind( ' ' ) < s.tqfind( '(' );
+
+ if ( startNum || noParens || illegalSpace || lst.tqfind( function.function ) != -1 ) {
+ invalidFunctions = TRUE;
+ invalidItems.append( (*it) );
+ continue;
+ }
+ bool functionFound = FALSE;
+ for ( fit = functionList.begin(); fit != functionList.end(); ++fit ) {
+ if ( MetaDataBase::normalizeFunction( (*fit).function ) ==
+ MetaDataBase::normalizeFunction( (*it).oldName ) ) {
+ functionFound = TRUE;
+ break;
+ }
+ }
+ if ( !functionFound )
+ commands.append( new AddFunctionCommand( tr( "Add function" ),
+ formWindow, function.function, function.specifier,
+ function.access,
+ function.type, formWindow->project()->language(),
+ function.returnType ) );
+ if ( MetaDataBase::normalizeFunction( (*it).newName ) != MetaDataBase::normalizeFunction( (*it).oldName ) ||
+ (*it).spec != (*it).oldSpec || (*it).access != (*it).oldAccess || (*it).type != (*it).oldType ||
+ (*it).retTyp != (*it).oldRetTyp ) {
+ TQString normalizedOldName = MetaDataBase::normalizeFunction( (*it).oldName );
+ if ((*it).oldName.endsWith("const")) // make sure we get the 'const' when we remove the old name
+ normalizedOldName += " const";
+ commands.append( new ChangeFunctionAttribCommand( tr( "Change function attributes" ),
+ formWindow, function, normalizedOldName,
+ (*it).oldSpec, (*it).oldAccess, (*it).oldType,
+ formWindow->project()->language(), (*it).oldRetTyp ) );
+ }
+ lst.append( function.function );
+ }
+ }
+
+ if ( invalidFunctions ) {
+ if ( TQMessageBox::information( this, tr( "Edit Functions" ),
+ tr( "Some syntactically incorrect functions have been defined.\n"
+ "Remove these functions?" ), tr( "&Yes" ), tr( "&No" ) ) == 0 ) {
+ TQValueList<FunctItem>::Iterator it = functList.begin();
+ while ( it != functList.end() ) {
+ bool found = FALSE;
+ TQValueList<FunctItem>::Iterator vit = invalidItems.begin();
+ for ( ; vit != invalidItems.end(); ++vit ) {
+ if ( (*vit).newName == (*it).newName ) {
+ invalidItems.remove( vit );
+ found = TRUE;
+ break;
+ }
+ }
+ if ( found ) {
+ int delId = (*it).id;
+ it = functList.remove( it );
+ TQMap<TQListViewItem*, int>::Iterator fit = functionIds.begin();
+ while ( fit != functionIds.end() ) {
+ if ( *fit == delId ) {
+ TQListViewItem *litem = fit.key();
+ functionIds.remove( fit );
+ delete litem;
+ if ( functionListView->currentItem() )
+ functionListView->setSelected( functionListView->currentItem(), TRUE );
+ currentItemChanged( functionListView->currentItem() );
+ break;
+ }
+ ++fit;
+ }
+ }
+ else
+ ++it;
+ }
+ if ( functionListView->firstChild() ) {
+ functionListView->setCurrentItem( functionListView->firstChild() );
+ functionListView->setSelected( functionListView->firstChild(), TRUE );
+ }
+ }
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ return;
+ }
+
+ if ( !commands.isEmpty() ) {
+ MacroCommand *cmd = new MacroCommand( n, formWindow, commands );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ accept();
+}
+
+void EditFunctions::functionAdd( const TQString &access, const TQString &type )
+{
+ TQListViewItem *i = new TQListViewItem( functionListView );
+ i->setPixmap( 0, TQPixmap::fromMimeSource( "designer_editTslots.png" ) );
+ i->setRenameEnabled( 0, TRUE );
+ i->setText( 1, "void" );
+ i->setText( 2, "virtual" );
+
+ if ( access.isEmpty() )
+ i->setText( 3, "public" );
+ else
+ i->setText( 3, access );
+
+ if( type.isEmpty() ) {
+ if ( showOnlySlots->isChecked() )
+ i->setText( 4, "slot" );
+ else {
+ i->setText( 4, lastType );
+ }
+ } else {
+ i->setText( 4, type );
+ }
+
+ if ( i->text( 4 ) == "slot" ) {
+ i->setText( 0, "newSlot()" );
+ if ( MetaDataBase::isSlotUsed( formWindow, "newSlot()" ) )
+ i->setText( 5, tr( "Yes" ) );
+ else
+ i->setText( 5, tr( "No" ) );
+ } else {
+ i->setText( 0, "newFunction()" );
+ i->setText( 5, "---" );
+ }
+
+ functionListView->setCurrentItem( i );
+ functionListView->setSelected( i, TRUE );
+ functionListView->ensureItemVisible( i );
+ functionName->setFocus();
+ functionName->selectAll();
+
+ FunctItem fui;
+ fui.id = id;
+ fui.oldName = i->text( 0 );
+ fui.newName = fui.oldName;
+ fui.oldRetTyp = i->text( 1 );
+ fui.retTyp = fui.oldRetTyp;
+ fui.oldSpec = i->text ( 2 );
+ fui.spec = fui.oldSpec;
+ fui.oldAccess = i->text( 3 );
+ fui.access = fui.oldAccess;
+ fui.oldType = i->text( 4 );
+ fui.type = fui.oldType;
+ lastType = fui.oldType;
+ functList.append( fui );
+ functionIds.insert( i, id );
+ id++;
+}
+
+void EditFunctions::functionRemove()
+{
+ if ( !functionListView->currentItem() )
+ return;
+
+ functionListView->blockSignals( TRUE );
+ removedFunctions << MetaDataBase::normalizeFunction( functionListView->currentItem()->text( 0 ) );
+ int delId = functionIds[ functionListView->currentItem() ];
+ TQValueList<FunctItem>::Iterator it = functList.begin();
+ while ( it != functList.end() ) {
+ if ( (*it).id == delId ) {
+ functList.remove( it );
+ break;
+ }
+ ++it;
+ }
+ functionIds.remove( functionListView->currentItem() );
+ delete functionListView->currentItem();
+ if ( functionListView->currentItem() )
+ functionListView->setSelected( functionListView->currentItem(), TRUE );
+ functionListView->blockSignals( FALSE );
+ currentItemChanged( functionListView->currentItem() );
+}
+
+void EditFunctions::currentItemChanged( TQListViewItem *i )
+{
+ functionName->blockSignals( TRUE );
+ functionName->setText( "" );
+ functionAccess->setCurrentItem( 0 );
+ functionName->blockSignals( FALSE );
+
+ if ( !i ) {
+ boxProperties->setEnabled( FALSE );
+ return;
+ }
+
+ functionName->blockSignals( TRUE );
+ functionName->setText( i->text( 0 ) );
+ editType->setText( i->text( 1 ) );
+ TQString specifier = i->text( 2 );
+ TQString access = i->text( 3 );
+ TQString type = i->text( 4 );
+ if ( specifier == "pure virtual" )
+ functionSpecifier->setCurrentItem( 2 );
+ else if ( specifier == "non virtual" )
+ functionSpecifier->setCurrentItem( 0 );
+ else if ( specifier == "virtual" )
+ functionSpecifier->setCurrentItem( 1 );
+ else
+ functionSpecifier->setCurrentItem( 3 );
+ if ( access == "private" )
+ functionAccess->setCurrentItem( 2 );
+ else if ( access == "protected" )
+ functionAccess->setCurrentItem( 1 );
+ else
+ functionAccess->setCurrentItem( 0 );
+ if ( type == "slot" )
+ functionType->setCurrentItem( 0 );
+ else
+ functionType->setCurrentItem( 1 );
+
+ functionName->blockSignals( FALSE );
+ boxProperties->setEnabled( TRUE );
+}
+
+void EditFunctions::currentTextChanged( const TQString &txt )
+{
+ if ( !functionListView->currentItem() )
+ return;
+
+ changeItem( functionListView->currentItem(), Name, txt );
+ functionListView->currentItem()->setText( 0, txt );
+
+ if ( functionListView->currentItem()->text( 4 ) == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow, MetaDataBase::normalizeFunction( txt.latin1() ).latin1() ) )
+ functionListView->currentItem()->setText( 5, tr( "Yes" ) );
+ else
+ functionListView->currentItem()->setText( 5, tr( "No" ) );
+ } else {
+ functionListView->currentItem()->setText( 5, "---" );
+ }
+}
+
+void EditFunctions::currentSpecifierChanged( const TQString& s )
+{
+ if ( !functionListView->currentItem() )
+ return;
+
+ changeItem( functionListView->currentItem(), Specifier, s );
+ functionListView->currentItem()->setText( 2, s );
+}
+
+void EditFunctions::currentAccessChanged( const TQString& a )
+{
+ if ( !functionListView->currentItem() )
+ return;
+ changeItem( functionListView->currentItem(), Access, a );
+ functionListView->currentItem()->setText( 3, a );
+}
+
+
+void EditFunctions::currentReturnTypeChanged( const TQString &type )
+{
+ if ( !functionListView->currentItem() )
+ return;
+ changeItem( functionListView->currentItem(), ReturnType, type );
+ functionListView->currentItem()->setText( 1, type );
+}
+
+void EditFunctions::currentTypeChanged( const TQString &type )
+{
+ if ( !functionListView->currentItem() )
+ return;
+ changeItem( functionListView->currentItem(), Type, type );
+ lastType = type;
+ functionListView->currentItem()->setText( 4, type );
+ if ( type == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow,
+ MetaDataBase::normalizeFunction( functionListView->currentItem()->text( 0 ).latin1() ).latin1() ) )
+ functionListView->currentItem()->setText( 5, tr( "Yes" ) );
+ else
+ functionListView->currentItem()->setText( 5, tr( "No" ) );
+ } else {
+ functionListView->currentItem()->setText( 5, "---" );
+ }
+}
+
+void EditFunctions::changeItem( TQListViewItem *item, Attribute a, const TQString &nV )
+{
+ int itemId;
+ TQMap<TQListViewItem*, int>::Iterator fit = functionIds.tqfind( item );
+ if ( fit != functionIds.end() )
+ itemId = *fit;
+ else
+ return;
+
+ TQValueList<FunctItem>::Iterator it = functList.begin();
+ for ( ; it != functList.end(); ++it ) {
+ if ( (*it).id == itemId ) {
+ switch( a ) {
+ case Name:
+ (*it).newName = nV;
+ break;
+ case Specifier:
+ (*it).spec = nV;
+ break;
+ case Access:
+ (*it).access = nV;
+ break;
+ case ReturnType:
+ (*it).retTyp = nV;
+ break;
+ case Type:
+ (*it).type = nV;
+ break;
+ }
+ }
+ }
+}
+
+void EditFunctions::setCurrentFunction( const TQString &function )
+{
+ TQListViewItemIterator it( functionListView );
+ while ( it.current() ) {
+ if ( MetaDataBase::normalizeFunction( it.current()->text( 0 ) ) == function ) {
+ functionListView->setCurrentItem( it.current() );
+ functionListView->setSelected( it.current(), TRUE );
+ currentItemChanged( it.current() );
+ return;
+ }
+ ++it;
+ }
+}
+
+void EditFunctions::displaySlots( bool justSlots )
+{
+ functionIds.clear();
+ functionListView->clear();
+ for ( TQValueList<FunctItem>::Iterator it = functList.begin(); it != functList.end(); ++it ) {
+ if ( (*it).type == "function" && justSlots )
+ continue;
+ TQListViewItem *i = new TQListViewItem( functionListView );
+ functionIds.insert( i, (*it).id );
+ i->setPixmap( 0, TQPixmap::fromMimeSource( "designer_editTslots.png" ) );
+ i->setText( 0, (*it).newName );
+ i->setText( 1, (*it).retTyp );
+ i->setText( 2, (*it).spec );
+ i->setText( 3, (*it).access );
+ i->setText( 4, (*it).type );
+
+ if ( (*it).type == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow, MetaDataBase::normalizeFunction( (*it).newName ).latin1() ) )
+ i->setText( 5, tr( "Yes" ) );
+ else
+ i->setText( 5, tr( "No" ) );
+ } else {
+ i->setText( 5, "---" );
+ }
+ }
+
+ if ( functionListView->firstChild() )
+ functionListView->setSelected( functionListView->firstChild(), TRUE );
+}
+
+void EditFunctions::emitItemRenamed( TQListViewItem *, int, const TQString & text )
+{
+ emit itemRenamed( text ); // Relay signal ( to TQLineEdit )
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.h b/tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.h
new file mode 100644
index 0000000..8d42af3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/editfunctionsimpl.h
@@ -0,0 +1,102 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef EDITFUNCTIONSIMPL_H
+#define EDITFUNCTIONSIMPL_H
+
+#include "editfunctions.h"
+#include "hierarchyview.h"
+#include "metadatabase.h"
+#include <tqmap.h>
+
+class FormWindow;
+class TQListViewItem;
+
+class EditFunctions : public EditFunctionsBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ EditFunctions( TQWidget *tqparent, FormWindow *fw, bool showOnlySlots = FALSE );
+
+ void setCurrentFunction( const TQString &function );
+ void functionAdd( const TQString &access = TQString(),
+ const TQString &type = TQString() );
+ void functionAdd() { functionAdd( "public" ); }
+
+Q_SIGNALS:
+ void itemRenamed(const TQString &);
+
+protected Q_SLOTS:
+ void okClicked();
+ void functionRemove();
+ void currentItemChanged( TQListViewItem * );
+ void currentTextChanged( const TQString &txt );
+ void currentSpecifierChanged( const TQString &s );
+ void currentAccessChanged( const TQString &a );
+ void currentReturnTypeChanged( const TQString &type );
+ void currentTypeChanged( const TQString &type );
+ void displaySlots( bool justSlots );
+ void emitItemRenamed( TQListViewItem *, int, const TQString & );
+
+private:
+ enum Attribute { Name, Specifier, Access, ReturnType, Type };
+ struct FunctItem {
+ int id;
+ TQString oldName;
+ TQString newName;
+ TQString oldRetTyp;
+ TQString retTyp;
+ TQString spec;
+ TQString oldSpec;
+ TQString access;
+ TQString oldAccess;
+ TQString type;
+ TQString oldType;
+
+ TQ_DUMMY_COMPARISON_OPERATOR( FunctItem )
+ };
+
+ void changeItem( TQListViewItem *item, Attribute a, const TQString &nV );
+
+ FormWindow *formWindow;
+ TQMap<TQListViewItem*, int> functionIds;
+ TQStringList removedFunctions;
+ TQValueList<MetaDataBase::Function> itemList;
+ TQValueList<FunctItem> functList;
+ int id;
+ TQString lastType;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/finddialog.ui b/tqtinterface/qt4/tools/designer/designer/finddialog.ui
new file mode 100644
index 0000000..1c0f39f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/finddialog.ui
@@ -0,0 +1,281 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>FindDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>FindDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>285</width>
+ <height>189</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Find Text</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>F&amp;ind:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFind</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>comboFind</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQButtonGroup" row="1" column="1">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Direction</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>radioForward</cstring>
+ </property>
+ <property name="text">
+ <string>Forwar&amp;d</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>radioBackward</cstring>
+ </property>
+ <property name="text">
+ <string>Bac&amp;kward</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkWords</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Whole words only</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkCase</cstring>
+ </property>
+ <property name="text">
+ <string>Case &amp;sensitive</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBegin</cstring>
+ </property>
+ <property name="text">
+ <string>Start at &amp;Beginning</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDialog</receiver>
+ <slot>doFind()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>comboFind</tabstop>
+ <tabstop>checkWords</tabstop>
+ <tabstop>checkCase</tabstop>
+ <tabstop>checkBegin</tabstop>
+ <tabstop>radioForward</tabstop>
+ <tabstop>radioBackward</tabstop>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>PushButton2</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">tqlineedit.h</include>
+ <include location="local" impldecl="in implementation">../interfaces/editorinterface.h</include>
+ <include location="local" impldecl="in implementation">finddialog.ui.h</include>
+</includes>
+<forwards>
+ <forward>struct EditorInterface;</forward>
+</forwards>
+<variables>
+ <variable>EditorInterface *editor;</variable>
+ <variable>TQT_BASE_OBJECT_NAME *formWindow;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>doFind()</slot>
+ <slot>setEditor( EditorInterface * e, TQT_BASE_OBJECT_NAME * fw )</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/finddialog.ui.h b/tqtinterface/qt4/tools/designer/designer/finddialog.ui.h
new file mode 100644
index 0000000..4eba205
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/finddialog.ui.h
@@ -0,0 +1,68 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+void FindDialog::init()
+{
+ editor = 0;
+ formWindow = 0;
+}
+
+void FindDialog::destroy()
+{
+ if ( editor )
+ editor->release();
+}
+
+void FindDialog::doFind()
+{
+ if ( !editor )
+ return;
+
+ if ( !editor->tqfind( comboFind->currentText(), checkCase->isChecked(),
+ checkWords->isChecked(), radioForward->isChecked(), !checkBegin->isChecked() ) )
+ checkBegin->setChecked( TRUE );
+ else
+ checkBegin->setChecked( FALSE );
+
+}
+
+void FindDialog::setEditor( EditorInterface * e, TQT_BASE_OBJECT_NAME * fw )
+{
+ if ( fw != formWindow )
+ checkBegin->setChecked( TRUE );
+ formWindow = fw;
+ if ( editor )
+ editor->release();
+ editor = e;
+ editor->addRef();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/formfile.cpp b/tqtinterface/qt4/tools/designer/designer/formfile.cpp
new file mode 100644
index 0000000..3701d02
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/formfile.cpp
@@ -0,0 +1,924 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "formfile.h"
+#include "timestamp.h"
+#include "project.h"
+#include "formwindow.h"
+#include "command.h"
+#include "sourceeditor.h"
+#include "mainwindow.h"
+#include "../interfaces/languageinterface.h"
+#include "resource.h"
+#include "workspace.h"
+#include <tqmessagebox.h>
+#include <tqfile.h>
+#include <tqstatusbar.h>
+#include "propertyeditor.h"
+#include <tqworkspace.h>
+#include <stdlib.h>
+#include "designerappiface.h"
+#include <tqapplication.h>
+
+static TQString make_func_pretty( const TQString &s )
+{
+ TQString res = s;
+ if ( res.tqfind( ")" ) - res.tqfind( "(" ) == 1 )
+ return res;
+ res.tqreplace( "(", "( " );
+ res.tqreplace( ")", " )" );
+ res.tqreplace( "&", " &" );
+ res.tqreplace( "*", " *" );
+ res.tqreplace( ",", ", " );
+ res.tqreplace( ":", " : " );
+ res = res.simplifyWhiteSpace();
+ res.tqreplace( " : : ", "::" );
+ res.tqreplace( ">>", "> >" );
+ return res;
+}
+
+FormFile::FormFile( const TQString &fn, bool temp, Project *p, const char *name )
+ : filename( fn ), fileNameTemp( temp ), pro( p ), fw( 0 ), ed( 0 ),
+ timeStamp( 0, fn + codeExtension() ), codeEdited( FALSE ), pkg( FALSE ),
+ cm( FALSE ), codeFileStat( None ), timeStampUi(0, fn)
+{
+ MetaDataBase::addEntry( this );
+ fake = qstrcmp( name, "qt_fakewindow" ) == 0;
+ //codeFileStat = FormFile::None;
+ pro->addFormFile( this );
+ loadCode();
+ if ( !temp )
+ checkFileName( FALSE );
+ timeStampUi.update();
+}
+
+FormFile::~FormFile()
+{
+ pro->removeFormFile( this );
+ if ( formWindow() )
+ formWindow()->setFormFile( 0 );
+}
+
+void FormFile::setFormWindow( FormWindow *f )
+{
+ if ( f == fw )
+ return;
+ if ( fw )
+ fw->setFormFile( 0 );
+ fw = f;
+ if ( fw )
+ fw->setFormFile( this );
+ parseCode( cod, FALSE );
+ TQTimer::singleShot( 0, this, TQT_SLOT( notifyFormWindowChange() ) );
+}
+
+void FormFile::setEditor( SourceEditor *e )
+{
+ ed = e;
+}
+
+void FormFile::setFileName( const TQString &fn )
+{
+ if ( fn == filename )
+ return;
+ if ( fn.isEmpty() ) {
+ fileNameTemp = TRUE;
+ if ( filename.tqfind( "unnamed" ) != 0 )
+ filename = createUnnamedFileName();
+ return;
+ } else {
+ fileNameTemp = FALSE;
+ }
+ filename = fn;
+ timeStamp.setFileName( filename + codeExtension() );
+ timeStampUi.setFileName( filename );
+ cod = "";
+ loadCode();
+}
+
+void FormFile::setCode( const TQString &c )
+{
+ cod = c;
+}
+
+FormWindow *FormFile::formWindow() const
+{
+ return fw;
+}
+
+SourceEditor *FormFile::editor() const
+{
+ return ed;
+}
+
+TQString FormFile::fileName() const
+{
+ return filename;
+}
+
+TQString FormFile::absFileName() const
+{
+ return pro->makeAbsolute( filename );
+}
+
+TQString FormFile::codeFile() const
+{
+ TQString codeExt = codeExtension();
+ if ( codeExt.isEmpty() )
+ return "";
+ return filename + codeExt;
+}
+
+TQString FormFile::code()
+{
+ return cod;
+}
+
+bool FormFile::save( bool withMsgBox, bool ignoreModified )
+{
+ if ( fileNameTemp )
+ return saveAs();
+ if ( !ignoreModified && !isModified() )
+ return TRUE;
+ if ( ed )
+ ed->save();
+ if (!shouldOverwriteUi())
+ return TRUE;
+
+ if ( formWindow() && isModified( WFormWindow ) ) {
+ if ( withMsgBox ) {
+ if ( !formWindow()->checkCustomWidgets() )
+ return FALSE;
+ }
+
+ if ( TQFile::exists( pro->makeAbsolute( filename ) ) ) {
+ TQString fn( pro->makeAbsolute( filename ) );
+#if defined(TQ_OS_WIN32)
+ fn += ".bak";
+#else
+ fn += "~";
+#endif
+ TQFile f( pro->makeAbsolute( filename ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQFile f2( fn );
+ if ( f2.open( IO_WriteOnly | IO_Translate ) ) {
+ TQCString data( f.size() );
+ f.readBlock( data.data(), f.size() );
+ f2.writeBlock( data );
+ } else {
+ TQMessageBox::warning( MainWindow::self, "Save", "The file " +
+ codeFile() + " could not be saved" );
+ }
+ }
+ }
+ }
+
+ if ( isModified( WFormCode ) ) {
+ if ( TQFile::exists( pro->makeAbsolute( codeFile() ) ) ) {
+ TQString fn( pro->makeAbsolute( codeFile() ) );
+#if defined(TQ_OS_WIN32)
+ fn += ".bak";
+#else
+ fn += "~";
+#endif
+ TQFile f( pro->makeAbsolute( codeFile() ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQFile f2( fn );
+ if ( f2.open( IO_WriteOnly | IO_Translate) ) {
+ TQCString data( f.size() );
+ f.readBlock( data.data(), f.size() );
+ f2.writeBlock( data );
+ } else if ( tqApp->type() != TQApplication::Tty ) {
+ TQMessageBox::warning( MainWindow::self, "Save", "The file " +
+ codeFile() + " could not be saved" );
+ }
+ }
+ }
+ }
+
+ if ( formWindow() ) {
+ Resource resource( MainWindow::self );
+ resource.setWidget( formWindow() );
+ bool formCodeOnly = isModified( WFormCode ) && !isModified( WFormWindow );
+ if ( !resource.save( pro->makeAbsolute( filename ), formCodeOnly ) ) {
+ if ( MainWindow::self )
+ MainWindow::self->statusBar()->message( tr( "Failed to save file '%1'.").arg( formCodeOnly ? codeFile(): filename ),
+ 5000 );
+ if ( formCodeOnly )
+ return FALSE;
+ return saveAs();
+ }
+ if ( MainWindow::self )
+ MainWindow::self->statusBar()->message( tr( "'%1' saved.").
+ arg( formCodeOnly ? codeFile() : filename ),
+ 3000 );
+ } else {
+ if ( !Resource::saveFormCode(this, MetaDataBase::languageInterface(pro->language())) )
+ return FALSE;
+ }
+ timeStamp.update();
+ timeStampUi.update();
+ setModified( FALSE );
+ return TRUE;
+}
+
+bool FormFile::shouldOverwriteUi() const
+{
+ if (timeStampUi.isUpToDate())
+ return TRUE;
+ return (TQMessageBox::information(MainWindow::self, tr( "TQt Designer" ),
+ tr("File '%1' has been changed outside TQt Designer.\n"
+ "Do you want to overwrite it?" ).arg(timeStampUi.fileName()),
+ tr("&Yes"), tr("&No")) == 0);
+}
+
+bool FormFile::saveAs( bool ignoreModified )
+{
+ TQString f = pro->makeAbsolute( fileName() );
+ if ( fileNameTemp && formWindow() ) {
+ f = TQString( formWindow()->name() ).lower();
+ f.tqreplace( "::", "_" );
+ f = pro->makeAbsolute( f + ".ui" );
+ }
+ bool saved = FALSE;
+ if ( ignoreModified ) {
+ TQString dir = TQStringList::split( ':', pro->iFace()->customSetting( "TQTSCRIPT_PACKAGES" ) ).first();
+ f = TQFileInfo( f ).fileName();
+ f.prepend( dir + "/" );
+ }
+ TQString fn;
+ while ( !saved ) {
+ fn = TQFileDialog::getSaveFileName( f,
+ tr( "TQt User-Interface Files (*.ui)" ) + ";;" +
+ tr( "All Files (*)" ), MainWindow::self, 0,
+ tr( "Save Form '%1' As ...").arg( formName() ),
+ MainWindow::self ? &MainWindow::self->lastSaveFilter : 0 );
+ if ( fn.isEmpty() )
+ return FALSE;
+ TQFileInfo fi( fn );
+ if ( fi.extension() != "ui" )
+ fn += ".ui";
+ fileNameTemp = FALSE;
+ filename = pro->makeRelative( fn );
+ TQFileInfo relfi( filename );
+ if ( relfi.exists() ) {
+ if ( TQMessageBox::warning( MainWindow::self, tr( "File Already Exists" ),
+ tr( "The file already exists. Do you wish to overwrite it?" ),
+ TQMessageBox::Yes,
+ TQMessageBox::No ) == TQMessageBox::Yes ) {
+ saved = TRUE;
+ } else {
+ filename = f;
+ }
+
+ } else {
+ saved = TRUE;
+ }
+ }
+ if ( !checkFileName( TRUE ) ) {
+ filename = f;
+ return FALSE;
+ }
+ pro->setModified( TRUE );
+ timeStamp.setFileName( pro->makeAbsolute( codeFile() ) );
+ if ( ed && formWindow() )
+ ed->setCaption( tr( "Edit %1" ).arg( formWindow()->name() ) );
+ setModified( TRUE );
+ if ( pro->isDummy() )
+ fw->mainWindow()->addRecentlyOpenedFile( fn );
+ return save( TRUE, ignoreModified );
+}
+
+bool FormFile::close()
+{
+ if ( editor() ) {
+ editor()->save();
+ editor()->close();
+ }
+ if ( formWindow() )
+ return formWindow()->close();
+ return TRUE;
+}
+
+bool FormFile::closeEvent()
+{
+ if ( !isModified() && fileNameTemp ) {
+ pro->removeFormFile( this );
+ return TRUE;
+ }
+
+ if ( !isModified() )
+ return TRUE;
+
+ if ( editor() )
+ editor()->save();
+
+ switch ( TQMessageBox::warning( MainWindow::self, tr( "Save Form" ),
+ tr( "Save changes to form '%1'?" ).arg( filename ),
+ tr( "&Yes" ), tr( "&No" ), tr( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ if ( !save() )
+ return FALSE;
+ case 1: // don't save
+ loadCode();
+ if ( ed )
+ ed->editorInterface()->setText( cod );
+ if ( fileNameTemp )
+ pro->removeFormFile( this );
+ if ( MainWindow::self )
+ MainWindow::self->workspace()->update();
+ break;
+ case 2: // cancel
+ return FALSE;
+ default:
+ break;
+ }
+
+ setModified( FALSE );
+ if ( MainWindow::self )
+ MainWindow::self->updateFunctionList();
+ setCodeEdited( FALSE );
+ return TRUE;
+}
+
+void FormFile::setModified( bool m, int who )
+{
+ if ( ( who & WFormWindow ) == WFormWindow )
+ setFormWindowModified( m );
+ if ( ( who & WFormCode ) == WFormCode )
+ setCodeModified( m );
+}
+
+bool FormFile::isModified( int who )
+{
+ if ( who == WFormWindow )
+ return isFormWindowModified();
+ if ( who == WFormCode )
+ return isCodeModified();
+ return isCodeModified() || isFormWindowModified();
+}
+
+bool FormFile::isFormWindowModified() const
+{
+ if ( !formWindow() || !formWindow()->commandHistory() )
+ return FALSE;
+ return formWindow()->commandHistory()->isModified();
+}
+
+bool FormFile::isCodeModified() const
+{
+ if ( !editor() )
+ return cm;
+ return editor()->isModified();
+}
+
+void FormFile::setFormWindowModified( bool m )
+{
+ bool b = isFormWindowModified();
+ if ( m == b )
+ return;
+ if ( !formWindow() || !formWindow()->commandHistory() )
+ return;
+ formWindow()->commandHistory()->setModified( m );
+ emit somethingChanged( this );
+}
+
+void FormFile::setCodeModified( bool m )
+{
+ bool b = isCodeModified();
+ if ( m == b )
+ return;
+ emit somethingChanged( this );
+ cm = m;
+ if ( !editor() )
+ return;
+ editor()->setModified( m );
+}
+
+void FormFile::showFormWindow()
+{
+ if ( !MainWindow::self )
+ return;
+ if ( formWindow() ) {
+ if ( ( formWindow()->hasFocus() ||
+ MainWindow::self->qWorkspace()->activeWindow() == formWindow() ) &&
+ MainWindow::self->propertyeditor()->formWindow() != formWindow() ) {
+ MainWindow::self->propertyeditor()->setWidget( formWindow()->currentWidget(), formWindow() );
+ MainWindow::self->objectHierarchy()->setFormWindow( formWindow(),
+ TQT_TQOBJECT(formWindow()->currentWidget()) );
+ }
+ formWindow()->setFocus();
+ return;
+ }
+ MainWindow::self->openFormWindow( pro->makeAbsolute( filename ), TRUE, this );
+}
+
+bool FormFile::setupUihFile( bool askForUih )
+{
+ if ( !pro->isCpp() || !askForUih ) {
+ if ( !hasFormCode() ) {
+ createFormCode();
+ setModified( TRUE );
+ }
+ codeFileStat = FormFile::Ok;
+ return TRUE;
+ }
+ if ( codeFileStat != FormFile::Ok && !ed ) {
+ if ( hasFormCode() ) {
+ int i = TQMessageBox::information( MainWindow::self, tr( "Using ui.h file" ),
+ tr( "An \"ui.h\" file for this form already exists.\n"
+ "Do you want to use it or create a new one?" ),
+ tr( "Use existing" ), tr( "Create new" ),
+ tr( "Cancel" ), 2, 2 );
+ if ( i == 2 )
+ return FALSE;
+ if ( i == 1 )
+ createFormCode();
+ } else {
+ if ( TQMessageBox::Yes != TQMessageBox::information( MainWindow::self, tr( "Creating ui.h file" ),
+ tr( "Do you want to create an new \"ui.h\" file?" ),
+ TQMessageBox::Yes, TQMessageBox::No ) )
+ return FALSE;
+ createFormCode();
+ }
+ setModified( TRUE );
+ }
+ codeFileStat = FormFile::Ok;
+ return TRUE;
+}
+
+SourceEditor *FormFile::showEditor( bool askForUih )
+{
+ if ( !MainWindow::self )
+ return 0;
+ showFormWindow();
+ if ( !setupUihFile( askForUih ) )
+ return 0;
+ SourceEditor *se = MainWindow::self->openSourceEditor();
+ if ( !se )
+ return 0;
+ se->setActiveWindow();
+ se->setFocus();
+ return se;
+}
+
+static int ui_counter = 0;
+TQString FormFile::createUnnamedFileName()
+{
+ return TQString( "unnamed" ) + TQString::number( ++ui_counter ) + TQString( ".ui" );
+}
+
+TQString FormFile::codeExtension() const
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( iface )
+ return iface->formCodeExtension();
+ return "";
+}
+
+TQString FormFile::codeComment() const
+{
+ return TQString( "/****************************************************************************\n"
+ "** ui.h extension file, included from the uic-generated form implementation.\n"
+ "**\n"
+ "** If you want to add, delete, or rename functions or Q_SLOTS, use\n"
+ "** TQt Designer to update this file, preserving your code.\n"
+ "**\n"
+ "** You should not define a constructor or destructor in this file.\n"
+ "** Instead, write your code in functions called init() and destroy().\n"
+ "** These will automatically be called by the form's constructor and\n"
+ "** destructor.\n"
+ "*****************************************************************************/\n" );
+}
+
+bool FormFile::hasFormCode() const
+{
+ return !cod.isEmpty() && cod != TQString( codeComment() );
+}
+
+int FormFile::codeFileState() const
+{
+ return hasFormCode() ? codeFileStat : None;
+}
+
+void FormFile::setCodeFileState( UihState s )
+{
+ codeFileStat = s;
+}
+
+void FormFile::createFormCode()
+{
+ if ( !formWindow() )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+ if ( pro->isCpp() )
+ cod = codeComment();
+ TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow() );
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = functionList.begin(); it != functionList.end(); ++it ) {
+ cod += (!cod.isEmpty() ? "\n\n" : "") +
+ iface->createFunctionStart( formWindow()->name(), make_func_pretty((*it).function),
+ (*it).returnType.isEmpty() ?
+ TQString( "void" ) :
+ (*it).returnType, (*it).access ) +
+ "\n" + iface->createEmptyFunction();
+ }
+ parseCode( cod, FALSE );
+}
+
+void FormFile::load()
+{
+ showFormWindow();
+ code();
+}
+
+bool FormFile::loadCode()
+{
+ TQString fn = pro->makeAbsolute( codeFile() );
+ if ( fn.isEmpty() )
+ return FALSE;
+
+ TQFile f( fn );
+ if ( !f.open( IO_ReadOnly ) ) {
+ cod = "";
+ setCodeFileState( FormFile::None );
+ return FALSE;
+ }
+ TQTextStream ts( &f );
+ cod = ts.read();
+ parseCode( cod, FALSE );
+ if ( hasFormCode() && codeFileStat != FormFile::Ok )
+ setCodeFileState( FormFile::Deleted );
+ timeStamp.update();
+ return TRUE;
+}
+
+bool FormFile::isCodeEdited() const
+{
+ return codeEdited;
+}
+
+void FormFile::setCodeEdited( bool b )
+{
+ codeEdited = b;
+}
+
+void FormFile::parseCode( const TQString &txt, bool allowModify )
+{
+ if ( !formWindow() )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+ TQValueList<LanguageInterface::Function> functions;
+ TQValueList<MetaDataBase::Function> newFunctions, oldFunctions;
+ oldFunctions = MetaDataBase::functionList( formWindow() );
+ iface->functions( txt, &functions );
+ TQMap<TQString, TQString> funcs;
+ for ( TQValueList<LanguageInterface::Function>::Iterator it = functions.begin();
+ it != functions.end(); ++it ) {
+ bool found = FALSE;
+ for ( TQValueList<MetaDataBase::Function>::Iterator fit = oldFunctions.begin();
+ fit != oldFunctions.end(); ++fit ) {
+ TQString f( (*fit).function );
+ if ( MetaDataBase::normalizeFunction( f ) ==
+ MetaDataBase::normalizeFunction( (*it).name ) ) {
+ found = TRUE;
+ MetaDataBase::Function function;
+ function.function = make_func_pretty( (*it).name );
+ function.specifier = (*fit).specifier;
+ function.type = (*fit).type;
+ if ( !pro->isCpp() )
+ function.access = (*it).access;
+ else
+ function.access = (*fit).access;
+ function.language = (*fit).language;
+ function.returnType = (*it).returnType;
+ newFunctions << function;
+ funcs.insert( (*it).name, (*it).body );
+ oldFunctions.remove( fit );
+ break;
+ }
+ }
+ if ( !found ) {
+ MetaDataBase::Function function;
+ function.function = make_func_pretty( (*it).name );
+ function.specifier = "virtual";
+ function.access = "public";
+ function.language = pro->language();
+ function.returnType = (*it).returnType;
+ if ( function.returnType == "void" )
+ function.type = "slot";
+ else
+ function.type = "function";
+ if ( function.function == "init()" || function.function == "destroy()" ) {
+ function.type = "function";
+ function.access = "private";
+ function.specifier = "non virtual";
+ }
+ newFunctions << function;
+ funcs.insert( (*it).name, (*it).body );
+ if ( allowModify )
+ setFormWindowModified( TRUE );
+ }
+ }
+
+ if ( allowModify && oldFunctions.count() > 0 )
+ setFormWindowModified( TRUE );
+
+ MetaDataBase::setFunctionList( formWindow(), newFunctions );
+}
+
+void FormFile::syncCode()
+{
+ if ( !editor() )
+ return;
+ parseCode( editor()->editorInterface()->text(), TRUE );
+ cod = editor()->editorInterface()->text();
+}
+
+void FormFile::checkTimeStamp()
+{
+ if ( timeStamp.isUpToDate() )
+ return;
+ timeStamp.update();
+ if ( codeEdited ) {
+ if ( TQMessageBox::information( MainWindow::self, tr( "TQt Designer" ),
+ tr( "File '%1' has been changed outside TQt Designer.\n"
+ "Do you want to reload it?" ).arg( timeStamp.fileName() ),
+ tr( "&Yes" ), tr( "&No" ) ) == 0 ) {
+ TQFile f( timeStamp.fileName() );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &f );
+ editor()->editorInterface()->setText( ts.read() );
+ editor()->save();
+ if ( MainWindow::self )
+ MainWindow::self->functionsChanged();
+ }
+ }
+ } else {
+ loadCode();
+ }
+}
+
+bool FormFile::isUihFileUpToDate()
+{
+ if ( timeStamp.isUpToDate() )
+ return TRUE;
+ if ( !editor() ) {
+ MainWindow::self->editSource();
+ parseCode( editor()->editorInterface()->text(), TRUE );
+ }
+ checkTimeStamp();
+ return FALSE;
+}
+
+void FormFile::addFunctionCode( MetaDataBase::Function function )
+{
+ if ( pro->isCpp() && !hasFormCode() && !codeEdited )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+
+ TQValueList<LanguageInterface::Function> funcs;
+ iface->functions( cod, &funcs );
+ bool hasFunc = FALSE;
+ for ( TQValueList<LanguageInterface::Function>::Iterator it = funcs.begin();
+ it != funcs.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).name ) == MetaDataBase::normalizeFunction( function.function ) ) {
+ hasFunc = TRUE;
+ break;
+ }
+ }
+
+ if ( !hasFunc ) {
+ if ( !codeEdited && !timeStamp.isUpToDate() )
+ loadCode();
+ MetaDataBase::MetaInfo mi = MetaDataBase::metaInfo( formWindow() );
+ TQString cn;
+ if ( mi.classNameChanged )
+ cn = mi.className;
+ if ( cn.isEmpty() )
+ cn = formWindow()->name();
+ TQString body = "\n\n" + iface->createFunctionStart( cn,
+ make_func_pretty( function.function ),
+ function.returnType.isEmpty() ?
+ TQString( "void" ) :
+ function.returnType, function.access ) +
+ "\n" + iface->createEmptyFunction();
+ cod += body;
+ if ( codeEdited ) {
+ setModified( TRUE );
+ emit somethingChanged( this );
+ }
+ }
+}
+
+void FormFile::removeFunctionCode( MetaDataBase::Function function )
+{
+ if ( pro->isCpp() && !hasFormCode() && !codeEdited )
+ return;
+
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+
+ checkTimeStamp();
+ TQString sourceCode = code();
+ if ( sourceCode.isEmpty() )
+ return;
+ TQValueList<LanguageInterface::Function> functions;
+ iface->functions( sourceCode, &functions );
+ TQString fu = MetaDataBase::normalizeFunction( function.function );
+ for ( TQValueList<LanguageInterface::Function>::Iterator fit = functions.begin(); fit != functions.end(); ++fit ) {
+ if ( MetaDataBase::normalizeFunction( (*fit).name ) == fu ) {
+ int line = 0;
+ int start = 0;
+ while ( line < (*fit).start - 1 ) {
+ start = sourceCode.tqfind( '\n', start );
+ if ( start == -1 )
+ return;
+ start++;
+ line++;
+ }
+ if ( start == -1 )
+ return;
+ int end = start;
+ while ( line < (*fit).end + 1 ) {
+ end = sourceCode.tqfind( '\n', end );
+ if ( end == -1 ) {
+ if ( line <= (*fit).end )
+ end = sourceCode.length() - 1;
+ else
+ return;
+ }
+ end++;
+ line++;
+ }
+ if ( end < start )
+ return;
+ sourceCode.remove( start, end - start );
+ setCode( sourceCode );
+ }
+ }
+}
+
+void FormFile::functionNameChanged( const TQString &oldName, const TQString &newName )
+{
+ if ( !cod.isEmpty() ) {
+ TQString funcStart = TQString( formWindow()->name() ) + TQString( "::" );
+ int i = cod.tqfind( funcStart + oldName );
+ if ( i != -1 ) {
+ cod.remove( i + funcStart.length(), oldName.length() );
+ cod.insert( i + funcStart.length(), newName );
+ }
+ }
+}
+
+void FormFile::functionRetTypeChanged( const TQString &fuName, const TQString &oldType, const TQString &newType )
+{
+ if ( !cod.isEmpty() ) {
+ TQString oldFunct = oldType + " " + TQString( formWindow()->name() ) + "::" + fuName;
+ TQString newFunct = newType + " " + TQString( formWindow()->name() ) + "::" + fuName;
+
+ int i = cod.tqfind( oldFunct );
+ if ( i != -1 ) {
+ cod.remove( i, oldFunct.length() );
+ cod.insert( i, newFunct );
+ }
+ }
+}
+
+TQString FormFile::formName() const
+{
+ FormFile* that = (FormFile*) this;
+ if ( formWindow() ) {
+ that->cachedFormName = formWindow()->name();
+ return cachedFormName;
+ }
+ if ( !cachedFormName.isNull() )
+ return cachedFormName;
+ TQFile f( pro->makeAbsolute( filename ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &f );
+ TQString line;
+ TQString className;
+ while ( !ts.eof() ) {
+ line = ts.readLine();
+ if ( !className.isEmpty() ) {
+ int end = line.tqfind( "</class>" );
+ if ( end == -1 ) {
+ className += line;
+ } else {
+ className += line.left( end );
+ break;
+ }
+ continue;
+ }
+ int start;
+ if ( ( start = line.tqfind( "<class>" ) ) != -1 ) {
+ int end = line.tqfind( "</class>" );
+ if ( end == -1 ) {
+ className = line.mid( start + 7 );
+ } else {
+ className = line.mid( start + 7, end - ( start + 7 ) );
+ break;
+ }
+ }
+ }
+ that->cachedFormName = className;
+ }
+ if ( cachedFormName.isEmpty() )
+ that->cachedFormName = filename;
+ return cachedFormName;
+}
+
+void FormFile::formWindowChangedSomehow()
+{
+ emit somethingChanged( this );
+}
+
+bool FormFile::checkFileName( bool allowBreak )
+{
+ FormFile *ff = pro->tqfindFormFile( filename, this );
+ if ( ff )
+ TQMessageBox::warning( MainWindow::self, tr( "Invalid Filename" ),
+ tr( "The project already tqcontains a form with a\n"
+ "filename of '%1'. Please choose a new filename." ).arg( filename ) );
+ if (!formWindow()) // We are starting up
+ return FALSE;
+ while ( ff ) {
+ TQString fn;
+ while ( fn.isEmpty() ) {
+ fn = TQFileDialog::getSaveFileName( pro->makeAbsolute( fileName() ),
+ tr( "TQt User-Interface Files (*.ui)" ) + ";;" +
+ tr( "All Files (*)" ), MainWindow::self, 0,
+ tr( "Save Form '%1' As ...").
+ arg( formWindow()->name() ),
+ MainWindow::self ? &MainWindow::self->lastSaveFilter : 0 );
+ if ( allowBreak && fn.isEmpty() )
+ return FALSE;
+ }
+ filename = pro->makeRelative( fn );
+ ff = pro->tqfindFormFile( filename, this );
+ }
+ return TRUE;
+}
+
+void FormFile::addConnection( const TQString &sender, const TQString &signal,
+ const TQString &receiver, const TQString &slot )
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( iface )
+ iface->addConnection( sender, signal, receiver, slot, &cod );
+ if ( ed )
+ ed->editorInterface()->setText( cod );
+}
+
+void FormFile::removeConnection( const TQString &sender, const TQString &signal,
+ const TQString &receiver, const TQString &slot )
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( iface )
+ iface->removeConnection( sender, signal, receiver, slot, &cod );
+ if ( ed )
+ ed->editorInterface()->setText( cod );
+}
+
+void FormFile::notifyFormWindowChange()
+{
+ if ( fw )
+ pro->formOpened( fw );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/formfile.h b/tqtinterface/qt4/tools/designer/designer/formfile.h
new file mode 100644
index 0000000..31396df
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/formfile.h
@@ -0,0 +1,154 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef FORMFILE_H
+#define FORMFILE_H
+
+#include <tqobject.h>
+#include "timestamp.h"
+#include "metadatabase.h"
+
+class Project;
+class FormWindow;
+class SourceEditor;
+
+class FormFile : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+ friend class SourceEditor;
+
+public:
+ enum Who {
+ WFormWindow = 1,
+ WFormCode = 2,
+ WAnyOrAll = WFormWindow | WFormCode
+ };
+
+ enum UihState { None, Ok, Deleted };
+
+ FormFile( const TQString &fn, bool temp, Project *p, const char *name = 0 );
+ ~FormFile();
+
+ void setFormWindow( FormWindow *f );
+ void setEditor( SourceEditor *e );
+ void setFileName( const TQString &fn );
+ void setCode( const TQString &c );
+ void setModified( bool m, int who = WAnyOrAll );
+ void setCodeEdited( bool b );
+
+ FormWindow *formWindow() const;
+ SourceEditor *editor() const;
+ TQString fileName() const;
+ TQString absFileName() const;
+
+ bool supportsCodeFile() const { return !codeExtension().isEmpty(); }
+ TQString codeComment() const;
+ TQString codeFile() const;
+ TQString code();
+ bool isCodeEdited() const;
+
+ bool loadCode();
+ void load();
+ bool save( bool withMsgBox = TRUE, bool ignoreModified = FALSE );
+ bool saveAs( bool ignoreModified = FALSE );
+ bool close();
+ bool closeEvent();
+ bool isModified( int who = WAnyOrAll );
+ bool hasFormCode() const;
+ void createFormCode();
+ void syncCode();
+ void checkTimeStamp();
+ bool isUihFileUpToDate();
+ void addFunctionCode( MetaDataBase::Function function );
+ void removeFunctionCode( MetaDataBase::Function function );
+ void functionNameChanged( const TQString &oldName, const TQString &newName );
+ void functionRetTypeChanged( const TQString &fuName, const TQString &oldType, const TQString &newType );
+
+ void showFormWindow();
+ SourceEditor *showEditor( bool askForUih = TRUE );
+
+ static TQString createUnnamedFileName();
+ TQString formName() const;
+
+ bool isFake() const { return fake; }
+
+ void parseCode( const TQString &txt, bool allowModify );
+
+ void addConnection( const TQString &sender, const TQString &signal,
+ const TQString &receiver, const TQString &slot );
+ void removeConnection( const TQString &sender, const TQString &signal,
+ const TQString &receiver, const TQString &slot );
+
+ bool hasTempFileName() const { return fileNameTemp; }
+ void setCodeFileState( UihState );
+ int codeFileState() const;
+ bool setupUihFile( bool askForUih = TRUE );
+
+ Project *project() const { return pro; }
+
+Q_SIGNALS:
+ void somethingChanged( FormFile* );
+
+private Q_SLOTS:
+ void formWindowChangedSomehow();
+ void notifyFormWindowChange();
+
+private:
+ bool isFormWindowModified() const;
+ bool isCodeModified() const;
+ void setFormWindowModified( bool m );
+ void setCodeModified( bool m );
+ TQString codeExtension() const;
+ bool checkFileName( bool allowBreak );
+ bool shouldOverwriteUi() const;
+
+private:
+ TQString filename;
+ bool fileNameTemp;
+ Project *pro;
+ FormWindow *fw;
+ SourceEditor *ed;
+ TQString cod;
+ TimeStamp timeStamp;
+ bool codeEdited;
+ TQString cachedFormName;
+ bool fake;
+ bool pkg;
+ bool cm;
+ UihState codeFileStat;
+
+ TimeStamp timeStampUi;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/formsettings.ui b/tqtinterface/qt4/tools/designer/designer/formsettings.ui
new file mode 100644
index 0000000..e6c8595
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/formsettings.ui
@@ -0,0 +1,556 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>FormSettingsBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>FormSettingsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>597</width>
+ <height>458</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form Settings</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Form Settings&lt;/b&gt;&lt;p&gt;Change settings for the form. Settings like &lt;b&gt;Comment&lt;/b&gt; and &lt;b&gt;Author&lt;/b&gt; are for your own use and are not required.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Pixmaps</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>radioPixmapInline</cstring>
+ </property>
+ <property name="text">
+ <string>Save In&amp;line</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Save pixmaps in the .ui files</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Save Inline&lt;/b&gt;&lt;p&gt;Saves the pixmaps as binary data in the .ui files. Pixmaps saved like this are not shared between forms. We recommend using Project image files instead.</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>radioProjectImageFile</cstring>
+ </property>
+ <property name="text">
+ <string>Project &amp;Imagefile</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use the Project's Image file for pixmaps</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Use the Project's Image file for pixmaps&lt;/b&gt;
+&lt;p&gt;Each project may have a collection of pixmaps. If you use a project, we recommend that you use this option since it shares the images and is the fastest and most efficient way to use pixmaps in your forms.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>editPixmapFunction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify Pixmap-Loader function (only the function's name, no parentheses!)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Specify Pixmap-Loader function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for loading a pixmap in the generated code. &lt;em&gt;Only enter the function's name, with no parentheses.&lt;/em&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>radioPixmapFunction</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;Function:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use the given function for pixmaps</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Use a given function for pixmaps&lt;/b&gt;&lt;p&gt;If you choose this option you must define a function in the line edit at the right which will be used in the generated code for loading pixmaps. When choosing a pixmap in &lt;i&gt;Qt Designer&lt;/i&gt; you will be asked to specify the arguments which will be passed to the function in the generated code.&lt;p&gt; This approach makes it possible to use your own icon-loader function for loading pixmaps. &lt;i&gt;Qt Designer&lt;/i&gt; can't preview the correct image if you use your own function.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editClassName</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change class name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter the name of the class that will be created.&lt;/b&gt;&lt;p&gt;&lt;em&gt;classname.h&lt;/em&gt; and &lt;em&gt;classname.cpp&lt;/em&gt; will be generated as C++ output when it is compiled by uic.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;uthor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editAuthor</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>editAuthor</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter your name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter your name.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Class &amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editClassName</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Co&amp;mment:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editComment</cstring>
+ </property>
+ </widget>
+ <widget class="TQMultiLineEdit" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>editComment</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter a comment about the form.</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>La&amp;youts</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSpinBox" row="0" column="2">
+ <property name="name">
+ <cstring>spinMargin</cstring>
+ </property>
+ <property name="value">
+ <number>11</number>
+ </property>
+ </widget>
+ <spacer row="0" column="3">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>D&amp;efault Spacing:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinSpacing</cstring>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkLayoutFunctions</cstring>
+ </property>
+ <property name="text">
+ <string>Use Func&amp;tions:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use functions to get the margin and spacing</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Use a given function for margin and/or spacing&lt;/b&gt;&lt;p&gt;If you choose this option you must define functions in the line edit below which will be used in the generated code for getting the margin and spacing value. &lt;i&gt;Qt Designer&lt;/i&gt; can't preview the correct margin or spacing if you use your own function. Instead, the default values will be used for preview.</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="1" column="2">
+ <property name="name">
+ <cstring>spinSpacing</cstring>
+ </property>
+ <property name="value">
+ <number>6</number>
+ </property>
+ </widget>
+ <spacer row="1" column="3">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Default Mar&amp;gin:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinMargin</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>spaFuLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>S&amp;pacing:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editSpacingFunction</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>marFuLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Ma&amp;rgin:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editMarginFunction</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="TQLineEdit" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>editSpacingFunction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify spacing function (only the function's name, no parentheses!)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Specify spacing function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for getting the spacing in the generated code. &lt;em&gt;Only enter the function's name, with no parentheses.&lt;/em&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="3" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>editMarginFunction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify margin function (only the function's name, no parentheses!)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Specify margin function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for getting the margin in the generated code. &lt;em&gt;Only enter the function's name, with no parentheses.&lt;/em&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>FormSettingsBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>FormSettingsBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>radioPixmapFunction</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>editPixmapFunction</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>editSpacingFunction</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>editMarginFunction</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>marFuLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>spaFuLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>editClassName</tabstop>
+ <tabstop>editComment</tabstop>
+ <tabstop>editAuthor</tabstop>
+ <tabstop>radioPixmapInline</tabstop>
+ <tabstop>radioPixmapFunction</tabstop>
+ <tabstop>editPixmapFunction</tabstop>
+ <tabstop>radioProjectImageFile</tabstop>
+ <tabstop>spinMargin</tabstop>
+ <tabstop>spinSpacing</tabstop>
+ <tabstop>checkLayoutFunctions</tabstop>
+ <tabstop>editMarginFunction</tabstop>
+ <tabstop>editSpacingFunction</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot>okClicked()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/formsettingsimpl.cpp b/tqtinterface/qt4/tools/designer/designer/formsettingsimpl.cpp
new file mode 100644
index 0000000..7fb6144
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/formsettingsimpl.cpp
@@ -0,0 +1,125 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "formsettingsimpl.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "command.h"
+#include "asciivalidator.h"
+#include "mainwindow.h"
+#include "project.h"
+
+#include <tqmultilineedit.h>
+#include <tqpushbutton.h>
+#include <tqcombobox.h>
+#include <tqradiobutton.h>
+#include <tqlineedit.h>
+#include <tqspinbox.h>
+#include <tqcheckbox.h>
+
+FormSettings::FormSettings( TQWidget *tqparent, FormWindow *fw )
+ : FormSettingsBase( tqparent, 0, TRUE ), formwindow( fw )
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( fw );
+ if ( info.classNameChanged && !info.className.isEmpty() )
+ editClassName->setText( info.className );
+ else
+ editClassName->setText( fw->name() );
+ editComment->setText( info.comment );
+ editAuthor->setText( info.author );
+
+ editClassName->setValidator( new AsciiValidator( TQString( ":" ), TQT_TQOBJECT(editClassName) ) );
+ editPixmapFunction->setValidator( new AsciiValidator( TQString( ":" ), TQT_TQOBJECT(editPixmapFunction) ) );
+
+ if ( formwindow->savePixmapInline() )
+ radioPixmapInline->setChecked( TRUE );
+ else if ( formwindow->savePixmapInProject() )
+ radioProjectImageFile->setChecked( TRUE );
+ else
+ radioPixmapFunction->setChecked( TRUE );
+ editPixmapFunction->setText( formwindow->pixmapLoaderFunction() );
+ radioProjectImageFile->setEnabled( !fw->project()->isDummy() );
+ spinSpacing->setValue( formwindow->layoutDefaultSpacing() );
+ spinMargin->setValue( formwindow->layoutDefaultMargin() );
+ editSpacingFunction->setValidator( new AsciiValidator( TQString( ":" ), TQT_TQOBJECT(editSpacingFunction) ) );
+ editMarginFunction->setValidator( new AsciiValidator( TQString( ":" ), TQT_TQOBJECT(editMarginFunction) ) );
+ checkLayoutFunctions->setChecked( formwindow->hasLayoutFunctions() );
+ editSpacingFunction->setText( formwindow->spacingFunction() );
+ editMarginFunction->setText( formwindow->marginFunction() );
+}
+
+void FormSettings::okClicked()
+{
+ MetaDataBase::MetaInfo info;
+ info.className = editClassName->text();
+ info.classNameChanged = info.className != TQString( formwindow->name() );
+ info.comment = editComment->text();
+ info.author = editAuthor->text();
+ MetaDataBase::setMetaInfo( formwindow, info );
+
+ formwindow->commandHistory()->setModified( TRUE );
+
+ if ( formwindow->savePixmapInline() ) {
+ MetaDataBase::clearPixmapArguments( formwindow );
+ MetaDataBase::clearPixmapKeys( formwindow );
+ } else if ( formwindow->savePixmapInProject() ) {
+ MetaDataBase::clearPixmapArguments( formwindow );
+ } else {
+ MetaDataBase::clearPixmapKeys( formwindow );
+ }
+
+ if ( radioPixmapInline->isChecked() ) {
+ formwindow->setSavePixmapInline( TRUE );
+ formwindow->setSavePixmapInProject( FALSE );
+ } else if ( radioProjectImageFile->isChecked() ){
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( TRUE );
+ } else {
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( FALSE );
+ }
+
+ if ( checkLayoutFunctions->isChecked() )
+ formwindow->hasLayoutFunctions( TRUE );
+ else
+ formwindow->hasLayoutFunctions( FALSE );
+
+ formwindow->setPixmapLoaderFunction( editPixmapFunction->text() );
+ formwindow->setLayoutDefaultSpacing( spinSpacing->value() );
+ formwindow->setSpacingFunction( editSpacingFunction->text() );
+ formwindow->setLayoutDefaultMargin( spinMargin->value() );
+ formwindow->setMarginFunction( editMarginFunction->text() );
+
+ accept();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/formsettingsimpl.h b/tqtinterface/qt4/tools/designer/designer/formsettingsimpl.h
new file mode 100644
index 0000000..a936aab
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/formsettingsimpl.h
@@ -0,0 +1,57 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef FORMSETTINGSIMPL_H
+#define FORMSETTINGSIMPL_H
+
+#include "formsettings.h"
+
+class FormWindow;
+
+class FormSettings : public FormSettingsBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ FormSettings( TQWidget *tqparent, FormWindow *fw );
+
+protected Q_SLOTS:
+ void okClicked();
+
+private:
+ FormWindow *formwindow;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/formwindow.cpp b/tqtinterface/qt4/tools/designer/designer/formwindow.cpp
new file mode 100644
index 0000000..0b102e9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/formwindow.cpp
@@ -0,0 +1,2754 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "formwindow.h"
+#include "defs.h"
+#include "mainwindow.h"
+#include "widgetfactory.h"
+#include "sizehandle.h"
+#include "metadatabase.h"
+#include "resource.h"
+#include "tqlayout.h"
+#include "connectiondialog.h"
+#include <widgetdatabase.h>
+#include "pixmapchooser.h"
+#include "orderindicator.h"
+#include "hierarchyview.h"
+#include "designerappiface.h"
+#include "menubareditor.h"
+#define NO_STATIC_COLORS
+#include "globaldefs.h"
+
+#include <stdlib.h>
+
+#include <tqevent.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqlabel.h>
+#include <tqobjectlist.h>
+#include <tqtimer.h>
+#include <tqapplication.h>
+#include <tqlayout.h>
+#include <tqspinbox.h>
+#include <tqstatusbar.h>
+#include <tqapplication.h>
+#include <tqpalette.h>
+#include <tqmessagebox.h>
+#include <tqpopupmenu.h>
+#include <tqsizegrip.h>
+#include <tqpushbutton.h>
+#include <tqwhatsthis.h>
+#include <tqmetaobject.h>
+#include <tqtooltip.h>
+#include <tqfeatures.h>
+#include <tqaccel.h>
+#include <tqpixmapcache.h>
+#include <tqbitmap.h>
+#include <tqsplitter.h>
+
+// FormWindow should be able to work to some limited degree
+// (existance, loading) without a MainWindow. Functions which require
+// a MainWindow in theory should never be called if no MainWindow
+// exists. These macros are used to let us know if that happens anyway
+// and to ensure that we don't crash
+#define CHECK_MAINWINDOW TQ_ASSERT( mainWindow() ); if ( !mainWindow() ) return
+#define CHECK_MAINWINDOW_VALUE( v ) TQ_ASSERT( mainWindow() ); if ( !mainWindow() ) return v
+
+static void setCursorToAll( const TQCursor &c, TQWidget *start )
+{
+ start->setCursor( c );
+ if ( !start->childrenListObject().isEmpty() ) {
+ for ( TQObject *o = start->childrenListObject().first(); o; o = start->childrenListObject().next() ) {
+ if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) )
+ setCursorToAll( c, ( (TQWidget*)o ) );
+ }
+ }
+}
+
+static void restoreCursors( TQWidget *start, FormWindow *fw )
+{
+ if ( fw->widgets()->tqfind( start ) )
+ start->setCursor( MetaDataBase::cursor( start ) );
+ else
+ start->setCursor( TQt::ArrowCursor );
+ if ( !start->childrenListObject().isEmpty() ) {
+ for ( TQObject *o = start->childrenListObject().first(); o; o = start->childrenListObject().next() ) {
+ if ( o->isWidgetType() && !::tqqt_cast<SizeHandle*>(o) )
+ restoreCursors( ( (TQWidget*)o ), fw );
+ }
+ }
+}
+
+#if defined(TQ_WS_WIN32) // #### needed for the workaround for tqrepaint problem on windows
+#include <tqt_windows.h>
+static void flickerfree_update( TQWidget *w )
+{
+ InvalidateRect( w->winId(), 0, FALSE );
+}
+#endif
+
+/*!
+ \class FormWindow formwindow.h
+ \brief Editor window for a form
+
+ The FormWindow is the widget which is used as editor for forms. It
+ handles inserting, deleting, moving, resizing, etc. of widgets.
+
+ Normally multiple formwindows are used at the same time in the
+ Designer. So each formwindow has its own undo/redo buffer, etc.
+
+ Also the formwindow has some Q_SIGNALS to inform e.g. about selection
+ changes which is interesting for the PropertyEditor.
+
+ For handling the events of the child widgets (moving, etc.) the
+ handleMousePress(), etc. functions are called from the application
+ event filter which is implemented in MainWindow::eventFilter().
+*/
+
+FormWindow::FormWindow( FormFile *f, MainWindow *mw, TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name, TQt::WDestructiveClose ), mainwindow( mw ),
+ commands( 100 ), pixInline( TRUE ), pixProject( FALSE )
+{
+ ff = f;
+ init();
+ initSlots();
+}
+
+FormWindow::FormWindow( FormFile *f, TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name, TQt::WDestructiveClose ), mainwindow( 0 ),
+ commands( 100 ), pixInline( TRUE )
+{
+ ff = f;
+ init();
+}
+
+void FormWindow::init()
+{
+ fake = qstrcmp( name(), "qt_fakewindow" ) == 0;
+ MetaDataBase::addEntry( this );
+ ff->setFormWindow( this );
+ iface = 0;
+ proj = 0;
+ propertyWidget = 0;
+ toolFixed = FALSE;
+ checkedSelectionsForMove = FALSE;
+ mContainer = 0;
+ startWidget = endWidget = 0;
+ currTool = POINTER_TOOL;
+ unclippedPainter = 0;
+ widgetPressed = FALSE;
+ drawRubber = FALSE;
+ setFocusPolicy( Qt::ClickFocus );
+ sizePreviewLabel = 0;
+ checkSelectionsTimer = new TQTimer( this, "checkSelectionsTimer" );
+ connect( checkSelectionsTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( invalidCheckedSelections() ) );
+ updatePropertiesTimer = new TQTimer( this );
+ connect( updatePropertiesTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( updatePropertiesTimerDone() ) );
+ showPropertiesTimer = new TQTimer( this );
+ connect( showPropertiesTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( showPropertiesTimerDone() ) );
+ selectionChangedTimer = new TQTimer( this );
+ connect( selectionChangedTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( selectionChangedTimerDone() ) );
+ windowsRepaintWorkaroundTimer = new TQTimer( this );
+ connect( windowsRepaintWorkaroundTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( windowsRepaintWorkaroundTimerTimeout() ) );
+ insertParent = 0;
+ connect( &commands, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ),
+ this, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ) );
+ propShowBlocked = FALSE;
+
+ setIcon( TQPixmap::fromMimeSource( "designer_form.png" ) );
+
+ connect( &commands, TQT_SIGNAL( modificationChanged( bool ) ),
+ this, TQT_SLOT( modificationChanged( bool ) ) );
+ buffer = 0;
+
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQFrame" ), this );
+ setMainContainer( w );
+ propertyWidget = TQT_TQOBJECT(w);
+ targetContainer = 0;
+ hadOwnPalette = FALSE;
+
+ defSpacing = BOXLAYOUT_DEFAULT_SPACING;
+ defMargin = BOXLAYOUT_DEFAULT_MARGIN;
+ hasLayoutFunc = FALSE;
+}
+
+void FormWindow::setMainWindow( MainWindow *w )
+{
+ mainwindow = w;
+ MetaDataBase::addEntry( this );
+ initSlots();
+}
+
+void FormWindow::initSlots()
+{
+ if ( isFake() )
+ return;
+ TQ_ASSERT( project() || MainWindow::self );
+ if ( !project() && !MainWindow::self )
+ return;
+ Project *p = project() ? project() : MainWindow::self->currProject();
+ if ( p && p->isCpp() ) {
+ TQString code = formFile()->code();
+ if ( code.isEmpty() )
+ formFile()->setCode( formFile()->codeComment() );
+ }
+}
+
+FormWindow::~FormWindow()
+{
+ if ( MainWindow::self && MainWindow::self->objectHierarchy()->formWindow() == this )
+ MainWindow::self->objectHierarchy()->setFormWindow( 0, 0 );
+
+ MetaDataBase::clear( this );
+ if ( ff )
+ ff->setFormWindow( 0 );
+ delete iface;
+}
+
+void FormWindow::closeEvent( TQCloseEvent *e )
+{
+ TQGuardedPtr<FormWindow> that = this;
+ if ( ff->closeEvent() && ( !that || ( mainwindow && mainwindow->unregisterClient( this ) ) ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void FormWindow::paintGrid( TQWidget *w, TQPaintEvent *e )
+{
+ if ( !mainWindow() || !mainWindow()->showGrid() )
+ return;
+ TQPixmap grid;
+ TQString grid_name;
+ grid_name.sprintf("FormWindowGrid_%d_%d", mainWindow()->grid().x(), mainWindow()->grid().y());
+ if( !TQPixmapCache::tqfind( grid_name, grid ) ) {
+ grid = TQPixmap( 350 + ( 350 % mainWindow()->grid().x() ), 350 + ( 350 % mainWindow()->grid().y() ) );
+ grid.fill( tqcolorGroup().color( TQColorGroup::Foreground ) );
+ TQBitmap tqmask( grid.width(), grid.height() );
+ tqmask.fill( Qt::color0 );
+ TQPainter p( &tqmask );
+ p.setPen( Qt::color1 );
+ for ( int y = 0; y < grid.width(); y += mainWindow()->grid().y()) {
+ for ( int x = 0; x < grid.height(); x += mainWindow()->grid().x() ) {
+ p.drawPoint( x, y );
+ }
+ }
+ grid.setMask( tqmask );
+ TQPixmapCache::insert( grid_name, grid );
+ }
+ TQPainter p( w );
+ p.setClipRegion( e->rect() );
+ p.drawTiledPixmap( TQRect( 0, 0, width(), height() ), grid );
+}
+
+/*! For operations like drawing a rubber band or drawing the rect
+ when inserting a new widget, a unclipped painter (which draws also
+ on child widgets) is needed. This method does all the initialization.
+*/
+
+void FormWindow::beginUnclippedPainter( bool doNot )
+{
+ endUnclippedPainter();
+ bool unclipped = testWFlags( TQt::WPaintUnclipped );
+ setWFlags( TQt::WPaintUnclipped );
+ unclippedPainter = new TQPainter;
+ unclippedPainter->begin( this );
+ if ( !unclipped )
+ clearWFlags( TQt::WPaintUnclipped );
+ if ( doNot ) {
+ unclippedPainter->setPen( TQPen( Qt::color0, 2 ) );
+ unclippedPainter->setRasterOp( TQt::NotROP );
+ }
+}
+
+/*!
+ Gets rid of an open unclipped painter.
+
+ \sa beginUnclippedPainter()
+*/
+
+void FormWindow::endUnclippedPainter()
+{
+ if ( unclippedPainter )
+ unclippedPainter->end();
+ delete unclippedPainter;
+ unclippedPainter = 0;
+}
+
+TQPoint FormWindow::gridPoint( const TQPoint &p )
+{
+ return TQPoint( ( p.x() / grid().x() ) * grid().x(),
+ ( p.y() / grid().y() ) * grid().y() );
+}
+
+void FormWindow::drawSizePreview( const TQPoint &pos, const TQString& text )
+{
+ unclippedPainter->save();
+ unclippedPainter->setPen( TQPen( tqcolorGroup().foreground(), 1 ));
+ unclippedPainter->setRasterOp( TQt::CopyROP );
+ if ( !sizePreviewPixmap.isNull() )
+ unclippedPainter->drawPixmap( sizePreviewPos, sizePreviewPixmap );
+ if ( text.isNull() ) {
+ sizePreviewPixmap = TQPixmap(); // set null again
+ unclippedPainter->restore();
+ return;
+ }
+ TQRect r = fontMetrics().boundingRect( 0, 0, 0, 0, TQt::AlignCenter, text );
+ r = TQRect( pos + TQPoint( 10, 10 ), r.size() + TQSize( 5, 5 ) );
+
+ checkPreviewGeometry( r );
+
+ sizePreviewPos = r.topLeft();
+ sizePreviewPixmap = TQPixmap::grabWindow( winId(), r.x(), r.y(), r.width(), r.height() );
+ unclippedPainter->setBrush( TQColor( 255, 255, 128 ) );
+ unclippedPainter->drawRect( r );
+ unclippedPainter->drawText( r, TQt::AlignCenter, text );
+ unclippedPainter->restore();
+}
+
+void FormWindow::insertWidget()
+{
+ CHECK_MAINWINDOW;
+ if ( !insertParent )
+ return;
+
+ if ( currTool == POINTER_TOOL )
+ return;
+
+ bool useSizeHint = !oldRectValid || ( currRect.width() < 2 && currRect.height() < 2 );
+ Qt::Orientation orient = Qt::Horizontal;
+ TQString n = WidgetDatabase::className( currTool );
+ if ( useSizeHint && ( n == "Spacer" || n == "TQSlider" || n == "Line" || n == "TQScrollBar" ) ) {
+ TQPopupMenu m( mainWindow() );
+ m.insertItem( tr( "&Qt::Horizontal" ) );
+ int ver = m.insertItem( tr( "&Qt::Vertical" ) );
+ int r = m.exec( TQCursor::pos() );
+ if ( r == ver )
+ orient = Qt::Vertical;
+ }
+
+
+ TQWidget *w = WidgetFactory::create( currTool, insertParent, 0, TRUE, &currRect, orient );
+ if ( !w )
+ return;
+
+ if ( !savePixmapInline() && currTool == WidgetDatabase::idFromClassName( "PixmapLabel" ) ) { // ### what to do for pixmaps in project
+ TQPixmap pix;
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( TQPixmap::fromMimeSource( "designer_image.png" ).convertToImage() );
+ ( (TQLabel*)w )->setPixmap( pix );
+ }
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) );
+ if ( WidgetDatabase::isCustomWidget( id ) ) {
+ TQWhatsThis::add( w, tr("<b>A %1 (custom widget)</b> "
+ "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> "
+ "menu to add and change custom widgets. You can add "
+ "properties as well as Q_SIGNALS and Q_SLOTS to integrate custom widgets into "
+ "<i>TQt Designer</i>, and provide a pixmap which will be used to represent "
+ "the widget on the form.</p>")
+ .arg(WidgetDatabase::toolTip( id )) );
+ TQToolTip::add( w, tr("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) );
+ } else {
+ TQString tt = WidgetDatabase::toolTip( id );
+ TQString wt = WidgetDatabase::whatsThis( id );
+ if ( !wt.isEmpty() && !tt.isEmpty() )
+ TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) );
+ }
+
+ TQString s = w->name();
+ unify( w, s, TRUE );
+ w->setName( s );
+ insertWidget( w );
+ TQRect r( currRect );
+ if ( !oldRectValid ||
+ ( currRect.width() < 2 && currRect.height() < 2 ) )
+ r = TQRect( rectAnchor, TQSize( 0, 0 ) );
+
+ TQPoint p = r.topLeft();
+ p = mapToGlobal( p );
+ p = insertParent->mapFromGlobal( p );
+ r = TQRect( p, r.size() );
+
+ if ( useSizeHint ) {
+ if ( n == "Spacer" ) {
+ if ( orient == Qt::Vertical ) {
+ r.setWidth( 20 );
+ r.setHeight( 40 );
+ } else {
+ r.setWidth( 40 );
+ r.setHeight( 20 );
+ }
+ } else {
+ r.setWidth( w->tqsizeHint().width() );
+ r.setHeight( w->tqsizeHint().height() );
+ }
+ }
+
+ if ( r.width() < 2 * grid().x() )
+ r.setWidth( 2 * grid().x() );
+ if ( r.height() < 2 * grid().y() )
+ r.setHeight( 2 * grid().y() );
+
+ TQObjectListIt it( insertParent->childrenListObject() );
+ TQWidgetList lst;
+ if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ for ( ; it.current(); ) {
+ TQObject *o = it.current();
+ ++it;
+ if ( o->isWidgetType() &&
+ ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.tqfind( (TQWidget*)o ) && o != TQT_TQOBJECT(w) ) {
+ TQRect r2( ( (TQWidget*)o )->pos(),
+ ( (TQWidget*)o )->size() );
+ if ( r.tqcontains( r2 ) )
+ lst.append( (TQWidget*)o );
+ }
+ }
+ }
+
+ if ( !lst.isEmpty() ) {
+ TQWidget *pw = WidgetFactory::containerOfWidget( w );
+ if (pw) {
+ TQValueList<TQPoint> op, np;
+ for ( TQWidget *i = lst.first(); i; i = lst.next() ) {
+ op.append( i->pos() );
+ TQPoint pos = pw->mapFromGlobal( i->mapToGlobal( TQPoint( 0, 0 ) ) );
+ pos -= r.topLeft();
+ np.append( pos );
+ }
+
+ MoveCommand *mv = new MoveCommand( tr( "Retqparent Widgets" ), this,
+ lst, op, np, insertParent, pw );
+
+ if ( !toolFixed )
+ mainwindow->resetTool();
+ else
+ setCursorToAll( CrossCursor, w );
+
+ InsertCommand *cmd = new InsertCommand( tr( "Insert %1" ).arg( w->name() ), this, w, r );
+
+ TQPtrList<Command> commands;
+ commands.append( mv );
+ commands.append( cmd );
+
+ MacroCommand *mc = new MacroCommand( tr( "Insert %1" ).arg( w->name() ), this, commands );
+ commandHistory()->addCommand( mc );
+ mc->execute();
+ }
+ } else {
+ if ( !toolFixed )
+ mainwindow->resetTool();
+ else
+ setCursorToAll( CrossCursor, w );
+
+ InsertCommand *cmd = new InsertCommand( tr( "Insert %1" ).arg( w->name() ), this, w, r );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+
+ TemplateWizardInterface *iface = mainWindow()->templateWizardInterface( w->className() );
+ if ( iface ) {
+ iface->setup( w->className(), w, iFace(), mainWindow()->designerInterface() );
+ iface->release();
+ }
+}
+
+void FormWindow::insertWidget( TQWidget *w, bool checkName )
+{
+ if ( !w )
+ return;
+ if ( checkName ) {
+ TQString s = w->name();
+ unify( w, s, TRUE );
+ w->setName( s );
+ }
+
+ MetaDataBase::addEntry( w );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) );
+ if ( WidgetDatabase::isCustomWidget( id ) ) {
+ TQWhatsThis::add( w, tr("<b>A %1 (custom widget)</b> "
+ "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> "
+ "menu to add and change custom widgets. You can add "
+ "properties as well as Q_SIGNALS and Q_SLOTS to integrate custom widgets into "
+ "<i>TQt Designer</i>, and provide a pixmap which will be used to represent "
+ "the widget on the form.</p>")
+ .arg(WidgetDatabase::toolTip( id )) );
+ TQToolTip::add( w, tr("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) );
+ } else {
+ TQString tt = WidgetDatabase::toolTip( id );
+ TQString wt = WidgetDatabase::whatsThis( id );
+ if ( !wt.isEmpty() && !tt.isEmpty() )
+ TQWhatsThis::add( w, TQString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) );
+ }
+
+ restoreCursors( w, this );
+ widgets()->insert( w, w );
+ w->show();
+}
+
+void FormWindow::removeWidget( TQWidget *w )
+{
+ MetaDataBase::removeEntry( w );
+ widgets()->take( w );
+}
+
+void FormWindow::handleContextMenu( TQContextMenuEvent *e, TQWidget *w )
+{
+ CHECK_MAINWINDOW;
+ switch ( currTool ) {
+ case POINTER_TOOL: {
+ if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
+ raiseChildSelections( w ); // raise selections and select widget
+ selectWidget( w );
+ // if widget is laid out, tqfind the first non-laid out super-widget
+ TQWidget *realWidget = w; // but store the original one
+ while ( w->parentWidget() &&
+ ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout ||
+ !insertedWidgets.tqfind(w) ) )
+ w = w->parentWidget();
+ if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget ) {
+ e->accept();
+ mainwindow->popupFormWindowMenu( e->globalPos(), this );
+ } else {
+ e->accept();
+ mainwindow->popupWidgetMenu( e->globalPos(), this, realWidget);
+ }
+ } else {
+ e->accept();
+ clearSelection();
+ mainwindow->popupFormWindowMenu( e->globalPos(), this );
+ }
+ break; }
+ default:
+ break;
+ }
+}
+
+void FormWindow::handleMousePress( TQMouseEvent *e, TQWidget *w )
+{
+ CHECK_MAINWINDOW;
+ checkedSelectionsForMove = FALSE;
+ checkSelectionsTimer->stop();
+ if ( !sizePreviewLabel ) {
+ sizePreviewLabel = new TQLabel( this );
+ sizePreviewLabel->hide();
+ sizePreviewLabel->setBackgroundColor( TQColor( 255, 255, 128 ) );
+ sizePreviewLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box );
+ }
+
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
+ // if the clicked widget is not in a tqlayout, raise it
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout )
+ w->raise();
+ if ( ( e->state() & ControlButton ) ) { // with control pressed, always start rubber band selection
+ drawRubber = TRUE;
+ currRect = TQRect( 0, 0, -1, -1 );
+ startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber );
+ break;
+ }
+
+ bool sel = isWidgetSelected( w );
+ if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { // control not pressed...
+ if ( !sel ) { // ...and widget no selectted: unselect all
+ clearSelection( FALSE );
+ } else { // ...widget selected
+ // only if widget has a tqlayout (it is a tqlayout meta widget or a laid out container!), unselect its childs
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ) {
+ TQObjectList *l = w->queryList( "TQWidget" );
+ setPropertyShowingBlocked( TRUE );
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( !o->isWidgetType() )
+ continue;
+ if ( insertedWidgets.tqfind( (TQWidget*)o ) )
+ selectWidget( (TQWidget*)o, FALSE );
+ }
+ setPropertyShowingBlocked( FALSE );
+ delete l;
+ }
+ }
+ tqApp->processEvents();
+ }
+ if ( ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) &&
+ sel && e->button() == Qt::LeftButton ) { // control pressed and selected, unselect widget
+ selectWidget( w, FALSE );
+ break;
+ }
+
+ raiseChildSelections( w ); // raise selections and select widget
+ selectWidget( w );
+
+ // if widget is laid out, tqfind the first non-laid out super-widget
+ while ( w->parentWidget() &&
+ ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.tqfind(w) ) )
+ w = w->parentWidget();
+
+ if ( e->button() == Qt::LeftButton ) { // left button: store original tqgeometry and more as the widget might start moving
+ widgetPressed = TRUE;
+ widgetGeom = TQRect( w->pos(), w->size() );
+ oldPressPos = w->mapFromGlobal( e->globalPos() );
+ origPressPos = oldPressPos;
+ checkedSelectionsForMove = FALSE;
+ moving.clear();
+ if ( w->parentWidget() && !isMainContainer( w->parentWidget() ) && !isCentralWidget( w->parentWidget() ) ) {
+ targetContainer = w->parentWidget();
+ hadOwnPalette = w->parentWidget()->ownPalette();
+ restorePalette = w->parentWidget()->palette();
+ }
+ }
+ } else { // press was on the formwindow
+ if ( e->button() == Qt::LeftButton ) { // left button: start rubber selection and show formwindow properties
+ drawRubber = TRUE;
+ if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) {
+ clearSelection( FALSE );
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(mainContainer());
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ }
+ currRect = TQRect( 0, 0, -1, -1 );
+ startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber );
+ }
+ }
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ if ( e->button() != Qt::LeftButton )
+ break;
+ validForBuddy = FALSE;
+ if ( currTool == BUDDY_TOOL ) {
+ if ( !::tqqt_cast<TQLabel*>(w) )
+ break;
+ clearSelection( FALSE );
+ validForBuddy = TRUE;
+ mainWindow()->statusBar()->message( tr( "Set buddy for '%1' to..." ).arg( w->name() ) );
+ } else {
+ mainWindow()->statusBar()->message( tr( "Connect '%1' with..." ).arg( w->name() ) );
+ }
+ saveBackground();
+ startPos = mapFromGlobal( e->globalPos() );
+ currentPos = startPos;
+ startWidget = designerWidget( w );
+ endWidget = startWidget;
+ beginUnclippedPainter( FALSE );
+ drawConnectionLine();
+ break;
+ case ORDER_TOOL:
+ if ( !isMainContainer( w ) ) { // press on a child widget
+ orderedWidgets.removeRef( w );
+ orderedWidgets.append( w );
+ for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
+ int i = stackedWidgets.tqfindRef( wid );
+ if ( i != -1 ) {
+ stackedWidgets.removeRef( wid );
+ stackedWidgets.insert( 0, wid );
+ }
+ }
+ TQWidgetList oldl = MetaDataBase::tabOrder( this );
+ TabOrderCommand *cmd = new TabOrderCommand( tr( "Change Tab Order" ), this, oldl, stackedWidgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd, TRUE );
+ updateOrderIndicators();
+ }
+ break;
+ default: // any insert widget tool
+ if ( e->button() == Qt::LeftButton ) {
+ insertParent = WidgetFactory::containerOfWidget( mainContainer() ); // default tqparent for new widget is the formwindow
+ if ( !isMainContainer( w ) ) { // press was not on formwindow, check if we can tqfind another tqparent
+ TQWidget *wid = w;
+ for (;;) {
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( wid ) );
+ if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) &&
+ !::tqqt_cast<TQLayoutWidget*>(wid) && !::tqqt_cast<TQSplitter*>(wid) ) {
+ insertParent = WidgetFactory::containerOfWidget( wid ); // found another tqparent, store it
+ break;
+ } else {
+ wid = wid->parentWidget();
+ if ( !wid )
+ break;
+ }
+ }
+ }
+ startRectDraw( w->mapFromGlobal( e->globalPos() ), e->globalPos(), w, Insert );
+ }
+ break;
+ }
+}
+
+void FormWindow::handleMouseDblClick( TQMouseEvent *, TQWidget *w )
+{
+ CHECK_MAINWINDOW;
+ switch ( currTool ) {
+ case ORDER_TOOL:
+ if ( !isMainContainer( w ) ) { // press on a child widget
+ orderedWidgets.clear();
+ orderedWidgets.append( w );
+ for ( TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
+ int i = stackedWidgets.tqfindRef( wid );
+ if ( i != -1 ) {
+ stackedWidgets.removeRef( wid );
+ stackedWidgets.insert( 0, wid );
+ }
+ }
+ TQWidgetList oldl = MetaDataBase::tabOrder( this );
+ TabOrderCommand *cmd = new TabOrderCommand( tr( "Change Tab Order" ), this, oldl, stackedWidgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd, TRUE );
+ updateOrderIndicators();
+ }
+ default:
+ if ( !WidgetFactory::isPassiveInteractor( w ) &&
+ ( isMainContainer( w ) || w == this ) )
+ mainWindow()->editSource();
+ break;
+ }
+}
+
+void FormWindow::handleMouseMove( TQMouseEvent *e, TQWidget *w )
+{
+ CHECK_MAINWINDOW;
+ if ( ( e->state() & Qt::LeftButton ) != Qt::LeftButton )
+ return;
+
+ TQWidget *newendWidget = endWidget, *oldendWidget = endWidget, *wid;
+ bool drawRecRect;
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( widgetPressed && allowMove( w ) ) { // we are prepated for a move
+
+ // if widget is laid out, tqfind the first non-laid out super-widget
+ while ( w->parentWidget() &&
+ ( WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout || !insertedWidgets.tqfind(w ) ) )
+ w = w->parentWidget();
+
+ // calc correct position
+ TQPoint pos = w->mapFromGlobal( e->globalPos() );
+
+#if 0
+ TQPoint mpos = w->mapToParent( pos );
+ // check if we are not outside the visible area, else correct coords
+ if ( mpos.x() < 0 )
+ pos.setX( w->mapFromParent( TQPoint( 0, mpos.y() ) ).x() );
+ if ( mpos.y() < 0 )
+ pos.setY( w->mapFromParent( TQPoint( mpos.x(), 0 ) ).y() );
+ if ( mpos.x() > w->parentWidget()->width() )
+ pos.setX( w->mapFromParent( TQPoint( w->parentWidget()->width(), mpos.y() ) ).x() );
+ if ( mpos.y() > w->parentWidget()->height() )
+ pos.setY( w->mapFromParent( TQPoint( mpos.x(), w->parentWidget()->height() ) ).y() );
+#endif
+
+ // calc move distance and store it
+ TQPoint d = oldPressPos - pos;
+ if ( TQABS( d.x() ) < grid().x() )
+ d.setX( 0 );
+ if ( TQABS( d.y() ) < grid().y() )
+ d.setY( 0 );
+ if ( d.x() == 0 )
+ pos.setX( oldPressPos.x() );
+ if ( d.y() == 0 )
+ pos.setY( oldPressPos.y() );
+ oldPressPos = pos;
+
+ // snap to grid
+ int x = widgetGeom.x() - d.x();
+ widgetGeom.setX( x );
+ x = ( x / grid().x() ) * grid().x();
+ int y = widgetGeom.y() - d.y();
+ widgetGeom.setY( y );
+ y = ( y / grid().y() ) * grid().y();
+ TQPoint p = w->pos();
+
+ if ( x - p.x() != 0 || y - p.y() != 0 ) { // if we actually have to move
+ if ( !checkedSelectionsForMove ) { // if not checked yet, check if the correct widget are selected...
+ if ( !isWidgetSelected( w ) ) { // and unselect others. Only siblings can be moved at the same time
+ setPropertyShowingBlocked( TRUE );
+ selectWidget( w );
+ setPropertyShowingBlocked( FALSE );
+ }
+ checkSelectionsForMove( w );
+ }
+
+ // check whether we would have to reparent the selection and highlight the possible new tqparent container
+ TQMapConstIterator<TQWidget*, TQPoint> it = moving.begin();
+ TQWidget* wa = containerAt( e->globalPos(), it.key() );
+ if ( wa && !isMainContainer( wa ) && !isCentralWidget( wa ) ) {
+ wa = WidgetFactory::containerOfWidget( wa );
+ // ok, looks like we moved onto a container
+
+ if ( wa != targetContainer ) {
+ if ( targetContainer ) {
+ if ( hadOwnPalette )
+ targetContainer->setPalette( restorePalette );
+ else
+ targetContainer->unsetPalette();
+ }
+ targetContainer = wa;
+ hadOwnPalette = wa->ownPalette();
+ restorePalette = wa->palette();
+ wa->setPaletteBackgroundColor( wa->tqcolorGroup().midlight() );
+ }
+ }
+ else if ( targetContainer ) {
+ if( hadOwnPalette )
+ targetContainer->setPalette( restorePalette );
+ else
+ targetContainer->unsetPalette();
+ targetContainer = 0;
+ }
+
+ // finally move the selected widgets and show/update preview label
+ moveSelectedWidgets( x - p.x(), y - p.y() );
+ sizePreviewLabel->setText( tr( "%1/%2" ).arg( w->pos().x() ).arg( w->pos().y() ) );
+ sizePreviewLabel->adjustSize();
+ TQRect lg( mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), sizePreviewLabel->size() );
+ checkPreviewGeometry( lg );
+ sizePreviewLabel->setGeometry( lg );
+ sizePreviewLabel->raise();
+ sizePreviewLabel->show();
+#if defined(TQ_WS_WIN32)
+ windowsRepaintWorkaroundTimer->start( 100, TRUE );
+#endif
+ } else { // if we don't need to move, do some indication
+ TQRect lg( mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ), sizePreviewLabel->size() );
+ checkPreviewGeometry( lg );
+ sizePreviewLabel->move( lg.x(), lg.y() );
+ }
+
+ oldPressPos += ( p - w->pos() );
+ } else if ( drawRubber ) { // draw rubber if we are in rubber-selection mode
+ continueRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber );
+ }
+ break;
+ case CONNECT_TOOL:
+ restoreConnectionLine();
+ wid = tqApp->widgetAt( e->globalPos(), TRUE );
+ if ( wid )
+ wid = designerWidget( wid );
+ if ( wid && ( isMainContainer( wid ) || insertedWidgets.tqfind( wid ) ) && wid->isVisibleTo( this ) )
+ newendWidget = wid;
+ if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) )
+ newendWidget = (TQWidget*)endWidget;
+ drawRecRect = newendWidget != endWidget;
+ if ( newendWidget &&
+ ( isMainContainer( newendWidget ) || insertedWidgets.tqfind( newendWidget ) ) && !isCentralWidget( newendWidget ) )
+ endWidget = newendWidget;
+ mainWindow()->statusBar()->message( tr( "Connect '%1' to '%2'" ).arg( startWidget->name() ).
+ arg( endWidget->name() ) );
+ currentPos = mapFromGlobal( e->globalPos() );
+ tqApp->processEvents();
+ if ( drawRecRect )
+ restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->parentWidget(), ( (TQWidget*)oldendWidget )->pos() ),
+ ( (TQWidget*)oldendWidget )->size() ) );
+ drawConnectionLine();
+ break;
+ case BUDDY_TOOL:
+ if ( !validForBuddy )
+ break;
+ restoreConnectionLine();
+ wid = tqApp->widgetAt( e->globalPos(), TRUE );
+ if ( wid )
+ wid = designerWidget( wid );
+ if ( wid && canBeBuddy( wid ) && wid->isVisibleTo( this ) )
+ newendWidget = wid;
+ else
+ newendWidget = 0;
+ if ( ::tqqt_cast<TQLayoutWidget*>(newendWidget) || ::tqqt_cast<Spacer*>(newendWidget) )
+ newendWidget = (TQWidget*)endWidget;
+ drawRecRect = newendWidget != endWidget;
+ if ( !newendWidget )
+ endWidget = newendWidget;
+ else if ( insertedWidgets.tqfind( newendWidget ) && !isCentralWidget( newendWidget ) )
+ endWidget = newendWidget;
+ if ( endWidget )
+ mainWindow()->statusBar()->message( tr( "Set buddy '%1' to '%2'" ).arg( startWidget->name() ).
+ arg( endWidget->name() ) );
+ else
+ mainWindow()->statusBar()->message( tr( "Set buddy '%1' to ..." ).arg( startWidget->name() ) );
+ currentPos = mapFromGlobal( e->globalPos() );
+ tqApp->processEvents();
+ if ( drawRecRect && oldendWidget )
+ restoreRect( TQRect( mapToForm( ( (TQWidget*)oldendWidget )->parentWidget(), ( (TQWidget*)oldendWidget )->pos() ),
+ ( (TQWidget*)oldendWidget )->size() ) );
+ drawConnectionLine();
+ break;
+ case ORDER_TOOL:
+ break;
+ default: // we are in an insert-widget tool
+ if ( insertParent ) // draw insert rect
+ continueRectDraw( w->mapFromGlobal( e->globalPos() ), e->globalPos(), w, Insert );
+ break;
+ }
+}
+
+void FormWindow::handleMouseRelease( TQMouseEvent *e, TQWidget *w )
+{
+ CHECK_MAINWINDOW;
+ if ( e->button() != Qt::LeftButton )
+ return;
+
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( widgetPressed && allowMove( w ) ) { // we moved the widget
+ sizePreviewLabel->hide();
+
+ if ( moving.isEmpty() || w->pos() == *moving.tqfind(w) )
+ break;
+
+ // restore targetContainer
+ if ( targetContainer ) {
+ if( hadOwnPalette )
+ targetContainer->setPalette( restorePalette );
+ else
+ targetContainer->unsetPalette();
+ }
+
+ // tell property editor to update
+ if ( propertyWidget && propertyWidget->isWidgetType() && !isMainContainer( propertyWidget ) )
+ emitUpdateProperties( propertyWidget );
+
+ TQMapConstIterator<TQWidget*,TQPoint> it = moving.begin();
+ TQWidget *oldParent = it.key()->parentWidget();
+ TQWidget *newParent = oldParent;
+ // check whether we have to reparent the selection
+ TQWidget* wa = containerAt( e->globalPos(), it.key() );
+ if ( wa ) {
+ wa = WidgetFactory::containerOfWidget( wa );
+ // ok, looks like we moved onto a container
+
+ // check whether we really have different parents.
+ if ( wa == it.key()->parentWidget() )
+ goto make_move_command;
+
+ // break tqlayout if necessary
+ if ( WidgetFactory::layoutType( wa ) != WidgetFactory::NoLayout ) {
+ if ( TQMessageBox::information( mainWindow(), tr( "Inserting a Widget" ),
+ tr( "You tried to insert a widget into the "
+ "tqlayout Container Widget '%1'.\n"
+ "This is not possible. "
+ "In order to insert the widget, the tqlayout of '%1'\n"
+ "must first be broken.\n"
+ "Break the tqlayout or cancel the operation?" ).
+ arg( wa->name() ).
+ arg( wa->name() ), tr( "&Break Layout" ), tr( "&Cancel" ) ) )
+ goto make_move_command; // cancel
+ breakLayout( wa );
+ }
+
+ // doesn't need to be a command, the MoveCommand does reparenting too
+ bool emitSelChanged = FALSE;
+ for ( TQMap<TQWidget*, TQPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) {
+ TQWidget *i = it.key();
+ if ( !emitSelChanged && ::tqqt_cast<TQButton*>(i) ) {
+ if ( ::tqqt_cast<TQButtonGroup*>(i->parentWidget()) || ::tqqt_cast<TQButtonGroup*>(wa) )
+ emitSelChanged = TRUE;
+ if ( !::tqqt_cast<TQButtonGroup*>(wa) ) {
+ MetaDataBase::setPropertyChanged( i, "buttonGroupId", FALSE );
+ if ( ::tqqt_cast<TQButtonGroup*>(i->parentWidget()) )
+ ( (TQButtonGroup*)i->parentWidget() )->remove( (TQButton*)i );
+ }
+ }
+ TQPoint pos = wa->mapFromGlobal( i->mapToGlobal( TQPoint(0,0) ) );
+ i->reparent( wa, pos, TRUE );
+ raiseSelection( i );
+ raiseChildSelections( i );
+ widgetChanged( i );
+ mainWindow()->objectHierarchy()->widgetRemoved( i );
+ mainWindow()->objectHierarchy()->widgetInserted( i );
+ }
+ if ( emitSelChanged ) {
+ emit showProperties( TQT_TQOBJECT(wa) );
+ emit showProperties( propertyWidget );
+ }
+ newParent = wa;
+ }
+
+ make_move_command:
+ TQWidgetList widgets; // collect the widgets and its old and new positions which have been moved
+ TQValueList<TQPoint> oldPos, newPos;
+ for ( it = moving.begin(); it != moving.end(); ++it ) {
+ widgets.append( it.key() );
+ oldPos.append( *it );
+ newPos.append( it.key()->pos() );
+ }
+ // add move command, don't execute it, this is just a summary of the operations we did during the move-event handling
+ commandHistory()->addCommand( new MoveCommand( tr( "Move" ),
+ this, widgets,
+ oldPos, newPos, oldParent, newParent ) );
+ } else if ( drawRubber ) { // we were drawing a rubber selection
+ endRectDraw(); // get rid of the rectangle
+ blockSignals( TRUE );
+ selectWidgets(); // select widgets which intersect the rect
+ blockSignals( FALSE );
+ emitSelectionChanged(); // inform about selection changes
+ if ( propertyWidget )
+ emitShowProperties( propertyWidget );
+ }
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ restoreConnectionLine();
+ if ( startWidget )
+ restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->parentWidget(),
+ ( (TQWidget*)startWidget )->pos() ),
+ ((TQWidget*)startWidget )->size() ) );
+ if ( endWidget )
+ restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->parentWidget(),
+ ( (TQWidget*)endWidget )->pos() ),
+ ( (TQWidget*)endWidget )->size() ) );
+ endUnclippedPainter();
+ tqApp->processEvents();
+
+ if ( startWidget && endWidget ) {
+ if ( currTool == CONNECT_TOOL )
+ editConnections();
+ else if ( currTool == BUDDY_TOOL && validForBuddy && startWidget != endWidget ) {
+ TQString oldBuddy = startWidget->property( "buddy" ).toString();
+ if ( oldBuddy.isNull() )
+ oldBuddy = "";
+ SetPropertyCommand *cmd = new SetPropertyCommand( tr( "Set buddy for " + TQString( startWidget->name() ) ),
+ this, startWidget, mainWindow()->propertyeditor(),
+ "buddy", startWidget->property( "buddy" ),
+ endWidget->name(), endWidget->name(),
+ oldBuddy );
+ commandHistory()->addCommand( cmd, TRUE );
+ cmd->execute();
+ emitUpdateProperties( startWidget );
+ }
+ }
+ if ( !toolFixed )
+ mainwindow->resetTool();
+ startWidget = endWidget = 0;
+ mainWindow()->statusBar()->clear();
+ break;
+ case ORDER_TOOL:
+ break;
+ default: // any insert widget tool is active
+ if ( insertParent ) { // we should insert the new widget now
+ endRectDraw();
+ if ( WidgetFactory::layoutType( insertParent ) != WidgetFactory::NoLayout ) {
+ if ( TQMessageBox::information( mainWindow(), tr( "Inserting a Widget" ),
+ tr( "You tried to insert a widget into the "
+ "tqlayout Container Widget '%1'.\n"
+ "This is not possible. "
+ "In order to insert the widget, the tqlayout of '%1'\n"
+ "must first be broken.\n"
+ "Break the tqlayout or cancel the operation?" ).
+ arg( insertParent->name() ).
+ arg( insertParent->name() ), tr( "&Break Layout" ), tr( "&Cancel" ) ) == 0 ) {
+ breakLayout( insertParent );
+ } else {
+ if ( !toolFixed )
+ mainWindow()->resetTool();
+ break;
+ }
+ }
+ insertWidget(); // so do it
+ }
+ break;
+ }
+ widgetPressed = FALSE;
+ drawRubber = FALSE;
+ insertParent = 0;
+ delete buffer;
+ buffer = 0;
+}
+
+void FormWindow::handleKeyPress( TQKeyEvent *e, TQWidget *w )
+{
+ CHECK_MAINWINDOW;
+ e->ignore();
+ checkSelectionsTimer->stop();
+ if ( !checkedSelectionsForMove &&
+ ( e->key() == Qt::Key_Left ||
+ e->key() == Qt::Key_Right ||
+ e->key() == Qt::Key_Up ||
+ e->key() == Qt::Key_Down ) &&
+ propertyWidget->isWidgetType() )
+ checkSelectionsForMove( (TQWidget*)propertyWidget );
+ checkSelectionsTimer->start( 1000, TRUE );
+ if ( e->key() == Qt::Key_Left || e->key() == Qt::Key_Right ||
+ e->key() == Qt::Key_Up || e->key() == Qt::Key_Down ) {
+ TQWidgetList widgets;
+ TQValueList<TQPoint> oldPos, newPos;
+ for ( WidgetSelection *s = selections.first(); s; s = selections.next() ) {
+ if ( s->isUsed() ) {
+ int dx = 0, dy = 0;
+ bool control = e->state() & ControlButton;
+
+ switch ( e->key() ) {
+ case Qt::Key_Left: {
+ e->accept();
+ if ( control )
+ dx = -1;
+ else
+ dx = -grid().x();
+ } break;
+ case Qt::Key_Right: {
+ e->accept();
+ if ( control )
+ dx = 1;
+ else
+ dx = grid().x();
+ } break;
+ case Qt::Key_Up: {
+ e->accept();
+ if ( control )
+ dy = -1;
+ else
+ dy = -grid().y();
+ } break;
+ case Qt::Key_Down: {
+ e->accept();
+ if ( control )
+ dy = 1;
+ else
+ dy = grid().y();
+ } break;
+ default:
+ break;
+ }
+
+ widgets.append( s->widget() );
+ oldPos.append( s->widget()->pos() );
+ newPos.append( s->widget()->pos() + TQPoint( dx, dy ) );
+ }
+ }
+ if ( !widgets.isEmpty() ) {
+ MoveCommand *cmd = new MoveCommand( tr( "Move" ), this,
+ widgets, oldPos, newPos, 0, 0 );
+ commandHistory()->addCommand( cmd, TRUE );
+ cmd->execute();
+ }
+ }
+ if ( !e->isAccepted() ) {
+ TQObjectList *l = queryList( "TQWidget" );
+ if ( !l )
+ return;
+ if ( l->tqfind( TQT_TQOBJECT(w) ) != -1 )
+ e->accept();
+ delete l;
+ }
+
+}
+
+void FormWindow::handleKeyRelease( TQKeyEvent *e, TQWidget * )
+{
+ e->ignore();
+}
+
+void FormWindow::selectWidget( TQT_BASE_OBJECT_NAME *o, bool select )
+{
+ CHECK_MAINWINDOW;
+ if ( !o->isWidgetType() ) {
+ // ########### do TQObject stuff
+ return;
+ }
+
+ TQWidget *w = (TQWidget*)o;
+
+ if ( isMainContainer( w ) ) {
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(mainContainer());
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ emitShowProperties( propertyWidget );
+ return;
+ }
+
+ if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && w == ( (TQMainWindow*)mainContainer() )->centralWidget() ) {
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(mainContainer());
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ emitShowProperties( propertyWidget );
+ return;
+ }
+
+ if ( ::tqqt_cast<TQDesignerToolBar*>(o) )
+ return;
+
+ if ( select ) {
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(w);
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ if ( !isPropertyShowingBlocked() )
+ emitShowProperties( propertyWidget );
+ WidgetSelection *s = usedSelections.tqfind( w );
+ if ( s ) {
+ s->show();
+ return;
+ }
+
+ for ( WidgetSelection *s2 = selections.first(); s2; s2 = selections.next() ) {
+ if ( !s2->isUsed() ) {
+ s = s2;
+ }
+ }
+
+ if ( !s ) {
+ s = new WidgetSelection( this, &usedSelections );
+ selections.append( s );
+ }
+
+ s->setWidget( w );
+ emitSelectionChanged();
+ } else {
+ WidgetSelection *s = usedSelections.tqfind( w );
+ if ( s )
+ s->setWidget( 0 );
+ TQObject *opw = propertyWidget;
+ if ( !usedSelections.isEmpty() )
+ propertyWidget = TQT_TQOBJECT(TQPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget());
+ else
+ propertyWidget = TQT_TQOBJECT(mainContainer());
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ if ( !isPropertyShowingBlocked() )
+ emitShowProperties( propertyWidget );
+ emitSelectionChanged();
+ }
+}
+
+TQPoint FormWindow::grid() const
+{
+ if ( !mainWindow() || !mainWindow()->snapGrid() )
+ return TQPoint( 1, 1 );
+ return mainWindow()->grid();
+}
+
+void FormWindow::updateSelection( QWidget *w )
+{
+ WidgetSelection *s = usedSelections.tqfind( w );
+ if ( !w->isVisibleTo( this ) )
+ selectWidget( w, FALSE );
+ else if ( s )
+ s->updateGeometry();
+}
+
+void FormWindow::raiseSelection( QWidget *w )
+{
+ WidgetSelection *s = usedSelections.tqfind( w );
+ if ( s )
+ s->show();
+}
+
+void FormWindow::repaintSelection( TQWidget *w )
+{
+ WidgetSelection *s = usedSelections.tqfind( w );
+ if ( s )
+ s->update();
+}
+
+void FormWindow::clearSelection( bool changePropertyDisplay )
+{
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ it.current()->setWidget( 0, FALSE );
+
+ usedSelections.clear();
+ if ( changePropertyDisplay ) {
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(mainContainer());
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ emitShowProperties( propertyWidget );
+ }
+ emitSelectionChanged();
+}
+
+void FormWindow::startRectDraw( const TQPoint &p, const TQPoint &global, TQWidget *, RectType t )
+{
+ TQPoint pos( p );
+ pos = mapFromGlobal( global );
+ oldRectValid = FALSE;
+ beginUnclippedPainter( TRUE );
+ if ( t == Rubber )
+ unclippedPainter->setPen( TQPen( Qt::color0, 1 ) );
+ if ( t == Insert )
+ rectAnchor = gridPoint( pos );
+ else if ( t == Rubber )
+ rectAnchor = pos;
+ currRect = TQRect( rectAnchor, TQPoint( 0, 0 ) );
+ if ( t == Insert )
+ drawSizePreview( pos, tr("Use Size Hint") );
+}
+
+void FormWindow::continueRectDraw( const TQPoint &p, const TQPoint &global, TQWidget *, RectType t )
+{
+ TQPoint pos =p;
+ pos = mapFromGlobal( global );
+ TQPoint p2;
+ if ( t == Insert )
+ p2 = gridPoint( pos );
+ else if ( t == Rubber )
+ p2 = pos;
+ TQRect r( rectAnchor, p2 );
+ r = r.normalize();
+
+ if ( currRect == r ) {
+ TQString t = tr( "%1/%2" );
+ t = t.arg( r.width() - 1 ).arg( r.height() - 1 );
+ drawSizePreview( pos, t );
+ return;
+ }
+
+ if ( oldRectValid )
+ unclippedPainter->drawRect( currRect );
+ if ( r.width() > 1 || r.height() > 1 ) {
+ oldRectValid = TRUE;
+ currRect = r;
+ if ( t == Insert ) {
+ TQString t = tr( "%1/%2" );
+ t = t.arg( r.width() - 1 ).arg( r.height() - 1 );
+ drawSizePreview( pos, t );
+ }
+ unclippedPainter->setClipRegion( TQRegion( rect() ).subtract( TQRect( sizePreviewPos, sizePreviewPixmap.size() ) ) );
+ unclippedPainter->drawRect( currRect );
+ unclippedPainter->setClipping( FALSE );
+ } else {
+ oldRectValid = FALSE;
+ if ( t == Insert )
+ drawSizePreview( pos, tr("Use Size Hint") );
+ }
+}
+
+void FormWindow::endRectDraw()
+{
+ if ( !unclippedPainter )
+ return;
+
+ if ( oldRectValid )
+ unclippedPainter->drawRect( currRect );
+ drawSizePreview( TQPoint(-1,-1), TQString() );
+ endUnclippedPainter();
+}
+
+void FormWindow::selectWidgets()
+{
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
+ if ( l ) {
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets[ (void*)o ] ) {
+ TQPoint p = ( (TQWidget*)o )->mapToGlobal( TQPoint(0,0) );
+ p = mapFromGlobal( p );
+ TQRect r( p, ( (TQWidget*)o )->size() );
+ if ( r.intersects( currRect ) && !r.tqcontains( currRect ) )
+ selectWidget( (TQWidget*)o );
+ }
+ }
+ delete l;
+ }
+ emitSelectionChanged();
+}
+
+bool FormWindow::isWidgetSelected( TQT_BASE_OBJECT_NAME *w )
+{
+ if ( w->isWidgetType() )
+ return usedSelections.tqfind( (TQWidget*)w ) != 0;
+ return FALSE; // #### do stuff for TQObjects
+}
+
+void FormWindow::moveSelectedWidgets( int dx, int dy )
+{
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it ) {
+ WidgetSelection *s = it.current();
+ TQWidget *w = s->widget();
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ continue;
+ w->move( w->x() + dx, w->y() + dy );
+ s->updateGeometry();
+ updateChildSelections( w );
+ }
+}
+
+CommandHistory *FormWindow::commandHistory()
+{
+ return &commands;
+}
+
+void FormWindow::undo()
+{
+ commandHistory()->undo();
+}
+
+void FormWindow::redo()
+{
+ commandHistory()->redo();
+}
+
+void FormWindow::raiseChildSelections( TQWidget *w )
+{
+ TQObjectList *l = w->queryList( "TQWidget" );
+ if ( !l || !l->first() ) {
+ delete l;
+ return;
+ }
+
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it ) {
+ if ( l->tqfindRef( TQT_TQOBJECT(it.current()->widget()) ) != -1 )
+ it.current()->show();
+ }
+ delete l;
+}
+
+void FormWindow::updateChildSelections( TQWidget *w )
+{
+ TQObjectList *l = w->queryList( "TQWidget" );
+ if ( l ) {
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ insertedWidgets.tqfind( (TQWidget*)o ) )
+ updateSelection( (TQWidget*)o );
+ }
+ delete l;
+ }
+}
+
+void FormWindow::checkSelectionsForMove( TQWidget *w )
+{
+ checkedSelectionsForMove = TRUE;
+
+ TQObjectList *l = w->parentWidget()->queryList( "TQWidget", 0, FALSE, FALSE );
+ moving.clear();
+ if ( l ) {
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ WidgetSelection *sel;
+ while ( ( sel = it.current() ) != 0 ) {
+ if ( it.current()->widget() == mainContainer() )
+ continue;
+ ++it;
+ if ( l->tqfind( TQT_TQOBJECT(sel->widget()) ) == -1 ) {
+ if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
+ sel->setWidget( 0 );
+ } else {
+ if ( WidgetFactory::layoutType( sel->widget()->parentWidget() ) == WidgetFactory::NoLayout ) {
+ moving.insert( sel->widget(), sel->widget()->pos() );
+ sel->widget()->raise();
+ raiseChildSelections( sel->widget() );
+ raiseSelection( sel->widget() );
+ }
+ }
+ }
+ delete l;
+ }
+}
+
+void FormWindow::deleteWidgets()
+{
+ CHECK_MAINWINDOW;
+ TQWidgetList widgets;
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it ) {
+ TQWidget *tb = 0;
+ if ( !( tb = mainWindow()->isAToolBarChild( it.current()->widget() ) ) )
+ widgets.append( it.current()->widget() );
+ else
+ ( (TQDesignerToolBar*)tb )->removeWidget( it.current()->widget() );
+ }
+
+ if ( widgets.isEmpty() )
+ return;
+
+ DeleteCommand *cmd = new DeleteCommand( tr( "Delete" ), this, widgets );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::editAdjustSize()
+{
+ TQPtrList<Command> commands;
+ TQWidgetList widgets = selectedWidgets();
+ if ( widgets.isEmpty() ) {
+ TQRect oldr = tqgeometry();
+ mainContainer()->adjustSize();
+ resize( mainContainer()->size() );
+ // check whether our own size constraint hit us
+ if ( size() != mainContainer()->size() )
+ mainContainer()->resize( size() );
+ TQRect nr = tqgeometry();
+ if ( oldr != nr ) {
+ ResizeCommand *cmd = new ResizeCommand( tr( "Adjust Size" ), this, this, oldr, nr );
+ commandHistory()->addCommand( cmd );
+ }
+ return;
+ }
+ for ( TQWidget* w = widgets.first(); w; w = widgets.next() ) {
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ continue;
+ TQRect oldr = w->tqgeometry();
+ w->adjustSize();
+ TQRect nr = w->tqgeometry();
+ if ( oldr != nr )
+ commands.append( new ResizeCommand( tr("Adjust Size"), this, w, oldr, nr ) );
+ }
+
+ if ( commands.isEmpty() )
+ return;
+ for ( WidgetSelection *s = selections.first(); s; s = selections.next() )
+ s->updateGeometry();
+
+ MacroCommand *cmd = new MacroCommand( tr( "Adjust Size" ), this, commands );
+ commandHistory()->addCommand( cmd );
+}
+
+
+TQWidgetList FormWindow::selectedWidgets() const
+{
+ TQWidgetList widgets;
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ widgets.append( it.current()->widget() );
+ return widgets;
+}
+
+void FormWindow::widgetChanged( TQT_BASE_OBJECT_NAME *w )
+{
+ if ( w->isWidgetType() )
+ updateSelection( (TQWidget*)w );
+ // ########## do TQObject stuff
+}
+
+TQLabel *FormWindow::sizePreview() const
+{
+ if ( !sizePreviewLabel ) {
+ ( (FormWindow*)this )->sizePreviewLabel = new TQLabel( (FormWindow*)this );
+ ( (FormWindow*)this )->sizePreviewLabel->hide();
+ ( (FormWindow*)this )->sizePreviewLabel->setBackgroundColor( TQColor( 255, 255, 128 ) );
+ ( (FormWindow*)this )->sizePreviewLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box );
+ }
+ return sizePreviewLabel;
+}
+
+void FormWindow::invalidCheckedSelections()
+{
+ checkedSelectionsForMove = FALSE;
+}
+
+void FormWindow::checkPreviewGeometry( TQRect &r )
+{
+ if ( !TQT_TQRECT_OBJECT(rect()).tqcontains( r ) ) {
+ if ( r.left() < rect().left() )
+ r.moveTopLeft( TQPoint( 0, r.top() ) );
+ if ( r.right() > rect().right() )
+ r.moveBottomRight( TQPoint( rect().right(), r.bottom() ) );
+ if ( r.top() < rect().top() )
+ r.moveTopLeft( TQPoint( r.left(), rect().top() ) );
+ if ( r.bottom() > rect().bottom() )
+ r.moveBottomRight( TQPoint( r.right(), rect().bottom() ) );
+ }
+}
+
+void FormWindow::focusInEvent( TQFocusEvent * ){
+
+ if (ff)
+ ff->checkTimeStamp();
+}
+
+void FormWindow::focusOutEvent( TQFocusEvent * )
+{
+ if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) {
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(mainContainer());
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ }
+}
+
+void FormWindow::resizeEvent( TQResizeEvent *e )
+{
+ TQWidget::resizeEvent( e );
+ if ( currTool == ORDER_TOOL )
+ repositionOrderIndicators();
+ if ( isVisible() )
+ formFile()->setModified( TRUE, FormFile::WFormWindow );
+
+#if defined(TQ_WS_WIN32)
+ windowsRepaintWorkaroundTimer->start( 100, TRUE );
+#endif
+}
+
+void FormWindow::windowsRepaintWorkaroundTimerTimeout()
+{
+#if defined(TQ_WS_WIN32)
+ TQObjectList *l = queryList( "TQWidget" );
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ flickerfree_update( (TQWidget*)o );
+ }
+ flickerfree_update( this );
+ delete l;
+#endif
+}
+
+TQPtrDict<TQWidget> *FormWindow::widgets()
+{
+ return &insertedWidgets;
+}
+
+TQWidget *FormWindow::designerWidget( TQT_BASE_OBJECT_NAME *o ) const
+{
+ if ( !o || !o->isWidgetType() )
+ return 0;
+ TQWidget *w = (TQWidget*)o;
+ while ( (w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ]) || isCentralWidget( w ) )
+ w = (TQWidget*)w->tqparent();
+ return w;
+}
+
+void FormWindow::emitShowProperties( TQT_BASE_OBJECT_NAME *w )
+{
+ if ( w ) {
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(w);
+ if ( opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ }
+ showPropertiesTimer->stop();
+ showPropertiesTimer->start( 0, TRUE );
+}
+
+void FormWindow::emitUpdateProperties( TQT_BASE_OBJECT_NAME *w )
+{
+ if ( w == propertyWidget ) {
+ updatePropertiesTimer->stop();
+ updatePropertiesTimer->start( 0, TRUE );
+ }
+}
+
+void FormWindow::emitSelectionChanged()
+{
+ selectionChangedTimer->stop();
+ selectionChangedTimer->start( 0, TRUE );
+}
+
+void FormWindow::updatePropertiesTimerDone()
+{
+ CHECK_MAINWINDOW;
+ if ( propertyWidget && mainWindow()->formWindow() == this )
+ emit updateProperties( propertyWidget );
+}
+
+void FormWindow::showPropertiesTimerDone()
+{
+ CHECK_MAINWINDOW;
+ if ( propertyWidget && mainWindow()->formWindow() == this )
+ emit showProperties( propertyWidget );
+}
+
+void FormWindow::selectionChangedTimerDone()
+{
+ emit selectionChanged();
+}
+
+void FormWindow::currentToolChanged()
+{
+ CHECK_MAINWINDOW;
+ toolFixed = FALSE;
+ int t = mainwindow->currentTool();
+ if ( currTool == t && t != ORDER_TOOL )
+ return;
+
+ // tool cleanup
+ switch ( currTool ) {
+ case ORDER_TOOL:
+ hideOrderIndicators();
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ restoreConnectionLine();
+ if ( startWidget )
+ restoreRect( TQRect( mapToForm( ( (TQWidget*)startWidget )->parentWidget(),
+ ( (TQWidget*)startWidget )->pos() ),
+ ( (TQWidget*)startWidget )->size() ) );
+ if ( endWidget )
+ restoreRect( TQRect( mapToForm( ( (TQWidget*)endWidget )->parentWidget(),
+ ( (TQWidget*)endWidget )->pos() ),
+ ( (TQWidget*)endWidget )->size() ) );
+ endUnclippedPainter();
+ break;
+ case POINTER_TOOL:
+ break;
+ default:
+ if ( insertParent )
+ endRectDraw();
+ break;
+ }
+
+ startWidget = endWidget = 0;
+ widgetPressed = FALSE;
+ drawRubber = FALSE;
+ insertParent = 0;
+ delete buffer;
+ buffer = 0;
+
+ currTool = t;
+
+ if ( hasFocus() )
+ clearSelection( FALSE );
+
+ mainWindow()->statusBar()->clear();
+
+ // tool setup
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) )
+ emitShowProperties( mainContainer() );
+ restoreCursors( this, this );
+ break;
+ case ORDER_TOOL:
+ if ( mainWindow()->formWindow() == this ) {
+ mainWindow()->statusBar()->message( tr( "Click widgets to change the tab order...") );
+ orderedWidgets.clear();
+ showOrderIndicators();
+ if ( mainWindow()->formWindow() == this )
+ emitShowProperties( mainContainer() );
+ setCursorToAll( ArrowCursor, this );
+ }
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ if ( currTool == CONNECT_TOOL )
+ mainWindow()->statusBar()->message( tr( "Drag a line to create a connection...") );
+ else
+ mainWindow()->statusBar()->message( tr( "Drag a line to set a buddy...") );
+ setCursorToAll( CrossCursor, this );
+ if ( mainWindow()->formWindow() == this )
+ emitShowProperties( mainContainer() );
+ break;
+ default:
+ mainWindow()->statusBar()->message( tr( "Click on the form to insert a %1..." ).arg( WidgetDatabase::toolTip( currTool ).lower() ) );
+ setCursorToAll( CrossCursor, this );
+ if ( mainWindow()->formWindow() == this )
+ emitShowProperties( mainContainer() );
+ break;
+ }
+}
+
+void FormWindow::showOrderIndicators()
+{
+ hideOrderIndicators();
+ orderIndicators.setAutoDelete( TRUE );
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
+ stackedWidgets = MetaDataBase::tabOrder( this );
+ if ( l ) {
+ int order = 1;
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ TQWidget* w = (TQWidget*) o;
+ if ( w->isShown() &&
+ insertedWidgets[ (void*)w ] &&
+ w->focusPolicy() != Qt::NoFocus ) {
+ OrderIndicator* ind = new OrderIndicator( order++, w, this );
+ orderIndicators.append( ind );
+ if ( stackedWidgets.tqfindRef( w ) == -1 )
+ stackedWidgets.append( w );
+ }
+ }
+ delete l;
+ }
+ updateOrderIndicators();
+}
+
+void FormWindow::hideOrderIndicators()
+{
+ orderIndicators.clear();
+}
+
+void FormWindow::updateOrderIndicators()
+{
+ int order = 1;
+ for ( TQWidget *w = stackedWidgets.first(); w; w = stackedWidgets.next() ) {
+ for ( OrderIndicator* i = orderIndicators.first(); i; i = orderIndicators.next() )
+ i->setOrder( order, w );
+ order++;
+ }
+}
+
+void FormWindow::repositionOrderIndicators()
+{
+ for ( OrderIndicator* i = orderIndicators.first(); i; i = orderIndicators.next() )
+ i->reposition();
+}
+
+
+void FormWindow::updateUndoInfo()
+{
+ commandHistory()->emitUndoRedo();
+}
+
+bool FormWindow::checkCustomWidgets()
+{
+ TQStringList missingCustomWidgets;
+ TQPtrDictIterator<TQWidget> it( insertedWidgets );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isA( "CustomWidget" ) ) {
+ TQString className = WidgetFactory::classNameOf( it.current() );
+ if ( !MetaDataBase::hasCustomWidget( className ) )
+ missingCustomWidgets << className;
+ }
+ }
+
+ if ( !missingCustomWidgets.isEmpty() ) {
+ TQString txt = tr( "The following custom widgets are used in '%1',\n"
+ "but are not known to TQt Designer:\n" ).arg( name() );
+ for ( TQStringList::Iterator sit = missingCustomWidgets.begin(); sit != missingCustomWidgets.end(); ++sit )
+ txt += " " + *sit + "\n";
+ txt += "If you save this form and generate code for it using uic, \n"
+ "the generated code will not compile.\n"
+ "Do you want to save this form now?";
+ if ( TQMessageBox::information( mainWindow(), tr( "Save Form" ), txt ) == 1 )
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void FormWindow::setPropertyShowingBlocked( bool b )
+{
+ propShowBlocked = b;
+}
+
+bool FormWindow::isPropertyShowingBlocked() const
+{
+ return propShowBlocked;
+}
+
+int FormWindow::numSelectedWidgets() const
+{
+ return usedSelections.count();
+}
+
+TQString FormWindow::copy()
+{
+ CHECK_MAINWINDOW_VALUE( TQString() );
+ Resource resource( mainWindow() );
+ resource.setWidget( this );
+ return resource.copy();
+}
+
+void FormWindow::lowerWidgets()
+{
+ TQWidgetList widgets;
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ widgets.append( it.current()->widget() );
+
+ LowerCommand *cmd = new LowerCommand( tr( "Lower" ), this, widgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd );
+}
+
+void tqfind_accel( const TQString &txt, TQMap<TQChar, TQWidgetList > &accels, TQWidget *w )
+{
+ int i = txt.tqfind( "&" );
+ if ( i == -1 )
+ return;
+ TQChar c = txt[ i + 1 ];
+ if ( c.isNull() || c == '&' )
+ return;
+ c = c.lower();
+ TQMap<TQChar, TQWidgetList >::Iterator it = accels.tqfind( c );
+ if ( it == accels.end() ) {
+ TQWidgetList wl;
+ wl.append( w );
+ accels.insert( c, wl );
+ } else {
+ TQWidgetList *wl = &*it;
+ wl->append( w );
+ }
+}
+
+void FormWindow::checkAccels()
+{
+ CHECK_MAINWINDOW;
+ TQMap<TQChar, TQWidgetList > accels;
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
+ if ( l ) {
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets[ (void*)o ] ) {
+ TQWidget *w = (TQWidget*)o;
+ const TQMetaProperty* text =
+ w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "text", TRUE ), TRUE );
+ const TQMetaProperty* title =
+ w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "title", TRUE ), TRUE );
+ const TQMetaProperty* pageTitle =
+ w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "pageTitle", TRUE ), TRUE );
+ if ( text )
+ tqfind_accel( w->property( "text" ).toString(), accels, w );
+ if ( title )
+ tqfind_accel( w->property( "title" ).toString(), accels, w );
+ if ( pageTitle )
+ tqfind_accel( w->property( "pageTitle" ).toString(), accels, w );
+ } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) {
+ ((MenuBarEditor *)o)->checkAccels( accels );
+ }
+ }
+ delete l;
+ }
+
+ bool ok = TRUE;
+ TQWidget *wid;
+ for ( TQMap<TQChar, TQWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it ) {
+ if ( (*it).count() > 1 ) {
+ ok = FALSE;
+ switch ( TQMessageBox::information( mainWindow(), tr( "Check Accelerators" ),
+ tr( "Accelerator '%1' is used %2 times."
+ ).arg( it.key().upper() ).arg( (*it).count() ),
+ tr( "&Select" ),
+ tr( "&Cancel" ), TQString(), 2 ) ) {
+ case 0: // select
+ clearSelection( FALSE );
+ for ( wid = (*it).first(); wid; wid = (*it).next() )
+ selectWidget( wid, TRUE );
+ return;
+ case 1: // cancel
+ return;
+ }
+ }
+ }
+
+ if ( ok )
+ TQMessageBox::information( mainWindow(), tr( "Check Accelerators" ),
+ tr( "No accelerator is used more than once." ) );
+}
+
+void FormWindow::raiseWidgets()
+{
+ TQWidgetList widgets;
+ TQPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ widgets.append( it.current()->widget() );
+
+ RaiseCommand *cmd = new RaiseCommand( tr( "Raise" ), this, widgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd );
+}
+
+void FormWindow::paste( const TQString &cb, TQWidget *tqparent )
+{
+ CHECK_MAINWINDOW;
+ Resource resource( mainWindow() );
+ resource.setWidget( this );
+ resource.paste( cb, tqparent );
+}
+
+void FormWindow::selectAll()
+{
+ checkedSelectionsForMove = FALSE;
+ blockSignals( TRUE );
+ TQObjectList *l = mainContainer()->queryList( "TQWidget" );
+ if ( l ) {
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets[ (void*)o ] ) {
+ selectWidget( (TQWidget*)o );
+ }
+ }
+ delete l;
+ }
+
+ blockSignals( FALSE );
+ emitSelectionChanged();
+ if ( propertyWidget )
+ emitShowProperties( propertyWidget );
+ emitSelectionChanged();
+}
+
+void FormWindow::layoutHorizontal()
+{
+ TQWidgetList widgets( selectedWidgets() );
+ LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( tr( "Lay out horizontally" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutVertical()
+{
+ TQWidgetList widgets( selectedWidgets() );
+ LayoutVerticalCommand *cmd = new LayoutVerticalCommand( tr( "Lay out vertically" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutHorizontalSplit()
+{
+ TQWidgetList widgets( selectedWidgets() );
+ LayoutHorizontalSplitCommand *cmd = new LayoutHorizontalSplitCommand( tr( "Lay out horizontally (in splitter)" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutVerticalSplit()
+{
+ TQWidgetList widgets( selectedWidgets() );
+ LayoutVerticalSplitCommand *cmd = new LayoutVerticalSplitCommand( tr( "Lay out vertically (in splitter)" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutGrid()
+{
+ int xres = grid().x();
+ int yres = grid().y();
+
+ TQWidgetList widgets( selectedWidgets() );
+ LayoutGridCommand *cmd = new LayoutGridCommand( tr( "Lay out in a grid" ),
+ this, mainContainer(), 0, widgets, xres, yres );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutHorizontalContainer( TQWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ if ( WidgetFactory::containerOfWidget(w)->childrenListObject().isEmpty() )
+ return;
+ TQWidgetList widgets;
+ for ( TQObject *o = WidgetFactory::containerOfWidget(w)->childrenListObject().first(); o; o = WidgetFactory::containerOfWidget(w)->childrenListObject().next() ) {
+ if ( o->isWidgetType() &&
+ ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.tqfind( (TQWidget*)o ) )
+ widgets.append( (TQWidget*)o );
+ }
+ LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( tr( "Lay out tqchildren horizontally" ),
+ this, mainContainer(), w, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutVerticalContainer( TQWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ if ( WidgetFactory::containerOfWidget(w)->childrenListObject().isEmpty() )
+ return;
+ TQWidgetList widgets;
+ for ( TQObject *o = WidgetFactory::containerOfWidget(w)->childrenListObject().first(); o; o = WidgetFactory::containerOfWidget(w)->childrenListObject().next() ) {
+ if ( o->isWidgetType() &&
+ ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.tqfind( (TQWidget*)o ) )
+ widgets.append( (TQWidget*)o );
+ }
+ LayoutVerticalCommand *cmd = new LayoutVerticalCommand( tr( "Lay out tqchildren vertically" ),
+ this, mainContainer(), w, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutGridContainer( TQWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ int xres = grid().x();
+ int yres = grid().y();
+
+ if ( WidgetFactory::containerOfWidget(w)->childrenListObject().isEmpty() )
+ return;
+ TQWidgetList widgets;
+ for ( TQObject *o = WidgetFactory::containerOfWidget(w)->childrenListObject().first(); o; o = WidgetFactory::containerOfWidget(w)->childrenListObject().next() ) {
+ if ( o->isWidgetType() &&
+ ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.tqfind( (TQWidget*)o ) )
+ widgets.append( (TQWidget*)o );
+ }
+ LayoutGridCommand *cmd = new LayoutGridCommand( tr( "Lay out tqchildren in a grid" ),
+ this, mainContainer(), w, widgets, xres, yres );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::breakLayout( TQWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ w = WidgetFactory::containerOfWidget( w );
+ TQPtrList<Command> commands;
+
+ for (;;) {
+ if ( !w || w == this )
+ break;
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout &&
+ WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ Command *cmd = breakLayoutCommand( w );
+ if ( cmd )
+ commands.insert( 0, cmd );
+ if ( !::tqqt_cast<TQLayoutWidget*>(w) && !::tqqt_cast<TQSplitter*>(w) )
+ break;
+ }
+ w = w->parentWidget();
+ }
+
+ if ( commands.isEmpty() )
+ return;
+
+ clearSelection( FALSE );
+ MacroCommand *cmd = new MacroCommand( tr( "Break Layout" ), this, commands );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+BreakLayoutCommand *FormWindow::breakLayoutCommand( TQWidget *w )
+{
+ CHECK_MAINWINDOW_VALUE( 0 );
+ if ( w->childrenListObject().isEmpty() )
+ return 0;
+
+ TQWidgetList widgets;
+ for ( TQObject *o = w->childrenListObject().first(); o; o = w->childrenListObject().next() ) {
+ if ( o->isWidgetType() &&
+ !mainWindow()->isAToolBarChild( (TQWidget*)o ) &&
+ ( (TQWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.tqfind( (TQWidget*)o ) )
+ widgets.append( (TQWidget*)o );
+ }
+ return new BreakLayoutCommand( tr( "Break Layout" ), this, WidgetFactory::widgetOfContainer( w ), widgets );
+}
+
+int FormWindow::numVisibleWidgets() const
+{
+ TQPtrDictIterator<TQWidget> it( insertedWidgets );
+ int visible = 0;
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isVisibleTo( (FormWindow*)this ) )
+ visible++;
+ }
+ return visible;
+}
+
+bool FormWindow::hasInsertedChildren( TQWidget *w ) const
+{
+ if ( !w )
+ return FALSE;
+ w = WidgetFactory::containerOfWidget( w );
+ if ( !w )
+ return FALSE;
+ TQObjectList *l = w->queryList( "TQWidget" );
+ if ( !l || !l->first() ) {
+ delete l;
+ return FALSE;
+ }
+
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ ( (TQWidget*)o )->isVisibleTo( (FormWindow*)this ) &&
+ insertedWidgets.tqfind( (TQWidget*)o ) ) {
+ delete l;
+ return TRUE;
+ }
+ }
+
+ delete l;
+ return FALSE;
+}
+
+bool FormWindow::allowMove( TQWidget *w )
+{
+ w = w->parentWidget();
+ while ( w ) {
+ if ( ( isMainContainer( w ) || insertedWidgets.tqfind( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
+ return TRUE;
+ w = w->parentWidget();
+ }
+ return FALSE;
+}
+
+
+void FormWindow::editConnections()
+{
+ CHECK_MAINWINDOW;
+ buffer = 0;
+ if ( !startWidget || !endWidget )
+ return;
+
+ ConnectionDialog dlg( mainwindow );
+ mainWindow()->statusBar()->message( tr( "Edit connections...") );
+ dlg.addConnection( startWidget, endWidget, TQString(), TQString() );
+ TQTimer::singleShot( 0, &dlg, TQT_SLOT(ensureConnectionVisible()) );
+ dlg.exec();
+}
+
+void FormWindow::saveBackground()
+{
+ if ( buffer )
+ delete buffer;
+ buffer = new TQPixmap( width(), height() );
+ *buffer = TQPixmap::grabWindow( winId() );
+}
+
+void FormWindow::restoreConnectionLine()
+{
+ if (!unclippedPainter || !buffer) // designer will occasionally crash if buffer is not tested to be non-zero
+ return;
+
+ int a =TQABS( startPos.x() - currentPos.x() );
+ int b = TQABS( startPos.y() - currentPos.y() );
+ TQRect r( startPos, currentPos );
+
+ if ( a < 32 || b < 32 ) { // special case: vertical or horizontal line
+ r = r.normalize();
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer,
+ r.x() - 2, r.y() - 2, r.width() + 4, r.height() + 4 );
+ return;
+ }
+
+ if ( a <= 0 )
+ a = 1;
+ if ( b <= 0 )
+ b = 1;
+ int w, h;
+ if ( b > a ) {
+ h = 64;
+ w = ( a * h ) / b;
+ } else {
+ w = 64;
+ h = ( b * w ) / a;
+ }
+
+ int dx = 2 * w / 3;
+ int dy = 2 * h / 3;
+ TQPoint p( startPos );
+
+ if ( r.x() > r.right() ) {
+ dx = dx * -1;
+ p.setX( p.x() - 64 );
+ r.moveBy( -64, 0 );
+ }
+ if ( r.y() > r.bottom() ) {
+ dy = dy * -1;
+ p.setY( p.y() - 64 );
+ r.moveBy( 0, -64 );
+ }
+
+ w = h = 64;
+ r = r.normalize();
+ while ( r.tqcontains( p ) ) {
+ unclippedPainter->drawPixmap( p, *buffer, TQRect( p, TQSize( w, h ) ) );
+ unclippedPainter->setPen( Qt::red );
+ p.setX( p.x() + dx );
+ p.setY( p.y() + dy );
+ }
+
+ unclippedPainter->drawPixmap( startPos.x() - 10, startPos.y() - 10, *buffer,
+ startPos.x() - 10, startPos.y() - 10, 20, 20 );
+}
+
+void FormWindow::restoreRect( const TQRect &rect )
+{
+ if (!unclippedPainter || !buffer)
+ return;
+
+ TQRect r( rect );
+ r = r.normalize();
+
+ r = TQRect( r.x() + 2, r.y() + 2, r.width() - 4, r.height() - 4 );
+
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, r.width() + 4, 4 );
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, 4, r.height() + 4 );
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() + r.height() - 3, *buffer, r.x() - 2, r.y() + r.height() - 3, r.width() + 4, 5 );
+ unclippedPainter->drawPixmap( r.x() + r.width() - 2, r.y(), *buffer, r.x() + r.width() - 2, r.y(), 4, r.height() + 4 );
+}
+
+void FormWindow::drawConnectionLine()
+{
+ if ( !unclippedPainter )
+ return;
+
+ unclippedPainter->setPen( TQPen( Qt::white, 2 ) );
+ unclippedPainter->drawLine( startPos, currentPos );
+ if ( validForBuddy )
+ unclippedPainter->setPen( TQPen( Qt::darkRed, 1 ) );
+ else
+ unclippedPainter->setPen( TQPen( Qt::darkCyan, 1 ) );
+ unclippedPainter->drawLine( startPos, currentPos );
+
+ if ( validForBuddy )
+ unclippedPainter->setPen( TQPen( Qt::darkGreen, 1 ) );
+ else
+ unclippedPainter->setPen( TQPen( Qt::magenta, 1 ) );
+ if ( startWidget ) {
+ TQWidget *s = (TQWidget*)startWidget;
+ TQPoint p = mapToForm( s, TQPoint(0,0) );
+ unclippedPainter->drawRect( TQRect( p + TQPoint( 2, 2 ), s->size() - TQSize( 4, 4 ) ) );
+ }
+ if ( endWidget ) {
+ TQWidget *e = (TQWidget*)endWidget;
+ TQPoint p = mapToForm( e, TQPoint(0,0) );
+ unclippedPainter->drawRect( TQRect( p + TQPoint( 2, 2 ), e->size() - TQSize( 4, 4 ) ) );
+ }
+}
+
+TQString FormWindow::fileName() const
+{
+ return ff->absFileName();
+}
+
+void FormWindow::setFileName( const TQString &fn )
+{
+ ff->setFileName( fn );
+ emit fileNameChanged( ff->fileName(), this );
+}
+
+void FormWindow::modificationChanged( bool m )
+{
+ emit modificationChanged( m, this );
+ emit modificationChanged( m, ff->fileName() );
+}
+
+bool FormWindow::unify( TQT_BASE_OBJECT_NAME *w, TQString &s, bool changeIt )
+{
+ bool found = !isMainContainer( w ) && qstrcmp( name(), s.latin1() ) == 0;
+ if ( !found ) {
+ TQString orig = s;
+ int num = 1;
+ TQPtrDictIterator<TQWidget> it( insertedWidgets );
+ for ( ; it.current();) {
+ if ( it.current() != w &&
+ qstrcmp( it.current()->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + TQString::number( ++num );
+ it.toFirst();
+ } else {
+ ++it;
+ }
+ }
+ if ( !found ) {
+ TQPtrList<TQAction> al;
+ TQAction *a = 0;
+ for ( a = actions.first(); a; a = actions.next() ) {
+ TQObjectList *l = a->queryList( "TQAction" );
+ al.append( a );
+ for ( TQObject *ao = l->first(); ao; ao = l->next() )
+ al.append( (TQAction*)ao );
+ delete l;
+ }
+ for ( a = al.first(); a; a = al.next() ) {
+ if ( a != w &&
+ qstrcmp( a->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + TQString::number( ++num );
+ a = actions.first();
+ }
+ }
+ }
+ if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) && !found ) {
+ TQObjectList *l = mainContainer()->queryList( "PopupMenuEditor" );
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( o != w &&
+ qstrcmp ( o->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + TQString::number( ++num );
+ o = l->first();
+ }
+ }
+ delete l;
+ }
+ if ( ::tqqt_cast<TQMainWindow*>(mainContainer()) ) {
+ if ( !found ) {
+ TQObjectList *l = mainContainer()->queryList( "TQDockWindow", 0, TRUE );
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( o != w &&
+ qstrcmp( o->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + TQString::number( ++num );
+ o = l->first();
+ }
+ }
+ delete l;
+ }
+ }
+ }
+
+ if ( !found )
+ return TRUE;
+ return FALSE;
+}
+
+bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w )
+{
+ TQPtrDictIterator<TQWidget> it( insertedWidgets );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isA( "CustomWidget" ) ) {
+ if ( qstrcmp( WidgetFactory::classNameOf( it.current() ), w->className.utf8() ) == 0 )
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+bool FormWindow::isDatabaseWidgetUsed() const
+{
+#ifndef TQT_NO_SQL
+ TQStringList dbClasses;
+ dbClasses << "TQDataTable"; // add more here
+ TQPtrDictIterator<TQWidget> it( insertedWidgets );
+ for ( ; it.current(); ++it ) {
+ TQString c( it.current()->className() );
+ if ( dbClasses.tqcontains( c ) > 0 ) {
+ return TRUE;
+ }
+ }
+#endif
+ return FALSE;
+}
+
+bool FormWindow::isDatabaseAware() const
+{
+#ifndef TQT_NO_SQL
+ if ( TQString(mContainer->className()) == "TQDesignerDataBrowser" || TQString(mContainer->className()) == "TQDesignerDataView" )
+ return TRUE;
+ return isDatabaseWidgetUsed();
+#else
+ return FALSE;
+#endif
+}
+
+void FormWindow::visibilityChanged()
+{
+ if ( currTool != ORDER_TOOL ) {
+ emitUpdateProperties( currentWidget() );
+ } else {
+ updateOrderIndicators();
+ repositionOrderIndicators();
+ }
+}
+
+
+/*!
+ Maps \a pos in \a w's coordinates to the form's coordinate system.
+
+ This is the equivalent to mapFromGlobal(w->mapToGlobal(pos) ) but
+ avoids the two roundtrips to the X-Server on Unix/X11.
+ */
+TQPoint FormWindow::mapToForm( const TQWidget* w, const TQPoint& pos ) const
+{
+ TQPoint p = pos;
+ const TQWidget* i = w;
+ while ( i && !i->isTopLevel() && !isMainContainer( (TQWidget*)i ) ) {
+ p = i->mapToParent( p );
+ i = i->parentWidget();
+ }
+ return mapFromGlobal( w->mapToGlobal( pos ) );
+}
+
+static int widgetDepth( TQWidget *w )
+{
+ int d = -1;
+ while ( w && !w->isTopLevel() ) {
+ d++;
+ w = w->parentWidget();
+ }
+
+ return d;
+}
+
+static bool isChildOf( TQWidget *c, TQWidget *p )
+{
+ while ( c && !c->isTopLevel() ) {
+ if ( c == p )
+ return TRUE;
+ c = c->parentWidget();
+ }
+ return FALSE;
+}
+
+TQWidget *FormWindow::containerAt( const TQPoint &pos, TQWidget *notParentOf )
+{
+ TQPtrDictIterator<TQWidget> it( insertedWidgets );
+ TQWidget *container = 0;
+ int depth = -1;
+ TQWidgetList selected = selectedWidgets();
+ if ( TQT_TQRECT_OBJECT(rect()).tqcontains( mapFromGlobal( pos ) ) ) {
+ container = mainContainer();
+ depth = widgetDepth( container );
+ }
+
+ for ( ; it.current(); ++it ) {
+ if ( ::tqqt_cast<TQLayoutWidget*>(it.current())
+ || ::tqqt_cast<TQSplitter*>(it.current()) )
+ continue;
+ if ( !it.current()->isVisibleTo( this ) )
+ continue;
+ if ( selected.tqfind( it.current() ) != -1 )
+ continue;
+ if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( it.current() ) ) ) &&
+ it.current() != mainContainer() )
+ continue;
+
+ // the rectangles of all ancestors of the container must contain the insert position
+ TQWidget *w = it.current();
+ while ( w && !w->isTopLevel() ) {
+ if ( !TQT_TQRECT_OBJECT(w->rect()).tqcontains( ( w->mapFromGlobal( pos ) ) ) )
+ break;
+ w = w->parentWidget();
+ }
+ if ( !( w == 0 || w->isTopLevel() ) ) continue; // we did not get through the full while loop
+
+ int wd = widgetDepth( it.current() );
+ if ( wd == depth && container ) {
+ if ( ( it.current()->parentWidget()->childrenListObject() ).tqfind( TQT_TQOBJECT(it.current()) ) >
+ ( container->parentWidget()->childrenListObject() ).tqfind( TQT_TQOBJECT(container) ) )
+ wd++;
+ }
+ if ( wd > depth && !isChildOf( it.current(), notParentOf ) ) {
+ depth = wd;
+ container = it.current();
+ }
+ }
+
+ return container;
+}
+
+bool FormWindow::isMainContainer( TQT_BASE_OBJECT_NAME *w ) const
+{
+ return w && w->isWidgetType() && ( w == (TQWidget*)this || w == mainContainer() );
+}
+
+void FormWindow::setMainContainer( TQWidget *w )
+{
+ bool resetPropertyWidget = isMainContainer( propertyWidget );
+ if ( mContainer )
+ insertedWidgets.remove( mContainer );
+ if ( TQT_BASE_OBJECT(propertyWidget) == TQT_BASE_OBJECT(mContainer) )
+ propertyWidget = 0;
+ delete mContainer;
+ mContainer = w;
+ insertedWidgets.insert( mContainer, mContainer );
+ delete tqlayout();
+ TQHBoxLayout *l = new TQHBoxLayout( this );
+ l->addWidget( w );
+ if ( resetPropertyWidget ) {
+ TQObject *opw = propertyWidget;
+ propertyWidget = TQT_TQOBJECT(mContainer);
+ if ( opw && opw->isWidgetType() )
+ repaintSelection( (TQWidget*)opw );
+ }
+ if ( project() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( project()->language() );
+ if ( iface && !project()->isCpp() && !isFake() ) {
+ if ( !MetaDataBase::hasFunction( this, "init()" ) )
+ MetaDataBase::addFunction( this, "init()", "", "private", "function",
+ project()->language(), "void" );
+ if ( !MetaDataBase::hasFunction( this, "destroy()" ) )
+ MetaDataBase::addFunction( this, "destroy()", "", "private", "function",
+ project()->language(), "void" );
+ if ( !MetaDataBase::hasConnection( this, mainContainer(), "shown()", mainContainer(), "init" ) )
+ MetaDataBase::addConnection( this, mainContainer(), "shown()", mainContainer(), "init" );
+ if ( !MetaDataBase::hasConnection( this, mainContainer(), "destroyed()", mainContainer(), "destroy" ) )
+ MetaDataBase::addConnection( this, mainContainer(), "destroyed()",
+ mainContainer(), "destroy" );
+ }
+ }
+}
+
+bool FormWindow::savePixmapInline() const
+{
+ return pixInline;
+}
+
+bool FormWindow::savePixmapInProject() const
+{
+ return pixProject;
+}
+
+TQString FormWindow::pixmapLoaderFunction() const
+{
+ return pixLoader;
+}
+
+void FormWindow::setSavePixmapInline( bool b )
+{
+ pixInline = b;
+ if ( b )
+ pixProject = FALSE;
+}
+
+void FormWindow::setSavePixmapInProject( bool b )
+{
+ pixProject = b;
+ if ( b )
+ pixInline = FALSE;
+}
+
+void FormWindow::setPixmapLoaderFunction( const TQString &func )
+{
+ pixLoader = func;
+}
+
+void FormWindow::setActiveObject( TQT_BASE_OBJECT_NAME *o )
+{
+ emitShowProperties( o );
+ propertyWidget = TQT_TQOBJECT(o);
+}
+
+void FormWindow::setProject( Project *pro )
+{
+ proj = pro;
+}
+
+Project *FormWindow::project() const
+{
+ return proj;
+}
+
+TQAction *FormWindow::tqfindAction( const TQString &name )
+{
+ for ( TQAction *a = actionList().first(); a; a = actionList().next() ) {
+ if ( TQString( a->name() ) == name )
+ return a;
+ TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" );
+ if ( ac )
+ return ac;
+ }
+ return 0;
+}
+
+void FormWindow::killAccels( TQT_BASE_OBJECT_NAME *top )
+{
+ TQObjectList *l = TQT_TQOBJECT(top)->queryList( "TQAccel" );
+ if ( !l )
+ return;
+ for ( TQObject *o = l->first(); o; o = l->next() )
+ ( (TQAccel*)o )->setEnabled( FALSE );
+ delete l;
+}
+
+DesignerFormWindow *FormWindow::iFace()
+{
+ if ( !iface )
+ iface = new DesignerFormWindowImpl( this );
+ return iface;
+}
+
+bool FormWindow::isCentralWidget( TQT_BASE_OBJECT_NAME *w ) const
+{
+ if ( !::tqqt_cast<TQMainWindow*>(mainContainer()) )
+ return FALSE;
+ return w == ( (TQMainWindow*)mainContainer() )->centralWidget();
+}
+
+int FormWindow::layoutDefaultSpacing() const
+{
+ return defSpacing;
+}
+
+int FormWindow::layoutDefaultMargin() const
+{
+ return defMargin;
+}
+
+void FormWindow::setLayoutDefaultSpacing( int s )
+{
+ defSpacing = s;
+}
+
+void FormWindow::setLayoutDefaultMargin( int s )
+{
+ defMargin = s;
+}
+
+void FormWindow::setSpacingFunction( const TQString &funct )
+{
+ spacFunction = funct;
+}
+
+TQString FormWindow::spacingFunction() const
+{
+ return spacFunction;
+}
+
+void FormWindow::hasLayoutFunctions( bool b )
+{
+ hasLayoutFunc = b;
+}
+
+bool FormWindow::hasLayoutFunctions() const
+{
+ return hasLayoutFunc;
+}
+
+void FormWindow::setMarginFunction( const TQString &funct )
+{
+ margFunction = funct;
+}
+
+TQString FormWindow::marginFunction() const
+{
+ return margFunction;
+}
+
+FormFile *FormWindow::formFile() const
+{
+ return ff;
+}
+
+void FormWindow::setFormFile( FormFile *f )
+{
+ ff = f;
+ if ( ff )
+ connect( this, TQT_SIGNAL( modificationChanged(bool, const TQString&) ), ff, TQT_SLOT( formWindowChangedSomehow() ) );
+}
+
+bool FormWindow::canBeBuddy( const TQWidget *w ) const
+{
+ return w->focusPolicy() != Qt::NoFocus;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/formwindow.h b/tqtinterface/qt4/tools/designer/designer/formwindow.h
new file mode 100644
index 0000000..bacc45f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/formwindow.h
@@ -0,0 +1,329 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef FORMWINDOW_H
+#define FORMWINDOW_H
+
+#include "command.h"
+#include "metadatabase.h"
+#include "sizehandle.h"
+#include "actiondnd.h"
+
+#include <tqwidget.h>
+#include <tqptrdict.h>
+#include <tqpixmap.h>
+#include <tqwidgetlist.h>
+#include <tqmap.h>
+
+class TQPaintEvent;
+class TQMouseEvent;
+class TQKeyEvent;
+class TQPainter;
+class TQLabel;
+class MainWindow;
+class TQTimer;
+class TQFocusEvent;
+class TQCloseEvent;
+class Resource;
+class TQResizeEvent;
+class BreakLayoutCommand;
+class TQPixmap;
+class TQSizeGrip;
+class Project;
+struct DesignerFormWindow;
+class FormFile;
+
+#if defined(TQ_CC_MSVC) || defined(TQ_FULL_TEMPLATE_INSTANTIATION)
+#include "orderindicator.h"
+#else
+class OrderIndicator;
+#endif
+
+class FormWindow : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( TQString fileName READ fileName WRITE setFileName )
+
+public:
+ FormWindow( FormFile *f, MainWindow *mw, TQWidget *tqparent, const char *name = 0 );
+ FormWindow( FormFile *f, TQWidget *tqparent, const char *name = 0 );
+ ~FormWindow();
+
+ void init();
+ virtual void setMainWindow( MainWindow *w );
+
+ virtual TQString fileName() const;
+ virtual void setFileName( const TQString &fn );
+
+ virtual TQPoint grid() const;
+ virtual TQPoint gridPoint( const TQPoint &p );
+
+ virtual CommandHistory *commandHistory();
+
+ virtual void undo();
+ virtual void redo();
+ virtual TQString copy();
+ virtual void paste( const TQString &cb, TQWidget *tqparent );
+ virtual void lowerWidgets();
+ virtual void raiseWidgets();
+ virtual void checkAccels();
+
+ virtual void layoutHorizontal();
+ virtual void layoutVertical();
+ virtual void layoutHorizontalSplit();
+ virtual void layoutVerticalSplit();
+ virtual void layoutGrid();
+
+ virtual void layoutHorizontalContainer( TQWidget *w );
+ virtual void layoutVerticalContainer( TQWidget *w );
+ virtual void layoutGridContainer( TQWidget *w );
+
+ virtual void breakLayout( TQWidget *w );
+
+ virtual void selectWidget( TQT_BASE_OBJECT_NAME *w, bool select = TRUE );
+ virtual void selectAll();
+ virtual void updateSelection( QWidget *w );
+ virtual void raiseSelection( QWidget *w );
+ virtual void repaintSelection( TQWidget *w );
+ virtual void clearSelection( bool changePropertyDisplay = TRUE );
+ virtual void selectWidgets();
+ bool isWidgetSelected( TQT_BASE_OBJECT_NAME *w );
+ virtual void updateChildSelections( TQWidget *w );
+ virtual void raiseChildSelections( TQWidget *w );
+
+ virtual void emitUpdateProperties( TQT_BASE_OBJECT_NAME *w );
+ virtual void emitShowProperties( TQT_BASE_OBJECT_NAME *w = 0 );
+ virtual void emitSelectionChanged();
+
+ virtual void setPropertyShowingBlocked( bool b );
+ bool isPropertyShowingBlocked() const;
+
+ virtual TQLabel *sizePreview() const;
+ virtual void checkPreviewGeometry( TQRect &r );
+
+ virtual TQPtrDict<TQWidget> *widgets();
+ virtual TQWidgetList selectedWidgets() const;
+
+ virtual TQWidget *designerWidget( TQT_BASE_OBJECT_NAME *o ) const;
+
+ virtual void handleContextMenu( TQContextMenuEvent *e, TQWidget *w );
+ virtual void handleMousePress( TQMouseEvent *e, TQWidget *w );
+ virtual void handleMouseRelease( TQMouseEvent *e, TQWidget *w );
+ virtual void handleMouseDblClick( TQMouseEvent *e, TQWidget *w );
+ virtual void handleMouseMove( TQMouseEvent *e, TQWidget *w );
+ virtual void handleKeyPress( TQKeyEvent *e, TQWidget *w );
+ virtual void handleKeyRelease( TQKeyEvent *e, TQWidget *w );
+
+ virtual void updateUndoInfo();
+
+ virtual MainWindow *mainWindow() const { return mainwindow; }
+
+ bool checkCustomWidgets();
+ virtual void insertWidget( TQWidget *w, bool checkName = FALSE );
+ virtual void removeWidget( TQWidget *w );
+ virtual void deleteWidgets();
+ virtual void editAdjustSize();
+ virtual void editConnections();
+
+ virtual int numSelectedWidgets() const;
+ virtual int numVisibleWidgets() const;
+
+ virtual bool hasInsertedChildren( TQWidget *w ) const;
+
+ virtual TQWidget *currentWidget() const { return propertyWidget && propertyWidget->isWidgetType() ? (TQWidget*)propertyWidget : 0; } // #####
+ virtual bool unify( TQT_BASE_OBJECT_NAME *w, TQString &s, bool changeIt );
+
+ virtual bool isCustomWidgetUsed( MetaDataBase::CustomWidget *w );
+ virtual bool isDatabaseWidgetUsed() const;
+ virtual bool isDatabaseAware() const;
+
+ virtual TQPoint mapToForm( const TQWidget* w, const TQPoint& ) const;
+
+ bool isMainContainer( TQT_BASE_OBJECT_NAME *w ) const;
+ bool isCentralWidget( TQT_BASE_OBJECT_NAME *w ) const;
+ TQWidget *mainContainer() const { return mContainer; }
+ void setMainContainer( TQWidget *w );
+
+ void paintGrid( TQWidget *w, TQPaintEvent *e );
+
+ bool savePixmapInline() const;
+ TQString pixmapLoaderFunction() const;
+ void setSavePixmapInline( bool b );
+ void setPixmapLoaderFunction( const TQString &func );
+
+ bool savePixmapInProject() const;
+ void setSavePixmapInProject( bool b );
+
+ void setToolFixed() { toolFixed = TRUE; }
+
+ void setActiveObject( TQT_BASE_OBJECT_NAME *o );
+
+ TQPtrList<TQAction> &actionList() { return actions; }
+ TQAction *tqfindAction( const TQString &name );
+
+ void setProject( Project *pro );
+ Project *project() const;
+
+ void killAccels( TQT_BASE_OBJECT_NAME *top );
+
+ DesignerFormWindow *iFace();
+
+ int layoutDefaultSpacing() const;
+ int layoutDefaultMargin() const;
+ void setLayoutDefaultSpacing( int s );
+ void setLayoutDefaultMargin( int s );
+ TQString spacingFunction() const;
+ TQString marginFunction() const;
+ void setSpacingFunction( const TQString &func );
+ void setMarginFunction( const TQString &func );
+ bool hasLayoutFunctions() const;
+ void hasLayoutFunctions( bool b );
+
+ void initSlots();
+ FormFile *formFile() const;
+ void setFormFile( FormFile *f );
+
+ bool isFake() const { return fake; }
+ bool canBeBuddy( const TQWidget* ) const;
+
+public Q_SLOTS:
+ virtual void widgetChanged( TQT_BASE_OBJECT_NAME *w );
+ virtual void currentToolChanged();
+ virtual void visibilityChanged();
+ virtual void modificationChanged( bool m );
+
+Q_SIGNALS:
+ void showProperties( TQObject *w );
+ void updateProperties( TQObject *w );
+ void undoRedoChanged( bool undoAvailable, bool redoAvailable,
+ const TQString &undoCmd, const TQString &redoCmd );
+ void selectionChanged();
+ void modificationChanged( bool m, FormWindow *fw );
+ void modificationChanged( bool m, const TQString &s );
+ void fileNameChanged( const TQString &s, FormWindow *fw );
+
+protected:
+ virtual void closeEvent( TQCloseEvent *e );
+ virtual void focusInEvent( TQFocusEvent *e );
+ virtual void focusOutEvent( TQFocusEvent *e );
+ virtual void resizeEvent( TQResizeEvent *e );
+ void mouseDoubleClickEvent( TQMouseEvent *e ) { handleMouseDblClick( e, mainContainer() ); }
+
+private:
+ enum RectType { Insert, Rubber };
+
+ void beginUnclippedPainter( bool doNot );
+ void endUnclippedPainter();
+ void drawConnectionLine();
+ void drawSizePreview( const TQPoint &pos, const TQString& text );
+
+ void insertWidget();
+ void moveSelectedWidgets( int dx, int dy );
+
+ void startRectDraw( const TQPoint &p, const TQPoint &global, TQWidget *w, RectType t );
+ void continueRectDraw( const TQPoint &p, const TQPoint &global, TQWidget *w, RectType t );
+ void endRectDraw();
+
+ void checkSelectionsForMove( TQWidget *w );
+ BreakLayoutCommand *breakLayoutCommand( TQWidget *w );
+
+ bool allowMove( TQWidget *w );
+
+ void saveBackground();
+ void restoreConnectionLine();
+ void restoreRect( const TQRect &rect ) ;
+
+ void showOrderIndicators();
+ void updateOrderIndicators();
+ void repositionOrderIndicators();
+ void hideOrderIndicators();
+
+ TQWidget *containerAt( const TQPoint &pos, TQWidget *notParentOf );
+
+private Q_SLOTS:
+ void invalidCheckedSelections();
+ void updatePropertiesTimerDone();
+ void showPropertiesTimerDone();
+ void selectionChangedTimerDone();
+ void windowsRepaintWorkaroundTimerTimeout();
+
+private:
+ int currTool;
+ bool oldRectValid, widgetPressed, drawRubber, checkedSelectionsForMove;
+ bool validForBuddy;
+ TQRect currRect;
+ TQPoint rectAnchor;
+ TQPainter *unclippedPainter;
+ TQPoint sizePreviewPos;
+ TQPixmap sizePreviewPixmap;
+ MainWindow *mainwindow;
+ TQPtrList<WidgetSelection> selections;
+ TQPtrDict<WidgetSelection> usedSelections;
+ TQRect widgetGeom, rubber;
+ TQPoint oldPressPos, origPressPos;
+ CommandHistory commands;
+ TQMap<TQWidget*, TQPoint> moving;
+ TQWidget *insertParent;
+ TQObject *propertyWidget;
+ TQLabel *sizePreviewLabel;
+ TQTimer *checkSelectionsTimer;
+ TQPtrDict<TQWidget> insertedWidgets;
+ bool propShowBlocked;
+ TQTimer* updatePropertiesTimer, *showPropertiesTimer, *selectionChangedTimer,
+ *windowsRepaintWorkaroundTimer;
+ TQPoint startPos, currentPos;
+ TQWidget *startWidget, *endWidget;
+ TQPixmap *buffer;
+ TQPtrList<OrderIndicator> orderIndicators;
+ TQWidgetList orderedWidgets;
+ TQWidgetList stackedWidgets;
+ TQWidget *mContainer;
+ bool pixInline, pixProject;
+ TQString pixLoader;
+ bool toolFixed;
+ TQPtrList<TQAction> actions;
+ Project *proj;
+ DesignerFormWindow *iface;
+ TQWidget* targetContainer;
+ TQPalette restorePalette;
+ bool hadOwnPalette;
+ int defSpacing, defMargin;
+ TQString spacFunction, margFunction;
+ bool hasLayoutFunc;
+ FormFile *ff;
+ bool fake;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui b/tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui
new file mode 100644
index 0000000..329ca8f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui
@@ -0,0 +1,176 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>GotoLineDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<include location="local" impldecl="in implementation">../interfaces/editorinterface.h</include>
+<include location="local" implDecl="in declaration">gotolinedialog.ui.h</include>
+<forward>struct EditorInterface;</forward>
+<variable>EditorInterface *editor;</variable>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>GotoLineDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>243</width>
+ <height>85</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Goto Line</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Line:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinLine</cstring>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>spinLine</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Goto</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>GotoLineDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>GotoLineDialog</receiver>
+ <slot>gotoLine()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="public" language="C++" returnType="void">gotoLine()</slot>
+ <slot access="public" language="C++" returnType="void">setEditor( EditorInterface * e )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui.h b/tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui.h
new file mode 100644
index 0000000..d8be5e8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/gotolinedialog.ui.h
@@ -0,0 +1,57 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+void GotoLineDialog::init()
+{
+ editor = 0;
+}
+
+void GotoLineDialog::destroy()
+{
+ if ( editor )
+ editor->release();
+}
+
+void GotoLineDialog::gotoLine()
+{
+ if ( editor )
+ editor->gotoLine( spinLine->value() - 1 );
+ accept();
+}
+
+void GotoLineDialog::setEditor( EditorInterface *e )
+{
+ editor = e;
+ editor->addRef();
+}
+
diff --git a/tqtinterface/qt4/tools/designer/designer/hierarchyview.cpp b/tqtinterface/qt4/tools/designer/designer/hierarchyview.cpp
new file mode 100644
index 0000000..d583bdc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/hierarchyview.cpp
@@ -0,0 +1,1498 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "hierarchyview.h"
+#include "formwindow.h"
+#include "globaldefs.h"
+#include "mainwindow.h"
+#include "command.h"
+#include "widgetfactory.h"
+#include "widgetdatabase.h"
+#include "project.h"
+#include "sourceeditor.h"
+#include "propertyeditor.h"
+#include "editfunctionsimpl.h"
+#include "listeditor.h"
+#include "actiondnd.h"
+#include "actioneditorimpl.h"
+#include "variabledialogimpl.h"
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+#include <tqpalette.h>
+#include <tqobjectlist.h>
+#include <tqheader.h>
+#include <tqpopupmenu.h>
+#include <tqtabwidget.h>
+#include <tqwizard.h>
+#include <tqwidgetstack.h>
+#include <tqtabbar.h>
+#include <tqfeatures.h>
+#include <tqapplication.h>
+#include <tqtimer.h>
+#include "../interfaces/languageinterface.h"
+#include <tqworkspace.h>
+#include <tqaccel.h>
+#include <tqmessagebox.h>
+
+#include <stdlib.h>
+
+TQListViewItem *newItem = 0;
+
+static TQPluginManager<ClassBrowserInterface> *classBrowserInterfaceManager = 0;
+
+HierarchyItem::HierarchyItem( Type type, TQListViewItem *tqparent, TQListViewItem *after,
+ const TQString &txt1, const TQString &txt2, const TQString &txt3 )
+ : TQListViewItem( tqparent, after, txt1, txt2, txt3 ), typ( type )
+{
+}
+
+HierarchyItem::HierarchyItem( Type type, TQListView *tqparent, TQListViewItem *after,
+ const TQString &txt1, const TQString &txt2, const TQString &txt3 )
+ : TQListViewItem( tqparent, after, txt1, txt2, txt3 ), typ( type )
+{
+}
+
+void HierarchyItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align )
+{
+ TQColorGroup g( cg );
+ g.setColor( TQColorGroup::Base, backgroundColor() );
+ g.setColor( TQColorGroup::Foreground, TQt::black );
+ g.setColor( TQColorGroup::Text, TQt::black );
+ TQString txt = text( 0 );
+ if ( rtti() == Function &&
+ MainWindow::self->currProject()->isCpp() &&
+ ( txt == "init()" || txt == "destroy()" ) ) {
+ listView()->setUpdatesEnabled( FALSE );
+ if ( txt == "init()" )
+ setText( 0, txt + " " + "(Constructor)" );
+ else
+ setText( 0, txt + " " + "(Destructor)" );
+ TQListViewItem::paintCell( p, g, column, width, align );
+ setText( 0, txt );
+ listView()->setUpdatesEnabled( TRUE );
+ } else {
+ TQListViewItem::paintCell( p, g, column, width, align );
+ }
+ p->save();
+ p->setPen( TQPen( cg.dark(), 1 ) );
+ if ( column == 0 )
+ p->drawLine( 0, 0, 0, height() - 1 );
+ if ( listView()->firstChild() != this ) {
+ if ( nextSibling() != itemBelow() && itemBelow()->depth() < depth() ) {
+ int d = depth() - itemBelow()->depth();
+ p->drawLine( -listView()->treeStepSize() * d, height() - 1, 0, height() - 1 );
+ }
+ }
+ p->drawLine( 0, height() - 1, width, height() - 1 );
+ p->drawLine( width - 1, 0, width - 1, height() );
+ p->restore();
+}
+
+TQColor HierarchyItem::backgroundColor()
+{
+ updateBackColor();
+ return backColor;
+}
+
+void HierarchyItem::updateBackColor()
+{
+ if ( listView()->firstChild() == this ) {
+ backColor = *backColor1;
+ return;
+ }
+
+ TQListViewItemIterator it( this );
+ --it;
+ if ( it.current() ) {
+ if ( ( ( HierarchyItem*)it.current() )->backColor == *backColor1 )
+ backColor = *backColor2;
+ else
+ backColor = *backColor1;
+ } else {
+ backColor = *backColor1;
+ }
+}
+
+void HierarchyItem::setObject( TQT_BASE_OBJECT_NAME *o )
+{
+ obj = TQT_TQOBJECT(o);
+}
+
+TQObject *HierarchyItem::object() const
+{
+ return obj;
+}
+
+void HierarchyItem::okRename( int col )
+{
+ if ( newItem == this )
+ newItem = 0;
+ TQListViewItem::okRename( col );
+}
+
+void HierarchyItem::cancelRename( int col )
+{
+ if ( newItem == this ) {
+ newItem = 0;
+ TQListViewItem::cancelRename( col );
+ delete this;
+ return;
+ }
+ TQListViewItem::cancelRename( col );
+}
+
+
+
+
+HierarchyList::HierarchyList( TQWidget *tqparent, FormWindow *fw, bool doConnects )
+ : TQListView( tqparent ), formWindow( fw )
+{
+ init_colors();
+
+ setDefaultRenameAction( Accept );
+ header()->setMovingEnabled( FALSE );
+ header()->setStretchEnabled( TRUE );
+ normalMenu = 0;
+ tabWidgetMenu = 0;
+ addColumn( tqtr( "Name" ) );
+ addColumn( tqtr( "Class" ) );
+ TQPalette p( palette() );
+ p.setColor( TQColorGroup::Base, TQColor( *backColor2 ) );
+ (void)*selectedBack; // hack
+ setPalette( p );
+ disconnect( header(), TQT_SIGNAL( sectionClicked( int ) ),
+ this, TQT_SLOT( changeSortColumn( int ) ) );
+ setSorting( -1 );
+ setHScrollBarMode( AlwaysOff );
+ setVScrollBarMode( AlwaysOn );
+ if ( doConnects ) {
+ connect( this, TQT_SIGNAL( clicked( TQListViewItem * ) ),
+ this, TQT_SLOT( objectClicked( TQListViewItem * ) ) );
+ connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ),
+ this, TQT_SLOT( objectDoubleClicked( TQListViewItem * ) ) );
+ connect( this, TQT_SIGNAL( returnPressed( TQListViewItem * ) ),
+ this, TQT_SLOT( objectClicked( TQListViewItem * ) ) );
+ connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint&, int ) ),
+ this, TQT_SLOT( showRMBMenu( TQListViewItem *, const TQPoint & ) ) );
+ }
+ deselect = TRUE;
+ setColumnWidthMode( 1, Manual );
+}
+
+void HierarchyList::keyPressEvent( TQKeyEvent *e )
+{
+ if ( e->key() == Qt::Key_Shift || e->key() == Qt::Key_Control )
+ deselect = FALSE;
+ else
+ deselect = TRUE;
+ TQListView::keyPressEvent( e );
+}
+
+void HierarchyList::keyReleaseEvent( TQKeyEvent *e )
+{
+ deselect = TRUE;
+ TQListView::keyReleaseEvent( e );
+}
+
+void HierarchyList::viewportMousePressEvent( TQMouseEvent *e )
+{
+ if ( e->state() & ShiftButton || e->state() & ControlButton )
+ deselect = FALSE;
+ else
+ deselect = TRUE;
+ TQListView::viewportMousePressEvent( e );
+}
+
+void HierarchyList::viewportMouseReleaseEvent( TQMouseEvent *e )
+{
+ TQListView::viewportMouseReleaseEvent( e );
+}
+
+TQObject *HierarchyList::handleObjectClick( TQListViewItem *i )
+{
+ if ( !i )
+ return 0;
+
+ TQObject *o = tqfindObject( i );
+ if ( !o )
+ return 0;
+ if ( TQT_BASE_OBJECT(formWindow) == TQT_BASE_OBJECT(o) ) {
+ if ( deselect )
+ formWindow->clearSelection( FALSE );
+ formWindow->emitShowProperties( formWindow );
+ return 0;
+ }
+ if ( o->isWidgetType() ) {
+ TQWidget *w = (TQWidget*)o;
+ if ( !formWindow->widgets()->tqfind( w ) ) {
+ if ( ::tqqt_cast<TQWidgetStack*>(w->tqparent()) ) {
+ if (::tqqt_cast<TQTabWidget*>(w->tqparent()->tqparent()) ) {
+ ((TQTabWidget*)w->tqparent()->tqparent())->showPage( w );
+ o = TQT_TQOBJECT((TQWidget*)w->tqparent()->tqparent());
+ formWindow->emitUpdateProperties( formWindow->currentWidget() );
+ } else if ( ::tqqt_cast<TQWizard*>(w->tqparent()->tqparent()) ) {
+ ((TQDesignerWizard*)w->tqparent()->tqparent())->
+ setCurrentPage( ( (TQDesignerWizard*)w->tqparent()->tqparent() )->pageNum( w ) );
+ o = TQT_TQOBJECT((TQWidget*)w->tqparent()->tqparent());
+ formWindow->emitUpdateProperties( formWindow->currentWidget() );
+ } else {
+ ( (TQWidgetStack*)w->tqparent() )->raiseWidget( w );
+ if ( (TQWidgetStack*)w->tqparent()->isA( "TQDesignerWidgetStack" ) )
+ ( (TQDesignerWidgetStack*)w->tqparent() )->updateButtons();
+ }
+ } else if ( ::tqqt_cast<TQMenuBar*>(w) || ::tqqt_cast<TQDockWindow*>(w) ) {
+ formWindow->setActiveObject( w );
+ } else if ( ::tqqt_cast<TQPopupMenu*>(w) ) {
+ return 0; // ### we could try to tqfind our menu bar and change the currentMenu to our index
+ } else {
+ return 0;
+ }
+ }
+ } else if ( ::tqqt_cast<TQAction*>(o) ) {
+ MainWindow::self->actioneditor()->setCurrentAction( (TQAction*)o );
+ deselect = TRUE;
+ }
+
+ if ( deselect )
+ formWindow->clearSelection( FALSE );
+
+ return o;
+}
+
+
+void HierarchyList::objectDoubleClicked( TQListViewItem *i )
+{
+ TQObject *o = handleObjectClick( i );
+ if ( !o )
+ return;
+ if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( formWindow ) ) {
+ TQWidget *w = (TQWidget*)o;
+ if ( !w->parentWidget() ||
+ WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout )
+ w->raise();
+ formWindow->selectWidget( w, TRUE );
+ }
+}
+
+void HierarchyList::objectClicked( TQListViewItem *i )
+{
+ TQObject *o = handleObjectClick( i );
+ if ( !o )
+ return;
+ if ( o->isWidgetType() && ( (TQWidget*)o )->isVisibleTo( formWindow ) ) {
+ TQWidget *w = (TQWidget*)o;
+ formWindow->selectWidget( w, TRUE );
+ }
+}
+
+TQObject *HierarchyList::tqfindObject( TQListViewItem *i )
+{
+ return ( (HierarchyItem*)i )->object();
+}
+
+TQListViewItem *HierarchyList::tqfindItem( TQT_BASE_OBJECT_NAME *o )
+{
+ TQListViewItemIterator it( this );
+ while ( it.current() ) {
+ if ( ( (HierarchyItem*)it.current() )->object() == o )
+ return it.current();
+ ++it;
+ }
+ return 0;
+}
+
+TQObject *HierarchyList::current() const
+{
+ if ( currentItem() )
+ return ( (HierarchyItem*)currentItem() )->object();
+ return 0;
+}
+
+void HierarchyList::changeNameOf( TQT_BASE_OBJECT_NAME *o, const TQString &name )
+{
+ TQListViewItem *item = tqfindItem( o );
+ if ( !item )
+ return;
+ item->setText( 0, name );
+}
+
+
+void HierarchyList::changeDatabaseOf( TQT_BASE_OBJECT_NAME *o, const TQString &info )
+{
+#ifndef TQT_NO_SQL
+ if ( !formWindow->isDatabaseAware() )
+ return;
+ TQListViewItem *item = tqfindItem( o );
+ if ( !item )
+ return;
+ item->setText( 2, info );
+#endif
+}
+
+static TQPtrList<TQWidgetStack> *widgetStacks = 0;
+
+void HierarchyList::setup()
+{
+ if ( !formWindow || formWindow->isFake() )
+ return;
+ clear();
+ TQWidget *w = formWindow->mainContainer();
+#ifndef TQT_NO_SQL
+ if ( formWindow->isDatabaseAware() ) {
+ if ( columns() == 2 ) {
+ addColumn( tqtr( "Database" ) );
+ header()->resizeSection( 0, 1 );
+ header()->resizeSection( 1, 1 );
+ header()->resizeSection( 2, 1 );
+ header()->adjustHeaderSize();
+ }
+ } else {
+ if ( columns() == 3 ) {
+ removeColumn( 2 );
+ }
+ }
+#endif
+ if ( !widgetStacks )
+ widgetStacks = new TQPtrList<TQWidgetStack>;
+ if ( w )
+ insertObject( w, 0 );
+ widgetStacks->clear();
+}
+
+void HierarchyList::setOpen( TQListViewItem *i, bool b )
+{
+ TQListView::setOpen( i, b );
+}
+
+void HierarchyList::insertObject( TQT_BASE_OBJECT_NAME *tqbo, TQListViewItem *tqparent )
+{
+ TQObject* o = TQT_TQOBJECT(tqbo);
+ if ( TQString( o->name() ).startsWith( "qt_dead_widget_" ) )
+ return;
+ bool fakeMainWindow = FALSE;
+ if ( ::tqqt_cast<TQMainWindow*>(o) ) {
+ TQObject *cw = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
+ if ( cw ) {
+ o = cw;
+ fakeMainWindow = TRUE;
+ }
+ }
+ TQListViewItem *item = 0;
+ TQString className = WidgetFactory::classNameOf( o );
+ if ( ::tqqt_cast<TQLayoutWidget*>(o) ) {
+ switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) {
+ case WidgetFactory::HBox:
+ className = "HBox";
+ break;
+ case WidgetFactory::VBox:
+ className = "VBox";
+ break;
+ case WidgetFactory::Grid:
+ className = "Grid";
+ break;
+ default:
+ break;
+ }
+ }
+
+ TQString dbInfo;
+#ifndef TQT_NO_SQL
+ dbInfo = MetaDataBase::fakeProperty( o, "database" ).toStringList().join(".");
+#endif
+
+ TQString name = o->name();
+ if ( ::tqqt_cast<TQWidgetStack*>(o->tqparent()) ) {
+ if ( ::tqqt_cast<TQTabWidget*>(o->tqparent()->tqparent()) )
+ name = ( (TQTabWidget*)o->tqparent()->tqparent() )->tabLabel( (TQWidget*)o );
+ else if ( ::tqqt_cast<TQWizard*>(o->tqparent()->tqparent()) )
+ name = ( (TQWizard*)o->tqparent()->tqparent() )->title( (TQWidget*)o );
+ }
+
+ TQToolBox *tb;
+ if ( o->tqparent() && o->tqparent()->tqparent() &&
+ (tb = ::tqqt_cast<TQToolBox*>(o->tqparent()->tqparent()->tqparent())) )
+ name = tb->itemLabel( tb->indexOf((TQWidget*)o) );
+
+ if ( fakeMainWindow ) {
+ name = o->tqparent()->name();
+ className = "TQMainWindow";
+ }
+
+ if ( !tqparent )
+ item = new HierarchyItem( HierarchyItem::Widget, this, 0, name, className, dbInfo );
+ else
+ item = new HierarchyItem( HierarchyItem::Widget, tqparent, 0, name, className, dbInfo );
+ item->setOpen( TRUE );
+ if ( !tqparent )
+ item->setPixmap( 0, TQPixmap::fromMimeSource( "designer_form.png" ) );
+ else if ( ::tqqt_cast<TQLayoutWidget*>(o) )
+ item->setPixmap( 0, TQPixmap::fromMimeSource( "designer_layout.png" ));
+ else
+ item->setPixmap( 0, WidgetDatabase::iconSet(
+ WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( o ) ) ).
+ pixmap( TQIconSet::Small, TQIconSet::Normal ) );
+ if ( ::tqqt_cast<TQAction*>(o) )
+ item->setPixmap( 0, ( (TQAction*)o )->iconSet().pixmap() );
+
+ ( (HierarchyItem*)item )->setObject( o );
+
+ if (( !o->childrenListObject().isEmpty() ) && (!( ::tqqt_cast<TQDesignerToolBar*>(o) ))) {
+ TQObjectListIt it( o->childrenListObject() );
+ it.toLast();
+ for ( ; it.current(); --it ) {
+ if ( !it.current()->isWidgetType() ||
+ ( (TQWidget*)it.current() )->isHidden() )
+ continue;
+ if ( !formWindow->widgets()->tqfind( (TQWidget*)it.current() ) ) {
+ if ( ::tqqt_cast<TQWidgetStack*>(it.current()->tqparent()) ||
+ ::tqqt_cast<TQWidgetStack*>(it.current()) ) {
+ TQObject *obj = it.current();
+ TQDesignerTabWidget *tw = ::tqqt_cast<TQDesignerTabWidget*>(it.current()->tqparent());
+ TQDesignerWizard *dw = ::tqqt_cast<TQDesignerWizard*>(it.current()->tqparent());
+ TQWidgetStack *stack = 0;
+ if ( dw || tw || ::tqqt_cast<TQWidgetStack*>(obj) )
+ stack = (TQWidgetStack*)obj;
+ else
+ stack = (TQWidgetStack*)obj->tqparent();
+ if ( widgetStacks->tqfindRef( stack ) != -1 )
+ continue;
+ widgetStacks->append( stack );
+ TQObjectList *l2 = stack->queryList( "TQWidget", 0, TRUE, FALSE );
+ for ( obj = l2->last(); obj; obj = l2->prev() ) {
+ if ( qstrcmp( obj->className(),
+ "TQWidgetStackPrivate::Invisible" ) == 0 ||
+ ( tw && !tw->tabBar()->tab( stack->id( (TQWidget*)obj ) ) ) ||
+ ( dw && dw->isPageRemoved( (TQWidget*)obj ) ) )
+ continue;
+ if ( qstrcmp( obj->name(), "designer_wizardstack_button" ) == 0 )
+ continue;
+ if ( stack->id( (TQWidget*)obj ) == -1 )
+ continue;
+ insertObject( obj, item );
+ }
+ delete l2;
+ } else if ( ::tqqt_cast<TQToolBox*>(it.current()->tqparent()) ) {
+ if ( !::tqqt_cast<TQScrollView*>(it.current()) )
+ continue;
+ TQToolBox *tb = (TQToolBox*)it.current()->tqparent();
+ for ( int i = tb->count() - 1; i >= 0; --i )
+ insertObject( tb->item( i ), item );
+ }
+ continue;
+ }
+ insertObject( it.current(), item );
+ }
+ }
+
+ if ( fakeMainWindow ) {
+ TQObjectList *l = o->tqparent()->queryList( "TQDesignerToolBar" );
+ TQObject *obj;
+ for ( obj = l->first(); obj; obj = l->next() )
+ insertObject( obj, item );
+ delete l;
+ l = o->tqparent()->queryList( "MenuBarEditor" );
+ for ( obj = l->first(); obj; obj = l->next() )
+ insertObject( obj, item );
+ delete l;
+ } else if ( ::tqqt_cast<TQDesignerToolBar*>(o) || ::tqqt_cast<PopupMenuEditor*>(o) ) {
+ TQPtrList<TQAction> actions;
+ if ( ::tqqt_cast<TQDesignerToolBar*>(o) )
+ actions = ( (TQDesignerToolBar*)o )->insertedActions();
+ else
+ ( (PopupMenuEditor*)o )->insertedActions( actions );
+
+ TQPtrListIterator<TQAction> it( actions );
+ it.toLast();
+ while ( it.current() ) {
+ TQAction *a = it.current();
+ if ( ::tqqt_cast<TQDesignerAction*>(a) ) {
+ TQDesignerAction *da = (TQDesignerAction*)a;
+ if ( da->supportsMenu() )
+ insertObject( da, item );
+ else
+ insertObject( da->widget(), item );
+ } else if ( ::tqqt_cast<TQDesignerActionGroup*>(a) ) {
+ insertObject( a, item );
+ }
+ --it;
+ }
+ } else if ( ::tqqt_cast<TQDesignerActionGroup*>(o) && !o->childrenListObject().isEmpty() ) {
+ for ( TQT_BASE_OBJECT_NAME *obj = o->childrenListObject().last(); obj; obj = o->childrenListObject().prev() ) {
+ if ( ::tqqt_cast<TQDesignerAction*>(obj) ) {
+ TQDesignerAction *da = (TQDesignerAction*)obj;
+ if ( da->supportsMenu() )
+ insertObject( da, item );
+ else
+ insertObject( da->widget(), item );
+ } else if ( ::tqqt_cast<TQDesignerActionGroup*>(obj) ) {
+ insertObject( obj, item );
+ }
+ }
+ } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) {
+ MenuBarEditor *mb = (MenuBarEditor*)o;
+ for ( int i = mb->count() -1; i >= 0; --i ) {
+ MenuBarEditorItem *md = mb->item( i );
+ if ( !md || !md->menu() )
+ continue;
+ insertObject( md->menu(), item );
+ }
+ }
+}
+
+void HierarchyList::setCurrent( TQT_BASE_OBJECT_NAME *o )
+{
+ TQListViewItemIterator it( this );
+ while ( it.current() ) {
+ if ( ( (HierarchyItem*)it.current() )->object() == o ) {
+ blockSignals( TRUE );
+ setCurrentItem( it.current() );
+ ensureItemVisible( it.current() );
+ blockSignals( FALSE );
+ return;
+ }
+ ++it;
+ }
+}
+
+void HierarchyList::showRMBMenu( TQListViewItem *i, const TQPoint & p )
+{
+ if ( !i )
+ return;
+
+ TQObject *o = tqfindObject( i );
+ if ( !o )
+ return;
+
+ if ( !o->isWidgetType() ||
+ ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(formWindow) && !formWindow->widgets()->tqfind( (TQWidget*)o ) ) )
+ return;
+
+ TQWidget *w = (TQWidget*)o;
+ if ( w->isVisibleTo( formWindow ) ) {
+ if ( !::tqqt_cast<TQTabWidget*>(w) && !::tqqt_cast<TQWizard*>(w) ) {
+ if ( !normalMenu )
+ normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this );
+ normalMenu->popup( p );
+ } else {
+ if ( !tabWidgetMenu )
+ tabWidgetMenu =
+ formWindow->mainWindow()->setupTabWidgetHierarchyMenu(
+ this, TQT_SLOT( addTabPage() ),
+ TQT_SLOT( removeTabPage() ) );
+ tabWidgetMenu->popup( p );
+ }
+ }
+}
+
+void HierarchyList::addTabPage()
+{
+ TQObject *o = current();
+ if ( !o || !o->isWidgetType() )
+ return;
+ TQWidget *w = (TQWidget*)o;
+ if ( ::tqqt_cast<TQTabWidget*>(w) ) {
+ TQTabWidget *tw = (TQTabWidget*)w;
+ AddTabPageCommand *cmd = new AddTabPageCommand( tqtr( "Add Page to %1" ).
+ arg( tw->name() ), formWindow,
+ tw, "Tab" );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( ::tqqt_cast<TQWizard*>(w) ) {
+ TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
+ AddWizardPageCommand *cmd = new AddWizardPageCommand( tqtr( "Add Page to %1" ).
+ arg( wiz->name() ), formWindow,
+ wiz, "Page" );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void HierarchyList::removeTabPage()
+{
+ TQObject *o = current();
+ if ( !o || !o->isWidgetType() )
+ return;
+ TQWidget *w = (TQWidget*)o;
+ if ( ::tqqt_cast<TQTabWidget*>(w) ) {
+ TQTabWidget *tw = (TQTabWidget*)w;
+ if ( tw->currentPage() ) {
+ TQDesignerTabWidget *dtw = (TQDesignerTabWidget*)tw;
+ DeleteTabPageCommand *cmd =
+ new DeleteTabPageCommand( tqtr( "Delete Page %1 of %2" ).
+ arg( dtw->pageTitle() ).arg( tw->name() ),
+ formWindow, tw, tw->currentPage() );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( ::tqqt_cast<TQWizard*>(w) ) {
+ TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
+ if ( wiz->currentPage() ) {
+ TQDesignerWizard *dw = (TQDesignerWizard*)wiz;
+ DeleteWizardPageCommand *cmd =
+ new DeleteWizardPageCommand( tqtr( "Delete Page %1 of %2" ).
+ arg( dw->pageTitle() ).arg( wiz->name() ),
+ formWindow, wiz,
+ wiz->indexOf( wiz->currentPage() ), TRUE );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+}
+
+// ------------------------------------------------------------
+
+FormDefinitionView::FormDefinitionView( TQWidget *tqparent, FormWindow *fw )
+ : HierarchyList( tqparent, fw, TRUE )
+{
+ header()->hide();
+ removeColumn( 1 );
+ connect( this, TQT_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ),
+ this, TQT_SLOT( renamed( TQListViewItem * ) ) );
+ popupOpen = FALSE;
+}
+
+void FormDefinitionView::setup()
+{
+ if ( popupOpen || !formWindow )
+ return;
+ if ( !formWindow->project()->isCpp() )
+ return;
+ TQListViewItem *i = firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::DefinitionParent ) {
+ TQListViewItem *a = i;
+ i = i->nextSibling();
+ delete a;
+ continue;
+ }
+ i = i->nextSibling();
+ }
+
+ LanguageInterface *lIface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( lIface ) {
+ TQStringList defs = lIface->definitions();
+ for ( TQStringList::Iterator dit = defs.begin(); dit != defs.end(); ++dit ) {
+ HierarchyItem *itemDef = new HierarchyItem( HierarchyItem::DefinitionParent, this, 0,
+ tqtr( *dit ), TQString(), TQString() );
+ itemDef->setPixmap( 0, TQPixmap::fromMimeSource( "designer_folder.png" ) );
+ itemDef->setOpen( TRUE );
+ TQStringList entries =
+ lIface->definitionEntries( *dit, formWindow->mainWindow()->designerInterface() );
+ HierarchyItem *item = 0;
+ for ( TQStringList::Iterator eit = entries.begin(); eit != entries.end(); ++eit ) {
+ item = new HierarchyItem( HierarchyItem::Definition,
+ itemDef, item, *eit, TQString(), TQString() );
+ item->setRenameEnabled( 0, TRUE );
+ }
+ }
+ lIface->release();
+ }
+ setupVariables();
+ refresh();
+}
+
+void FormDefinitionView::setupVariables()
+{
+ bool pubOpen, protOpen, privOpen;
+ pubOpen = protOpen = privOpen = TRUE;
+ TQListViewItem *i = firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::VarParent ) {
+ TQListViewItem *a = i;
+ i = i->firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::VarPublic )
+ pubOpen = i->isOpen();
+ else if ( i->rtti() == HierarchyItem::VarProtected )
+ protOpen = i->isOpen();
+ else if ( i->rtti() == HierarchyItem::VarPrivate )
+ privOpen = i->isOpen();
+ i = i->nextSibling();
+ }
+ delete a;
+ break;
+ }
+ i = i->nextSibling();
+ }
+
+ HierarchyItem *itemVar = new HierarchyItem( HierarchyItem::VarParent, this, 0, tqtr( "Class Variables" ),
+ TQString(), TQString() );
+ itemVar->setPixmap( 0, TQPixmap::fromMimeSource( "designer_folder.png" ) );
+ itemVar->setOpen( TRUE );
+
+ itemVarPriv = new HierarchyItem( HierarchyItem::VarPrivate, itemVar, 0, tqtr( "private" ),
+ TQString(), TQString() );
+ itemVarProt = new HierarchyItem( HierarchyItem::VarProtected, itemVar, 0, tqtr( "protected" ),
+ TQString(), TQString() );
+ itemVarPubl = new HierarchyItem( HierarchyItem::VarPublic, itemVar, 0, tqtr( "public" ),
+ TQString(), TQString() );
+
+ TQValueList<MetaDataBase::Variable> varList = MetaDataBase::variables( formWindow );
+ TQValueList<MetaDataBase::Variable>::Iterator it = --( varList.end() );
+ if ( !varList.isEmpty() && itemVar ) {
+ for (;;) {
+ TQListViewItem *item = 0;
+ if ( (*it).varAccess == "public" )
+ item = new HierarchyItem( HierarchyItem::Variable, itemVarPubl, 0, (*it).varName,
+ TQString(), TQString() );
+ else if ( (*it).varAccess == "private" )
+ item = new HierarchyItem( HierarchyItem::Variable, itemVarPriv, 0, (*it).varName,
+ TQString(), TQString() );
+ else // default is protected
+ item = new HierarchyItem( HierarchyItem::Variable, itemVarProt, 0, (*it).varName,
+ TQString(), TQString() );
+ item->setPixmap( 0, TQPixmap::fromMimeSource( "designer_editTslots.png" ) );
+ if ( it == varList.begin() )
+ break;
+ --it;
+ }
+ }
+ itemVar->setOpen( TRUE );
+ itemVarPriv->setOpen( privOpen );
+ itemVarProt->setOpen( protOpen );
+ itemVarPubl->setOpen( pubOpen );
+}
+
+void FormDefinitionView::refresh()
+{
+ if ( popupOpen || !formWindow || !formWindow->project()->isCpp() )
+ return;
+
+ bool fuPub, fuProt, fuPriv, slPub, slProt, slPriv;
+ fuPub = fuProt = fuPriv = slPub = slProt = slPriv = TRUE;
+ TQListViewItem *i = firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::SlotParent ||
+ i->rtti() == HierarchyItem::FunctParent ) {
+ TQListViewItem *a = i;
+ i = i->firstChild();
+ while ( i ) {
+ switch( i->rtti() ) {
+ case HierarchyItem::FunctPublic:
+ fuPub = i->isOpen();
+ case HierarchyItem::FunctProtected:
+ fuProt = i->isOpen();
+ break;
+ case HierarchyItem::FunctPrivate:
+ fuPriv = i->isOpen();
+ break;
+ case HierarchyItem::SlotPublic:
+ slPub = i->isOpen();
+ if ( slPub )
+ break;
+ case HierarchyItem::SlotProtected:
+ slProt = i->isOpen();
+ break;
+ case HierarchyItem::SlotPrivate:
+ slPriv = i->isOpen();
+ }
+ i = i->nextSibling();
+ }
+ i = a->nextSibling();
+ delete a;
+ continue;
+ }
+ i = i->nextSibling();
+ }
+
+
+ itemFunct = new HierarchyItem( HierarchyItem::FunctParent,
+ this, 0, tqtr( "Functions" ), TQString(), TQString() );
+ itemFunct->moveItem( i );
+ itemFunct->setPixmap( 0, TQPixmap::fromMimeSource( "designer_folder.png" ) );
+ itemFunctPriv = new HierarchyItem( HierarchyItem::FunctPrivate, itemFunct, 0,
+ tqtr( "private" ), TQString(), TQString() );
+ itemFunctProt = new HierarchyItem( HierarchyItem::FunctProtected, itemFunct, 0,
+ tqtr( "protected" ), TQString(), TQString() );
+ itemFunctPubl = new HierarchyItem( HierarchyItem::FunctPublic, itemFunct, 0,
+ tqtr( "public" ), TQString(), TQString() );
+
+ itemSlots = new HierarchyItem( HierarchyItem::SlotParent,
+ this, 0, tqtr( "Slots" ), TQString(), TQString() );
+ itemSlots->setPixmap( 0, TQPixmap::fromMimeSource( "designer_folder.png" ) );
+ itemPrivate = new HierarchyItem( HierarchyItem::SlotPrivate, itemSlots, 0, tqtr( "private" ),
+ TQString(), TQString() );
+ itemProtected = new HierarchyItem( HierarchyItem::SlotProtected, itemSlots, 0, tqtr( "protected" ),
+ TQString(), TQString() );
+ itemPublic = new HierarchyItem( HierarchyItem::SlotPublic, itemSlots, 0, tqtr( "public" ),
+ TQString(), TQString() );
+
+ TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow );
+ TQValueList<MetaDataBase::Function>::Iterator it = --( functionList.end() );
+ if ( !functionList.isEmpty() && itemFunct ) {
+ for (;;) {
+ TQListViewItem *item = 0;
+ if ( (*it).type == "slot" ) {
+ if ( (*it).access == "protected" )
+ item = new HierarchyItem( HierarchyItem::Slot, itemProtected, 0, (*it).function,
+ TQString(), TQString() );
+ else if ( (*it).access == "private" )
+ item = new HierarchyItem( HierarchyItem::Slot, itemPrivate, 0, (*it).function,
+ TQString(), TQString() );
+ else // default is public
+ item = new HierarchyItem( HierarchyItem::Slot, itemPublic, 0, (*it).function,
+ TQString(), TQString() );
+ } else {
+ if ( (*it).access == "protected" )
+ item = new HierarchyItem( HierarchyItem::Function, itemFunctProt, 0, (*it).function,
+ TQString(), TQString() );
+ else if ( (*it).access == "private" )
+ item = new HierarchyItem( HierarchyItem::Function, itemFunctPriv, 0, (*it).function,
+ TQString(), TQString() );
+ else // default is public
+ item = new HierarchyItem( HierarchyItem::Function, itemFunctPubl, 0, (*it).function,
+ TQString(), TQString() );
+ }
+ item->setPixmap( 0, TQPixmap::fromMimeSource( "designer_editTslots.png" ) );
+ if ( it == functionList.begin() )
+ break;
+ --it;
+ }
+ }
+
+ itemFunct->setOpen( TRUE );
+ itemFunctPubl->setOpen( fuPub );
+ itemFunctProt->setOpen( fuProt );
+ itemFunctPriv->setOpen( fuPriv );
+
+ itemSlots->setOpen( TRUE );
+ itemPublic->setOpen( slPub );
+ itemProtected->setOpen( slProt );
+ itemPrivate->setOpen( slPriv );
+}
+
+
+void FormDefinitionView::setCurrent( TQWidget * )
+{
+}
+
+void FormDefinitionView::objectClicked( TQListViewItem *i )
+{
+ if ( !i )
+ return;
+ if ( (i->rtti() == HierarchyItem::Slot) || (i->rtti() == HierarchyItem::Function) )
+ formWindow->mainWindow()->editFunction( i->text( 0 ) );
+}
+
+static HierarchyItem::Type getChildType( int type )
+{
+ switch ( (HierarchyItem::Type)type ) {
+ case HierarchyItem::Widget:
+ qWarning( "getChildType: Inserting childs dynamically to Widget or SlotParent is not allowed!" );
+ break;
+ case HierarchyItem::SlotParent:
+ case HierarchyItem::SlotPublic:
+ case HierarchyItem::SlotProtected:
+ case HierarchyItem::SlotPrivate:
+ case HierarchyItem::Slot:
+ return HierarchyItem::Slot;
+ case HierarchyItem::DefinitionParent:
+ case HierarchyItem::Definition:
+ return HierarchyItem::Definition;
+ case HierarchyItem::Event:
+ case HierarchyItem::EventFunction:
+ return HierarchyItem::Event;
+ case HierarchyItem::FunctParent:
+ case HierarchyItem::FunctPublic:
+ case HierarchyItem::FunctProtected:
+ case HierarchyItem::FunctPrivate:
+ case HierarchyItem::Function:
+ return HierarchyItem::Function;
+ case HierarchyItem::VarParent:
+ case HierarchyItem::VarPublic:
+ case HierarchyItem::VarProtected:
+ case HierarchyItem::VarPrivate:
+ case HierarchyItem::Variable:
+ return HierarchyItem::Variable;
+ }
+ return (HierarchyItem::Type)type;
+}
+
+void HierarchyList::insertEntry( TQListViewItem *i, const TQPixmap &pix, const TQString &s )
+{
+ TQListViewItem *after = i->firstChild();
+ while ( after && after->nextSibling() )
+ after = after->nextSibling();
+ HierarchyItem *item = new HierarchyItem( getChildType( i->rtti() ), i, after, s,
+ TQString(), TQString() );
+ if ( !pix.isNull() )
+ item->setPixmap( 0, pix );
+ item->setRenameEnabled( 0, TRUE );
+ setCurrentItem( item );
+ ensureItemVisible( item );
+ tqApp->processEvents();
+ newItem = item;
+ item->startRename( 0 );
+}
+
+void FormDefinitionView::contentsMouseDoubleClickEvent( TQMouseEvent *e )
+{
+ TQListViewItem *i = itemAt( contentsToViewport( e->pos() ) );
+ if ( !i )
+ return;
+
+ if ( i->rtti() == HierarchyItem::SlotParent || i->rtti() == HierarchyItem::FunctParent ||
+ i->rtti() == HierarchyItem::VarParent )
+ return;
+
+ HierarchyItem::Type t = getChildType( i->rtti() );
+ if ( (int)t == i->rtti() )
+ i = i->tqparent();
+
+ if ( formWindow->project()->isCpp() )
+ switch( i->rtti() ) {
+ case HierarchyItem::FunctPublic:
+ execFunctionDialog( "public", "function", TRUE );
+ break;
+ case HierarchyItem::FunctProtected:
+ execFunctionDialog( "protected", "function", TRUE );
+ break;
+ case HierarchyItem::FunctPrivate:
+ execFunctionDialog( "private", "function", TRUE );
+ break;
+ case HierarchyItem::SlotPublic:
+ execFunctionDialog( "public", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotProtected:
+ execFunctionDialog( "protected", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotPrivate:
+ execFunctionDialog( "private", "slot", TRUE );
+ break;
+ case HierarchyItem::VarPublic:
+ case HierarchyItem::VarProtected:
+ case HierarchyItem::VarPrivate: {
+ VariableDialog varDia( formWindow, this );
+ TQListViewItem *i = selectedItem();
+ if ( i )
+ varDia.setCurrentItem( i->text( 0 ) );
+ varDia.exec();
+ break;
+ }
+ default:
+ insertEntry( i );
+ } else
+ insertEntry( i );
+}
+
+void FormDefinitionView::execFunctionDialog( const TQString &access, const TQString &type, bool addFunc )
+{
+ FormFile *formFile = formWindow->formFile();
+ if ( !formFile || !formFile->isUihFileUpToDate() )
+ return;
+
+ // refresh the functions list in the metadatabase
+ SourceEditor *editor = formFile->editor();
+ if ( editor )
+ editor->refresh( TRUE );
+
+ EditFunctions dlg( this, formWindow );
+ if ( addFunc )
+ dlg.functionAdd( access, type );
+ dlg.exec();
+}
+
+void FormDefinitionView::showRMBMenu( TQListViewItem *i, const TQPoint &pos )
+{
+ if ( !i )
+ return;
+
+ const int EDIT = 1;
+ const int NEW = 2;
+ const int DEL = 3;
+ const int PROPS = 4;
+ const int GOIMPL = 5;
+
+ TQPopupMenu menu;
+ bool insertDelete = FALSE;
+
+ if ( i->rtti() == HierarchyItem::FunctParent || i->rtti() == HierarchyItem::SlotParent ||
+ i->rtti() == HierarchyItem::VarParent ) {
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editTslots.png" ), tqtr( "Edit..." ), EDIT );
+ } else
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_filenew.png" ), tqtr( "New" ), NEW );
+ if ( i->rtti() == HierarchyItem::DefinitionParent || i->rtti() == HierarchyItem::Variable ||
+ i->rtti() == HierarchyItem::Definition ) {
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editTslots.png" ), tqtr( "Edit..." ), EDIT );
+ }
+ if ( i->rtti() == HierarchyItem::Function || i->rtti() == HierarchyItem::Slot ) {
+ if ( formWindow->project()->isCpp() )
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editTslots.png" ), tqtr( "Properties..." ), PROPS );
+ if ( MetaDataBase::hasEditor( formWindow->project()->language() ) )
+ menu.insertItem( tqtr( "Goto Implementation" ), GOIMPL );
+ insertDelete = TRUE;
+ }
+ if ( insertDelete || i->rtti() == HierarchyItem::Variable ||
+ i->rtti() == HierarchyItem::Function || i->rtti() == HierarchyItem::Slot ||
+ i->rtti() == HierarchyItem::Definition ) {
+ menu.insertSeparator();
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editcut.png" ), tqtr( "Delete..." ), DEL );
+ }
+ popupOpen = TRUE;
+ int res = menu.exec( pos );
+ popupOpen = FALSE;
+ if ( res == -1 )
+ return;
+
+ if ( res == EDIT ) {
+ switch( i->rtti() ) {
+ case HierarchyItem::FunctParent:
+ execFunctionDialog( "public", "function", FALSE );
+ break;
+ case HierarchyItem::SlotParent:
+ execFunctionDialog( "public", "slot", FALSE );
+ break;
+ case HierarchyItem::VarParent:
+ case HierarchyItem::VarPublic:
+ case HierarchyItem::VarProtected:
+ case HierarchyItem::VarPrivate:
+ case HierarchyItem::Variable: {
+ VariableDialog varDia( formWindow, this );
+ TQListViewItem *i = selectedItem();
+ if ( i )
+ varDia.setCurrentItem( i->text( 0 ) );
+ if ( varDia.exec() == TQDialog::Accepted )
+ formWindow->commandHistory()->setModified( TRUE );
+ break;
+ }
+ case HierarchyItem::Definition:
+ case HierarchyItem::DefinitionParent:
+ LanguageInterface *lIface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( !lIface )
+ return;
+ if ( i->rtti() == HierarchyItem::Definition )
+ i = i->tqparent();
+ ListEditor dia( this, 0, TRUE );
+ dia.setCaption( tqtr( "Edit %1" ).arg( i->text( 0 ) ) );
+ TQStringList entries = lIface->definitionEntries( i->text( 0 ), MainWindow::self->designerInterface() );
+ dia.setList( entries );
+ dia.exec();
+ Command *cmd = new EditDefinitionsCommand( tqtr( "Edit " ) + i->text( 0 ), formWindow,
+ lIface, i->text( 0 ), TQT_TQSTRINGLIST_OBJECT(dia.items()) );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( res == NEW ) {
+ HierarchyItem::Type t = getChildType( i->rtti() );
+ if ( (int)t == i->rtti() )
+ i = i->tqparent();
+ switch( i->rtti() ) {
+ case HierarchyItem::SlotPublic:
+ execFunctionDialog( "public", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotProtected:
+ execFunctionDialog( "protected", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotPrivate:
+ execFunctionDialog( "private" , "slot", TRUE );
+ break;
+ case HierarchyItem::FunctPublic:
+ execFunctionDialog( "public", "function", TRUE );
+ break;
+ case HierarchyItem::FunctProtected:
+ execFunctionDialog( "protected", "function", TRUE );
+ break;
+ case HierarchyItem::FunctPrivate:
+ execFunctionDialog( "private" , "function", TRUE );
+ break;
+ default:
+ insertEntry( i );
+ }
+ } else if ( res == DEL ) {
+ if ( i->rtti() == HierarchyItem::Slot || i->rtti() == HierarchyItem::Function ) {
+
+ TQCString funct( MetaDataBase::normalizeFunction( i->text( 0 ) ).latin1() );
+ Command *cmd = new RemoveFunctionCommand( tqtr( "Remove function" ), formWindow, funct,
+ TQString(), TQString(), TQString(),
+ TQString(), formWindow->project()->language() );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ } else if ( i->rtti() == HierarchyItem::Variable ) {
+ Command *cmd = new RemoveVariableCommand( tqtr( "Remove variable" ), formWindow,
+ i->text( 0 ) );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else {
+ TQListViewItem *p = i->tqparent();
+ delete i;
+ save( p, 0 );
+ }
+ } else if ( res == PROPS ) {
+ if ( i->rtti() == HierarchyItem::Slot ||
+ i->rtti() == HierarchyItem::Function ) {
+ EditFunctions dlg( this, formWindow );
+ dlg.setCurrentFunction( MetaDataBase::normalizeFunction( i->text( 0 ) ) );
+ dlg.exec();
+ }
+ } else if ( res == GOIMPL ) {
+ if ( i->rtti() == HierarchyItem::Slot ||
+ i->rtti() == HierarchyItem::Function ) {
+ formWindow->mainWindow()->editFunction( i->text( 0 ) );
+ }
+ }
+}
+
+void FormDefinitionView::renamed( TQListViewItem *i )
+{
+ if ( newItem == i )
+ newItem = 0;
+ if ( !i->tqparent() )
+ return;
+ save( i->tqparent(), i );
+}
+
+
+void FormDefinitionView::save( TQListViewItem *p, TQListViewItem *i )
+{
+ if ( i && i->text( 0 ).isEmpty() ) {
+ delete i;
+ return;
+ }
+
+ if ( i && i->rtti() == HierarchyItem::Variable ) {
+ i->setRenameEnabled( 0, FALSE );
+ TQString varName = i->text( 0 );
+ varName = varName.simplifyWhiteSpace();
+ if ( varName[(int)varName.length() - 1] != ';' )
+ varName += ";";
+ if ( MetaDataBase::hasVariable( formWindow, varName ) ) {
+ TQMessageBox::information( this, tqtr( "Edit Variables" ),
+ tqtr( "This variable has already been declared!" ) );
+ } else {
+ if ( p->rtti() == HierarchyItem::VarPublic )
+ addVariable( varName, "public" );
+ else if ( p->rtti() == HierarchyItem::VarProtected )
+ addVariable( varName, "protected" );
+ else if ( p->rtti() == HierarchyItem::VarPrivate )
+ addVariable( varName, "private" );
+ }
+ } else {
+ LanguageInterface *lIface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( !lIface )
+ return;
+ TQStringList lst;
+ i = p->firstChild();
+ while ( i ) {
+ lst << i->text( 0 );
+ i = i->nextSibling();
+ }
+ Command *cmd = new EditDefinitionsCommand( tqtr( "Edit " ) + p->text( 0 ), formWindow,
+ lIface, p->text( 0 ), lst );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void FormDefinitionView::addVariable( const TQString &varName, const TQString &access )
+{
+ Command *cmd = new AddVariableCommand( tqtr( "Add variable" ), formWindow,
+ varName, access );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+// ------------------------------------------------------------
+
+HierarchyView::HierarchyView( TQWidget *tqparent )
+ : TQTabWidget( tqparent, 0, (WFlags)(WStyle_Customize | TQt::WStyle_NormalBorder | TQt::WStyle_Title |
+ TQt::WStyle_Tool | TQt::WStyle_MinMax | TQt::WStyle_SysMenu ))
+{
+ formwindow = 0;
+ editor = 0;
+ listview = new HierarchyList( this, formWindow() );
+ fView = new FormDefinitionView( this, formWindow() );
+ if ( !MainWindow::self->singleProjectMode() ) {
+ addTab( listview, tqtr( "Objects" ) );
+ setTabToolTip( listview, tqtr( "List of all widgets and objects of the current form in hierarchical order" ) );
+ addTab( fView, tqtr( "Members" ) );
+ setTabToolTip( fView, tqtr( "List of all members of the current form" ) );
+ } else {
+ listview->hide();
+ fView->hide();
+ }
+
+ if ( !classBrowserInterfaceManager ) {
+ classBrowserInterfaceManager =
+ new TQPluginManager<ClassBrowserInterface>( IID_ClassBrowser, TQApplication::libraryPaths(),
+ MainWindow::self->pluginDirectory() );
+ }
+
+ classBrowsers = new TQMap<TQString, ClassBrowser>();
+ TQStringList langs = MetaDataBase::languages();
+ for ( TQStringList::Iterator it = langs.begin(); it != langs.end(); ++it ) {
+ TQInterfacePtr<ClassBrowserInterface> ciface = 0;
+ classBrowserInterfaceManager->queryInterface( *it, &ciface );
+ if ( ciface ) {
+ ClassBrowser cb( ciface->createClassBrowser( this ), ciface );
+ addTab( cb.lv, tqtr( "Class Declarations" ) );
+ setTabToolTip( cb.lv, tqtr( "List of all classes and its declarations of the current source file" ) );
+ ciface->onClick( TQT_TQOBJECT(this), TQT_SLOT( jumpTo( const TQString &, const TQString &, int ) ) );
+ classBrowsers->insert( *it, cb );
+ setTabEnabled( cb.lv, FALSE );
+ }
+ }
+}
+
+HierarchyView::~HierarchyView()
+{
+}
+
+void HierarchyView::clear()
+{
+ listview->clear();
+ fView->clear();
+ for ( TQMap<TQString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ (*it).iface->clear();
+ }
+}
+
+void HierarchyView::setFormWindow( FormWindow *fw, TQObject *o )
+{
+ bool fake = fw && qstrcmp( fw->name(), "qt_fakewindow" ) == 0;
+ if ( fw == 0 || o == 0 ) {
+ listview->clear();
+ fView->clear();
+ listview->setFormWindow( fw );
+ fView->setFormWindow( fw );
+ formwindow = 0;
+ editor = 0;
+ }
+
+ setTabEnabled( listview, TRUE );
+ setTabEnabled( fView, fw && fw->project()->isCpp() );
+
+ if ( fw == formwindow ) {
+ if ( fw ) {
+ if ( !fake )
+ listview->setCurrent( (TQWidget*)o );
+ else
+ listview->clear();
+ if ( MainWindow::self->qWorkspace()->activeWindow() == fw )
+ showPage( listview );
+ else if ( fw->project()->isCpp() )
+ showPage( fView );
+ else
+ showClasses( fw->formFile()->editor() );
+ }
+ }
+
+ formwindow = fw;
+ if ( !fake ) {
+ listview->setFormWindow( fw );
+ } else {
+ listview->setFormWindow( 0 );
+ listview->clear();
+ }
+
+ fView->setFormWindow( fw );
+ if ( !fake ) {
+ listview->setup();
+ listview->setCurrent( (TQWidget*)o );
+ }
+ fView->setup();
+
+ for ( TQMap<TQString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ (*it).iface->clear();
+ setTabEnabled( (*it).lv, fw && !fw->project()->isCpp() );
+ }
+
+ if ( MainWindow::self->qWorkspace()->activeWindow() == fw )
+ showPage( listview );
+ else if ( fw && fw->project()->isCpp() )
+ showPage( fView );
+ else if ( fw )
+ showClasses( fw->formFile()->editor() );
+
+ editor = 0;
+}
+
+void HierarchyView::showClasses( SourceEditor *se )
+{
+ if ( !se->object() )
+ return;
+
+ lastSourceEditor = se;
+ TQTimer::singleShot( 100, this, TQT_SLOT( showClassesTimeout() ) );
+}
+
+void HierarchyView::showClassesTimeout()
+{
+ if ( !lastSourceEditor )
+ return;
+ SourceEditor *se = (SourceEditor*)lastSourceEditor;
+ if ( !se->object() )
+ return;
+ if ( se->formWindow() && se->formWindow()->project()->isCpp() ) {
+ setFormWindow( se->formWindow(), TQT_TQOBJECT(se->formWindow()->currentWidget()) );
+ MainWindow::self->propertyeditor()->setWidget( se->formWindow()->currentWidget(),
+ se->formWindow() );
+ return;
+ }
+
+ setTabEnabled( listview, !!se->formWindow() && !se->formWindow()->isFake() );
+ setTabEnabled( fView, FALSE );
+
+ formwindow = 0;
+ listview->setFormWindow( 0 );
+ fView->setFormWindow( 0 );
+ listview->clear();
+ fView->clear();
+ if ( !se->formWindow() )
+ MainWindow::self->propertyeditor()->setWidget( 0, 0 );
+ editor = se;
+
+ for ( TQMap<TQString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ if ( it.key() == se->project()->language() ) {
+ (*it).iface->update( se->text() );
+ setTabEnabled( (*it).lv, TRUE );
+ showPage( (*it).lv );
+ } else {
+ setTabEnabled( (*it).lv, FALSE );
+ (*it).iface->clear();
+ }
+ }
+}
+
+void HierarchyView::updateClassBrowsers()
+{
+ if ( !editor )
+ return;
+ for ( TQMap<TQString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ if ( it.key() == editor->project()->language() )
+ (*it).iface->update( editor->text() );
+ else
+ (*it).iface->clear();
+ }
+}
+
+FormWindow *HierarchyView::formWindow() const
+{
+ return formwindow;
+}
+
+void HierarchyView::closeEvent( TQCloseEvent *e )
+{
+ emit hidden();
+ e->accept();
+}
+
+void HierarchyView::widgetInserted( TQWidget * )
+{
+ listview->setup();
+}
+
+void HierarchyView::widgetRemoved( TQWidget * )
+{
+ listview->setup();
+}
+
+void HierarchyView::widgetsInserted( const TQWidgetList & )
+{
+ listview->setup();
+}
+
+void HierarchyView::widgetsRemoved( const TQWidgetList & )
+{
+ listview->setup();
+}
+
+void HierarchyView::namePropertyChanged( TQWidget *w, const TQVariant & )
+{
+ TQWidget *w2 = w;
+ if ( ::tqqt_cast<TQMainWindow*>(w) )
+ w2 = ( (TQMainWindow*)w )->centralWidget();
+ listview->changeNameOf( w2, w->name() );
+}
+
+
+void HierarchyView::databasePropertyChanged( TQWidget *w, const TQStringList& info )
+{
+#ifndef TQT_NO_SQL
+ TQString i = info.join( "." );
+ listview->changeDatabaseOf( w, i );
+#endif
+}
+
+
+void HierarchyView::tabsChanged( TQTabWidget * )
+{
+ listview->setup();
+}
+
+void HierarchyView::pagesChanged( TQWizard * )
+{
+ listview->setup();
+}
+
+void HierarchyView::rebuild()
+{
+ listview->setup();
+}
+
+void HierarchyView::closed( FormWindow *fw )
+{
+ if ( fw == formwindow ) {
+ listview->clear();
+ fView->clear();
+ }
+}
+
+void HierarchyView::updateFormDefinitionView()
+{
+ fView->setup();
+}
+
+void HierarchyView::jumpTo( const TQString &func, const TQString &clss, int type )
+{
+ if ( !editor )
+ return;
+ if ( type == ClassBrowserInterface::Class )
+ editor->setClass( func );
+ else
+ editor->setFunction( func, clss );
+}
+
+HierarchyView::ClassBrowser::ClassBrowser( TQListView *l, ClassBrowserInterface *i )
+ : lv( l ), iface( i )
+{
+}
+
+HierarchyView::ClassBrowser::~ClassBrowser()
+{
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/hierarchyview.h b/tqtinterface/qt4/tools/designer/designer/hierarchyview.h
new file mode 100644
index 0000000..9b04c0d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/hierarchyview.h
@@ -0,0 +1,254 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef HIRARCHYVIEW_H
+#define HIRARCHYVIEW_H
+
+#include <tqvariant.h>
+#include <tqlistview.h>
+#include <tqtabwidget.h>
+#include <tqguardedptr.h>
+#include <private/tqcom_p.h>
+#include "../interfaces/classbrowserinterface.h"
+
+class FormWindow;
+class TQCloseEvent;
+class TQPopupMenu;
+class TQKeyEvent;
+class TQMouseEvent;
+class TQWizard;
+class SourceEditor;
+
+class HierarchyItem : public TQListViewItem
+{
+public:
+ enum Type {
+ Widget,
+ SlotParent,
+ SlotPublic,
+ SlotProtected,
+ SlotPrivate,
+ Slot,
+ DefinitionParent,
+ Definition,
+ Event,
+ EventFunction,
+ FunctParent,
+ FunctPublic,
+ FunctProtected,
+ FunctPrivate,
+ Function,
+ VarParent,
+ VarPublic,
+ VarProtected,
+ VarPrivate,
+ Variable
+ };
+
+ HierarchyItem( Type type, TQListViewItem *tqparent, TQListViewItem *after,
+ const TQString &txt1, const TQString &txt2, const TQString &txt3 );
+ HierarchyItem( Type type, TQListView *tqparent, TQListViewItem *after,
+ const TQString &txt1, const TQString &txt2, const TQString &txt3 );
+
+ void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align );
+ void updateBackColor();
+
+ void setObject( TQT_BASE_OBJECT_NAME *o );
+ TQObject *object() const;
+
+ void setText( int col, const TQString &txt ) { if ( !txt.isEmpty() ) TQListViewItem::setText( col, txt ); }
+
+ int rtti() const { return (int)typ; }
+
+private:
+ void okRename( int col );
+ void cancelRename( int col );
+
+private:
+ TQColor backgroundColor();
+ TQColor backColor;
+ TQObject *obj;
+ Type typ;
+
+};
+
+class HierarchyList : public TQListView
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ HierarchyList( TQWidget *tqparent, FormWindow *fw, bool doConnects = TRUE );
+
+ virtual void setup();
+ virtual void setCurrent( TQT_BASE_OBJECT_NAME *o );
+ void setOpen( TQListViewItem *i, bool b );
+ void changeNameOf( TQT_BASE_OBJECT_NAME *o, const TQString &name );
+ void changeDatabaseOf( TQT_BASE_OBJECT_NAME *o, const TQString &info );
+ void setFormWindow( FormWindow *fw ) { formWindow = fw; }
+ void drawContentsOffset( TQPainter *p, int ox, int oy,
+ int cx, int cy, int cw, int ch ) {
+ setUpdatesEnabled( FALSE );
+ triggerUpdate();
+ setUpdatesEnabled( TRUE );
+ TQListView::drawContentsOffset( p, ox, oy, cx, cy, cw, ch );
+ }
+
+ void insertEntry( TQListViewItem *i, const TQPixmap &pix = TQPixmap(), const TQString &s = TQString() );
+
+protected:
+ void keyPressEvent( TQKeyEvent *e );
+ void keyReleaseEvent( TQKeyEvent *e );
+ void viewportMousePressEvent( TQMouseEvent *e );
+ void viewportMouseReleaseEvent( TQMouseEvent *e );
+
+public Q_SLOTS:
+ void addTabPage();
+ void removeTabPage();
+
+private:
+ void insertObject( TQT_BASE_OBJECT_NAME *o, TQListViewItem *tqparent );
+ TQObject *tqfindObject( TQListViewItem *i );
+ TQListViewItem *tqfindItem( TQT_BASE_OBJECT_NAME *o );
+ TQObject *current() const;
+ TQObject *handleObjectClick( TQListViewItem *i );
+
+private Q_SLOTS:
+ virtual void objectClicked( TQListViewItem *i );
+ virtual void objectDoubleClicked( TQListViewItem *i );
+ virtual void showRMBMenu( TQListViewItem *, const TQPoint & );
+
+protected:
+ FormWindow *formWindow;
+ TQPopupMenu *normalMenu, *tabWidgetMenu;
+ bool deselect;
+
+};
+
+class FormDefinitionView : public HierarchyList
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ FormDefinitionView( TQWidget *tqparent, FormWindow *fw );
+
+ void setup();
+ void setupVariables();
+ void refresh();
+ void setCurrent( TQWidget *w );
+
+protected:
+ void contentsMouseDoubleClickEvent( TQMouseEvent *e );
+
+private:
+ void save( TQListViewItem *p, TQListViewItem *i );
+ void execFunctionDialog( const TQString &access, const TQString &type, bool addFunc );
+ void addVariable( const TQString &varName, const TQString &access );
+
+private Q_SLOTS:
+ void objectClicked( TQListViewItem *i );
+ void showRMBMenu( TQListViewItem *, const TQPoint & );
+ void renamed( TQListViewItem *i );
+
+private:
+ bool popupOpen;
+ HierarchyItem *itemSlots, *itemPrivate, *itemProtected, *itemPublic;
+ HierarchyItem *itemFunct, *itemFunctPriv, *itemFunctProt, *itemFunctPubl;
+ HierarchyItem *itemVar, *itemVarPriv, *itemVarProt, *itemVarPubl;
+};
+
+
+class HierarchyView : public TQTabWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ HierarchyView( TQWidget *tqparent );
+ ~HierarchyView();
+
+ void setFormWindow( FormWindow *fw, TQObject *o );
+ FormWindow *formWindow() const;
+ SourceEditor *sourceEditor() const { return editor; }
+ void clear();
+
+ void showClasses( SourceEditor *se );
+ void updateClassBrowsers();
+
+ void widgetInserted( TQWidget *w );
+ void widgetRemoved( TQWidget *w );
+ void widgetsInserted( const TQWidgetList &l );
+ void widgetsRemoved( const TQWidgetList &l );
+ void namePropertyChanged( TQWidget *w, const TQVariant &old );
+ void databasePropertyChanged( TQWidget *w, const TQStringList& info );
+ void tabsChanged( TQTabWidget *w );
+ void pagesChanged( TQWizard *w );
+ void rebuild();
+ void closed( FormWindow *fw );
+ void updateFormDefinitionView();
+
+ FormDefinitionView *formDefinitionView() const { return fView; }
+ HierarchyList *hierarchyList() const { return listview; }
+
+protected Q_SLOTS:
+ void jumpTo( const TQString &func, const TQString &clss,int type );
+ void showClassesTimeout();
+
+protected:
+ void closeEvent( TQCloseEvent *e );
+
+Q_SIGNALS:
+ void hidden();
+
+private:
+ struct ClassBrowser
+ {
+ ClassBrowser( TQListView * = 0, ClassBrowserInterface * = 0 );
+ ~ClassBrowser();
+ TQListView *lv;
+ TQInterfacePtr<ClassBrowserInterface> iface;
+
+ TQ_DUMMY_COMPARISON_OPERATOR( ClassBrowser )
+ };
+ FormWindow *formwindow;
+ HierarchyList *listview;
+ FormDefinitionView *fView;
+ SourceEditor *editor;
+ TQMap<TQString, ClassBrowser> *classBrowsers;
+ TQGuardedPtr<SourceEditor> lastSourceEditor;
+
+};
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/iconvieweditor.ui b/tqtinterface/qt4/tools/designer/designer/iconvieweditor.ui
new file mode 100644
index 0000000..325678d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/iconvieweditor.ui
@@ -0,0 +1,464 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>IconViewEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>IconViewEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>567</width>
+ <height>321</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Iconview</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Iconview&lt;/b&gt;&lt;p&gt;Add, edit or delete items in the icon view.&lt;/p&gt;&lt;p&gt;Click the &lt;b&gt;New Item&lt;/b&gt;-button to create a new item, then enter text and choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the view and click the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the iconview.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQIconView">
+ <property name="name">
+ <cstring>preview</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>All items in the iconview.</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>itemNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add an item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Create a new item for the iconview.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>itemDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Vertical Spacing1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>&amp;Item Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemText</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>itemText</cstring>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Change the text for the selected item.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>itemPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>itemDeletePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_editcut.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item's pixmap.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select a pixmap file for the current item.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>itemNew</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>insertNewItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>deleteCurrentItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemText</sender>
+ <signal>textChanged( const QString &amp; )</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>currentTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>choosePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>selectionChanged(TQIconViewItem*)</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>currentItemChanged(TQIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>currentChanged(TQIconViewItem*)</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>currentItemChanged(TQIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>deletePixmap()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>preview</tabstop>
+ <tabstop>itemNew</tabstop>
+ <tabstop>itemDelete</tabstop>
+ <tabstop>itemText</tabstop>
+ <tabstop>itemDeletePixmap</tabstop>
+ <tabstop>itemChoosePixmap</tabstop>
+ <tabstop>buttonHelp</tabstop>
+ <tabstop>buttonApply</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">cancelClicked()</slot>
+ <slot access="protected">choosePixmap()</slot>
+ <slot access="protected">currentItemChanged( TQIconViewItem * )</slot>
+ <slot access="protected">currentTextChanged( const QString &amp; )</slot>
+ <slot access="protected">deleteCurrentItem()</slot>
+ <slot access="protected">insertNewItem()</slot>
+ <slot access="protected">deletePixmap()</slot>
+ <slot access="protected">okClicked()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.cpp
new file mode 100644
index 0000000..5d5619f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.cpp
@@ -0,0 +1,170 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "iconvieweditorimpl.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "pixmapchooser.h"
+
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqiconview.h>
+#include <tqpushbutton.h>
+#include <tqcheckbox.h>
+
+IconViewEditor::IconViewEditor( TQWidget *tqparent, TQWidget *editWidget, FormWindow *fw )
+ : IconViewEditorBase( tqparent, 0, TRUE ), formwindow( fw )
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ iconview = (TQIconView*)editWidget;
+
+ itemText->setText( "" );
+ itemText->setEnabled( FALSE );
+ itemPixmap->setText( "" );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+
+ TQIconViewItem *i = 0;
+ for ( i = iconview->firstItem(); i; i = i->nextItem() ) {
+ (void)new TQIconViewItem( preview, i->text(), *i->pixmap() );
+ }
+
+ if ( preview->firstItem() )
+ preview->setCurrentItem( preview->firstItem() );
+}
+
+void IconViewEditor::insertNewItem()
+{
+ TQIconViewItem *i = new TQIconViewItem( preview, tr( "New Item" ) );
+ preview->setCurrentItem( i );
+ preview->setSelected( i, TRUE );
+ itemText->setFocus();
+ itemText->selectAll();
+}
+
+void IconViewEditor::deleteCurrentItem()
+{
+ delete preview->currentItem();
+ if ( preview->currentItem() )
+ preview->setSelected( preview->currentItem(), TRUE );
+}
+
+void IconViewEditor::currentItemChanged( TQIconViewItem *i )
+{
+ itemText->blockSignals( TRUE );
+ itemText->setText( "" );
+ itemPixmap->setText( "" );
+ itemText->blockSignals( FALSE );
+
+ if ( !i ) {
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ return;
+ }
+
+ itemText->blockSignals( TRUE );
+ itemText->setEnabled( TRUE );
+ itemChoosePixmap->setEnabled( TRUE );
+ itemDeletePixmap->setEnabled( i->pixmap() && !i->pixmap()->isNull() );
+
+ itemText->setText( i->text() );
+ if ( i->pixmap() )
+ itemPixmap->setPixmap( *i->pixmap() );
+ itemText->blockSignals( FALSE );
+}
+
+void IconViewEditor::currentTextChanged( const TQString &txt )
+{
+ if ( !preview->currentItem() )
+ return;
+
+ preview->currentItem()->setText( txt );
+}
+
+void IconViewEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void IconViewEditor::cancelClicked()
+{
+ reject();
+}
+
+void IconViewEditor::applyClicked()
+{
+ TQIconViewItem *i = 0;
+ TQValueList<PopulateIconViewCommand::Item> items;
+ for ( i = preview->firstItem(); i; i = i->nextItem() ) {
+ PopulateIconViewCommand::Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ items.append( item );
+ }
+
+ PopulateIconViewCommand *cmd = new PopulateIconViewCommand( tr( "Edit the Items of '%1'" ).arg( iconview->name() ),
+ formwindow, iconview, items );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void IconViewEditor::choosePixmap()
+{
+ if ( !preview->currentItem() )
+ return;
+
+ TQPixmap pix;
+ if ( preview->currentItem()->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *preview->currentItem()->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, TQPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ preview->currentItem()->setPixmap( pix );
+ itemPixmap->setPixmap( pix );
+ itemDeletePixmap->setEnabled( TRUE );
+}
+
+void IconViewEditor::deletePixmap()
+{
+ if ( !preview->currentItem() )
+ return;
+
+ preview->currentItem()->setPixmap( TQPixmap() );
+ itemPixmap->setText( "" );
+ itemDeletePixmap->setEnabled( FALSE );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.h b/tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.h
new file mode 100644
index 0000000..2fc6441
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/iconvieweditorimpl.h
@@ -0,0 +1,66 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ICONVIEWEDITORIMPL_H
+#define ICONVIEWEDITORIMPL_H
+
+#include "iconvieweditor.h"
+
+class FormWindow;
+
+class IconViewEditor : public IconViewEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ IconViewEditor( TQWidget *tqparent, TQWidget *editWidget, FormWindow *fw );
+
+protected Q_SLOTS:
+ void insertNewItem();
+ void deleteCurrentItem();
+ void currentItemChanged( TQIconViewItem * );
+ void currentTextChanged( const TQString & );
+ void okClicked();
+ void cancelClicked();
+ void applyClicked();
+ void choosePixmap();
+ void deletePixmap();
+
+private:
+ TQIconView *iconview;
+ FormWindow *formwindow;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_adjustsize.png b/tqtinterface/qt4/tools/designer/designer/images/designer_adjustsize.png
new file mode 100644
index 0000000..6ade1e2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_adjustsize.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_appicon.png b/tqtinterface/qt4/tools/designer/designer/images/designer_appicon.png
new file mode 100644
index 0000000..7aadcba
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_appicon.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_arrow.png b/tqtinterface/qt4/tools/designer/designer/images/designer_arrow.png
new file mode 100644
index 0000000..ec9c061
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_arrow.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_background.png b/tqtinterface/qt4/tools/designer/designer/images/designer_background.png
new file mode 100644
index 0000000..27d2e99
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_background.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_book.png b/tqtinterface/qt4/tools/designer/designer/images/designer_book.png
new file mode 100644
index 0000000..dd850ab
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_book.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_buttongroup.png b/tqtinterface/qt4/tools/designer/designer/images/designer_buttongroup.png
new file mode 100644
index 0000000..d89e28f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_buttongroup.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_checkbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_checkbox.png
new file mode 100644
index 0000000..ab6f53e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_checkbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_combobox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_combobox.png
new file mode 100644
index 0000000..7d4890a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_combobox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_connecttool.png b/tqtinterface/qt4/tools/designer/designer/images/designer_connecttool.png
new file mode 100644
index 0000000..fca6748
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_connecttool.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_cross.png b/tqtinterface/qt4/tools/designer/designer/images/designer_cross.png
new file mode 100644
index 0000000..d5e9f0c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_cross.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_customwidget.png b/tqtinterface/qt4/tools/designer/designer/images/designer_customwidget.png
new file mode 100644
index 0000000..ab790e1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_customwidget.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_adjustsize.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_adjustsize.png
new file mode 100644
index 0000000..bbe30ff
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_adjustsize.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_book.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_book.png
new file mode 100644
index 0000000..b61d611
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_book.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_buttongroup.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_buttongroup.png
new file mode 100644
index 0000000..1e451a8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_buttongroup.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_checkbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_checkbox.png
new file mode 100644
index 0000000..1415eab
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_checkbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_combobox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_combobox.png
new file mode 100644
index 0000000..5fb44ef
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_combobox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_connecttool.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_connecttool.png
new file mode 100644
index 0000000..76a3b5f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_connecttool.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_customwidget.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_customwidget.png
new file mode 100644
index 0000000..5ea648f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_customwidget.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_databrowser.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_databrowser.png
new file mode 100644
index 0000000..115826a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_databrowser.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_datatable.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_datatable.png
new file mode 100644
index 0000000..7060dc3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_datatable.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_dataview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_dataview.png
new file mode 100644
index 0000000..c507d41
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_dataview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_dateedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_dateedit.png
new file mode 100644
index 0000000..162e63a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_dateedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_datetimeedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_datetimeedit.png
new file mode 100644
index 0000000..82a7e14
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_datetimeedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_dial.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_dial.png
new file mode 100644
index 0000000..a84869e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_dial.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_down.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_down.png
new file mode 100644
index 0000000..57b407e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_down.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editbreaklayout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editbreaklayout.png
new file mode 100644
index 0000000..2a36d67
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editbreaklayout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editcopy.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editcopy.png
new file mode 100644
index 0000000..895e3c6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editcut.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editcut.png
new file mode 100644
index 0000000..8d50ae0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editdelete.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editdelete.png
new file mode 100644
index 0000000..e960c58
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editdelete.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editgrid.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editgrid.png
new file mode 100644
index 0000000..ad2b87b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editgrid.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayout.png
new file mode 100644
index 0000000..dacaf82
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayoutsplit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayoutsplit.png
new file mode 100644
index 0000000..00a9605
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_edithlayoutsplit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editlower.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editlower.png
new file mode 100644
index 0000000..df7d371
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editlower.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editpaste.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editpaste.png
new file mode 100644
index 0000000..48acd7d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editpaste.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editraise.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editraise.png
new file mode 100644
index 0000000..5f7f04b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editraise.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editslots.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editslots.png
new file mode 100644
index 0000000..c2f900a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editslots.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayout.png
new file mode 100644
index 0000000..ed202af
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayoutsplit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayoutsplit.png
new file mode 100644
index 0000000..54ee44c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_editvlayoutsplit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_filenew.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_filenew.png
new file mode 100644
index 0000000..d5e7061
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_filenew.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_fileopen.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_fileopen.png
new file mode 100644
index 0000000..ddbd33d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_filesave.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_filesave.png
new file mode 100644
index 0000000..5d1476d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_folder.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_folder.png
new file mode 100644
index 0000000..4bed3ca
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_folder.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_form.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_form.png
new file mode 100644
index 0000000..9f89d65
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_form.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_frame.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_frame.png
new file mode 100644
index 0000000..09b21b2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_frame.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_groupbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_groupbox.png
new file mode 100644
index 0000000..e7e0108
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_groupbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_help.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_help.png
new file mode 100644
index 0000000..8f9d182
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_help.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_home.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_home.png
new file mode 100644
index 0000000..b3906a4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_home.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_iconview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_iconview.png
new file mode 100644
index 0000000..782c362
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_iconview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_image.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_image.png
new file mode 100644
index 0000000..f7cb29c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_image.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_label.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_label.png
new file mode 100644
index 0000000..bfbd5b8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_label.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_layout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_layout.png
new file mode 100644
index 0000000..1ee6095
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_layout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_lcdnumber.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_lcdnumber.png
new file mode 100644
index 0000000..786747e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_lcdnumber.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_left.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_left.png
new file mode 100644
index 0000000..50d03bb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_left.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_line.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_line.png
new file mode 100644
index 0000000..25b0dae
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_line.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_lineedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_lineedit.png
new file mode 100644
index 0000000..9d34ce9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_lineedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_listbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_listbox.png
new file mode 100644
index 0000000..d80c790
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_listbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_listview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_listview.png
new file mode 100644
index 0000000..dc1338f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_listview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_multilineedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_multilineedit.png
new file mode 100644
index 0000000..0532aee
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_multilineedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_newform.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_newform.png
new file mode 100644
index 0000000..ace6130
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_newform.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_ordertool.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_ordertool.png
new file mode 100644
index 0000000..61bdc7e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_ordertool.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_pixlabel.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_pixlabel.png
new file mode 100644
index 0000000..21e1f49
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_pixlabel.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_pointer.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_pointer.png
new file mode 100644
index 0000000..e6903eb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_pointer.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_print.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_print.png
new file mode 100644
index 0000000..03ee9b2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_print.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_progress.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_progress.png
new file mode 100644
index 0000000..25d857a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_progress.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_project.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_project.png
new file mode 100644
index 0000000..b265eae
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_project.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_pushbutton.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_pushbutton.png
new file mode 100644
index 0000000..635f35c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_pushbutton.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_radiobutton.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_radiobutton.png
new file mode 100644
index 0000000..e86eb8c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_radiobutton.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_redo.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_redo.png
new file mode 100644
index 0000000..6e993cc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_redo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_richtextedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_richtextedit.png
new file mode 100644
index 0000000..ba7ada1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_richtextedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_right.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_right.png
new file mode 100644
index 0000000..9dbf2dd
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_right.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_scrollbar.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_scrollbar.png
new file mode 100644
index 0000000..9a81897
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_scrollbar.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_searchfind.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_searchfind.png
new file mode 100644
index 0000000..e85e33f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_searchfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_setbuddy.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_setbuddy.png
new file mode 100644
index 0000000..fe816aa
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_setbuddy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_slider.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_slider.png
new file mode 100644
index 0000000..a1ad5d5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_slider.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_spacer.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_spacer.png
new file mode 100644
index 0000000..15319d9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_spacer.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_spinbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_spinbox.png
new file mode 100644
index 0000000..cafbe01
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_spinbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_table.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_table.png
new file mode 100644
index 0000000..a95bde1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_table.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_tabwidget.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_tabwidget.png
new file mode 100644
index 0000000..0f0bad0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_tabwidget.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textbold.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textbold.png
new file mode 100644
index 0000000..402a157
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textbold.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textbrowser.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textbrowser.png
new file mode 100644
index 0000000..b4315f9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textbrowser.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textcenter.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textcenter.png
new file mode 100644
index 0000000..7a66036
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textcenter.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textedit.png
new file mode 100644
index 0000000..6931414
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textfont.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textfont.png
new file mode 100644
index 0000000..beb2112
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textfont.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth1.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth1.png
new file mode 100644
index 0000000..bfffe02
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth1.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth2.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth2.png
new file mode 100644
index 0000000..e90437b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth2.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth3.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth3.png
new file mode 100644
index 0000000..dd527e3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_texth3.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textitalic.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textitalic.png
new file mode 100644
index 0000000..253ed9c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textitalic.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textjustify.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textjustify.png
new file mode 100644
index 0000000..3fb3cc3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textjustify.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textlarger.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textlarger.png
new file mode 100644
index 0000000..ecc35f5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textlarger.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textleft.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textleft.png
new file mode 100644
index 0000000..26db80f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textleft.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textlinebreak.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textlinebreak.png
new file mode 100644
index 0000000..b48e323
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textlinebreak.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textparagraph.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textparagraph.png
new file mode 100644
index 0000000..a7ef75c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textparagraph.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textright.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textright.png
new file mode 100644
index 0000000..d2954e9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textright.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textsmaller.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textsmaller.png
new file mode 100644
index 0000000..00734e7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textsmaller.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textteletext.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textteletext.png
new file mode 100644
index 0000000..6459730
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textteletext.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textunderline.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textunderline.png
new file mode 100644
index 0000000..4793445
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textunderline.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_textview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textview.png
new file mode 100644
index 0000000..05ce9c6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_textview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_timeedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_timeedit.png
new file mode 100644
index 0000000..955144e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_timeedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbox.png
new file mode 100644
index 0000000..e1f8447
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbutton.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbutton.png
new file mode 100644
index 0000000..08e309a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_toolbutton.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_undo.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_undo.png
new file mode 100644
index 0000000..22ac97f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_undo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_up.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_up.png
new file mode 100644
index 0000000..4c3ab7c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_up.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_widgetstack.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_widgetstack.png
new file mode 100644
index 0000000..c62f8e1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_widgetstack.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddata.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddata.png
new file mode 100644
index 0000000..fb540b8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddata.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddialog.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddialog.png
new file mode 100644
index 0000000..b83ca7e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_wizarddialog.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_d_wordwrap.png b/tqtinterface/qt4/tools/designer/designer/images/designer_d_wordwrap.png
new file mode 100644
index 0000000..f3f5d96
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_d_wordwrap.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_databrowser.png b/tqtinterface/qt4/tools/designer/designer/images/designer_databrowser.png
new file mode 100644
index 0000000..1dd9578
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_databrowser.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_datatable.png b/tqtinterface/qt4/tools/designer/designer/images/designer_datatable.png
new file mode 100644
index 0000000..5b3bfc7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_datatable.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_dataview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_dataview.png
new file mode 100644
index 0000000..5f6aad3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_dataview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_dateedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_dateedit.png
new file mode 100644
index 0000000..48286be
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_dateedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_datetimeedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_datetimeedit.png
new file mode 100644
index 0000000..68a5673
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_datetimeedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_dial.png b/tqtinterface/qt4/tools/designer/designer/images/designer_dial.png
new file mode 100644
index 0000000..3de30f1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_dial.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_down.png b/tqtinterface/qt4/tools/designer/designer/images/designer_down.png
new file mode 100644
index 0000000..3269dec
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_down.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editbreaklayout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editbreaklayout.png
new file mode 100644
index 0000000..badbb8e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editbreaklayout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editcopy.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editcopy.png
new file mode 100644
index 0000000..2f931cb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editcut.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editcut.png
new file mode 100644
index 0000000..a911482
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editdelete.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editdelete.png
new file mode 100644
index 0000000..9f0491d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editdelete.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editgrid.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editgrid.png
new file mode 100644
index 0000000..e1159bb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editgrid.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_edithlayout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_edithlayout.png
new file mode 100644
index 0000000..1a2b150
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_edithlayout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_edithlayoutsplit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_edithlayoutsplit.png
new file mode 100644
index 0000000..cba102b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_edithlayoutsplit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editlower.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editlower.png
new file mode 100644
index 0000000..50605f2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editlower.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editpaste.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editpaste.png
new file mode 100644
index 0000000..b1b7f85
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editpaste.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editraise.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editraise.png
new file mode 100644
index 0000000..f157251
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editraise.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editslots.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editslots.png
new file mode 100644
index 0000000..b86bddb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editslots.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editvlayout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editvlayout.png
new file mode 100644
index 0000000..f4cd3f9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editvlayout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_editvlayoutsplit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_editvlayoutsplit.png
new file mode 100644
index 0000000..0180cf5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_editvlayoutsplit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_filenew.png b/tqtinterface/qt4/tools/designer/designer/images/designer_filenew.png
new file mode 100644
index 0000000..9520080
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_filenew.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_fileopen.png b/tqtinterface/qt4/tools/designer/designer/images/designer_fileopen.png
new file mode 100644
index 0000000..3005290
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_filesave.png b/tqtinterface/qt4/tools/designer/designer/images/designer_filesave.png
new file mode 100644
index 0000000..c137165
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_folder.png b/tqtinterface/qt4/tools/designer/designer/images/designer_folder.png
new file mode 100644
index 0000000..7007e37
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_folder.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_form.png b/tqtinterface/qt4/tools/designer/designer/images/designer_form.png
new file mode 100644
index 0000000..08268bf
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_form.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_frame.png b/tqtinterface/qt4/tools/designer/designer/images/designer_frame.png
new file mode 100644
index 0000000..c070b9c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_frame.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_groupbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_groupbox.png
new file mode 100644
index 0000000..4025b4d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_groupbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_hand.png b/tqtinterface/qt4/tools/designer/designer/images/designer_hand.png
new file mode 100644
index 0000000..dd8af74
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_hand.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_help.png b/tqtinterface/qt4/tools/designer/designer/images/designer_help.png
new file mode 100644
index 0000000..2ab2c25
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_help.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_home.png b/tqtinterface/qt4/tools/designer/designer/images/designer_home.png
new file mode 100644
index 0000000..806d11d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_home.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_hsplit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_hsplit.png
new file mode 100644
index 0000000..232faf1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_hsplit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_ibeam.png b/tqtinterface/qt4/tools/designer/designer/images/designer_ibeam.png
new file mode 100644
index 0000000..6074c89
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_ibeam.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_iconview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_iconview.png
new file mode 100644
index 0000000..13b8f15
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_iconview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_image.png b/tqtinterface/qt4/tools/designer/designer/images/designer_image.png
new file mode 100644
index 0000000..29854df
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_image.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_label.png b/tqtinterface/qt4/tools/designer/designer/images/designer_label.png
new file mode 100644
index 0000000..5d7d7b4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_label.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_layout.png b/tqtinterface/qt4/tools/designer/designer/images/designer_layout.png
new file mode 100644
index 0000000..168eb1f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_layout.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_lcdnumber.png b/tqtinterface/qt4/tools/designer/designer/images/designer_lcdnumber.png
new file mode 100644
index 0000000..64eda5e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_lcdnumber.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_left.png b/tqtinterface/qt4/tools/designer/designer/images/designer_left.png
new file mode 100644
index 0000000..e58177f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_left.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_line.png b/tqtinterface/qt4/tools/designer/designer/images/designer_line.png
new file mode 100644
index 0000000..5c64dfb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_line.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_lineedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_lineedit.png
new file mode 100644
index 0000000..75fc890
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_lineedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_listbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_listbox.png
new file mode 100644
index 0000000..1c58cb6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_listbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_listview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_listview.png
new file mode 100644
index 0000000..d71cc1c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_listview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_multilineedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_multilineedit.png
new file mode 100644
index 0000000..26f7ef0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_multilineedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_newform.png b/tqtinterface/qt4/tools/designer/designer/images/designer_newform.png
new file mode 100644
index 0000000..37779c1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_newform.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_no.png b/tqtinterface/qt4/tools/designer/designer/images/designer_no.png
new file mode 100644
index 0000000..8bacc04
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_no.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_object.png b/tqtinterface/qt4/tools/designer/designer/images/designer_object.png
new file mode 100644
index 0000000..cc4192e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_object.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_ordertool.png b/tqtinterface/qt4/tools/designer/designer/images/designer_ordertool.png
new file mode 100644
index 0000000..ad12283
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_ordertool.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_pixlabel.png b/tqtinterface/qt4/tools/designer/designer/images/designer_pixlabel.png
new file mode 100644
index 0000000..0d54d63
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_pixlabel.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_pointer.png b/tqtinterface/qt4/tools/designer/designer/images/designer_pointer.png
new file mode 100644
index 0000000..67e38a3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_pointer.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_print.png b/tqtinterface/qt4/tools/designer/designer/images/designer_print.png
new file mode 100644
index 0000000..57e3e53
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_print.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_progress.png b/tqtinterface/qt4/tools/designer/designer/images/designer_progress.png
new file mode 100644
index 0000000..44ae094
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_progress.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_project.png b/tqtinterface/qt4/tools/designer/designer/images/designer_project.png
new file mode 100644
index 0000000..6a0fb96
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_project.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_pushbutton.png b/tqtinterface/qt4/tools/designer/designer/images/designer_pushbutton.png
new file mode 100644
index 0000000..61f779c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_pushbutton.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_qtlogo.png b/tqtinterface/qt4/tools/designer/designer/images/designer_qtlogo.png
new file mode 100644
index 0000000..4e1a147
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_qtlogo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_radiobutton.png b/tqtinterface/qt4/tools/designer/designer/images/designer_radiobutton.png
new file mode 100644
index 0000000..10c1d8c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_radiobutton.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_redo.png b/tqtinterface/qt4/tools/designer/designer/images/designer_redo.png
new file mode 100644
index 0000000..abdad26
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_redo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_resetproperty.png b/tqtinterface/qt4/tools/designer/designer/images/designer_resetproperty.png
new file mode 100644
index 0000000..cc0d6a2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_resetproperty.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_richtextedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_richtextedit.png
new file mode 100644
index 0000000..73573a8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_richtextedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_right.png b/tqtinterface/qt4/tools/designer/designer/images/designer_right.png
new file mode 100644
index 0000000..5f2f703
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_right.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_s_down.png b/tqtinterface/qt4/tools/designer/designer/images/designer_s_down.png
new file mode 100644
index 0000000..908e55e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_s_down.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_s_editcut.png b/tqtinterface/qt4/tools/designer/designer/images/designer_s_editcut.png
new file mode 100644
index 0000000..7cf5a9e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_s_editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_s_left.png b/tqtinterface/qt4/tools/designer/designer/images/designer_s_left.png
new file mode 100644
index 0000000..e6e19f8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_s_left.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_s_right.png b/tqtinterface/qt4/tools/designer/designer/images/designer_s_right.png
new file mode 100644
index 0000000..bfccda6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_s_right.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_s_up.png b/tqtinterface/qt4/tools/designer/designer/images/designer_s_up.png
new file mode 100644
index 0000000..97705d4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_s_up.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_scrollbar.png b/tqtinterface/qt4/tools/designer/designer/images/designer_scrollbar.png
new file mode 100644
index 0000000..466c58d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_scrollbar.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_searchfind.png b/tqtinterface/qt4/tools/designer/designer/images/designer_searchfind.png
new file mode 100644
index 0000000..3f369fd
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_searchfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_setbuddy.png b/tqtinterface/qt4/tools/designer/designer/images/designer_setbuddy.png
new file mode 100644
index 0000000..5ae9e1a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_setbuddy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_sizeall.png b/tqtinterface/qt4/tools/designer/designer/images/designer_sizeall.png
new file mode 100644
index 0000000..fa2a266
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_sizeall.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_sizeb.png b/tqtinterface/qt4/tools/designer/designer/images/designer_sizeb.png
new file mode 100644
index 0000000..ac5235b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_sizeb.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_sizef.png b/tqtinterface/qt4/tools/designer/designer/images/designer_sizef.png
new file mode 100644
index 0000000..28a30c2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_sizef.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_sizeh.png b/tqtinterface/qt4/tools/designer/designer/images/designer_sizeh.png
new file mode 100644
index 0000000..7b8abd3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_sizeh.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_sizev.png b/tqtinterface/qt4/tools/designer/designer/images/designer_sizev.png
new file mode 100644
index 0000000..80b3d8b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_sizev.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_slider.png b/tqtinterface/qt4/tools/designer/designer/images/designer_slider.png
new file mode 100644
index 0000000..525bd1c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_slider.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_spacer.png b/tqtinterface/qt4/tools/designer/designer/images/designer_spacer.png
new file mode 100644
index 0000000..926e8af
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_spacer.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_spinbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_spinbox.png
new file mode 100644
index 0000000..7ae2063
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_spinbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_splash.png b/tqtinterface/qt4/tools/designer/designer/images/designer_splash.png
new file mode 100644
index 0000000..d3b62a1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_splash.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_table.png b/tqtinterface/qt4/tools/designer/designer/images/designer_table.png
new file mode 100644
index 0000000..4bbd9c2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_table.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_tabwidget.png b/tqtinterface/qt4/tools/designer/designer/images/designer_tabwidget.png
new file mode 100644
index 0000000..1254bb6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_tabwidget.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textbold.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textbold.png
new file mode 100644
index 0000000..7b5be47
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textbold.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textbrowser.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textbrowser.png
new file mode 100644
index 0000000..090e2f8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textbrowser.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textcenter.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textcenter.png
new file mode 100644
index 0000000..5c68b09
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textcenter.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textedit.png
new file mode 100644
index 0000000..4cdff14
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textfont.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textfont.png
new file mode 100644
index 0000000..a4de87a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textfont.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_texth1.png b/tqtinterface/qt4/tools/designer/designer/images/designer_texth1.png
new file mode 100644
index 0000000..1c3aa2f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_texth1.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_texth2.png b/tqtinterface/qt4/tools/designer/designer/images/designer_texth2.png
new file mode 100644
index 0000000..b3a02af
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_texth2.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_texth3.png b/tqtinterface/qt4/tools/designer/designer/images/designer_texth3.png
new file mode 100644
index 0000000..c02ea26
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_texth3.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textitalic.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textitalic.png
new file mode 100644
index 0000000..68e2b44
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textitalic.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textjustify.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textjustify.png
new file mode 100644
index 0000000..1c6e5b9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textjustify.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textlarger.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textlarger.png
new file mode 100644
index 0000000..20282b6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textlarger.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textleft.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textleft.png
new file mode 100644
index 0000000..30b0501
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textleft.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textlinebreak.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textlinebreak.png
new file mode 100644
index 0000000..081a49e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textlinebreak.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textparagraph.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textparagraph.png
new file mode 100644
index 0000000..dcd0b3e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textparagraph.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textright.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textright.png
new file mode 100644
index 0000000..73f1cad
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textright.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textsmaller.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textsmaller.png
new file mode 100644
index 0000000..acf2577
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textsmaller.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textteletext.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textteletext.png
new file mode 100644
index 0000000..c020463
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textteletext.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textunderline.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textunderline.png
new file mode 100644
index 0000000..3477ccb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textunderline.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_textview.png b/tqtinterface/qt4/tools/designer/designer/images/designer_textview.png
new file mode 100644
index 0000000..ec2270c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_textview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_timeedit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_timeedit.png
new file mode 100644
index 0000000..01b3788
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_timeedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_toolbox.png b/tqtinterface/qt4/tools/designer/designer/images/designer_toolbox.png
new file mode 100644
index 0000000..2ab71dc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_toolbox.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_toolbutton.png b/tqtinterface/qt4/tools/designer/designer/images/designer_toolbutton.png
new file mode 100644
index 0000000..49921a1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_toolbutton.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_undo.png b/tqtinterface/qt4/tools/designer/designer/images/designer_undo.png
new file mode 100644
index 0000000..839a823
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_undo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_up.png b/tqtinterface/qt4/tools/designer/designer/images/designer_up.png
new file mode 100644
index 0000000..e437312
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_up.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_uparrow.png b/tqtinterface/qt4/tools/designer/designer/images/designer_uparrow.png
new file mode 100644
index 0000000..eefe4a0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_uparrow.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_vsplit.png b/tqtinterface/qt4/tools/designer/designer/images/designer_vsplit.png
new file mode 100644
index 0000000..b820c19
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_vsplit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_wait.png b/tqtinterface/qt4/tools/designer/designer/images/designer_wait.png
new file mode 100644
index 0000000..5d8cfed
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_wait.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_widgetstack.png b/tqtinterface/qt4/tools/designer/designer/images/designer_widgetstack.png
new file mode 100644
index 0000000..c326de8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_widgetstack.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_wizarddata.png b/tqtinterface/qt4/tools/designer/designer/images/designer_wizarddata.png
new file mode 100644
index 0000000..9493e3b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_wizarddata.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_wizarddialog.png b/tqtinterface/qt4/tools/designer/designer/images/designer_wizarddialog.png
new file mode 100644
index 0000000..a22dc88
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_wizarddialog.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/images/designer_wordwrap.png b/tqtinterface/qt4/tools/designer/designer/images/designer_wordwrap.png
new file mode 100644
index 0000000..29513c3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/images/designer_wordwrap.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/designer/layout.cpp b/tqtinterface/qt4/tools/designer/designer/layout.cpp
new file mode 100644
index 0000000..acb6766
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/layout.cpp
@@ -0,0 +1,1024 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "formwindow.h"
+#include "tqlayout.h"
+#include <widgetdatabase.h>
+#include "widgetfactory.h"
+
+#include <tqlayout.h>
+#include <tqevent.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqbitmap.h>
+#include <tqsplitter.h>
+#include <tqvaluevector.h>
+#include <tqmainwindow.h>
+
+bool operator<( const TQGuardedPtr<TQWidget> &p1, const TQGuardedPtr<TQWidget> &p2 )
+{
+ return p1.operator->() < p2.operator->();
+}
+
+/*!
+ \class Layout qlayout.h
+ \brief Baseclass for layouting widgets in the Designer
+
+ Classes derived from this abstract base class are used for layouting
+ operations in the Designer.
+
+*/
+
+/*! \a p specifies the tqparent of the layoutBase \a lb. The tqparent
+ might be changed in setup(). If the layoutBase is a
+ container, the tqparent and the layoutBase are the same. Also they
+ always have to be a widget known to the designer (e.g. in the case
+ of the tabwidget tqparent and layoutBase are the tabwidget and not the
+ page which actually gets laid out. For actual usage the correct
+ widget is found later by Layout.)
+ */
+
+Layout::Layout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup, bool splitter )
+ : widgets( wl ), tqparent( p ), formWindow( fw ), isBreak( !doSetup ), useSplitter( splitter )
+{
+ widgets.setAutoDelete( FALSE );
+ layoutBase = lb;
+ if ( !doSetup && layoutBase )
+ oldGeometry = layoutBase->tqgeometry();
+}
+
+/*! The widget list we got in the constructor might contain too much
+ widgets (like widgets with different parents, already laid out
+ widgets, etc.). Here we set up the list and so the only the "best"
+ widgets get laid out.
+*/
+
+void Layout::setup()
+{
+ startPoint = TQPoint( 32767, 32767 );
+ TQValueList<TQWidgetList> lists;
+ TQWidget *lastParent = 0;
+ TQWidgetList *lastList = 0;
+ TQWidget *w = 0;
+
+ // Go through all widgets of the list we got. As we can only
+ // tqlayout widgets which have the same tqparent, we first do some
+ // sorting which means create a list for each tqparent containing
+ // its child here. After that we keep working on the list of
+ // childs which has the most entries.
+ // Widgets which are already laid out are thrown away here too
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ continue;
+ if ( lastParent != w->parentWidget() ) {
+ lastList = 0;
+ lastParent = w->parentWidget();
+ TQValueList<TQWidgetList>::Iterator it = lists.begin();
+ for ( ; it != lists.end(); ++it ) {
+ if ( ( *it ).first()->parentWidget() == w->parentWidget() )
+ lastList = &( *it );
+ }
+ if ( !lastList ) {
+ TQWidgetList l;
+ l.setAutoDelete( FALSE );
+ lists.append( l );
+ lastList = &lists.last();
+ }
+ }
+ lastList->append( w );
+ }
+
+ // So, now tqfind the list with the most entries
+ lastList = 0;
+ TQValueList<TQWidgetList>::Iterator it = lists.begin();
+ for ( ; it != lists.end(); ++it ) {
+ if ( !lastList || ( *it ).count() > lastList->count() )
+ lastList = &( *it );
+ }
+
+ // If we found no list (because no widget did fit at all) or the
+ // best list has only one entry and we do not tqlayout a container,
+ // we leave here.
+ if ( !lastList || ( lastList->count() < 2 &&
+ ( !layoutBase ||
+ ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) &&
+ layoutBase != formWindow->mainContainer() ) )
+ ) ) {
+ widgets.clear();
+ startPoint = TQPoint( 0, 0 );
+ return;
+ }
+
+ // Now we have a new and clean widget list, which makes sense
+ // to tqlayout
+ widgets = *lastList;
+ // Also use the only correct tqparent later, so store it
+ tqparent = WidgetFactory::widgetOfContainer( widgets.first()->parentWidget() );
+ // Now calculate the position where the tqlayout-meta-widget should
+ // be placed and connect to widgetDestroyed() Q_SIGNALS of the
+ // widgets to get informed if one gets deleted to be able to
+ // handle that and do not crash in this case
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ connect( w, TQT_SIGNAL( destroyed() ),
+ this, TQT_SLOT( widgetDestroyed() ) );
+ startPoint = TQPoint( TQMIN( startPoint.x(), w->x() ),
+ TQMIN( startPoint.y(), w->y() ) );
+ geometries.insert( w, TQRect( w->pos(), w->size() ) );
+ // Change the Z-order, as saving/loading uses the Z-order for
+ // writing/creating widgets and this has to be the same as in
+ // the layout. Else saving + loading will give different results
+ w->raise();
+ }
+}
+
+void Layout::widgetDestroyed()
+{
+ if ( sender() && sender()->isWidgetType() )
+ widgets.removeRef( (TQWidget*)sender() );
+}
+
+bool Layout::prepareLayout( bool &needMove, bool &needRetqparent )
+{
+ if ( !widgets.count() )
+ return FALSE;
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() )
+ w->raise();
+ needMove = !layoutBase;
+ needRetqparent = needMove || ::tqqt_cast<TQLayoutWidget*>(layoutBase) || ::tqqt_cast<TQSplitter*>(layoutBase);
+ if ( !layoutBase ) {
+ if ( !useSplitter )
+ layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQLayoutWidget" ),
+ WidgetFactory::containerOfWidget( tqparent ) );
+ else
+ layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQSplitter" ),
+ WidgetFactory::containerOfWidget( tqparent ) );
+ } else {
+ WidgetFactory::deleteLayout( layoutBase );
+ }
+
+ return TRUE;
+}
+
+void Layout::finishLayout( bool needMove, TQLayout *tqlayout )
+{
+ if ( needMove )
+ layoutBase->move( startPoint );
+ TQRect g( TQRect( layoutBase->pos(), layoutBase->size() ) );
+ if ( WidgetFactory::layoutType( layoutBase->parentWidget() ) == WidgetFactory::NoLayout && !isBreak )
+ layoutBase->adjustSize();
+ else if ( isBreak )
+ layoutBase->setGeometry( oldGeometry );
+ oldGeometry = g;
+ layoutBase->show();
+ tqlayout->activate();
+ formWindow->insertWidget( layoutBase );
+ formWindow->selectWidget( layoutBase );
+ TQString n = layoutBase->name();
+ if ( n.tqfind( "qt_dead_widget_" ) != -1 ) {
+ n.remove( 0, TQString( "qt_dead_widget_" ).length() );
+ layoutBase->setName( n );
+ }
+}
+
+void Layout::undoLayout()
+{
+ if ( !widgets.count() )
+ return;
+ TQMap<TQGuardedPtr<TQWidget>, TQRect>::Iterator it = geometries.begin();
+ for ( ; it != geometries.end(); ++it ) {
+ if ( !it.key() )
+ continue;
+ it.key()->reparent( WidgetFactory::containerOfWidget( tqparent ), 0, ( *it ).topLeft(), it.key()->isVisibleTo( formWindow ) );
+ it.key()->resize( ( *it ).size() );
+ }
+ formWindow->selectWidget( layoutBase, FALSE );
+ WidgetFactory::deleteLayout( layoutBase );
+ if ( tqparent != layoutBase && !::tqqt_cast<TQMainWindow*>(layoutBase) ) {
+ layoutBase->hide();
+ TQString n = layoutBase->name();
+ n.prepend( "qt_dead_widget_" );
+ layoutBase->setName( n );
+ } else {
+ layoutBase->setGeometry( oldGeometry );
+ }
+ if ( widgets.first() )
+ formWindow->selectWidget( widgets.first() );
+ else
+ formWindow->selectWidget( formWindow );
+}
+
+void Layout::breakLayout()
+{
+ TQMap<TQWidget*, TQRect> rects;
+ if ( !widgets.isEmpty() ) {
+ TQWidget *w;
+ for ( w = widgets.first(); w; w = widgets.next() )
+ rects.insert( w, w->tqgeometry() );
+ }
+ WidgetFactory::deleteLayout( layoutBase );
+ bool needRetqparent = qstrcmp( layoutBase->className(), "TQLayoutWidget" ) == 0 ||
+ qstrcmp( layoutBase->className(), "TQSplitter" ) == 0 ||
+ ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) &&
+ layoutBase != formWindow->mainContainer() );
+ bool needResize = qstrcmp( layoutBase->className(), "TQSplitter" ) == 0;
+ bool add = geometries.isEmpty();
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( needRetqparent )
+ w->reparent( layoutBase->parentWidget(), 0,
+ layoutBase->pos() + w->pos(), TRUE );
+ if ( needResize ) {
+ TQMap<TQWidget*, TQRect>::Iterator it = rects.tqfind( w );
+ if ( it != rects.end() )
+ w->setGeometry( TQRect( layoutBase->pos() + (*it).topLeft(), (*it).size() ) );
+ }
+ if ( add )
+ geometries.insert( w, TQRect( w->pos(), w->size() ) );
+ }
+ if ( needRetqparent ) {
+ layoutBase->hide();
+ tqparent = layoutBase->parentWidget();
+ TQString n = layoutBase->name();
+ n.prepend( "qt_dead_widget_" );
+ layoutBase->setName( n );
+ } else {
+ tqparent = layoutBase;
+ }
+ if ( widgets.first() && widgets.first()->isVisibleTo( formWindow ) )
+ formWindow->selectWidget( widgets.first() );
+ else
+ formWindow->selectWidget( formWindow );
+}
+
+class HorizontalLayoutList : public TQWidgetList
+{
+public:
+ HorizontalLayoutList( const TQWidgetList &l )
+ : TQWidgetList( l ) {}
+
+ int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) {
+ TQWidget *w1 = (TQWidget*)item1;
+ TQWidget *w2 = (TQWidget*)item2;
+ if ( w1->x() == w2->x() )
+ return 0;
+ if ( w1->x() > w2->x() )
+ return 1;
+ return -1;
+ }
+
+};
+
+HorizontalLayout::HorizontalLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup, bool splitter )
+ : Layout( wl, p, fw, lb, doSetup, splitter )
+{
+ if ( doSetup )
+ setup();
+}
+
+void HorizontalLayout::setup()
+{
+ HorizontalLayoutList l( widgets );
+ l.sort();
+ widgets = l;
+ Layout::setup();
+}
+
+void HorizontalLayout::doLayout()
+{
+ bool needMove, needRetqparent;
+ if ( !prepareLayout( needMove, needRetqparent ) )
+ return;
+
+ TQHBoxLayout *tqlayout = (TQHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox );
+
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( needRetqparent && w->tqparent() != TQT_TQOBJECT(layoutBase) )
+ w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE );
+ if ( !useSplitter ) {
+ if ( qstrcmp( w->className(), "Spacer" ) == 0 )
+ tqlayout->addWidget( w, 0, ( (Spacer*)w )->tqalignment() );
+ else
+ tqlayout->addWidget( w );
+ if ( ::tqqt_cast<TQLayoutWidget*>(w) )
+ ( (TQLayoutWidget*)w )->updateSizePolicy();
+ }
+ w->show();
+ }
+
+ if ( ::tqqt_cast<TQSplitter*>(layoutBase) )
+ ( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal );
+
+ finishLayout( needMove, tqlayout );
+}
+
+
+
+
+class VerticalLayoutList : public TQWidgetList
+{
+public:
+ VerticalLayoutList( const TQWidgetList &l )
+ : TQWidgetList( l ) {}
+
+ int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) {
+ TQWidget *w1 = (TQWidget*)item1;
+ TQWidget *w2 = (TQWidget*)item2;
+ if ( w1->y() == w2->y() )
+ return 0;
+ if ( w1->y() > w2->y() )
+ return 1;
+ return -1;
+ }
+
+};
+
+VerticalLayout::VerticalLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup, bool splitter )
+ : Layout( wl, p, fw, lb, doSetup, splitter )
+{
+ if ( doSetup )
+ setup();
+}
+
+void VerticalLayout::setup()
+{
+ VerticalLayoutList l( widgets );
+ l.sort();
+ widgets = l;
+ Layout::setup();
+}
+
+void VerticalLayout::doLayout()
+{
+ bool needMove, needRetqparent;
+ if ( !prepareLayout( needMove, needRetqparent ) )
+ return;
+
+ TQVBoxLayout *tqlayout = (TQVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox );
+
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( needRetqparent && w->tqparent() != TQT_TQOBJECT(layoutBase) )
+ w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE );
+ if ( !useSplitter ) {
+ if ( qstrcmp( w->className(), "Spacer" ) == 0 )
+ tqlayout->addWidget( w, 0, ( (Spacer*)w )->tqalignment() );
+ else
+ tqlayout->addWidget( w );
+ if ( ::tqqt_cast<TQLayoutWidget*>(w) )
+ ( (TQLayoutWidget*)w )->updateSizePolicy();
+ }
+ w->show();
+ }
+
+ if ( ::tqqt_cast<TQSplitter*>(layoutBase) )
+ ( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical );
+
+ finishLayout( needMove, tqlayout );
+}
+
+
+
+
+
+class Grid
+{
+public:
+ Grid( int rows, int cols );
+ ~Grid();
+
+ TQWidget* cell( int row, int col ) const { return cells[ row * ncols + col]; }
+ void setCell( int row, int col, TQWidget* w ) { cells[ row*ncols + col] = w; }
+ void setCells( TQRect c, TQWidget* w ) {
+ for ( int rows = c.bottom()-c.top(); rows >= 0; rows--)
+ for ( int cols = c.right()-c.left(); cols >= 0; cols--) {
+ setCell(c.top()+rows, c.left()+cols, w);
+ }
+ }
+ int numRows() const { return nrows; }
+ int numCols() const { return ncols; }
+
+ void simplify();
+ bool locateWidget( TQWidget* w, int& row, int& col, int& rowspan, int& colspan );
+
+private:
+ void merge();
+ int countRow( int r, int c ) const;
+ int countCol( int r, int c ) const;
+ void setRow( int r, int c, TQWidget* w, int count );
+ void setCol( int r, int c, TQWidget* w, int count );
+ bool isWidgetStartCol( int c ) const;
+ bool isWidgetEndCol( int c ) const;
+ bool isWidgetStartRow( int r ) const;
+ bool isWidgetEndRow( int r ) const;
+ bool isWidgetTopLeft( int r, int c ) const;
+ void extendLeft();
+ void extendRight();
+ void extendUp();
+ void extendDown();
+ TQWidget** cells;
+ bool* cols;
+ bool* rows;
+ int nrows, ncols;
+
+};
+
+Grid::Grid( int r, int c )
+ : nrows( r ), ncols( c )
+{
+ cells = new TQWidget*[ r * c ];
+ memset( cells, 0, sizeof( cells ) * r * c );
+ rows = new bool[ r ];
+ cols = new bool[ c ];
+
+}
+
+Grid::~Grid()
+{
+ delete [] cells;
+ delete [] cols;
+ delete [] rows;
+}
+
+int Grid::countRow( int r, int c ) const
+{
+ TQWidget* w = cell( r, c );
+ int i = c + 1;
+ while ( i < ncols && cell( r, i ) == w )
+ i++;
+ return i - c;
+}
+
+int Grid::countCol( int r, int c ) const
+{
+ TQWidget* w = cell( r, c );
+ int i = r + 1;
+ while ( i < nrows && cell( i, c ) == w )
+ i++;
+ return i - r;
+}
+
+void Grid::setCol( int r, int c, TQWidget* w, int count )
+{
+ for (int i = 0; i < count; i++ )
+ setCell( r + i, c, w );
+}
+
+void Grid::setRow( int r, int c, TQWidget* w, int count )
+{
+ for (int i = 0; i < count; i++ )
+ setCell( r, c + i, w );
+}
+
+bool Grid::isWidgetStartCol( int c ) const
+{
+ int r;
+ for ( r = 0; r < nrows; r++ ) {
+ if ( cell( r, c ) && ( (c==0) || (cell( r, c) != cell( r, c-1) )) ) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+bool Grid::isWidgetEndCol( int c ) const
+{
+ int r;
+ for ( r = 0; r < nrows; r++ ) {
+ if ( cell( r, c ) && ((c == ncols-1) || (cell( r, c) != cell( r, c+1) )) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool Grid::isWidgetStartRow( int r ) const
+{
+ int c;
+ for ( c = 0; c < ncols; c++ ) {
+ if ( cell( r, c ) && ( (r==0) || (cell( r, c) != cell( r-1, c) )) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool Grid::isWidgetEndRow( int r ) const
+{
+ int c;
+ for ( c = 0; c < ncols; c++ ) {
+ if ( cell( r, c ) && ((r == nrows-1) || (cell( r, c) != cell( r+1, c) )) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+bool Grid::isWidgetTopLeft( int r, int c ) const
+{
+ TQWidget* w = cell( r, c );
+ if ( !w )
+ return FALSE;
+ return ( !r || cell( r-1, c) != w ) && (!c || cell( r, c-1) != w);
+}
+
+void Grid::extendLeft()
+{
+ int r,c,i;
+ for ( c = 1; c < ncols; c++ ) {
+ for ( r = 0; r < nrows; r++ ) {
+ TQWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cc = countCol( r, c);
+ int stretch = 0;
+ for ( i = c-1; i >= 0; i-- ) {
+ if ( cell( r, i ) )
+ break;
+ if ( countCol( r, i ) < cc )
+ break;
+ if ( isWidgetEndCol( i ) )
+ break;
+ if ( isWidgetStartCol( i ) ) {
+ stretch = c - i;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setCol( r, c-i-1, w, cc );
+ }
+ }
+ }
+}
+
+
+void Grid::extendRight()
+{
+ int r,c,i;
+ for ( c = ncols - 2; c >= 0; c-- ) {
+ for ( r = 0; r < nrows; r++ ) {
+ TQWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cc = countCol( r, c);
+ int stretch = 0;
+ for ( i = c+1; i < ncols; i++ ) {
+ if ( cell( r, i ) )
+ break;
+ if ( countCol( r, i ) < cc )
+ break;
+ if ( isWidgetStartCol( i ) )
+ break;
+ if ( isWidgetEndCol( i ) ) {
+ stretch = i - c;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setCol( r, c+i+1, w, cc );
+ }
+ }
+ }
+
+}
+
+void Grid::extendUp()
+{
+ int r,c,i;
+ for ( r = 1; r < nrows; r++ ) {
+ for ( c = 0; c < ncols; c++ ) {
+ TQWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cr = countRow( r, c);
+ int stretch = 0;
+ for ( i = r-1; i >= 0; i-- ) {
+ if ( cell( i, c ) )
+ break;
+ if ( countRow( i, c ) < cr )
+ break;
+ if ( isWidgetEndRow( i ) )
+ break;
+ if ( isWidgetStartRow( i ) ) {
+ stretch = r - i;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setRow( r-i-1, c, w, cr );
+ }
+ }
+ }
+}
+
+void Grid::extendDown()
+{
+ int r,c,i;
+ for ( r = nrows - 2; r >= 0; r-- ) {
+ for ( c = 0; c < ncols; c++ ) {
+ TQWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cr = countRow( r, c);
+ int stretch = 0;
+ for ( i = r+1; i < nrows; i++ ) {
+ if ( cell( i, c ) )
+ break;
+ if ( countRow( i, c ) < cr )
+ break;
+ if ( isWidgetStartRow( i ) )
+ break;
+ if ( isWidgetEndRow( i ) ) {
+ stretch = i - r;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setRow( r+i+1, c, w, cr );
+ }
+ }
+ }
+
+}
+
+void Grid::simplify()
+{
+ extendLeft();
+ extendRight();
+ extendUp();
+ extendDown();
+ merge();
+}
+
+
+void Grid::merge()
+{
+ int r,c;
+ for ( c = 0; c < ncols; c++ )
+ cols[c] = FALSE;
+
+ for ( r = 0; r < nrows; r++ )
+ rows[r] = FALSE;
+
+ for ( c = 0; c < ncols; c++ ) {
+ for ( r = 0; r < nrows; r++ ) {
+ if ( isWidgetTopLeft( r, c ) ) {
+ rows[r] = TRUE;
+ cols[c] = TRUE;
+ }
+ }
+ }
+}
+
+bool Grid::locateWidget( TQWidget* w, int& row, int& col, int& rowspan, int & colspan )
+{
+ int r,c, r2, c2;
+ for ( c = 0; c < ncols; c++ ) {
+ for ( r = 0; r < nrows; r++ ) {
+ if ( cell( r, c ) == w ) {
+ row = 0;
+ for ( r2 = 1; r2 <= r; r2++ ) {
+ if ( rows[ r2-1 ] )
+ row++;
+ }
+ col = 0;
+ for ( c2 = 1; c2 <= c; c2++ ) {
+ if ( cols[ c2-1 ] )
+ col++;
+ }
+ rowspan = 0;
+ for ( r2 = r ; r2 < nrows && cell( r2, c) == w; r2++ ) {
+ if ( rows[ r2 ] )
+ rowspan++;
+ }
+ colspan = 0;
+ for ( c2 = c; c2 < ncols && cell( r, c2) == w; c2++ ) {
+ if ( cols[ c2] )
+ colspan++;
+ }
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+
+
+
+GridLayout::GridLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, const TQSize &res, bool doSetup )
+ : Layout( wl, p, fw, lb, doSetup ), resolution( res )
+{
+ grid = 0;
+ if ( doSetup )
+ setup();
+}
+
+GridLayout::~GridLayout()
+{
+ delete grid;
+}
+
+void GridLayout::doLayout()
+{
+ bool needMove, needRetqparent;
+ if ( !prepareLayout( needMove, needRetqparent ) )
+ return;
+
+ TQDesignerGridLayout *tqlayout = (TQDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid );
+
+ if ( !grid )
+ buildGrid();
+
+ TQWidget* w;
+ int r, c, rs, cs;
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ if ( grid->locateWidget( w, r, c, rs, cs) ) {
+ if ( needRetqparent && w->tqparent() != TQT_TQOBJECT(layoutBase) )
+ w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE );
+ if ( rs * cs == 1 ) {
+ tqlayout->addWidget( w, r, c, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->tqalignment() : 0 );
+ } else {
+ tqlayout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::tqqt_cast<Spacer*>(w) ? ( (Spacer*)w )->tqalignment() : 0 );
+ }
+ if ( ::tqqt_cast<TQLayoutWidget*>(w) )
+ ( (TQLayoutWidget*)w )->updateSizePolicy();
+ w->show();
+ } else {
+ qWarning("ooops, widget '%s' does not fit in tqlayout", w->name() );
+ }
+ }
+ finishLayout( needMove, TQT_TQLAYOUT(tqlayout) );
+}
+
+void GridLayout::setup()
+{
+ Layout::setup();
+ buildGrid();
+}
+
+void GridLayout::buildGrid()
+{
+ if ( !widgets.count() )
+ return;
+
+ // Pixel to cell conversion:
+ // By keeping a list of start'n'stop values (x & y) for each widget,
+ // it is possible to create a very small grid of cells to represent
+ // the widget layout.
+ // -----------------------------------------------------------------
+
+ // We need a list of both start and stop values for x- & y-axis
+ TQValueVector<int> x( widgets.count()*2 );
+ TQValueVector<int> y( widgets.count()*2 );
+
+ // Using push_back would look nicer, but operator[] is much faster
+ int index = 0;
+ TQWidget* w = 0;
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ TQRect widgetPos = w->tqgeometry();
+ x[index] = widgetPos.left();
+ x[index+1] = widgetPos.right();
+ y[index] = widgetPos.top();
+ y[index+1] = widgetPos.bottom();
+ index += 2;
+ }
+
+ qHeapSort(x);
+ qHeapSort(y);
+
+ // Remove duplicate x enteries (Remove next, if equal to current)
+ if ( !x.empty() ) {
+ for (TQValueVector<int>::iterator current = x.begin() ;
+ (current != x.end()) && ((current+1) != x.end()) ; )
+ if ( (*current == *(current+1)) )
+ x.erase(current+1);
+ else
+ current++;
+ }
+
+ // Remove duplicate y enteries (Remove next, if equal to current)
+ if ( !y.empty() ) {
+ for (TQValueVector<int>::iterator current = y.begin() ;
+ (current != y.end()) && ((current+1) != y.end()) ; )
+ if ( (*current == *(current+1)) )
+ y.erase(current+1);
+ else
+ current++;
+ }
+
+ // Create the smallest grid possible to represent the current tqlayout
+ // Since no widget will be placed in the last row and column, we'll
+ // skip them to increase speed even further
+ delete grid;
+ grid = new Grid( (int)(y.size()-1), (int)(x.size()-1) );
+
+ // Mark the cells in the grid that tqcontains a widget
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ TQRect c(0,0,0,0), widgetPos = w->tqgeometry();
+ // From left til right (not including)
+ for (uint cw=0; cw<x.size(); cw++) {
+ if ( x[cw] == widgetPos.left() )
+ c.setLeft(cw);
+ if ( x[cw] < widgetPos.right())
+ c.setRight(cw);
+ }
+ // From top til bottom (not including)
+ for (uint ch=0; ch<y.size(); ch++) {
+ if ( y[ch] == widgetPos.top() )
+ c.setTop(ch);
+ if ( y[ch] < widgetPos.bottom() )
+ c.setBottom(ch);
+ }
+ grid->setCells(c, w); // Mark cellblock
+ }
+ grid->simplify();
+}
+
+
+
+
+
+
+
+Spacer::Spacer( TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name, TQt::WMouseNoMask ),
+ orient( Qt::Vertical ), interactive(TRUE), sh( TQSize(20,20) )
+{
+ setSizeType( Expanding );
+ setAutoMask( TRUE );
+}
+
+void Spacer::paintEvent( TQPaintEvent * )
+{
+ TQPainter p( this );
+ p.setPen( TQt::blue );
+
+ if ( orient == Qt::Horizontal ) {
+ const int dist = 3;
+ const int amplitude = TQMIN( 3, height() / 3 );
+ const int base = height() / 2;
+ int i = 0;
+ p.setPen( Qt::white );
+ for ( i = 0; i < width() / 3 +2; ++i )
+ p.drawLine( i * dist, base - amplitude, i * dist + dist / 2, base + amplitude );
+ p.setPen( Qt::blue );
+ for ( i = 0; i < width() / 3 +2; ++i )
+ p.drawLine( i * dist + dist / 2, base + amplitude, i * dist + dist, base - amplitude );
+ p.drawLine( 0, 0, 0, height() );
+ p.drawLine( width() - 1, 0, width() - 1, height());
+ } else {
+ const int dist = 3;
+ const int amplitude = TQMIN( 3, width() / 3 );
+ const int base = width() / 2;
+ int i = 0;
+ p.setPen( Qt::white );
+ for ( i = 0; i < height() / 3 +2; ++i )
+ p.drawLine( base - amplitude, i * dist, base + amplitude,i * dist + dist / 2 );
+ p.setPen( Qt::blue );
+ for ( i = 0; i < height() / 3 +2; ++i )
+ p.drawLine( base + amplitude, i * dist + dist / 2, base - amplitude, i * dist + dist );
+ p.drawLine( 0, 0, width(), 0 );
+ p.drawLine( 0, height() - 1, width(), height() - 1 );
+ }
+}
+
+void Spacer::resizeEvent( TQResizeEvent* e)
+{
+ TQWidget::resizeEvent( e );
+ if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
+ sh = size();
+}
+
+void Spacer::updateMask()
+{
+ TQRegion r( rect() );
+ if ( orient == Qt::Horizontal ) {
+ const int amplitude = TQMIN( 3, height() / 3 );
+ const int base = height() / 2;
+ r = r.subtract( TQRect(1, 0, width() - 2, base - amplitude ) );
+ r = r.subtract( TQRect(1, base + amplitude, width() - 2, height() - base - amplitude ) );
+ } else {
+ const int amplitude = TQMIN( 3, width() / 3 );
+ const int base = width() / 2;
+ r = r.subtract( TQRect(0, 1, base - amplitude, height() - 2 ) );
+ r = r.subtract( TQRect( base + amplitude, 1, width() - base - amplitude, height() - 2 ) );
+ }
+ setMask( r );
+}
+
+void Spacer::setSizeType( SizeType t )
+{
+ TQSizePolicy sizeP;
+ if ( orient == Qt::Vertical )
+ sizeP = TQSizePolicy( TQSizePolicy::Minimum, (TQSizePolicy::SizeType)t );
+ else
+ sizeP = TQSizePolicy( (TQSizePolicy::SizeType)t, TQSizePolicy::Minimum );
+ tqsetSizePolicy( sizeP );
+}
+
+
+Spacer::SizeType Spacer::sizeType() const
+{
+ if ( orient == Qt::Vertical )
+ return (SizeType)tqsizePolicy().verData();
+ return (SizeType)tqsizePolicy().horData();
+}
+
+int Spacer::tqalignment() const
+{
+ if ( orient == Qt::Vertical )
+ return TQt::AlignHCenter;
+ return TQt::AlignVCenter;
+}
+
+TQSize Spacer::tqminimumSize() const
+{
+ TQSize s = TQSize( 20,20 );
+ if ( sizeType() == Expanding )
+ if ( orient == Qt::Vertical )
+ s.rheight() = 0;
+ else
+ s.rwidth() = 0;
+ return s;
+}
+
+TQSize Spacer::tqsizeHint() const
+{
+ return sh;
+}
+
+
+void Spacer::setSizeHint( const TQSize &s )
+{
+ sh = s;
+ if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
+ resize( tqsizeHint() );
+ updateGeometry();
+}
+
+Qt::Orientation Spacer::orientation() const
+{
+ return orient;
+}
+
+void Spacer::setOrientation( Qt::Orientation o )
+{
+ if ( orient == o )
+ return;
+
+ SizeType st = sizeType();
+ orient = o;
+ setSizeType( st );
+ if ( interactive ) {
+ sh = TQSize( sh.height(), sh.width() );
+ if (!parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
+ resize( height(), width() );
+ }
+ updateMask();
+ update();
+ updateGeometry();
+}
+
+
+void TQDesignerGridLayout::addWidget( TQWidget *w, int row, int col, int align_ )
+{
+ items.insert( w, Item(row, col, 1, 1) );
+ TQGridLayout::addWidget( w, row, col, (Qt::AlignmentFlag)align_ );
+}
+
+void TQDesignerGridLayout::addMultiCellWidget( TQWidget *w, int fromRow, int toRow,
+ int fromCol, int toCol, int align_ )
+{
+ items.insert( w, Item(fromRow, fromCol, toRow - fromRow + 1, toCol - fromCol +1) );
+ TQGridLayout::addMultiCellWidget( w, fromRow, toRow, fromCol, toCol, (Qt::AlignmentFlag)align_ );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/layout.h b/tqtinterface/qt4/tools/designer/designer/layout.h
new file mode 100644
index 0000000..3b07fcc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/layout.h
@@ -0,0 +1,198 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LAYOUT_H
+#define LAYOUT_H
+
+#include <tqwidget.h>
+#include <tqmap.h>
+#include <tqguardedptr.h>
+#include <tqobject.h>
+#include <tqlayout.h>
+#include <tqmap.h>
+#include <tqwidgetlist.h>
+
+class FormWindow;
+class TQPaintEvent;
+
+class Layout : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ Layout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup = TRUE, bool splitter = FALSE );
+ virtual ~Layout() {}
+
+ virtual void doLayout() = 0;
+ virtual void undoLayout();
+ virtual void breakLayout();
+ virtual bool prepareLayout( bool &needMove, bool &needRetqparent );
+ virtual void finishLayout( bool needMove, TQLayout *tqlayout );
+
+protected:
+ TQWidgetList widgets;
+ TQWidget *tqparent;
+ TQPoint startPoint;
+ TQMap<TQGuardedPtr<TQWidget>, TQRect> geometries;
+ TQWidget *layoutBase;
+ FormWindow *formWindow;
+ TQRect oldGeometry;
+ bool isBreak;
+ bool useSplitter;
+
+protected:
+ virtual void setup();
+
+protected Q_SLOTS:
+ void widgetDestroyed();
+
+};
+
+class HorizontalLayout : public Layout
+{
+public:
+ HorizontalLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup = TRUE, bool splitter = FALSE );
+
+ void doLayout();
+
+protected:
+ void setup();
+
+};
+
+class VerticalLayout : public Layout
+{
+public:
+ VerticalLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup = TRUE, bool splitter = FALSE );
+
+ void doLayout();
+
+protected:
+ void setup();
+
+};
+
+class Grid;
+
+class GridLayout : public Layout
+{
+public:
+ GridLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, const TQSize &res, bool doSetup = TRUE );
+ ~GridLayout();
+
+ void doLayout();
+
+protected:
+ void setup();
+
+protected:
+ void buildGrid();
+ TQSize resolution;
+ Grid* grid;
+
+};
+
+class Spacer : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+ TQ_OVERRIDE( TQCString name )
+ Q_PROPERTY( Qt::Orientation orientation READ orientation WRITE setOrientation )
+ TQ_ENUMS( SizeType )
+ Q_PROPERTY( SizeType sizeType READ sizeType WRITE setSizeType )
+ Q_PROPERTY( TQSize tqsizeHint READ tqsizeHint WRITE setSizeHint DESIGNABLE true STORED true )
+ TQ_OVERRIDE( TQRect tqgeometry DESIGNABLE false )
+
+private:
+ enum { HSize = 6, HMask = 0x3f, VMask = HMask << HSize,
+ MayGrow = 1, ExpMask = 2, MayShrink = 4 };
+
+public:
+ enum SizeType { Fixed = 0,
+ Minimum = MayGrow,
+ Maximum = MayShrink,
+ Preferred = MayGrow|MayShrink ,
+ MinimumExpanding = Minimum|ExpMask,
+ Expanding = MinimumExpanding|MayShrink };
+
+ Spacer( TQWidget *tqparent, const char *name );
+
+ TQSize tqminimumSize() const;
+ TQSize tqsizeHint() const;
+ void setSizeType( SizeType t );
+ SizeType sizeType() const;
+ int tqalignment() const;
+ Qt::Orientation orientation() const;
+ void setOrientation( Qt::Orientation o );
+ void setInteraciveMode( bool b ) { interactive = b; };
+ void setSizeHint( const TQSize &s );
+
+protected:
+ void paintEvent( TQPaintEvent *e );
+ void resizeEvent( TQResizeEvent* e );
+ void updateMask();
+ Qt::Orientation orient;
+ bool interactive;
+ TQSize sh;
+};
+
+class TQDesignerGridLayout : public TQGridLayout
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ TQDesignerGridLayout( TQWidget *tqparent ) : TQGridLayout( tqparent ){};
+ TQDesignerGridLayout( TQLayout *parentLayout ) : TQGridLayout( parentLayout ){};
+
+ void addWidget( TQWidget *, int row, int col, int align = 0 );
+ void addMultiCellWidget( TQWidget *, int fromRow, int toRow,
+ int fromCol, int toCol, int align = 0 );
+
+ struct Item
+ {
+ Item(): row(0), column(0),rowspan(1),colspan(1){}
+ Item( int r, int c, int rs, int cs): row(r), column(c), rowspan(rs), colspan(cs){}
+ int row;
+ int column;
+ int rowspan;
+ int colspan;
+ TQ_DUMMY_COMPARISON_OPERATOR( Item )
+ };
+
+ TQMap<TQWidget*, Item> items;
+};
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/listboxdnd.cpp b/tqtinterface/qt4/tools/designer/designer/listboxdnd.cpp
new file mode 100644
index 0000000..191ea34
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listboxdnd.cpp
@@ -0,0 +1,312 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "listboxdnd.h"
+#include <tqwidget.h>
+#include <tqheader.h>
+#include <tqpainter.h>
+#include <tqdragobject.h>
+#include <tqvaluelist.h>
+
+// The Dragobject Declaration ---------------------------------------
+class ListBoxItemDrag : public TQStoredDrag
+{
+public:
+ ListBoxItemDrag( ListBoxItemList & items, bool sendPtr = FALSE, TQListBox * tqparent = 0, const char * name = 0 );
+ ~ListBoxItemDrag() {};
+ static bool canDecode( TQDragMoveEvent * event );
+ static bool decode( TQDropEvent * event, TQListBox * tqparent, TQListBoxItem * insertPoint );
+ enum ItemType { ListBoxText = 1, ListBoxPixmap = 2 };
+};
+// ------------------------------------------------------------------
+
+ListBoxDnd::ListBoxDnd( TQListBox * eventSource, const char * name )
+ : ListDnd( eventSource, name ) { }
+
+void ListBoxDnd::confirmDrop( TQListBoxItem * )
+{
+ dropConfirmed = TRUE;
+}
+
+bool ListBoxDnd::dropEvent( TQDropEvent * event )
+{
+ if ( dragInside ) {
+
+ if ( dMode & NullDrop ) { // combined with Move, a NullDrop will delete an item
+ event->accept();
+ emit dropped( 0 ); // a NullDrop
+ return TRUE;
+ }
+
+ TQPoint pos = event->pos();
+ TQListBoxItem * after = itemAt( pos );
+
+ if ( ListBoxItemDrag::decode( event, (TQListBox *) src, after ) ) {
+ event->accept();
+ TQListBox * src = (TQListBox *) this->src;
+ TQListBoxItem * item = ( after ? after->next() : src->firstItem() );
+ src->setCurrentItem( item );
+ emit dropped( item ); // ###FIX: Supports only one item!
+ }
+ }
+
+ line->hide();
+ dragInside = FALSE;
+
+ return TRUE;
+}
+
+bool ListBoxDnd::mouseMoveEvent( TQMouseEvent * event )
+{
+ if ( event->state() & Qt::LeftButton ) {
+ if ( ( event->pos() - mousePressPos ).manhattanLength() > 3 ) {
+
+ ListBoxItemList list;
+ buildList( list );
+ ListBoxItemDrag * dragobject = new ListBoxItemDrag( list, (dMode & Internal), (TQListBox *) src );
+
+ // Emit signal for all dragged items
+ TQListBoxItem * i = list.first();
+ while ( i ) {
+ emit dragged( i );
+ i = list.next();
+ }
+
+ if ( dMode & Move ) {
+ removeList( list ); // "hide" items
+ }
+
+ dragobject->dragCopy();
+
+ if ( dMode & Move ) {
+ if ( dropConfirmed ) {
+ // ###FIX: memleak ? in internal mode, only pointers are transfered...
+ //list.setAutoDelete( TRUE );
+ list.clear();
+ dropConfirmed = FALSE;
+ }
+ insertList( list ); // "show" items
+ }
+ }
+ }
+ return FALSE;
+}
+
+int ListBoxDnd::buildList( ListBoxItemList & list )
+{
+ TQListBoxItem * i = ((TQListBox *)src)->firstItem();
+ while ( i ) {
+ if ( i->isSelected() ) {
+ ((TQListBox *)src)->setSelected( i, FALSE );
+ list.append( i );
+ }
+ i = i->next();
+ }
+ return list.count();
+}
+
+void ListBoxDnd::insertList( ListBoxItemList & list )
+{
+ TQListBoxItem * i = list.first();
+ while ( i ) {
+ ((TQListBox *)src)->insertItem( i, i->prev() );
+ i = list.next();
+ }
+}
+
+void ListBoxDnd::removeList( ListBoxItemList & list )
+{
+ TQListBoxItem * i = list.first();
+ while ( i ) {
+ ((TQListBox *)src)->takeItem( i ); // remove item from TQListBox
+ i = list.next();
+ }
+}
+
+void ListBoxDnd::updateLine( const TQPoint & dragPos )
+{
+ TQListBox * src = (TQListBox *) this->src;
+ TQListBoxItem *item = itemAt( dragPos );
+
+ int ypos = item ?
+ ( src->tqitemRect( item ).bottom() - ( line->height() / 2 ) ) :
+ ( src->tqitemRect( ((TQListBox *)src)->firstItem() ).top() );
+
+ line->resize( src->viewport()->width(), line->height() );
+ line->move( 0, ypos );
+}
+
+TQListBoxItem * ListBoxDnd::itemAt( TQPoint pos )
+{
+ TQListBox * src = (TQListBox *) this->src;
+ TQListBoxItem * result = src->itemAt( pos );
+ TQListBoxItem * last = src->item( src->count() - 1 );
+ int i = src->index( result );
+
+ if ( result && ( pos.y() < (src->tqitemRect(result).top() + src->itemHeight(i)/2) ) )
+ result = result->prev();
+ else if ( !result && pos.y() > src->tqitemRect( last ).bottom() )
+ result = last;
+
+ return result;
+}
+
+bool ListBoxDnd::canDecode( TQDragEnterEvent * event )
+{
+ return ListBoxItemDrag::canDecode( event );
+}
+
+
+// ------------------------------------------------------------------
+// The Dragobject Implementation ------------------------------------
+// ------------------------------------------------------------------
+
+ListBoxItemDrag::ListBoxItemDrag( ListBoxItemList & items, bool sendPtr, TQListBox * tqparent, const char * name )
+ : TQStoredDrag( "qt/listboxitem", tqparent, name )
+{
+ // ### FIX!
+ TQByteArray data( sizeof( TQ_INT32 ) + sizeof( TQListBoxItem ) * items.count() );
+ TQDataStream stream( data, IO_WriteOnly );
+
+ stream << items.count();
+ stream << (TQ_UINT8) sendPtr; // just transfer item pointer; omit data
+
+ TQListBoxItem * i = items.first();
+
+ if ( sendPtr ) {
+
+ while ( i ) {
+
+ stream << (TQ_ULONG) i; //###FIX: demands sizeof(ulong) >= sizeof(void*)
+ i = items.next();
+
+ }
+
+ } else {
+
+ while ( i ) {
+
+ TQ_UINT8 b = 0;
+
+ b = (TQ_UINT8) ( i->text() != TQString() ); // does item have text ?
+ stream << b;
+ if ( b ) {
+ stream << i->text();
+ }
+
+ b = (TQ_UINT8) ( !!i->pixmap() ); // does item have a pixmap ?
+ stream << b;
+ if ( b ) {
+ stream << ( *i->pixmap() );
+ }
+
+ stream << (TQ_UINT8) i->isSelectable();
+
+ i = items.next();
+ }
+
+ }
+
+ setEncodedData( data );
+}
+
+bool ListBoxItemDrag::canDecode( TQDragMoveEvent * event )
+{
+ return event->provides( "qt/listboxitem" );
+}
+
+bool ListBoxItemDrag::decode( TQDropEvent * event, TQListBox * tqparent, TQListBoxItem * after )
+{
+ TQByteArray data = event->tqencodedData( "qt/listboxitem" );
+
+ if ( data.size() ) {
+ event->accept();
+ TQDataStream stream( data, IO_ReadOnly );
+
+ int count = 0;
+ stream >> count;
+
+ TQ_UINT8 recievePtr = 0; // data tqcontains just item pointers; no data
+ stream >> recievePtr;
+
+ TQListBoxItem * item = 0;
+
+ if ( recievePtr ) {
+
+ for( int i = 0; i < count; i++ ) {
+
+ TQ_ULONG p = 0; //###FIX: demands sizeof(ulong) >= sizeof(void*)
+ stream >> p;
+ item = (TQListBoxItem *) p;
+
+ tqparent->insertItem( item, after );
+
+ }
+
+ } else {
+
+ for ( int i = 0; i < count; i++ ) {
+
+ TQ_UINT8 hasText = 0;
+ TQString text;
+ stream >> hasText;
+ if ( hasText ) {
+ stream >> text;
+ }
+
+ TQ_UINT8 hasPixmap = 0;
+ TQPixmap pixmap;
+ stream >> hasPixmap;
+ if ( hasPixmap ) {
+ stream >> pixmap;
+ }
+
+ TQ_UINT8 isSelectable = 0;
+ stream >> isSelectable;
+
+ if ( hasPixmap ) {
+ item = new TQListBoxPixmap( tqparent, pixmap, text, after );
+ } else {
+ item = new TQListBoxText( tqparent, text, after );
+ }
+
+ item->setSelectable( isSelectable );
+
+ }
+
+ }
+
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/listboxdnd.h b/tqtinterface/qt4/tools/designer/designer/listboxdnd.h
new file mode 100644
index 0000000..a337413
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listboxdnd.h
@@ -0,0 +1,71 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LISTBOXDND_H
+#define LISTBOXDND_H
+
+#include <tqptrlist.h>
+#include <tqlistbox.h>
+#include "listdnd.h"
+
+typedef TQPtrList<TQListBoxItem> ListBoxItemList;
+
+class ListBoxDnd : public ListDnd
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ // dragModes are enumerated in ListDnd
+ ListBoxDnd( TQListBox * eventSource, const char * name = 0 );
+
+Q_SIGNALS:
+ void dropped( TQListBoxItem * );
+ void dragged( TQListBoxItem * );
+
+public Q_SLOTS:
+ void confirmDrop( TQListBoxItem * );
+
+protected:
+ virtual bool dropEvent( TQDropEvent * event );
+ virtual bool mouseMoveEvent( TQMouseEvent * event );
+ virtual void updateLine( const TQPoint & pos );
+ virtual bool canDecode( TQDragEnterEvent * event );
+
+private:
+ TQListBoxItem * itemAt( TQPoint pos );
+ int buildList( ListBoxItemList & list );
+ void insertList( ListBoxItemList & list );
+ void removeList( ListBoxItemList & list );
+};
+
+#endif //LISTBOXDND_H
diff --git a/tqtinterface/qt4/tools/designer/designer/listboxeditor.ui b/tqtinterface/qt4/tools/designer/designer/listboxeditor.ui
new file mode 100644
index 0000000..78e06c5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listboxeditor.ui
@@ -0,0 +1,461 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ListBoxEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ListBoxEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>482</width>
+ <height>229</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Listbox</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Listbox&lt;/b&gt;&lt;p&gt;Add, edit or delete items in the listbox.&lt;/p&gt;&lt;p&gt;Click the &lt;b&gt;New Item&lt;/b&gt;-button to create a new listbox entry, then enter text and choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and click the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>preview</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Item list</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of items.</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox" row="0" column="2" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Item Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>itemPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>itemDeletePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_editcut.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item's pixmap.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a pixmap file for the selected item.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemText</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>itemText</cstring>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Change the selected item's text.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>itemNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add an item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new item.&lt;/b&gt;&lt;p&gt;New items are appended to the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>itemDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>itemUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_up.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Moves the selected item up.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>itemDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_down.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Move the selected item down.</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>itemNew</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>insertNewItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>deleteCurrentItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemText</sender>
+ <signal>textChanged( const QString &amp; )</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>currentTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>choosePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>itemDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>deletePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>itemUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>moveItemUp()</slot>
+ </connection>
+ <connection>
+ <sender>itemDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>moveItemDown()</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>selectionChanged(TQListBoxItem*)</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>currentItemChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>currentChanged( TQListBoxItem * )</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>currentItemChanged(TQListBoxItem*)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>preview</tabstop>
+ <tabstop>itemNew</tabstop>
+ <tabstop>itemDelete</tabstop>
+ <tabstop>itemUp</tabstop>
+ <tabstop>itemDown</tabstop>
+ <tabstop>itemText</tabstop>
+ <tabstop>itemDeletePixmap</tabstop>
+ <tabstop>itemChoosePixmap</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>buttonApply</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">insertNewItem()</slot>
+ <slot access="protected">deleteCurrentItem()</slot>
+ <slot access="protected">currentItemChanged( TQListBoxItem * )</slot>
+ <slot access="protected">currentTextChanged( const QString &amp; )</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">cancelClicked()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">choosePixmap()</slot>
+ <slot access="protected">deletePixmap()</slot>
+ <slot access="protected">moveItemUp()</slot>
+ <slot access="protected">moveItemDown()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.cpp
new file mode 100644
index 0000000..b88ca18
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.cpp
@@ -0,0 +1,250 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "listboxeditorimpl.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "pixmapchooser.h"
+#include "command.h"
+#include "listboxdnd.h"
+#include "listboxrename.h"
+
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+#include <tqcheckbox.h>
+
+ListBoxEditor::ListBoxEditor( TQWidget *tqparent, TQWidget *editWidget, FormWindow *fw )
+ : ListBoxEditorBase( tqparent, 0, TRUE ), formwindow( fw )
+{
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ listbox = (TQListBox*)editWidget;
+
+ itemText->setText( "" );
+ itemText->setEnabled( FALSE );
+ itemPixmap->setText( "" );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+
+ TQListBoxItem *i = 0;
+ for ( i = listbox->firstItem(); i; i = i->next() ) {
+ if ( i->pixmap() )
+ (void)new TQListBoxPixmap( preview, *i->pixmap(), i->text() );
+ else
+ (void)new TQListBoxText( preview, i->text() );
+ }
+
+ if ( preview->firstItem() )
+ preview->setCurrentItem( preview->firstItem() );
+
+ ListBoxDnd *editorDnd = new ListBoxDnd( preview );
+ editorDnd->setDragMode( ListBoxDnd::Internal | ListBoxDnd::Move );
+ TQObject::connect( editorDnd, TQT_SIGNAL( dropped( TQListBoxItem * ) ),
+ editorDnd, TQT_SLOT( confirmDrop( TQListBoxItem * ) ) );
+
+ ListBoxRename *editorRename = new ListBoxRename( preview );
+
+ TQObjectList *l = tqparent->queryList( "TQLineEdit", "itemText" );
+ TQObjectListIt it( *l );
+ TQObject *obj;
+ while ( (obj = it.current()) != 0 ) {
+ ++it;
+ TQObject::connect( editorRename,
+ TQT_SIGNAL( itemTextChanged( const TQString & ) ),
+ obj,
+ TQT_SLOT( setText( const TQString & ) ) );
+ }
+ delete l;
+
+}
+
+void ListBoxEditor::insertNewItem()
+{
+ TQListBoxItem *i = new TQListBoxText( preview, tr("New Item") );
+ preview->setCurrentItem( i );
+ preview->setSelected( i, TRUE );
+ itemText->setFocus();
+ itemText->selectAll();
+}
+
+void ListBoxEditor::deleteCurrentItem()
+{
+ delete preview->item( preview->currentItem() );
+ if ( preview->currentItem() != -1 )
+ preview->setSelected( preview->currentItem(), TRUE );
+}
+
+void ListBoxEditor::currentItemChanged( TQListBoxItem *i )
+{
+ itemText->blockSignals( TRUE );
+ itemText->setText( "" );
+ itemPixmap->setText( "" );
+ itemText->blockSignals( FALSE );
+
+ if ( !i ) {
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ return;
+ }
+
+ itemText->blockSignals( TRUE );
+ itemText->setEnabled( TRUE );
+ itemChoosePixmap->setEnabled( TRUE );
+ itemDeletePixmap->setEnabled( i->pixmap() && !i->pixmap()->isNull() );
+
+ itemText->setText( i->text() );
+ if ( i->pixmap() )
+ itemPixmap->setPixmap( *i->pixmap() );
+ itemText->blockSignals( FALSE );
+}
+
+void ListBoxEditor::currentTextChanged( const TQString &txt )
+{
+ if ( preview->currentItem() == -1 )
+ return;
+
+ preview->blockSignals( TRUE );
+ if ( preview->item( preview->currentItem() )->pixmap() )
+ preview->changeItem( *preview->item( preview->currentItem() )->pixmap(), txt, preview->currentItem() );
+ else
+ preview->changeItem( txt, preview->currentItem() );
+ preview->blockSignals( FALSE );
+}
+
+void ListBoxEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void ListBoxEditor::cancelClicked()
+{
+ reject();
+}
+
+void ListBoxEditor::applyClicked()
+{
+ TQListBoxItem *i = 0;
+ TQValueList<PopulateListBoxCommand::Item> items;
+ for ( i = preview->firstItem(); i; i = i->next() ) {
+ PopulateListBoxCommand::Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ items.append( item );
+ }
+
+ PopulateListBoxCommand *cmd = new PopulateListBoxCommand( tr( "Edit the Items of '%1'" ).arg( listbox->name() ),
+ formwindow, listbox, items );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void ListBoxEditor::choosePixmap()
+{
+ if ( preview->currentItem() == -1 )
+ return;
+
+ TQPixmap pix;
+ if ( preview->item( preview->currentItem() )->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *preview->item( preview->currentItem() )->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, TQPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ TQString txt = preview->item( preview->currentItem() )->text();
+ preview->changeItem( pix, txt, preview->currentItem() );
+ itemDeletePixmap->setEnabled( TRUE );
+}
+
+void ListBoxEditor::moveItemUp()
+{
+ if ( preview->currentItem() < 1 )
+ return;
+
+ TQListBoxItem *i = preview->item( preview->currentItem() );
+ bool hasPix = (i->pixmap() != 0);
+ TQPixmap pix;
+ if ( hasPix )
+ pix = *i->pixmap();
+ TQString txt = i->text();
+
+ TQListBoxItem *p = i->prev();
+ if ( p->pixmap() )
+ preview->changeItem( *p->pixmap(), p->text(), preview->currentItem() );
+ else
+ preview->changeItem( p->text(), preview->currentItem() );
+
+ if ( hasPix )
+ preview->changeItem( pix, txt, preview->currentItem() - 1 );
+ else
+ preview->changeItem( txt, preview->currentItem() - 1 );
+}
+
+void ListBoxEditor::moveItemDown()
+{
+ if ( preview->currentItem() == -1 || preview->currentItem() > (int)preview->count() - 2 )
+ return;
+
+ TQListBoxItem *i = preview->item( preview->currentItem() );
+ bool hasPix = (i->pixmap() != 0);
+ TQPixmap pix;
+ if ( hasPix )
+ pix = *i->pixmap();
+ TQString txt = i->text();
+
+ TQListBoxItem *n = i->next();
+ if ( n->pixmap() )
+ preview->changeItem( *n->pixmap(), n->text(), preview->currentItem() );
+ else
+ preview->changeItem( n->text(), preview->currentItem() );
+
+ if ( hasPix )
+ preview->changeItem( pix, txt, preview->currentItem() + 1 );
+ else
+ preview->changeItem( txt, preview->currentItem() + 1 );
+}
+
+void ListBoxEditor::deletePixmap()
+{
+ if ( preview->currentItem() == -1 )
+ return;
+
+ TQListBoxItem *i = preview->item( preview->currentItem() );
+ preview->changeItem( i->text(), preview->currentItem() );
+ itemDeletePixmap->setEnabled( FALSE );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.h b/tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.h
new file mode 100644
index 0000000..69a5ec1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listboxeditorimpl.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LISTBOXEDITORIMPL_H
+#define LISTBOXEDITORIMPL_H
+
+class TQListBox;
+class FormWindow;
+
+#include "listboxeditor.h"
+
+class ListBoxEditor : public ListBoxEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ListBoxEditor( TQWidget *tqparent, TQWidget *editWidget, FormWindow *fw );
+
+protected Q_SLOTS:
+ void insertNewItem();
+ void deleteCurrentItem();
+ void currentItemChanged( TQListBoxItem * );
+ void currentTextChanged( const TQString & );
+ void okClicked();
+ void cancelClicked();
+ void applyClicked();
+ void choosePixmap();
+ void moveItemUp();
+ void moveItemDown();
+ void deletePixmap();
+
+private:
+ TQListBox *listbox;
+ FormWindow *formwindow;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/listboxrename.cpp b/tqtinterface/qt4/tools/designer/designer/listboxrename.cpp
new file mode 100644
index 0000000..421fda2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listboxrename.cpp
@@ -0,0 +1,164 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqheader.h>
+#include <tqlineedit.h>
+#include <tqtimer.h>
+#include "listboxrename.h"
+
+class EditableListBoxItem : public TQListBoxItem
+{
+public:
+ void setText( const TQString & text )
+ {
+ TQListBoxItem::setText( text );
+ }
+};
+
+ListBoxRename::ListBoxRename( TQListBox * eventSource, const char * name )
+ : TQObject( eventSource, name ),
+ clickedItem( 0 ), activity( FALSE )
+{
+ src = eventSource;
+ src->installEventFilter( this );
+ ed = new TQLineEdit( src->viewport() );
+ ed->hide();
+ ed->setFrame( FALSE );
+
+ TQObject::connect( ed, TQT_SIGNAL( returnPressed() ),
+ this, TQT_SLOT( renameClickedItem() ) );
+}
+
+bool ListBoxRename::eventFilter( TQObject *, TQEvent * event )
+{
+ switch ( event->type() ) {
+
+ case TQEvent::MouseButtonPress:
+ {
+ TQPoint pos = ((TQMouseEvent *) event)->pos();
+
+ if ( clickedItem &&
+ clickedItem->isSelected() &&
+ (clickedItem == src->itemAt( pos )) ) {
+ TQTimer::singleShot( 500, this, TQT_SLOT( showLineEdit() ) );
+ activity = FALSE; // no drags or clicks for 500 ms before we start the renaming
+ } else { // new item clicked
+ activity = TRUE;
+ clickedItem = src->itemAt( pos );
+ ed->hide();
+ }
+ }
+ break;
+
+ case TQEvent::MouseMove:
+
+ if ( ((TQMouseEvent *) event)->state() & Qt::LeftButton ) {
+ activity = TRUE; // drag
+ }
+ break;
+
+ case TQEvent::KeyPress:
+
+ switch ( ((TQKeyEvent *) event)->key() ) {
+
+ case TQt::Key_F2:
+
+ activity = FALSE;
+ clickedItem = src->item( src->currentItem() );
+ showLineEdit();
+ break;
+
+ case Key_Escape:
+ if ( !ed->isHidden() ) {
+ hideLineEdit(); // abort rename
+ return TRUE;
+ }
+ break;
+
+ case TQt::Key_Up:
+ case TQt::Key_Down:
+ case TQt::Key_PageUp:
+ case TQt::Key_PageDown:
+
+ if ( !ed->isHidden() )
+ return TRUE; // Filter out the keystrokes
+ break;
+
+ }
+ break;
+
+ case TQEvent::Resize:
+
+ if ( clickedItem && ed && !ed->isHidden() ) {
+ TQRect rect = src->tqitemRect( clickedItem );
+ ed->resize( rect.right() - rect.left() - 1,
+ rect.bottom() - rect.top() - 1 );
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+void ListBoxRename::showLineEdit()
+{
+ if ( !clickedItem || activity )
+ return;
+ TQRect rect = src->tqitemRect( clickedItem );
+ ed->resize( rect.right() - rect.left() - 1,
+ rect.bottom() - rect.top() - 1 );
+ ed->move( rect.left() + 1, rect.top() + 1 );
+ ed->setText( clickedItem->text() );
+ ed->selectAll();
+ ed->show();
+ ed->setFocus();
+}
+
+void ListBoxRename::hideLineEdit()
+{
+ ed->hide();
+ clickedItem = 0;
+ src->setFocus();
+}
+
+void ListBoxRename::renameClickedItem()
+{
+ if ( clickedItem && ed ) {
+ ( (EditableListBoxItem *) clickedItem )->setText( ed->text() );
+ emit itemTextChanged( ed->text() );
+ }
+ hideLineEdit();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/listboxrename.h b/tqtinterface/qt4/tools/designer/designer/listboxrename.h
new file mode 100644
index 0000000..417e6a4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listboxrename.h
@@ -0,0 +1,65 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LISTBOXRENAME_H
+#define LISTBOXRENAME_H
+
+#include <tqobject.h>
+#include <tqlistbox.h>
+
+class TQLineEdit;
+
+class ListBoxRename : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ ListBoxRename( TQListBox * eventSource, const char * name = 0 );
+ bool eventFilter( TQObject *, TQEvent * event );
+
+Q_SIGNALS:
+ void itemTextChanged( const TQString & );
+
+public Q_SLOTS:
+ void showLineEdit();
+ void hideLineEdit();
+ void renameClickedItem();
+
+private:
+ TQListBoxItem * clickedItem;
+ TQListBox * src;
+ TQLineEdit * ed;
+ bool activity;
+};
+
+#endif //LISTBOXRENAME_H
diff --git a/tqtinterface/qt4/tools/designer/designer/listdnd.cpp b/tqtinterface/qt4/tools/designer/designer/listdnd.cpp
new file mode 100644
index 0000000..dfc010d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listdnd.cpp
@@ -0,0 +1,149 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "listdnd.h"
+#include <tqwidget.h>
+#include <tqpainter.h>
+
+ListDnd::ListDnd( TQScrollView * eventSource, const char * name )
+ : TQObject( eventSource, name ),
+ dragInside( FALSE ), dragDelete( TRUE ), dropConfirmed( FALSE ), dMode( Both )
+{
+ src = eventSource;
+ src->setAcceptDrops( TRUE );
+ src->installEventFilter( this );
+ src->viewport()->installEventFilter( this );
+
+ line = new TQWidget( src->viewport(), 0, (WFlags)(TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop) );
+ line->setBackgroundColor( TQt::black );
+ line->resize( src->viewport()->width(), 2 );
+ line->hide();
+}
+
+void ListDnd::setDragMode( int mode )
+{
+ dMode = mode;
+}
+
+int ListDnd::dragMode() const
+{
+ return dMode;
+}
+
+bool ListDnd::eventFilter( TQObject *, TQEvent * event )
+{
+ switch ( event->type() ) {
+ case TQEvent::DragEnter:
+ return dragEnterEvent( (TQDragEnterEvent *) event );
+ case TQEvent::DragLeave:
+ return dragLeaveEvent( (TQDragLeaveEvent *) event );
+ case TQEvent::DragMove:
+ return dragMoveEvent( (TQDragMoveEvent *) event );
+ case TQEvent::Drop:
+ return dropEvent( (TQDropEvent *) event );
+ case TQEvent::MouseButtonPress:
+ return mousePressEvent( (TQMouseEvent *) event );
+ case TQEvent::MouseMove:
+ return mouseMoveEvent( (TQMouseEvent *) event );
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+bool ListDnd::dragEnterEvent( TQDragEnterEvent * event )
+{
+ if ( dMode == None ) {
+ return TRUE;
+ }
+
+ bool ok = ( ( ( dMode & Both ) == Both ) ||
+ ( ( dMode & Internal ) && ( event->source() == src ) ) ||
+ ( ( dMode & External ) && ( event->source() != src ) ) );
+
+ if ( ok && canDecode( event ) ) {
+ event->accept();
+ dragInside = TRUE;
+ if ( !( dMode & NullDrop ) ) {
+ updateLine( event->pos() );
+ line->show();
+ }
+ }
+ return TRUE;
+}
+
+bool ListDnd::dragLeaveEvent( TQDragLeaveEvent * )
+{
+ dragInside = FALSE;
+ line->hide();
+ return TRUE;
+}
+
+bool ListDnd::dragMoveEvent( TQDragMoveEvent * event )
+{
+ if ( dragInside && dMode && !( dMode & NullDrop ) ) {
+ updateLine( event->pos() );
+ }
+ return TRUE;
+}
+
+bool ListDnd::dropEvent( TQDropEvent * )
+{
+ // do nothing
+ return FALSE;
+}
+
+bool ListDnd::mousePressEvent( TQMouseEvent * event )
+{
+ if ( event->button() == Qt::LeftButton )
+ mousePressPos = event->pos();
+ return FALSE;
+}
+
+bool ListDnd::mouseMoveEvent( TQMouseEvent * )
+{
+ // do nothing
+ return FALSE;
+}
+
+void ListDnd::updateLine( const TQPoint & )
+{
+ // do nothing
+}
+
+bool ListDnd::canDecode( TQDragEnterEvent * )
+{
+ // do nothing
+ return FALSE;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/listdnd.h b/tqtinterface/qt4/tools/designer/designer/listdnd.h
new file mode 100644
index 0000000..a464255
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listdnd.h
@@ -0,0 +1,70 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LISTDND_H
+#define LISTDND_H
+
+#include <tqobject.h>
+#include <tqscrollview.h>
+
+class ListDnd : public TQObject
+{
+ TQ_OBJECT
+public:
+ enum DragMode { None = 0, External = 1, Internal = 2, Both = 3, Move = 4, NullDrop = 8 };
+ ListDnd( TQScrollView * eventSource, const char * name = 0 );
+ void setDragMode( int mode );
+ int dragMode() const;
+ bool eventFilter( TQObject *, TQEvent * event );
+
+protected:
+ virtual bool dragEnterEvent( TQDragEnterEvent * event );
+ virtual bool dragLeaveEvent( TQDragLeaveEvent * );
+ virtual bool dragMoveEvent( TQDragMoveEvent * event );
+ virtual bool dropEvent( TQDropEvent * event );
+ virtual bool mousePressEvent( TQMouseEvent * event );
+ virtual bool mouseMoveEvent( TQMouseEvent * event );
+ virtual void updateLine( const TQPoint & dragPos );
+ virtual bool canDecode( TQDragEnterEvent * event );
+
+ TQScrollView * src;
+ TQWidget * line;
+ TQPoint mousePressPos;
+ TQPoint dragPos;
+ bool dragInside;
+ bool dragDelete;
+ bool dropConfirmed;
+ int dMode;
+};
+
+#endif // LISTDND_H
diff --git a/tqtinterface/qt4/tools/designer/designer/listeditor.ui b/tqtinterface/qt4/tools/designer/designer/listeditor.ui
new file mode 100644
index 0000000..f1e3d2a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listeditor.ui
@@ -0,0 +1,182 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ListEditor</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ListEditor</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>331</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit...</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListView" row="0" column="0" rowspan="5" colspan="1">
+ <column>
+ <property name="text">
+ <string>Column 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listview</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Extended</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;name</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>PushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>addItem()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>removeItems()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>listview</sender>
+ <signal>itemRenamed(TQListViewItem*,int)</signal>
+ <receiver>ListEditor</receiver>
+ <slot>renamed(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>renameItem()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">listeditor.ui.h</include>
+</includes>
+<forwards>
+ <forward>class QStringList;</forward>
+</forwards>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>setList( const TQStringList &amp; l )</slot>
+ <slot>addItem()</slot>
+ <slot>renamed( TQListViewItem * i )</slot>
+ <slot>removeItems()</slot>
+ <slot returnType="TQStringList">items()</slot>
+ <slot>renameItem()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/listeditor.ui.h b/tqtinterface/qt4/tools/designer/designer/listeditor.ui.h
new file mode 100644
index 0000000..d1631ce
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listeditor.ui.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename Q_SLOTS use TQt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include <tqheader.h>
+#include <tqapplication.h>
+
+void ListEditor::init()
+{
+ listview->header()->hide();
+ listview->setSorting( -1 );
+ listview->setDefaultRenameAction( TQListView::Accept );
+}
+
+void ListEditor::setList( const TQStringList &l )
+{
+ TQListViewItem *i = 0;
+ for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) {
+ i = new TQListViewItem( listview, i );
+ i->setText( 0, *it );
+ i->setRenameEnabled( 0, TRUE );
+ }
+}
+
+void ListEditor::addItem()
+{
+ TQListViewItem *i = new TQListViewItem( listview, listview->lastItem() );
+ i->setRenameEnabled( 0, TRUE );
+ tqApp->processEvents();
+ i->startRename( 0 );
+}
+
+void ListEditor::renamed( TQListViewItem *i )
+{
+ if ( i && i->text( 0 ).isEmpty() )
+ i->startRename( 0 );
+}
+
+void ListEditor::removeItems()
+{
+ TQListViewItemIterator it( listview );
+ TQListViewItem *i = 0;
+ while ( ( i = it.current() ) ) {
+ ++it;
+ if ( i->isSelected() )
+ delete i;
+ }
+}
+
+TQStringList ListEditor::items()
+{
+ TQStringList l;
+ TQListViewItemIterator it( listview );
+ TQListViewItem *i = 0;
+ while ( ( i = it.current() ) ) {
+ ++it;
+ if ( !i->text( 0 ).isEmpty() )
+ l << i->text( 0 );
+ }
+ return l;
+}
+
+void ListEditor::renameItem()
+{
+ TQListViewItem *i = listview->currentItem();
+ if ( i )
+ i->startRename( 0 );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/listviewdnd.cpp b/tqtinterface/qt4/tools/designer/designer/listviewdnd.cpp
new file mode 100644
index 0000000..f283dd7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listviewdnd.cpp
@@ -0,0 +1,439 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "listviewdnd.h"
+#include <tqwidget.h>
+#include <tqheader.h>
+#include <tqpainter.h>
+#include <tqdragobject.h>
+#include <tqvaluelist.h>
+
+// The Dragobject Declaration ---------------------------------------
+class ListViewItemDrag : public TQStoredDrag
+{
+public:
+ enum DropRelation { Sibling, Child };
+ ListViewItemDrag( ListViewItemList & items, TQWidget * tqparent = 0, const char * name = 0 );
+ ~ListViewItemDrag() {};
+ static bool canDecode( TQDragMoveEvent * event );
+ static bool decode( TQDropEvent * event, TQListView * tqparent, TQListViewItem * insertPoint, DropRelation dr );
+};
+// ------------------------------------------------------------------
+
+ListViewDnd::ListViewDnd( TQListView * eventSource, const char * name )
+ : ListDnd( eventSource, name ) { }
+
+void ListViewDnd::confirmDrop( TQListViewItem * )
+{
+ dropConfirmed = TRUE;
+}
+
+bool ListViewDnd::dropEvent( TQDropEvent * event )
+{
+ if ( dragInside ) {
+
+ if ( dMode & NullDrop ) { // combined with Move, a NullDrop will delete an item
+ event->accept();
+ emit dropped( 0 ); // a NullDrop
+ return TRUE;
+ }
+
+ TQPoint pos = event->pos();
+
+ ListViewItemDrag::DropRelation dr = ListViewItemDrag::Sibling;
+ TQListViewItem *item = itemAt( pos );
+ int dpos = dropDepth( item, pos );
+
+ if ( item ) {
+ if ( dpos > item->depth() && !(dMode & Flat) ) {
+ // Child node
+ dr = ListViewItemDrag::Child;
+ } else if ( dpos < item->depth() ) {
+ // Parent(s) Sibling
+ while ( item && (item->depth() > dpos) )
+ item = item->tqparent();
+ }
+ }
+
+ if ( ListViewItemDrag::decode( event, (TQListView *) src, item, dr ) ) {
+ event->accept();
+ emit dropped( 0 ); // Use ID instead of item?
+ }
+ }
+
+ line->hide();
+ dragInside = FALSE;
+
+ return TRUE;
+}
+
+bool ListViewDnd::mouseMoveEvent( TQMouseEvent * event )
+{
+ if ( event->state() & Qt::LeftButton ) {
+ if ( ( event->pos() - mousePressPos ).manhattanLength() > 3 ) {
+ ListViewItemList list;
+
+ if ( dMode & Flat )
+ buildFlatList( list );
+ else
+ buildTreeList( list );
+
+ ListViewItemDrag * dragobject = new ListViewItemDrag( list, (TQListView *) src );
+
+ if ( dMode & Move ) {
+ disabledItems = list;
+ tqsetVisibleItems( FALSE );
+ }
+
+ dragobject->dragCopy();
+
+ if ( dMode & Move ) {
+ // Did the target accept the drop?
+ if ( dropConfirmed ) {
+ // Shouldn't autoDelete handle this?
+ for( list.first(); list.current(); list.next() )
+ delete list.current();
+ dropConfirmed = FALSE;
+ } else {
+ // Reenable disabled items since
+ // drag'n'drop was aborted
+ tqsetVisibleItems( TRUE );
+ }
+ disabledItems.clear();
+ }
+ }
+ }
+ return FALSE;
+}
+
+int ListViewDnd::buildFlatList( ListViewItemList & list )
+{
+ bool addKids = FALSE;
+ TQListViewItem *nextSibling = 0;
+ TQListViewItem *nextParent = 0;
+ TQListViewItemIterator it = ((TQListView *)src)->firstChild();
+ for ( ; *it; it++ ) {
+ // Hit the nextSibling, turn of child processing
+ if ( (*it) == nextSibling )
+ addKids = FALSE;
+
+ if ( (*it)->isSelected() ) {
+ if ( (*it)->childCount() == 0 ) {
+ // Selected, no tqchildren
+ list.append( *it );
+ } else if ( !addKids ) {
+ // Children processing not set, so set it
+ // Also tqfind the item were we shall quit
+ // processing tqchildren...if any such item
+ addKids = TRUE;
+ nextSibling = (*it)->nextSibling();
+ nextParent = (*it)->tqparent();
+ while ( nextParent && !nextSibling ) {
+ nextSibling = nextParent->nextSibling();
+ nextParent = nextParent->tqparent();
+ }
+ }
+ } else if ( ((*it)->childCount() == 0) && addKids ) {
+ // Leaf node, and we _do_ process tqchildren
+ list.append( *it );
+ }
+ }
+ return list.count();
+}
+
+int ListViewDnd::buildTreeList( ListViewItemList & list )
+{
+ TQListViewItemIterator it = ((TQListView *)src)->firstChild();
+ for ( ; *it; it++ ) {
+ if ( (*it)->isSelected() )
+ list.append( *it );
+ }
+ return list.count();
+}
+
+void ListViewDnd::tqsetVisibleItems( bool b )
+{
+ if ( disabledItems.isEmpty() )
+ return;
+
+ disabledItems.first();
+ do {
+ disabledItems.current()->tqsetVisible( b );
+ } while ( disabledItems.next() );
+}
+
+void ListViewDnd::updateLine( const TQPoint & dragPos )
+{
+ TQListViewItem * item = itemAt(dragPos);
+ TQListView * src = (TQListView *) this->src;
+
+ int ypos = item ?
+ ( src->tqitemRect( item ).bottom() - ( line->height() / 2 ) ) :
+ ( src->tqitemRect( src->firstChild() ).top() );
+
+ int xpos = dropDepth( item, dragPos ) * src->treeStepSize();
+ line->resize( src->viewport()->width() - xpos, line->height() );
+ line->move( xpos, ypos );
+}
+
+TQListViewItem * ListViewDnd::itemAt( TQPoint pos )
+{
+ TQListView * src = (TQListView *) this->src;
+ int headerHeight = (int)(src->header()->height());
+ pos.ry() -= headerHeight;
+ TQListViewItem * result = src->itemAt( pos );
+
+ if ( result && ( pos.ry() < (src->itemPos(result) + result->height()/2) ) )
+ result = result->itemAbove();
+
+ // Wind back if has tqparent, and we're in flat mode
+ while ( result && result->tqparent() && (dMode & Flat) )
+ result = result->tqparent();
+
+ // Wind back if has tqparent, and we're in flat mode
+ while ( result && !result->isVisible() && result->tqparent() )
+ result = result->tqparent();
+
+ if ( !result && src->firstChild() && (pos.y() > src->tqitemRect(src->firstChild()).bottom()) ) {
+ result = src->lastItem();
+ if ( !result->isVisible() )
+ // Handle special case where last item is actually hidden
+ result = result->itemAbove();
+ }
+
+ return result;
+}
+
+int ListViewDnd::dropDepth( TQListViewItem * item, TQPoint pos )
+{
+ if ( !item || (dMode & Flat) )
+ return 0;
+
+ int result = 0;
+ int itemDepth = item->depth();
+ int indentSize = ((TQListView *)src)->treeStepSize();
+ int itemLeft = indentSize * itemDepth;
+ int childMargin = indentSize*2;
+ if ( pos.x() > itemLeft + childMargin ) {
+ result = itemDepth + 1;
+ } else if ( pos.x() < itemLeft ) {
+ result = pos.x() / indentSize;
+ } else {
+ result = itemDepth;
+ }
+ return result;
+}
+
+bool ListViewDnd::canDecode( TQDragEnterEvent * event )
+{
+ return ListViewItemDrag::canDecode( event );
+}
+
+// ------------------------------------------------------------------
+// The Dragobject Implementation ------------------------------------
+// ------------------------------------------------------------------
+
+TQDataStream & operator<< ( TQDataStream & stream, const TQListViewItem & item );
+TQDataStream & operator>> ( TQDataStream & stream, TQListViewItem & item );
+
+ListViewItemDrag::ListViewItemDrag( ListViewItemList & items, TQWidget * tqparent, const char * name )
+ : TQStoredDrag( "qt/listviewitem", tqparent, name )
+{
+ // ### FIX!
+ TQByteArray data( sizeof( TQ_INT32 ) + sizeof( TQListViewItem ) * items.count() );
+ TQDataStream stream( data, IO_WriteOnly );
+
+ stream << items.count();
+
+ TQListViewItem *i = items.first();
+ while ( i ) {
+ stream << *i;
+ i = items.next();
+ }
+
+ setEncodedData( data );
+}
+
+bool ListViewItemDrag::canDecode( TQDragMoveEvent * event )
+{
+ return event->provides( "qt/listviewitem" );
+}
+
+bool ListViewItemDrag::decode( TQDropEvent * event, TQListView * tqparent, TQListViewItem * insertPoint, DropRelation dr )
+{
+ TQByteArray data = event->tqencodedData( "qt/listviewitem" );
+ TQListViewItem* itemParent = insertPoint ? insertPoint->tqparent() : 0;
+
+ // Change from sibling (default) to child creation
+ if ( insertPoint && dr == Child ) {
+ itemParent = insertPoint;
+ insertPoint = 0;
+ }
+
+ if ( data.size() ) {
+ event->accept();
+ TQDataStream stream( data, IO_ReadOnly );
+
+ int count = 0;
+ stream >> count;
+
+ for( int i = 0; i < count; i++ ) {
+ if ( itemParent ) {
+ insertPoint = new TQListViewItem( itemParent, insertPoint );
+ itemParent->setOpen( TRUE );
+ } else { // No tqparent for insertPoint, use TQListView
+ insertPoint = new TQListViewItem( tqparent, insertPoint );
+ }
+ stream >> *insertPoint;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+TQDataStream & operator<< ( TQDataStream & stream, const TQListViewItem & item )
+{
+ int columns = item.listView()->columns();
+ stream << columns;
+
+ TQ_UINT8 b = 0;
+
+ int i;
+ for ( i = 0; i < columns; i++ ) {
+ b = (TQ_UINT8) ( item.text( i ) != TQString() ); // does column i have a string ?
+ stream << b;
+ if ( b ) {
+ stream << item.text( i );
+ }
+ }
+
+ for ( i = 0; i < columns; i++ ) {
+ b = (TQ_UINT8) ( !!item.pixmap( i ) ); // does column i have a pixmap ?
+ stream << b;
+ if ( b ) {
+ stream << ( *item.pixmap( i ) );
+ }
+ }
+
+ stream << (TQ_UINT8) item.isOpen();
+ stream << (TQ_UINT8) item.isSelectable();
+ stream << (TQ_UINT8) item.isExpandable();
+ stream << (TQ_UINT8) item.dragEnabled();
+ stream << (TQ_UINT8) item.dropEnabled();
+ stream << (TQ_UINT8) item.isVisible();
+
+ for ( i = 0; i < columns; i++ ) {
+ stream << (TQ_UINT8) item.renameEnabled( i );
+ }
+
+ stream << (TQ_UINT8) item.multiLinesEnabled();
+ stream << item.childCount();
+
+ if ( item.childCount() > 0 ) {
+ TQListViewItem * child = item.firstChild();
+ while ( child ) {
+ stream << ( *child ); // recursive call
+ child = child->nextSibling();
+ }
+ }
+
+ return stream;
+}
+
+TQDataStream & operator>> ( TQDataStream & stream, TQListViewItem & item )
+{
+ TQ_INT32 columns;
+ stream >> columns;
+
+ TQ_UINT8 b = 0;
+
+ TQString text;
+ int i;
+ for ( i = 0; i < columns; i++ ) {
+ stream >> b;
+ if ( b ) { // column i has string ?
+ stream >> text;
+ item.setText( i, text );
+ }
+ }
+
+ TQPixmap pixmap;
+ for ( i = 0; i < columns; i++ ) {
+ stream >> b; // column i has pixmap ?
+ if ( b ) {
+ stream >> pixmap;
+ item.setPixmap( i, pixmap );
+ }
+ }
+
+ stream >> b;
+ item.setOpen( b );
+
+ stream >> b;
+ item.setSelectable( b );
+
+ stream >> b;
+ item.setExpandable( b );
+
+ stream >> b;
+ item.setDragEnabled( b );
+
+ stream >> b;
+ item.setDropEnabled( b );
+
+ stream >> b;
+ item.tqsetVisible( b );
+
+ for ( i = 0; i < columns; i++ ) {
+ stream >> b;
+ item.setRenameEnabled( i, b );
+ }
+
+ stream >> b;
+ item.setMultiLinesEnabled( b );
+
+ int childCount;
+ stream >> childCount;
+
+ TQListViewItem *child = 0;
+ TQListViewItem *prevchild = 0;
+ for ( i = 0; i < childCount; i++ ) {
+ child = new TQListViewItem( &item, prevchild );
+ stream >> ( *child );
+ item.insertItem( child );
+ prevchild = child;
+ }
+
+ return stream;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/listviewdnd.h b/tqtinterface/qt4/tools/designer/designer/listviewdnd.h
new file mode 100644
index 0000000..43798d7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listviewdnd.h
@@ -0,0 +1,74 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LISTVIEWDND_H
+#define LISTVIEWDND_H
+
+#include <tqptrlist.h>
+#include <tqlistview.h>
+#include "listdnd.h"
+
+class TQWidget;
+class TQListView;
+typedef TQPtrList<TQListViewItem> ListViewItemList;
+
+class ListViewDnd : public ListDnd
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ enum DragMode { Flat = 16 }; // see ListDnd::DragMode
+
+ ListViewDnd( TQListView * eventSource, const char * name = 0 );
+
+Q_SIGNALS:
+ void dropped( TQListViewItem * );
+
+public Q_SLOTS:
+ void confirmDrop( TQListViewItem * );
+
+protected:
+ virtual bool dropEvent( TQDropEvent * event );
+ virtual bool mouseMoveEvent( TQMouseEvent * event );
+ virtual void updateLine( const TQPoint & pos );
+ virtual bool canDecode( TQDragEnterEvent * event );
+private:
+ TQListViewItem * itemAt( TQPoint pos );
+ int dropDepth( TQListViewItem * item, TQPoint pos );
+ int buildFlatList( ListViewItemList & list );
+ int buildTreeList( ListViewItemList & list );
+ void tqsetVisibleItems( bool b );
+ ListViewItemList disabledItems;
+};
+
+#endif //LISTVIEWDND_H
diff --git a/tqtinterface/qt4/tools/designer/designer/listvieweditor.ui b/tqtinterface/qt4/tools/designer/designer/listvieweditor.ui
new file mode 100644
index 0000000..049d7c7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listvieweditor.ui
@@ -0,0 +1,938 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ListViewEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ListViewEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>567</width>
+ <height>398</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Listview</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Listview&lt;/b&gt;&lt;p&gt;Use the controls on the &lt;b&gt;Items&lt;/b&gt;-tab to add, edit or delete items in the listview. Change the column configuration of the listview using the controls on the &lt;b&gt;Columns&lt;/b&gt;-tab.&lt;/p&gt;Click the &lt;b&gt;New Item&lt;/b&gt;-button to create a new item, then enter text and add a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and click the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget10</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Items</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>itemDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Deletes the selected item.&lt;/b&gt;&lt;p&gt;Any sub-items are also deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox" row="0" column="2" rowspan="8" colspan="1">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Item Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>Pi&amp;xmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemText</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>itemText</cstring>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the text of the item.&lt;/b&gt;&lt;p&gt;The text will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>itemColumn</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change column</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select the current column.&lt;/b&gt;&lt;p&gt;The item's text and pixmap will be changed for the current column&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label4</cstring>
+ </property>
+ <property name="text">
+ <string>Colu&amp;mn:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemColumn</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>itemPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>itemDeletePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_editcut.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected item's pixmap.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>itemNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add an item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Adds a new item to the list.&lt;/b&gt;&lt;p&gt;The item will be inserted at the top of the list and can be moved using the up- and down-buttons.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQListView" row="0" column="0" rowspan="8" colspan="1">
+ <property name="name">
+ <cstring>itemsPreview</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of items.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>itemNewSub</cstring>
+ </property>
+ <property name="text">
+ <string>New &amp;Subitem</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add a subitem</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Create a new sub-item for the selected item.&lt;/b&gt;&lt;p&gt;New sub-items are inserted at the top of the list of sub-items, and new levels are created automatically.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>itemUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_up.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The item will be moved within its level in the hierarchy.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>itemDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_down.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The item will be moved within its level in the hierarchy.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="6" column="1">
+ <property name="name">
+ <cstring>itemLeft</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_left.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move left</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item one level up.&lt;/b&gt;&lt;p&gt;This will also change the level of the item's sub-items.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="7" column="1">
+ <property name="name">
+ <cstring>itemRight</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_right.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move right</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item one level down.&lt;/b&gt;&lt;p&gt;This will also change the level of the item's sub-items.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget11</cstring>
+ </property>
+ <attribute name="title">
+ <string>Co&amp;lumns</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQGroupBox" row="0" column="2" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Column Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>colPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>colDeletePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_editcut.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the pixmap of the selected column.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>colChoosePixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the selected column.&lt;/b&gt;&lt;p&gt;The pixmap will be displayed in the header of the listview.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colText</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>colText</cstring>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter column text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter the text for the selected column.&lt;/b&gt;&lt;p&gt;The text will be displayed in the header of the listview.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>colClickable</cstring>
+ </property>
+ <property name="text">
+ <string>Clicka&amp;ble</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this option is checked, the selected column will react to mouse clicks on the header.</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>colResizable</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;sizable</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The column's width will be resizable if this option is checked.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>colDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Column</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete column</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Deletes the selected Column.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>colDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_down.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column in the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>colNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Column</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add a Column</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Create a new column.&lt;/b&gt;&lt;p&gt;New columns are appended at the end of (right of) the list and may be moved using the up- and down-buttons.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>colUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_up.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column in the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>colPreview</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of columns.</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>applyButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>itemNew</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemNewClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemDeleteClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemColumn</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemColChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>itemText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>itemDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemPixmapDeleted()</slot>
+ </connection>
+ <connection>
+ <sender>itemChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemPixmapChoosen()</slot>
+ </connection>
+ <connection>
+ <sender>colNew</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>newColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>deleteColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>colDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnPixmapDeleted()</slot>
+ </connection>
+ <connection>
+ <sender>colChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnPixmapChosen()</slot>
+ </connection>
+ <connection>
+ <sender>colResizable</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnResizable(bool)</slot>
+ </connection>
+ <connection>
+ <sender>colClickable</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnClickable(bool)</slot>
+ </connection>
+ <connection>
+ <sender>tabWidget</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>initTabPage(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>applyButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colPreview</sender>
+ <signal>currentChanged(TQListBoxItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentColumnChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>colPreview</sender>
+ <signal>selectionChanged(TQListBoxItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentColumnChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemsPreview</sender>
+ <signal>currentChanged(TQListViewItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentItemChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemsPreview</sender>
+ <signal>selectionChanged(TQListViewItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentItemChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemNewSub</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemNewSubClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemLeft</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemLeftClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemRight</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemRightClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>itemsPreview</tabstop>
+ <tabstop>itemNew</tabstop>
+ <tabstop>itemNewSub</tabstop>
+ <tabstop>itemDelete</tabstop>
+ <tabstop>itemUp</tabstop>
+ <tabstop>itemDown</tabstop>
+ <tabstop>itemLeft</tabstop>
+ <tabstop>itemRight</tabstop>
+ <tabstop>itemColumn</tabstop>
+ <tabstop>itemText</tabstop>
+ <tabstop>itemDeletePixmap</tabstop>
+ <tabstop>itemChoosePixmap</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>applyButton</tabstop>
+ <tabstop>colPreview</tabstop>
+ <tabstop>colNew</tabstop>
+ <tabstop>colDelete</tabstop>
+ <tabstop>colUp</tabstop>
+ <tabstop>colDown</tabstop>
+ <tabstop>colText</tabstop>
+ <tabstop>colDeletePixmap</tabstop>
+ <tabstop>colChoosePixmap</tabstop>
+ <tabstop>colClickable</tabstop>
+ <tabstop>colResizable</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">columnClickable(bool)</slot>
+ <slot access="protected">columnDownClicked()</slot>
+ <slot access="protected">columnPixmapChosen()</slot>
+ <slot access="protected">columnPixmapDeleted()</slot>
+ <slot access="protected">columnResizable(bool)</slot>
+ <slot access="protected">columnTextChanged(const QString &amp;)</slot>
+ <slot access="protected">columnUpClicked()</slot>
+ <slot access="protected">currentColumnChanged(TQListBoxItem*)</slot>
+ <slot access="protected">currentItemChanged(TQListViewItem*)</slot>
+ <slot access="protected">deleteColumnClicked()</slot>
+ <slot access="protected">initTabPage(const QString &amp;)</slot>
+ <slot access="protected">itemColChanged(int)</slot>
+ <slot access="protected">itemDeleteClicked()</slot>
+ <slot access="protected">itemDownClicked()</slot>
+ <slot access="protected">itemLeftClicked()</slot>
+ <slot access="protected">itemNewClicked()</slot>
+ <slot access="protected">itemNewSubClicked()</slot>
+ <slot access="protected">itemPixmapChoosen()</slot>
+ <slot access="protected">itemPixmapDeleted()</slot>
+ <slot access="protected">itemTextChanged(const QString &amp;)</slot>
+ <slot access="protected">itemUpClicked()</slot>
+ <slot access="protected">newColumnClicked()</slot>
+ <slot access="protected">itemRightClicked()</slot>
+ <slot access="protected">okClicked()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.cpp
new file mode 100644
index 0000000..5e28663
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.cpp
@@ -0,0 +1,655 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "listvieweditorimpl.h"
+#include "pixmapchooser.h"
+#include "command.h"
+#include "listviewdnd.h"
+#include "listboxdnd.h"
+#include "listboxrename.h"
+
+#include <tqlistview.h>
+#include <tqheader.h>
+#include <tqlistbox.h>
+#include <tqlineedit.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqtabwidget.h>
+#include <tqspinbox.h>
+#include <tqpushbutton.h>
+#include <tqptrstack.h>
+
+ListViewEditor::ListViewEditor( TQWidget *tqparent, TQListView *lv, FormWindow *fw )
+ : ListViewEditorBase( tqparent, 0, TRUE ), listview( lv ), formwindow( fw )
+{
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ itemColumn->setEnabled( FALSE );
+
+ setupColumns();
+ PopulateListViewCommand::transferItems( listview, itemsPreview );
+ setupItems();
+
+ itemsPreview->setShowSortIndicator( listview->showSortIndicator() );
+ itemsPreview->setAllColumnsShowFocus( listview->allColumnsShowFocus() );
+ itemsPreview->setRootIsDecorated( listview->rootIsDecorated() );
+
+ if ( itemsPreview->firstChild() ) {
+ itemsPreview->setCurrentItem( itemsPreview->firstChild() );
+ itemsPreview->setSelected( itemsPreview->firstChild(), TRUE );
+ }
+
+ // Clamp on drag and drop to TQListView
+ ListViewDnd *itemsDnd = new ListViewDnd( itemsPreview );
+ itemsDnd->setDragMode( ListViewDnd::Internal | ListViewDnd::Move );
+ TQObject::connect( itemsDnd, TQT_SIGNAL( dropped( TQListViewItem * ) ),
+ itemsDnd, TQT_SLOT( confirmDrop( TQListViewItem * ) ) );
+
+ // Enable rename for all TQListViewItems
+ TQListViewItemIterator it = ((TQListView *)itemsPreview)->firstChild();
+ for ( ; *it; it++ )
+ (*it)->setRenameEnabled( 0, TRUE );
+
+ // Connect listview signal to signal-relay
+ TQObject::connect( itemsPreview,
+ TQT_SIGNAL( itemRenamed( TQListViewItem*, int, const TQString & ) ),
+ this,
+ TQT_SLOT( emitItemRenamed(TQListViewItem*, int, const TQString&) ) );
+
+ // Connect signal-relay to TQLineEdit "itemText"
+ TQObjectList *l = tqparent->queryList( "TQLineEdit", "itemText" );
+ TQObject *obj;
+ TQObjectListIt itemsLineEditIt( *l );
+ while ( (obj = itemsLineEditIt.current()) != 0 ) {
+ ++itemsLineEditIt;
+ TQObject::connect( this,
+ TQT_SIGNAL( itemRenamed( const TQString & ) ),
+ obj,
+ TQT_SLOT( setText( const TQString & ) ) );
+ }
+ delete l;
+
+ // Clamp on drag and drop to TQListBox
+ ListBoxDnd *columnsDnd = new ListBoxDnd( colPreview );
+ columnsDnd->setDragMode( ListBoxDnd::Internal | ListBoxDnd::Move );
+ TQObject::connect( columnsDnd, TQT_SIGNAL( dropped( TQListBoxItem * ) ),
+ columnsDnd, TQT_SLOT( confirmDrop( TQListBoxItem * ) ) );
+
+ // Clamp on rename to TQListBox
+ ListBoxRename *columnsRename = new ListBoxRename( colPreview );
+ TQObject::connect( columnsRename,
+ TQT_SIGNAL( itemTextChanged( const TQString & ) ),
+ this,
+ TQT_SLOT( columnTextChanged( const TQString & ) ) );
+
+ // Find TQLineEdit "colText" and connect
+ l = tqparent->queryList( "TQLineEdit", "colText" );
+ TQObjectListIt columnsLineEditIt( *l );
+ while ( (obj = columnsLineEditIt.current()) != 0 ) {
+ ++columnsLineEditIt;
+ TQObject::connect( columnsRename,
+ TQT_SIGNAL( itemTextChanged( const TQString & ) ),
+ obj,
+ TQT_SLOT( setText( const TQString & ) ) );
+ }
+ delete l;
+}
+
+void ListViewEditor::applyClicked()
+{
+ setupItems();
+ PopulateListViewCommand *cmd = new PopulateListViewCommand( tr( "Edit the Items and Columns of '%1'" ).arg( listview->name() ),
+ formwindow, listview, itemsPreview );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void ListViewEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void ListViewEditor::columnClickable( bool b )
+{
+ Column *c = tqfindColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+ c->clickable = b;
+}
+
+void ListViewEditor::columnDownClicked()
+{
+ if ( colPreview->currentItem() == -1 ||
+ colPreview->currentItem() > (int)colPreview->count() - 2 )
+ return;
+
+ colPreview->clearSelection();
+ TQListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ TQListBoxItem *below = i->next();
+
+ colPreview->takeItem( i );
+ colPreview->insertItem( i, below );
+
+ colPreview->setCurrentItem( i );
+ colPreview->setSelected( i, TRUE );
+}
+
+void ListViewEditor::columnPixmapChosen()
+{
+ Column *c = tqfindColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+
+ TQPixmap pix;
+ if ( colPixmap->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *colPixmap->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, TQPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ c->pixmap = pix;
+ colPreview->blockSignals( TRUE );
+ if ( !c->pixmap.isNull() )
+ colPreview->changeItem( c->pixmap, c->text, colPreview->index( c->item ) );
+ else
+ colPreview->changeItem( c->text, colPreview->index( c->item ) );
+ c->item = colPreview->item( colPreview->currentItem() );
+ colPixmap->setPixmap( c->pixmap );
+ colPreview->blockSignals( FALSE );
+ colDeletePixmap->setEnabled( TRUE );
+}
+
+void ListViewEditor::columnPixmapDeleted()
+{
+ Column *c = tqfindColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+
+ c->pixmap = TQPixmap();
+ colPreview->blockSignals( TRUE );
+ if ( !c->pixmap.isNull() )
+ colPreview->changeItem( c->pixmap, c->text, colPreview->index( c->item ) );
+ else
+ colPreview->changeItem( c->text, colPreview->index( c->item ) );
+ c->item = colPreview->item( colPreview->currentItem() );
+ colPixmap->setText( "" );
+ colPreview->blockSignals( FALSE );
+ colDeletePixmap->setEnabled( FALSE );
+}
+
+void ListViewEditor::columnResizable( bool b )
+{
+ Column *c = tqfindColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+ c->resizable = b;
+}
+
+void ListViewEditor::columnTextChanged( const TQString &txt )
+{
+ Column *c = tqfindColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+
+ c->text = txt;
+ colPreview->blockSignals( TRUE );
+ if ( !c->pixmap.isNull() )
+ colPreview->changeItem( c->pixmap, c->text, colPreview->index( c->item ) );
+ else
+ colPreview->changeItem( c->text, colPreview->index( c->item ) );
+ c->item = colPreview->item( colPreview->currentItem() );
+ colPreview->blockSignals( FALSE );
+}
+
+void ListViewEditor::columnUpClicked()
+{
+ if ( colPreview->currentItem() <= 0 )
+ return;
+
+ colPreview->clearSelection();
+ TQListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ TQListBoxItem *above = i->prev();
+
+ colPreview->takeItem( above );
+ colPreview->insertItem( above, i );
+
+ colPreview->setCurrentItem( i );
+ colPreview->setSelected( i, TRUE );
+}
+
+void ListViewEditor::currentColumnChanged( TQListBoxItem *i )
+{
+ Column *c = tqfindColumn( i );
+ if ( !i || !c ) {
+ colText->setEnabled( FALSE );
+ colPixmap->setEnabled( FALSE );
+ colDeletePixmap->setEnabled( FALSE );
+ colText->blockSignals( TRUE );
+ colText->setText( "" );
+ colText->blockSignals( FALSE );
+ colClickable->setEnabled( FALSE );
+ colResizable->setEnabled( FALSE );
+ return;
+ }
+
+ colText->setEnabled( TRUE );
+ colPixmap->setEnabled( TRUE );
+ colDeletePixmap->setEnabled( i->pixmap() && !i->pixmap()->isNull() );
+ colClickable->setEnabled( TRUE );
+ colResizable->setEnabled( TRUE );
+
+ colText->blockSignals( TRUE );
+ colText->setText( c->text );
+ colText->blockSignals( FALSE );
+ if ( !c->pixmap.isNull() )
+ colPixmap->setPixmap( c->pixmap );
+ else
+ colPixmap->setText( "" );
+ colClickable->setChecked( c->clickable );
+ colResizable->setChecked( c->resizable );
+}
+
+void ListViewEditor::newColumnClicked()
+{
+ Column col;
+ col.text = tr( "New Column" );
+ col.pixmap = TQPixmap();
+ col.clickable = TRUE;
+ col.resizable = TRUE;
+ if ( !col.pixmap.isNull() )
+ col.item = new TQListBoxPixmap( colPreview, col.pixmap, col.text );
+ else
+ col.item = new TQListBoxText( colPreview, col.text );
+ columns.append( col );
+ colPreview->setCurrentItem( col.item );
+ colPreview->setSelected( col.item, TRUE );
+}
+
+void ListViewEditor::deleteColumnClicked()
+{
+ TQListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ if ( !i )
+ return;
+
+ for ( TQValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
+ if ( ( *it ).item == i ) {
+ delete (*it).item;
+ columns.remove( it );
+ break;
+ }
+ }
+
+ if ( colPreview->currentItem() != -1 )
+ colPreview->setSelected( colPreview->currentItem(), TRUE );
+}
+
+void ListViewEditor::currentItemChanged( TQListViewItem *i )
+{
+ if ( !i ) {
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ itemColumn->setEnabled( FALSE );
+ return;
+ }
+
+ itemText->setEnabled( TRUE );
+ itemChoosePixmap->setEnabled( TRUE );
+ itemDeletePixmap->setEnabled( i->pixmap( itemColumn->value() ) &&
+ !i->pixmap( itemColumn->value() )->isNull() );
+ itemColumn->setEnabled( TRUE );
+
+ displayItem( i, itemColumn->value() );
+}
+
+void ListViewEditor::displayItem( TQListViewItem *i, int col )
+{
+ itemText->blockSignals( TRUE );
+ itemText->setText( i->text( col ) );
+ itemText->blockSignals( FALSE );
+
+ itemPixmap->blockSignals( TRUE );
+ if ( i->pixmap( col ) )
+ itemPixmap->setPixmap( *i->pixmap( col ) );
+ else
+ itemPixmap->setText( "" );
+ itemPixmap->blockSignals( FALSE );
+}
+
+void ListViewEditor::itemColChanged( int col )
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ displayItem( i, col );
+ itemDeletePixmap->setEnabled( i->pixmap( col ) && !i->pixmap( col )->isNull() );
+}
+
+void ListViewEditor::itemDeleteClicked()
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ delete i;
+ if ( itemsPreview->firstChild() ) {
+ itemsPreview->setCurrentItem( itemsPreview->firstChild() );
+ itemsPreview->setSelected( itemsPreview->firstChild(), TRUE );
+ }
+}
+
+void ListViewEditor::itemDownClicked()
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ TQListViewItemIterator it( i );
+ TQListViewItem *tqparent = i->tqparent();
+ it++;
+ while ( it.current() ) {
+ if ( it.current()->tqparent() == tqparent )
+ break;
+ it++;
+ }
+
+ if ( !it.current() )
+ return;
+ TQListViewItem *other = it.current();
+
+ i->moveItem( other );
+}
+
+void ListViewEditor::itemNewClicked()
+{
+ TQListViewItem *item = new TQListViewItem( itemsPreview );
+ item->setText( 0, "Item" );
+ item->setRenameEnabled( 0, TRUE );
+ itemsPreview->setCurrentItem( item );
+ itemsPreview->setSelected( item, TRUE );
+ itemText->setFocus();
+ itemText->selectAll();
+}
+
+void ListViewEditor::itemNewSubClicked()
+{
+ TQListViewItem *tqparent = itemsPreview->currentItem();
+ TQListViewItem *item = 0;
+ if ( tqparent ) {
+ item = new TQListViewItem( tqparent );
+ tqparent->setOpen( TRUE );
+ } else {
+ item = new TQListViewItem( itemsPreview );
+ }
+ item->setText( 0, "Subitem" );
+ item->setRenameEnabled( 0, TRUE );
+ itemsPreview->setCurrentItem( item );
+ itemsPreview->setSelected( item, TRUE );
+}
+
+void ListViewEditor::itemPixmapChoosen()
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ TQPixmap pix;
+ if ( itemPixmap->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *itemPixmap->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, TQPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ i->setPixmap( itemColumn->value(), TQPixmap( pix ) );
+ itemPixmap->setPixmap( pix );
+ itemDeletePixmap->setEnabled( TRUE );
+}
+
+void ListViewEditor::itemPixmapDeleted()
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ i->setPixmap( itemColumn->value(), TQPixmap() );
+ itemPixmap->setText( "" );
+ itemDeletePixmap->setEnabled( FALSE );
+}
+
+void ListViewEditor::itemTextChanged( const TQString &txt )
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+ i->setText( itemColumn->value(), txt );
+}
+
+void ListViewEditor::itemUpClicked()
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ TQListViewItemIterator it( i );
+ TQListViewItem *tqparent = i->tqparent();
+ --it;
+ while ( it.current() ) {
+ if ( it.current()->tqparent() == tqparent )
+ break;
+ --it;
+ }
+
+ if ( !it.current() )
+ return;
+ TQListViewItem *other = it.current();
+
+ other->moveItem( i );
+}
+
+void ListViewEditor::itemRightClicked()
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ TQListViewItemIterator it( i );
+ TQListViewItem *tqparent = i->tqparent();
+ tqparent = tqparent ? tqparent->firstChild() : itemsPreview->firstChild();
+ if ( !tqparent )
+ return;
+ it++;
+ while ( it.current() ) {
+ if ( it.current()->tqparent() == tqparent )
+ break;
+ it++;
+ }
+
+ if ( !it.current() )
+ return;
+ TQListViewItem *other = it.current();
+
+ for ( int c = 0; c < itemsPreview->columns(); ++c ) {
+ TQString s = i->text( c );
+ i->setText( c, other->text( c ) );
+ other->setText( c, s );
+ TQPixmap pix;
+ if ( i->pixmap( c ) )
+ pix = *i->pixmap( c );
+ if ( other->pixmap( c ) )
+ i->setPixmap( c, *other->pixmap( c ) );
+ else
+ i->setPixmap( c, TQPixmap() );
+ other->setPixmap( c, pix );
+ }
+
+ itemsPreview->setCurrentItem( other );
+ itemsPreview->setSelected( other, TRUE );
+}
+
+void ListViewEditor::itemLeftClicked()
+{
+ TQListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ TQListViewItemIterator it( i );
+ TQListViewItem *tqparent = i->tqparent();
+ if ( !tqparent )
+ return;
+ tqparent = tqparent->tqparent();
+ --it;
+ while ( it.current() ) {
+ if ( it.current()->tqparent() == tqparent )
+ break;
+ --it;
+ }
+
+ if ( !it.current() )
+ return;
+ TQListViewItem *other = it.current();
+
+ for ( int c = 0; c < itemsPreview->columns(); ++c ) {
+ TQString s = i->text( c );
+ i->setText( c, other->text( c ) );
+ other->setText( c, s );
+ TQPixmap pix;
+ if ( i->pixmap( c ) )
+ pix = *i->pixmap( c );
+ if ( other->pixmap( c ) )
+ i->setPixmap( c, *other->pixmap( c ) );
+ else
+ i->setPixmap( c, TQPixmap() );
+ other->setPixmap( c, pix );
+ }
+
+ itemsPreview->setCurrentItem( other );
+ itemsPreview->setSelected( other, TRUE );
+}
+
+void ListViewEditor::setupColumns()
+{
+ TQHeader *h = listview->header();
+ for ( int i = 0; i < (int)h->count(); ++i ) {
+ Column col;
+ col.text = h->label( i );
+ col.pixmap = TQPixmap();
+ if ( h->iconSet( i ) )
+ col.pixmap = h->iconSet( i )->pixmap();
+ col.clickable = h->isClickEnabled( i );
+ col.resizable = h->isResizeEnabled( i );
+ if ( !col.pixmap.isNull() )
+ col.item = new TQListBoxPixmap( colPreview, col.pixmap, col.text );
+ else
+ col.item = new TQListBoxText( colPreview, col.text );
+ columns.append( col );
+ }
+
+ colText->setEnabled( FALSE );
+ colPixmap->setEnabled( FALSE );
+ colClickable->setEnabled( FALSE );
+ colResizable->setEnabled( FALSE );
+
+ if ( colPreview->firstItem() )
+ colPreview->setCurrentItem( colPreview->firstItem() );
+ numColumns = colPreview->count();
+}
+
+void ListViewEditor::setupItems()
+{
+ itemColumn->setMinValue( 0 );
+ itemColumn->setMaxValue( TQMAX( numColumns - 1, 0 ) );
+ int i = 0;
+ TQHeader *header = itemsPreview->header();
+ for ( TQListBoxItem *item = colPreview->firstItem(); item; item = item->next() ) {
+ Column *col = tqfindColumn( item );
+ if ( !col )
+ continue;
+ if ( i >= itemsPreview->columns() )
+ itemsPreview->addColumn( col->text );
+ header->setLabel( i, col->pixmap, col->text );
+ header->setResizeEnabled( col->resizable, i );
+ header->setClickEnabled( col->clickable, i );
+ ++i;
+ }
+ while ( itemsPreview->columns() > i )
+ itemsPreview->removeColumn( i );
+
+ itemColumn->setValue( TQMIN( numColumns - 1, itemColumn->value() ) );
+}
+
+ListViewEditor::Column *ListViewEditor::tqfindColumn( TQListBoxItem *i )
+{
+ if ( !i )
+ return 0;
+
+ for ( TQValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
+ if ( ( *it ).item == i )
+ return &( *it );
+ }
+
+ return 0;
+}
+
+void ListViewEditor::initTabPage( const TQString &page )
+{
+ numColumns = colPreview->count();
+ if ( page == tr( "&Items" ) ) {
+ setupItems();
+ if ( numColumns == 0 ) {
+ itemNew->setEnabled( FALSE );
+ itemNewSub->setEnabled( FALSE );
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ itemColumn->setEnabled( FALSE );
+ } else {
+ itemNew->setEnabled( TRUE );
+ itemNewSub->setEnabled( TRUE );
+ }
+ }
+}
+
+void ListViewEditor::emitItemRenamed( TQListViewItem *, int, const TQString & text )
+{
+ emit itemRenamed( text ); // Relay signal ( to TQLineEdit )
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.h b/tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.h
new file mode 100644
index 0000000..8f2135b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/listvieweditorimpl.h
@@ -0,0 +1,110 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LISTVIEWEDITORIMPL_H
+#define LISTVIEWEDITORIMPL_H
+
+#include "listvieweditor.h"
+
+#include <tqmap.h>
+#include <tqpixmap.h>
+#include <tqvaluelist.h>
+
+class FormWindow;
+
+class ListViewEditor : public ListViewEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ListViewEditor( TQWidget *tqparent, TQListView *lv, FormWindow *fw );
+
+Q_SIGNALS:
+ void itemRenamed(const TQString &);
+
+protected Q_SLOTS:
+ void applyClicked();
+ void columnClickable(bool);
+ void columnDownClicked();
+ void columnPixmapChosen();
+ void columnPixmapDeleted();
+ void columnResizable(bool);
+ void columnTextChanged(const TQString &);
+ void columnUpClicked();
+ void currentColumnChanged(TQListBoxItem*);
+ void currentItemChanged(TQListViewItem*);
+ void deleteColumnClicked();
+ void itemColChanged(int);
+ void itemDeleteClicked();
+ void itemDownClicked();
+ void itemNewClicked();
+ void itemNewSubClicked();
+ void itemPixmapChoosen();
+ void itemPixmapDeleted();
+ void itemTextChanged(const TQString &);
+ void itemUpClicked();
+ void itemLeftClicked();
+ void itemRightClicked();
+ void newColumnClicked();
+ void okClicked();
+ void initTabPage(const TQString &page);
+ void emitItemRenamed(TQListViewItem*, int, const TQString&); // signal relay
+
+private:
+ struct Column
+ {
+ TQListBoxItem *item;
+ TQString text;
+ TQPixmap pixmap;
+ bool clickable, resizable;
+ TQ_DUMMY_COMPARISON_OPERATOR( Column )
+ };
+
+private:
+ void setupColumns();
+ void setupItems();
+ Column *tqfindColumn( TQListBoxItem *i );
+ void transferItems( TQListView *from, TQListView *to );
+ void displayItem( TQListViewItem *i, int col );
+
+private:
+ TQListView *listview;
+ TQValueList<Column> columns;
+ int numColumns;
+ FormWindow *formwindow;
+
+};
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/mainwindow.cpp b/tqtinterface/qt4/tools/designer/designer/mainwindow.cpp
new file mode 100644
index 0000000..def15eb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/mainwindow.cpp
@@ -0,0 +1,3784 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "designerappiface.h"
+#include "designerapp.h"
+
+#include "mainwindow.h"
+#include "defs.h"
+#include "globaldefs.h"
+#include "formwindow.h"
+#include "widgetdatabase.h"
+#include "widgetfactory.h"
+#include "propertyeditor.h"
+#include "metadatabase.h"
+#include "resource.h"
+#include "hierarchyview.h"
+#include "newformimpl.h"
+#include "workspace.h"
+#include "about.h"
+#include "multilineeditorimpl.h"
+#include "wizardeditorimpl.h"
+#include "outputwindow.h"
+#include "actioneditorimpl.h"
+#include "actiondnd.h"
+#include "project.h"
+#include "projectsettingsimpl.h"
+#include "tqwidgetfactory.h"
+#include "pixmapcollection.h"
+#include "qcompletionedit.h"
+#include "sourcefile.h"
+#include "orderindicator.h"
+#include <tqtoolbox.h>
+#include "widgetaction.h"
+#include "propertyobject.h"
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+#include "startdialog.h"
+#include "createtemplate.h"
+#include "editfunctions.h"
+//#include "connectionviewer.h"
+#include "formsettings.h"
+#include "preferences.h"
+#include "pixmapcollectioneditor.h"
+#ifndef TQT_NO_SQL
+#include "dbconnectionimpl.h"
+#endif
+//#include "connectioneditor.h"
+#include "customwidgeteditorimpl.h"
+#include "paletteeditorimpl.h"
+#include "listboxeditorimpl.h"
+#include "listvieweditorimpl.h"
+#include "iconvieweditorimpl.h"
+#include "tableeditorimpl.h"
+#include "multilineeditor.h"
+#include "finddialog.h"
+#include "replacedialog.h"
+#include "gotolinedialog.h"
+
+#include <tqinputdialog.h>
+#include <tqtoolbar.h>
+#include <tqfeatures.h>
+#include <tqmetaobject.h>
+#include <tqaction.h>
+#include <tqpixmap.h>
+#include <tqworkspace.h>
+#include <tqfiledialog.h>
+#include <tqclipboard.h>
+#include <tqmessagebox.h>
+#include <tqbuffer.h>
+#include <tqdir.h>
+#include <tqstyle.h>
+#include <tqlabel.h>
+#include <tqstatusbar.h>
+#include <tqfile.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqwizard.h>
+#include <tqtimer.h>
+#include <tqlistbox.h>
+#include <tqdockwindow.h>
+#include <tqstylefactory.h>
+#include <tqvbox.h>
+#include <tqprocess.h>
+#include <tqsettings.h>
+#include <tqaccel.h>
+#include <tqtooltip.h>
+#include <tqsizegrip.h>
+#include <tqtextview.h>
+#include <tqassistantclient.h>
+#include <stdlib.h>
+
+static bool mblockNewForms = FALSE;
+extern TQMap<TQWidget*, TQString> *qwf_forms;
+extern TQString *qwf_language;
+extern bool qwf_execute_code;
+extern bool qwf_stays_on_top;
+extern void set_splash_status( const TQString &txt );
+extern TQObject* qwf_form_object;
+extern TQString *qwf_plugin_dir;
+
+MainWindow *MainWindow::self = 0;
+
+TQString assistantPath()
+{
+ TQString path = TQDir::cleanDirPath( TQString( qInstallPathBins() ) +
+ TQDir::separator() );
+ return path;
+}
+
+
+static TQString textNoAccel( const TQString& text)
+{
+ TQString t = text;
+ int i;
+ while ( (i = t.tqfind('&') )>= 0 ) {
+ t.remove(i,1);
+ }
+ return t;
+}
+
+
+MainWindow::MainWindow( bool asClient, bool single, const TQString &plgDir )
+ : TQMainWindow( 0, "designer_mainwindow", (WFlags)((WFlags)TQt::WType_TopLevel | (single ? (WFlags)0 : (WFlags)TQt::WDestructiveClose) | (WFlags)TQt::WGroupLeader) ),
+ grd( 10, 10 ), sGrid( TRUE ), snGrid( TRUE ), restoreConfig( TRUE ), splashScreen( TRUE ),
+ fileFilter( tr( "TQt User-Interface Files (*.ui)" ) ), client( asClient ),
+ previewing( FALSE ), databaseAutoEdit( FALSE ), autoSaveEnabled( FALSE ), autoSaveInterval( 1800 )
+{
+ extern void qInitImages_designercore();
+ qInitImages_designercore();
+
+ self = this;
+ setPluginDirectory( plgDir );
+ customWidgetToolBar = customWidgetToolBar2 = 0;
+ guiStuffVisible = TRUE;
+ editorsReadOnly = FALSE;
+ sSignalHandlers = TRUE;
+ init_colors();
+ shStartDialog = TRUE;
+
+ desInterface = new DesignerInterfaceImpl( this );
+ desInterface->addRef();
+ inDebugMode = FALSE;
+ savePluginPaths = FALSE;
+
+ updateFunctionsTimer = new TQTimer( this );
+ connect( updateFunctionsTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( doFunctionsChanged() ) );
+
+ autoSaveTimer = new TQTimer( this );
+ connect( autoSaveTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( fileSaveAll() ) );
+
+ set_splash_status( "Loading Plugins..." );
+ setupPluginManagers();
+
+ if ( !single )
+ tqApp->setMainWidget( this );
+ TQWidgetFactory::addWidgetFactory( new CustomWidgetFactory );
+#ifndef TQ_WS_MACX
+ setIcon( TQPixmap::fromMimeSource( "designer_appicon.png" ) );
+#endif
+
+ actionGroupTools = 0;
+ prefDia = 0;
+ windowMenu = 0;
+ hierarchyView = 0;
+ actionEditor = 0;
+ currentProject = 0;
+ wspace = 0;
+ oWindow = 0;
+ singleProject = single;
+
+ statusBar()->clear();
+#if defined(TQT_NON_COMMERCIAL)
+ statusBar()->addWidget( new TQLabel(tr("Ready - This is the non-commercial version of TQt - "
+ "For commercial evaluations, use the help menu to register with Trolltech."), statusBar()), 1 );
+#else
+ statusBar()->addWidget( new TQLabel("Ready", statusBar()), 1 );
+#endif
+
+
+ set_splash_status( "Setting up GUI..." );
+ setupMDI();
+ setupMenuBar();
+
+ setupToolbox();
+
+ setupFileActions();
+ setupEditActions();
+ setupProjectActions();
+ setupSearchActions();
+ layoutToolBar = new TQToolBar( this, "Layout" );
+ layoutToolBar->setCloseMode( TQDockWindow::Undocked );
+ addToolBar( layoutToolBar, tr( "Layout" ) );
+ interpreterPluginManager = 0;
+ setupToolActions();
+ setupLayoutActions();
+ setupPreviewActions();
+ setupOutputWindow();
+ setupActionManager();
+ setupWindowActions();
+
+ setupWorkspace();
+ setupHierarchyView();
+ setupPropertyEditor();
+ setupActionEditor();
+
+ setupHelpActions();
+
+ setupRMBMenus();
+
+ connect( this, TQT_SIGNAL( projectChanged() ), this, TQT_SLOT( emitProjectSignals() ) );
+ connect( this, TQT_SIGNAL( hasActiveWindow(bool) ), this, TQT_SLOT( emitProjectSignals() ) );
+
+ emit hasActiveForm( FALSE );
+ emit hasActiveWindow( FALSE );
+
+ lastPressWidget = 0;
+ tqApp->installEventFilter( this );
+
+ TQSize as( tqApp->desktop()->size() );
+ as -= TQSize( 30, 30 );
+ resize( TQSize( 1200, 1000 ).boundedTo( as ) );
+
+ connect( tqApp->clipboard(), TQT_SIGNAL( dataChanged() ),
+ this, TQT_SLOT( clipboardChanged() ) );
+ clipboardChanged();
+ layoutChilds = FALSE;
+ layoutSelected = FALSE;
+ breakLayout = FALSE;
+ backPix = TRUE;
+
+ set_splash_status( "Loading User Settings..." );
+ readConfig();
+ // hack to make WidgetFactory happy (so it knows TQWidget and TQDialog for resetting properties)
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQWidget" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQDialog" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQLabel" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQTabWidget" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQFrame" ), this, 0, FALSE );
+ delete w;
+ setAppropriate( (TQDockWindow*)actionEditor->parentWidget(), FALSE );
+ actionEditor->parentWidget()->hide();
+
+ assistant = new TQAssistantClient( assistantPath(), TQT_TQOBJECT(this) );
+
+ statusBar()->setSizeGripEnabled( TRUE );
+ set_splash_status( "Initialization Done." );
+ if ( shStartDialog )
+ TQTimer::singleShot( 0, this, TQT_SLOT( showStartDialog() ));
+
+ if ( autoSaveEnabled )
+ autoSaveTimer->start( autoSaveInterval * 1000 );
+}
+
+MainWindow::~MainWindow()
+{
+ TQValueList<Tab>::Iterator tit;
+ for ( tit = preferenceTabs.begin(); tit != preferenceTabs.end(); ++tit ) {
+ Tab t = *tit;
+ delete t.w;
+ }
+ for ( tit = projectTabs.begin(); tit != projectTabs.end(); ++tit ) {
+ Tab t = *tit;
+ delete t.w;
+ }
+
+ TQMap< TQAction*, Project* >::Iterator it = projects.begin();
+ while ( it != projects.end() ) {
+ Project *p = *it;
+ ++it;
+ delete p;
+ }
+ projects.clear();
+
+ delete oWindow;
+ oWindow = 0;
+
+ desInterface->release();
+ desInterface = 0;
+
+ delete actionPluginManager;
+ delete preferencePluginManager;
+ delete projectSettingsPluginManager;
+ delete interpreterPluginManager;
+ delete templateWizardPluginManager;
+ delete editorPluginManager;
+ delete sourceTemplatePluginManager;
+
+ MetaDataBase::clearDataBase();
+ if(self == this)
+ self = 0;
+}
+
+void MainWindow::setupMDI()
+{
+ TQVBox *vbox = new TQVBox( this );
+ setCentralWidget( vbox );
+ vbox->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ vbox->setMargin( 1 );
+ vbox->setLineWidth( 1 );
+ qworkspace = new TQWorkspace( vbox );
+ qworkspace->setPaletteBackgroundPixmap( TQPixmap::fromMimeSource( "designer_background.png" ) );
+ qworkspace->setScrollBarsEnabled( TRUE );
+ connect( qworkspace, TQT_SIGNAL( windowActivated( TQWidget * ) ),
+ this, TQT_SLOT( activeWindowChanged( TQWidget * ) ) );
+ lastActiveFormWindow = 0;
+ qworkspace->setAcceptDrops( TRUE );
+}
+
+void MainWindow::setupMenuBar()
+{
+ menubar = menuBar();
+}
+
+void MainWindow::setupPropertyEditor()
+{
+ TQDockWindow *dw = new TQDockWindow( TQDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( TQDockWindow::Always );
+ propertyEditor = new PropertyEditor( dw );
+ addToolBar( dw, TQt::DockRight );
+ dw->setWidget( propertyEditor );
+ dw->setFixedExtentWidth( 250 );
+ dw->setCaption( tr( "Property Editor/Signal Handlers" ) );
+ TQWhatsThis::add( propertyEditor,
+ tr("<b>The Property Editor</b>"
+ "<p>You can change the appearance and behavior of the selected widget in the "
+ "property editor.</p>"
+ "<p>You can set properties for components and forms at design time and see the "
+ "immediately see the effects of the changes. "
+ "Each property has its own editor which (depending on the property) can be used "
+ "to enter "
+ "new values, open a special dialog, or to select values from a predefined list. "
+ "Click <b>F1</b> to get detailed help for the selected property.</p>"
+ "<p>You can resize the columns of the editor by dragging the separators in the "
+ "list's header.</p>"
+ "<p><b>Signal Handlers</b></p>"
+ "<p>In the Signal Handlers tab you can define connections between "
+ "the Q_SIGNALS emitted by widgets and the Q_SLOTS in the form. "
+ "(These connections can also be made using the connection tool.)" ) );
+ dw->show();
+}
+
+void MainWindow::setupOutputWindow()
+{
+ TQDockWindow *dw = new TQDockWindow( TQDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( TQDockWindow::Always );
+ addToolBar( dw, TQt::DockBottom );
+ oWindow = new OutputWindow( dw );
+ dw->setWidget( oWindow );
+ dw->setFixedExtentHeight( 150 );
+ dw->setCaption( tr( "Output Window" ) );
+}
+
+void MainWindow::setupHierarchyView()
+{
+ if ( hierarchyView )
+ return;
+ TQDockWindow *dw = new TQDockWindow( TQDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( TQDockWindow::Always );
+ hierarchyView = new HierarchyView( dw );
+ addToolBar( dw, TQt::DockRight );
+ dw->setWidget( hierarchyView );
+
+ dw->setCaption( tr( "Object Explorer" ) );
+ dw->setFixedExtentWidth( 250 );
+ TQWhatsThis::add( hierarchyView,
+ tr("<b>The Object Explorer</b>"
+ "<p>The Object Explorer provides an overview of the relationships "
+ "between the widgets in a form. You can use the clipboard functions using "
+ "a context menu for each item in the view. It is also useful for selecting widgets "
+ "in forms that have complex layouts.</p>"
+ "<p>The columns can be resized by dragging the separator in the list's header.</p>"
+ "<p>The second tab shows all the form's Q_SLOTS, class variables, includes, etc.</p>") );
+ dw->show();
+}
+
+void MainWindow::setupWorkspace()
+{
+ TQDockWindow *dw = new TQDockWindow( TQDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( TQDockWindow::Always );
+ TQVBox *vbox = new TQVBox( dw );
+ TQCompletionEdit *edit = new TQCompletionEdit( vbox );
+ TQToolTip::add( edit, tr( "Start typing the buffer you want to switch to here (ALT+B)" ) );
+ TQAccel *a = new TQAccel( this );
+ a->connectItem( a->insertItem( Qt::ALT + Qt::Key_B ), edit, TQT_SLOT( setFocus() ) );
+ wspace = new Workspace( vbox, this );
+ wspace->setBufferEdit( edit );
+ wspace->setCurrentProject( currentProject );
+ addToolBar( dw, TQt::DockRight );
+ dw->setWidget( vbox );
+
+ dw->setCaption( tr( "Project Overview" ) );
+ TQWhatsThis::add( wspace, tr("<b>The Project Overview Window</b>"
+ "<p>The Project Overview Window displays all the current "
+ "project, including forms and source files.</p>"
+ "<p>Use the search field to rapidly switch between files.</p>"));
+ dw->setFixedExtentHeight( 100 );
+ dw->show();
+}
+
+void MainWindow::setupActionEditor()
+{
+ TQDockWindow *dw = new TQDockWindow( TQDockWindow::OutsideDock, this, 0 );
+ addDockWindow( dw, TQt::DockTornOff );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( TQDockWindow::Always );
+ actionEditor = new ActionEditor( dw );
+ dw->setWidget( actionEditor );
+ actionEditor->show();
+ dw->setCaption( tr( "Action Editor" ) );
+ TQWhatsThis::add( actionEditor, tr("<b>The Action Editor</b>"
+ "<p>The Action Editor is used to add actions and action groups to "
+ "a form, and to connect actions to Tslots. Actions and action "
+ "groups can be dragged into menus and into toolbars, and may "
+ "feature keyboard shortcuts and tooltips. If actions have pixmaps "
+ "these are displayed on toolbar buttons and besides their names in "
+ "menus.</p>" ) );
+ dw->hide();
+ setAppropriate( dw, FALSE );
+}
+
+void MainWindow::setupToolbox()
+{
+ TQDockWindow *dw = new TQDockWindow( TQDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( TQDockWindow::Always );
+ addToolBar( dw, TQt::DockLeft );
+ toolBox = new TQToolBox( dw );
+ dw->setWidget( toolBox );
+ dw->setFixedExtentWidth( 160 );
+ dw->setCaption( tr( "Toolbox" ) );
+ dw->show();
+ setDockEnabled( dw, TQt::DockTop, FALSE );
+ setDockEnabled( dw, TQt::DockBottom, FALSE );
+ commonWidgetsToolBar = new TQToolBar( "Common Widgets", 0, toolBox, FALSE, "Common Widgets" );
+ commonWidgetsToolBar->setFrameStyle( TQFrame::NoFrame );
+ commonWidgetsToolBar->setOrientation( Qt::Vertical );
+ commonWidgetsToolBar->setBackgroundMode(TQt::PaletteBase);
+ toolBox->addItem( commonWidgetsToolBar, "Common Widgets" );
+}
+
+void MainWindow::setupRMBMenus()
+{
+ rmbWidgets = new TQPopupMenu( this );
+ actionEditCut->addTo( rmbWidgets );
+ actionEditCopy->addTo( rmbWidgets );
+ actionEditPaste->addTo( rmbWidgets );
+ actionEditDelete->addTo( rmbWidgets );
+#if 0
+ rmbWidgets->insertSeparator();
+ actionEditLower->addTo( rmbWidgets );
+ actionEditRaise->addTo( rmbWidgets );
+#endif
+ rmbWidgets->insertSeparator();
+ actionEditAdjustSize->addTo( rmbWidgets );
+ actionEditHLayout->addTo( rmbWidgets );
+ actionEditVLayout->addTo( rmbWidgets );
+ actionEditGridLayout->addTo( rmbWidgets );
+ actionEditSplitHorizontal->addTo( rmbWidgets );
+ actionEditSplitVertical->addTo( rmbWidgets );
+ actionEditBreakLayout->addTo( rmbWidgets );
+ rmbWidgets->insertSeparator();
+ if ( !singleProjectMode() )
+ actionEditConnections->addTo( rmbWidgets );
+ actionEditSource->addTo( rmbWidgets );
+
+ rmbFormWindow = new TQPopupMenu( this );
+ actionEditPaste->addTo( rmbFormWindow );
+ actionEditSelectAll->addTo( rmbFormWindow );
+ actionEditAccels->addTo( rmbFormWindow );
+ rmbFormWindow->insertSeparator();
+ actionEditAdjustSize->addTo( rmbFormWindow );
+ actionEditHLayout->addTo( rmbFormWindow );
+ actionEditVLayout->addTo( rmbFormWindow );
+ actionEditGridLayout->addTo( rmbFormWindow );
+ actionEditBreakLayout->addTo( rmbFormWindow );
+ rmbFormWindow->insertSeparator();
+ if ( !singleProjectMode() ) {
+ actionEditFunctions->addTo( rmbFormWindow );
+ actionEditConnections->addTo( rmbFormWindow );
+ }
+ actionEditSource->addTo( rmbFormWindow );
+ rmbFormWindow->insertSeparator();
+ actionEditFormSettings->addTo( rmbFormWindow );
+}
+
+void MainWindow::toolSelected( TQAction* action )
+{
+ actionCurrentTool = action;
+ emit currentToolChanged();
+ if ( formWindow() )
+ formWindow()->commandHistory()->emitUndoRedo();
+}
+
+int MainWindow::currentTool() const
+{
+ if ( !actionCurrentTool )
+ return POINTER_TOOL;
+ return TQString::tqfromLatin1(actionCurrentTool->name()).toInt();
+}
+
+void MainWindow::runProjectPrecondition()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ e->save();
+ e->saveBreakPoints();
+ }
+ fileSaveProject();
+
+ if ( currentTool() == ORDER_TOOL )
+ resetTool();
+ oWindow->clearErrorMessages();
+ oWindow->clearDebug();
+ oWindow->showDebugTab();
+ previewing = TRUE;
+}
+
+void MainWindow::runProjectPostcondition( TQObjectList *l )
+{
+ inDebugMode = TRUE;
+ debuggingForms = *l;
+ enableAll( FALSE );
+ for ( SourceEditor *e2 = sourceEditors.first(); e2; e2 = sourceEditors.next() ) {
+ if ( e2->project() == currentProject )
+ e2->editorInterface()->setMode( EditorInterface::Debugging );
+ }
+}
+
+TQWidget* MainWindow::previewFormInternal( TQStyle* style, TQPalette* palet )
+{
+ qwf_execute_code = FALSE;
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->save();
+ if ( currentTool() == ORDER_TOOL )
+ resetTool();
+
+ FormWindow *fw = formWindow();
+ if ( !fw )
+ return 0;
+
+ TQStringList databases;
+ TQPtrDictIterator<TQWidget> wit( *fw->widgets() );
+ while ( wit.current() ) {
+ TQStringList lst = MetaDataBase::fakeProperty( wit.current(), "database" ).toStringList();
+ if ( !lst.isEmpty() )
+ databases << lst [ 0 ];
+ ++wit;
+ }
+
+ if ( fw->project() ) {
+ TQStringList::ConstIterator it;
+ for ( it = databases.begin(); it != databases.end(); ++it )
+ fw->project()->openDatabase( *it, FALSE );
+ }
+ TQApplication::setOverrideCursor( WaitCursor );
+
+ TQCString s;
+ TQBuffer buffer( s );
+ buffer.open( IO_WriteOnly );
+ Resource resource( this );
+ resource.setWidget( fw );
+ TQValueList<Resource::Image> images;
+ resource.save( &TQT_TQIODEVICE_OBJECT(buffer) );
+
+ buffer.close();
+ buffer.open( IO_ReadOnly );
+
+ TQWidget *w = TQWidgetFactory::create( &TQT_TQIODEVICE_OBJECT(buffer) );
+ if ( w ) {
+ previewedForm = w;
+ if ( palet ) {
+ if ( style )
+ style->polish( *palet );
+ w->setPalette( *palet );
+ }
+
+ if ( style )
+ w->setStyle( style );
+
+ TQObjectList *l = w->queryList( "TQWidget" );
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( style )
+ ( (TQWidget*)o )->setStyle( style );
+ }
+ delete l;
+
+ w->move( fw->mapToGlobal( TQPoint(0,0) ) );
+ ((MainWindow*)w )->setWFlags( TQt::WDestructiveClose );
+ previewing = TRUE;
+ w->show();
+ previewing = FALSE;
+ TQApplication::restoreOverrideCursor();
+ return w;
+ }
+ TQApplication::restoreOverrideCursor();
+ return 0;
+}
+
+void MainWindow::previewForm()
+{
+ TQWidget* w = previewFormInternal();
+ if ( w )
+ w->show();
+}
+
+void MainWindow::previewForm( const TQString & style )
+{
+ TQStyle* st = TQStyleFactory::create( style );
+ TQWidget* w = 0;
+ if ( style == "Motif" ) {
+ TQPalette p( TQColor( 192, 192, 192 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "Windows" ) {
+ TQPalette p( TQColor( 212, 208, 200 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "Platinum" ) {
+ TQPalette p( TQColor( 220, 220, 220 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "CDE" ) {
+ TQPalette p( TQColor( 75, 123, 130 ) );
+ p.setColor( TQPalette::Active, TQColorGroup::Base, TQColor( 55, 77, 78 ) );
+ p.setColor( TQPalette::Inactive, TQColorGroup::Base, TQColor( 55, 77, 78 ) );
+ p.setColor( TQPalette::Disabled, TQColorGroup::Base, TQColor( 55, 77, 78 ) );
+ p.setColor( TQPalette::Active, TQColorGroup::Highlight, TQt::white );
+ p.setColor( TQPalette::Active, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) );
+ p.setColor( TQPalette::Inactive, TQColorGroup::Highlight, TQt::white );
+ p.setColor( TQPalette::Inactive, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) );
+ p.setColor( TQPalette::Disabled, TQColorGroup::Highlight, TQt::white );
+ p.setColor( TQPalette::Disabled, TQColorGroup::HighlightedText, TQColor( 55, 77, 78 ) );
+ p.setColor( TQPalette::Active, TQColorGroup::Foreground, TQt::white );
+ p.setColor( TQPalette::Active, TQColorGroup::Text, TQt::white );
+ p.setColor( TQPalette::Active, TQColorGroup::ButtonText, TQt::white );
+ p.setColor( TQPalette::Inactive, TQColorGroup::Foreground, TQt::white );
+ p.setColor( TQPalette::Inactive, TQColorGroup::Text, TQt::white );
+ p.setColor( TQPalette::Inactive, TQColorGroup::ButtonText, TQt::white );
+ p.setColor( TQPalette::Disabled, TQColorGroup::Foreground, TQt::lightGray );
+ p.setColor( TQPalette::Disabled, TQColorGroup::Text, TQt::lightGray );
+ p.setColor( TQPalette::Disabled, TQColorGroup::ButtonText, TQt::lightGray );
+
+ w = previewFormInternal( st, &p );
+ } else if ( style == "SGI" ) {
+ TQPalette p( TQColor( 220, 220, 220 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "MotifPlus" ) {
+ TQColor gtkfg(0x00, 0x00, 0x00);
+ TQColor gtkdf(0x75, 0x75, 0x75);
+ TQColor gtksf(0xff, 0xff, 0xff);
+ TQColor gtkbs(0xff, 0xff, 0xff);
+ TQColor gtkbg(0xd6, 0xd6, 0xd6);
+ TQColor gtksl(0x00, 0x00, 0x9c);
+ TQColorGroup active(gtkfg, // foreground
+ gtkbg, // button
+ gtkbg.light(), // light
+ gtkbg.dark(142), // dark
+ gtkbg.dark(110), // mid
+ gtkfg, // text
+ gtkfg, // bright text
+ gtkbs, // base
+ gtkbg), // background
+ disabled(gtkdf, // foreground
+ gtkbg, // button
+ gtkbg.light(), // light
+ gtkbg.dark(156), // dark
+ gtkbg.dark(110), // mid
+ gtkdf, // text
+ gtkdf, // bright text
+ gtkbs, // base
+ gtkbg); // background
+
+ TQPalette pal(active, disabled, active);
+
+ pal.setColor(TQPalette::Active, TQColorGroup::Highlight,
+ gtksl);
+ pal.setColor(TQPalette::Active, TQColorGroup::HighlightedText,
+ gtksf);
+ pal.setColor(TQPalette::Inactive, TQColorGroup::Highlight,
+ gtksl);
+ pal.setColor(TQPalette::Inactive, TQColorGroup::HighlightedText,
+ gtksf);
+ pal.setColor(TQPalette::Disabled, TQColorGroup::Highlight,
+ gtksl);
+ pal.setColor(TQPalette::Disabled, TQColorGroup::HighlightedText,
+ gtkdf);
+ w = previewFormInternal( st, &pal );
+ } else {
+ w = previewFormInternal( st );
+ }
+
+ if ( !w )
+ return;
+ w->insertChild( TQT_TQOBJECT(st) );
+ w->show();
+}
+
+void MainWindow::helpContents()
+{
+ TQWidget *tqfocusWidget = tqApp->tqfocusWidget();
+ bool showClassDocu = TRUE;
+ while ( tqfocusWidget ) {
+ if ( tqfocusWidget->isA( "PropertyList" ) ) {
+ showClassDocu = FALSE;
+ break;
+ }
+ tqfocusWidget = tqfocusWidget->parentWidget();
+ }
+
+ TQString source = "designer-manual.html";
+ if ( propertyDocumentation.isEmpty() ) {
+ TQString indexFile = documentationPath() + "/propertyindex";
+ TQFile f( indexFile );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &f );
+ while ( !ts.eof() ) {
+ TQString s = ts.readLine();
+ int from = s.tqfind( "\"" );
+ if ( from == -1 )
+ continue;
+ int to = s.tqfindRev( "\"" );
+ if ( to == -1 )
+ continue;
+ propertyDocumentation[ s.mid( from + 1, to - from - 1 ) ] = s.mid( to + 2 ) + "-prop";
+ }
+ f.close();
+ }
+ }
+
+ if ( propertyEditor->widget() && !showClassDocu ) {
+ if ( !propertyEditor->currentProperty().isEmpty() ) {
+ TQMetaObject* mo = propertyEditor->tqmetaObjectOfCurrentProperty();
+ TQString s;
+ TQString cp = propertyEditor->currentProperty();
+ if ( cp == "layoutMargin" ) {
+ source = propertyDocumentation[ "TQLayout/margin" ];
+ } else if ( cp == "layoutSpacing" ) {
+ source = propertyDocumentation[ "TQLayout/spacing" ];
+ } else if ( cp == "toolTip" ) {
+ source = "qtooltip.html#details";
+ } else if ( mo && qstrcmp( mo->className(), "Spacer" ) == 0 ) {
+ if ( cp != "name" )
+ source = "qsizepolicy.html#SizeType";
+ else
+ source = propertyDocumentation[ "TQObject/name" ];
+ } else {
+ while ( mo && !propertyDocumentation.tqcontains( ( s = TQString( mo->className() ) + "/" + cp ) ) )
+ mo = TQT_TQMETAOBJECT(const_cast<QMetaObject*>(mo->superClass()));
+ if ( mo )
+ source = "p:" + propertyDocumentation[s];
+ }
+ }
+
+ TQString classname = WidgetFactory::classNameOf( propertyEditor->widget() );
+ if ( source.isEmpty() || source == "designer-manual.html" ) {
+ if ( classname.lower() == "spacer" )
+ source = "qspaceritem.html#details";
+ else if ( classname == "TQLayoutWidget" )
+ source = "qlayout.html";
+ else
+ source = TQString( WidgetFactory::classNameOf( propertyEditor->widget() ) ).lower() + ".html#details";
+ }
+ } else if ( propertyEditor->widget() ) {
+ source = TQString( WidgetFactory::classNameOf( propertyEditor->widget() ) ).lower() + ".html#details";
+ }
+
+ if ( !source.isEmpty() )
+ assistant->showPage( documentationPath() + source );
+}
+
+void MainWindow::helpManual()
+{
+ assistant->showPage( documentationPath() + "/designer-manual.html" );
+}
+
+void MainWindow::helpAbout()
+{
+ AboutDialog dlg( this, 0, TRUE );
+ if ( singleProjectMode() ) {
+ dlg.aboutPixmap->setText( "" );
+ dlg.aboutVersion->setText( "" );
+ dlg.aboutCopyright->setText( "" );
+ LanguageInterface *iface = MetaDataBase::languageInterface( eProject->language() );
+ dlg.aboutLicense->setText( iface->aboutText() );
+ }
+ dlg.aboutVersion->setText(TQString("Version ") + TQString(TQT_VERSION_STR));
+ dlg.resize( dlg.width(), dlg.tqlayout()->heightForWidth(dlg.width()) );
+ dlg.exec();
+}
+
+void MainWindow::helpAboutTQt()
+{
+ TQMessageBox::aboutTQt( this, "TQt Designer" );
+}
+
+#if defined(_WS_WIN_)
+#include <tqt_windows.h>
+#include <tqprocess.h>
+#endif
+
+void MainWindow::helpRegister()
+{
+#if defined(_WS_WIN_)
+ HKEY key;
+ HKEY subkey;
+ long res;
+ DWORD type;
+ DWORD size = 255;
+ TQString command;
+ TQString sub( "htmlfile\\shell" );
+#if defined(UNICODE)
+ if ( TQApplication::winVersion() & TQt::WV_NT_based ) {
+ unsigned char data[256];
+ res = RegOpenKeyExW( HKEY_CLASSES_ROOT, NULL, 0, KEY_READ, &key );
+ res = RegOpenKeyExW( key, (TCHAR*)sub.ucs2(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExW( subkey, NULL, NULL, &type, data, &size );
+ command = qt_winTQString( data ) + "\\command";
+ size = 255;
+ res = RegOpenKeyExW( subkey, (TCHAR*)command.ucs2(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExW( subkey, NULL, NULL, &type, data, &size );
+ command = qt_winTQString( data );
+ } else
+#endif
+ {
+ unsigned char data[256];
+ res = RegOpenKeyExA( HKEY_CLASSES_ROOT, NULL, 0, KEY_READ, &key );
+ res = RegOpenKeyExA( key, sub.local8Bit(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExA( subkey, NULL, NULL, &type, data, &size );
+ command = TQString::fromLocal8Bit( (const char*) data ) + "\\command";
+ size = 255;
+ res = RegOpenKeyExA( subkey, command.local8Bit(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExA( subkey, NULL, NULL, &type, data, &size );
+ command = TQString::fromLocal8Bit( (const char*) data );
+ }
+
+ res = RegCloseKey( subkey );
+ res = RegCloseKey( key );
+
+ TQProcess process( command + " www.trolltech.com/products/download/eval/evaluation.html" );
+ if ( !process.start() )
+ TQMessageBox::information( this, "Register TQt", "Launching your web browser failed.\n"
+ "To register TQt, point your browser to www.trolltech.com/products/download/eval/evaluation.html" );
+#endif
+}
+
+void MainWindow::showProperties( TQObject *o )
+{
+ if ( !o->isWidgetType() ) {
+ propertyEditor->setWidget( o, lastActiveFormWindow );
+ if ( lastActiveFormWindow )
+ hierarchyView->setFormWindow( lastActiveFormWindow, TQT_TQOBJECT(lastActiveFormWindow->mainContainer()) );
+ else
+ hierarchyView->setFormWindow( 0, 0 );
+ return;
+ }
+ TQWidget *w = (TQWidget*)o;
+ setupHierarchyView();
+ FormWindow *fw = (FormWindow*)isAFormWindowChild( w );
+ if ( fw ) {
+ if ( fw->numSelectedWidgets() > 1 ) {
+ TQWidgetList wl = fw->selectedWidgets();
+ if ( wl.first() != w ) {
+ wl.removeRef( w );
+ wl.insert( 0, w );
+ }
+ propertyEditor->setWidget( new PropertyObject( wl ), fw );
+ } else {
+ propertyEditor->setWidget( w, fw );
+ }
+ hierarchyView->setFormWindow( fw, TQT_TQOBJECT(w) );
+ } else {
+ propertyEditor->setWidget( 0, 0 );
+ hierarchyView->setFormWindow( 0, 0 );
+ }
+
+ if ( currentTool() == POINTER_TOOL && fw &&
+ ( !qworkspace->activeWindow() || !::tqqt_cast<SourceEditor*>(qworkspace->activeWindow()) ) )
+ fw->setFocus();
+}
+
+void MainWindow::resetTool()
+{
+ actionPointerTool->setOn( TRUE );
+}
+
+void MainWindow::updateProperties( TQObject * )
+{
+ if ( propertyEditor )
+ propertyEditor->refetchData();
+}
+
+bool MainWindow::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( ::tqqt_cast<MenuBarEditor*>(o) || ::tqqt_cast<PopupMenuEditor*>(o) ||
+ ( o &&
+ ( ::tqqt_cast<MenuBarEditor*>(o->tqparent()) ||
+ ::tqqt_cast<PopupMenuEditor*>(o->tqparent()) ) ) ) {
+
+ if ( e->type() == TQEvent::Accel && ::tqqt_cast<PopupMenuEditor*>(o) ) {
+ return TRUE; // consume accel events
+ } else if ( e->type() == TQEvent::MouseButtonPress && ::tqqt_cast<MenuBarEditor*>(o) ) {
+ TQPoint pos = ((TQMouseEvent*)e)->pos();
+ MenuBarEditor *m = ::tqqt_cast<MenuBarEditor*>(o);
+ showProperties( o );
+ if ( m->tqfindItem( pos ) >= m->count() )
+ m->setFocus();
+ } else if ( e->type() == TQEvent::MouseButtonPress && ::tqqt_cast<PopupMenuEditor*>(o) ) {
+ PopupMenuEditor *m = ::tqqt_cast<PopupMenuEditor*>(o);
+ PopupMenuEditorItem *i = m->at( ((TQMouseEvent*)e)->pos() );
+ if ( m->tqfind( i->action() ) != -1 && !i->isSeparator() )
+ showProperties( i->action() );
+ }
+ return TQMainWindow::eventFilter( o, e );
+ }
+
+ if ( !o || !e || !o->isWidgetType() )
+ return TQMainWindow::eventFilter( o, e );
+
+ TQWidget *w = 0;
+ bool passiveInteractor;
+ switch ( e->type() ) {
+ case TQEvent::AccelOverride:
+ if ( ( (TQKeyEvent*)e )->key() == Qt::Key_F1 &&
+ ( ( (TQKeyEvent*)e )->state() & ShiftButton ) != ShiftButton ) {
+ w = (TQWidget*)o;
+ while ( w ) {
+ if ( ::tqqt_cast<PropertyList*>(w) )
+ break;
+ w = w->parentWidget( TRUE );
+ }
+ if ( w ) {
+ propertyEditor->propertyList()->showCurrentWhatsThis();
+ ( (TQKeyEvent*)e )->accept();
+ return TRUE;
+ }
+ }
+ break;
+ case TQEvent::Accel:
+ if ( ( ( (TQKeyEvent*)e )->key() == Qt::Key_A ||
+ ( (TQKeyEvent*)e )->key() == Qt::Key_E ) &&
+ ( (TQKeyEvent*)e )->state() & ControlButton ) {
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (TQKeyEvent*)e )->ignore();
+ return TRUE;
+ }
+ }
+ break;
+ case TQEvent::ContextMenu:
+ case TQEvent::MouseButtonPress:
+ if ( o && currentTool() == POINTER_TOOL &&
+ ( ::tqqt_cast<MenuBarEditor*>(o) ||
+ ::tqqt_cast<PopupMenuEditor*>(o) ||
+ ::tqqt_cast<TQDesignerToolBar*>(o) ||
+ ( ::tqqt_cast<TQComboBox*>(o) ||
+ ::tqqt_cast<TQToolButton*>(o) ||
+ ::tqqt_cast<TQDesignerToolBarSeparator*>(o) ) &&
+ o->tqparent()
+ && ( ::tqqt_cast<TQDesignerToolBar*>(o->tqparent())
+ || ::tqqt_cast<TQDesignerWidgetStack*>(o->tqparent())) ) ) {
+ TQWidget *w = (TQWidget*)o;
+ if ( ::tqqt_cast<TQToolButton*>(w) ||
+ ::tqqt_cast<TQComboBox*>(w) ||
+ ::tqqt_cast<PopupMenuEditor*>(w) ||
+ ::tqqt_cast<TQDesignerToolBarSeparator*>(w) )
+ w = w->parentWidget();
+ TQWidget *pw = w->parentWidget();
+ while ( pw ) {
+ if ( ::tqqt_cast<FormWindow*>(pw) ) {
+ ( (FormWindow*)pw )->emitShowProperties( w );
+ if ( !::tqqt_cast<TQDesignerToolBar*>(o) )
+ return ( !::tqqt_cast<TQToolButton*>(o) &&
+ !::tqqt_cast<MenuBarEditor*>(o) &&
+ !::tqqt_cast<TQComboBox*>(o) &&
+ !::tqqt_cast<TQDesignerToolBarSeparator*>(o) );
+ }
+ pw = pw->parentWidget();
+ }
+ }
+ if ( o && ( ::tqqt_cast<TQDesignerToolBar*>(o) || o->inherits("TQDockWindowHandle") )
+ && e->type() == TQEvent::ContextMenu )
+ break;
+ if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
+ break;
+ if ( ::tqqt_cast<TQSizeGrip*>(o) )
+ break;
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ if ( !w->hasFocus() )
+ w->setFocus();
+ passiveInteractor = WidgetFactory::isPassiveInteractor( o );
+ if ( !passiveInteractor || currentTool() != ORDER_TOOL ) {
+ if( e->type() == TQEvent::ContextMenu ) {
+ ( (FormWindow*)w )->handleContextMenu( (TQContextMenuEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ return TRUE;
+ } else {
+ ( (FormWindow*)w )->handleMousePress( (TQMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ }
+ }
+ lastPressWidget = (TQWidget*)o;
+ if ( passiveInteractor )
+ TQTimer::singleShot( 0, formWindow(), TQT_SLOT( visibilityChanged() ) );
+ if ( currentTool() == CONNECT_TOOL || currentTool() == BUDDY_TOOL )
+ return TRUE;
+ return !passiveInteractor;
+ case TQEvent::MouseButtonRelease:
+ lastPressWidget = 0;
+ if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
+ break;
+ if ( ::tqqt_cast<TQSizeGrip*>(o) )
+ break;
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ passiveInteractor = WidgetFactory::isPassiveInteractor( o );
+ if ( !passiveInteractor )
+ ( (FormWindow*)w )->handleMouseRelease( (TQMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ if ( passiveInteractor ) {
+ TQTimer::singleShot( 0, this, TQT_SLOT( selectionChanged() ) );
+ TQTimer::singleShot( 0, formWindow(), TQT_SLOT( visibilityChanged() ) );
+ }
+ return !passiveInteractor;
+ case TQEvent::MouseMove:
+ if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
+ break;
+ w = isAFormWindowChild( o );
+ if ( lastPressWidget != (TQWidget*)o && w &&
+ !::tqqt_cast<SizeHandle*>(o) && !::tqqt_cast<OrderIndicator*>(o) &&
+ !::tqqt_cast<PopupMenuEditor*>(o) && !::tqqt_cast<TQMenuBar*>(o) &&
+ !::tqqt_cast<TQSizeGrip*>(o) )
+ return TRUE;
+ if ( o && ::tqqt_cast<TQSizeGrip*>(o) )
+ break;
+ if ( lastPressWidget != (TQWidget*)o ||
+ ( !w || ::tqqt_cast<SizeHandle*>(o) ) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ passiveInteractor = WidgetFactory::isPassiveInteractor( o );
+ if ( !passiveInteractor )
+ ( (FormWindow*)w )->handleMouseMove( (TQMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ return !passiveInteractor;
+ case TQEvent::KeyPress:
+ if ( ( (TQKeyEvent*)e )->key() == Key_Escape && currentTool() != POINTER_TOOL ) {
+ resetTool();
+ return FALSE;
+ }
+ if ( ( (TQKeyEvent*)e )->key() == Key_Escape && incrementalSearch->hasFocus() ) {
+ if ( ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ qWorkspace()->activeWindow()->setFocus();
+ return TRUE;
+ }
+ }
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ ( (FormWindow*)w )->handleKeyPress( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
+ if ( ((TQKeyEvent*)e)->isAccepted() )
+ return TRUE;
+ break;
+ case TQEvent::MouseButtonDblClick:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) ) {
+ if ( ::tqqt_cast<TQToolButton*>(o) && ((TQToolButton*)o)->isOn() &&
+ o->tqparent() && ::tqqt_cast<TQToolBar*>(o->tqparent()) && formWindow() )
+ formWindow()->setToolFixed();
+ break;
+ }
+ if ( currentTool() == ORDER_TOOL ) {
+ ( (FormWindow*)w )->handleMouseDblClick( (TQMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ return TRUE;
+ }
+ if ( !WidgetFactory::isPassiveInteractor( o ) && ( (FormWindow*)w )->formFile() )
+ return openEditor( ( (FormWindow*)w )->designerWidget( o ), (FormWindow*)w );
+ return TRUE;
+ case TQEvent::KeyRelease:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ ( (FormWindow*)w )->handleKeyRelease( (TQKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
+ if ( ((TQKeyEvent*)e)->isAccepted() )
+ return TRUE;
+ break;
+ case TQEvent::Hide:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ if ( ( (FormWindow*)w )->isWidgetSelected( (TQWidget*)o ) )
+ ( (FormWindow*)w )->selectWidget( (TQWidget*)o, FALSE );
+ break;
+ case TQEvent::Enter:
+ case TQEvent::Leave:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) ||
+ ::tqqt_cast<MenuBarEditor*>(o) )
+ break;
+ return TRUE;
+ case TQEvent::Resize:
+ case TQEvent::Move:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ if ( WidgetFactory::layoutType( (TQWidget*)o->tqparent() ) != WidgetFactory::NoLayout ) {
+ ( (FormWindow*)w )->updateSelection( (TQWidget*)o );
+ if ( e->type() != TQEvent::Resize )
+ ( (FormWindow*)w )->updateChildSelections( (TQWidget*)o );
+ }
+ break;
+ case TQEvent::Close:
+ if ( o->isWidgetType() && (TQWidget*)o == (TQWidget*)previewedForm ) {
+ if ( lastActiveFormWindow && lastActiveFormWindow->project() ) {
+ TQStringList lst =
+ MetaDataBase::fakeProperty( lastActiveFormWindow, "database" ).toStringList();
+ lastActiveFormWindow->project()->closeDatabase( lst[ 0 ] );
+ }
+ }
+ break;
+ case TQEvent::DragEnter:
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(qWorkspace()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(workspace()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(workspace()->viewport()) ) {
+ workspace()->contentsDragEnterEvent( (TQDragEnterEvent*)e );
+ return TRUE;
+ }
+ break;
+ case TQEvent::DragMove:
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(qWorkspace()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(workspace()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(workspace()->viewport()) ) {
+ workspace()->contentsDragMoveEvent( (TQDragMoveEvent*)e );
+ return TRUE;
+ }
+ break;
+ case TQEvent::Drop:
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(qWorkspace()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(workspace()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(workspace()->viewport()) ) {
+ workspace()->contentsDropEvent( (TQDropEvent*)e );
+ return TRUE;
+ }
+ break;
+ case TQEvent::Show:
+ if ( o != TQT_TQOBJECT(this) )
+ break;
+ if ( ((TQShowEvent*)e)->spontaneous() )
+ break;
+ TQApplication::sendPostedEvents( qworkspace, TQEvent::ChildInserted );
+ showEvent( (TQShowEvent*)e );
+ checkTempFiles();
+ return TRUE;
+ case TQEvent::Wheel:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::tqqt_cast<SizeHandle*>(o) ||
+ ::tqqt_cast<OrderIndicator*>(o) )
+ break;
+ return TRUE;
+ case TQEvent::FocusIn:
+ if ( !::tqqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
+ return TRUE; //FIXME
+ if ( hierarchyView->formDefinitionView()->isRenaming()
+ && ( o->inherits( "Editor" ) || ::tqqt_cast<FormWindow*>(o) ) )
+ TQApplication::sendPostedEvents();
+ if ( o->inherits( "Editor" ) ) {
+ TQWidget *w = (TQWidget*)o;
+ while ( w ) {
+ if ( ::tqqt_cast<SourceEditor*>(w) )
+ break;
+ w = w->parentWidget( TRUE );
+ }
+ if ( ::tqqt_cast<SourceEditor*>(w) )
+ ( (SourceEditor*)w )->checkTimeStamp();
+ } else if ( ::tqqt_cast<FormWindow*>(o) ) {
+ FormWindow *fw = (FormWindow*)o;
+ if ( fw->formFile() && fw->formFile()->editor() )
+ fw->formFile()->editor()->checkTimeStamp();
+ }
+ break;
+ case TQEvent::FocusOut:
+ if ( !::tqqt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
+ return TRUE;
+ break;
+ default:
+ return TQMainWindow::eventFilter( o, e );
+ }
+
+ return TQMainWindow::eventFilter( o, e );
+}
+
+TQWidget *MainWindow::isAFormWindowChild( TQT_BASE_OBJECT_NAME *o ) const
+{
+ if ( ::tqqt_cast<TQWizard*>(TQT_TQOBJECT(o)->tqparent()) && !::tqqt_cast<TQPushButton*>(o) )
+ return 0;
+ while ( o ) {
+ if ( ::tqqt_cast<FormWindow*>(o) )
+ return (TQWidget*)o;
+ o = TQT_TQOBJECT(o)->tqparent();
+ }
+ return 0;
+}
+
+TQWidget *MainWindow::isAToolBarChild( TQT_BASE_OBJECT_NAME *o ) const
+{
+ while ( o ) {
+ if ( ::tqqt_cast<TQDesignerToolBar*>(o) )
+ return (TQWidget*)o;
+ if ( ::tqqt_cast<FormWindow*>(o) )
+ return 0;
+ o = TQT_TQOBJECT(o)->tqparent();
+ }
+ return 0;
+}
+
+FormWindow *MainWindow::formWindow()
+{
+ if ( qworkspace->activeWindow() ) {
+ FormWindow *fw = 0;
+ if ( ::tqqt_cast<FormWindow*>(qworkspace->activeWindow()) )
+ fw = (FormWindow*)qworkspace->activeWindow();
+ else if ( lastActiveFormWindow &&
+ qworkspace->windowList().tqfind( lastActiveFormWindow ) != -1)
+ fw = lastActiveFormWindow;
+ return fw;
+ }
+ return 0;
+}
+
+void MainWindow::emitProjectSignals()
+{
+ emit hasNonDummyProject( !currentProject->isDummy() );
+ emit hasActiveWindowOrProject( !!qworkspace->activeWindow() || !currentProject->isDummy() );
+}
+
+void MainWindow::insertFormWindow( FormWindow *fw )
+{
+ if ( fw )
+ TQWhatsThis::add( fw, tr( "<b>The Form Window</b>"
+ "<p>Use the various tools to add widgets or to change the tqlayout "
+ "and behavior of the components in the form. Select one or multiple "
+ "widgets to move them or lay them out. If a single widget is chosen it can "
+ "be resized using the resize handles.</p>"
+ "<p>Changes in the <b>Property Editor</b> are visible at design time, "
+ "and you can preview the form in different styles.</p>"
+ "<p>You can change the grid resolution, or turn the grid off in the "
+ "<b>Preferences</b> dialog in the <b>Edit</b> menu."
+ "<p>You can have several forms open, and all open forms are listed "
+ "in the <b>Form List</b>.") );
+
+ connect( fw, TQT_SIGNAL( showProperties( TQObject * ) ),
+ this, TQT_SLOT( showProperties( TQObject * ) ) );
+ connect( fw, TQT_SIGNAL( updateProperties( TQObject * ) ),
+ this, TQT_SLOT( updateProperties( TQObject * ) ) );
+ connect( this, TQT_SIGNAL( currentToolChanged() ),
+ fw, TQT_SLOT( currentToolChanged() ) );
+ connect( fw, TQT_SIGNAL( selectionChanged() ),
+ this, TQT_SLOT( selectionChanged() ) );
+ connect( fw, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ),
+ this, TQT_SLOT( updateUndoRedo( bool, bool, const TQString &, const TQString & ) ) );
+
+ if ( !mblockNewForms ) {
+ } else {
+ fw->setProject( currentProject );
+ }
+ fw->show();
+ fw->currentToolChanged();
+ if ( fw->caption().isEmpty() && tqstrlen( fw->name() ) )
+ fw->setCaption( fw->name() );
+ fw->mainContainer()->setCaption( fw->caption() );
+ WidgetFactory::saveDefaultProperties( fw->mainContainer(),
+ WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( fw->mainContainer() ) ) );
+ activeWindowChanged( fw );
+ emit formWindowsChanged();
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->project() == fw->project() )
+ e->resetContext();
+ }
+}
+
+void MainWindow::createNewProject( const TQString &lang )
+{
+ Project *pro = new Project( "", "", projectSettingsPluginManager );
+ pro->setLanguage( lang );
+
+
+ if ( !openProjectSettings( pro ) ) {
+ delete pro;
+ return;
+ }
+
+ if ( !pro->isValid() ) {
+ TQMessageBox::information( this, tr("New Project"), tr( "Cannot create an invalid project." ) );
+ delete pro;
+ return;
+ }
+
+ TQAction *a = new TQAction( pro->makeRelative( pro->fileName() ),
+ pro->makeRelative( pro->fileName() ), 0, actionGroupProjects, 0, TRUE );
+ projects.insert( a, pro );
+ addRecentlyOpened( pro->makeAbsolute( pro->fileName() ), recentlyProjects );
+ projectSelected( a );
+}
+
+
+bool MainWindow::unregisterClient( FormWindow *w )
+{
+ propertyEditor->closed( w );
+ objectHierarchy()->closed( w );
+ if ( w == lastActiveFormWindow )
+ lastActiveFormWindow = 0;
+
+ TQPtrList<SourceEditor> waitingForDelete;
+ waitingForDelete.setAutoDelete( TRUE );
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( TQT_BASE_OBJECT(e->object()) == TQT_BASE_OBJECT(w) )
+ waitingForDelete.append( e );
+ }
+
+ if ( actionEditor->form() == w ) {
+ actionEditor->setFormWindow( 0 );
+ actionEditor->parentWidget()->hide();
+ }
+
+ return TRUE;
+}
+
+void MainWindow::activeWindowChanged( TQWidget *w )
+{
+ TQWidget *old = formWindow();
+ if ( ::tqqt_cast<FormWindow*>(w) ) {
+ FormWindow *fw = (FormWindow*)w;
+ FormWindow *ofw = lastActiveFormWindow;
+ lastActiveFormWindow = fw;
+ lastActiveFormWindow->updateUndoInfo();
+ emit hasActiveForm( TRUE );
+ if ( formWindow() ) {
+ formWindow()->emitShowProperties();
+ emit formModified( formWindow()->commandHistory()->isModified() );
+ if ( currentTool() != POINTER_TOOL )
+ formWindow()->clearSelection();
+ }
+ workspace()->activeFormChanged( fw );
+ setAppropriate( (TQDockWindow*)actionEditor->parentWidget(),
+ ::tqqt_cast<TQMainWindow*>(lastActiveFormWindow->mainContainer()) );
+ if ( appropriate( (TQDockWindow*)actionEditor->parentWidget() ) ) {
+ if ( actionEditor->wantToBeShown() )
+ actionEditor->parentWidget()->show();
+ } else {
+ TQWidget *mc = 0;
+ if ( ofw && (mc = ofw->mainContainer()) && ::tqqt_cast<TQMainWindow*>(mc) )
+ actionEditor->setWantToBeShown( !actionEditor->parentWidget()->isHidden() );
+ actionEditor->parentWidget()->hide();
+ }
+
+ actionEditor->setFormWindow( lastActiveFormWindow );
+ if ( wspace && fw->project() && fw->project() != currentProject ) {
+ for ( TQMap<TQAction*, Project *>::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( *it == fw->project() ) {
+ projectSelected( it.key() );
+ break;
+ }
+ }
+ }
+ emit formWindowChanged();
+
+ } else if ( w == propertyEditor ) {
+ propertyEditor->resetFocus();
+ } else if ( !lastActiveFormWindow ) {
+ emit formWindowChanged();
+ emit hasActiveForm( FALSE );
+ actionEditUndo->setEnabled( FALSE );
+ actionEditRedo->setEnabled( FALSE );
+ }
+
+ if ( !w ) {
+ emit formWindowChanged();
+ emit hasActiveForm( FALSE );
+ propertyEditor->clear();
+ hierarchyView->clear();
+ updateUndoRedo( FALSE, FALSE, TQString(), TQString() );
+ }
+
+ selectionChanged();
+
+ if ( ::tqqt_cast<SourceEditor*>(w) ) {
+ SourceEditor *se = (SourceEditor*)w;
+ TQGuardedPtr<FormWindow> fw = se->formWindow();
+ if ( se->formWindow() &&
+ lastActiveFormWindow != fw ) {
+ activeWindowChanged( se->formWindow() );
+ }
+ actionSearchFind->setEnabled( TRUE );
+ actionSearchIncremetal->setEnabled( TRUE );
+ actionSearchReplace->setEnabled( TRUE );
+ actionSearchGotoLine->setEnabled( TRUE );
+ incrementalSearch->setEnabled( TRUE );
+
+ actionEditUndo->setEnabled( FALSE );
+ actionEditRedo->setEnabled( FALSE );
+ actionEditCut->setEnabled( TRUE );
+ actionEditCopy->setEnabled( TRUE );
+ // actionEditPaste will be updated by calling clipboardChanged()
+ actionEditSelectAll->setEnabled( TRUE );
+ actionEditUndo->setMenuText( tr( "&Undo" ) );
+ actionEditUndo->setToolTip( textNoAccel( actionEditUndo->menuText()) );
+ actionEditRedo->setMenuText( tr( "&Redo" ) );
+ actionEditRedo->setToolTip( textNoAccel( actionEditRedo->menuText()) );
+ if ( hierarchyView->sourceEditor() != w )
+ hierarchyView->showClasses( se );
+ actionEditor->setFormWindow( 0 );
+ if ( wspace && se->project() && se->project() != currentProject ) {
+ for ( TQMap<TQAction*, Project *>::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( *it == se->project() ) {
+ projectSelected( it.key() );
+ break;
+ }
+ }
+ }
+ workspace()->activeEditorChanged( se );
+ } else {
+ actionSearchFind->setEnabled( FALSE );
+ actionSearchIncremetal->setEnabled( FALSE );
+ actionSearchReplace->setEnabled( FALSE );
+ actionSearchGotoLine->setEnabled( FALSE );
+ incrementalSearch->setEnabled( FALSE );
+ }
+
+ clipboardChanged(); // update actionEditPaste
+
+ if ( currentTool() == ORDER_TOOL && w != old )
+ emit currentToolChanged();
+
+ emit hasActiveWindow( !!qworkspace->activeWindow() );
+}
+
+void MainWindow::updateUndoRedo( bool undoAvailable, bool redoAvailable,
+ const TQString &undoCmd, const TQString &redoCmd )
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return; // do not set a formWindow related command
+ actionEditUndo->setEnabled( undoAvailable );
+ actionEditRedo->setEnabled( redoAvailable );
+ if ( !undoCmd.isEmpty() )
+ actionEditUndo->setMenuText( tr( "&Undo: %1" ).arg( undoCmd ) );
+ else
+ actionEditUndo->setMenuText( tr( "&Undo: Not Available" ) );
+ if ( !redoCmd.isEmpty() )
+ actionEditRedo->setMenuText( tr( "&Redo: %1" ).arg( redoCmd ) );
+ else
+ actionEditRedo->setMenuText( tr( "&Redo: Not Available" ) );
+
+ actionEditUndo->setToolTip( textNoAccel( actionEditUndo->menuText()) );
+ actionEditRedo->setToolTip( textNoAccel( actionEditRedo->menuText()) );
+
+ if ( currentTool() == ORDER_TOOL ) {
+ actionEditUndo->setEnabled( FALSE );
+ actionEditRedo->setEnabled( FALSE );
+ }
+}
+
+void MainWindow::updateEditorUndoRedo()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+ SourceEditor *editor = (SourceEditor*)qWorkspace()->activeWindow();
+ actionEditUndo->setEnabled( editor->editIsUndoAvailable() );
+ actionEditRedo->setEnabled( editor->editIsRedoAvailable() );
+}
+
+TQWorkspace *MainWindow::qWorkspace() const
+{
+ return qworkspace;
+}
+
+void MainWindow::popupFormWindowMenu( const TQPoint & gp, FormWindow *fw )
+{
+ TQValueList<uint> ids;
+ TQMap<TQString, int> commands;
+
+ setupRMBSpecialCommands( ids, commands, fw );
+ setupRMBProperties( ids, commands, fw );
+
+ tqApp->processEvents();
+ int r = rmbFormWindow->exec( gp );
+
+ handleRMBProperties( r, commands, fw );
+ handleRMBSpecialCommands( r, commands, fw );
+
+ for ( TQValueList<uint>::ConstIterator i = ids.begin(); i != ids.end(); ++i )
+ rmbFormWindow->removeItem( *i );
+}
+
+void MainWindow::popupWidgetMenu( const TQPoint &gp, FormWindow * /*fw*/, TQWidget * w)
+{
+ TQValueList<uint> ids;
+ TQMap<TQString, int> commands;
+
+ setupRMBSpecialCommands( ids, commands, w );
+ setupRMBProperties( ids, commands, w );
+
+ tqApp->processEvents();
+ int r = rmbWidgets->exec( gp );
+
+ handleRMBProperties( r, commands, w );
+ handleRMBSpecialCommands( r, commands, w );
+
+ for ( TQValueList<uint>::ConstIterator i = ids.begin(); i != ids.end(); ++i )
+ rmbWidgets->removeItem( *i );
+}
+
+void MainWindow::setupRMBProperties( TQValueList<uint> &ids, TQMap<TQString, int> &props, TQWidget *w )
+{
+ const TQMetaProperty* text = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "text", TRUE ), TRUE );
+ if ( text && qstrcmp( text->type(), "TQString") != 0 )
+ text = 0;
+ const TQMetaProperty* title = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "title", TRUE ), TRUE );
+ if ( title && qstrcmp( title->type(), "TQString") != 0 )
+ title = 0;
+ const TQMetaProperty* pagetitle =
+ w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "pageTitle", TRUE ), TRUE );
+ if ( pagetitle && qstrcmp( pagetitle->type(), "TQString") != 0 )
+ pagetitle = 0;
+ const TQMetaProperty* pixmap =
+ w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "pixmap", TRUE ), TRUE );
+ if ( pixmap && qstrcmp( pixmap->type(), "TQPixmap") != 0 )
+ pixmap = 0;
+
+ if ( text && text->designable(w) ||
+ title && title->designable(w) ||
+ pagetitle && pagetitle->designable(w) ||
+ pixmap && pixmap->designable(w) ) {
+ int id = 0;
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator(0);
+ if ( pixmap && pixmap->designable(w) ) {
+ ids << ( id = rmbWidgets->insertItem( tr("Choose Pixmap..."), -1, 0) );
+ props.insert( "pixmap", id );
+ }
+ if ( text && text->designable(w) && !::tqqt_cast<TQTextEdit*>(w) ) {
+ ids << ( id = rmbWidgets->insertItem( tr("Edit Text..."), -1, 0) );
+ props.insert( "text", id );
+ }
+ if ( title && title->designable(w) ) {
+ ids << ( id = rmbWidgets->insertItem( tr("Edit Title..."), -1, 0) );
+ props.insert( "title", id );
+ }
+ if ( pagetitle && pagetitle->designable(w) ) {
+ ids << ( id = rmbWidgets->insertItem( tr("Edit Page Title..."), -1, 0) );
+ props.insert( "pagetitle", id );
+ }
+ }
+}
+
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+static TQWidgetContainerInterfacePrivate *containerWidgetInterface( TQWidget *w )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( w ), &iface );
+ if ( !iface )
+ return 0;
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
+ if ( !iface2 )
+ return 0;
+ iface->release();
+ return iface2;
+}
+#endif
+
+void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
+ TQMap<TQString, int> &commands, TQWidget *w )
+{
+ int id;
+
+ if ( ::tqqt_cast<TQTabWidget*>(w) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ if ( ( (TQDesignerTabWidget*)w )->count() > 1) {
+ ids << ( id = rmbWidgets->insertItem( tr("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( tr("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+ } else if ( ::tqqt_cast<TQDesignerWidgetStack*>(w) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ if ( ( (TQDesignerWidgetStack*)w )->count() > 1) {
+ ids << ( id = rmbWidgets->insertItem( tr("Previous Page"), -1, 0 ) );
+ commands.insert( "prevpage", id );
+ ids << ( id = rmbWidgets->insertItem( tr("Next Page"), -1, 0 ) );
+ ids << rmbWidgets->insertSeparator( 0 );
+ commands.insert( "nextpage", id );
+ ids << ( id = rmbWidgets->insertItem( tr("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( tr("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+ } else if ( ::tqqt_cast<TQToolBox*>(w) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ if ( ( (TQToolBox*)w )->count() > 1 ) {
+ ids << ( id = rmbWidgets->insertItem( tr("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( tr("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( WidgetDatabase::
+ isCustomPluginWidget( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ TQWidgetContainerInterfacePrivate *iface = containerWidgetInterface( w );
+ if ( iface && iface->supportsPages( WidgetFactory::classNameOf( w ) ) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+
+ if ( iface->count( WidgetFactory::classNameOf( w ), w ) > 1 ) {
+ ids << ( id = rmbWidgets->insertItem( tr( "Delete Page" ), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( tr("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+ if ( iface->currentIndex( WidgetFactory::classNameOf( w ), w ) != -1 ) {
+ ids << ( id = rmbWidgets->insertItem( tr("Rename Current Page..."), -1, 0 ) );
+ commands.insert( "rename", id );
+ }
+ }
+ if ( iface )
+ iface->release();
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+ }
+
+ if ( WidgetFactory::hasSpecialEditor( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), TQT_TQOBJECT(w) ) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ ids << ( id = rmbWidgets->insertItem( tr("Edit..."), -1, 0 ) );
+ commands.insert( "edit", id );
+ }
+}
+
+void MainWindow::setupRMBSpecialCommands( TQValueList<uint> &ids,
+ TQMap<TQString, int> &commands, FormWindow *fw )
+{
+ int id;
+
+ if ( ::tqqt_cast<TQWizard*>(fw->mainContainer()) ) {
+ if ( ids.isEmpty() )
+ ids << rmbFormWindow->insertSeparator( 0 );
+
+ if ( ( (TQWizard*)fw->mainContainer() )->pageCount() > 1) {
+ ids << ( id = rmbFormWindow->insertItem( tr("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+
+ ids << ( id = rmbFormWindow->insertItem( tr("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+
+ ids << ( id = rmbFormWindow->insertItem( tr("Edit Page Title..."), -1, 0 ) );
+ commands.insert( "rename", id );
+
+ ids << ( id = rmbFormWindow->insertItem( tr("Edit Pages..."), -1, 0 ) );
+ commands.insert( "edit", id );
+
+ } else if ( ::tqqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
+ if ( ids.isEmpty() )
+ ids << rmbFormWindow->insertSeparator( 0 );
+ ids << ( id = rmbFormWindow->insertItem( tr( "Add Menu Item" ), -1, 0 ) );
+ commands.insert( "add_menu_item", id );
+ ids << ( id = rmbFormWindow->insertItem( tr( "Add Toolbar" ), -1, 0 ) );
+ commands.insert( "add_toolbar", id );
+ }
+}
+
+void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWidget *w )
+{
+ if ( id == props[ "text" ] ) {
+ bool ok = FALSE;
+ bool oldDoWrap = FALSE;
+ if ( ::tqqt_cast<TQLabel*>(w) ) {
+ int align = w->property( "tqalignment" ).toInt();
+ if ( align & TQt::WordBreak )
+ oldDoWrap = TRUE;
+ }
+ bool doWrap = oldDoWrap;
+
+ TQString text;
+ if ( ::tqqt_cast<TQTextView*>(w) || ::tqqt_cast<TQLabel*>(w) || ::tqqt_cast<TQButton*>(w) ) {
+ text = MultiLineEditor::getText( this, w->property( "text" ).toString(), !::tqqt_cast<TQButton*>(w), &doWrap );
+ ok = !text.isNull();
+ } else {
+ text = TQInputDialog::getText( tr("Text"), tr( "New text" ),
+ TQLineEdit::Normal, w->property("text").toString(), &ok, this );
+ }
+ if ( ok ) {
+ if ( oldDoWrap != doWrap ) {
+ TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "wordwrap", TQVariant( oldDoWrap, 0 ),
+ TQVariant( doWrap, 0 ), TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
+ }
+
+ TQString pn( tr( "Set the 'text' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "text", w->property( "text" ),
+ text, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "text", TRUE );
+ }
+ } else if ( id == props[ "title" ] ) {
+ bool ok = FALSE;
+ TQString title = TQInputDialog::getText( tr("Title"), tr( "New title" ),
+ TQLineEdit::Normal, w->property("title").toString(), &ok, this );
+ if ( ok ) {
+ TQString pn( tr( "Set the 'title' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "title", w->property( "title" ),
+ title, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "title", TRUE );
+ }
+ } else if ( id == props[ "pagetitle" ] ) {
+ bool ok = FALSE;
+ TQString text = TQInputDialog::getText( tr("Page Title"), tr( "New page title" ),
+ TQLineEdit::Normal, w->property("pageTitle").toString(), &ok, this );
+ if ( ok ) {
+ TQString pn( tr( "Set the 'pageTitle' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "pageTitle",
+ w->property( "pageTitle" ),
+ text, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "pageTitle", TRUE );
+ }
+ } else if ( id == props[ "pixmap" ] ) {
+ TQPixmap oldPix = TQT_TQVARIANT_OBJECT(w->property( "pixmap" )).toPixmap();
+ TQPixmap pix = qChoosePixmap( this, formWindow(), oldPix );
+ if ( !pix.isNull() ) {
+ TQString pn( tr( "Set the 'pixmap' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "pixmap", w->property( "pixmap" ),
+ pix, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "pixmap", TRUE );
+ }
+ }
+}
+
+void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, TQWidget *w )
+{
+ if ( ::tqqt_cast<TQTabWidget*>(w) ) {
+ TQTabWidget *tw = (TQTabWidget*)w;
+ if ( id == commands[ "add" ] ) {
+ AddTabPageCommand *cmd =
+ new AddTabPageCommand( tr( "Add Page to %1" ).arg( tw->name() ), formWindow(),
+ tw, "Tab" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( tw->currentPage() ) {
+ TQDesignerTabWidget *dtw = (TQDesignerTabWidget*)tw;
+ DeleteTabPageCommand *cmd =
+ new DeleteTabPageCommand( tr( "Delete Page %1 of %2" ).
+ arg( dtw->pageTitle() ).arg( tw->name() ),
+ formWindow(), tw, tw->currentPage() );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ } else if ( ::tqqt_cast<TQToolBox*>(w) ) {
+ TQToolBox *tb = (TQToolBox*)w;
+ if ( id == commands[ "add" ] ) {
+ AddToolBoxPageCommand *cmd =
+ new AddToolBoxPageCommand( tr( "Add Page to %1" ).arg( tb->name() ),
+ formWindow(),
+ tb, "Page" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( tb->currentItem() ) {
+ DeleteToolBoxPageCommand *cmd =
+ new DeleteToolBoxPageCommand( tr( "Delete Page %1 of %2" ).
+ arg( tb->itemLabel( tb->currentIndex() ) ).
+ arg( tb->name() ),
+ formWindow(), tb, tb->currentItem() );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ } else if ( ::tqqt_cast<TQWidgetStack*>(w) ) {
+ TQDesignerWidgetStack *ws = (TQDesignerWidgetStack*)w;
+ if ( id == commands[ "add" ] ) {
+ AddWidgetStackPageCommand *cmd =
+ new AddWidgetStackPageCommand( tr( "Add Page to %1" ).arg( ws->name() ),
+ formWindow(), ws );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( ws->visibleWidget() ) {
+ DeleteWidgetStackPageCommand *cmd =
+ new DeleteWidgetStackPageCommand( tr( "Delete Page %1 of %2" ).
+ arg( ws->currentPage() ).arg( ws->name() ),
+ formWindow(), ws, ws->visibleWidget() );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( id == commands[ "nextpage" ] ) {
+ int currentPage = w->property( "currentPage" ).toInt();
+ TQString pn( tr( "Raise next page of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd =
+ new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "currentPage", currentPage,
+ currentPage + 1, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "currentPage", TRUE );
+ } else if ( id == commands[ "prevpage" ] ) {
+ int currentPage = w->property( "currentPage" ).toInt();
+ TQString pn( tr( "Raise previous page of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd =
+ new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "currentPage", currentPage,
+ currentPage -1, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "currentPage", TRUE );
+ }
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( WidgetDatabase::
+ isCustomPluginWidget( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ if ( id == commands[ "add" ] ) {
+ AddContainerPageCommand *cmd =
+ new AddContainerPageCommand( tr( "Add Page to %1" ).arg( w->name() ),
+ formWindow(), w, "Page" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ TQWidgetContainerInterfacePrivate *iface = containerWidgetInterface( w );
+ if ( iface ) {
+ TQString wClassName = WidgetFactory::classNameOf( w );
+ int index = iface->currentIndex( wClassName, w );
+ DeleteContainerPageCommand *cmd =
+ new DeleteContainerPageCommand( tr( "Delete Page %1 of %2" ).
+ arg( iface->pageLabel( wClassName,
+ w, index ) ).
+ arg( w->name() ),
+ formWindow(), w, index );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ iface->release();
+ }
+ } else if ( id == commands[ "rename" ] ) {
+ TQWidgetContainerInterfacePrivate *iface = containerWidgetInterface( w );
+ if ( iface ) {
+ bool ok = FALSE;
+ TQString wClassName = WidgetFactory::classNameOf( w );
+ int index = iface->currentIndex( wClassName, w );
+ TQString text = TQInputDialog::getText( tr("Page Title"), tr( "New page title" ),
+ TQLineEdit::Normal,
+ iface->pageLabel( wClassName, w,
+ index ),
+ &ok, this );
+ if ( ok ) {
+ RenameContainerPageCommand *cmd =
+ new RenameContainerPageCommand( tr( "Rename Page %1 to %2" ).
+ arg( iface->
+ pageLabel( wClassName, w,
+ index ) ).
+ arg( text ), formWindow(),
+ w, index, text );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ iface->release();
+ }
+ }
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+ }
+
+ if ( WidgetFactory::hasSpecialEditor( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), TQT_TQOBJECT(w) ) ) {
+ if ( id == commands[ "edit" ] )
+ WidgetFactory::editWidget( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), this, w, formWindow() );
+ }
+}
+
+void MainWindow::handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, FormWindow *fw )
+{
+ if ( ::tqqt_cast<TQWizard*>(fw->mainContainer()) ) {
+ TQWizard *wiz = (TQWizard*)fw->mainContainer();
+ if ( id == commands[ "add" ] ) {
+ AddWizardPageCommand *cmd =
+ new AddWizardPageCommand( tr( "Add Page to %1" ).arg( wiz->name() ),
+ formWindow(), wiz, "WizardPage" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( wiz->currentPage() ) {
+ TQDesignerWizard *dw = (TQDesignerWizard*)wiz;
+ DeleteWizardPageCommand *cmd =
+ new DeleteWizardPageCommand( tr( "Delete Page %1 of %2" ).
+ arg( dw->pageTitle() ).arg( wiz->name() ),
+ formWindow(), wiz,
+ wiz->indexOf( wiz->currentPage() ) );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( id == commands[ "edit" ] ) {
+ WizardEditor *e = new WizardEditor( this, wiz, fw );
+ e->exec();
+ delete e;
+ } else if ( id == commands[ "rename" ] ) {
+
+ bool ok = FALSE;
+ TQDesignerWizard *dw = (TQDesignerWizard*)wiz;
+ TQString text = TQInputDialog::getText( tr("Page Title"), tr( "New page title" ),
+ TQLineEdit::Normal, dw->pageTitle(), &ok, this );
+ if ( ok ) {
+ TQString pn( tr( "Rename page %1 of %2" ).arg( dw->pageTitle() ).arg( wiz->name() ) );
+ RenameWizardPageCommand *cmd =
+ new RenameWizardPageCommand( pn, formWindow()
+ , wiz, wiz->indexOf( wiz->currentPage() ), text );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ } else if ( ::tqqt_cast<TQMainWindow*>(fw->mainContainer()) ) {
+ TQMainWindow *mw = (TQMainWindow*)fw->mainContainer();
+ if ( id == commands[ "add_toolbar" ] ) {
+ AddToolBarCommand *cmd =
+ new AddToolBarCommand( tr( "Add Toolbar to '%1'" ).arg( formWindow()->name() ),
+ formWindow(), mw );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "add_menu_item" ] ) {
+ AddMenuCommand *cmd =
+ new AddMenuCommand( tr( "Add Menu to '%1'" ).arg( formWindow()->name() ),
+ formWindow(), mw );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+}
+
+void MainWindow::clipboardChanged()
+{
+ TQString text( tqApp->clipboard()->text() );
+ if (qWorkspace()->activeWindow() && ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow())) {
+ actionEditPaste->setEnabled(!text.isEmpty());
+ } else {
+ TQString start( "<!DOCTYPE UI-SELECTION>" );
+ actionEditPaste->setEnabled( text.left( start.length() ) == start );
+ }
+}
+
+void MainWindow::selectionChanged()
+{
+ layoutChilds = FALSE;
+ layoutSelected = FALSE;
+ breakLayout = FALSE;
+ if ( !formWindow() ) {
+ actionEditCut->setEnabled( FALSE );
+ actionEditCopy->setEnabled( FALSE );
+ actionEditDelete->setEnabled( FALSE );
+ actionEditAdjustSize->setEnabled( FALSE );
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditSplitHorizontal->setEnabled( FALSE );
+ actionEditSplitVertical->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ actionEditLower->setEnabled( FALSE );
+ actionEditRaise->setEnabled( FALSE );
+ actionEditAdjustSize->setEnabled( FALSE );
+ return;
+ }
+
+ int selectedWidgets = formWindow()->numSelectedWidgets();
+ bool enable = selectedWidgets > 0;
+ actionEditCut->setEnabled( enable );
+ actionEditCopy->setEnabled( enable );
+ actionEditDelete->setEnabled( enable );
+ actionEditLower->setEnabled( enable );
+ actionEditRaise->setEnabled( enable );
+
+ actionEditAdjustSize->setEnabled( FALSE );
+ actionEditSplitHorizontal->setEnabled( FALSE );
+ actionEditSplitVertical->setEnabled( FALSE );
+
+ enable = FALSE;
+ TQWidgetList widgets = formWindow()->selectedWidgets();
+ if ( selectedWidgets > 1 ) {
+ int unlaidout = 0;
+ int laidout = 0;
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout )
+ unlaidout++;
+ else
+ laidout++;
+ }
+ actionEditHLayout->setEnabled( unlaidout > 1 );
+ actionEditVLayout->setEnabled( unlaidout > 1 );
+ actionEditSplitHorizontal->setEnabled( unlaidout > 1 );
+ actionEditSplitVertical->setEnabled( unlaidout > 1 );
+ actionEditGridLayout->setEnabled( unlaidout > 1 );
+ actionEditBreakLayout->setEnabled( laidout > 0 );
+ actionEditAdjustSize->setEnabled( laidout > 0 );
+ layoutSelected = unlaidout > 1;
+ breakLayout = laidout > 0;
+ } else if ( selectedWidgets == 1 ) {
+ TQWidget *w = widgets.first();
+ bool isContainer = WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ||
+ w == formWindow()->mainContainer();
+ actionEditAdjustSize->setEnabled( !w->parentWidget() ||
+ WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout );
+
+ if ( !isContainer ) {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) {
+ actionEditBreakLayout->setEnabled( !isAToolBarChild( w ) );
+ breakLayout = TRUE;
+ } else {
+ actionEditBreakLayout->setEnabled( FALSE );
+ }
+ } else {
+ if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) {
+ if ( !formWindow()->hasInsertedChildren( w ) ) {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ } else {
+ actionEditHLayout->setEnabled( TRUE );
+ actionEditVLayout->setEnabled( TRUE );
+ actionEditGridLayout->setEnabled( TRUE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ layoutChilds = TRUE;
+ }
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) {
+ actionEditBreakLayout->setEnabled( !isAToolBarChild( w ) );
+ breakLayout = TRUE;
+ }
+ } else {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( !isAToolBarChild( w ) );
+ breakLayout = TRUE;
+ }
+ }
+ } else if ( selectedWidgets == 0 ) {
+ actionEditAdjustSize->setEnabled( TRUE );
+ TQWidget *w = formWindow()->mainContainer();
+ if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) {
+ if ( !formWindow()->hasInsertedChildren( w ) ) {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ } else {
+ actionEditHLayout->setEnabled( TRUE );
+ actionEditVLayout->setEnabled( TRUE );
+ actionEditGridLayout->setEnabled( TRUE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ layoutChilds = TRUE;
+ }
+ } else {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( TRUE );
+ breakLayout = TRUE;
+ }
+ } else {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ }
+}
+
+static TQString fixArgs( const TQString &s2 )
+{
+ TQString s = s2;
+ return s.tqreplace( ',', ';' );
+}
+
+void MainWindow::writeConfig()
+{
+ TQSettings config;
+
+ // No search path for unix, only needs application name
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+
+ TQString keybase = DesignerApplication::settingsKey();
+
+ if (savePluginPaths) {
+ TQStringList pluginPaths = TQApplication::libraryPaths();
+ config.writeEntry( keybase + "PluginPaths", pluginPaths );
+ }
+ config.writeEntry( keybase + "RestoreWorkspace", restoreConfig );
+ config.writeEntry( keybase + "SplashScreen", splashScreen );
+ config.writeEntry( keybase + "ShowStartDialog", shStartDialog );
+ config.writeEntry( keybase + "FileFilter", fileFilter );
+ config.writeEntry( keybase + "TemplatePath", templPath );
+ config.writeEntry( keybase + "RecentlyOpenedFiles", recentlyFiles );
+ config.writeEntry( keybase + "RecentlyOpenedProjects", recentlyProjects );
+ config.writeEntry( keybase + "DatabaseAutoEdit", databaseAutoEdit );
+
+ config.writeEntry( keybase + "AutoSave/Enabled", autoSaveEnabled );
+ config.writeEntry( keybase + "AutoSave/Interval", autoSaveInterval );
+
+ config.writeEntry( keybase + "Grid/Snap", snGrid );
+ config.writeEntry( keybase + "Grid/Show", sGrid );
+ config.writeEntry( keybase + "Grid/x", grid().x() );
+ config.writeEntry( keybase + "Grid/y", grid().y() );
+ config.writeEntry( keybase + "LastToolPage",
+ toolBox->itemLabel( toolBox->currentIndex() ) );
+
+ config.writeEntry( keybase + "Background/UsePixmap", backPix );
+ config.writeEntry( keybase + "Background/Color", (int)qworkspace->backgroundColor().rgb() );
+ if ( qworkspace->backgroundPixmap() )
+ qworkspace->backgroundPixmap()->save( TQDir::home().absPath() + "/.designer/" + "background.xpm", "PNG" );
+
+ config.writeEntry( keybase + "Geometries/MainwindowX", x() );
+ config.writeEntry( keybase + "Geometries/MainwindowY", y() );
+ config.writeEntry( keybase + "Geometries/MainwindowWidth", width() );
+ config.writeEntry( keybase + "Geometries/MainwindowHeight", height() );
+ config.writeEntry( keybase + "Geometries/MainwindowMaximized", isMaximized() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorX", propertyEditor->parentWidget()->x() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorY", propertyEditor->parentWidget()->y() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorWidth", propertyEditor->parentWidget()->width() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorHeight", propertyEditor->parentWidget()->height() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewX", hierarchyView->parentWidget()->x() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewY", hierarchyView->parentWidget()->y() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewWidth", hierarchyView->parentWidget()->width() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewHeight", hierarchyView->parentWidget()->height() );
+ config.writeEntry( keybase + "Geometries/WorkspaceX", wspace->parentWidget()->x() );
+ config.writeEntry( keybase + "Geometries/WorkspaceY", wspace->parentWidget()->y() );
+ config.writeEntry( keybase + "Geometries/WorkspaceWidth", wspace->parentWidget()->width() );
+ config.writeEntry( keybase + "Geometries/WorkspaceHeight", wspace->parentWidget()->height() );
+
+ config.writeEntry( keybase + "View/TextLabels", usesTextLabel() );
+ config.writeEntry( keybase + "View/BigIcons", usesBigPixmaps() );
+
+ TQString mwlKey = "MainwindowLayout";
+ if ( singleProjectMode() )
+ mwlKey += "S";
+ TQString mainWindowLayout;
+ TQTextStream ts( &mainWindowLayout, IO_WriteOnly );
+ ts << *this;
+ config.writeEntry( keybase + mwlKey, mainWindowLayout );
+
+
+ TQPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ config.writeEntry( keybase + "CustomWidgets/num", (int)lst->count() );
+ int j = 0;
+ TQDir::home().mkdir( ".designer" );
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ TQStringList l;
+ l << w->className;
+ l << w->includeFile;
+ l << TQString::number( (int)w->includePolicy );
+ l << TQString::number( w->tqsizeHint.width() );
+ l << TQString::number( w->tqsizeHint.height() );
+ l << TQString::number( w->lstSignals.count() );
+ for ( TQValueList<TQCString>::ConstIterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ l << TQString( fixArgs( *it ) );
+ l << TQString::number( w->lstSlots.count() );
+ for ( TQValueList<MetaDataBase::Function>::ConstIterator it2 = w->lstSlots.begin(); it2 != w->lstSlots.end(); ++it2 ) {
+ l << fixArgs( (*it2).function );
+ l << (*it2).access;
+ }
+ l << TQString::number( w->lstProperties.count() );
+ for ( TQValueList<MetaDataBase::Property>::ConstIterator it3 = w->lstProperties.begin(); it3 != w->lstProperties.end(); ++it3 ) {
+ l << (*it3).property;
+ l << (*it3).type;
+ }
+ l << TQString::number( size_type_to_int( w->sizePolicy.horData() ) );
+ l << TQString::number( size_type_to_int( w->sizePolicy.verData() ) );
+ l << TQString::number( (int)w->isContainer );
+ config.writeEntry( keybase + "CustomWidgets/Widget" + TQString::number( j++ ), l, ',' );
+ w->pixmap->save( TQDir::home().absPath() + "/.designer/" + w->className, "XPM" );
+ }
+
+ TQStringList l;
+ for ( TQAction *a = commonWidgetsPage.first(); a; a = commonWidgetsPage.next() )
+ l << a->text();
+ config.writeEntry( keybase + "ToolBox/CommonWidgets", l );
+}
+
+static TQString fixArgs2( const TQString &s2 )
+{
+ TQString s = s2;
+ return s.tqreplace( ';', ',' );
+}
+
+void MainWindow::readConfig()
+{
+ TQString keybase = DesignerApplication::settingsKey();
+ TQSettings config;
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+
+ bool ok;
+ bool readPreviousConfig = FALSE;
+ TQString backPixName( TQDir::home().absPath() + "/.designer/" + "background.xpm" );
+ restoreConfig = config.readBoolEntry( keybase + "RestoreWorkspace", TRUE, &ok );
+ if ( !ok ) {
+ keybase = DesignerApplication::oldSettingsKey();
+ restoreConfig = config.readBoolEntry( keybase + "RestoreWorkspace", TRUE, &ok );
+ if ( !ok ) {
+ if ( oWindow ) {
+ oWindow->shuttingDown();
+ ( (TQDockWindow*)oWindow->tqparent() )->hide();
+ }
+ TQPixmap pix;
+ pix.load( backPixName );
+ if ( !pix.isNull() )
+ qworkspace->setBackgroundPixmap( pix );
+ return;
+ }
+ readPreviousConfig = TRUE;
+ }
+ if ( !readPreviousConfig ) {
+ fileFilter = config.readEntry( keybase + "FileFilter", fileFilter );
+ templPath = config.readEntry( keybase + "TemplatePath", TQString() );
+ databaseAutoEdit = config.readBoolEntry( keybase + "DatabaseAutoEdit", databaseAutoEdit );
+ shStartDialog = config.readBoolEntry( keybase + "ShowStartDialog", shStartDialog );
+ autoSaveEnabled = config.readBoolEntry( keybase + "AutoSave/Enabled", autoSaveEnabled );
+ autoSaveInterval = config.readNumEntry( keybase + "AutoSave/Interval", autoSaveInterval );
+ }
+
+ if ( restoreConfig || readPreviousConfig ) {
+ TQString s = config.readEntry( keybase + "LastToolPage" );
+ for ( int i = 0; i < toolBox->count(); ++i ) {
+ if ( toolBox->itemLabel(i) == s ) {
+ toolBox->setCurrentIndex( i );
+ break;
+ }
+ }
+ // We know that the oldSettingsKey() will return 3.1
+ if ( keybase == DesignerApplication::oldSettingsKey() ) {
+ if (keybase.tqcontains("3.1"))
+ recentlyFiles = config.readListEntry( keybase + "RecentlyOpenedFiles", ',' );
+ else
+ recentlyFiles = config.readListEntry(keybase + "RecentlyOpenedFiles");
+
+ if ( recentlyFiles.count() == 1 && recentlyFiles[0].isNull() )
+ recentlyFiles.clear();
+ if (keybase.tqcontains("3.1"))
+ recentlyProjects = config.readListEntry( keybase + "RecentlyOpenedProjects", ',' );
+ else
+ recentlyProjects = config.readListEntry( keybase + "RecentlyOpenedProjects");
+ if ( recentlyProjects.count() == 1 && recentlyProjects[0].isNull() )
+ recentlyProjects.clear();
+ } else {
+ recentlyFiles = config.readListEntry( keybase + "RecentlyOpenedFiles" );
+ recentlyProjects = config.readListEntry( keybase + "RecentlyOpenedProjects" );
+ }
+
+ backPix = config.readBoolEntry( keybase + "Background/UsePixmap", TRUE ) | readPreviousConfig;
+ if ( backPix ) {
+ TQPixmap pix;
+ pix.load( backPixName );
+ if ( !pix.isNull() )
+ qworkspace->setBackgroundPixmap( pix );
+ } else {
+ qworkspace->setBackgroundColor( TQColor( (TQRgb)config.readNumEntry( keybase + "Background/Color" ) ) );
+ }
+
+ if ( !readPreviousConfig ) {
+ splashScreen = config.readBoolEntry( keybase + "SplashScreen", TRUE );
+
+ sGrid = config.readBoolEntry( keybase + "Grid/Show", TRUE );
+ snGrid = config.readBoolEntry( keybase + "Grid/Snap", TRUE );
+ grd.setX( config.readNumEntry( keybase + "Grid/x", 10 ) );
+ grd.setY( config.readNumEntry( keybase + "Grid/y", 10 ) );
+
+ if ( !config.readBoolEntry( DesignerApplication::settingsKey() + "Geometries/MainwindowMaximized", FALSE ) ) {
+ TQRect r( pos(), size() );
+ r.setX( config.readNumEntry( keybase + "Geometries/MainwindowX", r.x() ) );
+ r.setY( config.readNumEntry( keybase + "Geometries/MainwindowY", r.y() ) );
+ r.setWidth( config.readNumEntry( keybase + "Geometries/MainwindowWidth", r.width() ) );
+ r.setHeight( config.readNumEntry( keybase + "Geometries/MainwindowHeight", r.height() ) );
+
+ TQRect desk = TQApplication::desktop()->tqgeometry();
+ TQRect inter = desk.intersect( r );
+ resize( r.size() );
+ if ( inter.width() * inter.height() > ( r.width() * r.height() / 20 ) ) {
+ move( r.topLeft() );
+ }
+ }
+ setUsesTextLabel( config.readBoolEntry( keybase + "View/TextLabels", FALSE ) );
+ setUsesBigPixmaps( FALSE /*config.readBoolEntry( "BigIcons", FALSE )*/ ); // ### disabled for now
+ }
+ }
+ int num = config.readNumEntry( keybase + "CustomWidgets/num" );
+ for ( int j = 0; j < num; ++j ) {
+ MetaDataBase::CustomWidget *w = new MetaDataBase::CustomWidget;
+ TQStringList l = config.readListEntry( keybase + "CustomWidgets/Widget" + TQString::number( j ), ',' );
+ w->className = l[ 0 ];
+ w->includeFile = l[ 1 ];
+ w->includePolicy = (MetaDataBase::CustomWidget::IncludePolicy)l[ 2 ].toInt();
+ w->tqsizeHint.setWidth( l[ 3 ].toInt() );
+ w->tqsizeHint.setHeight( l[ 4 ].toInt() );
+ uint c = 5;
+ if ( l.count() > c ) {
+ int numSignals = l[ c ].toInt();
+ c++;
+ for ( int i = 0; i < numSignals; ++i, c++ )
+ w->lstSignals.append( fixArgs2( l[ c ] ).latin1() );
+ }
+ if ( l.count() > c ) {
+ int numSlots = l[ c ].toInt();
+ c++;
+ for ( int i = 0; i < numSlots; ++i ) {
+ MetaDataBase::Function slot;
+ slot.function = fixArgs2( l[ c ] );
+ c++;
+ slot.access = l[ c ];
+ c++;
+ w->lstSlots.append( slot );
+ }
+ }
+ if ( l.count() > c ) {
+ int numProperties = l[ c ].toInt();
+ c++;
+ for ( int i = 0; i < numProperties; ++i ) {
+ MetaDataBase::Property prop;
+ prop.property = l[ c ];
+ c++;
+ prop.type = l[ c ];
+ c++;
+ w->lstProperties.append( prop );
+ }
+ } if ( l.count() > c ) {
+ TQSizePolicy::SizeType h, v;
+ h = int_to_size_type( l[ c++ ].toInt() );
+ v = int_to_size_type( l[ c++ ].toInt() );
+ w->sizePolicy = TQSizePolicy( h, v );
+ }
+ if ( l.count() > c ) {
+ w->isContainer = (bool)l[ c++ ].toInt();
+ }
+ w->pixmap = new TQPixmap( TQPixmap::fromMimeSource( TQDir::home().absPath() + "/.designer/" + w->className ) );
+ MetaDataBase::addCustomWidget( w );
+ }
+ if ( num > 0 )
+ rebuildCustomWidgetGUI();
+
+ if ( !restoreConfig )
+ return;
+
+#ifndef TQ_WS_MAC
+ /* I'm sorry to make this not happen on the Mac, but it seems to hang somewhere deep
+ in TQLayout, it gets into a very large loop - and seems it has to do with clever
+ things the designer does ###Sam */
+ TQApplication::sendPostedEvents();
+#endif
+
+ if ( !readPreviousConfig ) {
+ TQString mwlKey = "MainwindowLayout";
+ if ( singleProjectMode() )
+ mwlKey += "S";
+ TQString mainWindowLayout = config.readEntry( keybase + mwlKey );
+ TQTextStream ts( &mainWindowLayout, IO_ReadOnly );
+ ts >> *this;
+ }
+ if ( readPreviousConfig && oWindow ) {
+ oWindow->shuttingDown();
+ ( (TQDockWindow*)oWindow->tqparent() )->hide();
+ }
+
+ rebuildCustomWidgetGUI();
+
+ TQStringList l = config.readListEntry( keybase + "ToolBox/CommonWidgets" );
+ if ( !l.isEmpty() ) {
+ TQPtrList<TQAction> lst;
+ commonWidgetsPage.clear();
+ for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) {
+ for ( TQAction *a = toolActions.first(); a; a = toolActions.next() ) {
+ if ( *it == a->text() ) {
+ lst.append( a );
+ break;
+ }
+ }
+ }
+ if ( lst != commonWidgetsPage ) {
+ commonWidgetsPage = lst;
+ rebuildCommonWidgetsToolBoxPage();
+ }
+ }
+}
+
+HierarchyView *MainWindow::objectHierarchy() const
+{
+ if ( !hierarchyView )
+ ( (MainWindow*)this )->setupHierarchyView();
+ return hierarchyView;
+}
+
+TQPopupMenu *MainWindow::setupNormalHierarchyMenu( TQWidget *tqparent )
+{
+ TQPopupMenu *menu = new TQPopupMenu( tqparent );
+
+ actionEditCut->addTo( menu );
+ actionEditCopy->addTo( menu );
+ actionEditPaste->addTo( menu );
+ actionEditDelete->addTo( menu );
+
+ return menu;
+}
+
+TQPopupMenu *MainWindow::setupTabWidgetHierarchyMenu( TQWidget *tqparent, const char *addSlot, const char *removeSlot )
+{
+ TQPopupMenu *menu = new TQPopupMenu( tqparent );
+
+ menu->insertItem( tr( "Add Page" ), tqparent, addSlot );
+ menu->insertItem( tr( "Delete Page" ), tqparent, removeSlot );
+ menu->insertSeparator();
+ actionEditCut->addTo( menu );
+ actionEditCopy->addTo( menu );
+ actionEditPaste->addTo( menu );
+ actionEditDelete->addTo( menu );
+
+ return menu;
+}
+
+void MainWindow::closeEvent( TQCloseEvent *e )
+{
+ if ( singleProject ) {
+ hide();
+ e->ignore();
+ return;
+ }
+
+ TQWidgetList windows = qWorkspace()->windowList();
+ TQWidgetListIt wit( windows );
+ while ( wit.current() ) {
+ TQWidget *w = wit.current();
+ ++wit;
+ if ( ::tqqt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->formFile()->editor() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
+ if ( ( (FormWindow*)w )->formFile()->formWindow() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->formWindow() );
+ if ( !( (FormWindow*)w )->formFile()->close() ) {
+ e->ignore();
+ return;
+ }
+ } else if ( ::tqqt_cast<SourceEditor*>(w) ) {
+ if ( !( (SourceEditor*)w )->close() ) {
+ e->ignore();
+ return;
+ }
+ }
+ w->close();
+ }
+
+ TQMapConstIterator<TQAction*, Project*> it = projects.begin();
+ while( it != projects.end() ) {
+ Project *pro = it.data();
+ ++it;
+ if ( pro->isModified() ) {
+ switch ( TQMessageBox::warning( this, tr( "Save Project Settings" ),
+ tr( "Save changes to '%1'?" ).arg( pro->fileName() ),
+ tr( "&Yes" ), tr( "&No" ), tr( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ pro->save();
+ break;
+ case 1: // don't save
+ break;
+ case 2: // cancel
+ e->ignore();
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+ writeConfig();
+ hide();
+ e->accept();
+
+ if ( client ) {
+ TQDir home( TQDir::homeDirPath() );
+ home.remove( ".designerpid" );
+ }
+}
+
+Workspace *MainWindow::workspace() const
+{
+ if ( !wspace )
+ ( (MainWindow*)this )->setupWorkspace();
+ return wspace;
+}
+
+PropertyEditor *MainWindow::propertyeditor() const
+{
+ if ( !propertyEditor )
+ ( (MainWindow*)this )->setupPropertyEditor();
+ return propertyEditor;
+}
+
+ActionEditor *MainWindow::actioneditor() const
+{
+ if ( !actionEditor )
+ ( (MainWindow*)this )->setupActionEditor();
+ return actionEditor;
+}
+
+bool MainWindow::openEditor( TQWidget *w, FormWindow *f )
+{
+ if ( f && !f->project()->isCpp() && !WidgetFactory::isPassiveInteractor( w ) ) {
+ TQString defSignal = WidgetFactory::defaultSignal( w );
+ if ( defSignal.isEmpty() ) {
+ editSource();
+ } else {
+ TQString s = TQString( w->name() ) + "_" + defSignal;
+ LanguageInterface *iface = MetaDataBase::languageInterface( f->project()->language() );
+ if ( iface ) {
+ TQStrList sigs = iface->signalNames( TQT_TQOBJECT(w) );
+ TQString fullSignal;
+ for ( int i = 0; i < (int)sigs.count(); ++i ) {
+ TQString sig = sigs.at( i );
+ if ( sig.left( sig.tqfind( '(' ) ) == defSignal ) {
+ fullSignal = sig;
+ break;
+ }
+ }
+
+ if ( !fullSignal.isEmpty() ) {
+ TQString signl = fullSignal;
+ fullSignal = fullSignal.mid( fullSignal.tqfind( '(' ) + 1 );
+ fullSignal.remove( (int)fullSignal.length() - 1, 1 );
+ fullSignal = iface->createArguments( fullSignal.simplifyWhiteSpace() );
+ s += "(" + fullSignal + ")";
+ if ( !MetaDataBase::hasFunction( f, s.latin1() ) )
+ MetaDataBase::addFunction( f, s.latin1(), "", "public", "slot",
+ f->project()->language(), "void" );
+ s = s.left( s.tqfind( '(' ) ).latin1();
+ if ( !MetaDataBase::hasConnection( f, w, defSignal.latin1(), f->mainContainer(), s.latin1() ) ) {
+ MetaDataBase::Connection conn;
+ conn.sender = TQT_TQOBJECT(w);
+ conn.receiver = TQT_TQOBJECT(f->mainContainer());
+ conn.signal = signl;
+ conn.slot = s;
+ AddConnectionCommand *cmd =
+ new AddConnectionCommand( tr( "Add connection" ), f, conn );
+ f->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ f->formFile()->setModified( TRUE );
+ }
+ }
+ }
+ editFunction( s, TRUE );
+ }
+ return TRUE;
+ }
+ if ( WidgetFactory::hasSpecialEditor( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), TQT_TQOBJECT(w) ) ) {
+ statusBar()->message( tr( "Edit %1..." ).arg( w->className() ) );
+ WidgetFactory::editWidget( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ),
+ this, w, formWindow() );
+ statusBar()->clear();
+ return TRUE;
+ }
+
+ const TQMetaProperty* text = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "text", TRUE ), TRUE );
+ const TQMetaProperty* title = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( "title", TRUE ), TRUE );
+ if ( text && text->designable(w) ) {
+ bool ok = FALSE;
+ bool oldDoWrap = FALSE;
+ if ( ::tqqt_cast<TQLabel*>(w) ) {
+ int align = w->property( "tqalignment" ).toInt();
+ if ( align & TQt::WordBreak )
+ oldDoWrap = TRUE;
+ }
+ bool doWrap = oldDoWrap;
+
+ TQString text;
+ if ( ::tqqt_cast<TQTextEdit*>(w) || ::tqqt_cast<TQLabel*>(w) || ::tqqt_cast<TQButton*>(w) ) {
+ text = MultiLineEditor::getText( this, w->property( "text" ).toString(),
+ !::tqqt_cast<TQButton*>(w), &doWrap );
+ ok = !text.isNull();
+ } else {
+ text = TQInputDialog::getText( tr("Text"), tr( "New text" ),
+ TQLineEdit::Normal, w->property("text").toString(), &ok, this );
+ }
+ if ( ok ) {
+ if ( oldDoWrap != doWrap ) {
+ TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "wordwrap", TQVariant( oldDoWrap, 0 ),
+ TQVariant( doWrap, 0 ), TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
+ }
+
+ TQString pn( tr( "Set the 'text' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "text", w->property( "text" ),
+ text, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "text", TRUE );
+ }
+ return TRUE;
+ }
+ if ( title && title->designable(w) ) {
+ bool ok = FALSE;
+ TQString text;
+ text = TQInputDialog::getText( tr("Title"), tr( "New title" ), TQLineEdit::Normal, w->property("title").toString(), &ok, this );
+ if ( ok ) {
+ TQString pn( tr( "Set the 'title' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "title", w->property( "title" ),
+ text, TQString(), TQString() );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "title", TRUE );
+ }
+ return TRUE;
+ }
+
+ if ( !WidgetFactory::isPassiveInteractor( w ) )
+ editSource();
+
+ return TRUE;
+}
+
+void MainWindow::rebuildCustomWidgetGUI()
+{
+ customWidgetToolBar->clear();
+ customWidgetMenu->clear();
+ customWidgetToolBar2->clear();
+ int count = 0;
+
+ TQPtrListIterator<TQAction> it( toolActions );
+ TQAction *action;
+ while ( ( action = it.current() ) ) {
+ ++it;
+ if ( ( (WidgetAction*)action )->group() == "Custom Widgets" )
+ delete action;
+ }
+
+ TQPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+
+ actionToolsCustomWidget->addTo( customWidgetMenu );
+ customWidgetMenu->insertSeparator();
+
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ WidgetAction* a = new WidgetAction( "Custom Widgets", actionGroupTools, TQT_TQSTRING(TQString::number( w->id )).latin1() );
+ a->setToggleAction( TRUE );
+ a->setText( w->className );
+ a->setIconSet( *w->pixmap );
+ a->setStatusTip( tr( "Insert a " +w->className + " (custom widget)" ) );
+ a->setWhatsThis( tr("<b>" + w->className + " (custom widget)</b>"
+ "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> menu to "
+ "add and change custom widgets. You can add properties as well as "
+ "Q_SIGNALS and Q_SLOTS to integrate them into TQt Designer, "
+ "and provide a pixmap which will be used to represent the widget on the form.</p>") );
+
+ a->addTo( customWidgetToolBar );
+ a->addTo( customWidgetToolBar2 );
+ a->addTo( customWidgetMenu );
+ count++;
+ }
+ TQWidget *wid;
+ customWidgetToolBar2->setStretchableWidget( ( wid = new TQWidget( customWidgetToolBar2 ) ) );
+ wid->setBackgroundMode( customWidgetToolBar2->backgroundMode() );
+
+ if ( count == 0 )
+ customWidgetToolBar->hide();
+ else if ( customWidgetToolBar->isVisible() )
+ customWidgetToolBar->show();
+}
+
+void MainWindow::rebuildCommonWidgetsToolBoxPage()
+{
+ toolBox->setUpdatesEnabled( FALSE );
+ commonWidgetsToolBar->setUpdatesEnabled( FALSE );
+ commonWidgetsToolBar->clear();
+ for ( TQAction *a = commonWidgetsPage.first(); a; a = commonWidgetsPage.next() )
+ a->addTo( commonWidgetsToolBar );
+ TQWidget *w;
+ commonWidgetsToolBar->setStretchableWidget( ( w = new TQWidget( commonWidgetsToolBar ) ) );
+ w->setBackgroundMode( commonWidgetsToolBar->backgroundMode() );
+ toolBox->setUpdatesEnabled( TRUE );
+ commonWidgetsToolBar->setUpdatesEnabled( TRUE );
+}
+
+bool MainWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *wid )
+{
+ TQWidgetList windows = qWorkspace()->windowList();
+ for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( ::tqqt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->isCustomWidgetUsed( wid ) )
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void MainWindow::setGrid( const TQPoint &p )
+{
+ if ( p == grd )
+ return;
+ grd = p;
+ TQWidgetList windows = qWorkspace()->windowList();
+ for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( !::tqqt_cast<FormWindow*>(w) )
+ continue;
+ ( (FormWindow*)w )->mainContainer()->update();
+ }
+}
+
+void MainWindow::setShowGrid( bool b )
+{
+ if ( b == sGrid )
+ return;
+ sGrid = b;
+ TQWidgetList windows = qWorkspace()->windowList();
+ for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( !::tqqt_cast<FormWindow*>(w) )
+ continue;
+ ( (FormWindow*)w )->mainContainer()->update();
+ }
+}
+
+void MainWindow::setSnapGrid( bool b )
+{
+ if ( b == snGrid )
+ return;
+ snGrid = b;
+}
+
+TQString MainWindow::documentationPath() const
+{
+ return TQString( qInstallPathDocs() ) + "/html/";
+}
+
+void MainWindow::windowsMenuActivated( int id )
+{
+ TQWidget* w = qworkspace->windowList().at( id );
+ if ( w )
+ w->setFocus();
+}
+
+void MainWindow::projectSelected( TQAction *a )
+{
+ a->setOn( TRUE );
+ if ( currentProject )
+ currentProject->setActive( FALSE );
+ Project *p = *projects.tqfind( a );
+ p->setActive( TRUE );
+ if ( currentProject == p )
+ return;
+ currentProject = p;
+ if ( wspace )
+ wspace->setCurrentProject( currentProject );
+}
+
+void MainWindow::openProject( const TQString &fn )
+{
+ for ( TQMap<TQAction*, Project*>::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( (*it)->fileName() == fn ) {
+ projectSelected( it.key() );
+ return;
+ }
+ }
+ TQApplication::setOverrideCursor( Qt::WaitCursor );
+ Project *pro = new Project( fn, "", projectSettingsPluginManager );
+ pro->setModified( FALSE );
+ TQAction *a = new TQAction( pro->projectName(), pro->projectName(), 0, actionGroupProjects, 0, TRUE );
+ projects.insert( a, pro );
+ projectSelected( a );
+ TQApplication::restoreOverrideCursor();
+}
+
+void MainWindow::checkTempFiles()
+{
+ TQString s = TQDir::homeDirPath() + "/.designer";
+ TQString baseName = s+ "/saved-form-";
+ if ( !TQFile::exists( baseName + "1.ui" ) )
+ return;
+ DesignerApplication::closeSplash();
+ TQDir d( s );
+ d.setNameFilter( "*.ui" );
+ TQStringList lst = d.entryList();
+ TQApplication::restoreOverrideCursor();
+ bool load = TQMessageBox::information( this, tr( "Restoring the Last Session" ),
+ tr( "TQt Designer found some temporary saved files, which were\n"
+ "written when TQt Designer crashed last time. Do you want to\n"
+ "load these files?" ), tr( "&Yes" ), tr( "&No" ) ) == 0;
+ TQApplication::setOverrideCursor( Qt::WaitCursor );
+ for ( TQStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( load )
+ openFormWindow( s + "/" + *it, FALSE );
+ d.remove( *it );
+ }
+}
+
+void MainWindow::showDialogHelp()
+{
+ TQWidget *w = (TQWidget*)sender();
+ w = w->tqtopLevelWidget();
+
+ TQString link = documentationPath() + "/designer-manual-13.html#";
+
+ if ( ::tqqt_cast<NewFormBase*>(w) || ::tqqt_cast<StartDialogBase*>(w) ) // own doc for startdialog?
+ link += "dialog-file-new";
+ else if ( ::tqqt_cast<CreateTemplate*>(w) )
+ link += "dialog-file-create-template";
+ else if ( ::tqqt_cast<EditFunctionsBase*>(w) )
+ link += "dialog-edit-functions";
+// else if ( ::tqqt_cast<ConnectionViewerBase*>(w) )
+ else if ( w->inherits("ConnectionViewerBase") )
+ link += "dialog-view-connections";
+ else if ( ::tqqt_cast<FormSettingsBase*>(w) )
+ link += "dialog-edit-form-settings";
+ else if ( ::tqqt_cast<Preferences*>(w) )
+ link += "dialog-edit-preferences";
+ else if ( ::tqqt_cast<PixmapCollectionEditor*>(w) )
+ link += "dialog-image-collection";
+// else if ( ::tqqt_cast<DatabaseConnectionBase*>(w) )
+ else if ( w->inherits( "DatabaseConnectionBase" ) )
+ link += "dialog-edit-database-connections";
+ else if ( ::tqqt_cast<ProjectSettingsBase*>(w) )
+ link += "dialog-project-settings";
+ else if ( ::tqqt_cast<FindDialog*>(w) )
+ link += "dialog-tqfind-text";
+ else if ( ::tqqt_cast<ReplaceDialog*>(w) )
+ link += "dialog-tqreplace-text";
+ else if ( ::tqqt_cast<GotoLineDialog*>(w) )
+ link += "dialog-go-to-line";
+// else if ( ::tqqt_cast<ConnectionEditorBase*>(w) )
+ else if ( w->inherits("ConnectionEditorBase") )
+ link += "dialog-edit-connections";
+ else if ( ::tqqt_cast<CustomWidgetEditorBase*>(w) )
+ link += "dialog-edit-custom-widgets";
+ else if ( ::tqqt_cast<PaletteEditorBase*>(w) )
+ link += "dialog-edit-palette";
+ else if ( ::tqqt_cast<ListBoxEditorBase*>(w) )
+ link += "dialog-edit-listbox";
+ else if ( ::tqqt_cast<ListViewEditorBase*>(w) )
+ link += "dialog-edit-listview";
+ else if ( ::tqqt_cast<IconViewEditorBase*>(w) )
+ link += "dialog-edit-iconview";
+ else if ( ::tqqt_cast<TableEditorBase*>(w) )
+ link += "dialog-edit-table";
+ else if ( ::tqqt_cast<MultiLineEditor*>(w) )
+ link += "dialog-text";
+
+ else {
+ TQMessageBox::information( this, tr( "Help" ),
+ tr( "There is no help available for this dialog at the moment." ) );
+ return;
+ }
+
+ assistant->showPage( link );
+}
+
+void MainWindow::setupActionManager()
+{
+ actionPluginManager = new TQPluginManager<ActionInterface>( IID_Action, TQApplication::libraryPaths(), pluginDirectory() );
+
+ TQStringList lst = actionPluginManager->featureList();
+ for ( TQStringList::ConstIterator ait = lst.begin(); ait != lst.end(); ++ait ) {
+ ActionInterface *iface = 0;
+ actionPluginManager->queryInterface( *ait, &iface );
+ if ( !iface )
+ continue;
+
+ iface->connectTo( desInterface );
+ TQAction *a = iface->create( *ait, TQT_TQOBJECT(this) );
+ if ( !a )
+ continue;
+
+ TQString grp = iface->group( *ait );
+ if ( grp.isEmpty() )
+ grp = "3rd party actions";
+ TQPopupMenu *menu = 0;
+ TQToolBar *tb = 0;
+
+ if ( !( menu = (TQPopupMenu*)child( grp.latin1(), "TQPopupMenu" ) ) ) {
+ menu = new TQPopupMenu( this, grp.latin1() );
+ menuBar()->insertItem( tr( grp ), menu );
+ }
+ if ( !( tb = (TQToolBar*)child( grp.latin1(), "TQToolBar" ) ) ) {
+ tb = new TQToolBar( this, grp.latin1() );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ addToolBar( tb, grp );
+ }
+
+ if ( iface->location( *ait, ActionInterface::Menu ) )
+ a->addTo( menu );
+ if ( iface->location( *ait, ActionInterface::Toolbar ) )
+ a->addTo( tb );
+
+ iface->release();
+ }
+}
+
+void MainWindow::editFunction( const TQString &func, bool rereadSource )
+{
+ if ( !formWindow() )
+ return;
+
+ if ( formWindow()->formFile()->codeFileState() != FormFile::Ok )
+ if ( !formWindow()->formFile()->setupUihFile(FALSE) )
+ return;
+
+ TQString lang = currentProject->language();
+ if ( !MetaDataBase::hasEditor( lang ) ) {
+ TQMessageBox::information( this, tr( "Edit Source" ),
+ tr( "There is no plugin for editing " + lang + " code installed!\n"
+ "Note: Plugins are not available in static TQt configurations." ) );
+ return;
+ }
+
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->language() == lang && e->formWindow() == formWindow() ) {
+ e->show();
+ e->setFunction( func );
+ return;
+ }
+ }
+
+ createSourceEditor( TQT_TQOBJECT(formWindow()), formWindow()->project(), lang, func, rereadSource );
+}
+
+void MainWindow::setupRecentlyFilesMenu()
+{
+ recentlyFilesMenu->clear();
+ int id = 0;
+ for ( TQStringList::ConstIterator it = recentlyFiles.begin(); it != recentlyFiles.end(); ++it ) {
+ recentlyFilesMenu->insertItem( *it, id );
+ id++;
+ }
+}
+
+void MainWindow::setupRecentlyProjectsMenu()
+{
+ recentlyProjectsMenu->clear();
+ int id = 0;
+ for ( TQStringList::ConstIterator it = recentlyProjects.begin(); it != recentlyProjects.end(); ++it ) {
+ recentlyProjectsMenu->insertItem( *it, id );
+ id++;
+ }
+}
+
+TQPtrList<DesignerProject> MainWindow::projectList() const
+{
+ TQPtrList<DesignerProject> list;
+ TQMapConstIterator<TQAction*, Project*> it = projects.begin();
+
+ while( it != projects.end() ) {
+ Project *p = it.data();
+ ++it;
+ list.append( p->iFace() );
+ }
+
+ return list;
+}
+
+TQStringList MainWindow::projectNames() const
+{
+ TQStringList res;
+ for ( TQMap<TQAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it )
+ res << (*it)->projectName();
+ return res;
+}
+
+TQStringList MainWindow::projectFileNames() const
+{
+ TQStringList res;
+ for ( TQMap<TQAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it )
+ res << (*it)->makeRelative( (*it)->fileName() );
+ return res;
+}
+
+Project *MainWindow::tqfindProject( const TQString &projectName ) const
+{
+ for ( TQMap<TQAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( (*it)->projectName() == projectName )
+ return *it;
+ }
+ return 0;
+}
+
+void MainWindow::setCurrentProject( Project *pro )
+{
+ for ( TQMap<TQAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( *it == pro ) {
+ projectSelected( it.key() );
+ return;
+ }
+ }
+}
+
+void MainWindow::setCurrentProjectByFilename( const TQString& proFilename )
+{
+ for ( TQMap<TQAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( (*it)->makeRelative( (*it)->fileName() ) == proFilename ) {
+ projectSelected( it.key() );
+ return;
+ }
+ }
+}
+
+
+void MainWindow::recentlyFilesMenuActivated( int id )
+{
+ if ( id != -1 ) {
+ if ( !TQFile::exists( *recentlyFiles.at( id ) ) ) {
+ TQMessageBox::warning( this, tr( "Open File" ),
+ tr( "Could not open '%1'. File does not exist." ).
+ arg( *recentlyFiles.at( id ) ) );
+ recentlyFiles.remove( recentlyFiles.at( id ) );
+ return;
+ }
+ fileOpen( "", "", *recentlyFiles.at( id ) );
+ TQString fn( *recentlyFiles.at( id ) );
+ addRecentlyOpened( fn, recentlyFiles );
+ }
+}
+
+void MainWindow::recentlyProjectsMenuActivated( int id )
+{
+ if ( id != -1 ) {
+ if ( !TQFile::exists( *recentlyProjects.at( id ) ) ) {
+ TQMessageBox::warning( this, tr( "Open Project" ),
+ tr( "Could not open '%1'. File does not exist." ).
+ arg( *recentlyProjects.at( id ) ) );
+ recentlyProjects.remove( recentlyProjects.at( id ) );
+ return;
+ }
+ openProject( *recentlyProjects.at( id ) );
+ TQString fn( *recentlyProjects.at( id ) );
+ addRecentlyOpened( fn, recentlyProjects );
+ }
+}
+
+void MainWindow::addRecentlyOpened( const TQString &fn, TQStringList &lst )
+{
+ TQFileInfo fi( fn );
+ fi.convertToAbs();
+ TQString f = fi.filePath();
+ if ( lst.tqfind( f ) != lst.end() )
+ lst.remove( f );
+ if ( lst.count() >= 10 )
+ lst.pop_back();
+ lst.prepend( f );
+}
+
+TemplateWizardInterface * MainWindow::templateWizardInterface( const TQString& className )
+{
+ TemplateWizardInterface* iface = 0;
+ templateWizardPluginManager->queryInterface( className, & iface );
+ return iface;
+}
+
+void MainWindow::setupPluginManagers()
+{
+ editorPluginManager = new TQPluginManager<EditorInterface>( IID_Editor, TQApplication::libraryPaths(), pluginDirectory() );
+ MetaDataBase::setEditor( editorPluginManager->featureList() );
+
+ templateWizardPluginManager =
+ new TQPluginManager<TemplateWizardInterface>( IID_TemplateWizard, TQApplication::libraryPaths(), pluginDirectory() );
+
+ MetaDataBase::setupInterfaceManagers( pluginDirectory() );
+ preferencePluginManager =
+ new TQPluginManager<PreferenceInterface>( IID_Preference, TQApplication::libraryPaths(), pluginDirectory() );
+ projectSettingsPluginManager =
+ new TQPluginManager<ProjectSettingsInterface>( IID_ProjectSettings, TQApplication::libraryPaths(), pluginDirectory() );
+ sourceTemplatePluginManager =
+ new TQPluginManager<SourceTemplateInterface>( IID_SourceTemplate, TQApplication::libraryPaths(), pluginDirectory() );
+
+ if ( preferencePluginManager ) {
+ TQStringList lst = preferencePluginManager->featureList();
+ for ( TQStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ PreferenceInterface *i = 0;
+ preferencePluginManager->queryInterface( *it, &i );
+ if ( !i )
+ continue;
+ i->connectTo( designerInterface() );
+ PreferenceInterface::Preference *pf = i->preference();
+ if ( pf )
+ addPreferencesTab( pf->tab, pf->title, pf->receiver, pf->init_slot, pf->accept_slot );
+ i->deletePreferenceObject( pf );
+
+ i->release();
+ }
+ }
+ if ( projectSettingsPluginManager ) {
+ TQStringList lst = projectSettingsPluginManager->featureList();
+ for ( TQStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ ProjectSettingsInterface *i = 0;
+ projectSettingsPluginManager->queryInterface( *it, &i );
+ if ( !i )
+ continue;
+ i->connectTo( designerInterface() );
+
+ ProjectSettingsInterface::ProjectSettings *pf = i->projectSetting();
+ if ( pf )
+ addProjectTab( pf->tab, pf->title, pf->receiver, pf->init_slot, pf->accept_slot );
+ i->deleteProjectSettingsObject( pf );
+ i->release();
+ }
+ }
+}
+
+void MainWindow::addPreferencesTab( TQWidget *tab, const TQString &title, TQObject *receiver, const char *init_slot, const char *accept_slot )
+{
+ Tab t;
+ t.w = tab;
+ t.title = title;
+ t.receiver = receiver;
+ t.init_slot = init_slot;
+ t.accept_slot = accept_slot;
+ preferenceTabs << t;
+}
+
+void MainWindow::addProjectTab( TQWidget *tab, const TQString &title, TQObject *receiver, const char *init_slot, const char *accept_slot )
+{
+ Tab t;
+ t.w = tab;
+ t.title = title;
+ t.receiver = receiver;
+ t.init_slot = init_slot;
+ t.accept_slot = accept_slot;
+ projectTabs << t;
+}
+
+void MainWindow::setModified( bool b, TQWidget *window )
+{
+ TQWidget *w = window;
+ while ( w ) {
+ if ( ::tqqt_cast<FormWindow*>(w) ) {
+ ( (FormWindow*)w )->modificationChanged( b );
+ return;
+ } else if ( ::tqqt_cast<SourceEditor*>(w) ) {
+ FormWindow *fw = ( (SourceEditor*)w )->formWindow();
+ if ( fw && !fw->isFake() ) {
+ //fw->commandHistory()->setModified( b );
+ //fw->modificationChanged( b );
+ fw->formFile()->setModified( b, FormFile::WFormCode );
+ wspace->update( fw->formFile() );
+ } else {
+ wspace->update();
+ }
+ return;
+ }
+ w = w->parentWidget( TRUE );
+ }
+}
+
+void MainWindow::editorClosed( SourceEditor *e )
+{
+ sourceEditors.take( sourceEditors.tqfindRef( e ) );
+}
+
+void MainWindow::functionsChanged()
+{
+ updateFunctionsTimer->start( 0, TRUE );
+}
+
+void MainWindow::doFunctionsChanged()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->refresh( FALSE );
+ hierarchyView->formDefinitionView()->refresh();
+}
+
+void MainWindow::updateFunctionList()
+{
+ if ( !qWorkspace()->activeWindow() || !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+ SourceEditor *se = (SourceEditor*)qWorkspace()->activeWindow();
+ se->save();
+ hierarchyView->formDefinitionView()->refresh();
+ if ( !currentProject->isCpp() && se->formWindow() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( currentProject->language() );
+ if ( !iface )
+ return;
+ TQValueList<LanguageInterface::Connection> conns;
+ iface->connections( se->text(), &conns );
+ MetaDataBase::setupConnections( se->formWindow(), conns );
+ propertyEditor->eventList()->setup();
+ }
+}
+
+void MainWindow::updateWorkspace()
+{
+ wspace->setCurrentProject( currentProject );
+}
+
+void MainWindow::showDebugStep( TQObject *o, int line )
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->clearStep();
+ if ( !o || line == -1 )
+ return;
+ showSourceLine( o, line, Step );
+}
+
+void MainWindow::showStackFrame( TQObject *o, int line )
+{
+ if ( !o || line == -1 )
+ return;
+ showSourceLine( o, line, StackFrame );
+}
+
+void MainWindow::showErrorMessage( TQObject *o, int errorLine, const TQString &errorMessage )
+{
+ if ( o ) {
+ errorLine--; // ######
+ TQValueList<uint> l;
+ l << ( errorLine + 1 );
+ TQStringList l2;
+ l2 << errorMessage;
+ TQObjectList ol;
+ ol.append( o );
+ TQStringList ll;
+ ll << currentProject->locationOfObject( o );
+ oWindow->setErrorMessages( l2, l, TRUE, ll, ol );
+ showSourceLine( o, errorLine, Error );
+ }
+}
+
+void MainWindow::finishedRun()
+{
+ inDebugMode = FALSE;
+ previewing = FALSE;
+ debuggingForms.clear();
+ enableAll( TRUE );
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->project() == currentProject )
+ e->editorInterface()->setMode( EditorInterface::Editing );
+ e->clearStackFrame();
+ }
+ outputWindow()->clearErrorMessages();
+}
+
+void MainWindow::enableAll( bool enable )
+{
+ menuBar()->setEnabled( enable );
+ TQObjectList *l = queryList( "TQDockWindow" );
+ for ( TQObject *o = l->first(); o; o = l->next() ) {
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(wspace->parentWidget()) ||
+ TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(oWindow->parentWidget()) ||
+ TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(hierarchyView->parentWidget()) )
+ continue;
+ ( (TQWidget*)o )->setEnabled( enable );
+ }
+ delete l;
+}
+
+void MainWindow::showSourceLine( TQObject *o, int line, LineMode lm )
+{
+ TQWidgetList windows = qworkspace->windowList();
+ for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
+ FormWindow *fw = 0;
+ SourceEditor *se = 0;
+ SourceFile *sf = 0;
+ if ( ::tqqt_cast<FormWindow*>(w) ) {
+ fw = (FormWindow*)w;
+ } else if ( ::tqqt_cast<SourceEditor*>(w) ) {
+ se = (SourceEditor*)w;
+ if ( !se->object() )
+ continue;
+ if ( se->formWindow() )
+ fw = se->formWindow();
+ else
+ sf = se->sourceFile();
+ }
+
+ if ( fw ) {
+ if ( fw->project() != currentProject )
+ continue;
+ if ( qstrcmp( fw->name(), o->name() ) == 0 ||
+ (fw->isFake() && currentProject->objectForFakeForm( fw ) == o )) {
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ return;
+ } else {
+ fw->showNormal();
+ fw->setFocus();
+ lastActiveFormWindow = fw;
+ tqApp->processEvents();
+ se = editSource();
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ return;
+ }
+ }
+ }
+ } else if ( se ) {
+ if ( o != sf )
+ continue;
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ return;
+ }
+ }
+
+ if ( ::tqqt_cast<SourceFile*>(o) ) {
+ for ( TQPtrListIterator<SourceFile> sources = currentProject->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ if ( f == o ) {
+ SourceEditor *se = editSource( f );
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ }
+ return;
+ }
+ }
+ }
+
+ FormFile *ff = currentProject->fakeFormFileFor( o );
+ FormWindow *fw = 0;
+ if ( ff )
+ fw = ff->formWindow();
+
+ if ( !fw && !qwf_forms ) {
+ qWarning( "MainWindow::showSourceLine: qwf_forms is NULL!" );
+ return;
+ }
+
+ mblockNewForms = TRUE;
+ if ( !fw )
+ openFormWindow( currentProject->makeAbsolute( *qwf_forms->tqfind( (TQWidget*)o ) ) );
+ else
+ fw->formFile()->showEditor( FALSE );
+ tqApp->processEvents(); // give all views the chance to get the formwindow
+ SourceEditor *se = editSource();
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ }
+ mblockNewForms = FALSE;
+}
+
+
+TQObject *MainWindow::tqfindRealObject( TQObject *o )
+{
+ TQWidgetList windows = qWorkspace()->windowList();
+ for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( ::tqqt_cast<FormWindow*>(w) && TQString( w->name() ) == TQString( o->name() ) )
+ return TQT_TQOBJECT(w);
+ else if ( ::tqqt_cast<SourceEditor*>(w) && ( (SourceEditor*)w )->formWindow() &&
+ TQString( ( (SourceEditor*)w )->formWindow()->name() ) == TQString( o->name() ) )
+ return TQT_TQOBJECT(w);
+ else if ( ::tqqt_cast<SourceFile*>(w) && ( (SourceEditor*)w )->sourceFile() &&
+ ( (SourceEditor*)w )->sourceFile() == o )
+ return o;
+ }
+ return 0;
+}
+
+void MainWindow::formNameChanged( FormWindow *fw )
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( TQT_BASE_OBJECT(e->object()) == TQT_BASE_OBJECT(fw) )
+ e->refresh( TRUE );
+ if ( e->project() == fw->project() )
+ e->resetContext();
+ }
+}
+
+void MainWindow::breakPointsChanged()
+{
+ if ( !inDebugMode )
+ return;
+ if ( !qWorkspace()->activeWindow() || !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+ SourceEditor *e = (SourceEditor*)qWorkspace()->activeWindow();
+ if ( !e->object() || !e->project() )
+ return;
+ if ( e->project() != currentProject )
+ return;
+
+ if ( !interpreterPluginManager ) {
+ interpreterPluginManager =
+ new TQPluginManager<InterpreterInterface>( IID_Interpreter,
+ TQApplication::libraryPaths(),
+ "/qsa" );
+ }
+
+ InterpreterInterface *iiface = 0;
+ if ( interpreterPluginManager ) {
+ TQString lang = currentProject->language();
+ iiface = 0;
+ interpreterPluginManager->queryInterface( lang, &iiface );
+ if ( !iiface )
+ return;
+ }
+
+ e->saveBreakPoints();
+
+ for ( TQObject *o = debuggingForms.first(); o; o = debuggingForms.next() ) {
+ if ( qstrcmp( o->name(), e->object()->name() ) == 0 ) {
+ iiface->setBreakPoints( o, MetaDataBase::breakPoints( e->object() ) );
+ break;
+ }
+ }
+
+ for ( e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->project() == currentProject && e->sourceFile() ) {
+ TQValueList<uint> bps = MetaDataBase::breakPoints( e->sourceFile() );
+ iiface->setBreakPoints( e->object(), bps );
+ }
+ }
+
+ iiface->release();
+}
+
+int MainWindow::currentLayoutDefaultSpacing() const
+{
+ if ( ( (MainWindow*)this )->formWindow() )
+ return ( (MainWindow*)this )->formWindow()->layoutDefaultSpacing();
+ return BOXLAYOUT_DEFAULT_SPACING;
+}
+
+int MainWindow::currentLayoutDefaultMargin() const
+{
+ if ( ( (MainWindow*)this )->formWindow() )
+ return ( (MainWindow*)this )->formWindow()->layoutDefaultMargin();
+ return BOXLAYOUT_DEFAULT_MARGIN;
+}
+
+void MainWindow::saveAllBreakPoints()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ e->save();
+ e->saveBreakPoints();
+ }
+}
+
+void MainWindow::resetBreakPoints()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->resetBreakPoints();
+}
+
+SourceFile *MainWindow::sourceFile()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( qworkspace->activeWindow() == e ) {
+ if ( e->sourceFile() )
+ return e->sourceFile();
+ }
+ }
+ return 0;
+}
+
+bool MainWindow::openProjectSettings( Project *pro )
+{
+ ProjectSettings dia( pro, this, 0, TRUE );
+ SenderObject *senderObject = new SenderObject( designerInterface() );
+ TQValueList<Tab>::ConstIterator it;
+ for ( it = projectTabs.begin(); it != projectTabs.end(); ++it ) {
+ Tab t = *it;
+ if ( t.title != pro->language() )
+ continue;
+ dia.tabWidget->addTab( t.w, t.title );
+ if ( t.receiver ) {
+ connect( dia.buttonOk, TQT_SIGNAL( clicked() ), senderObject, TQT_SLOT( emitAcceptSignal() ) );
+ connect( senderObject, TQT_SIGNAL( acceptSignal( TQUnknownInterface * ) ), t.receiver, t.accept_slot );
+ connect( senderObject, TQT_SIGNAL( initSignal( TQUnknownInterface * ) ), t.receiver, t.init_slot );
+ senderObject->emitInitSignal();
+ disconnect( senderObject, TQT_SIGNAL( initSignal( TQUnknownInterface * ) ), t.receiver, t.init_slot );
+ }
+ }
+
+ if ( singleProject )
+ dia.tabWidget->setTabEnabled( dia.tabSettings, FALSE );
+
+ int res = dia.exec();
+
+ delete senderObject;
+
+ for ( it = projectTabs.begin(); it != projectTabs.end(); ++it ) {
+ Tab t = *it;
+ dia.tabWidget->removePage( t.w );
+ t.w->reparent( 0, TQPoint(0,0), FALSE );
+ }
+
+ return res == TQDialog::Accepted;
+}
+
+void MainWindow::popupProjectMenu( const TQPoint &pos )
+{
+ projectMenu->exec( pos );
+}
+
+TQStringList MainWindow::sourceTemplates() const
+{
+ return sourceTemplatePluginManager->featureList();
+}
+
+SourceTemplateInterface* MainWindow::sourceTemplateInterface( const TQString& templ )
+{
+ SourceTemplateInterface *iface = 0;
+ sourceTemplatePluginManager->queryInterface( templ, &iface);
+ return iface;
+}
+
+TQString MainWindow::whatsThisFrom( const TQString &key )
+{
+ if ( menuHelpFile.isEmpty() ) {
+ TQString fn( documentationPath() );
+ fn += "/designer-manual-11.html";
+ TQFile f( fn );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &f );
+ menuHelpFile = ts.read();
+ }
+ }
+
+ int i = menuHelpFile.tqfind( key );
+ if ( i == -1 )
+ return TQString();
+ int start = i;
+ int end = i;
+ start = menuHelpFile.tqfindRev( "<li>", i ) + 4;
+ end = menuHelpFile.tqfind( '\n', i ) - 1;
+ return menuHelpFile.mid( start, end - start + 1 );
+}
+
+void MainWindow::setSingleProject( Project *pro )
+{
+ if ( eProject ) {
+ Project *pro = eProject;
+ pro->save();
+ TQWidgetList windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( TRUE );
+ TQWidgetListIt wit( windows );
+ while ( wit.current() ) {
+ TQWidget *w = wit.current();
+ ++wit;
+ if ( ::tqqt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->project() == pro ) {
+ if ( ( (FormWindow*)w )->formFile()->editor() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
+ ( (FormWindow*)w )->formFile()->close();
+ }
+ } else if ( ::tqqt_cast<SourceEditor*>(w) ) {
+ ( (SourceEditor*)w )->close();
+ }
+ }
+ hierarchyView->clear();
+ windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( FALSE );
+ currentProject = 0;
+ updateUndoRedo( FALSE, FALSE, TQString(), TQString() );
+ }
+
+ singleProject = TRUE;
+ projects.clear();
+ TQAction *a = new TQAction( tr( pro->name() ), tr( pro->name() ), 0,
+ actionGroupProjects, 0, TRUE );
+ eProject = pro;
+ projects.insert( a, eProject );
+ a->setOn( TRUE );
+ actionGroupProjects->removeFrom( projectMenu );
+ actionGroupProjects->removeFrom( projectToolBar );
+ currentProject = eProject;
+ currentProject->designerCreated();
+}
+
+void MainWindow::shuttingDown()
+{
+ outputWindow()->shuttingDown();
+}
+
+void MainWindow::showGUIStuff( bool b )
+{
+ if ( (bool)guiStuffVisible == b )
+ return;
+ guiStuffVisible = b;
+ if ( !b ) {
+ setAppropriate( (TQDockWindow*)toolBox->parentWidget(), FALSE );
+ toolBox->parentWidget()->hide();
+ for ( TQToolBar *tb = widgetToolBars.first(); tb; tb = widgetToolBars.next() ) {
+ tb->hide();
+ setAppropriate( tb, FALSE );
+ }
+ propertyEditor->setPropertyEditorEnabled( FALSE );
+ setAppropriate( layoutToolBar, FALSE );
+ layoutToolBar->hide();
+ setAppropriate( toolsToolBar, FALSE );
+ toolsToolBar->hide();
+ menubar->removeItem( toolsMenuId );
+ menubar->removeItem( toolsMenuId + 1 );
+ menubar->removeItem( toolsMenuId + 2 );
+ disconnect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditAccels, TQT_SLOT( setEnabled(bool) ) );
+ disconnect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditFunctions, TQT_SLOT( setEnabled(bool) ) );
+ disconnect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditConnections, TQT_SLOT( setEnabled(bool) ) );
+ disconnect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditSource, TQT_SLOT( setEnabled(bool) ) );
+ disconnect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditFormSettings, TQT_SLOT( setEnabled(bool) ) );
+ actionEditFormSettings->setEnabled( FALSE );
+ actionEditSource->setEnabled( FALSE );
+ actionEditConnections->setEnabled( FALSE );
+ actionEditFunctions->setEnabled( FALSE );
+ actionEditAccels->setEnabled( FALSE );
+ ( (TQDockWindow*)propertyEditor->parentWidget() )->
+ setCaption( tr( "Signal Handlers" ) );
+ actionGroupNew->removeFrom( fileMenu );
+ actionGroupNew->removeFrom( projectToolBar );
+ actionFileSave->removeFrom( fileMenu );
+ actionFileSave->removeFrom( projectToolBar );
+ actionFileExit->removeFrom( fileMenu );
+ actionNewFile->addTo( fileMenu );
+ actionNewFile->addTo( projectToolBar );
+ actionFileSave->addTo( fileMenu );
+ actionFileSave->addTo( projectToolBar );
+ actionFileExit->addTo( fileMenu );
+ } else {
+ setAppropriate( (TQDockWindow*)toolBox->parentWidget(), TRUE );
+ toolBox->parentWidget()->show();
+ for ( TQToolBar *tb = widgetToolBars.first(); tb; tb = widgetToolBars.next() ) {
+ setAppropriate( tb, TRUE );
+ tb->hide();
+ }
+ propertyEditor->setPropertyEditorEnabled( TRUE );
+ setAppropriate( layoutToolBar, TRUE );
+ layoutToolBar->show();
+ setAppropriate( toolsToolBar, TRUE );
+ toolsToolBar->show();
+ menubar->insertItem( tr( "&Tools" ), toolsMenu, toolsMenuId, toolsMenuIndex );
+ menubar->insertItem( tr( "&Layout" ), layoutMenu, toolsMenuId + 1, toolsMenuIndex + 1 );
+ menubar->insertItem( tr( "&Preview" ), previewMenu, toolsMenuId + 2, toolsMenuIndex + 2 );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditAccels, TQT_SLOT( setEnabled(bool) ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditFunctions, TQT_SLOT( setEnabled(bool) ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditConnections, TQT_SLOT( setEnabled(bool) ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditSource, TQT_SLOT( setEnabled(bool) ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditFormSettings, TQT_SLOT( setEnabled(bool) ) );
+ actionEditFormSettings->setEnabled( TRUE );
+ actionEditSource->setEnabled( TRUE );
+ actionEditConnections->setEnabled( TRUE );
+ actionEditFunctions->setEnabled( TRUE );
+ actionEditAccels->setEnabled( TRUE );
+ ( (TQDockWindow*)propertyEditor->parentWidget() )->
+ setCaption( tr( "Property Editor/Signal Handlers" ) );
+ actionFileSave->removeFrom( fileMenu );
+ actionFileSave->removeFrom( projectToolBar );
+ actionFileExit->removeFrom( fileMenu );
+ actionGroupNew->addTo( fileMenu );
+ actionGroupNew->addTo( projectToolBar );
+ actionFileSave->addTo( fileMenu );
+ actionFileSave->addTo( projectToolBar );
+ actionFileExit->addTo( fileMenu );
+ }
+}
+
+void MainWindow::setEditorsReadOnly( bool b )
+{
+ editorsReadOnly = b;
+}
+
+void MainWindow::setPluginDirectory( const TQString &pd )
+{
+ pluginDir = pd;
+ if ( !qwf_plugin_dir )
+ qwf_plugin_dir = new TQString( pd );
+ else
+ *qwf_plugin_dir = pd;
+}
+
+void MainWindow::toggleSignalHandlers( bool show )
+{
+ if ( sSignalHandlers == show )
+ return;
+ sSignalHandlers = show;
+ propertyEditor->setSignalHandlersEnabled( show );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/mainwindow.h b/tqtinterface/qt4/tools/designer/designer/mainwindow.h
new file mode 100644
index 0000000..30f04df
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/mainwindow.h
@@ -0,0 +1,505 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include "metadatabase.h"
+#include "../interfaces/actioninterface.h" // for GCC 2.7.* compatibility
+#include "../interfaces/editorinterface.h"
+#include "../interfaces/templatewizardiface.h"
+#include "../interfaces/languageinterface.h"
+#include "../interfaces/filterinterface.h"
+#include "../interfaces/interpreterinterface.h"
+#include "../interfaces/preferenceinterface.h"
+#include "../interfaces/projectsettingsiface.h"
+#include "../interfaces/sourcetemplateiface.h"
+#include "sourceeditor.h"
+
+#include <tqaction.h>
+#include <tqmainwindow.h>
+#include <tqmap.h>
+#include <tqguardedptr.h>
+#include <private/tqpluginmanager_p.h>
+#include <tqobjectlist.h>
+
+class TQToolBox;
+class PropertyEditor;
+class TQWorkspace;
+class TQMenuBar;
+class FormWindow;
+class TQPopupMenu;
+class HierarchyView;
+class TQCloseEvent;
+class Workspace;
+class ActionEditor;
+class Project;
+class OutputWindow;
+class TQTimer;
+class FindDialog;
+struct DesignerProject;
+class ReplaceDialog;
+class GotoLineDialog;
+class SourceFile;
+class FormFile;
+class TQAssistantClient;
+
+#if defined(TQ_FULL_TEMPLATE_INSTANTIATION)
+#include <tqtoolbar.h>
+#else
+class TQToolBar;
+#endif
+class Preferences;
+
+class MainWindow : public TQMainWindow
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ enum LineMode { Error, Step, StackFrame };
+
+ MainWindow( bool asClient, bool single = FALSE, const TQString &plgDir = "/designer" );
+ ~MainWindow();
+
+ HierarchyView *objectHierarchy() const;
+ Workspace *workspace() const;
+ PropertyEditor *propertyeditor() const;
+ ActionEditor *actioneditor() const;
+
+ void resetTool();
+ int currentTool() const;
+
+ FormWindow *formWindow();
+
+ bool unregisterClient( FormWindow *w );
+ void editorClosed( SourceEditor *e );
+ TQWidget *isAFormWindowChild( TQT_BASE_OBJECT_NAME *o ) const;
+ TQWidget *isAToolBarChild( TQT_BASE_OBJECT_NAME *o ) const;
+
+ void insertFormWindow( FormWindow *fw );
+ TQWorkspace *qWorkspace() const;
+
+ void popupFormWindowMenu( const TQPoint &gp, FormWindow *fw );
+ void popupWidgetMenu( const TQPoint &gp, FormWindow *fw, TQWidget *w );
+
+ TQPopupMenu *setupNormalHierarchyMenu( TQWidget *tqparent );
+ TQPopupMenu *setupTabWidgetHierarchyMenu( TQWidget *tqparent, const char *addSlot, const char *removeSlot );
+
+ FormWindow *openFormWindow( const TQString &fn, bool validFileName = TRUE, FormFile *ff = 0 );
+ bool isCustomWidgetUsed( MetaDataBase::CustomWidget *w );
+
+ void setGrid( const TQPoint &p );
+ void setShowGrid( bool b );
+ void setSnapGrid( bool b );
+ TQPoint grid() const { return grd; }
+ bool showGrid() const { return sGrid; }
+ bool snapGrid() const { return snGrid && sGrid; }
+
+ TQString documentationPath() const;
+
+ static MainWindow *self;
+
+ TQString templatePath() const { return templPath; }
+
+ void editFunction( const TQString &func, bool rereadSource = FALSE );
+
+ bool isPreviewing() const { return previewing; }
+
+ Project *currProject() const { return currentProject; }
+
+ FormWindow *activeForm() const { return lastActiveFormWindow; }
+
+ TemplateWizardInterface* templateWizardInterface( const TQString& className );
+ TQStringList sourceTemplates() const;
+ SourceTemplateInterface* sourceTemplateInterface( const TQString& templ );
+ TQUnknownInterface* designerInterface() const { return desInterface; }
+ TQPtrList<DesignerProject> projectList() const;
+ TQStringList projectNames() const;
+ TQStringList projectFileNames() const;
+ Project *tqfindProject( const TQString &projectName ) const;
+ void setCurrentProject( Project *pro );
+ void setCurrentProjectByFilename( const TQString& proFilename );
+ OutputWindow *outputWindow() const { return oWindow; }
+ void addPreferencesTab( TQWidget *tab, const TQString &title, TQObject *receiver, const char *init_slot, const char *accept_slot );
+ void addProjectTab( TQWidget *tab, const TQString &title, TQObject *receiver, const char *init_slot, const char *accept_slot );
+ void setModified( bool b, TQWidget *window );
+ void functionsChanged();
+ void updateFunctionList();
+ void updateWorkspace();
+ void runProjectPrecondition();
+ void runProjectPostcondition( TQObjectList *l );
+
+ void formNameChanged( FormWindow *fw );
+
+ int currentLayoutDefaultSpacing() const;
+ int currentLayoutDefaultMargin() const;
+
+ void saveAllBreakPoints();
+ void resetBreakPoints();
+
+ SourceFile *sourceFile();
+ void createNewProject( const TQString &lang );
+
+ void popupProjectMenu( const TQPoint &pos );
+ TQObject *tqfindRealObject( TQObject *o );
+
+ void setSingleProject( Project *pro );
+ bool singleProjectMode() const { return singleProject; }
+
+ void showSourceLine( TQObject *o, int line, LineMode lm );
+
+ void shuttingDown();
+ void showGUIStuff( bool b );
+ void setEditorsReadOnly( bool b );
+ bool areEditorsReadOnly() const { return editorsReadOnly; }
+ void toggleSignalHandlers( bool show );
+ bool showSignalHandlers() const { return sSignalHandlers; }
+ void writeConfig();
+
+ void openProject( const TQString &fn );
+ void setPluginDirectory( const TQString &pd );
+ TQString pluginDirectory() const { return pluginDir; }
+
+ TQAssistantClient* assistantClient() const { return assistant; }
+
+ void addRecentlyOpenedFile( const TQString &fn ) { addRecentlyOpened( fn, recentlyFiles ); }
+
+public Q_SLOTS:
+ void showProperties( TQObject *w );
+ void updateProperties( TQObject *w );
+ void showDialogHelp();
+ void showDebugStep( TQObject *o, int line );
+ void showStackFrame( TQObject *o, int line );
+ void showErrorMessage( TQObject *o, int line, const TQString &errorMessage );
+ void finishedRun();
+ void breakPointsChanged();
+
+Q_SIGNALS:
+ void currentToolChanged();
+ void hasActiveForm( bool );
+ void hasActiveWindow( bool );
+ void hasActiveWindowOrProject( bool );
+ void hasNonDummyProject( bool );
+ void formModified( bool );
+ void formWindowsChanged();
+ void formWindowChanged();
+ void projectChanged();
+ void editorChanged();
+
+protected:
+ bool eventFilter( TQObject *o, TQEvent *e );
+ void closeEvent( TQCloseEvent *e );
+
+public Q_SLOTS:
+ void fileNew();
+ void fileNewDialog();
+ void fileNewFile();
+ void fileClose();
+ void fileQuit();
+ void fileCloseProject(); // not visible in menu, called from fileClose
+ void fileOpen();
+ void fileOpen( const TQString &filter, const TQString &extension, const TQString &filename = "" , bool inProject = TRUE );
+ bool fileSave();
+ bool fileSaveForm(); // not visible in menu, called from fileSave
+ bool fileSaveProject(); // not visible in menu, called from fileSaveProject
+ bool fileSaveAs();
+ void fileSaveAll();
+ void fileCreateTemplate();
+
+public Q_SLOTS:
+ void editUndo();
+ void editRedo();
+ void editCut();
+ void editCopy();
+ void editPaste();
+ void editDelete();
+ void editSelectAll();
+ void editLower();
+ void editRaise();
+ void editAdjustSize();
+ void editLayoutHorizontal();
+ void editLayoutVertical();
+ void editLayoutHorizontalSplit();
+ void editLayoutVerticalSplit();
+ void editLayoutGrid();
+ void editLayoutContainerHorizontal();
+ void editLayoutContainerVertical();
+ void editLayoutContainerGrid();
+ void editBreakLayout();
+ void editAccels();
+ void editFunctions();
+ void editConnections();
+ SourceEditor *editSource();
+ SourceEditor *editSource( SourceFile *f );
+ SourceEditor *openSourceEditor();
+ SourceEditor *createSourceEditor( TQObject *object, Project *project,
+ const TQString &lang = TQString(),
+ const TQString &func = TQString(),
+ bool rereadSource = FALSE );
+ void editFormSettings();
+ void editProjectSettings();
+ void editPixmapCollection();
+ void editDatabaseConnections();
+ void editPreferences();
+
+ void projectInsertFile();
+
+ void searchFind();
+ void searchIncremetalFindMenu();
+ void searchIncremetalFind();
+ void searchIncremetalFindNext();
+ void searchReplace();
+ void searchGotoLine();
+
+ void previewForm();
+ void previewForm( const TQString& );
+
+ void toolsCustomWidget();
+ void toolsConfigure();
+
+ void helpContents();
+ void helpManual();
+ void helpAbout();
+ void helpAboutTQt();
+ void helpRegister();
+
+private Q_SLOTS:
+ void activeWindowChanged( TQWidget *w );
+ void updateUndoRedo( bool, bool, const TQString &, const TQString & );
+ void updateEditorUndoRedo();
+
+ void toolSelected( TQAction* );
+
+ void clipboardChanged();
+ void selectionChanged();
+
+ void windowsMenuActivated( int id );
+ void setupWindowActions();
+
+ void createNewTemplate();
+ void projectSelected( TQAction *a );
+
+ void setupRecentlyFilesMenu();
+ void setupRecentlyProjectsMenu();
+ void recentlyFilesMenuActivated( int id );
+ void recentlyProjectsMenuActivated( int id );
+
+ void emitProjectSignals();
+
+ void showStartDialog();
+
+private:
+ void setupMDI();
+ void setupMenuBar();
+ void setupEditActions();
+ void setupProjectActions();
+ void setupSearchActions();
+ void setupToolActions();
+ void setupLayoutActions();
+ void setupFileActions();
+ void setupPreviewActions();
+ void setupHelpActions();
+ void setupRMBMenus();
+
+ void setupPropertyEditor();
+ void setupHierarchyView();
+ void setupWorkspace();
+ void setupActionEditor();
+ void setupOutputWindow();
+ void setupToolbox();
+
+ void setupActionManager();
+ void setupPluginManagers();
+
+ void enableAll( bool enable );
+
+ TQWidget* previewFormInternal( TQStyle* style = 0, TQPalette* pal = 0 );
+
+ void readConfig();
+
+ void setupRMBProperties( TQValueList<uint> &ids, TQMap<TQString, int> &props, TQWidget *w );
+ void handleRMBProperties( int id, TQMap<TQString, int> &props, TQWidget *w );
+ void setupRMBSpecialCommands( TQValueList<uint> &ids, TQMap<TQString, int> &commands, TQWidget *w );
+ void handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, TQWidget *w );
+ void setupRMBSpecialCommands( TQValueList<uint> &ids, TQMap<TQString, int> &commands, FormWindow *w );
+ void handleRMBSpecialCommands( int id, TQMap<TQString, int> &commands, FormWindow *w );
+ bool openEditor( TQWidget *w, FormWindow *fw );
+ void rebuildCustomWidgetGUI();
+ void rebuildCommonWidgetsToolBoxPage();
+ void checkTempFiles();
+
+ void addRecentlyOpened( const TQString &fn, TQStringList &lst );
+
+ TQString whatsThisFrom( const TQString &key );
+
+private Q_SLOTS:
+ void doFunctionsChanged();
+ bool openProjectSettings( Project *pro );
+
+private:
+ struct Tab
+ {
+ TQWidget *w;
+ TQString title;
+ TQObject *receiver;
+ const char *init_slot, *accept_slot;
+ TQ_DUMMY_COMPARISON_OPERATOR( Tab )
+ };
+
+private:
+ PropertyEditor *propertyEditor;
+ HierarchyView *hierarchyView;
+ Workspace *wspace;
+ TQWidget *lastPressWidget;
+ TQWorkspace *qworkspace;
+ TQMenuBar *menubar;
+ TQGuardedPtr<FormWindow> lastActiveFormWindow;
+ bool breakLayout, layoutChilds, layoutSelected;
+ TQPoint grd;
+ bool sGrid, snGrid;
+ bool restoreConfig;
+ bool backPix;
+ bool splashScreen;
+ TQString fileFilter;
+
+ TQMap<TQAction*, Project*> projects;
+ TQAction *actionEditUndo, *actionEditRedo, *actionEditCut, *actionEditCopy,
+ *actionEditPaste, *actionEditDelete,
+ *actionEditAdjustSize,
+ *actionEditHLayout, *actionEditVLayout, *actionEditGridLayout,
+ *actionEditSplitHorizontal, *actionEditSplitVertical,
+ *actionEditSelectAll, *actionEditBreakLayout, *actionEditFunctions, *actionEditConnections,
+ *actionEditLower, *actionEditRaise, *actionInsertSpacer;
+ TQActionGroup *actionGroupTools, *actionGroupProjects;
+ TQAction* actionPointerTool, *actionConnectTool, *actionOrderTool, *actionBuddyTool;
+ TQAction* actionCurrentTool;
+ TQAction *actionHelpContents, *actionHelpAbout, *actionHelpAboutTQt, *actionHelpWhatsThis;
+ TQAction *actionHelpManual;
+#if defined(TQT_NON_COMMERCIAL)
+ TQAction *actionHelpRegister;
+#endif
+ TQAction *actionToolsCustomWidget, *actionEditPreferences;
+ TQAction *actionWindowTile, *actionWindowCascade, *actionWindowClose, *actionWindowCloseAll;
+ TQAction *actionWindowNext, *actionWindowPrevious;
+ TQAction *actionEditFormSettings, *actionEditAccels;
+ TQAction *actionEditSource, *actionNewFile, *actionFileSave, *actionFileExit;
+ TQAction *actionSearchFind, *actionSearchIncremetal, *actionSearchReplace, *actionSearchGotoLine;
+ TQActionGroup *actionGroupNew;
+
+ TQPopupMenu *rmbWidgets;
+ TQPopupMenu *rmbFormWindow;
+ TQPopupMenu *customWidgetMenu, *windowMenu, *fileMenu, *recentlyFilesMenu, *recentlyProjectsMenu;
+ TQPopupMenu *toolsMenu, *layoutMenu, *previewMenu;
+ TQToolBar *customWidgetToolBar, *layoutToolBar, *projectToolBar, *customWidgetToolBar2, *toolsToolBar;
+ TQToolBar *commonWidgetsToolBar;
+ TQPtrList<TQToolBar> widgetToolBars;
+
+ Preferences *prefDia;
+ TQMap<TQString,TQString> propertyDocumentation;
+ bool client;
+ TQString templPath;
+ ActionEditor *actionEditor;
+ Project *currentProject;
+ TQPluginManager<ActionInterface> *actionPluginManager;
+ TQPluginManager<EditorInterface> *editorPluginManager;
+ TQPluginManager<TemplateWizardInterface> *templateWizardPluginManager;
+ TQPluginManager<InterpreterInterface> *interpreterPluginManager;
+ TQPluginManager<PreferenceInterface> *preferencePluginManager;
+ TQPluginManager<ProjectSettingsInterface> *projectSettingsPluginManager;
+ TQPluginManager<SourceTemplateInterface> *sourceTemplatePluginManager;
+ TQPtrList<SourceEditor> sourceEditors;
+ bool previewing;
+ TQUnknownInterface *desInterface;
+ TQStringList recentlyFiles;
+ TQStringList recentlyProjects;
+ OutputWindow *oWindow;
+ TQValueList<Tab> preferenceTabs;
+ TQValueList<Tab> projectTabs;
+ bool databaseAutoEdit;
+ TQTimer *updateFunctionsTimer;
+ TQTimer *autoSaveTimer;
+ bool autoSaveEnabled;
+ int autoSaveInterval;
+ TQLineEdit *incrementalSearch;
+ TQGuardedPtr<FindDialog> tqfindDialog;
+ TQGuardedPtr<ReplaceDialog> tqreplaceDialog;
+ TQGuardedPtr<GotoLineDialog> gotoLineDialog;
+ Project *eProject;
+ bool inDebugMode;
+ TQObjectList debuggingForms;
+ TQString lastOpenFilter;
+ TQGuardedPtr<TQWidget> previewedForm;
+ TQPopupMenu *projectMenu;
+ TQString menuHelpFile;
+ bool singleProject;
+ TQToolBox *toolBox;
+ int toolsMenuId, toolsMenuIndex;
+ uint guiStuffVisible : 1;
+ uint editorsReadOnly : 1;
+ uint savePluginPaths : 1;
+ TQAssistantClient *assistant;
+ bool shStartDialog;
+ TQString pluginDir;
+ bool sSignalHandlers;
+
+public:
+ TQString lastSaveFilter;
+ TQPtrList<TQAction> toolActions;
+ TQPtrList<TQAction> commonWidgetsPage;
+
+};
+
+class SenderObject : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ SenderObject( TQUnknownInterface *i ) : iface( i ) { iface->addRef(); }
+ ~SenderObject() { iface->release(); }
+
+public Q_SLOTS:
+ void emitInitSignal() { emit initSignal( iface ); }
+ void emitAcceptSignal() { emit acceptSignal( iface ); }
+
+Q_SIGNALS:
+ void initSignal( TQUnknownInterface * );
+ void acceptSignal( TQUnknownInterface * );
+
+private:
+ TQUnknownInterface *iface;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/mainwindowactions.cpp b/tqtinterface/qt4/tools/designer/designer/mainwindowactions.cpp
new file mode 100644
index 0000000..281efdc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/mainwindowactions.cpp
@@ -0,0 +1,2061 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "mainwindow.h"
+
+#include <stdlib.h>
+#include <tqaction.h>
+#include <tqwhatsthis.h>
+#include <tqpopupmenu.h>
+#include <tqmenubar.h>
+#include <tqlineedit.h>
+#include <tqtooltip.h>
+#include <tqapplication.h>
+#include <tqsignalmapper.h>
+#include <tqstylefactory.h>
+#include <tqworkspace.h>
+#include <tqmessagebox.h>
+#include <tqstatusbar.h>
+#include <tqlistbox.h>
+#include <tqclipboard.h>
+#include <tqcombobox.h>
+#include <tqspinbox.h>
+#include <tqinputdialog.h>
+#include <tqdatetimeedit.h>
+#include <tqtextedit.h>
+
+#include "defs.h"
+#include "project.h"
+#include "widgetdatabase.h"
+#include "widgetfactory.h"
+#include "preferences.h"
+#include "formwindow.h"
+#include "newformimpl.h"
+#include "resource.h"
+#include "projectsettingsimpl.h"
+#include "workspace.h"
+#include "createtemplate.h"
+#include "hierarchyview.h"
+#include "editfunctionsimpl.h"
+#include "finddialog.h"
+#include "replacedialog.h"
+#include "gotolinedialog.h"
+#include "formsettingsimpl.h"
+#include "pixmapcollectioneditor.h"
+#include "styledbutton.h"
+#include "customwidgeteditorimpl.h"
+#ifndef TQT_NO_SQL
+#include "dbconnectionsimpl.h"
+#include "dbconnectionimpl.h"
+#endif
+#include "widgetaction.h"
+#include <tqtoolbox.h>
+#include "startdialogimpl.h"
+#include "designerappiface.h"
+#include "connectiondialog.h"
+#include "configtoolboxdialog.h"
+
+static const char * whatsthis_image[] = {
+ "16 16 3 1",
+ " c None",
+ "o c #000000",
+ "a c #000080",
+ "o aaaaa ",
+ "oo aaa aaa ",
+ "ooo aaa aaa",
+ "oooo aa aa",
+ "ooooo aa aa",
+ "oooooo a aaa",
+ "ooooooo aaa ",
+ "oooooooo aaa ",
+ "ooooooooo aaa ",
+ "ooooo aaa ",
+ "oo ooo ",
+ "o ooo aaa ",
+ " ooo aaa ",
+ " ooo ",
+ " ooo ",
+ " ooo "};
+
+const TQString toolbarHelp = "<p>Toolbars contain a number of buttons to "
+"provide quick access to often used functions.%1"
+"<br>Click on the toolbar handle to hide the toolbar, "
+"or drag and place the toolbar to a different location.</p>";
+
+static TQIconSet createIconSet( const TQString &name )
+{
+ TQIconSet ic( TQPixmap::fromMimeSource( "" + name ) );
+ TQString prefix = "designer_";
+ int right = name.length() - prefix.length();
+ ic.setPixmap( TQPixmap::fromMimeSource( prefix + "d_" + name.right( right ) ),
+ TQIconSet::Small, TQIconSet::Disabled );
+ return ic;
+}
+
+void MainWindow::setupEditActions()
+{
+ actionEditUndo = new TQAction( tr("Undo"), createIconSet( "designer_undo.png" ),tr("&Undo: Not Available"), Qt::CTRL + Qt::Key_Z, this, 0 );
+ actionEditUndo->setStatusTip( tr( "Undoes the last action" ) );
+ actionEditUndo->setWhatsThis( whatsThisFrom( "Edit|Undo" ) );
+ connect( actionEditUndo, TQT_SIGNAL( activated() ), this, TQT_SLOT( editUndo() ) );
+ actionEditUndo->setEnabled( FALSE );
+
+ actionEditRedo = new TQAction( tr( "Redo" ), createIconSet("designer_redo.png"), tr( "&Redo: Not Available" ), Qt::CTRL + Qt::Key_Y, this, 0 );
+ actionEditRedo->setStatusTip( tr( "Redoes the last undone operation") );
+ actionEditRedo->setWhatsThis( whatsThisFrom( "Edit|Redo" ) );
+ connect( actionEditRedo, TQT_SIGNAL( activated() ), this, TQT_SLOT( editRedo() ) );
+ actionEditRedo->setEnabled( FALSE );
+
+ actionEditCut = new TQAction( tr( "Cut" ), createIconSet("designer_editcut.png"), tr( "Cu&t" ), Qt::CTRL + Qt::Key_X, this, 0 );
+ actionEditCut->setStatusTip( tr( "Cuts the selected widgets and puts them on the clipboard" ) );
+ actionEditCut->setWhatsThis( whatsThisFrom( "Edit|Cut" ) );
+ connect( actionEditCut, TQT_SIGNAL( activated() ), this, TQT_SLOT( editCut() ) );
+ actionEditCut->setEnabled( FALSE );
+
+ actionEditCopy = new TQAction( tr( "Copy" ), createIconSet("designer_editcopy.png"), tr( "&Copy" ), Qt::CTRL + Qt::Key_C, this, 0 );
+ actionEditCopy->setStatusTip( tr( "Copies the selected widgets to the clipboard" ) );
+ actionEditCopy->setWhatsThis( whatsThisFrom( "Edit|Copy" ) );
+ connect( actionEditCopy, TQT_SIGNAL( activated() ), this, TQT_SLOT( editCopy() ) );
+ actionEditCopy->setEnabled( FALSE );
+
+ actionEditPaste = new TQAction( tr( "Paste" ), createIconSet("designer_editpaste.png"), tr( "&Paste" ), Qt::CTRL + Qt::Key_V, this, 0 );
+ actionEditPaste->setStatusTip( tr( "Pastes the clipboard's contents" ) );
+ actionEditPaste->setWhatsThis( whatsThisFrom( "Edit|Paste" ) );
+ connect( actionEditPaste, TQT_SIGNAL( activated() ), this, TQT_SLOT( editPaste() ) );
+ actionEditPaste->setEnabled( FALSE );
+
+ actionEditDelete = new TQAction( tr( "Delete" ), TQPixmap(), tr( "&Delete" ), Qt::Key_Delete, this, 0 );
+ actionEditDelete->setStatusTip( tr( "Deletes the selected widgets" ) );
+ actionEditDelete->setWhatsThis( whatsThisFrom( "Edit|Delete" ) );
+ connect( actionEditDelete, TQT_SIGNAL( activated() ), this, TQT_SLOT( editDelete() ) );
+ actionEditDelete->setEnabled( FALSE );
+#ifdef TQ_WS_MAC
+ TQAction *macDelete = new TQAction( tr( "Delete" ), TQPixmap(), tr( "&Delete" ), Qt::Key_Backspace, this, 0 );
+ connect( macDelete, TQT_SIGNAL( activated() ), this, TQT_SLOT( editDelete() ) );
+#endif
+
+ actionEditSelectAll = new TQAction( tr( "Select All" ), TQPixmap(), tr( "Select &All" ), Qt::CTRL + Qt::Key_A, this, 0 );
+ actionEditSelectAll->setStatusTip( tr( "Selects all widgets" ) );
+ actionEditSelectAll->setWhatsThis( whatsThisFrom( "Edit|Select All" ) );
+ connect( actionEditSelectAll, TQT_SIGNAL( activated() ), this, TQT_SLOT( editSelectAll() ) );
+ actionEditSelectAll->setEnabled( TRUE );
+
+ actionEditRaise = new TQAction( tr( "Bring to Front" ), createIconSet("designer_editraise.png"), tr( "Bring to &Front" ), 0, this, 0 );
+ actionEditRaise->setStatusTip( tr( "Raises the selected widgets" ) );
+ actionEditRaise->setWhatsThis( tr( "Raises the selected widgets" ) );
+ connect( actionEditRaise, TQT_SIGNAL( activated() ), this, TQT_SLOT( editRaise() ) );
+ actionEditRaise->setEnabled( FALSE );
+
+ actionEditLower = new TQAction( tr( "Send to Back" ), createIconSet("designer_editlower.png"), tr( "Send to &Back" ), 0, this, 0 );
+ actionEditLower->setStatusTip( tr( "Lowers the selected widgets" ) );
+ actionEditLower->setWhatsThis( tr( "Lowers the selected widgets" ) );
+ connect( actionEditLower, TQT_SIGNAL( activated() ), this, TQT_SLOT( editLower() ) );
+ actionEditLower->setEnabled( FALSE );
+
+ actionEditAccels = new TQAction( tr( "Check Accelerators" ), TQPixmap(),
+ tr( "Chec&k Accelerators" ), Qt::ALT + Qt::Key_R, this, 0 );
+ actionEditAccels->setStatusTip( tr("Checks if the accelerators used in the form are unique") );
+ actionEditAccels->setWhatsThis( whatsThisFrom( "Edit|Check Accelerator" ) );
+ connect( actionEditAccels, TQT_SIGNAL( activated() ), this, TQT_SLOT( editAccels() ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditAccels, TQT_SLOT( setEnabled(bool) ) );
+
+ actionEditFunctions = new TQAction( tr( "Slots" ), createIconSet("designer_editTslots.png"),
+ tr( "S&lots..." ), 0, this, 0 );
+ actionEditFunctions->setStatusTip( tr("Opens a dialog for editing Q_SLOTS") );
+ actionEditFunctions->setWhatsThis( whatsThisFrom( "Edit|Slots" ) );
+ connect( actionEditFunctions, TQT_SIGNAL( activated() ), this, TQT_SLOT( editFunctions() ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditFunctions, TQT_SLOT( setEnabled(bool) ) );
+
+ actionEditConnections = new TQAction( tr( "Connections" ), createIconSet("designer_connecttool.png"),
+ tr( "Co&nnections..." ), 0, this, 0 );
+ actionEditConnections->setStatusTip( tr("Opens a dialog for editing connections") );
+ actionEditConnections->setWhatsThis( whatsThisFrom( "Edit|Connections" ) );
+ connect( actionEditConnections, TQT_SIGNAL( activated() ), this, TQT_SLOT( editConnections() ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditConnections, TQT_SLOT( setEnabled(bool) ) );
+
+ actionEditSource = new TQAction( tr( "Source" ), TQIconSet(),
+ tr( "&Source..." ), Qt::CTRL + Qt::Key_E, this, 0 );
+ actionEditSource->setStatusTip( tr("Opens an editor to edit the form's source code") );
+ actionEditSource->setWhatsThis( whatsThisFrom( "Edit|Source" ) );
+ connect( actionEditSource, TQT_SIGNAL( activated() ), this, TQT_SLOT( editSource() ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditSource, TQT_SLOT( setEnabled(bool) ) );
+
+ actionEditFormSettings = new TQAction( tr( "Form Settings" ), TQPixmap(),
+ tr( "&Form Settings..." ), 0, this, 0 );
+ actionEditFormSettings->setStatusTip( tr("Opens a dialog to change the form's settings") );
+ actionEditFormSettings->setWhatsThis( whatsThisFrom( "Edit|Form Settings" ) );
+ connect( actionEditFormSettings, TQT_SIGNAL( activated() ), this, TQT_SLOT( editFormSettings() ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), actionEditFormSettings, TQT_SLOT( setEnabled(bool) ) );
+
+ actionEditPreferences = new TQAction( tr( "Preferences" ), TQPixmap(),
+ tr( "Preferences..." ), 0, this, 0 );
+ actionEditPreferences->setStatusTip( tr("Opens a dialog to change preferences") );
+ actionEditPreferences->setWhatsThis( whatsThisFrom( "Edit|Preferences" ) );
+ connect( actionEditPreferences, TQT_SIGNAL( activated() ), this, TQT_SLOT( editPreferences() ) );
+
+ TQToolBar *tb = new TQToolBar( this, "Edit" );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ TQWhatsThis::add( tb, tr( "<b>The Edit toolbar</b>%1").arg(tr(toolbarHelp).arg("")) );
+ addToolBar( tb, tr( "Edit" ) );
+ actionEditUndo->addTo( tb );
+ actionEditRedo->addTo( tb );
+ tb->addSeparator();
+ actionEditCut->addTo( tb );
+ actionEditCopy->addTo( tb );
+ actionEditPaste->addTo( tb );
+#if 0
+ tb->addSeparator();
+ actionEditLower->addTo( tb );
+ actionEditRaise->addTo( tb );
+#endif
+
+ TQPopupMenu *menu = new TQPopupMenu( this, "Edit" );
+ connect( menu, TQT_SIGNAL( aboutToShow() ), this, TQT_SLOT( updateEditorUndoRedo() ) );
+ menubar->insertItem( tr( "&Edit" ), menu );
+ actionEditUndo->addTo( menu );
+ actionEditRedo->addTo( menu );
+ menu->insertSeparator();
+ actionEditCut->addTo( menu );
+ actionEditCopy->addTo( menu );
+ actionEditPaste->addTo( menu );
+ actionEditDelete->addTo( menu );
+ actionEditSelectAll->addTo( menu );
+ actionEditAccels->addTo( menu );
+#if 0
+ menu->insertSeparator();
+ actionEditLower->addTo( menu );
+ actionEditRaise->addTo( menu );
+#endif
+ menu->insertSeparator();
+ if ( !singleProjectMode() ) {
+ actionEditFunctions->addTo( menu );
+ actionEditConnections->addTo( menu );
+ }
+ actionEditFormSettings->addTo( menu );
+ menu->insertSeparator();
+ actionEditPreferences->addTo( menu );
+}
+
+void MainWindow::setupSearchActions()
+{
+ actionSearchFind = new TQAction( tr( "Find" ), createIconSet( "designer_searchfind.png" ),
+ tr( "&Find..." ), Qt::CTRL + Qt::Key_F, this, 0 );
+ connect( actionSearchFind, TQT_SIGNAL( activated() ), this, TQT_SLOT( searchFind() ) );
+ actionSearchFind->setEnabled( FALSE );
+ actionSearchFind->setWhatsThis( whatsThisFrom( "Search|Find" ) );
+
+ actionSearchIncremetal = new TQAction( tr( "Find Incremental" ), TQIconSet(),
+ tr( "Find &Incremental" ), Qt::ALT + Qt::Key_I, this, 0 );
+ connect( actionSearchIncremetal, TQT_SIGNAL( activated() ), this, TQT_SLOT( searchIncremetalFindMenu() ) );
+ actionSearchIncremetal->setEnabled( FALSE );
+ actionSearchIncremetal->setWhatsThis( whatsThisFrom( "Search|Find Incremental" ) );
+
+ actionSearchReplace = new TQAction( tr( "Replace" ), TQIconSet(),
+ tr( "&Replace..." ), Qt::CTRL + Qt::Key_R, this, 0 );
+ connect( actionSearchReplace, TQT_SIGNAL( activated() ), this, TQT_SLOT( searchReplace() ) );
+ actionSearchReplace->setEnabled( FALSE );
+ actionSearchReplace->setWhatsThis( whatsThisFrom( "Search|Replace" ) );
+
+ actionSearchGotoLine = new TQAction( tr( "Goto Line" ), TQIconSet(),
+ tr( "&Goto Line..." ), Qt::ALT + Qt::Key_G, this, 0 );
+ connect( actionSearchGotoLine, TQT_SIGNAL( activated() ), this, TQT_SLOT( searchGotoLine() ) );
+ actionSearchGotoLine->setEnabled( FALSE );
+ actionSearchGotoLine->setWhatsThis( whatsThisFrom( "Search|Goto line" ) );
+
+ TQToolBar *tb = new TQToolBar( this, "Search" );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ addToolBar( tb, tr( "Search" ) );
+
+ actionSearchFind->addTo( tb );
+ incrementalSearch = new TQLineEdit( tb );
+ TQToolTip::add( incrementalSearch, tr( "Incremetal Search (Alt+I)" ) );
+ connect( incrementalSearch, TQT_SIGNAL( textChanged( const TQString & ) ),
+ this, TQT_SLOT( searchIncremetalFind() ) );
+ connect( incrementalSearch, TQT_SIGNAL( returnPressed() ),
+ this, TQT_SLOT( searchIncremetalFindNext() ) );
+ incrementalSearch->setEnabled( FALSE );
+
+ TQPopupMenu *menu = new TQPopupMenu( this, "Search" );
+ menubar->insertItem( tr( "&Search" ), menu );
+ actionSearchFind->addTo( menu );
+ actionSearchIncremetal->addTo( menu );
+ actionSearchReplace->addTo( menu );
+ menu->insertSeparator();
+ actionSearchGotoLine->addTo( menu );
+}
+
+void MainWindow::setupLayoutActions()
+{
+ if ( !actionGroupTools ) {
+ actionGroupTools = new TQActionGroup( this );
+ actionGroupTools->setExclusive( TRUE );
+ connect( actionGroupTools, TQT_SIGNAL( selected(TQAction*) ), this, TQT_SLOT( toolSelected(TQAction*) ) );
+ }
+
+ actionEditAdjustSize = new TQAction( tr( "Adjust Size" ), createIconSet("designer_adjustsize.png"),
+ tr( "Adjust &Size" ), Qt::CTRL + Qt::Key_J, this, 0 );
+ actionEditAdjustSize->setStatusTip(tr("Adjusts the size of the selected widget") );
+ actionEditAdjustSize->setWhatsThis( whatsThisFrom( "Layout|Adjust Size" ) );
+ connect( actionEditAdjustSize, TQT_SIGNAL( activated() ), this, TQT_SLOT( editAdjustSize() ) );
+ actionEditAdjustSize->setEnabled( FALSE );
+
+ actionEditHLayout = new TQAction( tr( "Lay Out Horizontally" ), createIconSet("designer_edithlayout.png"),
+ tr( "Lay Out &Horizontally" ), Qt::CTRL + Qt::Key_H, this, 0 );
+ actionEditHLayout->setStatusTip(tr("Lays out the selected widgets horizontally") );
+ actionEditHLayout->setWhatsThis( whatsThisFrom( "Layout|Lay Out Horizontally" ) );
+ connect( actionEditHLayout, TQT_SIGNAL( activated() ), this, TQT_SLOT( editLayoutHorizontal() ) );
+ actionEditHLayout->setEnabled( FALSE );
+
+ actionEditVLayout = new TQAction( tr( "Lay Out Vertically" ), createIconSet("designer_editvlayout.png"),
+ tr( "Lay Out &Vertically" ), Qt::CTRL + Qt::Key_L, this, 0 );
+ actionEditVLayout->setStatusTip(tr("Lays out the selected widgets vertically") );
+ actionEditVLayout->setWhatsThis( whatsThisFrom( "Layout|Lay Out Vertically" ) );
+ connect( actionEditVLayout, TQT_SIGNAL( activated() ), this, TQT_SLOT( editLayoutVertical() ) );
+ actionEditVLayout->setEnabled( FALSE );
+
+ actionEditGridLayout = new TQAction( tr( "Lay Out in a Grid" ), createIconSet("designer_editgrid.png"),
+ tr( "Lay Out in a &Grid" ), Qt::CTRL + Qt::Key_G, this, 0 );
+ actionEditGridLayout->setStatusTip(tr("Lays out the selected widgets in a grid") );
+ actionEditGridLayout->setWhatsThis( whatsThisFrom( "Layout|Lay Out in a Grid" ) );
+ connect( actionEditGridLayout, TQT_SIGNAL( activated() ), this, TQT_SLOT( editLayoutGrid() ) );
+ actionEditGridLayout->setEnabled( FALSE );
+
+ actionEditSplitHorizontal = new TQAction( tr( "Lay Out Horizontally (in Splitter)" ), createIconSet("designer_editvlayoutsplit.png"),
+ tr( "Lay Out Horizontally (in S&plitter)" ), 0, this, 0 );
+ actionEditSplitHorizontal->setStatusTip(tr("Lays out the selected widgets horizontally in a splitter") );
+ actionEditSplitHorizontal->setWhatsThis( whatsThisFrom( "Layout|Lay Out Horizontally (in Splitter)" ) );
+ connect( actionEditSplitHorizontal, TQT_SIGNAL( activated() ), this, TQT_SLOT( editLayoutHorizontalSplit() ) );
+ actionEditSplitHorizontal->setEnabled( FALSE );
+
+ actionEditSplitVertical = new TQAction( tr( "Lay Out Vertically (in Splitter)" ), createIconSet("designer_edithlayoutsplit.png"),
+ tr( "Lay Out Vertically (in Sp&litter)" ), 0, this, 0 );
+ actionEditSplitVertical->setStatusTip(tr("Lays out the selected widgets vertically in a splitter") );
+ actionEditSplitVertical->setWhatsThis( whatsThisFrom( "Layout|Lay Out Vertically (in Splitter)" ) );
+ connect( actionEditSplitVertical, TQT_SIGNAL( activated() ), this, TQT_SLOT( editLayoutVerticalSplit() ) );
+ actionEditSplitVertical->setEnabled( FALSE );
+
+ actionEditBreakLayout = new TQAction( tr( "Break Layout" ), createIconSet("designer_editbreaklayout.png"),
+ tr( "&Break Layout" ), Qt::CTRL + Qt::Key_B, this, 0 );
+ actionEditBreakLayout->setStatusTip(tr("Breaks the selected tqlayout") );
+ actionEditBreakLayout->setWhatsThis( whatsThisFrom( "Layout|Break Layout" ) );
+ connect( actionEditBreakLayout, TQT_SIGNAL( activated() ), this, TQT_SLOT( editBreakLayout() ) );
+ actionEditBreakLayout->setEnabled( FALSE );
+
+ int id = WidgetDatabase::idFromClassName( "Spacer" );
+ actionInsertSpacer = new WidgetAction( "Layout", actionGroupTools, TQString::number( id ).latin1() );
+ actionInsertSpacer->setToggleAction( TRUE );
+ actionInsertSpacer->setText( WidgetDatabase::className( id ) );
+ actionInsertSpacer->setMenuText( tr( "Add ") + WidgetDatabase::className( id ) );
+ actionInsertSpacer->setIconSet( WidgetDatabase::iconSet( id ) );
+ actionInsertSpacer->setToolTip( WidgetDatabase::toolTip( id ) );
+ actionInsertSpacer->setStatusTip( tr( "Insert a %1").arg(WidgetDatabase::toolTip( id )) );
+ actionInsertSpacer->setWhatsThis( TQString("<b>A %1</b><p>%2</p>"
+ "<p>Click to insert a single %3,"
+ "or double click to keep the tool selected.")
+ .arg(WidgetDatabase::toolTip( id ))
+ .arg(WidgetDatabase::whatsThis( id ))
+ .arg(WidgetDatabase::toolTip( id ) ));
+
+ actionInsertSpacer->addTo( commonWidgetsToolBar );
+ commonWidgetsPage.append( actionInsertSpacer );
+ TQWidget *w;
+ commonWidgetsToolBar->setStretchableWidget( ( w = new TQWidget( commonWidgetsToolBar ) ) );
+ w->setBackgroundMode( commonWidgetsToolBar->backgroundMode() );
+ TQWhatsThis::add( layoutToolBar, tr( "<b>The Layout toolbar</b>%1" ).arg(tr(toolbarHelp).arg("")) );
+ actionEditAdjustSize->addTo( layoutToolBar );
+ layoutToolBar->addSeparator();
+ actionEditHLayout->addTo( layoutToolBar );
+ actionEditVLayout->addTo( layoutToolBar );
+ actionEditGridLayout->addTo( layoutToolBar );
+ actionEditSplitHorizontal->addTo( layoutToolBar );
+ actionEditSplitVertical->addTo( layoutToolBar );
+ actionEditBreakLayout->addTo( layoutToolBar );
+ layoutToolBar->addSeparator();
+ actionInsertSpacer->addTo( layoutToolBar );
+
+ TQPopupMenu *menu = new TQPopupMenu( this, "Layout" );
+ layoutMenu = menu;
+ menubar->insertItem( tr( "&Layout" ), menu, toolsMenuId + 1 );
+ actionEditAdjustSize->addTo( menu );
+ menu->insertSeparator();
+ actionEditHLayout->addTo( menu );
+ actionEditVLayout->addTo( menu );
+ actionEditGridLayout->addTo( menu );
+ actionEditSplitHorizontal->addTo( menu );
+ actionEditSplitVertical->addTo( menu );
+ actionEditBreakLayout->addTo( menu );
+ menu->insertSeparator();
+ actionInsertSpacer->addTo( menu );
+}
+
+void MainWindow::setupToolActions()
+{
+ if ( !actionGroupTools ) {
+ actionGroupTools = new TQActionGroup( this );
+ actionGroupTools->setExclusive( TRUE );
+ connect( actionGroupTools, TQT_SIGNAL( selected(TQAction*) ),
+ this, TQT_SLOT( toolSelected(TQAction*) ) );
+ }
+
+ actionPointerTool = new TQAction( tr("Pointer"), createIconSet("designer_pointer.png"),
+ tr("&Pointer"), Qt::Key_F2,
+ actionGroupTools,
+ TQString::number(POINTER_TOOL).latin1(), TRUE );
+ actionPointerTool->setStatusTip( tr("Selects the pointer tool") );
+ actionPointerTool->setWhatsThis( whatsThisFrom( "Tools|Pointer" ) );
+
+ actionConnectTool = new TQAction( tr("Connect Signal/Slots"),
+ createIconSet("designer_connecttool.png"),
+ tr("&Connect Signal/Slots"),
+ singleProjectMode() ? 0 : Qt::Key_F3,
+ actionGroupTools,
+ TQString::number(CONNECT_TOOL).latin1(), TRUE );
+ actionConnectTool->setStatusTip( tr("Selects the connection tool") );
+ actionConnectTool->setWhatsThis( whatsThisFrom( "Tools|Connect Signals and Slots" ) );
+
+ actionOrderTool = new TQAction( tr("Tab Order"), createIconSet("designer_ordertool.png"),
+ tr("Tab &Order"), Qt::Key_F4,
+ actionGroupTools,
+ TQString::number(ORDER_TOOL).latin1(), TRUE );
+ actionOrderTool->setStatusTip( tr("Selects the tab order tool") );
+ actionOrderTool->setWhatsThis( whatsThisFrom( "Tools|Tab Order" ) );
+
+ actionBuddyTool = new TQAction( tr( "Set Buddy" ), createIconSet( "designer_setbuddy.png" ),
+ tr( "Set &Buddy" ), Qt::Key_F12,
+ actionGroupTools, TQString::number( BUDDY_TOOL ).latin1(),
+ TRUE );
+ actionBuddyTool->setStatusTip( tr( "Sets a buddy to a label" ) );
+ actionBuddyTool->setWhatsThis( whatsThisFrom( "Tools|Set Buddy" ) );
+
+ TQToolBar *tb = new TQToolBar( this, "Tools" );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ toolsToolBar = tb;
+ TQWhatsThis::add( tb, tr( "<b>The Tools toolbar</b>%1" ).arg(tr(toolbarHelp).arg("")) );
+
+ addToolBar( tb, tr( "Tools" ), TQt::DockTop, FALSE );
+ actionPointerTool->addTo( tb );
+ if ( !singleProjectMode() )
+ actionConnectTool->addTo( tb );
+ actionOrderTool->addTo( tb );
+ actionBuddyTool->addTo( tb );
+
+ TQPopupMenu *mmenu = new TQPopupMenu( this, "Tools" );
+ toolsMenu = mmenu;
+ toolsMenuId = 100;
+ menubar->insertItem( tr( "&Tools" ), mmenu, toolsMenuId );
+ toolsMenuIndex = menubar->indexOf( toolsMenuId );
+ actionPointerTool->addTo( mmenu );
+ if ( !singleProjectMode() )
+ actionConnectTool->addTo( mmenu );
+ actionOrderTool->addTo( mmenu );
+ actionBuddyTool->addTo( mmenu );
+ mmenu->insertSeparator();
+
+ customWidgetToolBar = 0;
+ customWidgetMenu = 0;
+
+ actionToolsCustomWidget = new TQAction( tr("Custom Widgets"),
+ createIconSet( "designer_customwidget.png" ),
+ tr("Edit &Custom Widgets..."), 0, this, 0 );
+ actionToolsCustomWidget->setStatusTip( tr("Opens a dialog to add and change "
+ "custom widgets") );
+ actionToolsCustomWidget->setWhatsThis( whatsThisFrom( "Tools|Custom|Edit Custom"
+ "Widgets" ) );
+ connect( actionToolsCustomWidget, TQT_SIGNAL( activated() ),
+ this, TQT_SLOT( toolsCustomWidget() ) );
+
+ for ( int j = 0; j < WidgetDatabase::numWidgetGroups(); ++j ) {
+ TQString grp = WidgetDatabase::widgetGroup( j );
+ if ( !WidgetDatabase::isGroupVisible( grp ) ||
+ WidgetDatabase::isGroupEmpty( grp ) )
+ continue;
+ TQToolBar *tb = new TQToolBar( this, grp.latin1() );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ widgetToolBars.append( tb );
+ bool plural = grp[(int)grp.length()-1] == 's';
+ if ( plural ) {
+ TQWhatsThis::add( tb, tr( "<b>The %1</b>%2" ).arg(grp).arg(tr(toolbarHelp).
+ arg( tr(" Click on a button to insert a single widget, "
+ "or double click to insert multiple %1.") ).arg(grp)) );
+ } else {
+ TQWhatsThis::add( tb, tr( "<b>The %1 Widgets</b>%2" ).arg(grp).arg(tr(toolbarHelp).
+ arg( tr(" Click on a button to insert a single %1 widget, "
+ "or double click to insert multiple widgets.") ).arg(grp)) );
+ }
+ addToolBar( tb, grp );
+ tb->hide();
+ TQPopupMenu *menu = new TQPopupMenu( this, grp.latin1() );
+ mmenu->insertItem( grp, menu );
+
+ TQToolBar *tb2 = new TQToolBar( grp, 0, toolBox, FALSE, grp.latin1() );
+ tb2->setFrameStyle( TQFrame::NoFrame );
+ tb2->setOrientation( Qt::Vertical );
+ tb2->setBackgroundMode( TQt::PaletteBase );
+ toolBox->addItem( tb2, grp );
+
+ if ( grp == "Custom" ) {
+ if ( !customWidgetMenu )
+ actionToolsCustomWidget->addTo( menu );
+ else
+ menu->insertSeparator();
+ customWidgetMenu = menu;
+ customWidgetToolBar = tb;
+ }
+
+ for ( int i = 0; i < WidgetDatabase::count(); ++i ) {
+ if ( WidgetDatabase::group( i ) != grp )
+ continue; // only widgets, i.e. not forms and temp stuff
+ WidgetAction* a =
+ new WidgetAction( grp, actionGroupTools, TQString::number( i ).latin1() );
+ a->setToggleAction( TRUE );
+ TQString atext = WidgetDatabase::className( i );
+ if ( atext[0] == 'Q' )
+ atext = atext.mid(1);
+ while ( atext.length() && atext[0] >= 'a' && atext[0] <= 'z' )
+ atext = atext.mid(1);
+ if ( atext.isEmpty() )
+ atext = WidgetDatabase::className( i );
+ a->setText( atext );
+ TQString ttip = WidgetDatabase::toolTip( i );
+ a->setIconSet( WidgetDatabase::iconSet( i ) );
+ a->setToolTip( ttip );
+ if ( !WidgetDatabase::isWhatsThisLoaded() )
+ WidgetDatabase::loadWhatsThis( documentationPath() );
+ a->setStatusTip( tr( "Insert a %1").arg(WidgetDatabase::className( i )) );
+
+ TQString whats = TQString("<b>A %1</b>").arg( WidgetDatabase::className( i ) );
+ if ( !WidgetDatabase::whatsThis( i ).isEmpty() )
+ whats += TQString("<p>%1</p>").arg(WidgetDatabase::whatsThis( i ));
+ a->setWhatsThis( whats+ tr("<p>Double click on this tool to keep it selected.</p>") );
+
+ if ( grp != "KDE" )
+ a->addTo( tb );
+ a->addTo( menu );
+ a->addTo( tb2 );
+ if ( WidgetDatabase::isCommon( i ) ) {
+ a->addTo( commonWidgetsToolBar );
+ commonWidgetsPage.append( a );
+ }
+ }
+ TQWidget *w;
+ tb2->setStretchableWidget( ( w = new TQWidget( tb2 ) ) );
+ w->setBackgroundMode( tb2->backgroundMode() );
+ }
+
+ if ( !customWidgetToolBar ) {
+ TQToolBar *tb = new TQToolBar( this, "Custom Widgets" );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ TQWhatsThis::add( tb, tr( "<b>The Custom Widgets toolbar</b>%1"
+ "<p>Click <b>Edit Custom Widgets...</b>"
+ "in the <b>Tools|Custom</b> menu to "
+ "add and change custom widgets</p>" ).
+ arg(tr(toolbarHelp).
+ arg( tr(" Click on the buttons to insert a single widget, "
+ "or double click to insert multiple widgets.") )) );
+ addToolBar( tb, "Custom" );
+ tb->hide();
+ widgetToolBars.append( tb );
+ customWidgetToolBar = tb;
+ TQPopupMenu *menu = new TQPopupMenu( this, "Custom Widgets" );
+ mmenu->insertItem( "Custom", menu );
+ customWidgetMenu = menu;
+ customWidgetToolBar->hide();
+ actionToolsCustomWidget->addTo( customWidgetMenu );
+ customWidgetMenu->insertSeparator();
+ TQToolBar *tb2 = new TQToolBar( "Custom Widgets", 0,
+ toolBox, FALSE, "Custom Widgets" );
+ tb2->setBackgroundMode(TQt::PaletteBase);
+ tb2->setOrientation( Qt::Vertical );
+ tb2->setFrameStyle( TQFrame::NoFrame );
+ toolBox->addItem( tb2, "Custom Widgets" );
+ customWidgetToolBar2 = tb2;
+ }
+
+ TQAction *a = new TQAction( tr( "Configure Toolbox" ), tr( "Configure Toolbox..." ), 0, this );
+ a->setStatusTip( tr( "Opens a dialog to configure the common "
+ "widgets page of the toolbox") );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( toolsConfigure() ) );
+ mmenu->insertSeparator();
+ a->addTo( mmenu );
+ resetTool();
+}
+
+void MainWindow::setupFileActions()
+{
+ TQToolBar* tb = new TQToolBar( this, "File" );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ projectToolBar = tb;
+
+ TQWhatsThis::add( tb, tr( "<b>The File toolbar</b>%1" ).arg(tr(toolbarHelp).arg("")) );
+ addToolBar( tb, tr( "File" ) );
+ fileMenu = new TQPopupMenu( this, "File" );
+ menubar->insertItem( tr( "&File" ), fileMenu );
+
+ TQAction *a = 0;
+
+ if ( !singleProject ) {
+ a = new TQAction( this, 0 );
+ a->setText( tr( "New" ) );
+ a->setToolTip( tr( "New Dialog or File" ) );
+ a->setMenuText( tr( "&New..." ) );
+ a->setIconSet( createIconSet("designer_filenew.png") );
+ a->setAccel( Qt::CTRL + Qt::Key_N );
+ a->setStatusTip( tr( "Creates a new project, form or source file." ) );
+ a->setWhatsThis( whatsThisFrom( "File|New" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileNew() ) );
+ a->addTo( tb );
+ a->addTo( fileMenu );
+ } else {
+ actionGroupNew = new TQActionGroup( this, 0, FALSE );
+ a = actionGroupNew;
+ ( (TQActionGroup*)a )->setUsesDropDown( TRUE );
+ a->setText( tr( "New" ) );
+ a->setMenuText( tr( "&New..." ) );
+ a->setIconSet( createIconSet("designer_form.png") );
+ a->setStatusTip( tr( "Creates a new dialog or file" ) );
+ a->setWhatsThis( whatsThisFrom( "File|New" ) );
+
+ TQAction *newForm = new TQAction( a, 0 );
+ newForm->setText( tr( "New Dialog" ) );
+ newForm->setMenuText( tr( "&Dialog..." ) );
+ newForm->setIconSet( createIconSet("designer_form.png") );
+ newForm->setAccel( Qt::CTRL + Qt::Key_N );
+ newForm->setStatusTip( tr( "Creates a new dialog." ) );
+ connect( newForm, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileNewDialog() ) );
+
+ TQAction *newFile = new TQAction( a, 0 );
+ newFile->setText( tr( "New File" ) );
+ newFile->setMenuText( tr( "&File..." ) );
+ newFile->setIconSet( createIconSet("designer_filenew.png") );
+ newFile->setAccel( Qt::ALT + Qt::Key_N );
+ newFile->setStatusTip( tr( "Creates a new file." ) );
+ connect( newFile, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileNewFile() ) );
+ actionNewFile = newFile;
+
+ a->addTo( tb );
+ a->addTo( fileMenu );
+
+ fileMenu->insertSeparator();
+ }
+
+ a = new TQAction( this, 0 );
+ a->setText( tr( "Open" ) );
+ a->setMenuText( tr( "&Open..." ) );
+ a->setIconSet( createIconSet("designer_fileopen.png") );
+ a->setAccel( Qt::CTRL + Qt::Key_O );
+ a->setStatusTip( tr( "Opens an existing project, form or source file ") );
+ a->setWhatsThis( whatsThisFrom( "File|Open" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileOpen() ) );
+ if ( !singleProject ) {
+ a->addTo( tb );
+ a->addTo( fileMenu );
+ fileMenu->insertSeparator();
+ }
+
+
+ a = new TQAction( this, 0 );
+ a->setText( tr( "Close" ) );
+ a->setMenuText( tr( "&Close" ) );
+ a->setStatusTip( tr( "Closes the current project or document" ) );
+ a->setWhatsThis(whatsThisFrom( "File|Close" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileClose() ) );
+ connect( this, TQT_SIGNAL( hasActiveWindowOrProject(bool) ), a, TQT_SLOT( setEnabled(bool) ) );
+ if ( !singleProject ) {
+ a->addTo( fileMenu );
+ fileMenu->insertSeparator();
+ }
+
+ a = new TQAction( this, 0 );
+ actionFileSave = a;
+ a->setText( tr( "Save" ) );
+ a->setMenuText( tr( "&Save" ) );
+ a->setIconSet( createIconSet("designer_filesave.png") );
+ a->setAccel( Qt::CTRL + Qt::Key_S );
+ a->setStatusTip( tr( "Saves the current project or document" ) );
+ a->setWhatsThis(whatsThisFrom( "File|Save" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileSave() ) );
+ connect( this, TQT_SIGNAL( hasActiveWindowOrProject(bool) ), a, TQT_SLOT( setEnabled(bool) ) );
+ a->addTo( tb );
+ a->addTo( fileMenu );
+
+ a = new TQAction( this, 0 );
+ a->setText( tr( "Save As" ) );
+ a->setMenuText( tr( "Save &As..." ) );
+ a->setStatusTip( tr( "Saves the current form with a new filename" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Save As" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileSaveAs() ) );
+ connect( this, TQT_SIGNAL( hasActiveWindow(bool) ), a, TQT_SLOT( setEnabled(bool) ) );
+ if ( !singleProject )
+ a->addTo( fileMenu );
+
+ a = new TQAction( this, 0 );
+ a->setText( tr( "Save All" ) );
+ a->setMenuText( tr( "Sa&ve All" ) );
+ a->setStatusTip( tr( "Saves all open documents" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Save All" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileSaveAll() ) );
+ connect( this, TQT_SIGNAL( hasActiveWindowOrProject(bool) ), a, TQT_SLOT( setEnabled(bool) ) );
+ if ( !singleProject ) {
+ a->addTo( fileMenu );
+ fileMenu->insertSeparator();
+ }
+
+ a = new TQAction( this, 0 );
+ a->setText( tr( "Create Template" ) );
+ a->setMenuText( tr( "Create &Template..." ) );
+ a->setStatusTip( tr( "Creates a new template" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Create Template" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileCreateTemplate() ) );
+ if ( !singleProject )
+ a->addTo( fileMenu );
+
+ if ( !singleProject )
+ fileMenu->insertSeparator();
+
+ recentlyFilesMenu = new TQPopupMenu( this );
+ recentlyProjectsMenu = new TQPopupMenu( this );
+
+ if ( !singleProject ) {
+ fileMenu->insertItem( tr( "Recently opened files " ), recentlyFilesMenu );
+ fileMenu->insertItem( tr( "Recently opened projects" ), recentlyProjectsMenu );
+ }
+
+ connect( recentlyFilesMenu, TQT_SIGNAL( aboutToShow() ),
+ this, TQT_SLOT( setupRecentlyFilesMenu() ) );
+ connect( recentlyProjectsMenu, TQT_SIGNAL( aboutToShow() ),
+ this, TQT_SLOT( setupRecentlyProjectsMenu() ) );
+ connect( recentlyFilesMenu, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( recentlyFilesMenuActivated( int ) ) );
+ connect( recentlyProjectsMenu, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( recentlyProjectsMenuActivated( int ) ) );
+
+ if ( !singleProject )
+ fileMenu->insertSeparator();
+
+ a = new TQAction( this, 0 );
+ actionFileExit = a;
+ a->setAccel(Qt::CTRL + Qt::Key_Q);
+ if ( !singleProjectMode() ) {
+ a->setText( tr( "Exit" ) );
+ a->setMenuText( tr( "E&xit" ) );
+ a->setStatusTip( tr( "Quits the application and prompts to save any changed forms, source files or project settings" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Exit" ) );
+ } else {
+ a->setText( tr( "Close" ) );
+ a->setMenuText( tr( "&Close" ) );
+ }
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( fileQuit() ) );
+ a->addTo( fileMenu );
+}
+
+void MainWindow::setupProjectActions()
+{
+ projectMenu = new TQPopupMenu( this, "Project" );
+ menubar->insertItem( tr( "Pr&oject" ), projectMenu );
+
+ TQActionGroup *ag = new TQActionGroup( this, 0 );
+ ag->setText( tr( "Active Project" ) );
+ ag->setMenuText( tr( "Active Project" ) );
+ ag->setExclusive( TRUE );
+ ag->setUsesDropDown( TRUE );
+ connect( ag, TQT_SIGNAL( selected( TQAction * ) ), this, TQT_SLOT( projectSelected( TQAction * ) ) );
+ connect( ag, TQT_SIGNAL( selected( TQAction * ) ), this, TQT_SIGNAL( projectChanged() ) );
+ TQAction *a = new TQAction( tr( "<No Project>" ), tr( "<No Project>" ), 0, ag, 0, TRUE );
+ eProject = new Project( "", tr( "<No Project>" ), projectSettingsPluginManager, TRUE );
+ projects.insert( a, eProject );
+ a->setOn( TRUE );
+ ag->addTo( projectMenu );
+ ag->addTo( projectToolBar );
+ actionGroupProjects = ag;
+
+ if ( !singleProject )
+ projectMenu->insertSeparator();
+
+ a = new TQAction( tr( "Add File" ), TQPixmap(), tr( "&Add File..." ), 0, this, 0 );
+ a->setStatusTip( tr("Adds a file to the current project") );
+ a->setWhatsThis( whatsThisFrom( "Project|Add File" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( projectInsertFile() ) );
+ a->setEnabled( FALSE );
+ connect( this, TQT_SIGNAL( hasNonDummyProject(bool) ), a, TQT_SLOT( setEnabled(bool) ) );
+ if ( !singleProject )
+ a->addTo( projectMenu );
+
+ TQAction* actionEditPixmapCollection = new TQAction( tr( "Image Collection..." ), TQPixmap(),
+ tr( "&Image Collection..." ), 0, this, 0 );
+ actionEditPixmapCollection->setStatusTip( tr("Opens a dialog for editing the current project's image collection") );
+ actionEditPixmapCollection->setWhatsThis( whatsThisFrom( "Project|Image Collection" ) );
+ connect( actionEditPixmapCollection, TQT_SIGNAL( activated() ), this, TQT_SLOT( editPixmapCollection() ) );
+ actionEditPixmapCollection->setEnabled( FALSE );
+ connect( this, TQT_SIGNAL( hasNonDummyProject(bool) ), actionEditPixmapCollection, TQT_SLOT( setEnabled(bool) ) );
+ actionEditPixmapCollection->addTo( projectMenu );
+
+#ifndef TQT_NO_SQL
+ TQAction* actionEditDatabaseConnections = new TQAction( tr( "Database Connections..." ), TQPixmap(),
+ tr( "&Database Connections..." ), 0, this, 0 );
+ actionEditDatabaseConnections->setStatusTip( tr("Opens a dialog for editing the current project's database connections") );
+ actionEditDatabaseConnections->setWhatsThis( whatsThisFrom( "Project|Database Connections" ) );
+ connect( actionEditDatabaseConnections, TQT_SIGNAL( activated() ), this, TQT_SLOT( editDatabaseConnections() ) );
+ //actionEditDatabaseConnections->setEnabled( FALSE );
+ //connect( this, TQT_SIGNAL( hasNonDummyProject(bool) ), actionEditDatabaseConnections, TQT_SLOT( setEnabled(bool) ) );
+ if ( !singleProject )
+ actionEditDatabaseConnections->addTo( projectMenu );
+#endif
+
+ TQAction* actionEditProjectSettings = new TQAction( tr( "Project Settings..." ), TQPixmap(),
+ tr( "&Project Settings..." ), 0, this, 0 );
+ actionEditProjectSettings->setStatusTip( tr("Opens a dialog to change the project's settings") );
+ actionEditProjectSettings->setWhatsThis( whatsThisFrom( "Project|Project Settings" ) );
+ connect( actionEditProjectSettings, TQT_SIGNAL( activated() ), this, TQT_SLOT( editProjectSettings() ) );
+ actionEditProjectSettings->setEnabled( FALSE );
+ connect( this, TQT_SIGNAL( hasNonDummyProject(bool) ), actionEditProjectSettings, TQT_SLOT( setEnabled(bool) ) );
+ actionEditProjectSettings->addTo( projectMenu );
+
+}
+
+void MainWindow::setupPreviewActions()
+{
+ TQAction* a = 0;
+ TQPopupMenu *menu = new TQPopupMenu( this, "Preview" );
+ layoutMenu = menu;
+ menubar->insertItem( tr( "&Preview" ), menu, toolsMenuId + 2 );
+
+ a = new TQAction( tr( "Preview Form" ), TQPixmap(), tr( "Preview &Form" ), 0, this, 0 );
+ a->setAccel( Qt::CTRL + Qt::Key_T );
+ a->setStatusTip( tr("Opens a preview") );
+ a->setWhatsThis( whatsThisFrom( "Preview|Preview Form" ) );
+ connect( a, TQT_SIGNAL( activated() ), this, TQT_SLOT( previewForm() ) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), a, TQT_SLOT( setEnabled(bool) ) );
+ a->addTo( menu );
+
+ menu->insertSeparator();
+
+ TQSignalMapper *mapper = new TQSignalMapper( TQT_TQOBJECT(this) );
+ connect( mapper, TQT_SIGNAL(mapped(const TQString&)), this, TQT_SLOT(previewForm(const TQString&)) );
+ TQStringList styles = TQStyleFactory::keys();
+ for ( TQStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
+ TQString info;
+ if ( *it == "Motif" )
+ info = tr( "The preview will use the Motif look and feel which is used as the default style on most UNIX systems." );
+ else if ( *it == "Windows" )
+ info = tr( "The preview will use the Windows look and feel." );
+ else if ( *it == "Platinum" )
+ info = tr( "The preview will use the Platinum look and feel which is similar to the Macinosh GUI style." );
+ else if ( *it == "CDE" )
+ info = tr( "The preview will use the CDE look and feel which is similar to some versions of the Common Desktop Environment." );
+ else if ( *it == "SGI" )
+ info = tr( "The preview will use the Motif look and feel which is used as the default style on SGI systems." );
+ else if ( *it == "MotifPlus" )
+ info = tr( "The preview will use the advanced Motif look and feel used by the GIMP toolkit (GTK) on Linux." );
+
+ a = new TQAction( tr( "Preview Form in %1 Style" ).arg( *it ), TQPixmap(),
+ tr( "... in %1 Style" ).arg( *it ), 0, this, 0 );
+ a->setStatusTip( tr("Opens a preview in %1 style").arg( *it ) );
+ a->setWhatsThis( tr("<b>Open a preview in %1 style.</b>"
+ "<p>Use the preview to test the design and "
+ "signal-slot connections of the current form. %2</p>").arg( *it ).arg( info ) );
+ mapper->setMapping( a, *it );
+ connect( a, TQT_SIGNAL(activated()), mapper, TQT_SLOT(map()) );
+ connect( this, TQT_SIGNAL( hasActiveForm(bool) ), a, TQT_SLOT( setEnabled(bool) ) );
+ a->addTo( menu );
+ }
+}
+
+void MainWindow::setupWindowActions()
+{
+ static bool windowActionsSetup = FALSE;
+ if ( !windowActionsSetup ) {
+ windowActionsSetup = TRUE;
+
+ actionWindowTile = new TQAction( tr( "Tile" ), tr( "&Tile" ), 0, this );
+ actionWindowTile->setStatusTip( tr("Tiles the windows so that they are all visible") );
+ actionWindowTile->setWhatsThis( whatsThisFrom( "Window|Tile" ) );
+ connect( actionWindowTile, TQT_SIGNAL( activated() ), qworkspace, TQT_SLOT( tile() ) );
+ actionWindowCascade = new TQAction( tr( "Cascade" ), tr( "&Cascade" ), 0, this );
+ actionWindowCascade->setStatusTip( tr("Cascades the windows so that all their title bars are visible") );
+ actionWindowCascade->setWhatsThis( whatsThisFrom( "Window|Cascade" ) );
+ connect( actionWindowCascade, TQT_SIGNAL( activated() ), qworkspace, TQT_SLOT( cascade() ) );
+
+ actionWindowClose = new TQAction( tr( "Close" ), tr( "Cl&ose" ), Qt::CTRL + Qt::Key_F4, this );
+ actionWindowClose->setStatusTip( tr( "Closes the active window") );
+ actionWindowClose->setWhatsThis( whatsThisFrom( "Window|Close" ) );
+ connect( actionWindowClose, TQT_SIGNAL( activated() ), qworkspace, TQT_SLOT( closeActiveWindow() ) );
+
+ actionWindowCloseAll = new TQAction( tr( "Close All" ), tr( "Close Al&l" ), 0, this );
+ actionWindowCloseAll->setStatusTip( tr( "Closes all form windows") );
+ actionWindowCloseAll->setWhatsThis( whatsThisFrom( "Window|Close All" ) );
+ connect( actionWindowCloseAll, TQT_SIGNAL( activated() ), qworkspace, TQT_SLOT( closeAllWindows() ) );
+
+ actionWindowNext = new TQAction( tr( "Next" ), tr( "Ne&xt" ), Qt::CTRL + Qt::Key_F6, this );
+ actionWindowNext->setStatusTip( tr( "Activates the next window" ) );
+ actionWindowNext->setWhatsThis( whatsThisFrom( "Window|Next" ) );
+ connect( actionWindowNext, TQT_SIGNAL( activated() ), qworkspace, TQT_SLOT( activateNextWindow() ) );
+
+ actionWindowPrevious = new TQAction( tr( "Previous" ), tr( "Pre&vious" ), Qt::CTRL + Qt::SHIFT + Qt::Key_F6, this );
+ actionWindowPrevious->setStatusTip( tr( "Activates the previous window" ) );
+ actionWindowPrevious->setWhatsThis( whatsThisFrom( "Window|Previous" ) );
+ connect( actionWindowPrevious, TQT_SIGNAL( activated() ), qworkspace, TQT_SLOT( activatePreviousWindow() ) );
+ }
+
+ if ( !windowMenu ) {
+ windowMenu = new TQPopupMenu( this, "Window" );
+ menubar->insertItem( tr( "&Window" ), windowMenu );
+ connect( windowMenu, TQT_SIGNAL( aboutToShow() ),
+ this, TQT_SLOT( setupWindowActions() ) );
+ } else {
+ windowMenu->clear();
+ }
+
+ actionWindowClose->addTo( windowMenu );
+ actionWindowCloseAll->addTo( windowMenu );
+ windowMenu->insertSeparator();
+ actionWindowNext->addTo( windowMenu );
+ actionWindowPrevious->addTo( windowMenu );
+ windowMenu->insertSeparator();
+ actionWindowTile->addTo( windowMenu );
+ actionWindowCascade->addTo( windowMenu );
+ windowMenu->insertSeparator();
+ windowMenu->insertItem( tr( "Vie&ws" ), createDockWindowMenu( NoToolBars ) );
+ windowMenu->insertItem( tr( "Tool&bars" ), createDockWindowMenu( OnlyToolBars ) );
+ TQWidgetList windows = qworkspace->windowList();
+ if ( windows.count() && formWindow() )
+ windowMenu->insertSeparator();
+ int j = 0;
+ for ( int i = 0; i < int( windows.count() ); ++i ) {
+ TQWidget *w = windows.at( i );
+ if ( !::tqqt_cast<FormWindow*>(w) && !::tqqt_cast<SourceEditor*>(w) )
+ continue;
+ if ( ::tqqt_cast<FormWindow*>(w) && ( ( (FormWindow*)w )->isFake() ) )
+ continue;
+ j++;
+ TQString itemText;
+ if ( j < 10 )
+ itemText = TQString("&%1 ").arg( j );
+ if ( ::tqqt_cast<FormWindow*>(w) )
+ itemText += w->name();
+ else
+ itemText += w->caption();
+
+ int id = windowMenu->insertItem( itemText, this, TQT_SLOT( windowsMenuActivated( int ) ) );
+ windowMenu->setItemParameter( id, i );
+ windowMenu->setItemChecked( id, qworkspace->activeWindow() == windows.at( i ) );
+ }
+}
+
+void MainWindow::setupHelpActions()
+{
+ actionHelpContents = new TQAction( tr( "Contents" ), tr( "&Contents" ), Qt::Key_F1, this, 0 );
+ actionHelpContents->setStatusTip( tr("Opens the online help") );
+ actionHelpContents->setWhatsThis( whatsThisFrom( "Help|Contents" ) );
+ connect( actionHelpContents, TQT_SIGNAL( activated() ), this, TQT_SLOT( helpContents() ) );
+
+ actionHelpManual = new TQAction( tr( "Manual" ), tr( "&Manual" ), Qt::CTRL + Qt::Key_M, this, 0 );
+ actionHelpManual->setStatusTip( tr("Opens the TQt Designer manual") );
+ actionHelpManual->setWhatsThis( whatsThisFrom( "Help|Manual" ) );
+ connect( actionHelpManual, TQT_SIGNAL( activated() ), this, TQT_SLOT( helpManual() ) );
+
+ actionHelpAbout = new TQAction( tr("About"), TQPixmap(), tr("&About"), 0, this, 0 );
+ actionHelpAbout->setStatusTip( tr("Displays information about TQt Designer") );
+ actionHelpAbout->setWhatsThis( whatsThisFrom( "Help|About" ) );
+ connect( actionHelpAbout, TQT_SIGNAL( activated() ), this, TQT_SLOT( helpAbout() ) );
+
+ actionHelpAboutTQt = new TQAction( tr("About TQt"), TQPixmap(), tr("About &TQt"), 0, this, 0 );
+ actionHelpAboutTQt->setStatusTip( tr("Displays information about the TQt Toolkit") );
+ actionHelpAboutTQt->setWhatsThis( whatsThisFrom( "Help|About TQt" ) );
+ connect( actionHelpAboutTQt, TQT_SIGNAL( activated() ), this, TQT_SLOT( helpAboutTQt() ) );
+
+#if 0 //defined(TQT_NON_COMMERCIAL)
+ // ### not used anymore -- should be deleted?
+ actionHelpRegister = new TQAction( tr("Register TQt"), TQPixmap(), tr("&Register TQt..."), 0, this, 0 );
+ actionHelpRegister->setStatusTip( tr("Opens a web browser at the evaluation form on www.trolltech.com") );
+ actionHelpRegister->setWhatsThis( tr("Register with Trolltech") );
+ connect( actionHelpRegister, TQT_SIGNAL( activated() ), this, TQT_SLOT( helpRegister() ) );
+#endif
+
+ actionHelpWhatsThis = new TQAction( tr("What's This?"), TQIconSet( whatsthis_image, whatsthis_image ),
+ tr("What's This?"), Qt::SHIFT + Qt::Key_F1, this, 0 );
+ actionHelpWhatsThis->setStatusTip( tr("\"What's This?\" context sensitive help") );
+ actionHelpWhatsThis->setWhatsThis( whatsThisFrom( "Help|What's This?" ) );
+ connect( actionHelpWhatsThis, TQT_SIGNAL( activated() ), this, TQT_SLOT( whatsThis() ) );
+
+ TQToolBar *tb = new TQToolBar( this, "Help" );
+ tb->setCloseMode( TQDockWindow::Undocked );
+ TQWhatsThis::add( tb, tr( "<b>The Help toolbar</b>%1" ).arg(tr(toolbarHelp).arg("") ));
+ addToolBar( tb, tr( "Help" ) );
+ actionHelpWhatsThis->addTo( tb );
+
+ TQPopupMenu *menu = new TQPopupMenu( this, "Help" );
+ menubar->insertSeparator();
+ menubar->insertItem( tr( "&Help" ), menu );
+ actionHelpContents->addTo( menu );
+ actionHelpManual->addTo( menu );
+ menu->insertSeparator();
+ actionHelpAbout->addTo( menu );
+ actionHelpAboutTQt->addTo( menu );
+#if 0 //defined(TQT_NON_COMMERCIAL)
+ // ### not used anymore -- should be deleted?
+ actionHelpRegister->addTo( menu );
+#endif
+
+ menu->insertSeparator();
+ actionHelpWhatsThis->addTo( menu );
+}
+
+void MainWindow::fileNew()
+{
+ statusBar()->message( tr( "Create a new project, form or source file...") );
+ NewForm dlg( this, projectNames(), currentProject->projectName(), templatePath() );
+ dlg.exec();
+ statusBar()->clear();
+}
+
+void MainWindow::fileNewDialog()
+{
+ static int forms = 0;
+ TQString n = "Dialog" + TQString::number( ++forms );
+ while ( currentProject->tqfindFormFile( n + ".ui" ) )
+ n = "Dialog" + TQString::number( ++forms );
+ FormWindow *fw = 0;
+ FormFile *ff = new FormFile( n + ".ui", FALSE, currentProject );
+ fw = new FormWindow( ff, MainWindow::self, MainWindow::self->qWorkspace(), n );
+ ff->setModified( TRUE );
+ currentProject->setModified( TRUE );
+ workspace()->update();
+ fw->setProject( currentProject );
+ MetaDataBase::addEntry( fw );
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQDialog" ), fw, n.latin1() );
+ fw->setMainContainer( w );
+ fw->setCaption( n );
+ fw->resize( 600, 480 );
+ insertFormWindow( fw );
+ fw->killAccels( fw );
+ fw->project()->setModified( TRUE );
+ fw->setFocus();
+ fw->setSavePixmapInProject( TRUE );
+ fw->setSavePixmapInline( FALSE );
+}
+
+void MainWindow::fileNewFile()
+{
+ TQString name = TQInputDialog::getText( tr( "Name of File" ), tr( "Enter the name of the new source file:" ) );
+ if ( name.isEmpty() )
+ return;
+ if ( name.right( 3 ) != ".qs" )
+ name += ".qs";
+ SourceFile *f = new SourceFile( name, FALSE, currentProject );
+ MainWindow::self->editSource( f );
+ f->setModified( TRUE );
+ currentProject->setModified( TRUE );
+ workspace()->update();
+}
+
+void MainWindow::fileQuit()
+{
+ close();
+ if ( !singleProjectMode() )
+ tqApp->closeAllWindows();
+}
+
+void MainWindow::fileClose()
+{
+ if ( !currentProject->isDummy() ) {
+ fileCloseProject();
+ } else {
+ TQWidget *w = qworkspace->activeWindow();
+ if ( w ) {
+ if ( ::tqqt_cast<FormWindow*>(w) )
+ ( (FormWindow*)w )->formFile()->close();
+ else if ( ::tqqt_cast<SourceEditor*>(w) )
+ ( (SourceEditor*)w )->close();
+ }
+ }
+}
+
+
+void MainWindow::fileCloseProject()
+{
+ if ( currentProject->isDummy() )
+ return;
+ Project *pro = currentProject;
+ TQAction* a = 0;
+ TQAction* lastValid = 0;
+ for ( TQMap<TQAction*, Project* >::Iterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( it.data() == pro ) {
+ a = it.key();
+ if ( lastValid )
+ break;
+ }
+ lastValid = it.key();
+ }
+ if ( a ) {
+ if ( pro->isModified() ) {
+ switch ( TQMessageBox::warning( this, tr( "Save Project Settings" ),
+ tr( "Save changes to '%1'?" ).arg( pro->fileName() ),
+ tr( "&Yes" ), tr( "&No" ), tr( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ pro->save();
+ break;
+ case 1: // don't save
+ break;
+ case 2: // cancel
+ return;
+ default:
+ break;
+ }
+ }
+
+ TQWidgetList windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( TRUE );
+ TQWidgetListIt wit( windows );
+ while ( wit.current() ) {
+ TQWidget *w = wit.current();
+ ++wit;
+ if ( ::tqqt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->project() == pro ) {
+ if ( ( (FormWindow*)w )->formFile()->editor() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
+ if ( !( (FormWindow*)w )->formFile()->close() )
+ return;
+ }
+ } else if ( ::tqqt_cast<SourceEditor*>(w) ) {
+ if ( !( (SourceEditor*)w )->close() )
+ return;
+ }
+ }
+ hierarchyView->clear();
+ windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( FALSE );
+ actionGroupProjects->removeChild( a );
+ projects.remove( a );
+ delete a;
+ currentProject = 0;
+ if ( lastValid ) {
+ projectSelected( lastValid );
+ statusBar()->message( "Selected project '" + tr( currentProject->projectName() + "'") );
+ }
+ if ( !windows.isEmpty() ) {
+ for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
+ if (!::tqqt_cast<FormWindow*>(w) || w->isHidden())
+ continue;
+ w->setFocus();
+ activeWindowChanged( w );
+ break;
+ }
+ } else {
+ emit hasActiveWindow( FALSE );
+ emit hasActiveForm( FALSE );
+ updateUndoRedo( FALSE, FALSE, TQString(), TQString() );
+ }
+ }
+}
+
+void MainWindow::fileOpen() // as called by the menu
+{
+ fileOpen( "", "", "", FALSE );
+}
+
+void MainWindow::projectInsertFile()
+{
+ fileOpen( "", "" );
+}
+
+void MainWindow::fileOpen( const TQString &filter, const TQString &extension, const TQString &fn, bool inProject )
+{
+ statusBar()->message( tr( "Open a file...") );
+
+ TQPluginManager<ImportFilterInterface> manager( IID_ImportFilter, TQApplication::libraryPaths(), pluginDirectory() );
+
+ Project* project = inProject ? currentProject : eProject;
+
+ TQStringList additionalSources;
+
+ {
+ TQStringList filterlist;
+ if ( filter.isEmpty() ) {
+ if ( !inProject )
+ filterlist << tr( "Designer Files (*.ui *.pro)" );
+ filterlist << tr( "TQt User-Interface Files (*.ui)" );
+ if ( !inProject )
+ filterlist << tr( "TQMAKE Project Files (*.pro)" );
+ TQStringList list = manager.featureList();
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ filterlist << *it;
+ LanguageInterface *iface = MetaDataBase::languageInterface( project->language() );
+ if ( iface ) {
+ filterlist += iface->fileFilterList();
+ additionalSources += iface->fileExtensionList();
+ }
+ filterlist << tr( "All Files (*)" );
+ } else {
+ filterlist << filter;
+ }
+
+ TQString filters = filterlist.join( ";;" );
+
+ TQStringList filenames;
+ if ( fn.isEmpty() ) {
+ if ( !inProject ) {
+ TQString f = TQFileDialog::getOpenFileName( TQString(), filters, this, 0,
+ tr("Open" ), &lastOpenFilter );
+ filenames << f;
+ } else {
+ filenames = TQFileDialog::getOpenFileNames( filters, TQString(), this, 0,
+ tr("Add"), &lastOpenFilter );
+ }
+ } else {
+ filenames << fn;
+ }
+
+ for ( TQStringList::Iterator fit = filenames.begin(); fit != filenames.end(); ++fit ) {
+ TQString filename = *fit;
+ if ( !filename.isEmpty() ) {
+ TQFileInfo fi( filename );
+
+ if ( fi.extension( FALSE ) == "pro" && ( extension.isEmpty() || extension.tqfind( ";pro" ) != -1 ) ) {
+ addRecentlyOpened( filename, recentlyProjects );
+ openProject( filename );
+ } else if ( fi.extension( FALSE ) == "ui" && ( extension.isEmpty() || extension.tqfind( ";ui" ) != -1 ) ) {
+ if ( !inProject )
+ setCurrentProject( eProject );
+ openFormWindow( filename );
+ addRecentlyOpened( filename, recentlyFiles );
+ } else if ( !extension.isEmpty() && extension.tqfind( ";" + fi.extension( FALSE ) ) != -1 ||
+ additionalSources.tqfind( fi.extension( FALSE ) ) != additionalSources.end() ) {
+ SourceFile *sf = project->tqfindSourceFile( project->makeRelative( filename ) );
+ if ( !sf )
+ sf = new SourceFile( project->makeRelative( filename ), FALSE, project );
+ editSource( sf );
+ } else if ( extension.isEmpty() ) {
+ TQString filter;
+ for ( TQStringList::Iterator it2 = filterlist.begin(); it2 != filterlist.end(); ++it2 ) {
+ if ( (*it2).tqcontains( "." + fi.extension( FALSE ), FALSE ) ) {
+ filter = *it2;
+ break;
+ }
+ }
+
+ ImportFilterInterface* iface = 0;
+ manager.queryInterface( filter, &iface );
+ if ( !iface ) {
+ statusBar()->message( tr( "No import filter is available to import '%1'").
+ arg( filename ), 3000 );
+ return;
+ }
+ statusBar()->message( tr( "Importing '%1' using import filter ...").arg( filename ) );
+ TQStringList list = iface->import( filter, filename );
+ iface->release();
+ if ( list.isEmpty() ) {
+ statusBar()->message( tr( "Nothing to load in '%1'").arg( filename ), 3000 );
+ return;
+ }
+ if ( !inProject )
+ setCurrentProject( eProject );
+ addRecentlyOpened( filename, recentlyFiles );
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ openFormWindow( *it, FALSE );
+ TQFile::remove( *it );
+ }
+ statusBar()->clear();
+ }
+ }
+ }
+ }
+}
+
+FormWindow *MainWindow::openFormWindow( const TQString &filename, bool validFileName, FormFile *ff )
+{
+ if ( filename.isEmpty() )
+ return 0;
+
+ bool makeNew = FALSE;
+
+ if ( !TQFile::exists( filename ) ) {
+ makeNew = TRUE;
+ } else {
+ TQFile f( filename );
+ f.open( IO_ReadOnly );
+ TQTextStream ts( &f );
+ makeNew = ts.read().length() < 2;
+ }
+ if ( makeNew ) {
+ fileNew();
+ if ( formWindow() )
+ formWindow()->setFileName( filename );
+ return formWindow();
+ }
+
+ statusBar()->message( tr( "Reading file '%1'...").arg( filename ) );
+ FormFile *ff2 = currentProject->tqfindFormFile( currentProject->makeRelative(filename) );
+ if ( ff2 && ff2->formWindow() ) {
+ ff2->formWindow()->setFocus();
+ return ff2->formWindow();
+ }
+
+ if ( ff2 )
+ ff = ff2;
+ TQApplication::setOverrideCursor( WaitCursor );
+ Resource resource( this );
+ if ( !ff )
+ ff = new FormFile( currentProject->makeRelative( filename ), FALSE, currentProject );
+ bool b = resource.load( ff ) && (FormWindow*)resource.widget();
+ if ( !validFileName && resource.widget() )
+ ( (FormWindow*)resource.widget() )->setFileName( TQString() );
+ TQApplication::restoreOverrideCursor();
+ if ( b ) {
+ rebuildCustomWidgetGUI();
+ statusBar()->message( tr( "Loaded file '%1'").arg( filename ), 3000 );
+ } else {
+ statusBar()->message( tr( "Failed to load file '%1'").arg( filename ), 5000 );
+ TQMessageBox::information( this, tr("Load File"), tr("Couldn't load file '%1'").arg( filename ) );
+ delete ff;
+ }
+ return (FormWindow*)resource.widget();
+}
+
+bool MainWindow::fileSave()
+{
+
+ if ( !currentProject->isDummy() )
+ return fileSaveProject();
+ return fileSaveForm();
+}
+
+bool MainWindow::fileSaveForm()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( TQT_BASE_OBJECT(e->object()) == TQT_BASE_OBJECT(formWindow()) || e == qWorkspace()->activeWindow() ) {
+ e->save();
+ }
+ }
+
+ FormWindow *fw = 0;
+
+ TQWidget *w = qWorkspace()->activeWindow();
+ if ( w ) {
+ if ( ::tqqt_cast<SourceEditor*>(w) ) {
+ SourceEditor *se = (SourceEditor*)w;
+ if ( se->formWindow() )
+ fw = se->formWindow();
+ else if ( se->sourceFile() ) {
+ se->sourceFile()->save();
+ return TRUE;
+ }
+ }
+ }
+
+ if ( !fw )
+ fw = formWindow();
+ if ( !fw || !fw->formFile()->save() )
+ return FALSE;
+ TQApplication::restoreOverrideCursor();
+ return TRUE;
+}
+
+bool MainWindow::fileSaveProject()
+{
+ currentProject->save();
+ statusBar()->message( tr( "Project '%1' saved.").arg( currentProject->projectName() ), 3000 );
+ return TRUE;
+}
+
+bool MainWindow::fileSaveAs()
+{
+ statusBar()->message( tr( "Enter a filename..." ) );
+
+ TQWidget *w = qworkspace->activeWindow();
+ if ( !w )
+ return TRUE;
+ if ( ::tqqt_cast<FormWindow*>(w) )
+ return ( (FormWindow*)w )->formFile()->saveAs();
+ else if ( ::tqqt_cast<SourceEditor*>(w) )
+ return ( (SourceEditor*)w )->saveAs();
+ return FALSE;
+}
+
+void MainWindow::fileSaveAll()
+{
+ for ( TQMap<TQAction*, Project* >::Iterator it = projects.begin(); it != projects.end(); ++it )
+ (*it)->save();
+}
+
+void MainWindow::fileCreateTemplate()
+{
+ CreateTemplate dia( this, 0, TRUE );
+
+ int i = 0;
+ for ( i = 0; i < WidgetDatabase::count(); ++i ) {
+ if ( WidgetDatabase::isForm( i ) && WidgetDatabase::group( i ) != "Temp") {
+ dia.listClass->insertItem( WidgetDatabase::className( i ) );
+ }
+ }
+ for ( i = 0; i < WidgetDatabase::count(); ++i ) {
+ if ( WidgetDatabase::isContainer( i ) && !WidgetDatabase::isForm(i) &&
+ WidgetDatabase::className( i ) != "TQTabWidget" && WidgetDatabase::group( i ) != "Temp" ) {
+ dia.listClass->insertItem( WidgetDatabase::className( i ) );
+ }
+ }
+
+ TQPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ if ( w->isContainer )
+ dia.listClass->insertItem( w->className );
+ }
+
+ dia.editName->setText( tr( "NewTemplate" ) );
+ connect( dia.buttonCreate, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( createNewTemplate() ) );
+ dia.exec();
+}
+
+void MainWindow::createNewTemplate()
+{
+ CreateTemplate *dia = (CreateTemplate*)(TQT_TQOBJECT(sender())->tqparent());
+ TQString fn = dia->editName->text();
+ TQString cn = dia->listClass->currentText();
+ if ( fn.isEmpty() || cn.isEmpty() ) {
+ TQMessageBox::information( this, tr( "Create Template" ), tr( "Couldn't create the template" ) );
+ return;
+ }
+
+ TQStringList templRoots;
+ const char *qtdir = getenv( "TQTDIR" );
+ if(qtdir)
+ templRoots << qtdir;
+ templRoots << qInstallPathData();
+ if(qtdir) //try the tools/designer directory last!
+ templRoots << (TQString(qtdir) + "/tools/designer");
+ TQFile f;
+ for ( TQStringList::Iterator it = templRoots.begin(); it != templRoots.end(); ++it ) {
+ if ( TQFile::exists( (*it) + "/templates/" )) {
+ TQString tmpfn = (*it) + "/templates/" + fn + ".ui";
+ f.setName(tmpfn);
+ if(f.open(IO_WriteOnly))
+ break;
+ }
+ }
+ if ( !f.isOpen() ) {
+ TQMessageBox::information( this, tr( "Create Template" ), tr( "Couldn't create the template" ) );
+ return;
+ }
+ TQTextStream ts( &f );
+
+ ts << "<!DOCTYPE UI><UI>" << endl;
+ ts << "<widget>" << endl;
+ ts << "<class>" << cn << "</class>" << endl;
+ ts << "<property stdset=\"1\">" << endl;
+ ts << " <name>name</name>" << endl;
+ ts << " <cstring>" << cn << "Form</cstring>" << endl;
+ ts << "</property>" << endl;
+ ts << "<property stdset=\"1\">" << endl;
+ ts << " <name>tqgeometry</name>" << endl;
+ ts << " <rect>" << endl;
+ ts << " <width>300</width>" << endl;
+ ts << " <height>400</height>" << endl;
+ ts << " </rect>" << endl;
+ ts << "</property>" << endl;
+ ts << "</widget>" << endl;
+ ts << "</UI>" << endl;
+
+ dia->editName->setText( tr( "NewTemplate" ) );
+
+ f.close();
+}
+
+void MainWindow::editUndo()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editUndo();
+ return;
+ }
+ if ( formWindow() )
+ formWindow()->undo();
+}
+
+void MainWindow::editRedo()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editRedo();
+ return;
+ }
+ if ( formWindow() )
+ formWindow()->redo();
+}
+
+void MainWindow::editCut()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editCut();
+ return;
+ }
+ editCopy();
+ editDelete();
+}
+
+void MainWindow::editCopy()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editCopy();
+ return;
+ }
+ if ( formWindow() )
+ tqApp->clipboard()->setText( formWindow()->copy() );
+}
+
+void MainWindow::editPaste()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editPaste();
+ return;
+ }
+ if ( !formWindow() )
+ return;
+
+ TQWidget *w = formWindow()->mainContainer();
+ TQWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 ) {
+ w = l.first();
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) &&
+ w != formWindow()->mainContainer() ) )
+ w = formWindow()->mainContainer();
+ }
+
+ if ( w && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) {
+ formWindow()->paste( tqApp->clipboard()->text(), WidgetFactory::containerOfWidget( w ) );
+ hierarchyView->widgetInserted( 0 );
+ formWindow()->commandHistory()->setModified( TRUE );
+ } else {
+ TQMessageBox::information( this, tr( "Paste error" ),
+ tr( "Can't paste widgets. Designer couldn't tqfind a container\n"
+ "to paste into which does not contain a layout. Break the tqlayout\n"
+ "of the container you want to paste into and select this container\n"
+ "and then paste again." ) );
+ }
+}
+
+void MainWindow::editDelete()
+{
+ if ( formWindow() )
+ formWindow()->deleteWidgets();
+}
+
+void MainWindow::editSelectAll()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editSelectAll();
+ return;
+ }
+ if ( formWindow() )
+ formWindow()->selectAll();
+}
+
+
+void MainWindow::editLower()
+{
+ if ( formWindow() )
+ formWindow()->lowerWidgets();
+}
+
+void MainWindow::editRaise()
+{
+ if ( formWindow() )
+ formWindow()->raiseWidgets();
+}
+
+void MainWindow::editAdjustSize()
+{
+ if ( formWindow() )
+ formWindow()->editAdjustSize();
+}
+
+void MainWindow::editLayoutHorizontal()
+{
+ if ( layoutChilds )
+ editLayoutContainerHorizontal();
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutHorizontal();
+}
+
+void MainWindow::editLayoutVertical()
+{
+ if ( layoutChilds )
+ editLayoutContainerVertical();
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutVertical();
+}
+
+void MainWindow::editLayoutHorizontalSplit()
+{
+ if ( layoutChilds )
+ ; // no way to do that
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutHorizontalSplit();
+}
+
+void MainWindow::editLayoutVerticalSplit()
+{
+ if ( layoutChilds )
+ ; // no way to do that
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutVerticalSplit();
+}
+
+void MainWindow::editLayoutGrid()
+{
+ if ( layoutChilds )
+ editLayoutContainerGrid();
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutGrid();
+}
+
+void MainWindow::editLayoutContainerVertical()
+{
+ if ( !formWindow() )
+ return;
+ TQWidget *w = formWindow()->mainContainer();
+ TQWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 )
+ w = l.first();
+ if ( w )
+ formWindow()->layoutVerticalContainer( w );
+}
+
+void MainWindow::editLayoutContainerHorizontal()
+{
+ if ( !formWindow() )
+ return;
+ TQWidget *w = formWindow()->mainContainer();
+ TQWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 )
+ w = l.first();
+ if ( w )
+ formWindow()->layoutHorizontalContainer( w );
+}
+
+void MainWindow::editLayoutContainerGrid()
+{
+ if ( !formWindow() )
+ return;
+ TQWidget *w = formWindow()->mainContainer();
+ TQWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 )
+ w = l.first();
+ if ( w )
+ formWindow()->layoutGridContainer( w );
+}
+
+void MainWindow::editBreakLayout()
+{
+ if ( !formWindow() || !breakLayout )
+ return;
+ TQWidget *w = formWindow()->mainContainer();
+ if ( formWindow()->currentWidget() )
+ w = formWindow()->currentWidget();
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) {
+ formWindow()->breakLayout( w );
+ return;
+ } else {
+ TQWidgetList widgets = formWindow()->selectedWidgets();
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ break;
+ }
+ if ( w ) {
+ formWindow()->breakLayout( w );
+ return;
+ }
+ }
+
+ w = formWindow()->mainContainer();
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ formWindow()->breakLayout( w );
+}
+
+void MainWindow::editAccels()
+{
+ if ( !formWindow() )
+ return;
+ formWindow()->checkAccels();
+}
+
+void MainWindow::editFunctions()
+{
+ if ( !formWindow() )
+ return;
+
+ statusBar()->message( tr( "Edit the current form's Tslots..." ) );
+ EditFunctions dlg( this, formWindow(), TRUE );
+ dlg.exec();
+ statusBar()->clear();
+}
+
+void MainWindow::editConnections()
+{
+ if ( !formWindow() )
+ return;
+
+ statusBar()->message( tr( "Edit the current form's connections..." ) );
+ ConnectionDialog dlg( this );
+ dlg.exec();
+
+ statusBar()->clear();
+}
+
+SourceEditor *MainWindow::editSource()
+{
+ if ( !formWindow() )
+ return 0;
+ return formWindow()->formFile()->showEditor();
+}
+
+SourceEditor *MainWindow::openSourceEditor()
+{
+ if ( !formWindow() )
+ return 0;
+
+ TQString lang = currentProject->language();
+ if ( !MetaDataBase::hasEditor( lang ) ) {
+ TQMessageBox::information( this, tr( "Edit Source" ),
+ tr( "There is no plugin for editing " + lang + " code installed!\n"
+ "Note: Plugins are not available in static TQt configurations." ) );
+ return 0;
+ }
+
+ SourceEditor *editor = 0;
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->language() == lang && e->formWindow() == formWindow() ) {
+ editor = e;
+ break;
+ }
+ }
+
+ if ( !editor )
+ editor = createSourceEditor( TQT_TQOBJECT(formWindow()), formWindow()->project(), lang );
+ return editor;
+}
+
+SourceEditor *MainWindow::editSource( SourceFile *f )
+{
+ TQString lang = currentProject->language();
+ if ( !MetaDataBase::hasEditor( lang ) ) {
+ TQMessageBox::information( this, tr( "Edit Source" ),
+ tr( "There is no plugin for editing " + lang + " code installed!\n"
+ "Note: Plugins are not available in static TQt configurations." ) );
+ return 0;
+ }
+
+ SourceEditor *editor = 0;
+ if ( f )
+ editor = f->editor();
+ if ( !editor )
+ editor = createSourceEditor( f, currentProject, lang );
+ editor->setActiveWindow();
+ editor->setFocus();
+ return editor;
+}
+
+SourceEditor *MainWindow::createSourceEditor( TQObject *object, Project *project,
+ const TQString &lang, const TQString &func,
+ bool rereadSource )
+{
+ SourceEditor *editor = 0;
+ EditorInterface *eIface = 0;
+ editorPluginManager->queryInterface( lang, &eIface );
+ if ( !eIface )
+ return 0;
+ LanguageInterface *lIface = MetaDataBase::languageInterface( lang );
+ if ( !lIface )
+ return 0;
+ TQApplication::setOverrideCursor( WaitCursor );
+ editor = new SourceEditor( qWorkspace(), eIface, lIface );
+ eIface->release();
+ lIface->release();
+
+ editor->setLanguage( lang );
+ sourceEditors.append( editor );
+ TQApplication::restoreOverrideCursor();
+
+ if ( editor->object() != object )
+ editor->setObject( object, project );
+ else if ( rereadSource )
+ editor->refresh( FALSE );
+
+ editor->show();
+ editor->setFocus();
+ if ( !func.isEmpty() )
+ editor->setFunction( func );
+ emit editorChanged();
+
+ return editor;
+}
+
+void MainWindow::editFormSettings()
+{
+ if ( !formWindow() )
+ return;
+
+ statusBar()->message( tr( "Edit the current form's settings..." ) );
+ FormSettings dlg( this, formWindow() );
+ dlg.exec();
+ statusBar()->clear();
+}
+
+void MainWindow::editProjectSettings()
+{
+ openProjectSettings( currentProject );
+ wspace->setCurrentProject( currentProject );
+}
+
+void MainWindow::editPixmapCollection()
+{
+ PixmapCollectionEditor dia( this, 0, TRUE );
+ dia.setProject( currentProject );
+ dia.exec();
+}
+
+void MainWindow::editDatabaseConnections()
+{
+#ifndef TQT_NO_SQL
+ DatabaseConnectionsEditor dia( currentProject, this, 0, TRUE );
+ dia.exec();
+#endif
+}
+
+void MainWindow::editPreferences()
+{
+ statusBar()->message( tr( "Edit preferences..." ) );
+ Preferences *dia = new Preferences( this, 0, TRUE );
+ prefDia = dia;
+ connect( dia->helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ dia->buttonColor->setEditor( StyledButton::ColorEditor );
+ dia->buttonPixmap->setEditor( StyledButton::PixmapEditor );
+ dia->groupBoxGrid->setChecked( sGrid );
+ dia->checkBoxSnapGrid->setChecked( snGrid );
+ dia->spinGridX->setValue( grid().x() );
+ dia->spinGridY->setValue( grid().y() );
+ dia->checkBoxWorkspace->setChecked( restoreConfig );
+ dia->checkBoxTextLabels->setChecked( usesTextLabel() );
+ dia->buttonColor->setColor( qworkspace->backgroundColor() );
+ TQString pluginPaths = TQApplication::libraryPaths().join("\n");
+ dia->textEditPluginPaths->setText(pluginPaths);
+ if ( qworkspace->backgroundPixmap() )
+ dia->buttonPixmap->setPixmap( *qworkspace->backgroundPixmap() );
+ if ( backPix )
+ dia->radioPixmap->setChecked( TRUE );
+ else
+ dia->radioColor->setChecked( TRUE );
+ dia->checkBoxSplash->setChecked( splashScreen );
+ dia->checkAutoEdit->setChecked( !databaseAutoEdit );
+ dia->checkBoxStartDialog->setChecked( shStartDialog );
+ dia->checkBoxAutoSave->setChecked( autoSaveEnabled );
+ int h = autoSaveInterval / 3600;
+ int m = ( autoSaveInterval - h * 3600 ) / 60;
+ int s = autoSaveInterval - ( h * 3600 + m * 60 );
+ TQTime t( h, m, s );
+ dia->timeEditAutoSave->setTime( t );
+
+ SenderObject *senderObject = new SenderObject( designerInterface() );
+ TQValueList<Tab>::Iterator it;
+ for ( it = preferenceTabs.begin(); it != preferenceTabs.end(); ++it ) {
+ Tab t = *it;
+ dia->tabWidget->addTab( t.w, t.title );
+ if ( t.receiver ) {
+ connect( dia->buttonOk, TQT_SIGNAL( clicked() ), senderObject, TQT_SLOT( emitAcceptSignal() ) );
+ connect( senderObject, TQT_SIGNAL( acceptSignal( TQUnknownInterface * ) ), t.receiver, t.accept_slot );
+ connect( senderObject, TQT_SIGNAL( initSignal( TQUnknownInterface * ) ), t.receiver, t.init_slot );
+ senderObject->emitInitSignal();
+ disconnect( senderObject, TQT_SIGNAL( initSignal( TQUnknownInterface * ) ), t.receiver, t.init_slot );
+ }
+ }
+
+ if ( dia->exec() == TQDialog::Accepted ) {
+ setSnapGrid( dia->checkBoxSnapGrid->isChecked() );
+ setShowGrid( dia->groupBoxGrid->isChecked() );
+ setGrid( TQPoint( dia->spinGridX->value(),
+ dia->spinGridY->value() ) );
+ restoreConfig = dia->checkBoxWorkspace->isChecked();
+ setUsesTextLabel( dia->checkBoxTextLabels->isChecked() );
+ if (dia->textEditPluginPaths->isModified()) {
+ pluginPaths = dia->textEditPluginPaths->text();
+ TQApplication::tqsetLibraryPaths(TQStringList::split("\n", pluginPaths));
+ savePluginPaths = TRUE;
+ }
+
+ if ( dia->radioPixmap->isChecked() && dia->buttonPixmap->pixmap() ) {
+ qworkspace->setBackgroundPixmap( *dia->buttonPixmap->pixmap() );
+ backPix = TRUE;
+ } else {
+ qworkspace->setBackgroundColor( dia->buttonColor->color() );
+ backPix = FALSE;
+ }
+ splashScreen = dia->checkBoxSplash->isChecked();
+ databaseAutoEdit = !dia->checkAutoEdit->isChecked();
+ shStartDialog = dia->checkBoxStartDialog->isChecked();
+ autoSaveEnabled = dia->checkBoxAutoSave->isChecked();
+ TQTime time = dia->timeEditAutoSave->time();
+ autoSaveInterval = time.hour() * 3600 + time.minute() * 60 + time.second();
+ if ( autoSaveEnabled )
+ autoSaveTimer->start( autoSaveInterval * 1000 );
+ else
+ autoSaveTimer->stop();
+ }
+ delete senderObject;
+ for ( it = preferenceTabs.begin(); it != preferenceTabs.end(); ++it ) {
+ Tab t = *it;
+ dia->tabWidget->removePage( t.w );
+ t.w->reparent( 0, TQPoint(0,0), FALSE );
+ }
+
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->configChanged();
+
+ delete dia;
+ prefDia = 0;
+ statusBar()->clear();
+}
+
+void MainWindow::searchFind()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ if ( !tqfindDialog )
+ tqfindDialog = new FindDialog( this, 0, FALSE );
+ tqfindDialog->show();
+ tqfindDialog->raise();
+ tqfindDialog->setEditor( ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface(),
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->object() );
+ tqfindDialog->comboFind->setFocus();
+ tqfindDialog->comboFind->lineEdit()->selectAll();
+}
+
+void MainWindow::searchIncremetalFindMenu()
+{
+ incrementalSearch->selectAll();
+ incrementalSearch->setFocus();
+}
+
+void MainWindow::searchIncremetalFind()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->tqfind( incrementalSearch->text(),
+ FALSE, FALSE, TRUE, FALSE );
+}
+
+void MainWindow::searchIncremetalFindNext()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->tqfind( incrementalSearch->text(),
+ FALSE, FALSE, TRUE, TRUE );
+}
+
+void MainWindow::searchReplace()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ if ( !tqreplaceDialog )
+ tqreplaceDialog = new ReplaceDialog( this, 0, FALSE );
+ tqreplaceDialog->show();
+ tqreplaceDialog->raise();
+ tqreplaceDialog->setEditor( ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface(),
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->object() );
+ tqreplaceDialog->comboFind->setFocus();
+ tqreplaceDialog->comboFind->lineEdit()->selectAll();
+}
+
+void MainWindow::searchGotoLine()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::tqqt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ if ( !gotoLineDialog )
+ gotoLineDialog = new GotoLineDialog( this, 0, FALSE );
+ gotoLineDialog->show();
+ gotoLineDialog->raise();
+ gotoLineDialog->setEditor( ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface() );
+ gotoLineDialog->spinLine->setFocus();
+ gotoLineDialog->spinLine->setMinValue( 1 );
+ gotoLineDialog->spinLine->setMaxValue( ( (SourceEditor*)qWorkspace()->activeWindow() )->numLines() );
+ gotoLineDialog->spinLine->selectAll();
+}
+
+void MainWindow::toolsCustomWidget()
+{
+ statusBar()->message( tr( "Edit custom widgets..." ) );
+ CustomWidgetEditor edit( this, this );
+ edit.exec();
+ rebuildCustomWidgetGUI();
+ statusBar()->clear();
+}
+
+void MainWindow::toolsConfigure()
+{
+ ConfigToolboxDialog dlg( this );
+ if ( dlg.exec() != TQDialog::Accepted )
+ return;
+ rebuildCommonWidgetsToolBoxPage();
+}
+
+void MainWindow::showStartDialog()
+{
+ if ( singleProjectMode() )
+ return;
+ for ( int i = 1; i < tqApp->argc(); ++i ) {
+ TQString arg = tqApp->argv()[i];
+ if ( arg[0] != '-' )
+ return;
+ }
+ StartDialog *sd = new StartDialog( this, templatePath() );
+ sd->setRecentlyFiles( recentlyFiles );
+ sd->setRecentlyProjects( recentlyProjects );
+ sd->exec();
+ shStartDialog = sd->showDialogInFuture();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/menubareditor.cpp b/tqtinterface/qt4/tools/designer/designer/menubareditor.cpp
new file mode 100644
index 0000000..1bfc825
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/menubareditor.cpp
@@ -0,0 +1,1134 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqaction.h>
+#include <tqapplication.h>
+#include <tqbitmap.h>
+#include <tqdragobject.h>
+#include <tqlineedit.h>
+#include <tqmainwindow.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include "command.h"
+#include "formwindow.h"
+#include "menubareditor.h"
+#include "popupmenueditor.h"
+
+extern void tqfind_accel( const TQString &txt, TQMap<TQChar, TQWidgetList > &accels, TQWidget *w );
+
+// Drag Object Declaration -------------------------------------------
+
+class MenuBarEditorItemPtrDrag : public TQStoredDrag
+{
+public:
+ MenuBarEditorItemPtrDrag( MenuBarEditorItem * item,
+ TQWidget * tqparent = 0,
+ const char * name = 0 );
+ ~MenuBarEditorItemPtrDrag() {};
+ static bool canDecode( TQDragMoveEvent * e );
+ static bool decode( TQDropEvent * e, MenuBarEditorItem ** i );
+};
+
+// Drag Object Implementation ---------------------------------------
+
+MenuBarEditorItemPtrDrag::MenuBarEditorItemPtrDrag( MenuBarEditorItem * item,
+ TQWidget * tqparent,
+ const char * name )
+ : TQStoredDrag( "qt/menubareditoritemptr", tqparent, name )
+{
+ TQByteArray data( sizeof( TQ_LONG ) );
+ TQDataStream stream( data, IO_WriteOnly );
+ stream << ( TQ_LONG ) item;
+ setEncodedData( data );
+}
+
+bool MenuBarEditorItemPtrDrag::canDecode( TQDragMoveEvent * e )
+{
+ return e->provides( "qt/menubareditoritemptr" );
+}
+
+bool MenuBarEditorItemPtrDrag::decode( TQDropEvent * e, MenuBarEditorItem ** i )
+{
+ TQByteArray data = e->tqencodedData( "qt/menubareditoritemptr" );
+ TQDataStream stream( data, IO_ReadOnly );
+
+ if ( !data.size() )
+ return FALSE;
+
+ TQ_LONG p = 0;
+ stream >> p;
+ *i = ( MenuBarEditorItem *) p;
+
+ return TRUE;
+}
+
+// MenuBarEditorItem ---------------------------------------------------
+
+MenuBarEditorItem::MenuBarEditorItem( MenuBarEditor * bar, TQObject * tqparent, const char * name )
+ : TQObject( tqparent, name ),
+ menuBar( bar ),
+ popupMenu( 0 ),
+ visible( TRUE ),
+ separator( FALSE ),
+ removable( FALSE )
+{ }
+
+MenuBarEditorItem::MenuBarEditorItem( PopupMenuEditor * menu, MenuBarEditor * bar,
+ TQObject * tqparent, const char * name )
+ : TQObject( tqparent, name ),
+ menuBar( bar ),
+ popupMenu( menu ),
+ visible( TRUE ),
+ separator( FALSE ),
+ removable( TRUE )
+{
+ text = menu->name();
+}
+
+MenuBarEditorItem::MenuBarEditorItem( TQActionGroup * actionGroup, MenuBarEditor * bar,
+ TQObject * tqparent, const char * name )
+ : TQObject( tqparent, name ),
+ menuBar( bar ),
+ popupMenu( 0 ),
+ visible( TRUE ),
+ separator( FALSE ),
+ removable( TRUE )
+{
+ text = actionGroup->menuText();
+ popupMenu = new PopupMenuEditor( menuBar->formWindow(), menuBar );
+ popupMenu->insert( actionGroup );
+}
+
+MenuBarEditorItem::MenuBarEditorItem( MenuBarEditorItem * item, TQObject * tqparent, const char * name )
+ : TQObject( tqparent, name ),
+ menuBar( item->menuBar ),
+ popupMenu( 0 ),
+ text( item->text ),
+ visible( item->visible ),
+ separator( item->separator ),
+ removable( item->removable )
+{
+ popupMenu = new PopupMenuEditor( menuBar->formWindow(), item->popupMenu, menuBar );
+}
+
+// MenuBarEditor --------------------------------------------------------
+
+int MenuBarEditor::clipboardOperation = 0;
+MenuBarEditorItem * MenuBarEditor::clipboardItem = 0;
+
+MenuBarEditor::MenuBarEditor( FormWindow * fw, TQWidget * tqparent, const char * name )
+ : TQMenuBar( tqparent, name ),
+ formWnd( fw ),
+ draggedItem( 0 ),
+ currentIndex( 0 ),
+ itemHeight( 0 ),
+ separatorWidth( 32 ),
+ hideWhenEmpty( TRUE ),
+ hasSeparator( FALSE )
+{
+ setAcceptDrops( TRUE );
+ setFocusPolicy( Qt::StrongFocus );
+
+ addItem.setMenuText( tr("new menu") );
+ addSeparator.setMenuText( tr("new separator") );
+
+ lineEdit = new TQLineEdit( this, "menubar lineedit" );
+ lineEdit->hide();
+ lineEdit->setFrameStyle(TQFrame::Plain | TQFrame::NoFrame);
+ lineEdit->polish();
+ lineEdit->setBackgroundMode(TQt::PaletteButton);
+ lineEdit->setBackgroundOrigin(TQWidget::ParentOrigin);
+ lineEdit->installEventFilter( this );
+
+ dropLine = new TQWidget( this, "menubar dropline", (WFlags)(TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop) );
+ dropLine->setBackgroundColor( TQt::red );
+ dropLine->hide();
+
+ setMinimumHeight( fontMetrics().height() + 2 * borderSize() );
+}
+
+MenuBarEditor::~MenuBarEditor()
+{
+ itemList.setAutoDelete( TRUE );
+}
+
+FormWindow * MenuBarEditor::formWindow()
+{
+ return formWnd;
+}
+
+MenuBarEditorItem * MenuBarEditor::createItem( int index, bool addToCmdStack )
+{
+ MenuBarEditorItem * i =
+ new MenuBarEditorItem( new PopupMenuEditor( formWnd, ( TQWidget * ) tqparent() ), this );
+ if ( addToCmdStack ) {
+ AddMenuCommand * cmd = new AddMenuCommand( "Add Menu", formWnd, this, i, index );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else {
+ AddMenuCommand cmd( "Add Menu", formWnd, this, i, index );
+ cmd.execute();
+ }
+ return i;
+}
+
+void MenuBarEditor::insertItem( MenuBarEditorItem * item, int index )
+{
+ item->menu()->parentMenu = this;
+
+ if ( index != -1 )
+ itemList.insert( index, item );
+ else
+ itemList.append( item );
+
+ if ( hideWhenEmpty && itemList.count() == 1 )
+ show(); // calls resizeInternals();
+ else
+ resizeInternals();
+
+ if ( isVisible() )
+ update();
+}
+
+void MenuBarEditor::insertItem( TQString text, PopupMenuEditor * menu, int index )
+{
+ MenuBarEditorItem * item = new MenuBarEditorItem( menu, this );
+ if ( !text.isNull() )
+ item->setMenuText( text );
+ insertItem( item, index );
+}
+
+void MenuBarEditor::insertItem( TQString text, TQActionGroup * group, int index )
+{
+ MenuBarEditorItem * item = new MenuBarEditorItem( group, this );
+ if ( !text.isNull() )
+ item->setMenuText( text );
+ insertItem( item, index );
+}
+
+
+void MenuBarEditor::insertSeparator( int index )
+{
+ if ( hasSeparator )
+ return;
+
+ MenuBarEditorItem * i = createItem( index );
+ i->setSeparator( TRUE );
+ i->setMenuText( "separator" );
+ hasSeparator = TRUE;
+}
+
+void MenuBarEditor::removeItemAt( int index )
+{
+ removeItem( item( index ) );
+}
+
+void MenuBarEditor::removeItem( MenuBarEditorItem * item )
+{
+ if ( item &&
+ item->isRemovable() &&
+ itemList.removeRef( item ) ) {
+
+ if ( item->isSeparator() )
+ hasSeparator = FALSE;
+
+ if ( hideWhenEmpty && itemList.count() == 0 )
+ hide();
+ else
+ resizeInternals();
+
+ int n = count() + 1;
+ if ( currentIndex >= n )
+ currentIndex = n;
+
+ if ( isVisible() )
+ update();
+ }
+}
+
+int MenuBarEditor::tqfindItem( MenuBarEditorItem * item )
+{
+ return itemList.tqfindRef( item );
+}
+
+int MenuBarEditor::tqfindItem( PopupMenuEditor * menu )
+{
+ MenuBarEditorItem * i = itemList.first();
+
+ while ( i ) {
+ if ( i->menu() == menu )
+ return itemList.at();
+ i = itemList.next();
+ }
+
+ return -1;
+}
+
+int MenuBarEditor::tqfindItem( TQPoint & pos )
+{
+ int x = borderSize();
+ int dx = 0;
+ int y = 0;
+ int w = width();
+ TQSize s;
+ TQRect r;
+
+ MenuBarEditorItem * i = itemList.first();
+
+ while ( i ) {
+
+ if ( i->isVisible() ) {
+
+ s = itemSize( i );
+ dx = s.width();
+
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+
+ r = TQRect( x, y, s.width(), s.height() );
+
+ if ( r.tqcontains( pos ) )
+ return itemList.at();
+
+ addItemSizeToCoords( i, x, y, w );
+ }
+
+ i = itemList.next();
+ }
+
+ // check add item
+ s = itemSize( &addItem );
+ dx = s.width();
+
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+
+ r = TQRect( x, y, s.width(), s.height() );
+
+ if ( r.tqcontains( pos ) )
+ return itemList.count();
+
+ return itemList.count() + 1;
+}
+
+MenuBarEditorItem * MenuBarEditor::item( int index )
+{
+ if ( index == -1 )
+ return itemList.at( currentIndex );
+
+ int c = itemList.count();
+ if ( index == c )
+ return &addItem;
+ else if ( index > c )
+ return &addSeparator;
+
+ return itemList.at( index );
+}
+
+int MenuBarEditor::count()
+{
+ return itemList.count();
+}
+
+int MenuBarEditor::current()
+{
+ return currentIndex;
+}
+
+void MenuBarEditor::cut( int index )
+{
+ if ( clipboardItem && clipboardOperation == Cut )
+ delete clipboardItem;
+
+ clipboardOperation = Cut;
+ clipboardItem = itemList.at( index );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ return; // do nothing
+ }
+
+ RemoveMenuCommand * cmd = new RemoveMenuCommand( "Cut Menu", formWnd, this, index );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void MenuBarEditor::copy( int index )
+{
+ if ( clipboardItem && clipboardOperation == Cut )
+ delete clipboardItem;
+
+ clipboardOperation = Copy;
+ clipboardItem = itemList.at( index );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ }
+}
+
+void MenuBarEditor::paste( int index )
+{
+ if ( clipboardItem && clipboardOperation ) {
+ MenuBarEditorItem * i = new MenuBarEditorItem( clipboardItem );
+ AddMenuCommand * cmd = new AddMenuCommand( "Paste Menu", formWnd, this, i, index );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void MenuBarEditor::exchange( int a, int b )
+{
+ MenuBarEditorItem * ia = itemList.at( a );
+ MenuBarEditorItem * ib = itemList.at( b );
+ if ( !ia || !ib ||
+ ia == &addItem || ia == &addSeparator ||
+ ib == &addItem || ib == &addSeparator )
+ return; // do nothing
+ itemList.tqreplace( b, ia );
+ itemList.tqreplace( a, ib );
+}
+
+void MenuBarEditor::showLineEdit( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ MenuBarEditorItem * i = 0;
+
+ if ( (uint) index >= itemList.count() )
+ i = &addItem;
+ else
+ i = itemList.at( index );
+
+ if ( i && i->isSeparator() )
+ return;
+
+ // open edit field for item name
+ lineEdit->setText( i->menuText() );
+ lineEdit->selectAll();
+ TQPoint pos = itemPos( index );
+ lineEdit->move( pos.x() + borderSize(), pos.y() - ( borderSize() / 2 ) );
+ lineEdit->resize( itemSize( i ) );
+ lineEdit->show();
+ lineEdit->setFocus();
+}
+
+void MenuBarEditor::showItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ MenuBarEditorItem * i = itemList.at( index );
+ if ( i->isSeparator() || draggedItem )
+ return;
+ PopupMenuEditor * m = i->menu();
+ TQPoint pos = itemPos( index );
+ m->move( pos.x(), pos.y() + itemHeight - 1 );
+ m->raise();
+ m->show();
+ setFocus();
+ }
+}
+
+void MenuBarEditor::hideItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ PopupMenuEditor * m = itemList.at( index )->menu();
+ m->hideSubMenu();
+ m->hide();
+ }
+}
+
+void MenuBarEditor::focusItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ PopupMenuEditor * m = itemList.at( index )->menu();
+ m->setFocus();
+ m->update();
+ update();
+ }
+}
+
+void MenuBarEditor::deleteItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ RemoveMenuCommand * cmd = new RemoveMenuCommand( "Delete Menu",
+ formWnd,
+ this,
+ currentIndex );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+TQSize MenuBarEditor::tqsizeHint() const
+{
+ return TQSize( parentWidget()->width(), heightForWidth( parentWidget()->width() ) );
+}
+
+int MenuBarEditor::heightForWidth( int max_width ) const
+{
+ MenuBarEditor * that = ( MenuBarEditor * ) this;
+ int x = borderSize();
+ int y = 0;
+
+ TQPainter p( this );
+ that->itemHeight = that->itemSize( &(that->addItem) ).height();
+
+ MenuBarEditorItem * i = that->itemList.first();
+ while ( i ) {
+ if ( i->isVisible() )
+ that->addItemSizeToCoords( i, x, y, max_width );
+ i = that->itemList.next();
+ }
+
+ that->addItemSizeToCoords( &(that->addItem), x, y, max_width );
+ that->addItemSizeToCoords( &(that->addSeparator), x, y, max_width );
+
+ return y + itemHeight;
+}
+
+void MenuBarEditor::show()
+{
+ TQWidget::show();
+ resizeInternals();
+
+ TQResizeEvent e( parentWidget()->size(), parentWidget()->size() );
+ TQApplication::sendEvent( parentWidget(), &e );
+}
+
+void MenuBarEditor::checkAccels( TQMap<TQChar, TQWidgetList > &accels )
+{
+ TQString t;
+ MenuBarEditorItem * i = itemList.first();
+ while ( i ) {
+ t = i->menuText();
+ tqfind_accel( t, accels, this );
+ // do not check the accelerators in the popup menus
+ i = itemList.next();
+ }
+}
+
+// public Q_SLOTS
+
+void MenuBarEditor::cut()
+{
+ cut( currentIndex );
+}
+
+void MenuBarEditor::copy()
+{
+ copy( currentIndex );
+}
+
+void MenuBarEditor::paste()
+{
+ paste( currentIndex );
+}
+
+// protected
+
+bool MenuBarEditor::eventFilter( TQObject * o, TQEvent * e )
+{
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(lineEdit) && e->type() == TQEvent::FocusOut ) {
+ leaveEditMode();
+ lineEdit->hide();
+ update();
+ } else if ( e->type() == TQEvent::LayoutHint ) {
+ resize( tqsizeHint() );
+ }
+ return TQMenuBar::eventFilter( o, e );
+}
+
+void MenuBarEditor::paintEvent( TQPaintEvent * )
+{
+ TQPainter p( this );
+ TQRect r = rect();
+ tqstyle().tqdrawPrimitive( TQStyle::PE_PanelMenuBar, &p,
+ r, tqcolorGroup() );
+ drawItems( p );
+}
+
+void MenuBarEditor::mousePressEvent( TQMouseEvent * e )
+{
+ mousePressPos = e->pos();
+ hideItem();
+ lineEdit->hide();
+ currentIndex = tqfindItem( mousePressPos );
+ showItem();
+ update();
+ e->accept();
+}
+
+void MenuBarEditor::mouseDoubleClickEvent( TQMouseEvent * e )
+{
+ mousePressPos = e->pos();
+ currentIndex = tqfindItem( mousePressPos );
+ lineEdit->hide();
+ if ( currentIndex > (int)itemList.count() ) {
+ insertSeparator();
+ update();
+ } else {
+ showLineEdit();
+ }
+}
+
+void MenuBarEditor::mouseMoveEvent( TQMouseEvent * e )
+{
+ if ( e->state() & Qt::LeftButton ) {
+ if ( ( e->pos() - mousePressPos ).manhattanLength() > 3 ) {
+ bool itemCreated = FALSE;
+ bool isSeparator = FALSE;
+ draggedItem = item( tqfindItem( mousePressPos ) );
+ if ( draggedItem == &addItem ) {
+ draggedItem = createItem();
+ itemCreated = TRUE;
+ } else if ( draggedItem == &addSeparator ) {
+ if (hasSeparator) // we can only have one separator
+ return;
+ draggedItem = createItem();
+ draggedItem->setSeparator( TRUE );
+ draggedItem->setMenuText( "separator" );
+ isSeparator = TRUE;
+ itemCreated = TRUE;
+ } else {
+ isSeparator = draggedItem->isSeparator();
+ }
+
+ MenuBarEditorItemPtrDrag * d =
+ new MenuBarEditorItemPtrDrag( draggedItem, this );
+ d->setPixmap( createTextPixmap( draggedItem->menuText() ) );
+ hideItem();
+ draggedItem->tqsetVisible( FALSE );
+ update();
+
+ // If the item is dropped in the same list,
+ // we will have two instances of the same pointer
+ // in the list.
+ itemList.tqfind( draggedItem );
+ TQLNode * node = itemList.currentNode();
+ dropConfirmed = FALSE;
+ d->dragCopy(); // dragevents and stuff happens
+ if ( draggedItem ) { // item was not dropped
+ if ( itemCreated ) {
+ removeItem( draggedItem );
+ } else {
+ hideItem();
+ draggedItem->tqsetVisible( TRUE );
+ draggedItem = 0;
+ showItem();
+ }
+ } else if ( dropConfirmed ) { // item was dropped
+ dropConfirmed = FALSE;
+ hideItem();
+ itemList.takeNode( node )->tqsetVisible( TRUE );
+ hasSeparator = isSeparator || hasSeparator;
+ showItem();
+ } else {
+ hasSeparator = isSeparator || hasSeparator;
+ }
+ update();
+ }
+ }
+}
+
+void MenuBarEditor::dragEnterEvent( TQDragEnterEvent * e )
+{
+ if ( MenuBarEditorItemPtrDrag::canDecode( e ) ) {
+ e->accept();
+ dropLine->show();
+ }
+}
+
+void MenuBarEditor::dragLeaveEvent( TQDragLeaveEvent * )
+{
+ dropLine->hide();
+}
+
+void MenuBarEditor::dragMoveEvent( TQDragMoveEvent * e )
+{
+
+ TQPoint pos = e->pos();
+ dropLine->move( snapToItem( pos ) );
+
+ int idx = tqfindItem( pos );
+ if ( currentIndex != idx ) {
+ hideItem();
+ currentIndex = idx;
+ showItem();
+ }
+}
+
+void MenuBarEditor::dropEvent( TQDropEvent * e )
+{
+ MenuBarEditorItem * i = 0;
+
+ if ( MenuBarEditorItemPtrDrag::decode( e, &i ) ) {
+ draggedItem = 0;
+ hideItem();
+ dropInPlace( i, e->pos() );
+ e->accept();
+ }
+
+ dropLine->hide();
+}
+
+void MenuBarEditor::keyPressEvent( TQKeyEvent * e )
+{
+ if ( lineEdit->isHidden() ) { // In navigation mode
+ switch ( e->key() ) {
+
+ case TQt::Key_Delete:
+ hideItem();
+ deleteItem();
+ showItem();
+ break;
+
+ case TQt::Key_Left:
+ e->accept();
+ navigateLeft( e->state() & ControlButton );
+ return;
+
+ case TQt::Key_Right:
+ e->accept();
+ navigateRight( e->state() & ControlButton );
+ return; // no update
+
+ case TQt::Key_Down:
+ e->accept();
+ focusItem();
+ return; // no update
+
+ case TQt::Key_PageUp:
+ currentIndex = 0;
+ break;
+
+ case TQt::Key_PageDown:
+ currentIndex = itemList.count();
+ break;
+
+ case TQt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_F2:
+ e->accept();
+ enterEditMode();
+ return; // no update
+
+ case TQt::Key_Up:
+ case TQt::Key_Alt:
+ case TQt::Key_Shift:
+ case TQt::Key_Control:
+ case Key_Escape:
+ e->ignore();
+ setFocus(); // FIXME: this is because some other widget get the focus when CTRL is pressed
+ return; // no update
+
+ case TQt::Key_C:
+ if ( e->state() & ControlButton && currentIndex < (int)itemList.count() ) {
+ copy( currentIndex );
+ break;
+ }
+
+ case TQt::Key_X:
+ if ( e->state() & ControlButton && currentIndex < (int)itemList.count() ) {
+ hideItem();
+ cut( currentIndex );
+ showItem();
+ break;
+ }
+
+ case TQt::Key_V:
+ if ( e->state() & ControlButton ) {
+ hideItem();
+ paste( currentIndex < (int)itemList.count() ? currentIndex + 1: itemList.count() );
+ showItem();
+ break;
+ }
+
+ default:
+ if ( e->ascii() >= 32 || e->ascii() == 0 ) {
+ showLineEdit();
+ TQApplication::sendEvent( lineEdit, e );
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ return;
+ }
+ } else { // In edit mode
+
+ switch ( e->key() ) {
+ case TQt::Key_Control:
+ e->ignore();
+ return;
+ case TQt::Key_Enter:
+ case TQt::Key_Return:
+ leaveEditMode();
+ case Key_Escape:
+ lineEdit->hide();
+ setFocus();
+ break;
+ }
+ }
+ e->accept();
+ update();
+}
+
+void MenuBarEditor::focusOutEvent( TQFocusEvent * e )
+{
+ TQWidget * fw = tqApp->tqfocusWidget();
+ if ( e->lostFocus() && !::tqqt_cast<PopupMenuEditor*>(fw) )
+ hideItem();
+ update();
+}
+
+void MenuBarEditor::resizeInternals()
+{
+ dropLine->resize( 2, itemHeight );
+ updateGeometry();
+}
+
+void MenuBarEditor::drawItems( TQPainter & p )
+{
+ TQPoint pos( borderSize(), 0 );
+ uint c = 0;
+
+ p.setPen( tqcolorGroup().buttonText() );
+
+ MenuBarEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->isVisible() )
+ drawItem( p, i, c++, pos ); // updates x y
+ i = itemList.next();
+ }
+
+ p.setPen( Qt::darkBlue );
+ drawItem( p, &addItem, c++, pos );
+ if ( !hasSeparator )
+ drawItem( p, &addSeparator, c, pos );
+}
+
+void MenuBarEditor::drawItem( TQPainter & p,
+ MenuBarEditorItem * i,
+ int idx,
+ TQPoint & pos )
+{
+ int w = itemSize( i ).width();
+
+ // If the item passes the right border, and it is not the first item on the line
+ if ( pos.x() + w > width() && pos.x() > borderSize() ) { // wrap
+ pos.ry() += itemHeight;
+ pos.setX( borderSize() );
+ }
+
+ if ( i->isSeparator() ) {
+ drawSeparator( p, pos );
+ } else {
+ int flags = TQt::AlignLeft | TQt::AlignVCenter |
+ TQt::ShowPrefix | TQt::SingleLine;
+ p.drawText( pos.x() + borderSize(), pos.y(), w - borderSize(), itemHeight,
+ flags, i->menuText() );
+ }
+
+ if ( hasFocus() && idx == currentIndex && !draggedItem )
+ p.drawWinFocusRect( pos.x(), pos.y() + 1, w, itemHeight - 2 );
+
+ pos.rx() += w;
+}
+
+void MenuBarEditor::drawSeparator( TQPainter & p, TQPoint & pos )
+{
+ p.save();
+ p.setPen( Qt::darkBlue );
+
+ int left = pos.x();
+ int top = pos.y() + 2;
+ int right = left + separatorWidth - 1;
+ int bottom = pos.y() + itemHeight - 4;
+
+ p.drawLine( left, top, left, bottom );
+ p.drawLine( right, top, right, bottom );
+
+ p.fillRect( left, pos.y() + borderSize() * 2,
+ separatorWidth - 1, itemHeight - borderSize() * 4,
+ TQBrush( Qt::darkBlue, Qt::Dense5Pattern ) );
+
+ p.restore();
+}
+
+TQSize MenuBarEditor::itemSize( MenuBarEditorItem * i )
+{
+ if ( i->isSeparator() )
+ return TQSize( separatorWidth, itemHeight );
+ TQRect r = fontMetrics().boundingRect( i->menuText().remove( "&") );
+ return TQSize( r.width() + borderSize() * 2, r.height() + borderSize() * 4 );
+}
+
+void MenuBarEditor::addItemSizeToCoords( MenuBarEditorItem * i, int & x, int & y, int w )
+{
+ int dx = itemSize( i ).width();
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ x += dx;
+}
+
+TQPoint MenuBarEditor::itemPos( int index )
+{
+ int x = borderSize();
+ int y = 0;
+ int w = width();
+ int dx = 0;
+ int c = 0;
+
+ MenuBarEditorItem * i = itemList.first();
+
+ while ( i ) {
+ if ( i->isVisible() ) {
+ dx = itemSize( i ).width();
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ if ( c == index )
+ return TQPoint( x, y );
+ x += dx;
+ c++;
+ }
+ i = itemList.next();
+ }
+ dx = itemSize( &addItem ).width();
+ if ( x + dx > width() && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+
+ return TQPoint( x, y );
+}
+
+TQPoint MenuBarEditor::snapToItem( const TQPoint & pos )
+{
+ int x = borderSize();
+ int y = 0;
+ int dx = 0;
+
+ MenuBarEditorItem * n = itemList.first();
+
+ while ( n ) {
+ if ( n->isVisible() ) {
+ dx = itemSize( n ).width();
+ if ( x + dx > width() && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ if ( pos.y() > y &&
+ pos.y() < y + itemHeight &&
+ pos.x() < x + dx / 2 ) {
+ return TQPoint( x, y );
+ }
+ x += dx;
+ }
+ n = itemList.next();
+ }
+
+ return TQPoint( x, y );
+}
+
+void MenuBarEditor::dropInPlace( MenuBarEditorItem * i, const TQPoint & pos )
+{
+ int x = borderSize();
+ int y = 0;
+ int dx = 0;
+ int idx = 0;
+
+ MenuBarEditorItem * n = itemList.first();
+
+ while ( n ) {
+ if ( n->isVisible() ) {
+ dx = itemSize( n ).width();
+ if ( x + dx > width() && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ if ( pos.y() > y &&
+ pos.y() < y + itemHeight &&
+ pos.x() < x + dx / 2 )
+ break;
+ x += dx;
+ }
+ n = itemList.next();
+ idx++;
+ }
+
+ hideItem();
+ Command * cmd = 0;
+ int iidx = itemList.tqfindRef( i );
+ if ( iidx != -1 ) { // internal dnd
+ cmd = new MoveMenuCommand( "Item Dragged", formWnd, this, iidx, idx );
+ item( iidx )->tqsetVisible( TRUE );
+ } else {
+ cmd = new AddMenuCommand( "Add Menu", formWnd, this, i, idx );
+ dropConfirmed = TRUE; // let mouseMoveEvent set the item visible
+ }
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ currentIndex = ( iidx >= 0 && iidx < idx ) ? idx - 1 : idx;
+ showItem();
+}
+
+
+void MenuBarEditor::safeDec()
+{
+ do {
+ currentIndex--;
+ } while ( currentIndex > 0 && !( item( currentIndex )->isVisible() ) );
+}
+
+void MenuBarEditor::safeInc()
+{
+ int max = (int)itemList.count();
+ if ( !hasSeparator )
+ max += 1;
+ if ( currentIndex < max ) {
+ do {
+ currentIndex++;
+ // skip invisible items
+ } while ( currentIndex < max && !( item( currentIndex )->isVisible() ) );
+ }
+}
+
+void MenuBarEditor::navigateLeft( bool ctrl )
+{
+ // FIXME: handle invisible items
+ if ( currentIndex > 0 ) {
+ hideItem();
+ if ( ctrl ) {
+ ExchangeMenuCommand * cmd = new ExchangeMenuCommand( "Move Menu Left",
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex - 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeDec();
+ } else {
+ safeDec();
+ }
+ showItem();
+ }
+ update();
+}
+
+void MenuBarEditor::navigateRight( bool ctrl )
+{
+// FIXME: handle invisible items
+ hideItem();
+ if ( ctrl ) {
+ if ( currentIndex < ( (int)itemList.count() - 1 ) ) {
+ ExchangeMenuCommand * cmd = new ExchangeMenuCommand( "Move Menu Right",
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex + 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeInc();
+ }
+ } else {
+ safeInc();
+ }
+ showItem();
+ update();
+}
+
+void MenuBarEditor::enterEditMode()
+{
+ if ( currentIndex > (int)itemList.count() ) {
+ insertSeparator();
+ } else {
+ showLineEdit();
+ }
+}
+
+void MenuBarEditor::leaveEditMode()
+{
+ MenuBarEditorItem * i = 0;
+ if ( currentIndex >= (int)itemList.count() ) {
+ i = createItem();
+ // do not put rename on cmd stack
+ RenameMenuCommand rename( "Rename Menu", formWnd, this, lineEdit->text(), i );
+ rename.execute();
+ } else {
+ i = itemList.at( currentIndex );
+ RenameMenuCommand * cmd =
+ new RenameMenuCommand( "Rename Menu", formWnd, this, lineEdit->text(), i );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ showItem();
+}
+
+TQPixmap MenuBarEditor::createTextPixmap( const TQString &text )
+{
+ TQSize sz( fontMetrics().boundingRect( text ).size() );
+ TQPixmap pix( sz.width() + 20, sz.height() * 2 );
+ pix.fill( Qt::white );
+ TQPainter p( &pix, this );
+ p.drawText( 2, 0, pix.width(), pix.height(), 0, text );
+ p.end();
+ TQBitmap bm( pix.size() );
+ bm.fill( Qt::color0 );
+ p.begin( &bm );
+ p.setPen( Qt::color1 );
+ p.drawText( 2, 0, pix.width(), pix.height(), 0, text );
+ p.end();
+ pix.setMask( bm );
+ return pix;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/menubareditor.h b/tqtinterface/qt4/tools/designer/designer/menubareditor.h
new file mode 100644
index 0000000..913f0a8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/menubareditor.h
@@ -0,0 +1,207 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef MENUBAREDITOR_H
+#define MENUBAREDITOR_H
+
+#include <tqmenubar.h>
+#include <tqptrlist.h>
+
+class PopupMenuEditor;
+class MenuBarEditor;
+class TQActionGroup;
+
+class MenuBarEditorItem : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+ friend class MenuBarEditor;
+
+ MenuBarEditorItem( MenuBarEditor * bar = 0, TQObject * tqparent = 0, const char * name = 0 );
+
+public:
+ MenuBarEditorItem( PopupMenuEditor * menu, MenuBarEditor * bar,
+ TQObject * tqparent = 0, const char * name = 0);
+ MenuBarEditorItem( TQActionGroup * actionGroup, MenuBarEditor * bar,
+ TQObject * tqparent = 0, const char * name = 0);
+ MenuBarEditorItem( MenuBarEditorItem * item,
+ TQObject * tqparent = 0, const char * name = 0);
+ ~MenuBarEditorItem() { };
+
+ PopupMenuEditor * menu() { return popupMenu; }
+
+ void setMenuText( const TQString t ) { text = t; };
+ TQString menuText() { return text; }
+
+ void tqsetVisible( bool enable ) { visible = enable; }
+ bool isVisible() { return visible; }
+
+ void setRemovable( bool enable ) { removable = enable; }
+ bool isRemovable() { return removable; }
+
+ bool isSeparator() { return separator; }
+protected:
+ void setSeparator( bool enable ) { separator = enable; }
+
+private:
+ MenuBarEditor * menuBar;
+ PopupMenuEditor * popupMenu;
+ TQString text;
+ uint visible : 1;
+ uint separator : 1;
+ uint removable : 1;
+};
+
+class TQLineEdit;
+class FormWindow;
+
+class MenuBarEditor : public TQMenuBar
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ MenuBarEditor( FormWindow * fw, TQWidget * tqparent = 0, const char * name = 0 );
+ ~MenuBarEditor();
+
+ FormWindow * formWindow();
+
+ MenuBarEditorItem * createItem( int index = -1, bool addToCmdStack = TRUE );
+ void insertItem( MenuBarEditorItem * item, int index = -1 );
+ void insertItem( TQString text, PopupMenuEditor * menu, int index = -1 );
+ void insertItem( TQString text, TQActionGroup * group, int index = -1 );
+
+ void insertSeparator( int index = -1 );
+
+ void removeItemAt( int index );
+ void removeItem( MenuBarEditorItem * item );
+
+ int tqfindItem( MenuBarEditorItem * item );
+ int tqfindItem( PopupMenuEditor * menu );
+ int tqfindItem( TQPoint & pos );
+
+ MenuBarEditorItem * item( int index = -1 );
+
+ int count();
+ int current();
+
+ void cut( int index );
+ void copy( int index );
+ void paste( int index );
+ void exchange( int a, int b );
+
+ void showLineEdit( int index = -1);
+ void showItem( int index = -1 );
+ void hideItem( int index = -1 );
+ void focusItem( int index = -1 );
+ void deleteItem( int index = -1 );
+
+ TQSize tqsizeHint() const;
+ TQSize tqminimumSize() const { return tqsizeHint(); }
+ TQSize tqminimumSizeHint() const { return tqsizeHint(); }
+ int heightForWidth( int max_width ) const;
+
+ void show();
+
+ void checkAccels( TQMap<TQChar, TQWidgetList > &accels );
+
+public Q_SLOTS:
+ void cut();
+ void copy();
+ void paste();
+
+protected:
+ bool eventFilter( TQObject * o, TQEvent * e );
+ void paintEvent( TQPaintEvent * e );
+ void mousePressEvent( TQMouseEvent * e );
+ void mouseDoubleClickEvent( TQMouseEvent * e );
+ void mouseMoveEvent( TQMouseEvent * e );
+ void dragEnterEvent( TQDragEnterEvent * e );
+ void dragLeaveEvent( TQDragLeaveEvent * e );
+ void dragMoveEvent( TQDragMoveEvent * e );
+ void dropEvent( TQDropEvent * e );
+ void keyPressEvent( TQKeyEvent * e );
+ void focusOutEvent( TQFocusEvent * e );
+ void resizeEvent( TQResizeEvent * e ) { TQFrame::resizeEvent( e ); }
+
+ void resizeInternals();
+
+ void drawItems( TQPainter & p );
+ void drawItem( TQPainter & p, MenuBarEditorItem * i, int idx, TQPoint & pos );
+ void drawSeparator( TQPainter & p, TQPoint & pos );
+
+ TQSize itemSize( MenuBarEditorItem * i );
+ void addItemSizeToCoords( MenuBarEditorItem * i, int & x, int & y, int w );
+
+ TQPoint itemPos( int index );
+ TQPoint snapToItem( const TQPoint & pos );
+ void dropInPlace( MenuBarEditorItem * i, const TQPoint & pos );
+
+ void safeDec();
+ void safeInc();
+
+ void navigateLeft( bool ctrl );
+ void navigateRight( bool ctrl );
+ void enterEditMode();
+ void leaveEditMode();
+
+ TQPixmap createTextPixmap( const TQString &text );
+ int borderSize() const { return margin() + 4; } // add 4 pixels to the margin
+
+private:
+ FormWindow * formWnd;
+ TQLineEdit * lineEdit;
+ TQWidget * dropLine;
+ TQPtrList<MenuBarEditorItem> itemList;
+ MenuBarEditorItem addItem;
+ MenuBarEditorItem addSeparator;
+ MenuBarEditorItem * draggedItem;
+ TQPoint mousePressPos;
+ int currentIndex;
+ int itemHeight;
+ int separatorWidth;
+ bool hideWhenEmpty;
+ bool hasSeparator;
+ bool dropConfirmed;
+
+ enum ClipboardOperation {
+ None = 0,
+ Cut = 1,
+ Copy = 2
+ };
+ static int clipboardOperation;
+ static MenuBarEditorItem * clipboardItem;
+};
+
+#endif //MENUBAREDITOR_H
diff --git a/tqtinterface/qt4/tools/designer/designer/metadatabase.cpp b/tqtinterface/qt4/tools/designer/designer/metadatabase.cpp
new file mode 100644
index 0000000..501e6cc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/metadatabase.cpp
@@ -0,0 +1,1693 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "metadatabase.h"
+#include "widgetfactory.h"
+#include "formwindow.h"
+#include "parser.h"
+#include "widgetdatabase.h"
+#include "formfile.h"
+#include "propertyobject.h"
+#include "project.h"
+#include "mainwindow.h"
+
+#include <tqapplication.h>
+#include <tqobject.h>
+#include <tqlayout.h>
+#include <tqptrdict.h>
+#include <tqobjectlist.h>
+#include <tqstrlist.h>
+#include <tqmetaobject.h>
+#include <tqwidgetlist.h>
+#include <tqmainwindow.h>
+#include <tqregexp.h>
+#include <private/tqpluginmanager_p.h>
+#include <tqdatetime.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqtextstream.h>
+
+#include <stdlib.h>
+
+class MetaDataBaseRecord
+{
+public:
+ TQObject *object;
+ TQStringList changedProperties;
+ TQMap<TQString,TQVariant> fakeProperties;
+ TQMap<TQString, TQString> propertyComments;
+ int spacing, margin;
+ TQString resizeMode;
+ TQValueList<MetaDataBase::Connection> connections;
+ TQValueList<MetaDataBase::Function> functionList;
+ TQValueList<MetaDataBase::Include> includes;
+ TQValueList<MetaDataBase::Variable> variables;
+ TQStringList forwards, sigs;
+ TQWidgetList tabOrder;
+ MetaDataBase::MetaInfo metaInfo;
+ TQCursor cursor;
+ TQMap<int, TQString> pixmapArguments;
+ TQMap<int, TQString> pixmapKeys;
+ TQMap<TQString, TQString> columnFields;
+ TQValueList<uint> breakPoints;
+ TQMap<int, TQString> breakPointConditions;
+ TQString exportMacro;
+};
+
+static TQPtrDict<MetaDataBaseRecord> *db = 0;
+static TQPtrList<MetaDataBase::CustomWidget> *cWidgets = 0;
+static bool doUpdate = TRUE;
+static TQStringList langList;
+static TQStringList editorLangList;
+static TQPluginManager<LanguageInterface> *languageInterfaceManager = 0;
+
+/*!
+ \class MetaDataBase metadatabase.h
+ \brief Database which stores meta data of widgets
+
+ The MetaDataBase stores meta information of widgets, which are not
+ stored directly in widgets (properties). This is e.g. the
+ information which properties have been modified.
+*/
+
+MetaDataBase::MetaDataBase()
+{
+}
+
+inline void setupDataBase()
+{
+ if ( !db || !cWidgets ) {
+ db = new TQPtrDict<MetaDataBaseRecord>( 1481 );
+ db->setAutoDelete( TRUE );
+ cWidgets = new TQPtrList<MetaDataBase::CustomWidget>;
+ cWidgets->setAutoDelete( TRUE );
+ }
+}
+
+void MetaDataBase::clearDataBase()
+{
+ delete db;
+ db = 0;
+ delete cWidgets;
+ cWidgets = 0;
+}
+
+void MetaDataBase::addEntry( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ if ( db->tqfind( o ) )
+ return;
+ MetaDataBaseRecord *r = new MetaDataBaseRecord;
+ r->object = TQT_TQOBJECT(o);
+ r->spacing = r->margin = -1;
+ db->insert( (void*)o, r );
+
+ WidgetFactory::initChangedProperties( o );
+}
+
+void MetaDataBase::removeEntry( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ db->remove( o );
+}
+
+void MetaDataBase::setPropertyChanged( TQT_BASE_OBJECT_NAME *o, const TQString &property, bool changed )
+{
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdPropertyChanged( property, changed );
+ return;
+ }
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ if ( changed ) {
+ if ( r->changedProperties.tqfindIndex( property ) == -1 )
+ r->changedProperties.append( property );
+ } else {
+ if ( r->changedProperties.tqfindIndex( property ) != -1 )
+ r->changedProperties.remove( property );
+ }
+
+ if ( doUpdate &&
+ ( property == "hAlign" || property == "vAlign" || property == "wordwrap" ) ) {
+ doUpdate = FALSE;
+ setPropertyChanged( o, "tqalignment", changed ||
+ isPropertyChanged( o, "hAlign" ) ||
+ isPropertyChanged( o, "vAlign" ) ||
+ isPropertyChanged( o, "wordwrap" ) );
+ doUpdate = TRUE;
+ }
+
+ if ( doUpdate && property == "tqalignment" ) {
+ doUpdate = FALSE;
+ setPropertyChanged( o, "hAlign", changed );
+ setPropertyChanged( o, "vAlign", changed );
+ setPropertyChanged( o, "wordwrap", changed );
+ doUpdate = TRUE;
+ }
+}
+
+bool MetaDataBase::isPropertyChanged( TQT_BASE_OBJECT_NAME *o, const TQString &property )
+{
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdIsPropertyChanged( property );
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return FALSE;
+ }
+
+ return r->changedProperties.tqfindIndex( property ) != -1;
+}
+
+TQStringList MetaDataBase::changedProperties( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQStringList();
+ }
+
+ TQStringList lst( r->changedProperties );
+ return lst;
+}
+
+void MetaDataBase::setPropertyComment( TQT_BASE_OBJECT_NAME *o, const TQString &property, const TQString &comment )
+{
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetPropertyComment( property, comment );
+ return;
+ }
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->propertyComments.insert( property, comment );
+}
+
+TQString MetaDataBase::propertyComment( TQT_BASE_OBJECT_NAME *o, const TQString &property )
+{
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdPropertyComment( property );
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQString();
+ }
+
+ return *r->propertyComments.tqfind( property );
+}
+
+void MetaDataBase::setFakeProperty( TQT_BASE_OBJECT_NAME *o, const TQString &property, const TQVariant& value )
+{
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetFakeProperty( property, value );
+ return;
+ }
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ r->fakeProperties[property] = value;
+}
+
+TQVariant MetaDataBase::fakeProperty( TQT_BASE_OBJECT_NAME * o, const TQString &property)
+{
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdFakeProperty( property );
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQVariant();
+ }
+ TQMap<TQString, TQVariant>::Iterator it = r->fakeProperties.tqfind( property );
+ if ( it != r->fakeProperties.end() )
+ return r->fakeProperties[property];
+ return WidgetFactory::defaultValue( o, property );
+
+}
+
+TQMap<TQString,TQVariant>* MetaDataBase::fakeProperties( TQT_BASE_OBJECT_NAME* o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return 0;
+ }
+ return &r->fakeProperties;
+}
+
+void MetaDataBase::setSpacing( TQT_BASE_OBJECT_NAME *o, int spacing )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->spacing = spacing;
+ TQLayout * tqlayout = 0;
+ WidgetFactory::layoutType( (TQWidget*)o, tqlayout );
+ if ( tqlayout ) {
+ int spadef = 6;
+ if ( MainWindow::self->formWindow() )
+ spadef = MainWindow::self->formWindow()->layoutDefaultSpacing();
+ if ( spacing == -1 )
+ tqlayout->setSpacing( spadef );
+ else
+ tqlayout->setSpacing( spacing );
+ }
+}
+
+int MetaDataBase::spacing( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return -1;
+ setupDataBase();
+ if ( ::tqqt_cast<TQMainWindow*>(o) )
+ o = ( (TQMainWindow*)o )->centralWidget();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return -1;
+ }
+
+ return r->spacing;
+}
+
+void MetaDataBase::setMargin( TQT_BASE_OBJECT_NAME *o, int margin )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->margin = margin;
+ TQLayout * tqlayout = 0;
+ WidgetFactory::layoutType( (TQWidget*)o, tqlayout );
+
+ bool isInnerLayout = TRUE;
+
+ TQWidget *widget = (TQWidget*)o;
+ if ( widget && !::tqqt_cast<TQLayoutWidget*>(widget) &&
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
+ widget && widget->parentWidget() && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) )
+ isInnerLayout = FALSE;
+
+
+ if ( tqlayout ) {
+ int mardef = 11;
+ if ( MainWindow::self->formWindow() )
+ mardef = MainWindow::self->formWindow()->layoutDefaultMargin();
+ if ( margin == -1 ) {
+ if ( isInnerLayout )
+ tqlayout->setMargin( 1 );
+ else
+ tqlayout->setMargin( TQMAX( 1, mardef ) );
+ }
+ else
+ tqlayout->setMargin( TQMAX( 1, margin ) );
+ }
+}
+
+int MetaDataBase::margin( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return -1;
+ setupDataBase();
+ if ( ::tqqt_cast<TQMainWindow*>(o) )
+ o = ( (TQMainWindow*)o )->centralWidget();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return -1;
+ }
+ return r->margin;
+}
+
+void MetaDataBase::setResizeMode( TQT_BASE_OBJECT_NAME *o, const TQString &mode )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->resizeMode = mode;
+}
+
+TQString MetaDataBase::resizeMode( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return TQString();
+ setupDataBase();
+ if ( ::tqqt_cast<TQMainWindow*>(o) )
+ o = ( (TQMainWindow*)o )->centralWidget();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQString();
+ }
+ return r->resizeMode;
+}
+
+void MetaDataBase::addConnection( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *sender, const TQCString &signal,
+ TQT_BASE_OBJECT_NAME *receiver, const TQCString &slot, bool addCode )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ if ( !(sender && receiver) )
+ return;
+ Connection conn;
+ conn.sender = TQT_TQOBJECT(sender);
+ conn.signal = signal;
+ conn.receiver = TQT_TQOBJECT(receiver);
+ conn.slot = slot;
+ r->connections.append( conn );
+ if ( addCode ) {
+ TQString rec = TQT_TQOBJECT(receiver)->name();
+ if ( ::tqqt_cast<FormWindow*>(o) && receiver == ( (FormWindow*)o )->mainContainer() )
+ rec = "this";
+ TQString sen = TQT_TQOBJECT(sender)->name();
+ if ( ::tqqt_cast<FormWindow*>(o) && sender == ( (FormWindow*)o )->mainContainer() )
+ sen = "this";
+ FormFile *ff = 0;
+ if ( ::tqqt_cast<FormFile*>(o) )
+ ff = (FormFile*)o;
+ else if ( ::tqqt_cast<FormWindow*>(o) )
+ ff = ( (FormWindow*)o )->formFile();
+ ff->addConnection( sen, signal, rec, slot );
+ }
+}
+
+void MetaDataBase::removeConnection( TQT_BASE_OBJECT_NAME *o, TQObject *sender, const TQCString &signal,
+ TQObject *receiver, const TQCString &slot )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ if ( !(sender && receiver) )
+ return;
+ for ( TQValueList<Connection>::Iterator it = r->connections.begin(); it != r->connections.end(); ++it ) {
+ Connection conn = *it;
+ if ( conn.sender == sender &&
+ conn.signal == signal &&
+ conn.receiver == receiver &&
+ conn.slot == slot ) {
+ r->connections.remove( it );
+ break;
+ }
+ }
+ if ( ::tqqt_cast<FormWindow*>(o) ) {
+ TQString rec = receiver->name();
+ if ( TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(( (FormWindow*)o )->mainContainer()) )
+ rec = "this";
+ ( (FormWindow*)o )->formFile()->removeConnection( sender->name(), signal, rec, slot );
+ }
+}
+
+void MetaDataBase::setupConnections( TQT_BASE_OBJECT_NAME *o, const TQValueList<LanguageInterface::Connection> &conns )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ if ( !::tqqt_cast<FormFile*>(o) )
+ return;
+
+ FormFile *formfile = (FormFile*)o;
+
+ r->connections.clear();
+
+ for ( TQValueList<LanguageInterface::Connection>::ConstIterator cit = conns.begin();
+ cit != conns.end(); ++cit ) {
+ // #### get the correct sender object out of Bla.Blub.sender
+ TQString senderName = (*cit).sender;
+ if ( senderName.tqfind( '.' ) != -1 )
+ senderName = senderName.mid( senderName.tqfindRev( '.' ) + 1 );
+ TQObject *sender = 0;
+ if ( formfile->formWindow() )
+ sender = formfile->formWindow()->child( senderName );
+ if ( !sender && formfile->isFake() )
+ sender = formfile->project()->objectForFakeFormFile( formfile );
+ if ( !sender && senderName == "this" )
+ sender = formfile->formWindow() ?
+ TQT_TQOBJECT(formfile->formWindow()->mainContainer()) :
+ formfile->project()->objectForFakeFormFile( formfile );
+ if ( !sender )
+ continue;
+ MetaDataBase::addConnection( formfile->formWindow() ?
+ (TQObject*)formfile->formWindow() :
+ (TQObject*)formfile,
+ sender,
+ (*cit).signal.latin1(),
+ formfile->formWindow() ?
+ TQT_TQOBJECT(formfile->formWindow()->mainContainer()) :
+ formfile->project()->objectForFakeFormFile( formfile ),
+ (*cit).slot.latin1(),
+ FALSE );
+ }
+}
+
+bool MetaDataBase::hasConnection( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *sender, const TQCString &signal,
+ TQT_BASE_OBJECT_NAME *receiver, const TQCString &slot )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return FALSE;
+ }
+
+ for ( TQValueList<Connection>::Iterator it = r->connections.begin(); it != r->connections.end(); ++it ) {
+ Connection conn = *it;
+ if ( conn.sender == sender &&
+ conn.signal == signal &&
+ conn.receiver == receiver &&
+ conn.slot == slot )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+TQValueList<MetaDataBase::Connection> MetaDataBase::connections( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<Connection>();
+ }
+ return r->connections;
+}
+
+TQValueList<MetaDataBase::Connection> MetaDataBase::connections( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *sender,
+ TQT_BASE_OBJECT_NAME *receiver )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<Connection>();
+ }
+ TQValueList<Connection>::Iterator it = r->connections.begin();
+ TQValueList<Connection> ret;
+ TQValueList<Connection>::Iterator conn;
+ while ( ( conn = it ) != r->connections.end() ) {
+ ++it;
+ if ( (*conn).sender == sender &&
+ (*conn).receiver == receiver )
+ ret << *conn;
+ }
+
+ return ret;
+}
+
+TQValueList<MetaDataBase::Connection> MetaDataBase::connections( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *object )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<Connection>();
+ }
+ TQValueList<Connection>::Iterator it = r->connections.begin();
+ TQValueList<Connection> ret;
+ TQValueList<Connection>::Iterator conn;
+ while ( ( conn = it ) != r->connections.end() ) {
+ ++it;
+ if ( (*conn).sender == object ||
+ (*conn).receiver == object )
+ ret << *conn;
+ }
+ return ret;
+}
+
+void MetaDataBase::doConnections( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ TQObject *sender = 0, *receiver = 0;
+ TQObjectList *l = 0;
+ TQValueList<Connection>::Iterator it = r->connections.begin();
+ for ( ; it != r->connections.end(); ++it ) {
+ Connection conn = *it;
+ if ( qstrcmp( conn.sender->name(), TQT_TQOBJECT(o)->name() ) == 0 ) {
+ sender = TQT_TQOBJECT(o);
+ } else {
+ l = TQT_TQOBJECT(o)->queryList( 0, conn.sender->name(), FALSE );
+ if ( !l || !l->first() ) {
+ delete l;
+ continue;
+ }
+ sender = l->first();
+ delete l;
+ }
+ if ( qstrcmp( conn.receiver->name(), TQT_TQOBJECT(o)->name() ) == 0 ) {
+ receiver = TQT_TQOBJECT(o);
+ } else {
+ l = TQT_TQOBJECT(o)->queryList( 0, conn.receiver->name(), FALSE );
+ if ( !l || !l->first() ) {
+ delete l;
+ continue;
+ }
+ receiver = l->first();
+ delete l;
+ }
+ TQString s = "2""%1";
+ s = s.arg( TQString(conn.signal) );
+ TQString s2 = "1""%1";
+ s2 = s2.arg( TQString(conn.slot) );
+
+ TQStrList signalList = sender->tqmetaObject()->signalNames( TRUE );
+ TQStrList slotList = receiver->tqmetaObject()->slotNames( TRUE );
+
+ // avoid warnings
+ if ( signalList.tqfind( conn.signal ) == -1 ||
+ slotList.tqfind( conn.slot ) == -1 )
+ continue;
+
+ TQObject::connect( sender, s, receiver, s2 );
+ }
+}
+
+bool MetaDataBase::hasSlot( TQT_BASE_OBJECT_NAME *o, const TQCString &slot, bool onlyCustom )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return FALSE;
+ }
+
+ if ( !onlyCustom ) {
+ TQStrList slotList = TQT_TQOBJECT(o)->tqmetaObject()->slotNames( TRUE );
+ if ( slotList.tqfind( slot ) != -1 )
+ return TRUE;
+
+ if ( ::tqqt_cast<FormWindow*>(o) ) {
+ o = ( (FormWindow*)o )->mainContainer();
+ slotList = TQT_TQOBJECT(o)->tqmetaObject()->slotNames( TRUE );
+ if ( slotList.tqfind( slot ) != -1 )
+ return TRUE;
+ }
+
+ //if ( ::tqqt_cast<CustomWidget*>(o) ) {
+ if ( o->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
+ for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
+ TQCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ if ( s == slot )
+ return TRUE;
+ }
+ }
+ }
+
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( slot ) && f.type == "slot" )
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool MetaDataBase::isSlotUsed( TQT_BASE_OBJECT_NAME *o, const TQCString &slot )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return FALSE;
+ }
+
+ TQValueList<Connection> conns = connections( o );
+ for ( TQValueList<Connection>::Iterator it = conns.begin(); it != conns.end(); ++it ) {
+ if ( (*it).slot == slot )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+void MetaDataBase::addFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function, const TQString &specifier,
+ const TQString &access, const TQString &type, const TQString &language,
+ const TQString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ Function f;
+ f.function = function;
+ f.specifier = specifier;
+ f.access = access;
+ f.type = type;
+ f.language = language;
+ f.returnType = returnType;
+ TQValueList<MetaDataBase::Function>::Iterator it = r->functionList.tqfind( f );
+ if ( it != r->functionList.end() )
+ r->functionList.remove( it );
+ r->functionList.append( f );
+ ( (FormWindow*)o )->formFile()->addFunctionCode( f );
+}
+
+void MetaDataBase::setFunctionList( TQT_BASE_OBJECT_NAME *o, const TQValueList<Function> &functionList )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ r->functionList = functionList;
+}
+
+void MetaDataBase::removeFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function, const TQString &specifier,
+ const TQString &access, const TQString &type, const TQString &language,
+ const TQString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).function ) ==
+ MetaDataBase::normalizeFunction( function ) &&
+ (*it).specifier == specifier &&
+ (*it).access == access &&
+ (*it).type == type &&
+ ( language.isEmpty() || (*it).language == language ) &&
+ ( returnType.isEmpty() || (*it).returnType == returnType ) ) {
+ ( (FormWindow*)o )->formFile()->removeFunctionCode( *it );
+ r->functionList.remove( it );
+ break;
+ }
+ }
+}
+
+void MetaDataBase::removeFunction( TQT_BASE_OBJECT_NAME *o, const TQString &function )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( normalizeFunction( (*it).function ) == normalizeFunction( function ) ) {
+ ( (FormWindow*)o )->formFile()->removeFunctionCode( *it );
+ r->functionList.remove( it );
+ break;
+ }
+ }
+}
+
+TQValueList<MetaDataBase::Function> MetaDataBase::functionList( TQT_BASE_OBJECT_NAME *o, bool onlyFunctions )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<Function>();
+ }
+ if ( !onlyFunctions )
+ return r->functionList;
+ TQValueList<Function> fList;
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( (*it).type == "function" )
+ fList.append( *it );
+ }
+ return fList;
+}
+
+TQValueList<MetaDataBase::Function> MetaDataBase::slotList( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<Function>();
+ }
+ TQValueList<Function> slotList;
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( (*it).type == "slot" )
+ slotList.append( *it );
+ }
+ return slotList;
+}
+
+void MetaDataBase::changeFunction( TQT_BASE_OBJECT_NAME *o, const TQString &function, const TQString &newName,
+ const TQString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( function ) ) {
+ (*it).function = newName;
+ if ( !returnType.isNull() )
+ (*it).returnType = returnType;
+ return;
+ }
+ }
+}
+
+void MetaDataBase::changeFunctionAttributes( TQT_BASE_OBJECT_NAME *o, const TQString &oldName, const TQString &newName,
+ const TQString &specifier, const TQString &access,
+ const TQString &type, const TQString &language,
+ const TQString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( oldName ) ) {
+ (*it).function = newName;
+ (*it).specifier = specifier;
+ (*it).access = access;
+ (*it).type = type;
+ (*it).language = language;
+ (*it).returnType = returnType;
+ return;
+ }
+ }
+}
+
+bool MetaDataBase::hasFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function, bool onlyCustom )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return FALSE;
+ }
+
+ if ( !onlyCustom ) {
+ TQStrList functionList = TQT_TQOBJECT(o)->tqmetaObject()->slotNames( TRUE );
+ if ( functionList.tqfind( function ) != -1 )
+ return TRUE;
+
+ if ( ::tqqt_cast<FormWindow*>(o) ) {
+ o = ( (FormWindow*)o )->mainContainer();
+ functionList = TQT_TQOBJECT(o)->tqmetaObject()->slotNames( TRUE );
+ if ( functionList.tqfind( function ) != -1 )
+ return TRUE;
+ }
+
+ //if ( ::tqqt_cast<CustomWidget*>(o) ) {
+ if ( o->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
+ for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
+ TQCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ if ( s == function )
+ return TRUE;
+ }
+ }
+ }
+
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( function ) )
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+TQString MetaDataBase::languageOfFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQString();
+ }
+
+ TQString fu = normalizeFunction( function );
+ for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( fu == normalizeFunction( (*it).function ) )
+ return (*it).language;
+ }
+ return TQString();
+}
+
+bool MetaDataBase::addCustomWidget( CustomWidget *wid )
+{
+ setupDataBase();
+
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( *wid == *w ) {
+ for ( TQValueList<TQCString>::ConstIterator it = wid->lstSignals.begin(); it != wid->lstSignals.end(); ++it ) {
+ if ( !w->hasSignal( *it ) )
+ w->lstSignals.append( *it );
+ }
+ for ( TQValueList<Function>::ConstIterator it2 = wid->lstSlots.begin(); it2 != wid->lstSlots.end(); ++it2 ) {
+ if ( !w->hasSlot( MetaDataBase::normalizeFunction( (*it2).function ).latin1() ) )
+ w->lstSlots.append( *it2 );
+ }
+ for ( TQValueList<Property>::ConstIterator it3 = wid->lstProperties.begin(); it3 != wid->lstProperties.end(); ++it3 ) {
+ if ( !w->hasProperty( (*it3).property ) )
+ w->lstProperties.append( *it3 );
+ }
+ delete wid;
+ return FALSE;
+ }
+ }
+
+
+ WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
+ r->name = wid->className;
+ r->includeFile = wid->includeFile;
+ r->group = WidgetDatabase::widgetGroup( "Custom" );
+ r->toolTip = wid->className;
+ r->icon = new TQIconSet( *wid->pixmap, *wid->pixmap );
+ r->isContainer = wid->isContainer;
+ wid->id = WidgetDatabase::addCustomWidget( r );
+ cWidgets->append( wid );
+ return TRUE;
+}
+
+void MetaDataBase::removeCustomWidget( CustomWidget *w )
+{
+ cWidgets->removeRef( w );
+}
+
+TQPtrList<MetaDataBase::CustomWidget> *MetaDataBase::customWidgets()
+{
+ setupDataBase();
+ return cWidgets;
+}
+
+MetaDataBase::CustomWidget *MetaDataBase::customWidget( int id )
+{
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( id == w->id )
+ return w;
+ }
+ return 0;
+}
+
+bool MetaDataBase::isWidgetNameUsed( CustomWidget *wid )
+{
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( w == wid )
+ continue;
+ if ( wid->className == w->className )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool MetaDataBase::hasCustomWidget( const TQString &className )
+{
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( w->className == className )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void MetaDataBase::setTabOrder( TQWidget *w, const TQWidgetList &order )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*) w );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ w, w->name(), w->className() );
+ return;
+ }
+
+ r->tabOrder = order;
+}
+
+TQWidgetList MetaDataBase::tabOrder( TQWidget *w )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*) w );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ w, w->name(), w->className() );
+ return TQWidgetList();
+ }
+
+ return r->tabOrder;
+}
+
+void MetaDataBase::setIncludes( TQT_BASE_OBJECT_NAME *o, const TQValueList<Include> &incs )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->includes = incs;
+}
+
+TQValueList<MetaDataBase::Include> MetaDataBase::includes( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<Include>();
+ }
+
+ return r->includes;
+}
+
+void MetaDataBase::setForwards( TQT_BASE_OBJECT_NAME *o, const TQStringList &fwds )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->forwards = fwds;
+}
+
+TQStringList MetaDataBase::forwards( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQStringList();
+ }
+
+ return r->forwards;
+}
+
+void MetaDataBase::setVariables( TQT_BASE_OBJECT_NAME *o, const TQValueList<Variable> &vars )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->variables = vars;
+}
+
+void MetaDataBase::addVariable( TQT_BASE_OBJECT_NAME *o, const TQString &name, const TQString &access )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ Variable v;
+ v.varName = name;
+ v.varAccess = access;
+ r->variables << v;
+}
+
+void MetaDataBase::removeVariable( TQT_BASE_OBJECT_NAME *o, const TQString &name )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ TQValueList<Variable>::Iterator it = r->variables.begin();
+ for ( ; it != r->variables.end(); ++it ) {
+ if ( (*it).varName == name ) {
+ r->variables.remove( it );
+ break;
+ }
+ }
+}
+
+TQValueList<MetaDataBase::Variable> MetaDataBase::variables( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<MetaDataBase::Variable>();
+ }
+
+ return r->variables;
+}
+
+bool MetaDataBase::hasVariable( TQT_BASE_OBJECT_NAME *o, const TQString &name )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return FALSE;
+ }
+
+ TQValueList<Variable>::Iterator it = r->variables.begin();
+ for ( ; it != r->variables.end(); ++it ) {
+ if ( extractVariableName( name ) == extractVariableName( (*it).varName ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+TQString MetaDataBase::extractVariableName( const TQString &name )
+{
+ TQString n = name.right( name.length() - name.tqfindRev( ' ' ) - 1 );
+ if ( n[ 0 ] == '*' || n[ 0 ] == '&' )
+ n[ 0 ] = ' ';
+ if ( n[ (int)n.length() - 1 ] == ';' )
+ n[ (int)n.length() - 1 ] = ' ';
+ return n.simplifyWhiteSpace();
+}
+
+void MetaDataBase::setSignalList( TQT_BASE_OBJECT_NAME *o, const TQStringList &sigs )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->sigs.clear();
+
+ for ( TQStringList::ConstIterator it = sigs.begin(); it != sigs.end(); ++it ) {
+ TQString s = (*it).simplifyWhiteSpace();
+ bool hasSemicolon = s.endsWith( ";" );
+ if ( hasSemicolon )
+ s = s.left( s.length() - 1 );
+ int p = s.tqfind( '(' );
+ if ( p < 0 )
+ p = s.length();
+ int sp = s.tqfind( ' ' );
+ if ( sp >= 0 && sp < p ) {
+ s = s.mid( sp+1 );
+ p -= sp + 1;
+ }
+ if ( p == (int) s.length() )
+ s += "()";
+ if ( hasSemicolon )
+ s += ";";
+ r->sigs << s;
+ }
+}
+
+TQStringList MetaDataBase::signalList( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQStringList();
+ }
+
+ return r->sigs;
+}
+
+void MetaDataBase::setMetaInfo( TQT_BASE_OBJECT_NAME *o, MetaInfo mi )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->metaInfo = mi;
+}
+
+MetaDataBase::MetaInfo MetaDataBase::metaInfo( TQT_BASE_OBJECT_NAME *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return MetaInfo();
+ }
+
+ return r->metaInfo;
+}
+
+
+
+
+MetaDataBase::CustomWidget::CustomWidget()
+{
+ className = "MyCustomWidget";
+ includeFile = "mywidget.h";
+ includePolicy = Local;
+ tqsizeHint = TQSize( -1, -1 );
+ pixmap = new TQPixmap( TQPixmap::fromMimeSource( "designer_customwidget.png" ) );
+ id = -1;
+ sizePolicy = TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Preferred );
+ isContainer = FALSE;
+}
+
+MetaDataBase::CustomWidget::CustomWidget( const CustomWidget &w )
+{
+ className = w.className;
+ includeFile = w.includeFile;
+ includePolicy = w.includePolicy;
+ tqsizeHint = w.tqsizeHint;
+ if ( w.pixmap )
+ pixmap = new TQPixmap( *w.pixmap );
+ else
+ pixmap = 0;
+ id = w.id;
+ isContainer = w.isContainer;
+}
+
+void MetaDataBase::setCursor( TQWidget *w, const TQCursor &c )
+{
+ setupDataBase();
+ if ( w->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)w )->mdSetCursor( c );
+ return;
+ }
+ MetaDataBaseRecord *r = db->tqfind( (void*)w );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ w, w->name(), w->className() );
+ return;
+ }
+
+ r->cursor = c;
+}
+
+TQCursor MetaDataBase::cursor( TQWidget *w )
+{
+ setupDataBase();
+ if ( w->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)w )->mdCursor();
+ MetaDataBaseRecord *r = db->tqfind( (void*)w );
+ if ( !r ) {
+ w->unsetCursor();
+ return w->cursor();
+ }
+
+ return r->cursor;
+}
+
+bool MetaDataBase::CustomWidget::operator==( const CustomWidget &w ) const
+{
+ return className == w.className;
+}
+
+MetaDataBase::CustomWidget &MetaDataBase::CustomWidget::operator=( const CustomWidget &w )
+{
+ delete pixmap;
+ className = w.className;
+ includeFile = w.includeFile;
+ includePolicy = w.includePolicy;
+ tqsizeHint = w.tqsizeHint;
+ if ( w.pixmap )
+ pixmap = new TQPixmap( *w.pixmap );
+ else
+ pixmap = 0;
+ lstSignals = w.lstSignals;
+ lstSlots = w.lstSlots;
+ lstProperties = w.lstProperties;
+ id = w.id;
+ isContainer = w.isContainer;
+ return *this;
+}
+
+bool MetaDataBase::CustomWidget::hasSignal( const TQCString &signal ) const
+{
+ TQStrList sigList = TQWidget::tqstaticMetaObject()->signalNames( TRUE );
+ if ( sigList.tqfind( signal ) != -1 )
+ return TRUE;
+ for ( TQValueList<TQCString>::ConstIterator it = lstSignals.begin(); it != lstSignals.end(); ++it ) {
+ if ( normalizeFunction( *it ) == normalizeFunction( signal ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool MetaDataBase::CustomWidget::hasSlot( const TQCString &slot ) const
+{
+ TQStrList slotList = TQWidget::tqstaticMetaObject()->slotNames( TRUE );
+ if ( slotList.tqfind( normalizeFunction( slot ) ) != -1 )
+ return TRUE;
+
+ for ( TQValueList<MetaDataBase::Function>::ConstIterator it = lstSlots.begin(); it != lstSlots.end(); ++it ) {
+ if ( normalizeFunction( (*it).function ) == normalizeFunction( slot ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool MetaDataBase::CustomWidget::hasProperty( const TQCString &prop ) const
+{
+ TQStrList propList = TQWidget::tqstaticMetaObject()->propertyNames( TRUE );
+ if ( propList.tqfind( prop ) != -1 )
+ return TRUE;
+
+ for ( TQValueList<MetaDataBase::Property>::ConstIterator it = lstProperties.begin(); it != lstProperties.end(); ++it ) {
+ if ( (*it).property == prop )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void MetaDataBase::setPixmapArgument( TQT_BASE_OBJECT_NAME *o, int pixmap, const TQString &arg )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->pixmapArguments.remove( pixmap );
+ r->pixmapArguments.insert( pixmap, arg );
+}
+
+TQString MetaDataBase::pixmapArgument( TQT_BASE_OBJECT_NAME *o, int pixmap )
+{
+ if ( !o )
+ return TQString();
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQString();
+ }
+
+ return *r->pixmapArguments.tqfind( pixmap );
+}
+
+void MetaDataBase::clearPixmapArguments( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->pixmapArguments.clear();
+}
+
+
+void MetaDataBase::setPixmapKey( TQT_BASE_OBJECT_NAME *o, int pixmap, const TQString &arg )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetPixmapKey( pixmap, arg );
+ return;
+ }
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->pixmapKeys.remove( pixmap );
+ r->pixmapKeys.insert( pixmap, arg );
+}
+
+TQString MetaDataBase::pixmapKey( TQT_BASE_OBJECT_NAME *o, int pixmap )
+{
+ if ( !o )
+ return TQString();
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdPixmapKey( pixmap );
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQString();
+ }
+
+ TQString s = *r->pixmapKeys.tqfind( pixmap );
+ if ( !s.isNull() )
+ return s;
+ if ( !o->isWidgetType() )
+ return s;
+ TQWidget *w = (TQWidget*)o;
+ if ( w->icon() )
+ return *r->pixmapKeys.tqfind( w->icon()->serialNumber() );
+ return s;
+}
+
+void MetaDataBase::clearPixmapKeys( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->pixmapKeys.clear();
+}
+
+
+
+void MetaDataBase::setColumnFields( TQT_BASE_OBJECT_NAME *o, const TQMap<TQString, TQString> &columnFields )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->columnFields = columnFields;
+}
+
+TQMap<TQString, TQString> MetaDataBase::columnFields( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return TQMap<TQString, TQString>();
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQMap<TQString, TQString>();
+ }
+
+ return r->columnFields;
+}
+
+void MetaDataBase::setEditor( const TQStringList &langs )
+{
+ editorLangList = langs;
+}
+
+bool MetaDataBase::hasEditor( const TQString &lang )
+{
+ return editorLangList.tqfind( lang ) != editorLangList.end();
+}
+
+void MetaDataBase::setupInterfaceManagers( const TQString &plugDir )
+{
+ if ( !languageInterfaceManager ) {
+ languageInterfaceManager =
+ new TQPluginManager<LanguageInterface>( IID_Language,
+ TQApplication::libraryPaths(),
+ plugDir );
+
+ langList = languageInterfaceManager->featureList();
+ langList.remove( "C++" );
+ langList << "C++";
+ }
+}
+
+TQStringList MetaDataBase::languages()
+{
+ return langList;
+}
+
+TQString MetaDataBase::normalizeFunction( const TQString &f )
+{
+ return Parser::cleanArgs( f );
+}
+
+LanguageInterface *MetaDataBase::languageInterface( const TQString &lang )
+{
+ LanguageInterface* iface = 0;
+ languageInterfaceManager->queryInterface( lang, &iface );
+ return iface;
+}
+
+void MetaDataBase::clear( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ db->remove( (void*)o );
+ for ( TQPtrDictIterator<TQWidget> it( *( (FormWindow*)o )->widgets() ); it.current(); ++it )
+ db->remove( (void*)it.current() );
+}
+
+void MetaDataBase::setBreakPoints( TQT_BASE_OBJECT_NAME *o, const TQValueList<uint> &l )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->breakPoints = l;
+
+ TQMap<int, TQString>::Iterator it = r->breakPointConditions.begin();
+ while ( it != r->breakPointConditions.end() ) {
+ int line = it.key();
+ ++it;
+ if ( r->breakPoints.tqfind( line ) == r->breakPoints.end() )
+ r->breakPointConditions.remove( r->breakPointConditions.tqfind( line ) );
+ }
+}
+
+TQValueList<uint> MetaDataBase::breakPoints( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return TQValueList<uint>();
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQValueList<uint>();
+ }
+
+ return r->breakPoints;
+}
+
+void MetaDataBase::setBreakPointCondition( TQT_BASE_OBJECT_NAME *o, int line, const TQString &condition )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+ r->breakPointConditions.tqreplace( line, condition );
+}
+
+TQString MetaDataBase::breakPointCondition( TQT_BASE_OBJECT_NAME *o, int line )
+{
+ if ( !o )
+ return TQString();
+ setupDataBase();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return TQString();
+ }
+ TQMap<int, TQString>::Iterator it = r->breakPointConditions.tqfind( line );
+ if ( it == r->breakPointConditions.end() )
+ return TQString();
+ return *it;
+}
+
+void MetaDataBase::setExportMacro( TQT_BASE_OBJECT_NAME *o, const TQString &macro )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetExportMacro( macro );
+ return;
+ }
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return;
+ }
+
+ r->exportMacro = macro;
+}
+
+TQString MetaDataBase::exportMacro( TQT_BASE_OBJECT_NAME *o )
+{
+ if ( !o )
+ return "";
+ setupDataBase();
+ if ( TQT_TQOBJECT(o)->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdExportMacro();
+ MetaDataBaseRecord *r = db->tqfind( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, TQT_TQOBJECT(o)->name(), TQT_TQOBJECT(o)->className() );
+ return "";
+ }
+
+ return r->exportMacro;
+}
+
+bool MetaDataBase::hasObject( TQT_BASE_OBJECT_NAME *o )
+{
+ return !!db->tqfind( o );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/metadatabase.h b/tqtinterface/qt4/tools/designer/designer/metadatabase.h
new file mode 100644
index 0000000..08e01f5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/metadatabase.h
@@ -0,0 +1,276 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef METADATABASE_H
+#define METADATABASE_H
+
+#include <tqvariant.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
+#include <tqptrlist.h>
+#include <tqsizepolicy.h>
+#include <tqsize.h>
+#include <tqwidgetlist.h>
+#include <tqcursor.h>
+
+#include "pixmapchooser.h"
+#include "../interfaces/languageinterface.h"
+
+class TQObject;
+class TQPixmap;
+struct LanguageInterface;
+
+class MetaDataBase
+{
+public:
+ struct Connection
+ {
+ TQObject *sender, *receiver;
+ TQCString signal, slot;
+ bool operator==( const Connection &c ) const {
+ return sender == c.sender && receiver == c.receiver &&
+ signal == c.signal && slot == c.slot ;
+ }
+ };
+
+ struct Function
+ {
+ TQString returnType;
+ TQCString function;
+ TQString specifier;
+ TQString access;
+ TQString type;
+ TQString language;
+ bool operator==( const Function &f ) const {
+ return ( returnType == f.returnType &&
+ function == f.function &&
+ specifier == f.specifier &&
+ access == f.access &&
+ type == f.type &&
+ language == f.language
+ );
+ }
+ };
+
+ struct Property
+ {
+ TQCString property;
+ TQString type;
+ bool operator==( const Property &p ) const {
+ return property == p.property &&
+ type == p.type;
+ }
+ };
+
+ struct CustomWidget
+ {
+ CustomWidget();
+ CustomWidget( const CustomWidget &w );
+ ~CustomWidget() { delete pixmap; } // inlined to work around 2.7.2.3 bug
+ bool operator==( const CustomWidget &w ) const;
+ CustomWidget &operator=( const CustomWidget &w );
+
+ bool hasSignal( const TQCString &signal ) const;
+ bool hasSlot( const TQCString &slot ) const;
+ bool hasProperty( const TQCString &prop ) const;
+
+ enum IncludePolicy { Global, Local };
+ TQString className;
+ TQString includeFile;
+ IncludePolicy includePolicy;
+ TQSize tqsizeHint;
+ TQSizePolicy sizePolicy;
+ TQPixmap *pixmap;
+ TQValueList<TQCString> lstSignals;
+ TQValueList<Function> lstSlots;
+ TQValueList<Property> lstProperties;
+ int id;
+ bool isContainer;
+ };
+
+ struct Include
+ {
+ Include() : header(), location(), implDecl( "in implementation" ) {}
+ TQString header;
+ TQString location;
+ bool operator==( const Include &i ) const {
+ return header == i.header && location == i.location;
+ }
+ TQString implDecl;
+ };
+
+ struct Variable
+ {
+ TQString varName;
+ TQString varAccess;
+ bool operator==( const Variable &v ) const {
+ return varName == v.varName &&
+ varAccess == v.varAccess;
+ }
+ };
+
+ struct MetaInfo
+ {
+ MetaInfo() : classNameChanged( FALSE ) { }
+ TQString className;
+ bool classNameChanged;
+ TQString comment;
+ TQString author;
+ };
+
+ MetaDataBase();
+ static void clearDataBase();
+
+ static void addEntry( TQT_BASE_OBJECT_NAME *o );
+ static void removeEntry( TQT_BASE_OBJECT_NAME *o );
+ static void setPropertyChanged( TQT_BASE_OBJECT_NAME *o, const TQString &property, bool changed );
+ static bool isPropertyChanged( TQT_BASE_OBJECT_NAME *o, const TQString &property );
+ static void setPropertyComment( TQT_BASE_OBJECT_NAME *o, const TQString &property, const TQString &comment );
+ static TQString propertyComment( TQT_BASE_OBJECT_NAME *o, const TQString &property );
+ static TQStringList changedProperties( TQT_BASE_OBJECT_NAME *o );
+
+ static void setFakeProperty( TQT_BASE_OBJECT_NAME *o, const TQString &property, const TQVariant& value );
+ static TQVariant fakeProperty( TQT_BASE_OBJECT_NAME * o, const TQString &property );
+ static TQMap<TQString,TQVariant>* fakeProperties( TQT_BASE_OBJECT_NAME* o );
+
+ static void setSpacing( TQT_BASE_OBJECT_NAME *o, int spacing );
+ static int spacing( TQT_BASE_OBJECT_NAME *o );
+ static void setMargin( TQT_BASE_OBJECT_NAME *o, int margin );
+ static int margin( TQT_BASE_OBJECT_NAME *o );
+
+ static void setResizeMode( TQT_BASE_OBJECT_NAME *o, const TQString &mode );
+ static TQString resizeMode( TQT_BASE_OBJECT_NAME *o );
+
+ static void addConnection( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *sender, const TQCString &signal,
+ TQT_BASE_OBJECT_NAME *receiver, const TQCString &slot, bool addCode = TRUE );
+ static void removeConnection( TQT_BASE_OBJECT_NAME *o, TQObject *sender, const TQCString &signal,
+ TQObject *receiver, const TQCString &slot );
+ static bool hasConnection( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *sender, const TQCString &signal,
+ TQT_BASE_OBJECT_NAME *receiver, const TQCString &slot );
+ static void setupConnections( TQT_BASE_OBJECT_NAME *o, const TQValueList<LanguageInterface::Connection> &conns );
+ static TQValueList<Connection> connections( TQT_BASE_OBJECT_NAME *o );
+ static TQValueList<Connection> connections( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *sender, TQT_BASE_OBJECT_NAME *receiver );
+ static TQValueList<Connection> connections( TQT_BASE_OBJECT_NAME *o, TQT_BASE_OBJECT_NAME *object );
+ static void doConnections( TQT_BASE_OBJECT_NAME *o );
+
+ static void addFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function, const TQString &specifier,
+ const TQString &access, const TQString &type, const TQString &language,
+ const TQString &returnType );
+ static void removeFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function, const TQString &specifier,
+ const TQString &access, const TQString &type, const TQString &language,
+ const TQString &returnType );
+ static void removeFunction( TQT_BASE_OBJECT_NAME *o, const TQString &function );
+ static TQValueList<Function> functionList( TQT_BASE_OBJECT_NAME *o, bool onlyFunctions = FALSE );
+ static TQValueList<Function> slotList( TQT_BASE_OBJECT_NAME *o );
+ static bool isSlotUsed( TQT_BASE_OBJECT_NAME *o, const TQCString &slot );
+ static bool hasFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function, bool onlyCustom = FALSE );
+ static bool hasSlot( TQT_BASE_OBJECT_NAME *o, const TQCString &slot, bool onlyCustom = FALSE );
+ static void changeFunction( TQT_BASE_OBJECT_NAME *o, const TQString &function, const TQString &newName,
+ const TQString &returnType );
+ static void changeFunctionAttributes( TQT_BASE_OBJECT_NAME *o, const TQString &oldName, const TQString &newName,
+ const TQString &specifier, const TQString &access,
+ const TQString &type, const TQString &language,
+ const TQString &returnType );
+ static TQString languageOfFunction( TQT_BASE_OBJECT_NAME *o, const TQCString &function );
+ static void setFunctionList( TQT_BASE_OBJECT_NAME *o, const TQValueList<Function> &functionList );
+
+
+ static bool addCustomWidget( CustomWidget *w );
+ static void removeCustomWidget( CustomWidget *w );
+ static TQPtrList<CustomWidget> *customWidgets();
+ static CustomWidget *customWidget( int id );
+ static bool isWidgetNameUsed( CustomWidget *w );
+ static bool hasCustomWidget( const TQString &className );
+
+ static void setTabOrder( TQWidget *w, const TQWidgetList &order );
+ static TQWidgetList tabOrder( TQWidget *w );
+
+ static void setIncludes( TQT_BASE_OBJECT_NAME *o, const TQValueList<Include> &incs );
+ static TQValueList<Include> includes( TQT_BASE_OBJECT_NAME *o );
+
+ static void setForwards( TQT_BASE_OBJECT_NAME *o, const TQStringList &fwds );
+ static TQStringList forwards( TQT_BASE_OBJECT_NAME *o );
+
+ static void setVariables( TQT_BASE_OBJECT_NAME *o, const TQValueList<Variable> &vars );
+ static void addVariable( TQT_BASE_OBJECT_NAME *o, const TQString &name, const TQString &access );
+ static void removeVariable( TQT_BASE_OBJECT_NAME *o, const TQString &name );
+ static TQValueList<Variable> variables( TQT_BASE_OBJECT_NAME *o );
+ static bool hasVariable( TQT_BASE_OBJECT_NAME *o, const TQString &name );
+ static TQString extractVariableName( const TQString &name );
+
+ static void setSignalList( TQT_BASE_OBJECT_NAME *o, const TQStringList &sigs );
+ static TQStringList signalList( TQT_BASE_OBJECT_NAME *o );
+
+ static void setMetaInfo( TQT_BASE_OBJECT_NAME *o, MetaInfo mi );
+ static MetaInfo metaInfo( TQT_BASE_OBJECT_NAME *o );
+
+ static void setCursor( TQWidget *w, const TQCursor &c );
+ static TQCursor cursor( TQWidget *w );
+
+ static void setPixmapArgument( TQT_BASE_OBJECT_NAME *o, int pixmap, const TQString &arg );
+ static TQString pixmapArgument( TQT_BASE_OBJECT_NAME *o, int pixmap );
+ static void clearPixmapArguments( TQT_BASE_OBJECT_NAME *o );
+
+ static void setPixmapKey( TQT_BASE_OBJECT_NAME *o, int pixmap, const TQString &arg );
+ static TQString pixmapKey( TQT_BASE_OBJECT_NAME *o, int pixmap );
+ static void clearPixmapKeys( TQT_BASE_OBJECT_NAME *o );
+
+ static void setColumnFields( TQT_BASE_OBJECT_NAME *o, const TQMap<TQString, TQString> &columnFields );
+ static TQMap<TQString, TQString> columnFields( TQT_BASE_OBJECT_NAME *o );
+
+ static void setEditor( const TQStringList &langs );
+ static bool hasEditor( const TQString &lang );
+
+ static void setupInterfaceManagers( const TQString &plugDir );
+ static TQStringList languages();
+
+ static LanguageInterface *languageInterface( const TQString &lang );
+
+ static TQString normalizeFunction( const TQString &f );
+
+ static void clear( TQT_BASE_OBJECT_NAME *o );
+
+ static void setBreakPoints( TQT_BASE_OBJECT_NAME *o, const TQValueList<uint> &l );
+ static void setBreakPointCondition( TQT_BASE_OBJECT_NAME *o, int line, const TQString &condition );
+ static TQValueList<uint> breakPoints( TQT_BASE_OBJECT_NAME *o );
+ static TQString breakPointCondition( TQT_BASE_OBJECT_NAME *o, int line );
+
+ static void setExportMacro( TQT_BASE_OBJECT_NAME *o, const TQString &macro );
+ static TQString exportMacro( TQT_BASE_OBJECT_NAME *o );
+
+ static bool hasObject( TQT_BASE_OBJECT_NAME *o );
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/multilineeditor.ui b/tqtinterface/qt4/tools/designer/designer/multilineeditor.ui
new file mode 100644
index 0000000..87d4603
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/multilineeditor.ui
@@ -0,0 +1,188 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MultiLineEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2002-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQMainWindow">
+ <property name="name">
+ <cstring>MultiLineEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>598</width>
+ <height>307</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Multiline Edit&lt;/b&gt;&lt;p&gt;This is a simple richtext editor. For an easier working, it provides the most common html tags in form of toolbar items respectively shortcuts. By clicking on such an icon, the regarding tag will be written to the editor and you can insert your text. If you have already written a text and want to format it, just mark it and click on the wished tag button. For a better visualization this editor supports also a simple html syntax highlighting.</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>OkButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="on">
+ <bool>false</bool>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>applyButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menuBar</cstring>
+ </property>
+</menubar>
+<toolbars>
+</toolbars>
+<connections>
+ <connection>
+ <sender>OkButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MultiLineEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>applyButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MultiLineEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MultiLineEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+</connections>
+<Q_SLOTS>
+ <slot>applyClicked()</slot>
+ <slot>okClicked()</slot>
+ <slot>cancelClicked()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.cpp
new file mode 100644
index 0000000..d8a1ff2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.cpp
@@ -0,0 +1,417 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "multilineeditorimpl.h"
+#include "formwindow.h"
+#include "command.h"
+#include "mainwindow.h"
+#include "richtextfontdialog.h"
+#include "syntaxhighlighter_html.h"
+#include "widgetfactory.h"
+
+#include <tqtextedit.h>
+#include <./private/tqrichtext_p.h>
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+#include <tqtoolbutton.h>
+#include <tqapplication.h>
+#include <tqaction.h>
+#include <tqmetaobject.h>
+
+ToolBarItem::ToolBarItem( TQWidget *tqparent, TQWidget *toolBar,
+ const TQString &label, const TQString &tagstr,
+ const TQIconSet &icon, const TQKeySequence &key )
+ : TQAction( tqparent )
+{
+ setIconSet( icon );
+ setText( label );
+ setAccel( key );
+ addTo( toolBar );
+ tag = tagstr;
+ connect( this, TQT_SIGNAL( activated() ), this, TQT_SLOT( wasActivated() ) );
+}
+
+ToolBarItem::~ToolBarItem()
+{
+
+}
+
+void ToolBarItem::wasActivated()
+{
+ emit clicked( tag );
+}
+
+TextEdit::TextEdit( TQWidget *tqparent, const char *name )
+ : TQTextEdit( tqparent, name )
+{
+ setTextFormat( TQt::PlainText );
+}
+
+TQTextParagraph* TextEdit::paragraph()
+{
+ TQTextCursor *tc = new TQTextCursor( TQTextEdit::document() );
+ return tc->paragraph();
+}
+
+
+MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget *tqparent, TQWidget *editWidget,
+ FormWindow *fw, const TQString &text )
+ : MultiLineEditorBase( tqparent, 0, (WFlags)(TQt::WType_Dialog | TQt::WShowModal) ), formwindow( fw ), doWrap( FALSE )
+{
+ callStatic = call_static;
+
+ if ( callStatic )
+ applyButton->hide();
+
+ textEdit = new TextEdit( centralWidget(), "textedit" );
+ Layout4->insertWidget( 0, textEdit );
+
+ if ( richtextMode ) {
+ TQPopupMenu *stylesMenu = new TQPopupMenu( this );
+ menuBar->insertItem( tr( "&Styles" ), stylesMenu );
+
+ basicToolBar = new TQToolBar( tr( "Basics" ), this, TQt::DockTop );
+
+ ToolBarItem *it = new ToolBarItem( this, basicToolBar, tr( "Italic" ),
+ "i", TQPixmap::fromMimeSource( "designer_textitalic.png" ), Qt::CTRL+Qt::Key_I );
+ it->addTo( stylesMenu );
+ connect( it, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *b = new ToolBarItem( this, basicToolBar, tr( "Bold" ),
+ "b", TQPixmap::fromMimeSource( "designer_textbold.png" ), Qt::CTRL+Qt::Key_B );
+ b->addTo( stylesMenu );
+ connect( b, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *ul = new ToolBarItem( this, basicToolBar, tr( "Underline" ),
+ "u", TQPixmap::fromMimeSource( "designer_textunderline.png" ), Qt::CTRL+Qt::Key_U );
+ ul->addTo( stylesMenu );
+ connect( ul, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *tt = new ToolBarItem( this, basicToolBar, tr( "Typewriter" ),
+ "tt", TQPixmap::fromMimeSource( "designer_textteletext.png" ) );
+ tt->addTo( stylesMenu );
+ connect( tt, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ basicToolBar->addSeparator();
+
+ TQPopupMenu *layoutMenu = new TQPopupMenu( this );
+ menuBar->insertItem( tr( "&Layout" ), layoutMenu );
+
+ TQAction *brAction = new TQAction( this );
+ brAction->setIconSet( TQPixmap::fromMimeSource( "designer_textlinebreak.png" ) );
+ brAction->setText( tr("Break" ) );
+ brAction->addTo( basicToolBar );
+ brAction->addTo( layoutMenu );
+ connect( brAction, TQT_SIGNAL( activated() ) , this, TQT_SLOT( insertBR() ) );
+
+ ToolBarItem *p = new ToolBarItem( this, basicToolBar, tr( "Paragraph" ),
+ "p", TQPixmap::fromMimeSource( "designer_textparagraph.png" ) );
+ p->addTo( layoutMenu );
+ connect( p, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+ layoutMenu->insertSeparator();
+ basicToolBar->addSeparator();
+
+ ToolBarItem *al = new ToolBarItem( this, basicToolBar, tr( "Align left" ),
+ "p align=\"left\"", TQPixmap::fromMimeSource( "designer_textleft.png" ) );
+ al->addTo( layoutMenu );
+ connect( al, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *ac = new ToolBarItem( this, basicToolBar, tr( "Align center" ),
+ "p align=\"center\"", TQPixmap::fromMimeSource( "designer_textcenter.png" ) );
+ ac->addTo( layoutMenu );
+ connect( ac, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *ar = new ToolBarItem( this, basicToolBar, tr( "Align right" ),
+ "p align=\"right\"", TQPixmap::fromMimeSource( "designer_textright.png" ) );
+ ar->addTo( layoutMenu );
+ connect( ar, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *block = new ToolBarItem( this, basicToolBar, tr( "Blockquote" ),
+ "blockquote", TQPixmap::fromMimeSource( "designer_textjustify.png" ) );
+ block->addTo( layoutMenu );
+ connect( block, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+
+ TQPopupMenu *fontMenu = new TQPopupMenu( this );
+ menuBar->insertItem( tr( "&Font" ), fontMenu );
+
+ fontToolBar = new TQToolBar( "Fonts", this, TQt::DockTop );
+
+ TQAction *fontAction = new TQAction( this );
+ fontAction->setIconSet( TQPixmap::fromMimeSource( "designer_textfont.png" ) );
+ fontAction->setText( tr("Font" ) );
+ fontAction->addTo( fontToolBar );
+ fontAction->addTo( fontMenu );
+ connect( fontAction, TQT_SIGNAL( activated() ) , this, TQT_SLOT( showFontDialog() ) );
+
+
+ ToolBarItem *fp1 = new ToolBarItem( this, fontToolBar, tr( "Fontsize +1" ),
+ "font size=\"+1\"", TQPixmap::fromMimeSource( "designer_textlarger.png" ) );
+ connect( fp1, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *fm1 = new ToolBarItem( this, fontToolBar, tr( "Fontsize -1" ),
+ "font size=\"-1\"", TQPixmap::fromMimeSource( "designer_textsmaller.png" ) );
+ connect( fm1, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *h1 = new ToolBarItem( this, fontToolBar, tr( "Headline 1" ),
+ "h1", TQPixmap::fromMimeSource( "designer_texth1.png" ) );
+ connect( h1, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *h2 = new ToolBarItem( this, fontToolBar, tr( "Headline 2" ),
+ "h2", TQPixmap::fromMimeSource( "designer_texth2.png" ) );
+ connect( h2, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ ToolBarItem *h3 = new ToolBarItem( this, fontToolBar, tr( "Headline 3" ),
+ "h3", TQPixmap::fromMimeSource( "designer_texth3.png" ) );
+ connect( h3, TQT_SIGNAL( clicked( const TQString& ) ),
+ this, TQT_SLOT( insertTags( const TQString& )));
+
+ TQPopupMenu *optionsMenu = new TQPopupMenu( this );
+ menuBar->insertItem( tr( "O&ptions" ), optionsMenu );
+
+ optionsToolBar = new TQToolBar( "Options", this, TQt::DockTop );
+ wrapAction = new TQAction( this );
+ wrapAction->setToggleAction( TRUE );
+ wrapAction->setIconSet( TQPixmap::fromMimeSource( "designer_wordwrap.png" ) );
+ wrapAction->setText( tr( "Word Wrapping" ) );
+ wrapAction->addTo( optionsToolBar );
+ wrapAction->addTo( optionsMenu );
+ connect( wrapAction, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( changeWrapMode( bool ) ) );
+
+ oldDoWrap = doWrap;
+ wrapAction->setOn( doWrap );
+
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ textEdit->document()->setFormatter( new TQTextFormatterBreakInWords );
+ textEdit->document()->setUseFormatCollection( FALSE );
+ textEdit->document()->setPreProcessor( new SyntaxHighlighter_HTML );
+
+ if ( !callStatic && ::tqqt_cast<TQTextEdit*>(editWidget) ) {
+ mlined = (TQTextEdit*)editWidget;
+ mlined->setReadOnly( TRUE );
+
+ const TQMetaProperty *wordWrap = mlined->tqmetaObject()->property(
+ mlined->tqmetaObject()->tqfindProperty( "wordWrap", TRUE ), TRUE );
+ oldWrapMode = 0;
+ oldWrapString = "NoWrap";
+ if ( wordWrap ) {
+ oldWrapMode = TQT_TQVARIANT_OBJECT(mlined->property( "wordWrap" ));
+ oldWrapString = TQString( wordWrap->valueToKey( oldWrapMode.toInt() ) );
+ if ( oldWrapString != "NoWrap" )
+ doWrap = TRUE;
+ }
+ textEdit->tqsetAlignment( mlined->tqalignment() );
+ textEdit->setWordWrap( mlined->wordWrap() );
+ textEdit->setWrapColumnOrWidth( mlined->wrapColumnOrWidth() );
+ textEdit->setWrapPolicy( mlined->wrapPolicy() );
+ textEdit->setText( mlined->text() );
+ if ( !mlined->text().isEmpty() )
+ textEdit->selectAll();
+ } else {
+ textEdit->setText( text );
+ textEdit->selectAll();
+ }
+ } else {
+ textEdit->setText( text );
+ textEdit->selectAll();
+ }
+ textEdit->setFocus();
+}
+
+int MultiLineEditor::exec()
+{
+ res = 1;
+ show();
+ tqApp->enter_loop();
+ return res;
+}
+
+void MultiLineEditor::okClicked()
+{
+ applyClicked();
+ close();
+}
+
+void MultiLineEditor::applyClicked()
+{
+ if ( !callStatic ) {
+ PopulateMultiLineEditCommand *cmd = new PopulateMultiLineEditCommand( tr( "Set the text of '%1'" ).arg( mlined->name() ),
+ formwindow, mlined, textEdit->text() );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+
+ if ( oldDoWrap != doWrap ) {
+ TQString pn( tr( "Set 'wordWrap' of '%2'" ).arg( mlined->name() ) );
+ SetPropertyCommand *propcmd;
+ if ( doWrap )
+ propcmd = new SetPropertyCommand( pn, formwindow,
+ mlined, MainWindow::self->propertyeditor(),
+ "wordWrap", WidgetFactory::property( mlined, "wordWrap" ),
+ TQVariant( 1 ), "WidgetWidth", oldWrapString );
+ else
+ propcmd = new SetPropertyCommand( pn, formwindow,
+ mlined, MainWindow::self->propertyeditor(),
+ "wordWrap", WidgetFactory::property( mlined, "wordWrap" ),
+ TQVariant( 0 ), "NoWrap", oldWrapString );
+
+ propcmd->execute();
+ formwindow->commandHistory()->addCommand( propcmd, TRUE );
+ }
+ textEdit->setFocus();
+ }
+ else {
+ staticText = textEdit->text();
+ }
+}
+
+void MultiLineEditor::cancelClicked()
+{
+ res = 0;
+ close();
+}
+
+void MultiLineEditor::closeEvent( TQCloseEvent *e )
+{
+ tqApp->exit_loop();
+ MultiLineEditorBase::closeEvent( e );
+}
+
+void MultiLineEditor::insertTags( const TQString &tag )
+{
+ int pfrom, pto, ifrom, ito;
+ TQString tagend( tag.simplifyWhiteSpace() );
+ tagend.remove( tagend.tqfind( ' ', 0 ), tagend.length() );
+ if ( textEdit->hasSelectedText() ) {
+ textEdit->getSelection( &pfrom, &ifrom, &pto, &ito );
+ TQString buf = textEdit->selectedText();
+ buf = TQString( "<%1>%3</%2>" ).arg( tag ).arg( tagend ).arg( buf );
+ textEdit->removeSelectedText();
+ textEdit->insertAt( buf, pfrom, ifrom );
+ textEdit->setCursorPosition( pto, ito + 2 + tag.length() );
+ }
+ else {
+ int para, index;
+ textEdit->getCursorPosition( &para, &index );
+ textEdit->insert( TQString( "<%1></%2>" ).arg( tag ).arg( tagend ) );
+ index += 2 + tag.length();
+ textEdit->setCursorPosition( para, index );
+ }
+}
+
+void MultiLineEditor::insertBR()
+{
+ textEdit->insert( "<br>" );
+}
+
+void MultiLineEditor::showFontDialog()
+{
+ bool selText = FALSE;
+ int pfrom, pto, ifrom, ito;
+ if ( textEdit->hasSelectedText() ) {
+ textEdit->getSelection( &pfrom, &ifrom, &pto, &ito );
+ selText = TRUE;
+ }
+ RichTextFontDialog *fd = new RichTextFontDialog( this );
+ if ( fd->exec() == TQDialog::Accepted ) {
+ TQString size, font;
+ if ( fd->getSize() != "0" )
+ size = "size=\"" + fd->getSize() + "\"";
+ TQString color;
+ if ( !fd->getColor().isEmpty() && fd->getColor() != "#000000" )
+ color = "color=\"" + fd->getColor() + "\"";
+ if ( fd->getFont() != "default" )
+ font = "face=\"" + fd->getFont() + "\"";
+ TQString tag( TQString( "font %1 %2 %3" )
+ .arg( color ).arg( size ).arg( font ) );
+
+ if ( selText )
+ textEdit->setSelection( pfrom, ifrom, pto, ito );
+ insertTags( tag.simplifyWhiteSpace() );
+ }
+ else if ( selText )
+ textEdit->setSelection( pfrom, ifrom, pto, ito );
+}
+
+TQString MultiLineEditor::getStaticText()
+{
+ return staticText.stripWhiteSpace();
+}
+
+TQString MultiLineEditor::getText( TQWidget *tqparent, const TQString &text, bool richtextMode, bool *useWrap )
+{
+ MultiLineEditor medit( TRUE, richtextMode, tqparent, 0, 0, text );
+ if ( richtextMode )
+ medit.setUseWrapping( *useWrap );
+ if ( medit.exec() == TQDialog::Accepted ) {
+ *useWrap = medit.useWrapping();
+ return medit.getStaticText();
+ }
+ return TQString();
+}
+
+void MultiLineEditor::changeWrapMode( bool b )
+{
+ doWrap = b;
+ if ( doWrap && !callStatic ) {
+ if ( oldDoWrap )
+ textEdit->setProperty( "wordWrap", oldWrapMode );
+ else
+ textEdit->setWordWrap( TQTextEdit::WidgetWidth );
+ } else {
+ textEdit->setWordWrap( TQTextEdit::NoWrap );
+ }
+}
+
+bool MultiLineEditor::useWrapping() const
+{
+ return doWrap;
+}
+
+void MultiLineEditor::setUseWrapping( bool b )
+{
+ doWrap = b;
+ wrapAction->setOn( doWrap );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.h b/tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.h
new file mode 100644
index 0000000..1af9680
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/multilineeditorimpl.h
@@ -0,0 +1,119 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef MULTILINEEDITORIMPL_H
+#define MULTILINEEDITORIMPL_H
+
+#include <tqaction.h>
+#include <tqtextedit.h>
+#include <private/tqrichtext_p.h>
+#include "multilineeditor.h"
+
+class FormWindow;
+class TQToolBar;
+class TQTextDocument;
+
+class TextEdit : public TQTextEdit
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TextEdit( TQWidget *tqparent = 0, const char *name = 0 );
+ TQTextDocument *document() const { return TQTextEdit::document(); }
+ TQTextParagraph *paragraph();
+
+};
+
+class ToolBarItem : public TQAction
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ToolBarItem( TQWidget *tqparent, TQWidget *toolBar,
+ const TQString &label, const TQString &tagstr,
+ const TQIconSet &icon, const TQKeySequence &key = 0 );
+ ~ToolBarItem();
+Q_SIGNALS:
+ void clicked( const TQString &t );
+
+protected Q_SLOTS:
+ void wasActivated();
+private:
+ TQString tag;
+};
+
+
+class MultiLineEditor : public MultiLineEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ MultiLineEditor( bool call_static, bool richtextMode, TQWidget *tqparent, TQWidget *editWidget,
+ FormWindow *fw, const TQString &text = TQString() );
+ bool useWrapping() const;
+ void setUseWrapping( bool );
+ static TQString getText( TQWidget *tqparent, const TQString &text, bool richtextMode, bool *useWrap );
+ int exec();
+
+protected Q_SLOTS:
+ void okClicked();
+ void applyClicked();
+ void cancelClicked();
+ void insertTags( const TQString& );
+ void insertBR();
+ void showFontDialog();
+ void changeWrapMode( bool );
+
+ void closeEvent( TQCloseEvent *e );
+
+private:
+ TQString getStaticText();
+ TextEdit *textEdit;
+ TQTextEdit *mlined;
+ FormWindow *formwindow;
+ TQToolBar *basicToolBar;
+ TQToolBar *fontToolBar;
+ TQToolBar *optionsToolBar;
+ TQAction *wrapAction;
+ int res;
+ TQString staticText;
+ bool callStatic;
+ bool oldDoWrap, doWrap;
+ TQVariant oldWrapMode;
+ TQString oldWrapString;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/newform.ui b/tqtinterface/qt4/tools/designer/designer/newform.ui
new file mode 100644
index 0000000..ea28f3c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/newform.ui
@@ -0,0 +1,245 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>NewFormBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>NewFormBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>557</width>
+ <height>436</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New File</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;New Form&lt;/b&gt;&lt;p&gt;Select a template for the new form and click the &lt;b&gt;OK&lt;/b&gt;-button to create it.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Create a new form using the selected template.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog without creating a new form.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQIconView" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>templateView</cstring>
+ </property>
+ <property name="gridX">
+ <number>120</number>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ <property name="wordWrapIconText">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displays a list of the available templates.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelProject</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert into:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>projectCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>projectCombo</cstring>
+ </property>
+ </widget>
+ <spacer row="0" column="2">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>projectCombo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>projectChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>currentChanged(TQIconViewItem*)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>itemChanged(TQIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>doubleClicked(TQIconViewItem*)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>returnPressed(TQIconViewItem*)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>templateView</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">itemChanged( TQIconViewItem * )</slot>
+ <slot access="protected">projectChanged( const QString &amp; )</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/newformimpl.cpp b/tqtinterface/qt4/tools/designer/designer/newformimpl.cpp
new file mode 100644
index 0000000..1192529
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/newformimpl.cpp
@@ -0,0 +1,418 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "newformimpl.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "project.h"
+#include "formwindow.h"
+#include "widgetfactory.h"
+#include "widgetdatabase.h"
+#include "actioneditorimpl.h"
+#include "hierarchyview.h"
+#include "resource.h"
+#include "projectsettingsimpl.h"
+#include "sourcefile.h"
+
+#include <tqiconview.h>
+#include <tqlabel.h>
+#include <tqfileinfo.h>
+#include <tqdir.h>
+#include <tqpushbutton.h>
+#include <stdlib.h>
+#include <tqcombobox.h>
+#include <tqworkspace.h>
+#include <tqmessagebox.h>
+
+static int forms = 0;
+
+ProjectItem::ProjectItem( TQIconView *view, const TQString &text )
+ : NewItem( view, text )
+{
+}
+
+void ProjectItem::insert( Project * )
+{
+ MainWindow::self->createNewProject( lang );
+}
+
+
+
+FormItem::FormItem( TQIconView *view, const TQString &text )
+ : NewItem( view, text )
+{
+}
+
+void FormItem::insert( Project *pro )
+{
+ TQString n = "Form" + TQString::number( ++forms );
+ FormWindow *fw = 0;
+ FormFile *ff = new FormFile( FormFile::createUnnamedFileName(), TRUE, pro );
+ fw = new FormWindow( ff, MainWindow::self, MainWindow::self->qWorkspace(), n );
+ fw->setProject( pro );
+ MetaDataBase::addEntry( fw );
+ if ( fType == Widget ) {
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQWidget" ),
+ fw, n.latin1() );
+ fw->setMainContainer( w );
+ } else if ( fType == Dialog ) {
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQDialog" ), fw, n.latin1() );
+ fw->setMainContainer( w );
+ } else if ( fType == Wizard ) {
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQWizard" ),
+ fw, n.latin1() );
+ fw->setMainContainer( w );
+ } else if ( fType == MainWindow ) {
+ TQWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQMainWindow" ),
+ fw, n.latin1() );
+ fw->setMainContainer( w );
+ }
+
+ fw->setCaption( n );
+ fw->resize( 600, 480 );
+ MainWindow::self->insertFormWindow( fw );
+
+ TemplateWizardInterface *iface =
+ MainWindow::self->templateWizardInterface( fw->mainContainer()->className() );
+ if ( iface ) {
+ iface->setup( fw->mainContainer()->className(), fw->mainContainer(),
+ fw->iFace(), MainWindow::self->designerInterface() );
+ iface->release();
+ }
+
+ // the wizard might have changed a lot, lets update everything
+ MainWindow::self->actioneditor()->setFormWindow( fw );
+ MainWindow::self->objectHierarchy()->setFormWindow( fw, TQT_TQOBJECT(fw) );
+ MainWindow::self->objectHierarchy()->formDefinitionView()->refresh();
+ MainWindow::self->objectHierarchy()->rebuild();
+ fw->killAccels( fw );
+ fw->project()->setModified( TRUE );
+ fw->setFocus();
+ if ( !pro->isDummy() ) {
+ fw->setSavePixmapInProject( TRUE );
+ fw->setSavePixmapInline( FALSE );
+ }
+}
+
+
+
+CustomFormItem::CustomFormItem( TQIconView *view, const TQString &text )
+ : NewItem( view, text )
+{
+}
+
+static void unifyFormName( FormWindow *fw, TQWorkspace *qworkspace )
+{
+ TQStringList lst;
+ TQWidgetList windows = qworkspace->windowList();
+ for ( TQWidget *w =windows.first(); w; w = windows.next() ) {
+ if ( w == fw )
+ continue;
+ lst << w->name();
+ }
+
+ if ( lst.tqfindIndex( fw->name() ) == -1 )
+ return;
+ TQString origName = fw->name();
+ TQString n = origName;
+ int i = 1;
+ while ( lst.tqfindIndex( n ) != -1 ) {
+ n = origName + TQString::number( i++ );
+ }
+ fw->setName( n );
+ fw->setCaption( n );
+}
+
+void CustomFormItem::insert( Project *pro )
+{
+ TQString filename = templateFileName();
+ if ( !filename.isEmpty() && TQFile::exists( filename ) ) {
+ Resource resource( MainWindow::self );
+ FormFile *ff = new FormFile( filename, TRUE, pro );
+ if ( !resource.load( ff ) ) {
+ TQMessageBox::information( MainWindow::self, MainWindow::tr("Load Template"),
+ MainWindow::tr("Couldn't load form description from template '" +
+ filename + "'" ) );
+ delete ff;
+ return;
+ }
+ ff->setFileName( TQString() );
+ if ( MainWindow::self->formWindow() ) {
+ MainWindow::self->formWindow()->setFileName( TQString() );
+ unifyFormName( MainWindow::self->formWindow(), MainWindow::self->qWorkspace() );
+ if ( !pro->isDummy() ) {
+ MainWindow::self->formWindow()->setSavePixmapInProject( TRUE );
+ MainWindow::self->formWindow()->setSavePixmapInline( FALSE );
+ }
+ }
+ }
+}
+
+
+
+SourceFileItem::SourceFileItem( TQIconView *view, const TQString &text )
+ : NewItem( view, text ), visible( TRUE )
+{
+}
+
+void SourceFileItem::insert( Project *pro )
+{
+ SourceFile *f = new SourceFile( SourceFile::createUnnamedFileName( ext ), TRUE, pro );
+ MainWindow::self->editSource( f );
+}
+
+void SourceFileItem::setProject( Project *pro )
+{
+ TQIconView *iv = iconView();
+ bool v = lang == pro->language();
+ if ( !iv || v == visible )
+ return;
+ visible = v;
+ if ( !visible )
+ iv->takeItem( this );
+ else
+ iv->insertItem( this );
+}
+
+
+
+SourceTemplateItem::SourceTemplateItem( TQIconView *view, const TQString &text )
+ : NewItem( view, text ), visible( TRUE )
+{
+}
+
+void SourceTemplateItem::insert( Project *pro )
+{
+ SourceTemplateInterface *siface = MainWindow::self->sourceTemplateInterface( text() );
+ if ( !siface )
+ return;
+ SourceTemplateInterface::Source src = siface->create( text(), MainWindow::self->designerInterface() );
+ SourceFile *f = 0;
+ if ( src.type == SourceTemplateInterface::Source::Invalid )
+ return;
+ if ( src.type == SourceTemplateInterface::Source::FileName )
+ f = new SourceFile( src.filename, FALSE, pro );
+ else
+ f = new SourceFile( SourceFile::createUnnamedFileName( src.extension ), TRUE, pro );
+ if ( f->isAccepted()) {
+ f->setText( src.code );
+ MainWindow::self->editSource( f );
+ f->setModified( TRUE );
+ } else {
+ delete f;
+ }
+}
+
+void SourceTemplateItem::setProject( Project *pro )
+{
+ TQIconView *iv = iconView();
+ bool v = !pro->isDummy() && lang == pro->language();
+ if ( !iv || v == visible )
+ return;
+ visible = v;
+ if ( !visible )
+ iv->takeItem( this );
+ else
+ iv->insertItem( this );
+}
+
+void NewForm::insertTemplates( TQIconView *tView,
+ const TQString &templatePath )
+{
+ TQStringList::Iterator it;
+ TQStringList languages = MetaDataBase::languages();
+ if ( !MainWindow::self->singleProjectMode() ) {
+ for ( it = languages.begin(); it != languages.end(); ++it ) {
+ ProjectItem *pi = new ProjectItem( tView, *it + " " + tr( "Project" ) );
+ allItems.append( pi );
+ pi->setLanguage( *it );
+ pi->setPixmap( TQPixmap::fromMimeSource( "designer_project.png" ) );
+ pi->setDragEnabled( FALSE );
+ }
+ }
+ TQIconViewItem *cur = 0;
+ FormItem *fi = new FormItem( tView,tr( "Dialog" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::Dialog );
+ fi->setPixmap( TQPixmap::fromMimeSource( "designer_newform.png" ) );
+ fi->setDragEnabled( FALSE );
+ cur = fi;
+ if ( !MainWindow::self->singleProjectMode() ) {
+ fi = new FormItem( tView,tr( "Wizard" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::Wizard );
+ fi->setPixmap( TQPixmap::fromMimeSource( "designer_newform.png" ) );
+ fi->setDragEnabled( FALSE );
+ fi = new FormItem( tView, tr( "Widget" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::Widget );
+ fi->setPixmap( TQPixmap::fromMimeSource( "designer_newform.png" ) );
+ fi->setDragEnabled( FALSE );
+ fi = new FormItem( tView, tr( "Main Window" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::MainWindow );
+ fi->setPixmap( TQPixmap::fromMimeSource( "designer_newform.png" ) );
+ fi->setDragEnabled( FALSE );
+
+ TQString templPath = templatePath;
+ TQStringList templRoots;
+ const char *qtdir = getenv( "TQTDIR" );
+ if(qtdir)
+ templRoots << qtdir;
+ templRoots << qInstallPathData();
+ if(qtdir) //try the tools/designer directory last!
+ templRoots << (TQString(qtdir) + "/tools/designer");
+ for ( TQStringList::Iterator it = templRoots.begin(); it != templRoots.end(); ++it ) {
+ TQString path = (*it) + "/templates";
+ if ( TQFile::exists( path )) {
+ templPath = path;
+ break;
+ }
+ }
+ if ( !templPath.isEmpty() ) {
+ TQDir dir( templPath );
+ const TQFileInfoList *filist = dir.entryInfoList( TQDir::DefaultFilter, TQDir::DirsFirst | TQDir::Name );
+ if ( filist ) {
+ TQFileInfoListIterator it( *filist );
+ TQFileInfo *fi;
+ while ( ( fi = it.current() ) != 0 ) {
+ ++it;
+ if ( !fi->isFile() || fi->extension() != "ui" )
+ continue;
+ TQString name = fi->baseName();
+ name = name.tqreplace( '_', ' ' );
+ CustomFormItem *ci = new CustomFormItem( tView, name );
+ allItems.append( ci );
+ ci->setDragEnabled( FALSE );
+ ci->setPixmap( TQPixmap::fromMimeSource( "designer_newform.png" ) );
+ ci->setTemplateFile( fi->absFilePath() );
+ }
+ }
+ }
+ }
+
+ for ( it = languages.begin(); it != languages.end(); ++it ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( *it );
+ if ( iface ) {
+ TQMap<TQString, TQString> extensionMap;
+ iface->preferedExtensions( extensionMap );
+ for ( TQMap<TQString, TQString>::Iterator eit = extensionMap.begin();
+ eit != extensionMap.end(); ++eit ) {
+ SourceFileItem * si = new SourceFileItem( tView, *eit );
+ allItems.append( si );
+ si->setExtension( eit.key() );
+ si->setLanguage( *it );
+ si->setPixmap( TQPixmap::fromMimeSource( "designer_filenew.png" ) );
+ si->setDragEnabled( FALSE );
+ }
+ iface->release();
+ }
+ }
+
+ if ( !MainWindow::self->singleProjectMode() ) {
+ TQStringList sourceTemplates = MainWindow::self->sourceTemplates();
+ for ( TQStringList::Iterator sit = sourceTemplates.begin(); sit != sourceTemplates.end(); ++sit ) {
+ SourceTemplateInterface *siface = MainWindow::self->sourceTemplateInterface( *sit );
+ if ( !siface )
+ continue;
+ SourceTemplateItem * si = new SourceTemplateItem( tView, *sit );
+ allItems.append( si );
+ si->setTemplate( *sit );
+ si->setLanguage( siface->language( *sit ) );
+ si->setPixmap( TQPixmap::fromMimeSource( "designer_filenew.png" ) );
+ si->setDragEnabled( FALSE );
+ siface->release();
+ }
+ }
+
+ tView->viewport()->setFocus();
+ tView->setCurrentItem( cur );
+
+ if ( MainWindow::self->singleProjectMode() )
+ adjustSize();
+}
+
+NewForm::NewForm( TQIconView *templateView, const TQString &templatePath )
+{
+ insertTemplates( templateView, templatePath );
+ projectChanged( tr( "<No Project>" ) );
+}
+
+NewForm::NewForm( TQWidget *tqparent, const TQStringList& projects,
+ const TQString& currentProject, const TQString &templatePath )
+ : NewFormBase( tqparent, 0, TRUE )
+{
+ connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+
+ projectCombo->insertStringList( projects );
+ projectCombo->setCurrentText( currentProject );
+
+ insertTemplates( templateView, templatePath );
+
+ projectChanged( projectCombo->currentText() );
+}
+
+void NewForm::accept()
+{
+ if ( !templateView->currentItem() )
+ return;
+ Project *pro = MainWindow::self->tqfindProject( projectCombo->currentText() );
+ if ( !pro )
+ return;
+ MainWindow::self->setCurrentProject( pro );
+ NewFormBase::accept();
+ ( (NewItem*)templateView->currentItem() )->insert( pro );
+}
+
+void NewForm::projectChanged( const TQString &project )
+{
+ Project *pro = MainWindow::self->tqfindProject( project );
+ if ( !pro )
+ return;
+ TQIconViewItem *i;
+ for ( i = allItems.first(); i; i = allItems.next() )
+ ( (NewItem*)i )->setProject( pro );
+ templateView->setCurrentItem( templateView->firstItem() );
+ templateView->arrangeItemsInGrid( TRUE );
+}
+
+void NewForm::itemChanged( TQIconViewItem *item )
+{
+ labelProject->setEnabled( item->rtti() != NewItem::ProjectType );
+ projectCombo->setEnabled( item->rtti() != NewItem::ProjectType );
+}
+
+TQPtrList<TQIconViewItem> NewForm::allViewItems()
+{
+ return allItems;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/newformimpl.h b/tqtinterface/qt4/tools/designer/designer/newformimpl.h
new file mode 100644
index 0000000..89fbe11
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/newformimpl.h
@@ -0,0 +1,172 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef NEWFORMIMPL_H
+#define NEWFORMIMPL_H
+
+#include "newform.h"
+#include <tqiconview.h>
+
+class Project;
+
+class NewItem : public TQIconViewItem
+{
+public:
+ enum Type {
+ ProjectType,
+ Form,
+ CustomForm,
+ SourceFileType,
+ SourceTemplateType
+ };
+
+ NewItem( TQIconView *view, const TQString &text )
+ : TQIconViewItem( view, text ) {}
+ virtual void insert( Project *pro ) = 0;
+ virtual void setProject( Project * ) {}
+
+};
+
+class ProjectItem : public NewItem
+{
+public:
+ ProjectItem( TQIconView *view, const TQString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)ProjectType; }
+
+ void setLanguage( const TQString &l ) { lang = l; }
+ TQString language() const { return lang; }
+
+private:
+ TQString lang;
+
+};
+
+class FormItem : public NewItem
+{
+public:
+ enum FormType {
+ Widget,
+ Dialog,
+ Wizard,
+ MainWindow
+ };
+
+ FormItem( TQIconView *view, const TQString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)Form; }
+
+ void setFormType( FormType ft ) { fType = ft; }
+ FormType formType() const { return fType; }
+
+private:
+ FormType fType;
+
+};
+
+class CustomFormItem : public NewItem
+{
+public:
+ CustomFormItem( TQIconView *view, const TQString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)CustomForm; }
+
+ void setTemplateFile( const TQString &tf ) { templFile = tf; }
+ TQString templateFileName() const { return templFile; }
+
+private:
+ TQString templFile;
+
+};
+
+class SourceFileItem : public NewItem
+{
+public:
+ SourceFileItem( TQIconView *view, const TQString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)SourceFileType; }
+
+ void setExtension( const TQString &e ) { ext = e; }
+ TQString extension() const { return ext; }
+ void setLanguage( const TQString &l ) { lang = l; }
+ void setProject( Project *pro );
+
+private:
+ TQString ext;
+ TQString lang;
+ bool visible;
+
+};
+
+class SourceTemplateItem : public NewItem
+{
+public:
+ SourceTemplateItem( TQIconView *view, const TQString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)SourceTemplateType; }
+
+ void setTemplate( const TQString &t ) { templ = t; }
+ TQString tenplate() const { return templ; }
+ void setLanguage( const TQString &l ) { lang = l; }
+ void setProject( Project *pro );
+
+private:
+ TQString templ;
+ TQString lang;
+ bool visible;
+
+};
+
+class NewForm : public NewFormBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ NewForm( TQIconView *templateView, const TQString &templatePath );
+ NewForm( TQWidget *tqparent, const TQStringList& projects,
+ const TQString& currentProject, const TQString &templatePath );
+ void insertTemplates( TQIconView*, const TQString& );
+ void accept();
+ TQPtrList<TQIconViewItem> allViewItems();
+
+protected Q_SLOTS:
+ void projectChanged( const TQString &project );
+ void itemChanged( TQIconViewItem *item );
+
+private:
+ TQPtrList<TQIconViewItem> allItems;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/orderindicator.cpp b/tqtinterface/qt4/tools/designer/designer/orderindicator.cpp
new file mode 100644
index 0000000..3cbc4e3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/orderindicator.cpp
@@ -0,0 +1,119 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvariant.h> // HP-UX compiler need this here
+
+#include "orderindicator.h"
+#include "formwindow.h"
+
+#include <tqpainter.h>
+#include <tqbitmap.h>
+#include <tqapplication.h>
+
+OrderIndicator::OrderIndicator( int i, TQWidget* w, FormWindow *fw )
+ : TQWidget( fw, "order_indicator", TQt::WMouseNoMask ), formWindow( fw )
+{
+ order = -1;
+ widget = w;
+ setBackgroundMode( TQt::NoBackground );
+ setAutoMask( TRUE );
+ setOrder( i, w );
+}
+
+
+OrderIndicator::~OrderIndicator()
+{
+}
+
+
+void OrderIndicator::setOrder( int i, TQWidget* wid )
+{
+ if ( widget != wid )
+ return;
+ if ( !wid->isVisibleTo( formWindow ) ) {
+ hide();
+ return;
+ }
+
+ if ( order == i ) {
+ show();
+ raise();
+ return;
+ }
+ order = i;
+ int w = fontMetrics().width( TQString::number( i ) ) + 10;
+ int h = fontMetrics().lineSpacing() * 3 / 2;
+ TQFont f( font() );
+ f.setBold( TRUE );
+ setFont( f );
+ resize( TQMAX( w, h ), h );
+ update(); // in case the size didn't change
+ reposition();
+ show();
+ raise();
+}
+
+void OrderIndicator::reposition()
+{
+ TQPoint p =parentWidget()->mapFromGlobal( widget->mapToGlobal( widget->rect().topLeft() ) );
+ move( p - TQPoint( width()/3, height()/3 ) );
+}
+
+
+void OrderIndicator::paintEvent( TQPaintEvent * )
+{
+ TQPainter p( this );
+ p.setPen( Qt::white );
+ p.setBrush( Qt::blue );
+ p.drawEllipse( rect() );
+ p.drawText( rect(), TQt::AlignCenter, TQString::number( order ) );
+}
+
+
+void OrderIndicator::updateMask()
+{
+ TQBitmap bm( size() );
+ bm.fill( Qt::color0 );
+ {
+ TQPainter p( &bm, this );
+ p.setPen( Qt::color1 );
+ p.setBrush( Qt::color1 );
+ p.drawEllipse( rect() );
+ }
+ setMask( bm );
+}
+
+void OrderIndicator::mousePressEvent( TQMouseEvent *e )
+{
+ TQApplication::sendEvent( widget, e );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/orderindicator.h b/tqtinterface/qt4/tools/designer/designer/orderindicator.h
new file mode 100644
index 0000000..dbcacb2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/orderindicator.h
@@ -0,0 +1,65 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ORDERINDICATOR_H
+#define ORDERINDICATOR_H
+
+#include <tqwidget.h>
+
+class FormWindow;
+
+class OrderIndicator : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ OrderIndicator( int i, TQWidget* w, FormWindow* fw );
+ ~OrderIndicator();
+
+ void setOrder( int i, TQWidget* w );
+ void reposition();
+
+protected:
+ void paintEvent( TQPaintEvent * );
+ void mousePressEvent( TQMouseEvent *e );
+ void updateMask();
+
+private:
+ int order;
+ TQWidget* widget;
+ FormWindow *formWindow;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/outputwindow.cpp b/tqtinterface/qt4/tools/designer/designer/outputwindow.cpp
new file mode 100644
index 0000000..ef3a943
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/outputwindow.cpp
@@ -0,0 +1,214 @@
+/**********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "outputwindow.h"
+#include "designerappiface.h"
+#include "metadatabase.h"
+#include "mainwindow.h"
+
+#include <tqlistview.h>
+#include <tqtextedit.h>
+#include <tqapplication.h>
+#include <tqheader.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <tqpainter.h>
+
+static TQTextEdit *debugoutput = 0;
+bool debugToStderr = FALSE;
+
+TQtMsgHandler OutputWindow::oldMsgHandler = 0;
+
+OutputWindow::OutputWindow( TQWidget *tqparent )
+ : TQTabWidget( tqparent, "output_window" ), debugView( 0 ), errorView( 0 )
+{
+ setupDebug();
+ setupError();
+ iface = new DesignerOutputDockImpl( this );
+}
+
+OutputWindow::~OutputWindow()
+{
+ debugoutput = debugView = 0;
+ errorView = 0;
+ if ( !debugToStderr )
+ tqInstallMsgHandler( oldMsgHandler );
+ delete iface;
+}
+
+void OutputWindow::shuttingDown()
+{
+ if ( !debugToStderr )
+ tqInstallMsgHandler( oldMsgHandler );
+}
+
+void OutputWindow::setupError()
+{
+ errorView = new TQListView( this, "OutputWindow::errorView" );
+ errorView->setSorting( -1 );
+ connect( errorView, TQT_SIGNAL( currentChanged( TQListViewItem* ) ),
+ this, TQT_SLOT( currentErrorChanged( TQListViewItem* ) ) );
+ connect( errorView, TQT_SIGNAL( clicked( TQListViewItem* ) ),
+ this, TQT_SLOT( currentErrorChanged( TQListViewItem* ) ) );
+
+ if ( MetaDataBase::languages().count() > 1 )
+ addTab( errorView, tr( "Warnings/Errors" ) );
+ else
+ errorView->hide();
+ errorView->addColumn( tr( "Type" ) );
+ errorView->addColumn( tr( "Message" ) );
+ errorView->addColumn( tr( "Line" ) );
+ errorView->addColumn( tr( "Location" ) );
+ errorView->setResizeMode( TQListView::LastColumn );
+ errorView->setColumnWidth( 0, errorView->fontMetrics().width( "WARNING1234" ) );
+ errorView->setColumnWidth( 1, errorView->fontMetrics().width( "ABCDEFGHIJKLMNOPTQRSTUVWXYZABCDEFGHIJKLMNOPTQRSTUVWXYZABCDEFGHIJKLMNOP" ) );
+ errorView->setColumnWidth( 2, errorView->fontMetrics().width( "9999999" ) );
+ errorView->setColumnAlignment( 2, TQt::AlignRight );
+ errorView->setAllColumnsShowFocus( TRUE );
+}
+
+static void debugMessageOutput( TQtMsgType type, const char *msg )
+{
+ TQString s( msg );
+ s += "\n";
+
+ if ( type != TQtFatalMsg ) {
+ if ( debugoutput && debugoutput->isVisible() )
+ debugoutput->append( s );
+ else if ( OutputWindow::oldMsgHandler )
+ (*OutputWindow::oldMsgHandler)( type, msg );
+ else
+ fputs( s.latin1(), stderr );
+ } else {
+ fputs( s.latin1(), stderr );
+ abort();
+ }
+
+ tqApp->flush();
+}
+
+void OutputWindow::setupDebug()
+{
+ debugoutput = debugView = new TQTextEdit( this, "OutputWindow::debugView" );
+ //debugView->setReadOnly( TRUE );
+ addTab( debugView, "Debug Output" );
+
+ if ( !debugToStderr )
+ oldMsgHandler = tqInstallMsgHandler( debugMessageOutput );
+}
+
+void OutputWindow::setErrorMessages( const TQStringList &errors, const TQValueList<uint> &lines,
+ bool clear, const TQStringList &locations,
+ const TQObjectList &locationObjects )
+{
+ if ( clear )
+ errorView->clear();
+ TQStringList::ConstIterator mit = errors.begin();
+ TQValueList<uint>::ConstIterator lit = lines.begin();
+ TQStringList::ConstIterator it = locations.begin();
+ TQObjectList objects = (TQObjectList)locationObjects;
+ TQObject *o = objects.first();
+ TQListViewItem *after = 0;
+ for ( ; lit != lines.end() && mit != errors.end(); ++lit, ++mit, ++it, o = objects.next() )
+ after = new ErrorItem( errorView, after, *mit, *lit, *it, o );
+ setCurrentPage( 1 );
+}
+
+DesignerOutputDock *OutputWindow::iFace()
+{
+ return iface;
+}
+
+void OutputWindow::appendDebug( const TQString &text )
+{
+ debugView->append( text + "\n" );
+}
+
+void OutputWindow::clearErrorMessages()
+{
+ errorView->clear();
+}
+
+void OutputWindow::clearDebug()
+{
+ debugView->clear();
+}
+
+void OutputWindow::showDebugTab()
+{
+ showPage( debugView );
+}
+
+void OutputWindow::currentErrorChanged( TQListViewItem *i )
+{
+ if ( !i )
+ return;
+ ErrorItem *ei = (ErrorItem*)i;
+ ei->setRead( TRUE );
+ MainWindow::self->showSourceLine( ei->location(), ei->line() - 1, MainWindow::Error );
+}
+
+
+
+ErrorItem::ErrorItem( TQListView *tqparent, TQListViewItem *after, const TQString &message, int line,
+ const TQString &locationString, TQObject *locationObject )
+ : TQListViewItem( tqparent, after )
+{
+ setMultiLinesEnabled( TRUE );
+ TQString m( message );
+ type = m.startsWith( "Warning: " ) ? Warning : Error;
+ m = m.mid( m.tqfind( ':' ) + 1 );
+ setText( 0, type == Error ? "Error" : "Warning" );
+ setText( 1, m );
+ setText( 2, TQString::number( line ) );
+ setText( 3, locationString );
+ object = locationObject;
+ read = !after;
+ if ( !after ) {
+ tqparent->setSelected( this, TRUE );
+ tqparent->setCurrentItem( this );
+ }
+}
+
+void ErrorItem::paintCell( TQPainter *p, const TQColorGroup & cg,
+ int column, int width, int tqalignment )
+{
+ TQColorGroup g( cg );
+ g.setColor( TQColorGroup::Text, type == Error ? TQt::red : TQt::darkYellow );
+ if ( !read ) {
+ TQFont f( p->font() );
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+ TQListViewItem::paintCell( p, g, column, width, tqalignment );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/outputwindow.h b/tqtinterface/qt4/tools/designer/designer/outputwindow.h
new file mode 100644
index 0000000..8c34f92
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/outputwindow.h
@@ -0,0 +1,106 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef OUTPUTWINDOW_H
+#define OUTPUTWINDOW_H
+
+#include <tqtabwidget.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqlistview.h>
+
+struct DesignerOutputDock;
+class TQTextEdit;
+class TQListView;
+
+class ErrorItem : public TQListViewItem
+{
+public:
+ enum Type { Error, Warning };
+
+ ErrorItem( TQListView *tqparent, TQListViewItem *after, const TQString &message, int line,
+ const TQString &locationString, TQObject *locationObject );
+
+ void paintCell( TQPainter *, const TQColorGroup & cg,
+ int column, int width, int tqalignment );
+
+ void setRead( bool b ) { read = b; tqrepaint(); }
+
+ TQObject *location() const { return object; }
+ int line() const { return text( 2 ).toInt(); }
+
+private:
+ TQObject *object;
+ Type type;
+ bool read;
+
+};
+
+class OutputWindow : public TQTabWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ OutputWindow( TQWidget *tqparent );
+ ~OutputWindow();
+
+ void setErrorMessages( const TQStringList &errors, const TQValueList<uint> &lines,
+ bool clear, const TQStringList &locations,
+ const TQObjectList &locationObjects );
+ void appendDebug( const TQString& );
+ void clearErrorMessages();
+ void clearDebug();
+ void showDebugTab();
+
+ DesignerOutputDock *iFace();
+
+ void shuttingDown();
+
+ static TQtMsgHandler oldMsgHandler;
+
+private Q_SLOTS:
+ void currentErrorChanged( TQListViewItem *i );
+
+private:
+ void setupError();
+ void setupDebug();
+
+ TQTextEdit *debugView;
+ TQListView *errorView;
+
+ DesignerOutputDock *iface;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/paletteeditor.ui b/tqtinterface/qt4/tools/designer/designer/paletteeditor.ui
new file mode 100644
index 0000000..36dbd59
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/paletteeditor.ui
@@ -0,0 +1,503 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PaletteEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>PaletteEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>449</width>
+ <height>443</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Edit Palette</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>groupAutoPalette</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Build Palette</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignAuto</set>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelMainColor</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string>&amp;3-D Effects:</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignAuto|AlignVCenter</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonMainColor</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonMainColor</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the effect-color for the generated palette.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelMainColor2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string>Back&amp;ground:</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignAuto|AlignVCenter</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonMainColor2</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonMainColor2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the background color for the generated palette.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>btnAdvanced</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Tune Palette...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox126</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Preview</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Select &amp;Palette:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="PreviewFrame">
+ <property name="name">
+ <cstring>previewFrame</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>StyledButton</class>
+ <header location="local">styledbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>clicked()</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ <property type="Bool">scale</property>
+ </customwidget>
+ <customwidget>
+ <class>PreviewFrame</class>
+ <header location="local">previewframe.h</header>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>image1</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="1112">789c9dd2cb8e9b301406e07d9e0225bba89a09601350d505302c5b7559a9eac23e6672b363620c0ca9faeef53949da2e2a55eab123f9e38f2f217e5e475f3e7f8cd6cf8bde0b7f8008f6c2456b3518337ffdf6e1fb62992451e8691ac5cb778be55304d1277b6e71fc12c6ab0d157222e61bd8e4c812196f6216535a13f318624a6764b2495842e99558249014c81e99c6294b69d3376291424ae9806431638cd28628183081f4489e70ce13e4852878c129ad905992f18cd291283295517a466ed32ddfa64847945bb595c80e99a739cf29d54499ab9c528b2c58c10b86344428540148400a26b8a0541241b482d215523299494a0551c9562ae409091c32e0c82351410b942aa4e22a53941e882d36e41ed966d8903b2215f215f99a6143b6442afaafff5aff485658622584a091941256948443d1cabbdd6ebf3f28753c09a9e9cdc1fe703c9e4ea19f689a0430fa4c8908082be093d08d016bbb0bbd5e7ceafade5b30de19d083b3fa9e008cd39b9fafd69495b473af7fcfb15325c1d61eea0afaf005ddf97b5295c658a866338f97591babef7340fa396c6c5ca9e7fe650807d0bf566b4262299986ba335a3b4a2cc84b69ac85b1b673037d8fabf95b023a9c09cc7530e104dd5419ed6e27083fb09a7c752db5a9bd31cde4ec634ed8a39aebbe337618c3f6fdc5dee6d8b0bb0d6b5b8b1fad43d78fe4e14e3f6aace8e29d9d736777fea3c686eee0138c9726d4d00c548df7a315ff750f7ebc5ffc04a0e5308d</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonMainColor2</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChoose2ndMainColor()</slot>
+ </connection>
+ <connection>
+ <sender>paletteCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>paletteSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>btnAdvanced</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onTune()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonMainColor</sender>
+ <signal>changed()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChooseMainColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonMainColor</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChooseMainColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonMainColor2</sender>
+ <signal>changed()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChoose2ndMainColor()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">onTune()</slot>
+ <slot access="protected" language="C++" returnType="void">onChoose2ndMainColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseMainColor()</slot>
+ <slot access="protected" language="C++" returnType="void">paletteSelected(int)</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>buttonMainColor</tabstop>
+ <tabstop>buttonMainColor2</tabstop>
+ <tabstop>btnAdvanced</tabstop>
+ <tabstop>paletteCombo</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/paletteeditoradvanced.ui b/tqtinterface/qt4/tools/designer/designer/paletteeditoradvanced.ui
new file mode 100644
index 0000000..c869d97
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/paletteeditoradvanced.ui
@@ -0,0 +1,755 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PaletteEditorAdvancedBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>PaletteEditorAdvancedBase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>327</width>
+ <height>341</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Tune Palette</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Palette&lt;/b&gt;&lt;p&gt;Change the current widget or form's palette.&lt;/p&gt;&lt;p&gt;Use a generated palette or select colors for each color group and each color role.&lt;/p&gt;&lt;p&gt;The palette can be tested with different widget layouts in the preview section.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout14</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="text">
+ <string>Select &amp;Palette:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Auto</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBuildInactive</cstring>
+ </property>
+ <property name="text">
+ <string>Build the &amp;inactive palette from the active palette.</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBuildDisabled</cstring>
+ </property>
+ <property name="text">
+ <string>Build the &amp;disabled palette from the active palette.</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>groupCentral</cstring>
+ </property>
+ <property name="title">
+ <string>Central color roles</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Background</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Foreground</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Button</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Base</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BrightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ButtonText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Highlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>HighlightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Link</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>LinkVisited</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboCentral</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose the central color role</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available central color roles are: &lt;ul&gt; &lt;li&gt;Background - general background color.&lt;/li&gt; &lt;li&gt;Foreground - general foreground color. &lt;/li&gt; &lt;li&gt;Base - used as the background color for example, for text entry widgets; it is usually white or another light color. &lt;/li&gt; &lt;li&gt;Text - the forground color used with Base. Usually this is the same as the Foreground, in which case it must provide good contrast both with the Background and with the Base. &lt;/li&gt; &lt;li&gt;Button - general button background color; useful where buttons need a background different from Background, as in the Macintosh style. &lt;/li&gt; &lt;li&gt;ButtonText - a foreground color used with the Button color. &lt;/li&gt; &lt;li&gt;Highlight - a color used to indicate a selected or highlighted item. &lt;/li&gt; &lt;li&gt;HighlightedText - a text color that contrasts to Highlight. &lt;/li&gt; &lt;li&gt;BrightText - a text color that is very different from Foreground and contrasts well with, for example, black. &lt;/li&gt; &lt;/ul&gt; &lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout32_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelPixmap</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Choose Pi&amp;xmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonPixmap</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonPixmap</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a pixmap file for the selected central color role.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelCentral</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&amp;Select Color:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonCentral</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonCentral</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a color for the selected central color role.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>groupEffect</cstring>
+ </property>
+ <property name="title">
+ <string>3-D shadow effects</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout32_3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBuildEffect</cstring>
+ </property>
+ <property name="text">
+ <string>Build &amp;from button color</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Generate shadings</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check to let 3D-effect colors be calculated from the button-color.</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Light</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Midlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Mid</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dark</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Shadow</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboEffect</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose 3D-effect color role</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a color effect role.&lt;/b&gt;&lt;p&gt;Available effect roles are: &lt;ul&gt; &lt;li&gt;Light - lighter than Button color. &lt;/li&gt; &lt;li&gt;Midlight - between Button and Light. &lt;/li&gt; &lt;li&gt;Mid - between Button and Dark. &lt;/li&gt; &lt;li&gt;Dark - darker than Button. &lt;/li&gt; &lt;li&gt;Shadow - a very dark color. &lt;/li&gt; &lt;/ul&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout31_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelEffect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Select Co&amp;lor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonEffect</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonEffect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a color for the selected effect color role.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>StyledButton</class>
+ <header location="local">styledbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>clicked()</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ <property type="Bool">scale</property>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="1112">789c9dd2cb8e9b301406e07d9e0225bba89a09601350d505302c5b7559a9eac23e6672b363620c0ca9faeef53949da2e2a55eab123f9e38f2f217e5e475f3e7f8cd6cf8bde0b7f8008f6c2456b3518337ffdf6e1fb62992451e8691ac5cb778be55304d1277b6e71fc12c6ab0d157222e61bd8e4c812196f6216535a13f318624a6764b2495842e99558249014c81e99c6294b69d3376291424ae9806431638cd28628183081f4489e70ce13e4852878c129ad905992f18cd291283295517a466ed32ddfa64847945bb595c80e99a739cf29d54499ab9c528b2c58c10b86344428540148400a26b8a0541241b482d215523299494a0551c9562ae409091c32e0c82351410b942aa4e22a53941e882d36e41ed966d8903b2215f215f99a6143b6442afaafff5aff485658622584a091941256948443d1cabbdd6ebf3f28753c09a9e9cdc1fe703c9e4ea19f689a0430fa4c8908082be093d08d016bbb0bbd5e7ceafade5b30de19d083b3fa9e008cd39b9fafd69495b473af7fcfb15325c1d61eea0afaf005ddf97b5295c658a866338f97591babef7340fa396c6c5ca9e7fe650807d0bf566b4262299986ba335a3b4a2cc84b69ac85b1b673037d8fabf95b023a9c09cc7530e104dd5419ed6e27083fb09a7c752db5a9bd31cde4ec634ed8a39aebbe337618c3f6fdc5dee6d8b0bb0d6b5b8b1fad43d78fe4e14e3f6aace8e29d9d736777fea3c686eee0138c9726d4d00c548df7a315ff750f7ebc5ffc04a0e5308d</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>paletteCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>paletteSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>comboCentral</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onCentral(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChoosePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCentral</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChooseCentralColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonEffect</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChooseEffectColor()</slot>
+ </connection>
+ <connection>
+ <sender>comboEffect</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onEffect(int)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildEffects(bool)</slot>
+ </connection>
+ <connection>
+ <sender>buttonHelp</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>showHelp()</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comboEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildInactive</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildInactive(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildDisabled</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildDisabled(bool)</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildDisabled(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">onCentral(int)</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseCentralColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseEffectColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onChoosePixmap()</slot>
+ <slot access="protected" language="C++" returnType="void">onEffect(int)</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildEffects(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildInactive(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">paletteSelected(int)</slot>
+ <slot access="public" language="C++" returnType="void">showHelp()</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>paletteCombo</tabstop>
+ <tabstop>checkBuildInactive</tabstop>
+ <tabstop>checkBuildDisabled</tabstop>
+ <tabstop>comboCentral</tabstop>
+ <tabstop>buttonPixmap</tabstop>
+ <tabstop>buttonCentral</tabstop>
+ <tabstop>checkBuildEffect</tabstop>
+ <tabstop>comboEffect</tabstop>
+ <tabstop>buttonEffect</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.cpp b/tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.cpp
new file mode 100644
index 0000000..4d36ed9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.cpp
@@ -0,0 +1,650 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "paletteeditoradvancedimpl.h"
+#include "styledbutton.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqapplication.h>
+#include <tqpushbutton.h>
+#include <tqlistbox.h>
+#include <tqpainter.h>
+#include <tqgroupbox.h>
+
+/*!
+ Class used by PaletteEditor for bold combobox items
+*/
+
+class BoldListBoxText : public TQListBoxText
+{
+public:
+ BoldListBoxText( TQString text, TQListBox* lb = 0 );
+
+protected:
+ virtual void paint( TQPainter* );
+};
+
+BoldListBoxText::BoldListBoxText( TQString text, TQListBox* lb )
+ : TQListBoxText( lb )
+{
+ setText( text );
+}
+
+void BoldListBoxText::paint( TQPainter* painter )
+{
+ TQFont f = painter->font();
+ f.setBold( TRUE );
+ painter->setFont( f );
+
+ TQListBoxText::paint( painter );
+}
+
+PaletteEditorAdvanced::PaletteEditorAdvanced( FormWindow *fw, TQWidget * tqparent,
+ const char * name, bool modal, WFlags f )
+ : PaletteEditorAdvancedBase( tqparent, name, modal, f ), formWindow( fw ), selectedPalette(0)
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+
+ buttonPixmap->setEditor( StyledButton::PixmapEditor );
+
+ editPalette = TQApplication::palette();
+ setPreviewPalette( editPalette );
+
+ buttonPixmap->setFormWindow( formWindow );
+
+ // force toggle event
+ checkBuildEffect->setChecked(FALSE);
+ checkBuildEffect->setChecked(TRUE);
+}
+
+PaletteEditorAdvanced::~PaletteEditorAdvanced()
+{
+}
+
+void PaletteEditorAdvanced::onToggleBuildInactive( bool v )
+{
+ if (selectedPalette == 1) {
+ groupCentral->setDisabled(v);
+ groupEffect->setDisabled(v);
+ }
+
+ if (v) {
+ buildInactive();
+ updateStyledButtons();
+ }
+}
+
+void PaletteEditorAdvanced::onToggleBuildDisabled( bool v )
+{
+ if (selectedPalette == 2) {
+ groupCentral->setDisabled(v);
+ groupEffect->setDisabled(v);
+ }
+
+ if (v) {
+ buildDisabled();
+ updateStyledButtons();
+ }
+}
+
+void PaletteEditorAdvanced::paletteSelected(int p)
+{
+ selectedPalette = p;
+
+ if(p == 1) { // inactive
+ groupCentral->setDisabled(checkBuildInactive->isChecked());
+ groupEffect->setDisabled(checkBuildInactive->isChecked());
+ }
+ else if (p == 2) { // disabled
+ groupCentral->setDisabled(checkBuildDisabled->isChecked());
+ groupEffect->setDisabled(checkBuildDisabled->isChecked());
+ }
+ else {
+ groupCentral->setEnabled(TRUE);
+ groupEffect->setEnabled(TRUE);
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onChooseCentralColor()
+{
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActiveCentralRole( buttonCentral->color() );
+ break;
+ case 1:
+ mapToInactiveCentralRole( buttonCentral->color() );
+ break;
+ case 2:
+ mapToDisabledCentralRole( buttonCentral->color() );
+ break;
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onChooseEffectColor()
+{
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActiveEffectRole( buttonEffect->color() );
+ break;
+ case 1:
+ mapToInactiveEffectRole( buttonEffect->color() );
+ break;
+ case 2:
+ mapToDisabledEffectRole( buttonEffect->color() );
+ break;
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onChoosePixmap()
+{
+ if (buttonPixmap->pixmap()) {
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActivePixmapRole( *buttonPixmap->pixmap() );
+ break;
+ case 1:
+ mapToInactivePixmapRole( *buttonPixmap->pixmap() );
+ break;
+ case 2:
+ mapToDisabledPixmapRole( *buttonPixmap->pixmap() );
+ break;
+ }
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onToggleBuildEffects( bool on )
+{
+ if (!on) return;
+ buildActiveEffect();
+ buildInactiveEffect();
+ buildDisabledEffect();
+}
+
+TQColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item )
+{
+ switch( item ) {
+ case 0:
+ return TQColorGroup::Background;
+ case 1:
+ return TQColorGroup::Foreground;
+ case 2:
+ return TQColorGroup::Button;
+ case 3:
+ return TQColorGroup::Base;
+ case 4:
+ return TQColorGroup::Text;
+ case 5:
+ return TQColorGroup::BrightText;
+ case 6:
+ return TQColorGroup::ButtonText;
+ case 7:
+ return TQColorGroup::Highlight;
+ case 8:
+ return TQColorGroup::HighlightedText;
+ case 9:
+ return TQColorGroup::Link;
+ case 10:
+ return TQColorGroup::LinkVisited;
+ default:
+ return TQColorGroup::NColorRoles;
+ }
+}
+
+TQColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item )
+{
+ switch( item ) {
+ case 0:
+ return TQColorGroup::Light;
+ case 1:
+ return TQColorGroup::Midlight;
+ case 2:
+ return TQColorGroup::Mid;
+ case 3:
+ return TQColorGroup::Dark;
+ case 4:
+ return TQColorGroup::Shadow;
+ default:
+ return TQColorGroup::NColorRoles;
+ }
+}
+
+void PaletteEditorAdvanced::onCentral( int item )
+{
+ TQPixmap* p = 0;
+ TQColor c;
+
+ switch(selectedPalette) {
+ case 0:
+ default:
+ c = editPalette.active().color( centralFromItem(item) );
+ p = editPalette.active().tqbrush( centralFromItem(item) ).pixmap();
+ break;
+ case 1:
+ c = editPalette.inactive().color( centralFromItem(item) );
+ p = editPalette.inactive().tqbrush( centralFromItem(item) ).pixmap();
+ break;
+ case 2:
+ c = editPalette.disabled().color( centralFromItem(item) );
+ p = editPalette.disabled().tqbrush( centralFromItem(item) ).pixmap();
+ break;
+ }
+
+ buttonCentral->setColor(c);
+
+ if (p)
+ buttonPixmap->setPixmap( *p );
+ else
+ buttonPixmap->setPixmap( TQPixmap() );
+}
+
+void PaletteEditorAdvanced::onEffect( int item )
+{
+ TQColor c;
+ switch(selectedPalette) {
+ case 0:
+ default:
+ c = editPalette.active().color( effectFromItem(item) );
+ break;
+ case 1:
+ editPalette.inactive().color( effectFromItem(item) );
+ break;
+ case 2:
+ editPalette.disabled().color( effectFromItem(item) );
+ break;
+ }
+ buttonEffect->setColor(c);
+}
+
+void PaletteEditorAdvanced::mapToActiveCentralRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setActive( cg );
+
+ buildActiveEffect();
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToActiveEffectRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setActive( cg );
+
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToActivePixmapRole( const TQPixmap& pm )
+{
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.active();
+ if ( !pm.isNull() )
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
+ editPalette.setActive( cg );
+
+
+ buildActiveEffect();
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactiveCentralRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.inactive();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setInactive( cg );
+
+ buildInactiveEffect();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactiveEffectRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.inactive();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setInactive( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactivePixmapRole( const TQPixmap& pm )
+{
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.inactive();
+ if ( !pm.isNull() )
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
+ editPalette.setInactive( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledCentralRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.disabled();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledEffectRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.disabled();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setDisabled( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledPixmapRole( const TQPixmap& pm )
+{
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.disabled();
+ if ( !pm.isNull() )
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
+
+ editPalette.setDisabled( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::buildActiveEffect()
+{
+ TQColorGroup cg = editPalette.active();
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ TQPalette temp( btn, btn );
+
+ for (int i = 0; i<5; i++)
+ cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ setPreviewPalette( editPalette );
+
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::buildInactive()
+{
+ editPalette.setInactive( editPalette.active() );
+ buildInactiveEffect();
+}
+
+void PaletteEditorAdvanced::buildInactiveEffect()
+{
+ TQColorGroup cg = editPalette.inactive();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setInactive( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::buildDisabled()
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( TQColorGroup::ButtonText, Qt::darkGray );
+ cg.setColor( TQColorGroup::Foreground, Qt::darkGray );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+}
+
+void PaletteEditorAdvanced::buildDisabledEffect()
+{
+ TQColorGroup cg = editPalette.disabled();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setDisabled( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::setPreviewPalette( const TQPalette& pal )
+{
+ TQColorGroup cg;
+
+ switch (selectedPalette) {
+ case 0:
+ default:
+ cg = pal.active();
+ break;
+ case 1:
+ cg = pal.inactive();
+ break;
+ case 2:
+ cg = pal.disabled();
+ break;
+ }
+ previewPalette.setActive( cg );
+ previewPalette.setInactive( cg );
+ previewPalette.setDisabled( cg );
+}
+
+void PaletteEditorAdvanced::updateStyledButtons()
+{
+ TQColor central, effect;
+ TQPixmap *pm = 0;
+ switch (selectedPalette) {
+ case 0:
+ default:
+ central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) );
+ pm = editPalette.active().tqbrush( centralFromItem( comboCentral->currentItem() ) ).pixmap();
+ break;
+ case 1:
+ central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) );
+ pm = editPalette.inactive().tqbrush( centralFromItem( comboCentral->currentItem() ) ).pixmap();
+ break;
+ case 2:
+ central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) );
+ pm = editPalette.disabled().tqbrush( centralFromItem( comboCentral->currentItem() ) ).pixmap();
+ break;
+ }
+
+ buttonCentral->setColor(central);
+ buttonEffect->setColor(effect);
+ if ( pm && !pm->isNull() )
+ buttonPixmap->setPixmap( *pm );
+ else
+ buttonPixmap->setPixmap(TQPixmap());
+}
+
+void PaletteEditorAdvanced::setPal( const TQPalette& pal )
+{
+ editPalette = pal;
+ setPreviewPalette( pal );
+ updateStyledButtons();
+}
+
+TQPalette PaletteEditorAdvanced::pal() const
+{
+ return editPalette;
+}
+
+void PaletteEditorAdvanced::setupBackgroundMode( TQt::BackgroundMode mode )
+{
+ int initRole = 0;
+
+ switch( mode ) {
+ case TQt::PaletteBackground:
+ initRole = 0;
+ break;
+ case TQt::PaletteForeground:
+ initRole = 1;
+ break;
+ case TQt::PaletteButton:
+ initRole = 2;
+ break;
+ case TQt::PaletteBase:
+ initRole = 3;
+ break;
+ case TQt::PaletteText:
+ initRole = 4;
+ break;
+ case TQt::PaletteBrightText:
+ initRole = 5;
+ break;
+ case TQt::PaletteButtonText:
+ initRole = 6;
+ break;
+ case TQt::PaletteHighlight:
+ initRole = 7;
+ break;
+ case TQt::PaletteHighlightedText:
+ initRole = 8;
+ break;
+ case TQt::PaletteLight:
+ initRole = 9;
+ break;
+ case TQt::PaletteMidlight:
+ initRole = 10;
+ break;
+ case TQt::PaletteDark:
+ initRole = 11;
+ break;
+ case TQt::PaletteMid:
+ initRole = 12;
+ break;
+ case TQt::PaletteShadow:
+ initRole = 13;
+ break;
+ default:
+ initRole = -1;
+ break;
+ }
+
+ if ( initRole <= -1 ) return;
+
+ if (initRole > 8 ) {
+ comboEffect->setCurrentItem( initRole - 9 );
+ if ( comboEffect->listBox() ) {
+ TQString text = comboEffect->currentText();
+ comboEffect->listBox()->changeItem( new BoldListBoxText( text ), initRole - 9 );
+ }
+ }
+ else {
+ comboCentral->setCurrentItem( initRole );
+ if ( comboCentral->listBox() ) {
+ TQString text = comboCentral->currentText();
+ comboCentral->listBox()->changeItem( new BoldListBoxText( text ), initRole );
+ }
+ }
+}
+
+TQPalette PaletteEditorAdvanced::getPalette( bool *ok, const TQPalette &init,
+ TQt::BackgroundMode mode, TQWidget* tqparent,
+ const char* name, FormWindow *fw )
+{
+ PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( fw, tqparent, name, TRUE );
+ dlg->setupBackgroundMode( mode );
+
+ if ( init != TQPalette() )
+ dlg->setPal( init );
+ int resultCode = dlg->exec();
+
+ TQPalette result = init;
+ if ( resultCode == TQDialog::Accepted ) {
+ if ( ok )
+ *ok = TRUE;
+ result = dlg->pal();
+ } else {
+ if ( ok )
+ *ok = FALSE;
+ }
+ delete dlg;
+ return result;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.h b/tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.h
new file mode 100644
index 0000000..d345abb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/paletteeditoradvancedimpl.h
@@ -0,0 +1,104 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PALETTEEDITORADVANCEDIMPL_H
+#define PALETTEEDITORADVANCEDIMPL_H
+
+#include "paletteeditoradvanced.h"
+
+class FormWindow;
+
+class PaletteEditorAdvanced : public PaletteEditorAdvancedBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ PaletteEditorAdvanced( FormWindow *fw, TQWidget * tqparent=0, const char * name=0,
+ bool modal=FALSE, WFlags f=0 );
+ ~PaletteEditorAdvanced();
+
+ static TQPalette getPalette( bool *ok, const TQPalette &pal, TQt::BackgroundMode mode = TQt::PaletteBackground,
+ TQWidget* tqparent = 0, const char* name = 0, FormWindow *fw = 0 );
+
+protected Q_SLOTS:
+ void paletteSelected(int);
+
+ void onCentral( int );
+ void onEffect( int );
+
+ void onChooseCentralColor();
+ void onChooseEffectColor();
+ void onChoosePixmap();
+
+ void onToggleBuildEffects( bool );
+ void onToggleBuildInactive( bool );
+ void onToggleBuildDisabled( bool );
+
+protected:
+ void mapToActiveCentralRole( const TQColor& );
+ void mapToActiveEffectRole( const TQColor& );
+ void mapToActivePixmapRole( const TQPixmap& );
+ void mapToInactiveCentralRole( const TQColor& );
+ void mapToInactiveEffectRole( const TQColor& );
+ void mapToInactivePixmapRole( const TQPixmap& );
+ void mapToDisabledCentralRole( const TQColor& );
+ void mapToDisabledEffectRole( const TQColor& );
+ void mapToDisabledPixmapRole( const TQPixmap& );
+
+
+ void buildPalette();
+ void buildActiveEffect();
+ void buildInactive();
+ void buildInactiveEffect();
+ void buildDisabled();
+ void buildDisabledEffect();
+
+private:
+ void setPreviewPalette( const TQPalette& );
+ void updateStyledButtons();
+ void setupBackgroundMode( TQt::BackgroundMode );
+
+ TQPalette pal() const;
+ void setPal( const TQPalette& );
+
+ TQColorGroup::ColorRole centralFromItem( int );
+ TQColorGroup::ColorRole effectFromItem( int );
+ TQPalette editPalette;
+ TQPalette previewPalette;
+
+ FormWindow *formWindow;
+
+ int selectedPalette;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.cpp
new file mode 100644
index 0000000..879f6f9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.cpp
@@ -0,0 +1,311 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "paletteeditorimpl.h"
+#include "paletteeditoradvancedimpl.h"
+#include "previewframe.h"
+#include "styledbutton.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqapplication.h>
+#include <tqpushbutton.h>
+
+PaletteEditor::PaletteEditor( FormWindow *fw, TQWidget * tqparent, const char * name, bool modal, WFlags f )
+ : PaletteEditorBase( tqparent, name, modal, f ), formWindow( fw )
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+
+ editPalette = TQApplication::palette();
+ setPreviewPalette( editPalette );
+
+ buttonMainColor->setColor( editPalette.active().color( TQColorGroup::Button ) );
+ buttonMainColor2->setColor( editPalette.active().color( TQColorGroup::Background ) );
+}
+
+PaletteEditor::~PaletteEditor()
+{
+}
+
+void PaletteEditor::onTune()
+{
+ bool ok;
+ TQPalette pal = PaletteEditorAdvanced::getPalette( &ok, editPalette, backgroundMode, this, "tune_palette", formWindow);
+ if (!ok) return;
+
+ editPalette = pal;
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditor::onChooseMainColor()
+{
+ buildPalette();
+}
+
+void PaletteEditor::onChoose2ndMainColor()
+{
+ buildPalette();
+}
+
+void PaletteEditor::paletteSelected(int)
+{
+ setPreviewPalette(editPalette);
+}
+
+TQColorGroup::ColorRole PaletteEditor::centralFromItem( int item )
+{
+ switch( item )
+ {
+ case 0:
+ return TQColorGroup::Background;
+ case 1:
+ return TQColorGroup::Foreground;
+ case 2:
+ return TQColorGroup::Button;
+ case 3:
+ return TQColorGroup::Base;
+ case 4:
+ return TQColorGroup::Text;
+ case 5:
+ return TQColorGroup::BrightText;
+ case 6:
+ return TQColorGroup::ButtonText;
+ case 7:
+ return TQColorGroup::Highlight;
+ case 8:
+ return TQColorGroup::HighlightedText;
+ default:
+ return TQColorGroup::NColorRoles;
+ }
+}
+
+TQColorGroup::ColorRole PaletteEditor::effectFromItem( int item )
+{
+ switch( item )
+ {
+ case 0:
+ return TQColorGroup::Light;
+ case 1:
+ return TQColorGroup::Midlight;
+ case 2:
+ return TQColorGroup::Mid;
+ case 3:
+ return TQColorGroup::Dark;
+ case 4:
+ return TQColorGroup::Shadow;
+ default:
+ return TQColorGroup::NColorRoles;
+ }
+}
+
+void PaletteEditor::buildPalette()
+{
+ int i;
+ TQColorGroup cg;
+ TQColor btn = buttonMainColor->color();
+ TQColor back = buttonMainColor2->color();
+ TQPalette automake( btn, back );
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), automake.active().color( centralFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ buildActiveEffect();
+
+ cg = editPalette.inactive();
+
+ TQPalette temp( editPalette.active().color( TQColorGroup::Button ),
+ editPalette.active().color( TQColorGroup::Background ) );
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), temp.inactive().color( centralFromItem(i) ) );
+
+ editPalette.setInactive( cg );
+ buildInactiveEffect();
+
+ cg = editPalette.disabled();
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), temp.disabled().color( centralFromItem(i) ) );
+
+ editPalette.setDisabled( cg );
+ buildDisabledEffect();
+
+ updateStyledButtons();
+}
+
+void PaletteEditor::buildActiveEffect()
+{
+ TQColorGroup cg = editPalette.active();
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ TQPalette temp( btn, btn );
+
+ for (int i = 0; i<5; i++)
+ cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ setPreviewPalette( editPalette );
+
+ updateStyledButtons();
+}
+
+void PaletteEditor::buildInactive()
+{
+ editPalette.setInactive( editPalette.active() );
+ buildInactiveEffect();
+}
+
+void PaletteEditor::buildInactiveEffect()
+{
+ TQColorGroup cg = editPalette.inactive();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setInactive( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditor::buildDisabled()
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( TQColorGroup::ButtonText, Qt::darkGray );
+ cg.setColor( TQColorGroup::Foreground, Qt::darkGray );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+}
+
+void PaletteEditor::buildDisabledEffect()
+{
+ TQColorGroup cg = editPalette.disabled();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setDisabled( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditor::setPreviewPalette( const TQPalette& pal )
+{
+ TQColorGroup cg;
+
+ switch (paletteCombo->currentItem()) {
+ case 0:
+ default:
+ cg = pal.active();
+ break;
+ case 1:
+ cg = pal.inactive();
+ break;
+ case 2:
+ cg = pal.disabled();
+ break;
+ }
+ previewPalette.setActive( cg );
+ previewPalette.setInactive( cg );
+ previewPalette.setDisabled( cg );
+
+ previewFrame->setPreviewPalette(previewPalette);
+}
+
+void PaletteEditor::updateStyledButtons()
+{
+ buttonMainColor->setColor( editPalette.active().color( TQColorGroup::Button ));
+ buttonMainColor2->setColor( editPalette.active().color( TQColorGroup::Background ));
+}
+
+void PaletteEditor::setPal( const TQPalette& pal )
+{
+ editPalette = pal;
+ setPreviewPalette( pal );
+ updateStyledButtons();
+}
+
+TQPalette PaletteEditor::pal() const
+{
+ return editPalette;
+}
+
+TQPalette PaletteEditor::getPalette( bool *ok, const TQPalette &init, TQt::BackgroundMode mode,
+ TQWidget* tqparent, const char* name, FormWindow *fw )
+{
+ PaletteEditor* dlg = new PaletteEditor( fw, tqparent, name, TRUE );
+ dlg->setupBackgroundMode( mode );
+
+ if ( init != TQPalette() )
+ dlg->setPal( init );
+ int resultCode = dlg->exec();
+
+ TQPalette result = init;
+ if ( resultCode == TQDialog::Accepted ) {
+ if ( ok )
+ *ok = TRUE;
+ result = dlg->pal();
+ } else {
+ if ( ok )
+ *ok = FALSE;
+ }
+ delete dlg;
+ return result;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.h b/tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.h
new file mode 100644
index 0000000..c2eaeb3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/paletteeditorimpl.h
@@ -0,0 +1,84 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PALETTEEDITORIMPL_H
+#define PALETTEEDITORIMPL_H
+
+#include "paletteeditor.h"
+
+class FormWindow;
+
+class PaletteEditor : public PaletteEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PaletteEditor( FormWindow *fw, TQWidget * tqparent=0, const char * name=0, bool modal=FALSE, WFlags f=0 );
+ ~PaletteEditor();
+
+ static TQPalette getPalette( bool *ok, const TQPalette &pal, TQt::BackgroundMode mode = TQt::PaletteBackground,
+ TQWidget* tqparent = 0, const char* name = 0, FormWindow *fw = 0 );
+
+protected Q_SLOTS:
+ void onChooseMainColor();
+ void onChoose2ndMainColor();
+ void onTune();
+ void paletteSelected(int);
+
+protected:
+ void buildPalette();
+ void buildActiveEffect();
+ void buildInactive();
+ void buildInactiveEffect();
+ void buildDisabled();
+ void buildDisabledEffect();
+
+private:
+ void setPreviewPalette( const TQPalette& );
+ void updateStyledButtons();
+ void setupBackgroundMode( TQt::BackgroundMode mode ) { backgroundMode = mode; }
+
+ TQPalette pal() const;
+ void setPal( const TQPalette& );
+
+ TQColorGroup::ColorRole centralFromItem( int );
+ TQColorGroup::ColorRole effectFromItem( int );
+ TQPalette editPalette;
+ TQPalette previewPalette;
+
+ FormWindow *formWindow;
+ TQt::BackgroundMode backgroundMode;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/pixmapchooser.cpp b/tqtinterface/qt4/tools/designer/designer/pixmapchooser.cpp
new file mode 100644
index 0000000..32b1231
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/pixmapchooser.cpp
@@ -0,0 +1,206 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvariant.h> // HP-UX compiler needs this here
+
+#include "pixmapchooser.h"
+#include "formwindow.h"
+#if defined(DESIGNER) && !defined(RESOURCE)
+#include "pixmapfunction.h"
+#endif
+#include "metadatabase.h"
+#include "mainwindow.h"
+#include "pixmapcollectioneditor.h"
+#include "pixmapcollection.h"
+#include "project.h"
+
+#include <tqapplication.h>
+#include <tqimage.h>
+#include <tqpainter.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqiconview.h>
+
+#if defined(DESIGNER)
+static ImageIconProvider *imageIconProvider = 0;
+#endif
+
+PixmapView::PixmapView( TQWidget *tqparent )
+ : TQScrollView( tqparent )
+{
+ viewport()->setBackgroundMode( TQt::PaletteBase );
+}
+
+void PixmapView::setPixmap( const TQPixmap &pix )
+{
+ pixmap = pix;
+ resizeContents( pixmap.size().width(), pixmap.size().height() );
+ viewport()->tqrepaint( FALSE );
+}
+
+void PixmapView::drawContents( TQPainter *p, int cx, int cy, int cw, int ch )
+{
+ p->fillRect( cx, cy, cw, ch, tqcolorGroup().brush( TQColorGroup::Base ) );
+ p->drawPixmap( 0, 0, pixmap );
+}
+
+void PixmapView::previewUrl( const TQUrl &u )
+{
+ if ( u.isLocalFile() ) {
+ TQString path = u.path();
+ TQPixmap pix( path );
+ if ( !pix.isNull() )
+ setPixmap( pix );
+ } else {
+ qWarning( "Previewing remote files not supported." );
+ }
+}
+
+static void buildImageFormatList( TQString &filter, TQString &all )
+{
+ all = tqApp->translate( "qChoosePixmap", "All Pixmaps (" );
+ for ( uint i = 0; i < TQImageIO::outputFormats().count(); i++ ) {
+ TQString outputFormat = TQImageIO::outputFormats().at( i );
+ TQString outputExtension;
+ if ( outputFormat != "JPEG" )
+ outputExtension = outputFormat.lower();
+ else
+ outputExtension = "jpg;*.jpeg";
+ filter += tqApp->translate( "qChoosePixmap", "%1-Pixmaps (%2)\n" ).
+ arg( outputFormat ).arg( "*." + outputExtension);
+ all += "*." + outputExtension + ";";
+ }
+ filter.prepend( all + tqApp->translate( "qChoosePixmap", ")\n" ) );
+ filter += tqApp->translate( "qChoosePixmap", "All Files (*)" );
+
+}
+TQStringList qChoosePixmaps( TQWidget *tqparent )
+{
+ if ( !imageIconProvider && !TQFileDialog::iconProvider() )
+ TQFileDialog::setIconProvider( ( imageIconProvider = new ImageIconProvider ) );
+
+ TQString filter;
+ TQString all;
+ buildImageFormatList( filter, all );
+
+ TQFileDialog fd( TQString(), filter, tqparent, 0, TRUE );
+ fd.setMode( TQFileDialog::ExistingFiles );
+ fd.setContentsPreviewEnabled( TRUE );
+ PixmapView *pw = new PixmapView( &fd );
+ fd.setContentsPreview( pw, pw );
+ fd.setViewMode( TQFileDialog::List );
+ fd.setPreviewMode( TQFileDialog::Contents );
+ fd.setCaption( tqApp->translate( "qChoosePixmap", "Choose Images..." ) );
+ if ( fd.exec() == TQDialog::Accepted )
+ return fd.selectedFiles();
+ return TQStringList();
+}
+
+TQPixmap qChoosePixmap( TQWidget *tqparent, FormWindow *fw, const TQPixmap &old, TQString *fn )
+{
+#if defined(DESIGNER)
+ if ( !fw || fw->savePixmapInline() ) {
+ if ( !imageIconProvider && !TQFileDialog::iconProvider() )
+ TQFileDialog::setIconProvider( ( imageIconProvider = new ImageIconProvider ) );
+
+ TQString filter;
+ TQString all;
+ buildImageFormatList( filter, all );
+
+ TQFileDialog fd( TQString(), filter, tqparent, 0, TRUE );
+ fd.setContentsPreviewEnabled( TRUE );
+ PixmapView *pw = new PixmapView( &fd );
+ fd.setContentsPreview( pw, pw );
+ fd.setViewMode( TQFileDialog::List );
+ fd.setPreviewMode( TQFileDialog::Contents );
+ fd.setCaption( tqApp->translate( "qChoosePixmap", "Choose a Pixmap..." ) );
+ if ( fd.exec() == TQDialog::Accepted ) {
+ TQPixmap pix( fd.selectedFile() );
+ if ( fn )
+ *fn = fd.selectedFile();
+ MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), fd.selectedFile() );
+ return pix;
+ }
+ } else if ( fw && fw->savePixmapInProject() ) {
+ PixmapCollectionEditor dia( tqparent, 0, TRUE );
+ dia.setProject( fw->project() );
+ dia.setChooserMode( TRUE );
+ dia.setCurrentItem( MetaDataBase::pixmapKey( fw, old.serialNumber() ) );
+ if ( dia.exec() == TQDialog::Accepted ) {
+ TQPixmap pix( fw->project()->pixmapCollection()->pixmap( dia.viewPixmaps->currentItem()->text() ) );
+ MetaDataBase::setPixmapKey( fw, pix.serialNumber(), dia.viewPixmaps->currentItem()->text() );
+ return pix;
+ }
+ } else {
+ PixmapFunction dia( tqparent, 0, TRUE );
+ TQObject::connect( dia.helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ dia.labelFunction->setText( fw->pixmapLoaderFunction() + "(" );
+ dia.editArguments->setText( MetaDataBase::pixmapArgument( fw, old.serialNumber() ) );
+ dia.editArguments->setFocus();
+ if ( dia.exec() == TQDialog::Accepted ) {
+ TQPixmap pix;
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( TQPixmap::fromMimeSource( "designer_image.png" ).convertToImage() );
+
+ MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), dia.editArguments->text() );
+ return pix;
+ }
+ }
+#else
+ TQ_UNUSED( tqparent );
+ TQ_UNUSED( fw );
+ TQ_UNUSED( old );
+#endif
+ return TQPixmap();
+}
+
+ImageIconProvider::ImageIconProvider( TQWidget *tqparent, const char *name )
+ : TQFileIconProvider( TQT_TQOBJECT(tqparent), name ), imagepm( TQPixmap::fromMimeSource( "designer_image.png" ) )
+{
+ fmts = TQImage::inputFormats();
+}
+
+ImageIconProvider::~ImageIconProvider()
+{
+}
+
+const TQPixmap * ImageIconProvider::pixmap( const TQFileInfo &fi )
+{
+ TQString ext = fi.extension().upper();
+ if ( fmts.tqcontains( ext ) ) {
+ return &imagepm;
+ } else {
+ return TQFileIconProvider::pixmap( fi );
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/pixmapchooser.h b/tqtinterface/qt4/tools/designer/designer/pixmapchooser.h
new file mode 100644
index 0000000..d2b9882
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/pixmapchooser.h
@@ -0,0 +1,79 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PIXMAPCHOOSER_H
+#define PIXMAPCHOOSER_H
+
+#include <tqfiledialog.h>
+#include <tqscrollview.h>
+#include <tqpixmap.h>
+#include <tqurl.h>
+
+class FormWindow;
+
+class PixmapView : public TQScrollView,
+ public TQFilePreview
+{
+ TQ_OBJECT
+
+public:
+ PixmapView( TQWidget *tqparent );
+ void setPixmap( const TQPixmap &pix );
+ void drawContents( TQPainter *p, int, int, int, int );
+ void previewUrl( const TQUrl &u );
+
+private:
+ TQPixmap pixmap;
+
+};
+
+class ImageIconProvider : public TQFileIconProvider
+{
+ TQ_OBJECT
+
+public:
+ ImageIconProvider( TQWidget *tqparent = 0, const char *name = 0 );
+ ~ImageIconProvider();
+
+ const TQPixmap *pixmap( const TQFileInfo &fi );
+
+private:
+ TQStrList fmts;
+ TQPixmap imagepm;
+
+};
+
+TQPixmap qChoosePixmap( TQWidget *tqparent, FormWindow *fw = 0, const TQPixmap &old = TQPixmap(), TQString *fn = 0 );
+TQStringList qChoosePixmaps( TQWidget *tqparent );
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/pixmapcollection.cpp b/tqtinterface/qt4/tools/designer/designer/pixmapcollection.cpp
new file mode 100644
index 0000000..c896991
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/pixmapcollection.cpp
@@ -0,0 +1,187 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "pixmapcollection.h"
+#include "project.h"
+#include "mainwindow.h"
+#include <tqmime.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqtextstream.h>
+#include <tqimage.h>
+
+PixmapCollection::PixmapCollection( Project *pro )
+ : project( pro )
+{
+ iface = new DesignerPixmapCollectionImpl( this );
+ mimeSourceFactory = new TQMimeSourceFactory();
+}
+
+PixmapCollection::~PixmapCollection()
+{
+ delete mimeSourceFactory;
+ delete iface;
+}
+
+bool PixmapCollection::addPixmap( const Pixmap &pix, bool force )
+{
+ Pixmap pixmap = pix;
+ savePixmap( pixmap );
+
+ if ( !force ) {
+ for ( TQValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( (*it).name == pixmap.name )
+ return FALSE;
+ }
+ }
+
+ pixList.append( pixmap );
+ mimeSourceFactory->setPixmap( pixmap.name, pixmap.pix );
+ project->setModified( TRUE );
+ return TRUE;
+}
+
+void PixmapCollection::removePixmap( const TQString &name )
+{
+ for ( TQValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( (*it).name == name ) {
+ pixList.remove( it );
+ break;
+ }
+ }
+ project->setModified( TRUE );
+}
+
+TQValueList<PixmapCollection::Pixmap> PixmapCollection::pixmaps() const
+{
+ return pixList;
+}
+
+TQString PixmapCollection::unifyName( const TQString &n )
+{
+ TQString name = n;
+ bool restart = FALSE;
+ int added = 1;
+
+ for ( TQValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( restart )
+ it = pixList.begin();
+ restart = FALSE;
+ if ( name == (*it).name ) {
+ name = n;
+ name += "_" + TQString::number( added );
+ ++added;
+ restart = TRUE;
+ }
+ }
+
+ return name;
+}
+
+void PixmapCollection::setActive( bool b )
+{
+ if ( b )
+ TQMimeSourceFactory::defaultFactory()->addFactory( mimeSourceFactory );
+ else
+ TQMimeSourceFactory::defaultFactory()->removeFactory( mimeSourceFactory );
+}
+
+TQPixmap PixmapCollection::pixmap( const TQString &name )
+{
+ for ( TQValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( (*it).name == name )
+ return (*it).pix;
+ }
+ return TQPixmap();
+}
+
+void PixmapCollection::savePixmap( Pixmap &pix )
+{
+ if ( pix.absname == imageDir() + "/" + pix.name )
+ return; // no need to save, it is already there
+ TQString rel = project->makeRelative( pix.absname );
+ if ( rel[0] == '/' || ( rel[1] == ':' && rel[2] == '/' ) ) { // only save if file is outside the project
+ mkdir();
+ pix.name = unifyName( TQFileInfo( pix.absname ).baseName() ) + ".png";
+ pix.absname = imageDir() + "/" + pix.name;
+ pix.pix.save( pix.absname, "PNG" );
+ } else if ( rel.isEmpty() ) {
+ mkdir();
+ pix.name = unifyName( pix.name );
+ pix.absname = imageDir() + "/" + pix.name;
+ pix.pix.save( pix.absname, "PNG" );
+ }
+}
+
+TQString PixmapCollection::imageDir() const
+{
+ return TQFileInfo( project->fileName() ).dirPath( TRUE ) + "/images";
+}
+
+void PixmapCollection::mkdir()
+{
+ TQString f = project->fileName();
+ TQDir d( TQFileInfo( f ).dirPath( TRUE ) );
+ d.mkdir( "images" );
+}
+
+void PixmapCollection::load( const TQString& filename )
+{
+ if ( filename.isEmpty() )
+ return;
+ TQString absfile;
+ if ( filename[0] == '/' )
+ absfile = filename;
+ else
+ absfile = TQFileInfo( project->fileName() ).dirPath( TRUE ) + "/" + filename;
+
+ TQPixmap pm( absfile );
+ if ( pm.isNull() )
+ return;
+
+ Pixmap pix;
+ pix.name = TQFileInfo( absfile ).fileName();
+ pix.absname = absfile;
+ pix.pix = pm;
+ addPixmap( pix, TRUE );
+}
+
+DesignerPixmapCollection *PixmapCollection::iFace()
+{
+ return iface;
+}
+
+bool PixmapCollection::isEmpty() const
+{
+ return pixList.isEmpty();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/pixmapcollection.h b/tqtinterface/qt4/tools/designer/designer/pixmapcollection.h
new file mode 100644
index 0000000..60c5dc9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/pixmapcollection.h
@@ -0,0 +1,87 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PIXMAPCOLLECTION_H
+#define PIXMAPCOLLECTION_H
+
+#include <tqstring.h>
+#include <tqpixmap.h>
+#include <tqvaluelist.h>
+#include "designerappiface.h"
+
+class TQMimeSourceFactory;
+class Project;
+
+class PixmapCollection
+{
+public:
+ struct Pixmap
+ {
+ TQPixmap pix;
+ TQString name;
+ TQString absname;
+ TQ_DUMMY_COMPARISON_OPERATOR( Pixmap )
+ };
+
+ PixmapCollection( Project *pro );
+ ~PixmapCollection();
+
+ bool addPixmap( const Pixmap &pix, bool force = TRUE );
+ void removePixmap( const TQString &name );
+ TQPixmap pixmap( const TQString &name );
+
+ TQValueList<Pixmap> pixmaps() const;
+ bool isEmpty() const;
+
+ void setActive( bool b );
+
+ void load( const TQString& filename );
+
+ DesignerPixmapCollection *iFace();
+
+private:
+ TQString unifyName( const TQString &n );
+ void savePixmap( Pixmap &pix );
+
+ TQString imageDir() const;
+ void mkdir();
+
+private:
+ TQValueList<Pixmap> pixList;
+ TQMimeSourceFactory *mimeSourceFactory;
+ Project *project;
+ DesignerPixmapCollectionImpl *iface;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui b/tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui
new file mode 100644
index 0000000..59c50b9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui
@@ -0,0 +1,225 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PixmapCollectionEditor</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>PixmapCollectionEditor</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>455</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Manage Image Collection</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQIconView">
+ <property name="name">
+ <cstring>viewPixmaps</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonClose</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;lose</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>addPixmap()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>removePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>viewPixmaps</sender>
+ <signal>currentChanged(TQIconViewItem*)</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>currentChanged(TQIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonClose</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>PushButton2</tabstop>
+ <tabstop>PushButton3</tabstop>
+ <tabstop>viewPixmaps</tabstop>
+ <tabstop>buttonClose</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">pixmapcollection.h</include>
+ <include location="local" impldecl="in implementation">pixmapchooser.h</include>
+ <include location="local" impldecl="in implementation">project.h</include>
+ <include location="global" impldecl="in implementation">tqfileinfo.h</include>
+ <include location="global" impldecl="in implementation">tqimage.h</include>
+ <include location="global" impldecl="in declaration">tqpixmap.h</include>
+ <include location="local" impldecl="in implementation">pixmapcollectioneditor.ui.h</include>
+</includes>
+<forwards>
+ <forward>class Project;</forward>
+</forwards>
+<variables>
+ <variable>Project *project;</variable>
+ <variable>bool chooser;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>addPixmap()</slot>
+ <slot>removePixmap()</slot>
+ <slot>updateView()</slot>
+ <slot>currentChanged(TQIconViewItem * i)</slot>
+ <slot>setChooserMode(bool c)</slot>
+ <slot>setCurrentItem(const TQString &amp; name)</slot>
+ <slot>setProject(Project * pro)</slot>
+ <slot returnType="TQPixmap">scaledPixmap(const TQPixmap &amp; p)</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui.h b/tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui.h
new file mode 100644
index 0000000..2dfe556
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/pixmapcollectioneditor.ui.h
@@ -0,0 +1,156 @@
+/**********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+void PixmapCollectionEditor::init()
+{
+ project = 0;
+ setChooserMode( FALSE );
+}
+
+void PixmapCollectionEditor::destroy()
+{
+}
+
+void PixmapCollectionEditor::addPixmap()
+{
+ if ( !project )
+ return;
+
+ TQString f;
+ TQStringList pixmaps = qChoosePixmaps( this );
+ if ( pixmaps.isEmpty() )
+ return;
+
+ TQString lastName;
+ for ( TQStringList::ConstIterator it = pixmaps.begin(); it != pixmaps.end(); ++it ) {
+ TQPixmap pm( *it );
+ if ( pm.isNull() )
+ continue;
+ PixmapCollection::Pixmap pixmap;
+ pixmap.pix = pm;
+ TQFileInfo fi ( *it );
+ pixmap.name = fi.fileName();
+ pixmap.absname = fi.filePath();
+ if ( !project->pixmapCollection()->addPixmap( pixmap, FALSE ) )
+ continue;
+ lastName = pixmap.name;
+ }
+
+ updateView();
+ TQIconViewItem *item = viewPixmaps->tqfindItem( lastName );
+ if ( item ) {
+ viewPixmaps->setCurrentItem( item );
+ viewPixmaps->ensureItemVisible( item );
+ }
+
+}
+
+void PixmapCollectionEditor::removePixmap()
+{
+ if ( !project || !viewPixmaps->currentItem() )
+ return;
+ project->pixmapCollection()->removePixmap( viewPixmaps->currentItem()->text() );
+ updateView();
+}
+
+void PixmapCollectionEditor::updateView()
+{
+ if ( !project )
+ return;
+
+ viewPixmaps->clear();
+
+ TQValueList<PixmapCollection::Pixmap> pixmaps = project->pixmapCollection()->pixmaps();
+ for ( TQValueList<PixmapCollection::Pixmap>::Iterator it = pixmaps.begin(); it != pixmaps.end(); ++it ) {
+ // #### might need to scale down the pixmap
+ TQIconViewItem *item = new TQIconViewItem( viewPixmaps, (*it).name, scaledPixmap( (*it).pix ) );
+ //item->setRenameEnabled( TRUE ); // this will be a bit harder to implement
+ item->setDragEnabled( FALSE );
+ item->setDropEnabled( FALSE );
+ }
+ viewPixmaps->setCurrentItem( viewPixmaps->firstItem() );
+ currentChanged( viewPixmaps->firstItem() );
+}
+
+void PixmapCollectionEditor::currentChanged( TQIconViewItem * i )
+{
+ buttonOk->setEnabled( !!i );
+}
+
+void PixmapCollectionEditor::setChooserMode( bool c )
+{
+ chooser = c;
+ if ( chooser ) {
+ buttonClose->hide();
+ buttonOk->show();
+ buttonCancel->show();
+ buttonOk->setEnabled( FALSE );
+ buttonOk->setDefault( TRUE );
+ connect( viewPixmaps, TQT_SIGNAL( doubleClicked( TQIconViewItem * ) ), buttonOk, TQT_SIGNAL( clicked() ) );
+ connect( viewPixmaps, TQT_SIGNAL( returnPressed( TQIconViewItem * ) ), buttonOk, TQT_SIGNAL( clicked() ) );
+ setCaption( tr( "Choose an Image" ) );
+ } else {
+ buttonClose->show();
+ buttonOk->hide();
+ buttonCancel->hide();
+ buttonClose->setDefault( TRUE );
+ }
+ updateView();
+}
+
+void PixmapCollectionEditor::setCurrentItem( const TQString & name )
+{
+ TQIconViewItem *i = viewPixmaps->tqfindItem( name );
+ if ( i ) {
+ viewPixmaps->setCurrentItem( i );
+ currentChanged( i );
+ }
+}
+
+void PixmapCollectionEditor::setProject( Project * pro )
+{
+ project = pro;
+ updateView();
+}
+
+TQPixmap PixmapCollectionEditor::scaledPixmap( const TQPixmap & p )
+{
+ TQPixmap pix( p );
+ if ( pix.width() < 50 && pix.height() < 50 )
+ return pix;
+ TQImage img;
+ img = pix;
+ img = img.smoothScale( 50, 50 );
+ pix.convertFromImage( img );
+ return pix;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/pixmapfunction.ui b/tqtinterface/qt4/tools/designer/designer/pixmapfunction.ui
new file mode 100644
index 0000000..c456633
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/pixmapfunction.ui
@@ -0,0 +1,937 @@
+<!DOCTYPE UI><UI>
+<class>PixmapFunction</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget>
+ <class>TQDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PixmapFunction</cstring>
+ </property>
+ <property stdset="1">
+ <name>tqgeometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>300</width>
+ <height>108</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Choose Pixmap</string>
+ </property>
+ <property stdset="1">
+ <name>sizeGripEnabled</name>
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>TQLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Enter arguments for loading the pixmap</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>editArguments</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>TQFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame9</cstring>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>lineWidth</name>
+ <number>2</number>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>TQLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>labelFunction</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>QPixmap(</string>
+ </property>
+ <property stdset="1">
+ <name>palette</name>
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>233</red>
+ <green>233</green>
+ <blue>233</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ </widget>
+ <widget>
+ <class>TQLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>editArguments</cstring>
+ </property>
+ <property stdset="1">
+ <name>frame</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>palette</name>
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>233</red>
+ <green>233</green>
+ <blue>233</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ </widget>
+ <widget>
+ <class>TQLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>)</string>
+ </property>
+ <property stdset="1">
+ <name>palette</name>
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>233</red>
+ <green>233</green>
+ <blue>233</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer1</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>tqsizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>TQLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>TQPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>helpButton</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Help</string>
+ </property>
+ <property stdset="1">
+ <name>autoDefault</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>tqsizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>TQPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buttonOk</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;OK</string>
+ </property>
+ <property stdset="1">
+ <name>autoDefault</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>default</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>TQPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Cancel</string>
+ </property>
+ <property stdset="1">
+ <name>autoDefault</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapFunction</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapFunction</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/popupmenueditor.cpp b/tqtinterface/qt4/tools/designer/designer/popupmenueditor.cpp
new file mode 100644
index 0000000..d9d6a17
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/popupmenueditor.cpp
@@ -0,0 +1,1468 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqapplication.h>
+#include <tqcstring.h>
+#include <tqdatastream.h>
+#include <tqdragobject.h>
+#include <tqlineedit.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqpopupmenu.h>
+#include <tqrect.h>
+#include <tqsize.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
+#include "actiondnd.h"
+#include "actioneditorimpl.h"
+#include "command.h"
+#include "formfile.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "pixmapchooser.h"
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+// Drag Object Declaration -------------------------------------------
+
+class PopupMenuEditorItemPtrDrag : public TQStoredDrag
+{
+public:
+ PopupMenuEditorItemPtrDrag( PopupMenuEditorItem * item, TQWidget * tqparent = 0,
+ const char * name = 0 );
+ ~PopupMenuEditorItemPtrDrag() {};
+ static bool canDecode( TQDragMoveEvent * e );
+ static bool decode( TQDropEvent * e, PopupMenuEditorItem ** i );
+};
+
+// Drag Object Implementation ---------------------------------------
+
+PopupMenuEditorItemPtrDrag::PopupMenuEditorItemPtrDrag( PopupMenuEditorItem * item,
+ TQWidget * tqparent, const char * name )
+ : TQStoredDrag( "qt/popupmenueditoritemptr", tqparent, name )
+{
+ TQByteArray data( sizeof( TQ_LONG ) );
+ TQDataStream stream( data, IO_WriteOnly );
+ stream << ( TQ_LONG ) item;
+ setEncodedData( data );
+}
+
+bool PopupMenuEditorItemPtrDrag::canDecode( TQDragMoveEvent * e )
+{
+ return e->provides( "qt/popupmenueditoritemptr" );
+}
+
+bool PopupMenuEditorItemPtrDrag::decode( TQDropEvent * e, PopupMenuEditorItem ** i )
+{
+ TQByteArray data = e->tqencodedData( "qt/popupmenueditoritemptr" );
+ TQDataStream stream( data, IO_ReadOnly );
+
+ if ( !data.size() )
+ return FALSE;
+
+ TQ_LONG p = 0;
+ stream >> p;
+ *i = ( PopupMenuEditorItem *) p;
+
+ return TRUE;
+}
+
+// PopupMenuEditorItem Implementation -----------------------------------
+
+PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditor * menu, TQObject * tqparent, const char * name )
+ : TQObject( tqparent, name ),
+ a( 0 ),
+ s( 0 ),
+ m( menu ),
+ separator( FALSE ),
+ removable( FALSE )
+{
+ init();
+ a = new TQAction( this );
+ TQObject::connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( selfDestruct() ) );
+}
+
+
+PopupMenuEditorItem::PopupMenuEditorItem( TQAction * action, PopupMenuEditor * menu,
+ TQObject * tqparent, const char * name )
+ : TQObject( tqparent, name ),
+ a( action ),
+ s( 0 ),
+ m( menu ),
+ separator( FALSE ),
+ removable( TRUE )
+{
+ init();
+ if ( /*a->name() == "qt_separator_action" ||*/ ::tqqt_cast<TQSeparatorAction*>(a) )
+ separator = TRUE;
+ if ( a && !a->childrenListObject().isEmpty() )
+ a->installEventFilter( this );
+}
+
+PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuEditor * menu,
+ TQObject * tqparent, const char * name )
+ : TQObject( tqparent, name ),
+ a( item->a ),
+ s( 0 ),
+ m( menu ),
+ separator( item->separator ),
+ removable( item->removable )
+{
+ init();
+ if ( ::tqqt_cast<TQActionGroup*>(a) )
+ a->installEventFilter( this );
+}
+
+PopupMenuEditorItem::~PopupMenuEditorItem()
+{
+
+}
+
+void PopupMenuEditorItem::init()
+{
+ if ( a ) {
+ TQObject::connect( a, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( selfDestruct() ) );
+ if ( m && !isSeparator() ) {
+ s = new PopupMenuEditor( m->formWindow(), m );
+ TQString n = "popupMenu";
+ m->formWindow()->unify( s, n, TRUE );
+ s->setName( n );
+ MetaDataBase::addEntry( s );
+ }
+ }
+}
+
+PopupMenuEditorItem::ItemType PopupMenuEditorItem::type() const
+{
+ if ( separator )
+ return Separator;
+ else if ( a )
+ return Action;
+ return Unknown;
+}
+
+void PopupMenuEditorItem::tqsetVisible( bool enable )
+{
+ if ( a )
+ a->tqsetVisible( enable );
+}
+
+bool PopupMenuEditorItem::isVisible() const
+{
+ TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(a);
+ if ( g )
+ return ( g->isVisible() && g->usesDropDown() );
+ else if ( a )
+ return a->isVisible();
+ return FALSE;
+}
+
+void PopupMenuEditorItem::showMenu( int x, int y )
+{
+ if ( ( !separator ) && s ) {
+ s->move( x, y );
+ s->show();
+ s->raise();
+ }
+}
+
+void PopupMenuEditorItem::hideMenu()
+{
+ if ( s ) {
+ s->hideSubMenu();
+ s->hide();
+ }
+}
+
+void PopupMenuEditorItem::focusOnMenu()
+{
+ if ( s ) {
+ s->showSubMenu();
+ s->setFocus();
+ }
+}
+
+int PopupMenuEditorItem::count() const
+{
+ if ( s ) {
+ return s->count();
+ } else if ( ::tqqt_cast<TQActionGroup*>(a) ) {
+ if ( !a->childrenListObject().isEmpty() )
+ return a->childrenListObject().count();
+ }
+ return 0;
+}
+
+bool PopupMenuEditorItem::eventFilter( TQObject * o, TQEvent * event )
+{
+ if ( ! ::tqqt_cast<TQActionGroup*>( o ) )
+ return FALSE;
+ if ( event->type() == TQEvent::ChildInserted ) {
+ TQChildEvent * ce = ( TQChildEvent * ) event;
+ TQObject * c = TQT_TQOBJECT(ce->child());
+ TQAction * action = ::tqqt_cast<TQAction*>( c );
+ if ( s->tqfind( action ) != -1 ) // avoid duplicates
+ return FALSE;
+ TQActionGroup * actionGroup = ::tqqt_cast<TQActionGroup*>( c );
+ if ( actionGroup )
+ s->insert( actionGroup );
+ else if ( action )
+ s->insert( action );
+ }
+ return FALSE;
+}
+
+void PopupMenuEditorItem::selfDestruct()
+{
+ hideMenu();
+ int i = m->tqfind( s );
+ if ( i != -1 && i < m->count() )
+ m->remove( i ); // remove this item
+ a = 0; // the selfDestruct call was caused by the deletion of the action
+ delete this;
+}
+
+// PopupMenuEditor Implementation -----------------------------------
+
+PopupMenuEditorItem * PopupMenuEditor::draggedItem = 0;
+int PopupMenuEditor::clipboardOperation = 0;
+PopupMenuEditorItem * PopupMenuEditor::clipboardItem = 0;
+
+PopupMenuEditor::PopupMenuEditor( FormWindow * fw, TQWidget * tqparent, const char * name )
+ : TQWidget( 0, name, (WFlags)(WStyle_Customize | TQt::WStyle_NoBorder | WRepaintNoErase | TQt::WResizeNoErase) ),
+ formWnd( fw ),
+ parentMenu( tqparent ),
+ iconWidth( 0 ),
+ textWidth( 0 ),
+ accelWidth( 0 ),
+ arrowWidth( 30 ),
+ borderSize( 2 ),
+ currentField( 1 ),
+ currentIndex( 0 )
+{
+ init();
+}
+
+PopupMenuEditor::PopupMenuEditor( FormWindow * fw, PopupMenuEditor * menu,
+ TQWidget * tqparent, const char * name )
+ : TQWidget( 0, name, (WFlags)(WStyle_Customize | TQt::WStyle_NoBorder | WRepaintNoErase) ),
+ formWnd( fw ),
+ parentMenu( tqparent ),
+ iconWidth( menu->iconWidth ),
+ textWidth( menu->textWidth ),
+ accelWidth( menu->accelWidth ),
+ arrowWidth( menu->arrowWidth ),
+ borderSize( menu->borderSize ),
+ currentField( menu->currentField ),
+ currentIndex( menu->currentIndex )
+{
+ init();
+ PopupMenuEditorItem * i;
+ for ( i = menu->itemList.first(); i; i = menu->itemList.next() ) {
+ PopupMenuEditorItem * n = new PopupMenuEditorItem( i, this );
+ itemList.append( n );
+ }
+}
+
+PopupMenuEditor::~PopupMenuEditor()
+{
+ itemList.setAutoDelete( TRUE );
+}
+
+void PopupMenuEditor::init()
+{
+ reparent( ( TQMainWindow * ) formWnd->mainContainer(), pos() );
+
+ addItem.action()->setMenuText( tr("new item") );
+ addSeparator.action()->setMenuText( tr("new separator") );
+
+ setAcceptDrops( TRUE );
+ setFocusPolicy( Qt::StrongFocus );
+
+ lineEdit = new TQLineEdit( this );
+ lineEdit->hide();
+ lineEdit->setFrameStyle(TQFrame::Plain | TQFrame::NoFrame);
+ lineEdit->polish();
+ lineEdit->setBackgroundOrigin(TQWidget::ParentOrigin);
+ lineEdit->setBackgroundMode(TQt::PaletteButton);
+ lineEdit->installEventFilter( this );
+
+ dropLine = new TQWidget( this, 0, (WFlags)(TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop) );
+ dropLine->setBackgroundColor( TQt::red );
+ dropLine->hide();
+
+ hide();
+}
+
+void PopupMenuEditor::insert( PopupMenuEditorItem * item, int index )
+{
+ if ( !item )
+ return;
+ if ( index == -1 ) {
+ itemList.append( item );
+ if ( isVisible() )
+ currentIndex = itemList.count() - 1;
+ } else {
+ itemList.insert( index, item );
+ if ( isVisible() )
+ currentIndex = index;
+ }
+ item->m = this;
+ if (item->s)
+ item->s->parentMenu = this;
+ resizeToContents();
+ if ( isVisible() && parentMenu )
+ parentMenu->update(); // draw arrow in tqparent menu
+ emit inserted( item->action() );
+}
+
+void PopupMenuEditor::insert( TQAction * action, int index )
+{
+ if ( !action )
+ return;
+ insert( new PopupMenuEditorItem( action, this, 0, action->name() ), index );
+}
+
+void PopupMenuEditor::insert( TQActionGroup * actionGroup, int index )
+{
+ if ( !actionGroup )
+ return;
+ bool dropdown = actionGroup->usesDropDown();
+ PopupMenuEditorItem *i = new PopupMenuEditorItem( (TQAction *)actionGroup, this, 0,
+ TQString( actionGroup->name() ) + "Menu" );
+ TQActionGroup *g = 0;
+ TQObjectList *l = actionGroup->queryList( "TQAction", 0, FALSE, FALSE );
+ TQObjectListIterator it( *l );
+ insert( i, index );
+ for ( ; it.current(); ++it ) {
+ g = ::tqqt_cast<TQActionGroup*>(it.current());
+ if ( g ) {
+ if ( dropdown )
+ i->s->insert( g );
+ else
+ insert( g );
+ } else {
+ i->s->insert( (TQAction*)it.current() );
+ }
+ }
+ delete l;
+}
+
+int PopupMenuEditor::tqfind( const TQAction * action )
+{
+ PopupMenuEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->action() == action )
+ return itemList.at();
+ i = itemList.next();
+ }
+ return -1;
+}
+
+int PopupMenuEditor::tqfind( PopupMenuEditor * menu )
+{
+ PopupMenuEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->subMenu() == menu )
+ return itemList.at();
+ i = itemList.next();
+ }
+ return -1;
+}
+
+int PopupMenuEditor::count()
+{
+ return itemList.count();
+}
+
+PopupMenuEditorItem * PopupMenuEditor::at( int index )
+{
+ return itemList.at( index );
+}
+
+void PopupMenuEditor::exchange( int a, int b )
+{
+ PopupMenuEditorItem * ia = itemList.at( a );
+ PopupMenuEditorItem * ib = itemList.at( b );
+ if ( !ia || !ib ||
+ ia == &addItem || ia == &addSeparator ||
+ ib == &addItem || ib == &addSeparator )
+ return; // do nothing
+ itemList.tqreplace( b, ia );
+ itemList.tqreplace( a, ib );
+}
+
+void PopupMenuEditor::cut( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ clipboardOperation = Cut;
+ clipboardItem = itemList.at( idx );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ return; // do nothing
+ }
+
+ RemoveActionFromPopupCommand * cmd =
+ new RemoveActionFromPopupCommand( "Cut Item", formWnd, this, idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void PopupMenuEditor::copy( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ clipboardOperation = Copy;
+ clipboardItem = itemList.at( idx );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ }
+}
+
+void PopupMenuEditor::paste( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ if ( clipboardItem && clipboardOperation ) {
+ PopupMenuEditorItem * n = new PopupMenuEditorItem( clipboardItem, this );
+ AddActionToPopupCommand * cmd =
+ new AddActionToPopupCommand( "Paste Item", formWnd, this, n, idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void PopupMenuEditor::insertedActions( TQPtrList<TQAction> & list )
+{
+ TQAction * a = 0;
+ PopupMenuEditorItem * i = itemList.first();
+
+ while ( i ) {
+ a = i->action();
+ if ( a )
+ list.append( a );
+ i = itemList.next();
+ }
+}
+
+void PopupMenuEditor::show()
+{
+ resizeToContents();
+ TQWidget::show();
+}
+
+void PopupMenuEditor::choosePixmap( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ PopupMenuEditorItem * i = 0;
+ TQAction * a = 0;
+
+ if ( idx < (int)itemList.count() ) {
+ i = itemList.at( idx );
+ a = i->action();
+ } else {
+ createItem();
+ }
+
+ hide(); // qChoosePixmap hides the menu
+ TQIconSet icons( qChoosePixmap( 0, formWnd, 0, 0 ) );
+ SetActionIconsCommand * cmd =
+ new SetActionIconsCommand( "Set icon", formWnd, a, this, icons );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ show();
+ setFocus();
+}
+
+void PopupMenuEditor::showLineEdit( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ PopupMenuEditorItem * i = 0;
+
+ if ( idx >= (int)itemList.count() )
+ i = &addItem;
+ else
+ i = itemList.at( idx );
+
+ // open edit currentField for item name
+ lineEdit->setText( i->action()->menuText() );
+ lineEdit->selectAll();
+ lineEdit->setGeometry( borderSize + iconWidth, borderSize + itemPos( i ),
+ textWidth, itemHeight( i ) );
+ lineEdit->show();
+ lineEdit->setFocus();
+}
+
+void PopupMenuEditor::setAccelerator( int key, TQt::ButtonState state, int index )
+{
+ // FIXME: make this a command
+
+ int idx = ( index == -1 ? currentIndex : index );
+
+ if ( key == TQt::Key_Shift ||
+ key == TQt::Key_Control ||
+ key == TQt::Key_Alt ||
+ key == TQt::Key_Meta ||
+ key == TQt::Key_unknown )
+ return; // ignore these keys when they are pressed
+
+ PopupMenuEditorItem * i = 0;
+
+ if ( idx >= (int)itemList.count() )
+ i = createItem();
+ else
+ i = itemList.at( idx );
+
+ int shift = ( state & ShiftButton ? TQt::SHIFT : 0 );
+ int ctrl = ( state & ControlButton ? TQt::CTRL : 0 );
+ int alt = ( state & TQt::AltButton ? TQt::ALT : 0 );
+ int meta = ( state & TQt::MetaButton ? TQt::META : 0 );
+
+ TQAction * a = i->action();
+ TQKeySequence ks = a->accel();
+ int keys[4] = { ks[0], ks[1], ks[2], ks[3] };
+ int n = 0;
+ while ( n < 4 && ks[n++] );
+ n--;
+ if ( n < 4 )
+ keys[n] = key | shift | ctrl | alt | meta;
+ a->setAccel( TQKeySequence( keys[0], keys[1], keys[2], keys[3] ) );
+ MetaDataBase::setPropertyChanged( a, "accel", TRUE );
+ resizeToContents();
+}
+
+void PopupMenuEditor::resizeToContents()
+{
+ TQSize s = contentsSize();
+ dropLine->resize( s.width(), 2 );
+ s.rwidth() += borderSize * 2;
+ s.rheight() += borderSize * 2;
+ resize( s );
+}
+
+void PopupMenuEditor::showSubMenu()
+{
+ if ( currentIndex < (int)itemList.count() ) {
+ itemList.at( currentIndex )->showMenu( pos().x() + width() - borderSize * 3,
+ pos().y() + itemPos( at( currentIndex ) ) +
+ borderSize * 2 );
+ setFocus(); // Keep focus in this widget
+ }
+}
+
+void PopupMenuEditor::hideSubMenu()
+{
+ if ( currentIndex < (int)itemList.count() )
+ itemList.at( currentIndex )->hideMenu();
+}
+
+void PopupMenuEditor::focusOnSubMenu()
+{
+ if ( currentIndex < (int)itemList.count() )
+ itemList.at( currentIndex )->focusOnMenu();
+}
+
+// This function has no undo. It is only here to remove an item when its action was
+// removed from the action editor.
+// Use removeItem to put the command on the command stack.
+void PopupMenuEditor::remove( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+ PopupMenuEditorItem * i = itemList.at( idx );
+ if ( i && i->isRemovable() ) {
+ itemList.remove( idx );
+ int n = itemList.count() + 1;
+ if ( currentIndex >= n )
+ currentIndex = itemList.count() + 1;
+ emit removed( i->action() );
+ resizeToContents();
+ }
+}
+
+PopupMenuEditorItem * PopupMenuEditor::createItem( TQAction * a )
+{
+ ActionEditor * ae = (ActionEditor *) formWindow()->mainWindow()->child( 0, "ActionEditor" );
+ if ( !a )
+ a = ae->newActionEx();
+ PopupMenuEditorItem * i = new PopupMenuEditorItem( a, this );
+ TQString n = TQString( a->name() ) + "Item";
+ formWindow()->unify( i, n, FALSE );
+ i->setName( n );
+ AddActionToPopupCommand * cmd =
+ new AddActionToPopupCommand( "Add Item", formWnd, this, i );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ return i;
+}
+
+void PopupMenuEditor::removeItem( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+ if ( idx < (int)itemList.count() ) {
+ RemoveActionFromPopupCommand * cmd = new RemoveActionFromPopupCommand( "Remove Item",
+ formWnd,
+ this,
+ idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ if ( itemList.count() == 0 && parentMenu )
+ parentMenu->update();
+ resizeToContents();
+ }
+}
+
+PopupMenuEditorItem * PopupMenuEditor::currentItem()
+{
+ int count = itemList.count();
+ if ( currentIndex < count )
+ return itemList.at( currentIndex );
+ else if ( currentIndex == count )
+ return &addItem;
+ return &addSeparator;
+}
+
+PopupMenuEditorItem * PopupMenuEditor::itemAt( int y )
+{
+ PopupMenuEditorItem * i = itemList.first();
+ int iy = 0;
+
+ while ( i ) {
+ iy += itemHeight( i );
+ if ( iy > y )
+ return i;
+ i = itemList.next();
+ }
+ iy += itemHeight( &addItem );
+ if ( iy > y )
+ return &addItem;
+ return &addSeparator;
+}
+
+void PopupMenuEditor::setFocusAt( const TQPoint & pos )
+{
+ hideSubMenu();
+ lineEdit->hide();
+
+ currentIndex = 0;
+ int iy = 0;
+ PopupMenuEditorItem * i = itemList.first();
+
+ while ( i ) {
+ iy += itemHeight( i );
+ if ( iy > pos.y() )
+ break;
+ i = itemList.next();
+ currentIndex++;
+ }
+
+ iy += itemHeight( &addItem );
+ if ( iy <= pos.y() )
+ currentIndex++;
+
+ if ( currentIndex < (int)itemList.count() ) {
+ if ( pos.x() < iconWidth )
+ currentField = 0;
+ else if ( pos.x() < iconWidth + textWidth )
+ currentField = 1;
+ else
+ currentField = 2;
+ } else {
+ currentField = 1;
+ }
+
+ showSubMenu();
+}
+
+bool PopupMenuEditor::eventFilter( TQObject * o, TQEvent * e )
+{
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(lineEdit) && e->type() == TQEvent::FocusOut ) {
+ leaveEditMode( 0 );
+ update();
+ }
+ return TQWidget::eventFilter( o, e );
+}
+
+void PopupMenuEditor::paintEvent( TQPaintEvent * )
+{
+ TQPainter p( this );
+ p.save();
+ TQRegion reg( rect() );
+ TQRegion mid( borderSize, borderSize,
+ rect().width() - borderSize * 2, rect().height() - borderSize * 2 );
+ reg -= mid;
+ p.setClipRegion( reg );
+ tqstyle().tqdrawPrimitive( TQStyle::PE_PanelPopup, &p, rect(), tqcolorGroup() );
+ p.restore();
+ drawItems( &p );
+}
+
+void PopupMenuEditor::mousePressEvent( TQMouseEvent * e )
+{
+ mousePressPos = e->pos();
+ setFocusAt( mousePressPos );
+ e->accept();
+ update();
+}
+
+void PopupMenuEditor::mouseDoubleClickEvent( TQMouseEvent * )
+{
+ setFocusAt( mousePressPos );
+ if ( currentItem() == &addSeparator ) {
+ PopupMenuEditorItem * i = createItem( new TQSeparatorAction( 0 ) );
+ i->setSeparator( TRUE );
+ return;
+ }
+ if ( currentField == 0 ) {
+ choosePixmap();
+ resizeToContents();
+ } else if ( currentField == 1 ) {
+ showLineEdit();
+ }
+}
+
+void PopupMenuEditor::mouseMoveEvent( TQMouseEvent * e )
+{
+ if ( e->state() & Qt::LeftButton ) {
+ if ( ( e->pos() - mousePressPos ).manhattanLength() > 3 ) {
+ draggedItem = itemAt( mousePressPos.y() );
+ if ( draggedItem == &addItem ) {
+ draggedItem = createItem();
+ RenameActionCommand cmd( "Rename Item", formWnd, draggedItem->action(),
+ this, "Unnamed" );
+ cmd.execute();
+ // FIXME: start rename after drop
+ } else if ( draggedItem == &addSeparator ) {
+ draggedItem = createItem( new TQSeparatorAction( 0 ) );
+ draggedItem->setSeparator( TRUE );
+ }
+
+ PopupMenuEditorItemPtrDrag * d =
+ new PopupMenuEditorItemPtrDrag( draggedItem, this );
+
+ hideSubMenu();
+
+ draggedItem->tqsetVisible( FALSE );
+ resizeToContents();
+
+ // If the item is dropped in the same list,
+ // we will have two instances of the same pointer
+ // in the list. We use node instead.
+ int idx = itemList.tqfind( draggedItem );
+ TQLNode * node = itemList.currentNode();
+
+ d->dragCopy(); // dragevents and stuff happens
+
+ if ( draggedItem ) { // item was not dropped
+ draggedItem->tqsetVisible( TRUE );
+ draggedItem = 0;
+ if ( hasFocus() ) {
+ hideSubMenu();
+ resizeToContents();
+ showSubMenu();
+ }
+ } else { // item was dropped
+ itemList.takeNode( node )->tqsetVisible( TRUE );
+ if ( currentIndex > 0 && currentIndex > idx )
+ --currentIndex;
+ // the drop might happen in another menu, so we'll resize
+ // and show the submenu there
+ }
+ }
+ }
+}
+
+void PopupMenuEditor::dragEnterEvent( TQDragEnterEvent * e )
+{
+ if ( e->provides( "qt/popupmenueditoritemptr" ) ||
+ e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-actiongroup" ) ) {
+ e->accept();
+ dropLine->show();
+ }
+}
+
+void PopupMenuEditor::dragLeaveEvent( TQDragLeaveEvent * )
+{
+ dropLine->hide();
+}
+
+void PopupMenuEditor::dragMoveEvent( TQDragMoveEvent * e )
+{
+ TQPoint pos = e->pos();
+ dropLine->move( borderSize, snapToItem( pos.y() ) );
+
+ if ( currentItem() != itemAt( pos.y() ) ) {
+ hideSubMenu();
+ setFocusAt( pos );
+ showSubMenu();
+ }
+}
+
+void PopupMenuEditor::dropEvent( TQDropEvent * e )
+{
+ if ( !( e->provides( "qt/popupmenueditoritemptr" ) ||
+ e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-actiongroup" ) ) )
+ return;
+
+ // Hide the sub menu of the current item, but do it later
+ if ( currentIndex < (int)itemList.count() ) {
+ PopupMenuEditor *s = itemList.at( currentIndex )->s;
+ TQTimer::singleShot( 0, s, TQT_SLOT( hide() ) );
+ }
+
+ draggedItem = 0;
+ PopupMenuEditorItem * i = 0;
+
+ if ( e->provides( "qt/popupmenueditoritemptr" ) ) {
+ PopupMenuEditorItemPtrDrag::decode( e, &i );
+ } else {
+ if ( e->provides( "application/x-designer-actiongroup" ) ) {
+ TQActionGroup * g = ::tqqt_cast<TQDesignerActionGroup*>(ActionDrag::action());
+ if ( g->usesDropDown() ) {
+ i = new PopupMenuEditorItem( g, this );
+ TQString n = TQString( g->name() ) + "Item";
+ formWindow()->unify( i, n, FALSE );
+ i->setName( n );
+ TQObjectList *l = g->queryList( "TQAction", 0, FALSE, FALSE );
+ TQObjectListIterator it( *l );
+ for ( ; it.current(); ++it ) {
+ g = ::tqqt_cast<TQActionGroup*>(it.current());
+ if ( g )
+ i->s->insert( g );
+ else
+ i->s->insert( (TQAction*)it.current() );
+ }
+ delete l;
+ } else {
+ dropInPlace( g, e->pos().y() );
+ }
+ } else if ( e->provides( "application/x-designer-actions" ) ) {
+ TQAction *a = ::tqqt_cast<TQDesignerAction*>(ActionDrag::action());
+ i = new PopupMenuEditorItem( a, this );
+ }
+ }
+
+ if ( i ) {
+ dropInPlace( i, e->pos().y() );
+ TQTimer::singleShot( 0, this, TQT_SLOT( resizeToContents() ) );
+ }
+
+ TQTimer::singleShot( 0, this, TQT_SLOT( showSubMenu() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( setFocus() ) );
+ dropLine->hide();
+ e->accept();
+}
+
+void PopupMenuEditor::keyPressEvent( TQKeyEvent * e )
+{
+ if ( lineEdit->isHidden() ) { // In navigation mode
+
+ switch ( e->key() ) {
+
+ case TQt::Key_Delete:
+ hideSubMenu();
+ removeItem();
+ showSubMenu();
+ break;
+
+ case TQt::Key_Backspace:
+ clearCurrentField();
+ break;
+
+ case TQt::Key_Up:
+ navigateUp( e->state() & ControlButton );
+ break;
+
+ case TQt::Key_Down:
+ navigateDown( e->state() & ControlButton );
+ break;
+
+ case TQt::Key_Left:
+ navigateLeft();
+ break;
+
+ case TQt::Key_Right:
+ navigateRight();
+ break;
+
+ case TQt::Key_PageUp:
+ currentIndex = 0;
+ break;
+
+ case TQt::Key_PageDown:
+ currentIndex = itemList.count();
+ break;
+
+ case TQt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_F2:
+ enterEditMode( e );
+ // move on
+ case TQt::Key_Alt:
+ case TQt::Key_Shift:
+ case TQt::Key_Control:
+ // do nothing
+ return;
+
+ case Key_Escape:
+ currentField = 0;
+ navigateLeft();
+ break;
+
+ case TQt::Key_C:
+ if ( e->state() & ControlButton &&
+ currentIndex < (int)itemList.count() ) {
+ copy( currentIndex );
+ break;
+ }
+
+ case TQt::Key_X:
+ if ( e->state() & ControlButton &&
+ currentIndex < (int)itemList.count() ) {
+ hideSubMenu();
+ cut( currentIndex );
+ showSubMenu();
+ break;
+ }
+
+ case TQt::Key_V:
+ if ( e->state() & ControlButton ) {
+ hideSubMenu();
+ paste( currentIndex < (int)itemList.count() ? currentIndex + 1: itemList.count() );
+ showSubMenu();
+ break;
+ }
+
+ default:
+ if ( currentItem()->isSeparator() )
+ return;
+ if ( currentField == 1 ) {
+ showLineEdit();
+ TQApplication::sendEvent( lineEdit, e );
+ e->accept();
+ return;
+ } else if ( currentField == 2 ) {
+ setAccelerator( e->key(), e->state() );
+ showSubMenu();
+ }
+ break;
+
+ }
+
+ } else { // In edit mode
+ switch ( e->key() ) {
+ case TQt::Key_Enter:
+ case TQt::Key_Return:
+ case Key_Escape:
+ leaveEditMode( e );
+ e->accept();
+ return;
+ }
+ }
+ update();
+}
+
+void PopupMenuEditor::focusInEvent( TQFocusEvent * )
+{
+ showSubMenu();
+ update();
+ parentMenu->update();
+}
+
+void PopupMenuEditor::focusOutEvent( TQFocusEvent * )
+{
+ TQWidget * fw = tqApp->tqfocusWidget();
+ if ( !fw || ( !::tqqt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) {
+ hideSubMenu();
+ if ( fw && ::tqqt_cast<MenuBarEditor*>(fw) )
+ return;
+ TQWidget * w = this;
+ while ( w && w != fw && ::tqqt_cast<PopupMenuEditor*>(w) ) { // hide all popups
+ w->hide();
+ w = ((PopupMenuEditor *)w)->parentEditor();
+ }
+ }
+}
+
+void PopupMenuEditor::drawItem( TQPainter * p, PopupMenuEditorItem * i,
+ const TQRect & r, int f ) const
+{
+ int x = r.x();
+ int y = r.y();
+ int h = r.height();
+
+ p->fillRect( r, tqcolorGroup().brush( TQColorGroup::Background ) );
+
+ if ( i->isSeparator() ) {
+ tqstyle().tqdrawPrimitive( TQStyle::PE_Separator, p,
+ TQRect( r.x(), r.y() + 2, r.width(), 1 ),
+ tqcolorGroup(), TQStyle::Style_Sunken | (QStyle::StateFlag)f );
+ return;
+ }
+
+ const TQAction * a = i->action();
+ if ( a->isToggleAction() && a->isOn() ) {
+ tqstyle().tqdrawPrimitive( TQStyle::PE_CheckMark, p,
+ TQRect( x , y, iconWidth, h ),
+ tqcolorGroup(), (QStyle::StateFlag)f );
+ } else {
+ TQPixmap icon = a->iconSet().pixmap( TQIconSet::Automatic, TQIconSet::Normal );
+ p->drawPixmap( x + ( iconWidth - icon.width() ) / 2,
+ y + ( h - icon.height() ) / 2,
+ icon );
+ }
+ x += iconWidth;
+ p->drawText( x, y, textWidth, h,
+ TQt::AlignLeft |
+ TQt::AlignVCenter |
+ TQt::ShowPrefix |
+ TQt::SingleLine,
+ a->menuText() );
+
+ x += textWidth + borderSize * 3;
+ p->drawText( x, y, accelWidth, h,
+ TQt::AlignLeft | TQt::AlignVCenter,
+ a->accel() );
+ if ( i->count() ) // Item has submenu
+ tqstyle().tqdrawPrimitive( TQStyle::PE_ArrowRight, p,
+ TQRect( r.width() - arrowWidth, r.y(), arrowWidth, r.height() ),
+ tqcolorGroup(), (QStyle::StateFlag)f );
+}
+
+void PopupMenuEditor::drawWinFocusRect( TQPainter * p, const TQRect & r ) const
+{
+ if ( currentIndex < (int)itemList.count() &&
+ ((PopupMenuEditor*)this)->itemList.at( currentIndex )->isSeparator() ) {
+ p->drawWinFocusRect( borderSize, r.y(), width() - borderSize * 2, r.height() );
+ return;
+ }
+ int y = r.y();
+ int h = r.height();
+ if ( currentField == 0 )
+ p->drawWinFocusRect( borderSize + 1, y, iconWidth - 2, h );
+ else if ( currentField == 1 )
+ p->drawWinFocusRect( borderSize + iconWidth, y, textWidth, h );
+ else if ( currentField == 2 )
+ p->drawWinFocusRect( borderSize + iconWidth + textWidth +
+ borderSize * 3, y, accelWidth, h );
+}
+
+void PopupMenuEditor::drawItems( TQPainter * p )
+{
+ int flags = 0;
+ int idx = 0;
+
+ TQColorGroup enabled = tqcolorGroup();
+ TQColorGroup disabled = tqpalette().disabled();
+ TQRect focus;
+ TQRect rect( borderSize, borderSize, width() - borderSize * 2, 0 );
+
+ PopupMenuEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->isVisible() ) {
+ rect.setHeight( itemHeight( i ) );
+ if ( idx == currentIndex )
+ focus = rect;
+ if ( i->action()->isEnabled() ) {
+ flags = TQStyle::Style_Enabled;
+ p->setPen( enabled.buttonText() );
+ } else {
+ flags = TQStyle::Style_Default;
+ p->setPen( disabled.buttonText() );
+ }
+ drawItem( p, i, rect, flags );
+ rect.moveBy( 0, rect.height() );
+ }
+ i = itemList.next();
+ idx++;
+ }
+
+ // Draw the "add item" and "add separator" items
+ p->setPen( Qt::darkBlue );
+ rect.setHeight( itemHeight( &addItem ) );
+ if ( idx == currentIndex )
+ focus = rect;
+ drawItem( p, &addItem, rect, TQStyle::Style_Default );
+ rect.moveBy( 0, rect.height() );
+ idx++;
+ rect.setHeight( itemHeight( &addSeparator ) );
+ if ( idx == currentIndex )
+ focus = rect;
+ drawItem( p, &addSeparator, rect, TQStyle::Style_Default );
+ idx++;
+
+ if ( hasFocus() && !draggedItem )
+ drawWinFocusRect( p, focus );
+}
+
+TQSize PopupMenuEditor::contentsSize()
+{
+ TQRect textRect = fontMetrics().boundingRect( addSeparator.action()->menuText() );
+ textWidth = textRect.width();
+ accelWidth = textRect.height(); // default size
+ iconWidth = textRect.height();
+
+ int w = 0;
+ int h = itemHeight( &addItem ) + itemHeight( &addSeparator );
+ PopupMenuEditorItem * i = itemList.first();
+ TQAction * a = 0;
+ while ( i ) {
+ if ( i->isVisible() ) {
+ if ( !i->isSeparator() ) {
+ a = i->action();
+ w = a->iconSet().pixmap( TQIconSet::Automatic, TQIconSet::Normal ).rect().width() +
+ borderSize; // padding
+ iconWidth = TQMAX( iconWidth, w );
+ w = fontMetrics().boundingRect( a->menuText() ).width();
+ textWidth = TQMAX( textWidth, w );
+ w = fontMetrics().boundingRect( a->accel() ).width() + 2; // added padding?
+ accelWidth = TQMAX( accelWidth, w );
+ }
+ h += itemHeight( i );
+ }
+ i = itemList.next();
+ }
+
+ int width = iconWidth + textWidth + borderSize * 3 + accelWidth + arrowWidth;
+ return TQSize( width, h );
+}
+
+int PopupMenuEditor::itemHeight( const PopupMenuEditorItem * item ) const
+{
+ if ( !item || ( item && !item->isVisible() ) )
+ return 0;
+ if ( item->isSeparator() )
+ return 4; // FIXME: hardcoded ( get from styles )r
+ int padding = + borderSize * 6;
+ TQAction * a = item->action();
+ int h = a->iconSet().pixmap( TQIconSet::Automatic, TQIconSet::Normal ).rect().height();
+ h = TQMAX( h, fontMetrics().boundingRect( a->menuText() ).height() + padding );
+ h = TQMAX( h, fontMetrics().boundingRect( a->accel() ).height() + padding );
+ return h;
+}
+
+int PopupMenuEditor::itemPos( const PopupMenuEditorItem * item ) const
+{
+ PopupMenuEditor * that = ( PopupMenuEditor * ) this;
+ int y = 0;
+ PopupMenuEditorItem * i = that->itemList.first();
+ while ( i ) {
+ if ( i == item )
+ return y;
+ y += itemHeight( i );
+ i = that->itemList.next();
+ }
+ return y;
+}
+
+int PopupMenuEditor::snapToItem( int y )
+{
+ int iy = 0;
+ int dy = 0;
+
+ PopupMenuEditorItem * i = itemList.first();
+
+ while ( i ) {
+ dy = itemHeight( i );
+ if ( iy + dy / 2 > y )
+ return iy;
+ iy += dy;
+ i = itemList.next();
+ }
+
+ return iy;
+}
+
+void PopupMenuEditor::dropInPlace( PopupMenuEditorItem * i, int y )
+{
+ int iy = 0;
+ int dy = 0;
+ int idx = 0;
+
+ PopupMenuEditorItem * n = itemList.first();
+
+ while ( n ) {
+ dy = itemHeight( n );
+ if ( iy + dy / 2 > y )
+ break;
+ iy += dy;
+ idx++;
+ n = itemList.next();
+ }
+ int same = itemList.tqfindRef( i );
+ AddActionToPopupCommand * cmd = new AddActionToPopupCommand( "Drop Item", formWnd, this, i, idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ currentIndex = ( same >= 0 && same < idx ) ? idx - 1 : idx;
+ currentField = 1;
+}
+
+void PopupMenuEditor::dropInPlace( TQActionGroup * g, int y )
+{
+ if (g->childrenListObject().isEmpty())
+ return;
+ TQObjectList l = g->childrenListObject();
+ for ( int i = 0; i < (int)l.count(); ++i ) {
+ TQAction *a = ::tqqt_cast<TQAction*>(l.at(i));
+ TQActionGroup *g = ::tqqt_cast<TQActionGroup*>(l.at(i));
+ if ( g )
+ dropInPlace( g, y );
+ else if ( a )
+ dropInPlace( new PopupMenuEditorItem( a, this ), y );
+ }
+}
+
+void PopupMenuEditor::safeDec()
+{
+ do {
+ currentIndex--;
+ } while ( currentIndex > 0 && !currentItem()->isVisible() );
+ if ( currentIndex == 0 &&
+ !currentItem()->isVisible() &&
+ parentMenu ) {
+ parentMenu->setFocus();
+ }
+}
+
+void PopupMenuEditor::safeInc()
+{
+ int max = itemList.count() + 1;
+ if ( currentIndex < max ) {
+ do {
+ currentIndex++;
+ } while ( currentIndex < max && !currentItem()->isVisible() ); // skip invisible items
+ }
+}
+
+void PopupMenuEditor::clearCurrentField()
+{
+ if ( currentIndex >= (int)itemList.count() )
+ return; // currentIndex is addItem or addSeparator
+ PopupMenuEditorItem * i = currentItem();
+ hideSubMenu();
+ if ( i->isSeparator() )
+ return;
+ if ( currentField == 0 ) {
+ TQIconSet icons( 0 );
+ SetActionIconsCommand * cmd = new SetActionIconsCommand( "Remove icon",
+ formWnd,
+ i->action(),
+ this,
+ icons );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( currentField == 2 ) {
+ i->action()->setAccel( 0 );
+ }
+ resizeToContents();
+ showSubMenu();
+ return;
+}
+
+void PopupMenuEditor::navigateUp( bool ctrl )
+{
+ if ( currentIndex > 0 ) {
+ hideSubMenu();
+ if ( ctrl ) {
+ ExchangeActionInPopupCommand * cmd =
+ new ExchangeActionInPopupCommand( "Move Item Up",
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex - 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeDec();
+ } else {
+ safeDec();
+ }
+ showSubMenu();
+ } else if ( parentMenu ) {
+ parentMenu->setFocus();
+ parentMenu->update();
+ }
+}
+
+void PopupMenuEditor::navigateDown( bool ctrl )
+{
+ hideSubMenu();
+ if ( ctrl ) {
+ if ( currentIndex < ( (int)itemList.count() - 1 ) ) { // safe index
+ ExchangeActionInPopupCommand * cmd =
+ new ExchangeActionInPopupCommand( "Move Item Down",
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex + 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeInc();
+ }
+ } else { // ! Ctrl
+ safeInc();
+ }
+ if ( currentIndex >= (int)itemList.count() )
+ currentField = 1;
+ showSubMenu();
+}
+
+void PopupMenuEditor::navigateLeft()
+{
+ if ( currentItem()->isSeparator() ||
+ currentIndex >= (int)itemList.count() ||
+ currentField == 0 ) {
+ if ( parentMenu ) {
+ hideSubMenu();
+ parentMenu->setFocus();
+ } else if ( !currentItem()->isSeparator() ) {
+ currentField = 2;
+ }
+ } else {
+ currentField--;
+ }
+}
+
+void PopupMenuEditor::navigateRight()
+{
+ if ( !currentItem()->isSeparator() &&
+ currentIndex < (int)itemList.count() ) {
+ if ( currentField == 2 ) {
+ focusOnSubMenu();
+ } else {
+ currentField++;
+ currentField %= 3;
+ }
+ }
+}
+
+void PopupMenuEditor::enterEditMode( TQKeyEvent * e )
+{
+ PopupMenuEditorItem * i = currentItem();
+
+ if ( i == &addSeparator ) {
+ i = createItem( new TQSeparatorAction( 0 ) );
+ } else if ( i->isSeparator() ) {
+ return;
+ } else if ( currentField == 0 ) {
+ choosePixmap();
+ } else if ( currentField == 1 ) {
+ showLineEdit();
+ return;
+ } else {// currentField == 2
+ setAccelerator( e->key(), e->state() );
+ }
+ showSubMenu();
+ return;
+}
+
+void PopupMenuEditor::leaveEditMode( TQKeyEvent * e )
+{
+ setFocus();
+ lineEdit->hide();
+
+ PopupMenuEditorItem * i = 0;
+ if ( e && e->key() == Key_Escape ) {
+ update();
+ return;
+ }
+
+ if ( currentIndex >= (int)itemList.count() ) {
+ // new item was created
+ TQAction * a = formWnd->mainWindow()->actioneditor()->newActionEx();
+ TQString actionText = lineEdit->text();
+ actionText.tqreplace("&&", "&");
+ TQString menuText = lineEdit->text();
+ a->setText( actionText );
+ a->setMenuText( menuText );
+ i = createItem( a );
+ TQString n = constructName( i );
+ formWindow()->unify( a, n, TRUE );
+ a->setName( n );
+ MetaDataBase::addEntry( a );
+ MetaDataBase::setPropertyChanged( a, "menuText", TRUE );
+ ActionEditor *ae = (ActionEditor*)formWindow()->mainWindow()->child( 0, "ActionEditor" );
+ if ( ae )
+ ae->updateActionName( a );
+ } else {
+ i = itemList.at( currentIndex );
+ RenameActionCommand * cmd = new RenameActionCommand( "Rename Item",
+ formWnd,
+ i->action(),
+ this,
+ lineEdit->text() );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ resizeToContents();
+
+ if ( !i )
+ return;
+
+ if ( i->isSeparator() )
+ hideSubMenu();
+ else
+ showSubMenu();
+}
+
+TQString PopupMenuEditor::constructName( PopupMenuEditorItem *item )
+{
+ TQString s;
+ TQString name = item->action()->menuText();
+ TQWidget *e = parentEditor();
+ PopupMenuEditor *p = ::tqqt_cast<PopupMenuEditor*>(e);
+ if ( p ) {
+ int idx = p->tqfind( item->m );
+ PopupMenuEditorItem * i = ( idx > -1 ? p->at( idx ) : 0 );
+ s = ( i ? TQString( i->action()->name() ).remove( "Action" ) : TQString( "" ) );
+ } else {
+ MenuBarEditor *b = ::tqqt_cast<MenuBarEditor*>(e);
+ if ( b ) {
+ int idx = b->tqfindItem( item->m );
+ MenuBarEditorItem * i = ( idx > -1 ? b->item( idx ) : 0 );
+ s = ( i ? i->menuText().lower() : TQString( "" ) );
+ }
+ }
+ // tqreplace illegal characters
+
+ return ( RenameMenuCommand::makeLegal( s ) +
+ RenameMenuCommand::makeLegal( name ) + "Action" );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/popupmenueditor.h b/tqtinterface/qt4/tools/designer/designer/popupmenueditor.h
new file mode 100644
index 0000000..df070d9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/popupmenueditor.h
@@ -0,0 +1,244 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef POPUPMENUEDITOR_H
+#define POPUPMENUEDITOR_H
+
+#include <tqwidget.h>
+#include <tqptrlist.h>
+#include <tqaction.h>
+
+class PopupMenuEditor;
+class TQMenuItem;
+
+class PopupMenuEditorItem : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+ friend class PopupMenuEditor;
+
+ PopupMenuEditorItem( PopupMenuEditor * menu = 0, TQObject * tqparent = 0, const char * name = 0 );
+
+public:
+ enum ItemType {
+ Unknown = -1,
+ Separator = 0,
+ Action = 1
+ };
+
+ PopupMenuEditorItem( TQAction * action, PopupMenuEditor * menu,
+ TQObject * tqparent = 0, const char * name = 0 );
+ PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuEditor * menu,
+ TQObject * tqparent = 0, const char * name = 0 );
+ ~PopupMenuEditorItem();
+
+ void init();
+
+ ItemType type() const;
+ TQAction * action() const { return a; }
+
+ void tqsetVisible( bool enable );
+ bool isVisible() const;
+
+ void setSeparator( bool enable ) { separator = enable; }
+ bool isSeparator() const { return separator; }
+
+ void setRemovable( bool enable ) { removable = enable; }
+ bool isRemovable() const { return removable; }
+
+ void showMenu( int x, int y );
+ void hideMenu();
+ void focusOnMenu();
+ PopupMenuEditor * subMenu() const { return s; }
+
+ int count() const;
+
+ bool eventFilter( TQObject *, TQEvent * event );
+
+public Q_SLOTS:
+ void selfDestruct();
+
+protected:
+
+private:
+ TQAction * a;
+ PopupMenuEditor * s;
+ PopupMenuEditor * m;
+ uint separator : 1;
+ uint removable : 1;
+};
+
+class FormWindow;
+class MainWindow;
+class TQLineEdit;
+
+#include <tqpopupmenu.h>
+
+class PopupMenuEditor : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+ friend class PopupMenuEditorItem;
+ friend class MenuBarEditor;
+ friend class Resource;
+
+public:
+ PopupMenuEditor( FormWindow * fw, TQWidget * tqparent = 0, const char * name = 0 );
+ PopupMenuEditor( FormWindow * fw, PopupMenuEditor * menu, TQWidget * tqparent, const char * name = 0 );
+ ~PopupMenuEditor();
+
+ void init();
+
+ void insert( PopupMenuEditorItem * item, int index = -1 );
+ void insert( TQAction * action, int index = -1 );
+ void insert( TQActionGroup * actionGroup, int index = -1 );
+ int tqfind( const TQAction * action );
+ int tqfind( PopupMenuEditor * menu );
+ int count();
+ PopupMenuEditorItem * at( int index );
+ PopupMenuEditorItem * at( TQPoint pos ) { return itemAt( pos.y() ); }
+ void exchange( int a, int b );
+
+ void cut( int index );
+ void copy( int index );
+ void paste( int index );
+
+ void insertedActions( TQPtrList<TQAction> & list );
+
+ void show();
+ void choosePixmap( int index = -1 );
+ void showLineEdit( int index = -1);
+ void setAccelerator( int key, TQt::ButtonState state, int index = -1 );
+
+ FormWindow * formWindow() { return formWnd; }
+ bool isCreatingAccelerator() { return ( currentField == 2 ); }
+
+ TQPtrList<PopupMenuEditorItem> * items() { return &itemList; }
+
+ TQWidget * parentEditor() { return parentMenu; }
+
+Q_SIGNALS:
+ void inserted( TQAction * );
+ void removed( TQAction * );
+
+public Q_SLOTS:
+
+ void cut() { cut( currentIndex ); }
+ void copy() { copy( currentIndex ); }
+ void paste() { paste( currentIndex ); }
+
+ void remove( int index );
+ void remove( TQAction * a ) { remove( tqfind( a ) ); }
+
+ void resizeToContents();
+ void showSubMenu();
+ void hideSubMenu();
+ void focusOnSubMenu();
+
+protected:
+ PopupMenuEditorItem * createItem( TQAction * a = 0 );
+ void removeItem( int index = -1 );
+ PopupMenuEditorItem * currentItem();
+ PopupMenuEditorItem * itemAt( int y );
+ void setFocusAt( const TQPoint & pos );
+
+ bool eventFilter( TQObject * o, TQEvent * e );
+ void paintEvent( TQPaintEvent * e );
+ void mousePressEvent( TQMouseEvent * e );
+ void mouseDoubleClickEvent( TQMouseEvent * e );
+ void mouseMoveEvent( TQMouseEvent * e );
+ void dragEnterEvent( TQDragEnterEvent * e );
+ void dragLeaveEvent( TQDragLeaveEvent * e );
+ void dragMoveEvent( TQDragMoveEvent * e );
+ void dropEvent( TQDropEvent * e );
+ void keyPressEvent( TQKeyEvent * e );
+ void focusInEvent( TQFocusEvent * e );
+ void focusOutEvent( TQFocusEvent * e );
+
+ void drawItems( TQPainter * p );
+ void drawItem( TQPainter * p, PopupMenuEditorItem * i, const TQRect & r, int f ) const;
+ void drawWinFocusRect( TQPainter * p, const TQRect & r ) const;
+
+ TQSize contentsSize();
+ int itemHeight( const PopupMenuEditorItem * item ) const;
+ int itemPos( const PopupMenuEditorItem * item ) const;
+
+ int snapToItem( int y );
+ void dropInPlace( PopupMenuEditorItem * i, int y );
+ void dropInPlace( TQActionGroup * g, int y );
+
+ void safeDec();
+ void safeInc();
+
+ void clearCurrentField();
+ void navigateUp( bool ctrl );
+ void navigateDown( bool ctrl );
+ void navigateLeft();
+ void navigateRight();
+ void enterEditMode( TQKeyEvent * e );
+ void leaveEditMode( TQKeyEvent * e );
+
+ TQString constructName( PopupMenuEditorItem *item );
+
+private:
+ FormWindow * formWnd;
+ TQLineEdit * lineEdit;
+ TQWidget * dropLine;
+ TQPtrList<PopupMenuEditorItem> itemList;
+ PopupMenuEditorItem addItem;
+ PopupMenuEditorItem addSeparator;
+ TQWidget * parentMenu;
+
+ int iconWidth;
+ int textWidth;
+ int accelWidth;
+ int arrowWidth;
+ int borderSize;
+
+ int currentField;
+ int currentIndex;
+ TQPoint mousePressPos;
+ static PopupMenuEditorItem * draggedItem;
+
+ enum ClipboardOperation {
+ None = 0,
+ Cut = 1,
+ Copy = 2
+ };
+ static int clipboardOperation;
+ static PopupMenuEditorItem * clipboardItem;
+};
+
+#endif //POPUPMENUEDITOR_H
diff --git a/tqtinterface/qt4/tools/designer/designer/preferences.ui b/tqtinterface/qt4/tools/designer/designer/preferences.ui
new file mode 100644
index 0000000..51f17b3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/preferences.ui
@@ -0,0 +1,670 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Preferences</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>Preferences</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>482</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Preferences</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Preferences&lt;/b&gt;&lt;p&gt;Change the preferences of Qt Designer. There is always one tab with general preferences. There may be additional tabs, depending on which plugins are installed.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>pageGeneral</cstring>
+ </property>
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>File Saving</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxAutoSave</cstring>
+ </property>
+ <property name="text">
+ <string>Enable Auto Sa&amp;ve</string>
+ </property>
+ <property name="accel">
+ <string>Alt+V</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>tqlayout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>textLabelAutoSave</cstring>
+ </property>
+ <property name="text">
+ <string>Auto Save &amp;Interval:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>timeEditAutoSave</cstring>
+ </property>
+ </widget>
+ <widget class="TQTimeEdit">
+ <property name="name">
+ <cstring>timeEditAutoSave</cstring>
+ </property>
+ <property name="time">
+ <time>
+ <hour>0</hour>
+ <minute>30</minute>
+ <second>0</second>
+ </time>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQButtonGroup" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Plu&amp;gin Paths</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQTextEdit">
+ <property name="name">
+ <cstring>textEditPluginPaths</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A splash screen is displayed when starting Qt Designer if this option is checked.</string>
+ </property>
+ </spacer>
+ <widget class="TQGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>GroupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Ge&amp;neral</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxWorkspace</cstring>
+ </property>
+ <property name="text">
+ <string>Restore Last &amp;Workspace on Startup</string>
+ </property>
+ <property name="accel">
+ <string>Alt+W</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Restore last workspace</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The current workspace settings will be restored the next time you start Qt Designer if this option is checked.</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxSplash</cstring>
+ </property>
+ <property name="text">
+ <string>Show &amp;Splash Screen on Startup</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Show Splashscreen</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A splash screen is displayed when starting Qt Designer if this option is checked.</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxStartDialog</cstring>
+ </property>
+ <property name="text">
+ <string>Show Start &amp;Dialog</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkAutoEdit</cstring>
+ </property>
+ <property name="text">
+ <string>Disable Data&amp;base Auto-Edit in Preview</string>
+ </property>
+ <property name="accel">
+ <string>Alt+B</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxTextLabels</cstring>
+ </property>
+ <property name="text">
+ <string>Show Toolbutton Lab&amp;els</string>
+ </property>
+ <property name="accel">
+ <string>Alt+E</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Text Labels</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Text labels will be usin in the toolbars if this is checked.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox" row="0" column="1">
+ <property name="name">
+ <cstring>groupBoxGrid</cstring>
+ </property>
+ <property name="title">
+ <string>G&amp;rid</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxSnapGrid</cstring>
+ </property>
+ <property name="text">
+ <string>Sn&amp;ap to Grid</string>
+ </property>
+ <property name="accel">
+ <string>Alt+A</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Snap to the grid</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Snap to Grid&lt;/b&gt; is checked, the widgets snap to the grid using the the X/Y resolution.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>spinGridX</cstring>
+ </property>
+ <property name="maxValue">
+ <number>50</number>
+ </property>
+ <property name="minValue">
+ <number>5</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Grid resolution</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, a grid is shown on all forms using the X/Y resolution.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>spinGridY</cstring>
+ </property>
+ <property name="maxValue">
+ <number>50</number>
+ </property>
+ <property name="minValue">
+ <number>5</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Grid resolution</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, a grid is shown on all forms using the X/Y resolution.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>Grid-&amp;X:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinGridX</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Grid-&amp;Y:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinGridY</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Backgro&amp;und</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="StyledButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonColor</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select a color in the color dialog.</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>radioColor</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>NoFocus</enum>
+ </property>
+ <property name="text">
+ <string>Co&amp;lor</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use a background color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use a background color.</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>radioPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use a background pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use a background pixmap.</string>
+ </property>
+ </widget>
+ <widget class="StyledButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonPixmap</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a pixmap file.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>StyledButton</class>
+ <header location="local">styledbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>clicked()</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ <property type="Bool">scale</property>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="1112">789c9dd2cb8e9b301406e07d9e0225bba89a09601350d505302c5b7559a9eac23e6672b363620c0ca9faeef53949da2e2a55eab123f9e38f2f217e5e475f3e7f8cd6cf8bde0b7f8008f6c2456b3518337ffdf6e1fb62992451e8691ac5cb778be55304d1277b6e71fc12c6ab0d157222e61bd8e4c812196f6216535a13f318624a6764b2495842e99558249014c81e99c6294b69d3376291424ae9806431638cd28628183081f4489e70ce13e4852878c129ad905992f18cd291283295517a466ed32ddfa64847945bb595c80e99a739cf29d54499ab9c528b2c58c10b86344428540148400a26b8a0541241b482d215523299494a0551c9562ae409091c32e0c82351410b942aa4e22a53941e882d36e41ed966d8903b2215f215f99a6143b6442afaafff5aff485658622584a091941256948443d1cabbdd6ebf3f28753c09a9e9cdc1fe703c9e4ea19f689a0430fa4c8908082be093d08d016bbb0bbd5e7ceafade5b30de19d083b3fa9e008cd39b9fafd69495b473af7fcfb15325c1d61eea0afaf005ddf97b5295c658a866338f97591babef7340fa396c6c5ca9e7fe650807d0bf566b4262299986ba335a3b4a2cc84b69ac85b1b673037d8fabf95b023a9c09cc7530e104dd5419ed6e27083fb09a7c752db5a9bd31cde4ec634ed8a39aebbe337618c3f6fdc5dee6d8b0bb0d6b5b8b1fad43d78fe4e14e3f6aace8e29d9d736777fea3c686eee0138c9726d4d00c548df7a315ff750f7ebc5ffc04a0e5308d</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>Preferences</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>Preferences</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>radioColor</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonColor</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>radioPixmap</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonPixmap</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>radioColor</tabstop>
+ <tabstop>radioPixmap</tabstop>
+ <tabstop>buttonColor</tabstop>
+ <tabstop>buttonPixmap</tabstop>
+ <tabstop>checkBoxSnapGrid</tabstop>
+ <tabstop>spinGridX</tabstop>
+ <tabstop>spinGridY</tabstop>
+ <tabstop>checkBoxWorkspace</tabstop>
+ <tabstop>checkBoxSplash</tabstop>
+ <tabstop>checkBoxStartDialog</tabstop>
+ <tabstop>checkAutoEdit</tabstop>
+ <tabstop>checkBoxTextLabels</tabstop>
+ <tabstop>helpButton</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>styledbutton.h</includehint>
+ <includehint>styledbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/previewframe.cpp b/tqtinterface/qt4/tools/designer/designer/previewframe.cpp
new file mode 100644
index 0000000..338a65f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/previewframe.cpp
@@ -0,0 +1,64 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvbox.h>
+#include <tqpainter.h>
+
+#include "previewframe.h"
+
+PreviewFrame::PreviewFrame( TQWidget *tqparent, const char *name )
+ : TQVBox( tqparent, name )
+{
+ setMinimumSize(200, 200);
+ setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken);
+ setLineWidth(1);
+
+ PreviewWorkspace * w = new PreviewWorkspace( this );
+ w->setEraseColor(tqcolorGroup().dark());
+ previewWidget = new PreviewWidget( w );
+ previewWidget->move( 10, 10 );
+}
+
+void PreviewFrame::setPreviewPalette(TQPalette pal)
+{
+ previewWidget->setPalette(pal);
+}
+
+void PreviewWorkspace::paintEvent( TQPaintEvent* )
+{
+ TQPainter p ( this );
+ p.setPen( TQPen( Qt::white ) );
+ p.drawText ( 0, height() / 2, width(), height(), Qt::AlignHCenter,
+ "The moose in the noose\nate the goose who was loose." );
+}
+
diff --git a/tqtinterface/qt4/tools/designer/designer/previewframe.h b/tqtinterface/qt4/tools/designer/designer/previewframe.h
new file mode 100644
index 0000000..929d3b6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/previewframe.h
@@ -0,0 +1,66 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PREVIEWFRAME_H
+#define PREVIEWFRAME_H
+
+#include <tqvbox.h>
+#include <tqworkspace.h>
+
+#include "previewwidgetimpl.h"
+
+class PreviewWorkspace : public TQWorkspace
+{
+ TQ_OBJECT
+public:
+ PreviewWorkspace( TQWidget* tqparent = 0, const char* name = 0 )
+ : TQWorkspace( tqparent, name ) {}
+ ~PreviewWorkspace() {}
+
+protected:
+ void paintEvent( TQPaintEvent* );
+};
+
+class PreviewFrame : public TQVBox
+{
+ TQ_OBJECT
+
+public:
+ PreviewFrame( TQWidget *tqparent = 0, const char *name = 0 );
+ void setPreviewPalette(TQPalette);
+
+private:
+ PreviewWidget *previewWidget;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/previewwidget.ui b/tqtinterface/qt4/tools/designer/designer/previewwidget.ui
new file mode 100644
index 0000000..6ecba7b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/previewwidget.ui
@@ -0,0 +1,311 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PreviewWidgetBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>PreviewWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>378</width>
+ <height>236</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Preview Window</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout17</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>ButtonGroup</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>RadioButton1</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>RadioButton2</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton2</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>RadioButton3</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton3</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>ButtonGroup2</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>CheckBox1</cstring>
+ </property>
+ <property name="text">
+ <string>CheckBox1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>CheckBox2</cstring>
+ </property>
+ <property name="text">
+ <string>CheckBox2</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQProgressBar">
+ <property name="name">
+ <cstring>ProgressBar1</cstring>
+ </property>
+ <property name="progress">
+ <number>50</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>LineEdit1</cstring>
+ </property>
+ <property name="text">
+ <string>LineEdit</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>ComboBox</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>ComboBox1</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSpinBox">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQScrollBar">
+ <property name="name">
+ <cstring>ScrollBar1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQSlider">
+ <property name="name">
+ <cstring>Slider1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQTextView">
+ <property name="name">
+ <cstring>textView</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>32767</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;
+&lt;a href="http://www.trolltech.com/"&gt;http://www.trolltech.com&lt;/a&gt;
+&lt;/p&gt;
+&lt;p&gt;
+&lt;a href="http://www.kde.org/"&gt;http://www.kde.org&lt;/a&gt;
+&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.cpp b/tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.cpp
new file mode 100644
index 0000000..c136223
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.cpp
@@ -0,0 +1,72 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqobjectlist.h"
+#include "previewwidgetimpl.h"
+
+PreviewWidget::PreviewWidget( TQWidget *tqparent, const char *name )
+ : PreviewWidgetBase( tqparent, name )
+{
+ // install event filter on child widgets
+ TQObjectList *l = queryList("TQWidget");
+ TQObjectListIt it(*l);
+ TQObject * obj;
+ while ((obj = it.current()) != 0) {
+ ++it;
+ obj->installEventFilter(this);
+ ((TQWidget*)obj)->setFocusPolicy(Qt::NoFocus);
+ }
+}
+
+void PreviewWidget::closeEvent(TQCloseEvent *e)
+{
+ e->ignore();
+}
+
+bool PreviewWidget::eventFilter(TQObject *, TQEvent *e)
+{
+ switch ( e->type() ) {
+ case TQEvent::MouseButtonPress:
+ case TQEvent::MouseButtonRelease:
+ case TQEvent::MouseButtonDblClick:
+ case TQEvent::MouseMove:
+ case TQEvent::KeyPress:
+ case TQEvent::KeyRelease:
+ case TQEvent::Enter:
+ case TQEvent::Leave:
+ return TRUE; // ignore;
+ default:
+ break;
+ }
+ return FALSE;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.h b/tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.h
new file mode 100644
index 0000000..5efe4ab
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/previewwidgetimpl.h
@@ -0,0 +1,51 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PREVIEWWIDGETIMPL_H
+#define PREVIEWWIDGETIMPL_H
+
+#include "previewwidget.h"
+
+class PreviewWidget : public PreviewWidgetBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PreviewWidget( TQWidget *tqparent = 0, const char *name = 0 );
+
+ void closeEvent(TQCloseEvent *);
+ bool eventFilter(TQObject *, TQEvent *);
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/project.cpp b/tqtinterface/qt4/tools/designer/designer/project.cpp
new file mode 100644
index 0000000..fa14e25
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/project.cpp
@@ -0,0 +1,1598 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+**1 This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "project.h"
+#include "formwindow.h"
+#include "designerappiface.h"
+#include "../interfaces/languageinterface.h"
+#include "pixmapcollection.h"
+#ifndef TQT_NO_SQL
+#include "dbconnectionimpl.h"
+#endif
+#include "resource.h"
+#include <tqwidgetfactory.h>
+#include "outputwindow.h"
+
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqurl.h>
+#include <tqobjectlist.h>
+#include <tqfeatures.h>
+#include <tqtextcodec.h>
+#include <tqdom.h>
+#include <tqmessagebox.h>
+#include <tqapplication.h>
+#include "mainwindow.h"
+#include <tqworkspace.h>
+
+#ifndef TQT_NO_SQL
+#include <tqsqldatabase.h>
+#include <tqsqlrecord.h>
+#include <tqdatatable.h>
+#endif
+
+#include <stdlib.h>
+#ifdef TQ_OS_UNIX
+# include <unistd.h>
+#endif
+
+#ifndef TQT_NO_SQL
+DatabaseConnection::~DatabaseConnection()
+{
+ delete iface;
+}
+
+bool DatabaseConnection::refreshCatalog()
+{
+#ifndef TQT_NO_SQL
+ if ( loaded )
+ return TRUE;
+ if ( !open() )
+ return FALSE;
+ tbls = conn->tables( TQSql::TableType( TQSql::Tables | TQSql::Views ) );
+ flds.clear();
+ for ( TQStringList::Iterator it = tbls.begin(); it != tbls.end(); ++it ) {
+ TQSqlRecord fil = conn->record( *it );
+ TQStringList lst;
+ for ( uint j = 0; j < fil.count(); ++j )
+ lst << fil.field( j )->name();
+ flds.insert( *it, lst );
+ }
+ loaded = TRUE;
+ conn->close();
+ return loaded;
+#else
+ return FALSE;
+#endif
+}
+
+#ifndef TQT_NO_SQL
+void DatabaseConnection::remove()
+{
+ if ( nm == "(default)" )
+ TQSqlDatabase::removeDatabase( TQSqlDatabase::defaultConnection );
+ else
+ TQSqlDatabase::removeDatabase( nm );
+ // the above will effectively delete the current connection
+ conn = 0;
+}
+#endif
+
+bool DatabaseConnection::open( bool suppressDialog )
+{
+#ifndef TQT_NO_SQL
+ // register our name, if nec
+ if ( nm == "(default)" ) {
+ if ( !TQSqlDatabase::tqcontains() ) // default doesn't exists?
+ conn = TQSqlDatabase::addDatabase( drv );
+ else
+ conn = TQSqlDatabase::database();
+ } else {
+ if ( !TQSqlDatabase::tqcontains( nm ) )
+ conn = TQSqlDatabase::addDatabase( drv, nm );
+ else
+ conn = TQSqlDatabase::database( nm );
+ }
+ conn->setDatabaseName( dbName );
+ conn->setUserName( uname );
+ conn->setPassword( pword );
+ conn->setHostName( hname );
+ conn->setPort( prt );
+ bool success = conn->open();
+ for( ; suppressDialog == FALSE ; ) {
+ bool done = FALSE;
+ if ( !success ) {
+ DatabaseConnectionEditor dia( this, 0 , 0 , TRUE );
+ switch( dia.exec() ) {
+ case TQDialog::Accepted:
+ done = FALSE;
+ break;
+ case TQDialog::Rejected:
+ done = TRUE;
+ break;
+ }
+ }
+ if ( done )
+ break;
+ conn->setUserName( uname );
+ conn->setPassword( pword );
+ conn->setHostName( hname );
+ conn->setPort( prt );
+ success = conn->open();
+ if ( !success ) {
+ switch( TQMessageBox::warning( project->messageBoxParent(), TQApplication::tr( "Connection" ),
+ TQApplication::tr( "Could not connect to the database.\n"
+ "Press 'OK' to continue or 'Cancel' to "
+ "specify different\nconnection information.\n" )
+ + TQString( "[" + conn->lastError().driverText() + "\n" +
+ conn->lastError().databaseText() + "]\n" ),
+ TQApplication::tr( "&OK" ),
+ TQApplication::tr( "&Cancel" ), TQString(), 0, 1 ) ) {
+ case 0: // OK or Enter
+ continue;
+ case 1: // Cancel or Escape
+ done = TRUE;
+ break;
+ }
+ } else
+ break;
+ if ( done )
+ break;
+ }
+ if ( !success ) {
+ dbErr = conn->lastError().driverText() + "\n" + conn->lastError().databaseText();
+ remove();
+ }
+ return success;
+#else
+ return FALSE;
+#endif
+}
+
+void DatabaseConnection::close()
+{
+ if ( !loaded )
+ return;
+#ifndef TQT_NO_SQL
+ if ( conn ) {
+ conn->close();
+ }
+#endif
+}
+
+DesignerDatabase *DatabaseConnection::iFace()
+{
+ if ( !iface )
+ iface = new DesignerDatabaseImpl( this );
+ return iface;
+}
+
+#endif
+
+////////
+
+bool Project::isDummy() const
+{
+ return isDummyProject;
+}
+
+Project::Project( const TQString &fn, const TQString &pName,
+ TQPluginManager<ProjectSettingsInterface> *pm, bool isDummy,
+ const TQString &l )
+ : proName( pName ), projectSettingsPluginManager( pm ), isDummyProject( isDummy )
+{
+ modified = TRUE;
+ pixCollection = new PixmapCollection( this );
+ iface = 0;
+ lang = l;
+ is_cpp = lang == "C++";
+ cfg.insert( "(all)", "qt warn_on release" );
+ templ = "app";
+ setFileName( fn );
+ if ( !pName.isEmpty() )
+ proName = pName;
+ sourcefiles.setAutoDelete( TRUE );
+ modified = FALSE;
+ objs.setAutoDelete( FALSE );
+ fakeFormFiles.setAutoDelete( FALSE );
+}
+
+Project::~Project()
+{
+ if ( singleProjectMode() )
+ removeTempProject();
+ delete iface;
+ delete pixCollection;
+}
+
+void Project::setModified( bool b )
+{
+ modified = b;
+ emit projectModified();
+}
+
+#ifndef TQT_NO_SQL
+DatabaseConnection *Project::databaseConnection( const TQString &name )
+{
+ for ( DatabaseConnection *conn = dbConnections.first();
+ conn;
+ conn = dbConnections.next() ) {
+ if ( conn->name() == name )
+ return conn;
+ }
+ return 0;
+}
+#endif
+
+void Project::setFileName( const TQString &fn, bool doClear )
+{
+ if ( fn == filename )
+ return;
+
+ if ( singleProjectMode() ) {
+ TQString qsa = TQString( getenv( "HOME" ) ) + TQString( "/.qsa" );
+ if ( !TQFile::exists( qsa ) ) {
+ TQDir d;
+ d.mkdir( qsa );
+ }
+ if ( fn == singleProFileName )
+ return;
+ singleProFileName = fn;
+ static int counter = 0;
+ TQString str_counter = TQString::number( counter++ );
+ str_counter = "/.qsa/" + str_counter;
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ filename = TQString( getenv( "HOME" ) + str_counter + TQString( "tmp_" ) +
+ TQFileInfo( fn ).baseName() + "/" + TQFileInfo( fn ).baseName() + ".pro" );
+ removeTempProject();
+ if ( iface && iface->supports( LanguageInterface::CompressProject ) ) {
+ filename = iface->uncompressProject( makeAbsolute( singleProFileName ),
+ TQString( getenv( "HOME" ) +
+ str_counter + TQString( "tmp_" ) +
+ TQFileInfo( fn ).baseName() ) );
+ proName = makeAbsolute( singleProFileName );
+ }
+ } else {
+ filename = fn;
+ if ( !filename.endsWith( ".pro" ) )
+ filename += ".pro";
+ proName = filename;
+ }
+
+
+ if ( proName.tqcontains( '.' ) )
+ proName = proName.left( proName.tqfind( '.' ) );
+
+ if ( !doClear )
+ return;
+ clear();
+ if ( TQFile::exists( filename ) )
+ parse();
+}
+
+TQString Project::fileName( bool singlePro ) const
+{
+ if ( singlePro )
+ return singleProFileName;
+ return filename;
+}
+
+TQString Project::databaseDescription() const
+{
+ return dbFile;
+}
+
+TQString Project::projectName() const
+{
+ return proName;
+}
+
+static TQString parse_part( const TQString &part )
+{
+ TQString res;
+ bool inName = FALSE;
+ TQString currName;
+ for ( int i = 0; i < (int)part.length(); ++i ) {
+ TQChar c = part[ i ];
+ if ( !inName ) {
+ if ( c != ' ' && c != '\t' && c != '\n' && c != '=' && c != '\\' && c != '+' )
+ inName = TRUE;
+ else
+ continue;
+ }
+ if ( inName ) {
+ if ( c == '\n' )
+ break;
+ res += c;
+ }
+ }
+ return res;
+}
+
+TQStringList parse_multiline_part( const TQString &contents, const TQString &key, int *start = 0 )
+{
+ if ( start )
+ *start = -1;
+ TQString lastWord;
+ // Account for things like win32: SOURCES
+ int extraWhiteSpaceCount = 0;
+ int braceCount = 0;
+ for ( int i = 0; i < (int)contents.length(); ++i ) {
+ TQChar c( contents[ i ] );
+ switch ( c ) {
+ case '{':
+ braceCount++;
+ lastWord = "";
+ break;
+ case '}':
+ braceCount--;
+ lastWord = "";
+ break;
+ case ' ': case '\t':
+ if (!key.startsWith(lastWord)) {
+ lastWord = "";
+ extraWhiteSpaceCount = 0;
+ } else {
+ extraWhiteSpaceCount++;
+ }
+ break;
+ case '\\': case '\n':
+ lastWord = "";
+ break;
+ case '#':
+ while ( contents[ i ] != '\n' && i < (int)contents.length() )
+ ++i;
+ break;
+ default:
+ lastWord += c;
+ }
+
+ // ### we should read the 'bla { SOURCES= ... }' stuff as well (braceCount > 0)
+ if ( lastWord == key && braceCount == 0 ) {
+ if ( start )
+ *start = i - lastWord.length() - extraWhiteSpaceCount + 1;
+ TQStringList lst;
+ bool inName = FALSE;
+ TQString currName;
+ bool hadEqual = FALSE;
+ for ( ; i < (int)contents.length(); ++i ) {
+ c = contents[ i ];
+ if ( !hadEqual && c != '=' )
+ continue;
+ if ( !hadEqual ) {
+ hadEqual = TRUE;
+ continue;
+ }
+ if ( ( c.isLetter() ||
+ c.isDigit() ||
+ c == '.' ||
+ c == '/' ||
+ c == '_' ||
+ c == '\\' ||
+ c == '\"' ||
+ c == '\'' ||
+ c == '=' ||
+ c == '$' ||
+ c == '-' ||
+ c == '(' ||
+ c == ')' ||
+ c == ':' ||
+ c == '+' ||
+ c == ',' ||
+ c == '~' ||
+ c == '{' ||
+ c == '}' ||
+ c == '@' ) &&
+ c != ' ' && c != '\t' && c != '\n' ) {
+ if ( !inName )
+ currName = TQString();
+ if ( c != '\\' || contents[i+1] != '\n' ) {
+ currName += c;
+ inName = TRUE;
+ }
+ } else {
+ if ( inName ) {
+ inName = FALSE;
+ if ( currName.simplifyWhiteSpace() != "\\" )
+ lst.append( currName );
+ }
+ if ( c == '\n' && i > 0 && contents[ (int)i - 1 ] != '\\' )
+ break;
+ }
+ }
+ return lst;
+ }
+ }
+
+ return TQStringList();
+}
+
+void Project::parse()
+{
+ TQFile f( filename );
+ if ( !f.exists() || !f.open( IO_ReadOnly ) )
+ return;
+ TQTextStream ts( &f );
+ TQString contents = ts.read();
+ f.close();
+
+ proName = TQFileInfo( filename ).baseName();
+
+ TQStringList::ConstIterator it;
+
+ int i = contents.tqfind( "LANGUAGE" );
+ if ( i != -1 ) {
+ lang = "";
+ is_cpp = FALSE;
+ TQString part = contents.mid( i + TQString( "LANGUAGE" ).length() );
+ lang = parse_part( part );
+ is_cpp = lang == "C++";
+ }
+
+ i = contents.tqfind( "DBFILE" );
+ if ( i != -1 ) {
+ dbFile = "";
+ TQString part = contents.mid( i + TQString( "DBFILE" ).length() );
+ dbFile = parse_part( part );
+ }
+
+ TQStringList uifiles = parse_multiline_part( contents, "FORMS" );
+ uifiles += parse_multiline_part( contents, "INTERFACES" ); // compatibility
+ for ( it = uifiles.begin(); it != uifiles.end(); ++it ) {
+ if ( (*it).startsWith( "__APPOBJ" ) )
+ continue;
+ (void) new FormFile( *it, FALSE, this );
+ }
+
+
+ i = contents.tqfind( "TEMPLATE" );
+ if ( i != -1 ) {
+ templ = "";
+ TQString part = contents.mid( i + TQString( "TEMPLATE" ).length() );
+ templ = parse_part( part );
+ }
+
+ readPlatformSettings( contents, "CONFIG", cfg );
+ readPlatformSettings( contents, "LIBS", lbs );
+ readPlatformSettings( contents, "INCLUDEPATH", inclPath );
+ readPlatformSettings( contents, "DEFINES", defs );
+ readPlatformSettings( contents, "SOURCES", sources );
+ readPlatformSettings( contents, "HEADERS", headers );
+
+ LanguageInterface *iface = MetaDataBase::languageInterface( lang );
+ if ( iface ) {
+ TQStringList sourceKeys;
+ iface->sourceProjectKeys( sourceKeys );
+ for ( TQStringList::Iterator it = sourceKeys.begin(); it != sourceKeys.end(); ++it ) {
+ TQStringList lst = parse_multiline_part( contents, *it );
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ (void) new SourceFile( *it, FALSE, this );
+ }
+ }
+
+ updateCustomSettings();
+
+ for ( it = csList.begin(); it != csList.end(); ++it ) {
+ i = contents.tqfind( *it );
+ if ( i != -1 ) {
+ TQString val = "";
+ TQString part = contents.mid( i + TQString( *it ).length() );
+ val = parse_part( part );
+ customSettings.tqreplace( *it, val );
+ }
+ }
+
+ loadConnections();
+
+ TQStringList images = parse_multiline_part( contents, "IMAGES" );
+
+ // ### remove that for the final - this is beta-compatibility
+ if ( images.isEmpty() && TQDir( TQFileInfo( filename ).dirPath( TRUE ) + "/images" ).exists() ) {
+ images = TQDir( TQFileInfo( filename ).dirPath( TRUE ) + "/images" ).entryList();
+ for ( int i = 0; i < (int)images.count(); ++i )
+ images[ i ].prepend( "images/" );
+ modified = TRUE;
+ }
+
+ for ( TQStringList::ConstIterator pit = images.begin(); pit != images.end(); ++pit )
+ pixCollection->load( *pit );
+}
+
+void Project::clear()
+{
+ dbFile = "";
+ proName = "unnamed";
+ desc = "";
+}
+
+bool Project::removeSourceFile( SourceFile *sf )
+{
+ if ( !sourcefiles.tqcontainsRef( sf ) )
+ return FALSE;
+ if ( !sf->close() )
+ return FALSE;
+ sourcefiles.removeRef( sf );
+ modified = TRUE;
+ emit sourceFileRemoved( sf );
+ return TRUE;
+}
+
+void Project::setDatabaseDescription( const TQString &db )
+{
+ dbFile = db;
+}
+
+void Project::setDescription( const TQString &s )
+{
+ desc = s;
+}
+
+TQString Project::description() const
+{
+ return desc;
+}
+
+
+bool Project::isValid() const
+{
+ // #### do more checking here?
+ if ( filename.isEmpty() || proName.isEmpty() )
+ return FALSE;
+
+ return TRUE;
+}
+
+TQString Project::makeAbsolute( const TQString &f )
+{
+ if ( isDummy() )
+ return f;
+ TQString encodedUrl = TQFileInfo( filename ).dirPath( TRUE );
+ TQUrl::encode( encodedUrl );
+ TQUrl u( encodedUrl, f );
+ return u.path();
+}
+
+TQString Project::makeRelative( const TQString &f )
+{
+ if ( isDummy() )
+ return f;
+ TQString p = TQFileInfo( filename ).dirPath( TRUE );
+ TQString f2 = f;
+#if defined(TQ_WS_WIN32)
+ if ( p.endsWith("/") )
+ p = p.left( p.length() - 1 );
+ if ( f2.left( p.length() ).lower() == p.lower() )
+#else
+ if ( f2.left( p.length() ) == p )
+#endif
+ f2.remove( 0, p.length() + 1 );
+ return f2;
+}
+
+static void remove_contents( TQString &contents, const TQString &s )
+{
+ int i = contents.tqfind( s );
+ if ( i != -1 ) {
+ int start = i;
+ int end = contents.tqfind( '\n', i );
+ if ( end == -1 )
+ end = contents.length() - 1;
+ contents.remove( start, end - start + 1 );
+ }
+}
+
+static void remove_multiline_contents( TQString &contents, const TQString &s, int *strt = 0 )
+{
+ int i = contents.tqfind( s );
+ int startBrace = contents.tqfindRev("{", i);
+ int endBrace = contents.tqfindRev("}", i);
+ // We found a startBrace before i, but no endBrace after the startBrace before i
+ if (startBrace != -1 && endBrace < startBrace)
+ return;
+ if ( strt )
+ *strt = i;
+ int start = i;
+ bool lastWasBackspash = TRUE;
+ if ( i != -1 && ( i == 0 || contents[ i - 1 ] != '{' || contents[ i - 1 ] != ':' ) && !(i > 0 && contents[i-1] != '\n')) {
+ for ( ; i < (int)contents.length(); ++i ) {
+ if ( contents[ i ] == '\n' && !lastWasBackspash )
+ break;
+ lastWasBackspash = ( contents[ i ] == '\\' ||
+ lastWasBackspash && ( contents[ i ] == ' ' || contents[ i ] == '\t' ) );
+ }
+ contents.remove( start, i - start + 1 );
+ }
+}
+
+void Project::save( bool onlyProjectFile )
+{
+ bool anythingModified = FALSE;
+
+ // save sources and forms
+ if ( !onlyProjectFile ) {
+
+ saveConnections();
+
+ for ( SourceFile *sf = sourcefiles.first(); sf; sf = sourcefiles.next() ) {
+ anythingModified = anythingModified || sf->isModified();
+ if ( !sf->save() )
+ return;
+ }
+
+ for ( FormFile *ff = formfiles.first(); ff; ff = formfiles.next() ) {
+ anythingModified = anythingModified || ff->isModified();
+ if ( !ff->save() )
+ return;
+ }
+ }
+
+ if ( isDummy() || filename.isEmpty() )
+ return;
+
+ if ( !modified ) {
+ if ( singleProjectMode() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ if ( iface && iface->supports( LanguageInterface::CompressProject ) )
+ iface->compressProject( makeAbsolute( filename ), singleProFileName, anythingModified );
+ }
+ return;
+ }
+
+ TQFile f( filename );
+ TQString original = "";
+
+ // read the existing file
+ bool hasPreviousContents = FALSE;
+ if ( f.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &f );
+ original = ts.read();
+ f.close();
+ hasPreviousContents = TRUE;
+ remove_contents( original, "{SOURCES+=" ); // ### compatibility with early 3.0 betas
+ remove_contents( original, "DBFILE" );
+ remove_contents( original, "LANGUAGE" );
+ remove_contents( original, "TEMPLATE" );
+ removePlatformSettings( original, "CONFIG" );
+ removePlatformSettings( original, "DEFINES" );
+ removePlatformSettings( original, "LIBS" );
+ removePlatformSettings( original, "INCLUDEPATH" );
+ removePlatformSettings( original, "SOURCES" );
+ removePlatformSettings( original, "HEADERS" );
+ remove_multiline_contents( original, "FORMS" );
+ remove_multiline_contents( original, "INTERFACES" ); // compatibility
+ remove_multiline_contents( original, "IMAGES" );
+ for ( TQStringList::Iterator it = csList.begin(); it != csList.end(); ++it )
+ remove_contents( original, *it );
+ }
+
+ if (!original.isEmpty()) {
+ // Removes any new lines at the beginning of the file
+ while (original.startsWith("\n"))
+ original.remove(0, 1);
+ }
+
+ // the contents of the saved file
+ TQString contents;
+
+ // template
+ contents += "TEMPLATE\t= " + templ + "\n";
+
+ // language
+ contents += "LANGUAGE\t= " + lang + "\n";
+ contents += "\n";
+
+ // config
+ writePlatformSettings( contents, "CONFIG", cfg );
+ LanguageInterface *iface = MetaDataBase::languageInterface( lang );
+ if ( iface ) {
+ TQStringList sourceKeys;
+ iface->sourceProjectKeys( sourceKeys );
+ for ( TQStringList::Iterator spit = sourceKeys.begin(); spit != sourceKeys.end(); ++spit )
+ remove_multiline_contents( contents, *spit );
+ }
+
+ // libs, defines, includes
+ writePlatformSettings( contents, "LIBS", lbs );
+ writePlatformSettings( contents, "DEFINES", defs );
+ writePlatformSettings( contents, "INCLUDEPATH", inclPath );
+ writePlatformSettings( contents, "SOURCES", sources );
+ writePlatformSettings( contents, "HEADERS", headers );
+
+ // unix
+ if ( !hasPreviousContents ) {
+ contents +=
+ "unix {\n"
+ " UI_DIR = .ui\n"
+ " TQMOC_DIR = .tqmoc\n"
+ " OBJECTS_DIR = .obj\n"
+ "}\n\n";
+ }
+
+ // sources
+ if ( !sourcefiles.isEmpty() && iface ) {
+ TQMap<TQString, TQStringList> sourceToKey;
+ for ( SourceFile *f = sourcefiles.first(); f; f = sourcefiles.next() ) {
+ TQString key = iface->projectKeyForExtension( TQFileInfo( f->fileName() ).extension() );
+ TQStringList lst = sourceToKey[ key ];
+ lst << makeRelative( f->fileName() );
+ sourceToKey.tqreplace( key, lst );
+ }
+
+ for ( TQMap<TQString, TQStringList>::Iterator skit = sourceToKey.begin();
+ skit != sourceToKey.end(); ++skit ) {
+ TQString part = skit.key() + "\t+= ";
+ TQStringList lst = *skit;
+ for ( TQStringList::Iterator sit = lst.begin(); sit != lst.end(); ++sit ) {
+ part += *sit;
+ part += ++sit != lst.end() ? " \\\n\t" : "";
+ --sit;
+ }
+ part += "\n\n";
+ contents += part;
+ }
+ }
+
+ // forms and interfaces
+ if ( !formfiles.isEmpty() ) {
+ contents += "FORMS\t= ";
+ for ( TQPtrListIterator<FormFile> fit = formfiles; fit.current(); ++fit ) {
+ contents += fit.current()->fileName() +
+ (fit != formfiles.last() ? " \\\n\t" : "");
+ }
+ contents += "\n\n";
+ }
+
+ // images
+ if ( !pixCollection->isEmpty() ) {
+ contents += "IMAGES\t= ";
+ TQValueList<PixmapCollection::Pixmap> pixmaps = pixCollection->pixmaps();
+ for ( TQValueList<PixmapCollection::Pixmap>::Iterator it = pixmaps.begin();
+ it != pixmaps.end(); ++it ) {
+ contents += makeRelative( (*it).absname );
+ contents += ++it != pixmaps.end() ? " \\\n\t" : "";
+ --it;
+ }
+ contents += "\n\n";
+ }
+
+ // database
+ if ( !dbFile.isEmpty() )
+ contents += "DBFILE\t= " + dbFile + "\n";
+
+ // custom settings
+ for ( TQStringList::Iterator it = csList.begin(); it != csList.end(); ++it ) {
+ TQString val = *customSettings.tqfind( *it );
+ if ( !val.isEmpty() )
+ contents += *it + "\t= " + val + "\n";
+ }
+
+ if ( !f.open( IO_WriteOnly | IO_Translate ) ) {
+ TQMessageBox::warning( messageBoxParent(),
+ "Save Project Failed", "Couldn't write project file " + filename );
+ return;
+ }
+
+ TQTextStream os( &f );
+ os << contents;
+ if (hasPreviousContents)
+ os << original;
+
+ f.close();
+
+ setModified( FALSE );
+
+ if ( singleProjectMode() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ if ( iface && iface->supports( LanguageInterface::CompressProject ) )
+ iface->compressProject( makeAbsolute( filename ), singleProFileName, TRUE );
+ }
+}
+
+#ifndef TQT_NO_SQL
+TQPtrList<DatabaseConnection> Project::databaseConnections() const
+{
+ return dbConnections;
+}
+#endif
+
+#ifndef TQT_NO_SQL
+void Project::setDatabaseConnections( const TQPtrList<DatabaseConnection> &lst )
+{
+ dbConnections = lst;
+}
+#endif
+
+#ifndef TQT_NO_SQL
+void Project::addDatabaseConnection( DatabaseConnection *conn )
+{
+ dbConnections.append( conn );
+ modified = TRUE;
+}
+#endif
+
+#ifndef TQT_NO_SQL
+void Project::removeDatabaseConnection( const TQString &c )
+{
+ for ( DatabaseConnection *conn = dbConnections.first(); conn; conn = dbConnections.next() ) {
+ if ( conn->name() == c ) {
+ conn->remove();
+ dbConnections.removeRef( conn );
+ delete conn;
+ return;
+ }
+ }
+}
+#endif
+
+#ifndef TQT_NO_SQL
+TQStringList Project::databaseConnectionList()
+{
+ TQStringList lst;
+ for ( DatabaseConnection *conn = dbConnections.first(); conn; conn = dbConnections.next() )
+ lst << conn->name();
+ return lst;
+}
+#endif
+
+#ifndef TQT_NO_SQL
+TQStringList Project::databaseTableList( const TQString &connection )
+{
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( !conn ) {
+ return TQStringList();
+ }
+ return conn->tables();
+}
+#endif
+
+#ifndef TQT_NO_SQL
+TQStringList Project::databaseFieldList( const TQString &connection, const TQString &table )
+{
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( !conn )
+ return TQStringList();
+ return conn->fields( table );
+}
+#endif
+
+#ifndef TQT_NO_SQL
+static TQString makeIndent( int indent )
+{
+ TQString s;
+ s.fill( ' ', indent * 4 );
+ return s;
+}
+#endif
+
+#ifndef TQT_NO_SQL
+static void saveSingleProperty( TQTextStream &ts, const TQString& name, const TQString& value, int indent )
+{
+ ts << makeIndent( indent ) << "<property name=\"" << name << "\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<string>" << value << "</string>" << endl;
+ --indent;
+ ts << makeIndent( indent ) << "</property>" << endl;
+}
+#endif
+
+void Project::saveConnections()
+{
+#ifndef TQT_NO_SQL
+ if ( dbFile.isEmpty() ) {
+ TQFileInfo fi( fileName() );
+ setDatabaseDescription( fi.baseName() + ".db" );
+ }
+
+ TQFile f( makeAbsolute( dbFile ) );
+
+ if ( dbConnections.isEmpty() ) {
+ if ( f.exists() )
+ f.remove();
+ setDatabaseDescription( "" );
+ modified = TRUE;
+ return;
+ }
+
+ /* .db xml */
+ if ( f.open( IO_WriteOnly | IO_Translate ) ) {
+ TQTextStream ts( &f );
+ ts.setCodec( TQTextCodec::codecForName( "UTF-8" ) );
+ ts << "<!DOCTYPE DB><DB version=\"1.0\">" << endl;
+
+ /* db connections */
+ int indent = 0;
+ for ( DatabaseConnection *conn = dbConnections.first(); conn; conn = dbConnections.next() ) {
+ ts << makeIndent( indent ) << "<connection>" << endl;
+ ++indent;
+ saveSingleProperty( ts, "name", conn->name(), indent );
+ saveSingleProperty( ts, "driver", conn->driver(), indent );
+ saveSingleProperty( ts, "database", conn->database(), indent );
+ saveSingleProperty( ts, "username", conn->username(), indent );
+ saveSingleProperty( ts, "hostname", conn->hostname(), indent );
+ saveSingleProperty( ts, "port", TQString::number( conn->port() ), indent );
+
+ /* connection tables */
+ TQStringList tables = conn->tables();
+ for ( TQStringList::Iterator it = tables.begin();
+ it != tables.end(); ++it ) {
+ ts << makeIndent( indent ) << "<table>" << endl;
+ ++indent;
+ saveSingleProperty( ts, "name", (*it), indent );
+
+ /* tables fields */
+ TQStringList fields = conn->fields( *it );
+ for ( TQStringList::Iterator it2 = fields.begin();
+ it2 != fields.end(); ++it2 ) {
+ ts << makeIndent( indent ) << "<field>" << endl;
+ ++indent;
+ saveSingleProperty( ts, "name", (*it2), indent );
+ --indent;
+ ts << makeIndent( indent ) << "</field>" << endl;
+ }
+
+ --indent;
+ ts << makeIndent( indent ) << "</table>" << endl;
+ }
+
+ --indent;
+ ts << makeIndent( indent ) << "</connection>" << endl;
+ }
+
+ ts << "</DB>" << endl;
+ f.close();
+ }
+#endif
+}
+
+#ifndef TQT_NO_SQL
+static TQDomElement loadSingleProperty( TQDomElement e, const TQString& name )
+{
+ TQDomElement n;
+ for ( n = e.firstChild().toElement();
+ !n.isNull();
+ n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" && n.toElement().attribute("name") == name )
+ return n;
+ }
+ return n;
+}
+#endif
+
+void Project::loadConnections()
+{
+#ifndef TQT_NO_SQL
+ if ( dbFile.isEmpty() || !TQFile::exists( makeAbsolute( dbFile ) ) )
+ return;
+
+ TQFile f( makeAbsolute( dbFile ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQDomDocument doc;
+ TQString errMsg;
+ int errLine;
+ if ( doc.setContent( &f, &errMsg, &errLine ) ) {
+ TQDomElement e;
+ e = doc.firstChild().toElement();
+
+ /* connections */
+ TQDomNodeList connections = e.toElement().elementsByTagName( "connection" );
+ for ( uint i = 0; i < connections.length(); i++ ) {
+ TQDomElement connection = connections.item(i).toElement();
+ TQDomElement connectionName = loadSingleProperty( connection, "name" );
+ TQDomElement connectionDriver = loadSingleProperty( connection, "driver" );
+ TQDomElement connectionDatabase = loadSingleProperty( connection,
+ "database" );
+ TQDomElement connectionUsername = loadSingleProperty( connection,
+ "username" );
+ TQDomElement connectionHostname = loadSingleProperty( connection,
+ "hostname" );
+ TQDomElement connectionPort = loadSingleProperty( connection,
+ "port" );
+
+ DatabaseConnection *conn = new DatabaseConnection( this );
+ conn->setName( connectionName.firstChild().firstChild().toText().data() );
+ conn->setDriver( connectionDriver.firstChild().firstChild().toText().data() );
+ conn->setDatabase( connectionDatabase.firstChild().firstChild().toText().data() );
+ conn->setUsername( connectionUsername.firstChild().firstChild().toText().data() );
+ conn->setHostname( connectionHostname.firstChild().firstChild().toText().data() );
+ conn->setPort( TQString( connectionPort.firstChild().firstChild().toText().data() ).toInt() );
+
+ /* connection tables */
+ TQDomNodeList tables = connection.toElement().elementsByTagName( "table" );
+ for ( uint j = 0; j < tables.length(); j++ ) {
+ TQDomElement table = tables.item(j).toElement();
+ TQDomElement tableName = loadSingleProperty( table, "name" );
+ conn->addTable( tableName.firstChild().firstChild().toText().data() );
+
+ /* table fields */
+ TQStringList fieldList;
+ TQDomNodeList fields = table.toElement().elementsByTagName( "field" );
+ for ( uint k = 0; k < fields.length(); k++ ) {
+ TQDomElement field = fields.item(k).toElement();
+ TQDomElement fieldName = loadSingleProperty( field, "name" );
+ fieldList.append( fieldName.firstChild().firstChild().toText().data() );
+ }
+ conn->setFields( tableName.firstChild().firstChild().toText().data(),
+ fieldList );
+ }
+
+ dbConnections.append( conn );
+ }
+ } else {
+ qDebug( TQString("Parse error: ") + errMsg + TQString(" in line %d"), errLine );
+ }
+ f.close();
+ }
+#endif
+}
+
+/*! Opens the database \a connection. The connection remains open and
+can be closed again with closeDatabase().
+*/
+
+bool Project::openDatabase( const TQString &connection, bool suppressDialog )
+{
+#ifndef TQT_NO_SQL
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( connection.isEmpty() && !conn )
+ conn = databaseConnection( "(default)" );
+ if ( !conn )
+ return FALSE;
+ bool b = conn->open( suppressDialog );
+ return b;
+#else
+ TQ_UNUSED( connection );
+ TQ_UNUSED( suppressDialog );
+ return FALSE;
+#endif
+}
+
+/*! Closes the database \a connection.
+*/
+void Project::closeDatabase( const TQString &connection )
+{
+#ifndef TQT_NO_SQL
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( connection.isEmpty() && !conn )
+ conn = databaseConnection( "(default)" );
+ if ( !conn )
+ return;
+ conn->close();
+#else
+ TQ_UNUSED( connection );
+#endif
+}
+
+// void Project::formClosed( FormWindow *fw )
+// {
+// formWindows.remove( fw );
+// }
+
+TQObjectList *Project::formList( bool resolveFakeObjects ) const
+{
+ TQObjectList *l = new TQObjectList;
+ for ( TQPtrListIterator<FormFile> forms(formfiles); forms.current(); ++forms ) {
+ FormFile* f = forms.current();
+ if ( f->formWindow() ) {
+ if ( resolveFakeObjects && f->formWindow()->isFake() )
+ l->append( objectForFakeForm( f->formWindow() ) );
+ else
+ l->append( f->formWindow()->child( 0, "TQWidget" ) );
+ } else if ( f->isFake() ) {
+ l->append( objectForFakeFormFile( f ) );
+ }
+ }
+ return l;
+}
+
+DesignerProject *Project::iFace()
+{
+ if ( !iface )
+ iface = new DesignerProjectImpl( this );
+ return iface;
+}
+
+void Project::setLanguage( const TQString &l )
+{
+ if ( l == lang )
+ return;
+ lang = l;
+ is_cpp = lang == "C++";
+ updateCustomSettings();
+ modified = TRUE;
+}
+
+TQString Project::language() const
+{
+ return lang;
+}
+
+void Project::setCustomSetting( const TQString &key, const TQString &value )
+{
+ customSettings.remove( key );
+ customSettings.insert( key, value );
+ modified = TRUE;
+}
+
+TQString Project::customSetting( const TQString &key ) const
+{
+ return *customSettings.tqfind( key );
+}
+
+void Project::updateCustomSettings()
+{
+ if ( !projectSettingsPluginManager )
+ return;
+
+/*
+ ProjectSettingsInterface *iface = 0;
+ projectSettingsPluginManager->queryInterface( lang, (TQUnknownInterface**)&iface );
+ if ( !iface )
+ return;
+ csList = iface->projectSettings();
+ iface->release();
+*/
+
+ TQInterfacePtr<ProjectSettingsInterface> iface;
+ projectSettingsPluginManager->queryInterface( lang, &iface );
+ if ( !iface )
+ return;
+ csList = iface->projectSettings();
+ customSettings.clear();
+
+}
+
+void Project::setActive( bool b )
+{
+ pixCollection->setActive( b );
+}
+
+void Project::addSourceFile( SourceFile *sf )
+{
+ sourcefiles.append( sf );
+ modified = TRUE;
+ emit sourceFileAdded( sf );
+}
+
+
+SourceFile* Project::tqfindSourceFile( const TQString& filename, SourceFile *ignore ) const
+{
+ TQPtrListIterator<SourceFile> it(sourcefiles);
+ while ( it.current() ) {
+ if ( it.current() != ignore && it.current()->fileName() == filename )
+ return it.current();
+ ++it;
+ }
+ return 0;
+}
+
+FormFile* Project::tqfindFormFile( const TQString& filename, FormFile *ignore ) const
+{
+ TQPtrListIterator<FormFile> it(formfiles);
+ while ( it.current() ) {
+ if ( it.current() != ignore && it.current()->fileName() == filename )
+ return it.current();
+ ++it;
+ }
+ return 0;
+}
+
+void Project::setIncludePath( const TQString &platform, const TQString &path )
+{
+ if ( inclPath[platform] == path )
+ return;
+ inclPath.tqreplace( platform, path );
+ modified = TRUE;
+}
+
+void Project::setLibs( const TQString &platform, const TQString &path )
+{
+ lbs.tqreplace( platform, path );
+}
+
+void Project::setDefines( const TQString &platform, const TQString &path )
+{
+ defs.tqreplace( platform, path );
+}
+
+void Project::setConfig( const TQString &platform, const TQString &config )
+{
+ cfg.tqreplace( platform, config );
+}
+
+TQString Project::config( const TQString &platform ) const
+{
+ return cfg[ platform ];
+}
+
+TQString Project::libs( const TQString &platform ) const
+{
+ return lbs[ platform ];
+}
+
+TQString Project::defines( const TQString &platform ) const
+{
+ return defs[ platform ];
+}
+
+TQString Project::includePath( const TQString &platform ) const
+{
+ return inclPath[ platform ];
+}
+
+TQString Project::templte() const
+{
+ return templ;
+}
+
+void Project::setTemplate( const TQString &t )
+{
+ templ = t;
+}
+
+void Project::readPlatformSettings( const TQString &contents,
+ const TQString &setting,
+ TQMap<TQString, TQString> &res )
+{
+ const TQString platforms[] = { "", "win32", "unix", "mac", TQString() };
+ for ( int i = 0; platforms[ i ] != TQString(); ++i ) {
+ TQString p = platforms[ i ];
+ if ( !p.isEmpty() )
+ p += ":";
+ TQStringList lst = parse_multiline_part( contents, p + setting );
+ TQString s = lst.join( " " );
+ TQString key = platforms[ i ];
+ if ( key.isEmpty() )
+ key = "(all)";
+ res.tqreplace( key, s );
+ }
+}
+
+void Project::removePlatformSettings( TQString &contents, const TQString &setting )
+{
+ const TQString platforms[] = { "win32", "unix", "mac", "", TQString() };
+ for ( int i = 0; platforms[ i ] != TQString(); ++i ) {
+ TQString p = platforms[ i ];
+ if ( !p.isEmpty() )
+ p += ":";
+ remove_multiline_contents( contents, p + setting );
+ }
+}
+
+void Project::writePlatformSettings( TQString &contents, const TQString &setting,
+ const TQMap<TQString, TQString> &input )
+{
+ const TQString platforms[] = { "", "win32", "unix", "mac", TQString() };
+ int i;
+ LanguageInterface *iface = MetaDataBase::languageInterface( lang );
+ if (iface && (setting == "SOURCES" || setting == "HEADERS")) // The (all) part will be saved later on
+ i = 1;
+ else
+ i = 0;
+ for (; platforms[ i ] != TQString(); ++i ) {
+ TQString p = platforms[ i ];
+ if ( !p.isEmpty() )
+ p += ":";
+ TQString key = platforms[ i ];
+ if ( key.isEmpty() )
+ key = "(all)";
+ TQMap<TQString, TQString>::ConstIterator it = input.tqfind( key );
+ if ( it == input.end() || (*it).isEmpty() )
+ continue;
+ contents += p + setting + "\t+= " + *it + "\n\n";
+ }
+}
+
+void Project::addFormFile( FormFile *ff )
+{
+ formfiles.append( ff );
+ modified = TRUE;
+ emit formFileAdded( ff );
+}
+
+bool Project::removeFormFile( FormFile *ff )
+{
+ if ( !formfiles.tqcontainsRef( ff ) )
+ return FALSE;
+ if ( !ff->close() )
+ return FALSE;
+ formfiles.removeRef( ff );
+ modified = TRUE;
+ emit formFileRemoved( ff );
+ return TRUE;
+}
+
+void Project::addObject( TQObject *o )
+{
+ bool wasModified = modified;
+ objs.append( o );
+ FormFile *ff = new FormFile( "", FALSE, this, "qt_fakewindow" );
+ ff->setFileName( "__APPOBJ" + TQString( o->name() ) + ".ui" );
+ fakeFormFiles.insert( (void*)o, ff );
+ MetaDataBase::addEntry( o );
+ if ( hasGUI() ) {
+ TQWidget *tqparent = MainWindow::self ? MainWindow::self->qWorkspace() : 0;
+ FormWindow *fw = new FormWindow( ff, MainWindow::self, tqparent, "qt_fakewindow" );
+ fw->setProject( this );
+ if ( TQFile::exists( ff->absFileName() ) )
+ Resource::loadExtraSource( ff, ff->absFileName(),
+ MetaDataBase::languageInterface( language() ), FALSE );
+ if ( MainWindow::self )
+ fw->setMainWindow( MainWindow::self );
+ if ( MainWindow::self ) {
+ TQApplication::sendPostedEvents( MainWindow::self->qWorkspace(), TQEvent::ChildInserted );
+ connect( fw,
+ TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &, const TQString & ) ),
+ MainWindow::self,
+ TQT_SLOT( updateUndoRedo( bool, bool, const TQString &, const TQString & ) )
+ );
+ }
+ if ( fw->parentWidget() ) {
+ fw->parentWidget()->setFixedSize( 1, 1 );
+ fw->show();
+ }
+ } else {
+ if ( TQFile::exists( ff->absFileName() ) )
+ Resource::loadExtraSource( ff, ff->absFileName(),
+ MetaDataBase::languageInterface( language() ), FALSE );
+ }
+ emit objectAdded( o );
+ modified = wasModified;
+}
+
+void Project::setObjects( const TQObjectList &ol )
+{
+ for ( TQObjectListIt it( ol ); it.current(); ++it )
+ addObject( it.current() );
+}
+
+void Project::removeObject( TQObject *o )
+{
+ bool wasModified = modified;
+ objs.removeRef( o );
+ MetaDataBase::removeEntry( o );
+ fakeFormFiles.remove( (void*)o );
+ emit objectRemoved( o );
+ modified = wasModified;
+}
+
+TQObjectList Project::objects() const
+{
+ return objs;
+}
+
+FormFile *Project::fakeFormFileFor( TQObject *o ) const
+{
+ return fakeFormFiles.tqfind( (void*)o );
+}
+
+TQObject *Project::objectForFakeForm( FormWindow *fw ) const
+{
+ for ( TQPtrDictIterator<FormFile> it( fakeFormFiles ); it.current(); ++it ) {
+ if ( it.current()->formWindow() == fw ||
+ it.current() == fw->formFile() )
+ return (TQObject*)it.currentKey();
+ }
+ return 0;
+}
+
+TQObject *Project::objectForFakeFormFile( FormFile *ff ) const
+{
+ for ( TQPtrDictIterator<FormFile> it( fakeFormFiles ); it.current(); ++it ) {
+ if ( it.current() == ff )
+ return (TQObject*)it.currentKey();
+ }
+ return 0;
+}
+
+void Project::removeTempProject()
+{
+ if ( !singleProjectMode() )
+ return;
+ TQDir d( TQFileInfo( filename ).dirPath() );
+ if ( !d.exists( TQFileInfo( filename ).dirPath() ) )
+ return;
+ TQStringList files = d.entryList( TQDir::Files );
+ TQStringList::Iterator it;
+ for ( it = files.begin(); it != files.end(); ++it ) {
+ d.remove( *it );
+ }
+ if ( d.exists( TQFileInfo( filename ).dirPath() + "/images" ) ) {
+ d = TQDir( TQFileInfo( filename ).dirPath() + "/images" );
+ files = d.entryList( TQDir::Files );
+ for ( it = files.begin(); it != files.end(); ++it )
+ d.remove( *it );
+ d = TQDir( TQFileInfo( filename ).dirPath() );
+ d.remove( "images" );
+ }
+ d.remove( TQFileInfo( filename ).dirPath() );
+#if defined(TQ_OS_UNIX)
+ // ##### implement for all platforms, ideally should be in TQt
+ ::rmdir( d.absPath().latin1() );
+#endif
+}
+
+void Project::addAndEditFunction( const TQString &function, const TQString &functionBody, bool openDeveloper )
+{
+ for ( SourceFile *f = sourcefiles.first(); f; f = sourcefiles.next() ) {
+ if ( TQFileInfo( f->fileName() ).baseName() == "main" ) {
+ TQValueList<LanguageInterface::Function> funcs;
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ if ( !iface )
+ return;
+ iface->functions( f->text(), &funcs );
+ TQString func = function;
+ int i = func.tqfind( '(' );
+ if ( i != -1 )
+ func = func.left( i );
+
+ bool found = FALSE;
+ for ( TQValueList<LanguageInterface::Function>::Iterator it = funcs.begin();
+ it != funcs.end(); ++it ) {
+ if ( (*it).name.left( (*it).name.tqfind( '(' ) ) == func ) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if ( !found ) {
+ TQString code = f->text();
+ if ( functionBody.isEmpty() )
+ code += "\n\n" + iface->createFunctionStart( "", func, "", "" ) + "()\n{\n\n}\n";
+ else
+ code += "\n\n" + iface->createFunctionStart( "", func, "", "" ) +
+ "()\n" + functionBody + "\n";
+ f->setText( code );
+ if ( f->editor() )
+ f->editor()->refresh( FALSE );
+ }
+
+ if ( openDeveloper ) {
+ if ( MainWindow::self )
+ MainWindow::self->editSource( f );
+ f->editor()->setFunction( func, "" );
+ }
+
+ break;
+ }
+ }
+}
+
+bool Project::hasParentObject( TQObject *o )
+{
+ for ( TQObject *p = objs.first(); p; p = objs.next() ) {
+ TQObject *c = p->child( o->name(), o->className() );
+ if ( c )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+TQString Project::qualifiedName( TQObject *o )
+{
+ TQString name = o->name();
+ TQObject *p = o->tqparent();
+ while ( p ) {
+ name.prepend( TQString( p->name() ) + "." );
+ if ( objs.tqfindRef( p ) != -1 )
+ break;
+ p = p->tqparent();
+ }
+ return name;
+}
+
+bool Project::singleProjectMode() const
+{
+ return !MainWindow::self || MainWindow::self->singleProjectMode();
+}
+
+TQWidget *Project::messageBoxParent() const
+{
+ return MainWindow::self;
+}
+
+void Project::designerCreated()
+{
+ for ( FormFile *ff = formfiles.first(); ff; ff = formfiles.next() ) {
+ FormWindow *fw = ff->formWindow();
+ if ( !fw || fw->mainWindow() )
+ continue;
+ fw->setMainWindow( MainWindow::self );
+ connect( fw, TQT_SIGNAL( undoRedoChanged( bool, bool, const TQString &,
+ const TQString & ) ),
+ MainWindow::self, TQT_SLOT( updateUndoRedo( bool, bool,
+ const TQString &, const TQString & ) ) );
+ fw->reparent( MainWindow::self->qWorkspace(), TQPoint( 0, 0 ), FALSE );
+ TQApplication::sendPostedEvents( MainWindow::self->qWorkspace(),
+ TQEvent::ChildInserted );
+ fw->parentWidget()->setFixedSize( 1, 1 );
+ fw->show();
+ }
+}
+
+void Project::formOpened( FormWindow *fw )
+{
+ if ( fw->isFake() )
+ return;
+ emit newFormOpened( fw );
+}
+
+TQString Project::locationOfObject( TQObject *o )
+{
+ if ( !o )
+ return TQString();
+
+ if ( MainWindow::self ) {
+ TQWidgetList windows = MainWindow::self->qWorkspace()->windowList();
+ for ( TQWidget *w = windows.first(); w; w = windows.next() ) {
+ FormWindow *fw = ::tqqt_cast<FormWindow*>(w);
+ SourceEditor *se = ::tqqt_cast<SourceEditor*>(w);
+ if ( fw ) {
+ if ( fw->isFake() )
+ return objectForFakeForm( fw )->name() + TQString( " [Source]" );
+ else
+ return fw->name() + TQString( " [Source]" );
+ } else if ( se ) {
+ if ( !se->object() )
+ continue;
+ if ( se->formWindow() )
+ return se->formWindow()->name() + TQString( " [Source]" );
+ else
+ return makeRelative( se->sourceFile()->fileName() );
+ }
+ }
+ }
+
+ if ( ::tqqt_cast<SourceFile*>(o) ) {
+ for ( TQPtrListIterator<SourceFile> sources = sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ if ( f == o )
+ return makeRelative( f->fileName() );
+ }
+ }
+
+ extern TQMap<TQWidget*, TQString> *qwf_forms;
+ if ( !qwf_forms ) {
+ qWarning( "Project::locationOfObject: qwf_forms is NULL!" );
+ return TQString();
+ }
+
+ TQString s = makeRelative( *qwf_forms->tqfind( (TQWidget*)o ) );
+ s += " [Source]";
+ return s;
+}
+
+bool Project::hasGUI() const
+{
+ return tqApp->type() != TQApplication::Tty;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/project.h b/tqtinterface/qt4/tools/designer/designer/project.h
new file mode 100644
index 0000000..bb4b8bb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/project.h
@@ -0,0 +1,281 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PROJECT_H
+#define PROJECT_H
+
+#include <tqfeatures.h>
+
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
+#include <private/tqpluginmanager_p.h>
+#include "../interfaces/projectsettingsiface.h"
+#include "sourcefile.h"
+#include "formfile.h"
+#include <tqobjectlist.h>
+#include <tqptrdict.h>
+#include "formfile.h"
+
+class TQObjectList;
+struct DesignerProject;
+struct DesignerDatabase;
+class PixmapCollection;
+class Project;
+
+#ifndef TQT_NO_SQL
+class TQSqlDatabase;
+
+class DatabaseConnection
+{
+public:
+ DatabaseConnection( Project *p ) :
+#ifndef TQT_NO_SQL
+ conn( 0 ),
+#endif
+ project( p ), loaded( FALSE ), iface( 0 ) {}
+ ~DatabaseConnection();
+
+ bool refreshCatalog();
+ bool open( bool suppressDialog = TRUE );
+ void close();
+ DesignerDatabase *iFace();
+
+ bool isLoaded() const { return loaded; }
+ void setName( const TQString& n ) { nm = n; }
+ TQString name() const { return nm; }
+ void setDriver( const TQString& d ) { drv = d; }
+ TQString driver() const { return drv; }
+ void setDatabase( const TQString& db ) { dbName = db; }
+ TQString database() const { return dbName; }
+ void setUsername( const TQString& u ) { uname = u; }
+ TQString username() const { return uname; }
+ void setPassword( const TQString& p ) { pword = p; }
+ TQString password() const { return pword; }
+ void setHostname( const TQString& h ) { hname = h; }
+ TQString hostname() const { return hname; }
+ void setPort( int p ) { prt = p; }
+ int port() const { return prt; }
+ TQString lastError() const { return dbErr; }
+ void addTable( const TQString& t ) { tbls.append(t); }
+ void setFields( const TQString& t, const TQStringList& f ) { flds[t] = f; }
+ TQStringList tables() const { return tbls; }
+ TQStringList fields( const TQString& t ) { return flds[t]; }
+ TQMap<TQString, TQStringList> fields() { return flds; }
+#ifndef TQT_NO_SQL
+ TQSqlDatabase* connection() const { return conn; }
+ void remove();
+#endif
+
+private:
+ TQString nm;
+ TQString drv, dbName, uname, pword, hname;
+ TQString dbErr;
+ int prt;
+ TQStringList tbls;
+ TQMap<TQString, TQStringList> flds;
+#ifndef TQT_NO_SQL
+ TQSqlDatabase *conn;
+#endif
+ Project *project;
+ bool loaded;
+ DesignerDatabase *iface;
+};
+
+#endif
+
+class Project : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+ friend class DatabaseConnection;
+
+public:
+ Project( const TQString &fn, const TQString &pName = TQString(),
+ TQPluginManager<ProjectSettingsInterface> *pm = 0, bool isDummy = FALSE,
+ const TQString &l = "C++" );
+ ~Project();
+
+ void setFileName( const TQString &fn, bool doClear = TRUE );
+ TQString fileName( bool singlePro = FALSE ) const;
+ TQString projectName() const;
+
+ void setDatabaseDescription( const TQString &db );
+ TQString databaseDescription() const;
+
+ void setDescription( const TQString &s );
+ TQString description() const;
+
+ void setLanguage( const TQString &l );
+ TQString language() const;
+
+
+ bool isValid() const;
+
+ // returns TRUE if this project is the <No Project> project
+ bool isDummy() const;
+
+ TQString makeAbsolute( const TQString &f );
+ TQString makeRelative( const TQString &f );
+
+ void save( bool onlyProjectFile = FALSE );
+
+#ifndef TQT_NO_SQL
+ TQPtrList<DatabaseConnection> databaseConnections() const;
+ void setDatabaseConnections( const TQPtrList<DatabaseConnection> &lst );
+ void addDatabaseConnection( DatabaseConnection *conn );
+ void removeDatabaseConnection( const TQString &conn );
+ DatabaseConnection *databaseConnection( const TQString &name );
+ TQStringList databaseConnectionList();
+ TQStringList databaseTableList( const TQString &connection );
+ TQStringList databaseFieldList( const TQString &connection, const TQString &table );
+#endif
+ void saveConnections();
+ void loadConnections();
+
+ bool openDatabase( const TQString &connection, bool suppressDialog = TRUE );
+ void closeDatabase( const TQString &connection );
+
+ TQObjectList *formList( bool resolveFakeObjects = FALSE ) const;
+
+ DesignerProject *iFace();
+
+ void setCustomSetting( const TQString &key, const TQString &value );
+ TQString customSetting( const TQString &key ) const;
+
+ PixmapCollection *pixmapCollection() const { return pixCollection; }
+
+ void setActive( bool b );
+
+ TQPtrListIterator<SourceFile> sourceFiles() const { return TQPtrListIterator<SourceFile>(sourcefiles); }
+ void addSourceFile( SourceFile *sf );
+ bool removeSourceFile( SourceFile *sf );
+ SourceFile* tqfindSourceFile( const TQString& filename, SourceFile *ignore = 0 ) const;
+
+ TQPtrListIterator<FormFile> formFiles() const { return TQPtrListIterator<FormFile>(formfiles); }
+ void addFormFile( FormFile *ff );
+ bool removeFormFile( FormFile *ff );
+ FormFile* tqfindFormFile( const TQString& filename, FormFile *ignore = 0 ) const;
+
+ void setIncludePath( const TQString &platform, const TQString &path );
+ void setLibs( const TQString &platform, const TQString &path );
+ void setDefines( const TQString &platform, const TQString &path );
+ void setConfig( const TQString &platform, const TQString &config );
+ void setTemplate( const TQString &t );
+
+ TQString config( const TQString &platform ) const;
+ TQString libs( const TQString &platform ) const;
+ TQString defines( const TQString &platform ) const;
+ TQString includePath( const TQString &platform ) const;
+ TQString templte() const;
+
+ bool isModified() const { return !isDummy() && modified; }
+ void setModified( bool b );
+
+ void addObject( TQObject *o );
+ void setObjects( const TQObjectList &ol );
+ void removeObject( TQObject *o );
+ TQObjectList objects() const;
+ FormFile *fakeFormFileFor( TQObject *o ) const;
+ TQObject *objectForFakeForm( FormWindow *fw ) const;
+ TQObject *objectForFakeFormFile( FormFile *ff ) const;
+
+ void addAndEditFunction( const TQString &functionName, const TQString &functionBody,
+ bool openDeveloper );
+
+ void removeTempProject();
+ bool hasParentObject( TQObject *o );
+ TQString qualifiedName( TQObject *o );
+
+ bool isCpp() const { return is_cpp; }
+
+ void designerCreated();
+
+ void formOpened( FormWindow *fw );
+
+ TQString locationOfObject( TQObject *o );
+
+ bool hasGUI() const;
+
+Q_SIGNALS:
+ void projectModified();
+ void sourceFileAdded( SourceFile* );
+ void sourceFileRemoved( SourceFile* );
+ void formFileAdded( FormFile* );
+ void formFileRemoved( FormFile* );
+ void objectAdded( TQObject * );
+ void objectRemoved( TQObject * );
+ void newFormOpened( FormWindow *fw );
+
+private:
+ void parse();
+ void clear();
+ void updateCustomSettings();
+ void readPlatformSettings( const TQString &contents,
+ const TQString &setting,
+ TQMap<TQString, TQString> &res );
+ void removePlatformSettings( TQString &contents, const TQString &setting );
+ void writePlatformSettings( TQString &contents, const TQString &setting,
+ const TQMap<TQString, TQString> &input );
+ bool singleProjectMode() const;
+ TQWidget *messageBoxParent() const;
+
+private:
+ TQString filename;
+ TQString proName;
+ TQString desc;
+ TQString dbFile;
+#ifndef TQT_NO_SQL
+ TQPtrList<DatabaseConnection> dbConnections;
+#endif
+ TQString lang;
+ DesignerProject *iface;
+ TQMap<TQString, TQString> customSettings;
+ TQStringList csList;
+ TQPluginManager<ProjectSettingsInterface> *projectSettingsPluginManager;
+ PixmapCollection *pixCollection;
+ TQPtrList<SourceFile> sourcefiles;
+ TQPtrList<FormFile> formfiles;
+ TQMap<TQString, TQString> inclPath, defs, lbs, cfg, sources, headers;
+ TQString templ;
+ bool isDummyProject;
+ bool modified;
+ TQObjectList objs;
+ TQPtrDict<FormFile> fakeFormFiles;
+ TQString singleProFileName;
+ bool is_cpp;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/projectsettings.ui b/tqtinterface/qt4/tools/designer/designer/projectsettings.ui
new file mode 100644
index 0000000..284f554
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/projectsettings.ui
@@ -0,0 +1,308 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ProjectSettingsBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ProjectSettingsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>375</width>
+ <height>224</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Project Settings</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tabSettings</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Settings</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Project File:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editProjectFile</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Language</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboLanguage</cstring>
+ </property>
+ </widget>
+ <widget class="TQToolButton" row="2" column="2">
+ <property name="name">
+ <cstring>buttonDatabaseFile_2</cstring>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editDatabaseFile</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Database File:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editDatabaseFile</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>comboLanguage</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>editProjectFile</cstring>
+ </property>
+ </widget>
+ <widget class="TQToolButton">
+ <property name="name">
+ <cstring>buttonProject</cstring>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>21</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonProject</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>chooseProjectFile()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonHelp</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>helpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>comboLanguage</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>languageChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>editProjectFile</tabstop>
+ <tabstop>comboLanguage</tabstop>
+ <tabstop>buttonHelp</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">chooseDatabaseFile()</slot>
+ <slot access="protected">chooseProjectFile()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">helpClicked()</slot>
+ <slot access="protected">init()</slot>
+ <slot access="protected">languageChanged( const QString &amp; )</slot>
+ <slot access="protected">okClicked()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.cpp b/tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.cpp
new file mode 100644
index 0000000..3c7f813
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.cpp
@@ -0,0 +1,132 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "projectsettingsimpl.h"
+#include "project.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "mainwindow.h"
+#include "asciivalidator.h"
+#include "mainwindow.h"
+#include "sourcefile.h"
+#include "workspace.h"
+
+#include <tqlineedit.h>
+#include <tqtextedit.h>
+#include <tqcheckbox.h>
+#include <tqfiledialog.h>
+#include <tqcombobox.h>
+#include <tqobjectlist.h>
+#include <tqheader.h>
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+
+/*
+ * Constructs a ProjectSettings which is a child of 'tqparent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+ProjectSettings::ProjectSettings( Project *pro, TQWidget* tqparent, const char* name, bool modal, WFlags fl )
+ : ProjectSettingsBase( tqparent, name, modal, fl ), project( pro )
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+
+ editProjectFile->setFocus();
+
+ if ( project->isDummy() ) {
+ editProjectFile->setEnabled( FALSE );
+ editProjectFile->setText( project->projectName() );
+ } else {
+ if ( project->fileName().isEmpty() || project->fileName() == ".pro" ) {
+ editProjectFile->setText( tr( "unnamed.pro" ) );
+ editProjectFile->selectAll();
+ } else {
+ editProjectFile->setText( project->fileName() );
+ }
+ }
+
+ editDatabaseFile->setText( project->databaseDescription() );
+
+ comboLanguage->insertStringList( MetaDataBase::languages() );
+ for ( int j = 0; j < (int)comboLanguage->count(); ++j ) {
+ if ( project->language() == comboLanguage->text( j ) ) {
+ comboLanguage->setCurrentItem( j );
+ break;
+ }
+ }
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+ProjectSettings::~ProjectSettings()
+{
+}
+
+void ProjectSettings::chooseDatabaseFile()
+{
+ TQString fn = TQFileDialog::getSaveFileName(editDatabaseFile->text(), tr("Database Files (*.db);;All Files (*)"),
+ this);
+ if ( fn.isEmpty() )
+ return;
+ editDatabaseFile->setText( fn );
+}
+
+void ProjectSettings::chooseProjectFile()
+{
+ TQString fn = TQFileDialog::getSaveFileName(editProjectFile->text(), tr("Project Files (*.pro);;All Files (*)"),
+ this);
+ if ( fn.isEmpty() )
+ return;
+ editProjectFile->setText( fn );
+}
+
+void ProjectSettings::helpClicked()
+{
+}
+
+void ProjectSettings::okClicked()
+{
+ // ### check for validity
+ project->setFileName( editProjectFile->text(), FALSE );
+ project->setDatabaseDescription( editDatabaseFile->text() );
+ project->setLanguage( comboLanguage->text( comboLanguage->currentItem() ) );
+ project->setModified( TRUE );
+ accept();
+}
+
+void ProjectSettings::languageChanged( const TQString & )
+{
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.h b/tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.h
new file mode 100644
index 0000000..9bc743c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/projectsettingsimpl.h
@@ -0,0 +1,64 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PROJECTSETTINGSIMPL_H
+#define PROJECTSETTINGSIMPL_H
+
+#include "projectsettings.h"
+
+class Project;
+class TQListViewItem;
+class FormWindow;
+class SourceFile;
+
+class ProjectSettings : public ProjectSettingsBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ProjectSettings( Project *pro, TQWidget* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~ProjectSettings();
+
+protected Q_SLOTS:
+ void chooseDatabaseFile();
+ void chooseProjectFile();
+ void helpClicked();
+ void okClicked();
+ void languageChanged( const TQString &lang );
+
+private:
+ Project *project;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/propertyeditor.cpp b/tqtinterface/qt4/tools/designer/designer/propertyeditor.cpp
new file mode 100644
index 0000000..c74d2a3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/propertyeditor.cpp
@@ -0,0 +1,4307 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvariant.h> // HP-UX compiler needs this here
+
+#include "propertyeditor.h"
+#include "formwindow.h"
+#include "command.h"
+#include "metadatabase.h"
+#include "propertyobject.h"
+#include <widgetdatabase.h>
+#include "widgetfactory.h"
+#include "globaldefs.h"
+#include "defs.h"
+#include "asciivalidator.h"
+#include "paletteeditorimpl.h"
+#include "multilineeditorimpl.h"
+#include "mainwindow.h"
+#include "project.h"
+#include "hierarchyview.h"
+#include "database.h"
+#include "menubareditor.h"
+
+#include <tqpainter.h>
+#include <tqpalette.h>
+#include <tqapplication.h>
+#include <tqheader.h>
+#include <tqlineedit.h>
+#include <tqstrlist.h>
+#include <tqmetaobject.h>
+#include <tqcombobox.h>
+#include <tqpushbutton.h>
+#include <tqhbox.h>
+#include <tqfontdialog.h>
+#include <tqspinbox.h>
+#include <tqevent.h>
+#include <tqobjectlist.h>
+#include <tqlistbox.h>
+#include <tqfontdatabase.h>
+#include <tqcolor.h>
+#include <tqcolordialog.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqsizepolicy.h>
+#include <tqbitmap.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
+#include <tqaccel.h>
+#include <tqworkspace.h>
+#include <tqtimer.h>
+#include <tqdragobject.h>
+#include <tqdom.h>
+#include <tqprocess.h>
+#include <tqstyle.h>
+#include <tqdatetimeedit.h>
+#include <tqassistantclient.h>
+#include <tqdrawutil.h>
+#include <tqmultilineedit.h> // FIXME: obsolete
+#include <tqsplitter.h>
+#include <tqdatatable.h>
+#include <tqtextview.h>
+
+#include <limits.h>
+
+static TQFontDatabase *fontDataBase = 0;
+TQString assistantPath();
+
+#ifdef TQ_WS_MAC
+#include <tqwindowsstyle.h>
+static void setupStyle(TQWidget *w)
+{
+ static TQStyle *windowsStyle = 0;
+ if(!windowsStyle)
+ windowsStyle = new TQWindowsStyle;
+ w->setStyle(windowsStyle);
+}
+#else
+#define setupStyle(x)
+#endif
+
+static void cleanupFontDatabase()
+{
+ delete fontDataBase;
+ fontDataBase = 0;
+}
+
+static TQStringList getFontList()
+{
+ if ( !fontDataBase ) {
+ fontDataBase = new TQFontDatabase;
+ qAddPostRoutine( cleanupFontDatabase );
+ }
+ return TQT_TQSTRINGLIST_OBJECT(fontDataBase->families());
+}
+
+
+class PropertyWhatsThis : public TQWhatsThis
+{
+public:
+ PropertyWhatsThis( PropertyList *l );
+ TQString text( const TQPoint &pos );
+ bool clicked( const TQString& href );
+
+private:
+ PropertyList *propertyList;
+
+};
+
+PropertyWhatsThis::PropertyWhatsThis( PropertyList *l )
+ : TQWhatsThis( l->viewport() ), propertyList( l )
+{
+}
+
+TQString PropertyWhatsThis::text( const TQPoint &pos )
+{
+ return propertyList->whatsThisAt( pos );
+}
+
+bool PropertyWhatsThis::clicked( const TQString& href )
+{
+ if ( !href.isEmpty() ) {
+ TQAssistantClient *ac = MainWindow::self->assistantClient();
+ ac->showPage( TQString( qInstallPathDocs() ) + "/html/" + href );
+ }
+ return FALSE; // do not hide window
+}
+
+
+/*!
+ \class PropertyItem propertyeditor.h
+ \brief Base class for all property items
+
+ This is the base class for each property item for the
+ PropertyList. A simple property item has just a name and a value to
+ provide an editor for a datatype. But more complex datatypes might
+ provide an expandable item for editing single parts of the
+ datatype. See hasSubItems(), initChildren() for that.
+*/
+
+/*! If this item should be a child of another property item, specify
+ \a prop as the tqparent item.
+*/
+
+PropertyItem::PropertyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName )
+ : TQListViewItem( l, after ), listview( l ), property( prop ), propertyName( propName )
+{
+ setSelectable( FALSE );
+ open = FALSE;
+ setText( 0, propertyName );
+ changed = FALSE;
+ setText( 1, "" );
+ resetButton = 0;
+}
+
+PropertyItem::~PropertyItem()
+{
+ if ( resetButton )
+ delete resetButton->parentWidget();
+ resetButton = 0;
+}
+
+void PropertyItem::toggle()
+{
+}
+
+void PropertyItem::updateBackColor()
+{
+ if ( itemAbove() && this != listview->firstChild() ) {
+ if ( ( ( PropertyItem*)itemAbove() )->backColor == *backColor1 )
+ backColor = *backColor2;
+ else
+ backColor = *backColor1;
+ } else {
+ backColor = *backColor1;
+ }
+ if ( listview->firstChild() == this )
+ backColor = *backColor1;
+}
+
+TQColor PropertyItem::backgroundColor()
+{
+ updateBackColor();
+ if ( (TQListViewItem*)this == listview->currentItem() )
+ return *selectedBack;
+ return backColor;
+}
+
+/*! If a subclass is a expandable item, this is called when the child
+items should be created.
+*/
+
+void PropertyItem::createChildren()
+{
+}
+
+/*! If a subclass is a expandable item, this is called when the child
+items should be initialized.
+*/
+
+void PropertyItem::initChildren()
+{
+}
+
+void PropertyItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align )
+{
+ TQColorGroup g( cg );
+ g.setColor( TQColorGroup::Base, backgroundColor() );
+ g.setColor( TQColorGroup::Foreground, TQt::black );
+ g.setColor( TQColorGroup::Text, TQt::black );
+ int indent = 0;
+ if ( column == 0 ) {
+ indent = 20 + ( property ? 20 : 0 );
+ p->fillRect( 0, 0, width, height(), backgroundColor() );
+ p->save();
+ p->translate( indent, 0 );
+ }
+
+ if ( isChanged() && column == 0 ) {
+ p->save();
+ TQFont f = p->font();
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+
+ if ( !hasCustomContents() || column != 1 ) {
+ TQListViewItem::paintCell( p, g, column, width - indent, align );
+ } else {
+ p->fillRect( 0, 0, width, height(), backgroundColor() );
+ drawCustomContents( p, TQRect( 0, 0, width, height() ) );
+ }
+
+ if ( isChanged() && column == 0 )
+ p->restore();
+ if ( column == 0 )
+ p->restore();
+ if ( hasSubItems() && column == 0 ) {
+ p->save();
+ p->setPen( cg.foreground() );
+ p->setBrush( cg.base() );
+ p->drawRect( 5, height() / 2 - 4, 9, 9 );
+ p->drawLine( 7, height() / 2, 11, height() / 2 );
+ if ( !isOpen() )
+ p->drawLine( 9, height() / 2 - 2, 9, height() / 2 + 2 );
+ p->restore();
+ }
+ p->save();
+ p->setPen( TQPen( cg.dark(), 1 ) );
+ p->drawLine( 0, height() - 1, width, height() - 1 );
+ p->drawLine( width - 1, 0, width - 1, height() );
+ p->restore();
+
+ if ( listview->currentItem() == this && column == 0 &&
+ !listview->hasFocus() && !listview->viewport()->hasFocus() )
+ paintFocus( p, cg, TQRect( 0, 0, width, height() ) );
+}
+
+void PropertyItem::paintBranches( TQPainter * p, const TQColorGroup & cg,
+ int w, int y, int h )
+{
+ TQColorGroup g( cg );
+ g.setColor( TQColorGroup::Base, backgroundColor() );
+ TQListViewItem::paintBranches( p, g, w, y, h );
+}
+
+void PropertyItem::paintFocus( TQPainter *p, const TQColorGroup &cg, const TQRect &r )
+{
+ p->save();
+ TQApplication::tqstyle().tqdrawPrimitive(TQStyle::PE_Panel, p, r, cg, TQStyle::Style_Sunken, TQStyleOption(1,1) );
+ p->restore();
+}
+
+/*! Subclasses which are expandable items have to return TRUE
+ here. Default is FALSE.
+*/
+
+bool PropertyItem::hasSubItems() const
+{
+ return FALSE;
+}
+
+/*! Returns the tqparent property item here if this is a child or 0
+ otherwise.
+ */
+
+PropertyItem *PropertyItem::propertyParent() const
+{
+ return property;
+}
+
+bool PropertyItem::isOpen() const
+{
+ return open;
+}
+
+void PropertyItem::setOpen( bool b )
+{
+ if ( b == open )
+ return;
+ open = b;
+
+ if ( !open ) {
+ tqchildren.setAutoDelete( TRUE );
+ tqchildren.clear();
+ tqchildren.setAutoDelete( FALSE );
+ tqApp->processEvents();
+ listview->updateEditorSize();
+ return;
+ }
+
+ createChildren();
+ initChildren();
+ tqApp->processEvents();
+ listview->updateEditorSize();
+}
+
+/*! Subclasses have to show the editor of the item here
+*/
+
+void PropertyItem::showEditor()
+{
+ createResetButton();
+ resetButton->parentWidget()->show();
+}
+
+/*! Subclasses have to hide the editor of the item here
+*/
+
+void PropertyItem::hideEditor()
+{
+ createResetButton();
+ resetButton->parentWidget()->hide();
+}
+
+/*! This is called to init the value of the item. Reimplement in
+ subclasses to init the editor
+*/
+
+void PropertyItem::setValue( const TQVariant &v )
+{
+ val = v;
+}
+
+TQVariant PropertyItem::value() const
+{
+ return val;
+}
+
+bool PropertyItem::isChanged() const
+{
+ return changed;
+}
+
+void PropertyItem::setChanged( bool b, bool updateDb )
+{
+ if ( propertyParent() )
+ return;
+ if ( changed == b )
+ return;
+ changed = b;
+ tqrepaint();
+ if ( updateDb ) {
+ MetaDataBase::setPropertyChanged( listview->propertyEditor()->widget(), name(), changed );
+ }
+ updateResetButtonState();
+}
+
+TQString PropertyItem::name() const
+{
+ return propertyName;
+}
+
+void PropertyItem::createResetButton()
+{
+ if ( resetButton ) {
+ resetButton->parentWidget()->lower();
+ return;
+ }
+ TQHBox *hbox = new TQHBox( listview->viewport() );
+ hbox->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ hbox->setLineWidth( 1 );
+ resetButton = new TQPushButton( hbox );
+ setupStyle( resetButton );
+ resetButton->setPixmap( TQPixmap::fromMimeSource( "designer_resetproperty.png" ) );
+ resetButton->setFixedWidth( resetButton->tqsizeHint().width() );
+ hbox->tqlayout()->tqsetAlignment( TQt::AlignRight );
+ listview->addChild( hbox );
+ hbox->hide();
+ TQObject::connect( resetButton, TQT_SIGNAL( clicked() ),
+ listview, TQT_SLOT( resetProperty() ) );
+ TQToolTip::add( resetButton, PropertyEditor::tr( "Reset the property to its default value" ) );
+ TQWhatsThis::add( resetButton, PropertyEditor::tr( "Click this button to reset the property to its default value" ) );
+ updateResetButtonState();
+}
+
+void PropertyItem::updateResetButtonState()
+{
+ if ( !resetButton )
+ return;
+ if ( propertyParent() || !WidgetFactory::canResetProperty( listview->propertyEditor()->widget(), name() ) )
+ resetButton->setEnabled( FALSE );
+ else
+ resetButton->setEnabled( isChanged() );
+}
+
+/*! Call this to place/resize the item editor correctly (normally
+ call it from showEditor())
+*/
+
+void PropertyItem::placeEditor( TQWidget *w )
+{
+ createResetButton();
+ TQRect r = listview->tqitemRect( this );
+ if ( !r.size().isValid() ) {
+ listview->ensureItemVisible( this );
+#if defined(TQ_WS_WIN)
+ listview->repaintContents( FALSE );
+#endif
+ r = listview->tqitemRect( this );
+ }
+ r.setX( listview->header()->sectionPos( 1 ) );
+ r.setWidth( listview->header()->sectionSize( 1 ) - 1 );
+ r.setWidth( r.width() - resetButton->width() - 2 );
+ r = TQRect( listview->viewportToContents( r.topLeft() ), r.size() );
+ w->resize( r.size() );
+ listview->moveChild( w, r.x(), r.y() );
+ resetButton->parentWidget()->resize( resetButton->tqsizeHint().width() + 10, r.height() );
+ listview->moveChild( resetButton->parentWidget(), r.x() + r.width() - 8, r.y() );
+ resetButton->setFixedHeight( TQMAX( 0, r.height() - 3 ) );
+}
+
+/*! This should be called by subclasses if the user changed the value
+ of the property and this value should be applied to the widget property
+*/
+
+void PropertyItem::notifyValueChange()
+{
+ if ( !propertyParent() ) {
+ listview->valueChanged( this );
+ setChanged( TRUE );
+ if ( hasSubItems() )
+ initChildren();
+ } else {
+ propertyParent()->childValueChanged( this );
+ setChanged( TRUE );
+ }
+}
+
+/*! If a subclass is a expandable item reimplement this as this is
+ always called if a child item changed its value. So update the
+ display of the item here then.
+*/
+
+void PropertyItem::childValueChanged( PropertyItem * )
+{
+}
+
+/*! When adding a child item, call this (normally from addChildren()
+*/
+
+void PropertyItem::addChild( PropertyItem *i )
+{
+ tqchildren.append( i );
+}
+
+int PropertyItem::childCount() const
+{
+ return tqchildren.count();
+}
+
+PropertyItem *PropertyItem::child( int i ) const
+{
+ // ARRRRRRRRG
+ return ( (PropertyItem*)this )->tqchildren.at( i );
+}
+
+/*! If the contents of the item is not displayable with a text, but
+ you want to draw it yourself (using drawCustomContents()), return
+ TRUE here.
+*/
+
+bool PropertyItem::hasCustomContents() const
+{
+ return FALSE;
+}
+
+/*!
+ \sa hasCustomContents()
+*/
+
+void PropertyItem::drawCustomContents( TQPainter *, const TQRect & )
+{
+}
+
+TQString PropertyItem::currentItem() const
+{
+ return TQString();
+}
+
+int PropertyItem::currentIntItem() const
+{
+ return -1;
+}
+
+void PropertyItem::setCurrentItem( const TQString & )
+{
+}
+
+void PropertyItem::setCurrentItem( int )
+{
+}
+
+int PropertyItem::currentIntItemFromObject() const
+{
+ return -1;
+}
+
+TQString PropertyItem::currentItemFromObject() const
+{
+ return TQString();
+}
+
+void PropertyItem::setFocus( TQWidget *w )
+{
+ if ( !tqApp->tqfocusWidget() ||
+ listview->propertyEditor()->formWindow() &&
+ ( !MainWindow::self->isAFormWindowChild( tqApp->tqfocusWidget() ) &&
+ !tqApp->tqfocusWidget()->inherits( "Editor" ) ) )
+ w->setFocus();
+}
+
+void PropertyItem::setText( int col, const TQString &t )
+{
+ TQString txt( t );
+ if ( col == 1 )
+ txt = txt.tqreplace( "\n", " " );
+ TQListViewItem::setText( col, txt );
+}
+
+// --------------------------------------------------------------
+
+PropertyTextItem::PropertyTextItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool comment, bool multiLine, bool ascii, bool a )
+ : PropertyItem( l, after, prop, propName ), withComment( comment ),
+ hasMultiLines( multiLine ), asciiOnly( ascii ), accel( a )
+{
+ lin = 0;
+ box = 0;
+}
+
+TQLineEdit *PropertyTextItem::lined()
+{
+ if ( lin )
+ return lin;
+ if ( hasMultiLines ) {
+ box = new TQHBox( listview->viewport() );
+ box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ box->setLineWidth( 2 );
+ box->hide();
+ }
+
+ lin = 0;
+ if ( hasMultiLines )
+ lin = new TQLineEdit( box );
+ else
+ lin = new TQLineEdit( listview->viewport() );
+
+ if ( asciiOnly ) {
+ if ( PropertyItem::name() == "name" ) {
+ lin->setValidator( new AsciiValidator( TQString(":"), TQT_TQOBJECT(lin), "ascii_validator" ) );
+ if ( listview->propertyEditor()->formWindow()->isFake() )
+ lin->setEnabled( FALSE );
+ } else {
+ lin->setValidator( new AsciiValidator( TQString("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
+ "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9"
+ "\xaa\xab\xac\xad\xae\xaf\xb1\xb2\xb3"
+ "\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc"
+ "\xbd\xbe\xbf"), TQT_TQOBJECT(lin), "ascii_validator" ) );
+ }
+ } if ( !hasMultiLines ) {
+ lin->hide();
+ } else {
+ button = new TQPushButton( tr("..."), box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ connect( button, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( getText() ) );
+ lin->setFrame( FALSE );
+ }
+ connect( lin, TQT_SIGNAL( returnPressed() ),
+ this, TQT_SLOT( setValue() ) );
+ connect( lin, TQT_SIGNAL( textChanged( const TQString & ) ),
+ this, TQT_SLOT( setValue() ) );
+ if ( PropertyItem::name() == "name" || PropertyItem::name() == "itemName" )
+ connect( lin, TQT_SIGNAL( returnPressed() ),
+ listview->propertyEditor()->formWindow()->commandHistory(),
+ TQT_SLOT( checkCompressedCommand() ) );
+ lin->installEventFilter( listview );
+ return lin;
+}
+
+PropertyTextItem::~PropertyTextItem()
+{
+ delete (TQLineEdit*)lin;
+ lin = 0;
+ delete (TQHBox*)box;
+ box = 0;
+}
+
+void PropertyTextItem::setChanged( bool b, bool updateDb )
+{
+ PropertyItem::setChanged( b, updateDb );
+ if ( withComment && childCount() > 0 )
+ ( (PropertyTextItem*)PropertyItem::child( 0 ) )->lined()->setEnabled( b );
+}
+
+bool PropertyTextItem::hasSubItems() const
+{
+ return withComment;
+}
+
+void PropertyTextItem::childValueChanged( PropertyItem *child )
+{
+ if ( PropertyItem::name() != "name" )
+ MetaDataBase::setPropertyComment( listview->propertyEditor()->widget(),
+ PropertyItem::name(), child->value().toString() );
+ else
+ MetaDataBase::setExportMacro( listview->propertyEditor()->widget(), child->value().toString() );
+ listview->propertyEditor()->formWindow()->commandHistory()->setModified( TRUE );
+}
+
+void PropertyTextItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin || lin->text().length() == 0 ) {
+ lined()->blockSignals( TRUE );
+ lined()->setText( value().toString() );
+ lined()->blockSignals( FALSE );
+ }
+
+ TQWidget* w;
+ if ( hasMultiLines )
+ w = box;
+ else
+ w= lined();
+
+ placeEditor( w );
+ if ( !w->isVisible() || !lined()->hasFocus() ) {
+ w->show();
+ setFocus( lined() );
+ }
+}
+
+void PropertyTextItem::createChildren()
+{
+ PropertyTextItem *i = new PropertyTextItem( listview, this, this,
+ PropertyItem::name() == "name" ?
+ "export macro" : "comment", FALSE, FALSE,
+ PropertyItem::name() == "name" );
+ i->lined()->setEnabled( isChanged() );
+ addChild( i );
+}
+
+void PropertyTextItem::initChildren()
+{
+ if ( !childCount() )
+ return;
+ PropertyItem *item = PropertyItem::child( 0 );
+ if ( item ) {
+ if ( PropertyItem::name() != "name" )
+ item->setValue( MetaDataBase::propertyComment( listview->propertyEditor()->widget(),
+ PropertyItem::name() ) );
+ else
+ item->setValue( MetaDataBase::exportMacro( listview->propertyEditor()->widget() ) );
+ }
+}
+
+void PropertyTextItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ TQWidget* w;
+ if ( hasMultiLines )
+ w = box;
+ else
+ w = lined();
+
+ w->hide();
+}
+
+void PropertyTextItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ int oldCursorPos;
+ oldCursorPos = lin->cursorPosition();
+ lined()->setText( v.toString() );
+ if ( oldCursorPos < (int)lin->text().length() )
+ lin->setCursorPosition( oldCursorPos );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toString() );
+ PropertyItem::setValue( v );
+}
+
+void PropertyTextItem::setValue()
+{
+ setText( 1, lined()->text() );
+ TQVariant v;
+ if ( accel ) {
+ v = TQVariant( TQKeySequence( lined()->text() ) );
+ if ( v.toString().isNull() )
+ return; // not yet valid input
+ } else {
+ v = lined()->text();
+ }
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+void PropertyTextItem::getText()
+{
+ bool richText = !::tqqt_cast<TQButton*>(listview->propertyEditor()->widget()) ||
+ ( text( 0 ) == "whatsThis" );
+ bool doWrap = FALSE;
+ TQString txt = MultiLineEditor::getText( listview, value().toString(), richText, &doWrap );
+ if ( !txt.isEmpty() ) {
+ setText( 1, txt );
+ PropertyItem::setValue( txt );
+ notifyValueChange();
+ lined()->blockSignals( TRUE );
+ lined()->setText( txt );
+ lined()->blockSignals( FALSE );
+ }
+}
+
+// --------------------------------------------------------------
+
+PropertyDoubleItem::PropertyDoubleItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+TQLineEdit *PropertyDoubleItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new TQLineEdit( listview->viewport() );
+ lin->setValidator( new TQDoubleValidator( TQT_TQOBJECT(lin), "double_validator" ) );
+
+ connect( lin, TQT_SIGNAL( returnPressed() ),
+ this, TQT_SLOT( setValue() ) );
+ connect( lin, TQT_SIGNAL( textChanged( const TQString & ) ),
+ this, TQT_SLOT( setValue() ) );
+ lin->installEventFilter( listview );
+ return lin;
+}
+
+PropertyDoubleItem::~PropertyDoubleItem()
+{
+ delete (TQLineEdit*)lin;
+ lin = 0;
+}
+
+void PropertyDoubleItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setText( TQString::number( value().toDouble() ) );
+ lined()->blockSignals( FALSE );
+ }
+ TQWidget* w = lined();
+
+ placeEditor( w );
+ if ( !w->isVisible() || !lined()->hasFocus() ) {
+ w->show();
+ setFocus( lined() );
+ }
+}
+
+
+void PropertyDoubleItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ TQWidget* w = lined();
+ w->hide();
+}
+
+void PropertyDoubleItem::setValue( const TQVariant &v )
+{
+ if ( value() == v )
+ return;
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ int oldCursorPos;
+ oldCursorPos = lin->cursorPosition();
+ lined()->setText( TQString::number( v.toDouble() ) );
+ if ( oldCursorPos < (int)lin->text().length() )
+ lin->setCursorPosition( oldCursorPos );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, TQString::number( v.toDouble() ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyDoubleItem::setValue()
+{
+ setText( 1, lined()->text() );
+ TQVariant v = lined()->text().toDouble();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+
+// --------------------------------------------------------------
+
+PropertyDateItem::PropertyDateItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+TQDateEdit *PropertyDateItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new TQDateEdit( listview->viewport() );
+ TQObjectList *l = lin->queryList( "TQLineEdit" );
+ for ( TQObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( listview );
+ delete l;
+ connect( lin, TQT_SIGNAL( valueChanged( const TQDate & ) ),
+ this, TQT_SLOT( setValue() ) );
+ return lin;
+}
+
+PropertyDateItem::~PropertyDateItem()
+{
+ delete (TQDateEdit*)lin;
+ lin = 0;
+}
+
+void PropertyDateItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setDate( value().toDate() );
+ lined()->blockSignals( FALSE );
+ }
+ placeEditor( lin );
+ if ( !lin->isVisible() ) {
+ lin->show();
+ setFocus( lin );
+ }
+}
+
+void PropertyDateItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ if ( lin )
+ lin->hide();
+}
+
+void PropertyDateItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ if ( lined()->date() != v.toDate() )
+ lined()->setDate( v.toDate() );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toDate().toString( Qt::ISODate ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyDateItem::setValue()
+{
+ setText( 1, lined()->date().toString( Qt::ISODate ) );
+ TQVariant v;
+ v = lined()->date();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyTimeItem::PropertyTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+TQTimeEdit *PropertyTimeItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new TQTimeEdit( listview->viewport() );
+ connect( lin, TQT_SIGNAL( valueChanged( const TQTime & ) ),
+ this, TQT_SLOT( setValue() ) );
+ TQObjectList *l = lin->queryList( "TQLineEdit" );
+ for ( TQObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( listview );
+ delete l;
+ return lin;
+}
+
+PropertyTimeItem::~PropertyTimeItem()
+{
+ delete (TQTimeEdit*)lin;
+ lin = 0;
+}
+
+void PropertyTimeItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setTime( value().toTime() );
+ lined()->blockSignals( FALSE );
+ }
+ placeEditor( lin );
+ if ( !lin->isVisible() ) {
+ lin->show();
+ setFocus( lin );
+ }
+}
+
+void PropertyTimeItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ if ( lin )
+ lin->hide();
+}
+
+void PropertyTimeItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ if ( lined()->time() != v.toTime() )
+ lined()->setTime( v.toTime() );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toTime().toString( Qt::ISODate ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyTimeItem::setValue()
+{
+ setText( 1, lined()->time().toString( Qt::ISODate ) );
+ TQVariant v;
+ v = lined()->time();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyDateTimeItem::PropertyDateTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+TQDateTimeEdit *PropertyDateTimeItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new TQDateTimeEdit( listview->viewport() );
+ connect( lin, TQT_SIGNAL( valueChanged( const TQDateTime & ) ),
+ this, TQT_SLOT( setValue() ) );
+ TQObjectList *l = lin->queryList( "TQLineEdit" );
+ for ( TQObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( listview );
+ delete l;
+ return lin;
+}
+
+PropertyDateTimeItem::~PropertyDateTimeItem()
+{
+ delete (TQDateTimeEdit*)lin;
+ lin = 0;
+}
+
+void PropertyDateTimeItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setDateTime( value().toDateTime() );
+ lined()->blockSignals( FALSE );
+ }
+ placeEditor( lin );
+ if ( !lin->isVisible() ) {
+ lin->show();
+ setFocus( lin );
+ }
+}
+
+void PropertyDateTimeItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ if ( lin )
+ lin->hide();
+}
+
+void PropertyDateTimeItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ if ( lined()->dateTime() != v.toDateTime() )
+ lined()->setDateTime( v.toDateTime() );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toDateTime().toString( Qt::ISODate ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyDateTimeItem::setValue()
+{
+ setText( 1, lined()->dateTime().toString( Qt::ISODate ) );
+ TQVariant v;
+ v = lined()->dateTime();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyBoolItem::PropertyBoolItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ comb = 0;
+}
+
+TQComboBox *PropertyBoolItem::combo()
+{
+ if ( comb )
+ return comb;
+ comb = new TQComboBox( FALSE, listview->viewport() );
+ comb->hide();
+ comb->insertItem( tqtr( "False" ) );
+ comb->insertItem( tqtr( "True" ) );
+ connect( comb, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( setValue() ) );
+ comb->installEventFilter( listview );
+ return comb;
+}
+
+PropertyBoolItem::~PropertyBoolItem()
+{
+ delete (TQComboBox*)comb;
+ comb = 0;
+}
+
+void PropertyBoolItem::toggle()
+{
+ bool b = value().toBool();
+ setValue( TQVariant( !b, 0 ) );
+ setValue();
+}
+
+void PropertyBoolItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ if ( value().toBool() )
+ combo()->setCurrentItem( 1 );
+ else
+ combo()->setCurrentItem( 0 );
+ combo()->blockSignals( FALSE );
+ }
+ placeEditor( combo() );
+ if ( !combo()->isVisible() || !combo()->hasFocus() ) {
+ combo()->show();
+ setFocus( combo() );
+ }
+}
+
+void PropertyBoolItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ combo()->hide();
+}
+
+void PropertyBoolItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( comb ) {
+ combo()->blockSignals( TRUE );
+ if ( v.toBool() )
+ combo()->setCurrentItem( 1 );
+ else
+ combo()->setCurrentItem( 0 );
+ combo()->blockSignals( FALSE );
+ }
+ TQString tmp = tr( "True" );
+ if ( !v.toBool() )
+ tmp = tr( "False" );
+ setText( 1, tmp );
+ PropertyItem::setValue( v );
+}
+
+void PropertyBoolItem::setValue()
+{
+ if ( !comb )
+ return;
+ setText( 1, combo()->currentText() );
+ bool b = combo()->currentItem() == 0 ? (bool)FALSE : (bool)TRUE;
+ PropertyItem::setValue( TQVariant( b, 0 ) );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyIntItem::PropertyIntItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool s )
+ : PropertyItem( l, after, prop, propName ), signedValue( s )
+{
+ spinBx = 0;
+}
+
+TQSpinBox *PropertyIntItem::spinBox()
+{
+ if ( spinBx )
+ return spinBx;
+ if ( signedValue )
+ spinBx = new TQSpinBox( -INT_MAX, INT_MAX, 1, listview->viewport() );
+ else
+ spinBx = new TQSpinBox( 0, INT_MAX, 1, listview->viewport() );
+ spinBx->hide();
+ spinBx->installEventFilter( listview );
+ TQObjectList *ol = spinBx->queryList( "TQLineEdit" );
+ if ( ol && ol->first() )
+ ol->first()->installEventFilter( listview );
+ delete ol;
+ connect( spinBx, TQT_SIGNAL( valueChanged( int ) ),
+ this, TQT_SLOT( setValue() ) );
+ return spinBx;
+}
+
+PropertyIntItem::~PropertyIntItem()
+{
+ delete (TQSpinBox*)spinBx;
+ spinBx = 0;
+}
+
+void PropertyIntItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ if ( signedValue )
+ spinBox()->setValue( value().toInt() );
+ else
+ spinBox()->setValue( value().toUInt() );
+ spinBox()->blockSignals( FALSE );
+ }
+ placeEditor( spinBox() );
+ if ( !spinBox()->isVisible() || !spinBox()->hasFocus() ) {
+ spinBox()->show();
+ setFocus( spinBox() );
+ }
+}
+
+void PropertyIntItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ spinBox()->hide();
+}
+
+void PropertyIntItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ if ( signedValue )
+ spinBox()->setValue( v.toInt() );
+ else
+ spinBox()->setValue( v.toUInt() );
+ spinBox()->blockSignals( FALSE );
+ }
+
+ if ( signedValue )
+ setText( 1, TQString::number( v.toInt() ) );
+ else
+ setText( 1, TQString::number( v.toUInt() ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyIntItem::setValue()
+{
+ if ( !spinBx )
+ return;
+ setText( 1, TQString::number( spinBox()->value() ) );
+ if ( signedValue )
+ PropertyItem::setValue( spinBox()->value() );
+ else
+ PropertyItem::setValue( (uint)spinBox()->value() );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyLayoutItem::PropertyLayoutItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ spinBx = 0;
+}
+
+PropertyLayoutItem::~PropertyLayoutItem()
+{
+ delete (TQSpinBox*)spinBx;
+ spinBx = 0;
+}
+
+TQSpinBox* PropertyLayoutItem::spinBox()
+{
+ if ( spinBx )
+ return spinBx;
+ spinBx = new TQSpinBox( -1, INT_MAX, 1, listview->viewport() );
+ spinBx->setSpecialValueText( tr( "default" ) );
+ spinBx->hide();
+ spinBx->installEventFilter( listview );
+ TQObjectList *ol = spinBx->queryList( "TQLineEdit" );
+ if ( ol && ol->first() )
+ ol->first()->installEventFilter( listview );
+ delete ol;
+ connect( spinBx, TQT_SIGNAL( valueChanged( int ) ),
+ this, TQT_SLOT( setValue() ) );
+ return spinBx;
+}
+
+void PropertyLayoutItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ spinBox()->setValue( value().toInt() );
+ spinBox()->blockSignals( TRUE );
+ }
+ placeEditor( spinBox() );
+ if ( !spinBox()->isVisible() || !spinBox()->hasFocus() ) {
+ spinBox()->show();
+ setFocus( spinBox() );
+ }
+}
+
+void PropertyLayoutItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ spinBox()->hide();
+}
+
+void PropertyLayoutItem::setValue( const TQVariant &v )
+{
+ if ( spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ spinBox()->setValue( v.toInt() );
+ spinBox()->blockSignals( FALSE );
+ }
+ TQString s = v.toString();
+ if ( v.toInt() == -1 )
+ s = spinBox()->specialValueText();
+ setText( 1, s );
+ PropertyItem::setValue( v );
+}
+
+void PropertyLayoutItem::setValue()
+{
+ if ( !spinBx )
+ return;
+ PropertyItem::setValue( spinBox()->value() );
+ notifyValueChange();
+}
+
+
+// --------------------------------------------------------------
+
+PropertyListItem::PropertyListItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool e )
+ : PropertyItem( l, after, prop, propName ), editable( e )
+{
+ comb = 0;
+ oldInt = -1;
+}
+
+TQComboBox *PropertyListItem::combo()
+{
+ if ( comb )
+ return comb;
+ comb = new TQComboBox( editable, listview->viewport() );
+ comb->hide();
+ connect( comb, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( setValue() ) );
+ comb->installEventFilter( listview );
+ if ( editable ) {
+ TQObjectList *ol = comb->queryList( "TQLineEdit" );
+ if ( ol && ol->first() )
+ ol->first()->installEventFilter( listview );
+ delete ol;
+ }
+ return comb;
+}
+
+PropertyListItem::~PropertyListItem()
+{
+ delete (TQComboBox*)comb;
+ comb = 0;
+}
+
+void PropertyListItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( value().toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ placeEditor( combo() );
+ if ( !combo()->isVisible() || !combo()->hasFocus() ) {
+ combo()->show();
+ setFocus( combo() );
+ }
+}
+
+void PropertyListItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ combo()->hide();
+}
+
+void PropertyListItem::setValue( const TQVariant &v )
+{
+ if ( comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( v.toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ setText( 1, v.toStringList().first() );
+ PropertyItem::setValue( v );
+}
+
+void PropertyListItem::setValue()
+{
+ if ( !comb )
+ return;
+ setText( 1, combo()->currentText() );
+ TQStringList lst;
+ for ( uint i = 0; i < combo()->listBox()->count(); ++i )
+ lst << combo()->listBox()->item( i )->text();
+ PropertyItem::setValue( lst );
+ notifyValueChange();
+ oldInt = currentIntItem();
+ oldString = currentItem();
+}
+
+TQString PropertyListItem::currentItem() const
+{
+ return ( (PropertyListItem*)this )->combo()->currentText();
+}
+
+void PropertyListItem::setCurrentItem( const TQString &s )
+{
+ if ( comb && currentItem().lower() == s.lower() )
+ return;
+
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( value().toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ for ( uint i = 0; i < combo()->listBox()->count(); ++i ) {
+ if ( combo()->listBox()->item( i )->text().lower() == s.lower() ) {
+ combo()->setCurrentItem( i );
+ setText( 1, combo()->currentText() );
+ break;
+ }
+ }
+ oldInt = currentIntItem();
+ oldString = currentItem();
+}
+
+void PropertyListItem::addItem( const TQString &s )
+{
+ combo()->insertItem( s );
+}
+
+void PropertyListItem::setCurrentItem( int i )
+{
+ if ( comb && i == combo()->currentItem() )
+ return;
+
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( value().toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ combo()->setCurrentItem( i );
+ setText( 1, combo()->currentText() );
+ oldInt = currentIntItem();
+ oldString = currentItem();
+}
+
+int PropertyListItem::currentIntItem() const
+{
+ return ( (PropertyListItem*)this )->combo()->currentItem();
+}
+
+int PropertyListItem::currentIntItemFromObject() const
+{
+ return oldInt;
+}
+
+TQString PropertyListItem::currentItemFromObject() const
+{
+ return oldString;
+}
+
+// --------------------------------------------------------------
+
+PropertyCoordItem::PropertyCoordItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, Type t )
+ : PropertyItem( l, after, prop, propName ), typ( t )
+{
+ lin = 0;
+
+}
+
+TQLineEdit *PropertyCoordItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new TQLineEdit( listview->viewport() );
+ lin->setReadOnly( TRUE );
+ lin->installEventFilter( listview );
+ lin->hide();
+ return lin;
+}
+
+void PropertyCoordItem::createChildren()
+{
+ PropertyItem *i = this;
+ if ( typ == Rect || typ == Point ) {
+ i = new PropertyIntItem( listview, i, this, tr( "x" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, tr( "y" ), TRUE );
+ addChild( i );
+ }
+ if ( typ == Rect || typ == Size ) {
+ i = new PropertyIntItem( listview, i, this, tr( "width" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, tr( "height" ), TRUE );
+ addChild( i );
+ }
+}
+
+void PropertyCoordItem::initChildren()
+{
+ PropertyItem *item = 0;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == tr( "x" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().x() );
+ else if ( typ == Point )
+ item->setValue( val.toPoint().x() );
+ } else if ( item->name() == tr( "y" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().y() );
+ else if ( typ == Point )
+ item->setValue( val.toPoint().y() );
+ } else if ( item->name() == tr( "width" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().width() );
+ else if ( typ == Size )
+ item->setValue( val.toSize().width() );
+ } else if ( item->name() == tr( "height" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().height() );
+ else if ( typ == Size )
+ item->setValue( val.toSize().height() );
+ }
+ }
+}
+
+PropertyCoordItem::~PropertyCoordItem()
+{
+ delete (TQLineEdit*)lin;
+ lin = 0;
+}
+
+void PropertyCoordItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin )
+ lined()->setText( text( 1 ) );
+ placeEditor( lined() );
+ if ( !lined()->isVisible() || !lined()->hasFocus() ) {
+ lined()->show();
+ setFocus( lined() );
+ }
+}
+
+void PropertyCoordItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ lined()->hide();
+}
+
+void PropertyCoordItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ TQString s;
+ if ( typ == Rect )
+ s = "[ " + TQString::number( v.toRect().x() ) + ", " + TQString::number( v.toRect().y() ) + ", " +
+ TQString::number( v.toRect().width() ) + ", " + TQString::number( v.toRect().height() ) + " ]";
+ else if ( typ == Point )
+ s = "[ " + TQString::number( v.toPoint().x() ) + ", " +
+ TQString::number( v.toPoint().y() ) + " ]";
+ else if ( typ == Size )
+ s = "[ " + TQString::number( v.toSize().width() ) + ", " +
+ TQString::number( v.toSize().height() ) + " ]";
+ setText( 1, s );
+ if ( lin )
+ lined()->setText( s );
+ PropertyItem::setValue( v );
+}
+
+bool PropertyCoordItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+void PropertyCoordItem::childValueChanged( PropertyItem *child )
+{
+ if ( typ == Rect ) {
+ TQRect r = value().toRect();
+ if ( child->name() == tr( "x" ) )
+ r.moveBy( -r.x() + child->value().toInt(), 0 );
+ else if ( child->name() == tr( "y" ) )
+ r.moveBy( 0, -r.y() + child->value().toInt() );
+ else if ( child->name() == tr( "width" ) )
+ r.setWidth( child->value().toInt() );
+ else if ( child->name() == tr( "height" ) )
+ r.setHeight( child->value().toInt() );
+ setValue( r );
+ } else if ( typ == Point ) {
+ TQPoint r = value().toPoint();
+ if ( child->name() == tr( "x" ) )
+ r.setX( child->value().toInt() );
+ else if ( child->name() == tr( "y" ) )
+ r.setY( child->value().toInt() );
+ setValue( r );
+ } else if ( typ == Size ) {
+ TQSize r = value().toSize();
+ if ( child->name() == tr( "width" ) )
+ r.setWidth( child->value().toInt() );
+ else if ( child->name() == tr( "height" ) )
+ r.setHeight( child->value().toInt() );
+ setValue( r );
+ }
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyPixmapItem::PropertyPixmapItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, Type t )
+ : PropertyItem( l, after, prop, propName ), type( t )
+{
+ box = new TQHBox( listview->viewport() );
+ box->hide();
+ pixPrev = new TQLabel( box );
+ pixPrev->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Minimum ) );
+ pixPrev->setBackgroundColor( pixPrev->tqcolorGroup().color( TQColorGroup::Base ) );
+ button = new TQPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ box->setLineWidth( 2 );
+ pixPrev->setFrameStyle( TQFrame::NoFrame );
+ box->installEventFilter( listview );
+ connect( button, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( getPixmap() ) );
+}
+
+PropertyPixmapItem::~PropertyPixmapItem()
+{
+ delete (TQHBox*)box;
+}
+
+void PropertyPixmapItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertyPixmapItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyPixmapItem::setValue( const TQVariant &v )
+{
+ TQString s;
+ if ( type == Pixmap )
+ pixPrev->setPixmap( v.toPixmap() );
+ else if ( type == IconSet )
+ pixPrev->setPixmap( v.toIconSet().pixmap() );
+ else
+ pixPrev->setPixmap( v.toImage() );
+ PropertyItem::setValue( v );
+ tqrepaint();
+}
+
+void PropertyPixmapItem::getPixmap()
+{
+ TQPixmap pix = qChoosePixmap( listview, listview->propertyEditor()->formWindow(), value().toPixmap() );
+ if ( !pix.isNull() ) {
+ if ( type == Pixmap )
+ setValue( pix );
+ else if ( type == IconSet )
+ setValue( TQIconSet( pix ) );
+ else
+ setValue( TQT_TQIMAGE_OBJECT(pix.convertToImage()) );
+
+ notifyValueChange();
+ }
+}
+
+bool PropertyPixmapItem::hasCustomContents() const
+{
+ return TRUE;
+}
+
+void PropertyPixmapItem::drawCustomContents( TQPainter *p, const TQRect &r )
+{
+ TQPixmap pix;
+ if ( type == Pixmap )
+ pix = value().toPixmap();
+ else if ( type == IconSet )
+ pix = value().toIconSet().pixmap();
+ else
+ pix = value().toImage();
+
+ if ( !pix.isNull() ) {
+ p->save();
+ p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()),
+ (int)(p->tqworldMatrix().dy() + r.y()) ),
+ r.size() ) );
+ p->drawPixmap( r.x(), r.y() + ( r.height() - pix.height() ) / 2, pix );
+ p->restore();
+ }
+}
+
+
+// --------------------------------------------------------------
+
+PropertyColorItem::PropertyColorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool tqchildren )
+ : PropertyItem( l, after, prop, propName ), withChildren( tqchildren )
+{
+ box = new TQHBox( listview->viewport() );
+ box->hide();
+ colorPrev = new TQFrame( box );
+ button = new TQPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ box->setLineWidth( 2 );
+ colorPrev->setFrameStyle( TQFrame::Plain | TQFrame::Box );
+ colorPrev->setLineWidth( 2 );
+ TQPalette pal = colorPrev->palette();
+ TQColorGroup cg = pal.active();
+ cg.setColor( TQColorGroup::Foreground, cg.color( TQColorGroup::Base ) );
+ pal.setActive( cg );
+ pal.setInactive( cg );
+ pal.setDisabled( cg );
+ colorPrev->setPalette( pal );
+ box->installEventFilter( listview );
+ connect( button, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( getColor() ) );
+}
+
+void PropertyColorItem::createChildren()
+{
+ PropertyItem *i = this;
+ i = new PropertyIntItem( listview, i, this, tr( "Red" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, tr( "Green" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, tr( "Blue" ), TRUE );
+ addChild( i );
+}
+
+void PropertyColorItem::initChildren()
+{
+ PropertyItem *item = 0;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == tr( "Red" ) )
+ item->setValue( val.toColor().red() );
+ else if ( item->name() == tr( "Green" ) )
+ item->setValue( val.toColor().green() );
+ else if ( item->name() == tr( "Blue" ) )
+ item->setValue( val.toColor().blue() );
+ }
+}
+
+PropertyColorItem::~PropertyColorItem()
+{
+ delete (TQHBox*)box;
+}
+
+void PropertyColorItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertyColorItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyColorItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ TQString s;
+ setText( 1, v.toColor().name() );
+ colorPrev->setBackgroundColor( v.toColor() );
+ PropertyItem::setValue( v );
+}
+
+bool PropertyColorItem::hasSubItems() const
+{
+ return withChildren;
+}
+
+void PropertyColorItem::childValueChanged( PropertyItem *child )
+{
+ TQColor c( val.toColor() );
+ if ( child->name() == tr( "Red" ) )
+ c.setRgb( child->value().toInt(), c.green(), c.blue() );
+ else if ( child->name() == tr( "Green" ) )
+ c.setRgb( c.red(), child->value().toInt(), c.blue() );
+ else if ( child->name() == tr( "Blue" ) )
+ c.setRgb( c.red(), c.green(), child->value().toInt() );
+ setValue( c );
+ notifyValueChange();
+}
+
+void PropertyColorItem::getColor()
+{
+ TQColor c = TQColorDialog::getColor( val.asColor(), listview );
+ if ( c.isValid() ) {
+ setValue( c );
+ notifyValueChange();
+ }
+}
+
+bool PropertyColorItem::hasCustomContents() const
+{
+ return TRUE;
+}
+
+void PropertyColorItem::drawCustomContents( TQPainter *p, const TQRect &r )
+{
+ p->save();
+ p->setPen( TQPen( black, 1 ) );
+ p->setBrush( val.toColor() );
+ p->drawRect( r.x() + 2, r.y() + 2, r.width() - 5, r.height() - 5 );
+ p->restore();
+}
+
+// --------------------------------------------------------------
+
+PropertyFontItem::PropertyFontItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ box = new TQHBox( listview->viewport() );
+ box->hide();
+ lined = new TQLineEdit( box );
+ button = new TQPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ box->setLineWidth( 2 );
+ lined->setFrame( FALSE );
+ lined->setReadOnly( TRUE );
+ box->setFocusProxy( lined );
+ box->installEventFilter( listview );
+ lined->installEventFilter( listview );
+ button->installEventFilter( listview );
+ connect( button, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( getFont() ) );
+}
+
+void PropertyFontItem::createChildren()
+{
+ PropertyItem *i = this;
+ i = new PropertyListItem( listview, i, this, tr( "Family" ), FALSE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, tr( "Point Size" ), TRUE );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, tr( "Bold" ) );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, tr( "Italic" ) );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, tr( "Underline" ) );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, tr( "Strikeout" ) );
+ addChild( i );
+}
+
+void PropertyFontItem::initChildren()
+{
+ PropertyItem *item = 0;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == tr( "Family" ) ) {
+ ( (PropertyListItem*)item )->setValue( getFontList() );
+ ( (PropertyListItem*)item )->setCurrentItem( val.toFont().family() );
+ } else if ( item->name() == tr( "Point Size" ) )
+ item->setValue( val.toFont().pointSize() );
+ else if ( item->name() == tr( "Bold" ) )
+ item->setValue( TQVariant( val.toFont().bold(), 0 ) );
+ else if ( item->name() == tr( "Italic" ) )
+ item->setValue( TQVariant( val.toFont().italic(), 0 ) );
+ else if ( item->name() == tr( "Underline" ) )
+ item->setValue( TQVariant( val.toFont().underline(), 0 ) );
+ else if ( item->name() == tr( "Strikeout" ) )
+ item->setValue( TQVariant( val.toFont().strikeOut(), 0 ) );
+ }
+}
+
+PropertyFontItem::~PropertyFontItem()
+{
+ delete (TQHBox*)box;
+}
+
+void PropertyFontItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() || !lined->hasFocus() ) {
+ box->show();
+ setFocus( lined );
+ }
+}
+
+void PropertyFontItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyFontItem::setValue( const TQVariant &v )
+{
+ if ( value() == v )
+ return;
+
+ setText( 1, v.toFont().family() + "-" + TQString::number( v.toFont().pointSize() ) );
+ lined->setText( v.toFont().family() + "-" + TQString::number( v.toFont().pointSize() ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyFontItem::getFont()
+{
+ bool ok = FALSE;
+ TQFont f = TQFontDialog::getFont( &ok, val.toFont(), listview );
+ if ( ok && f != val.toFont() ) {
+ setValue( f );
+ notifyValueChange();
+ }
+}
+
+bool PropertyFontItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+void PropertyFontItem::childValueChanged( PropertyItem *child )
+{
+ TQFont f = val.toFont();
+ if ( child->name() == tr( "Family" ) )
+ f.setFamily( ( (PropertyListItem*)child )->currentItem() );
+ else if ( child->name() == tr( "Point Size" ) )
+ f.setPointSize( child->value().toInt() );
+ else if ( child->name() == tr( "Bold" ) )
+ f.setBold( child->value().toBool() );
+ else if ( child->name() == tr( "Italic" ) )
+ f.setItalic( child->value().toBool() );
+ else if ( child->name() == tr( "Underline" ) )
+ f.setUnderline( child->value().toBool() );
+ else if ( child->name() == tr( "Strikeout" ) )
+ f.setStrikeOut( child->value().toBool() );
+ setValue( f );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyDatabaseItem::PropertyDatabaseItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool wField )
+ : PropertyItem( l, after, prop, propName ), withField( wField )
+{
+ box = new TQHBox( listview->viewport() );
+ box->hide();
+ lined = new TQLineEdit( box );
+ button = new TQPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ box->setLineWidth( 2 );
+ lined->setFrame( FALSE );
+ lined->setReadOnly( TRUE );
+ box->setFocusProxy( lined );
+ box->installEventFilter( listview );
+ lined->installEventFilter( listview );
+ button->installEventFilter( listview );
+}
+
+void PropertyDatabaseItem::createChildren()
+{
+ PropertyItem *i = this;
+ i = new PropertyListItem( listview, i, this, tr( "Connection" ), TRUE );
+ addChild( i );
+ i = new PropertyListItem( listview, i, this, tr( "Table" ), TRUE );
+ addChild( i );
+ if ( withField ) {
+ i = new PropertyListItem( listview, i, this, tr( "Field" ), TRUE );
+ addChild( i );
+ }
+}
+
+void PropertyDatabaseItem::initChildren()
+{
+#ifndef TQT_NO_SQL
+ PropertyItem *item = 0;
+ TQStringList lst = value().toStringList();
+ TQString conn, table;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == tr( "Connection" ) ) {
+ TQStringList cl = listview->propertyEditor()->formWindow()->project()->databaseConnectionList();
+ if ( !cl.isEmpty() )
+ item->setValue( cl );
+ else if ( lst.count() > 0 )
+ item->setValue( TQStringList( lst[ 0 ] ) );
+ else if ( withField )
+ item->setValue( TQStringList( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(),
+ "database" ).toStringList()[ 0 ] ) );
+
+ if ( lst.count() > 0 && !lst[ 0 ].isEmpty() )
+ item->setCurrentItem( lst[ 0 ] );
+ else if ( !isChanged() && withField )
+ item->setCurrentItem( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(),
+ "database" ).toStringList()[ 0 ] );
+ else
+ item->setCurrentItem( 0 );
+ conn = item->currentItem();
+ } else if ( item->name() == tr( "Table" ) ) {
+ TQStringList cl = listview->propertyEditor()->formWindow()->project()->databaseTableList( conn );
+ if ( !cl.isEmpty() )
+ item->setValue( cl );
+ else if ( lst.count() > 1 )
+ item->setValue( TQStringList( lst[ 1 ] ) );
+ else if ( withField ) {
+ TQStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList();
+ if ( fakeLst.count() > 1 )
+ item->setValue( fakeLst[ 1 ] );
+ }
+
+ if ( lst.count() > 1 && !lst[ 1 ].isEmpty() )
+ item->setCurrentItem( lst[ 1 ] );
+ else if ( !isChanged() && withField ) {
+ TQStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList();
+ if ( fakeLst.count() > 1 )
+ item->setCurrentItem( fakeLst[ 1 ] );
+ else
+ item->setCurrentItem( 0 );
+ } else
+ item->setCurrentItem( 0 );
+ table = item->currentItem();
+ } else if ( item->name() == tr( "Field" ) ) {
+ TQStringList cl = listview->propertyEditor()->formWindow()->project()->databaseFieldList( conn, table );
+ if ( !cl.isEmpty() )
+ item->setValue( cl );
+ else if ( lst.count() > 2 )
+ item->setValue( TQStringList( lst[ 2 ] ) );
+ if ( lst.count() > 2 && !lst[ 2 ].isEmpty() )
+ item->setCurrentItem( lst[ 2 ] );
+ else
+ item->setCurrentItem( 0 );
+ }
+ }
+#endif
+}
+
+PropertyDatabaseItem::~PropertyDatabaseItem()
+{
+ delete (TQHBox*)box;
+}
+
+void PropertyDatabaseItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() || !lined->hasFocus() ) {
+ box->show();
+ setFocus( lined );
+ }
+}
+
+void PropertyDatabaseItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyDatabaseItem::setValue( const TQVariant &v )
+{
+ if ( value() == v )
+ return;
+
+ TQStringList lst = v.toStringList();
+ TQString s = lst.join( "." );
+ setText( 1, s );
+ lined->setText( s );
+ PropertyItem::setValue( v );
+}
+
+bool PropertyDatabaseItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+void PropertyDatabaseItem::childValueChanged( PropertyItem *c )
+{
+#ifndef TQT_NO_SQL
+ TQStringList lst;
+ lst << ( (PropertyListItem*)PropertyItem::child( 0 ) )->currentItem()
+ << ( (PropertyListItem*)PropertyItem::child( 1 ) )->currentItem();
+ if ( withField )
+ lst << ( (PropertyListItem*)PropertyItem::child( 2 ) )->currentItem();
+ if ( c == PropertyItem::child( 0 ) ) { // if the connection changed
+ lst[ 0 ] = ( (PropertyListItem*)c )->currentItem();
+ PropertyItem::child( 1 )->setValue( listview->propertyEditor()->formWindow()->project()->databaseTableList( lst[ 0 ] ) );
+ if ( withField )
+ PropertyItem::child( 2 )->setValue( listview->propertyEditor()->formWindow()->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] ) );
+ } else if ( withField && c == PropertyItem::child( 1 ) ) { // if the table changed
+ lst[ 1 ] = ( (PropertyListItem*)c )->currentItem();
+ if ( withField )
+ PropertyItem::child( 2 )->setValue( listview->propertyEditor()->formWindow()->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] ) );
+ }
+ lst.clear();
+ lst << ( (PropertyListItem*)PropertyItem::child( 0 ) )->currentItem()
+ << ( (PropertyListItem*)PropertyItem::child( 1 ) )->currentItem();
+ if ( withField )
+ lst << ( (PropertyListItem*)PropertyItem::child( 2 ) )->currentItem();
+ setValue( lst );
+ notifyValueChange();
+#else
+ TQ_UNUSED( c );
+#endif
+}
+
+// --------------------------------------------------------------
+
+PropertySizePolicyItem::PropertySizePolicyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+TQLineEdit *PropertySizePolicyItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new TQLineEdit( listview->viewport() );
+ lin->hide();
+ lin->setReadOnly( TRUE );
+ return lin;
+}
+
+void PropertySizePolicyItem::createChildren()
+{
+ TQStringList lst;
+ lst << "Fixed" << "Minimum" << "Maximum" << "Preferred" << "MinimumExpanding" << "Expanding" << "Ignored";
+
+ PropertyItem *i = this;
+ i = new PropertyListItem( listview, i, this, tr( "hSizeType" ), FALSE );
+ i->setValue( lst );
+ addChild( i );
+ i = new PropertyListItem( listview, i, this, tr( "vSizeType" ), FALSE );
+ i->setValue( lst );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, tr( "horizontalStretch" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, tr( "verticalStretch" ), TRUE );
+ addChild( i );
+}
+
+void PropertySizePolicyItem::initChildren()
+{
+ PropertyItem *item = 0;
+ TQSizePolicy sp = val.toSizePolicy();
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == tr( "hSizeType" ) )
+ ( (PropertyListItem*)item )->setCurrentItem( size_type_to_int( sp.horData() ) );
+ else if ( item->name() == tr( "vSizeType" ) )
+ ( (PropertyListItem*)item )->setCurrentItem( size_type_to_int( sp.verData() ) );
+ else if ( item->name() == tr( "horizontalStretch" ) )
+ ( (PropertyIntItem*)item )->setValue( sp.horStretch() );
+ else if ( item->name() == tr( "verticalStretch" ) )
+ ( (PropertyIntItem*)item )->setValue( sp.verStretch() );
+ }
+}
+
+PropertySizePolicyItem::~PropertySizePolicyItem()
+{
+ delete (TQLineEdit*)lin;
+}
+
+void PropertySizePolicyItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( lined() );
+ if ( !lined()->isVisible() || !lined()->hasFocus() ) {
+ lined()->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertySizePolicyItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ lined()->hide();
+}
+
+void PropertySizePolicyItem::setValue( const TQVariant &v )
+{
+ if ( value() == v )
+ return;
+
+ TQString s = tr( "%1/%2/%2/%2" );
+ s = s.arg( size_type_to_string( v.toSizePolicy().horData() ) ).
+ arg( size_type_to_string( v.toSizePolicy().verData() ) ).
+ arg( v.toSizePolicy().horStretch() ).
+ arg( v.toSizePolicy().verStretch() );
+ setText( 1, s );
+ lined()->setText( s );
+ PropertyItem::setValue( v );
+}
+
+void PropertySizePolicyItem::childValueChanged( PropertyItem *child )
+{
+ TQSizePolicy sp = val.toSizePolicy();
+ if ( child->name() == tr( "hSizeType" ) )
+ sp.setHorData( int_to_size_type( ( ( PropertyListItem*)child )->currentIntItem() ) );
+ else if ( child->name() == tr( "vSizeType" ) )
+ sp.setVerData( int_to_size_type( ( ( PropertyListItem*)child )->currentIntItem() ) );
+ else if ( child->name() == tr( "horizontalStretch" ) )
+ sp.setHorStretch( ( ( PropertyIntItem*)child )->value().toInt() );
+ else if ( child->name() == tr( "verticalStretch" ) )
+ sp.setVerStretch( ( ( PropertyIntItem*)child )->value().toInt() );
+ setValue( sp );
+ notifyValueChange();
+}
+
+bool PropertySizePolicyItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+// --------------------------------------------------------------
+
+PropertyPaletteItem::PropertyPaletteItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ box = new TQHBox( listview->viewport() );
+ box->hide();
+ palettePrev = new TQLabel( box );
+ button = new TQPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
+ box->setLineWidth( 2 );
+ palettePrev->setFrameStyle( TQFrame::NoFrame );
+ box->installEventFilter( listview );
+ connect( button, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( getPalette() ) );
+}
+PropertyPaletteItem::~PropertyPaletteItem()
+{
+ delete (TQHBox*)box;
+}
+
+void PropertyPaletteItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertyPaletteItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyPaletteItem::setValue( const TQVariant &v )
+{
+ TQString s;
+ palettePrev->setPalette( v.toPalette() );
+ PropertyItem::setValue( v );
+ tqrepaint();
+}
+
+void PropertyPaletteItem::getPalette()
+{
+ if ( !listview->propertyEditor()->widget()->isWidgetType() )
+ return;
+ bool ok = FALSE;
+ TQWidget *w = (TQWidget*)listview->propertyEditor()->widget();
+ if ( ::tqqt_cast<TQScrollView*>(w) )
+ w = ( (TQScrollView*)w )->viewport();
+ TQPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(),
+#if defined(TQT_NON_COMMERCIAL)
+ w->backgroundMode(), listview->tqtopLevelWidget(),
+#else
+ w->backgroundMode(), listview,
+#endif
+ "choose_palette", listview->propertyEditor()->formWindow() );
+ if ( !ok )
+ return;
+ setValue( pal );
+ notifyValueChange();
+}
+
+bool PropertyPaletteItem::hasCustomContents() const
+{
+ return TRUE;
+}
+
+void PropertyPaletteItem::drawCustomContents( TQPainter *p, const TQRect &r )
+{
+ TQPalette pal( value().toPalette() );
+ p->save();
+ p->setClipRect( TQRect( TQPoint( (int)(p->tqworldMatrix().dx() + r.x()),
+ (int)(p->tqworldMatrix().dy() + r.y()) ),
+ r.size() ) );
+ TQRect r2( r );
+ r2.setX( r2.x() + 2 );
+ r2.setY( r2.y() + 2 );
+ r2.setWidth( r2.width() - 3 );
+ r2.setHeight( r2.height() - 3 );
+ p->setPen( TQPen( black, 1 ) );
+ p->setBrush( pal.active().background() );
+ p->drawRect( r2 );
+ p->restore();
+}
+
+// --------------------------------------------------------------
+
+PropertyCursorItem::PropertyCursorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ comb = 0;
+}
+
+TQComboBox *PropertyCursorItem::combo()
+{
+ if ( comb )
+ return comb;
+ comb = new TQComboBox( FALSE, listview->viewport() );
+ comb->hide();
+ TQBitmap cur;
+
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_arrow.png" ), tr("Arrow"), TQt::ArrowCursor);
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_uparrow.png" ), tr("Up-Arrow"), TQt::UpArrowCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_cross.png" ), tr("Cross"), TQt::CrossCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_wait.png" ), tr("Waiting"), TQt::WaitCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_ibeam.png" ), tr("iBeam"), TQt::IbeamCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_sizev.png" ), tr("Size Vertical"), TQt::SizeVerCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_sizeh.png" ), tr("Size Horizontal"), TQt::SizeHorCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_sizef.png" ), tr("Size Slash"), TQt::SizeBDiagCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_sizeb.png" ), tr("Size Backslash"), TQt::SizeFDiagCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_sizeall.png" ), tr("Size All"), TQt::SizeAllCursor );
+ cur = TQBitmap( 25, 25, 1 );
+ cur.setMask( cur );
+ comb->insertItem( cur, tr("Blank"), TQt::BlankCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_vsplit.png" ), tr("Split Vertical"), TQt::SplitVCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_hsplit.png" ), tr("Split Horizontal"), TQt::SplitHCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_hand.png" ), tr("Pointing Hand"), TQt::PointingHandCursor );
+ comb->insertItem( TQPixmap::fromMimeSource( "designer_no.png" ), tr("Forbidden"), TQt::ForbiddenCursor );
+
+ connect( comb, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( setValue() ) );
+ comb->installEventFilter( listview );
+ return comb;
+}
+
+PropertyCursorItem::~PropertyCursorItem()
+{
+ delete (TQComboBox*)comb;
+}
+
+void PropertyCursorItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->setCurrentItem( (int)value().toCursor().tqshape() );
+ combo()->blockSignals( FALSE );
+ }
+ placeEditor( combo() );
+ if ( !combo()->isVisible() || !combo()->hasFocus() ) {
+ combo()->show();
+ setFocus( combo() );
+ }
+}
+
+void PropertyCursorItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ combo()->hide();
+}
+
+void PropertyCursorItem::setValue( const TQVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ combo()->blockSignals( TRUE );
+ combo()->setCurrentItem( (int)v.toCursor().tqshape() );
+ combo()->blockSignals( FALSE );
+ setText( 1, combo()->currentText() );
+ PropertyItem::setValue( v );
+}
+
+void PropertyCursorItem::setValue()
+{
+ if ( !comb )
+ return;
+ if ( TQVariant( TQCursor( combo()->currentItem() ) ) == val )
+ return;
+ setText( 1, combo()->currentText() );
+ PropertyItem::setValue( TQCursor( combo()->currentItem() ) );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyKeysequenceItem::PropertyKeysequenceItem( PropertyList *l,
+ PropertyItem *after,
+ PropertyItem *prop,
+ const TQString &propName )
+ : PropertyItem( l, after, prop, propName ),
+ k1( 0 ), k2( 0 ), k3( 0 ), k4( 0 ), num( 0 ), mouseEnter( FALSE )
+{
+ box = new TQHBox( listview->viewport() );
+ box->hide();
+ sequence = new TQLineEdit( box );
+ connect( sequence, TQT_SIGNAL(textChanged( const TQString & )),
+ this, TQT_SLOT(setValue()) );
+ sequence->installEventFilter( this );
+}
+
+PropertyKeysequenceItem::~PropertyKeysequenceItem()
+{
+ delete (TQHBox*)box;
+}
+
+void PropertyKeysequenceItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ sequence->setFocus();
+ }
+}
+
+void PropertyKeysequenceItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+bool PropertyKeysequenceItem::eventFilter( TQObject *o, TQEvent *e )
+{
+ TQ_UNUSED( o );
+ if ( e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *k = (TQKeyEvent *)e;
+ if ( !mouseEnter &&
+ (k->key() == Qt::Key_Up ||
+ k->key() == Qt::Key_Down) )
+ return FALSE;
+ handleKeyEvent( k );
+ return TRUE;
+ } else if ( (e->type() == TQEvent::FocusIn) ||
+ (e->type() == TQEvent::MouseButtonPress) ) {
+ mouseEnter = ( listview->lastEvent() == PropertyList::MouseEvent ) ||
+ (e->type() == TQEvent::MouseButtonPress);
+ return TRUE;
+ }
+
+ // Lets eat accelerators now..
+ if ( e->type() == TQEvent::Accel ||
+ e->type() == TQEvent::AccelOverride ||
+ e->type() == TQEvent::KeyRelease )
+ return TRUE;
+ return FALSE;
+}
+
+void PropertyKeysequenceItem::handleKeyEvent( TQKeyEvent *e )
+{
+ int nextKey = e->key();
+
+ if ( num > 3 ||
+ nextKey == Qt::Key_Control ||
+ nextKey == Qt::Key_Shift ||
+ nextKey == Qt::Key_Meta ||
+ nextKey == Qt::Key_Alt)
+ return;
+
+ int modifier = translateModifiers( e->state() );
+ if (nextKey == TQt::Key_BackTab)
+ modifier &= ~Qt::SHIFT;
+
+ nextKey |= modifier;
+ switch( num ) {
+ case 0:
+ k1 = nextKey;
+ break;
+ case 1:
+ k2 = nextKey;
+ break;
+ case 2:
+ k3 = nextKey;
+ break;
+ case 3:
+ k4 = nextKey;
+ break;
+ default:
+ break;
+ }
+ num++;
+ TQKeySequence ks( k1, k2, k3, k4 );
+ sequence->setText( ks );
+}
+
+int PropertyKeysequenceItem::translateModifiers( int state )
+{
+ int result = 0;
+ if ( state & ShiftButton )
+ result |= Qt::SHIFT;
+ if ( state & ControlButton )
+ result |= Qt::CTRL;
+ if ( state & TQt::MetaButton )
+ result |= Qt::META;
+ if ( state & TQt::AltButton )
+ result |= Qt::ALT;
+ return result;
+}
+
+void PropertyKeysequenceItem::setValue()
+{
+ TQVariant v;
+ v = TQVariant( TQKeySequence(sequence->text()) );
+ if ( v.toString().isNull() )
+ return;
+ setText( 1, sequence->text() );
+ PropertyItem::setValue( v );
+ if (sequence->hasFocus()
+ // if the user wants to use F1 as accelerator, Designer will pop up a TQWhatsThat widget
+ || (tqApp->tqfocusWidget() && tqApp->tqfocusWidget()->inherits("TQWhatsThat")))
+ notifyValueChange();
+ setChanged( TRUE );
+}
+
+void PropertyKeysequenceItem::setValue( const TQVariant &v )
+{
+ TQKeySequence ks = v.toKeySequence();
+ if ( sequence ) {
+ sequence->setText( ks );
+ }
+ num = ks.count();
+ k1 = ks[0];
+ k2 = ks[1];
+ k3 = ks[2];
+ k4 = ks[3];
+ setText( 1, ks );
+ PropertyItem::setValue( v );
+}
+
+// --------------------------------------------------------------
+
+EnumPopup::EnumPopup( TQWidget *tqparent, const char *name, WFlags f )
+ : TQFrame( tqparent, name, f )
+{
+ setLineWidth( 1 );
+ setFrameStyle( Panel | Plain );
+ setPaletteBackgroundColor( TQt::white );
+ popLayout = new TQVBoxLayout( this, 3 );
+ checkBoxList.setAutoDelete( TRUE );
+}
+
+EnumPopup::~EnumPopup()
+{
+}
+
+void EnumPopup::insertEnums( TQValueList<EnumItem> lst )
+{
+ while ( checkBoxList.count() )
+ checkBoxList.removeFirst();
+
+ itemList = lst;
+ TQCheckBox *cb;
+ TQValueListConstIterator<EnumItem> it = itemList.begin();
+ for ( ; it != itemList.end(); ++it ) {
+ cb = new TQCheckBox( this );
+ cb->setText( (*it).key );
+ cb->setChecked( (*it).selected );
+ if ( it == itemList.begin() )
+ cb->setFocus();
+ checkBoxList.append( cb );
+ cb->resize( width(), cb->height() );
+ popLayout->addWidget( cb );
+ }
+}
+
+void EnumPopup::keyPressEvent( TQKeyEvent *e )
+{
+ if ( e->key() == Key_Escape ) {
+ hide();
+ emit hidden();
+ } else if ( e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return ) {
+ closeWidget();
+ }
+}
+
+void EnumPopup::closeWidget()
+{
+ TQPtrListIterator<TQCheckBox> it( checkBoxList );
+ int i = 0;
+ while ( it.current() != 0 ) {
+ itemList[i].selected = (*it)->isChecked();
+ ++it;
+ ++i;
+ }
+ close();
+ emit closed();
+}
+
+TQValueList<EnumItem> EnumPopup::enumList() const
+{
+ return itemList;
+}
+
+EnumBox::EnumBox( TQWidget *tqparent, const char *name )
+ : TQComboBox( tqparent, name )
+{
+ pop = new EnumPopup( this, "popup", (WFlags)WType_Popup );
+ connect( pop, TQT_SIGNAL( hidden() ), this, TQT_SLOT( popupHidden() ) );
+ connect( pop, TQT_SIGNAL( closed() ), this, TQT_SLOT( popupClosed() ) );
+ popupShown = FALSE;
+ arrowDown = FALSE;
+}
+
+void EnumBox::popupHidden()
+{
+ popupShown = FALSE;
+}
+
+void EnumBox::popupClosed()
+{
+ popupShown = FALSE;
+ emit valueChanged();
+}
+
+void EnumBox::paintEvent( TQPaintEvent * )
+{
+ TQPainter p( this );
+ const TQColorGroup & g = tqcolorGroup();
+ p.setPen(g.text());
+
+ TQStyle::SFlags flags = TQStyle::Style_Default;
+ if (isEnabled())
+ flags |= TQStyle::Style_Enabled;
+ if (hasFocus())
+ flags |= TQStyle::Style_HasFocus;
+
+ if ( width() < 5 || height() < 5 ) {
+ qDrawShadePanel( &p, rect().x(), rect().y(), rect().width(), rect().height(), g, FALSE, 2,
+ &g.brush( TQColorGroup::Button ) );
+ return;
+ }
+ tqstyle().tqdrawComplexControl( TQStyle::CC_ComboBox, &p, this, rect(), g,
+ flags, TQStyle::SC_All,
+ (arrowDown ?
+ TQStyle::SC_ComboBoxArrow :
+ TQStyle::SC_None ));
+
+ TQRect re = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this,
+ TQStyle::SC_ComboBoxEditField );
+ re = TQStyle::tqvisualRect(re, this);
+ p.setClipRect( re );
+
+ if ( !str.isNull() ) {
+ p.save();
+ p.setFont(font());
+ TQFontMetrics fm(font());
+ int x = re.x(), y = re.y() + fm.ascent();
+ p.drawText( x, y, str );
+ p.restore();
+ }
+}
+
+void EnumBox::insertEnums( TQValueList<EnumItem> lst )
+{
+ pop->insertEnums( lst );
+}
+
+TQValueList<EnumItem> EnumBox::enumList() const
+{
+ return pop->enumList();
+}
+
+void EnumBox::popup()
+{
+ if ( popupShown ) {
+ pop->closeWidget();
+ popupShown = FALSE;
+ return;
+ }
+ pop->move( ((TQWidget*)tqparent())->mapToGlobal( tqgeometry().bottomLeft() ) );
+ pop->setMinimumWidth( width() );
+ emit aboutToShowPopup();
+ pop->show();
+ popupShown = TRUE;
+}
+
+void EnumBox::mousePressEvent( TQMouseEvent *e )
+{
+ if ( e->button() != Qt::LeftButton )
+ return;
+
+ TQRect arrowRect = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this,
+ TQStyle::SC_ComboBoxArrow);
+ arrowRect = TQStyle::tqvisualRect(arrowRect, this);
+
+ arrowRect.setHeight( TQMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) );
+
+ if ( arrowRect.tqcontains( e->pos() ) ) {
+ arrowDown = TRUE;
+ tqrepaint( FALSE );
+ }
+
+ popup();
+ TQTimer::singleShot( 100, this, TQT_SLOT( restoreArrow() ) );
+}
+
+void EnumBox::keyPressEvent( TQKeyEvent *e )
+{
+ if ( e->key() == Qt::Key_Space ) {
+ popup();
+ TQTimer::singleShot( 100, this, TQT_SLOT( restoreArrow() ) );
+ } else if ( e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return ) {
+ popup();
+ }
+}
+
+void EnumBox::restoreArrow()
+{
+ arrowDown = FALSE;
+ tqrepaint( FALSE );
+}
+
+void EnumBox::setText( const TQString &text )
+{
+ str = text;
+ tqrepaint( FALSE );
+}
+
+
+
+PropertyEnumItem::PropertyEnumItem( PropertyList *l,
+ PropertyItem *after,
+ PropertyItem *prop,
+ const TQString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ box = new EnumBox( listview->viewport() );
+ box->hide();
+ box->installEventFilter( listview );
+ connect( box, TQT_SIGNAL( aboutToShowPopup() ), this, TQT_SLOT( insertEnums() ) );
+ connect( box, TQT_SIGNAL( valueChanged() ), this, TQT_SLOT( setValue() ) );
+}
+
+PropertyEnumItem::~PropertyEnumItem()
+{
+ delete (EnumBox*)box;
+}
+
+void PropertyEnumItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ box->setText( enumString );
+ listView()->viewport()->setFocus();
+ }
+ box->setFocus();
+}
+
+void PropertyEnumItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyEnumItem::setValue( const TQVariant &v )
+{
+ enumString = "";
+ enumList.clear();
+ TQStringList lst = v.toStringList();
+ TQValueListConstIterator<TQString> it = lst.begin();
+ for ( ; it != lst.end(); ++it )
+ enumList.append( EnumItem( *it, FALSE ) );
+ enumList.first().selected = TRUE;
+ enumString = enumList.first().key;
+ box->setText( enumString );
+ setText( 1, enumString );
+ PropertyItem::setValue( v );
+}
+
+void PropertyEnumItem::insertEnums()
+{
+ box->insertEnums( enumList );
+}
+
+void PropertyEnumItem::setValue()
+{
+ enumList = box->enumList();
+ enumString = "";
+ TQValueListConstIterator<EnumItem> it = enumList.begin();
+ for ( ; it != enumList.end(); ++it ) {
+ if ( (*it).selected )
+ enumString += "|" + (*it).key;
+ }
+ if ( !enumString.isEmpty() )
+ enumString.tqreplace( 0, 1, "" );
+
+ box->setText( enumString );
+ setText( 1, enumString );
+ notifyValueChange();
+}
+
+void PropertyEnumItem::setCurrentValues( TQStrList lst )
+{
+ enumString ="";
+ TQStrList::ConstIterator it = lst.begin();
+ TQValueList<EnumItem>::Iterator eit = enumList.begin();
+ for ( ; eit != enumList.end(); ++eit ) {
+ (*eit).selected = FALSE;
+ for ( it = lst.begin(); it != lst.end(); ++it ) {
+ if ( TQString( *it ) == (*eit).key ) {
+ (*eit).selected = TRUE;
+ enumString += "|" + (*eit).key;
+ break;
+ }
+ }
+ }
+ if ( !enumString.isEmpty() )
+ enumString.tqreplace( 0, 1, "" );
+ box->setText( enumString );
+ setText( 1, enumString );
+}
+
+TQString PropertyEnumItem::currentItem() const
+{
+ return enumString;
+}
+
+TQString PropertyEnumItem::currentItemFromObject() const
+{
+ return enumString;
+}
+
+// --------------------------------------------------------------
+
+/*!
+ \class PropertyList propertyeditor.h
+ \brief PropertyList is a TQListView derived class which is used for editing widget properties
+
+ This class is used for widget properties. It has to be child of a
+ PropertyEditor.
+
+ To initialize it for editing a widget call setupProperties() which
+ iterates through the properties of the current widget (see
+ PropertyEditor::widget()) and builds the list.
+
+ To update the item values, refetchData() can be called.
+
+ If the value of an item has been changed by the user, and this
+ change should be applied to the widget's property, valueChanged()
+ has to be called.
+
+ To set the value of an item, setPropertyValue() has to be called.
+*/
+
+PropertyList::PropertyList( PropertyEditor *e )
+ : TQListView( e ), editor( e )
+{
+ init_colors();
+
+ whatsThis = new PropertyWhatsThis( this );
+ showSorted = FALSE;
+ header()->setMovingEnabled( FALSE );
+ header()->setStretchEnabled( TRUE );
+ setResizePolicy( TQScrollView::Manual );
+ viewport()->setAcceptDrops( TRUE );
+ viewport()->installEventFilter( this );
+ addColumn( tr( "Property" ) );
+ addColumn( tr( "Value" ) );
+ connect( header(), TQT_SIGNAL( sizeChange( int, int, int ) ),
+ this, TQT_SLOT( updateEditorSize() ) );
+ disconnect( header(), TQT_SIGNAL( sectionClicked( int ) ),
+ this, TQT_SLOT( changeSortColumn( int ) ) );
+ connect( header(), TQT_SIGNAL( sectionClicked( int ) ),
+ this, TQT_SLOT( toggleSort() ) );
+ connect( this, TQT_SIGNAL( pressed( TQListViewItem *, const TQPoint &, int ) ),
+ this, TQT_SLOT( itemPressed( TQListViewItem *, const TQPoint &, int ) ) );
+ connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ),
+ this, TQT_SLOT( toggleOpen( TQListViewItem * ) ) );
+ setSorting( -1 );
+ setHScrollBarMode( AlwaysOff );
+ setVScrollBarMode( AlwaysOn );
+ setColumnWidthMode( 1, Manual );
+ mousePressed = FALSE;
+ pressItem = 0;
+ theLastEvent = MouseEvent;
+ header()->installEventFilter( this );
+}
+
+void PropertyList::toggleSort()
+{
+ showSorted = !showSorted;
+ editor->clear();
+ editor->setup();
+}
+
+void PropertyList::resizeEvent( TQResizeEvent *e )
+{
+ TQListView::resizeEvent( e );
+ if ( currentItem() )
+ ( ( PropertyItem* )currentItem() )->showEditor();
+}
+
+static TQVariant::TQType type_to_variant( const TQString &s )
+{
+ if ( s == "Invalid " )
+ return TQVariant::Invalid;
+ if ( s == "Map" )
+ return TQVariant::Map;
+ if ( s == "List" )
+ return TQVariant::List;
+ if ( s == "String" )
+ return TQVariant::String;
+ if ( s == "StringList" )
+ return TQVariant::StringList;
+ if ( s == "Font" )
+ return TQVariant::Font;
+ if ( s == "Pixmap" )
+ return TQVariant::Pixmap;
+ if ( s == "Brush" )
+ return TQVariant::Brush;
+ if ( s == "Rect" )
+ return TQVariant::Rect;
+ if ( s == "Size" )
+ return TQVariant::Size;
+ if ( s == "Color" )
+ return TQVariant::Color;
+ if ( s == "Palette" )
+ return TQVariant::Palette;
+ if ( s == "ColorGroup" )
+ return TQVariant::ColorGroup;
+ if ( s == "IconSet" )
+ return TQVariant::IconSet;
+ if ( s == "Point" )
+ return TQVariant::Point;
+ if ( s == "Image" )
+ return TQVariant::Image;
+ if ( s == "Int" )
+ return TQVariant::Int;
+ if ( s == "UInt" )
+ return TQVariant::UInt;
+ if ( s == "Bool" )
+ return TQVariant::Bool;
+ if ( s == "Double" )
+ return TQVariant::Double;
+ if ( s == "CString" )
+ return TQVariant::CString;
+ if ( s == "PointArray" )
+ return TQVariant::PointArray;
+ if ( s == "Region" )
+ return TQVariant::Region;
+ if ( s == "Bitmap" )
+ return TQVariant::Bitmap;
+ if ( s == "Cursor" )
+ return TQVariant::Cursor;
+ if ( s == "SizePolicy" )
+ return TQVariant::SizePolicy;
+ if ( s == "Date" )
+ return TQVariant::Date;
+ if ( s == "Time" )
+ return TQVariant::Time;
+ if ( s == "DateTime" )
+ return TQVariant::DateTime;
+ return TQVariant::Invalid;
+}
+
+#ifndef TQT_NO_SQL
+static bool parent_is_data_aware( TQWidget *w )
+{
+ TQWidget *p = w ? w->parentWidget() : 0;
+ while ( p && !p->isTopLevel() ) {
+ if ( ::tqqt_cast<TQDesignerDataBrowser*>(p) || ::tqqt_cast<TQDesignerDataView*>(p) )
+ return TRUE;
+ p = p->parentWidget();
+ }
+ return FALSE;
+}
+#endif
+
+/*! Sets up the property list by adding an item for each designable
+property of the widget which is just edited.
+*/
+
+void PropertyList::setupProperties()
+{
+ if ( !editor->widget() )
+ return;
+ bool allProperties = !::tqqt_cast<Spacer*>(editor->widget());
+ TQStrList lst = editor->widget()->tqmetaObject()->propertyNames( allProperties );
+ PropertyItem *item = 0;
+ TQMap<TQString, bool> unique;
+ TQObject *w = editor->widget();
+ TQStringList valueSet;
+ bool parentHasLayout =
+ w->isWidgetType() &&
+ !editor->formWindow()->isMainContainer( (TQWidget*)w ) && ( (TQWidget*)w )->parentWidget() &&
+ WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout;
+ for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) {
+ const TQMetaProperty* p =
+ editor->widget()->tqmetaObject()->
+ property( editor->widget()->tqmetaObject()->tqfindProperty( it.current(), allProperties), allProperties );
+ if ( !p )
+ continue;
+ if ( unique.tqcontains( TQString::tqfromLatin1( it.current() ) ) )
+ continue;
+ if ( ::tqqt_cast<TQDesignerToolBar*>(editor->widget()) ||
+ ::tqqt_cast<MenuBarEditor*>(editor->widget()) ) {
+ if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "sizePolicy" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 )
+ continue;
+ }
+ unique.insert( TQString::tqfromLatin1( it.current() ), TRUE );
+ if ( editor->widget()->isWidgetType() &&
+ editor->formWindow()->isMainContainer( (TQWidget*)editor->widget() ) ) {
+ if ( qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ } else { // hide some toplevel-only stuff
+ if ( qstrcmp( p->name(), "icon" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "iconText" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "caption" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "sizeIncrement" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "baseSize" ) == 0 )
+ continue;
+ if ( parentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ if ( ::tqqt_cast<TQLayoutWidget*>(w) || ::tqqt_cast<Spacer*>(w) ) {
+ if ( qstrcmp( p->name(), "sizePolicy" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "tqminimumSize" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "tqmaximumSize" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "enabled" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "paletteForegroundColor" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "paletteBackgroundColor" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "paletteBackgroundPixmap" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "palette" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "font" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "cursor" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "mouseTracking" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "focusPolicy" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "acceptDrops" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "autoMask" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "backgroundOrigin" ) == 0 )
+ continue;
+ }
+ }
+ if ( ::tqqt_cast<TQActionGroup*>(w) ) {
+ if ( qstrcmp( p->name(), "usesDropDown" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "toggleAction" ) == 0 )
+ continue;
+ }
+ if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in Q_PROPERTY can take a function (isInButtonGroup() in this case)
+ if ( !editor->widget()->isWidgetType() ||
+ !editor->widget()->tqparent() ||
+ !::tqqt_cast<TQButtonGroup*>(editor->widget()->tqparent()) )
+ continue;
+ }
+
+ bool isPropertyObject = w->isA( "PropertyObject" );
+
+ if ( ( p->designable(w) ||
+ isPropertyObject && p->designable( ( (PropertyObject*)w )->widgetList().first() ) ) &&
+ ( !isPropertyObject || qstrcmp( p->name(), "name" ) != 0 ) ) {
+ if ( p->isSetType() ) {
+ if ( TQString( p->name() ) == "tqalignment" ) {
+ TQStringList lst;
+ lst << p->valueToKey( TQt::AlignAuto )
+ << p->valueToKey( TQt::AlignLeft )
+ << p->valueToKey( TQt::AlignHCenter )
+ << p->valueToKey( TQt::AlignRight )
+ << p->valueToKey( TQt::AlignJustify );
+ item = new PropertyListItem( this, item, 0, "hAlign", FALSE );
+ item->setValue( lst );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) )
+ item->setChanged( TRUE, FALSE );
+ if ( !::tqqt_cast<TQMultiLineEdit*>(editor->widget()) ) {
+ lst.clear();
+ lst << p->valueToKey( TQt::AlignTop )
+ << p->valueToKey( TQt::AlignVCenter )
+ << p->valueToKey( TQt::AlignBottom );
+ item = new PropertyListItem( this, item, 0, "vAlign", FALSE );
+ item->setValue( lst );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) )
+ item->setChanged( TRUE, FALSE );
+ item = new PropertyBoolItem( this, item, 0, "wordwrap" );
+ if ( ::tqqt_cast<TQGroupBox*>(w) )
+ item->tqsetVisible( FALSE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+ } else {
+ TQStrList lst( p->enumKeys() );
+ TQStringList l;
+ TQPtrListIterator<char> it( lst );
+ while ( it.current() != 0 ) {
+ l << TQString(*it);
+ ++it;
+ }
+ item = new PropertyEnumItem( this, item, 0, p->name() );
+ item->setValue( l );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), p->name() ) )
+ item->setChanged( TRUE, FALSE );
+ }
+ } else if ( p->isEnumType() ) {
+ TQStrList l = p->enumKeys();
+ TQStringList lst;
+ for ( uint i = 0; i < l.count(); ++i ) {
+ TQString k = l.at( i );
+ // filter out enum-masks
+ if ( k[0] == 'M' && k[1].category() == TQChar::Letter_Uppercase )
+ continue;
+ lst << k;
+ }
+ item = new PropertyListItem( this, item, 0, p->name(), FALSE );
+ item->setValue( lst );
+ } else {
+ TQVariant::Type t = TQVariant::nameToType( p->type() );
+ if ( !addPropertyItem( item, p->name(), t ) )
+ continue;
+ }
+ }
+ if ( item && !p->isSetType() ) {
+ if ( valueSet.tqfindIndex( item->name() ) == -1 ) {
+ setPropertyValue( item );
+ valueSet << item->name();
+ }
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), p->name() ) )
+ item->setChanged( TRUE, FALSE );
+ }
+ }
+
+ if ( !::tqqt_cast<TQSplitter*>(w) && !::tqqt_cast<MenuBarEditor*>(w) && !::tqqt_cast<TQDesignerToolBar*>(w) &&
+ w->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)w ) != WidgetFactory::NoLayout ) {
+ item = new PropertyLayoutItem( this, item, 0, "layoutSpacing" );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutSpacing" )
+ || MetaDataBase::spacing( editor->widget() ) != -1 )
+ layoutInitValue( item, TRUE );
+ else
+ layoutInitValue( item );
+ item = new PropertyLayoutItem( this, item, 0, "layoutMargin" );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutMargin" )
+ || MetaDataBase::margin( editor->widget() ) != -1 )
+ layoutInitValue( item, TRUE );
+ else
+ layoutInitValue( item );
+ TQWidget *widget = (TQWidget*)w;
+ if ( ( !::tqqt_cast<TQLayoutWidget*>(widget) &&
+ widget->parentWidget() && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) {
+ item = new PropertyListItem( this, item, 0, "resizeMode", FALSE );
+ TQStringList lst;
+ lst << "Auto" << "FreeResize" << "Minimum" << "Fixed";
+ item->setValue( lst );
+ setPropertyValue( item );
+ TQString resizeMod = MetaDataBase::resizeMode( editor->widget() );
+ if ( !resizeMod.isEmpty() &&
+ resizeMod != WidgetFactory::defaultCurrentItem( editor->widget(), "resizeMode" ) ) {
+ item->setChanged( TRUE, FALSE );
+ MetaDataBase::setPropertyChanged( editor->widget(), "resizeMode", TRUE );
+ }
+ }
+ }
+
+ if ( !::tqqt_cast<Spacer*>(w) && !::tqqt_cast<TQLayoutWidget*>(w) &&
+ !::tqqt_cast<MenuBarEditor*>(w) && !::tqqt_cast<TQDesignerToolBar*>(w) ) {
+ item = new PropertyTextItem( this, item, 0, "toolTip", TRUE, FALSE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "toolTip" ) )
+ item->setChanged( TRUE, FALSE );
+ item = new PropertyTextItem( this, item, 0, "whatsThis", TRUE, TRUE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "whatsThis" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+
+#ifndef TQT_NO_SQL
+ if ( !::tqqt_cast<TQDataTable*>(editor->widget()) && !::tqqt_cast<TQDataBrowser*>(editor->widget()) &&
+ !::tqqt_cast<TQDataView*>(editor->widget()) && parent_is_data_aware( ::tqqt_cast<TQWidget*>(editor->widget()) ) ) {
+ item = new PropertyDatabaseItem( this, item, 0, "database", TQT_BASE_OBJECT(editor->formWindow()->mainContainer()) != TQT_BASE_OBJECT(w) );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+
+ if ( ::tqqt_cast<TQDataTable*>(editor->widget()) || ::tqqt_cast<TQDataBrowser*>(editor->widget()) ||
+ ::tqqt_cast<TQDataView*>(editor->widget()) ) {
+ item = new PropertyDatabaseItem( this, item, 0, "database", FALSE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) )
+ item->setChanged( TRUE, FALSE );
+ item = new PropertyBoolItem( this, item, 0, "frameworkCode" );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "frameworkCode" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+#endif
+
+ if ( w->isA("PropertyObject") ) {
+ const TQWidgetList wl = ( (PropertyObject*)w )->widgetList();
+ TQPtrListIterator<TQWidget> wIt( wl );
+ while ( *wIt ) {
+ if ( (*wIt)->inherits("CustomWidget") ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)*wIt )->customWidget();
+ setupCusWidgetProperties( cw, unique, item );
+ }
+ ++wIt;
+ }
+ } else if ( w->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)w )->customWidget();
+ setupCusWidgetProperties( cw, unique, item );
+ }
+
+ setCurrentItem( firstChild() );
+
+ if ( showSorted ) {
+ setSorting( 0 );
+ sort();
+ setSorting( -1 );
+ setCurrentItem( firstChild() );
+ tqApp->processEvents();
+ }
+
+ updateEditorSize();
+}
+
+void PropertyList::setupCusWidgetProperties( MetaDataBase::CustomWidget *cw,
+ TQMap<TQString, bool> &unique,
+ PropertyItem *&item )
+{
+ if ( !cw )
+ return;
+
+ for ( TQValueList<MetaDataBase::Property>::Iterator it =
+ cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) {
+ if ( unique.tqcontains( TQString( (*it).property ) ) )
+ continue;
+ unique.insert( TQString( (*it).property ), TRUE );
+ addPropertyItem( item, (*it).property, (QVariant::Type)(int)type_to_variant( (*it).type ) );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), (*it).property ) )
+ item->setChanged( TRUE, FALSE );
+ }
+}
+
+bool PropertyList::addPropertyItem( PropertyItem *&item, const TQCString &name, TQVariant::Type t )
+{
+ if ( name == "buddy" ) {
+ PropertyListItem *itm = new PropertyListItem( this, item, 0, name, TRUE );
+ TQPtrDict<TQWidget> *widgets = editor->formWindow()->widgets();
+ TQPtrDictIterator<TQWidget> it( *widgets );
+ TQStringList l;
+ l << "";
+ while ( it.current() ) {
+ if ( editor->formWindow()->canBeBuddy( it.current() ) ) {
+ if ( l.tqfind( it.current()->name() ) == l.end() )
+ l << it.current()->name();
+ }
+ ++it;
+ }
+ l.sort();
+ itm->setValue( l );
+ item = itm;
+ return TRUE;
+ }
+
+ switch ( t ) {
+ case TQVariant::String:
+ item = new PropertyTextItem( this, item, 0, name, TRUE,
+ ::tqqt_cast<TQLabel*>(editor->widget()) ||
+ ::tqqt_cast<TQTextView*>(editor->widget()) ||
+ ::tqqt_cast<TQButton*>(editor->widget()) );
+ break;
+ case TQVariant::CString:
+ item = new PropertyTextItem( this, item, 0,
+ name, name == "name" &&
+ TQT_BASE_OBJECT(editor->widget()) == TQT_BASE_OBJECT(editor->formWindow()->mainContainer()),
+ FALSE, TRUE );
+ break;
+ case TQVariant::Bool:
+ item = new PropertyBoolItem( this, item, 0, name );
+ break;
+ case TQVariant::Font:
+ item = new PropertyFontItem( this, item, 0, name );
+ break;
+ case TQVariant::Int:
+ if ( name == "accel" )
+ item = new PropertyTextItem( this, item, 0, name, FALSE, FALSE, FALSE, TRUE );
+ else if ( name == "layoutSpacing" || name == "layoutMargin" )
+ item = new PropertyLayoutItem( this, item, 0, name );
+ else if ( name == "resizeMode" )
+ item = new PropertyListItem( this, item, 0, name, TRUE );
+ else
+ item = new PropertyIntItem( this, item, 0, name, TRUE );
+ break;
+ case TQVariant::Double:
+ item = new PropertyDoubleItem( this, item, 0, name );
+ break;
+ case TQVariant::KeySequence:
+ item = new PropertyKeysequenceItem( this, item, 0, name );
+ break;
+ case TQVariant::UInt:
+ item = new PropertyIntItem( this, item, 0, name, FALSE );
+ break;
+ case TQVariant::StringList:
+ item = new PropertyListItem( this, item, 0, name, TRUE );
+ break;
+ case TQVariant::Rect:
+ item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Rect );
+ break;
+ case TQVariant::Point:
+ item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Point );
+ break;
+ case TQVariant::Size:
+ item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Size );
+ break;
+ case TQVariant::Color:
+ item = new PropertyColorItem( this, item, 0, name, TRUE );
+ break;
+ case TQVariant::Pixmap:
+ item = new PropertyPixmapItem( this, item, 0, name, PropertyPixmapItem::Pixmap );
+ break;
+ case TQVariant::IconSet:
+ item = new PropertyPixmapItem( this, item, 0, name, PropertyPixmapItem::IconSet );
+ break;
+ case TQVariant::Image:
+ item = new PropertyPixmapItem( this, item, 0, name, PropertyPixmapItem::Image );
+ break;
+ case TQVariant::SizePolicy:
+ item = new PropertySizePolicyItem( this, item, 0, name );
+ break;
+ case TQVariant::Palette:
+ item = new PropertyPaletteItem( this, item, 0, name );
+ break;
+ case TQVariant::Cursor:
+ item = new PropertyCursorItem( this, item, 0, name );
+ break;
+ case TQVariant::Date:
+ item = new PropertyDateItem( this, item, 0, name );
+ break;
+ case TQVariant::Time:
+ item = new PropertyTimeItem( this, item, 0, name );
+ break;
+ case TQVariant::DateTime:
+ item = new PropertyDateTimeItem( this, item, 0, name );
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void PropertyList::paintEmptyArea( TQPainter *p, const TQRect &r )
+{
+ p->fillRect( r, *backColor2 );
+}
+
+void PropertyList::setCurrentItem( TQListViewItem *i )
+{
+ if ( !i )
+ return;
+
+ if ( currentItem() )
+ ( (PropertyItem*)currentItem() )->hideEditor();
+ TQListView::setCurrentItem( i );
+ ( (PropertyItem*)currentItem() )->showEditor();
+}
+
+void PropertyList::updateEditorSize()
+{
+ if ( currentItem() )
+ ( ( PropertyItem* )currentItem() )->showEditor();
+}
+
+/*! This has to be called if the value if \a i should be set as
+ property to the currently edited widget.
+*/
+
+void PropertyList::valueChanged( PropertyItem *i )
+{
+ if ( !editor->widget() )
+ return;
+ TQString pn( tr( "Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(),
+ editor->widget(), editor,
+ i->name(), WidgetFactory::property( editor->widget(), i->name() ),
+ i->value(), i->currentItem(), i->currentItemFromObject() );
+
+ cmd->execute();
+ editor->formWindow()->commandHistory()->addCommand( cmd, TRUE );
+}
+
+void PropertyList::layoutInitValue( PropertyItem *i, bool changed )
+{
+ if ( !editor->widget() )
+ return;
+ TQString pn( tr( "Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(),
+ editor->widget(), editor,
+ i->name(), WidgetFactory::property( editor->widget(), i->name() ),
+ i->value(), i->currentItem(), i->currentItemFromObject() );
+ cmd->execute();
+ if ( i->value().toString() != "-1" )
+ changed = TRUE;
+ i->setChanged( changed );
+}
+
+void PropertyList::itemPressed( TQListViewItem *i, const TQPoint &p, int c )
+{
+ if ( !i )
+ return;
+ PropertyItem *pi = (PropertyItem*)i;
+ if ( !pi->hasSubItems() )
+ return;
+
+ if ( c == 0 && viewport()->mapFromGlobal( p ).x() < 20 )
+ toggleOpen( i );
+}
+
+void PropertyList::toggleOpen( TQListViewItem *i )
+{
+ if ( !i )
+ return;
+ PropertyItem *pi = (PropertyItem*)i;
+ if ( pi->hasSubItems() ) {
+ pi->setOpen( !pi->isOpen() );
+ } else {
+ pi->toggle();
+ }
+}
+
+bool PropertyList::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( !o || !e )
+ return TRUE;
+
+ PropertyItem *i = (PropertyItem*)currentItem();
+ if ( e->type() == TQEvent::KeyPress )
+ theLastEvent = KeyEvent;
+ else if ( e->type() == TQEvent::MouseButtonPress )
+ theLastEvent = MouseEvent;
+
+ if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this) &&e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if ( ( ke->key() == Qt::Key_Up || ke->key() == Qt::Key_Down ) &&
+ ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this) || TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(viewport()) ) &&
+ !( ke->state() & ControlButton ) ) {
+ TQApplication::sendEvent( this, (TQKeyEvent*)e );
+ return TRUE;
+ } else if ( ( !::tqqt_cast<TQLineEdit*>(o) ||
+ ( ::tqqt_cast<TQLineEdit*>(o) && ( (TQLineEdit*)o )->isReadOnly() ) ) &&
+ i && i->hasSubItems() ) {
+ if ( !i->isOpen() &&
+ ( ke->key() == Qt::Key_Plus ||
+ ke->key() == Qt::Key_Right ))
+ i->setOpen( TRUE );
+ else if ( i->isOpen() &&
+ ( ke->key() == Qt::Key_Minus ||
+ ke->key() == Qt::Key_Left ) )
+ i->setOpen( FALSE );
+ } else if ( ( ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter ) && ::tqqt_cast<TQComboBox*>(o) ) {
+ TQKeyEvent ke2( TQEvent::KeyPress, Qt::Key_Space, 0, 0 );
+ TQApplication::sendEvent( o, &ke2 );
+ return TRUE;
+ }
+ } else if ( e->type() == TQEvent::FocusOut && ::tqqt_cast<TQLineEdit*>(o) && editor->formWindow() ) {
+ TQTimer::singleShot( 100, editor->formWindow()->commandHistory(), TQT_SLOT( checkCompressedCommand() ) );
+ } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(viewport()) ) {
+ TQMouseEvent *me;
+ PropertyListItem* i;
+ switch ( e->type() ) {
+ case TQEvent::MouseButtonPress:
+ me = (TQMouseEvent*)e;
+ i = (PropertyListItem*) itemAt( me->pos() );
+ if ( i && ( ::tqqt_cast<PropertyColorItem*>(i) || ::tqqt_cast<PropertyPixmapItem*>(i) ) ) {
+ pressItem = i;
+ pressPos = me->pos();
+ mousePressed = TRUE;
+ }
+ break;
+ case TQEvent::MouseMove:
+ me = (TQMouseEvent*)e;
+ if ( me && me->state() & Qt::LeftButton && mousePressed) {
+
+ i = (PropertyListItem*) itemAt( me->pos() );
+ if ( i && i == pressItem ) {
+
+ if (( pressPos - me->pos() ).manhattanLength() > TQApplication::startDragDistance() ){
+ if ( ::tqqt_cast<PropertyColorItem*>(i) ) {
+ TQColor col = i->value().asColor();
+ TQColorDrag *drg = new TQColorDrag( col, this );
+ TQPixmap pix( 25, 25 );
+ pix.fill( col );
+ TQPainter p( &pix );
+ p.drawRect( 0, 0, pix.width(), pix.height() );
+ p.end();
+ drg->setPixmap( pix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ else if ( ::tqqt_cast<PropertyPixmapItem*>(i) ) {
+ TQPixmap pix = i->value().asPixmap();
+ if( !pix.isNull() ) {
+ TQImage img = pix.convertToImage();
+ TQImageDrag *drg = new TQImageDrag( img, this );
+ drg->setPixmap( pix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ }
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(header()) ) {
+ if ( e->type() == TQEvent::ContextMenu ) {
+ ((TQContextMenuEvent *)e)->accept();
+ TQPopupMenu menu( 0 );
+ menu.setCheckable( TRUE );
+ const int cat_id = 1;
+ const int alpha_id = 2;
+ menu.insertItem( tr( "Sort &Categorized" ), cat_id );
+ int alpha = menu.insertItem( tr( "Sort &Alphabetically" ), alpha_id );
+ if ( showSorted )
+ menu.setItemChecked( alpha_id, TRUE );
+ else
+ menu.setItemChecked( cat_id, TRUE );
+ int res = menu.exec( ( (TQContextMenuEvent*)e )->globalPos() );
+ if ( res != -1 ) {
+ bool newShowSorted = ( res == alpha );
+ if ( showSorted != newShowSorted ) {
+ showSorted = newShowSorted;
+ editor->clear();
+ editor->setup();
+ }
+ }
+ return TRUE;
+ }
+ }
+
+ return TQListView::eventFilter( o, e );
+}
+
+/*! This method re-initializes each item of the property list.
+*/
+
+void PropertyList::refetchData()
+{
+ TQListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ PropertyItem *i = (PropertyItem*)it.current();
+ if ( !i->propertyParent() )
+ setPropertyValue( i );
+ if ( i->hasSubItems() )
+ i->initChildren();
+ bool changed = MetaDataBase::isPropertyChanged( editor->widget(), i->name() );
+ if ( ( i->name() == "layoutSpacing" || i->name() == "layoutMargin" ) ) {
+ if ( i->value().toString() != "-1" )
+ i->setChanged( TRUE, FALSE );
+ else
+ i->setChanged( FALSE, FALSE );
+ }
+ else if ( changed != i->isChanged() )
+ i->setChanged( changed, FALSE );
+ }
+ updateEditorSize();
+}
+
+static void clearAlignList( TQStrList &l )
+{
+ if ( l.count() == 1 )
+ return;
+ if ( l.tqfind( "AlignAuto" ) != -1 )
+ l.remove( "AlignAuto" );
+ if ( l.tqfind( "WordBreak" ) != -1 )
+ l.remove( "WordBreak" );
+}
+
+/*! This method initializes the value of the item \a i to the value
+ of the corresponding property.
+*/
+
+void PropertyList::setPropertyValue( PropertyItem *i )
+{
+ const TQMetaProperty *p =
+ editor->widget()->tqmetaObject()->
+ property( editor->widget()->tqmetaObject()->tqfindProperty( i->name(), TRUE), TRUE );
+ if ( !p ) {
+ if ( i->name() == "hAlign" ) {
+ int align = editor->widget()->property( "tqalignment" ).toInt();
+ p = editor->widget()->tqmetaObject()->
+ property( editor->widget()->tqmetaObject()->tqfindProperty( "tqalignment", TRUE ), TRUE );
+ align &= ~Qt::AlignVertical_Mask;
+ TQStrList l = p->valueToKeys( align );
+ clearAlignList( l );
+ ( (PropertyListItem*)i )->setCurrentItem( l.last() );
+ } else if ( i->name() == "vAlign" ) {
+ int align = editor->widget()->property( "tqalignment" ).toInt();
+ p = editor->widget()->tqmetaObject()->
+ property( editor->widget()->tqmetaObject()->tqfindProperty( "tqalignment", TRUE ), TRUE );
+ align &= ~Qt::AlignHorizontal_Mask;
+ ( (PropertyListItem*)i )->setCurrentItem( p->valueToKeys( align ).last() );
+ } else if ( i->name() == "wordwrap" ) {
+ int align = editor->widget()->property( "tqalignment" ).toInt();
+ if ( align & TQt::WordBreak )
+ i->setValue( TQVariant( TRUE, 0 ) );
+ else
+ i->setValue( TQVariant( FALSE, 0 ) );
+ } else if ( i->name() == "layoutSpacing" ) {
+ ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) );
+ } else if ( i->name() == "layoutMargin" ) {
+ ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::margin( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) );
+ } else if ( i->name() == "resizeMode" ) {
+ ( (PropertyListItem*)i )->setCurrentItem( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) );
+ } else if ( i->name() == "toolTip" || i->name() == "whatsThis" || i->name() == "database" || i->name() == "frameworkCode" ) {
+ i->setValue( MetaDataBase::fakeProperty( editor->widget(), i->name() ) );
+ } else if ( editor->widget()->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)editor->widget() )->customWidget();
+ if ( !cw )
+ return;
+ i->setValue( MetaDataBase::fakeProperty( editor->widget(), i->name() ) );
+ }
+ return;
+ }
+ if ( p->isSetType() )
+ ( (PropertyEnumItem*)i )->setCurrentValues( p->valueToKeys( editor->widget()->property( i->name() ).toInt() ) );
+ else if ( p->isEnumType() )
+ ( (PropertyListItem*)i )->setCurrentItem( p->valueToKey( editor->widget()->property( i->name() ).toInt() ) );
+ else if ( qstrcmp( p->name(), "buddy" ) == 0 )
+ ( (PropertyListItem*)i )->setCurrentItem( editor->widget()->property( i->name() ).toString() );
+ else
+ i->setValue( TQT_TQOBJECT(editor->widget())->property( i->name() ) );
+}
+
+void PropertyList::setCurrentProperty( const TQString &n )
+{
+ if ( currentItem() && currentItem()->text( 0 ) == n ||
+ currentItem() && ( (PropertyItem*)currentItem() )->propertyParent() &&
+ ( (PropertyItem*)currentItem() )->propertyParent()->text( 0 ) == n )
+ return;
+
+ TQListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->text( 0 ) == n ) {
+ setCurrentItem( it.current() );
+ break;
+ }
+ }
+}
+
+PropertyEditor *PropertyList::propertyEditor() const
+{
+ return editor;
+}
+
+void PropertyList::resetProperty()
+{
+ if ( !currentItem() )
+ return;
+ PropertyItem *i = (PropertyItem*)currentItem();
+ if ( !MetaDataBase::isPropertyChanged( editor->widget(), i->PropertyItem::name() ) )
+ return;
+ TQString pn( tr( "Reset '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(),
+ editor->widget(), editor,
+ i->name(), i->value(),
+ WidgetFactory::defaultValue( editor->widget(), i->name() ),
+ WidgetFactory::defaultCurrentItem( editor->widget(), i->name() ),
+ i->currentItem(), TRUE );
+ cmd->execute();
+ editor->formWindow()->commandHistory()->addCommand( cmd, FALSE );
+ if ( i->hasSubItems() )
+ i->initChildren();
+}
+
+void PropertyList::viewportDragEnterEvent( TQDragEnterEvent *e )
+{
+ PropertyListItem *i = (PropertyListItem*) itemAt( e->pos() );
+ if( !i ) {
+ e->ignore();
+ return;
+ }
+
+ if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void PropertyList::viewportDragMoveEvent ( TQDragMoveEvent *e )
+{
+ PropertyListItem *i = (PropertyListItem*) itemAt( e->pos() );
+ if( !i ) {
+ e->ignore();
+ return;
+ }
+
+ if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void PropertyList::viewportDropEvent ( TQDropEvent *e )
+{
+ PropertyListItem *i = (PropertyListItem*) itemAt( e->pos() );
+ if( !i ) {
+ e->ignore();
+ return;
+ }
+
+ if ( ::tqqt_cast<PropertyColorItem*>(i) && TQColorDrag::canDecode( e ) ) {
+ TQColor color;
+ TQColorDrag::decode( e, color );
+ i->setValue( TQVariant( color ) );
+ valueChanged( i );
+ e->accept();
+ }
+ else if ( ::tqqt_cast<PropertyPixmapItem*>(i) && TQImageDrag::canDecode( e ) ) {
+ TQImage img;
+ TQImageDrag::decode( e, img );
+ TQPixmap pm;
+ pm.convertFromImage( img );
+ i->setValue( TQVariant( pm ) );
+ valueChanged( i );
+ e->accept();
+ }
+ else
+ e->ignore();
+}
+
+TQString PropertyList::whatsThisAt( const TQPoint &p )
+{
+ return whatsThisText( itemAt( p ) );
+}
+
+void PropertyList::showCurrentWhatsThis()
+{
+ if ( !currentItem() )
+ return;
+ TQPoint p( 0, currentItem()->itemPos() );
+ p = viewport()->mapToGlobal( contentsToViewport( p ) );
+ TQWhatsThis::display( whatsThisText( currentItem() ), p, viewport() );
+}
+
+TQString PropertyList::whatsThisText( TQListViewItem *i )
+{
+ if ( !i || !editor->widget() )
+ return TQString();
+ readPropertyDocs();
+ if ( ( (PropertyItem*)i )->propertyParent() )
+ i = ( (PropertyItem*)i )->propertyParent();
+
+ const TQMetaObject *mo = editor->widget()->tqmetaObject();
+ TQString prop = ( (PropertyItem*)i )->name();
+ while ( mo ) {
+ TQString s;
+ s = TQString( mo->className() ) + "::" + prop;
+ TQMap<TQString, TQString>::Iterator it;
+ if ( ( it = propertyDocs.tqfind( s ) ) != propertyDocs.end() ) {
+ return *it;
+ }
+ mo = mo->tqsuperClass();
+ }
+
+ return tr( "<p><b>TQWidget::%1</b></p><p>There is no documentation available for this property.</p>" ).arg( prop );
+}
+
+void PropertyList::readPropertyDocs()
+{
+ if ( !propertyDocs.isEmpty() )
+ return;
+
+ TQString docFile = MainWindow::self->documentationPath() + "/propertydocs";
+ TQFile f( docFile );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQDomDocument doc;
+ TQString errMsg;
+ int errLine;
+ if ( !doc.setContent( &f, &errMsg, &errLine ) )
+ return;
+ TQDomElement e = doc.firstChild().toElement().firstChild().toElement();
+
+ for ( ; !e.isNull(); e = e.nextSibling().toElement() ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQString name;
+ TQString doc;
+ for ( ; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "name" )
+ name = n.firstChild().toText().data();
+ else if ( n.tagName() == "doc" )
+ doc = n.firstChild().toText().data();
+ }
+ doc.insert( 0, "<p><b>" + name + "</b></p>" );
+ propertyDocs.insert( name, doc );
+ }
+}
+
+PropertyList::LastEventType PropertyList::lastEvent()
+{
+ return theLastEvent;
+}
+// ------------------------------------------------------------
+
+EventList::EventList( TQWidget *tqparent, FormWindow *fw, PropertyEditor *e )
+ : HierarchyList( tqparent, fw, TRUE ), editor( e )
+{
+ header()->hide();
+ removeColumn( 1 );
+ setRootIsDecorated( TRUE );
+ connect( this, TQT_SIGNAL( itemRenamed( TQListViewItem *, int, const TQString & ) ),
+ this, TQT_SLOT( renamed( TQListViewItem * ) ) );
+}
+
+TQString clean_arguments( const TQString &s )
+{
+ TQString slot = s;
+ TQString arg = slot.mid( slot.tqfind( '(' ) + 1 );
+ arg = arg.left( arg.tqfindRev( ')' ) );
+ TQStringList args = TQStringList::split( ',', arg );
+ slot = slot.left( slot.tqfind( '(' ) + 1 );
+ int num = 0;
+ for ( TQStringList::Iterator it = args.begin(); it != args.end(); ++it, ++num ) {
+ TQString a = *it;
+ int i;
+ if ( ( i =a.tqfind( ':' ) ) == -1 )
+ slot += a.simplifyWhiteSpace();
+ else
+ slot += a.mid( i + 1 ).simplifyWhiteSpace();
+ if ( num < (int)args.count() - 1 )
+ slot += ",";
+ }
+
+ slot += ")";
+
+ return slot;
+}
+
+
+void EventList::setup()
+{
+ clear();
+
+ if ( !formWindow )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ TQStrList sigs;
+ if ( iface )
+ sigs = iface->signalNames( editor->widget() );
+ TQStrListIterator it( sigs );
+ while ( it.current() ) {
+ HierarchyItem *eventItem = new HierarchyItem( HierarchyItem::Event, this, (HierarchyItem*)0,
+ it.current(), TQString(), TQString() );
+ eventItem->setOpen( TRUE );
+ TQValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( formWindow, editor->widget(), formWindow->mainContainer() );
+ HierarchyItem *item = 0;
+ for ( TQValueList<MetaDataBase::Connection>::Iterator cit = conns.begin();
+ cit != conns.end(); ++cit ) {
+ TQString s = it.current();
+ if ( MetaDataBase::normalizeFunction( clean_arguments( TQString( (*cit).signal ) ) ) !=
+ MetaDataBase::normalizeFunction( clean_arguments( s ) ) )
+ continue;
+ item = new HierarchyItem( HierarchyItem::EventFunction, eventItem, item,
+ (*cit).slot, TQString(), TQString() );
+ item->setPixmap( 0, TQPixmap::fromMimeSource( "designer_editTslots.png" ) );
+ }
+ ++it;
+ }
+}
+
+extern TQListViewItem *newItem;
+
+void EventList::contentsMouseDoubleClickEvent( TQMouseEvent *e )
+{
+ TQListViewItem *i = itemAt( contentsToViewport( e->pos() ) );
+ if ( !i || i->tqparent() )
+ return;
+ TQString s;
+ if ( !formWindow->project()->isCpp() ) {
+ TQString s1 = i->text( 0 );
+ int pt = s1.tqfind( "(" );
+ if ( pt != -1 )
+ s1 = s1.left( pt );
+ s = TQString( editor->widget()->name() ) + "_" + s1;
+ } else {
+ s = TQString( editor->widget()->name() ) + "_" + i->text( 0 );
+ }
+
+ insertEntry( i, TQPixmap::fromMimeSource( "designer_editTslots.png" ), s );
+}
+
+void EventList::setCurrent( TQWidget * )
+{
+}
+
+void EventList::objectClicked( TQListViewItem *i )
+{
+ if ( !i || !i->tqparent() )
+ return;
+ formWindow->mainWindow()->editFunction( i->text( 0 ) );
+}
+
+void EventList::showRMBMenu( TQListViewItem *i, const TQPoint &pos )
+{
+ if ( !i )
+ return;
+ TQPopupMenu menu;
+ const int NEW_ITEM = 1;
+ const int DEL_ITEM = 2;
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_filenew.png" ), tqtr( "New Signal Handler" ), NEW_ITEM );
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editcut.png" ), tqtr( "Delete Signal Handler" ), DEL_ITEM );
+ int res = menu.exec( pos );
+ if ( res == NEW_ITEM ) {
+ TQString s;
+ if ( !formWindow->project()->isCpp() ) {
+ TQString s1 = ( i->tqparent() ? i->tqparent() : i )->text( 0 );
+ int pt = s1.tqfind( "(" );
+ if ( pt != -1 )
+ s1 = s1.left( pt );
+ s = TQString( editor->widget()->name() ) + "_" + s1;
+ } else {
+ s = TQString( editor->widget()->name() ) + "_" + ( i->tqparent() ? i->tqparent() : i )->text( 0 );
+ }
+ insertEntry( i->tqparent() ? i->tqparent() : i, TQPixmap::fromMimeSource( "designer_editTslots.png" ), s );
+ } else if ( res == DEL_ITEM && i->tqparent() ) {
+ MetaDataBase::Connection conn;
+ conn.sender = editor->widget();
+ conn.receiver = TQT_TQOBJECT(formWindow->mainContainer());
+ conn.signal = i->tqparent()->text( 0 );
+ conn.slot = i->text( 0 );
+ delete i;
+ RemoveConnectionCommand *cmd = new RemoveConnectionCommand( tr( "Remove connection" ),
+ formWindow,
+ conn );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ editor->formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ }
+}
+
+void EventList::renamed( TQListViewItem *i )
+{
+ if ( newItem == i )
+ newItem = 0;
+ if ( !i->tqparent() )
+ return;
+ TQListViewItem *itm = i->tqparent()->firstChild();
+ bool del = FALSE;
+ while ( itm ) {
+ if ( itm != i && itm->text( 0 ) == i->text( 0 ) ) {
+ del = TRUE;
+ break;
+ }
+ itm = itm->nextSibling();
+ }
+ i->setRenameEnabled( 0, FALSE );
+ if ( del ) {
+ delete i;
+ } else {
+ MetaDataBase::Connection conn;
+ conn.sender = editor->widget();
+ conn.receiver = TQT_TQOBJECT(formWindow->mainContainer());
+ conn.signal = i->tqparent()->text( 0 );
+ conn.slot = i->text( 0 );
+ AddConnectionCommand *cmd = new AddConnectionCommand( tr( "Add connection" ),
+ formWindow,
+ conn );
+ formWindow->commandHistory()->addCommand( cmd );
+ // #### we should look if the specified slot already
+ // exists and if we can connect to this one
+ TQString funcname = i->text( 0 ).latin1();
+ if ( funcname.tqfind( '(' ) == -1 ) { // try to create a signature
+ TQString sig = i->tqparent()->text( 0 );
+ sig = sig.mid( sig.tqfind( '(' ) + 1 );
+ sig.remove( (int)sig.length() - 1, 1 );
+ LanguageInterface *iface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( iface )
+ sig = iface->createArguments( sig.simplifyWhiteSpace() );
+ funcname += "(" + sig + ")";
+ }
+ MetaDataBase::addFunction( formWindow, funcname.latin1(), "virtual", "public",
+ "slot", formWindow->project()->language(), "void" );
+ editor->formWindow()->mainWindow()->
+ editFunction( i->text( 0 ).left( i->text( 0 ).tqfind( "(" ) ), TRUE );
+ cmd->execute();
+ editor->formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ editor->formWindow()->formFile()->setModified( TRUE );
+ }
+}
+
+void EventList::save( TQListViewItem *p )
+{
+ TQStringList lst;
+ TQListViewItem *i = p->firstChild();
+ while ( i ) {
+ lst << i->text( 0 );
+ i = i->nextSibling();
+ }
+}
+
+// --------------------------------------------------------------
+
+/*!
+ \class PropertyEditor propertyeditor.h
+ \brief PropertyEdior toplevel window
+
+ This is the toplevel window of the property editor which tqcontains a
+ listview for editing properties.
+*/
+
+PropertyEditor::PropertyEditor( TQWidget *tqparent )
+ : TQTabWidget( tqparent, 0, (WFlags)( WStyle_Customize | TQt::WStyle_NormalBorder | TQt::WStyle_Title |
+ TQt::WStyle_StaysOnTop | TQt::WStyle_Tool | TQt::WStyle_MinMax | TQt::WStyle_SysMenu ))
+{
+ setCaption( tr( "Property Editor" ) );
+ wid = 0;
+ formwindow = 0;
+ listview = new PropertyList( this );
+ addTab( listview, tr( "P&roperties" ) );
+ eList = new EventList( this, formWindow(), this );
+ addTab( eList, tr( "Signa&l Handlers" ) );
+}
+
+TQObject *PropertyEditor::widget() const
+{
+ return wid;
+}
+
+void PropertyEditor::setWidget( TQT_BASE_OBJECT_NAME *w, FormWindow *fw )
+{
+ if ( fw && fw->isFake() )
+ w = fw->project()->objectForFakeForm( fw );
+ eList->setFormWindow( fw );
+ if ( w && w == wid ) {
+ // if there is no properties displayed then we really should show them.
+ // to do this check the number of properties in the list.
+ bool ret = (listview->childCount() > 0) ? TRUE : FALSE;
+ if ( wid->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)wid ) != WidgetFactory::NoLayout ) {
+ TQListViewItemIterator it( listview );
+ ret = FALSE;
+ while ( it.current() ) {
+ if ( it.current()->text( 0 ) == "layoutSpacing" || it.current()->text( 0 ) == "layoutMargin" ) {
+ ret = TRUE;
+ break;
+ }
+ ++it;
+ }
+ }
+ if ( ret )
+ return;
+ }
+
+ if ( !w || !fw ) {
+ setCaption( tr( "Property Editor" ) );
+ clear();
+ wid = 0;
+ formwindow = 0;
+ return;
+ }
+
+ wid = TQT_TQOBJECT(w);
+ formwindow = fw;
+ setCaption( tr( "Property Editor (%1)" ).arg( formwindow->name() ) );
+ listview->viewport()->setUpdatesEnabled( FALSE );
+ listview->setUpdatesEnabled( FALSE );
+ clear();
+ listview->viewport()->setUpdatesEnabled( TRUE );
+ listview->setUpdatesEnabled( TRUE );
+ setup();
+}
+
+void PropertyEditor::clear()
+{
+ listview->setContentsPos( 0, 0 );
+ listview->clear();
+ eList->setContentsPos( 0, 0 );
+ eList->clear();
+}
+
+void PropertyEditor::setup()
+{
+ if ( !formwindow || !wid )
+ return;
+ listview->viewport()->setUpdatesEnabled( FALSE );
+ listview->setupProperties();
+ listview->viewport()->setUpdatesEnabled( TRUE );
+ listview->updateEditorSize();
+
+ // the forced processing of events in setupProperties() can set wid to 0, so we have to check
+ if ( wid && !wid->isA( "PropertyObject" ) ) {
+ eList->viewport()->setUpdatesEnabled( FALSE );
+ eList->setup();
+ eList->viewport()->setUpdatesEnabled( TRUE );
+ }
+}
+
+void PropertyEditor::refetchData()
+{
+ listview->refetchData();
+}
+
+void PropertyEditor::emitWidgetChanged()
+{
+ if ( formwindow && wid )
+ formwindow->widgetChanged( wid );
+}
+
+void PropertyEditor::closed( FormWindow *w )
+{
+ if ( w == formwindow ) {
+ formwindow = 0;
+ wid = 0;
+ clear();
+ }
+}
+
+void PropertyEditor::closeEvent( TQCloseEvent *e )
+{
+ emit hidden();
+ e->accept();
+}
+
+PropertyList *PropertyEditor::propertyList() const
+{
+ return listview;
+}
+
+FormWindow *PropertyEditor::formWindow() const
+{
+ return formwindow;
+}
+
+TQString PropertyEditor::currentProperty() const
+{
+ if ( !wid )
+ return TQString();
+ if ( ( (PropertyItem*)listview->currentItem() )->propertyParent() )
+ return ( (PropertyItem*)listview->currentItem() )->propertyParent()->name();
+ return ( (PropertyItem*)listview->currentItem() )->name();
+}
+
+TQString PropertyEditor::classOfCurrentProperty() const
+{
+ if ( !wid )
+ return TQString();
+ TQObject *o = wid;
+ TQString curr = currentProperty();
+ TQMetaObject *mo = o->tqmetaObject();
+ while ( mo ) {
+ TQStrList props = mo->propertyNames( FALSE );
+ if ( props.tqfind( curr.latin1() ) != -1 )
+ return mo->className();
+ mo = mo->tqsuperClass();
+ }
+ return TQString();
+}
+
+TQMetaObject* PropertyEditor::tqmetaObjectOfCurrentProperty() const
+{
+ if ( !wid )
+ return 0;
+ return wid->tqmetaObject();
+}
+
+void PropertyEditor::resetFocus()
+{
+ if ( listview->currentItem() )
+ ( (PropertyItem*)listview->currentItem() )->showEditor();
+}
+
+EventList *PropertyEditor::eventList() const
+{
+ return eList;
+}
+
+void PropertyEditor::setPropertyEditorEnabled( bool b )
+{
+ if ( !b )
+ removePage( listview );
+ else
+ insertTab( listview, tr( "Property Editor" ), 0 );
+ updateWindow();
+}
+
+void PropertyEditor::setSignalHandlersEnabled( bool b )
+{
+ if ( !b )
+ removePage( eList );
+ else
+ insertTab( eList, tr( "Signal Handlers" ), 0 );
+ updateWindow();
+}
+
+void PropertyEditor::updateWindow()
+{
+ if ( isHidden() && count() ) {
+ parentWidget()->show();
+ MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), TRUE );
+ } else if ( isShown() && !count() ) {
+ parentWidget()->hide();
+ MainWindow::self->setAppropriate( (TQDockWindow*)parentWidget(), FALSE );
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/propertyeditor.h b/tqtinterface/qt4/tools/designer/designer/propertyeditor.h
new file mode 100644
index 0000000..2e9aee4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/propertyeditor.h
@@ -0,0 +1,898 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PROPERTYEDITOR_H
+#define PROPERTYEDITOR_H
+
+#include <tqfeatures.h>
+#include <tqvariant.h>
+#include <tqlistview.h>
+#include <tqptrlist.h>
+#include <tqguardedptr.h>
+#include <tqtabwidget.h>
+#include <tqmodules.h>
+#include <tqptrlist.h>
+#include <tqlayout.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include "hierarchyview.h"
+#include "metadatabase.h"
+
+class PropertyList;
+class PropertyEditor;
+class TQPainter;
+class TQColorGroup;
+class TQLineEdit;
+class TQPushButton;
+class TQHBox;
+class TQSpinBox;
+class TQLabel;
+class TQFrame;
+class FormWindow;
+class TQCloseEvent;
+class TQResizeEvent;
+class PropertyWhatsThis;
+class TQDateEdit;
+class TQTimeEdit;
+class TQDateTimeEdit;
+
+class PropertyItem : public TQListViewItem
+{
+public:
+ PropertyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName );
+ ~PropertyItem();
+
+ void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align );
+ void paintBranches( TQPainter * p, const TQColorGroup & cg,
+ int w, int y, int h );
+ void paintFocus( TQPainter *p, const TQColorGroup &cg, const TQRect &r );
+
+ virtual bool hasSubItems() const;
+ virtual void createChildren();
+ virtual void initChildren();
+
+ bool isOpen() const;
+ void setOpen( bool b );
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ TQVariant value() const;
+ TQString name() const;
+ virtual void notifyValueChange();
+
+ virtual void setChanged( bool b, bool updateDb = TRUE );
+ bool isChanged() const;
+
+ virtual void placeEditor( TQWidget *w );
+
+ virtual PropertyItem *propertyParent() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+ void addChild( PropertyItem *i );
+ int childCount() const;
+ PropertyItem *child( int i ) const;
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( TQPainter *p, const TQRect &r );
+
+ void updateBackColor();
+
+ void setup() { TQListViewItem::setup(); setHeight( TQListViewItem::height() + 2 ); }
+
+ virtual TQString currentItem() const;
+ virtual int currentIntItem() const;
+ virtual void setCurrentItem( const TQString &s );
+ virtual void setCurrentItem( int i );
+ virtual int currentIntItemFromObject() const;
+ virtual TQString currentItemFromObject() const;
+
+ void setFocus( TQWidget *w );
+
+ virtual void toggle();
+ void setText( int col, const TQString &txt );
+
+protected:
+ PropertyList *listview;
+ TQVariant val;
+
+private:
+ TQColor backgroundColor();
+ void createResetButton();
+ void updateResetButtonState();
+
+private:
+ bool open, changed;
+ PropertyItem *property;
+ TQString propertyName;
+ TQPtrList<PropertyItem> tqchildren;
+ TQColor backColor;
+ TQPushButton *resetButton;
+
+};
+
+class PropertyTextItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyTextItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool comment, bool multiLine, bool ascii = FALSE, bool a = FALSE );
+ ~PropertyTextItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+ virtual void setChanged( bool b, bool updateDb = TRUE );
+
+private Q_SLOTS:
+ void setValue();
+ void getText();
+
+private:
+ TQLineEdit *lined();
+ TQGuardedPtr<TQLineEdit> lin;
+ TQGuardedPtr<TQHBox> box;
+ TQPushButton *button;
+ bool withComment, hasMultiLines, asciiOnly, accel;
+
+};
+
+
+class PropertyBoolItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyBoolItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName );
+ ~PropertyBoolItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ virtual void toggle();
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQComboBox *combo();
+ TQGuardedPtr<TQComboBox> comb;
+
+};
+
+class PropertyIntItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyIntItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool s );
+ ~PropertyIntItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQSpinBox *spinBox();
+ TQGuardedPtr<TQSpinBox> spinBx;
+ bool signedValue;
+
+};
+
+class PropertyLayoutItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyLayoutItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName );
+ ~PropertyLayoutItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQSpinBox *spinBox();
+ TQGuardedPtr<TQSpinBox> spinBx;
+
+};
+
+class PropertyDoubleItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyDoubleItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName );
+ ~PropertyDoubleItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQLineEdit *lined();
+ TQGuardedPtr<TQLineEdit> lin;
+};
+
+class PropertyListItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyListItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool editable );
+ ~PropertyListItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+ TQString currentItem() const;
+ int currentIntItem() const;
+ void setCurrentItem( const TQString &s );
+ void setCurrentItem( int i );
+ int currentIntItemFromObject() const;
+ TQString currentItemFromObject() const;
+ void addItem( const TQString &s );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQComboBox *combo();
+ TQGuardedPtr<TQComboBox> comb;
+ int oldInt;
+ bool editable;
+ TQString oldString;
+
+};
+
+class PropertyFontItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyFontItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName );
+ ~PropertyFontItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private Q_SLOTS:
+ void getFont();
+
+private:
+ TQGuardedPtr<TQLineEdit> lined;
+ TQGuardedPtr<TQPushButton> button;
+ TQGuardedPtr<TQHBox> box;
+
+};
+
+class PropertyCoordItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ enum Type { Rect, Size, Point };
+
+ PropertyCoordItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, Type t );
+ ~PropertyCoordItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private:
+ TQLineEdit *lined();
+ TQGuardedPtr<TQLineEdit> lin;
+ Type typ;
+
+};
+
+class PropertyColorItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyColorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, bool tqchildren );
+ ~PropertyColorItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( TQPainter *p, const TQRect &r );
+
+private Q_SLOTS:
+ void getColor();
+
+private:
+ TQGuardedPtr<TQHBox> box;
+ TQGuardedPtr<TQFrame> colorPrev;
+ TQGuardedPtr<TQPushButton> button;
+ bool withChildren;
+
+};
+
+class PropertyPixmapItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ enum Type { Pixmap, IconSet, Image };
+
+ PropertyPixmapItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName, Type t );
+ ~PropertyPixmapItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( TQPainter *p, const TQRect &r );
+
+private Q_SLOTS:
+ void getPixmap();
+
+private:
+ TQGuardedPtr<TQHBox> box;
+ TQGuardedPtr<TQLabel> pixPrev;
+ TQPushButton *button;
+ Type type;
+
+};
+
+
+class PropertySizePolicyItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertySizePolicyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName );
+ ~PropertySizePolicyItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private:
+ TQLineEdit *lined();
+ TQGuardedPtr<TQLineEdit> lin;
+
+};
+
+class PropertyPaletteItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyPaletteItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName );
+ ~PropertyPaletteItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( TQPainter *p, const TQRect &r );
+
+private Q_SLOTS:
+ void getPalette();
+
+private:
+ TQGuardedPtr<TQHBox> box;
+ TQGuardedPtr<TQLabel> palettePrev;
+ TQGuardedPtr<TQPushButton> button;
+
+};
+
+class PropertyCursorItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyCursorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName );
+ ~PropertyCursorItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQComboBox *combo();
+ TQGuardedPtr<TQComboBox> comb;
+
+};
+
+class PropertyKeysequenceItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyKeysequenceItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName );
+ ~PropertyKeysequenceItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ bool eventFilter( TQObject *o, TQEvent *e );
+ void handleKeyEvent( TQKeyEvent *e );
+ int translateModifiers( int state );
+
+ TQGuardedPtr<TQLineEdit> sequence;
+ TQGuardedPtr<TQHBox> box;
+ int k1,k2,k3,k4;
+ int num;
+ bool mouseEnter;
+};
+
+class PropertyDatabaseItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyDatabaseItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName, bool wField );
+ ~PropertyDatabaseItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private:
+ TQGuardedPtr<TQLineEdit> lined;
+ TQGuardedPtr<TQPushButton> button;
+ TQGuardedPtr<TQHBox> box;
+ bool withField;
+
+};
+
+struct EnumItem {
+ EnumItem( const TQString &k, bool s )
+ : key( k ), selected( s ) {}
+ EnumItem() : key( TQString() ), selected( FALSE ) {}
+ bool operator==( const EnumItem &item ) const {
+ return key == item.key;
+ }
+ TQString key;
+ bool selected;
+};
+
+class EnumPopup : public TQFrame
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ EnumPopup( TQWidget *tqparent, const char *name, WFlags f=0 );
+ ~EnumPopup();
+ void insertEnums( TQValueList<EnumItem> lst );
+ TQValueList<EnumItem> enumList() const;
+ void closeWidget();
+
+Q_SIGNALS:
+ void closed();
+ void hidden();
+
+protected:
+ void keyPressEvent( TQKeyEvent *e );
+
+private:
+ TQValueList<EnumItem> itemList;
+ TQPtrList<TQCheckBox> checkBoxList;
+ TQVBoxLayout *popLayout;
+};
+
+class EnumBox : public TQComboBox
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ EnumBox( TQWidget *tqparent, const char *name = 0 );
+ ~EnumBox() {}
+ void setText( const TQString &text );
+ void insertEnums( TQValueList<EnumItem> lst );
+ TQValueList<EnumItem> enumList() const;
+
+Q_SIGNALS:
+ void aboutToShowPopup();
+ void valueChanged();
+
+protected:
+ void paintEvent( TQPaintEvent * );
+ void mousePressEvent( TQMouseEvent *e );
+ void keyPressEvent( TQKeyEvent *e );
+
+protected Q_SLOTS:
+ void restoreArrow();
+ void popupHidden();
+ void popupClosed();
+
+private:
+ void popup();
+ bool arrowDown;
+ TQString str;
+ bool popupShown;
+ EnumPopup *pop;
+
+};
+class PropertyEnumItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyEnumItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const TQString &propName );
+ ~PropertyEnumItem();
+
+ void showEditor();
+ void hideEditor();
+ void setValue( const TQVariant &v );
+ TQString currentItem() const;
+ TQString currentItemFromObject() const;
+ void setCurrentValues( TQStrList lst );
+
+private Q_SLOTS:
+ void setValue();
+ void insertEnums();
+
+private:
+ TQGuardedPtr<EnumBox> box;
+ TQValueList<EnumItem> enumList;
+ TQString enumString;
+};
+
+class PropertyList : public TQListView
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyList( PropertyEditor *e );
+
+ virtual void setupProperties();
+
+ virtual void setCurrentItem( TQListViewItem *i );
+ virtual void valueChanged( PropertyItem *i );
+ virtual void refetchData();
+ virtual void setPropertyValue( PropertyItem *i );
+ virtual void setCurrentProperty( const TQString &n );
+
+ void layoutInitValue( PropertyItem *i, bool changed = FALSE );
+ PropertyEditor *propertyEditor() const;
+ TQString whatsThisAt( const TQPoint &p );
+ void showCurrentWhatsThis();
+
+ enum LastEventType { KeyEvent, MouseEvent };
+ LastEventType lastEvent();
+
+public Q_SLOTS:
+ void updateEditorSize();
+ void resetProperty();
+ void toggleSort();
+
+private Q_SLOTS:
+ void itemPressed( TQListViewItem *i, const TQPoint &p, int c );
+ void toggleOpen( TQListViewItem *i );
+ bool eventFilter( TQObject *o, TQEvent *e );
+
+protected:
+ void resizeEvent( TQResizeEvent *e );
+ void paintEmptyArea( TQPainter *p, const TQRect &r );
+ bool addPropertyItem( PropertyItem *&item, const TQCString &name, TQVariant::Type t );
+
+ void viewportDragEnterEvent( TQDragEnterEvent * );
+ void viewportDragMoveEvent ( TQDragMoveEvent * );
+ void viewportDropEvent ( TQDropEvent * );
+
+protected:
+ PropertyEditor *editor;
+
+private:
+ void readPropertyDocs();
+ void setupCusWidgetProperties( MetaDataBase::CustomWidget *cw,
+ TQMap<TQString, bool> &unique,
+ PropertyItem *&item );
+ TQString whatsThisText( TQListViewItem *i );
+
+private:
+ PropertyListItem* pressItem;
+ TQPoint pressPos;
+ bool mousePressed;
+ bool showSorted;
+ TQMap<TQString, TQString> propertyDocs;
+ PropertyWhatsThis *whatsThis;
+ LastEventType theLastEvent;
+};
+
+class EventList : public HierarchyList
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ EventList( TQWidget *tqparent, FormWindow *fw, PropertyEditor *e );
+
+ void setup();
+ void setCurrent( TQWidget *w );
+
+protected:
+ void contentsMouseDoubleClickEvent( TQMouseEvent *e );
+
+private:
+ void save( TQListViewItem *p );
+
+private Q_SLOTS:
+ void objectClicked( TQListViewItem *i );
+ void showRMBMenu( TQListViewItem *, const TQPoint & );
+ void renamed( TQListViewItem *i );
+
+private:
+ PropertyEditor *editor;
+
+};
+
+
+class PropertyEditor : public TQTabWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyEditor( TQWidget *tqparent );
+
+ TQObject *widget() const;
+
+ void clear();
+ void setup();
+
+ void emitWidgetChanged();
+ void refetchData();
+
+ void closed( FormWindow *w );
+
+ PropertyList *propertyList() const;
+ FormWindow *formWindow() const;
+ EventList *eventList() const;
+
+ TQString currentProperty() const;
+ TQString classOfCurrentProperty() const;
+ TQMetaObject* tqmetaObjectOfCurrentProperty() const;
+
+ void resetFocus();
+
+ void setPropertyEditorEnabled( bool b );
+ void setSignalHandlersEnabled( bool b );
+
+Q_SIGNALS:
+ void hidden();
+
+public Q_SLOTS:
+ void setWidget( TQT_BASE_OBJECT_NAME *w, FormWindow *fw );
+
+protected:
+ void closeEvent( TQCloseEvent *e );
+
+private:
+ void updateWindow();
+
+private:
+ TQObject *wid;
+ PropertyList *listview;
+ EventList *eList;
+ FormWindow *formwindow;
+
+};
+
+class PropertyDateItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyDateItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName );
+ ~PropertyDateItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQDateEdit *lined();
+ TQGuardedPtr<TQDateEdit> lin;
+
+};
+
+class PropertyTimeItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName );
+ ~PropertyTimeItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQTimeEdit *lined();
+ TQGuardedPtr<TQTimeEdit> lin;
+
+};
+
+class PropertyDateTimeItem : public TQObject,
+ public PropertyItem
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PropertyDateTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const TQString &propName );
+ ~PropertyDateTimeItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const TQVariant &v );
+
+private Q_SLOTS:
+ void setValue();
+
+private:
+ TQDateTimeEdit *lined();
+ TQGuardedPtr<TQDateTimeEdit> lin;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/propertyobject.cpp b/tqtinterface/qt4/tools/designer/designer/propertyobject.cpp
new file mode 100644
index 0000000..9aa3e28
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/propertyobject.cpp
@@ -0,0 +1,165 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "propertyobject.h"
+#include "metadatabase.h"
+#include <tqptrvector.h>
+#include <tqptrlist.h>
+#include <tqmetaobject.h>
+#include <tqvariant.h>
+
+PropertyObject::PropertyObject( const TQWidgetList &objs )
+ : TQObject(), objects( objs ), mobj( 0 )
+{
+ TQPtrVector<TQPtrList<TQMetaObject> > v;
+ v.resize( objects.count() );
+ v.setAutoDelete( TRUE );
+
+ for ( TQWidget *o = objects.first(); o; o = objects.next() ) {
+ const TQMetaObject *m = o->tqmetaObject();
+ TQPtrList<TQMetaObject> *mol = new TQPtrList<TQMetaObject>;
+ while ( m ) {
+ mol->insert( 0, m );
+ m = m->tqsuperClass();
+ }
+ v.insert( v.count(), mol );
+ }
+
+ int numObjects = objects.count();
+ int minDepth = v[0]->count();
+ int depth = minDepth;
+
+ for ( int i = 0; i < numObjects; ++i ) {
+ depth = (int)v[i]->count();
+ if ( depth < minDepth )
+ minDepth = depth;
+ }
+
+ const TQMetaObject *m = v[0]->at( --minDepth );
+
+ for ( int j = 0; j < numObjects; ++j ) {
+ if ( v[j]->at( minDepth ) != m ) {
+ m = v[0]->at( --minDepth );
+ j = 0;
+ }
+ }
+
+ mobj = m;
+
+ TQ_ASSERT( mobj );
+}
+
+bool PropertyObject::setProperty( const char *name, const TQVariant& value )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() )
+ o->setProperty( name, value );
+
+ return TRUE;
+}
+
+TQVariant PropertyObject::property( const char *name ) const
+{
+ return TQT_TQVARIANT_OBJECT(( (PropertyObject*)this )->objects.first()->property( name ));
+}
+
+void PropertyObject::mdPropertyChanged( const TQString &property, bool changed )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setPropertyChanged( o, property, changed );
+}
+
+bool PropertyObject::mdIsPropertyChanged( const TQString &property )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() ) {
+ if ( MetaDataBase::isPropertyChanged( o, property ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void PropertyObject::mdSetPropertyComment( const TQString &property, const TQString &comment )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setPropertyComment( o, property, comment );
+}
+
+TQString PropertyObject::mdPropertyComment( const TQString &property )
+{
+ return MetaDataBase::propertyComment( objects.first(), property );
+}
+
+void PropertyObject::mdSetFakeProperty( const TQString &property, const TQVariant &value )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setFakeProperty( o, property, value );
+}
+
+TQVariant PropertyObject::mdFakeProperty( const TQString &property )
+{
+ return MetaDataBase::fakeProperty( objects.first(), property );
+}
+
+void PropertyObject::mdSetCursor( const TQCursor &c )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() ) {
+ if ( o->isWidgetType() )
+ MetaDataBase::setCursor( (TQWidget*)o, c );
+ }
+}
+
+TQCursor PropertyObject::mdCursor()
+{
+ return MetaDataBase::cursor( objects.first() );
+}
+
+void PropertyObject::mdSetPixmapKey( int pixmap, const TQString &arg )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setPixmapKey( o, pixmap, arg );
+}
+
+TQString PropertyObject::mdPixmapKey( int pixmap )
+{
+ return MetaDataBase::pixmapKey( objects.first(), pixmap );
+}
+
+void PropertyObject::mdSetExportMacro( const TQString &macro )
+{
+ for ( TQWidget *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setExportMacro( o, macro );
+}
+
+TQString PropertyObject::mdExportMacro()
+{
+ return MetaDataBase::exportMacro( objects.first() );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/propertyobject.h b/tqtinterface/qt4/tools/designer/designer/propertyobject.h
new file mode 100644
index 0000000..4cfb54f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/propertyobject.h
@@ -0,0 +1,43 @@
+#ifndef PROPERTYOBJECT_H
+#define PROPERTYOBJECT_H
+
+#include <tqobject.h>
+#include <tqwidgetlist.h>
+#include <tqcursor.h>
+
+class PropertyObject : public TQObject
+{
+public:
+ TQMetaObject *tqmetaObject() const { return (TQMetaObject*)mobj; }
+ const char *className() const { return "PropertyObject"; }
+ TQObject* qObject() { return (TQObject*)this; }
+private:
+ static TQMetaObject *metaObj;
+
+public:
+ PropertyObject( const TQWidgetList &objs );
+
+ bool setProperty( const char *name, const TQVariant& value );
+ TQVariant property( const char *name ) const;
+
+ void mdPropertyChanged( const TQString &property, bool changed );
+ bool mdIsPropertyChanged( const TQString &property );
+ void mdSetPropertyComment( const TQString &property, const TQString &comment );
+ TQString mdPropertyComment( const TQString &property );
+ void mdSetFakeProperty( const TQString &property, const TQVariant &value );
+ TQVariant mdFakeProperty( const TQString &property );
+ void mdSetCursor( const TQCursor &c );
+ TQCursor mdCursor();
+ void mdSetPixmapKey( int pixmap, const TQString &arg );
+ TQString mdPixmapKey( int pixmap );
+ void mdSetExportMacro( const TQString &macro );
+ TQString mdExportMacro();
+ TQWidgetList widgetList() const { return objects; }
+
+private:
+ TQWidgetList objects;
+ const TQMetaObject *mobj;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/qcompletionedit.cpp b/tqtinterface/qt4/tools/designer/designer/qcompletionedit.cpp
new file mode 100644
index 0000000..6c19964
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/qcompletionedit.cpp
@@ -0,0 +1,217 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "qcompletionedit.h"
+#include <tqlistbox.h>
+#include <tqsizegrip.h>
+#include <tqapplication.h>
+#include <tqvbox.h>
+
+TQCompletionEdit::TQCompletionEdit( TQWidget *tqparent, const char *name )
+ : TQLineEdit( tqparent, name ), aAdd( FALSE ), caseSensitive( FALSE )
+{
+ popup = new TQVBox( 0, 0, (WFlags)WType_Popup );
+ popup->setFrameStyle( TQFrame::Box | TQFrame::Plain );
+ popup->setLineWidth( 1 );
+ popup->hide();
+
+ listbox = new TQListBox( popup );
+ listbox->setFrameStyle( TQFrame::NoFrame );
+ listbox->setLineWidth( 1 );
+ listbox->installEventFilter( this );
+ listbox->setHScrollBarMode( TQScrollView::AlwaysOn );
+ listbox->setVScrollBarMode( TQScrollView::AlwaysOn );
+ listbox->setCornerWidget( new TQSizeGrip( listbox, "completion sizegrip" ) );
+ connect( this, TQT_SIGNAL( textChanged( const TQString & ) ),
+ this, TQT_SLOT( textDidChange( const TQString & ) ) );
+ popup->setFocusProxy( listbox );
+ installEventFilter( this );
+}
+
+bool TQCompletionEdit::autoAdd() const
+{
+ return aAdd;
+}
+
+TQStringList TQCompletionEdit::completionList() const
+{
+ return compList;
+}
+
+void TQCompletionEdit::setCompletionList( const TQStringList &l )
+{
+ compList = l;
+}
+
+void TQCompletionEdit::setAutoAdd( bool add )
+{
+ aAdd = add;
+}
+
+void TQCompletionEdit::textDidChange( const TQString &text )
+{
+ if ( text.isEmpty() ) {
+ popup->close();
+ return;
+ }
+ updateListBox();
+ placeListBox();
+}
+
+void TQCompletionEdit::placeListBox()
+{
+ if ( listbox->count() == 0 ) {
+ popup->close();
+ return;
+ }
+
+ popup->resize( TQMAX( listbox->tqsizeHint().width() + listbox->verticalScrollBar()->width() + 4, width() ),
+ listbox->tqsizeHint().height() + listbox->horizontalScrollBar()->height() + 4 );
+
+ TQPoint p( mapToGlobal( TQPoint( 0, 0 ) ) );
+ if ( p.y() + height() + popup->height() <= TQApplication::desktop()->height() )
+ popup->move( p.x(), p.y() + height() );
+ else
+ popup->move( p.x(), p.y() - listbox->height() );
+ popup->show();
+ listbox->setCurrentItem( 0 );
+ listbox->setSelected( 0, TRUE );
+ setFocus();
+}
+
+void TQCompletionEdit::updateListBox()
+{
+ listbox->clear();
+ if ( compList.isEmpty() )
+ return;
+ for ( TQStringList::Iterator it = compList.begin(); it != compList.end(); ++it ) {
+ if ( caseSensitive && (*it).left( text().length() ) == text() ||
+ !caseSensitive && (*it).left( text().length() ).lower() == text().lower() )
+ listbox->insertItem( *it );
+ }
+}
+
+bool TQCompletionEdit::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(popup) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(listbox) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(listbox->viewport()) ) {
+ if ( e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Tab ) {
+ if ( ke->key() == Qt::Key_Tab && listbox->count() > 1 &&
+ listbox->currentItem() < (int)listbox->count() - 1 ) {
+ listbox->setCurrentItem( listbox->currentItem() + 1 );
+ return TRUE;
+ }
+ popup->close();
+ setFocus();
+ blockSignals( TRUE );
+ setText( listbox->currentText() );
+ blockSignals( FALSE );
+ emit chosen( text() );
+ return TRUE;
+ } else if ( ke->key() == Qt::Key_Left || ke->key() == Qt::Key_Right ||
+ ke->key() == Qt::Key_Up || ke->key() == Qt::Key_Down ||
+ ke->key() == Qt::Key_Home || ke->key() == Qt::Key_End ||
+ ke->key() == TQt::Key_Prior || ke->key() == TQt::Key_Next ) {
+ return FALSE;
+ } else if ( ke->key() == Key_Escape ) {
+ popup->close();
+ setFocus();
+ } else if ( ke->key() != Qt::Key_Shift && ke->key() != Qt::Key_Control &&
+ ke->key() != Qt::Key_Alt ) {
+ updateListBox();
+ if ( listbox->count() == 0 || text().length() == 0 ) {
+ popup->close();
+ setFocus();
+ }
+ TQApplication::sendEvent( this, e );
+ return TRUE;
+ }
+ } else if ( e->type() == TQEvent::MouseButtonDblClick ) {
+ popup->close();
+ setFocus();
+ blockSignals( TRUE );
+ setText( listbox->currentText() );
+ blockSignals( FALSE );
+ emit chosen( text() );
+ return TRUE;
+ }
+ } else if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) ) {
+ if ( e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if ( ke->key() == Qt::Key_Up ||
+ ke->key() == Qt::Key_Down ||
+ ke->key() == TQt::Key_Prior ||
+ ke->key() == TQt::Key_Next ||
+ ke->key() == Qt::Key_Return ||
+ ke->key() == Qt::Key_Enter ||
+ ke->key() == Qt::Key_Tab ||
+ ke->key() == Key_Escape ) {
+ TQApplication::sendEvent( listbox, e );
+ return TRUE;
+ }
+ }
+ }
+ return TQLineEdit::eventFilter( o, e );
+}
+
+void TQCompletionEdit::addCompletionEntry( const TQString &entry )
+{
+ if ( compList.tqfind( entry ) == compList.end() ) {
+ compList << entry;
+ compList.sort();
+ }
+}
+
+void TQCompletionEdit::removeCompletionEntry( const TQString &entry )
+{
+ TQStringList::Iterator it = compList.tqfind( entry );
+ if ( it != compList.end() )
+ compList.remove( it );
+}
+
+void TQCompletionEdit::setCaseSensitive( bool b )
+{
+ caseSensitive = b;
+}
+
+bool TQCompletionEdit::isCaseSensitive() const
+{
+ return caseSensitive;
+}
+
+void TQCompletionEdit::clear()
+{
+ TQLineEdit::clear();
+ compList.clear();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/qcompletionedit.h b/tqtinterface/qt4/tools/designer/designer/qcompletionedit.h
new file mode 100644
index 0000000..f6e7f50
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/qcompletionedit.h
@@ -0,0 +1,87 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TQCOMPLETIONEDIT_H
+#define TQCOMPLETIONEDIT_H
+
+#include <tqlineedit.h>
+#include <tqstringlist.h>
+
+class TQListBox;
+class TQVBox;
+
+class TQCompletionEdit : public TQLineEdit
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( bool autoAdd READ autoAdd WRITE setAutoAdd )
+ Q_PROPERTY( bool caseSensitive READ isCaseSensitive WRITE setCaseSensitive )
+
+public:
+ TQCompletionEdit( TQWidget *tqparent = 0, const char *name = 0 );
+
+ bool autoAdd() const;
+ TQStringList completionList() const;
+ bool eventFilter( TQObject *o, TQEvent *e );
+ bool isCaseSensitive() const;
+
+public Q_SLOTS:
+ void setCompletionList( const TQStringList &l );
+ void setAutoAdd( bool add );
+ void clear();
+ void addCompletionEntry( const TQString &entry );
+ void removeCompletionEntry( const TQString &entry );
+ void setCaseSensitive( bool b );
+
+Q_SIGNALS:
+ void chosen( const TQString &text );
+
+private Q_SLOTS:
+ void textDidChange( const TQString &text );
+
+private:
+ void placeListBox();
+ void updateListBox();
+
+private:
+ bool aAdd;
+ TQStringList compList;
+ TQListBox *listbox;
+ TQVBox *popup;
+ bool caseSensitive;
+
+};
+
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/replacedialog.ui b/tqtinterface/qt4/tools/designer/designer/replacedialog.ui
new file mode 100644
index 0000000..a2a33af
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/replacedialog.ui
@@ -0,0 +1,325 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ReplaceDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ReplaceDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>286</width>
+ <height>217</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Replace Text</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>R&amp;eplace</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboReplace</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFind</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>comboFind</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboReplace</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonReplace</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Replace</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonReplaceAll</cstring>
+ </property>
+ <property name="text">
+ <string>Replace &amp;All</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkWords</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Whole words only</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkCase</cstring>
+ </property>
+ <property name="text">
+ <string>Case &amp;sensitive</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBegin</cstring>
+ </property>
+ <property name="text">
+ <string>Start at &amp;Beginning</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQButtonGroup" row="1" column="1">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Direction</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>radioForward</cstring>
+ </property>
+ <property name="text">
+ <string>Forwar&amp;d</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>radioBackward</cstring>
+ </property>
+ <property name="text">
+ <string>Bac&amp;kward</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonReplace</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDialog</receiver>
+ <slot>doReplace()</slot>
+ </connection>
+ <connection>
+ <sender>buttonReplaceAll</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDialog</receiver>
+ <slot>doReplaceAll()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>comboFind</tabstop>
+ <tabstop>comboReplace</tabstop>
+ <tabstop>checkWords</tabstop>
+ <tabstop>checkCase</tabstop>
+ <tabstop>checkBegin</tabstop>
+ <tabstop>radioForward</tabstop>
+ <tabstop>radioBackward</tabstop>
+ <tabstop>buttonReplace</tabstop>
+ <tabstop>buttonReplaceAll</tabstop>
+ <tabstop>PushButton2</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">../interfaces/editorinterface.h</include>
+ <include location="global" impldecl="in implementation">tqlineedit.h</include>
+ <include location="local" impldecl="in implementation">replacedialog.ui.h</include>
+</includes>
+<forwards>
+ <forward>struct EditorInterface;</forward>
+</forwards>
+<variables>
+ <variable>EditorInterface *editor;</variable>
+ <variable>TQT_BASE_OBJECT_NAME *formWindow;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>doReplace()</slot>
+ <slot>doReplaceAll()</slot>
+ <slot>setEditor( EditorInterface * e, TQT_BASE_OBJECT_NAME * fw )</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/replacedialog.ui.h b/tqtinterface/qt4/tools/designer/designer/replacedialog.ui.h
new file mode 100644
index 0000000..74fa7cb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/replacedialog.ui.h
@@ -0,0 +1,82 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+
+void ReplaceDialog::init()
+{
+ editor = 0;
+ formWindow = 0;
+}
+
+void ReplaceDialog::destroy()
+{
+ if ( editor )
+ editor->release();
+ editor = 0;
+ formWindow = 0;
+}
+
+void ReplaceDialog::doReplace()
+{
+ if ( !editor )
+ return;
+
+ if ( !editor->tqreplace( comboFind->currentText(), comboReplace->currentText(), checkCase->isChecked(),
+ checkWords->isChecked(), radioForward->isChecked(), !checkBegin->isChecked(), FALSE ) )
+ checkBegin->setChecked( TRUE );
+ else
+ checkBegin->setChecked( FALSE );
+}
+
+void ReplaceDialog::doReplaceAll()
+{
+ if ( !editor )
+ return;
+
+ if ( !editor->tqreplace( comboFind->currentText(), comboReplace->currentText(), checkCase->isChecked(),
+ checkWords->isChecked(), radioForward->isChecked(), !checkBegin->isChecked(), TRUE ) )
+ checkBegin->setChecked( TRUE );
+ else
+ checkBegin->setChecked( FALSE );
+}
+
+void ReplaceDialog::setEditor( EditorInterface * e, TQT_BASE_OBJECT_NAME * fw )
+{
+ if ( fw != formWindow )
+ checkBegin->setChecked( TRUE );
+ formWindow = fw;
+ if ( editor )
+ editor->release();
+ editor = e;
+ editor->addRef();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/resource.cpp b/tqtinterface/qt4/tools/designer/designer/resource.cpp
new file mode 100644
index 0000000..053c155
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/resource.cpp
@@ -0,0 +1,3367 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "actiondnd.h"
+#include "command.h"
+#ifndef TQT_NO_SQL
+#include "database.h"
+#endif
+#include "formfile.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "menubareditor.h"
+#include "metadatabase.h"
+#include "pixmapcollection.h"
+#include "popupmenueditor.h"
+#include "project.h"
+#include "resource.h"
+#include "widgetfactory.h"
+
+#include <domtool.h>
+#include <widgetdatabase.h>
+
+#include <tqaccel.h>
+#include <tqapplication.h>
+#include <tqbuffer.h>
+#include <tqcombobox.h>
+#include <tqdatetime.h>
+#include <tqdom.h>
+#include <tqfeatures.h>
+#include <tqfile.h>
+#include <tqheader.h>
+#include <tqiconview.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqmenudata.h>
+#include <tqmessagebox.h>
+#include <tqmetaobject.h>
+#include <tqobject.h>
+#include <tqobjectlist.h>
+#include <tqtabbar.h>
+#ifndef TQT_NO_TABLE
+#include <tqtable.h>
+#include <tqdatatable.h>
+#endif
+#include <tqtabwidget.h>
+#include <tqtabwidget.h>
+#include <tqtextcodec.h>
+#include <tqtextstream.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
+#include <tqwidget.h>
+#include <tqwidgetstack.h>
+#include <tqwizard.h>
+#include <tqworkspace.h>
+#include <tqworkspace.h>
+#include <tqsplitter.h>
+#include <private/tqucom_p.h>
+
+static TQString makeIndent( int indent )
+{
+ TQString s;
+ s.fill( ' ', indent * 4 );
+ return s;
+}
+
+static TQString entitize( const TQString &s, bool attribute = FALSE )
+{
+ TQString s2 = s;
+ s2 = s2.tqreplace( "&", "&amp;" );
+ s2 = s2.tqreplace( ">", "&gt;" );
+ s2 = s2.tqreplace( "<", "&lt;" );
+ if ( attribute ) {
+ s2 = s2.tqreplace( "\"", "&quot;" );
+ s2 = s2.tqreplace( "'", "&apos;" );
+ }
+ return s2;
+}
+
+#ifdef TQ_WS_MACX
+static struct {
+ int key;
+ const char* name;
+} keyname[] = {
+ { TQt::Key_Space, TQT_TRANSLATE_NOOP( "TQAccel", "Space" ) },
+ { TQt::Key_Escape, TQT_TRANSLATE_NOOP( "TQAccel", "Esc" ) },
+ { TQt::Key_Tab, TQT_TRANSLATE_NOOP( "TQAccel", "Tab" ) },
+ { TQt::Key_Backtab, TQT_TRANSLATE_NOOP( "TQAccel", "Backtab" ) },
+ { TQt::Key_Backspace, TQT_TRANSLATE_NOOP( "TQAccel", "Backspace" ) },
+ { TQt::Key_Return, TQT_TRANSLATE_NOOP( "TQAccel", "Return" ) },
+ { TQt::Key_Enter, TQT_TRANSLATE_NOOP( "TQAccel", "Enter" ) },
+ { TQt::Key_Insert, TQT_TRANSLATE_NOOP( "TQAccel", "Ins" ) },
+ { TQt::Key_Delete, TQT_TRANSLATE_NOOP( "TQAccel", "Del" ) },
+ { TQt::Key_Pause, TQT_TRANSLATE_NOOP( "TQAccel", "Pause" ) },
+ { TQt::Key_Print, TQT_TRANSLATE_NOOP( "TQAccel", "Print" ) },
+ { TQt::Key_SysReq, TQT_TRANSLATE_NOOP( "TQAccel", "SysReq" ) },
+ { TQt::Key_Home, TQT_TRANSLATE_NOOP( "TQAccel", "Home" ) },
+ { TQt::Key_End, TQT_TRANSLATE_NOOP( "TQAccel", "End" ) },
+ { TQt::Key_Left, TQT_TRANSLATE_NOOP( "TQAccel", "Left" ) },
+ { TQt::Key_Up, TQT_TRANSLATE_NOOP( "TQAccel", "Up" ) },
+ { TQt::Key_Right, TQT_TRANSLATE_NOOP( "TQAccel", "Right" ) },
+ { TQt::Key_Down, TQT_TRANSLATE_NOOP( "TQAccel", "Down" ) },
+ { TQt::Key_Prior, TQT_TRANSLATE_NOOP( "TQAccel", "PgUp" ) },
+ { TQt::Key_Next, TQT_TRANSLATE_NOOP( "TQAccel", "PgDown" ) },
+ { TQt::Key_CapsLock, TQT_TRANSLATE_NOOP( "TQAccel", "CapsLock" ) },
+ { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( "TQAccel", "NumLock" ) },
+ { TQt::Key_ScrollLock, TQT_TRANSLATE_NOOP( "TQAccel", "ScrollLock" ) },
+ { TQt::Key_Menu, TQT_TRANSLATE_NOOP( "TQAccel", "Menu" ) },
+ { TQt::Key_Help, TQT_TRANSLATE_NOOP( "TQAccel", "Help" ) },
+
+ // Multimedia keys
+ { TQt::Key_Back, TQT_TRANSLATE_NOOP( "TQAccel", "Back" ) },
+ { TQt::Key_Forward, TQT_TRANSLATE_NOOP( "TQAccel", "Forward" ) },
+ { TQt::Key_Stop, TQT_TRANSLATE_NOOP( "TQAccel", "Stop" ) },
+ { TQt::Key_Refresh, TQT_TRANSLATE_NOOP( "TQAccel", "Refresh" ) },
+ { TQt::Key_VolumeDown, TQT_TRANSLATE_NOOP( "TQAccel", "Volume Down" ) },
+ { TQt::Key_VolumeMute, TQT_TRANSLATE_NOOP( "TQAccel", "Volume Mute" ) },
+ { TQt::Key_VolumeUp, TQT_TRANSLATE_NOOP( "TQAccel", "Volume Up" ) },
+ { TQt::Key_BassBoost, TQT_TRANSLATE_NOOP( "TQAccel", "Bass Boost" ) },
+ { TQt::Key_BassUp, TQT_TRANSLATE_NOOP( "TQAccel", "Bass Up" ) },
+ { TQt::Key_BassDown, TQT_TRANSLATE_NOOP( "TQAccel", "Bass Down" ) },
+ { TQt::Key_TrebleUp, TQT_TRANSLATE_NOOP( "TQAccel", "Treble Up" ) },
+ { TQt::Key_TrebleDown, TQT_TRANSLATE_NOOP( "TQAccel", "Treble Down" ) },
+ { TQt::Key_MediaPlay, TQT_TRANSLATE_NOOP( "TQAccel", "Media Play" ) },
+ { TQt::Key_MediaStop, TQT_TRANSLATE_NOOP( "TQAccel", "Media Stop" ) },
+ { TQt::Key_MediaPrev, TQT_TRANSLATE_NOOP( "TQAccel", "Media Previous" ) },
+ { TQt::Key_MediaNext, TQT_TRANSLATE_NOOP( "TQAccel", "Media Next" ) },
+ { TQt::Key_MediaRecord, TQT_TRANSLATE_NOOP( "TQAccel", "Media Record" ) },
+ { TQt::Key_HomePage, TQT_TRANSLATE_NOOP( "TQAccel", "Home" ) },
+ { TQt::Key_Favorites, TQT_TRANSLATE_NOOP( "TQAccel", "Favorites" ) },
+ { TQt::Key_Search, TQT_TRANSLATE_NOOP( "TQAccel", "Search" ) },
+ { TQt::Key_Standby, TQT_TRANSLATE_NOOP( "TQAccel", "Standby" ) },
+ { TQt::Key_OpenUrl, TQT_TRANSLATE_NOOP( "TQAccel", "Open URL" ) },
+ { TQt::Key_LaunchMail, TQT_TRANSLATE_NOOP( "TQAccel", "Launch Mail" ) },
+ { TQt::Key_LaunchMedia, TQT_TRANSLATE_NOOP( "TQAccel", "Launch Media" ) },
+ { TQt::Key_Launch0, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (0)" ) },
+ { TQt::Key_Launch1, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (1)" ) },
+ { TQt::Key_Launch2, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (2)" ) },
+ { TQt::Key_Launch3, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (3)" ) },
+ { TQt::Key_Launch4, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (4)" ) },
+ { TQt::Key_Launch5, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (5)" ) },
+ { TQt::Key_Launch6, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (6)" ) },
+ { TQt::Key_Launch7, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (7)" ) },
+ { TQt::Key_Launch8, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (8)" ) },
+ { TQt::Key_Launch9, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (9)" ) },
+ { TQt::Key_LaunchA, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (A)" ) },
+ { TQt::Key_LaunchB, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (B)" ) },
+ { TQt::Key_LaunchC, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (C)" ) },
+ { TQt::Key_LaunchD, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (D)" ) },
+ { TQt::Key_LaunchE, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (E)" ) },
+ { TQt::Key_LaunchF, TQT_TRANSLATE_NOOP( "TQAccel", "Launch (F)" ) },
+
+ // --------------------------------------------------------------
+ // More consistent namings
+ { TQt::Key_Print, TQT_TRANSLATE_NOOP( "TQAccel", "Print Screen" ) },
+ { TQt::Key_Prior, TQT_TRANSLATE_NOOP( "TQAccel", "Page Up" ) },
+ { TQt::Key_Next, TQT_TRANSLATE_NOOP( "TQAccel", "Page Down" ) },
+ { TQt::Key_CapsLock, TQT_TRANSLATE_NOOP( "TQAccel", "Caps Lock" ) },
+ { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( "TQAccel", "Num Lock" ) },
+ { TQt::Key_NumLock, TQT_TRANSLATE_NOOP( "TQAccel", "Number Lock" ) },
+ { TQt::Key_ScrollLock, TQT_TRANSLATE_NOOP( "TQAccel", "Scroll Lock" ) },
+ { TQt::Key_Insert, TQT_TRANSLATE_NOOP( "TQAccel", "Insert" ) },
+ { TQt::Key_Delete, TQT_TRANSLATE_NOOP( "TQAccel", "Delete" ) },
+ { TQt::Key_Escape, TQT_TRANSLATE_NOOP( "TQAccel", "Escape" ) },
+ { TQt::Key_SysReq, TQT_TRANSLATE_NOOP( "TQAccel", "System Request" ) },
+
+ { 0, 0 }
+};
+#endif
+static TQString platformNeutralKeySequence(const TQKeySequence &ks)
+{
+#ifndef TQ_WS_MACX
+ return TQString(ks);
+#else
+ uint k;
+ TQString str;
+ TQString p;
+ for (k = 0; k < ks.count(); ++k) {
+ int keycombo = ks[k];
+ int basekey = keycombo & ~(TQt::SHIFT | TQt::CTRL | TQt::ALT | TQt::META);
+ if (keycombo & TQt::CTRL)
+ str += "Ctrl+";
+ if (keycombo & TQt::ALT)
+ str += "Alt+";
+ if (keycombo & TQt::META)
+ str += "Meta+";
+ if (keycombo & TQt::SHIFT)
+ str += "Shift+";
+
+ // begin copy and paste from TQKeySequence :(
+ if (basekey & TQt::UNICODE_ACCEL) {
+ // Note: This character should NOT be upper()'ed, since
+ // the encoded string should indicate EXACTLY what the
+ // key represents! Hence a 'Ctrl+Shift+c' is posible to
+ // represent, but is clearly impossible to trigger...
+ p = TQChar(basekey & 0xffff);
+ } else if ( basekey >= TQt::Key_F1 && basekey <= TQt::Key_F35 ) {
+ p = TQAccel::tr( "F%1" ).arg(basekey - TQt::Key_F1 + 1);
+ } else if ( basekey > TQt::Key_Space && basekey <= TQt::Key_AsciiTilde ) {
+ p.sprintf( "%c", basekey );
+ } else {
+ int i = 0;
+ while (keyname[i].name) {
+ if (basekey == keyname[i].key) {
+ p = TQAccel::tr(keyname[i].name);
+ break;
+ }
+ ++i;
+ }
+ // If we can't tqfind the actual translatable keyname,
+ // fall back on the tqunicode representation of it...
+ // Or else characters like Key_aring may not get displayed
+ // ( Really depends on you locale )
+ if ( !keyname[i].name )
+ // Note: This character should NOT be upper()'ed, see above!
+ p = TQChar(basekey & 0xffff);
+ }
+ // end copy...
+ str += p + ", ";
+ }
+ str.truncate(str.length() - 2);
+ return str;
+#endif
+}
+
+static TQString mkBool( bool b )
+{
+ return b? "true" : "false";
+}
+
+/*!
+ \class Resource resource.h
+ \brief Class for saving/loading, etc. forms
+
+ This class is used for saving and loading forms, code generation,
+ transferring data of widgets over the clipboard, etc..
+
+*/
+
+
+Resource::Resource()
+{
+ mainwindow = 0;
+ formwindow = 0;
+ toplevel = 0;
+ copying = FALSE;
+ pasting = FALSE;
+ hadGeometry = FALSE;
+ langIface = 0;
+ hasFunctions = FALSE;
+}
+
+Resource::Resource( MainWindow* mw )
+ : mainwindow( mw )
+{
+ formwindow = 0;
+ toplevel = 0;
+ copying = FALSE;
+ pasting = FALSE;
+ hadGeometry = FALSE;
+ langIface = 0;
+ hasFunctions = FALSE;
+}
+
+Resource::~Resource()
+{
+ if ( langIface )
+ langIface->release();
+}
+
+void Resource::setWidget( FormWindow *w )
+{
+ formwindow = w;
+ toplevel = w;
+}
+
+TQWidget *Resource::widget() const
+{
+ return toplevel;
+}
+
+bool Resource::load( FormFile *ff, Project *defProject )
+{
+ if ( !ff || ff->absFileName().isEmpty() )
+ return FALSE;
+ currFileName = ff->absFileName();
+ mainContainerSet = FALSE;
+
+ TQFile f( ff->absFileName() );
+ f.open( IO_ReadOnly | IO_Translate );
+
+ bool b = load( ff, &TQT_TQIODEVICE_OBJECT(f), defProject );
+ f.close();
+
+ return b;
+}
+
+#undef Q_SIGNALS
+#undef Q_SLOTS
+
+bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject )
+{
+ TQDomDocument doc;
+ TQString errMsg;
+ int errLine;
+ if ( !doc.setContent( dev, &errMsg, &errLine ) ) {
+ return FALSE;
+ }
+
+ DomTool::fixDocument( doc );
+
+ TQWidget *p = mainwindow ? mainwindow->qWorkspace() : 0;
+ toplevel = formwindow = new FormWindow( ff, p, 0 );
+ if ( defProject )
+ formwindow->setProject( defProject );
+ else if ( MainWindow::self )
+ formwindow->setProject( MainWindow::self->currProject() );
+ if ( mainwindow )
+ formwindow->setMainWindow( mainwindow );
+ MetaDataBase::addEntry( formwindow );
+
+ if ( !langIface ) {
+ TQString lang = "TQt Script";
+ if ( mainwindow )
+ lang = mainwindow->currProject()->language();
+ langIface = MetaDataBase::languageInterface( lang );
+ if ( langIface )
+ langIface->addRef();
+ }
+
+ uiFileVersion = doc.firstChild().toElement().attribute("version");
+ TQDomElement e = doc.firstChild().toElement().firstChild().toElement();
+
+ TQDomElement forwards = e;
+ while ( forwards.tagName() != "forwards" && !forwards.isNull() )
+ forwards = forwards.nextSibling().toElement();
+
+ TQDomElement includes = e;
+ while ( includes.tagName() != "includes" && !includes.isNull() )
+ includes = includes.nextSibling().toElement();
+
+ TQDomElement variables = e;
+ while ( variables.tagName() != "variables" && !variables.isNull() )
+ variables = variables.nextSibling().toElement();
+
+ TQDomElement qsignals = e;
+ while ( qsignals.tagName() != "Q_SIGNALS" && !qsignals.isNull() )
+ qsignals = qsignals.nextSibling().toElement();
+
+ TQDomElement qslots = e;
+ while ( qslots.tagName() != "Q_SLOTS" && !qslots.isNull() )
+ qslots = qslots.nextSibling().toElement();
+
+ TQDomElement functions = e;
+ while ( functions.tagName() != "functions" && !functions.isNull() )
+ functions = functions.nextSibling().toElement();
+
+ TQDomElement connections = e;
+ while ( connections.tagName() != "connections" && !connections.isNull() )
+ connections = connections.nextSibling().toElement();
+
+ TQDomElement imageCollection = e;
+ images.clear();
+ while ( imageCollection.tagName() != "images" && !imageCollection.isNull() )
+ imageCollection = imageCollection.nextSibling().toElement();
+
+ TQDomElement customWidgets = e;
+ while ( customWidgets.tagName() != "customwidgets" && !customWidgets.isNull() )
+ customWidgets = customWidgets.nextSibling().toElement();
+
+ TQDomElement tabOrder = e;
+ while ( tabOrder.tagName() != "tabstops" && !tabOrder.isNull() )
+ tabOrder = tabOrder.nextSibling().toElement();
+
+ TQDomElement actions = e;
+ while ( actions.tagName() != "actions" && !actions.isNull() )
+ actions = actions.nextSibling().toElement();
+
+ TQDomElement toolbars = e;
+ while ( toolbars.tagName() != "toolbars" && !toolbars.isNull() )
+ toolbars = toolbars.nextSibling().toElement();
+
+ TQDomElement menubar = e;
+ while ( menubar.tagName() != "menubar" && !menubar.isNull() )
+ menubar = menubar.nextSibling().toElement();
+
+ TQDomElement widget;
+ while ( !e.isNull() ) {
+ if ( e.tagName() == "widget" ) {
+ widgets.clear();
+ widget = e;
+ } else if ( e.tagName() == "include" ) { // compatibility with 2.x
+ MetaDataBase::Include inc;
+ inc.location = "global";
+ if ( e.attribute( "location" ) == "local" )
+ inc.location = "local";
+ inc.implDecl = "in declaration";
+ if ( e.attribute( "impldecl" ) == "in implementation" )
+ inc.implDecl = "in implementation";
+ inc.header = e.firstChild().toText().data();
+ if ( inc.header.right( 5 ) != ".ui.h" ) {
+ metaIncludes.append( inc );
+ } else {
+ if ( formwindow->formFile() )
+ formwindow->formFile()->setCodeFileState( FormFile::Ok );
+ }
+ } else if ( e.tagName() == "comment" ) {
+ metaInfo.comment = e.firstChild().toText().data();
+ } else if ( e.tagName() == "forward" ) { // compatibility with old betas
+ metaForwards << e.firstChild().toText().data();
+ } else if ( e.tagName() == "variable" ) { // compatibility with old betas
+ MetaDataBase::Variable v;
+ v.varName = e.firstChild().toText().data();
+ v.varAccess = "protected";
+ metaVariables << v;
+ } else if ( e.tagName() == "author" ) {
+ metaInfo.author = e.firstChild().toText().data();
+ } else if ( e.tagName() == "class" ) {
+ metaInfo.className = e.firstChild().toText().data();
+ } else if ( e.tagName() == "pixmapfunction" ) {
+ if ( formwindow ) {
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( FALSE );
+ formwindow->setPixmapLoaderFunction( e.firstChild().toText().data() );
+ }
+ } else if ( e.tagName() == "pixmapinproject" ) {
+ if ( formwindow ) {
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( TRUE );
+ }
+ } else if ( e.tagName() == "exportmacro" ) {
+ exportMacro = e.firstChild().toText().data();
+ } else if ( e.tagName() == "layoutdefaults" ) {
+ formwindow->setLayoutDefaultSpacing( e.attribute( "spacing", TQString::number( formwindow->layoutDefaultSpacing() ) ).toInt() );
+ formwindow->setLayoutDefaultMargin( e.attribute( "margin", TQString::number( formwindow->layoutDefaultMargin() ) ).toInt() );
+ } else if ( e.tagName() == "layoutfunctions" ) {
+ formwindow->setSpacingFunction( e.attribute( "spacing" ) );
+ formwindow->setMarginFunction( e.attribute( "margin" ) );
+ if ( !formwindow->marginFunction().isEmpty() || !formwindow->spacingFunction().isEmpty() )
+ formwindow->hasLayoutFunctions( TRUE );
+ }
+
+ e = e.nextSibling().toElement();
+ }
+
+ if ( !imageCollection.isNull() )
+ loadImageCollection( imageCollection );
+ if ( !customWidgets.isNull() )
+ loadCustomWidgets( customWidgets, this );
+
+#if defined (TQT_NON_COMMERCIAL)
+ bool previewMode = MainWindow::self ? MainWindow::self->isPreviewing() : FALSE;
+ TQWidget *w = (TQWidget*)createObject( widget, !previewMode ? (TQWidget*)formwindow : MainWindow::self );
+ if ( !w )
+ return FALSE;
+ if ( previewMode )
+ w->reparent( MainWindow::self, TQt::WType_TopLevel, w->pos(), TRUE );
+#else
+ if ( !createObject( widget, formwindow) )
+ return FALSE;
+#endif
+
+ if ( !forwards.isNull() ) {
+ for ( TQDomElement n = forwards.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "forward" )
+ metaForwards << n.firstChild().toText().data();
+ }
+
+ if ( !includes.isNull() ) {
+ for ( TQDomElement n = includes.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "include" ) {
+ if ( n.tagName() == "include" ) {
+ MetaDataBase::Include inc;
+ inc.location = "global";
+ if ( n.attribute( "location" ) == "local" )
+ inc.location = "local";
+ inc.implDecl = "in declaration";
+ if ( n.attribute( "impldecl" ) == "in implementation" )
+ inc.implDecl = "in implementation";
+ inc.header = n.firstChild().toText().data();
+ if ( inc.header.right( 5 ) != ".ui.h" ) {
+ metaIncludes.append( inc );
+ } else {
+ if ( formwindow->formFile() )
+ formwindow->formFile()->setCodeFileState( FormFile::Ok );
+ }
+ }
+ }
+ }
+
+ if ( !variables.isNull() ) {
+ for ( TQDomElement n = variables.firstChild().toElement(); !n.isNull();
+ n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "variable" ) {
+ MetaDataBase::Variable v;
+ v.varName = n.firstChild().toText().data();
+ v.varAccess = n.attribute( "access", "protected" );
+ if ( v.varAccess.isEmpty() )
+ v.varAccess = "protected";
+ metaVariables << v;
+ }
+ }
+ }
+ if ( !qsignals.isNull() ) {
+ for ( TQDomElement n = qsignals.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "signal" )
+ metaSignals << n.firstChild().toText().data();
+ }
+ if ( !qslots.isNull() ) {
+ for ( TQDomElement n = qslots.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "slot" ) {
+ MetaDataBase::Function function;
+ function.specifier = n.attribute( "specifier", "virtual" );
+ if ( function.specifier.isEmpty() )
+ function.specifier = "virtual";
+ function.access = n.attribute( "access", "public" );
+ if ( function.access.isEmpty() )
+ function.access = "public";
+ function.language = n.attribute( "language", "C++" );
+ function.returnType = n.attribute( "returnType", "void" );
+ if ( function.returnType.isEmpty() )
+ function.returnType = "void";
+ function.type = "slot";
+ function.function = n.firstChild().toText().data();
+ if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) )
+ MetaDataBase::addFunction( formwindow, function.function, function.specifier,
+ function.access, "slot", function.language, function.returnType );
+ else
+ MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function,
+ function.specifier, function.access,
+ "slot", function.language,
+ function.returnType );
+ }
+ }
+
+ if ( !functions.isNull() ) {
+ for ( TQDomElement n = functions.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "function" ) {
+ MetaDataBase::Function function;
+ function.specifier = n.attribute( "specifier", "virtual" );
+ if ( function.specifier.isEmpty() )
+ function.specifier = "virtual";
+ function.access = n.attribute( "access", "public" );
+ if ( function.access.isEmpty() )
+ function.access = "public";
+ function.type = n.attribute( "type", "function" );
+ function.type = "function";
+ function.language = n.attribute( "language", "C++" );
+ function.returnType = n.attribute( "returnType", "void" );
+ if ( function.returnType.isEmpty() )
+ function.returnType = "void";
+ function.function = n.firstChild().toText().data();
+ if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) )
+ MetaDataBase::addFunction( formwindow, function.function, function.specifier,
+ function.access, function.type, function.language,
+ function.returnType );
+ else
+ MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function,
+ function.specifier, function.access,
+ function.type, function.language, function.returnType );
+ }
+ }
+ }
+
+ if ( !actions.isNull() )
+ loadActions( actions );
+ if ( !toolbars.isNull() )
+ loadToolBars( toolbars );
+ if ( !menubar.isNull() )
+ loadMenuBar( menubar );
+
+ if ( !connections.isNull() )
+ loadConnections( connections );
+
+ if ( !tabOrder.isNull() )
+ loadTabOrder( tabOrder );
+
+ if ( formwindow ) {
+ MetaDataBase::setIncludes( formwindow, metaIncludes );
+ MetaDataBase::setForwards( formwindow, metaForwards );
+ MetaDataBase::setVariables( formwindow, metaVariables );
+ MetaDataBase::setSignalList( formwindow, metaSignals );
+ metaInfo.classNameChanged = metaInfo.className != TQString( formwindow->name() );
+ MetaDataBase::setMetaInfo( formwindow, metaInfo );
+ MetaDataBase::setExportMacro( formwindow->mainContainer(), exportMacro );
+ }
+
+ loadExtraSource( formwindow->formFile(), currFileName, langIface, hasFunctions );
+
+ if ( mainwindow && formwindow )
+ mainwindow->insertFormWindow( formwindow );
+
+ if ( formwindow ) {
+ formwindow->killAccels( formwindow );
+ if ( formwindow->tqlayout() )
+ formwindow->tqlayout()->activate();
+ if ( hadGeometry )
+ formwindow->resize( formwindow->size().expandedTo( formwindow->tqminimumSize().
+ expandedTo( formwindow->tqminimumSizeHint() ) ) );
+ else
+ formwindow->resize( formwindow->size().expandedTo( formwindow->tqsizeHint() ) );
+ }
+
+ return TRUE;
+}
+
+static bool saveCode( const TQString &filename, const TQString &code )
+{
+ TQFile f( filename );
+ if ( f.open(IO_WriteOnly | IO_Translate) ) {
+ TQTextStream ts( &f );
+ ts << code;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool Resource::save( const TQString& filename, bool formCodeOnly )
+{
+ if ( !formwindow || filename.isEmpty() )
+ return FALSE;
+ if (!langIface) {
+ TQString lang = "TQt Script";
+ if ( mainwindow )
+ lang = mainwindow->currProject()->language();
+ langIface = MetaDataBase::languageInterface( lang );
+ if ( langIface )
+ langIface->addRef();
+ }
+ if ( formCodeOnly && langIface ) {
+ if ( saveFormCode(formwindow->formFile(), langIface) )
+ return TRUE;
+ bool breakout = FALSE;
+ FormFile *ff = formwindow->formFile();
+ TQString codeFile = ff->project()->makeAbsolute( ff->codeFile() );
+ TQString filter = langIface->fileFilterList().join(";;");
+ while ( !breakout ) {
+ TQString fn = TQFileDialog::getSaveFileName( codeFile, filter );
+ breakout = fn.isEmpty();
+ if ( !breakout ) {
+ if ( saveCode(fn, ff->code()) )
+ return TRUE;
+ }
+ }
+ }
+ currFileName = filename;
+
+ TQFile f( filename );
+ if ( !f.open( IO_WriteOnly | IO_Translate ) )
+ return FALSE;
+ bool b = save( &TQT_TQIODEVICE_OBJECT(f) );
+ f.close();
+ return b;
+}
+
+bool Resource::save( TQIODevice* dev )
+{
+ if ( !formwindow )
+ return FALSE;
+
+ if ( !langIface ) {
+ TQString lang = "C++";
+ if ( mainwindow )
+ lang = mainwindow->currProject()->language();
+ langIface = MetaDataBase::languageInterface( lang );
+ if ( langIface )
+ langIface->addRef();
+ }
+
+ TQTextStream ts( dev );
+ ts.setCodec( TQTextCodec::codecForName( "UTF-8" ) );
+
+ ts << "<!DOCTYPE UI><UI version=\"3.3\" stdsetdef=\"1\">" << endl;
+ saveMetaInfoBefore( ts, 0 );
+ saveObject( formwindow->mainContainer(), 0, ts, 0 );
+ if ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) {
+ saveMenuBar( (TQMainWindow*)formwindow->mainContainer(), ts, 0 );
+ saveToolBars( (TQMainWindow*)formwindow->mainContainer(), ts, 0 );
+ }
+ if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() )
+ saveCustomWidgets( ts, 0 );
+ if ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) )
+ saveActions( formwindow->actionList(), ts, 0 );
+ if ( !images.isEmpty() )
+ saveImageCollection( ts, 0 );
+ if ( !MetaDataBase::connections( formwindow ).isEmpty() ||
+ !MetaDataBase::slotList( formwindow ).isEmpty() )
+ saveConnections( ts, 0 );
+ saveTabOrder( ts, 0 );
+ saveMetaInfoAfter( ts, 0 );
+ saveIncludeHints( ts, 0 );
+ ts << "</UI>" << endl;
+ bool ok = saveFormCode( formwindow->formFile(), langIface );
+ images.clear();
+
+ return ok;
+}
+
+TQString Resource::copy()
+{
+ if ( !formwindow )
+ return TQString();
+
+ copying = TRUE;
+ TQString s;
+ TQTextOStream ts( &s );
+
+ ts << "<!DOCTYPE UI-SELECTION><UI-SELECTION>" << endl;
+ TQWidgetList widgets = formwindow->selectedWidgets();
+ TQWidgetList tmp( widgets );
+ for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) {
+ TQWidget *p = w->parentWidget();
+ bool save = TRUE;
+ while ( p ) {
+ if ( tmp.tqfindRef( p ) != -1 ) {
+ save = FALSE;
+ break;
+ }
+ p = p->parentWidget();
+ }
+ if ( save )
+ saveObject( w, 0, ts, 0 );
+ }
+ if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() )
+ saveCustomWidgets( ts, 0 );
+ if ( !images.isEmpty() )
+ saveImageCollection( ts, 0 );
+ ts << "</UI-SELECTION>" << endl;
+
+ return s;
+}
+
+
+void Resource::paste( const TQString &cb, TQWidget *tqparent )
+{
+ if ( !formwindow )
+ return;
+ mainContainerSet = TRUE;
+
+ pasting = TRUE;
+ TQDomDocument doc;
+ TQString errMsg;
+ int errLine;
+ doc.setContent( cb, &errMsg, &errLine );
+
+ TQDomElement firstWidget = doc.firstChild().toElement().firstChild().toElement();
+
+ TQDomElement imageCollection = firstWidget;
+ images.clear();
+ while ( imageCollection.tagName() != "images" && !imageCollection.isNull() )
+ imageCollection = imageCollection.nextSibling().toElement();
+
+ TQDomElement customWidgets = firstWidget;
+ while ( customWidgets.tagName() != "customwidgets" && !customWidgets.isNull() )
+ customWidgets = customWidgets.nextSibling().toElement();
+
+ if ( !imageCollection.isNull() )
+ loadImageCollection( imageCollection );
+ if ( !customWidgets.isNull() )
+ loadCustomWidgets( customWidgets, this );
+
+ TQWidgetList widgets;
+ formwindow->clearSelection( FALSE );
+ formwindow->setPropertyShowingBlocked( TRUE );
+ formwindow->clearSelection( FALSE );
+ while ( !firstWidget.isNull() ) {
+ if ( firstWidget.tagName() == "widget" ) {
+ TQWidget *w = (TQWidget*)createObject( firstWidget, tqparent, 0 );
+ if ( !w )
+ continue;
+ widgets.append( w );
+ int x = w->x() + formwindow->grid().x();
+ int y = w->y() + formwindow->grid().y();
+ if ( w->x() + w->width() > tqparent->width() )
+ x = TQMAX( 0, tqparent->width() - w->width() );
+ if ( w->y() + w->height() > tqparent->height() )
+ y = TQMAX( 0, tqparent->height() - w->height() );
+ if ( x != w->x() || y != w->y() )
+ w->move( x, y );
+ formwindow->selectWidget( w );
+ } else if ( firstWidget.tagName() == "spacer" ) {
+ TQWidget *w = createSpacer( firstWidget, tqparent, 0, firstWidget.tagName() == "vspacer" ? Qt::Vertical : Qt::Horizontal );
+ if ( !w )
+ continue;
+ widgets.append( w );
+ int x = w->x() + formwindow->grid().x();
+ int y = w->y() + formwindow->grid().y();
+ if ( w->x() + w->width() > tqparent->width() )
+ x = TQMAX( 0, tqparent->width() - w->width() );
+ if ( w->y() + w->height() > tqparent->height() )
+ y = TQMAX( 0, tqparent->height() - w->height() );
+ if ( x != w->x() || y != w->y() )
+ w->move( x, y );
+ formwindow->selectWidget( w );
+ }
+ firstWidget = firstWidget.nextSibling().toElement();
+ }
+ formwindow->setPropertyShowingBlocked( FALSE );
+ formwindow->emitShowProperties();
+
+ PasteCommand *cmd = new PasteCommand( FormWindow::tr( "Paste" ), formwindow, widgets );
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void Resource::saveObject( TQT_BASE_OBJECT_NAME *bobj, TQDesignerGridLayout* grid, TQTextStream &ts, int indent )
+{
+ TQObject* obj = TQT_TQOBJECT(bobj);
+ if ( obj && obj->isWidgetType() && ( (TQWidget*)obj )->isHidden() )
+ return;
+ TQString closeTag;
+ const char* className = WidgetFactory::classNameOf( obj );
+ int classID = WidgetDatabase::idFromClassName( className );
+ bool isPlugin = WidgetDatabase::isCustomPluginWidget( classID );
+ if ( obj->isWidgetType() ) {
+ if ( obj->isA("CustomWidget") || isPlugin ) {
+ usedCustomWidgets << TQString( className );
+ includeHints << WidgetDatabase::includeFile( classID );
+ }
+
+ if ( TQT_BASE_OBJECT(obj) != TQT_BASE_OBJECT(formwindow) && !formwindow->widgets()->tqfind( (TQWidget*)obj ) )
+ return; // we don't know anything about this thing
+
+ TQString attributes;
+ if ( grid ) {
+ TQDesignerGridLayout::Item item = grid->items[ (TQWidget*)obj ];
+ attributes += TQString(" row=\"") + TQString::number(item.row) + "\"";
+ attributes += TQString(" column=\"") + TQString::number(item.column) + "\"";
+ if ( item.rowspan * item.colspan != 1 ) {
+ attributes += TQString(" rowspan=\"") + TQString::number(item.rowspan) + "\"";
+ attributes += TQString(" colspan=\"") + TQString::number(item.colspan) + "\"";
+ }
+ }
+
+ if ( qstrcmp( className, "Spacer" ) == 0 ) {
+ closeTag = makeIndent( indent ) + "</spacer>\n";
+ ts << makeIndent( indent ) << "<spacer" << attributes << ">" << endl;
+ ++indent;
+ } else {
+ closeTag = makeIndent( indent ) + "</widget>\n";
+ ts << makeIndent( indent ) << "<widget class=\"" << className << "\"" << attributes << ">" << endl;
+ ++indent;
+ }
+ if ( WidgetFactory::hasItems(classID, obj) )
+ saveItems( obj, ts, indent );
+ saveObjectProperties( obj, ts, indent );
+ } else {
+ // test for other objects we created. Nothing so far.
+ return;
+ }
+
+ TQDesignerWidgetStack* ws = 0;
+
+ if ( ::tqqt_cast<TQTabWidget*>(obj) ) {
+ TQTabWidget* tw = (TQTabWidget*) obj;
+ TQObjectList* tmpl = tw->queryList( "TQWidgetStack" );
+ TQWidgetStack *ws = (TQWidgetStack*)tmpl->first();
+ TQTabBar *tb = ( (TQDesignerTabWidget*)obj )->tabBar();
+ for ( int i = 0; i < tb->count(); ++i ) {
+ TQTab *t = tb->tabAt( i );
+ if ( !t )
+ continue;
+ TQWidget *w = ws->widget( t->identifier() );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+
+ ts << makeIndent( indent ) << "<attribute name=\"title\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( t->text() ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ delete tmpl;
+ } else if ( (ws = ::tqqt_cast<TQDesignerWidgetStack*>(obj)) != 0 ) {
+ for ( int i = 0; i < ws->count(); ++i ) {
+ TQWidget *w = ws->page( i );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<attribute name=\"id\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<number>" << TQString::number(i) << "</number>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ } else if ( ::tqqt_cast<TQToolBox*>(obj) ) {
+ TQToolBox* tb = (TQToolBox*)obj;
+ for ( int i = 0; i < tb->count(); ++i ) {
+ TQWidget *w = tb->item( i );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<property name=\"backgroundMode\">" << endl;
+ indent++;
+ saveEnumProperty( w, "backgroundMode", TQVariant::Invalid, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<attribute name=\"label\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( tb->itemLabel( tb->indexOf(w) ) ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ } else if ( ::tqqt_cast<TQWizard*>(obj) ) {
+ TQWizard* wiz = (TQWizard*)obj;
+ for ( int i = 0; i < wiz->pageCount(); ++i ) {
+ TQWidget *w = wiz->page( i );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+
+ ts << makeIndent( indent ) << "<attribute name=\"title\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( wiz->title( w ) ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ } else if ( ::tqqt_cast<TQMainWindow*>(obj) ) {
+ saveChildrenOf( ( (TQMainWindow*)obj )->centralWidget(), ts, indent );
+ } else {
+ bool saved = FALSE;
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ if ( isPlugin ) {
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( className, &iface );
+ if ( iface ) {
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ if ( iface2->supportsPages( className ) ) {
+ TQWidgetList containers = iface2->pages( className, (TQWidget*)obj );
+ if ( !containers.isEmpty() ) {
+ saved = TRUE;
+ int i = 0;
+ for ( TQWidget *w = containers.first(); w; w = containers.next(), ++i ) {
+ if ( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\""
+ << WidgetFactory::classNameOf( w )
+ << "\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() )
+ << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<attribute name=\"label\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>"
+ << entitize( iface2->pageLabel( className, (TQWidget*)obj, i ) )
+ << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ }
+ } else {
+ saved = TRUE;
+ TQWidget *w = iface2->containerOfWidget( className, (TQWidget*)obj );
+ if ( obj != w ) {
+ ts << makeIndent( indent ) << "<widget class=\""
+ << WidgetFactory::classNameOf( w )
+ << "\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() )
+ << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ // Create a custom widget and then store it in the database
+ // so we can save the custom widgets.
+ MetaDataBase::CustomWidget *cw = new MetaDataBase::CustomWidget;
+ cw->className = className;
+ cw->includeFile = WidgetDatabase::includeFile( classID );
+ TQStrList lst = w->tqmetaObject()->signalNames( TRUE );
+ for ( TQPtrListIterator<char> it(lst); it.current(); ++it )
+ cw->lstSignals.append(it.current());
+
+ int i;
+ int total = w->tqmetaObject()->numProperties( TRUE );
+ for ( i = 0; i < total; i++ ) {
+ const TQMetaProperty *p = w->tqmetaObject()->property( i, TRUE );
+ if ( p->designable(w) ) {
+ MetaDataBase::Property prop;
+ prop.property = p->name();
+ TQString pType = p->type();
+ // *sigh* designer types are not normal types
+ // Handle most cases, the ones it misses are
+ // probably too difficult to deal with anyway...
+ if ( pType.startsWith("Q") ) {
+ pType = pType.right( pType.length() - 1 );
+ } else {
+ pType[0] = pType[0].upper();
+ }
+ prop.type = pType;
+ cw->lstProperties.append( prop );
+ }
+ }
+
+ total = w->tqmetaObject()->numSlots( TRUE );
+ for ( i = 0; i < total; i++ ) {
+ const TQMetaData *md = w->tqmetaObject()->slot( i, TRUE );
+ MetaDataBase::Function funky;
+ // Find out if we have a return type.
+ if ( md->method->count > 0 ) {
+ const TQUParameter p = md->method->parameters[0];
+ if ( p.inOut == TQUParameter::InOut )
+ funky.returnType = p.type->desc();
+ }
+
+ funky.function = md->name;
+ funky.language = "C++";
+ switch ( md->access ) {
+ case TQMetaData::Public:
+ funky.access = "public";
+ break;
+ case TQMetaData::Protected:
+ funky.access = "protected";
+ break;
+ case TQMetaData::Private:
+ funky.access = "private";
+ break;
+ }
+ cw->lstSlots.append( funky );
+ }
+ MetaDataBase::addCustomWidget( cw );
+ }
+ iface2->release();
+ }
+ iface->release();
+ }
+ }
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+ if ( !saved )
+ saveChildrenOf( obj, ts, indent );
+ }
+
+ indent--;
+ ts << closeTag;
+}
+
+void Resource::saveItems( TQT_BASE_OBJECT_NAME *bobj, TQTextStream &ts, int indent )
+{
+ TQObject* obj = TQT_TQOBJECT(bobj);
+ if ( ::tqqt_cast<TQListBox*>(obj) || ::tqqt_cast<TQComboBox*>(obj) ) {
+ TQListBox *lb = 0;
+ if ( ::tqqt_cast<TQListBox*>(obj) ) {
+ lb = (TQListBox*)obj;
+ } else {
+ TQComboBox *cb = (TQComboBox*)obj;
+ lb = cb->listBox();
+ if (!lb) {
+ TQPopupMenu *popup = (TQPopupMenu*)cb->child( 0, "TQPopupMenu" );
+ TQ_ASSERT(popup);
+ for ( int id = 0; id < (int)popup->count(); ++id ) {
+ ts << makeIndent( indent ) << "<item>" << endl;
+ indent++;
+ TQStringList text;
+ text << popup->text(id);
+ TQPtrList<TQPixmap> pixmaps;
+ if ( popup->pixmap(id) )
+ pixmaps.append( popup->pixmap(id) );
+ saveItem( text, pixmaps, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ }
+ }
+
+ if (lb) {
+ TQListBoxItem *i = lb->firstItem();
+ for ( ; i; i = i->next() ) {
+ ts << makeIndent( indent ) << "<item>" << endl;
+ indent++;
+ TQStringList text;
+ text << i->text();
+ TQPtrList<TQPixmap> pixmaps;
+ if ( i->pixmap() )
+ pixmaps.append( i->pixmap() );
+ saveItem( text, pixmaps, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ }
+
+ } else if ( ::tqqt_cast<TQIconView*>(obj) ) {
+ TQIconView *iv = (TQIconView*)obj;
+
+ TQIconViewItem *i = iv->firstItem();
+ for ( ; i; i = i->nextItem() ) {
+ ts << makeIndent( indent ) << "<item>" << endl;
+ indent++;
+ TQStringList text;
+ text << i->text();
+ TQPtrList<TQPixmap> pixmaps;
+ if ( i->pixmap() )
+ pixmaps.append( i->pixmap() );
+ saveItem( text, pixmaps, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ } else if ( ::tqqt_cast<TQListView*>(obj) ) {
+ TQListView *lv = (TQListView*)obj;
+ int i;
+ for ( i = 0; i < lv->header()->count(); ++i ) {
+ ts << makeIndent( indent ) << "<column>" << endl;
+ indent++;
+ TQStringList l;
+ l << lv->header()->label( i );
+ TQPtrList<TQPixmap> pix;
+ pix.setAutoDelete( TRUE );
+ if ( lv->header()->iconSet( i ) )
+ pix.append( new TQPixmap( lv->header()->iconSet( i )->pixmap() ) );
+ saveItem( l, pix, ts, indent );
+ ts << makeIndent( indent ) << "<property name=\"clickable\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<bool>" << mkBool( lv->header()->isClickEnabled( i ) )<< "</bool>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<property name=\"resizable\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<bool>" << mkBool( lv->header()->isResizeEnabled( i ) ) << "</bool>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</column>" << endl;
+ }
+ saveItem( lv->firstChild(), ts, indent - 1 );
+ }
+#if !defined (TQT_NO_TABLE)
+ else if ( ::tqqt_cast<TQTable*>(obj) ) {
+ TQTable *table = (TQTable*)obj;
+ int i;
+ TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( table );
+# ifndef TQT_NO_SQL
+ bool isDataTable = ::tqqt_cast<TQDataTable*>(table);
+# else
+ bool isDataTable = false;
+# endif
+ for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
+ if ( !table->horizontalHeader()->label( i ).isNull() &&
+ table->horizontalHeader()->label( i ).toInt() != i + 1 ||
+ table->horizontalHeader()->iconSet( i ) ||
+ isDataTable ) {
+ ts << makeIndent( indent ) << "<column>" << endl;
+ indent++;
+ TQStringList l;
+ l << table->horizontalHeader()->label( i );
+ TQPtrList<TQPixmap> pix;
+ pix.setAutoDelete( TRUE );
+ if ( table->horizontalHeader()->iconSet( i ) )
+ pix.append( new TQPixmap( table->horizontalHeader()->iconSet( i )->pixmap() ) );
+ saveItem( l, pix, ts, indent );
+ if ( isDataTable && !columnFields.isEmpty() ) {
+ ts << makeIndent( indent ) << "<property name=\"field\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( *columnFields.tqfind( l[ 0 ] ) ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</column>" << endl;
+ }
+ }
+ for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
+ if ( !table->verticalHeader()->label( i ).isNull() &&
+ table->verticalHeader()->label( i ).toInt() != i + 1 ||
+ table->verticalHeader()->iconSet( i ) ) {
+ ts << makeIndent( indent ) << "<row>" << endl;
+ indent++;
+ TQStringList l;
+ l << table->verticalHeader()->label( i );
+ TQPtrList<TQPixmap> pix;
+ pix.setAutoDelete( TRUE );
+ if ( table->verticalHeader()->iconSet( i ) )
+ pix.append( new TQPixmap( table->verticalHeader()->iconSet( i )->pixmap() ) );
+ saveItem( l, pix, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</row>" << endl;
+ }
+ }
+ }
+#endif
+}
+
+void Resource::saveItem( TQListViewItem *i, TQTextStream &ts, int indent )
+{
+ TQListView *lv = i->listView();
+ while ( i ) {
+ ts << makeIndent( indent ) << "<item>" << endl;
+ indent++;
+
+ TQPtrList<TQPixmap> pixmaps;
+ TQStringList textes;
+ for ( int c = 0; c < lv->columns(); ++c ) {
+ pixmaps.append( i->pixmap( c ) );
+ textes << i->text( c );
+ }
+ saveItem( textes, pixmaps, ts, indent );
+
+ if ( i->firstChild() )
+ saveItem( i->firstChild(), ts, indent );
+
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ i = i->nextSibling();
+ }
+}
+
+void Resource::savePixmap( const TQPixmap &p, TQTextStream &ts, int indent, const TQString &tagname )
+{
+ if ( p.isNull() ) {
+ ts << makeIndent( indent ) << "<" << tagname << "></" << tagname << ">" << endl;
+ return;
+ }
+
+ if ( formwindow && formwindow->savePixmapInline() )
+ ts << makeIndent( indent ) << "<" << tagname << ">" << saveInCollection( p ) << "</" << tagname << ">" << endl;
+ else if ( formwindow && formwindow->savePixmapInProject() )
+ ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapKey( formwindow, p.serialNumber() )
+ << "</" << tagname << ">" << endl;
+ else
+ ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapArgument( formwindow, p.serialNumber() )
+ << "</" << tagname << ">" << endl;
+}
+
+TQPixmap Resource::loadPixmap( const TQDomElement &e, const TQString &/*tagname*/ )
+{
+ TQString arg = e.firstChild().toText().data();
+
+ if ( formwindow && formwindow->savePixmapInline() ) {
+ TQImage img = loadFromCollection( arg );
+ TQPixmap pix;
+ pix.convertFromImage( img );
+ MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg );
+ return pix;
+ } else if ( formwindow && formwindow->savePixmapInProject() ) {
+ TQPixmap pix;
+ if ( mainwindow && mainwindow->currProject() ) {
+ pix = mainwindow->currProject()->pixmapCollection()->pixmap( arg );
+ } else {
+ pix = TQPixmap::fromMimeSource( "designer_image.png" );
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( pix.convertToImage() );
+ }
+
+ MetaDataBase::setPixmapKey( formwindow, pix.serialNumber(), arg );
+ return pix;
+ }
+ TQPixmap pix = TQPixmap::fromMimeSource( "designer_image.png" );
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( pix.convertToImage() );
+ MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg );
+ return pix;
+}
+
+void Resource::saveItem( const TQStringList &text,
+ const TQPtrList<TQPixmap> &pixmaps, TQTextStream &ts,
+ int indent )
+{
+ TQStringList::ConstIterator it = text.begin();
+ for ( ; it != text.end(); ++it ) {
+ ts << makeIndent( indent ) << "<property name=\"text\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( *it ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+
+ for ( int i = 0; i < (int)pixmaps.count(); ++i ) {
+ TQPixmap *p = ( (TQPtrList<TQPixmap>)pixmaps ).at( i );
+ ts << makeIndent( indent ) << "<property name=\"pixmap\">" << endl;
+ indent++;
+ if ( p )
+ savePixmap( *p, ts, indent );
+ else
+ savePixmap( TQPixmap(), ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+}
+
+void Resource::saveChildrenOf( TQT_BASE_OBJECT_NAME* bobj, TQTextStream &ts, int indent )
+{
+ TQObject* obj = TQT_TQOBJECT(bobj);
+ if ( obj->childrenListObject().isEmpty() )
+ return; // no tqchildren to save
+
+ TQString closeTag;
+ // if the widget has a tqlayout we pretend that all widget's childs are childs of the tqlayout - makes the structure nicer
+ TQLayout *tqlayout = 0;
+ TQDesignerGridLayout* grid = 0;
+ if ( !::tqqt_cast<TQSplitter*>(obj) &&
+ WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) &&
+ obj->isWidgetType() &&
+ WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ) != WidgetFactory::NoLayout ) {
+ WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, tqlayout );
+ switch ( lay ) {
+ case WidgetFactory::HBox:
+ closeTag = makeIndent( indent ) + "</hbox>";
+ ts << makeIndent( indent ) << "<hbox>" << endl;
+ ++indent;
+ break;
+ case WidgetFactory::VBox:
+ closeTag = makeIndent( indent ) + "</vbox>";
+ ts << makeIndent( indent ) << "<vbox>" << endl;
+ ++indent;
+ break;
+ case WidgetFactory::Grid:
+ closeTag = makeIndent( indent ) + "</grid>";
+ ts << makeIndent( indent ) << "<grid>" << endl;
+ ++indent;
+ grid = (TQDesignerGridLayout*) tqlayout;
+ break;
+ default:
+ break;
+ }
+
+ // save properties of tqlayout
+ if ( lay != WidgetFactory::NoLayout )
+ saveObjectProperties( tqlayout, ts, indent );
+
+ }
+
+ TQObject *o = 0;
+ for ( TQPtrListIterator<TQObject> it ( obj->childrenListObject() ); ( o = it.current() ); ++it )
+ if ( !TQString( o->name() ).startsWith( "qt_dead_widget_" ) )
+ saveObject( o, grid, ts, indent );
+ if ( !closeTag.isEmpty() ) {
+ indent--;
+ ts << closeTag << endl;
+ }
+}
+
+void Resource::saveObjectProperties( TQT_BASE_OBJECT_NAME *bobj, TQTextStream &ts, int indent )
+{
+ TQObject* w = TQT_TQOBJECT(bobj);
+ TQStringList saved;
+ TQStringList changed;
+ changed = MetaDataBase::changedProperties( w );
+ if ( w->isWidgetType() ) {
+ if ( ::tqqt_cast<Spacer*>(w) ) {
+ if ( !changed.tqcontains( "tqsizeHint" ) )
+ changed << "tqsizeHint";
+ if ( !changed.tqcontains( "geometry" ) )
+ changed << "geometry";
+ } else {
+ TQToolButton *tb = ::tqqt_cast<TQToolButton*>(w);
+ if ( tb && !tb->iconSet().isNull() ) {
+ changed << "iconSet";
+ }
+ }
+ } else if ( ::tqqt_cast<TQLayout*>(w) ) {
+ if ( MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) ) > -1 )
+ changed << "spacing";
+ if ( MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) ) > -1 )
+ changed << "margin";
+ if ( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) ) != "Auto"
+ && !MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) ).isEmpty() )
+ changed << "resizeMode";
+ }
+
+ if ( TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) {
+ if ( changed.tqfindIndex( "geometry" ) == -1 )
+ changed << "geometry";
+ if ( changed.tqfindIndex( "caption" ) == -1 )
+ changed << "caption";
+ }
+
+ if ( changed.isEmpty() )
+ return;
+
+ bool inLayout = TQT_BASE_OBJECT(w) != TQT_BASE_OBJECT(formwindow->mainContainer()) && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() &&
+ WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout;
+
+ TQStrList lst = w->tqmetaObject()->propertyNames( !::tqqt_cast<Spacer*>(w) );
+ for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) {
+ if ( changed.tqfind( TQString::tqfromLatin1( it.current() ) ) == changed.end() )
+ continue;
+ if ( saved.tqfind( TQString::tqfromLatin1( it.current() ) ) != saved.end() )
+ continue;
+ saved << TQString::tqfromLatin1( it.current() );
+ const TQMetaProperty* p = w->tqmetaObject()->
+ property( w->tqmetaObject()->tqfindProperty( it.current(), TRUE ), TRUE );
+ if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) )
+ continue;
+ if ( ::tqqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 &&
+ ( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) )
+ continue;
+ if ( ::tqqt_cast<MenuBarEditor*>(w) &&
+ ( qstrcmp( p->name(), "itemName" ) == 0 || qstrcmp( p->name(), "itemNumber" ) == 0 ||
+ qstrcmp( p->name(), "itemText" ) == 0 ) )
+ continue;
+ if ( qstrcmp( p->name(), "name" ) == 0 )
+ knownNames << w->property( "name" ).toString();
+ if ( !p->isSetType() && !p->isEnumType() && !w->property( p->name() ).isValid() )
+ continue;
+ ts << makeIndent( indent ) << "<property";
+ ts << " name=\"" << it.current() << "\"";
+ if ( !p->stdSet() )
+ ts << " stdset=\"0\"";
+ ts << ">" << endl;
+ indent++;
+ if ( strcmp( it.current(), "resizeMode" ) == 0 && ::tqqt_cast<TQLayout*>(w) ) {
+ saveProperty( w, it.current(), "", TQVariant::String, ts, indent );
+ } else if ( p->isSetType() ) {
+ saveSetProperty( w, it.current(), TQVariant::nameToType( p->type() ), ts, indent );
+ } else if ( p->isEnumType() ) {
+ saveEnumProperty( w, it.current(), TQVariant::nameToType( p->type() ), ts, indent );
+ } else {
+ saveProperty( w, it.current(), w->property( p->name() ), TQVariant::nameToType( p->type() ), ts, indent );
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+
+ if ( w->isWidgetType() && MetaDataBase::fakeProperties( w ) ) {
+ TQMap<TQString, TQVariant>* fakeProperties = MetaDataBase::fakeProperties( w );
+ for ( TQMap<TQString, TQVariant>::Iterator fake = fakeProperties->begin();
+ fake != fakeProperties->end(); ++fake ) {
+ if ( MetaDataBase::isPropertyChanged( w, fake.key() ) ) {
+ if ( w->inherits("CustomWidget") ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)w )->customWidget();
+ if ( cw && !cw->hasProperty( fake.key().latin1() ) && fake.key() != "toolTip" && fake.key() != "whatsThis" )
+ continue;
+ }
+
+ ts << makeIndent( indent ) << "<property name=\"" << fake.key() << "\" stdset=\"0\">" << endl;
+ indent++;
+ saveProperty( w, fake.key(), *fake, (*fake).type(), ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+ }
+ }
+}
+
+void Resource::saveSetProperty( TQT_BASE_OBJECT_NAME *bobj, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent )
+{
+ TQObject* w = TQT_TQOBJECT(bobj);
+ const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( name, TRUE ), TRUE );
+ TQStrList l( p->valueToKeys( w->property( name ).toInt() ) );
+ TQString v;
+ for ( uint i = 0; i < l.count(); ++i ) {
+ v += l.at( i );
+ if ( i < l.count() - 1 )
+ v += "|";
+ }
+ ts << makeIndent( indent ) << "<set>" << v << "</set>" << endl;
+}
+
+void Resource::saveEnumProperty( TQT_BASE_OBJECT_NAME *bobj, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent )
+{
+ TQObject* w = TQT_TQOBJECT(bobj);
+ const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( name, TRUE ), TRUE );
+ int value = w->property( name ).toInt();
+ const char* key = p->valueToKey( value );
+ if (key)
+ ts << makeIndent( indent ) << "<enum>" << key << "</enum>" << endl;
+}
+
+void Resource::saveProperty( TQT_BASE_OBJECT_NAME *bobj, const TQString &name, const TQVariant &value, TQVariant::Type t, TQTextStream &ts, int indent )
+{
+ TQObject* w = TQT_TQOBJECT(bobj);
+ if ( name == "hAlign" || name =="vAlign" || name == "wordwrap" ||
+ name == "layoutMargin" || name =="layoutSpacing" )
+ return;
+ int num;
+ uint unum;
+ double dob;
+ TQString comment;
+ if ( w && formwindow->widgets()->tqfind( (TQWidget*)w ) || formwindow->actionList().tqfind( (TQAction*)w ) )
+ comment = MetaDataBase::propertyComment( w, name );
+ switch ( t ) {
+ case TQVariant::String:
+ if ( name == "resizeMode" ) {
+ TQString resmod = MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) );
+ if ( !resmod.isNull() && resmod != "Auto" ) {
+ ts << makeIndent( indent ) << "<enum>";
+ ts << resmod;
+ ts << "</enum>" << endl;
+ }
+
+ } else {
+ ts << makeIndent( indent ) << "<string>" << entitize( value.toString() ) << "</string>" << endl;
+ if ( !comment.isEmpty() )
+ ts << makeIndent( indent ) << "<comment>" << entitize( comment ) << "</comment>" << endl;
+ }
+ break;
+ case TQVariant::CString:
+ ts << makeIndent( indent ) << "<cstring>" << entitize( value.toCString() ).latin1() << "</cstring>" << endl;
+ break;
+ case TQVariant::Bool:
+ ts << makeIndent( indent ) << "<bool>" << mkBool( value.toBool() ) << "</bool>" << endl;
+ break;
+ case TQVariant::Int:
+ if ( ::tqqt_cast<TQLayout*>(w) ) {
+ num = -1;
+ if ( name == "spacing" )
+ num = MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) );
+ else if ( name == "margin" )
+ num = MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)w ) ) );
+ if ( num != -1 )
+ ts << makeIndent( indent ) << "<number>" << TQString::number( num ) << "</number>" << endl;
+ } else {
+ num = value.toInt();
+ ts << makeIndent( indent ) << "<number>" << TQString::number( num ) << "</number>" << endl;
+ }
+ break;
+ case TQVariant::Double:
+ dob = value.toDouble();
+ ts << makeIndent( indent ) << "<number>" << TQString::number( dob ) << "</number>" << endl;
+ break;
+ case TQVariant::KeySequence:
+ ts << makeIndent( indent ) << "<string>"
+ << entitize(platformNeutralKeySequence(value.toKeySequence())) << "</string>" << endl;
+ break;
+ case TQVariant::UInt:
+ unum = value.toUInt();
+ ts << makeIndent( indent ) << "<number>" << TQString::number( unum ) << "</number>" << endl;
+ break;
+ case TQVariant::Rect: {
+ TQVariant v( value );
+ ts << makeIndent( indent ) << "<rect>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<x>" << TQString::number( v.toRect().x() ) << "</x>" << endl;
+ ts << makeIndent( indent ) << "<y>" << TQString::number( v.toRect().y() ) << "</y>" << endl;
+ ts << makeIndent( indent ) << "<width>" << TQString::number( v.toRect().width() ) << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << TQString::number( v.toRect().height() ) << "</height>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</rect>" << endl;
+ } break;
+ case TQVariant::Point: {
+ TQVariant v( value );
+ ts << makeIndent( indent ) << "<point>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<x>" << TQString::number( v.toPoint().x() ) << "</x>" << endl;
+ ts << makeIndent( indent ) << "<y>" << TQString::number( v.toPoint().y() ) << "</y>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</point>" << endl;
+ } break;
+ case TQVariant::Size: {
+ TQVariant v( value );
+ ts << makeIndent( indent ) << "<size>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<width>" << TQString::number( v.toSize().width() ) << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << TQString::number( v.toSize().height() ) << "</height>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</size>" << endl;
+ } break;
+ case TQVariant::Color: {
+ TQVariant v( value );
+ ts << makeIndent( indent ) << "<color>" << endl;
+ indent++;
+ saveColor( ts, indent, v.toColor() );
+ indent--;
+ ts << makeIndent( indent ) << "</color>" << endl;
+ } break;
+ case TQVariant::Font: {
+ TQVariant v( value );
+ ts << makeIndent( indent ) << "<font>" << endl;
+ TQFont f( tqApp->font() );
+ if ( w && w->isWidgetType() && ((TQWidget*)w)->parentWidget() )
+ f = ((TQWidget*)w)->parentWidget()->font();
+ TQFont f2( v.toFont() );
+ indent++;
+ if ( f.family() != f2.family() )
+ ts << makeIndent( indent ) << "<family>" << f2.family() << "</family>" << endl;
+ if ( f.pointSize() != f2.pointSize() )
+ ts << makeIndent( indent ) << "<pointsize>" << TQString::number( f2.pointSize() ) << "</pointsize>" << endl;
+ if ( f.bold() != f2.bold() )
+ ts << makeIndent( indent ) << "<bold>" << TQString::number( (int)f2.bold() ) << "</bold>" << endl;
+ if ( f.italic() != f2.italic() )
+ ts << makeIndent( indent ) << "<italic>" << TQString::number( (int)f2.italic() ) << "</italic>" << endl;
+ if ( f.underline() != f2.underline() )
+ ts << makeIndent( indent ) << "<underline>" << TQString::number( (int)f2.underline() ) << "</underline>" << endl;
+ if ( f.strikeOut() != f2.strikeOut() )
+ ts << makeIndent( indent ) << "<strikeout>" << TQString::number( (int)f2.strikeOut() ) << "</strikeout>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</font>" << endl;
+ } break;
+ case TQVariant::SizePolicy: {
+ TQSizePolicy sp( value.toSizePolicy() );
+ ts << makeIndent( indent ) << "<sizepolicy>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<hsizetype>" << (int)sp.horData() << "</hsizetype>" << endl;
+ ts << makeIndent( indent ) << "<vsizetype>" << (int)sp.verData() << "</vsizetype>" << endl;
+ ts << makeIndent( indent ) << "<horstretch>" << (int)sp.horStretch() << "</horstretch>" << endl;
+ ts << makeIndent( indent ) << "<verstretch>" << (int)sp.verStretch() << "</verstretch>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizepolicy>" << endl;
+ break;
+ }
+ case TQVariant::Pixmap:
+ savePixmap( value.toPixmap(), ts, indent );
+ break;
+ case TQVariant::IconSet:
+ savePixmap( value.toIconSet().pixmap(), ts, indent, "iconset" );
+ break;
+ case TQVariant::Image:
+ ts << makeIndent( indent ) << "<image>" << saveInCollection( value.toImage() ) << "</image>" << endl;
+ break;
+ case TQVariant::Palette: {
+ TQPalette p( value.toPalette() );
+ ts << makeIndent( indent ) << "<palette>" << endl;
+ indent++;
+
+ ts << makeIndent( indent ) << "<active>" << endl;
+ indent++;
+ saveColorGroup( ts, indent, p.active() );
+ indent--;
+ ts << makeIndent( indent ) << "</active>" << endl;
+
+ ts << makeIndent( indent ) << "<disabled>" << endl;
+ indent++;
+ saveColorGroup( ts, indent, p.disabled() );
+ indent--;
+ ts << makeIndent( indent ) << "</disabled>" << endl;
+
+ ts << makeIndent( indent ) << "<inactive>" << endl;
+ indent++;
+ saveColorGroup( ts, indent, p.inactive() );
+ indent--;
+ ts << makeIndent( indent ) << "</inactive>" << endl;
+
+ indent--;
+ ts << makeIndent( indent ) << "</palette>" << endl;
+ } break;
+ case TQVariant::Cursor:
+ ts << makeIndent( indent ) << "<cursor>" << value.toCursor().tqshape() << "</cursor>" << endl;
+ break;
+ case TQVariant::StringList: {
+ TQStringList lst = value.toStringList();
+ uint i = 0;
+ ts << makeIndent( indent ) << "<stringlist>" << endl;
+ indent++;
+ if ( !lst.isEmpty() ) {
+ for ( i = 0; i < lst.count(); ++i )
+ ts << makeIndent( indent ) << "<string>" << entitize( lst[ i ] ) << "</string>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</stringlist>" << endl;
+ } break;
+ case TQVariant::Date: {
+ TQDate d = value.toDate();
+ ts << makeIndent( indent ) << "<date>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<year>" << d.year() << "</year>" << endl;
+ ts << makeIndent( indent ) << "<month>" << d.month() << "</month>" << endl;
+ ts << makeIndent( indent ) << "<day>" << d.day() << "</day>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</date>" << endl;
+ break;
+ }
+ case TQVariant::Time: {
+ TQTime t = value.toTime();
+ ts << makeIndent( indent ) << "<time>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<hour>" << t.hour() << "</hour>" << endl;
+ ts << makeIndent( indent ) << "<minute>" << t.minute() << "</minute>" << endl;
+ ts << makeIndent( indent ) << "<second>" << t.second() << "</second>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</time>" << endl;
+ break;
+ }
+ case TQVariant::DateTime: {
+ TQDateTime dt = value.toDateTime();
+ ts << makeIndent( indent ) << "<datetime>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<year>" << dt.date().year() << "</year>" << endl;
+ ts << makeIndent( indent ) << "<month>" << dt.date().month() << "</month>" << endl;
+ ts << makeIndent( indent ) << "<day>" << dt.date().day() << "</day>" << endl;
+ ts << makeIndent( indent ) << "<hour>" << dt.time().hour() << "</hour>" << endl;
+ ts << makeIndent( indent ) << "<minute>" << dt.time().minute() << "</minute>" << endl;
+ ts << makeIndent( indent ) << "<second>" << dt.time().second() << "</second>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</datetime>" << endl;
+ break;
+ }
+ default:
+ qWarning( "saving the property %s of type %d not supported yet", name.latin1(), (int)t );
+ }
+}
+
+void Resource::saveColorGroup( TQTextStream &ts, int indent, const TQColorGroup &cg )
+{
+ for( int r = 0 ; r < TQColorGroup::NColorRoles ; r++ ) {
+ ts << makeIndent( indent ) << "<color>" << endl;
+ indent++;
+ saveColor( ts, indent, cg.color( (TQColorGroup::ColorRole)r ) );
+ indent--;
+ ts << makeIndent( indent ) << "</color>" << endl;
+ TQPixmap* pm = TQT_TQBRUSH_OBJECT(cg.brush( (TQColorGroup::ColorRole)r )).pixmap();
+ if ( pm && !pm->isNull() )
+ savePixmap( *pm, ts, indent );
+ }
+}
+
+void Resource::saveColor( TQTextStream &ts, int indent, const TQColor &c )
+{
+ ts << makeIndent( indent ) << "<red>" << TQString::number( c.red() ) << "</red>" << endl;
+ ts << makeIndent( indent ) << "<green>" << TQString::number( c.green() ) << "</green>" << endl;
+ ts << makeIndent( indent ) << "<blue>" << TQString::number( c.blue() ) << "</blue>" << endl;
+}
+
+TQObject *Resource::createObject( const TQDomElement &e, TQWidget *tqparent, TQLayout* tqlayout )
+{
+ lastItem = 0;
+ TQDomElement n = e.firstChild().toElement();
+ TQWidget *w = 0; // the widget that got created
+ TQObject *obj = 0; // gets the properties
+
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+
+ TQString className = e.attribute( "class", "TQWidget" );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ TQString parentClassName = WidgetFactory::classNameOf( tqparent );
+ bool isPlugin =
+ WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( parentClassName ) );
+ if ( isPlugin )
+ qWarning( "####### loading custom container widgets without page support not implemented!" );
+ // ### TODO loading for custom container widgets without pages
+#endif
+ if ( !className.isNull() ) {
+ obj = TQT_TQOBJECT(WidgetFactory::create( WidgetDatabase::idFromClassName( className ), tqparent, 0, FALSE ));
+ if ( !obj ) {
+ TQMessageBox::critical( MainWindow::self, MainWindow::tr( "Loading File" ),
+ MainWindow::tr( "Error loading %1.\n"
+ "The widget %2 couldn't be created.\n"
+ "Information may be lost if this form is saved." ).
+ arg( currFileName ).arg( className ) );
+ return 0;
+ }
+ if ( !mainContainerSet ) {
+ if ( formwindow )
+ formwindow->setMainContainer( (TQWidget*)obj );
+ mainContainerSet = TRUE;
+ }
+ w = (TQWidget*)obj;
+ if ( ::tqqt_cast<TQMainWindow*>(w) )
+ w = ( (TQMainWindow*)w )->centralWidget();
+ if ( tqlayout ) {
+ switch ( WidgetFactory::layoutType( tqlayout ) ) {
+ case WidgetFactory::HBox:
+ ( (TQHBoxLayout*)tqlayout )->addWidget( w );
+ break;
+ case WidgetFactory::VBox:
+ ( (TQVBoxLayout*)tqlayout )->addWidget( w );
+ break;
+ case WidgetFactory::Grid:
+ ( (TQDesignerGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1,
+ col, col + colspan - 1 );
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ( !toplevel )
+ toplevel = w;
+ tqlayout = 0;
+
+ if ( w && formwindow ) {
+ if ( !tqparent ||
+ ( !::tqqt_cast<TQTabWidget*>(tqparent) &&
+ !::tqqt_cast<TQWidgetStack*>(tqparent) &&
+ !::tqqt_cast<TQToolBox*>(tqparent) &&
+ !::tqqt_cast<TQWizard*>(tqparent)
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ && !isPlugin
+#endif
+ ) )
+ formwindow->insertWidget( w, pasting );
+ else if ( tqparent &&
+ ( ::tqqt_cast<TQTabWidget*>(tqparent) ||
+ ::tqqt_cast<TQWidgetStack*>(tqparent) ||
+ ::tqqt_cast<TQToolBox*>(tqparent) ||
+ ::tqqt_cast<TQWizard*>(tqparent)
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ || isPlugin
+#endif
+ ) )
+ MetaDataBase::addEntry( w );
+ }
+ }
+
+ TQDomElement sizePolicyElement;
+ TQObject *sizePolicyObject = 0;
+
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "spacer" ) {
+ createSpacer( n, w, tqlayout, Qt::Horizontal );
+ } else if ( n.tagName() == "widget" ) {
+ createObject( n, w, tqlayout );
+ } else if ( n.tagName() == "hbox" ) {
+ tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::HBox );
+ obj = TQT_TQOBJECT(tqlayout);
+ n = n.firstChild().toElement();
+ continue;
+ } else if ( n.tagName() == "grid" ) {
+ tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::Grid );
+ obj = TQT_TQOBJECT(tqlayout);
+ n = n.firstChild().toElement();
+ continue;
+ } else if ( n.tagName() == "vbox" ) {
+ tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::VBox );
+ obj = TQT_TQOBJECT(tqlayout);
+ n = n.firstChild().toElement();
+ continue;
+ } else if ( n.tagName() == "property" && obj ) {
+ if ( n.attribute( "name" ) == "sizePolicy" ) {
+ // ### Evil hack ### Delay setting sizePolicy so it won't be overridden by other properties.
+ sizePolicyElement = n;
+ sizePolicyObject = obj;
+ } else {
+ setObjectProperty( obj, n.attribute( "name" ), n.firstChild().toElement() );
+ }
+ } else if ( n.tagName() == "attribute" && w ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( ::tqqt_cast<TQTabWidget*>(tqparent) ) {
+ if ( attrib == "title" )
+ ( (TQTabWidget*)tqparent )->insertTab( w, v.toString() );
+ } else if ( ::tqqt_cast<TQWidgetStack*>(tqparent) ) {
+ if ( attrib == "id" )
+ ( (TQDesignerWidgetStack*)tqparent )->insertPage( w, v.toInt() );
+ } else if ( ::tqqt_cast<TQToolBox*>(tqparent) ) {
+ if ( attrib == "label" )
+ ( (TQToolBox*)tqparent )->addItem( w, v.toString() );
+ } else if ( ::tqqt_cast<TQWizard*>(tqparent) ) {
+ if ( attrib == "title" )
+ ( (TQWizard*)tqparent )->addPage( w, v.toString() );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( isPlugin ) {
+ if ( attrib == "label" ) {
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( parentClassName, &iface );
+ if ( iface ) {
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ iface2->insertPage( parentClassName,
+ (TQWidget*)tqparent, v.toString(), -1, w );
+ iface2->release();
+ }
+ iface->release();
+ }
+ }
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+ }
+ } else if ( n.tagName() == "item" ) {
+ createItem( n, w );
+ } else if ( n.tagName() == "column" || n.tagName() =="row" ) {
+ createColumn( n, w );
+ }
+
+ n = n.nextSibling().toElement();
+ }
+
+ // ### Evil hack ### See description above.
+ if ( !sizePolicyElement.isNull() ) {
+ setObjectProperty( sizePolicyObject,
+ sizePolicyElement.attribute( "name" ),
+ sizePolicyElement.firstChild().toElement() );
+ }
+
+ if ( w->isWidgetType() )
+ widgets.insert( w->name(), w );
+
+ return TQT_TQOBJECT(w);
+}
+
+void Resource::createColumn( const TQDomElement &e, TQWidget *widget )
+{
+ if ( !widget )
+ return;
+
+ if ( ::tqqt_cast<TQListView*>(widget) && e.tagName() == "column" ) {
+ TQListView *lv = (TQListView*)widget;
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ bool hasPixmap = FALSE;
+ TQString txt;
+ bool clickable = TRUE, resizable = TRUE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ txt = v.toString();
+ else if ( attrib == "pixmap" ) {
+ pix = loadPixmap( n.firstChild().toElement().toElement() );
+ hasPixmap = !pix.isNull();
+ } else if ( attrib == "clickable" )
+ clickable = v.toBool();
+ else if ( attrib == "resizable" )
+ resizable = v.toBool();
+ }
+ n = n.nextSibling().toElement();
+ }
+ lv->addColumn( txt );
+ int i = lv->header()->count() - 1;
+ if ( hasPixmap ) {
+ lv->header()->setLabel( i, pix, txt );
+ }
+ if ( !clickable )
+ lv->header()->setClickEnabled( clickable, i );
+ if ( !resizable )
+ lv->header()->setResizeEnabled( resizable, i );
+ }
+#ifndef TQT_NO_TABLE
+ else if ( ::tqqt_cast<TQTable*>(widget) ) {
+ TQTable *table = (TQTable*)widget;
+ bool isRow;
+ if ( ( isRow = e.tagName() == "row" ) )
+ table->setNumRows( table->numRows() + 1 );
+ else
+ table->setNumCols( table->numCols() + 1 );
+
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ bool hasPixmap = FALSE;
+ TQString txt;
+ TQString field;
+ TQMap<TQString, TQString> fieldMap = MetaDataBase::columnFields( table );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ txt = v.toString();
+ else if ( attrib == "pixmap" ) {
+ hasPixmap = !n.firstChild().firstChild().toText().data().isEmpty();
+ if ( hasPixmap )
+ pix = loadPixmap( n.firstChild().toElement() );
+ } else if ( attrib == "field" )
+ field = v.toString();
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ int i = isRow ? table->numRows() - 1 : table->numCols() - 1;
+ TQHeader *h = !isRow ? table->horizontalHeader() : table->verticalHeader();
+ if ( hasPixmap )
+ h->setLabel( i, pix, txt );
+ else
+ h->setLabel( i, txt );
+ if ( !isRow && !field.isEmpty() )
+ fieldMap.insert( txt, field );
+ MetaDataBase::setColumnFields( table, fieldMap );
+ }
+#endif
+}
+
+void Resource::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bool &hasPixmap )
+{
+ TQDomElement n = e;
+ hasPixmap = FALSE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ txt = v.toString();
+ else if ( attrib == "pixmap" ) {
+ pix = loadPixmap( n.firstChild().toElement() );
+ hasPixmap = !pix.isNull();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i )
+{
+ if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ), TQT_TQOBJECT(widget) ) )
+ return;
+
+ if ( ::tqqt_cast<TQListBox*>(widget) || ::tqqt_cast<TQComboBox*>(widget) ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ bool hasPixmap = FALSE;
+ TQString txt;
+ loadItem( n, pix, txt, hasPixmap );
+ TQListBox *lb = 0;
+ if ( ::tqqt_cast<TQListBox*>(widget) ) {
+ lb = (TQListBox*)widget;
+ } else {
+ TQComboBox *cb = (TQComboBox*)widget;
+ lb = cb->listBox();
+ if (!lb) {
+ lb = new TQListBox(cb);
+ cb->setListBox(lb);
+ }
+ }
+ if ( hasPixmap ) {
+ new TQListBoxPixmap( lb, pix, txt );
+ } else {
+ new TQListBoxText( lb, txt );
+ }
+ } else if ( ::tqqt_cast<TQIconView*>(widget) ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ bool hasPixmap = FALSE;
+ TQString txt;
+ loadItem( n, pix, txt, hasPixmap );
+ TQIconView *iv = (TQIconView*)widget;
+ if ( hasPixmap )
+ new TQIconViewItem( iv, txt, pix );
+ else
+ new TQIconViewItem( iv, txt );
+ } else if ( ::tqqt_cast<TQListView*>(widget) ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ TQValueList<TQPixmap> pixmaps;
+ TQStringList textes;
+ TQListViewItem *item = 0;
+ TQListView *lv = (TQListView*)widget;
+ if ( i )
+ item = new TQListViewItem( i, lastItem );
+ else
+ item = new TQListViewItem( lv, lastItem );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ textes << v.toString();
+ else if ( attrib == "pixmap" ) {
+ TQString s = v.toString();
+ if ( s.isEmpty() ) {
+ pixmaps << TQPixmap();
+ } else {
+ pix = loadPixmap( n.firstChild().toElement() );
+ pixmaps << pix;
+ }
+ }
+ } else if ( n.tagName() == "item" ) {
+ item->setOpen( TRUE );
+ createItem( n, widget, item );
+ }
+
+ n = n.nextSibling().toElement();
+ }
+
+ for ( int i = 0; i < lv->columns(); ++i ) {
+ item->setText( i, textes[ i ] );
+ item->setPixmap( i, pixmaps[ i ] );
+ }
+ lastItem = item;
+ }
+}
+
+TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *tqparent, TQLayout *tqlayout, Qt::Orientation o )
+{
+ TQDomElement n = e.firstChild().toElement();
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+
+ Spacer *spacer = (Spacer*) WidgetFactory::create( WidgetDatabase::idFromClassName("Spacer"),
+ tqparent, "spacer", FALSE);
+ spacer->setOrientation( o );
+ spacer->setInteraciveMode( FALSE );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" )
+ setObjectProperty( spacer, n.attribute( "name" ), n.firstChild().toElement() );
+ n = n.nextSibling().toElement();
+ }
+ spacer->setInteraciveMode( TRUE );
+ if ( formwindow )
+ formwindow->insertWidget( spacer, pasting );
+ if ( tqlayout ) {
+ if ( ::tqqt_cast<TQBoxLayout*>(tqlayout) )
+ ( (TQBoxLayout*)tqlayout )->addWidget( spacer, 0, spacer->tqalignment() );
+ else
+ ( (TQDesignerGridLayout*)tqlayout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1,
+ spacer->tqalignment() );
+ }
+ return spacer;
+}
+
+/*!
+ Attention: this function has to be in sync with Uic::setObjectProperty(). If you change one, change both.
+*/
+void Resource::setObjectProperty( TQT_BASE_OBJECT_NAME* bobj, const TQString &prop, const TQDomElement &e )
+{
+ TQObject* obj = TQT_TQOBJECT(bobj);
+ const TQMetaProperty *p = obj->tqmetaObject()->property( obj->tqmetaObject()->tqfindProperty( prop, TRUE ), TRUE );
+
+ if ( !::tqqt_cast<TQLayout*>(obj) ) {// no layouts in metadatabase... (RS)
+ if ( obj->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)obj )->customWidget();
+ if ( cw && !cw->hasProperty( prop.latin1() ) && !p && prop != "toolTip" && prop != "whatsThis" )
+ return;
+ }
+ MetaDataBase::setPropertyChanged( obj, prop, TRUE );
+ }
+
+ TQVariant defVarient;
+ if ( e.tagName() == "font" ) {
+ TQFont f( tqApp->font() );
+ if ( obj->isWidgetType() && ( (TQWidget*)obj )->parentWidget() )
+ f = ( (TQWidget*)obj )->parentWidget()->font();
+ defVarient = TQVariant( f );
+ }
+
+ TQString comment;
+ TQVariant v( DomTool::elementToVariant( e, defVarient, comment ) );
+
+ if ( !comment.isEmpty() ) {
+ MetaDataBase::addEntry( obj );
+ MetaDataBase::setPropertyComment( obj, prop, comment );
+ }
+
+ if ( e.tagName() == "pixmap" ) {
+ TQPixmap pix = loadPixmap( e );
+ if ( pix.isNull() )
+ return;
+ v = TQVariant( pix );
+ } else if ( e.tagName() == "iconset" ) {
+ TQPixmap pix = loadPixmap( e, "iconset" );
+ if ( pix.isNull() )
+ return;
+ v = TQVariant( TQIconSet( pix ) );
+ } else if ( e.tagName() == "image" ) {
+ v = TQVariant( loadFromCollection( v.toString() ) );
+ }
+
+ if ( !p ) {
+ MetaDataBase::setFakeProperty( obj, prop, v );
+ if ( obj->isWidgetType() ) {
+ if ( prop == "database" && TQT_BASE_OBJECT(obj) != TQT_BASE_OBJECT(toplevel) ) {
+ TQStringList lst = MetaDataBase::fakeProperty( obj, "database" ).toStringList();
+ if ( lst.count() > 2 )
+ dbControls.insert( obj->name(), lst[ 2 ] );
+ else if ( lst.count() == 2 )
+ dbTables.insert( obj->name(), lst );
+ }
+ return;
+ }
+ }
+
+ if ( e.tagName() == "palette" ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPalette p;
+ while ( !n.isNull() ) {
+ TQColorGroup cg;
+ if ( n.tagName() == "active" ) {
+ cg = loadColorGroup( n );
+ p.setActive( cg );
+ } else if ( n.tagName() == "inactive" ) {
+ cg = loadColorGroup( n );
+ p.setInactive( cg );
+ } else if ( n.tagName() == "disabled" ) {
+ cg = loadColorGroup( n );
+ p.setDisabled( cg );
+ }
+ n = n.nextSibling().toElement();
+ }
+ v = TQPalette( p );
+ } else if ( e.tagName() == "enum" && p && p->isEnumType() && prop != "resizeMode" ) {
+ TQString key( v.toString() );
+ int vi = p->keyToValue( key );
+ if ( vi == -1 )
+ return; // ignore invalid properties
+ v = TQVariant( vi );
+ } else if ( e.tagName() == "set" && p && p->isSetType() ) {
+ TQString keys( v.toString() );
+ TQStringList lst = TQStringList::split( '|', keys );
+ TQStrList l;
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ l.append( *it );
+ v = TQVariant( p->keysToValue( l ) );
+ }
+
+ if ( prop == "caption" ) {
+ TQCString s1 = v.toCString();
+ TQString s2 = v.toString();
+ if ( !s2.isEmpty() )
+ formwindow->setCaption( s2 );
+ else if ( !s1.isEmpty() )
+ formwindow->setCaption( s1 );
+ }
+ if ( prop == "icon" ) {
+ formwindow->setIcon( v.toPixmap() );
+ TQString pmk = MetaDataBase::pixmapKey( formwindow, v.toPixmap().serialNumber() );
+ MetaDataBase::setPixmapKey( formwindow,
+ formwindow->icon()->serialNumber(), pmk );
+ }
+
+ if ( prop == "geometry" ) {
+ if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(toplevel) ) {
+ hadGeometry = TRUE;
+ toplevel->resize( v.toRect().size() );
+ return;
+ } else if ( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) {
+ hadGeometry = TRUE;
+ formwindow->resize( v.toRect().size() );
+ return;
+ }
+ }
+
+ if ( ::tqqt_cast<TQLayout*>(obj) ) {
+ if ( prop == "spacing" ) {
+ MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) ), v.toInt() );
+ return;
+ } else if ( prop == "margin" ) {
+ MetaDataBase::setMargin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) ), v.toInt() );
+ return;
+ } else if ( e.tagName() == "enum" && prop == "resizeMode" ) {
+ MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) ), v.toString() );
+ return;
+ }
+ }
+
+ if ( prop == "name" ) {
+ if ( pasting ) {
+ TQString s = v.toString();
+ formwindow->unify( (TQWidget*)obj, s, TRUE );
+ obj->setName( s );
+ return;
+ } else if ( formwindow && TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) {
+ formwindow->setName( v.toCString() );
+ }
+ }
+
+ if ( prop == "sizePolicy" ) {
+ TQSizePolicy sp = v.toSizePolicy();
+ sp.setHeightForWidth( ( (TQWidget*)obj )->sizePolicy().hasHeightForWidth() );
+ }
+
+ if ( prop == "cursor" )
+ MetaDataBase::setCursor( (TQWidget*)obj, v.toCursor() );
+
+ obj->setProperty( prop, v );
+}
+
+
+TQString Resource::saveInCollection( const TQImage &img )
+{
+ TQString imgName = "none";
+ TQValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ if ( img == ( *it ).img ) {
+ imgName = ( *it ).name;
+ break;
+ }
+ }
+
+ if ( imgName == "none" ) {
+ Image i;
+ imgName = "image" + TQString::number( images.count() );
+ i.name = imgName;
+ i.img = img;
+ images.append( i );
+ }
+ return imgName;
+}
+
+void Resource::saveImageData( const TQImage &img, TQTextStream &ts, int indent )
+{
+ TQByteArray ba;
+ TQBuffer buf( ba );
+ buf.open( IO_WriteOnly | IO_Translate );
+ TQString format;
+ bool compress = FALSE;
+ if (img.hasAlphaBuffer()) {
+ format = "PNG";
+ } else {
+ format = img.depth() > 1 ? "XPM" : "XBM";
+ compress = TRUE;
+ }
+ TQImageIO iio( &buf, format );
+ iio.setImage( img );
+ iio.write();
+ buf.close();
+ TQByteArray bazip = ba;
+ int i = 0;
+ if (compress) {
+ bazip = tqCompress( ba );
+ format += ".GZ";
+ // The first 4 bytes in tqCompress() are the length of the unzipped
+ // format. The XPM.GZ format does not use these.
+ i = 4;
+ }
+ ulong len = bazip.size();
+ ts << makeIndent( indent ) << "<data format=\"" + format + "\" length=\"" << ba.size() << "\">";
+ static const char hexchars[] = "0123456789abcdef";
+ for (; i < (int)len; ++i ) {
+ uchar s = (uchar) bazip[i];
+ ts << hexchars[s >> 4];
+ ts << hexchars[s & 0x0f];
+ }
+ ts << "</data>" << endl;
+}
+
+void Resource::saveImageCollection( TQTextStream &ts, int indent )
+{
+ ts << makeIndent( indent ) << "<images>" << endl;
+ indent++;
+
+ TQValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ ts << makeIndent( indent ) << "<image name=\"" << (*it).name << "\">" << endl;
+ indent++;
+ saveImageData( (*it).img, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</image>" << endl;
+ }
+
+ indent--;
+ ts << makeIndent( indent ) << "</images>" << endl;
+}
+
+static TQImage loadImageData( TQDomElement &n2 )
+{
+ TQImage img;
+ TQString data = n2.firstChild().toText().data();
+ const int lengthOffset = 4;
+ int baSize = data.length() / 2 + lengthOffset;
+ uchar *ba = new uchar[ baSize ];
+ for ( int i = lengthOffset; i < baSize; ++i ) {
+ char h = data[ 2 * (i-lengthOffset) ].latin1();
+ char l = data[ 2 * (i-lengthOffset) + 1 ].latin1();
+ uchar r = 0;
+ if ( h <= '9' )
+ r += h - '0';
+ else
+ r += h - 'a' + 10;
+ r = r << 4;
+ if ( l <= '9' )
+ r += l - '0';
+ else
+ r += l - 'a' + 10;
+ ba[ i ] = r;
+ }
+ TQString format = n2.attribute( "format", "PNG" );
+ if ( format == "XPM.GZ" || format == "XBM.GZ" ) {
+ ulong len = n2.attribute( "length" ).toULong();
+ if ( len < data.length() * 5 )
+ len = data.length() * 5;
+ // tqUncompress() expects the first 4 bytes to be the expected length of
+ // the uncompressed data
+ ba[0] = ( len & 0xff000000 ) >> 24;
+ ba[1] = ( len & 0x00ff0000 ) >> 16;
+ ba[2] = ( len & 0x0000ff00 ) >> 8;
+ ba[3] = ( len & 0x000000ff );
+ TQByteArray baunzip = tqUncompress( ba, baSize );
+ img.loadFromData( (const uchar*)baunzip.data(), baunzip.size(), format.left(format.tqfind('.')) );
+ } else {
+ img.loadFromData( (const uchar*)ba+lengthOffset, baSize-lengthOffset, format );
+ }
+ delete [] ba;
+ return img;
+}
+
+void Resource::loadImageCollection( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "image" ) {
+ Image img;
+ img.name = n.attribute( "name" );
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "data" )
+ img.img = loadImageData( n2 );
+ n2 = n2.nextSibling().toElement();
+ }
+ images.append( img );
+ n = n.nextSibling().toElement();
+ }
+ }
+}
+
+TQImage Resource::loadFromCollection( const TQString &name )
+{
+ TQValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ if ( ( *it ).name == name )
+ return ( *it ).img;
+ }
+ return TQImage();
+}
+
+void Resource::saveConnections( TQTextStream &ts, int indent )
+{
+ TQValueList<MetaDataBase::Connection> connections = MetaDataBase::connections( formwindow );
+ if ( connections.isEmpty() )
+ return;
+ ts << makeIndent( indent ) << "<connections>" << endl;
+ indent++;
+ TQValueList<MetaDataBase::Connection>::Iterator it = connections.begin();
+ for ( ; it != connections.end(); ++it ) {
+ MetaDataBase::Connection conn = *it;
+ if ( ( knownNames.tqfindIndex( TQString( conn.sender->name() ) ) == -1 &&
+ qstrcmp( conn.sender->name(), "this" ) != 0 ) ||
+ ( knownNames.tqfindIndex( TQString( conn.receiver->name() ) ) == -1 &&
+ qstrcmp( conn.receiver->name(), "this" ) != 0 ) )
+ continue;
+ if ( formwindow->isMainContainer( (TQWidget*)(*it).receiver ) &&
+ !MetaDataBase::hasSlot( formwindow, MetaDataBase::normalizeFunction( (*it).slot ).latin1() ) )
+ continue;
+
+ if ( conn.sender->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)conn.sender )->customWidget();
+ if ( cw && !cw->hasSignal( conn.signal ) )
+ continue;
+ }
+
+ if ( conn.receiver->inherits( "CustomWidget" ) && !formwindow->isMainContainer( conn.receiver ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)conn.receiver )->customWidget();
+ if ( cw && !cw->hasSlot( MetaDataBase::normalizeFunction( conn.slot ).latin1() ) )
+ continue;
+ }
+
+ ts << makeIndent( indent ) << "<connection>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<sender>" << entitize( conn.sender->name() ) << "</sender>" << endl;
+ ts << makeIndent( indent ) << "<signal>" << entitize( conn.signal ) << "</signal>" << endl;
+ ts << makeIndent( indent ) << "<receiver>" << entitize( conn.receiver->name() ) << "</receiver>" << endl;
+ ts << makeIndent( indent ) << "<slot>" << entitize( MetaDataBase::normalizeFunction( conn.slot ) ) << "</slot>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</connection>" << endl;
+ }
+
+ TQString lang = formwindow->project()->language();
+ indent--;
+ ts << makeIndent( indent ) << "</connections>" << endl;
+}
+
+void Resource::loadConnections( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "connection" ) {
+ TQString lang = n.attribute( "language", "C++" );
+ TQDomElement n2 = n.firstChild().toElement();
+ MetaDataBase::Connection conn;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "sender" ) {
+ conn.sender = 0;
+ TQString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.sender = TQT_TQOBJECT(toplevel);
+ } else {
+ if ( name == "this" )
+ name = toplevel->name();
+ TQObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.sender = l->first();
+ delete l;
+ l = 0;
+ }
+ if ( !conn.sender )
+ conn.sender = formwindow->tqfindAction( name );
+ }
+ } else if ( n2.tagName() == "signal" ) {
+ conn.signal = n2.firstChild().toText().data();
+ } else if ( n2.tagName() == "receiver" ) {
+ conn.receiver = 0;
+ TQString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.receiver = TQT_TQOBJECT(toplevel);
+ } else {
+ TQObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.receiver = l->first();
+ delete l;
+ l = 0;
+ }
+ if ( !conn.receiver )
+ conn.receiver = formwindow->tqfindAction( name );
+ }
+ } else if ( n2.tagName() == "slot" ) {
+ conn.slot = n2.firstChild().toText().data();
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( formwindow ) {
+ if ( TQT_BASE_OBJECT(conn.sender) == TQT_BASE_OBJECT(formwindow) )
+ conn.sender = TQT_TQOBJECT(formwindow->mainContainer());
+ if ( TQT_BASE_OBJECT(conn.receiver) == TQT_BASE_OBJECT(formwindow) )
+ conn.receiver = TQT_TQOBJECT(formwindow->mainContainer());
+ }
+ if ( conn.sender && conn.receiver ) {
+ if ( lang == "C++" ) {
+ MetaDataBase::addConnection( formwindow ? formwindow : toplevel,
+ conn.sender, conn.signal, conn.receiver, conn.slot );
+ }
+ }
+ } else if ( n.tagName() == "slot" ) { // compatibility with 2.x
+ MetaDataBase::Function slot;
+ slot.specifier = n.attribute( "specifier", "virtual" );
+ if ( slot.specifier.isEmpty() )
+ slot.specifier = "virtual";
+ slot.access = n.attribute( "access", "public" );
+ if ( slot.access.isEmpty() )
+ slot.access = "public";
+ slot.language = n.attribute( "language", "C++" );
+ slot.returnType = n.attribute( "returnType", "void" );
+ if ( slot.returnType.isEmpty() )
+ slot.returnType = "void";
+ slot.function = n.firstChild().toText().data();
+ if ( !MetaDataBase::hasFunction( formwindow, slot.function, TRUE ) )
+ MetaDataBase::addFunction( formwindow, slot.function, slot.specifier,
+ slot.access, "slot", slot.language, slot.returnType );
+ else
+ MetaDataBase::changeFunctionAttributes( formwindow, slot.function, slot.function,
+ slot.specifier, slot.access,
+ "slot", slot.language, slot.returnType );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::saveCustomWidgets( TQTextStream &ts, int indent )
+{
+ ts << makeIndent( indent ) << "<customwidgets>" << endl;
+ indent++;
+
+ TQPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ if ( usedCustomWidgets.tqfindIndex( w->className ) == -1 )
+ continue;
+ ts << makeIndent( indent ) << "<customwidget>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<class>" << w->className << "</class>" << endl;
+ ts << makeIndent( indent ) << "<header location=\""
+ << ( w->includePolicy == MetaDataBase::CustomWidget::Local ? "local" : "global" )
+ << "\">" << w->includeFile << "</header>" << endl;
+ ts << makeIndent( indent ) << "<sizehint>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<width>" << w->tqsizeHint.width() << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << w->tqsizeHint.height() << "</height>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizehint>" << endl;
+ ts << makeIndent( indent ) << "<container>" << (int)w->isContainer << "</container>" << endl;
+ ts << makeIndent( indent ) << "<sizepolicy>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<hordata>" << (int)w->sizePolicy.horData() << "</hordata>" << endl;
+ ts << makeIndent( indent ) << "<verdata>" << (int)w->sizePolicy.verData() << "</verdata>" << endl;
+ ts << makeIndent( indent ) << "<horstretch>" << (int)w->sizePolicy.horStretch() << "</horstretch>" << endl;
+ ts << makeIndent( indent ) << "<verstretch>" << (int)w->sizePolicy.verStretch() << "</verstretch>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizepolicy>" << endl;
+ ts << makeIndent( indent ) << "<pixmap>" << saveInCollection( TQT_TQIMAGE_OBJECT(w->pixmap->convertToImage()) ) << "</pixmap>" << endl;
+ if ( !w->lstSignals.isEmpty() ) {
+ for ( TQValueList<TQCString>::Iterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ ts << makeIndent( indent ) << "<signal>" << entitize( *it ) << "</signal>" << endl;
+ }
+ if ( !w->lstSlots.isEmpty() ) {
+ for ( TQValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it )
+ ts << makeIndent( indent ) << "<slot access=\"" << (*it).access << "\" specifier=\""
+ << (*it).specifier << "\">" << entitize( (*it).function ) << "</slot>" << endl;
+ }
+ if ( !w->lstProperties.isEmpty() ) {
+ for ( TQValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.begin(); it != w->lstProperties.end(); ++it )
+ ts << makeIndent( indent ) << "<property type=\"" << (*it).type << "\">" << entitize( (*it).property ) << "</property>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</customwidget>" << endl;
+ }
+
+
+ indent--;
+ ts << makeIndent( indent ) << "</customwidgets>" << endl;
+}
+
+void Resource::loadCustomWidgets( const TQDomElement &e, Resource *r )
+{
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "customwidget" ) {
+ TQDomElement n2 = n.firstChild().toElement();
+ MetaDataBase::CustomWidget *w = new MetaDataBase::CustomWidget;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "class" ) {
+ w->className = n2.firstChild().toText().data();
+ } else if ( n2.tagName() == "header" ) {
+ w->includeFile = n2.firstChild().toText().data();
+ TQString s = n2.attribute( "location" );
+ if ( s != "local" )
+ w->includePolicy = MetaDataBase::CustomWidget::Global;
+ else
+ w->includePolicy = MetaDataBase::CustomWidget::Local;
+ } else if ( n2.tagName() == "sizehint" ) {
+ TQDomElement n3 = n2.firstChild().toElement();
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "width" )
+ w->tqsizeHint.setWidth( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "height" )
+ w->tqsizeHint.setHeight( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ } else if ( n2.tagName() == "sizepolicy" ) {
+ TQDomElement n3 = n2.firstChild().toElement();
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hordata" )
+ w->sizePolicy.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "verdata" )
+ w->sizePolicy.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "horstretch" )
+ w->sizePolicy.setHorStretch( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "verstretch" )
+ w->sizePolicy.setVerStretch( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ } else if ( n2.tagName() == "pixmap" ) {
+ TQPixmap pix;
+ if ( r ) {
+ pix = r->loadPixmap( n2 );
+ } else {
+ TQDomElement n3 = n2.firstChild().toElement();
+ TQImage img;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "data" ) {
+ img = loadImageData( n3 );
+ }
+ n3 = n3.nextSibling().toElement();
+ }
+ pix.convertFromImage( img );
+ }
+ w->pixmap = new TQPixmap( pix );
+ } else if ( n2.tagName() == "signal" ) {
+ w->lstSignals.append( n2.firstChild().toText().data().latin1() );
+ } else if ( n2.tagName() == "container" ) {
+ w->isContainer = (bool)n2.firstChild().toText().data().toInt();
+ } else if ( n2.tagName() == "slot" ) {
+ MetaDataBase::Function function;
+ function.function = n2.firstChild().toText().data().latin1();
+ function.access = n2.attribute( "access" );
+ function.type = "slot";
+ w->lstSlots.append( function );
+ } else if ( n2.tagName() == "property" ) {
+ MetaDataBase::Property property;
+ property.property = n2.firstChild().toText().data().latin1();
+ property.type = n2.attribute( "type" );
+ w->lstProperties.append( property );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ MetaDataBase::addCustomWidget( w );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::saveTabOrder( TQTextStream &ts, int indent )
+{
+ TQWidgetList l = MetaDataBase::tabOrder( toplevel );
+ if ( l.isEmpty() )
+ return;
+
+ ts << makeIndent( indent ) << "<tabstops>" << endl;
+ indent++;
+
+ for ( TQWidget *w = l.first(); w; w = l.next() ) {
+ if ( w->testWState( TQt::WState_ForceHide ) || knownNames.tqfindIndex( w->name() ) == -1 )
+ continue;
+ ts << makeIndent( indent ) << "<tabstop>" << w->name() << "</tabstop>" << endl;
+ }
+
+ indent--;
+ ts << makeIndent( indent ) << "</tabstops>" << endl;
+}
+
+void Resource::loadTabOrder( const TQDomElement &e )
+{
+ TQWidget *last = 0;
+ TQDomElement n = e.firstChild().toElement();
+ TQWidgetList widgets;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "tabstop" ) {
+ TQString name = n.firstChild().toText().data();
+ if ( name.isEmpty() )
+ continue;
+ TQObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() ) {
+ TQWidget *w = (TQWidget*)l->first();
+ widgets.append( w );
+ if ( last )
+ toplevel->setTabOrder( last, w );
+ last = w;
+ }
+ delete l;
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( !widgets.isEmpty() )
+ MetaDataBase::setTabOrder( toplevel, widgets );
+}
+
+void Resource::saveMetaInfoBefore( TQTextStream &ts, int indent )
+{
+ MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow );
+ TQString cn;
+ if ( info.classNameChanged && !info.className.isEmpty() )
+ cn = info.className;
+ else
+ cn = formwindow->name();
+ ts << makeIndent( indent ) << "<class>" << entitize( cn ) << "</class>" << endl;
+ if ( !info.comment.isEmpty() )
+ ts << makeIndent( indent ) << "<comment>" << entitize( info.comment ) << "</comment>" << endl;
+ if ( !info.author.isEmpty() )
+ ts << makeIndent( indent ) << "<author>" << entitize( info.author ) << "</author>" << endl;
+}
+
+void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent )
+{
+ MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow );
+ if ( !langIface || formwindow->project()->isCpp() ) {
+ TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formwindow );
+ TQString extensionInclude;
+ bool needExtensionInclude = FALSE;
+ if ( langIface &&
+ formwindow->formFile()->hasFormCode() &&
+ formwindow->formFile()->codeFileState() != FormFile::Deleted ) {
+ extensionInclude = TQFileInfo( currFileName ).fileName() + langIface->formCodeExtension();
+ needExtensionInclude = TRUE;
+ }
+ if ( !includes.isEmpty() || needExtensionInclude ) {
+ ts << makeIndent( indent ) << "<includes>" << endl;
+ indent++;
+
+ for ( TQValueList<MetaDataBase::Include>::Iterator it = includes.begin(); it != includes.end(); ++it ) {
+ ts << makeIndent( indent ) << "<include location=\"" << (*it).location
+ << "\" impldecl=\"" << (*it).implDecl << "\">" << (*it).header << "</include>" << endl;
+ if ( needExtensionInclude )
+ needExtensionInclude = (*it).header != extensionInclude;
+ }
+
+ if ( needExtensionInclude )
+ ts << makeIndent( indent ) << "<include location=\"local\" impldecl=\"in implementation\">"
+ << extensionInclude << "</include>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</includes>" << endl;
+ }
+
+ TQStringList forwards = MetaDataBase::forwards( formwindow );
+ if ( !forwards.isEmpty() ) {
+ ts << makeIndent( indent ) << "<forwards>" << endl;
+ indent++;
+ for ( TQStringList::Iterator it2 = forwards.begin(); it2 != forwards.end(); ++it2 )
+ ts << makeIndent( indent ) << "<forward>" << entitize( *it2 ) << "</forward>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</forwards>" << endl;
+ }
+ TQValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( formwindow );
+ if ( !varLst.isEmpty() ) {
+ ts << makeIndent( indent ) << "<variables>" << endl;
+ indent++;
+
+ TQValueList<MetaDataBase::Variable>::Iterator it = varLst.begin();
+ for ( ; it != varLst.end(); ++it ) {
+ ts << makeIndent( indent ) << "<variable";
+ if ( (*it).varAccess != "protected" )
+ ts << " access=\"" << (*it).varAccess << "\"";
+
+ ts << ">" << entitize( (*it).varName ) << "</variable>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</variables>" << endl;
+ }
+ TQStringList sigs = MetaDataBase::signalList( formwindow );
+ if ( !sigs.isEmpty() ) {
+ ts << makeIndent( indent ) << "<Q_SIGNALS>" << endl;
+ indent++;
+ for ( TQStringList::Iterator it3 = sigs.begin(); it3 != sigs.end(); ++it3 )
+ ts << makeIndent( indent ) << "<signal>" << entitize( *it3 ) << "</signal>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</Q_SIGNALS>" << endl;
+ }
+
+ TQValueList<MetaDataBase::Function> slotList = MetaDataBase::slotList( formwindow );
+ if ( !slotList.isEmpty() ) {
+ ts << makeIndent( indent ) << "<Q_SLOTS>" << endl;
+ indent++;
+ TQString lang = formwindow->project()->language();
+ TQValueList<MetaDataBase::Function>::Iterator it = slotList.begin();
+ for ( ; it != slotList.end(); ++it ) {
+ MetaDataBase::Function function = *it;
+ ts << makeIndent( indent ) << "<slot";
+ if ( function.access != "public" )
+ ts << " access=\"" << function.access << "\"";
+ if ( function.specifier != "virtual" )
+ ts << " specifier=\"" << function.specifier << "\"";
+ if ( function.language != "C++" )
+ ts << " language=\"" << function.language<< "\"";
+ if ( function.returnType != "void" )
+ ts << " returnType=\"" << entitize( function.returnType ) << "\"";
+ ts << ">" << entitize( function.function ) << "</slot>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</Q_SLOTS>" << endl;
+ }
+
+ TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formwindow, TRUE );
+ if ( !functionList.isEmpty() ) {
+ ts << makeIndent( indent ) << "<functions>" << endl;
+ indent++;
+ TQString lang = formwindow->project()->language();
+ TQValueList<MetaDataBase::Function>::Iterator it = functionList.begin();
+ for ( ; it != functionList.end(); ++it ) {
+ MetaDataBase::Function function = *it;
+ ts << makeIndent( indent ) << "<function";
+ if ( function.access != "public" )
+ ts << " access=\"" << function.access << "\"";
+ if ( function.specifier != "virtual" )
+ ts << " specifier=\"" << function.specifier << "\"";
+ if ( function.language != "C++" )
+ ts << " language=\"" << function.language<< "\"";
+ if ( function.returnType != "void" )
+ ts << " returnType=\"" << entitize( function.returnType ) << "\"";
+ ts << ">" << entitize( function.function ) << "</function>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</functions>" << endl;
+ }
+ }
+
+ if ( formwindow && formwindow->savePixmapInline() )
+ ;
+ else if ( formwindow && formwindow->savePixmapInProject() )
+ ts << makeIndent( indent ) << "<pixmapinproject/>" << endl;
+ else
+ ts << makeIndent( indent ) << "<pixmapfunction>" << formwindow->pixmapLoaderFunction() << "</pixmapfunction>" << endl;
+ if ( !( exportMacro = MetaDataBase::exportMacro( formwindow->mainContainer() ) ).isEmpty() )
+ ts << makeIndent( indent ) << "<exportmacro>" << exportMacro << "</exportmacro>" << endl;
+ if ( formwindow ) {
+ ts << makeIndent( indent ) << "<layoutdefaults spacing=\"" << formwindow->layoutDefaultSpacing()
+ << "\" margin=\"" << formwindow->layoutDefaultMargin() << "\"/>" << endl;
+ if ( formwindow->hasLayoutFunctions() ) {
+ TQString s = "";
+ TQString m = "";
+ if ( !formwindow->spacingFunction().isEmpty() )
+ s = TQString( " spacing=\"%1\"" ).arg( formwindow->spacingFunction() );
+ if ( !formwindow->marginFunction().isEmpty() )
+ m = TQString( " margin=\"%1\"" ).arg( formwindow->marginFunction() );
+ ts << makeIndent( indent ) << "<layoutfunctions" << s << m << "/>" << endl;
+ }
+ }
+}
+
+void Resource::saveIncludeHints( TQTextStream &ts, int indent )
+{
+ if ( includeHints.isEmpty() )
+ return;
+ ts << makeIndent( indent ) << "<includehints>" << endl;
+ indent++;
+ for ( TQStringList::Iterator it = includeHints.begin(); it != includeHints.end(); ++it )
+ ts << makeIndent( indent ) << "<includehint>" << *it << "</includehint>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</includehints>" << endl;
+}
+
+TQColorGroup Resource::loadColorGroup( const TQDomElement &e )
+{
+ TQColorGroup cg;
+ int r = -1;
+ TQDomElement n = e.firstChild().toElement();
+ TQColor col;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "color" ) {
+ r++;
+ cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ } else if ( n.tagName() == "pixmap" ) {
+ TQPixmap pix = loadPixmap( n );
+ cg.setBrush( (TQColorGroup::ColorRole)r, TQBrush( col, pix ) );
+ }
+ n = n.nextSibling().toElement();
+ }
+ return cg;
+}
+
+void Resource::saveChildActions( TQAction *a, TQTextStream &ts, int indent )
+{
+ if ( a->childrenListObject().isEmpty() )
+ return;
+ TQObjectListIt it( a->childrenListObject() );
+ while ( it.current() ) {
+ TQObject *o = it.current();
+ ++it;
+ if ( !::tqqt_cast<TQAction*>(o) )
+ continue;
+ TQAction *ac = (TQAction*)o;
+ bool isGroup = ::tqqt_cast<TQActionGroup*>(ac);
+ if ( isGroup )
+ ts << makeIndent( indent ) << "<actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "<action>" << endl;
+ indent++;
+ saveObjectProperties( ac, ts, indent );
+ indent--;
+ if ( isGroup ) {
+ indent++;
+ saveChildActions( ac, ts, indent );
+ indent--;
+ }
+ if ( isGroup )
+ ts << makeIndent( indent ) << "</actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "</action>" << endl;
+ }
+}
+
+void Resource::saveActions( const TQPtrList<TQAction> &actions, TQTextStream &ts, int indent )
+{
+ if ( actions.isEmpty() )
+ return;
+ ts << makeIndent( indent ) << "<actions>" << endl;
+ indent++;
+ TQPtrListIterator<TQAction> it( actions );
+ while ( it.current() ) {
+ TQAction *a = it.current();
+ bool isGroup = ::tqqt_cast<TQActionGroup*>(a);
+ if ( isGroup )
+ ts << makeIndent( indent ) << "<actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "<action>" << endl;
+ indent++;
+ saveObjectProperties( a, ts, indent );
+ indent--;
+ if ( isGroup ) {
+ indent++;
+ saveChildActions( a, ts, indent );
+ indent--;
+ }
+ if ( isGroup )
+ ts << makeIndent( indent ) << "</actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "</action>" << endl;
+ ++it;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</actions>" << endl;
+}
+
+void Resource::loadChildAction( TQT_BASE_OBJECT_NAME *bobj, const TQDomElement &e )
+{
+ TQObject* tqparent = TQT_TQOBJECT(bobj);
+ TQDomElement n = e;
+ TQAction *a = 0;
+ if ( n.tagName() == "action" ) {
+ a = new TQDesignerAction( tqparent );
+ MetaDataBase::addEntry( a );
+ TQDomElement n2 = n.firstChild().toElement();
+ bool hasMenuText = FALSE;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ TQDomElement n3(n2); // don't modify n2
+ TQString prop = n3.attribute( "name" );
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ TQDomElement value(n3.firstChild().toElement());
+ setObjectProperty( a, prop, value );
+ if (!hasMenuText && uiFileVersion < "3.3" && prop == "text")
+ setObjectProperty( a, "menuText", value );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !::tqqt_cast<TQAction*>(tqparent) )
+ formwindow->actionList().append( a );
+ } else if ( n.tagName() == "actiongroup" ) {
+ a = new TQDesignerActionGroup( tqparent );
+ MetaDataBase::addEntry( a );
+ TQDomElement n2 = n.firstChild().toElement();
+ bool hasMenuText = FALSE;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ TQDomElement n3(n2); // don't modify n2
+ TQString prop = n3.attribute( "name" );
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ TQDomElement value = n3.firstChild().toElement();
+ setObjectProperty( a, prop, value );
+ if (!hasMenuText && uiFileVersion < "3.3" && prop == "text")
+ setObjectProperty( a, "menuText", value );
+ } else if ( n2.tagName() == "action" ||
+ n2.tagName() == "actiongroup" ) {
+ loadChildAction( a, n2 );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !::tqqt_cast<TQAction*>(tqparent) )
+ formwindow->actionList().append( a );
+ }
+}
+
+void Resource::loadActions( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" ) {
+ loadChildAction( formwindow, n );
+ } else if ( n.tagName() == "actiongroup" ) {
+ loadChildAction( formwindow, n );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent )
+{
+ ts << makeIndent( indent ) << "<toolbars>" << endl;
+ indent++;
+
+ TQPtrList<TQToolBar> tbList;
+ for ( int i = 0; i <= (int)TQt::TQt::DockMinimized; ++i ) {
+ tbList = mw->toolBars( (TQt::TQt::Dock)i );
+ if ( tbList.isEmpty() )
+ continue;
+ for ( TQToolBar *tb = tbList.first(); tb; tb = tbList.next() ) {
+ if ( tb->isHidden() )
+ continue;
+ ts << makeIndent( indent ) << "<toolbar dock=\"" << i << "\">" << endl;
+ indent++;
+ saveObjectProperties( tb, ts, indent );
+ TQPtrList<TQAction> actionList = ( (TQDesignerToolBar*)tb )->insertedActions();
+ for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
+ if ( ::tqqt_cast<TQSeparatorAction*>(a) ) {
+ ts << makeIndent( indent ) << "<separator/>" << endl;
+ } else {
+ if ( ::tqqt_cast<TQDesignerAction*>(a) && !( (TQDesignerAction*)a )->supportsMenu() ) {
+ TQWidget *w = ( (TQDesignerAction*)a )->widget();
+ ts << makeIndent( indent ) << "<widget class=\""
+ << WidgetFactory::classNameOf( w ) << "\">" << endl;
+ indent++;
+ const char *className = WidgetFactory::classNameOf( w );
+ if ( w->isA( "CustomWidget" ) )
+ usedCustomWidgets << TQString( className );
+ if ( WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ), TQT_TQOBJECT(w) ) )
+ saveItems( w, ts, indent );
+ saveObjectProperties( w, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ } else {
+ ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl;
+ }
+ }
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</toolbar>" << endl;
+ }
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</toolbars>" << endl;
+}
+
+void Resource::saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent )
+{
+ MenuBarEditor *mb = (MenuBarEditor *)mw->child( 0, "MenuBarEditor" );
+ if ( !mb )
+ return;
+ ts << makeIndent( indent ) << "<menubar>" << endl;
+ indent++;
+ MetaDataBase::setPropertyChanged( mb, "name", TRUE ); // FIXME: remove
+ saveObjectProperties( mb, ts, indent );
+
+ for ( int i = 0; i < (int)mb->count(); ++i ) {
+ MenuBarEditorItem *m = mb->item( i );
+ if ( !m )
+ continue;
+ if ( m->isSeparator() ) {
+ ts << makeIndent( indent ) << "<separator/>" << endl;
+ } else {
+ ts << makeIndent( indent ) << "<item text=\"" << entitize( m->menuText() )
+ << "\" name=\"" << entitize( m->menu()->name() ) << "\">" << endl;
+ indent++;
+ savePopupMenu( m->menu(), mw, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</menubar>" << endl;
+}
+
+void Resource::savePopupMenu( PopupMenuEditor *pm, TQMainWindow *mw, TQTextStream &ts, int indent )
+{
+ for ( PopupMenuEditorItem *i = pm->items()->first(); i; i = pm->items()->next() ) {
+ TQAction *a = i->action();
+ if ( ::tqqt_cast<TQSeparatorAction*>(a) )
+ ts << makeIndent( indent ) << "<separator/>" << endl;
+ else if ( ::tqqt_cast<TQDesignerAction*>(a) )
+ ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl;
+ else if ( ::tqqt_cast<TQDesignerActionGroup*>(a) )
+ ts << makeIndent( indent ) << "<actiongroup name=\"" << a->name() << "\"/>" << endl;
+ PopupMenuEditor *s = i->subMenu();
+ if ( s && s->count() ) {
+ TQString n = s->name();
+ ts << makeIndent( indent ) << "<item text=\"" << entitize( a->menuText() )
+ << "\" name=\"" << entitize( n )
+ << "\" accel=\"" << entitize( a->accel() )
+ << "\">" << endl;
+ indent++;
+ savePopupMenu( s, mw, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ }
+}
+
+void Resource::loadToolBars( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ TQMainWindow *mw = ( (TQMainWindow*)formwindow->mainContainer() );
+ TQDesignerToolBar *tb = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "toolbar" ) {
+ TQt::TQt::Dock dock = (TQt::TQt::Dock)n.attribute( "dock" ).toInt();
+ tb = new TQDesignerToolBar( mw, dock );
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "action" ) {
+ TQAction *a = formwindow->tqfindAction( n2.attribute( "name" ) );
+ if ( a ) {
+ a->addTo( tb );
+ tb->addAction( a );
+ }
+ } else if ( n2.tagName() == "separator" ) {
+ TQAction *a = new TQSeparatorAction( 0 );
+ a->addTo( tb );
+ tb->addAction( a );
+ } else if ( n2.tagName() == "widget" ) {
+ TQWidget *w = (TQWidget*)createObject( n2, tb );
+ TQDesignerAction *a = new TQDesignerAction( w, TQT_TQOBJECT(tb) );
+ a->addTo( tb );
+ tb->addAction( a );
+ tb->installEventFilters( w );
+ } else if ( n2.tagName() == "property" ) {
+ setObjectProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::loadMenuBar( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ TQMainWindow *mw = (TQMainWindow*)formwindow->mainContainer();
+ MenuBarEditor *mb = new MenuBarEditor( formwindow, mw );
+ MetaDataBase::addEntry( mb );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "item" ) {
+ PopupMenuEditor * popup = new PopupMenuEditor( formwindow, mw );
+ loadPopupMenu( popup, n );
+ popup->setName( n.attribute( "name" ) );
+ mb->insertItem( n.attribute( "text" ), popup );
+ MetaDataBase::addEntry( popup );
+ } else if ( n.tagName() == "property" ) {
+ setObjectProperty( mb, n.attribute( "name" ), n.firstChild().toElement() );
+ } else if ( n.tagName() == "separator" ) {
+ mb->insertSeparator();
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::loadPopupMenu( PopupMenuEditor *p, const TQDomElement &e )
+{
+ MetaDataBase::addEntry( p );
+ TQDomElement n = e.firstChild().toElement();
+ TQAction *a = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" || n.tagName() == "actiongroup") {
+ a = formwindow->tqfindAction( n.attribute( "name" ) );
+ if ( a )
+ p->insert( a );
+ }
+ if ( n.tagName() == "item" ) {
+ PopupMenuEditorItem *i = p->at( p->tqfind( a ) );
+ if ( i ) {
+ TQString name = n.attribute( "name" );
+ formwindow->unify( i, name, TRUE );
+ i->setName( name );
+ MetaDataBase::addEntry( i );
+ loadPopupMenu( i->subMenu(), n );
+ }
+ } else if ( n.tagName() == "separator" ) {
+ a = new TQSeparatorAction( 0 );
+ p->insert( a );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+bool Resource::saveFormCode( FormFile *formfile, LanguageInterface * /*langIface*/ )
+{
+ TQString lang = formfile->project()->language();
+ if ( formfile->hasTempFileName() ||
+ formfile->code().isEmpty() ||
+ !formfile->hasFormCode() ||
+ !formfile->isModified(FormFile::WFormCode) )
+ return TRUE; // There is no code to be saved.
+ return saveCode( formfile->project()->makeAbsolute(formfile->codeFile()),
+ formfile->code() );
+}
+
+void Resource::loadExtraSource( FormFile *formfile, const TQString &currFileName,
+ LanguageInterface *langIface, bool hasFunctions )
+{
+ TQString lang = "TQt Script";
+ if ( MainWindow::self )
+ lang = MainWindow::self->currProject()->language();
+ LanguageInterface *iface = langIface;
+ if ( hasFunctions || !iface )
+ return;
+ TQValueList<LanguageInterface::Function> functions;
+ TQStringList forwards;
+ TQStringList includesImpl;
+ TQStringList includesDecl;
+ TQStringList vars;
+ TQValueList<LanguageInterface::Connection> connections;
+
+ iface->loadFormCode( formfile->formName(),
+ currFileName + iface->formCodeExtension(),
+ functions,
+ vars,
+ connections );
+
+ TQFile f( formfile->project()->makeAbsolute( formfile->codeFile() ) );
+ TQString code;
+ if ( f.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &f );
+ code = ts.read();
+ }
+ formfile->setCode( code );
+
+ if ( !MainWindow::self || !MainWindow::self->currProject()->isCpp() )
+ MetaDataBase::setupConnections( formfile, connections );
+
+ for ( TQValueList<LanguageInterface::Function>::Iterator fit = functions.begin();
+ fit != functions.end(); ++fit ) {
+
+ if ( MetaDataBase::hasFunction( formfile->formWindow() ?
+ (TQObject*)formfile->formWindow() :
+ (TQObject*)formfile,
+ (*fit).name.latin1() ) ) {
+ TQString access = (*fit).access;
+ if ( !MainWindow::self || !MainWindow::self->currProject()->isCpp() )
+ MetaDataBase::changeFunction( formfile->formWindow() ?
+ (TQObject*)formfile->formWindow() :
+ (TQObject*)formfile,
+ (*fit).name,
+ (*fit).name,
+ TQString() );
+ } else {
+ TQString access = (*fit).access;
+ if ( access.isEmpty() )
+ access = "protected";
+ TQString type = "function";
+ if ( (*fit).returnType == "void" )
+ type = "slot";
+ MetaDataBase::addFunction( formfile->formWindow() ?
+ (TQObject*)formfile->formWindow() :
+ (TQObject*)formfile,
+ (*fit).name.latin1(), "virtual", (*fit).access,
+ type, lang, (*fit).returnType );
+ }
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/resource.h b/tqtinterface/qt4/tools/designer/designer/resource.h
new file mode 100644
index 0000000..e506fe7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/resource.h
@@ -0,0 +1,172 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef RESOURCE_H
+#define RESOURCE_H
+
+#include <tqstring.h>
+#include <tqtextstream.h>
+#include <tqvariant.h>
+#include <tqvaluelist.h>
+#include <tqimage.h>
+#include "actiondnd.h"
+
+#include "metadatabase.h"
+
+class TQWidget;
+class TQObject;
+class TQLayout;
+class TQStyle;
+class TQPalette;
+class FormWindow;
+class MainWindow;
+class TQDomElement;
+class TQDesignerGridLayout;
+class TQListViewItem;
+class TQMainWindow;
+struct LanguageInterface;
+class FormFile;
+class Project;
+class PopupMenuEditor;
+
+class Resource
+{
+public:
+ struct Image {
+ TQImage img;
+ TQString name;
+ bool operator==( const Image &i ) const {
+ return ( i.name == name &&
+ i.img == img );
+ }
+ };
+
+ Resource();
+ Resource( MainWindow* mw );
+ ~Resource();
+
+ void setWidget( FormWindow *w );
+ TQWidget *widget() const;
+
+ bool load( FormFile *ff, Project *defProject = 0 );
+ bool load( FormFile *ff, TQIODevice*, Project *defProject = 0 );
+ TQString copy();
+
+ bool save( const TQString& filename, bool formCodeOnly = FALSE);
+ bool save( TQIODevice* );
+ void paste( const TQString &cb, TQWidget *tqparent );
+
+ static void saveImageData( const TQImage &img, TQTextStream &ts, int indent );
+ static void loadCustomWidgets( const TQDomElement &e, Resource *r );
+ static void loadExtraSource( FormFile *formfile, const TQString &currFileName,
+ LanguageInterface *langIface, bool hasFunctions );
+ static bool saveFormCode( FormFile *formfile, LanguageInterface *langIface );
+
+private:
+ void saveObject( TQT_BASE_OBJECT_NAME *obj, TQDesignerGridLayout* grid, TQTextStream &ts, int indent );
+ void saveChildrenOf( TQT_BASE_OBJECT_NAME* obj, TQTextStream &ts, int indent );
+ void saveObjectProperties( TQT_BASE_OBJECT_NAME *w, TQTextStream &ts, int indent );
+ void saveSetProperty( TQT_BASE_OBJECT_NAME *w, const TQString &name, TQVariant::Type t, TQTextStream &ts, int indent );
+ void saveEnumProperty( TQT_BASE_OBJECT_NAME *w, const TQString &name, TQVariant::Type t, TQTextStream &ts, int indent );
+ void saveProperty( TQT_BASE_OBJECT_NAME *w, const TQString &name, const TQVariant &value, TQVariant::Type t, TQTextStream &ts, int indent );
+ void saveProperty( const TQVariant &value, TQTextStream &ts, int indent );
+ void saveItems( TQT_BASE_OBJECT_NAME *obj, TQTextStream &ts, int indent );
+ void saveItem( const TQStringList &text, const TQPtrList<TQPixmap> &pixmaps, TQTextStream &ts, int indent );
+ void saveItem( TQListViewItem *i, TQTextStream &ts, int indent );
+ void saveConnections( TQTextStream &ts, int indent );
+ void saveCustomWidgets( TQTextStream &ts, int indent );
+ void saveTabOrder( TQTextStream &ts, int indent );
+ void saveColorGroup( TQTextStream &ts, int indent, const TQColorGroup &cg );
+ void saveColor( TQTextStream &ts, int indent, const TQColor &c );
+ void saveMetaInfoBefore( TQTextStream &ts, int indent );
+ void saveMetaInfoAfter( TQTextStream &ts, int indent );
+ void saveIncludeHints( TQTextStream &ts, int indent );
+ void savePixmap( const TQPixmap &p, TQTextStream &ts, int indent, const TQString &tagname = "pixmap" );
+ void saveActions( const TQPtrList<TQAction> &actions, TQTextStream &ts, int indent );
+ void saveChildActions( TQAction *a, TQTextStream &ts, int indent );
+ void saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent );
+ void saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent );
+ void savePopupMenu( PopupMenuEditor *pm, TQMainWindow *mw, TQTextStream &ts, int indent );
+
+ TQObject *createObject( const TQDomElement &e, TQWidget *tqparent, TQLayout* tqlayout = 0 );
+ TQWidget *createSpacer( const TQDomElement &e, TQWidget *tqparent, TQLayout *tqlayout, Qt::Orientation o );
+ void createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i = 0 );
+ void createColumn( const TQDomElement &e, TQWidget *widget );
+ void setObjectProperty( TQT_BASE_OBJECT_NAME* widget, const TQString &prop, const TQDomElement &e);
+ TQString saveInCollection( const TQImage &img );
+ TQString saveInCollection( const TQPixmap &pix ) { return saveInCollection( TQT_TQIMAGE_OBJECT(pix.convertToImage()) ); }
+ TQImage loadFromCollection( const TQString &name );
+ void saveImageCollection( TQTextStream &ts, int indent );
+ void loadImageCollection( const TQDomElement &e );
+ void loadConnections( const TQDomElement &e );
+ void loadTabOrder( const TQDomElement &e );
+ void loadItem( const TQDomElement &n, TQPixmap &pix, TQString &txt, bool &hasPixmap );
+ void loadActions( const TQDomElement &n );
+ void loadChildAction( TQT_BASE_OBJECT_NAME *tqparent, const TQDomElement &e );
+ void loadToolBars( const TQDomElement &n );
+ void loadMenuBar( const TQDomElement &n );
+ void loadPopupMenu( PopupMenuEditor *pm, const TQDomElement &e );
+ TQColorGroup loadColorGroup( const TQDomElement &e );
+ TQPixmap loadPixmap( const TQDomElement &e, const TQString &tagname = "pixmap" );
+
+private:
+ MainWindow *mainwindow;
+ FormWindow *formwindow;
+ TQWidget* toplevel;
+ TQValueList<Image> images;
+ bool copying, pasting;
+ bool mainContainerSet;
+ TQStringList knownNames;
+ TQStringList usedCustomWidgets;
+ TQListViewItem *lastItem;
+
+ TQValueList<MetaDataBase::Include> metaIncludes;
+ TQValueList<MetaDataBase::Variable> metaVariables;
+ TQStringList metaForwards;
+ TQStringList metaSignals;
+ MetaDataBase::MetaInfo metaInfo;
+ TQMap<TQString, TQString> dbControls;
+ TQMap<TQString, TQStringList> dbTables;
+ TQMap<TQString, TQWidget*> widgets;
+ TQString exportMacro;
+ bool hadGeometry;
+ TQMap<TQString, TQValueList<MetaDataBase::Connection> > langConnections;
+ TQString currFileName;
+ LanguageInterface *langIface;
+ bool hasFunctions;
+ TQStringList includeHints;
+
+ TQString uiFileVersion;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui b/tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui
new file mode 100644
index 0000000..bfa704b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui
@@ -0,0 +1,354 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>RichTextFontDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2002-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>RichTextFontDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>255</width>
+ <height>158</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Font Properties</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQComboBox" row="0" column="1" rowspan="1" colspan="2">
+ <item>
+ <property name="text">
+ <string>default</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>fontCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Font:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fontCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Rel. &amp;Size:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fontSizeCombo</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <property name="name">
+ <cstring>Spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;olor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colorButton</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1" rowspan="1" colspan="2">
+ <item>
+ <property name="text">
+ <string>0</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-4</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-3</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-2</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+2</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+3</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+4</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>fontSizeCombo</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>AtTop</enum>
+ </property>
+ </widget>
+ <widget class="TQToolButton" row="2" column="1">
+ <property name="name">
+ <cstring>colorButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer14</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="Line" row="2" column="0">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout15</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>colorButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RichTextFontDialog</receiver>
+ <slot>selectColor()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RichTextFontDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RichTextFontDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>fontCombo</tabstop>
+ <tabstop>fontSizeCombo</tabstop>
+ <tabstop>colorButton</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">richtextfontdialog.ui.h</include>
+</includes>
+<variables>
+ <variable>TQString font</variable>
+ <variable>TQColor color</variable>
+ <variable>TQString size</variable>
+</variables>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>selectColor()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+ <slot returnType="TQString">getSize()</slot>
+ <slot returnType="TQString">getColor()</slot>
+ <slot returnType="TQString">getFont()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui.h b/tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui.h
new file mode 100644
index 0000000..6dfc43c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/richtextfontdialog.ui.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename Q_SLOTS use TQt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+#include <tqcolordialog.h>
+#include <tqfontdatabase.h>
+
+void RichTextFontDialog::init()
+{
+ TQFontDatabase *db = new TQFontDatabase();
+ fontCombo->insertStringList( TQT_TQSTRINGLIST_OBJECT(db->families()) );
+}
+
+void RichTextFontDialog::selectColor()
+{
+ color = TQColorDialog::getColor( "", this );
+ if( color.isValid() )
+ colorButton->setPaletteBackgroundColor( color );
+}
+
+void RichTextFontDialog::accept()
+{
+ size = fontSizeCombo->currentText();
+ font = fontCombo->currentText();
+ done( Accepted );
+}
+
+void RichTextFontDialog::reject()
+{
+ done( Rejected );
+}
+
+TQString RichTextFontDialog::getSize()
+{
+ return size;
+}
+
+TQString RichTextFontDialog::getColor()
+{
+ return color.name();
+}
+
+TQString RichTextFontDialog::getFont()
+{
+ return font;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/sizehandle.cpp b/tqtinterface/qt4/tools/designer/designer/sizehandle.cpp
new file mode 100644
index 0000000..f0c6ef3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/sizehandle.cpp
@@ -0,0 +1,394 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvariant.h> // HP-UX compiler needs this here
+
+#include "sizehandle.h"
+#include "formwindow.h"
+#include "widgetfactory.h"
+
+#include <tqwidget.h>
+#include <tqapplication.h>
+#include <tqlabel.h>
+
+SizeHandle::SizeHandle( FormWindow *tqparent, Direction d, WidgetSelection *s )
+ : TQWidget( tqparent )
+{
+ active = TRUE;
+ setBackgroundMode( active ? TQt::PaletteText : TQt::PaletteDark );
+ setFixedSize( 6, 6 );
+ widget = 0;
+ dir =d ;
+ setMouseTracking( FALSE );
+ formWindow = tqparent;
+ sel = s;
+ updateCursor();
+}
+
+void SizeHandle::updateCursor()
+{
+ if ( !active ) {
+ setCursor( tqarrowCursor );
+ return;
+ }
+
+ switch ( dir ) {
+ case LeftTop:
+ setCursor( tqsizeFDiagCursor );
+ break;
+ case Top:
+ setCursor( tqsizeVerCursor );
+ break;
+ case RightTop:
+ setCursor( tqsizeBDiagCursor );
+ break;
+ case Right:
+ setCursor( tqsizeHorCursor );
+ break;
+ case RightBottom:
+ setCursor( tqsizeFDiagCursor );
+ break;
+ case Bottom:
+ setCursor( tqsizeVerCursor );
+ break;
+ case LeftBottom:
+ setCursor( tqsizeBDiagCursor );
+ break;
+ case Left:
+ setCursor( tqsizeHorCursor );
+ break;
+ }
+}
+
+void SizeHandle::setActive( bool a )
+{
+ active = a;
+ setBackgroundMode( active ? TQt::PaletteText : TQt::PaletteDark );
+ updateCursor();
+}
+
+void SizeHandle::setWidget( TQWidget *w )
+{
+ widget = w;
+}
+
+void SizeHandle::paintEvent( TQPaintEvent * )
+{
+ if ( ( (FormWindow*)parentWidget() )->currentWidget() != widget )
+ return;
+ TQPainter p( this );
+ p.setPen( Qt::blue );
+ p.drawRect( 0, 0, width(), height() );
+}
+
+void SizeHandle::mousePressEvent( TQMouseEvent *e )
+{
+ if ( !widget || e->button() != Qt::LeftButton || !active )
+ return;
+ oldPressPos = e->pos();
+ geom = origGeom = TQRect( widget->pos(), widget->size() );
+}
+
+void SizeHandle::mouseMoveEvent( TQMouseEvent *e )
+{
+ if ( !widget || ( e->state() & Qt::LeftButton ) != Qt::LeftButton || !active )
+ return;
+ TQPoint rp = mapFromGlobal( e->globalPos() );
+ TQPoint d = oldPressPos - rp;
+ oldPressPos = rp;
+ TQPoint checkPos = widget->parentWidget()->mapFromGlobal( e->globalPos() );
+ TQRect pr = widget->parentWidget()->rect();
+
+ // ##### move code around a bit to reduce duplicated code here
+ switch ( dir ) {
+ case LeftTop: {
+ if ( checkPos.x() > pr.width() - 2 * width() || checkPos.y() > pr.height() - 2 * height() )
+ return;
+ int w = geom.width() + d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int h = geom.height() + d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ int dx = widget->width() - w;
+ int dy = widget->height() - h;
+ trySetGeometry( widget, widget->x() + dx, widget->y() + dy, w, h );
+ } break;
+ case Top: {
+ if ( checkPos.y() > pr.height() - 2 * height() )
+ return;
+ int h = geom.height() + d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ int dy = widget->height() - h;
+ trySetGeometry( widget, widget->x(), widget->y() + dy, widget->width(), h );
+ } break;
+ case RightTop: {
+ if ( checkPos.x() < 2 * width() || checkPos.y() > pr.height() - 2 * height() )
+ return;
+ int h = geom.height() + d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ int dy = widget->height() - h;
+ int w = geom.width() - d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ trySetGeometry( widget, widget->x(), widget->y() + dy, w, h );
+ } break;
+ case Right: {
+ if ( checkPos.x() < 2 * width() )
+ return;
+ int w = geom.width() - d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ tryResize( widget, w, widget->height() );
+ } break;
+ case RightBottom: {
+ if ( checkPos.x() < 2 * width() || checkPos.y() < 2 * height() )
+ return;
+ int w = geom.width() - d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int h = geom.height() - d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ tryResize( widget, w, h );
+ } break;
+ case Bottom: {
+ if ( checkPos.y() < 2 * height() )
+ return;
+ int h = geom.height() - d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ tryResize( widget, widget->width(), h );
+ } break;
+ case LeftBottom: {
+ if ( checkPos.x() > pr.width() - 2 * width() || checkPos.y() < 2 * height() )
+ return;
+ int w = geom.width() + d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int dx = widget->width() - w;
+ int h = geom.height() - d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ trySetGeometry( widget, widget->x() + dx, widget->y(), w, h );
+ } break;
+ case Left: {
+ if ( checkPos.x() > pr.width() - 2 * width() )
+ return;
+ int w = geom.width() + d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int dx = widget->width() - w;
+ trySetGeometry( widget, widget->x() + dx, widget->y(), w, widget->height() );
+ } break;
+ }
+
+ TQPoint p = pos();
+ sel->updateGeometry();
+ oldPressPos += ( p - pos() );
+
+ formWindow->sizePreview()->setText( tr( "%1/%2" ).arg( widget->width() ).arg( widget->height() ) );
+ formWindow->sizePreview()->adjustSize();
+ TQRect lg( formWindow->mapFromGlobal( e->globalPos() ) + TQPoint( 16, 16 ),
+ formWindow->sizePreview()->size() );
+ formWindow->checkPreviewGeometry( lg );
+ formWindow->sizePreview()->setGeometry( lg );
+ formWindow->sizePreview()->show();
+ formWindow->sizePreview()->raise();
+ if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout )
+ formWindow->updateChildSelections( widget );
+}
+
+void SizeHandle::mouseReleaseEvent( TQMouseEvent *e )
+{
+ if ( e->button() != Qt::LeftButton || !active )
+ return;
+
+ formWindow->sizePreview()->hide();
+ if ( geom != widget->tqgeometry() )
+ formWindow->commandHistory()->addCommand( new ResizeCommand( tr( "Resize" ),
+ formWindow,
+ widget, origGeom,
+ widget->tqgeometry() ) );
+ formWindow->emitUpdateProperties( widget );
+}
+
+void SizeHandle::trySetGeometry( TQWidget *w, int x, int y, int width, int height )
+{
+ int minw = TQMAX( w->tqminimumSizeHint().width(), w->tqminimumSize().width() );
+ minw = TQMAX( minw, 2 * formWindow->grid().x() );
+ int minh = TQMAX( w->tqminimumSizeHint().height(), w->tqminimumSize().height() );
+ minh = TQMAX( minh, 2 * formWindow->grid().y() );
+ if ( TQMAX( minw, width ) > w->maximumWidth() ||
+ TQMAX( minh, height ) > w->maximumHeight() )
+ return;
+ if ( width < minw && x != w->x() )
+ x -= minw - width;
+ if ( height < minh && y != w->y() )
+ y -= minh - height;
+ w->setGeometry( x, y, TQMAX( minw, width ), TQMAX( minh, height ) );
+}
+
+void SizeHandle::tryResize( TQWidget *w, int width, int height )
+{
+ int minw = TQMAX( w->tqminimumSizeHint().width(), w->tqminimumSize().width() );
+ minw = TQMAX( minw, 16 );
+ int minh = TQMAX( w->tqminimumSizeHint().height(), w->tqminimumSize().height() );
+ minh = TQMAX( minh, 16 );
+ w->resize( TQMAX( minw, width ), TQMAX( minh, height ) );
+}
+
+// ------------------------------------------------------------------------
+
+WidgetSelection::WidgetSelection( FormWindow *tqparent, TQPtrDict<WidgetSelection> *selDict )
+ : selectionDict( selDict )
+{
+ formWindow = tqparent;
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ handles.insert( i, new SizeHandle( formWindow, (SizeHandle::Direction)i, this ) );
+ }
+ hide();
+}
+
+void WidgetSelection::setWidget( TQWidget *w, bool updateDict )
+{
+ if ( !w ) {
+ hide();
+ if ( updateDict )
+ selectionDict->remove( wid );
+ wid = 0;
+ return;
+ }
+
+ wid = w;
+ bool active = !wid->parentWidget() || WidgetFactory::layoutType( wid->parentWidget() ) == WidgetFactory::NoLayout;
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h ) {
+ h->setWidget( wid );
+ h->setActive( active );
+ }
+ }
+ updateGeometry();
+ show();
+ if ( updateDict )
+ selectionDict->insert( w, this );
+}
+
+bool WidgetSelection::isUsed() const
+{
+ return wid != 0;
+}
+
+void WidgetSelection::updateGeometry()
+{
+ if ( !wid || !wid->parentWidget() )
+ return;
+
+ TQPoint p = wid->parentWidget()->mapToGlobal( wid->pos() );
+ p = formWindow->mapFromGlobal( p );
+ TQRect r( p, wid->size() );
+
+ int w = 6;
+ int h = 6;
+
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *hndl = handles[ i ];
+ if ( !hndl )
+ continue;
+ switch ( i ) {
+ case SizeHandle::LeftTop:
+ hndl->move( r.x() - w / 2, r.y() - h / 2 );
+ break;
+ case SizeHandle::Top:
+ hndl->move( r.x() + r.width() / 2 - w / 2, r.y() - h / 2 );
+ break;
+ case SizeHandle::RightTop:
+ hndl->move( r.x() + r.width() - w / 2, r.y() - h / 2 );
+ break;
+ case SizeHandle::Right:
+ hndl->move( r.x() + r.width() - w / 2, r.y() + r.height() / 2 - h / 2 );
+ break;
+ case SizeHandle::RightBottom:
+ hndl->move( r.x() + r.width() - w / 2, r.y() + r.height() - h / 2 );
+ break;
+ case SizeHandle::Bottom:
+ hndl->move( r.x() + r.width() / 2 - w / 2, r.y() + r.height() - h / 2 );
+ break;
+ case SizeHandle::LeftBottom:
+ hndl->move( r.x() - w / 2, r.y() + r.height() - h / 2 );
+ break;
+ case SizeHandle::Left:
+ hndl->move( r.x() - w / 2, r.y() + r.height() / 2 - h / 2 );
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void WidgetSelection::hide()
+{
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h )
+ h->hide();
+ }
+}
+
+void WidgetSelection::show()
+{
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h ) {
+ h->show();
+ h->raise();
+ }
+ }
+}
+
+void WidgetSelection::update()
+{
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h )
+ h->update();
+ }
+}
+
+TQWidget *WidgetSelection::widget() const
+{
+ return wid;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/sizehandle.h b/tqtinterface/qt4/tools/designer/designer/sizehandle.h
new file mode 100644
index 0000000..2f3ce9f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/sizehandle.h
@@ -0,0 +1,105 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SIZEHANDLE_H
+#define SIZEHANDLE_H
+
+#include <tqwidget.h>
+#include <tqintdict.h>
+#include <tqptrdict.h>
+
+class TQMouseEvent;
+class FormWindow;
+class WidgetSelection;
+class TQPaintEvent;
+
+class SizeHandle : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ enum Direction { LeftTop, Top, RightTop, Right, RightBottom, Bottom, LeftBottom, Left };
+
+ SizeHandle( FormWindow *tqparent, Direction d, WidgetSelection *s );
+ void setWidget( TQWidget *w );
+ void setActive( bool a );
+ void updateCursor();
+
+ void setEnabled( bool ) {}
+
+protected:
+ void paintEvent( TQPaintEvent *e );
+ void mousePressEvent( TQMouseEvent *e );
+ void mouseMoveEvent( TQMouseEvent *e );
+ void mouseReleaseEvent( TQMouseEvent *e );
+
+private:
+ void trySetGeometry( TQWidget *w, int x, int y, int width, int height );
+ void tryResize( TQWidget *w, int width, int height );
+
+private:
+ TQWidget *widget;
+ Direction dir;
+ TQPoint oldPressPos;
+ FormWindow *formWindow;
+ WidgetSelection *sel;
+ TQRect geom, origGeom;
+ bool active;
+
+};
+
+class WidgetSelection
+{
+public:
+ WidgetSelection( FormWindow *tqparent, TQPtrDict<WidgetSelection> *selDict );
+
+ void setWidget( TQWidget *w, bool updateDict = TRUE );
+ bool isUsed() const;
+
+ void updateGeometry();
+ void hide();
+ void show();
+ void update();
+
+ TQWidget *widget() const;
+
+protected:
+ TQIntDict<SizeHandle> handles;
+ TQWidget *wid;
+ FormWindow *formWindow;
+ TQPtrDict<WidgetSelection> *selectionDict;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/sourceeditor.cpp b/tqtinterface/qt4/tools/designer/designer/sourceeditor.cpp
new file mode 100644
index 0000000..1f147ab
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/sourceeditor.cpp
@@ -0,0 +1,325 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "sourceeditor.h"
+
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "project.h"
+#include "mainwindow.h"
+#include "../interfaces/languageinterface.h"
+#include <tqregexp.h>
+#include "project.h"
+#include "sourcefile.h"
+#include "hierarchyview.h"
+#include <tqmessagebox.h>
+#include <tqtextstream.h>
+
+SourceEditor::SourceEditor( TQWidget *tqparent, EditorInterface *iface, LanguageInterface *liface )
+ : TQVBox( tqparent, 0, (WFlags)TQt::WDestructiveClose ), iFace( iface ), lIface( liface ), obj( 0 ), pro( 0 )
+{
+ iFace->addRef();
+ lIface->addRef();
+ editor = iFace->editor( MainWindow::self->areEditorsReadOnly(),
+ this, MainWindow::self->designerInterface() );
+ iFace->onBreakPointChange( TQT_TQOBJECT(MainWindow::self), TQT_SLOT( breakPointsChanged() ) );
+ resize( 600, 400 );
+ setIcon( TQPixmap::fromMimeSource( "designer_filenew.png" ) );
+}
+
+SourceEditor::~SourceEditor()
+{
+ saveBreakPoints();
+ editor = 0;
+ if ( formWindow() ) {
+ formWindow()->formFile()->setCodeEdited( FALSE );
+ formWindow()->formFile()->setEditor( 0 );
+ } else if ( sourceFile() ) {
+ sourceFile()->setEditor( 0 );
+ if ( MainWindow::self->objectHierarchy()->sourceEditor() == this )
+ MainWindow::self->objectHierarchy()->setFormWindow( 0, 0 );
+ }
+ iFace->release();
+ lIface->release();
+ MainWindow::self->editorClosed( this );
+}
+
+void SourceEditor::setObject( TQObject *o, Project *p )
+{
+ if ( sourceFile() )
+ sourceFile()->setEditor( 0 );
+ if ( formWindow() ) {
+ formWindow()->formFile()->setCodeEdited( FALSE );
+ formWindow()->formFile()->setEditor( 0 );
+ }
+ if ( ::tqqt_cast<FormWindow*>(o) )
+ ( (FormWindow*)o )->formFile()->setCodeEdited( TRUE );
+ save();
+ bool changed = FALSE;
+ if ( &(*obj) != o ) {
+ saveBreakPoints();
+ changed = TRUE;
+ }
+ obj = o;
+ pro = p;
+ if ( formWindow() ) {
+ if ( formWindow()->isFake() )
+ setCaption( formWindow()->project()->objectForFakeForm( formWindow() )->name() );
+ else
+ setCaption( obj->name() );
+ } else {
+ setCaption( sourceFile()->fileName() );
+ }
+ if ( sourceFile() )
+ sourceFile()->setEditor( this );
+ else if ( formWindow() )
+ formWindow()->formFile()->setEditor( this );
+ iFace->setText( sourceOfObject( obj, lang, iFace, lIface ) );
+ if ( pro && formWindow() ) {
+ if ( formWindow()->isFake() )
+ iFace->setContext( pro->objectForFakeFormFile( formWindow()->formFile() ) );
+ else
+ iFace->setContext( TQT_TQOBJECT(formWindow()->mainContainer()) );
+ } else {
+ iFace->setContext( 0 );
+ }
+ if ( changed || sourceFile() )
+ iFace->setBreakPoints( MetaDataBase::breakPoints( o ) );
+ MainWindow::self->objectHierarchy()->showClasses( this );
+}
+
+TQString SourceEditor::sourceOfObject( TQObject *o, const TQString &,
+ EditorInterface *, LanguageInterface * )
+{
+ TQString txt;
+ if ( !o )
+ return txt;
+ if ( ::tqqt_cast<FormWindow*>(o) )
+ txt = ( (FormWindow*)o )->formFile()->code();
+ else if ( ::tqqt_cast<SourceFile*>(o) )
+ txt = ( (SourceFile*)o )->text();
+ return txt;
+}
+
+void SourceEditor::setFunction( const TQString &func, const TQString &clss )
+{
+ iFace->scrollTo( lIface->createFunctionStart( obj->name(), func, "", "" ), clss );
+}
+
+void SourceEditor::setClass( const TQString &clss )
+{
+ iFace->scrollTo( clss, TQString() );
+}
+
+void SourceEditor::closeEvent( TQCloseEvent *e )
+{
+ e->accept();
+ if ( !obj )
+ return;
+ if ( formWindow() ) {
+ save();
+ formWindow()->formFile()->cm = formWindow()->formFile()->isModified();
+ } else {
+ if ( !sourceFile()->closeEvent() )
+ e->ignore();
+ }
+}
+
+void SourceEditor::save()
+{
+ if ( !obj )
+ return;
+ if ( formWindow() )
+ formWindow()->formFile()->syncCode();
+ else if ( sourceFile() && sourceFile()->editor() )
+ sourceFile()->setText( iFace->text() );
+}
+
+TQString SourceEditor::language() const
+{
+ return lang;
+}
+
+void SourceEditor::setLanguage( const TQString &l )
+{
+ lang = l;
+}
+
+void SourceEditor::editCut()
+{
+ iFace->cut();
+}
+
+void SourceEditor::editCopy()
+{
+ iFace->copy();
+}
+
+void SourceEditor::editPaste()
+{
+ iFace->paste();
+}
+
+bool SourceEditor::editIsUndoAvailable()
+{
+ return iFace->isUndoAvailable();
+}
+
+bool SourceEditor::editIsRedoAvailable()
+{
+ return iFace->isRedoAvailable();
+}
+
+void SourceEditor::editUndo()
+{
+ iFace->undo();
+}
+
+void SourceEditor::editRedo()
+{
+ iFace->redo();
+}
+
+void SourceEditor::editSelectAll()
+{
+ iFace->selectAll();
+}
+
+void SourceEditor::configChanged()
+{
+ iFace->readSettings();
+}
+
+void SourceEditor::setModified( bool b )
+{
+ iFace->setModified( b );
+}
+
+void SourceEditor::refresh( bool allowSave )
+{
+ if ( allowSave )
+ save();
+ bool oldMod = iFace->isModified();
+ iFace->setText( sourceOfObject( obj, lang, iFace, lIface ) );
+ iFace->setModified( oldMod );
+}
+
+void SourceEditor::resetContext()
+{
+ if ( pro && formWindow() ) {
+ if ( formWindow()->isFake() )
+ iFace->setContext( pro->objectForFakeFormFile( formWindow()->formFile() ) );
+ else
+ iFace->setContext( TQT_TQOBJECT(formWindow()->mainContainer()) );
+ } else {
+ iFace->setContext( 0 );
+ }
+}
+
+void SourceEditor::setFocus()
+{
+ if ( formWindow() )
+ formWindow()->formFile()->setCodeEdited( TRUE );
+ if ( editor )
+ editor->setFocus();
+}
+
+int SourceEditor::numLines() const
+{
+ return iFace->numLines();
+}
+
+void SourceEditor::saveBreakPoints()
+{
+ if ( !obj )
+ return;
+ TQValueList<uint> l;
+ iFace->breakPoints( l );
+ MetaDataBase::setBreakPoints( obj, l );
+}
+
+void SourceEditor::clearStep()
+{
+ iFace->clearStep();
+}
+
+void SourceEditor::clearStackFrame()
+{
+ iFace->clearStackFrame();
+}
+
+void SourceEditor::resetBreakPoints()
+{
+ iFace->setBreakPoints( MetaDataBase::breakPoints( obj ) );
+}
+
+TQString SourceEditor::text() const
+{
+ return iFace->text();
+}
+
+bool SourceEditor::isModified() const
+{
+ return iFace->isModified();
+}
+
+void SourceEditor::checkTimeStamp()
+{
+ if ( formWindow() )
+ formWindow()->formFile()->checkTimeStamp();
+ else if ( sourceFile() )
+ sourceFile()->checkTimeStamp();
+}
+
+bool SourceEditor::saveAs()
+{
+ if ( formWindow() )
+ return formWindow()->formFile()->saveAs();
+ else if ( sourceFile() )
+ return sourceFile()->saveAs();
+ return FALSE;
+}
+
+SourceFile *SourceEditor::sourceFile() const
+{
+ if ( !::tqqt_cast<SourceFile*>((TQObject *)obj) )
+ return 0;
+ return (SourceFile*)(TQObject*)obj;
+}
+
+FormWindow *SourceEditor::formWindow() const
+{
+ if ( !::tqqt_cast<FormWindow*>((TQObject *)obj) )
+ return 0;
+ return (FormWindow*)(TQObject*)obj;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/sourceeditor.h b/tqtinterface/qt4/tools/designer/designer/sourceeditor.h
new file mode 100644
index 0000000..cd54cba
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/sourceeditor.h
@@ -0,0 +1,114 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SOURCEEDITOR_H
+#define SOURCEEDITOR_H
+
+#include "../interfaces/editorinterface.h"
+#include <tqvbox.h>
+#include <tqguardedptr.h>
+
+class FormWindow;
+class TQCloseEvent;
+struct LanguageInterface;
+class Project;
+class SourceFile;
+
+class SourceEditor : public TQVBox
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ SourceEditor( TQWidget *tqparent, EditorInterface *iface, LanguageInterface *liface );
+ ~SourceEditor();
+
+ void setObject( TQObject *fw, Project *p );
+ TQObject *object() const { return obj; }
+ Project *project() const { return pro; }
+ void setFunction( const TQString &func, const TQString &clss = TQString() );
+ void setClass( const TQString &clss );
+ void save();
+ bool saveAs();
+ void setModified( bool b );
+ bool isModified() const;
+
+ static TQString sourceOfObject( TQObject *fw, const TQString &lang, EditorInterface *iface, LanguageInterface *lIface );
+
+ TQString language() const;
+ void setLanguage( const TQString &l );
+
+ void editCut();
+ void editCopy();
+ void editPaste();
+ bool editIsUndoAvailable();
+ bool editIsRedoAvailable();
+ void editUndo();
+ void editRedo();
+ void editSelectAll();
+
+ void configChanged();
+ void refresh( bool allowSave );
+ void resetContext();
+
+ EditorInterface *editorInterface() const { return iFace; }
+
+ void setFocus();
+ int numLines() const;
+ void saveBreakPoints();
+ void clearStep();
+ void clearStackFrame();
+ void resetBreakPoints();
+
+ TQString text() const;
+
+ void checkTimeStamp();
+
+ SourceFile *sourceFile() const;
+ FormWindow *formWindow() const;
+
+protected:
+ void closeEvent( TQCloseEvent *e );
+
+
+private:
+ EditorInterface *iFace;
+ LanguageInterface *lIface;
+ TQGuardedPtr<TQObject> obj;
+ Project *pro;
+ TQString lang;
+ TQGuardedPtr<TQWidget> editor;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/sourcefile.cpp b/tqtinterface/qt4/tools/designer/designer/sourcefile.cpp
new file mode 100644
index 0000000..747822f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/sourcefile.cpp
@@ -0,0 +1,302 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "sourcefile.h"
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include "designerappiface.h"
+#include "sourceeditor.h"
+#include "metadatabase.h"
+#include "../interfaces/languageinterface.h"
+#include <tqfiledialog.h>
+#include <tqmessagebox.h>
+#include "mainwindow.h"
+#include "workspace.h"
+#include <stdlib.h>
+
+SourceFile::SourceFile( const TQString &fn, bool temp, Project *p )
+ : filename( fn ), ed( 0 ), fileNameTemp( temp ),
+ timeStamp( 0, p->makeAbsolute( fn ) ), pro( p ), pkg( FALSE )
+ , accepted( TRUE )
+{
+ iface = 0;
+
+ if ( !temp )
+ accepted = checkFileName( TRUE );
+
+ if (accepted) {
+ load();
+ pro->addSourceFile( this );
+ MetaDataBase::addEntry( this );
+ }
+
+}
+
+SourceFile::~SourceFile()
+{
+ if (iface)
+ delete iface;
+}
+
+TQString SourceFile::text() const
+{
+ return txt;
+}
+
+void SourceFile::setText( const TQString &s )
+{
+ txt = s;
+}
+
+bool SourceFile::save( bool ignoreModified )
+{
+ if ( fileNameTemp )
+ return saveAs();
+ if ( !ignoreModified && !isModified() )
+ return TRUE;
+ if ( ed )
+ ed->save();
+
+ if ( TQFile::exists( pro->makeAbsolute( filename ) ) ) {
+ TQString fn( pro->makeAbsolute( filename ) );
+#if defined(TQ_OS_WIN32)
+ fn += ".bak";
+#else
+ fn += "~";
+#endif
+ TQFile f( pro->makeAbsolute( filename ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQFile f2( fn );
+ if ( f2.open( IO_WriteOnly | IO_Translate ) ) {
+ TQCString data( f.size() );
+ f.readBlock( data.data(), f.size() );
+ f2.writeBlock( data );
+ }
+ }
+ }
+
+ TQFile f( pro->makeAbsolute( filename ) );
+ if ( !f.open( IO_WriteOnly | IO_Translate ) )
+ return saveAs();
+
+ TQTextStream ts( &f );
+ ts << txt;
+ timeStamp.update();
+ setModified( FALSE );
+ return TRUE;
+}
+
+bool SourceFile::saveAs( bool ignoreModified )
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ TQString filter;
+ if ( iface )
+ filter = iface->fileFilterList().join(";;");
+
+ TQString old = filename;
+ TQString initFn = pro->makeAbsolute( filename );
+ if ( ignoreModified ) {
+ TQString dir = TQStringList::split( ':', project()->iFace()->customSetting( "TQTSCRIPT_PACKAGES" ) ).first();
+ initFn = TQFileInfo( initFn ).fileName();
+ initFn.prepend( dir + "/" );
+ }
+ TQString fn = TQFileDialog::getSaveFileName( initFn, filter );
+ if ( fn.isEmpty() )
+ return FALSE;
+ fileNameTemp = FALSE;
+ filename = pro->makeRelative( fn );
+ if ( !checkFileName( TRUE ) ) {
+ filename = old;
+ return FALSE;
+ }
+ pro->setModified( TRUE );
+ timeStamp.setFileName( pro->makeAbsolute( filename ) );
+ if ( ed )
+ ed->setCaption( tr( "Edit %1" ).arg( filename ) );
+ setModified( TRUE );
+ if ( pro->isDummy() ) {
+ TQObject *o = ed->tqparent();
+ while ( o && !o->isA( "MainWindow" ) )
+ o = o->tqparent();
+ if ( o )
+ ((MainWindow *)o)->addRecentlyOpenedFile( fn );
+ }
+ return save( ignoreModified );
+}
+
+bool SourceFile::load()
+{
+ TQFile f( pro->makeAbsolute( filename ) );
+ if ( !f.open( IO_ReadOnly ) )
+ return FALSE;
+ TQTextStream ts( &f );
+ txt = ts.read();
+ timeStamp.update();
+ return TRUE;
+}
+
+DesignerSourceFile *SourceFile::iFace()
+{
+ if ( !iface )
+ iface = new DesignerSourceFileImpl( this );
+ return iface;
+}
+
+void SourceFile::setEditor( SourceEditor *e )
+{
+ ed = e;
+}
+
+bool SourceFile::isModified() const
+{
+ if ( !ed )
+ return FALSE;
+ return ed->isModified();
+}
+
+static TQMap<TQString, int> *extensionCounter;
+TQString SourceFile::createUnnamedFileName( const TQString &extension )
+{
+ if ( !extensionCounter )
+ extensionCounter = new TQMap<TQString, int>;
+ int count = -1;
+ TQMap<TQString, int>::Iterator it;
+ if ( ( it = extensionCounter->tqfind( extension ) ) != extensionCounter->end() ) {
+ count = *it;
+ ++count;
+ extensionCounter->tqreplace( extension, count );
+ } else {
+ count = 1;
+ extensionCounter->insert( extension, count );
+ }
+
+ return "unnamed" + TQString::number( count ) + "." + extension;
+}
+
+void SourceFile::setModified( bool m )
+{
+ if ( !ed )
+ return;
+ ed->setModified( m );
+}
+
+bool SourceFile::closeEvent()
+{
+ if ( !isModified() && fileNameTemp ) {
+ pro->removeSourceFile( this );
+ return TRUE;
+ }
+
+ if ( !isModified() )
+ return TRUE;
+
+ if ( ed )
+ ed->save();
+
+ switch ( TQMessageBox::warning( MainWindow::self, tr( "Save Code" ),
+ tr( "Save changes to '%1'?" ).arg( filename ),
+ tr( "&Yes" ), tr( "&No" ), tr( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ if ( !save() )
+ return FALSE;
+ break;
+ case 1: // don't save
+ load();
+ if ( ed )
+ ed->editorInterface()->setText( txt );
+ if ( fileNameTemp ) {
+ pro->removeSourceFile( this );
+ return TRUE;
+ }
+ if ( MainWindow::self )
+ MainWindow::self->workspace()->update();
+ break;
+ case 2: // cancel
+ return FALSE;
+ default:
+ break;
+ }
+ setModified( FALSE );
+ return TRUE;
+}
+
+bool SourceFile::close()
+{
+ if ( !ed )
+ return TRUE;
+ return ed->close();
+}
+
+Project *SourceFile::project() const
+{
+ return pro;
+}
+
+void SourceFile::checkTimeStamp()
+{
+ if ( timeStamp.isUpToDate() )
+ return;
+ timeStamp.update();
+ if ( TQMessageBox::information( MainWindow::self, tr( "TQt Designer" ),
+ tr( "File '%1' has been changed outside TQt Designer.\n"
+ "Do you want to reload it?" ).arg( filename ),
+ tr( "&Yes" ), tr( "&No" ) ) == 0 ) {
+ load();
+ if ( ed )
+ ed->editorInterface()->setText( txt );
+ }
+}
+
+bool SourceFile::checkFileName( bool allowBreak )
+{
+ SourceFile *sf = pro->tqfindSourceFile( filename, this );
+ if ( sf )
+ TQMessageBox::warning( MainWindow::self, tr( "Invalid Filename" ),
+ tr( "The project already tqcontains a source file with \n"
+ "filename '%1'. Please choose a new filename." ).arg( filename ) );
+ while ( sf ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ TQString filter;
+ if ( iface )
+ filter = iface->fileFilterList().join(";;");
+ TQString fn;
+ while ( fn.isEmpty() ) {
+ fn = TQFileDialog::getSaveFileName( pro->makeAbsolute( filename ), filter );
+ if ( allowBreak && fn.isEmpty() )
+ return FALSE;
+ }
+ filename = pro->makeRelative( fn );
+ sf = pro->tqfindSourceFile( filename, this );
+ }
+ return TRUE;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/sourcefile.h b/tqtinterface/qt4/tools/designer/designer/sourcefile.h
new file mode 100644
index 0000000..07834ff
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/sourcefile.h
@@ -0,0 +1,94 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SOURCEFILE_H
+#define SOURCEFILE_H
+
+#include <tqobject.h>
+#include "timestamp.h"
+
+struct DesignerSourceFile;
+class SourceEditor;
+class Project;
+
+class SourceFile : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ SourceFile( const TQString &fn, bool temp, Project *p );
+ ~SourceFile();
+
+ void setText( const TQString &s );
+ void setModified( bool m );
+
+ bool save( bool ignoreModified = FALSE );
+ bool saveAs( bool ignoreModified = FALSE );
+ bool load();
+ bool close();
+ bool closeEvent();
+ Project *project() const;
+
+ TQString text() const;
+ TQString fileName() const { return filename; }
+ bool isModified() const;
+
+ void checkTimeStamp();
+
+ DesignerSourceFile *iFace();
+
+ void setEditor( SourceEditor *e );
+ SourceEditor *editor() const { return ed; }
+
+ static TQString createUnnamedFileName( const TQString &extension );
+
+ bool isAccepted() const { return accepted; }
+
+private:
+ bool checkFileName( bool allowBreak );
+
+private:
+ TQString filename;
+ TQString txt;
+ DesignerSourceFile *iface;
+ SourceEditor *ed;
+ bool fileNameTemp;
+ TimeStamp timeStamp;
+ Project *pro;
+ bool pkg;
+ bool accepted;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/startdialog.ui b/tqtinterface/qt4/tools/designer/designer/startdialog.ui
new file mode 100644
index 0000000..531e7ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/startdialog.ui
@@ -0,0 +1,331 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>StartDialogBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2002-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>StartDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>576</width>
+ <height>420</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Qt Designer - New/Open</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget8</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;New File/Project</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQIconView" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>templateView</cstring>
+ </property>
+ <property name="gridX">
+ <number>120</number>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Open File/Project</string>
+ </attribute>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ </hbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget9</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Recently Opened</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQIconView" row="0" column="0">
+ <property name="name">
+ <cstring>recentView</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>WheelFocus</enum>
+ </property>
+ <property name="gridX">
+ <number>120</number>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>fileInfoLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkShowInFuture</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Don't show this dialog in the future</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <number>4144</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>doubleClicked(TQIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>returnPressed(TQIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>doubleClicked(TQIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>onItem(TQIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>recentItemChanged(TQIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>onViewport()</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>clearFileInfo()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>returnPressed(TQIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>selectionChanged(TQIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>recentItemChanged(TQIconViewItem*)</slot>
+ </connection>
+</connections>
+<Q_SLOTS>
+ <slot>recentItemChanged( TQIconViewItem * )</slot>
+ <slot>clearFileInfo()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/startdialogimpl.cpp b/tqtinterface/qt4/tools/designer/designer/startdialogimpl.cpp
new file mode 100644
index 0000000..8d342f4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/startdialogimpl.cpp
@@ -0,0 +1,177 @@
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqptrlist.h>
+#include <tqiconview.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
+#include <tqfiledialog.h>
+#include <tqtabwidget.h>
+#include <tqpoint.h>
+#include <tqobjectlist.h>
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+#include <tqfileinfo.h>
+#include <tqmap.h>
+#include <tqdatetime.h>
+#include <tqapplication.h>
+#include <tqcheckbox.h>
+#include <tqurl.h>
+
+#include "mainwindow.h"
+#include "startdialogimpl.h"
+#include "designerapp.h"
+
+FileDialog::FileDialog( const TQString &dir, TQWidget *tqparent )
+ : TQFileDialog( dir, TQString(), tqparent )
+{
+}
+
+void FileDialog::accept()
+{
+ emit fileSelected();
+}
+
+
+StartDialog::StartDialog( TQWidget *tqparent, const TQString &templatePath )
+ : StartDialogBase( tqparent, 0 )
+{
+ newForm = new NewForm( templateView, templatePath );
+ recentFiles.clear();
+ initFileOpen();
+ showInFuture = TRUE;
+
+ connect( buttonHelp, TQT_SIGNAL( clicked() ),
+ MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ connect( recentView, TQT_SIGNAL( doubleClicked(TQIconViewItem*) ),
+ this, TQT_SLOT( accept() ) );
+ connect( recentView, TQT_SIGNAL( returnPressed(TQIconViewItem*) ),
+ this, TQT_SLOT( accept() ) );
+ connect( fd, TQT_SIGNAL( fileSelected() ), this, TQT_SLOT( accept() ) );
+}
+
+void StartDialog::accept()
+{
+ hide();
+ showInFuture = !checkShowInFuture->isChecked(); // means don't show it anymore
+
+ int tabindex = tabWidget->currentPageIndex();
+ TQString filename;
+ if( !tabindex ) {
+ if ( !templateView->currentItem() )
+ return;
+ Project *pro = MainWindow::self->tqfindProject( tr( "<No Project>" ) );
+ if ( !pro )
+ return;
+ MainWindow::self->setCurrentProject( pro );
+ ( (NewItem*)templateView->currentItem() )->insert( pro );
+ } else if ( tabindex == 1 ) {
+ filename = fd->selectedFile();
+ } else if ( tabindex == 2 ) {
+ filename = recentFiles[recentView->currentItem()->index()];
+ }
+ if ( tabindex ) {
+ if ( !filename.isEmpty() ) {
+ TQFileInfo fi( filename );
+ if ( fi.extension() == "pro" )
+ MainWindow::self->openProject( filename );
+ else
+ MainWindow::self->fileOpen( "", "", filename );
+ }
+ }
+
+ done( Accepted );
+}
+
+void StartDialog::reject()
+{
+ done( Rejected );
+}
+
+void StartDialog::recentItemChanged( TQIconViewItem *item )
+{
+ TQString msg( recentFiles[item->index()] );
+ TQFileInfo f( recentFiles[item->index()] );
+ uint s = f.size();
+ TQString unit( "B" );
+ if( s > 1024 ) {
+ s /= 1024;
+ unit = "KB";
+ }
+ if ( s > 1024 ) {
+ s /= 1024;
+ unit = "MB";
+ }
+ TQDateTime dt( f.lastModified() );
+ TQString date( dt.toString( "MMMM dd hh:mm" ));
+ msg = TQString( "%1 (%2 %3) %4" ).arg(msg).arg(s).arg(unit).arg(date);
+ fileInfoLabel->setText( msg );
+}
+
+void StartDialog::clearFileInfo()
+{
+ fileInfoLabel->clear();
+}
+
+void StartDialog::setRecentlyFiles( TQStringList &files )
+{
+ insertRecentItems( files, FALSE );
+}
+
+void StartDialog::setRecentlyProjects( TQStringList &projects )
+{
+ insertRecentItems( projects, TRUE );
+}
+
+void StartDialog::insertRecentItems( TQStringList &files, bool isProject )
+{
+ TQString iconName = "designer_newform.png";
+ if ( isProject )
+ iconName = "designer_project.png";
+ TQIconViewItem *item;
+ TQStringList::iterator it = files.begin();
+ for( ; it != files.end(); ++it ) {
+ TQFileInfo fi( *it );
+ item = new TQIconViewItem( recentView, fi.fileName() );
+ recentFiles[recentView->index( item )] = *it;
+ item->setPixmap( TQPixmap::fromMimeSource( iconName ) );
+ item->setDragEnabled( FALSE );
+ }
+}
+
+void StartDialog::initFileOpen()
+{
+ TQString encode = TQDir::currentDirPath();
+ TQUrl::encode( encode );
+ fd = new FileDialog( encode, this );
+ TQPoint point( 0, 0 );
+ fd->reparent( tab, point );
+
+ TQObjectList *l = fd->queryList( "TQPushButton" );
+ TQObjectListIt it( *l );
+ TQObject *obj;
+ while ( (obj = it.current()) != 0 ) {
+ ++it;
+ ((TQPushButton*)obj)->hide();
+ }
+ delete l;
+
+ fd->setSizeGripEnabled ( FALSE );
+ tabLayout->addWidget( fd );
+
+ TQPluginManager<ImportFilterInterface> manager( IID_ImportFilter, TQApplication::libraryPaths(),
+ MainWindow::self->pluginDirectory() );
+ TQStringList filterlist;
+ filterlist << tr( "Designer Files (*.ui *.pro)" );
+ filterlist << tr( "TQt User-Interface Files (*.ui)" );
+ filterlist << tr( "TQMAKE Project Files (*.pro)" );
+
+ TQStringList list = manager.featureList();
+ for ( TQStringList::Iterator it2 = list.begin(); it2 != list.end(); ++it2 )
+ filterlist << *it2;
+
+ filterlist << tr( "All Files (*)" );
+ TQString filters = filterlist.join( ";;" );
+ fd->setFilters( filters );
+
+ fd->show();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/startdialogimpl.h b/tqtinterface/qt4/tools/designer/designer/startdialogimpl.h
new file mode 100644
index 0000000..757a1b4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/startdialogimpl.h
@@ -0,0 +1,89 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef STARTDIALOGIMPL_H
+#define STARTDIALOGIMPL_H
+
+#include <tqiconview.h>
+#include <tqlistview.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqfiledialog.h>
+#include <tqmap.h>
+
+#include "newformimpl.h"
+#include "startdialog.h"
+
+class FileDialog : public TQFileDialog
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ FileDialog( const TQString &dir, TQWidget *tqparent );
+
+protected Q_SLOTS:
+ void accept();
+
+Q_SIGNALS:
+ void fileSelected();
+};
+
+
+class StartDialog : public StartDialogBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ StartDialog( TQWidget *tqparent, const TQString &templatePath );
+ void setRecentlyFiles( TQStringList& );
+ void setRecentlyProjects( TQStringList& );
+ bool showDialogInFuture() const { return showInFuture; }
+
+protected Q_SLOTS:
+ void recentItemChanged( TQIconViewItem *item );
+ void clearFileInfo();
+ void accept();
+ void reject();
+
+private:
+ void initFileOpen();
+ void insertRecentItems( TQStringList &files, bool isProject );
+ NewForm *newForm;
+ FileDialog *fd;
+ TQMap<int, TQString> recentFiles;
+ bool showInFuture;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/styledbutton.cpp b/tqtinterface/qt4/tools/designer/designer/styledbutton.cpp
new file mode 100644
index 0000000..c2419c3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/styledbutton.cpp
@@ -0,0 +1,302 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvariant.h> // HP-UX compiler needs this here
+#include "styledbutton.h"
+#include "formwindow.h"
+#include "pixmapchooser.h"
+#include <tqcolordialog.h>
+#include <tqpalette.h>
+#include <tqlabel.h>
+#include <tqpainter.h>
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqapplication.h>
+#include <tqdragobject.h>
+#include <tqstyle.h>
+
+StyledButton::StyledButton(TQWidget* tqparent, const char* name)
+ : TQButton( tqparent, name ), pix( 0 ), spix( 0 ), s( 0 ), formWindow( 0 ), mousePressed( FALSE )
+{
+ setMinimumSize( tqminimumSizeHint() );
+ setAcceptDrops( TRUE );
+
+ connect( this, TQT_SIGNAL(clicked()), TQT_SLOT(onEditor()));
+
+ setEditor( ColorEditor );
+}
+
+StyledButton::StyledButton( const TQBrush& b, TQWidget* tqparent, const char* name, WFlags f )
+ : TQButton( tqparent, name, f ), spix( 0 ), s( 0 ), formWindow( 0 )
+{
+ col = b.color();
+ pix = b.pixmap();
+ setMinimumSize( tqminimumSizeHint() );
+}
+
+StyledButton::~StyledButton()
+{
+}
+
+void StyledButton::setEditor( EditorType e )
+{
+ if ( edit == e )
+ return;
+
+ edit = e;
+ update();
+}
+
+StyledButton::EditorType StyledButton::editor() const
+{
+ return edit;
+}
+
+void StyledButton::setColor( const TQColor& c )
+{
+ col = c;
+ update();
+}
+
+void StyledButton::setPixmap( const TQPixmap & pm )
+{
+ if ( !pm.isNull() ) {
+ delete pix;
+ pix = new TQPixmap( pm );
+ } else {
+ delete pix;
+ pix = 0;
+ }
+ scalePixmap();
+}
+
+TQColor StyledButton::color() const
+{
+ return col;
+}
+
+TQPixmap* StyledButton::pixmap() const
+{
+ return pix;
+}
+
+bool StyledButton::scale() const
+{
+ return s;
+}
+
+void StyledButton::setScale( bool on )
+{
+ if ( s == on )
+ return;
+
+ s = on;
+ scalePixmap();
+}
+
+TQSize StyledButton::tqsizeHint() const
+{
+ return TQSize( 50, 25 );
+}
+
+TQSize StyledButton::tqminimumSizeHint() const
+{
+ return TQSize( 50, 25 );
+}
+
+void StyledButton::scalePixmap()
+{
+ delete spix;
+
+ if ( pix ) {
+ spix = new TQPixmap( 6*width()/8, 6*height()/8 );
+ TQImage img = pix->convertToImage();
+
+ spix->convertFromImage( s? img.smoothScale( 6*width()/8, 6*height()/8 ) : img );
+ } else {
+ spix = 0;
+ }
+
+ update();
+}
+
+void StyledButton::resizeEvent( TQResizeEvent* e )
+{
+ scalePixmap();
+ TQButton::resizeEvent( e );
+}
+
+void StyledButton::drawButton( TQPainter *paint )
+{
+ tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonBevel, paint, rect(), tqcolorGroup(),
+ isDown() ? TQStyle::Style_Sunken : TQStyle::Style_Raised);
+ drawButtonLabel(paint);
+
+ if (hasFocus())
+ tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, paint,
+ tqstyle().subRect(TQStyle::SR_PushButtonFocusRect, this),
+ tqcolorGroup(), TQStyle::Style_Default);
+}
+
+void StyledButton::drawButtonLabel( TQPainter *paint )
+{
+ TQColor pen = isEnabled() ?
+ hasFocus() ? tqpalette().active().buttonText() : tqpalette().inactive().buttonText()
+ : tqpalette().disabled().buttonText();
+ paint->setPen( pen );
+
+ if(!isEnabled()) {
+ paint->setBrush( TQBrush( tqcolorGroup().button() ) );
+ }
+ else if ( edit == PixmapEditor && spix ) {
+ paint->setBrush( TQBrush( col, *spix ) );
+ paint->setBrushOrigin( width()/8, height()/8 );
+ } else
+ paint->setBrush( TQBrush( col ) );
+
+ paint->drawRect( width()/8, height()/8, 6*width()/8, 6*height()/8 );
+}
+
+void StyledButton::onEditor()
+{
+ switch (edit) {
+ case ColorEditor: {
+ TQColor c = TQColorDialog::getColor( tqpalette().active().background(), this );
+ if ( c.isValid() ) {
+ setColor( c );
+ emit changed();
+ }
+ } break;
+ case PixmapEditor: {
+ TQPixmap p;
+ if ( pixmap() )
+ p = qChoosePixmap( this, formWindow, *pixmap() );
+ else
+ p = qChoosePixmap( this, formWindow, TQPixmap() );
+ if ( !p.isNull() ) {
+ setPixmap( p );
+ emit changed();
+ }
+ } break;
+ default:
+ break;
+ }
+}
+
+void StyledButton::mousePressEvent(TQMouseEvent* e)
+{
+ TQButton::mousePressEvent(e);
+ mousePressed = TRUE;
+ pressPos = e->pos();
+}
+
+void StyledButton::mouseMoveEvent(TQMouseEvent* e)
+{
+ TQButton::mouseMoveEvent( e );
+#ifndef TQT_NO_DRAGANDDROP
+ if ( !mousePressed )
+ return;
+ if ( ( pressPos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) {
+ if ( edit == ColorEditor ) {
+ TQColorDrag *drg = new TQColorDrag( col, this );
+ TQPixmap pix( 25, 25 );
+ pix.fill( col );
+ TQPainter p( &pix );
+ p.drawRect( 0, 0, pix.width(), pix.height() );
+ p.end();
+ drg->setPixmap( pix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ else if ( edit == PixmapEditor && pix && !pix->isNull() ) {
+ TQImage img = pix->convertToImage();
+ TQImageDrag *drg = new TQImageDrag( img, this );
+ if(spix)
+ drg->setPixmap( *spix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ }
+#endif
+}
+
+#ifndef TQT_NO_DRAGANDDROP
+void StyledButton::dragEnterEvent( TQDragEnterEvent *e )
+{
+ setFocus();
+ if ( edit == ColorEditor && TQColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( edit == PixmapEditor && TQImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void StyledButton::dragLeaveEvent( TQDragLeaveEvent * )
+{
+ if ( hasFocus() )
+ parentWidget()->setFocus();
+}
+
+void StyledButton::dragMoveEvent( TQDragMoveEvent *e )
+{
+ if ( edit == ColorEditor && TQColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( edit == PixmapEditor && TQImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void StyledButton::dropEvent( TQDropEvent *e )
+{
+ if ( edit == ColorEditor && TQColorDrag::canDecode( e ) ) {
+ TQColor color;
+ TQColorDrag::decode( e, color );
+ setColor(color);
+ emit changed();
+ e->accept();
+ }
+ else if ( edit == PixmapEditor && TQImageDrag::canDecode( e ) ) {
+ TQImage img;
+ TQImageDrag::decode( e, img );
+ TQPixmap pm;
+ pm.convertFromImage(img);
+ setPixmap(pm);
+ emit changed();
+ e->accept();
+ } else {
+ e->ignore();
+ }
+}
+#endif // TQT_NO_DRAGANDDROP
diff --git a/tqtinterface/qt4/tools/designer/designer/styledbutton.h b/tqtinterface/qt4/tools/designer/designer/styledbutton.h
new file mode 100644
index 0000000..68a4adc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/styledbutton.h
@@ -0,0 +1,111 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef STYLEDBUTTON_H
+#define STYLEDBUTTON_H
+
+#include <tqbutton.h>
+#include <tqpixmap.h>
+
+class TQColor;
+class TQBrush;
+class FormWindow;
+
+class StyledButton : public TQButton
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+ Q_PROPERTY( TQColor color READ color WRITE setColor )
+ Q_PROPERTY( TQPixmap pixmap READ pixmap WRITE setPixmap )
+ Q_PROPERTY( EditorType editor READ editor WRITE setEditor )
+ Q_PROPERTY( bool scale READ scale WRITE setScale )
+
+ TQ_ENUMS( EditorType )
+
+public:
+ enum EditorType { ColorEditor, PixmapEditor };
+
+ StyledButton( TQWidget* tqparent = 0, const char* name = 0 );
+ StyledButton( const TQBrush& b, TQWidget* tqparent = 0, const char* name = 0, WFlags f = 0 );
+ ~StyledButton();
+
+ void setEditor( EditorType );
+ EditorType editor() const;
+
+ void setColor( const TQColor& );
+ void setPixmap( const TQPixmap& );
+
+ TQPixmap* pixmap() const;
+ TQColor color() const;
+
+ void setScale( bool );
+ bool scale() const;
+
+ TQSize tqsizeHint() const;
+ TQSize tqminimumSizeHint() const;
+
+ void setFormWindow( FormWindow *fw ) { formWindow = fw; }
+
+public Q_SLOTS:
+ virtual void onEditor();
+
+Q_SIGNALS:
+ void changed();
+
+protected:
+ void mousePressEvent(TQMouseEvent*);
+ void mouseMoveEvent(TQMouseEvent*);
+#ifndef TQT_NO_DRAGANDDROP
+ void dragEnterEvent ( TQDragEnterEvent * );
+ void dragMoveEvent ( TQDragMoveEvent * );
+ void dragLeaveEvent ( TQDragLeaveEvent * );
+ void dropEvent ( TQDropEvent * );
+#endif // TQT_NO_DRAGANDDROP
+ void drawButton( TQPainter* );
+ void drawButtonLabel( TQPainter* );
+ void resizeEvent( TQResizeEvent* );
+ void scalePixmap();
+
+private:
+ TQPixmap* pix;
+ TQPixmap* spix; // the pixmap scaled down to fit into the button
+ TQColor col;
+ EditorType edit;
+ bool s;
+ FormWindow *formWindow;
+ TQPoint pressPos;
+ bool mousePressed;
+};
+
+#endif //STYLEDBUTTON_H
diff --git a/tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.cpp b/tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.cpp
new file mode 100644
index 0000000..b53520d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.cpp
@@ -0,0 +1,167 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "syntaxhighlighter_html.h"
+#include "tqstring.h"
+#include "tqmap.h"
+#include "tqapplication.h"
+
+
+SyntaxHighlighter_HTML::SyntaxHighlighter_HTML()
+ : TQTextPreProcessor(), lastFormat( 0 ), lastFormatId( -1 )
+{
+ TQFont f( tqApp->font() );
+
+ addFormat(Standard, new TQTextFormat(f, tqApp->palette().color(TQPalette::Active, TQColorGroup::Text)));
+ addFormat(Keyword, new TQTextFormat(f, tqApp->palette().color(TQPalette::Active, TQColorGroup::Dark)));
+ addFormat(Attribute, new TQTextFormat(f, tqApp->palette().color(TQPalette::Active, TQColorGroup::Link)));
+ addFormat(AttribValue, new TQTextFormat(f, tqApp->palette().color(TQPalette::Active, TQColorGroup::LinkVisited)));
+}
+
+SyntaxHighlighter_HTML::~SyntaxHighlighter_HTML()
+{
+}
+
+void SyntaxHighlighter_HTML::process( TQTextDocument *doc, TQTextParagraph *string, int, bool tqinvalidate )
+{
+
+ TQTextFormat *formatStandard = format( Standard );
+ TQTextFormat *formatKeyword = format( Keyword );
+ TQTextFormat *formatAttribute = format( Attribute );
+ TQTextFormat *formatAttribValue = format( AttribValue );
+
+ const int StateStandard = 0;
+ const int StateTag = 1;
+ const int StateAttribute = 2;
+ const int StateAttribVal = 3;
+
+ TQString buffer = "";
+
+ int state = StateStandard;
+
+
+ if ( string->prev() ) {
+ if ( string->prev()->endState() == -1 )
+ process( doc, string->prev(), 0, FALSE );
+ state = string->prev()->endState();
+ }
+
+
+ int i = 0;
+ for ( ;; ) {
+ TQChar c = string->at( i )->c;
+
+ if ( c == '<' ) {
+ if ( state != StateStandard )
+ string->setFormat( i - buffer.length(), buffer.length(), formatStandard, FALSE );
+ buffer = c;
+ state = StateTag;
+ string->setFormat( i, 1, formatKeyword, FALSE );
+ }
+ else if ( c == '>' && ( state != StateStandard ) ) {
+ string->setFormat( i, 1, formatKeyword, FALSE );
+ buffer = "";
+ state = StateStandard;
+ }
+ else if ( c == ' ' && state == StateTag ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribute;
+ }
+ else if ( c == '=' && state == StateAttribute ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribute;
+ }
+ else if ( c == '\"' && state == StateAttribute ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribVal;
+ }
+ else if ( c == '\"' && state == StateAttribVal ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribute;
+ }
+ else if ( state == StateAttribute ) {
+ buffer += c;
+ string->setFormat( i, 1, formatAttribute, FALSE );
+ }
+ else if ( state == StateAttribVal ) {
+ buffer += c;
+ string->setFormat( i, 1, formatAttribValue, FALSE );
+ }
+ else if ( state == StateTag ) {
+ string->setFormat( i, 1, formatKeyword, FALSE );
+ buffer += c;
+ }
+ else if ( state == StateStandard ) {
+ string->setFormat( i, 1, formatStandard, FALSE );
+ }
+
+ i++;
+ if ( i >= string->length() )
+ break;
+ }
+
+ string->setEndState( state );
+ string->setFirstPreProcess( FALSE );
+
+ if ( tqinvalidate && string->next() &&
+ !string->next()->firstPreProcess() && string->next()->endState() != -1 ) {
+ TQTextParagraph *p = string->next();
+ while ( p ) {
+ if ( p->endState() == -1 )
+ return;
+ p->setEndState( -1 );
+ p = p->next();
+ }
+ }
+}
+
+TQTextFormat *SyntaxHighlighter_HTML::format( int id )
+{
+ if ( lastFormatId == id && lastFormat )
+ return lastFormat;
+
+ TQTextFormat *f = formats[ id ];
+ lastFormat = f ? f : formats[ 0 ];
+ lastFormatId = id;
+ return lastFormat;
+}
+
+void SyntaxHighlighter_HTML::addFormat( int id, TQTextFormat *f )
+{
+ formats.insert( id, f );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.h b/tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.h
new file mode 100644
index 0000000..ed141d2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/syntaxhighlighter_html.h
@@ -0,0 +1,67 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SYNTAXHIGHLIGHTER_HTML_H
+#define SYNTAXHIGHLIGHTER_HTML_H
+
+#include <./../src/kernel/tqrichtext_p.h>
+#include <./private/tqrichtext_p.h>
+
+#include <tqintdict.h>
+
+class SyntaxHighlighter_HTML : public TQTextPreProcessor
+{
+public:
+
+ enum HTML {
+ Standard = 1,
+ Keyword,
+ Attribute,
+ AttribValue
+ };
+
+ SyntaxHighlighter_HTML();
+ virtual ~SyntaxHighlighter_HTML();
+ void process( TQTextDocument *doc, TQTextParagraph *string, int start, bool tqinvalidate = TRUE );
+ TQTextFormat *format( int id );
+
+private:
+ void addFormat( int id, TQTextFormat *f );
+
+ TQTextFormat *lastFormat;
+ int lastFormatId;
+ TQIntDict<TQTextFormat> formats;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/tableeditor.ui b/tqtinterface/qt4/tools/designer/designer/tableeditor.ui
new file mode 100644
index 0000000..fea785a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/tableeditor.ui
@@ -0,0 +1,831 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>TableEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>TableEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>484</width>
+ <height>406</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Table</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTable" row="0" column="0">
+ <property name="name">
+ <cstring>table</cstring>
+ </property>
+ <property name="numRows">
+ <number>1</number>
+ </property>
+ <property name="numCols">
+ <number>1</number>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQTabWidget" row="0" column="1">
+ <property name="name">
+ <cstring>TabWidget</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>columns_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Co&amp;lumns</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="4" column="2">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQListBox" row="0" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>listColumns</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>buttonColumnUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_up.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>buttonColumnDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_down.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDeleteColumn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Column</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNewColumn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Column</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelTable</cstring>
+ </property>
+ <property name="text">
+ <string>Table:</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="3" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelColumnPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonDeleteColPixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_editcut.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected item's pixmap.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonChooseColPixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Label:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editColumnText</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>labelFields</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Field:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFields</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editColumnText</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboFields</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="1">
+ <property name="name">
+ <cstring>labelTableValue</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;no table&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>rows_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Rows</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="4" column="2">
+ <property name="name">
+ <cstring>Spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>buttonRowUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_up.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="0" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>listRows</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>buttonRowDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_down.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNewRow</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Row</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDeleteRow</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Row</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout7_2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Label:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editRowText</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout2_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelRowPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonDeleteRowPixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_editcut.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected item's pixmap.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonChooseRowPixmap</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editRowText</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>listColumns</sender>
+ <signal>currentChanged(TQListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentColumnChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listColumns</sender>
+ <signal>selectionChanged(TQListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentColumnChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>editColumnText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>columnTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewColumn</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>newColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteColumn</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonColumnUp</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>columnUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonColumnDown</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>columnDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>comboFields</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentFieldChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listRows</sender>
+ <signal>selectionChanged(TQListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentRowChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listRows</sender>
+ <signal>currentChanged(TQListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentRowChanged(TQListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewRow</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>newRowClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteRow</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteRowClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRowUp</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>rowUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRowDown</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>rowDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonChooseRowPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>chooseRowPixmapClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteColPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteColPixmapClicked()</slot>
+ </connection>
+ <connection>
+ <sender>editRowText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>rowTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonChooseColPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>chooseColPixmapClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteRowPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteRowPixmapClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>table</tabstop>
+ <tabstop>TabWidget</tabstop>
+ <tabstop>listColumns</tabstop>
+ <tabstop>buttonNewColumn</tabstop>
+ <tabstop>buttonDeleteColumn</tabstop>
+ <tabstop>comboFields</tabstop>
+ <tabstop>editColumnText</tabstop>
+ <tabstop>buttonDeleteColPixmap</tabstop>
+ <tabstop>buttonChooseColPixmap</tabstop>
+ <tabstop>buttonColumnUp</tabstop>
+ <tabstop>buttonColumnDown</tabstop>
+ <tabstop>buttonApply</tabstop>
+ <tabstop>listRows</tabstop>
+ <tabstop>buttonNewRow</tabstop>
+ <tabstop>buttonDeleteRow</tabstop>
+ <tabstop>editRowText</tabstop>
+ <tabstop>buttonDeleteRowPixmap</tabstop>
+ <tabstop>buttonChooseRowPixmap</tabstop>
+ <tabstop>buttonRowUp</tabstop>
+ <tabstop>buttonRowDown</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">tqtable.h</include>
+</includes>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">chooseRowPixmapClicked()</slot>
+ <slot access="protected">columnTextChanged( const TQString &amp; )</slot>
+ <slot access="protected">columnUpClicked()</slot>
+ <slot access="protected">currentColumnChanged( TQListBoxItem * )</slot>
+ <slot access="protected">currentFieldChanged( const TQString &amp; )</slot>
+ <slot access="protected">currentRowChanged( TQListBoxItem * )</slot>
+ <slot access="protected">deleteColPixmapClicked()</slot>
+ <slot access="protected">deleteColumnClicked()</slot>
+ <slot access="protected">deleteRowClicked()</slot>
+ <slot access="protected">deleteRowPixmapClicked()</slot>
+ <slot access="protected">newColumnClicked()</slot>
+ <slot access="protected">newRowClicked()</slot>
+ <slot access="protected">chooseColPixmapClicked()</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">rowDownClicked()</slot>
+ <slot access="protected">rowTextChanged( const TQString &amp; )</slot>
+ <slot access="protected">rowUpClicked()</slot>
+ <slot access="protected">columnDownClicked()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/tableeditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/tableeditorimpl.cpp
new file mode 100644
index 0000000..1247f5e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/tableeditorimpl.cpp
@@ -0,0 +1,501 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tableeditorimpl.h"
+#ifndef TQT_NO_TABLE
+#include <tqtable.h>
+#endif
+#include "formwindow.h"
+#include <tqlabel.h>
+#include <tqcombobox.h>
+#include <tqheader.h>
+#include <tqlistbox.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include "pixmapchooser.h"
+#include "command.h"
+#include <tqvaluelist.h>
+#include <tqtabwidget.h>
+#include <tqdatatable.h>
+#include "project.h"
+#include "metadatabase.h"
+#include "mainwindow.h"
+
+TableEditor::TableEditor( TQWidget* tqparent, TQWidget *editWidget, FormWindow *fw, const char* name, bool modal, WFlags fl )
+ : TableEditorBase( tqparent, name, modal, fl ),
+#ifndef TQT_NO_TABLE
+ editTable( (TQTable*)editWidget ),
+#endif
+ formWindow( fw )
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+#ifndef TQT_NO_TABLE
+ labelColumnPixmap->setText( "" );
+ labelRowPixmap->setText( "" );
+
+#ifndef TQT_NO_SQL
+ if ( !::tqqt_cast<TQDataTable*>(editTable) )
+#endif
+ {
+ labelFields->hide();
+ comboFields->hide();
+ labelTable->hide();
+ labelTableValue->hide();
+ }
+#ifndef TQT_NO_SQL
+ if ( ::tqqt_cast<TQDataTable*>(editTable) ) {
+ // ## why does this behave weird?
+ // TabWidget->removePage( rows_tab );
+ // rows_tab->hide();
+ // ## do this in the meantime...
+ TabWidget->setTabEnabled( rows_tab, FALSE );
+ }
+
+ if ( formWindow->project() && ::tqqt_cast<TQDataTable*>(editTable) ) {
+ TQStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList();
+ if ( lst.count() == 2 && !lst[ 0 ].isEmpty() && !lst[ 1 ].isEmpty() ) {
+ TQStringList fields;
+ fields << "<no field>";
+ fields += formWindow->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] );
+ comboFields->insertStringList( fields );
+ }
+ if ( !lst[ 1 ].isEmpty() )
+ labelTableValue->setText( lst[ 1 ] );
+ }
+#endif
+
+ readFromTable();
+#endif
+}
+
+TableEditor::~TableEditor()
+{
+}
+
+void TableEditor::columnDownClicked()
+{
+ if ( listColumns->currentItem() == -1 ||
+ listColumns->currentItem() == (int)listColumns->count() - 1 ||
+ listColumns->count() < 2 )
+ return;
+ saveFieldMap();
+ int index = listColumns->currentItem() + 1;
+ TQListBoxItem *i = listColumns->item( listColumns->currentItem() );
+ listColumns->takeItem( i );
+ listColumns->insertItem( i, index );
+ listColumns->setCurrentItem( i );
+ readColumns();
+ restoreFieldMap();
+ currentColumnChanged( i );
+}
+
+void TableEditor::columnTextChanged( const TQString &s )
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+ listColumns->blockSignals( TRUE );
+ listColumns->changeItem( s, listColumns->currentItem() );
+ listColumns->blockSignals( FALSE );
+#ifndef TQT_NO_TABLE
+ if ( table->horizontalHeader()->iconSet( listColumns->currentItem() ) )
+ table->horizontalHeader()->setLabel( listColumns->currentItem(),
+ *table->horizontalHeader()->iconSet( listColumns->currentItem() ), s );
+ else
+ table->horizontalHeader()->setLabel( listColumns->currentItem(), s );
+#endif
+}
+
+void TableEditor::columnUpClicked()
+{
+ if ( listColumns->currentItem() <= 0 ||
+ listColumns->count() < 2 )
+ return;
+ saveFieldMap();
+ int index = listColumns->currentItem() - 1;
+ TQListBoxItem *i = listColumns->item( listColumns->currentItem() );
+ listColumns->takeItem( i );
+ listColumns->insertItem( i, index );
+ listColumns->setCurrentItem( i );
+ readColumns();
+ restoreFieldMap();
+ currentColumnChanged( i );
+}
+
+void TableEditor::currentColumnChanged( TQListBoxItem *i )
+{
+ if ( !i )
+ return;
+ editColumnText->blockSignals( TRUE );
+ editColumnText->setText( i->text() );
+ if ( i->pixmap() )
+ labelColumnPixmap->setPixmap( *i->pixmap() );
+ else
+ labelColumnPixmap->setText( "" );
+ editColumnText->blockSignals( FALSE );
+
+#ifndef TQT_NO_SQL
+ if ( ::tqqt_cast<TQDataTable*>(editTable) ) {
+ TQString s = *fieldMap.tqfind( listColumns->index( i ) );
+ if ( s.isEmpty() )
+ comboFields->setCurrentItem( 0 );
+ else if ( comboFields->listBox()->tqfindItem( s ) )
+ comboFields->setCurrentItem( comboFields->listBox()->index( comboFields->listBox()->tqfindItem( s ) ) );
+ else
+ comboFields->lineEdit()->setText( s );
+ }
+#endif
+}
+
+void TableEditor::currentFieldChanged( const TQString &s )
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+ fieldMap.remove( listColumns->currentItem() );
+ fieldMap.insert( listColumns->currentItem(), s );
+ editColumnText->blockSignals( TRUE ); //## necessary
+ TQString newColText = s.mid(0,1).upper() + s.mid(1);
+ editColumnText->setText( newColText );
+ columnTextChanged( newColText );
+ editColumnText->blockSignals( FALSE );
+}
+
+void TableEditor::currentRowChanged( TQListBoxItem *i )
+{
+ if ( !i )
+ return;
+ editRowText->blockSignals( TRUE );
+ editRowText->setText( i->text() );
+ if ( i->pixmap() )
+ labelRowPixmap->setPixmap( *i->pixmap() );
+ else
+ labelRowPixmap->setText( "" );
+ editRowText->blockSignals( FALSE );
+}
+
+void TableEditor::deleteColumnClicked()
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+#ifndef TQT_NO_TABLE
+ table->setNumCols( table->numCols() - 1 );
+ delete listColumns->item( listColumns->currentItem() );
+ readColumns();
+ if ( listColumns->firstItem() ) {
+ listColumns->setCurrentItem( listColumns->firstItem() );
+ listColumns->setSelected( listColumns->firstItem(), TRUE );
+ }
+#endif
+}
+
+void TableEditor::deleteRowClicked()
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+#ifndef TQT_NO_TABLE
+ table->setNumRows( table->numRows() - 1 );
+ delete listRows->item( listRows->currentItem() );
+ readRows();
+ if ( listRows->firstItem() ) {
+ listRows->setCurrentItem( listRows->firstItem() );
+ listRows->setSelected( listRows->firstItem(), TRUE );
+ }
+#endif
+}
+
+void TableEditor::newColumnClicked()
+{
+#ifndef TQT_NO_TABLE
+ table->setNumCols( table->numCols() + 1 );
+ TQMap<TQString, bool> m;
+ for ( int i = 0; i < table->numCols() - 1; ++i )
+ m.insert( table->horizontalHeader()->label( i ), TRUE );
+ int n = table->numCols() - 1;
+ TQString t = TQString::number( n );
+ while ( m.tqfind( t ) != m.end() )
+ t = TQString::number( ++n );
+ table->horizontalHeader()->setLabel( table->numCols() - 1, t );
+ listColumns->insertItem( t );
+ TQListBoxItem *item = listColumns->item( listColumns->count() - 1 );
+ listColumns->setCurrentItem( item );
+ listColumns->setSelected( item, TRUE );
+#ifndef TQT_NO_SQL
+ if ( ::tqqt_cast<TQDataTable*>(editTable) ) {
+ comboFields->setFocus();
+ } else
+#endif
+ {
+ editColumnText->setFocus();
+ editColumnText->selectAll();
+ }
+#endif
+}
+
+void TableEditor::newRowClicked()
+{
+#ifndef TQT_NO_TABLE
+ table->setNumRows( table->numRows() + 1 );
+ TQMap<TQString, bool> m;
+ for ( int i = 0; i < table->numRows() - 1; ++i )
+ m.insert( table->verticalHeader()->label( i ), TRUE );
+ int n = table->numRows() - 1;
+ TQString t = TQString::number( n );
+ while ( m.tqfind( t ) != m.end() )
+ t = TQString::number( ++n );
+ table->verticalHeader()->setLabel( table->numRows() - 1, t );
+ listRows->insertItem( t );
+ TQListBoxItem *item = listRows->item( listRows->count() - 1 );
+ listRows->setCurrentItem( item );
+ listRows->setSelected( item, TRUE );
+#endif
+}
+
+void TableEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void TableEditor::rowDownClicked()
+{
+ if ( listRows->currentItem() == -1 ||
+ listRows->currentItem() == (int)listRows->count() - 1 ||
+ listRows->count() < 2 )
+ return;
+ int index = listRows->currentItem() + 1;
+ TQListBoxItem *i = listRows->item( listRows->currentItem() );
+ listRows->takeItem( i );
+ listRows->insertItem( i, index );
+ listRows->setCurrentItem( i );
+ readRows();
+}
+
+void TableEditor::rowTextChanged( const TQString &s )
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+#ifndef TQT_NO_TABLE
+ listRows->blockSignals(TRUE);
+ listRows->changeItem( s, listRows->currentItem() );
+ listRows->blockSignals(FALSE);
+ if ( table->verticalHeader()->iconSet( listRows->currentItem() ) )
+ table->verticalHeader()->setLabel( listRows->currentItem(),
+ *table->verticalHeader()->iconSet( listRows->currentItem() ), s );
+ else
+ table->verticalHeader()->setLabel( listRows->currentItem(), s );
+#endif
+}
+
+void TableEditor::rowUpClicked()
+{
+ if ( listRows->currentItem() <= 0 ||
+ listRows->count() < 2 )
+ return;
+ int index = listRows->currentItem() - 1;
+ TQListBoxItem *i = listRows->item( listRows->currentItem() );
+ listRows->takeItem( i );
+ listRows->insertItem( i, index );
+ listRows->setCurrentItem( i );
+ readRows();
+}
+
+void TableEditor::applyClicked()
+{
+ TQValueList<PopulateTableCommand::Row> rows;
+ TQValueList<PopulateTableCommand::Column> cols;
+
+ int i = 0;
+#ifndef TQT_NO_TABLE
+ for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
+ PopulateTableCommand::Column col;
+ col.text = table->horizontalHeader()->label( i );
+ if ( table->horizontalHeader()->iconSet( i ) )
+ col.pix = table->horizontalHeader()->iconSet( i )->pixmap();
+ col.field = *fieldMap.tqfind( i );
+ cols.append( col );
+ }
+ for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
+ PopulateTableCommand::Row row;
+ row.text = table->verticalHeader()->label( i );
+ if ( table->verticalHeader()->iconSet( i ) )
+ row.pix = table->verticalHeader()->iconSet( i )->pixmap();
+ rows.append( row );
+ }
+ PopulateTableCommand *cmd = new PopulateTableCommand( tr( "Edit the Rows and Columns of '%1' " ).arg( editTable->name() ),
+ formWindow, editTable, rows, cols );
+ cmd->execute();
+ formWindow->commandHistory()->addCommand( cmd );
+#endif
+}
+
+void TableEditor::chooseRowPixmapClicked()
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+ TQPixmap pix;
+ if ( listRows->item( listRows->currentItem() )->pixmap() )
+ pix = qChoosePixmap( this, formWindow, *listRows->item( listRows->currentItem() )->pixmap() );
+ else
+ pix = qChoosePixmap( this, formWindow, TQPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+#ifndef TQT_NO_TABLE
+ table->verticalHeader()->setLabel( listRows->currentItem(), pix, table->verticalHeader()->label( listRows->currentItem() ) );
+ listRows->changeItem( pix, listRows->currentText(), listRows->currentItem() );
+#endif
+}
+
+void TableEditor::deleteRowPixmapClicked()
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+#ifndef TQT_NO_TABLE
+ table->verticalHeader()->setLabel( listRows->currentItem(), TQPixmap(), table->verticalHeader()->label( listRows->currentItem() ) );
+ listRows->changeItem( listRows->currentText(), listRows->currentItem() );
+#endif
+}
+
+void TableEditor::chooseColPixmapClicked()
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+ TQPixmap pix;
+ if ( listColumns->item( listColumns->currentItem() )->pixmap() )
+ pix = qChoosePixmap( this, formWindow, *listColumns->item( listColumns->currentItem() )->pixmap() );
+ else
+ pix = qChoosePixmap( this, formWindow, TQPixmap() );
+
+ if ( pix.isNull() )
+ return;
+#ifndef TQT_NO_TABLE
+ table->horizontalHeader()->setLabel( listColumns->currentItem(), pix, table->horizontalHeader()->label( listColumns->currentItem() ) );
+ listColumns->changeItem( pix, listColumns->currentText(), listColumns->currentItem() );
+#endif
+}
+
+void TableEditor::deleteColPixmapClicked()
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+#ifndef TQT_NO_TABLE
+ table->horizontalHeader()->setLabel( listColumns->currentItem(), TQPixmap(), table->horizontalHeader()->label( listColumns->currentItem() ) );
+ listColumns->changeItem( listColumns->currentText(), listColumns->currentItem() );
+#endif
+}
+
+void TableEditor::readFromTable()
+{
+#ifndef TQT_NO_TABLE
+ TQHeader *cols = editTable->horizontalHeader();
+ table->setNumCols( cols->count() );
+ TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( editTable );
+ for ( int i = 0; i < cols->count(); ++i ) {
+ if ( editTable->horizontalHeader()->iconSet( i ) ) {
+ table->horizontalHeader()->setLabel( i, *editTable->horizontalHeader()->iconSet( i ),
+ editTable->horizontalHeader()->label( i ) );
+ listColumns->insertItem( editTable->horizontalHeader()->iconSet( i )->pixmap(),
+ editTable->horizontalHeader()->label( i ) );
+ } else {
+ table->horizontalHeader()->setLabel( i, editTable->horizontalHeader()->label( i ) );
+ listColumns->insertItem( editTable->horizontalHeader()->label( i ) );
+ }
+ TQString cf = *columnFields.tqfind( editTable->horizontalHeader()->label( i ) );
+ fieldMap.insert( i, cf );
+ }
+
+ if ( listColumns->firstItem() ) {
+ listColumns->setCurrentItem( listColumns->firstItem() );
+ listColumns->setSelected( listColumns->firstItem(), TRUE );
+ }
+
+ TQHeader *rows = editTable->verticalHeader();
+ table->setNumRows( rows->count() );
+ for ( int j = 0; j < rows->count(); ++j ) {
+ if ( editTable->verticalHeader()->iconSet( j ) ) {
+ table->verticalHeader()->setLabel( j, *editTable->verticalHeader()->iconSet( j ),
+ editTable->verticalHeader()->label( j ) );
+ listRows->insertItem( editTable->verticalHeader()->iconSet( j )->pixmap(),
+ editTable->verticalHeader()->label( j ) );
+ } else {
+ table->verticalHeader()->setLabel( j, editTable->verticalHeader()->label( j ) );
+ listRows->insertItem( editTable->verticalHeader()->label( j ) );
+ }
+ }
+
+ if ( listRows->firstItem() ) {
+ listRows->setCurrentItem( listRows->firstItem() );
+ listRows->setSelected( listRows->firstItem(), TRUE );
+ }
+#endif
+}
+
+void TableEditor::readColumns()
+{
+ int j = 0;
+#ifndef TQT_NO_TABLE
+ for ( TQListBoxItem *i = listColumns->firstItem(); i; i = i->next(), ++j ) {
+ if ( i->pixmap() )
+ table->horizontalHeader()->setLabel( j, *i->pixmap(), i->text() );
+ else
+ table->horizontalHeader()->setLabel( j, i->text() );
+ }
+#endif
+}
+
+void TableEditor::readRows()
+{
+ int j = 0;
+#ifndef TQT_NO_TABLE
+ for ( TQListBoxItem *i = listRows->firstItem(); i; i = i->next(), ++j ) {
+ if ( i->pixmap() )
+ table->verticalHeader()->setLabel( j, *i->pixmap(), i->text() );
+ else
+ table->verticalHeader()->setLabel( j, i->text() );
+ }
+#endif
+}
+
+void TableEditor::saveFieldMap()
+{
+ tmpFieldMap.clear();
+ for ( TQMap<int, TQString>::Iterator it = fieldMap.begin(); it != fieldMap.end(); ++it )
+ tmpFieldMap.insert( listColumns->item( it.key() ), *it );
+}
+
+void TableEditor::restoreFieldMap()
+{
+ fieldMap.clear();
+ for ( TQMap<TQListBoxItem*, TQString>::Iterator it = tmpFieldMap.begin(); it != tmpFieldMap.end(); ++it )
+ fieldMap.insert( listColumns->index( it.key() ), *it );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/tableeditorimpl.h b/tqtinterface/qt4/tools/designer/designer/tableeditorimpl.h
new file mode 100644
index 0000000..9d32ec2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/tableeditorimpl.h
@@ -0,0 +1,90 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TABLEEDITORIMPL_H
+#define TABLEEDITORIMPL_H
+
+#include "tableeditor.h"
+#include <tqmap.h>
+
+class TQListBoxItem;
+class TQTable;
+class FormWindow;
+
+class TableEditor : public TableEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TableEditor( TQWidget* tqparent = 0, TQWidget *editWidget = 0, FormWindow *fw = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~TableEditor();
+
+protected Q_SLOTS:
+ void columnDownClicked();
+ void columnTextChanged( const TQString & );
+ void columnUpClicked();
+ void currentColumnChanged( TQListBoxItem * );
+ void currentFieldChanged( const TQString & );
+ void currentRowChanged( TQListBoxItem * );
+ void deleteColumnClicked();
+ void deleteRowClicked();
+ void newColumnClicked();
+ void newRowClicked();
+ void okClicked();
+ void rowDownClicked();
+ void rowTextChanged( const TQString & );
+ void rowUpClicked();
+ void applyClicked();
+ void chooseRowPixmapClicked();
+ void deleteRowPixmapClicked();
+ void chooseColPixmapClicked();
+ void deleteColPixmapClicked();
+
+private:
+ void readFromTable();
+ void readColumns();
+ void readRows();
+ void saveFieldMap();
+ void restoreFieldMap();
+
+private:
+ TQTable *editTable;
+ FormWindow *formWindow;
+ TQMap<int, TQString> fieldMap;
+ TQMap<TQListBoxItem*, TQString> tmpFieldMap;
+
+};
+
+#endif // TABLEEDITOR_H
diff --git a/tqtinterface/qt4/tools/designer/designer/timestamp.cpp b/tqtinterface/qt4/tools/designer/designer/timestamp.cpp
new file mode 100644
index 0000000..61f554d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/timestamp.cpp
@@ -0,0 +1,93 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "timestamp.h"
+#include <tqfile.h>
+#include <tqfileinfo.h>
+
+class TQTimer;
+
+TimeStamp::TimeStamp( TQObject *tqparent, const TQString &f )
+ : TQObject( tqparent ), filename( f ), autoCheck( FALSE )
+{
+ timer = new TQTimer( this );
+ connect( timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( autoCheckTimeStamp() ) );
+ update();
+}
+
+void TimeStamp::setFileName( const TQString &f )
+{
+ filename = f;
+ update();
+}
+
+TQString TimeStamp::fileName() const
+{
+ return filename;
+}
+
+void TimeStamp::setAutoCheckEnabled( bool a )
+{
+ autoCheck = a;
+ if ( autoCheck )
+ timer->start( 5000 );
+ else
+ timer->stop();
+}
+
+void TimeStamp::update()
+{
+ TQFile f( filename );
+ if ( !f.exists() )
+ return;
+ lastTimeStamp = TQFileInfo( f ).lastModified();
+}
+
+bool TimeStamp::isUpToDate() const
+{
+ TQFile f( filename );
+ if ( !f.exists() )
+ return TRUE;
+ return lastTimeStamp == TQFileInfo( f ).lastModified();
+}
+
+bool TimeStamp::isAutoCheckEnabled() const
+{
+ return autoCheck;
+}
+
+void TimeStamp::autoCheckTimeStamp()
+{
+ if ( !isUpToDate() )
+ emit timeStampChanged();
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/timestamp.h b/tqtinterface/qt4/tools/designer/designer/timestamp.h
new file mode 100644
index 0000000..aa1468e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/timestamp.h
@@ -0,0 +1,71 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TIMESTAMP_H
+#define TIMESTAMP_H
+
+#include <tqobject.h>
+#include <tqdatetime.h>
+#include <tqtimer.h>
+
+class TimeStamp : public TQObject
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TimeStamp( TQObject *tqparent, const TQString &f );
+
+ void setFileName( const TQString &f );
+ TQString fileName() const;
+ void setAutoCheckEnabled( bool a );
+ void update();
+
+ bool isUpToDate() const;
+ bool isAutoCheckEnabled() const;
+
+Q_SIGNALS:
+ void timeStampChanged();
+
+private Q_SLOTS:
+ void autoCheckTimeStamp();
+
+private:
+ TQDateTime lastTimeStamp;
+ TQString filename;
+ bool autoCheck;
+ TQTimer *timer;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/variabledialog.ui b/tqtinterface/qt4/tools/designer/designer/variabledialog.ui
new file mode 100644
index 0000000..6ea81ff
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/variabledialog.ui
@@ -0,0 +1,301 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>VariableDialogBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2002-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>VariableDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>276</width>
+ <height>320</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Variable</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>varView</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>deleteButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>propBox</cstring>
+ </property>
+ <property name="title">
+ <string>Variable Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Acc&amp;ess:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>accessCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Variable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>varName</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>varName</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>public</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>protected</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>private</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>accessCombo</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>addButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="3" column="3">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>addButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>addVariable()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>varName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>nameChanged()</slot>
+ </connection>
+ <connection>
+ <sender>deleteButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>deleteVariable()</slot>
+ </connection>
+ <connection>
+ <sender>accessCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>accessChanged()</slot>
+ </connection>
+ <connection>
+ <sender>varView</sender>
+ <signal>currentChanged(TQListViewItem*)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>currentItemChanged(TQListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>varView</sender>
+ <signal>selectionChanged(TQListViewItem*)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>currentItemChanged(TQListViewItem*)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>varView</tabstop>
+ <tabstop>addButton</tabstop>
+ <tabstop>deleteButton</tabstop>
+ <tabstop>varName</tabstop>
+ <tabstop>accessCombo</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot>addVariable()</slot>
+ <slot>deleteVariable()</slot>
+ <slot>accessChanged()</slot>
+ <slot>nameChanged()</slot>
+ <slot>okClicked()</slot>
+ <slot>currentItemChanged( TQListViewItem * i )</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/variabledialogimpl.cpp b/tqtinterface/qt4/tools/designer/designer/variabledialogimpl.cpp
new file mode 100644
index 0000000..e84a332
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/variabledialogimpl.cpp
@@ -0,0 +1,185 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqlistview.h>
+#include <tqgroupbox.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqmessagebox.h>
+
+#include "metadatabase.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "command.h"
+#include "variabledialogimpl.h"
+
+
+VariableDialog::VariableDialog( FormWindow *fw, TQWidget *tqparent )
+ : VariableDialogBase( tqparent ), formWindow( fw )
+{
+ varView->setSorting( -1 );
+ TQValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( formWindow );
+ TQValueList<MetaDataBase::Variable>::Iterator it = varLst.begin();
+ for ( ; it != varLst.end(); ++it ) {
+ TQListViewItem *i = new TQListViewItem( varView );
+ i->setText( 0, (*it).varName );
+ i->setText( 1, (*it).varAccess );
+ }
+
+ if ( varView->firstChild() )
+ varView->setCurrentItem( varView->firstChild() );
+ else
+ propBox->setEnabled( FALSE );
+}
+
+VariableDialog::~VariableDialog()
+{
+}
+
+void VariableDialog::setCurrentItem( TQString text )
+{
+ TQListViewItem *i = varView->tqfindItem( text, 0 );
+ if ( i )
+ varView->setCurrentItem( i );
+}
+
+void VariableDialog::okClicked()
+{
+ TQValueList<MetaDataBase::Variable> lst;
+
+ TQListViewItemIterator it( varView );
+ while ( it.current() != 0 ) {
+ MetaDataBase::Variable v;
+ v.varName = it.current()->text( 0 ).simplifyWhiteSpace();
+ if ( v.varName[ (int)v.varName.length() - 1 ] != ';' )
+ v.varName += ";";
+ v.varAccess = it.current()->text( 1 );
+ lst << v;
+ ++it;
+ }
+
+ if ( !lst.isEmpty() ) {
+ TQValueList<MetaDataBase::Variable> invalidLst;
+ TQValueList<MetaDataBase::Variable>::Iterator it1 = lst.begin();
+ TQValueList<MetaDataBase::Variable>::Iterator it2;
+ for ( ; it1 != lst.end(); ++it1 ) {
+ it2 = it1;
+ ++it2;
+ for ( ; it2 != lst.end(); ++it2 ) {
+ if ( MetaDataBase::extractVariableName( (*it1).varName ) ==
+ MetaDataBase::extractVariableName( (*it2).varName ) ) {
+ invalidLst << (*it1);
+ break;
+ }
+ }
+ }
+ if ( !invalidLst.isEmpty() ) {
+ if ( TQMessageBox::information( this, tr( "Edit Variables" ),
+ tr( "One variable has been declared twice.\n"
+ "Remove this variable?" ), tr( "&Yes" ), tr( "&No" ) ) == 0 ) {
+ for ( it2 = invalidLst.begin(); it2 != invalidLst.end(); ++it2 ) {
+ it = varView->firstChild();
+ while ( it.current() != 0 ) {
+ if ( MetaDataBase::extractVariableName( (*it)->text( 0 ).simplifyWhiteSpace() ) ==
+ MetaDataBase::extractVariableName( (*it2).varName ) ) {
+ delete (*it);
+ break;
+ }
+ ++it;
+ }
+ }
+ }
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ return;
+ }
+ }
+ Command *cmd = new SetVariablesCommand( "Edit variables", formWindow, lst );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ accept();
+}
+
+void VariableDialog::addVariable()
+{
+ TQListViewItem *i = new TQListViewItem( varView, varView->lastItem() );
+ i->setText( 0, "int newVariable" );
+ i->setText( 1, "protected" );
+ varView->setCurrentItem( i );
+ varView->setSelected( i, TRUE );
+ varName->setFocus();
+ varName->selectAll();
+}
+
+void VariableDialog::deleteVariable()
+{
+ TQListViewItem *i = varView->selectedItem();
+ if ( !i )
+ return;
+ delete i;
+ i = 0;
+ if ( varView->firstChild() )
+ varView->setSelected( varView->firstChild(), TRUE );
+}
+
+void VariableDialog::currentItemChanged( TQListViewItem *i )
+{
+ if ( !i ) {
+ varName->clear();
+ accessCombo->setCurrentItem( 1 );
+ propBox->setEnabled( FALSE );
+ return;
+ }
+ varName->setText( i->text( 0 ) );
+ if ( i->text( 1 ) == "public" )
+ accessCombo->setCurrentItem( 0 );
+ else if ( i->text( 1 ) == "protected" )
+ accessCombo->setCurrentItem( 1 );
+ else
+ accessCombo->setCurrentItem( 2 );
+ propBox->setEnabled( TRUE );
+}
+
+void VariableDialog::nameChanged()
+{
+ if ( !varView->currentItem() )
+ return;
+ varView->currentItem()->setText( 0, varName->text() );
+}
+
+void VariableDialog::accessChanged()
+{
+ if ( !varView->currentItem() )
+ return;
+ varView->currentItem()->setText( 1, accessCombo->currentText() );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/variabledialogimpl.h b/tqtinterface/qt4/tools/designer/designer/variabledialogimpl.h
new file mode 100644
index 0000000..0ce9f8e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/variabledialogimpl.h
@@ -0,0 +1,64 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef VARIABLEDIALOGIMPL_H
+#define VARIABLEDIALOGIMPL_H
+
+#include "variabledialog.h"
+
+class FormWindow;
+class TQListView;
+
+class VariableDialog : public VariableDialogBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ VariableDialog( FormWindow *fw, TQWidget* tqparent = 0 );
+ ~VariableDialog();
+
+ void setCurrentItem( TQString text );
+
+protected Q_SLOTS:
+ void okClicked();
+ void addVariable();
+ void deleteVariable();
+ void nameChanged();
+ void accessChanged();
+ void currentItemChanged( TQListViewItem *i );
+
+private:
+ FormWindow *formWindow;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/widgetaction.cpp b/tqtinterface/qt4/tools/designer/designer/widgetaction.cpp
new file mode 100644
index 0000000..3435e44
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/widgetaction.cpp
@@ -0,0 +1,65 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "widgetaction.h"
+#include <tqwidget.h>
+#include <tqtoolbutton.h>
+#include "mainwindow.h"
+#include <tqstylefactory.h>
+#include <tqstyle.h>
+
+static TQStyle *windowsStyle = 0;
+
+void WidgetAction::addedTo( TQWidget *w, TQWidget *container )
+{
+ if ( ::tqqt_cast<TQToolButton*>(w) && ::tqqt_cast<TQScrollView*>(container->tqparent()->tqparent()) ) {
+ if ( !windowsStyle )
+ windowsStyle = TQStyleFactory::create( "windows" );
+ w->setStyle( windowsStyle );
+ ( (TQToolButton*)w )->setUsesTextLabel( TRUE );
+ ( (TQToolButton*)w )->setTextPosition( TQToolButton::Right );
+ w->setBackgroundMode( container->backgroundMode() );
+ }
+}
+
+WidgetAction::~WidgetAction()
+{
+ if ( MainWindow::self )
+ MainWindow::self->toolActions.removeRef( this );
+}
+
+void WidgetAction::init( const TQString &g )
+{
+ MainWindow::self->toolActions.append( this );
+ grp = g;
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/widgetaction.h b/tqtinterface/qt4/tools/designer/designer/widgetaction.h
new file mode 100644
index 0000000..b1658f5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/widgetaction.h
@@ -0,0 +1,72 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef WIDGETACTION_H
+#define WIDGETACTION_H
+
+#include <tqaction.h>
+
+class WidgetAction : public TQAction
+{
+ TQ_OBJECT
+
+public:
+ WidgetAction( const TQString &grp, TQObject* tqparent,
+ const char* name = 0, bool toggle = FALSE )
+ : TQAction( tqparent, name, toggle ) { init( grp ); }
+ WidgetAction( const TQString &grp, const TQString& text,
+ const TQIconSet& icon, const TQString& menuText, TQKeySequence accel,
+ TQObject* tqparent, const char* name = 0, bool toggle = FALSE )
+ : TQAction( text, icon, menuText, accel, tqparent, name, toggle ) { init( grp ); }
+ WidgetAction( const TQString &grp, const TQString& text,
+ const TQString& menuText, TQKeySequence accel, TQObject* tqparent,
+ const char* name = 0, bool toggle = FALSE )
+ : TQAction( text, menuText, accel, tqparent, name, toggle ) { init( grp ); }
+ ~WidgetAction();
+
+#if !defined(TQ_NO_USING_KEYWORD)
+ using TQAction::addedTo;
+#endif
+ void addedTo( TQWidget *, TQWidget * );
+
+ TQString group() const { return grp; }
+
+private:
+ void init( const TQString &g );
+
+private:
+ TQString grp;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp b/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp
new file mode 100644
index 0000000..84ccb85
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/widgetfactory.cpp
@@ -0,0 +1,1829 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvariant.h> // HP-UX compiler need this here
+#include "widgetfactory.h"
+#include <widgetdatabase.h>
+#include "metadatabase.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+#include "propertyeditor.h"
+#include "tqlayout.h"
+#include "listboxeditorimpl.h"
+#include "listvieweditorimpl.h"
+#include "iconvieweditorimpl.h"
+#include "formwindow.h"
+#include "multilineeditorimpl.h"
+#include "../interfaces/widgetinterface.h"
+#ifndef TQT_NO_TABLE
+#include "tableeditorimpl.h"
+#endif
+#include "project.h"
+#include "menubareditor.h"
+#include "popupmenueditor.h"
+
+#include <tqfeatures.h>
+
+#include <tqpixmap.h>
+#include <tqgroupbox.h>
+#include <tqiconview.h>
+#ifndef TQT_NO_TABLE
+#include <tqtable.h>
+#endif
+#ifndef TQT_NO_SQL
+#include <tqdatatable.h>
+#endif
+#include <tqdatetimeedit.h>
+#include <tqlineedit.h>
+#include <tqspinbox.h>
+#include <tqmultilineedit.h>
+#include <tqtextedit.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqwidgetstack.h>
+#include <tqcombobox.h>
+#include <tqtabbar.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqobjectlist.h>
+#include <tqlcdnumber.h>
+#include <tqslider.h>
+#include <tqdial.h>
+#include <tqprogressbar.h>
+#include <tqtextview.h>
+#include <tqtextbrowser.h>
+#include <tqframe.h>
+#include <tqmetaobject.h>
+#include <tqwidgetstack.h>
+#include <tqwizard.h>
+#include <tqvaluelist.h>
+#include <tqtimer.h>
+#include <tqscrollbar.h>
+#include <tqmainwindow.h>
+#include <tqmenubar.h>
+#include <tqapplication.h>
+#include <tqsplitter.h>
+#include <tqtoolbox.h>
+#include <tqsizegrip.h>
+#ifndef TQT_NO_SQL
+#include "database.h"
+#endif
+
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include <tqobject.h>
+
+FormWindow *tqfind_formwindow( TQWidget *w )
+{
+ if ( !w )
+ return 0;
+ for (;;) {
+ if ( ::tqqt_cast<FormWindow*>(w) )
+ return (FormWindow*)w;
+ if ( !w->parentWidget() )
+ return 0;
+ w = w->parentWidget();
+ }
+}
+
+void TQLayoutWidget::paintEvent( TQPaintEvent* )
+{
+ TQPainter p ( this );
+ p.setPen( Qt::red );
+ p.drawRect( rect() );
+}
+
+
+TQDesignerTabWidget::TQDesignerTabWidget( TQWidget *tqparent, const char *name )
+ : TQTabWidget( tqparent, name ), dropIndicator( 0 ), dragPage( 0 ), mousePressed( FALSE )
+{
+ tabBar()->setAcceptDrops( TRUE );
+ tabBar()->installEventFilter( this );
+}
+
+int TQDesignerTabWidget::currentPage() const
+{
+ return tabBar()->currentTab();
+}
+
+void TQDesignerTabWidget::setCurrentPage( int i )
+{
+ tabBar()->setCurrentTab( i );
+}
+
+TQString TQDesignerTabWidget::pageTitle() const
+{
+ return ((TQTabWidget*)this)->tabLabel( TQTabWidget::currentPage() );
+}
+
+void TQDesignerTabWidget::setPageTitle( const TQString& title )
+{
+ changeTab( TQTabWidget::currentPage(), title );
+}
+
+void TQDesignerTabWidget::setPageName( const TQCString& name )
+{
+ if ( TQTabWidget::currentPage() )
+ TQTabWidget::currentPage()->setName( name );
+}
+
+TQCString TQDesignerTabWidget::pageName() const
+{
+ if ( !TQTabWidget::currentPage() )
+ return 0;
+ return TQTabWidget::currentPage()->name();
+}
+
+int TQDesignerTabWidget::count() const
+{
+ return tabBar()->count();
+}
+
+bool TQDesignerTabWidget::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(tabBar()) ) return FALSE;
+
+ switch ( e->type() ) {
+ case TQEvent::MouseButtonPress: {
+ mousePressed = TRUE;
+ TQMouseEvent *me = (TQMouseEvent*)e;
+ pressPoint = me->pos();
+ }
+ break;
+ case TQEvent::MouseMove: {
+ TQMouseEvent *me = (TQMouseEvent*)e;
+ if ( mousePressed && ( pressPoint - me->pos()).manhattanLength() > TQApplication::startDragDistance() ) {
+ TQTextDrag *drg = new TQTextDrag( TQString::number( (long) this ) , this );
+ mousePressed = FALSE;
+ dragPage = TQTabWidget::currentPage();
+ dragLabel = TQTabWidget::tabLabel( dragPage );
+
+ int index = indexOf( dragPage );
+
+ removePage( dragPage );
+ if ( !drg->dragMove() ) {
+ insertTab( dragPage, dragLabel, index );
+ showPage( dragPage );
+ }
+ if ( dropIndicator )
+ dropIndicator->hide();
+ }
+ }
+ break;
+ case TQEvent::DragLeave: {
+ if ( dropIndicator )
+ dropIndicator->hide();
+ }
+ break;
+ case TQEvent::DragMove: {
+ TQDragEnterEvent *de = (TQDragEnterEvent*) e;
+ if ( TQTextDrag::canDecode( de ) ) {
+ TQString text;
+ TQTextDrag::decode( de, text );
+ if ( text == TQString::number( (long)this ) )
+ de->accept();
+ else
+ return FALSE;
+ }
+
+ int index = 0;
+ TQRect rect;
+ for ( ; index < tabBar()->count(); index++ ) {
+ if ( tabBar()->tabAt( index )->rect().tqcontains( de->pos() ) ) {
+ rect = tabBar()->tabAt( index )->rect();
+ break;
+ }
+ }
+
+ if ( index == tabBar()->count() -1 ) {
+ TQRect rect2 = rect;
+ rect2.setLeft( rect2.left() + rect2.width() / 2 );
+ if ( rect2.tqcontains( de->pos() ) )
+ index++;
+ }
+
+ if ( ! dropIndicator ) {
+ dropIndicator = new TQWidget( this );
+ dropIndicator->setBackgroundColor( Qt::red );
+ }
+
+ TQPoint pos;
+ if ( index == tabBar()->count() )
+ pos = tabBar()->mapToParent( TQPoint( rect.x() + rect.width(), rect.y() ) );
+ else
+ pos = tabBar()->mapToParent( TQPoint( rect.x(), rect.y() ) );
+
+ dropIndicator->setGeometry( pos.x(), pos.y() , 3, rect.height() );
+ dropIndicator->show();
+ }
+ break;
+ case TQEvent::Drop: {
+ TQDragEnterEvent *de = (TQDragEnterEvent*) e;
+ if ( TQTextDrag::canDecode( de ) ) {
+ TQString text;
+ TQTextDrag::decode( de, text );
+ if ( text == TQString::number( (long)this ) ) {
+
+ int newIndex = 0;
+ for ( ; newIndex < tabBar()->count(); newIndex++ ) {
+ if ( tabBar()->tabAt( newIndex )->rect().tqcontains( de->pos() ) )
+ break;
+ }
+
+ if ( newIndex == tabBar()->count() -1 ) {
+ TQRect rect2 = tabBar()->tabAt( newIndex )->rect();
+ rect2.setLeft( rect2.left() + rect2.width() / 2 );
+ if ( rect2.tqcontains( de->pos() ) )
+ newIndex++;
+ }
+
+ int oldIndex = 0;
+ for ( ; oldIndex < tabBar()->count(); oldIndex++ ) {
+ if ( tabBar()->tabAt( oldIndex )->rect().tqcontains( pressPoint ) )
+ break;
+ }
+
+ FormWindow *fw = tqfind_formwindow( this );
+ MoveTabPageCommand *cmd =
+ new MoveTabPageCommand( tr( "Move Tab Page" ), fw, this,
+ dragPage, dragLabel, newIndex, oldIndex );
+ fw->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ de->accept();
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+TQDesignerWidgetStack::TQDesignerWidgetStack( TQWidget *tqparent, const char *name )
+ : TQWidgetStack( tqparent, name )
+{
+ prev = new TQToolButton( TQt::LeftArrow, this, "designer_wizardstack_button" );
+ prev->setAutoRaise( TRUE );
+ prev->setAutoRepeat( TRUE );
+ prev->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored ) );
+ next = new TQToolButton( TQt::RightArrow, this, "designer_wizardstack_button" );
+ next->setAutoRaise( TRUE );
+ next->setAutoRepeat( TRUE );
+ next->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored ) );
+ connect( prev, TQT_SIGNAL( clicked() ), this, TQT_SLOT( prevPage() ) );
+ connect( next, TQT_SIGNAL( clicked() ), this, TQT_SLOT( nextPage() ) );
+ updateButtons();
+}
+
+void TQDesignerWidgetStack::updateButtons()
+{
+ prev->setGeometry( width() - 31, 1, 15, 15 );
+ next->setGeometry( width() - 16, 1, 15, 15 );
+ prev->show();
+ next->show();
+ prev->raise();
+ next->raise();
+}
+
+void TQDesignerWidgetStack::prevPage()
+{
+ setCurrentPage( currentPage() - 1 );
+}
+
+void TQDesignerWidgetStack::nextPage()
+{
+ setCurrentPage( currentPage() + 1 );
+}
+
+int TQDesignerWidgetStack::currentPage() const
+{
+ TQDesignerWidgetStack* that = (TQDesignerWidgetStack*) this;
+ return that->pages.tqfind( visibleWidget() );
+}
+
+void TQDesignerWidgetStack::setCurrentPage( int i )
+{
+ // help next/prev page commands
+ if ( i < 0 )
+ i += count();
+ if ( i >= count() )
+ i -= count();
+
+ if ( i < 0 || i >= count() )
+ return;
+ raiseWidget( pages.at( i ) );
+ updateButtons();
+}
+
+TQCString TQDesignerWidgetStack::pageName() const
+{
+ if ( !visibleWidget() )
+ return 0;
+ return visibleWidget()->name();
+}
+
+void TQDesignerWidgetStack::setPageName( const TQCString& name )
+{
+ if ( visibleWidget() )
+ visibleWidget()->setName( name );
+}
+
+int TQDesignerWidgetStack::count() const
+{
+ return pages.count();
+}
+
+TQWidget* TQDesignerWidgetStack::page( int i ) const
+{
+ if ( i < 0 || i >= count() )
+ return 0;
+ TQDesignerWidgetStack* that = (TQDesignerWidgetStack*) this;
+ return that->pages.at( i );
+}
+
+
+int TQDesignerWidgetStack::insertPage( TQWidget *p, int i )
+{
+ if ( i < 0 )
+ pages.append( p );
+ else
+ pages.insert( (uint) i, p );
+ addWidget( p );
+ p->show();
+ raiseWidget( p );
+ TQApplication::sendPostedEvents();
+ updateButtons();
+ return pages.tqfind( p );
+}
+
+int TQDesignerWidgetStack::removePage( TQWidget *p )
+{
+ int i = pages.tqfind( p );
+ pages.remove( p );
+ removeWidget( p );
+ setCurrentPage( 0 );
+ updateButtons();
+ return i;
+}
+
+
+int TQDesignerWizard::currentPageNum() const
+{
+ for ( int i = 0; i < pageCount(); ++i ) {
+ if ( page( i ) == currentPage() )
+ return i;
+ }
+ return 0;
+}
+
+
+
+
+
+void TQDesignerWizard::setCurrentPage( int i )
+{
+ if ( i < currentPageNum() ) {
+ while ( i < currentPageNum() ) {
+ if ( currentPageNum() == 0 )
+ break;
+ back();
+ }
+
+ } else {
+ while ( i > currentPageNum() ) {
+ if ( currentPageNum() == pageCount() - 1 )
+ break;
+ next();
+ }
+ }
+}
+
+TQString TQDesignerWizard::pageTitle() const
+{
+ return title( currentPage() );
+}
+
+void TQDesignerWizard::setPageTitle( const TQString& title )
+{
+ setTitle( currentPage(), title );
+}
+
+void TQDesignerWizard::setPageName( const TQCString& name )
+{
+ if ( TQWizard::currentPage() )
+ TQWizard::currentPage()->setName( name );
+}
+
+TQCString TQDesignerWizard::pageName() const
+{
+ if ( !TQWizard::currentPage() )
+ return 0;
+ return TQWizard::currentPage()->name();
+}
+
+int TQDesignerWizard::pageNum( TQWidget *p )
+{
+ for ( int i = 0; i < pageCount(); ++i ) {
+ if ( page( i ) == p )
+ return i;
+ }
+ return -1;
+}
+
+void TQDesignerWizard::addPage( TQWidget *p, const TQString &t )
+{
+ TQWizard::addPage( p, t );
+ if ( removedPages.tqfind( p ) )
+ removedPages.remove( p );
+}
+
+void TQDesignerWizard::removePage( TQWidget *p )
+{
+ TQWizard::removePage( p );
+ removedPages.insert( p, p );
+}
+
+void TQDesignerWizard::insertPage( TQWidget *p, const TQString &t, int index )
+{
+ TQWizard::insertPage( p, t, index );
+ if ( removedPages.tqfind( p ) )
+ removedPages.remove( p );
+}
+
+TQMap< int, TQMap< TQString, TQVariant> > *defaultProperties = 0;
+TQMap< int, TQStringList > *changedProperties = 0;
+
+/*!
+ \class WidgetFactory widgetfactory.h
+ \brief Set of static functions for creating widgets, layouts and do other stuff
+
+ The widget factory offers functions to create widgets, create and
+ delete layouts tqfind out other details - all based on the
+ WidgetDatabase's data. So the functions that use ids use the same
+ ids as in the WidgetDatabase.
+*/
+
+
+void WidgetFactory::saveDefaultProperties( TQT_BASE_OBJECT_NAME *tqbo, int id )
+{
+ TQObject *w = TQT_TQOBJECT(tqbo);
+ TQMap< TQString, TQVariant> propMap;
+ TQStrList lst = w->tqmetaObject()->propertyNames( TRUE );
+ for ( uint i = 0; i < lst.count(); ++i ) {
+ TQVariant var = w->property( lst.at( i ) );
+ if ( !var.isValid() && qstrcmp( "pixmap", lst.at( i ) ) == 0 )
+ var = TQVariant( TQPixmap() );
+ else if ( !var.isValid() && qstrcmp( "iconSet", lst.at( i ) ) == 0 )
+ var = TQVariant( TQIconSet() );
+ propMap.tqreplace( lst.at( i ), var );
+ }
+ defaultProperties->tqreplace( id, propMap );
+}
+
+void WidgetFactory::saveChangedProperties( TQT_BASE_OBJECT_NAME *w, int id )
+{
+ TQStringList l = MetaDataBase::changedProperties( w );
+ changedProperties->insert( id, l );
+}
+
+/*! Creates a widget of the type which is registered as \a id as
+ child of \a tqparent. The \a name is optional. If \a init is TRUE, the
+ widget is initialized with some defaults, else the plain widget is
+ created.
+*/
+
+TQWidget *WidgetFactory::create( int id, TQWidget *tqparent, const char *name, bool init, const TQRect *r, Qt::Orientation orient )
+{
+ TQString n = WidgetDatabase::className( id );
+ if ( n.isEmpty() )
+ return 0;
+
+ if ( !defaultProperties ) {
+ defaultProperties = new TQMap< int, TQMap< TQString, TQVariant> >();
+ changedProperties = new TQMap< int, TQStringList >();
+ }
+
+ TQWidget *w = 0;
+ TQString str = WidgetDatabase::createWidgetName( id );
+ const char *s = str.latin1();
+ w = createWidget( n, tqparent, name ? name : s, init, r, orient );
+ if ( ::tqqt_cast<TQScrollView*>(w) )
+ ( (TQScrollView*)w )->disableSizeHintCaching();
+ if ( !w && WidgetDatabase::isCustomWidget( id ) )
+ w = createCustomWidget( tqparent, name ? name : s, MetaDataBase::customWidget( id ) );
+ if ( !w )
+ return 0;
+ MetaDataBase::addEntry( w );
+
+ if ( !defaultProperties->tqcontains( id ) )
+ saveDefaultProperties( w, id );
+ if ( !changedProperties->tqcontains( id ) )
+ saveChangedProperties( w, id );
+
+ return w;
+}
+
+/*! Creates a tqlayout on the widget \a widget of the type \a type
+ which can be \c HBox, \c VBox or \c Grid.
+*/
+
+TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, LayoutType type )
+{
+ int spacing = MainWindow::self->currentLayoutDefaultSpacing();
+ int margin = 0;
+
+ int metaspacing = MetaDataBase::spacing( widget );
+ int metamargin = MetaDataBase::margin( widget );
+
+ if ( ::tqqt_cast<TQLayoutWidget*>(widget) &&
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
+ widget && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) )
+ margin = MainWindow::self->currentLayoutDefaultMargin();
+
+ if ( !tqlayout && ::tqqt_cast<TQTabWidget*>(widget) )
+ widget = ((TQTabWidget*)widget)->currentPage();
+
+ if ( !tqlayout && ::tqqt_cast<TQWizard*>(widget) )
+ widget = ((TQWizard*)widget)->currentPage();
+
+ if ( !tqlayout && ::tqqt_cast<TQMainWindow*>(widget) )
+ widget = ((TQMainWindow*)widget)->centralWidget();
+
+ if ( !tqlayout && ::tqqt_cast<TQWidgetStack*>(widget) )
+ widget = ((TQWidgetStack*)widget)->visibleWidget();
+
+ if ( !tqlayout && ::tqqt_cast<TQToolBox*>(widget) )
+ widget = ((TQToolBox*)widget)->currentItem();
+
+ MetaDataBase::addEntry( widget );
+
+ TQLayout *l = 0;
+ int align = 0;
+ if ( !tqlayout && ::tqqt_cast<TQGroupBox*>(widget) ) {
+ TQGroupBox *gb = (TQGroupBox*)widget;
+ gb->setColumnLayout( 0, Qt::Vertical );
+ tqlayout = gb->tqlayout();
+ tqlayout->setMargin( 0 );
+ tqlayout->setSpacing( 0 );
+ switch ( type ) {
+ case HBox:
+ l = new TQHBoxLayout( tqlayout );
+ break;
+ case VBox:
+ l = new TQVBoxLayout( tqlayout );
+ break;
+ case Grid:
+ l = TQT_TQLAYOUT(new TQDesignerGridLayout( tqlayout ));
+ break;
+ default:
+ return 0;
+ }
+ align = TQt::AlignTop;
+ MetaDataBase::setMargin( gb, metamargin );
+ MetaDataBase::setSpacing( gb, metaspacing );
+ } else {
+ if ( tqlayout ) {
+ switch ( type ) {
+ case HBox:
+ l = new TQHBoxLayout( tqlayout );
+ break;
+ case VBox:
+ l = new TQVBoxLayout( tqlayout );
+ break;
+ case Grid:
+ l = TQT_TQLAYOUT(new TQDesignerGridLayout( tqlayout ));
+ break;
+ default:
+ return 0;
+ }
+ MetaDataBase::addEntry( l );
+ l->setSpacing( spacing );
+ l->setMargin( margin );
+ } else {
+ switch ( type ) {
+ case HBox:
+ l = new TQHBoxLayout( widget );
+ break;
+ case VBox:
+ l = new TQVBoxLayout( widget );
+ break;
+ case Grid:
+ l = TQT_TQLAYOUT(new TQDesignerGridLayout( widget ));
+ break;
+ default:
+ return 0;
+ }
+ MetaDataBase::addEntry( l );
+ if ( widget ) {
+ MetaDataBase::setMargin( widget, metamargin );
+ MetaDataBase::setSpacing( widget, metaspacing );
+ } else {
+ l->setMargin( margin );
+ l->setSpacing( spacing );
+ }
+ }
+ }
+ l->tqsetAlignment( align );
+ MetaDataBase::addEntry( l );
+ return l;
+}
+
+void WidgetFactory::deleteLayout( TQWidget *widget )
+{
+ if ( !widget )
+ return;
+
+ if ( ::tqqt_cast<TQTabWidget*>(widget) )
+ widget = ((TQTabWidget*)widget)->currentPage();
+ if ( ::tqqt_cast<TQWizard*>(widget) )
+ widget = ((TQWizard*)widget)->currentPage();
+ if ( ::tqqt_cast<TQMainWindow*>(widget) )
+ widget = ((TQMainWindow*)widget)->centralWidget();
+ if ( ::tqqt_cast<TQWidgetStack*>(widget) )
+ widget = ((TQWidgetStack*)widget)->visibleWidget();
+ if ( ::tqqt_cast<TQToolBox*>(widget) )
+ widget = ((TQToolBox*)widget)->currentItem();
+ delete widget->tqlayout();
+}
+
+/*! Factory functions for creating a widget of the type \a className
+ as child of \a tqparent with the name \a name.
+
+ If \a init is TRUE, some initial default properties are set. This
+ has to be in sync with the initChangedProperties() function!
+*/
+
+TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *tqparent, const char *name, bool init,
+ const TQRect *r, Qt::Orientation orient )
+{
+ if ( className == "TQPushButton" ) {
+ TQPushButton *b = 0;
+ if ( init ) {
+ b = new TQDesignerPushButton( tqparent, name );
+ b->setText( TQString::tqfromLatin1( name ) );
+ } else {
+ b = new TQDesignerPushButton( tqparent, name );
+ }
+ TQWidget *w = tqfind_formwindow( b );
+ b->setAutoDefault( w && ::tqqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) );
+ return b;
+ } else if ( className == "TQToolButton" ) {
+ if ( init ) {
+ TQDesignerToolButton *tb = new TQDesignerToolButton( tqparent, name );
+ if ( ::tqqt_cast<TQToolBox*>(widgetOfContainer(tqparent))) {
+ tb->setUsesTextLabel(TRUE);
+ tb->setTextLabel("...");
+ tb->setAutoRaise(TRUE);
+ tb->setTextPosition(TQToolButton::BesideIcon);
+ } else {
+ tb->setText( "..." );
+ }
+ return tb;
+ }
+ return new TQDesignerToolButton( tqparent, name );
+ } else if ( className == "TQCheckBox" ) {
+ if ( init ) {
+ TQDesignerCheckBox *cb = new TQDesignerCheckBox( tqparent, name );
+ cb->setText( TQString::tqfromLatin1( name ) );
+ return cb;
+ }
+ return new TQDesignerCheckBox( tqparent, name );
+ } else if ( className == "TQRadioButton" ) {
+ if ( init ) {
+ TQDesignerRadioButton *rb = new TQDesignerRadioButton( tqparent, name );
+ rb->setText( TQString::tqfromLatin1( name ) );
+ return rb;
+ }
+ return new TQDesignerRadioButton( tqparent, name );
+ } else if ( className == "TQGroupBox" ) {
+ if ( init )
+ return new TQGroupBox( TQString::tqfromLatin1( name ), tqparent, name );
+ return new TQGroupBox( tqparent, name );
+ } else if ( className == "TQButtonGroup" ) {
+ if ( init )
+ return new TQButtonGroup( TQString::tqfromLatin1( name ), tqparent, name );
+ return new TQButtonGroup( tqparent, name );
+ } else if ( className == "TQIconView" ) {
+#if !defined(TQT_NO_ICONVIEW)
+ TQIconView* iv = new TQIconView( tqparent, name );
+ if ( init )
+ (void) new TQIconViewItem( iv, MainWindow::tr( "New Item" ) );
+ return iv;
+#else
+ return 0;
+#endif
+ } else if ( className == "TQTable" ) {
+#if !defined(TQT_NO_TABLE)
+ if ( init )
+ return new TQTable( 3, 3, tqparent, name );
+ return new TQTable( tqparent, name );
+#else
+ return 0;
+#endif
+#ifndef TQT_NO_SQL
+ } else if ( className == "TQDataTable" ) {
+ return new TQDataTable( tqparent, name );
+#endif //TQT_NO_SQL
+ } else if ( className == "TQDateEdit" ) {
+ return new TQDateEdit( tqparent, name );
+ } else if ( className == "TQTimeEdit" ) {
+ return new TQTimeEdit( tqparent, name );
+ } else if ( className == "TQDateTimeEdit" ) {
+ return new TQDateTimeEdit( tqparent, name );
+ }
+ else if ( className == "TQListBox" ) {
+ TQListBox* lb = new TQListBox( tqparent, name );
+ if ( init ) {
+ lb->insertItem( MainWindow::tqtr( "New Item" ) );
+ lb->setCurrentItem( 0 );
+ }
+ return lb;
+ } else if ( className == "TQListView" ) {
+ TQListView *lv = new TQListView( tqparent, name );
+ lv->setSorting( -1 );
+ if ( init ) {
+ lv->addColumn( MainWindow::tr( "Column 1" ) );
+ lv->setCurrentItem( new TQListViewItem( lv, MainWindow::tr( "New Item" ) ) );
+ }
+ return lv;
+ } else if ( className == "TQLineEdit" )
+ return new TQLineEdit( tqparent, name );
+ else if ( className == "TQSpinBox" )
+ return new TQSpinBox( tqparent, name );
+ else if ( className == "TQSplitter" )
+ return new TQSplitter( tqparent, name );
+ else if ( className == "TQMultiLineEdit" )
+ return new TQMultiLineEdit( tqparent, name );
+ else if ( className == "TQTextEdit" )
+ return new TQTextEdit( tqparent, name );
+ else if ( className == "TQLabel" || className == "TextLabel" ) {
+ TQDesignerLabel *l = new TQDesignerLabel( tqparent, name );
+ if ( init ) {
+ l->setText( TQString::tqfromLatin1( name ) );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "text", TRUE );
+ }
+ return l;
+ } else if ( className == "PixmapLabel" ) {
+ TQDesignerLabel *l = new TQDesignerLabel( tqparent, name );
+ if ( init ) {
+ l->setPixmap( TQPixmap::fromMimeSource( "designer_qtlogo.png" ) );
+ l->setScaledContents( TRUE );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "pixmap", TRUE );
+ MetaDataBase::setPropertyChanged( l, "scaledContents", TRUE );
+ }
+ return l;
+ } else if ( className == "TQLayoutWidget" )
+ return new TQLayoutWidget( tqparent, name );
+ else if ( className == "TQTabWidget" ) {
+ TQTabWidget *tw = new TQDesignerTabWidget( tqparent, name );
+ if ( init ) {
+ FormWindow *fw = tqfind_formwindow( tqparent );
+ TQWidget *w = fw ? new TQDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
+ tw->addTab( w, MainWindow::tr("Tab 1") );
+ MetaDataBase::addEntry( w );
+ w = fw ? new TQDesignerWidget( fw, tw, "tab" ) : new TQWidget( tw, "tab" );
+ tw->addTab( w, MainWindow::tr("Tab 2") );
+ MetaDataBase::addEntry( tw );
+ MetaDataBase::addEntry( w );
+ }
+ return tw;
+ } else if ( className == "TQWidgetStack" ) {
+ TQDesignerWidgetStack *ws = new TQDesignerWidgetStack( tqparent, name );
+ if ( init ) {
+ FormWindow *fw = tqfind_formwindow( tqparent );
+ TQWidget *w = fw ? new TQDesignerWidget( fw, ws, "WStackPage" ) : new TQWidget( ws, "WStackPage" );
+ ws->insertPage( w );
+ MetaDataBase::addEntry( w );
+ MetaDataBase::addEntry( ws );
+ }
+ return ws;
+ } else if ( className == "TQComboBox" ) {
+ return new TQComboBox( FALSE, tqparent, name );
+ } else if ( className == "TQWidget" ) {
+ if ( tqparent &&
+ ( ::tqqt_cast<FormWindow*>(tqparent) ||
+ ::tqqt_cast<TQWizard*>(tqparent) ||
+ ::tqqt_cast<TQTabWidget*>(tqparent) ||
+ ::tqqt_cast<TQWidgetStack*>(tqparent) ||
+ ::tqqt_cast<TQToolBox*>(tqparent) ||
+ ::tqqt_cast<TQMainWindow*>(tqparent) ) ) {
+ FormWindow *fw = tqfind_formwindow( tqparent );
+ if ( fw ) {
+ TQDesignerWidget *dw = new TQDesignerWidget( fw, tqparent, name );
+ MetaDataBase::addEntry( dw );
+ return dw;
+ }
+ }
+ return new TQWidget( tqparent, name );
+ } else if ( className == "TQDialog" ) {
+ TQDialog *dia = 0;
+ if ( ::tqqt_cast<FormWindow*>(tqparent) )
+ dia = new TQDesignerDialog( (FormWindow*)tqparent, tqparent, name );
+ else
+ dia = new TQDialog( tqparent, name );
+#if defined(TQT_NON_COMMERCIAL)
+ if ( ::tqqt_cast<MainWindow*>(tqparent) )
+#else
+ if ( tqparent )
+#endif
+ dia->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
+ return dia;
+ } else if ( className == "TQWizard" ) {
+ TQWizard *wiz = new TQDesignerWizard( tqparent, name );
+#if defined(TQT_NON_COMMERCIAL)
+ if ( ::tqqt_cast<MainWindow*>(tqparent) )
+#else
+ if ( tqparent )
+#endif
+ wiz->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
+ if ( init && ::tqqt_cast<FormWindow*>(tqparent) ) {
+ TQDesignerWidget *dw = new TQDesignerWidget( (FormWindow*)tqparent, wiz, "WizardPage" );
+ MetaDataBase::addEntry( dw );
+ wiz->addPage( dw, FormWindow::tr( "Page" ) );
+ TQTimer::singleShot( 0, wiz, TQT_SLOT( next() ) );
+ }
+ return wiz;
+ } else if ( className == "Spacer" ) {
+ Spacer *s = new Spacer( tqparent, name );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( s, "sizeType", TRUE );
+ if ( !r )
+ return s;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ s->setOrientation( orient );
+ else if ( r->width() < r->height() )
+ s->setOrientation( Qt::Vertical );
+ else
+ s->setOrientation( Qt::Horizontal );
+ return s;
+ } else if ( className == "TQLCDNumber" )
+ return new TQLCDNumber( tqparent, name );
+ else if ( className == "TQProgressBar" )
+ return new TQProgressBar( tqparent, name );
+ else if ( className == "TQTextView" )
+ return new TQTextView( tqparent, name );
+ else if ( className == "TQTextBrowser" )
+ return new TQTextBrowser( tqparent, name );
+ else if ( className == "TQDial" )
+ return new TQDial( tqparent, name );
+ else if ( className == "TQSlider" ) {
+ TQSlider *s = new TQSlider( tqparent, name );
+ if ( !r )
+ return s;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ s->setOrientation( orient );
+ else if ( r->width() > r->height() )
+ s->setOrientation( Qt::Horizontal );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ return s;
+ } else if ( className == "TQScrollBar" ) {
+ TQScrollBar *s = new TQScrollBar( tqparent, name );
+ if ( !r )
+ return s;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ s->setOrientation( orient );
+ else if ( r->width() > r->height() )
+ s->setOrientation( Qt::Horizontal );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ return s;
+ } else if ( className == "TQFrame" ) {
+ if ( !init )
+ return new TQFrame( tqparent, name );
+ TQFrame *f = new TQFrame( tqparent, name );
+ f->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised );
+ return f;
+ } else if ( className == "Line" ) {
+ Line *l = new Line( tqparent, name );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( l, "frameShadow", TRUE );
+ MetaDataBase::setPropertyChanged( l, "frameShape", TRUE );
+ if ( !r )
+ return l;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ l->setOrientation( orient );
+ else if ( r->width() < r->height() )
+ l->setOrientation( Qt::Vertical );
+ return l;
+ } else if ( className == "TQMainWindow" ) {
+ TQMainWindow *mw = new TQMainWindow( tqparent, name, 0 );
+ mw->setDockEnabled( TQt::TQt::DockMinimized, FALSE );
+ TQDesignerWidget *dw = new TQDesignerWidget( (FormWindow*)tqparent, mw, "central widget" );
+ mw->setDockMenuEnabled( FALSE );
+ MetaDataBase::addEntry( dw );
+ mw->setCentralWidget( dw );
+ (void)mw->statusBar();
+ dw->show();
+ return mw;
+ } else if ( className == "TQToolBox" ) {
+ if ( !init )
+ return new TQDesignerToolBox( tqparent, name );
+ TQToolBox *tb = new TQDesignerToolBox( tqparent, name );
+ FormWindow *fw = tqfind_formwindow( tqparent );
+ TQWidget *w = fw ? new TQDesignerWidget( fw, tb, "page1" ) :
+ new TQWidget( tb, "page1" );
+ tb->addItem( w, MainWindow::tr("Page 1") );
+ MetaDataBase::addEntry( w );
+ w = fw ? new TQDesignerWidget( fw, tb, "page2" ) : new TQWidget( tb, "page2" );
+ tb->addItem( w, MainWindow::tr("Page 2") );
+ MetaDataBase::addEntry( tb );
+ MetaDataBase::addEntry( w );
+ return tb;
+ }
+#ifndef TQT_NO_SQL
+ else if ( className == "TQDataBrowser" ) {
+ TQWidget *w = new TQDesignerDataBrowser( tqparent, name );
+ if ( tqparent )
+ w->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
+ return w;
+ } else if ( className == "TQDataView" ) {
+ TQWidget *w = new TQDesignerDataView( tqparent, name );
+ if ( tqparent )
+ w->reparent( tqparent, TQPoint( 0, 0 ), TRUE );
+ return w;
+ }
+#endif
+
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( className, &iface );
+ if ( !iface )
+ return 0;
+
+ TQWidget *w = iface->create( className, tqparent, name );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ if ( init && WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( className ) ) ) {
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ iface2->addPage( className, w, "Page", -1 );
+ iface2->release();
+ }
+ }
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+ iface->release();
+ return w;
+}
+
+
+
+/*! Find out which type the tqlayout of the widget is. Returns \c HBox,
+ \c VBox, \c Grid or \c NoLayout. \a tqlayout points to this
+ TQWidget::tqlayout() of \a w or to 0 after the function call.
+*/
+
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tqlayout )
+{
+ tqlayout = 0;
+
+ if ( ::tqqt_cast<TQTabWidget*>(w) )
+ w = ((TQTabWidget*)w)->currentPage();
+ if ( ::tqqt_cast<TQWizard*>(w) )
+ w = ((TQWizard*)w)->currentPage();
+ if ( ::tqqt_cast<TQMainWindow*>(w) )
+ w = ((TQMainWindow*)w)->centralWidget();
+ if ( ::tqqt_cast<TQWidgetStack*>(w) )
+ w = ((TQWidgetStack*)w)->visibleWidget();
+ if ( ::tqqt_cast<TQToolBox*>(w) )
+ w = ((TQToolBox*)w)->currentItem();
+
+ if ( ::tqqt_cast<TQSplitter*>(w) )
+ return ( (TQSplitter*)w )->orientation() == Qt::Horizontal ? HBox : VBox;
+
+ if ( !w || !w->tqlayout() )
+ return NoLayout;
+ TQLayout *lay = w->tqlayout();
+
+ if ( ::tqqt_cast<TQGroupBox*>(w) ) {
+ TQObjectList *l = TQT_TQOBJECT(lay)->queryList( "TQLayout" );
+ if ( l && l->first() )
+ lay = (TQLayout*)l->first();
+ delete l;
+ }
+ tqlayout = lay;
+
+ if ( ::tqqt_cast<TQHBoxLayout*>(lay) )
+ return HBox;
+ else if ( ::tqqt_cast<TQVBoxLayout*>(lay) )
+ return VBox;
+ else if ( ::tqqt_cast<TQGridLayout*>(lay) )
+ return Grid;
+ return NoLayout;
+}
+
+/*!
+ \overload
+*/
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *tqlayout )
+{
+ if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout) )
+ return HBox;
+ else if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout) )
+ return VBox;
+ else if ( ::tqqt_cast<TQGridLayout*>(tqlayout) )
+ return Grid;
+ return NoLayout;
+}
+
+/*!
+ \overload
+*/
+WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w )
+{
+ TQLayout *l = 0;
+ return layoutType( w, l );
+}
+
+
+TQWidget *WidgetFactory::layoutParent( TQLayout *tqlayout )
+{
+ TQObject *o = TQT_TQOBJECT(tqlayout);
+ while ( o ) {
+ if ( o->isWidgetType() )
+ return (TQWidget*)o;
+ o = o->tqparent();
+ }
+ return 0;
+}
+
+/*! Returns the widget into which tqchildren should be inserted when \a
+ w is a container known to the designer.
+
+ Usually that is \a w itself, sometimes it is different (e.g. a
+ tabwidget is known to the designer as a container but the child
+ widgets should be inserted into the current page of the
+ tabwidget. So in this case this function returns the current page of
+ the tabwidget.)
+ */
+TQWidget* WidgetFactory::containerOfWidget( TQWidget *w )
+{
+ if ( !w )
+ return w;
+ if ( ::tqqt_cast<TQTabWidget*>(w) )
+ return ((TQTabWidget*)w)->currentPage();
+ if ( ::tqqt_cast<TQWizard*>(w) )
+ return ((TQWizard*)w)->currentPage();
+ if ( ::tqqt_cast<TQWidgetStack*>(w) )
+ return ((TQWidgetStack*)w)->visibleWidget();
+ if ( ::tqqt_cast<TQToolBox*>(w) )
+ return ((TQToolBox*)w)->currentItem();
+ if ( ::tqqt_cast<TQMainWindow*>(w) )
+ return ((TQMainWindow*)w)->centralWidget();
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ if ( !WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) )
+ return w;
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( classNameOf( w ), &iface );
+ if ( !iface )
+ return w;
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
+ if ( !iface2 )
+ return w;
+ TQWidget *c = iface2->containerOfWidget( w->className(), w );
+ iface2->release();
+ iface->release();
+ if ( c )
+ return c;
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+ return w;
+}
+
+/*! Returns the actual designer widget of the container \a w. This is
+ normally \a w itself, but might be a tqparent or grand tqparent of \a w
+ (e.g. when working with a tabwidget and \a w is the container which
+ tqcontains and layouts childs, but the actual widget known to the
+ designer is the tabwidget which is the tqparent of \a w. So this
+ function returns the tabwidget then.)
+*/
+
+TQWidget* WidgetFactory::widgetOfContainer( TQWidget *w )
+{
+ if ( w && ::tqqt_cast<TQWidgetStack*>(w->parentWidget()) )
+ w = w->parentWidget();
+ if ( w->parentWidget() && w->parentWidget()->parentWidget() &&
+ w->parentWidget()->parentWidget()->parentWidget() &&
+ ::tqqt_cast<TQToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) )
+ return w->parentWidget()->parentWidget()->parentWidget();
+ while ( w ) {
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) );
+ if ( WidgetDatabase::isContainer( id ) ||
+ w && ::tqqt_cast<FormWindow*>(w->parentWidget()) )
+ return w;
+ w = w->parentWidget();
+ }
+ return w;
+}
+
+/*!
+ Returns whether \a o is a passive interactor or not.
+ */
+
+bool WidgetFactory::lastWasAPassiveInteractor = FALSE;
+TQGuardedPtr<TQObject> *WidgetFactory::lastPassiveInteractor = new TQGuardedPtr<TQObject>();
+
+bool WidgetFactory::isPassiveInteractor( TQT_BASE_OBJECT_NAME* tqbo )
+{
+ TQObject *o = TQT_TQOBJECT(tqbo);
+ if ( lastPassiveInteractor && *lastPassiveInteractor && (TQObject*)(*lastPassiveInteractor) == o )
+ return lastWasAPassiveInteractor;
+ lastWasAPassiveInteractor = FALSE;
+ (*lastPassiveInteractor) = o;
+ if ( TQApplication::activePopupWidget() ) // if a popup is open, we have to make sure that this one is closed, else X might do funny things
+ return ( lastWasAPassiveInteractor = TRUE );
+
+ if ( ::tqqt_cast<TQTabBar*>(o) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::tqqt_cast<TQSizeGrip*>(o) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::tqqt_cast<TQButton*>(o) &&
+ ( ::tqqt_cast<TQTabBar*>(o->tqparent()) || ::tqqt_cast<TQToolBox*>(o->tqparent()) ) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::tqqt_cast<TQPushButton*>(o) && ::tqqt_cast<TQWizard*>(o->tqparent()) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::tqqt_cast<TQMenuBar*>(o) && ::tqqt_cast<TQMainWindow*>(o->tqparent()) )
+ return ( lastWasAPassiveInteractor = TRUE );
+// else if ( ::tqqt_cast<TQDockWindowHandle*>(o) )
+ else if ( o->inherits( "TQDockWindowHandle" ) )
+ return ( lastWasAPassiveInteractor = TRUE );
+// else if ( ::tqqt_cast<TQHideTQt::Dock*>(o) )
+ else if ( o->inherits( "TQHideTQt::Dock" ) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( qstrcmp( o->name(), "designer_wizardstack_button" ) == 0 )
+ return ( lastWasAPassiveInteractor = TRUE );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ if ( !o->isWidgetType() )
+ return ( lastWasAPassiveInteractor = FALSE );
+ WidgetInterface *iface = 0;
+ TQWidget *w = (TQWidget*)o;
+ while ( !iface && w && !::tqqt_cast<FormWindow*>(w) ) {
+ widgetManager()->queryInterface( classNameOf( w ), &iface );
+ w = w->parentWidget();
+ }
+ if ( !iface )
+ return ( lastWasAPassiveInteractor = FALSE );
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
+ if ( !iface2 )
+ return ( lastWasAPassiveInteractor = FALSE );
+ TQWidget *fw = MainWindow::self->isAFormWindowChild( (TQWidget*)o );
+ if ( !fw )
+ return ( lastWasAPassiveInteractor = FALSE );
+ TQWidget *dw = ( (FormWindow*)fw )->designerWidget( (TQWidget*)o );
+ if ( !dw )
+ return ( lastWasAPassiveInteractor = FALSE );
+ lastWasAPassiveInteractor = iface2->isPassiveInteractor( dw->className(), (TQWidget*)o );
+ iface2->release();
+ iface->release();
+#endif // TQT_CONTAINER_CUSTOM_WIDGETS
+ return lastWasAPassiveInteractor;
+}
+
+
+/*!
+ Returns the class name of object \a o that should be used for externally (i.e. for saving)
+ */
+const char* WidgetFactory::classNameOf( TQT_BASE_OBJECT_NAME* tqbo )
+{
+ TQObject *o = TQT_TQOBJECT(tqbo);
+ if ( o->isA( "PropertyObject" ) )
+ return o->className();
+ if (WidgetDatabase::isCustomPluginWidget(WidgetDatabase::idFromClassName(o->className())))
+ return o->className();
+ else if ( ::tqqt_cast<TQDesignerTabWidget*>(o) )
+ return "TQTabWidget";
+ else if ( ::tqqt_cast<TQDesignerWidgetStack*>(o) )
+ return "TQWidgetStack";
+ else if ( ::tqqt_cast<TQWidgetStack*>(o) )
+ return "TQWeDoNotWantToBreakTabWidget";
+ else if ( ::tqqt_cast<TQDesignerDialog*>(o) )
+ return "TQDialog";
+ else if ( ::tqqt_cast<TQDesignerWidget*>(o) )
+ return "TQWidget";
+ else if ( o->inherits( "CustomWidget" ) )
+ return ( (CustomWidget*)o )->realClassName().latin1();
+ else if ( ::tqqt_cast<TQDesignerLabel*>(o) )
+ return "TQLabel";
+ else if ( ::tqqt_cast<TQDesignerWizard*>(o) )
+ return "TQWizard";
+ else if ( ::tqqt_cast<TQDesignerPushButton*>(o) )
+ return "TQPushButton";
+ else if ( ::tqqt_cast<TQDesignerToolButton*>(o) )
+ return "TQToolButton";
+ else if ( ::tqqt_cast<TQDesignerRadioButton*>(o) )
+ return "TQRadioButton";
+ else if ( ::tqqt_cast<TQDesignerCheckBox*>(o) )
+ return "TQCheckBox";
+ else if ( ::tqqt_cast<MenuBarEditor*>(o) )
+ return "TQMenuBar";
+ else if ( ::tqqt_cast<TQDesignerToolBar*>(o) )
+ return "TQToolBar";
+ else if ( ::tqqt_cast<TQDesignerAction*>(o) )
+ return "TQAction";
+ else if ( ::tqqt_cast<TQDesignerActionGroup*>(o) )
+ return "TQActionGroup";
+ else if ( ::tqqt_cast<PopupMenuEditor*>(o) )
+ return "TQPopupMenu";
+ else if ( ::tqqt_cast<TQDesignerToolBox*>(o) )
+ return "TQToolBox";
+#ifndef TQT_NO_SQL
+ else if ( ::tqqt_cast<TQDesignerDataBrowser*>(o) )
+ return "TQDataBrowser";
+ else if ( ::tqqt_cast<TQDesignerDataView*>(o) )
+ return "TQDataView";
+#endif
+ return o->className();
+}
+
+TQString WidgetFactory::defaultSignal( TQT_BASE_OBJECT_NAME *tqbo )
+{
+ TQObject *w = TQT_TQOBJECT(tqbo);
+ if ( ::tqqt_cast<TQRadioButton*>(w) || ::tqqt_cast<TQCheckBox*>(w) )
+ return "toggled";
+ else if ( ::tqqt_cast<TQButton*>(w) || ::tqqt_cast<TQButtonGroup*>(w) )
+ return "clicked";
+ else if ( ::tqqt_cast<TQTextBrowser*>(w) )
+ return "linkClicked";
+ else if ( ::tqqt_cast<TQLineEdit*>(w) || ::tqqt_cast<TQTextEdit*>(w) )
+ return "textChanged";
+ else if ( ::tqqt_cast<TQListView*>(w) || ::tqqt_cast<TQIconView*>(w) ||
+ ::tqqt_cast<TQListBox*>(w) || ::tqqt_cast<TQTable*>(w) )
+ return "selectionChanged";
+ else if ( ::tqqt_cast<TQTabWidget*>(w) )
+ return "selected";
+ else if ( ::tqqt_cast<TQToolBox*>(w) )
+ return "currentChanged";
+ else if ( ::tqqt_cast<TQWidgetStack*>(w) )
+ return "aboutToShow";
+ else if ( ::tqqt_cast<TQSpinBox*>(w) || ::tqqt_cast<TQSlider*>(w) ||
+ ::tqqt_cast<TQScrollBar*>(w) || ::tqqt_cast<TQDateEdit*>(w) ||
+ ::tqqt_cast<TQTimeEdit*>(w) || ::tqqt_cast<TQDateTimeEdit*>(w) ||
+ ::tqqt_cast<TQDial*>(w) )
+ return "valueChanged";
+ else if ( ::tqqt_cast<TQComboBox*>(w) )
+ return "activated";
+ return TQString();
+}
+
+/*! As some properties are set by default when creating a widget this
+ functions markes this properties as changed. Has to be in sync with
+ createWidget()!
+*/
+
+void WidgetFactory::initChangedProperties( TQT_BASE_OBJECT_NAME *tqbo )
+{
+ TQObject *o = TQT_TQOBJECT(tqbo);
+ if ( MainWindow::self && MainWindow::self->currProject() &&
+ MainWindow::self->currProject()->fakeFormFileFor( o ) )
+ return;
+ MetaDataBase::setPropertyChanged( o, "name", TRUE );
+ if ( !::tqqt_cast<TQDesignerToolBar*>(o) && !::tqqt_cast<MenuBarEditor*>(o) )
+ MetaDataBase::setPropertyChanged( o, "geometry", TRUE );
+
+ if ( ::tqqt_cast<TQPushButton*>(o) ||
+ ::tqqt_cast<TQRadioButton*>(o) ||
+ ::tqqt_cast<TQCheckBox*>(o) ||
+ ::tqqt_cast<TQToolButton*>(o) ) {
+ if (::tqqt_cast<TQToolButton*>(o) && ::tqqt_cast<TQToolBox*>(widgetOfContainer((TQWidget*)o->tqparent()))) {
+ MetaDataBase::setPropertyChanged( o, "usesTextLabel", TRUE );
+ MetaDataBase::setPropertyChanged( o, "textLabel", TRUE );
+ MetaDataBase::setPropertyChanged( o, "autoRaise", TRUE );
+ MetaDataBase::setPropertyChanged( o, "textPosition", TRUE );
+ } else {
+ MetaDataBase::setPropertyChanged( o, "text", TRUE );
+ }
+ }
+ else if ( ::tqqt_cast<TQGroupBox*>(o) )
+ MetaDataBase::setPropertyChanged( o, "title", TRUE );
+ else if ( o->isA( "TQFrame" ) ) {
+ MetaDataBase::setPropertyChanged( o, "frameShadow", TRUE );
+ MetaDataBase::setPropertyChanged( o, "frameShape", TRUE );
+ } else if ( ::tqqt_cast<TQTabWidget*>(o) || ::tqqt_cast<TQWizard*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "pageTitle", TRUE );
+ MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
+ MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
+ } else if ( ::tqqt_cast<TQWidgetStack*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
+ MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
+ } else if ( ::tqqt_cast<TQToolBox*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "currentIndex", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemLabel", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemIconSet", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemToolTip", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", TRUE );
+#ifndef TQT_NO_TABLE
+ } else if ( ::tqqt_cast<TQTable*>(o) ) {
+# ifndef TQT_NO_SQL
+ if (!::tqqt_cast<TQDataTable*>(o) )
+# endif
+ {
+ MetaDataBase::setPropertyChanged( o, "numRows", TRUE );
+ MetaDataBase::setPropertyChanged( o, "numCols", TRUE );
+ TQTable *t = (TQTable*)o;
+ for ( int i = 0; i < 3; ++i ) {
+ t->horizontalHeader()->setLabel( i, TQString::number( i + 1 ) );
+ t->verticalHeader()->setLabel( i, TQString::number( i + 1 ) );
+ }
+ }
+#endif
+ } else if ( ::tqqt_cast<TQSplitter*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "orientation", TRUE );
+ } else if ( ::tqqt_cast<TQDesignerToolBar*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "label", TRUE );
+ } else if ( ::tqqt_cast<MenuBarEditor*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemNumber", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemText", TRUE );
+ }
+}
+
+bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget )
+{
+ TQString className = WidgetDatabase::className( id );
+
+ if ( className.tqcontains( "ListBox" ) )
+ return TRUE;
+ if ( className.tqcontains( "ComboBox" ) )
+ return TRUE;
+ if ( className.tqcontains( "ListView" ) )
+ return TRUE;
+ if ( className.tqcontains( "IconView" ) )
+ return TRUE;
+ if ( className == "TQTextEdit" || className == "TQMultiLineEdit" )
+ return TRUE;
+ if ( ::tqqt_cast<TQTable*>(editorWidget) != 0 )
+ return TRUE;
+
+ return FALSE;
+}
+
+bool WidgetFactory::hasItems( int id, TQObject *editorWidget )
+{
+ TQString className = WidgetDatabase::className( id );
+
+ if ( className.tqcontains( "ListBox" ) || className.tqcontains( "ListView" ) ||
+ className.tqcontains( "IconView" ) || className.tqcontains( "ComboBox" ) ||
+ ::tqqt_cast<TQTable*>(editorWidget) != 0 )
+ return TRUE;
+
+ return FALSE;
+}
+
+void WidgetFactory::editWidget( int id, TQWidget *tqparent, TQWidget *editWidget, FormWindow *fw )
+{
+ TQString className = WidgetDatabase::className( id );
+
+ if ( className.tqcontains( "ListBox" ) ) {
+ if ( !::tqqt_cast<TQListBox*>(editWidget) )
+ return;
+ ListBoxEditor *e = new ListBoxEditor( tqparent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+
+ if ( className.tqcontains( "ComboBox" ) ) {
+ if ( !::tqqt_cast<TQComboBox*>(editWidget) )
+ return;
+ TQComboBox *cb = (TQComboBox*)editWidget;
+ TQListBox *lb = cb->listBox();
+ if (!lb) {
+ lb = new TQListBox(cb);
+ cb->setListBox(lb);
+ }
+ ListBoxEditor *e = new ListBoxEditor( tqparent, lb, fw );
+ e->exec();
+ delete e;
+ cb->update();
+ return;
+ }
+
+ if ( className.tqcontains( "ListView" ) ) {
+ if ( !::tqqt_cast<TQListView*>(editWidget) )
+ return;
+ TQListView *lv = (TQListView*)editWidget;
+ ListViewEditor *e = new ListViewEditor( tqparent, lv, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+
+ if ( className.tqcontains( "IconView" ) ) {
+ if ( !::tqqt_cast<TQIconView*>(editWidget) )
+ return;
+ IconViewEditor *e = new IconViewEditor( tqparent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+
+ if ( className == "TQMultiLineEdit" || className == "TQTextEdit" ) {
+ MultiLineEditor *e = new MultiLineEditor( FALSE, TRUE, tqparent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+#ifndef TQT_NO_TABLE
+ if (::tqqt_cast<TQTable*>(editWidget) != 0) {
+ TableEditor *e = new TableEditor( tqparent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+#endif
+}
+
+bool WidgetFactory::canResetProperty( TQT_BASE_OBJECT_NAME *w, const TQString &propName )
+{
+ if ( propName == "name" || propName == "geometry" )
+ return FALSE;
+ TQStringList l = *changedProperties->tqfind( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
+ return l.tqfindIndex( propName ) == -1;
+}
+
+bool WidgetFactory::resetProperty( TQT_BASE_OBJECT_NAME *tqbo, const TQString &propName )
+{
+ TQObject *w = TQT_TQOBJECT(tqbo);
+ const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->
+ tqfindProperty( propName, TRUE ), TRUE );
+ if (!p )
+ return FALSE;
+ return p->reset( w );
+}
+
+TQVariant WidgetFactory::defaultValue( TQT_BASE_OBJECT_NAME *w, const TQString &propName )
+{
+ if ( propName == "wordwrap" ) {
+ int v = defaultValue( w, "tqalignment" ).toInt();
+ return TQVariant( ( v & WordBreak ) == WordBreak, 0 );
+ } else if ( propName == "toolTip" || propName == "whatsThis" ) {
+ return TQVariant( TQString::tqfromLatin1( "" ) );
+ } else if ( w->inherits( "CustomWidget" ) ) {
+ return TQVariant();
+ } else if ( propName == "frameworkCode" ) {
+ return TQVariant( TRUE, 0 );
+ } else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) {
+ return TQVariant( -1 );
+ }
+
+ return *( *defaultProperties->tqfind( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ).tqfind( propName );
+}
+
+TQString WidgetFactory::defaultCurrentItem( TQT_BASE_OBJECT_NAME *tqbo, const TQString &propName )
+{
+ TQObject *w = TQT_TQOBJECT(tqbo);
+ const TQMetaProperty *p = w->tqmetaObject()->
+ property( w->tqmetaObject()->tqfindProperty( propName, TRUE ), TRUE );
+ if ( !p ) {
+ int v = defaultValue( w, "tqalignment" ).toInt();
+ if ( propName == "hAlign" ) {
+ if ( ( v & AlignAuto ) == AlignAuto )
+ return "AlignAuto";
+ if ( ( v & AlignLeft ) == AlignLeft )
+ return "AlignLeft";
+ if ( ( v & AlignCenter ) == AlignCenter || ( v & AlignHCenter ) == AlignHCenter )
+ return "AlignHCenter";
+ if ( ( v & AlignRight ) == AlignRight )
+ return "AlignRight";
+ if ( ( v & AlignJustify ) == AlignJustify )
+ return "AlignJustify";
+ } else if ( propName == "vAlign" ) {
+ if ( ( v & AlignTop ) == AlignTop )
+ return "AlignTop";
+ if ( ( v & AlignCenter ) == AlignCenter || ( v & AlignVCenter ) == AlignVCenter )
+ return "AlignVCenter";
+ if ( ( v & AlignBottom ) == AlignBottom )
+ return "AlignBottom";
+ } else if ( propName == "resizeMode" ) {
+ return "Auto";
+ }
+ return TQString();
+
+ }
+ return p->valueToKey( defaultValue( w, propName ).toInt() );
+}
+
+TQWidget *WidgetFactory::createCustomWidget( TQWidget *tqparent, const char *name, MetaDataBase::CustomWidget *w )
+{
+ if ( !w )
+ return 0;
+ return new CustomWidget( tqparent, name, w );
+}
+
+TQVariant WidgetFactory::property( TQT_BASE_OBJECT_NAME *tqbo, const char *name )
+{
+ TQObject *w = TQT_TQOBJECT(tqbo);
+ int id = w->tqmetaObject()->tqfindProperty( name, TRUE );
+ const TQMetaProperty* p = w->tqmetaObject()->property( id, TRUE );
+ if ( !p || !p->isValid() )
+ return MetaDataBase::fakeProperty( w, name );
+ return w->property( name );
+}
+
+void TQDesignerLabel::updateBuddy()
+{
+
+ if ( myBuddy.isEmpty() )
+ return;
+
+ TQObjectList *l = tqtopLevelWidget()->queryList( "TQWidget", myBuddy, FALSE, TRUE );
+ if ( !l || !l->first() ) {
+ delete l;
+ return;
+ }
+
+ TQLabel::setBuddy( (TQWidget*)l->first() );
+ delete l;
+}
+
+
+void TQDesignerWidget::resizeEvent( TQResizeEvent* e)
+{
+ if ( need_frame ) {
+ TQPainter p(this);
+ p.setPen( backgroundColor() );
+ p.drawRect( TQRect( TQPoint(0,0), e->oldSize() ) );
+ }
+}
+
+void TQDesignerWidget::paintEvent( TQPaintEvent *e )
+{
+ if ( need_frame ) {
+ TQPainter p(this);
+ p.setPen( backgroundColor().dark() );
+ p.drawRect( rect() );
+ }
+ formwindow->paintGrid( this, e );
+}
+
+void TQDesignerDialog::paintEvent( TQPaintEvent *e )
+{
+ formwindow->paintGrid( this, e );
+}
+
+TQSizePolicy TQLayoutWidget::sizePolicy() const
+{
+ return sp;
+}
+
+bool TQLayoutWidget::event( TQEvent *e )
+{
+ if ( e && ( e->type() == TQEvent::ChildInserted ||
+ e->type() == TQEvent::ChildRemoved ||
+ e->type() == TQEvent::LayoutHint ||
+ e->type() == TQEvent::Reparent ) )
+ updateSizePolicy();
+ return TQWidget::event( e );
+}
+
+/*
+ This function must be called on TQLayoutWidget creation and whenever
+ the TQLayoutWidget's tqparent tqlayout changes (e.g., from a TQHBoxLayout
+ to a TQVBoxLayout), because of the (illogical) way layouting works.
+*/
+void TQLayoutWidget::updateSizePolicy()
+{
+ if ( childrenListObject().isEmpty() || childrenListObject().count() == 0 ) {
+ sp = TQWidget::tqsizePolicy();
+ return;
+ }
+
+ /*
+ TQSizePolicy::MayShrink & friends are private. Here we assume the
+ following:
+
+ Fixed = 0
+ Maximum = MayShrink
+ Minimum = MayGrow
+ Preferred = MayShrink | MayGrow
+ */
+
+ int ht = (int) TQSizePolicy::Preferred;
+ int vt = (int) TQSizePolicy::Preferred;
+
+ if ( tqlayout() ) {
+ /*
+ parentLayout is set to the tqparent tqlayout if there is one and if it is
+ top level, in which case layouting is illogical.
+ */
+ TQLayout *parentLayout = 0;
+ if ( tqparent() && tqparent()->isWidgetType() ) {
+ parentLayout = ((TQWidget *)tqparent())->tqlayout();
+ if ( parentLayout &&
+ ::tqqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) )
+ parentLayout = 0;
+ }
+
+ TQObjectListIt it( childrenListObject() );
+ TQObject *o;
+
+ if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout()) ) {
+ if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) )
+ vt = TQSizePolicy::Minimum;
+ else
+ vt = TQSizePolicy::Fixed;
+
+ while ( ( o = it.current() ) ) {
+ ++it;
+ if ( !o->isWidgetType() || ( (TQWidget*)o )->testWState( TQt::WState_ForceHide ) )
+ continue;
+ TQWidget *w = (TQWidget*)o;
+
+ if ( !w->tqsizePolicy().mayGrowHorizontally() )
+ ht &= ~TQSizePolicy::Minimum;
+ if ( !w->tqsizePolicy().mayShrinkHorizontally() )
+ ht &= ~TQSizePolicy::Maximum;
+ if ( w->tqsizePolicy().mayGrowVertically() )
+ vt |= TQSizePolicy::Minimum;
+ if ( w->tqsizePolicy().mayShrinkVertically() )
+ vt |= TQSizePolicy::Maximum;
+ }
+ } else if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout()) ) {
+ if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) )
+ ht = TQSizePolicy::Minimum;
+ else
+ ht = TQSizePolicy::Fixed;
+
+ while ( ( o = it.current() ) ) {
+ ++it;
+ if ( !o->isWidgetType() || ( (TQWidget*)o )->testWState( TQt::WState_ForceHide ) )
+ continue;
+ TQWidget *w = (TQWidget*)o;
+
+ if ( w->tqsizePolicy().mayGrowHorizontally() )
+ ht |= TQSizePolicy::Minimum;
+ if ( w->tqsizePolicy().mayShrinkHorizontally() )
+ ht |= TQSizePolicy::Maximum;
+ if ( !w->tqsizePolicy().mayGrowVertically() )
+ vt &= ~TQSizePolicy::Minimum;
+ if ( !w->tqsizePolicy().mayShrinkVertically() )
+ vt &= ~TQSizePolicy::Maximum;
+ }
+ } else if ( ::tqqt_cast<TQGridLayout*>(tqlayout()) ) {
+ ht = TQSizePolicy::Fixed;
+ vt = TQSizePolicy::Fixed;
+ if ( parentLayout ) {
+ if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) )
+ ht = TQSizePolicy::Minimum;
+ else if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) )
+ vt = TQSizePolicy::Minimum;
+ }
+
+ while ( ( o = it.current() ) ) {
+ ++it;
+ if ( !o->isWidgetType() || ( (TQWidget*)o )->testWState( TQt::WState_ForceHide ) )
+ continue;
+ TQWidget *w = (TQWidget*)o;
+
+ if ( w->tqsizePolicy().mayGrowHorizontally() )
+ ht |= TQSizePolicy::Minimum;
+ if ( w->tqsizePolicy().mayShrinkHorizontally() )
+ ht |= TQSizePolicy::Maximum;
+ if ( w->tqsizePolicy().mayGrowVertically() )
+ vt |= TQSizePolicy::Minimum;
+ if ( w->tqsizePolicy().mayShrinkVertically() )
+ vt |= TQSizePolicy::Maximum;
+ }
+ }
+ if ( tqlayout()->expandingDirections() & TQSizePolicy::Horizontally )
+ ht = TQSizePolicy::Expanding;
+ if ( tqlayout()->expandingDirections() & TQSizePolicy::Vertically )
+ vt = TQSizePolicy::Expanding;
+
+ tqlayout()->tqinvalidate();
+ }
+
+ sp = TQSizePolicy( (TQSizePolicy::SizeType) ht, (TQSizePolicy::SizeType) vt );
+ updateGeometry();
+}
+
+void CustomWidget::paintEvent( TQPaintEvent *e )
+{
+ if ( ::tqqt_cast<FormWindow*>(parentWidget()) ) {
+ ( (FormWindow*)parentWidget() )->paintGrid( this, e );
+ } else {
+ TQPainter p( this );
+ p.fillRect( rect(), tqcolorGroup().dark() );
+ p.setPen( tqcolorGroup().light() );
+ p.drawText( 2, 2, width() - 4, height() - 4, TQt::AlignAuto | TQt::AlignTop, cusw->className );
+ p.drawPixmap( ( width() - cusw->pixmap->width() ) / 2,
+ ( height() - cusw->pixmap->height() ) / 2,
+ *cusw->pixmap );
+ }
+}
+
+
+CustomWidgetFactory::CustomWidgetFactory()
+{
+}
+
+TQWidget *CustomWidgetFactory::createWidget( const TQString &className, TQWidget *tqparent, const char *name ) const
+{
+ MetaDataBase::CustomWidget *w = MetaDataBase::customWidget( WidgetDatabase::idFromClassName( className ) );
+ if ( !w )
+ return 0;
+ return WidgetFactory::createCustomWidget( tqparent, name, w );
+}
+
+void TQDesignerRadioButton::setFocusPolicy( Qt::FocusPolicy policy )
+{
+ // Make sure we only set a policy that has a key.
+ // If we set a policy that is a combination of enums, it will be imposible to save
+ // We need this check because TQButtonGroup::buttonToggled(...) will remove TabFocus,
+ // making the policy StrongFocus & ~TabFocus
+
+ switch ( policy ) {
+ case Qt::NoFocus:
+ case Qt::TabFocus:
+ case Qt::ClickFocus:
+ case Qt::StrongFocus:
+ case Qt::WheelFocus:
+ TQRadioButton::setFocusPolicy( policy );
+ return;
+ }
+ TQRadioButton::setFocusPolicy( Qt::NoFocus );
+}
+
+TQDesignerToolBox::TQDesignerToolBox( TQWidget *tqparent, const char *name )
+ : TQToolBox( tqparent, name )
+{
+}
+
+TQString TQDesignerToolBox::itemLabel() const
+{
+ return TQToolBox::itemLabel( currentIndex() );
+}
+
+void TQDesignerToolBox::setItemLabel( const TQString &l )
+{
+ TQToolBox::setItemLabel( currentIndex(), l );
+}
+
+TQCString TQDesignerToolBox::itemName() const
+{
+ return currentItem() ? currentItem()->name() : 0;
+}
+
+void TQDesignerToolBox::setItemName( const TQCString &n )
+{
+ if (currentItem())
+ currentItem()->setName( n );
+}
+
+
+TQt::BackgroundMode TQDesignerToolBox::itemBackgroundMode() const
+{
+ return (item(0) ? item(0)->backgroundMode() : TQt::PaletteBackground);
+}
+
+void TQDesignerToolBox::setItemBackgroundMode( TQt::BackgroundMode bmode )
+{
+ for (int i = 0; i < count(); ++i) {
+ TQWidget *w = item(i);
+ w->setBackgroundMode( bmode );
+ w->update();
+ }
+}
+
+void TQDesignerToolBox::itemInserted( int index )
+{
+ if (count() > 1)
+ item(index)->setBackgroundMode(item(index>0?0:1)->backgroundMode());
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/widgetfactory.h b/tqtinterface/qt4/tools/designer/designer/widgetfactory.h
new file mode 100644
index 0000000..77c0574
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/widgetfactory.h
@@ -0,0 +1,523 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef WIDGETFACTORY_H
+#define WIDGETFACTORY_H
+
+#include <tqvariant.h>
+#include <tqiconset.h>
+#include <tqstring.h>
+#include <tqintdict.h>
+#include <tqtabwidget.h>
+#include <tqpixmap.h>
+#include <tqsize.h>
+#include <tqpainter.h>
+#include <tqevent.h>
+#include <tqobjectlist.h>
+#include <tqlabel.h>
+#include <tqwizard.h>
+#include <tqptrdict.h>
+#include <tqpushbutton.h>
+#include <tqtoolbutton.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqwidgetstack.h>
+#include <tqguardedptr.h>
+#include <tqtoolbox.h>
+
+#include "metadatabase.h"
+#include "tqwidgetfactory.h"
+
+class TQWidget;
+class TQLayout;
+class FormWindow;
+
+class CustomWidgetFactory : public TQWidgetFactory
+{
+public:
+ CustomWidgetFactory();
+ TQWidget *createWidget( const TQString &className, TQWidget *tqparent, const char *name ) const;
+
+};
+
+class WidgetFactory : public TQt
+{
+ friend class CustomWidgetFactory;
+
+public:
+ enum LayoutType {
+ HBox,
+ VBox,
+ Grid,
+ NoLayout
+ };
+
+ static TQWidget *create( int id, TQWidget *tqparent, const char *name = 0, bool init = TRUE,
+ const TQRect *rect = 0, Qt::Orientation orient = Qt::Horizontal );
+ static TQLayout *createLayout( TQWidget *widget, TQLayout* tqlayout, LayoutType type );
+ static void deleteLayout( TQWidget *widget );
+
+ static LayoutType layoutType( TQWidget *w );
+ static LayoutType layoutType( TQWidget *w, TQLayout *&tqlayout );
+ static LayoutType layoutType( TQLayout *tqlayout );
+ static TQWidget *layoutParent( TQLayout *tqlayout );
+
+ static TQWidget* containerOfWidget( TQWidget *w );
+ static TQWidget* widgetOfContainer( TQWidget *w );
+
+ static bool isPassiveInteractor( TQT_BASE_OBJECT_NAME* o );
+ static const char* classNameOf( TQT_BASE_OBJECT_NAME* o );
+
+ static void initChangedProperties( TQT_BASE_OBJECT_NAME *o );
+
+ static bool hasSpecialEditor( int id, TQObject *editorWidget );
+ static bool hasItems( int id, TQObject *editorWidget );
+ static void editWidget( int id, TQWidget *tqparent, TQWidget *editWidget, FormWindow *fw );
+
+ static bool canResetProperty( TQT_BASE_OBJECT_NAME *w, const TQString &propName );
+ static bool resetProperty( TQT_BASE_OBJECT_NAME *w, const TQString &propName );
+ static TQVariant defaultValue( TQT_BASE_OBJECT_NAME *w, const TQString &propName );
+ static TQString defaultCurrentItem( TQT_BASE_OBJECT_NAME *w, const TQString &propName );
+
+ static TQVariant property( TQT_BASE_OBJECT_NAME *w, const char *name );
+ static void saveDefaultProperties( TQT_BASE_OBJECT_NAME *w, int id );
+ static void saveChangedProperties( TQT_BASE_OBJECT_NAME *w, int id );
+
+ static TQString defaultSignal( TQT_BASE_OBJECT_NAME *w );
+
+private:
+ static TQWidget *createWidget( const TQString &className, TQWidget *tqparent, const char *name, bool init,
+ const TQRect *r = 0, Qt::Orientation orient = Qt::Horizontal );
+ static TQWidget *createCustomWidget( TQWidget *tqparent, const char *name, MetaDataBase::CustomWidget *w );
+
+ static TQGuardedPtr<TQObject> *lastPassiveInteractor;
+ static bool lastWasAPassiveInteractor;
+};
+
+
+class TQDesignerTabWidget : public TQTabWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( int currentPage READ currentPage WRITE setCurrentPage STORED false DESIGNABLE true )
+ Q_PROPERTY( TQString pageTitle READ pageTitle WRITE setPageTitle STORED false DESIGNABLE true )
+ Q_PROPERTY( TQCString pageName READ pageName WRITE setPageName STORED false DESIGNABLE true )
+public:
+ TQDesignerTabWidget( TQWidget *tqparent, const char *name );
+
+ int currentPage() const;
+ void setCurrentPage( int i );
+ TQString pageTitle() const;
+ void setPageTitle( const TQString& title );
+ TQCString pageName() const;
+ void setPageName( const TQCString& name );
+
+ int count() const;
+ TQTabBar *tabBar() const { return TQTabWidget::tabBar(); }
+
+ bool eventFilter( TQObject*, TQEvent* );
+
+private:
+ TQPoint pressPoint;
+ TQWidget *dropIndicator;
+ TQWidget *dragPage;
+ TQString dragLabel;
+ bool mousePressed;
+};
+
+class TQDesignerWidgetStack : public TQWidgetStack
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( int currentPage READ currentPage WRITE setCurrentPage STORED false DESIGNABLE true )
+ Q_PROPERTY( TQCString pageName READ pageName WRITE setPageName STORED false DESIGNABLE true )
+public:
+ TQDesignerWidgetStack( TQWidget *tqparent, const char *name );
+
+ int currentPage() const;
+ void setCurrentPage( int i );
+ TQCString pageName() const;
+ void setPageName( const TQCString& name );
+
+ int count() const;
+ TQWidget* page( int i ) const;
+
+ int insertPage( TQWidget *p, int i = -1 );
+ int removePage( TQWidget *p );
+
+public Q_SLOTS:
+ void updateButtons();
+
+protected:
+ void resizeEvent( TQResizeEvent *e ) {
+ TQWidgetStack::resizeEvent( e );
+ updateButtons();
+ }
+
+ void showEvent( TQShowEvent *e ) {
+ TQWidgetStack::showEvent( e );
+ updateButtons();
+ }
+
+private Q_SLOTS:
+ void prevPage();
+ void nextPage();
+
+private:
+ TQPtrList<TQWidget> pages;
+ TQToolButton *prev, *next;
+
+};
+
+class TQDesignerWizard : public TQWizard
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( int currentPage READ currentPageNum WRITE setCurrentPage STORED false DESIGNABLE true )
+ Q_PROPERTY( TQString pageTitle READ pageTitle WRITE setPageTitle STORED false DESIGNABLE true )
+ Q_PROPERTY( TQCString pageName READ pageName WRITE setPageName STORED false DESIGNABLE true )
+ TQ_OVERRIDE( bool modal READ isModal WRITE setModal )
+
+public:
+ TQDesignerWizard( TQWidget *tqparent, const char *name )
+ : TQWizard( tqparent, name ), modal(FALSE) {}
+
+ int currentPageNum() const;
+ void setCurrentPage( int i );
+ TQString pageTitle() const;
+ void setPageTitle( const TQString& title );
+ TQCString pageName() const;
+ void setPageName( const TQCString& name );
+ int pageNum( TQWidget *page );
+ void addPage( TQWidget *p, const TQString & );
+ void removePage( TQWidget *p );
+ void insertPage( TQWidget *p, const TQString &t, int index );
+ bool isPageRemoved( TQWidget *p ) { return (removedPages.tqfind( p ) != 0); }
+
+ bool isModal() const { return modal; }
+ void setModal(bool b) { modal = b; }
+
+ void reject() {}
+
+private:
+ struct Page
+ {
+ Page( TQWidget *a, const TQString &b ) : p( a ), t( b ) {}
+ Page() : p( 0 ), t( TQString() ) {}
+ TQWidget *p;
+ TQString t;
+ };
+ TQPtrDict<TQWidget> removedPages;
+ bool modal;
+
+};
+
+class TQLayoutWidget : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQLayoutWidget( TQWidget *tqparent, const char *name ) : TQWidget( tqparent, name ), sp( TQWidget::tqsizePolicy() ) {}
+
+ TQSizePolicy sizePolicy() const;
+ void updateSizePolicy();
+
+protected:
+ void paintEvent( TQPaintEvent * );
+ bool event( TQEvent * );
+ TQSizePolicy sp;
+
+};
+
+
+class CustomWidget : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ CustomWidget( TQWidget *tqparent, const char *name, MetaDataBase::CustomWidget *cw )
+ : TQWidget( tqparent, name ), cusw( cw ) {
+ alwaysExpand = parentWidget() && parentWidget()->inherits( "FormWindow" );
+ tqsetSizePolicy( cw->sizePolicy );
+ if ( !alwaysExpand )
+ setBackgroundMode( TQt::PaletteDark );
+ }
+
+ TQSize tqsizeHint() const {
+ TQSize sh = cusw->tqsizeHint;
+ if ( sh.isValid() )
+ return sh;
+ return TQWidget::tqsizeHint();
+ }
+
+ TQString realClassName() { return cusw->className; }
+ MetaDataBase::CustomWidget *customWidget() const { return cusw; }
+
+protected:
+ void paintEvent( TQPaintEvent *e );
+
+ MetaDataBase::CustomWidget *cusw;
+ bool alwaysExpand;
+
+};
+
+
+class Line : public TQFrame
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+ Q_PROPERTY( Qt::Orientation orientation READ orientation WRITE setOrientation )
+ TQ_OVERRIDE( int frameWidth DESIGNABLE false )
+ TQ_OVERRIDE( Shape frameShape DESIGNABLE false )
+ TQ_OVERRIDE( TQRect frameRect DESIGNABLE false )
+ TQ_OVERRIDE( TQRect contentsRect DESIGNABLE false )
+public:
+ Line( TQWidget *tqparent, const char *name )
+ : TQFrame( tqparent, name, TQt::WMouseNoMask ) {
+ setFrameStyle( HLine | Sunken );
+ }
+
+ void setOrientation( Qt::Orientation orient ) {
+ if ( orient == Qt::Horizontal )
+ setFrameShape( HLine );
+ else
+ setFrameShape( VLine );
+ }
+ Qt::Orientation orientation() const {
+ return frameShape() == HLine ? Qt::Horizontal : Qt::Vertical;
+ }
+};
+
+class TQDesignerLabel : public TQLabel
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+ Q_PROPERTY( TQCString buddy READ buddyWidget WRITE setBuddyWidget )
+
+public:
+ TQDesignerLabel( TQWidget *tqparent = 0, const char *name = 0 )
+ : TQLabel( tqparent, name ) { myBuddy = 0; }
+
+ void setBuddyWidget( const TQCString &b ) {
+ myBuddy = b;
+ updateBuddy();
+ }
+ TQCString buddyWidget() const {
+ return myBuddy;
+ };
+
+protected:
+ void showEvent( TQShowEvent *e ) {
+ TQLabel::showEvent( e );
+ updateBuddy();
+ }
+
+
+private:
+ void updateBuddy();
+
+ TQCString myBuddy;
+
+};
+
+class TQDesignerWidget : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ TQDesignerWidget( FormWindow *fw, TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name, TQt::WResizeNoErase ), formwindow( fw ) {
+ need_frame = tqparent && tqparent->inherits("TQDesignerWidgetStack" );
+ }
+
+protected:
+ void resizeEvent( TQResizeEvent* e);
+ void paintEvent( TQPaintEvent *e );
+
+private:
+ FormWindow *formwindow;
+ uint need_frame : 1;
+
+};
+
+class TQDesignerDialog : public TQDialog
+{
+ Q_OBJECT
+ TQ_OBJECT
+ TQ_OVERRIDE( bool modal READ isModal WRITE setModal )
+
+public:
+ TQDesignerDialog( FormWindow *fw, TQWidget *tqparent, const char *name )
+ : TQDialog( tqparent, name, FALSE, (WFlags)TQt::WResizeNoErase ), formwindow( fw ), modal(FALSE) {}
+
+ bool isModal() const { return modal; }
+ void setModal(bool b) { modal = b; }
+
+protected:
+ void paintEvent( TQPaintEvent *e );
+
+private:
+ FormWindow *formwindow;
+ bool modal;
+
+};
+
+class TQDesignerToolButton : public TQToolButton
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ TQDesignerToolButton( TQWidget *tqparent, const char *name )
+ : TQToolButton( tqparent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ ( (TQButtonGroup*)parentWidget() )->remove( this );
+ ( (TQButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+};
+
+class TQDesignerRadioButton : public TQRadioButton
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ TQDesignerRadioButton( TQWidget *tqparent, const char *name )
+ : TQRadioButton( tqparent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ ( (TQButtonGroup*)parentWidget() )->remove( this );
+ ( (TQButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+
+ void setFocusPolicy( Qt::FocusPolicy policy );
+};
+
+class TQDesignerPushButton : public TQPushButton
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ TQDesignerPushButton( TQWidget *tqparent, const char *name )
+ : TQPushButton( tqparent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ ( (TQButtonGroup*)parentWidget() )->remove( this );
+ ( (TQButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+
+};
+
+class TQDesignerCheckBox : public TQCheckBox
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ TQDesignerCheckBox( TQWidget *tqparent, const char *name )
+ : TQCheckBox( tqparent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ ( (TQButtonGroup*)parentWidget() )->remove( this );
+ ( (TQButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+
+};
+
+class TQDesignerToolBox : public TQToolBox
+{
+ Q_OBJECT
+ TQ_OBJECT
+ Q_PROPERTY( TQString itemLabel READ itemLabel WRITE setItemLabel STORED false DESIGNABLE true )
+ Q_PROPERTY( TQCString itemName READ itemName WRITE setItemName STORED false DESIGNABLE true )
+ Q_PROPERTY( BackgroundMode itemBackgroundMode READ itemBackgroundMode WRITE setItemBackgroundMode STORED false DESIGNABLE true )
+
+public:
+ TQDesignerToolBox( TQWidget *tqparent, const char *name );
+
+ TQString itemLabel() const;
+ void setItemLabel( const TQString &l );
+ TQCString itemName() const;
+ void setItemName( const TQCString &n );
+ TQt::BackgroundMode itemBackgroundMode() const;
+ void setItemBackgroundMode( TQt::BackgroundMode );
+
+protected:
+ void itemInserted( int index );
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/wizardeditor.ui b/tqtinterface/qt4/tools/designer/designer/wizardeditor.ui
new file mode 100644
index 0000000..6a2a14a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/wizardeditor.ui
@@ -0,0 +1,345 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>WizardEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>WizardEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>396</width>
+ <height>233</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Wizard Page Editor</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout14</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>pagesLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Wizard Pages:</string>
+ </property>
+ </widget>
+ <widget class="TQListBox">
+ <property name="name">
+ <cstring>listBox</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout18</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonAdd</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;dd</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonRemove</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_up.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_s_down.png</pixmap>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonHelp</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>helpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonUp</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>upClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDown</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>downClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>addClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemove</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>removeClicked()</slot>
+ </connection>
+ <connection>
+ <sender>listBox</sender>
+ <signal>selected(int)</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>itemSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>listBox</sender>
+ <signal>highlighted(int)</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>itemHighlighted(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+</connections>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">addClicked()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">cancelClicked()</slot>
+ <slot access="protected">downClicked()</slot>
+ <slot access="protected">helpClicked()</slot>
+ <slot access="protected">itemHighlighted(int)</slot>
+ <slot access="protected">itemSelected(int)</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">removeClicked()</slot>
+ <slot access="protected">upClicked()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.cpp b/tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.cpp
new file mode 100644
index 0000000..594a277
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.cpp
@@ -0,0 +1,258 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "wizardeditorimpl.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "command.h"
+#include "listboxdnd.h"
+#include "listboxrename.h"
+
+#include <tqwizard.h>
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+#include <tqinputdialog.h>
+
+WizardEditor::WizardEditor( TQWidget *tqparent, TQWizard *w, FormWindow *fw )
+ : WizardEditorBase( tqparent, 0 ), formwindow( fw ), wizard( w ), draggedItem( 0 )
+{
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
+ fillListBox();
+
+ // Add drag and drop
+ ListBoxDnd *listBoxDnd = new ListBoxDnd( listBox );
+ listBoxDnd->setDragMode( ListBoxDnd::Internal | ListBoxDnd::Move );
+ TQObject::connect( listBoxDnd, TQT_SIGNAL( dropped( TQListBoxItem * ) ),
+ listBoxDnd, TQT_SLOT( confirmDrop( TQListBoxItem * ) ) );
+
+ TQObject::connect( listBoxDnd, TQT_SIGNAL( dragged( TQListBoxItem * ) ),
+ this, TQT_SLOT( itemDragged( TQListBoxItem * ) ) );
+ TQObject::connect( listBoxDnd, TQT_SIGNAL( dropped( TQListBoxItem * ) ),
+ this, TQT_SLOT( itemDropped( TQListBoxItem * ) ) );
+
+ // Add in-place rename
+ new ListBoxRename( listBox );
+}
+
+WizardEditor::~WizardEditor()
+{
+ commands.setAutoDelete( TRUE );
+}
+
+void WizardEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void WizardEditor::cancelClicked()
+{
+ reject();
+}
+
+void WizardEditor::applyClicked()
+{
+ if ( commands.isEmpty() ) return;
+
+ // schedule macro command
+ MacroCommand* cmd = new MacroCommand( tr( "Edit Wizard Pages" ), formwindow, commands );
+ formwindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+
+ // clear command list
+ commands.clear();
+
+ // fix wizard buttons
+ for ( int i = 0; i < wizard->pageCount(); i++ ) {
+
+ TQWidget * page = wizard->page( i );
+ if ( i == 0 ) { // first page
+
+ wizard->setBackEnabled( page, FALSE );
+ wizard->setNextEnabled( page, TRUE );
+ }
+ else if ( i == wizard->pageCount() - 1 ) { // last page
+
+ wizard->setBackEnabled( page, TRUE );
+ wizard->setNextEnabled( page, FALSE );
+ }
+ else {
+
+ wizard->setBackEnabled( page, TRUE );
+ wizard->setNextEnabled( page, TRUE );
+ }
+ wizard->setFinishEnabled( page, FALSE );
+ }
+
+ // update listbox
+ int index = listBox->currentItem();
+ fillListBox();
+ listBox->setCurrentItem( index );
+
+ // show current page
+ wizard->showPage( wizard->page( 0 ) );
+}
+
+void WizardEditor::helpClicked()
+{
+
+}
+
+void WizardEditor::addClicked()
+{
+ int index = listBox->currentItem() + 1;
+ // update listbox
+ listBox->insertItem( "Page", index );
+
+ // schedule add command
+ AddWizardPageCommand *cmd = new AddWizardPageCommand( tr( "Add Page to %1" ).arg( wizard->name() ),
+ formwindow, wizard, "Page", index, FALSE);
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::removeClicked()
+{
+ if ( listBox->count() < 2 ) return;
+
+ int index = listBox->currentItem();
+
+ // update listbox
+ listBox->removeItem( index );
+
+ // schedule remove command
+ DeleteWizardPageCommand *cmd = new DeleteWizardPageCommand( tr( "Delete Page %1 of %2" )
+ .arg( listBox->text( index ) ).arg( wizard->name() ),
+ formwindow, wizard, index, FALSE );
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::upClicked()
+{
+ int index1 = listBox->currentItem();
+ int index2 = index1 - 1;
+
+ // swap listbox items
+ TQString item1 = listBox->text( index1 );
+ listBox->removeItem( index1 );
+ listBox->insertItem( item1, index2 );
+ listBox->setCurrentItem( index2 );
+
+ // schedule swap command
+ SwapWizardPagesCommand *cmd = new SwapWizardPagesCommand( tr( "Swap pages %1 and %2 of %1" ).arg( index1 ).arg( index2 )
+ .arg( wizard->name() ), formwindow, wizard, index1, index2);
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::downClicked()
+{
+ int index1 = listBox->currentItem();
+ int index2 = index1 + 1;
+
+ // swap listbox items
+ TQString item1 = listBox->text( index1 );
+ listBox->removeItem( index1 );
+ listBox->insertItem( item1, index2 );
+ listBox->setCurrentItem( index2 );
+
+ // schedule swap command
+ SwapWizardPagesCommand *cmd = new SwapWizardPagesCommand( tr( "Swap pages %1 and %2 of %1" ).arg( index1 ).arg( index2 ).arg( wizard->name() ), formwindow, wizard, index2, index1);
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::fillListBox()
+{
+ listBox->clear();
+
+ if ( !wizard ) return;
+ for ( int i = 0; i < wizard->pageCount(); i++ )
+ listBox->insertItem( wizard->title( wizard->page( i ) ) );
+
+ updateButtons();
+}
+
+void WizardEditor::itemHighlighted( int )
+{
+ updateButtons();
+}
+
+void WizardEditor::itemSelected( int index )
+{
+ if ( index < 0 ) return;
+ // Called when TQt::Key_Enter was pressed.
+ // ListBoxRename has renamed the list item, so we only need to rename the page to the same name.
+ TQString pn( tr( "Rename page %1 of %2" ).arg( wizard->title( wizard->page( index ) ) ).arg( wizard->name() ) );
+ RenameWizardPageCommand *cmd = new RenameWizardPageCommand( pn, formwindow, wizard, index, listBox->text( index ) );
+ commands.append( cmd );
+}
+
+void WizardEditor::updateButtons()
+{
+ int index = listBox->currentItem();
+
+ buttonUp->setEnabled( index > 0 );
+ buttonDown->setEnabled( index < (int)listBox->count() - 1 );
+ buttonRemove->setEnabled( index >= 0 );
+
+ if ( listBox->count() < 2 )
+ buttonRemove->setEnabled( FALSE );
+}
+
+void WizardEditor::itemDragged( TQListBoxItem * i )
+{
+ // Store item index
+ draggedItem = listBox->index( i );
+}
+
+void WizardEditor::itemDropped( TQListBoxItem * i )
+{
+ if ( draggedItem < 0 ) return;
+ // The reorder the pages acording to the listBox list of items
+ // Assumes that only one item has been moved.
+ int droppedItem = listBox->index( i );
+
+ //qDebug( "Moving page %d -> %d", draggedItem, droppedItem );
+ MoveWizardPageCommand *cmd = new MoveWizardPageCommand( tr( "Move page %1 to %2 in %3" ).arg( draggedItem ).arg( droppedItem ).arg( wizard->name() ), formwindow, wizard, draggedItem, droppedItem );
+ commands.append( cmd );
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.h b/tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.h
new file mode 100644
index 0000000..8a08e61
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/wizardeditorimpl.h
@@ -0,0 +1,82 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef WIZARDEDITORIMPL_H
+#define WIZARDEDITORIMPL_H
+
+class TQWizard;
+class FormWindow;
+
+#include <tqptrlist.h>
+
+#include "wizardeditor.h"
+#include "command.h"
+
+class WizardEditor : public WizardEditorBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ WizardEditor( TQWidget *tqparent, TQWizard *wizard, FormWindow *fw );
+ ~WizardEditor();
+
+protected Q_SLOTS:
+ void okClicked();
+ void applyClicked();
+ void cancelClicked();
+ void helpClicked();
+
+ void addClicked();
+ void removeClicked();
+ void upClicked();
+ void downClicked();
+
+ void itemHighlighted( int );
+ void itemSelected( int );
+
+ void itemDragged( TQListBoxItem * );
+ void itemDropped( TQListBoxItem * );
+
+private:
+ void updateButtons();
+ void fillListBox();
+
+private:
+ FormWindow *formwindow;
+ TQWizard *wizard;
+ TQPtrList<Command> commands;
+ int draggedItem;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/designer/workspace.cpp b/tqtinterface/qt4/tools/designer/designer/workspace.cpp
new file mode 100644
index 0000000..0694112
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/workspace.cpp
@@ -0,0 +1,713 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqvariant.h> // HP-UX compiler needs this here
+#include "workspace.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "globaldefs.h"
+#include "command.h"
+#include "project.h"
+#include "pixmapcollection.h"
+#include "sourcefile.h"
+#include "sourceeditor.h"
+#include "propertyeditor.h"
+
+#include <tqheader.h>
+#include <tqdragobject.h>
+#include <tqfileinfo.h>
+#include <tqapplication.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqobjectlist.h>
+#include <tqworkspace.h>
+#include <tqpopupmenu.h>
+#include <tqtextstream.h>
+#include "qcompletionedit.h"
+
+WorkspaceItem::WorkspaceItem( TQListView *tqparent, Project* p )
+ : TQListViewItem( tqparent )
+{
+ init();
+ project = p;
+ t = ProjectType;
+ setPixmap( 0, TQPixmap::fromMimeSource( "designer_folder.png" ) );
+ setExpandable( FALSE );
+}
+
+WorkspaceItem::WorkspaceItem( TQListViewItem *tqparent, SourceFile* sf )
+ : TQListViewItem( tqparent )
+{
+ init();
+ sourceFile = sf;
+ t = SourceFileType;
+ setPixmap( 0, TQPixmap::fromMimeSource( "designer_filenew.png" ) );
+}
+
+WorkspaceItem::WorkspaceItem( TQListViewItem *tqparent, TQObject *o, Project *p )
+ : TQListViewItem( tqparent )
+{
+ init();
+ object = o;
+ project = p;
+ t = ObjectType;
+ setPixmap( 0, TQPixmap::fromMimeSource( "designer_object.png" ) );
+ TQObject::connect( p->fakeFormFileFor( o ), TQT_SIGNAL( somethingChanged(FormFile*) ),
+ listView(), TQT_SLOT( update() ) );
+}
+
+WorkspaceItem::WorkspaceItem( TQListViewItem *tqparent, FormFile* ff, Type type )
+ : TQListViewItem( tqparent )
+{
+ init();
+ formFile = ff;
+ t = type;
+ if ( type == FormFileType ) {
+ setPixmap( 0, TQPixmap::fromMimeSource( "designer_form.png" ) );
+ TQObject::connect( ff, TQT_SIGNAL( somethingChanged(FormFile*) ), listView(), TQT_SLOT( update(FormFile*) ) );
+ if ( formFile->supportsCodeFile() ) {
+ (void) new WorkspaceItem( this, formFile, FormSourceType );
+ }
+ } else if ( type == FormSourceType ) {
+ setPixmap( 0, TQPixmap::fromMimeSource( "designer_filenew.png" ) );
+ }
+}
+
+
+void WorkspaceItem::init()
+{
+ autoOpen = FALSE;
+ useOddColor = FALSE;
+ project = 0;
+ sourceFile = 0;
+ formFile = 0;
+}
+
+void WorkspaceItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align )
+{
+ TQColorGroup g( cg );
+ g.setColor( TQColorGroup::Base, backgroundColor() );
+ g.setColor( TQColorGroup::Foreground, TQt::black );
+
+ if ( type() == FormSourceType &&
+ ( !formFile->hasFormCode() || ( formFile->codeFileState() == FormFile::Deleted && formFile->formWindow() ) ) &&
+ tqparent() && tqparent()->tqparent() && ( (WorkspaceItem*)tqparent()->tqparent() )->project &&
+ ( (WorkspaceItem*)tqparent()->tqparent() )->project->isCpp() ) {
+ g.setColor( TQColorGroup::Text, listView()->tqpalette().disabled().color( TQColorGroup::Text) );
+ g.setColor( TQColorGroup::HighlightedText, listView()->tqpalette().disabled().color( TQColorGroup::Text) );
+ } else {
+ g.setColor( TQColorGroup::Text, TQt::black );
+ }
+ p->save();
+
+ if ( isModified() ) {
+ TQFont f = p->font();
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+
+ TQListViewItem::paintCell( p, g, column, width, align );
+ p->setPen( TQPen( cg.dark(), 1 ) );
+ if ( column == 0 )
+ p->drawLine( 0, 0, 0, height() - 1 );
+ if ( listView()->firstChild() != this ) {
+ if ( nextSibling() != itemBelow() && itemBelow()->depth() < depth() ) {
+ int d = depth() - itemBelow()->depth();
+ p->drawLine( -listView()->treeStepSize() * d, height() - 1, 0, height() - 1 );
+ }
+ }
+ p->drawLine( 0, height() - 1, width, height() - 1 );
+ p->drawLine( width - 1, 0, width - 1, height() );
+ p->restore();
+}
+
+TQString WorkspaceItem::text( int column ) const
+{
+ if ( column != 0 )
+ return TQListViewItem::text( column );
+ switch( t ) {
+ case ProjectType:
+ if ( project->isDummy() ) {
+ return Project::tqtr("<No Project>" );
+ } else if ( MainWindow::self->singleProjectMode() ) {
+ return TQFileInfo( project->fileName() ).baseName();
+ }
+ return project->makeRelative( project->fileName() );
+ case FormFileType:
+ if ( !MainWindow::self->singleProjectMode() )
+ return formFile->formName() + ": " + formFile->fileName();
+ return formFile->formName();
+ case FormSourceType:
+ if ( !MainWindow::self->singleProjectMode() )
+ return formFile->codeFile();
+ return formFile->formName() + " [Source]";
+ case SourceFileType:
+ return sourceFile->fileName();
+ case ObjectType:
+ if ( !project->hasParentObject( object ) )
+ return object->name();
+ return project->qualifiedName( object );
+ }
+
+ return TQString(); // shut up compiler
+}
+
+void WorkspaceItem::fillCompletionList( TQStringList& completion )
+{
+ switch( t ) {
+ case ProjectType:
+ break;
+ case FormFileType:
+ completion += formFile->formName();
+ completion += formFile->fileName();
+ break;
+ case FormSourceType:
+ completion += formFile->codeFile();
+ break;
+ case SourceFileType:
+ completion += sourceFile->fileName();
+ break;
+ case ObjectType:
+ completion += object->name();
+ }
+}
+
+bool WorkspaceItem::checkCompletion( const TQString& completion )
+{
+ switch( t ) {
+ case ProjectType:
+ break;
+ case FormFileType:
+ return completion == formFile->formName()
+ || completion == formFile->fileName();
+ case FormSourceType:
+ return completion == formFile->codeFile();
+ case SourceFileType:
+ return completion == sourceFile->fileName();
+ case ObjectType:
+ return completion == object->name();
+ }
+ return FALSE;
+}
+
+
+bool WorkspaceItem::isModified() const
+{
+ switch( t ) {
+ case ProjectType:
+ return project->isModified();
+ case FormFileType:
+ return formFile->isModified( FormFile::WFormWindow );
+ case FormSourceType:
+ return formFile->isModified( FormFile::WFormCode );
+ case SourceFileType:
+ return sourceFile->isModified();
+ case ObjectType:
+ return project->fakeFormFileFor( object )->isModified();
+ break;
+ }
+ return FALSE; // shut up compiler
+}
+
+TQString WorkspaceItem::key( int column, bool ) const
+{
+ TQString key = text( column );
+ if ( t == FormFileType )
+ key.prepend( "0" );
+ else if ( t == ObjectType )
+ key.prepend( "a" );
+ else
+ key.prepend( "A" );
+ return key;
+}
+
+TQColor WorkspaceItem::backgroundColor()
+{
+ bool b = useOddColor;
+ if ( t == FormSourceType && tqparent() )
+ b = ( ( WorkspaceItem*)tqparent() )->useOddColor;
+ return b ? *backColor2 : *backColor1;
+}
+
+
+void WorkspaceItem::setOpen( bool b )
+{
+ TQListViewItem::setOpen( b );
+ autoOpen = FALSE;
+}
+
+void WorkspaceItem::setAutoOpen( bool b )
+{
+ TQListViewItem::setOpen( b );
+ autoOpen = b;
+}
+
+Workspace::Workspace( TQWidget *tqparent, MainWindow *mw )
+ : TQListView( tqparent, 0, (WFlags)(WStyle_Customize | TQt::WStyle_NormalBorder | TQt::WStyle_Title |
+ TQt::WStyle_Tool | TQt::WStyle_MinMax | TQt::WStyle_SysMenu) ), mainWindow( mw ),
+ project( 0 ), completionDirty( FALSE )
+{
+ init_colors();
+
+ setDefaultRenameAction( Accept );
+ blockNewForms = FALSE;
+ bufferEdit = 0;
+ header()->setStretchEnabled( TRUE );
+ header()->hide();
+ setSorting( 0 );
+ setResizePolicy( TQScrollView::Manual );
+#ifndef TQ_WS_MAC
+ TQPalette p( tqpalette() );
+ p.setColor( TQColorGroup::Base, TQColor( *backColor2 ) );
+ (void)*selectedBack; // hack
+ setPalette( p );
+#endif
+ addColumn( tqtr( "Files" ) );
+ setAllColumnsShowFocus( TRUE );
+ connect( this, TQT_SIGNAL( mouseButtonClicked( int, TQListViewItem *, const TQPoint &, int ) ),
+ this, TQT_SLOT( itemClicked( int, TQListViewItem *, const TQPoint& ) ) ),
+ connect( this, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ),
+ this, TQT_SLOT( itemDoubleClicked( TQListViewItem * ) ) ),
+ connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint &, int ) ),
+ this, TQT_SLOT( rmbClicked( TQListViewItem *, const TQPoint& ) ) ),
+ setHScrollBarMode( AlwaysOff );
+ setVScrollBarMode( AlwaysOn );
+ viewport()->setAcceptDrops( TRUE );
+ setAcceptDrops( TRUE );
+ setColumnWidthMode( 1, Manual );
+}
+
+
+void Workspace::projectDestroyed( TQObject* o )
+{
+ if ( o == project ) {
+ project = 0;
+ clear();
+ }
+}
+
+void Workspace::setCurrentProject( Project *pro )
+{
+ if ( project == pro )
+ return;
+ if ( project ) {
+ disconnect( project, TQT_SIGNAL( sourceFileAdded(SourceFile*) ), this, TQT_SLOT( sourceFileAdded(SourceFile*) ) );
+ disconnect( project, TQT_SIGNAL( sourceFileRemoved(SourceFile*) ), this, TQT_SLOT( sourceFileRemoved(SourceFile*) ) );
+ disconnect( project, TQT_SIGNAL( formFileAdded(FormFile*) ), this, TQT_SLOT( formFileAdded(FormFile*) ) );
+ disconnect( project, TQT_SIGNAL( formFileRemoved(FormFile*) ), this, TQT_SLOT( formFileRemoved(FormFile*) ) );
+ disconnect( project, TQT_SIGNAL( objectAdded(TQObject*) ), this, TQT_SLOT( objectAdded(TQObject*) ) );
+ disconnect( project, TQT_SIGNAL( objectRemoved(TQObject*) ), this, TQT_SLOT( objectRemoved(TQObject*) ) );
+ disconnect( project, TQT_SIGNAL( projectModified() ), this, TQT_SLOT( update() ) );
+ }
+ project = pro;
+ connect( project, TQT_SIGNAL( sourceFileAdded(SourceFile*) ), this, TQT_SLOT( sourceFileAdded(SourceFile*) ) );
+ connect( project, TQT_SIGNAL( sourceFileRemoved(SourceFile*) ), this, TQT_SLOT( sourceFileRemoved(SourceFile*) ) );
+ connect( project, TQT_SIGNAL( formFileAdded(FormFile*) ), this, TQT_SLOT( formFileAdded(FormFile*) ) );
+ connect( project, TQT_SIGNAL( formFileRemoved(FormFile*) ), this, TQT_SLOT( formFileRemoved(FormFile*) ) );
+ connect( project, TQT_SIGNAL( destroyed(TQObject*) ), this, TQT_SLOT( projectDestroyed(TQObject*) ) );
+ connect( project, TQT_SIGNAL( objectAdded(TQObject*) ), this, TQT_SLOT( objectAdded(TQObject*) ) );
+ connect( project, TQT_SIGNAL( objectRemoved(TQObject*) ), this, TQT_SLOT( objectRemoved(TQObject*) ) );
+ connect( project, TQT_SIGNAL( projectModified() ), this, TQT_SLOT( update() ) );
+ clear();
+
+ if ( bufferEdit )
+ bufferEdit->clear();
+
+ projectItem = new WorkspaceItem( this, project );
+
+ projectItem->setOpen( TRUE );
+
+ for ( TQPtrListIterator<SourceFile> sources = project->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ (void) new WorkspaceItem( projectItem, f );
+ }
+
+ for ( TQPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ FormFile* f = forms.current();
+ if ( f->isFake() )
+ continue;
+
+ (void) new WorkspaceItem( projectItem, f );
+ }
+
+ TQObjectList l = project->objects();
+ TQObjectListIt objs( l );
+ for ( ;objs.current(); ++objs ) {
+ TQObject* o = objs.current();
+ (void) new WorkspaceItem( projectItem, o, project );
+ }
+
+ updateColors();
+ completionDirty = TRUE;
+}
+
+void Workspace::sourceFileAdded( SourceFile* sf )
+{
+ (void) new WorkspaceItem( projectItem, sf );
+ updateColors();
+}
+
+void Workspace::sourceFileRemoved( SourceFile* sf )
+{
+ delete tqfindItem( sf );
+ updateColors();
+}
+
+void Workspace::formFileAdded( FormFile* ff )
+{
+ if ( ff->isFake() )
+ return;
+ (void) new WorkspaceItem( projectItem, ff );
+ updateColors();
+}
+
+void Workspace::formFileRemoved( FormFile* ff )
+{
+ delete tqfindItem( ff );
+ updateColors();
+}
+
+void Workspace::objectAdded( TQObject *o )
+{
+ (void) new WorkspaceItem( projectItem, o, project );
+ updateColors();
+}
+
+void Workspace::objectRemoved( TQObject *o )
+{
+ delete tqfindItem( o );
+ updateColors();
+}
+
+void Workspace::update()
+{
+ completionDirty = TRUE;
+ triggerUpdate();
+}
+
+void Workspace::update( FormFile* ff )
+{
+ TQListViewItem* i = tqfindItem( ff );
+ if ( i ) {
+ i->tqrepaint();
+ if ( (i = i->firstChild()) )
+ i->tqrepaint();
+ }
+}
+
+
+void Workspace::activeFormChanged( FormWindow *fw )
+{
+ WorkspaceItem *i = tqfindItem( fw->formFile() );
+ if ( i ) {
+ setCurrentItem( i );
+ setSelected( i, TRUE );
+ if ( !i->isOpen() )
+ i->setAutoOpen( TRUE );
+ }
+
+ closeAutoOpenItems();
+
+}
+
+void Workspace::activeEditorChanged( SourceEditor *se )
+{
+ if ( !se->object() )
+ return;
+
+ if ( se->formWindow() ) {
+ WorkspaceItem *i = tqfindItem( se->formWindow()->formFile() );
+ if ( i && i->firstChild() ) {
+ if ( !i->isOpen() )
+ i->setAutoOpen( TRUE );
+ setCurrentItem( i->firstChild() );
+ setSelected( i->firstChild(), TRUE );
+ }
+ } else {
+ WorkspaceItem *i = tqfindItem( se->sourceFile() );
+ if ( i ) {
+ setCurrentItem( i );
+ setSelected( i, TRUE );
+ }
+ }
+
+ closeAutoOpenItems();
+}
+
+WorkspaceItem *Workspace::tqfindItem( FormFile* ff)
+{
+ TQListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( ( (WorkspaceItem*)it.current() )->formFile == ff )
+ return (WorkspaceItem*)it.current();
+ }
+ return 0;
+}
+
+WorkspaceItem *Workspace::tqfindItem( SourceFile *sf )
+{
+ TQListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( ( (WorkspaceItem*)it.current() )->sourceFile == sf )
+ return (WorkspaceItem*)it.current();
+ }
+ return 0;
+}
+
+WorkspaceItem *Workspace::tqfindItem( TQObject *o )
+{
+ TQListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( ( (WorkspaceItem*)it.current() )->object == o )
+ return (WorkspaceItem*)it.current();
+ }
+ return 0;
+}
+
+void Workspace::closeAutoOpenItems()
+{
+ TQListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ WorkspaceItem* i = (WorkspaceItem*) it.current();
+ WorkspaceItem* ip = (WorkspaceItem*) i->tqparent();
+ if ( i->type() == WorkspaceItem::FormSourceType ) {
+ if ( !i->isSelected() && !ip->isSelected()
+ && ip->isAutoOpen() ) {
+ ip->setAutoOpen( FALSE );
+ }
+ }
+ }
+}
+
+
+void Workspace::closeEvent( TQCloseEvent *e )
+{
+ e->accept();
+}
+
+void Workspace::itemDoubleClicked( TQListViewItem *i )
+{
+ if ( ( (WorkspaceItem*)i)->type()== WorkspaceItem::ProjectType )
+ i->setOpen( TRUE );
+}
+
+void Workspace::itemClicked( int button, TQListViewItem *i, const TQPoint& )
+{
+ if ( !i || button != Qt::LeftButton )
+ return;
+
+ closeAutoOpenItems();
+
+ WorkspaceItem* wi = (WorkspaceItem*)i;
+ switch( wi->type() ) {
+ case WorkspaceItem::ProjectType:
+ break; // ### TODO
+ case WorkspaceItem::FormFileType:
+ wi->formFile->showFormWindow();
+ break;
+ case WorkspaceItem::FormSourceType:
+ wi->formFile->showEditor( FALSE );
+ break;
+ case WorkspaceItem::SourceFileType:
+ mainWindow->editSource( wi->sourceFile );
+ break;
+ case WorkspaceItem::ObjectType:
+ project->fakeFormFileFor( wi->object )->formWindow()->setFocus();
+ mainWindow->propertyeditor()->setWidget( wi->object,
+ project->fakeFormFileFor( wi->object )->formWindow() );
+ mainWindow->objectHierarchy()->
+ setFormWindow( project->fakeFormFileFor( wi->object )->formWindow(), wi->object );
+ project->fakeFormFileFor( wi->object )->showEditor();
+ break;
+ }
+}
+
+void Workspace::contentsDropEvent( TQDropEvent *e )
+{
+ if ( !TQUriDrag::canDecode( e ) ) {
+ e->ignore();
+ } else {
+ TQStringList files;
+ TQUriDrag::decodeLocalFiles( e, files );
+ if ( !files.isEmpty() ) {
+ for ( TQStringList::Iterator it = files.begin(); it != files.end(); ++it ) {
+ TQString fn = *it;
+ mainWindow->fileOpen( "", "", fn );
+ }
+ }
+ }
+}
+
+void Workspace::contentsDragEnterEvent( TQDragEnterEvent *e )
+{
+ if ( !TQUriDrag::canDecode( e ) )
+ e->ignore();
+ else
+ e->accept();
+}
+
+void Workspace::contentsDragMoveEvent( TQDragMoveEvent *e )
+{
+ if ( !TQUriDrag::canDecode( e ) )
+ e->ignore();
+ else
+ e->accept();
+}
+
+void Workspace::rmbClicked( TQListViewItem *i, const TQPoint& pos )
+{
+ if ( !i )
+ return;
+ WorkspaceItem* wi = (WorkspaceItem*)i;
+ enum { OPEN_SOURCE, REMOVE_SOURCE, OPEN_FORM, REMOVE_FORM,
+ OPEN_FORM_SOURCE, REMOVE_FORM_SOURCE, OPEN_OBJECT_SOURCE };
+ TQPopupMenu menu( this );
+ menu.setCheckable( TRUE );
+ switch ( wi->type() ) {
+ case WorkspaceItem::SourceFileType:
+ menu.insertItem( tqtr( "&Open source file" ), OPEN_SOURCE );
+ menu.insertSeparator();
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editcut.png" ),
+ tqtr( "&Remove source file from project" ), REMOVE_SOURCE );
+ break;
+ case WorkspaceItem::FormFileType:
+ menu.insertItem( tqtr( "&Open form" ), OPEN_FORM );
+ menu.insertSeparator();
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editcut.png" ),
+ tqtr( "&Remove form from project" ), REMOVE_FORM );
+ break;
+ case WorkspaceItem::FormSourceType:
+ menu.insertItem( tqtr( "&Open form source" ), OPEN_FORM_SOURCE );
+ menu.insertSeparator();
+ if ( project->isCpp() )
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editcut.png" ),
+ tqtr( "&Remove source file from form" ), REMOVE_FORM_SOURCE );
+ else
+ menu.insertItem( TQPixmap::fromMimeSource( "designer_editcut.png" ),
+ tqtr( "&Remove form from project" ), REMOVE_FORM );
+ break;
+ case WorkspaceItem::ProjectType:
+ MainWindow::self->popupProjectMenu( pos );
+ return;
+ case WorkspaceItem::ObjectType:
+ menu.insertItem( tqtr( "&Open source" ), OPEN_OBJECT_SOURCE );
+ break;
+ }
+
+ switch ( menu.exec( pos ) ) {
+ case REMOVE_SOURCE:
+ project->removeSourceFile( wi->sourceFile );
+ break;
+ case REMOVE_FORM:
+ project->removeFormFile( wi->formFile );
+ break;
+ case REMOVE_FORM_SOURCE:
+ ( (WorkspaceItem*)i )->formFile->setModified( TRUE );
+ ( (WorkspaceItem*)i )->formFile->setCodeFileState( FormFile::Deleted );
+ delete ( (WorkspaceItem*)i )->formFile->editor();
+ break;
+ case OPEN_OBJECT_SOURCE:
+ case OPEN_SOURCE:
+ case OPEN_FORM:
+ case OPEN_FORM_SOURCE:
+ itemClicked( Qt::LeftButton, i, pos );
+ break;
+ }
+}
+
+bool Workspace::eventFilter( TQObject *o, TQEvent * e )
+{
+ // Reggie, on what type of events do we have to execute updateBufferEdit()
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(bufferEdit) && e->type() != TQEvent::ChildRemoved )
+ updateBufferEdit();
+ return TQListView::eventFilter( o, e );
+}
+
+void Workspace::setBufferEdit( TQCompletionEdit *edit )
+{
+ bufferEdit = edit;
+ connect( bufferEdit, TQT_SIGNAL( chosen( const TQString & ) ),
+ this, TQT_SLOT( bufferChosen( const TQString & ) ) );
+ bufferEdit->installEventFilter( this );
+}
+
+void Workspace::updateBufferEdit()
+{
+ if ( !bufferEdit || !completionDirty || !MainWindow::self)
+ return;
+ completionDirty = FALSE;
+ TQStringList completion = MainWindow::self->projectFileNames();
+ TQListViewItemIterator it( this );
+ while ( it.current() ) {
+ ( (WorkspaceItem*)it.current())->fillCompletionList( completion );
+ ++it;
+ }
+ completion.sort();
+ bufferEdit->setCompletionList( completion );
+}
+
+void Workspace::bufferChosen( const TQString &buffer )
+{
+ if ( bufferEdit )
+ bufferEdit->setText( "" );
+
+ if ( MainWindow::self->projectFileNames().tqcontains( buffer ) ) {
+ MainWindow::self->setCurrentProjectByFilename( buffer );
+ return;
+ }
+
+ TQListViewItemIterator it( this );
+ while ( it.current() ) {
+ if ( ( (WorkspaceItem*)it.current())->checkCompletion( buffer ) ) {
+ itemClicked( Qt::LeftButton, it.current(), TQPoint() );
+ break;
+ }
+ ++it;
+ }
+}
+
+void Workspace::updateColors()
+{
+ TQListViewItem* i = firstChild();
+ if ( i )
+ i = i->firstChild();
+ bool b = TRUE;
+ while ( i ) {
+ WorkspaceItem* wi = ( WorkspaceItem*) i;
+ i = i->nextSibling();
+ wi->useOddColor = b;
+ b = !b;
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/designer/workspace.h b/tqtinterface/qt4/tools/designer/designer/workspace.h
new file mode 100644
index 0000000..b889d3f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/designer/workspace.h
@@ -0,0 +1,159 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef WORKSPACE_H
+#define WORKSPACE_H
+
+#include <tqlistview.h>
+
+class FormWindow;
+class TQResizeEvent;
+class TQCloseEvent;
+class TQDropEvent;
+class TQDragMoveEvent;
+class TQDragEnterEvent;
+class MainWindow;
+class Project;
+class SourceFile;
+class FormFile;
+class TQCompletionEdit;
+class SourceEditor;
+
+class WorkspaceItem : public TQListViewItem
+{
+public:
+ enum Type { ProjectType, FormFileType, FormSourceType, SourceFileType, ObjectType };
+
+ WorkspaceItem( TQListView *tqparent, Project* p );
+ WorkspaceItem( TQListViewItem *tqparent, SourceFile* sf );
+ WorkspaceItem( TQListViewItem *tqparent, FormFile* ff, Type t = FormFileType );
+ WorkspaceItem( TQListViewItem *tqparent, TQObject *o, Project *p );
+
+ void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align );
+
+ Type type() const { return t; }
+
+ bool isModified() const;
+
+ TQString text( int ) const;
+
+ void fillCompletionList( TQStringList& completion );
+ bool checkCompletion( const TQString& completion );
+
+ TQString key( int, bool ) const; // column sorting key
+
+ Project* project;
+ SourceFile* sourceFile;
+ FormFile* formFile;
+ TQObject *object;
+
+ void setOpen( bool );
+
+ void setAutoOpen( bool );
+ bool isAutoOpen() const { return isOpen() && autoOpen; }
+
+ bool useOddColor;
+
+private:
+ void init();
+ bool autoOpen;
+ TQColor backgroundColor();
+ Type t;
+};
+
+class Workspace : public TQListView
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ Workspace( TQWidget *tqparent , MainWindow *mw );
+
+ void setCurrentProject( Project *pro );
+
+ void contentsDropEvent( TQDropEvent *e );
+ void contentsDragEnterEvent( TQDragEnterEvent *e );
+ void contentsDragMoveEvent( TQDragMoveEvent *e );
+
+ void setBufferEdit( TQCompletionEdit *edit );
+
+public Q_SLOTS:
+
+ void update();
+ void update( FormFile* );
+
+ void activeFormChanged( FormWindow *fw );
+ void activeEditorChanged( SourceEditor *se );
+
+protected:
+ void closeEvent( TQCloseEvent *e );
+ bool eventFilter( TQObject *, TQEvent * );
+
+
+private Q_SLOTS:
+ void itemClicked( int, TQListViewItem *i, const TQPoint& pos );
+ void itemDoubleClicked( TQListViewItem *i );
+ void rmbClicked( TQListViewItem *i, const TQPoint& pos );
+ void bufferChosen( const TQString &buffer );
+
+ void projectDestroyed( TQObject* );
+
+ void sourceFileAdded( SourceFile* );
+ void sourceFileRemoved( SourceFile* );
+
+ void formFileAdded( FormFile* );
+ void formFileRemoved( FormFile* );
+
+ void objectAdded( TQObject* );
+ void objectRemoved( TQObject * );
+
+private:
+ WorkspaceItem *tqfindItem( FormFile *ff );
+ WorkspaceItem *tqfindItem( SourceFile *sf );
+ WorkspaceItem *tqfindItem( TQObject *o );
+
+ void closeAutoOpenItems();
+
+private:
+ MainWindow *mainWindow;
+ Project *project;
+ WorkspaceItem *projectItem;
+ TQCompletionEdit *bufferEdit;
+ bool blockNewForms;
+ void updateBufferEdit();
+ bool completionDirty;
+ void updateColors();
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/arghintwidget.cpp b/tqtinterface/qt4/tools/designer/editor/arghintwidget.cpp
new file mode 100644
index 0000000..7f9269a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/arghintwidget.cpp
@@ -0,0 +1,239 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "arghintwidget.h"
+#include <tqbutton.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+
+static const char * left_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+" ",
+" ",
+" + ",
+" ++ ",
+" +++ ",
+" ++++ ",
+" +++++ ",
+" ++++++ ",
+" ++++++ ",
+" +++++ ",
+" ++++ ",
+" +++ ",
+" ++ ",
+" + ",
+" ",
+" "};
+
+static const char * right_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+" ",
+" ",
+" + ",
+" ++ ",
+" +++ ",
+" ++++ ",
+" +++++ ",
+" ++++++ ",
+" ++++++ ",
+" +++++ ",
+" ++++ ",
+" +++ ",
+" ++ ",
+" + ",
+" ",
+" "};
+
+static const char * left_disabled_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c darkgray",
+" ",
+" ",
+" + ",
+" ++ ",
+" +++ ",
+" ++++ ",
+" +++++ ",
+" ++++++ ",
+" ++++++ ",
+" +++++ ",
+" ++++ ",
+" +++ ",
+" ++ ",
+" + ",
+" ",
+" "};
+
+static const char * right_disabled_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c darkgray",
+" ",
+" ",
+" + ",
+" ++ ",
+" +++ ",
+" ++++ ",
+" +++++ ",
+" ++++++ ",
+" ++++++ ",
+" +++++ ",
+" ++++ ",
+" +++ ",
+" ++ ",
+" + ",
+" ",
+" "};
+
+class ArrowButton : public TQButton
+{
+ TQ_OBJECT
+
+public:
+ enum Dir { Left, Right };
+
+ ArrowButton( TQWidget *tqparent, const char *name, Dir d );
+ void drawButton( TQPainter *p );
+
+private:
+ TQPixmap pix, pix_disabled;
+
+};
+
+ArrowButton::ArrowButton( TQWidget *tqparent, const char *name, Dir d )
+ : TQButton( tqparent, name )
+{
+ setFixedSize( 16, 16 );
+ if ( d == Left ) {
+ pix = TQPixmap( left_xpm );
+ pix_disabled = TQPixmap( left_disabled_xpm );
+ } else {
+ pix = TQPixmap( right_xpm );
+ pix_disabled = TQPixmap( right_disabled_xpm );
+ }
+}
+
+void ArrowButton::drawButton( TQPainter *p )
+{
+ if ( isDown() )
+ p->fillRect( 0, 0, width(), height(), darkGray );
+ else
+ p->fillRect( 0, 0, width(), height(), lightGray );
+ if ( isEnabled() )
+ p->drawPixmap( 0, 0, pix );
+ else
+ p->drawPixmap( 0, 0, pix_disabled );
+}
+
+
+ArgHintWidget::ArgHintWidget( TQWidget *tqparent, const char*name )
+ : TQFrame( tqparent, name, WType_Popup ), curFunc( 0 ), numFuncs( 0 )
+{
+ setFrameStyle( TQFrame::Box | TQFrame::Plain );
+ setLineWidth( 1 );
+ setBackgroundColor( white );
+ TQHBoxLayout *hbox = new TQHBoxLayout( this );
+ hbox->setMargin( 1 );
+ hbox->addWidget( ( prev = new ArrowButton( this, "editor_left_btn", ArrowButton::Left ) ) );
+ hbox->addWidget( ( funcLabel = new TQLabel( this, "editor_func_lbl" ) ) );
+ hbox->addWidget( ( next = new ArrowButton( this, "editor_right_btn", ArrowButton::Right ) ) );
+ funcLabel->setBackgroundColor( white );
+ funcLabel->tqsetAlignment( AlignCenter );
+ connect( prev, TQT_SIGNAL( clicked() ), this, TQT_SLOT( gotoPrev() ) );
+ connect( next, TQT_SIGNAL( clicked() ), this, TQT_SLOT( gotoNext() ) );
+ updateState();
+ setFocusPolicy( NoFocus );
+ prev->setFocusPolicy( NoFocus );
+ next->setFocusPolicy( NoFocus );
+ funcLabel->setFocusPolicy( NoFocus );
+}
+
+void ArgHintWidget::setFunctionText( int func, const TQString &text )
+{
+ funcs.tqreplace( func, text );
+ if ( func == curFunc ) {
+ funcLabel->clear();
+ funcLabel->setText( text );
+ }
+}
+
+void ArgHintWidget::setNumFunctions( int num )
+{
+ funcs.clear();
+ numFuncs = num;
+ curFunc = 0;
+ updateState();
+}
+
+void ArgHintWidget::gotoPrev()
+{
+ if ( curFunc > 0 ) {
+ curFunc--;
+ funcLabel->setText( funcs[ curFunc ] );
+ updateState();
+ }
+}
+
+void ArgHintWidget::gotoNext()
+{
+ if ( curFunc < numFuncs - 1 ) {
+ curFunc++;
+ funcLabel->setText( funcs[ curFunc ] );
+ updateState();
+ }
+}
+
+void ArgHintWidget::updateState()
+{
+ prev->setEnabled( curFunc > 0 );
+ next->setEnabled( curFunc < numFuncs - 1 );
+}
+
+void ArgHintWidget::retqlayout()
+{
+ funcLabel->setText( "" );
+ funcLabel->setText( funcs[ curFunc ] );
+}
+
+#include "arghintwidget.tqmoc"
diff --git a/tqtinterface/qt4/tools/designer/editor/arghintwidget.h b/tqtinterface/qt4/tools/designer/editor/arghintwidget.h
new file mode 100644
index 0000000..0986c55
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/arghintwidget.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ARGHINTWIDGET_H
+#define ARGHINTWIDGET_H
+
+#include <tqframe.h>
+
+class TQLabel;
+class ArrowButton;
+
+class ArgHintWidget : public TQFrame
+{
+ TQ_OBJECT
+
+public:
+ ArgHintWidget( TQWidget *tqparent, const char*name );
+
+ void setFunctionText( int func, const TQString &text );
+ void setNumFunctions( int num );
+
+public Q_SLOTS:
+ void retqlayout();
+ void gotoPrev();
+ void gotoNext();
+
+private:
+ void updateState();
+
+private:
+ int curFunc;
+ int numFuncs;
+ TQMap<int, TQString> funcs;
+ TQLabel *funcLabel;
+ ArrowButton *prev, *next;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/browser.cpp b/tqtinterface/qt4/tools/designer/editor/browser.cpp
new file mode 100644
index 0000000..67c0e12
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/browser.cpp
@@ -0,0 +1,149 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "browser.h"
+#include "editor.h"
+#include <private/tqrichtext_p.h>
+
+
+EditorBrowser::EditorBrowser( Editor *e )
+ : curEditor( e ), oldHighlightedParag( 0 )
+{
+ curEditor = e;
+
+ // ### disabled for now
+// curEditor->viewport()->installEventFilter( this );
+// curEditor->installEventFilter( this );
+
+ TQFont fn( curEditor->font() );
+ fn.setUnderline( TRUE );
+ highlightedFormat = new TQTextFormat( fn, blue );
+}
+
+EditorBrowser::~EditorBrowser()
+{
+ delete highlightedFormat;
+}
+
+bool EditorBrowser::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( ::tqqt_cast<Editor*>(o->tqparent()) || ::tqqt_cast<Editor*>(o) ) {
+ TQMouseEvent *me;
+ TQKeyEvent *ke;
+ switch ( e->type() ) {
+ case TQEvent::MouseMove:
+ me = (TQMouseEvent*)e;
+ if ( ( me->state() & ControlButton ) == ControlButton ) {
+ curEditor->viewport()->setCursor( pointingHandCursor );
+ TQTextCursor c( curEditor->document() );
+ curEditor->placeCursor( curEditor->viewportToContents( me->pos() ), &c );
+ TQTextCursor from, to;
+ if ( oldHighlightedParag ) {
+ oldHighlightedParag->setEndState( -1 );
+ oldHighlightedParag->format();
+ oldHighlightedParag = 0;
+ }
+ if ( tqfindCursor( c, from, to ) && from.paragraph() == to.paragraph() ) {
+ // avoid collision with other selections
+ for ( int i = 0; i < curEditor->document()->numSelections(); ++i )
+ curEditor->document()->removeSelection( i );
+ from.paragraph()->setFormat( from.index(), to.index() - from.index() + 1, highlightedFormat, FALSE );
+ lastWord = from.paragraph()->string()->toString().mid( from.index(), to.index() - from.index() + 1 );
+ oldHighlightedParag = from.paragraph();
+ } else {
+ lastWord = "";
+ }
+ curEditor->repaintChanged();
+ return TRUE;
+ }
+ break;
+ case TQEvent::MouseButtonPress: {
+ bool killEvent = !lastWord.isEmpty();
+ if ( !lastWord.isEmpty() )
+ showHelp( lastWord );
+ lastWord = "";
+ curEditor->viewport()->setCursor( ibeamCursor );
+ if ( oldHighlightedParag ) {
+ oldHighlightedParag->setEndState( -1 );
+ oldHighlightedParag->format();
+ curEditor->repaintChanged();
+ oldHighlightedParag = 0;
+ }
+ if ( killEvent )
+ return TRUE;
+ } break;
+ case TQEvent::KeyRelease:
+ lastWord = "";
+ ke = (TQKeyEvent*)e;
+ if ( ke->key() == Key_Control ) {
+ curEditor->viewport()->setCursor( ibeamCursor );
+ if ( oldHighlightedParag ) {
+ oldHighlightedParag->setEndState( -1 );
+ oldHighlightedParag->format();
+ curEditor->repaintChanged();
+ oldHighlightedParag = 0;
+ }
+ }
+ default:
+ break;
+ }
+ }
+ return FALSE;
+}
+
+void EditorBrowser::setCurrentEdior( Editor *e )
+{
+ curEditor = e;
+ curEditor->installEventFilter( this );
+}
+
+void EditorBrowser::addEditor( Editor *e )
+{
+ e->installEventFilter( this );
+}
+
+bool EditorBrowser::tqfindCursor( const TQTextCursor &c, TQTextCursor &from, TQTextCursor &to )
+{
+ from = c;
+ while ( from.paragraph()->at( from.index() )->c != ' ' && from.paragraph()->at( from.index() )->c != '\t' && from.index() > 0 )
+ from.gotoLeft();
+ if ( from.paragraph()->at( from.index() )->c == ' ' || from.paragraph()->at( from.index() )->c == '\t' )
+ from.gotoRight();
+ to = c;
+ while ( to.paragraph()->at( to.index() )->c != ' ' && to.paragraph()->at( to.index() )->c != '\t' &&
+ to.index() < to.paragraph()->length() - 1 )
+ to.gotoRight();
+ if ( to.paragraph()->at( to.index() )->c == ' ' || to.paragraph()->at( to.index() )->c == '\t' )
+ to.gotoLeft();
+ return TRUE;
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/browser.h b/tqtinterface/qt4/tools/designer/editor/browser.h
new file mode 100644
index 0000000..6d57299
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/browser.h
@@ -0,0 +1,66 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef BROWSER_H
+#define BROWSER_H
+
+#include <tqobject.h>
+
+class Editor;
+class TQTextCursor;
+class TQTextParagraph;
+class TQTextFormat;
+
+class EditorBrowser : public TQObject
+{
+ TQ_OBJECT
+
+public:
+ EditorBrowser( Editor *e );
+ ~EditorBrowser();
+
+ bool eventFilter( TQObject *o, TQEvent *e );
+ virtual void setCurrentEdior( Editor *e );
+ virtual void addEditor( Editor *e );
+ virtual bool tqfindCursor( const TQTextCursor &c, TQTextCursor &from, TQTextCursor &to );
+ virtual void showHelp( const TQString & ) {}
+
+protected:
+ Editor *curEditor;
+ TQTextParagraph *oldHighlightedParag;
+ TQString lastWord;
+ TQTextFormat *highlightedFormat;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/cindent.cpp b/tqtinterface/qt4/tools/designer/editor/cindent.cpp
new file mode 100644
index 0000000..4c8c425
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/cindent.cpp
@@ -0,0 +1,163 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "cindent.h"
+#include "tqregexp.h"
+
+extern int indentForBottomLine( const TQStringList& program, TQChar typedIn );
+extern void setTabSize( int s );
+extern void setIndentSize( int s );
+
+CIndent::CIndent()
+ : TQTextIndent(), tabSize( 8 ), indentSize( 4 ),
+ autoIndent( TRUE ), keepTabs( TRUE ), lastDoc( 0 )
+{
+}
+
+static int indentation( const TQString &s )
+{
+ if ( s.simplifyWhiteSpace().length() == 0 )
+ return 0;
+ int i = 0;
+ int ind = 0;
+ while ( i < (int)s.length() ) {
+ TQChar c = s.at( i );
+ if ( c == ' ' )
+ ind++;
+ else if ( c == '\t' )
+ ind += 8;
+ else
+ break;
+ ++i;
+ }
+ return ind;
+}
+
+void CIndent::tabify( TQString &s )
+{
+ if ( !keepTabs )
+ return;
+ int i = 0;
+ for ( ;; ) {
+ for ( int j = i; j < (int)s.length(); ++j ) {
+ if ( s[ j ] != ' ' && s[ j ] != '\t' ) {
+ if ( j > i ) {
+ TQString t = s.mid( i, j - i );
+ int spaces = 0;
+ for ( int k = 0; k < (int)t.length(); ++k )
+ spaces += ( t[ k ] == ' ' ? 1 : tabSize );
+ s.remove( i, t.length() );
+ int tabs = spaces / tabSize;
+ spaces = spaces - ( tabSize * tabs );
+ TQString tmp;
+ tmp.fill( ' ', spaces );
+ if ( spaces > 0 )
+ s.insert( i, tmp );
+ tmp.fill( '\t', tabs );
+ if ( tabs > 0 )
+ s.insert( i, tmp );
+ }
+ break;
+ }
+ }
+ i = s.tqfind( '\n', i );
+ if ( i == -1 )
+ break;
+ ++i;
+ }
+}
+
+void CIndent::indentLine( TQTextParagraph *p, int &oldIndent, int &newIndent )
+{
+ TQString indentString;
+ indentString.fill( ' ', newIndent );
+ indentString.append( "a" );
+ tabify( indentString );
+ indentString.remove( indentString.length() - 1, 1 );
+ newIndent = indentString.length();
+ oldIndent = 0;
+ while ( p->length() > 0 && ( p->at( 0 )->c == ' ' || p->at( 0 )->c == '\t' ) ) {
+ ++oldIndent;
+ p->remove( 0, 1 );
+ }
+ if ( p->string()->length() == 0 )
+ p->append( " " );
+ if ( !indentString.isEmpty() )
+ p->insert( 0, indentString );
+}
+
+
+void CIndent::indent( TQTextDocument *doc, TQTextParagraph *p, int *oldIndent, int *newIndent )
+{
+ lastDoc = doc;
+ int oi = indentation( p->string()->toString() );
+ TQStringList code;
+ TQTextParagraph *parag = doc->firstParagraph();
+ while ( parag ) {
+ code << parag->string()->toString();
+ if ( parag == p )
+ break;
+ parag = parag->next();
+ }
+
+ int ind = indentForBottomLine( code, TQChar::null );
+ indentLine( p, oi, ind );
+ if ( oldIndent )
+ *oldIndent = oi;
+ if ( newIndent )
+ *newIndent = ind;
+}
+
+void CIndent::reindent()
+{
+ if ( !lastDoc )
+ return;
+ // #### this is sloooooooow (O(n^2))
+ TQTextParagraph *parag = lastDoc->firstParagraph();
+ while ( parag ) {
+ indent( lastDoc, parag, 0, 0 );
+ parag = parag->next();
+ }
+}
+
+void CIndent::setTabSize( int ts )
+{
+ tabSize = ts;
+ ::setTabSize( ts );
+}
+
+void CIndent::setIndentSize( int is )
+{
+ indentSize = is;
+ ::setIndentSize( is );
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/cindent.h b/tqtinterface/qt4/tools/designer/editor/cindent.h
new file mode 100644
index 0000000..6e7e122
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/cindent.h
@@ -0,0 +1,63 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CINDENT_H
+#define CINDENT_H
+
+#include <private/tqrichtext_p.h>
+
+class CIndent : public TQTextIndent
+{
+public:
+ CIndent();
+ virtual ~CIndent() {}
+ void indent( TQTextDocument *doc, TQTextParagraph *parag, int *oldIndent, int *newIndent );
+
+ void setTabSize( int ts );
+ void setIndentSize( int is );
+ void setAutoIndent( bool ai ) { autoIndent = ai; reindent(); }
+ void setKeepTabs( bool kt ) { keepTabs = kt; }
+
+private:
+ void reindent();
+ void indentLine( TQTextParagraph *p, int &oldIndent, int &newIndent );
+ void tabify( TQString &s );
+
+public:
+ int tabSize, indentSize;
+ bool autoIndent, keepTabs;
+ TQTextDocument *lastDoc;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/completion.cpp b/tqtinterface/qt4/tools/designer/editor/completion.cpp
new file mode 100644
index 0000000..1b42cb0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/completion.cpp
@@ -0,0 +1,714 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "completion.h"
+#include "paragdata.h"
+#include "editor.h"
+#include <tqlistbox.h>
+#include <tqvbox.h>
+#include <tqmap.h>
+#include <private/tqrichtext_p.h>
+#include <tqapplication.h>
+#include <tqregexp.h>
+#include "arghintwidget.h"
+#include <tqsizegrip.h>
+#include <tqtimer.h>
+
+static TQColor getColor( const TQString &type )
+{
+ if ( type == "function" || type == "slot" || type == "package" )
+ return TQt::blue;
+ else if ( type == "variable" || type == "widget" || type == "dir" )
+ return TQt::darkRed;
+ else if ( type == "object" || type == "class" )
+ return TQt::darkBlue;
+ else if ( type == "property" )
+ return TQt::darkGreen;
+ else if ( type == "enum" )
+ return TQt::darkYellow;
+ return TQt::black;
+}
+
+class CompletionItem : public TQListBoxItem
+{
+public:
+ CompletionItem( TQListBox *lb, const TQString &txt, const TQString &t, const TQString &p,
+ const TQString &pre, const TQString &p2 )
+ : TQListBoxItem( lb ), type( t ), postfix( p ), prefix( pre ), postfix2( p2 ),
+ parag( 0 ), lastState( FALSE ) { setText( txt ); }
+ ~CompletionItem() { delete parag; }
+ void paint( TQPainter *painter ) {
+ if ( lastState != isSelected() ) {
+ delete parag;
+ parag = 0;
+ }
+ lastState = isSelected();
+ if ( !parag )
+ setupParagraph();
+ parag->paint( *painter, listBox()->tqcolorGroup() );
+ }
+
+ int height( const TQListBox * ) const {
+ if ( !parag )
+ ( (CompletionItem*)this )->setupParagraph();
+ return parag->rect().height();
+ }
+ int width( const TQListBox * ) const {
+ if ( !parag )
+ ( (CompletionItem*)this )->setupParagraph();
+ return parag->rect().width() - 2;
+ }
+ TQString text() const { return TQListBoxItem::text() + postfix; }
+
+private:
+ void setupParagraph();
+ TQString type, postfix, prefix, postfix2;
+ TQTextParagraph *parag;
+ bool lastState;
+
+};
+
+void CompletionItem::setupParagraph() {
+ if ( !parag ) {
+ TQTextFormatter *formatter;
+ formatter = new TQTextFormatterBreakWords;
+ formatter->setWrapEnabled( FALSE );
+ parag = new TQTextParagraph( 0 );
+ parag->setTabStops( listBox()->fontMetrics().width( "propertyXXXX" ) );
+ parag->pseudoDocument()->pFormatter = formatter;
+ parag->insert( 0, " " + type + ( type.isEmpty() ? " " : "\t" ) + prefix +
+ TQListBoxItem::text() + postfix + postfix2 );
+ bool selCol = isSelected() && listBox()->tqcolorGroup().highlightedText() != listBox()->tqcolorGroup().text();
+ TQColor sc = selCol ? listBox()->tqcolorGroup().highlightedText() : getColor( type );
+ TQTextFormat *f1 = parag->formatCollection()->format( listBox()->font(), sc );
+ TQTextFormat *f3 = parag->formatCollection()->format( listBox()->font(), isSelected() ?
+ listBox()->tqcolorGroup().highlightedText() :
+ listBox()->tqcolorGroup().text() );
+ TQFont f( listBox()->font() );
+ f.setBold( TRUE );
+ TQTextFormat *f2 =
+ parag->formatCollection()->format( f, isSelected() ? listBox()->tqcolorGroup().highlightedText() :
+ listBox()->tqcolorGroup().text() );
+ parag->setFormat( 1, type.length() + 1, f1 );
+ parag->setFormat( type.length() + 2, prefix.length() + TQListBoxItem::text().length(), f2 );
+ if ( !postfix.isEmpty() )
+ parag->setFormat( type.length() + 2 + prefix.length() + TQListBoxItem::text().length(),
+ postfix.length(), f3 );
+ parag->setFormat( type.length() + 2 + prefix.length() + TQListBoxItem::text().length() + postfix.length(),
+ postfix2.length(), f3 );
+ f1->removeRef();
+ f2->removeRef();
+ f3->removeRef();
+ parag->format();
+ }
+}
+
+
+EditorCompletion::EditorCompletion( Editor *e )
+{
+ enabled = TRUE;
+ lastDoc = 0;
+ completionPopup = new TQVBox( e->tqtopLevelWidget(), 0, WType_Popup );
+ completionPopup->setFrameStyle( TQFrame::Box | TQFrame::Plain );
+ completionPopup->setLineWidth( 1 );
+ functionLabel = new ArgHintWidget( e->tqtopLevelWidget(), "editor_function_lbl" );
+ functionLabel->hide();
+ completionListBox = new TQListBox( completionPopup, "editor_completion_lb" );
+ completionListBox->setFrameStyle( TQFrame::NoFrame );
+ completionListBox->installEventFilter( this );
+ completionListBox->setHScrollBarMode( TQScrollView::AlwaysOn );
+ completionListBox->setVScrollBarMode( TQScrollView::AlwaysOn );
+ completionListBox->setCornerWidget( new TQSizeGrip( completionListBox, "editor_cornerwidget" ) );
+ completionPopup->installEventFilter( this );
+ functionLabel->installEventFilter( this );
+ completionPopup->setFocusProxy( completionListBox );
+ completionOffset = 0;
+ curEditor = e;
+ curEditor->installEventFilter( this );
+}
+
+EditorCompletion::~EditorCompletion()
+{
+ delete completionPopup;
+ delete functionLabel;
+}
+
+void EditorCompletion::addCompletionEntry( const TQString &s, TQTextDocument *, bool strict )
+{
+ TQChar key( s[ 0 ] );
+ TQMap<TQChar, TQStringList>::Iterator it = completionMap.tqfind( key );
+ if ( it == completionMap.end() ) {
+ completionMap.insert( key, TQStringList( s ) );
+ } else {
+ if ( strict ) {
+ TQStringList::Iterator sit;
+ for ( sit = (*it).begin(); sit != (*it).end(); ) {
+ TQStringList::Iterator it2 = sit;
+ ++sit;
+ if ( (*it2).length() > s.length() && (*it2).left( s.length() ) == s ) {
+ if ( (*it2)[ (int)s.length() ].isLetter() && (*it2)[ (int)s.length() ].upper() != (*it2)[ (int)s.length() ] )
+ return;
+ } else if ( s.length() > (*it2).length() && s.left( (*it2).length() ) == *it2 ) {
+ if ( s[ (int)(*it2).length() ].isLetter() && s[ (int)(*it2).length() ].upper() != s[ (int)(*it2).length() ] )
+ (*it).remove( it2 );
+ }
+ }
+ }
+ (*it).append( s );
+ }
+}
+
+TQValueList<CompletionEntry> EditorCompletion::completionList( const TQString &s, TQTextDocument *doc ) const
+{
+ if ( doc )
+ ( (EditorCompletion*)this )->updateCompletionMap( doc );
+
+ TQChar key( s[ 0 ] );
+ TQMap<TQChar, TQStringList>::ConstIterator it = completionMap.tqfind( key );
+ if ( it == completionMap.end() )
+ return TQValueList<CompletionEntry>();
+ TQStringList::ConstIterator it2 = (*it).begin();
+ TQValueList<CompletionEntry> lst;
+ int len = s.length();
+ for ( ; it2 != (*it).end(); ++it2 ) {
+ CompletionEntry c;
+ c.type = "";
+ c.text = *it2;
+ c.postfix = "";
+ c.prefix = "";
+ c.postfix2 = "";
+ if ( (int)(*it2).length() > len && (*it2).left( len ) == s && lst.tqfind( c ) == lst.end() )
+ lst << c;
+ }
+
+ return lst;
+}
+
+void EditorCompletion::updateCompletionMap( TQTextDocument *doc )
+{
+ bool strict = TRUE;
+ if ( doc != lastDoc )
+ strict = FALSE;
+ lastDoc = doc;
+ TQTextParagraph *s = doc->firstParagraph();
+ if ( !s->extraData() )
+ s->setExtraData( new ParagData );
+ while ( s ) {
+ if ( s->length() == ( (ParagData*)s->extraData() )->lastLengthForCompletion ) {
+ s = s->next();
+ continue;
+ }
+
+ TQChar c;
+ TQString buffer;
+ for ( int i = 0; i < s->length(); ++i ) {
+ c = s->at( i )->c;
+ if ( c.isLetter() || c.isNumber() || c == '_' || c == '#' ) {
+ buffer += c;
+ } else {
+ addCompletionEntry( buffer, doc, strict );
+ buffer = TQString();
+ }
+ }
+ if ( !buffer.isEmpty() )
+ addCompletionEntry( buffer, doc, strict );
+
+ ( (ParagData*)s->extraData() )->lastLengthForCompletion = s->length();
+ s = s->next();
+ }
+}
+
+bool EditorCompletion::doCompletion()
+{
+ searchString = "";
+ if ( !curEditor )
+ return FALSE;
+
+ TQTextCursor *cursor = curEditor->textCursor();
+ TQTextDocument *doc = curEditor->document();
+
+ if ( cursor->index() > 0 && cursor->paragraph()->at( cursor->index() - 1 )->c == '.' &&
+ ( cursor->index() == 1 || cursor->paragraph()->at( cursor->index() - 2 )->c != '.' ) )
+ return doObjectCompletion();
+
+ int idx = cursor->index();
+ if ( idx == 0 )
+ return FALSE;
+ TQChar c = cursor->paragraph()->at( idx - 1 )->c;
+ if ( !c.isLetter() && !c.isNumber() && c != '_' && c != '#' )
+ return FALSE;
+
+ TQString s;
+ idx--;
+ completionOffset = 1;
+ for (;;) {
+ s.prepend( TQString( cursor->paragraph()->at( idx )->c ) );
+ idx--;
+ if ( idx < 0 )
+ break;
+ if ( !cursor->paragraph()->at( idx )->c.isLetter() &&
+ !cursor->paragraph()->at( idx )->c.isNumber() &&
+ cursor->paragraph()->at( idx )->c != '_' &&
+ cursor->paragraph()->at( idx )->c != '#' )
+ break;
+ completionOffset++;
+ }
+
+ searchString = s;
+
+ TQValueList<CompletionEntry> lst( completionList( s, doc ) );
+ if ( lst.count() > 1 ) {
+ TQTextStringChar *chr = cursor->paragraph()->at( cursor->index() );
+ int h = cursor->paragraph()->lineHeightOfChar( cursor->index() );
+ int x = cursor->paragraph()->rect().x() + chr->x;
+ int y, dummy;
+ cursor->paragraph()->lineHeightOfChar( cursor->index(), &dummy, &y );
+ y += cursor->paragraph()->rect().y();
+ completionListBox->clear();
+ for ( TQValueList<CompletionEntry>::ConstIterator it = lst.begin(); it != lst.end(); ++it )
+ (void)new CompletionItem( completionListBox, (*it).text, (*it).type, (*it).postfix,
+ (*it).prefix, (*it).postfix2 );
+ cList = lst;
+ completionPopup->resize( completionListBox->tqsizeHint() +
+ TQSize( completionListBox->verticalScrollBar()->width() + 4,
+ completionListBox->horizontalScrollBar()->height() + 4 ) );
+ completionListBox->setCurrentItem( 0 );
+ completionListBox->setFocus();
+ if ( curEditor->mapToGlobal( TQPoint( 0, y ) ).y() + h + completionPopup->height() < TQApplication::desktop()->height() )
+ completionPopup->move( curEditor->mapToGlobal( curEditor->
+ contentsToViewport( TQPoint( x, y + h ) ) ) );
+ else
+ completionPopup->move( curEditor->mapToGlobal( curEditor->
+ contentsToViewport( TQPoint( x, y - completionPopup->height() ) ) ) );
+ completionPopup->show();
+ } else if ( lst.count() == 1 ) {
+ curEditor->insert( lst.first().text.mid( completionOffset, 0xFFFFFF ),
+ (uint) ( TQTextEdit::RedoIndentation |
+ TQTextEdit::CheckNewLines |
+ TQTextEdit::RemoveSelected ) );
+ } else {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+bool EditorCompletion::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( !enabled )
+ return FALSE;
+ if ( e->type() == TQEvent::KeyPress && ::tqqt_cast<Editor*>(o)) {
+ curEditor = (Editor*)o;
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if ( ke->key() == Key_Tab ) {
+ TQString s = curEditor->textCursor()->paragraph()->string()->toString().
+ left( curEditor->textCursor()->index() );
+ if ( curEditor->document()->hasSelection( TQTextDocument::Standard ) ||
+ s.simplifyWhiteSpace().isEmpty() ) {
+ if ( curEditor->document()->indent() ) {
+ curEditor->indent();
+ int i = 0;
+ for ( ; i < curEditor->textCursor()->paragraph()->length() - 1; ++i ) {
+ if ( curEditor->textCursor()->paragraph()->at( i )->c != ' ' &&
+ curEditor->textCursor()->paragraph()->at( i )->c != '\t' )
+ break;
+ }
+ curEditor->drawCursor( FALSE );
+ curEditor->textCursor()->setIndex( i );
+ curEditor->drawCursor( TRUE );
+ } else {
+ curEditor->insert( "\t" );
+ }
+ return TRUE;
+ }
+ }
+
+ if ( functionLabel->isVisible() ) {
+ if ( ke->key() == Key_Up && ( ke->state() & ControlButton ) == ControlButton ) {
+ functionLabel->gotoPrev();
+ return TRUE;
+ } else if ( ke->key() == Key_Down && ( ke->state() & ControlButton ) == ControlButton ) {
+ functionLabel->gotoNext();
+ return TRUE;
+ }
+ }
+
+ if ( ke->text().length() && !( ke->state() & AltButton ) &&
+ ( !ke->ascii() || ke->ascii() >= 32 ) ||
+ ( ke->text() == "\t" && !( ke->state() & ControlButton ) ) ) {
+ if ( ke->key() == Key_Tab ) {
+ if ( curEditor->textCursor()->index() == 0 &&
+ curEditor->textCursor()->paragraph()->isListItem() )
+ return FALSE;
+ if ( doCompletion() )
+ return TRUE;
+ } else if ( ke->key() == Key_Period &&
+ ( curEditor->textCursor()->index() == 0 ||
+ curEditor->textCursor()->paragraph()->at( curEditor->textCursor()->index() - 1 )->c != '.' )
+ ||
+ ke->key() == Key_Greater &&
+ curEditor->textCursor()->index() > 0 &&
+ curEditor->textCursor()->paragraph()->at( curEditor->textCursor()->index() - 1 )->c == '-' ) {
+ doObjectCompletion();
+ } else {
+ if ( !doArgumentHint( ke->text() == "(" ) )
+ functionLabel->hide();
+ }
+ }
+ } else if ( o == completionPopup || o == completionListBox ||
+ o == completionListBox->viewport() ) {
+ if ( e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if ( ke->key() == Key_Enter || ke->key() == Key_Return || ke->key() == Key_Tab ) {
+ if ( ke->key() == Key_Tab && completionListBox->count() > 1 &&
+ completionListBox->currentItem() < (int)completionListBox->count() - 1 ) {
+ completionListBox->setCurrentItem( completionListBox->currentItem() + 1 );
+ return TRUE;
+ }
+ completeCompletion();
+ return TRUE;
+ } else if ( ke->key() == Key_Left || ke->key() == Key_Right ||
+ ke->key() == Key_Up || ke->key() == Key_Down ||
+ ke->key() == Key_Home || ke->key() == Key_End ||
+ ke->key() == Key_Prior || ke->key() == Key_Next ) {
+ return FALSE;
+ } else if ( ke->key() != Key_Shift && ke->key() != Key_Control &&
+ ke->key() != Key_Alt ) {
+ int l = searchString.length();
+ if ( ke->key() == Key_Backspace ) {
+ searchString.remove( searchString.length() - 1, 1 );
+ } else {
+ searchString += ke->text();
+ l = 1;
+ }
+ if ( !l || !continueComplete() ) {
+ completionPopup->close();
+ curEditor->setFocus();
+ }
+ TQApplication::sendEvent( curEditor, e );
+ return TRUE;
+ }
+ } else if ( e->type() == TQEvent::MouseButtonDblClick ) {
+ completeCompletion();
+ return TRUE;
+ }
+ }
+ if ( o == functionLabel || ::tqqt_cast<Editor*>(o) && functionLabel->isVisible() ) {
+ if ( e->type() == TQEvent::KeyPress ) {
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if ( ke->key() == Key_Escape ) {
+ functionLabel->hide();
+ } else {
+ if ( !doArgumentHint( ke->text() == "(" ) )
+ functionLabel->hide();
+ if ( o == functionLabel ) {
+ TQApplication::sendEvent( curEditor, e );
+ return TRUE;
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+
+void EditorCompletion::completeCompletion()
+{
+ int idx = curEditor->textCursor()->index();
+ TQString s = completionListBox->currentText().mid( searchString.length() );
+ curEditor->insert( s, (uint) ( TQTextEdit::RedoIndentation |
+ TQTextEdit::CheckNewLines |
+ TQTextEdit::RemoveSelected ) );
+ int i = s.tqfind( '(' );
+ completionPopup->close();
+ curEditor->setFocus();
+ if ( i != -1 && i < (int)s.length() ) {
+ curEditor->setCursorPosition( curEditor->textCursor()->paragraph()->paragId(), idx + i + 1 );
+ doArgumentHint( FALSE );
+ }
+}
+
+void EditorCompletion::setCurrentEdior( Editor *e )
+{
+ curEditor = e;
+ curEditor->installEventFilter( this );
+}
+
+void EditorCompletion::addEditor( Editor *e )
+{
+ e->installEventFilter( this );
+}
+
+bool EditorCompletion::doObjectCompletion()
+{
+ searchString = "";
+ TQString object;
+ int i = curEditor->textCursor()->index();
+ i--;
+ TQTextParagraph *p = curEditor->textCursor()->paragraph();
+ for (;;) {
+ if ( i < 0 )
+ break;
+ if ( p->at( i )->c == ' ' || p->at( i )->c == '\t' )
+ break;
+ object.prepend( p->at( i )->c );
+ i--;
+ }
+
+ if ( object[ (int)object.length() - 1 ] == '-' )
+ object.remove( object.length() - 1, 1 );
+
+ if ( object.isEmpty() )
+ return FALSE;
+ return doObjectCompletion( object );
+}
+
+bool EditorCompletion::doObjectCompletion( const TQString & )
+{
+ return FALSE;
+}
+
+static void strip( TQString &txt )
+{
+ int i = txt.tqfind( "(" );
+ if ( i == -1 )
+ return;
+ txt = txt.left( i );
+}
+
+bool EditorCompletion::continueComplete()
+{
+ if ( searchString.isEmpty() ) {
+ completionListBox->clear();
+ for ( TQValueList<CompletionEntry>::ConstIterator it = cList.begin(); it != cList.end(); ++it )
+ (void)new CompletionItem( completionListBox, (*it).text, (*it).type,
+ (*it).postfix, (*it).prefix, (*it).postfix2 );
+ completionListBox->setCurrentItem( 0 );
+ completionListBox->setSelected( completionListBox->currentItem(), TRUE );
+ return TRUE;
+ }
+
+ TQListBoxItem *i = completionListBox->tqfindItem( searchString );
+ if ( !i )
+ return FALSE;
+
+ TQString txt1 = i->text();
+ TQString txt2 = searchString;
+ strip( txt1 );
+ strip( txt2 );
+ if ( txt1 == txt2 && !i->next() )
+ return FALSE;
+
+ TQValueList<CompletionEntry> res;
+ for ( TQValueList<CompletionEntry>::ConstIterator it = cList.begin(); it != cList.end(); ++it ) {
+ if ( (*it).text.left( searchString.length() ) == searchString )
+ res << *it;
+ }
+ if ( res.isEmpty() )
+ return FALSE;
+ completionListBox->clear();
+ for ( TQValueList<CompletionEntry>::ConstIterator it2 = res.begin(); it2 != res.end(); ++it2 )
+ (void)new CompletionItem( completionListBox, (*it2).text, (*it2).type,
+ (*it2).postfix, (*it2).prefix, (*it2).postfix2 );
+ completionListBox->setCurrentItem( 0 );
+ completionListBox->setSelected( completionListBox->currentItem(), TRUE );
+ return TRUE;
+}
+
+bool EditorCompletion::doArgumentHint( bool useIndex )
+{
+ TQTextCursor *cursor = curEditor->textCursor();
+ int i = cursor->index() ;
+ if ( !useIndex ) {
+ bool foundParen = FALSE;
+ int closeParens = 0;
+ while ( i >= 0 ) {
+ if ( cursor->paragraph()->at( i )->c == ')' && i != cursor->index() )
+ closeParens++;
+ if ( cursor->paragraph()->at( i )->c == '(' ) {
+ closeParens--;
+ if ( closeParens == -1 ) {
+ foundParen = TRUE;
+ break;
+ }
+ }
+ --i;
+ }
+
+ if ( !foundParen )
+ return FALSE;
+ }
+ int j = i - 1;
+ bool foundSpace = FALSE;
+ bool foundNonSpace = FALSE;
+ while ( j >= 0 ) {
+ if ( foundNonSpace && ( cursor->paragraph()->at( j )->c == ' ' || cursor->paragraph()->at( j )->c == ',' ) ) {
+ foundSpace = TRUE;
+ break;
+ }
+ if ( !foundNonSpace && ( cursor->paragraph()->at( j )->c != ' ' || cursor->paragraph()->at( j )->c != ',' ) )
+ foundNonSpace = TRUE;
+ --j;
+ }
+ if ( foundSpace )
+ ++j;
+ j = TQMAX( j, 0 );
+ TQString function( cursor->paragraph()->string()->toString().mid( j, i - j + 1 ) );
+ TQString part = cursor->paragraph()->string()->toString().mid( j, cursor->index() - j + 1 );
+ function = function.simplifyWhiteSpace();
+ for (;;) {
+ if ( function[ (int)function.length() - 1 ] == '(' ) {
+ function.remove( function.length() - 1, 1 );
+ function = function.simplifyWhiteSpace();
+ } else if ( function[ (int)function.length() - 1 ] == ')' ) {
+ function.remove( function.length() - 1, 1 );
+ function = function.simplifyWhiteSpace();
+ } else {
+ break;
+ }
+ }
+
+ TQChar sep;
+ TQString pre, post;
+ TQValueList<TQStringList> argl = functionParameters( function, sep, pre, post );
+ if ( argl.isEmpty() )
+ return FALSE;
+
+ TQString label;
+ int w = 0;
+ int num = 0;
+ if ( !functionLabel->isVisible() )
+ functionLabel->setNumFunctions( (int)argl.count() );
+ for ( TQValueList<TQStringList>::Iterator vit = argl.begin(); vit != argl.end(); ++vit, ++num ) {
+ TQStringList args = *vit;
+ int argNum = 0;
+ int inParen = 0;
+ for ( int k = 0; k < (int)part.length(); ++k ) {
+ if ( part[ k ] == sep && inParen < 2 )
+ argNum++;
+ if ( part[ k ] == '(' )
+ inParen++;
+ if ( part[ k ] == ')' )
+ inParen--;
+ }
+
+ TQString func = function;
+ int pnt = -1;
+ pnt = func.tqfindRev( '.' );
+ if ( pnt == -1 )
+ func.tqfindRev( '>' );
+ if ( pnt != -1 )
+ func = func.mid( pnt + 1 );
+
+ TQString s = func + "( ";
+ if ( s[ 0 ] == '\"' )
+ s.remove( (uint)0, 1 );
+ i = 0;
+ for ( TQStringList::Iterator it = args.begin(); it != args.end(); ++it, ++i ) {
+ if ( i == argNum )
+ s += "<b>" + *it + "</b>";
+ else
+ s += *it;
+ if ( i < (int)args.count() - 1 )
+ s += ", ";
+ else
+ s += " ";
+ }
+ s += ")";
+ s.prepend( pre );
+ s.append( post );
+ label += "<p>" + s + "</p>";
+ functionLabel->setFunctionText( num, s );
+ w = TQMAX( w, functionLabel->fontMetrics().width( s ) + 10 );
+ }
+ w += 16;
+ if ( label.isEmpty() )
+ return FALSE;
+ if ( functionLabel->isVisible() ) {
+ functionLabel->resize( w + 50, TQMAX( functionLabel->fontMetrics().height(), 16 ) );
+ } else {
+ TQTextStringChar *chr = cursor->paragraph()->at( cursor->index() );
+ int h = cursor->paragraph()->lineHeightOfChar( cursor->index() );
+ int x = cursor->paragraph()->rect().x() + chr->x;
+ int y, dummy;
+ cursor->paragraph()->lineHeightOfChar( cursor->index(), &dummy, &y );
+ y += cursor->paragraph()->rect().y();
+ functionLabel->resize( w + 50, TQMAX( functionLabel->fontMetrics().height(), 16 ) );
+ functionLabel->move( curEditor->mapToGlobal( curEditor->contentsToViewport( TQPoint( x, y + h ) ) ) );
+ if ( functionLabel->x() + functionLabel->width() > TQApplication::desktop()->width() )
+ functionLabel->move( TQMAX( 0, TQApplication::desktop()->width() - functionLabel->width() ),
+ functionLabel->y() );
+ functionLabel->show();
+ curEditor->setFocus();
+ }
+ TQTimer::singleShot( 0, functionLabel, TQT_SLOT( retqlayout() ) );
+
+ return TRUE;
+}
+
+TQValueList<TQStringList> EditorCompletion::functionParameters( const TQString &, TQChar &, TQString &, TQString & )
+{
+ return TQValueList<TQStringList>();
+}
+
+void EditorCompletion::setContext( TQObject * )
+{
+}
+
+void EditorCompletion::showCompletion( const TQValueList<CompletionEntry> &lst )
+{
+ TQTextCursor *cursor = curEditor->textCursor();
+ TQTextStringChar *chr = cursor->paragraph()->at( cursor->index() );
+ int h = cursor->paragraph()->lineHeightOfChar( cursor->index() );
+ int x = cursor->paragraph()->rect().x() + chr->x;
+ int y, dummy;
+ cursor->paragraph()->lineHeightOfChar( cursor->index(), &dummy, &y );
+ y += cursor->paragraph()->rect().y();
+ completionListBox->clear();
+ for ( TQValueList<CompletionEntry>::ConstIterator it = lst.begin(); it != lst.end(); ++it )
+ (void)new CompletionItem( completionListBox, (*it).text, (*it).type,
+ (*it).postfix, (*it).prefix, (*it).postfix2 );
+ cList = lst;
+ completionPopup->resize( completionListBox->tqsizeHint() +
+ TQSize( completionListBox->verticalScrollBar()->width() + 4,
+ completionListBox->horizontalScrollBar()->height() + 4 ) );
+ completionListBox->setCurrentItem( 0 );
+ completionListBox->setFocus();
+ if ( curEditor->mapToGlobal( TQPoint( 0, y ) ).y() + h + completionPopup->height() < TQApplication::desktop()->height() )
+ completionPopup->move( curEditor->mapToGlobal( curEditor->
+ contentsToViewport( TQPoint( x, y + h ) ) ) );
+ else
+ completionPopup->move( curEditor->mapToGlobal( curEditor->
+ contentsToViewport( TQPoint( x, y - completionPopup->height() ) ) ) );
+
+ completionPopup->show();
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/completion.h b/tqtinterface/qt4/tools/designer/editor/completion.h
new file mode 100644
index 0000000..a3ab598
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/completion.h
@@ -0,0 +1,110 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef COMPLETION_H
+#define COMPLETION_H
+
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqobject.h>
+#include <tqmap.h>
+
+class TQTextDocument;
+class Editor;
+class TQVBox;
+class TQListBox;
+class ArgHintWidget;
+
+struct CompletionEntry
+{
+ TQString type;
+ TQString text;
+ TQString postfix;
+ TQString prefix;
+ TQString postfix2;
+
+ bool operator==( const CompletionEntry &c ) const {
+ return ( c.type == type &&
+ c.text == text &&
+ c.postfix == postfix &&
+ c.prefix == prefix &&
+ c.postfix2 == postfix2 );
+ }
+};
+
+class EditorCompletion : public TQObject
+{
+ TQ_OBJECT
+
+public:
+ EditorCompletion( Editor *e );
+ ~EditorCompletion();
+
+ virtual void addCompletionEntry( const TQString &s, TQTextDocument *doc, bool strict );
+ virtual TQValueList<CompletionEntry> completionList( const TQString &s, TQTextDocument *doc ) const;
+ virtual void updateCompletionMap( TQTextDocument *doc );
+
+ bool eventFilter( TQObject *o, TQEvent *e );
+ virtual void setCurrentEdior( Editor *e );
+ virtual bool doCompletion();
+ virtual bool doObjectCompletion();
+ virtual bool doObjectCompletion( const TQString &object );
+ virtual bool doArgumentHint( bool useIndex );
+
+ virtual void addEditor( Editor *e );
+ virtual TQValueList<TQStringList> functionParameters( const TQString &func, TQChar &, TQString &prefix, TQString &postfix );
+
+ virtual void setContext( TQObject *this_ );
+
+ void setEnabled( bool b ) { enabled = b; }
+
+protected:
+ virtual bool continueComplete();
+ virtual void showCompletion( const TQValueList<CompletionEntry> &lst );
+ virtual void completeCompletion();
+
+protected:
+ TQVBox *completionPopup;
+ TQListBox *completionListBox;
+ ArgHintWidget *functionLabel;
+ int completionOffset;
+ Editor *curEditor;
+ TQString searchString;
+ TQValueList<CompletionEntry> cList;
+ TQMap<TQChar, TQStringList> completionMap;
+ bool enabled;
+ TQTextDocument *lastDoc;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/conf.cpp b/tqtinterface/qt4/tools/designer/editor/conf.cpp
new file mode 100644
index 0000000..a9e5679
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/conf.cpp
@@ -0,0 +1,269 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "conf.h"
+#include <tqapplication.h>
+#include <tqfont.h>
+#include <tqcolor.h>
+#include <tqsettings.h>
+
+TQMap<TQString, ConfigStyle> Config::defaultStyles()
+{
+ ConfigStyle s;
+ TQMap<TQString, ConfigStyle> styles;
+ int normalSize = tqApp->font().pointSize();
+ TQString normalFamily = tqApp->font().family();
+ TQString commentFamily = "times";
+ int normalWeight = tqApp->font().weight();
+
+ s.font = TQFont( normalFamily, normalSize, normalWeight );
+ s.color = TQt::black;
+ styles.insert( "Standard", s );
+
+ s.font = TQFont( commentFamily, normalSize, normalWeight, TRUE );
+ s.color = TQt::red;
+ styles.insert( "Comment", s );
+
+ s.font = TQFont( normalFamily, normalSize, normalWeight );
+ s.color = TQt::blue;
+ styles.insert( "Number", s );
+
+ s.font = TQFont( normalFamily, normalSize, normalWeight );
+ s.color = TQt::darkGreen;
+ styles.insert( "String", s );
+
+ s.font = TQFont( normalFamily, normalSize, normalWeight );
+ s.color = TQt::darkMagenta;
+ styles.insert( "Type", s );
+
+ s.font = TQFont( normalFamily, normalSize, normalWeight );
+ s.color = TQt::darkYellow;
+ styles.insert( "Keyword", s );
+
+ s.font = TQFont( normalFamily, normalSize, normalWeight );
+ s.color = TQt::darkBlue;
+ styles.insert( "Preprocessor", s );
+
+ s.font = TQFont( normalFamily, normalSize, normalWeight );
+ s.color = TQt::darkRed;
+ styles.insert( "Label", s );
+
+ return styles;
+}
+
+TQMap<TQString, ConfigStyle> Config::readStyles( const TQString &path )
+{
+ TQMap<TQString, ConfigStyle> styles;
+ styles = defaultStyles();
+
+ TQString family;
+ int size = 10;
+ bool bold = FALSE, italic = FALSE, underline = FALSE;
+ int red = 0, green = 0, blue = 0;
+
+ TQString elements[] = {
+ "Comment",
+ "Number",
+ "String",
+ "Type",
+ "Keyword",
+ "Preprocessor",
+ "Label",
+ "Standard",
+ TQString()
+ };
+
+ for ( int i = 0; elements[ i ] != TQString(); ++i ) {
+ TQSettings settings;
+ bool ok = TRUE;
+ for (;;) {
+ family = settings.readEntry( path + elements[ i ] + "/family", TQString(), &ok );
+ if ( !ok )
+ break;
+ size = settings.readNumEntry( path + elements[ i ] + "/size", 10, &ok );
+ if ( !ok )
+ break;
+ bold = settings.readBoolEntry( path + elements[ i ] + "/bold", FALSE, &ok );
+ if ( !ok )
+ break;
+ italic = settings.readBoolEntry( path + elements[ i ] + "/italic", FALSE, &ok );
+ if ( !ok )
+ break;
+ underline = settings.readBoolEntry( path + elements[ i ] + "/underline", FALSE, &ok );
+ if ( !ok )
+ break;
+ red = settings.readNumEntry( path + elements[ i ] + "/red", 0, &ok );
+ if ( !ok )
+ break;
+ green = settings.readNumEntry( path + elements[ i ] + "/green", 0, &ok );
+ if ( !ok )
+ break;
+ blue = settings.readNumEntry( path + elements[ i ] + "/blue", 0, &ok );
+ if ( !ok )
+ break;
+ break;
+ }
+ if ( !ok )
+ continue;
+ TQFont f( family );
+ f.setPointSize( size );
+ f.setBold( bold );
+ f.setItalic( italic );
+ f.setUnderline( underline );
+ TQColor c( red, green, blue );
+ ConfigStyle s;
+ s.font = f;
+ s.color = c;
+ styles.remove( elements[ i ] );
+ styles.insert( elements[ i ], s );
+ }
+ return styles;
+}
+
+void Config::saveStyles( const TQMap<TQString, ConfigStyle> &styles, const TQString &path )
+{
+ TQString elements[] = {
+ "Comment",
+ "Number",
+ "String",
+ "Type",
+ "Keyword",
+ "Preprocessor",
+ "Label",
+ "Standard",
+ TQString()
+ };
+
+ TQSettings settings;
+ for ( int i = 0; elements[ i ] != TQString(); ++i ) {
+ settings.writeEntry( path + "/" + elements[ i ] + "/family", styles[ elements[ i ] ].font.family() );
+ settings.writeEntry( path + "/" + elements[ i ] + "/size", styles[ elements[ i ] ].font.pointSize() );
+ settings.writeEntry( path + "/" + elements[ i ] + "/bold", styles[ elements[ i ] ].font.bold() );
+ settings.writeEntry( path + "/" + elements[ i ] + "/italic", styles[ elements[ i ] ].font.italic() );
+ settings.writeEntry( path + "/" + elements[ i ] + "/underline", styles[ elements[ i ] ].font.underline() );
+ settings.writeEntry( path + "/" + elements[ i ] + "/red", styles[ elements[ i ] ].color.red() );
+ settings.writeEntry( path + "/" + elements[ i ] + "/green", styles[ elements[ i ] ].color.green() );
+ settings.writeEntry( path + "/" + elements[ i ] + "/blue", styles[ elements[ i ] ].color.blue() );
+ }
+}
+
+bool Config::completion( const TQString &path )
+{
+ TQSettings settings;
+ bool ret = settings.readBoolEntry( path + "/completion", TRUE );
+ return ret;
+}
+
+bool Config::wordWrap( const TQString &path )
+{
+ TQSettings settings;
+ bool ret = settings.readBoolEntry( path + "/wordWrap", TRUE );
+ return ret;
+}
+
+bool Config::parenMatching( const TQString &path )
+{
+ TQSettings settings;
+ bool ret = settings.readBoolEntry( path + "/parenMatching", TRUE );
+ return ret;
+}
+
+int Config::indentTabSize( const TQString &path )
+{
+ TQSettings settings;
+ int ret = settings.readNumEntry( path + "/indentTabSize", 8 );
+ return ret;
+}
+
+int Config::indentIndentSize( const TQString &path )
+{
+ TQSettings settings;
+ int ret = settings.readNumEntry( path + "/indentIndentSize", 4 );
+ return ret;
+}
+
+bool Config::indentKeepTabs( const TQString &path )
+{
+ TQSettings settings;
+ bool ret = settings.readBoolEntry( path + "/indentKeepTabs", TRUE );
+ return ret;
+}
+
+bool Config::indentAutoIndent( const TQString &path )
+{
+ TQSettings settings;
+ bool ret = settings.readBoolEntry( path + "/indentAutoIndent", TRUE );
+ return ret;
+}
+
+void Config::setCompletion( bool b, const TQString &path )
+{
+ TQSettings settings;
+ settings.writeEntry( path + "/completion", b );
+}
+
+void Config::setWordWrap( bool b, const TQString &path )
+{
+ TQSettings settings;
+ settings.writeEntry( path + "/wordWrap", b );
+}
+
+void Config::setParenMatching( bool b,const TQString &path )
+{
+ TQSettings settings;
+ settings.writeEntry( path + "/parenMatching", b );
+}
+
+void Config::setIndentTabSize( int s, const TQString &path )
+{
+ TQSettings settings;
+ settings.writeEntry( path + "/indentTabSize", s );
+}
+
+void Config::setIndentIndentSize( int s, const TQString &path )
+{
+ TQSettings settings;
+ settings.writeEntry( path + "/indentIndentSize", s );
+}
+
+void Config::setIndentKeepTabs( bool b, const TQString &path )
+{
+ TQSettings settings;
+ settings.writeEntry( path + "/indentKeepTabs", b );
+}
+
+void Config::setIndentAutoIndent( bool b, const TQString &path )
+{
+ TQSettings settings;
+ settings.writeEntry( path + "/indentAutoIndent", b );
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/conf.h b/tqtinterface/qt4/tools/designer/editor/conf.h
new file mode 100644
index 0000000..7869a7f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/conf.h
@@ -0,0 +1,75 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CONF_H
+#define CONF_H
+
+#include <tqfont.h>
+#include <tqcolor.h>
+#include <tqmap.h>
+
+struct ConfigStyle
+{
+ TQFont font;
+ TQColor color;
+
+ TQ_DUMMY_COMPARISON_OPERATOR( ConfigStyle )
+};
+
+struct Config
+{
+ TQMap<TQString, ConfigStyle> styles;
+ bool hasCompletion, hasParenMatching, hasWordWrap;
+
+ static TQMap<TQString, ConfigStyle> defaultStyles();
+ static TQMap<TQString, ConfigStyle> readStyles( const TQString &path );
+ static void saveStyles( const TQMap<TQString, ConfigStyle> &styles, const TQString &path );
+ static bool completion( const TQString &path );
+ static bool wordWrap( const TQString &path );
+ static bool parenMatching( const TQString &path );
+ static int indentTabSize( const TQString &path );
+ static int indentIndentSize( const TQString &path );
+ static bool indentKeepTabs( const TQString &path );
+ static bool indentAutoIndent( const TQString &path );
+
+ static void setCompletion( bool b, const TQString &path );
+ static void setWordWrap( bool b, const TQString &path );
+ static void setParenMatching( bool b,const TQString &path );
+ static void setIndentTabSize( int s, const TQString &path );
+ static void setIndentIndentSize( int s, const TQString &path );
+ static void setIndentKeepTabs( bool b, const TQString &path );
+ static void setIndentAutoIndent( bool b, const TQString &path );
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/editor.cpp b/tqtinterface/qt4/tools/designer/editor/editor.cpp
new file mode 100644
index 0000000..626df22
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/editor.cpp
@@ -0,0 +1,251 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "editor.h"
+#include "parenmatcher.h"
+#include <tqfile.h>
+#include <private/tqrichtext_p.h>
+#include "conf.h"
+#include <tqapplication.h>
+#include <tqpopupmenu.h>
+#include <tqaccel.h>
+
+Editor::Editor( const TQString &fn, TQWidget *tqparent, const char *name )
+ : TQTextEdit( tqparent, name ), hasError( FALSE )
+{
+ document()->setFormatter( new TQTextFormatterBreakInWords );
+ if ( !fn.isEmpty() )
+ load( fn );
+ setHScrollBarMode( TQScrollView::AlwaysOff );
+ setVScrollBarMode( TQScrollView::AlwaysOn );
+ document()->setUseFormatCollection( FALSE );
+ parenMatcher = new ParenMatcher;
+ connect( this, TQT_SIGNAL( cursorPositionChanged( TQTextCursor * ) ),
+ this, TQT_SLOT( cursorPosChanged( TQTextCursor * ) ) );
+ cfg = new Config;
+ document()->addSelection( Error );
+ document()->addSelection( Step );
+ document()->setSelectionColor( Error, red );
+ document()->setSelectionColor( Step, yellow );
+ document()->setInvertSelectionText( Error, FALSE );
+ document()->setInvertSelectionText( Step, FALSE );
+ document()->addSelection( ParenMatcher::Match );
+ document()->addSelection( ParenMatcher::Mismatch );
+ document()->setSelectionColor( ParenMatcher::Match, TQColor( 204, 232, 195 ) );
+ document()->setSelectionColor( ParenMatcher::Mismatch, TQt::magenta );
+ document()->setInvertSelectionText( ParenMatcher::Match, FALSE );
+ document()->setInvertSelectionText( ParenMatcher::Mismatch, FALSE );
+
+ accelComment = new TQAccel( this );
+ accelComment->connectItem( accelComment->insertItem( ALT + Key_C ),
+ this, TQT_SLOT( commentSelection() ) );
+ accelUncomment = new TQAccel( this );
+ accelUncomment->connectItem( accelUncomment->insertItem( ALT + Key_U ),
+ this, TQT_SLOT( uncommentSelection() ) );
+ editable = TRUE;
+}
+
+Editor::~Editor()
+{
+ delete cfg;
+ delete parenMatcher;
+}
+
+void Editor::cursorPosChanged( TQTextCursor *c )
+{
+ if ( parenMatcher->match( c ) )
+ repaintChanged();
+ if ( hasError ) {
+ emit clearErrorMarker();
+ hasError = FALSE;
+ }
+}
+
+void Editor::load( const TQString &fn )
+{
+ filename = fn;
+ TQFile f( filename );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQCString txt;
+ txt.resize( f.size() );
+ f.readBlock( txt.data(), f.size() );
+ TQString s( TQString::tqfromLatin1( txt ) );
+ setText( s );
+}
+
+void Editor::save( const TQString &fn )
+{
+ if ( !filename.isEmpty() )
+ filename = fn;
+}
+
+void Editor::configChanged()
+{
+ document()->tqinvalidate();
+ viewport()->tqrepaint( FALSE );
+}
+
+void Editor::setErrorSelection( int line )
+{
+ TQTextParagraph *p = document()->paragAt( line );
+ if ( !p )
+ return;
+ TQTextCursor c( document() );
+ c.setParagraph( p );
+ c.setIndex( 0 );
+ document()->removeSelection( Error );
+ document()->setSelectionStart( Error, c );
+ c.gotoLineEnd();
+ document()->setSelectionEnd( Error, c );
+ hasError = TRUE;
+ viewport()->tqrepaint( FALSE );
+}
+
+void Editor::setStepSelection( int line )
+{
+ TQTextParagraph *p = document()->paragAt( line );
+ if ( !p )
+ return;
+ TQTextCursor c( document() );
+ c.setParagraph( p );
+ c.setIndex( 0 );
+ document()->removeSelection( Step );
+ document()->setSelectionStart( Step, c );
+ c.gotoLineEnd();
+ document()->setSelectionEnd( Step, c );
+ viewport()->tqrepaint( FALSE );
+}
+
+void Editor::clearStepSelection()
+{
+ document()->removeSelection( Step );
+ viewport()->tqrepaint( FALSE );
+}
+
+void Editor::doChangeInterval()
+{
+ emit intervalChanged();
+ TQTextEdit::doChangeInterval();
+}
+
+void Editor::commentSelection()
+{
+ TQTextParagraph *start = document()->selectionStartCursor( TQTextDocument::Standard ).paragraph();
+ TQTextParagraph *end = document()->selectionEndCursor( TQTextDocument::Standard ).paragraph();
+ if ( !start || !end )
+ start = end = textCursor()->paragraph();
+ while ( start ) {
+ if ( start == end && textCursor()->index() == 0 )
+ break;
+ start->insert( 0, "//" );
+ if ( start == end )
+ break;
+ start = start->next();
+ }
+ document()->removeSelection( TQTextDocument::Standard );
+ repaintChanged();
+ setModified( TRUE );
+}
+
+void Editor::uncommentSelection()
+{
+ TQTextParagraph *start = document()->selectionStartCursor( TQTextDocument::Standard ).paragraph();
+ TQTextParagraph *end = document()->selectionEndCursor( TQTextDocument::Standard ).paragraph();
+ if ( !start || !end )
+ start = end = textCursor()->paragraph();
+ while ( start ) {
+ if ( start == end && textCursor()->index() == 0 )
+ break;
+ while ( start->at( 0 )->c == '/' )
+ start->remove( 0, 1 );
+ if ( start == end )
+ break;
+ start = start->next();
+ }
+ document()->removeSelection( TQTextDocument::Standard );
+ repaintChanged();
+ setModified( TRUE );
+}
+
+TQPopupMenu *Editor::createPopupMenu( const TQPoint &p )
+{
+ TQPopupMenu *menu = TQTextEdit::createPopupMenu( p );
+ menu->insertSeparator();
+ menu->insertItem( tr( "C&omment Code\tAlt+C" ), this, TQT_SLOT( commentSelection() ) );
+ menu->insertItem( tr( "Unco&mment Code\tAlt+U" ), this, TQT_SLOT( uncommentSelection() ) );
+ return menu;
+}
+
+bool Editor::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) &&
+ ( o == this || o == viewport() ) ) {
+ accelUncomment->setEnabled( e->type() == TQEvent::FocusIn );
+ accelComment->setEnabled( e->type() == TQEvent::FocusIn );
+ }
+ return TQTextEdit::eventFilter( o, e );
+}
+
+void Editor::doKeyboardAction( KeyboardAction action )
+{
+ if ( !editable )
+ return;
+ TQTextEdit::doKeyboardAction( action );
+}
+
+void Editor::keyPressEvent( TQKeyEvent *e )
+{
+ if ( editable ) {
+ TQTextEdit::keyPressEvent( e );
+ return;
+ }
+
+ switch ( e->key() ) {
+ case Key_Left:
+ case Key_Right:
+ case Key_Up:
+ case Key_Down:
+ case Key_Home:
+ case Key_End:
+ case Key_Prior:
+ case Key_Next:
+ case Key_Direction_L:
+ case Key_Direction_R:
+ TQTextEdit::keyPressEvent( e );
+ break;
+ default:
+ e->accept();
+ break;
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/editor.h b/tqtinterface/qt4/tools/designer/editor/editor.h
new file mode 100644
index 0000000..782ea97
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/editor.h
@@ -0,0 +1,111 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef EDITOR_H
+#define EDITOR_H
+
+#include <tqtextedit.h>
+
+struct Config;
+class ParenMatcher;
+class EditorCompletion;
+class EditorBrowser;
+class TQAccel;
+
+class Editor : public TQTextEdit
+{
+ TQ_OBJECT
+
+public:
+ enum Selection {
+ Error = 3,
+ Step = 4
+ };
+
+ Editor( const TQString &fn, TQWidget *tqparent, const char *name );
+ ~Editor();
+ virtual void load( const TQString &fn );
+ virtual void save( const TQString &fn );
+ TQTextDocument *document() const { return TQTextEdit::document(); }
+ void placeCursor( const TQPoint &p, TQTextCursor *c ) { TQTextEdit::placeCursor( p, c ); }
+ void setDocument( TQTextDocument *doc ) { TQTextEdit::setDocument( doc ); }
+ TQTextCursor *textCursor() const { return TQTextEdit::textCursor(); }
+ void repaintChanged() { TQTextEdit::repaintChanged(); }
+
+ virtual EditorCompletion *completionManager() { return 0; }
+ virtual EditorBrowser *browserManager() { return 0; }
+ virtual void configChanged();
+
+ Config *config() { return cfg; }
+
+ void setErrorSelection( int line );
+ void setStepSelection( int line );
+ void clearStepSelection();
+ void clearSelections();
+
+ virtual bool supportsErrors() const { return TRUE; }
+ virtual bool supportsBreakPoints() const { return TRUE; }
+ virtual void makeFunctionVisible( TQTextParagraph * ) {}
+
+ void drawCursor( bool b ) { TQTextEdit::drawCursor( b ); }
+
+ TQPopupMenu *createPopupMenu( const TQPoint &p );
+ bool eventFilter( TQObject *o, TQEvent *e );
+
+ void setEditable( bool b ) { editable = b; }
+
+protected:
+ void doKeyboardAction( KeyboardAction action );
+ void keyPressEvent( TQKeyEvent *e );
+
+Q_SIGNALS:
+ void clearErrorMarker();
+ void intervalChanged();
+
+private Q_SLOTS:
+ void cursorPosChanged( TQTextCursor *c );
+ void doChangeInterval();
+ void commentSelection();
+ void uncommentSelection();
+
+protected:
+ ParenMatcher *parenMatcher;
+ TQString filename;
+ Config *cfg;
+ bool hasError;
+ TQAccel *accelComment, *accelUncomment;
+ bool editable;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/editor.pro b/tqtinterface/qt4/tools/designer/editor/editor.pro
new file mode 100644
index 0000000..dc9235f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/editor.pro
@@ -0,0 +1,40 @@
+TEMPLATE = lib
+CONFIG += qt warn_on staticlib
+CONFIG -= dll
+HEADERS = editor.h \
+ parenmatcher.h \
+ completion.h \
+ viewmanager.h \
+ markerwidget.h\
+ conf.h \
+ browser.h \
+ arghintwidget.h \
+ cindent.h
+
+SOURCES = editor.cpp \
+ parenmatcher.cpp \
+ completion.cpp \
+ viewmanager.cpp \
+ markerwidget.cpp \
+ conf.cpp \
+ browser.cpp \
+ arghintwidget.cpp \
+ cindent.cpp \
+ yyindent.cpp
+
+FORMS = preferences.ui
+
+TARGET = editor
+DESTDIR = ../../../lib
+VERSION = 1.0.0
+
+INCLUDEPATH += $$QT_SOURCE_TREE/tools/designer/interfaces
+
+target.path=$$libs.path
+
+INSTALLS += target
+
+unix {
+ QMAKE_CFLAGS += $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SHLIB
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/markerwidget.cpp b/tqtinterface/qt4/tools/designer/editor/markerwidget.cpp
new file mode 100644
index 0000000..1164d8b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/markerwidget.cpp
@@ -0,0 +1,491 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "markerwidget.h"
+#include "viewmanager.h"
+#include <private/tqrichtext_p.h>
+#include "editor.h"
+#include <tqpainter.h>
+#include <tqpopupmenu.h>
+#include "paragdata.h"
+
+static const char * error_xpm[] = {
+"15 15 35 1",
+" c None",
+". c #FF0000",
+"+ c #F50F0F",
+"@ c #BF5F5F",
+"# c #FF1010",
+"$ c #FF7878",
+"% c #FF0A0A",
+"& c #FF0606",
+"* c #FF1414",
+"= c #FFFFFF",
+"- c #FFA3A3",
+"; c #FF0707",
+"> c #FF0202",
+", c #FF9898",
+"' c #FF8888",
+") c #D04747",
+"! c #FFA7A7",
+"~ c #FF9D9D",
+"{ c #FFB1B1",
+"] c #FF0C0C",
+"^ c #F90A0A",
+"/ c #FFB5B5",
+"( c #FF0909",
+"_ c #A08F8F",
+": c #FFACAC",
+"< c #FF0303",
+"[ c #9F8F8F",
+"} c #FB0606",
+"| c #9F9090",
+"1 c #CE4949",
+"2 c #999999",
+"3 c #FF1919",
+"4 c #F70C0C",
+"5 c #A38A8A",
+"6 c #B37272",
+" .... ",
+" ........ ",
+" .........+@ ",
+" ..#$%..&$*.+ ",
+" ..$=-;>,='..) ",
+"...%-=!~={]..^ ",
+"....;!==/(...._",
+"....>~==:<....[",
+"...&,=/:=!;..}|",
+" ..$={(<!='..12",
+" ..*']..;'3.45 ",
+" +........462 ",
+" @+......462 ",
+" )^..}152 ",
+" _[|2 "};
+
+static const char * breakpoint_xpm[] = {
+"15 15 3 1",
+" c None",
+". c #8B0000",
+"+ c #FFFFFF",
+" ....... ",
+" ......... ",
+" ........... ",
+" ............. ",
+"..+.+++.+..++..",
+".+.+.+.+.+.+.+.",
+".+...+.+.+.+.+.",
+"..+..+.+.+.++..",
+"...+.+.+.+.+...",
+".+.+.+.+.+.+...",
+"..+..+..+..+...",
+" ............. ",
+" ........... ",
+" ......... ",
+" ....... " };
+
+static const char * step_xpm[] = {
+"16 16 128 2",
+" c None",
+". c #B4B6BF",
+"+ c #7893D8",
+"@ c #8D95BF",
+"# c #B8BFC1",
+"$ c #B6D1E6",
+"% c #7193E6",
+"& c #8893C2",
+"* c #B3BDC4",
+"= c #AAD2EC",
+"- c #9AD0FF",
+"; c #6690EF",
+"> c #8894C8",
+", c #AFBAC4",
+"' c #95BFEC",
+") c #99CBFF",
+"! c #8EC3FF",
+"~ c #6D95F0",
+"{ c #8792CA",
+"] c #9DA7C3",
+"^ c #8BA2E3",
+"/ c #809AE0",
+"( c #8398D1",
+"_ c #93A0CC",
+": c #ACB3CB",
+"< c #B4B9C4",
+"[ c #B6BAC4",
+"} c #93A4CC",
+"| c #82B0F5",
+"1 c #8BBCFF",
+"2 c #8EC0FF",
+"3 c #8FC1FF",
+"4 c #6594F4",
+"5 c #7381CC",
+"6 c #81A7E9",
+"7 c #D0F5FF",
+"8 c #C1EBFF",
+"9 c #AEDAFF",
+"0 c #A2D1FC",
+"a c #A3C8F3",
+"b c #AACAE6",
+"c c #B4CFE9",
+"d c #ADCCF9",
+"e c #84B2FF",
+"f c #82B4FF",
+"g c #86B7FF",
+"h c #88B7FF",
+"i c #83B4FF",
+"j c #5F8AF3",
+"k c #7585C8",
+"l c #77A4F3",
+"m c #ABDFFF",
+"n c #9CCAFF",
+"o c #96C7FF",
+"p c #97C8FF",
+"q c #95C5FF",
+"r c #9DCCFF",
+"s c #A0CDFF",
+"t c #90C0FF",
+"u c #82AFFF",
+"v c #7FAFFF",
+"w c #7DAEFF",
+"x c #79AAFF",
+"y c #6C9EFF",
+"z c #4366EB",
+"A c #6894F2",
+"B c #93C6FF",
+"C c #82B3FF",
+"D c #7AABFF",
+"E c #73A5FF",
+"F c #71A3FF",
+"G c #6C9DFF",
+"H c #699BFF",
+"I c #76A8FF",
+"J c #7EB0FF",
+"K c #7BADFF",
+"L c #74A5FF",
+"M c #608BFF",
+"N c #3462FF",
+"O c #2444E5",
+"P c #577AE0",
+"Q c #5D90FF",
+"R c #4C7AFF",
+"S c #3B66FF",
+"T c #335CF9",
+"U c #365AF1",
+"V c #3858E5",
+"W c #3959E0",
+"X c #416CF9",
+"Y c #75A5FF",
+"Z c #78A9FF",
+"` c #74A4FF",
+" . c #6191FF",
+".. c #3059FF",
+"+. c #1B37F1",
+"@. c #6A75C7",
+"#. c #828BC1",
+"$. c #4358D8",
+"%. c #374BDA",
+"&. c #4759CA",
+"*. c #636CC4",
+"=. c #8489C0",
+"-. c #9DA1C1",
+";. c #A3A6BF",
+">. c #7486CB",
+",. c #6E98F5",
+"'. c #719EFF",
+"). c #608DFF",
+"!. c #315EFF",
+"~. c #1432F4",
+"{. c #5C63C8",
+"]. c #B1B4B9",
+"^. c #B3BABB",
+"/. c #ABB4C3",
+"(. c #7299E9",
+"_. c #5486FF",
+":. c #224EFF",
+"<. c #1733F2",
+"[. c #7079C5",
+"}. c #5C7DE9",
+"|. c #2450FF",
+"1. c #1B39EC",
+"2. c #7077C5",
+"3. c #3A54E1",
+"4. c #1E36EA",
+"5. c #858CBF",
+"6. c #525FCB",
+"7. c #727CBC",
+" ",
+" . + @ ",
+" # $ % & ",
+" * = - ; > ",
+" , ' ) ! ~ { ",
+"] ^ / ( _ : < [ } | 1 2 3 4 5 ",
+"6 7 8 9 0 a b c d e f g h i j k ",
+"l m n o p q r s t u v u w x y z ",
+"A B C D E F G H I J K D L M N O ",
+"P Q R S T U V W X Y Z ` ...+.@.",
+"#.$.%.&.*.=.-.;.>.,.'.).!.~.{. ",
+" ].^. /.(._.:.<.[. ",
+" }.|.1.2. ",
+" 3.4.5. ",
+" 6.7. ",
+" "};
+
+static const char *stack_frame_xpm[]={
+"16 16 2 1",
+". c None",
+"# c #00c000",
+"................",
+".###............",
+".#####..........",
+".#######........",
+".#########......",
+".###########....",
+".#############..",
+".##############.",
+".##############.",
+".#############..",
+".###########....",
+".#########......",
+".#######........",
+".#####..........",
+".###............",
+"................"};
+
+static TQPixmap *errorPixmap = 0;
+static TQPixmap *breakpointPixmap = 0;
+static TQPixmap *stepPixmap = 0;
+static TQPixmap *stackFrame = 0;
+
+MarkerWidget::MarkerWidget( ViewManager *tqparent, const char*name )
+ : TQWidget( tqparent, name, WRepaintNoErase | WStaticContents | WResizeNoErase ), viewManager( tqparent )
+{
+ if ( !errorPixmap ) {
+ errorPixmap = new TQPixmap( error_xpm );
+ breakpointPixmap = new TQPixmap( breakpoint_xpm );
+ stepPixmap = new TQPixmap( step_xpm );
+ stackFrame = new TQPixmap( stack_frame_xpm );
+ }
+}
+
+void MarkerWidget::paintEvent( TQPaintEvent * )
+{
+ buffer.fill( backgroundColor() );
+
+ TQTextParagraph *p = ( (Editor*)viewManager->currentView() )->document()->firstParagraph();
+ TQPainter painter( &buffer );
+ int yOffset = ( (Editor*)viewManager->currentView() )->contentsY();
+ while ( p ) {
+ if ( !p->isVisible() ) {
+ p = p->next();
+ continue;
+ }
+ if ( p->rect().y() + p->rect().height() - yOffset < 0 ) {
+ p = p->next();
+ continue;
+ }
+ if ( p->rect().y() - yOffset > height() )
+ break;
+ if ( !((p->paragId() + 1) % 10) ) {
+ painter.save();
+ painter.setPen( tqcolorGroup().dark() );
+ painter.drawText( 0, p->rect().y() - yOffset, width() - 20, p->rect().height(),
+ TQt::AlignRight | TQt::AlignTop, TQString::number( p->paragId() + 1 ) );
+ painter.restore();
+ }
+ ParagData *paragData = (ParagData*)p->extraData();
+ if ( paragData ) {
+ switch ( paragData->marker ) {
+ case ParagData::Error:
+ painter.drawPixmap( 3, p->rect().y() +
+ ( p->rect().height() - errorPixmap->height() ) / 2 -
+ yOffset, *errorPixmap );
+ break;
+ case ParagData::Breakpoint:
+ painter.drawPixmap( 3, p->rect().y() +
+ ( p->rect().height() - breakpointPixmap->height() ) / 2 -
+ yOffset, *breakpointPixmap );
+ break;
+ default:
+ break;
+ }
+ switch ( paragData->lineState ) {
+ case ParagData::FunctionStart:
+ painter.setPen( tqcolorGroup().foreground() );
+ painter.setBrush( tqcolorGroup().base() );
+ painter.drawLine( width() - 11, p->rect().y() - yOffset,
+ width() - 11, p->rect().y() + p->rect().height() - yOffset );
+ painter.drawRect( width() - 15, p->rect().y() + ( p->rect().height() - 9 ) / 2 - yOffset, 9, 9 );
+ painter.drawLine( width() - 13, p->rect().y() + ( p->rect().height() - 9 ) / 2 - yOffset + 4,
+ width() - 9, p->rect().y() +
+ ( p->rect().height() - 9 ) / 2 - yOffset + 4 );
+ if ( !paragData->functionOpen )
+ painter.drawLine( width() - 11,
+ p->rect().y() + ( p->rect().height() - 9 ) / 2 - yOffset + 2,
+ width() - 11,
+ p->rect().y() +
+ ( p->rect().height() - 9 ) / 2 - yOffset + 6 );
+ break;
+ case ParagData::InFunction:
+ painter.setPen( tqcolorGroup().foreground() );
+ painter.drawLine( width() - 11, p->rect().y() - yOffset,
+ width() - 11, p->rect().y() + p->rect().height() - yOffset );
+ break;
+ case ParagData::FunctionEnd:
+ painter.setPen( tqcolorGroup().foreground() );
+ painter.drawLine( width() - 11, p->rect().y() - yOffset,
+ width() - 11, p->rect().y() + p->rect().height() - yOffset );
+ painter.drawLine( width() - 11, p->rect().y() + p->rect().height() - yOffset,
+ width() - 7, p->rect().y() + p->rect().height() - yOffset );
+ break;
+ default:
+ break;
+ }
+ if ( paragData->step )
+ painter.drawPixmap( 3, p->rect().y() +
+ ( p->rect().height() - stepPixmap->height() ) / 2 -
+ yOffset, *stepPixmap );
+ if ( paragData->stackFrame )
+ painter.drawPixmap( 3, p->rect().y() +
+ ( p->rect().height() - stackFrame->height() ) / 2 -
+ yOffset, *stackFrame );
+ }
+ p = p->next();
+ }
+ painter.end();
+
+ bitBlt( this, 0, 0, &buffer );
+}
+
+void MarkerWidget::resizeEvent( TQResizeEvent *e )
+{
+ buffer.resize( e->size() );
+ TQWidget::resizeEvent( e );
+}
+
+void MarkerWidget::mousePressEvent( TQMouseEvent *e )
+{
+ if ( e->button() != LeftButton )
+ return;
+ bool supports = ( (Editor*)viewManager->currentView() )->supportsBreakPoints();
+ TQTextParagraph *p = ( (Editor*)viewManager->currentView() )->document()->firstParagraph();
+ int yOffset = ( (Editor*)viewManager->currentView() )->contentsY();
+ while ( p ) {
+ if ( e->y() >= p->rect().y() - yOffset && e->y() <= p->rect().y() + p->rect().height() - yOffset ) {
+ TQTextParagraphData *d = p->extraData();
+ if ( !d )
+ return;
+ ParagData *data = (ParagData*)d;
+ if ( supports && ( e->x() < width() - 15 ) ) {
+ if ( data->marker == ParagData::Breakpoint ) {
+ data->marker = ParagData::NoMarker;
+ } else {
+ bool ok = TRUE;
+ isBreakpointPossible( ok, ( (Editor*)viewManager->currentView() )->text(), p->paragId() );
+ if ( ok )
+ data->marker = ParagData::Breakpoint;
+ else
+ emit showMessage( tr( "<font color=red>Can't set breakpoint here!</font>" ) );
+ }
+ } else {
+ if ( data->lineState == ParagData::FunctionStart ) {
+ if ( data->functionOpen )
+ emit collapseFunction( p );
+ else
+ emit expandFunction( p );
+ }
+ }
+ break;
+ }
+ p = p->next();
+ }
+ doRepaint();
+ emit markersChanged();
+}
+
+void MarkerWidget::contextMenuEvent( TQContextMenuEvent *e )
+{
+ TQPopupMenu m( 0, "editor_breakpointsmenu" );
+
+ int toggleBreakPoint = 0;
+// int editBreakpoints = 0;
+
+ TQTextParagraph *p = ( (Editor*)viewManager->currentView() )->document()->firstParagraph();
+ int yOffset = ( (Editor*)viewManager->currentView() )->contentsY();
+ bool supports = ( (Editor*)viewManager->currentView() )->supportsBreakPoints();
+ while ( p && supports ) {
+ if ( e->y() >= p->rect().y() - yOffset && e->y() <= p->rect().y() + p->rect().height() - yOffset ) {
+ if ( ( (ParagData*)p->extraData() )->marker == ParagData::Breakpoint )
+ toggleBreakPoint = m.insertItem( tr( "Clear Breakpoint\tF9" ) );
+ else
+ toggleBreakPoint = m.insertItem( tr( "Set Breakpoint\tF9" ) );
+// editBreakpoints = m.insertItem( tr( "Edit Breakpoints..." ) );
+ m.insertSeparator();
+ break;
+ }
+ p = p->next();
+ }
+
+ const int collapseAll = m.insertItem( tr( "Collapse All" ) );
+ const int expandAll = m.insertItem( tr( "Expand All" ) );
+ const int collapseFunctions = m.insertItem( tr( "Collapse all Functions" ) );
+ const int expandFunctions = m.insertItem( tr( "Expand all Functions" ) );
+
+ int res = m.exec( e->globalPos() );
+ if ( res == -1)
+ return;
+
+ if ( res == collapseAll ) {
+ emit collapse( TRUE );
+ } else if ( res == collapseFunctions ) {
+ emit collapse( FALSE );
+ } else if ( res == expandAll ) {
+ emit expand( TRUE );
+ } else if ( res == expandFunctions ) {
+ emit expand( FALSE );
+ } else if ( res == toggleBreakPoint ) {
+ if ( ( (ParagData*)p->extraData() )->marker == ParagData::Breakpoint ) {
+ ( (ParagData*)p->extraData() )->marker = ParagData::NoMarker;
+ } else {
+ bool ok;
+ isBreakpointPossible( ok, ( (Editor*)viewManager->currentView() )->text(), p->paragId() );
+ if ( ok )
+ ( (ParagData*)p->extraData() )->marker = ParagData::Breakpoint;
+ else
+ emit showMessage( tr( "<font color=red>Can't set breakpoint here!</font>" ) );
+ }
+// } else if ( res == editBreakpoints ) {
+// emit editBreakPoints();
+ }
+ doRepaint();
+ emit markersChanged();
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/markerwidget.h b/tqtinterface/qt4/tools/designer/editor/markerwidget.h
new file mode 100644
index 0000000..6e124c1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/markerwidget.h
@@ -0,0 +1,75 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef MARKERWIDGET_H
+#define MARKERWIDGET_H
+
+#include <tqwidget.h>
+#include <tqpixmap.h>
+
+class ViewManager;
+class TQTextParagraph;
+
+class MarkerWidget : public TQWidget
+{
+ TQ_OBJECT
+
+public:
+ MarkerWidget( ViewManager *tqparent, const char*name );
+
+Q_SIGNALS:
+ void markersChanged();
+ void expandFunction( TQTextParagraph *p );
+ void collapseFunction( TQTextParagraph *p );
+ void collapse( bool all /*else only functions*/ );
+ void expand( bool all /*else only functions*/ );
+ void editBreakPoints();
+ void isBreakpointPossible( bool &possible, const TQString &code, int line );
+ void showMessage( const TQString &msg );
+
+public Q_SLOTS:
+ void doRepaint() { tqrepaint( FALSE ); }
+
+protected:
+ void paintEvent( TQPaintEvent *e );
+ void resizeEvent( TQResizeEvent *e );
+ void mousePressEvent( TQMouseEvent *e );
+ void contextMenuEvent( TQContextMenuEvent *e );
+
+private:
+ TQPixmap buffer;
+ ViewManager *viewManager;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/paragdata.h b/tqtinterface/qt4/tools/designer/editor/paragdata.h
new file mode 100644
index 0000000..23ed6b5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/paragdata.h
@@ -0,0 +1,65 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PARAGDATA_H
+#define PARAGDATA_H
+
+#include "parenmatcher.h"
+#include <private/tqrichtext_p.h>
+
+struct ParagData : public TQTextParagraphData
+{
+public:
+ enum MarkerType { NoMarker, Error, Breakpoint };
+ enum LineState { FunctionStart, InFunction, FunctionEnd, Invalid };
+
+ ParagData() : lastLengthForCompletion( -1 ), marker( NoMarker ),
+ lineState( Invalid ), functionOpen( TRUE ), step( FALSE ), stackFrame( FALSE ) {}
+ ~ParagData() {}
+ void join( TQTextParagraphData *data ) {
+ ParagData *d = (ParagData*)data;
+ if ( marker == NoMarker )
+ marker = d->marker;
+ lineState = d->lineState;
+ }
+ ParenList parenList;
+ int lastLengthForCompletion;
+ MarkerType marker;
+ LineState lineState;
+ bool functionOpen;
+ bool step;
+ bool stackFrame;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/parenmatcher.cpp b/tqtinterface/qt4/tools/designer/editor/parenmatcher.cpp
new file mode 100644
index 0000000..990962c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/parenmatcher.cpp
@@ -0,0 +1,215 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "parenmatcher.h"
+#include "paragdata.h"
+
+#include "tqtextedit.h"
+#include <private/tqrichtext_p.h>
+#include <tqapplication.h>
+
+ParenMatcher::ParenMatcher()
+{
+ enabled = TRUE;
+}
+
+bool ParenMatcher::match( TQTextCursor *cursor )
+{
+ if ( !enabled )
+ return FALSE;
+ bool ret = FALSE;
+
+ TQChar c( cursor->paragraph()->at( cursor->index() )->c );
+ bool ok1 = FALSE;
+ bool ok2 = FALSE;
+ if ( c == '{' || c == '(' || c == '[' ) {
+ ok1 = checkOpenParen( cursor );
+ ret = ok1 || ret;
+ } else if ( cursor->index() > 0 ) {
+ c = cursor->paragraph()->at( cursor->index() - 1 )->c;
+ if ( c == '}' || c == ')' || c == ']' ) {
+ ok2 = checkClosedParen( cursor );
+ ret = ok2 || ret;
+ }
+ }
+
+ return ret;
+}
+
+bool ParenMatcher::checkOpenParen( TQTextCursor *cursor )
+{
+ if ( !cursor->paragraph()->extraData() )
+ return FALSE;
+ ParenList parenList = ( (ParagData*)cursor->paragraph()->extraData() )->parenList;
+
+ Paren openParen, closedParen;
+ TQTextParagraph *closedParenParag = cursor->paragraph();
+
+ int i = 0;
+ int ignore = 0;
+ bool foundOpen = FALSE;
+ TQChar c = cursor->paragraph()->at( cursor->index() )->c;
+ for (;;) {
+ if ( !foundOpen ) {
+ if ( i >= (int)parenList.count() )
+ goto bye;
+ openParen = parenList[ i ];
+ if ( openParen.pos != cursor->index() ) {
+ ++i;
+ continue;
+ } else {
+ foundOpen = TRUE;
+ ++i;
+ }
+ }
+
+ if ( i >= (int)parenList.count() ) {
+ for (;;) {
+ closedParenParag = closedParenParag->next();
+ if ( !closedParenParag )
+ goto bye;
+ if ( closedParenParag->extraData() &&
+ ( (ParagData*)closedParenParag->extraData() )->parenList.count() > 0 ) {
+ parenList = ( (ParagData*)closedParenParag->extraData() )->parenList;
+ break;
+ }
+ }
+ i = 0;
+ }
+
+ closedParen = parenList[ i ];
+ if ( closedParen.type == Paren::Open ) {
+ ignore++;
+ ++i;
+ continue;
+ } else {
+ if ( ignore > 0 ) {
+ ignore--;
+ ++i;
+ continue;
+ }
+
+ int id = Match;
+ if ( c == '{' && closedParen.chr != '}' ||
+ c == '(' && closedParen.chr != ')' ||
+ c == '[' && closedParen.chr != ']' )
+ id = Mismatch;
+ cursor->document()->setSelectionStart( id, *cursor );
+ int tidx = cursor->index();
+ TQTextParagraph *tstring = cursor->paragraph();
+ cursor->setParagraph( closedParenParag );
+ cursor->setIndex( closedParen.pos + 1 );
+ cursor->document()->setSelectionEnd( id, *cursor );
+ cursor->setParagraph( tstring );
+ cursor->setIndex( tidx );
+ return TRUE;
+ }
+ }
+
+ bye:
+ return FALSE;
+}
+
+bool ParenMatcher::checkClosedParen( TQTextCursor *cursor )
+{
+ if ( !cursor->paragraph()->extraData() )
+ return FALSE;
+ ParenList parenList = ( (ParagData*)cursor->paragraph()->extraData() )->parenList;
+
+ Paren openParen, closedParen;
+ TQTextParagraph *openParenParag = cursor->paragraph();
+
+ int i = (int)parenList.count() - 1;
+ int ignore = 0;
+ bool foundClosed = FALSE;
+ TQChar c = cursor->paragraph()->at( cursor->index() - 1 )->c;
+ for (;;) {
+ if ( !foundClosed ) {
+ if ( i < 0 )
+ goto bye;
+ closedParen = parenList[ i ];
+ if ( closedParen.pos != cursor->index() - 1 ) {
+ --i;
+ continue;
+ } else {
+ foundClosed = TRUE;
+ --i;
+ }
+ }
+
+ if ( i < 0 ) {
+ for (;;) {
+ openParenParag = openParenParag->prev();
+ if ( !openParenParag )
+ goto bye;
+ if ( openParenParag->extraData() &&
+ ( (ParagData*)openParenParag->extraData() )->parenList.count() > 0 ) {
+ parenList = ( (ParagData*)openParenParag->extraData() )->parenList;
+ break;
+ }
+ }
+ i = (int)parenList.count() - 1;
+ }
+
+ openParen = parenList[ i ];
+ if ( openParen.type == Paren::Closed ) {
+ ignore++;
+ --i;
+ continue;
+ } else {
+ if ( ignore > 0 ) {
+ ignore--;
+ --i;
+ continue;
+ }
+
+ int id = Match;
+ if ( c == '}' && openParen.chr != '{' ||
+ c == ')' && openParen.chr != '(' ||
+ c == ']' && openParen.chr != '[' )
+ id = Mismatch;
+ cursor->document()->setSelectionStart( id, *cursor );
+ int tidx = cursor->index();
+ TQTextParagraph *tstring = cursor->paragraph();
+ cursor->setParagraph( openParenParag );
+ cursor->setIndex( openParen.pos );
+ cursor->document()->setSelectionEnd( id, *cursor );
+ cursor->setParagraph( tstring );
+ cursor->setIndex( tidx );
+ return TRUE;
+ }
+ }
+
+ bye:
+ return FALSE;
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/parenmatcher.h b/tqtinterface/qt4/tools/designer/editor/parenmatcher.h
new file mode 100644
index 0000000..2aa843b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/parenmatcher.h
@@ -0,0 +1,78 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PARENMATCHER_H
+#define PARENMATCHER_H
+
+#include <tqstring.h>
+#include <tqvaluelist.h>
+
+class TQTextCursor;
+
+struct Paren
+{
+ Paren() : type( Open ), chr( ' ' ), pos( -1 ) {}
+ Paren( int t, const TQChar &c, int p ) : type( (Type)t ), chr( c ), pos( p ) {}
+ enum Type { Open, Closed };
+ Type type;
+ TQChar chr;
+ int pos;
+
+ TQ_DUMMY_COMPARISON_OPERATOR( Paren )
+};
+
+typedef TQValueList<Paren> ParenList;
+
+class ParenMatcher
+{
+public:
+ enum Selection {
+ Match = 1,
+ Mismatch
+ };
+
+ ParenMatcher();
+
+ virtual bool match( TQTextCursor *c );
+
+ void setEnabled( bool b ) { enabled = b; }
+
+private:
+ bool checkOpenParen( TQTextCursor *c );
+ bool checkClosedParen( TQTextCursor *c );
+
+ bool enabled;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/preferences.ui b/tqtinterface/qt4/tools/designer/editor/preferences.ui
new file mode 100644
index 0000000..9b65ef2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/preferences.ui
@@ -0,0 +1,510 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PreferencesBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>PreferencesBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>362</width>
+ <height>396</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQGroupBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>S&amp;yntax Highlighting</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Element:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listElements</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="1" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkBold</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Bold</string>
+ </property>
+ </widget>
+ <widget class="TQToolButton" row="5" column="1">
+ <property name="name">
+ <cstring>buttonColor</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>comboFamily</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Family:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFamily</cstring>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkUnderline</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Underline</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>spinSize</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkItalic</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Italic</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Change co&amp;lor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonColor</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Size:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinSize</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQListBox" row="1" column="0">
+ <item>
+ <property name="text">
+ <string>Comment</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Number</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>String</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Keyword</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Preprocessor</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Label</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Standard</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>listElements</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Preview:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editPreview</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>editPreview</cstring>
+ </property>
+ <property name="text">
+ <string>Some Text</string>
+ </property>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Optio&amp;ns</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkWordWrap</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Word Wrap</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkCompletion</cstring>
+ </property>
+ <property name="text">
+ <string>Comple&amp;tion</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkParenMatching</cstring>
+ </property>
+ <property name="text">
+ <string>Parentheses &amp;Matching</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>GroupBox3_2</cstring>
+ </property>
+ <property name="title">
+ <string>Indentation</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>spinTabSize</cstring>
+ </property>
+ <property name="value">
+ <number>8</number>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Tab Size:</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>spinIndentSize</cstring>
+ </property>
+ <property name="value">
+ <number>4</number>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>Indent Size:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkKeepTabs</cstring>
+ </property>
+ <property name="text">
+ <string>Keep Tabs</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkAutoIndent</cstring>
+ </property>
+ <property name="text">
+ <string>Auto Indent</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>spinSize</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>PreferencesBase</receiver>
+ <slot>sizeChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>checkBold</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PreferencesBase</receiver>
+ <slot>boldChanged(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkItalic</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PreferencesBase</receiver>
+ <slot>italicChanged(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkUnderline</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PreferencesBase</receiver>
+ <slot>underlineChanged(bool)</slot>
+ </connection>
+ <connection>
+ <sender>buttonColor</sender>
+ <signal>clicked()</signal>
+ <receiver>PreferencesBase</receiver>
+ <slot>colorClicked()</slot>
+ </connection>
+ <connection>
+ <sender>comboFamily</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>PreferencesBase</receiver>
+ <slot>familyChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listElements</sender>
+ <signal>highlighted(const QString&amp;)</signal>
+ <receiver>PreferencesBase</receiver>
+ <slot>elementChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>listElements</tabstop>
+ <tabstop>editPreview</tabstop>
+ <tabstop>comboFamily</tabstop>
+ <tabstop>spinSize</tabstop>
+ <tabstop>checkBold</tabstop>
+ <tabstop>checkItalic</tabstop>
+ <tabstop>checkUnderline</tabstop>
+ <tabstop>checkWordWrap</tabstop>
+ <tabstop>checkCompletion</tabstop>
+ <tabstop>checkParenMatching</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in declaration">qmap.h</include>
+ <include location="local" impldecl="in declaration">conf.h</include>
+ <include location="global" impldecl="in implementation">qpalette.h</include>
+ <include location="global" impldecl="in implementation">qlineedit.h</include>
+ <include location="global" impldecl="in implementation">qpixmap.h</include>
+ <include location="global" impldecl="in implementation">qcombobox.h</include>
+ <include location="global" impldecl="in implementation">qfontdatabase.h</include>
+ <include location="local" impldecl="in implementation">editor.h</include>
+ <include location="global" impldecl="in implementation">qpushbutton.h</include>
+ <include location="global" impldecl="in implementation">qcheckbox.h</include>
+ <include location="global" impldecl="in implementation">qcolordialog.h</include>
+ <include location="global" impldecl="in implementation">qsettings.h</include>
+ <include location="local" impldecl="in implementation">preferences.ui.h</include>
+</includes>
+<variables>
+ <variable>QString path;</variable>
+ <variable>QMap&lt;QString, ConfigStyle&gt; styles;</variable>
+ <variable>ConfigStyle currentStyle;</variable>
+ <variable>QString currentElement;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>colorClicked()</slot>
+ <slot>reInit()</slot>
+ <slot>save()</slot>
+ <slot>updatePreview()</slot>
+ <slot>boldChanged( bool b )</slot>
+ <slot>elementChanged( const QString &amp; element )</slot>
+ <slot>familyChanged( const QString &amp; f )</slot>
+ <slot>italicChanged( bool b )</slot>
+ <slot>setColorPixmap( const QColor &amp; c )</slot>
+ <slot>setPath( const QString &amp; p )</slot>
+ <slot>sizeChanged( int s )</slot>
+ <slot>underlineChanged( bool b )</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/editor/preferences.ui.h b/tqtinterface/qt4/tools/designer/editor/preferences.ui.h
new file mode 100644
index 0000000..cf29fb8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/preferences.ui.h
@@ -0,0 +1,181 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+void PreferencesBase::init()
+{
+ TQFontDatabase fdb;
+ comboFamily->insertStringList( fdb.families() );
+ listElements->setCurrentItem( listElements->firstItem() );
+ currentElement = "";
+}
+
+void PreferencesBase::destroy()
+{
+
+}
+
+void PreferencesBase::colorClicked()
+{
+ TQColor c = TQColorDialog::getColor( currentStyle.color, this, "editor_getcolor_dlg" );
+ if ( c.isValid() ) {
+ currentStyle.color = c;
+ setColorPixmap( c );
+ }
+}
+
+void PreferencesBase::reInit()
+{
+ styles = Config::readStyles( path );
+ currentElement = "";
+ elementChanged( "Comment" );
+ for ( int i = 0; i < comboFamily->count(); ++i ) {
+ if ( listElements->text( i ) == "Comment" ) {
+ listElements->setCurrentItem( i );
+ break;
+ }
+ }
+ checkWordWrap->setChecked( Config::wordWrap( path ) );
+ checkCompletion->setChecked( Config::completion( path ) );
+ checkParenMatching->setChecked( Config::parenMatching( path ) );
+ spinTabSize->setValue( Config::indentTabSize( path ) );
+ spinIndentSize->setValue( Config::indentIndentSize( path ) );
+ checkKeepTabs->setChecked( Config::indentKeepTabs( path ) );
+ checkAutoIndent->setChecked( Config::indentAutoIndent( path ) );
+}
+
+void PreferencesBase::save()
+{
+ if ( !currentElement.isEmpty() ) {
+ styles.remove( currentElement );
+ styles.insert( currentElement, currentStyle );
+ currentElement = "";
+ }
+
+ TQSettings settings;
+ Config::saveStyles( styles, path );
+ Config::setWordWrap( checkWordWrap->isChecked(), path );
+ Config::setCompletion( checkCompletion->isChecked(), path );
+ Config::setParenMatching( checkParenMatching->isChecked(), path );
+ Config::setIndentTabSize( spinTabSize->value(), path );
+ Config::setIndentIndentSize( spinIndentSize->value(), path );
+ Config::setIndentKeepTabs( checkKeepTabs->isChecked(), path );
+ Config::setIndentAutoIndent( checkAutoIndent->isChecked(), path );
+}
+
+void PreferencesBase::updatePreview()
+{
+ editPreview->setFont( currentStyle.font );
+ TQPalette pal = editPreview->palette();
+ pal.setColor( TQPalette::Active, TQColorGroup::Text, currentStyle.color );
+ pal.setColor( TQPalette::Active, TQColorGroup::Foreground, currentStyle.color );
+ editPreview->setPalette( pal );
+}
+
+void PreferencesBase::boldChanged( bool b )
+{
+ currentStyle.font.setBold( b );
+ updatePreview();
+}
+
+void PreferencesBase::elementChanged( const TQString &element )
+{
+ if ( !currentElement.isEmpty() ) {
+ styles.remove( currentElement );
+ styles.insert( currentElement, currentStyle );
+ currentElement = "";
+ }
+ TQMap<TQString, ConfigStyle>::Iterator it = styles.tqfind( element );
+ if ( it == styles.end() )
+ return;
+ ConfigStyle s = *it;
+ currentStyle = s;
+ comboFamily->lineEdit()->setText( s.font.family() );
+ spinSize->setValue( s.font.pointSize() );
+ checkBold->setChecked( s.font.bold() );
+ checkItalic->setChecked( s.font.italic() );
+ checkUnderline->setChecked( s.font.underline() );
+ setColorPixmap( s.color );
+ currentElement = element;
+ updatePreview();
+}
+
+void PreferencesBase::familyChanged( const TQString &f )
+{
+ TQString oldFamily = currentStyle.font.family();
+ currentStyle.font.setFamily( f );
+ if ( currentElement == "Standard" ) {
+ for ( TQMap<TQString, ConfigStyle>::Iterator it = styles.begin(); it != styles.end(); ++it ) {
+ if ( (*it).font.family() == oldFamily )
+ (*it).font.setFamily( f );
+ }
+ }
+ updatePreview();
+}
+
+void PreferencesBase::italicChanged( bool b )
+{
+ currentStyle.font.setItalic( b );
+ updatePreview();
+}
+
+void PreferencesBase::setColorPixmap( const TQColor &c )
+{
+ TQPixmap pm( 20, 20 );
+ pm.fill( c );
+ buttonColor->setPixmap( pm );
+ updatePreview();
+}
+
+void PreferencesBase::setPath( const TQString &p )
+{
+ path = p;
+}
+
+void PreferencesBase::sizeChanged( int s )
+{
+ int oldSize = currentStyle.font.pointSize();
+ currentStyle.font.setPointSize( s );
+ if ( currentElement == "Standard" ) {
+ for ( TQMap<TQString, ConfigStyle>::Iterator it = styles.begin(); it != styles.end(); ++it ) {
+ if ( (*it).font.pointSize() == oldSize )
+ (*it).font.setPointSize( s );
+ }
+ }
+ updatePreview();
+}
+
+void PreferencesBase::underlineChanged( bool b )
+{
+ currentStyle.font.setUnderline( b );
+ updatePreview();
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/viewmanager.cpp b/tqtinterface/qt4/tools/designer/editor/viewmanager.cpp
new file mode 100644
index 0000000..6c98f01
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/viewmanager.cpp
@@ -0,0 +1,276 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "viewmanager.h"
+#include "editor.h"
+#include "markerwidget.h"
+#include <tqlayout.h>
+#include <private/tqrichtext_p.h>
+#include "paragdata.h"
+#include <tqobjectlist.h>
+#include <tqlabel.h>
+#include <tqtimer.h>
+
+ViewManager::ViewManager( TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name ), curView( 0 )
+{
+ TQHBoxLayout *l = new TQHBoxLayout( this );
+ markerWidget = new MarkerWidget( this, "editor_markerwidget" );
+ connect( markerWidget, TQT_SIGNAL( markersChanged() ),
+ this, TQT_SIGNAL( markersChanged() ) );
+ connect( markerWidget, TQT_SIGNAL( collapseFunction( TQTextParagraph * ) ),
+ this, TQT_SIGNAL( collapseFunction( TQTextParagraph * ) ) );
+ connect( markerWidget, TQT_SIGNAL( expandFunction( TQTextParagraph * ) ),
+ this, TQT_SIGNAL( expandFunction( TQTextParagraph * ) ) );
+ connect( markerWidget, TQT_SIGNAL( collapse( bool ) ),
+ this, TQT_SIGNAL( collapse( bool ) ) );
+ connect( markerWidget, TQT_SIGNAL( expand( bool ) ),
+ this, TQT_SIGNAL( expand( bool ) ) );
+ connect( markerWidget, TQT_SIGNAL( editBreakPoints() ),
+ this, TQT_SIGNAL( editBreakPoints() ) );
+ connect( markerWidget, TQT_SIGNAL( isBreakpointPossible( bool&, const TQString &, int ) ),
+ this, TQT_SIGNAL( isBreakpointPossible( bool&, const TQString &, int ) ) );
+ connect( markerWidget, TQT_SIGNAL( showMessage( const TQString & ) ),
+ this, TQT_SLOT( showMessage( const TQString & ) ) );
+ messageTimer = new TQTimer( this );
+ connect( messageTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( cleartqStatusBar() ) );
+ markerWidget->setFixedWidth( fontMetrics().width( "0000" ) + 20 );
+ l->addWidget( markerWidget );
+ tqlayout = new TQVBoxLayout( l );
+}
+
+void ViewManager::addView( TQWidget *view )
+{
+ tqlayout->addWidget( view );
+ curView = view;
+ connect( ( (Editor*)curView )->verticalScrollBar(), TQT_SIGNAL( valueChanged( int ) ),
+ markerWidget, TQT_SLOT( doRepaint() ) );
+ connect( (Editor*)curView, TQT_SIGNAL( textChanged() ),
+ markerWidget, TQT_SLOT( doRepaint() ) );
+ connect( (Editor*)curView, TQT_SIGNAL( clearErrorMarker() ),
+ this, TQT_SLOT( clearErrorMarker() ) );
+ posLabel = new TQLabel( this, "editor_poslabel" );
+ posLabel->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight );
+ posLabel->setText( " Line: 1 Col: 1" );
+ posLabel->setFrameStyle( TQFrame::Sunken | TQFrame::Panel );
+ posLabel->setLineWidth( 1 );
+ posLabel->setFixedHeight( posLabel->fontMetrics().height() );
+ tqlayout->addWidget( posLabel );
+ connect( curView, TQT_SIGNAL( cursorPositionChanged( int, int ) ),
+ this, TQT_SLOT( cursorPositionChanged( int, int ) ) );
+}
+
+TQWidget *ViewManager::currentView() const
+{
+ return curView;
+}
+
+void ViewManager::childEvent( TQChildEvent *e )
+{
+ if ( e->type() == TQEvent::ChildInserted && ::tqqt_cast<Editor*>(e->child()) )
+ addView( (TQWidget*)e->child() );
+ TQWidget::childEvent( e );
+}
+
+void ViewManager::setError( int line )
+{
+ TQTextParagraph *p = ( (Editor*)curView )->document()->paragAt( line );
+ if ( p ) {
+ ( (Editor*)curView )->setErrorSelection( line );
+ ( (Editor*)curView )->setCursorPosition( line, 0 );
+ ( (Editor*)curView )->viewport()->setFocus();
+ ( (Editor*)curView )->makeFunctionVisible( p );
+ ParagData *paragData = (ParagData*)p->extraData();
+ if ( !paragData )
+ paragData = new ParagData;
+ paragData->marker = ParagData::Error;
+ p->setExtraData( paragData );
+ markerWidget->doRepaint();
+ }
+}
+
+void ViewManager::setStep( int line )
+{
+ TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
+ while ( p ) {
+ if ( p->extraData() )
+ ( (ParagData*)p->extraData() )->step = FALSE;
+ p = p->next();
+ }
+ p = ( (Editor*)curView )->document()->paragAt( line );
+ if ( p ) {
+ ( (Editor*)curView )->setStepSelection( line );
+ ( (Editor*)curView )->setCursorPosition( line, 0 );
+ ( (Editor*)curView )->viewport()->setFocus();
+ ( (Editor*)curView )->makeFunctionVisible( p );
+ ParagData *paragData = (ParagData*)p->extraData();
+ if ( !paragData )
+ paragData = new ParagData;
+ paragData->step = TRUE;
+ p->setExtraData( paragData );
+ markerWidget->doRepaint();
+ }
+}
+
+void ViewManager::clearStep()
+{
+ ( (Editor*)curView )->clearStepSelection();
+ TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
+ while ( p ) {
+ if ( p->extraData() )
+ ( (ParagData*)p->extraData() )->step = FALSE;
+ p = p->next();
+ }
+ markerWidget->doRepaint();
+}
+
+void ViewManager::setStackFrame( int line )
+{
+ TQTextParagraph *p = ( (Editor*)curView )->document()->paragAt( line );
+ if ( p ) {
+ ( (Editor*)curView )->sync();
+ ( (Editor*)curView )->setCursorPosition( line, 0 );
+ ( (Editor*)curView )->ensureCursorVisible();
+ ( (Editor*)curView )->viewport()->setFocus();
+ ( (Editor*)curView )->makeFunctionVisible( p );
+ ParagData *paragData = (ParagData*)p->extraData();
+ if ( !paragData )
+ paragData = new ParagData;
+ paragData->stackFrame = TRUE;
+ p->setExtraData( paragData );
+ markerWidget->doRepaint();
+ }
+}
+
+void ViewManager::clearStackFrame()
+{
+ TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
+ while ( p ) {
+ if ( p->extraData() ) {
+ ( (ParagData*)p->extraData() )->stackFrame = FALSE;
+ if ( ( (ParagData*)p->extraData() )->marker == ParagData::Error )
+ ( (ParagData*)p->extraData() )->marker = ParagData::NoMarker;
+ }
+ p = p->next();
+ }
+ markerWidget->doRepaint();
+}
+
+void ViewManager::resizeEvent( TQResizeEvent *e )
+{
+ TQWidget::resizeEvent( e );
+ markerWidget->doRepaint();
+}
+
+void ViewManager::clearErrorMarker()
+{
+ TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
+ while ( p ) {
+ if ( p->extraData() )
+ ( (ParagData*)p->extraData() )->marker = ParagData::NoMarker;
+ p = p->next();
+ }
+ markerWidget->doRepaint();
+}
+
+void ViewManager::setBreakPoints( const TQValueList<uint> &l )
+{
+ TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
+ int i = 0;
+ while ( p ) {
+ if ( l.tqfind( i ) != l.end() ) {
+ if ( !p->extraData() ) {
+ ParagData *data = new ParagData;
+ p->setExtraData( data );
+ }
+ ParagData *data = (ParagData*)p->extraData();
+ data->marker = ParagData::Breakpoint;
+ } else if ( p->extraData() ) {
+ ParagData *data = (ParagData*)p->extraData();
+ data->marker = ParagData::NoMarker;
+ }
+ p = p->next();
+ ++i;
+ }
+ markerWidget->doRepaint();
+}
+
+TQValueList<uint> ViewManager::breakPoints() const
+{
+ TQValueList<uint> l;
+ int i = 0;
+ TQTextParagraph *p = ( (Editor*)curView )->document()->firstParagraph();
+ while ( p ) {
+ if ( p->extraData() &&
+ ( (ParagData*)p->extraData() )->marker == ParagData::Breakpoint )
+ l << i;
+ p = p->next();
+ ++i;
+ }
+ return l;
+}
+
+void ViewManager::showMarkerWidget( bool b )
+{
+ if ( b )
+ markerWidget->show();
+ else
+ markerWidget->hide();
+}
+
+void ViewManager::emitMarkersChanged()
+{
+ emit markersChanged();
+}
+
+void ViewManager::cursorPositionChanged( int row, int col )
+{
+ posLabel->setText( TQString( " Line: %1 Col: %2" ).arg( row + 1 ).arg( col + 1 ) );
+}
+
+void ViewManager::showMessage( const TQString &msg )
+{
+ int row;
+ int col;
+ ( (TQTextEdit*)currentView() )->getCursorPosition( &row, &col );
+ posLabel->setText( msg );
+ messageTimer->start( 1000, TRUE );
+}
+
+void ViewManager::cleartqStatusBar()
+{
+ int row;
+ int col;
+ ( (TQTextEdit*)currentView() )->getCursorPosition( &row, &col );
+ posLabel->setText( TQString( " Line: %1 Col: %2" ).arg( row + 1 ).arg( col + 1 ) );
+}
diff --git a/tqtinterface/qt4/tools/designer/editor/viewmanager.h b/tqtinterface/qt4/tools/designer/editor/viewmanager.h
new file mode 100644
index 0000000..2677fb9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/viewmanager.h
@@ -0,0 +1,100 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef VIEWMANAGER_H
+#define VIEWMANAGER_H
+
+#include <tqwidget.h>
+#include <tqvaluelist.h>
+
+class TQChildEvent;
+class MarkerWidget;
+class TQVBoxLayout;
+class TQTQt::DockArea;
+class TQTextParagraph;
+class TQLabel;
+class TQTimer;
+
+class ViewManager : public TQWidget
+{
+ TQ_OBJECT
+
+public:
+ ViewManager( TQWidget *tqparent, const char *name );
+
+ void addView( TQWidget *view );
+ TQWidget *currentView() const;
+ void showMarkerWidget( bool );
+
+ void setError( int line );
+ void setStep( int line );
+ void setStackFrame( int line );
+ void clearStep();
+ void clearStackFrame();
+ void setBreakPoints( const TQValueList<uint> &l );
+ TQValueList<uint> breakPoints() const;
+
+ void emitMarkersChanged();
+ MarkerWidget *marker_widget() const { return markerWidget; }
+
+Q_SIGNALS:
+ void markersChanged();
+ void expandFunction( TQTextParagraph *p );
+ void collapseFunction( TQTextParagraph *p );
+ void collapse( bool all /*else only functions*/ );
+ void expand( bool all /*else only functions*/ );
+ void editBreakPoints();
+ void isBreakpointPossible( bool &possible, const TQString &code, int line );
+
+protected Q_SLOTS:
+ void clearErrorMarker();
+ void cursorPositionChanged( int row, int col );
+ void showMessage( const TQString &msg );
+ void cleartqStatusBar();
+
+protected:
+ void childEvent( TQChildEvent *e );
+ void resizeEvent( TQResizeEvent *e );
+
+private:
+ TQWidget *curView;
+ MarkerWidget *markerWidget;
+ TQVBoxLayout *tqlayout;
+ TQTQt::DockArea *dockArea;
+ TQLabel *posLabel;
+ TQString extraText;
+ TQTimer *messageTimer;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/editor/yyindent.cpp b/tqtinterface/qt4/tools/designer/editor/yyindent.cpp
new file mode 100644
index 0000000..61bd4d6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/editor/yyindent.cpp
@@ -0,0 +1,1170 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+/*
+ This file is a self-contained interactive indenter for C++ and TQt
+ Script.
+
+ The general problem of indenting a C++ program is ill posed. On the
+ one hand, an indenter has to analyze programs written in a
+ free-form formal language that is best described in terms of
+ tokens, not characters, not lines. On the other hand, indentation
+ applies to lines and white space characters matter, and otherwise
+ the programs to indent are formally invalid in general, as they are
+ begin edited.
+
+ The approach taken here works line by line. We receive a program
+ consisting of N lines or more, and we want to compute the
+ indentation appropriate for the Nth line. Lines beyond the Nth
+ lines are of no concern to us, so for simplicity we pretend the
+ program has exactly N lines and we call the Nth line the "bottom
+ line". Typically, we have to indent the bottom line when it's still
+ empty, so we concentrate our analysis on the N - 1 lines that
+ precede.
+
+ By inspecting the (N - 1)-th line, the (N - 2)-th line, ...
+ backwards, we determine the kind of the bottom line and indent it
+ accordingly.
+
+ * The bottom line is a comment line. See
+ bottomLineStartsInCComment() and
+ indentWhenBottomLineStartsInCComment().
+ * The bottom line is a continuation line. See isContinuationLine()
+ and indentForContinuationLine().
+ * The bottom line is a standalone line. See
+ indentForStandaloneLine().
+
+ Certain tokens that influence the indentation, notably braces, are
+ looked for in the lines. This is done by simple string comparison,
+ without a real tokenizer. Confusing constructs such as comments and
+ string literals are removed beforehand.
+*/
+
+#include <tqregexp.h>
+
+/* qmake ignore TQ_OBJECT */
+
+/*
+ The indenter avoids getting stuck in almost infinite loops by
+ imposing arbitrary limits on the number of lines it analyzes when
+ looking for a construct.
+
+ For example, the indenter never considers more than BigRoof lines
+ backwards when looking for the start of a C-style comment.
+*/
+static const int SmallRoof = 40;
+static const int BigRoof = 400;
+
+/*
+ The indenter supports a few parameters:
+
+ * ppHardwareTabSize is the size of a '\t' in your favorite editor.
+ * ppIndentSize is the size of an indentation, or software tab
+ size.
+ * ppContinuationIndentSize is the extra indent for a continuation
+ line, when there is nothing to align against on the previous
+ line.
+ * ppCommentOffset is the indentation within a C-style comment,
+ when it cannot be picked up.
+*/
+
+static int ppHardwareTabSize = 8;
+static int ppIndentSize = 4;
+static int ppContinuationIndentSize = 8;
+
+static const int ppCommentOffset = 2;
+
+void setTabSize( int size )
+{
+ ppHardwareTabSize = size;
+}
+
+void setIndentSize( int size )
+{
+ ppIndentSize = size;
+ ppContinuationIndentSize = 2 * size;
+}
+
+static TQRegExp *literal = 0;
+static TQRegExp *label = 0;
+static TQRegExp *inlineCComment = 0;
+static TQRegExp *braceX = 0;
+static TQRegExp *iflikeKeyword = 0;
+
+/*
+ Returns the first non-space character in the string t, or
+ TQChar::null if the string is made only of white space.
+*/
+static TQChar firstNonWhiteSpace( const TQString& t )
+{
+ int i = 0;
+ while ( i < (int) t.length() ) {
+ if ( !t[i].isSpace() )
+ return t[i];
+ i++;
+ }
+ return TQChar::null;
+}
+
+/*
+ Returns TRUE if string t is made only of white space; otherwise
+ returns FALSE.
+*/
+static bool isOnlyWhiteSpace( const TQString& t )
+{
+ return firstNonWhiteSpace( t ).isNull();
+}
+
+/*
+ Assuming string t is a line, returns the column number of a given
+ index. Column numbers and index are identical for strings that don't
+ contain '\t's.
+*/
+int columnForIndex( const TQString& t, int index )
+{
+ int col = 0;
+ if ( index > (int) t.length() )
+ index = t.length();
+
+ for ( int i = 0; i < index; i++ ) {
+ if ( t[i] == TQChar('\t') ) {
+ col = ( (col / ppHardwareTabSize) + 1 ) * ppHardwareTabSize;
+ } else {
+ col++;
+ }
+ }
+ return col;
+}
+
+/*
+ Returns the indentation size of string t.
+*/
+int indentOfLine( const TQString& t )
+{
+ return columnForIndex( t, t.tqfind(firstNonWhiteSpace(t)) );
+}
+
+/*
+ Replaces t[k] by ch, unless t[k] is '\t'. Tab characters are better
+ left alone since they break the "index equals column" rule. No
+ provisions are taken against '\n' or '\r', which shouldn't occur in
+ t anyway.
+*/
+static inline void eraseChar( TQString& t, int k, TQChar ch )
+{
+ if ( t[k] != '\t' )
+ t[k] = ch;
+}
+
+/*
+ Removes some nefast constructs from a code line and returns the
+ resulting line.
+*/
+static TQString trimmedCodeLine( const TQString& t )
+{
+ TQString trimmed = t;
+ int k;
+
+ /*
+ Replace character and string literals by X's, since they may
+ contain confusing characters (such as '{' and ';'). "Hello!" is
+ tqreplaced by XXXXXXXX. The literals are rigourously of the same
+ length before and after; otherwise, we would break tqalignment of
+ continuation lines.
+ */
+ k = 0;
+ while ( (k = trimmed.tqfind(*literal, k)) != -1 ) {
+ for ( int i = 0; i < literal->matchedLength(); i++ )
+ eraseChar( trimmed, k + i, 'X' );
+ k += literal->matchedLength();
+ }
+
+ /*
+ Replace inline C-style comments by spaces. Other comments are
+ handled elsewhere.
+ */
+ k = 0;
+ while ( (k = trimmed.tqfind(*inlineCComment, k)) != -1 ) {
+ for ( int i = 0; i < inlineCComment->matchedLength(); i++ )
+ eraseChar( trimmed, k + i, ' ' );
+ k += inlineCComment->matchedLength();
+ }
+
+ /*
+ Replace goto and switch labels by whitespace, but be careful
+ with this case:
+
+ foo1: bar1;
+ bar2;
+ */
+ while ( trimmed.tqfindRev(':') != -1 && trimmed.tqfind(*label) != -1 ) {
+ TQString cap1 = label->cap( 1 );
+ int pos1 = label->pos( 1 );
+ int stop = cap1.length();
+
+ if ( pos1 + stop < (int) trimmed.length() && ppIndentSize < stop )
+ stop = ppIndentSize;
+
+ int i = 0;
+ while ( i < stop ) {
+ eraseChar( trimmed, pos1 + i, ' ' );
+ i++;
+ }
+ while ( i < (int) cap1.length() ) {
+ eraseChar( trimmed, pos1 + i, ';' );
+ i++;
+ }
+ }
+
+ /*
+ Remove C++-style comments.
+ */
+ k = trimmed.tqfind( "//" );
+ if ( k != -1 )
+ trimmed.truncate( k );
+
+ return trimmed;
+}
+
+/*
+ Returns '(' if the last parenthesis is opening, ')' if it is
+ closing, and TQChar::null if there are no parentheses in t.
+*/
+static inline TQChar lastParen( const TQString& t )
+{
+ int i = t.length();
+ while ( i > 0 ) {
+ i--;
+ if ( t[i] == TQChar('(') || t[i] == TQChar(')') )
+ return t[i];
+ }
+ return TQChar::null;
+}
+
+/*
+ Returns TRUE if typedIn the same as okayCh or is null; otherwise
+ returns FALSE.
+*/
+static inline bool okay( TQChar typedIn, TQChar okayCh )
+{
+ return typedIn == TQChar::null || typedIn == okayCh;
+}
+
+/*
+ The "linizer" is a group of functions and variables to iterate
+ through the source code of the program to indent. The program is
+ given as a list of strings, with the bottom line being the line to
+ indent. The actual program might contain extra lines, but those are
+ uninteresting and not passed over to us.
+*/
+
+struct LinizerState
+{
+ TQString line;
+ int braceDepth;
+ bool leftBraceFollows;
+
+ TQStringList::ConstIterator iter;
+ bool inCComment;
+ bool pendingRightBrace;
+};
+
+static TQStringList *yyProgram = 0;
+static LinizerState *yyLinizerState = 0;
+
+// shorthands
+static const TQString *yyLine = 0;
+static const int *yyBraceDepth = 0;
+static const bool *yyLeftBraceFollows = 0;
+
+/*
+ Saves and restores the state of the global linizer. This enables
+ backtracking.
+*/
+#define YY_SAVE() \
+ LinizerState savedState = *yyLinizerState
+#define YY_RESTORE() \
+ *yyLinizerState = savedState
+
+/*
+ Advances to the previous line in yyProgram and update yyLine
+ accordingly. yyLine is cleaned from comments and other damageable
+ constructs. Empty lines are skipped.
+*/
+static bool readLine()
+{
+ int k;
+
+ yyLinizerState->leftBraceFollows =
+ ( firstNonWhiteSpace(yyLinizerState->line) == TQChar('{') );
+
+ do {
+ if ( yyLinizerState->iter == yyProgram->begin() ) {
+ yyLinizerState->line = TQString();
+ return FALSE;
+ }
+
+ --yyLinizerState->iter;
+ yyLinizerState->line = *yyLinizerState->iter;
+
+ yyLinizerState->line = trimmedCodeLine( yyLinizerState->line );
+
+ /*
+ Remove C-style comments that span multiple lines. If the
+ bottom line starts in a C-style comment, we are not aware
+ of that and eventually yyLine will contain a slash-aster.
+
+ Notice that both if's can be executed, since
+ yyLinizerState->inCComment is potentially set to FALSE in
+ the first if. The order of the if's is also important.
+ */
+
+ if ( yyLinizerState->inCComment ) {
+ TQString slashAster( "/*" );
+
+ k = yyLinizerState->line.tqfind( slashAster );
+ if ( k == -1 ) {
+ yyLinizerState->line = TQString();
+ } else {
+ yyLinizerState->line.truncate( k );
+ yyLinizerState->inCComment = FALSE;
+ }
+ }
+
+ if ( !yyLinizerState->inCComment ) {
+ TQString asterSlash( "*/" );
+
+ k = yyLinizerState->line.tqfind( asterSlash );
+ if ( k != -1 ) {
+ for ( int i = 0; i < k + 2; i++ )
+ eraseChar( yyLinizerState->line, i, ' ' );
+ yyLinizerState->inCComment = TRUE;
+ }
+ }
+
+ /*
+ Remove preprocessor directives.
+ */
+ k = 0;
+ while ( k < (int) yyLinizerState->line.length() ) {
+ TQChar ch = yyLinizerState->line[k];
+ if ( ch == TQChar('#') ) {
+ yyLinizerState->line = TQString();
+ } else if ( !ch.isSpace() ) {
+ break;
+ }
+ k++;
+ }
+
+ /*
+ Remove trailing spaces.
+ */
+ k = yyLinizerState->line.length();
+ while ( k > 0 && yyLinizerState->line[k - 1].isSpace() )
+ k--;
+ yyLinizerState->line.truncate( k );
+
+ /*
+ '}' increment the brace depth and '{' decrements it and not
+ the other way around, as we are parsing backwards.
+ */
+ yyLinizerState->braceDepth +=
+ yyLinizerState->line.tqcontains( '}' ) -
+ yyLinizerState->line.tqcontains( '{' );
+
+ /*
+ We use a dirty trick for
+
+ } else ...
+
+ We don't count the '}' yet, so that it's more or less
+ equivalent to the friendly construct
+
+ }
+ else ...
+ */
+ if ( yyLinizerState->pendingRightBrace )
+ yyLinizerState->braceDepth++;
+ yyLinizerState->pendingRightBrace =
+ ( yyLinizerState->line.tqfind(*braceX) == 0 );
+ if ( yyLinizerState->pendingRightBrace )
+ yyLinizerState->braceDepth--;
+ } while ( yyLinizerState->line.isEmpty() );
+
+ return TRUE;
+}
+
+/*
+ Resets the linizer to its initial state, with yyLine containing the
+ line above the bottom line of the program.
+*/
+static void startLinizer()
+{
+ yyLinizerState->braceDepth = 0;
+ yyLinizerState->inCComment = FALSE;
+ yyLinizerState->pendingRightBrace = FALSE;
+
+ yyLine = &yyLinizerState->line;
+ yyBraceDepth = &yyLinizerState->braceDepth;
+ yyLeftBraceFollows = &yyLinizerState->leftBraceFollows;
+
+ yyLinizerState->iter = yyProgram->end();
+ --yyLinizerState->iter;
+ yyLinizerState->line = *yyLinizerState->iter;
+ readLine();
+}
+
+/*
+ Returns TRUE if the start of the bottom line of yyProgram (and
+ potentially the whole line) is part of a C-style comment; otherwise
+ returns FALSE.
+*/
+static bool bottomLineStartsInCComment()
+{
+ TQString slashAster( "/*" );
+ TQString asterSlash( "*/" );
+
+ /*
+ We could use the linizer here, but that would slow us down
+ terribly. We are better to trim only the code lines we need.
+ */
+ TQStringList::ConstIterator p = yyProgram->end();
+ --p; // skip bottom line
+
+ for ( int i = 0; i < BigRoof; i++ ) {
+ if ( p == yyProgram->begin() )
+ return FALSE;
+ --p;
+
+ if ( (*p).tqfind(slashAster) != -1 || (*p).tqfind(asterSlash) != -1 ) {
+ TQString trimmed = trimmedCodeLine( *p );
+
+ if ( trimmed.tqfind(slashAster) != -1 ) {
+ return TRUE;
+ } else if ( trimmed.tqfind(asterSlash) != -1 ) {
+ return FALSE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+/*
+ Returns the recommended indent for the bottom line of yyProgram
+ assuming that it starts in a C-style comment, a condition that is
+ tested elsewhere.
+
+ Essentially, we're trying to align against some text on the previous
+ line.
+*/
+static int indentWhenBottomLineStartsInCComment()
+{
+ int k = yyLine->tqfindRev( "/*" );
+ if ( k == -1 ) {
+ /*
+ We found a normal text line in a comment. Align the
+ bottom line with the text on this line.
+ */
+ return indentOfLine( *yyLine );
+ } else {
+ /*
+ The C-style comment starts on this line. If there is
+ text on the same line, align with it. Otherwise, align
+ with the slash-aster plus a given offset.
+ */
+ int indent = columnForIndex( *yyLine, k );
+ k += 2;
+ while ( k < (int) yyLine->length() ) {
+ if ( !(*yyLine)[k].isSpace() )
+ return columnForIndex( *yyLine, k );
+ k++;
+ }
+ return indent + ppCommentOffset;
+ }
+}
+
+/*
+ A function called match...() modifies the linizer state. If it
+ returns TRUE, yyLine is the top line of the matched construct;
+ otherwise, the linizer is left in an unknown state.
+
+ A function called is...() keeps the linizer state intact.
+*/
+
+/*
+ Returns TRUE if the current line (and upwards) forms a braceless
+ control statement; otherwise returns FALSE.
+
+ The first line of the following example is a "braceless control
+ statement":
+
+ if ( x )
+ y;
+*/
+static bool matchBracelessControlStatement()
+{
+ int delimDepth = 0;
+
+ if ( yyLine->endsWith("else") )
+ return TRUE;
+
+ if ( !yyLine->endsWith(")") )
+ return FALSE;
+
+ for ( int i = 0; i < SmallRoof; i++ ) {
+ int j = yyLine->length();
+ while ( j > 0 ) {
+ j--;
+ TQChar ch = (*yyLine)[j];
+
+ switch ( ch.tqunicode() ) {
+ case ')':
+ delimDepth++;
+ break;
+ case '(':
+ delimDepth--;
+ if ( delimDepth == 0 ) {
+ if ( yyLine->tqfind(*iflikeKeyword) != -1 ) {
+ /*
+ We have
+
+ if ( x )
+ y
+
+ "if ( x )" is not part of the statement
+ "y".
+ */
+ return TRUE;
+ }
+ }
+ if ( delimDepth == -1 ) {
+ /*
+ We have
+
+ if ( (1 +
+ 2)
+
+ and not
+
+ if ( 1 +
+ 2 )
+ */
+ return FALSE;
+ }
+ break;
+ case '{':
+ case '}':
+ case ';':
+ /*
+ We met a statement separator, but not where we
+ expected it. What follows is probably a weird
+ continuation line. Be careful with ';' in for,
+ though.
+ */
+ if ( ch != TQChar(';') || delimDepth == 0 )
+ return FALSE;
+ }
+ }
+
+ if ( !readLine() )
+ break;
+ }
+ return FALSE;
+}
+
+/*
+ Returns TRUE if yyLine is an unfinished line; otherwise returns
+ FALSE.
+
+ In many places we'll use the terms "standalone line", "unfinished
+ line" and "continuation line". The meaning of these should be
+ evident from this code example:
+
+ a = b; // standalone line
+ c = d + // unfinished line
+ e + // unfinished continuation line
+ f + // unfinished continuation line
+ g; // continuation line
+*/
+static bool isUnfinishedLine()
+{
+ bool unf = FALSE;
+
+ YY_SAVE();
+
+ if ( yyLine->isEmpty() )
+ return FALSE;
+
+ TQChar lastCh = (*yyLine)[(int) yyLine->length() - 1];
+ if ( TQString("{};").tqfind(lastCh) == -1 && !yyLine->endsWith("...") ) {
+ /*
+ It doesn't end with ';' or similar. If it's neither
+ "TQ_OBJECT" nor "if ( x )", it must be an unfinished line.
+ */
+ unf = ( yyLine->tqcontains("TQ_OBJECT") == 0 &&
+ !matchBracelessControlStatement() );
+ } else if ( lastCh == TQChar(';') ) {
+ if ( lastParen(*yyLine) == TQChar('(') ) {
+ /*
+ Exception:
+
+ for ( int i = 1; i < 10;
+ */
+ unf = TRUE;
+ } else if ( readLine() && yyLine->endsWith(";") &&
+ lastParen(*yyLine) == TQChar('(') ) {
+ /*
+ Exception:
+
+ for ( int i = 1;
+ i < 10;
+ */
+ unf = TRUE;
+ }
+ }
+
+ YY_RESTORE();
+ return unf;
+}
+
+/*
+ Returns TRUE if yyLine is a continuation line; otherwise returns
+ FALSE.
+*/
+static bool isContinuationLine()
+{
+ bool cont = FALSE;
+
+ YY_SAVE();
+ if ( readLine() )
+ cont = isUnfinishedLine();
+ YY_RESTORE();
+ return cont;
+}
+
+/*
+ Returns the recommended indent for the bottom line of yyProgram,
+ assuming it's a continuation line.
+
+ We're trying to align the continuation line against some parenthesis
+ or other bracked left opened on a previous line, or some interesting
+ operator such as '='.
+*/
+static int indentForContinuationLine()
+{
+ int braceDepth = 0;
+ int delimDepth = 0;
+
+ bool leftBraceFollowed = *yyLeftBraceFollows;
+
+ for ( int i = 0; i < SmallRoof; i++ ) {
+ int hook = -1;
+
+ int j = yyLine->length();
+ while ( j > 0 && hook < 0 ) {
+ j--;
+ TQChar ch = (*yyLine)[j];
+
+ switch ( ch.tqunicode() ) {
+ case ')':
+ case ']':
+ delimDepth++;
+ break;
+ case '}':
+ braceDepth++;
+ break;
+ case '(':
+ case '[':
+ delimDepth--;
+ /*
+ An unclosed delimiter is a good place to align at,
+ at least for some styles (including Trolltech's).
+ */
+ if ( delimDepth == -1 )
+ hook = j;
+ break;
+ case '{':
+ braceDepth--;
+ /*
+ A left brace followed by other stuff on the same
+ line is typically for an enum or an initializer.
+ Such a brace must be treated just like the other
+ delimiters.
+ */
+ if ( braceDepth == -1 ) {
+ if ( j < (int) yyLine->length() - 1 ) {
+ hook = j;
+ } else {
+ return 0; // shouldn't happen
+ }
+ }
+ break;
+ case '=':
+ /*
+ An equal sign is a very natural tqalignment hook
+ because it's usually the operator with the lowest
+ precedence in statements it appears in. Case in
+ point:
+
+ int x = 1 +
+ 2;
+
+ However, we have to beware of constructs such as
+ default arguments and explicit enum constant
+ values:
+
+ void foo( int x = 0,
+ int y = 0 );
+
+ And not
+
+ void foo( int x = 0,
+ int y = 0 );
+
+ These constructs are caracterized by a ',' at the
+ end of the unfinished lines or by unbalanced
+ parentheses.
+ */
+ if ( TQString("!=<>").tqfind((*yyLine)[j - 1]) == -1 &&
+ (*yyLine)[j + 1] != '=' ) {
+ if ( braceDepth == 0 && delimDepth == 0 &&
+ j < (int) yyLine->length() - 1 &&
+ !yyLine->endsWith(",") &&
+ (yyLine->tqcontains('(') == yyLine->tqcontains(')')) )
+ hook = j;
+ }
+ }
+ }
+
+ if ( hook >= 0 ) {
+ /*
+ Yes, we have a delimiter or an operator to align
+ against! We don't really align against it, but rather
+ against the following token, if any. In this example,
+ the following token is "11":
+
+ int x = ( 11 +
+ 2 );
+
+ If there is no such token, we use a continuation indent:
+
+ static TQRegExp foo( TQString(
+ "foo foo foo foo foo foo foo foo foo") );
+ */
+ hook++;
+ while ( hook < (int) yyLine->length() ) {
+ if ( !(*yyLine)[hook].isSpace() )
+ return columnForIndex( *yyLine, hook );
+ hook++;
+ }
+ return indentOfLine( *yyLine ) + ppContinuationIndentSize;
+ }
+
+ if ( braceDepth != 0 )
+ break;
+
+ /*
+ The line's delimiters are balanced. It looks like a
+ continuation line or something.
+ */
+ if ( delimDepth == 0 ) {
+ if ( leftBraceFollowed ) {
+ /*
+ We have
+
+ int main()
+ {
+
+ or
+
+ Bar::Bar()
+ : Foo( x )
+ {
+
+ The "{" should be flush left.
+ */
+ if ( !isContinuationLine() )
+ return indentOfLine( *yyLine );
+ } else if ( isContinuationLine() || yyLine->endsWith(",") ) {
+ /*
+ We have
+
+ x = a +
+ b +
+ c;
+
+ or
+
+ int t[] = {
+ 1, 2, 3,
+ 4, 5, 6
+
+ The "c;" should fall right under the "b +", and the
+ "4, 5, 6" right under the "1, 2, 3,".
+ */
+ return indentOfLine( *yyLine );
+ } else {
+ /*
+ We have
+
+ stream << 1 +
+ 2;
+
+ We could, but we don't, try to analyze which
+ operator has precedence over which and so on, to
+ obtain the excellent result
+
+ stream << 1 +
+ 2;
+
+ We do have a special trick above for the assignment
+ operator above, though.
+ */
+ return indentOfLine( *yyLine ) + ppContinuationIndentSize;
+ }
+ }
+
+ if ( !readLine() )
+ break;
+ }
+ return 0;
+}
+
+/*
+ Returns the recommended indent for the bottom line of yyProgram if
+ that line is standalone (or should be indented likewise).
+
+ Indenting a standalone line is tricky, mostly because of braceless
+ control statements. Grossly, we are looking backwards for a special
+ line, a "hook line", that we can use as a starting point to indent,
+ and then modify the indentation level according to the braces met
+ along the way to that hook.
+
+ Let's consider a few examples. In all cases, we want to indent the
+ bottom line.
+
+ Example 1:
+
+ x = 1;
+ y = 2;
+
+ The hook line is "x = 1;". We met 0 opening braces and 0 closing
+ braces. Therefore, "y = 2;" inherits the indent of "x = 1;".
+
+ Example 2:
+
+ if ( x ) {
+ y;
+
+ The hook line is "if ( x ) {". No matter what precedes it, "y;" has
+ to be indented one level deeper than the hook line, since we met one
+ opening brace along the way.
+
+ Example 3:
+
+ if ( a )
+ while ( b ) {
+ c;
+ }
+ d;
+
+ To indent "d;" correctly, we have to go as far as the "if ( a )".
+ Compare with
+
+ if ( a ) {
+ while ( b ) {
+ c;
+ }
+ d;
+
+ Still, we're striving to go back as little as possible to accomodate
+ people with irregular indentation schemes. A hook line near at hand
+ is much more reliable than a remote one.
+*/
+static int indentForStandaloneLine()
+{
+ for ( int i = 0; i < SmallRoof; i++ ) {
+ if ( !*yyLeftBraceFollows ) {
+ YY_SAVE();
+
+ if ( matchBracelessControlStatement() ) {
+ /*
+ The situation is this, and we want to indent "z;":
+
+ if ( x &&
+ y )
+ z;
+
+ yyLine is "if ( x &&".
+ */
+ return indentOfLine( *yyLine ) + ppIndentSize;
+ }
+ YY_RESTORE();
+ }
+
+ if ( yyLine->endsWith(";") || yyLine->tqcontains('{') > 0 ) {
+ /*
+ The situation is possibly this, and we want to indent
+ "z;":
+
+ while ( x )
+ y;
+ z;
+
+ We return the indent of "while ( x )". In place of "y;",
+ any arbitrarily complex compound statement can appear.
+ */
+
+ if ( *yyBraceDepth > 0 ) {
+ do {
+ if ( !readLine() )
+ break;
+ } while ( *yyBraceDepth > 0 );
+ }
+
+ LinizerState hookState;
+
+ while ( isContinuationLine() )
+ readLine();
+ hookState = *yyLinizerState;
+
+ readLine();
+ if ( *yyBraceDepth <= 0 ) {
+ do {
+ if ( !matchBracelessControlStatement() )
+ break;
+ hookState = *yyLinizerState;
+ } while ( readLine() );
+ }
+
+ *yyLinizerState = hookState;
+
+ while ( isContinuationLine() )
+ readLine();
+
+ /*
+ Never trust lines containing only '{' or '}', as some
+ people (Richard M. Stallman) format them weirdly.
+ */
+ if ( yyLine->stripWhiteSpace().length() > 1 )
+ return indentOfLine( *yyLine ) - *yyBraceDepth * ppIndentSize;
+ }
+
+ if ( !readLine() )
+ return -*yyBraceDepth * ppIndentSize;
+ }
+ return 0;
+}
+
+/*
+ Constructs global variables used by the indenter.
+*/
+static void initializeIndenter()
+{
+ literal = new TQRegExp( "([\"'])(?:\\\\.|[^\\\\])*\\1" );
+ literal->setMinimal( TRUE );
+ label = new TQRegExp(
+ "^\\s*((?:case\\b([^:]|::)+|[a-zA-Z_0-9]+)(?:\\s+Q_SLOTS)?:)(?!:)" );
+ inlineCComment = new TQRegExp( "/\\*.*\\*/" );
+ inlineCComment->setMinimal( TRUE );
+ braceX = new TQRegExp( "^\\s*\\}\\s*(?:else|catch)\\b" );
+ iflikeKeyword = new TQRegExp( "\\b(?:catch|do|for|if|while)\\b" );
+
+ yyLinizerState = new LinizerState;
+}
+
+/*
+ Destroys global variables used by the indenter.
+*/
+static void terminateIndenter()
+{
+ delete literal;
+ delete label;
+ delete inlineCComment;
+ delete braceX;
+ delete iflikeKeyword;
+ delete yyLinizerState;
+}
+
+/*
+ Returns the recommended indent for the bottom line of program.
+ Unless null, typedIn stores the character of yyProgram that
+ triggered reindentation.
+
+ This function works better if typedIn is set properly; it is
+ slightly more conservative if typedIn is completely wild, and
+ slighly more liberal if typedIn is always null. The user might be
+ annoyed by the liberal behavior.
+*/
+int indentForBottomLine( const TQStringList& program, TQChar typedIn )
+{
+ if ( program.isEmpty() )
+ return 0;
+
+ initializeIndenter();
+
+ yyProgram = new TQStringList( program );
+ startLinizer();
+
+ const TQString& bottomLine = program.last();
+ TQChar firstCh = firstNonWhiteSpace( bottomLine );
+ int indent;
+
+ if ( bottomLineStartsInCComment() ) {
+ /*
+ The bottom line starts in a C-style comment. Indent it
+ smartly, unless the user has already played around with it,
+ in which case it's better to leave her stuff alone.
+ */
+ if ( isOnlyWhiteSpace(bottomLine) ) {
+ indent = indentWhenBottomLineStartsInCComment();
+ } else {
+ indent = indentOfLine( bottomLine );
+ }
+ } else if ( okay(typedIn, '#') && firstCh == TQChar('#') ) {
+ /*
+ Preprocessor directives go flush left.
+ */
+ indent = 0;
+ } else {
+ if ( isUnfinishedLine() ) {
+ indent = indentForContinuationLine();
+ } else {
+ indent = indentForStandaloneLine();
+ }
+
+ if ( okay(typedIn, '}') && firstCh == TQChar('}') ) {
+ /*
+ A closing brace is one level more to the left than the
+ code it follows.
+ */
+ indent -= ppIndentSize;
+ } else if ( okay(typedIn, ':') ) {
+ TQRegExp caseLabel(
+ "\\s*(?:case\\b(?:[^:]|::)+"
+ "|(?:public|protected|private|Q_SIGNALS|default)(?:\\s+Q_SLOTS)?\\s*"
+ ")?:.*" );
+
+ if ( caseLabel.exactMatch(bottomLine) ) {
+ /*
+ Move a case label (or the ':' in front of a
+ constructor initialization list) one level to the
+ left, but only if the user did not play around with
+ it yet. Some users have exotic tastes in the
+ matter, and most users probably are not patient
+ enough to wait for the final ':' to format their
+ code properly.
+
+ We don't attempt the same for goto labels, as the
+ user is probably the middle of "foo::bar". (Who
+ uses goto, anyway?)
+ */
+ if ( indentOfLine(bottomLine) <= indent )
+ indent -= ppIndentSize;
+ else
+ indent = indentOfLine( bottomLine );
+ }
+ }
+ }
+ delete yyProgram;
+ terminateIndenter();
+ return TQMAX( 0, indent );
+}
+
+#ifdef TQ_TEST_YYINDENT
+/*
+ Test driver.
+*/
+
+#include <tqfile.h>
+#include <tqtextstream.h>
+
+#include <errno.h>
+
+static TQString fileContents( const TQString& fileName )
+{
+ TQFile f( fileName );
+ if ( !f.open(IO_ReadOnly) ) {
+ qWarning( "yyindent error: Cannot open file '%s' for reading: %s",
+ fileName.latin1(), strerror(errno) );
+ return TQString();
+ }
+
+ TQTextStream t( &f );
+ TQString contents = t.read();
+ f.close();
+ if ( contents.isEmpty() )
+ qWarning( "yyindent error: File '%s' is empty", fileName.latin1() );
+ return contents;
+}
+
+int main( int argc, char **argv )
+{
+ if ( argc != 2 ) {
+ qWarning( "usage: yyindent file.cpp" );
+ return 1;
+ }
+
+ TQString code = fileContents( argv[1] );
+ TQStringList program = TQStringList::split( '\n', code, TRUE );
+ TQStringList p;
+ TQString out;
+
+ while ( !program.isEmpty() && program.last().stripWhiteSpace().isEmpty() )
+ program.remove( program.fromLast() );
+
+ TQStringList::ConstIterator line = program.begin();
+ while ( line != program.end() ) {
+ p.push_back( *line );
+ TQChar typedIn = firstNonWhiteSpace( *line );
+ if ( p.last().endsWith(":") )
+ typedIn = ':';
+
+ int indent = indentForBottomLine( p, typedIn );
+
+ if ( !(*line).stripWhiteSpace().isEmpty() ) {
+ for ( int j = 0; j < indent; j++ )
+ out += " ";
+ out += (*line).stripWhiteSpace();
+ }
+ out += "\n";
+ ++line;
+ }
+
+ while ( out.endsWith("\n") )
+ out.truncate( out.length() - 1 );
+
+ printf( "%s\n", out.latin1() );
+ return 0;
+}
+#endif
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.pro b/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.pro
new file mode 100644
index 0000000..a658372
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+unix {
+ UI_DIR = .ui
+ TQMOC_DIR = .tqmoc
+ OBJECTS_DIR = .obj
+}
+
+SOURCES += main.cpp
+FORMS = addressbook.ui addressdetails.ui search.ui
+IMAGES = images/filenew.png images/fileopen.png images/filesave.png images/searchfind.png images/editcut.png
+DBFILE = addressbook.db
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui b/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui
new file mode 100644
index 0000000..27078a6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui
@@ -0,0 +1,324 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>AddressBook</class>
+<widget class="TQMainWindow">
+ <property name="name">
+ <cstring>AddressBook</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Address Book</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListView">
+ <column>
+ <property name="text">
+ <string>Last Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>First Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Phone Number</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Street </string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>City</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Country</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Zip Code</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>addressView</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Extended</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <item text="&amp;File" name="fileMenu">
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <action name="fileSaveAsAction"/>
+ <separator/>
+ <action name="fileExitAction"/>
+ </item>
+ <item text="&amp;Edit" name="editMenu">
+ <action name="actionDeleteAddress"/>
+ <separator/>
+ <action name="editFindAction"/>
+ </item>
+</menubar>
+<toolbars>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>toolBar</cstring>
+ </property>
+ <property name="label">
+ <string>Tools</string>
+ </property>
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <separator/>
+ <action name="actionDeleteAddress"/>
+ <action name="editFindAction"/>
+ </toolbar>
+</toolbars>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>fileNewAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>filenew.png</iconset>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;New</string>
+ </property>
+ <property name="accel">
+ <number>4194382</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileOpenAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>fileopen.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Open...</string>
+ </property>
+ <property name="accel">
+ <number>4194383</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>filesave.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Save</string>
+ </property>
+ <property name="accel">
+ <number>4194387</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Save As</string>
+ </property>
+ <property name="menuText">
+ <string>Save &amp;As...</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileExitAction</cstring>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="menuText">
+ <string>E&amp;xit</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editFindAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>searchfind.png</iconset>
+ </property>
+ <property name="text">
+ <string>Find</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Find...</string>
+ </property>
+ <property name="accel">
+ <number>4194374</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionDeleteAddress</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>editcut.png</iconset>
+ </property>
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ </action>
+</actions>
+<connections>
+ <connection>
+ <sender>fileNewAction</sender>
+ <signal>activated()</signal>
+ <receiver>AddressBook</receiver>
+ <slot>fileNew()</slot>
+ </connection>
+ <connection>
+ <sender>fileOpenAction</sender>
+ <signal>activated()</signal>
+ <receiver>AddressBook</receiver>
+ <slot>fileOpen()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAction</sender>
+ <signal>activated()</signal>
+ <receiver>AddressBook</receiver>
+ <slot>fileSave()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAsAction</sender>
+ <signal>activated()</signal>
+ <receiver>AddressBook</receiver>
+ <slot>fileSaveAs()</slot>
+ </connection>
+ <connection>
+ <sender>fileExitAction</sender>
+ <signal>activated()</signal>
+ <receiver>AddressBook</receiver>
+ <slot>fileExit()</slot>
+ </connection>
+ <connection>
+ <sender>editFindAction</sender>
+ <signal>activated()</signal>
+ <receiver>AddressBook</receiver>
+ <slot>editFind()</slot>
+ </connection>
+ <connection>
+ <sender>actionDeleteAddress</sender>
+ <signal>activated()</signal>
+ <receiver>AddressBook</receiver>
+ <slot>deleteAddress()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">addressbook.ui.h</include>
+</includes>
+<variables>
+ <variable>QString currentFileName;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>fileNew()</slot>
+ <slot>insertAddress( const QString &amp; firstName, const QString &amp; lastName, const QString &amp; phoneNumber, const QString &amp; street, const QString &amp; city, const QString &amp; country, const QString &amp; zipCode )</slot>
+ <slot>deleteAddress()</slot>
+ <slot>fileOpen()</slot>
+ <slot>fileSave()</slot>
+ <slot>fileSaveAs()</slot>
+ <slot>fileExit()</slot>
+ <slot>editFind()</slot>
+ <slot>searchAddress( const QString &amp; expr )</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui.h b/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui.h
new file mode 100644
index 0000000..bd3c218
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/addressbook.ui.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename Q_SLOTS use TQt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include "addressdetails.h"
+#include "search.h"
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqfiledialog.h>
+#include <tqapplication.h>
+
+void AddressBook::fileNew()
+{
+ AddressDetails dia( this, 0, TRUE );
+ connect( &dia, TQT_SIGNAL( newAddress( const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString & ) ),
+ this, TQT_SLOT( insertAddress( const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString &,
+ const TQString & ) ) );
+ dia.exec();
+}
+
+void AddressBook::insertAddress( const TQString &firstName,
+ const TQString &lastName,
+ const TQString &phoneNumber,
+ const TQString &street,
+ const TQString &city,
+ const TQString &country,
+ const TQString &zipCode )
+{
+ TQListViewItem *i = new TQListViewItem( addressView );
+ i->setText( 0, firstName );
+ i->setText( 1, lastName );
+ i->setText( 2, phoneNumber );
+ i->setText( 3, street );
+ i->setText( 4, city );
+ i->setText( 5, country );
+ i->setText( 6, zipCode );
+}
+
+void AddressBook::deleteAddress()
+{
+ TQListViewItemIterator it( addressView );
+ while ( it.current() ) {
+ TQListViewItem *i = it.current();
+ ++it;
+ if ( i->isSelected() )
+ delete i;
+ }
+}
+
+void AddressBook::fileOpen()
+{
+ addressView->clear();
+ TQString fn = TQFileDialog::getOpenFileName();
+ if ( fn.isEmpty() )
+ return;
+ currentFileName = fn;
+ TQFile f( currentFileName );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQTextStream ts( &f );
+
+ while ( !ts.eof() ) {
+ TQListViewItem *item = new TQListViewItem( addressView );
+ for ( int i = 0; i < 7; ++i )
+ item->setText( i, ts.readLine() );
+ }
+
+}
+
+void AddressBook::fileSave()
+{
+ if ( currentFileName.isEmpty() )
+ fileSaveAs();
+ TQFile f( currentFileName );
+ if ( !f.open( IO_WriteOnly ) )
+ return;
+ TQTextStream ts( &f );
+
+ TQListViewItemIterator it( addressView );
+ while ( it.current() ) {
+ for ( int i = 0; i < 7; ++i )
+ ts << it.current()->text( i ) << endl;
+ ++it;
+ }
+
+ f.close();
+}
+
+void AddressBook::fileSaveAs()
+{
+ TQString fn = TQFileDialog::getSaveFileName();
+ if ( fn.isEmpty() )
+ return;
+ currentFileName = fn;
+ fileSave();
+}
+
+void AddressBook::fileExit()
+{
+ tqApp->exit();
+}
+
+void AddressBook::editFind()
+{
+ SearchDialog dia( this, 0, TRUE );
+ connect( &dia, TQT_SIGNAL( searchAddress( const TQString & ) ),
+ this, TQT_SLOT( searchAddress( const TQString & ) ) );
+ dia.exec();
+}
+
+void AddressBook::searchAddress( const TQString &expr )
+{
+ addressView->clearSelection();
+ TQListViewItemIterator it( addressView );
+ while ( it.current() ) {
+ for ( int i = 0; i < 7; ++i ) {
+ if ( it.current()->text( i ).tqfind( expr ) != -1 )
+ addressView->setSelected( it.current(), TRUE );
+ }
+ ++it;
+ }
+} \ No newline at end of file
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui b/tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui
new file mode 100644
index 0000000..46963e6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui
@@ -0,0 +1,243 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>AddressDetails</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>AddressDetails</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>216</width>
+ <height>252</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Enter Address</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel8</cstring>
+ </property>
+ <property name="text">
+ <string>Street</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>editStreet</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editPhoneNumber</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property name="text">
+ <string>City</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Last Name</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel6</cstring>
+ </property>
+ <property name="text">
+ <string>Phone Number</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="5" column="1">
+ <property name="name">
+ <cstring>editCountry</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="6" column="0">
+ <property name="name">
+ <cstring>TextLabel10</cstring>
+ </property>
+ <property name="text">
+ <string>Zip Code</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editLastName</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="6" column="1">
+ <property name="name">
+ <cstring>editZipCode</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>First Name</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>editCity</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel9</cstring>
+ </property>
+ <property name="text">
+ <string>Country</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>editFirstName</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>AddressDetails</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>AddressDetails</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>editLastName</tabstop>
+ <tabstop>editFirstName</tabstop>
+ <tabstop>editPhoneNumber</tabstop>
+ <tabstop>editStreet</tabstop>
+ <tabstop>editCity</tabstop>
+ <tabstop>editCountry</tabstop>
+ <tabstop>editZipCode</tabstop>
+ <tabstop>PushButton2</tabstop>
+ <tabstop>PushButton3</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">addressdetails.ui.h</include>
+</includes>
+<Q_SIGNALS>
+ <signal>newAddress( const QString &amp;, const QString &amp;, const QString &amp;, const QString &amp;, const QString &amp;, const QString &amp;, const QString &amp; );</signal>
+</Q_SIGNALS>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>okClicked()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui.h b/tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui.h
new file mode 100644
index 0000000..66047a7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/addressdetails.ui.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename Q_SLOTS use TQt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+void AddressDetails::init()
+{
+ editLastName->setFocus();
+}
+
+void AddressDetails::okClicked()
+{
+ emit newAddress( editLastName->text(),
+ editFirstName->text(),
+ editPhoneNumber->text(),
+ editStreet->text(),
+ editCity->text(),
+ editCountry->text(),
+ editZipCode->text() );
+ close();
+} \ No newline at end of file
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/images/editcut.png b/tqtinterface/qt4/tools/designer/examples/addressbook/images/editcut.png
new file mode 100644
index 0000000..9c7fb3c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/images/editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/images/filenew.png b/tqtinterface/qt4/tools/designer/examples/addressbook/images/filenew.png
new file mode 100644
index 0000000..d898107
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/images/filenew.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/images/fileopen.png b/tqtinterface/qt4/tools/designer/examples/addressbook/images/fileopen.png
new file mode 100644
index 0000000..7e49adb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/images/fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/images/filesave.png b/tqtinterface/qt4/tools/designer/examples/addressbook/images/filesave.png
new file mode 100644
index 0000000..77d9f50
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/images/filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/images/searchfind.png b/tqtinterface/qt4/tools/designer/examples/addressbook/images/searchfind.png
new file mode 100644
index 0000000..f18b029
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/images/searchfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/main.cpp b/tqtinterface/qt4/tools/designer/examples/addressbook/main.cpp
new file mode 100644
index 0000000..57c9ced
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/main.cpp
@@ -0,0 +1,11 @@
+#include <tqapplication.h>
+#include "addressbook.h"
+
+int main( int argc, char ** argv )
+{
+ TQApplication a( argc, argv );
+ AddressBook *w = new AddressBook;
+ w->show();
+ a.connect( &a, TQT_SIGNAL( lastWindowClosed() ), &a, TQT_SLOT( quit() ) );
+ return a.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/search.ui b/tqtinterface/qt4/tools/designer/examples/addressbook/search.ui
new file mode 100644
index 0000000..4dd1386
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/search.ui
@@ -0,0 +1,136 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>SearchDialog</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>SearchDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>216</width>
+ <height>76</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Search</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel12</cstring>
+ </property>
+ <property name="text">
+ <string>Search</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>editSearch</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>Search</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton5</cstring>
+ </property>
+ <property name="text">
+ <string>Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton5</sender>
+ <signal>clicked()</signal>
+ <receiver>SearchDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>SearchDialog</receiver>
+ <slot>search()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">search.ui.h</include>
+</includes>
+<Q_SIGNALS>
+ <signal>searchAddress( const QString &amp; )</signal>
+</Q_SIGNALS>
+<Q_SLOTS>
+ <slot>search()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/addressbook/search.ui.h b/tqtinterface/qt4/tools/designer/examples/addressbook/search.ui.h
new file mode 100644
index 0000000..47cab31
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/addressbook/search.ui.h
@@ -0,0 +1,13 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename Q_SLOTS use TQt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+void SearchDialog::search()
+{
+ emit searchAddress( editSearch->text() );
+ close();
+} \ No newline at end of file
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book.sql b/tqtinterface/qt4/tools/designer/examples/book/book.sql
new file mode 100644
index 0000000..a92daac
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book.sql
@@ -0,0 +1,42 @@
+-- The following SQL generates the database
+-- used by the 'book' example programs
+--** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+--
+-- This file is part of an example program for Qt. This example
+-- program may be used, distributed and modified without limitation.
+
+DROP TABLE author;
+DROP TABLE book;
+DROP TABLE sequence;
+
+CREATE TABLE author
+( id integer primary key,
+forename varchar(40),
+surname varchar(40) );
+
+CREATE TABLE book
+( id integer primary key,
+title varchar(40),
+price numeric(10,2),
+authorid integer,
+notes varchar(255) );
+
+create index book_authorid_idx on book( authorid );
+
+CREATE TABLE sequence
+( tablename varchar(10),
+sequence numeric);
+
+INSERT INTO author VALUES ( 0, 'Philip K', 'Dick' );
+INSERT INTO author VALUES ( 1, 'Robert', 'Heinlein' );
+INSERT INTO author VALUES ( 2, 'Sarah', 'Paretsky' );
+
+INSERT INTO book VALUES ( 0, 'The Man Who Japed', 6.99, 0, 'A good book' );
+INSERT INTO book VALUES ( 1, 'The Man in the High Castle', 9.99, 0, 'Worth reading' );
+INSERT INTO book VALUES ( 2, 'The Number of the Beast', 8.99, 1, 'Get this!' );
+INSERT INTO book VALUES ( 3, 'Indemnity Only', 9.99, 2, 'Cool' );
+INSERT INTO book VALUES ( 4, 'Burn Marks', 9.99, 2, 'Need to make notes' );
+INSERT INTO book VALUES ( 5, 'Deadlock', 9.99, 2, 'Hmmm..' );
+
+INSERT INTO sequence VALUES ( 'author', 2 );
+INSERT INTO sequence VALUES ( 'book', 5 );
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui
new file mode 100644
index 0000000..40fac0e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui
@@ -0,0 +1,71 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>584</width>
+ <height>472</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorcDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui.h
new file mode 100644
index 0000000..d727860
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book1/book.ui.h
@@ -0,0 +1,5 @@
+void BookForm::primeInsertAuthor( TQSqlRecord * )
+{
+
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/book1.pro b/tqtinterface/qt4/tools/designer/examples/book/book1/book1.pro
new file mode 100644
index 0000000..a7e1f7b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book1/book1.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book1/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book1/main.cpp
new file mode 100644
index 0000000..d244790
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book1/main.cpp
@@ -0,0 +1,27 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui
new file mode 100644
index 0000000..1e91d13
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui
@@ -0,0 +1,77 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>576</width>
+ <height>468</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorcDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>AuthorcDataTable</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>primeInsertAuthor(QSqlRecord*)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui.h
new file mode 100644
index 0000000..3295581
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book2/book.ui.h
@@ -0,0 +1,10 @@
+void BookForm::primeInsertAuthor( TQSqlRecord * buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/book2.pro b/tqtinterface/qt4/tools/designer/examples/book/book2/book2.pro
new file mode 100644
index 0000000..a7e1f7b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book2/book2.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book2/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book2/main.cpp
new file mode 100644
index 0000000..d244790
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book2/main.cpp
@@ -0,0 +1,27 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui
new file mode 100644
index 0000000..ece1235
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui
@@ -0,0 +1,141 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>566</width>
+ <height>464</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSplitter">
+ <property name="name">
+ <cstring>Splitter1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ <property name="field">
+ <string>title</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ <property name="field">
+ <string>price</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="field">
+ <string>notes</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>BookDataTable</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>currentChanged(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>newCurrentAuthor(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>primeInsertAuthor(QSqlRecord*)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui.h
new file mode 100644
index 0000000..707ee90
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book3/book.ui.h
@@ -0,0 +1,16 @@
+void BookForm::newCurrentAuthor( TQSqlRecord *author )
+{
+ BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() );
+ BookDataTable->refresh();
+}
+
+void BookForm::primeInsertAuthor( TQSqlRecord *buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/book3.pro b/tqtinterface/qt4/tools/designer/examples/book/book3/book3.pro
new file mode 100644
index 0000000..a7e1f7b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book3/book3.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book3/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book3/main.cpp
new file mode 100644
index 0000000..1e0f042
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book3/main.cpp
@@ -0,0 +1,27 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui
new file mode 100644
index 0000000..d39d271
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui
@@ -0,0 +1,179 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>546</width>
+ <height>532</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSplitter">
+ <property name="name">
+ <cstring>Splitter1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ <property name="field">
+ <string>title</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ <property name="field">
+ <string>price</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="field">
+ <string>notes</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>BookDataTable</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>EditPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Books</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>QuitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>currentChanged(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>newCurrentAuthor(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>primeInsertAuthor(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>QuitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui.h
new file mode 100644
index 0000000..730cafe
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book4/book.ui.h
@@ -0,0 +1,16 @@
+void BookForm::newCurrentAuthor( TQSqlRecord * author )
+{
+ BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() );
+ BookDataTable->refresh();
+}
+
+void BookForm::primeInsertAuthor( TQSqlRecord * buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/book4.pro b/tqtinterface/qt4/tools/designer/examples/book/book4/book4.pro
new file mode 100644
index 0000000..a7e1f7b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book4/book4.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book4/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book4/main.cpp
new file mode 100644
index 0000000..f611d3d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book4/main.cpp
@@ -0,0 +1,29 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui
new file mode 100644
index 0000000..399e7fd
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui
@@ -0,0 +1,188 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="local" impldecl="in declaration">qdatabrowser.h</include>
+<include location="local" impldecl="in declaration">editbook.h</include>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>530</width>
+ <height>524</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSplitter">
+ <property name="name">
+ <cstring>Splitter1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ <property name="field">
+ <string>title</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ <property name="field">
+ <string>price</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="field">
+ <string>notes</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>BookDataTable</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>EditPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Books</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>QuitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>QuitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>EditPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>editClicked()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>primeInsertAuthor(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>currentChanged(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>newCurrentAuthor(QSqlRecord*)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui.h
new file mode 100644
index 0000000..c41fa17
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book5/book.ui.h
@@ -0,0 +1,23 @@
+void BookForm::editClicked()
+{
+ EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE );
+ dialog->exec();
+ delete dialog;
+}
+
+void BookForm::newCurrentAuthor( TQSqlRecord *author )
+{
+ BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() );
+ BookDataTable->refresh();
+}
+
+void BookForm::primeInsertAuthor( TQSqlRecord *buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/book5.pro b/tqtinterface/qt4/tools/designer/examples/book/book5/book5.pro
new file mode 100644
index 0000000..030db5f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book5/book5.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui editbook.ui
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui
new file mode 100644
index 0000000..70a6df0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui
@@ -0,0 +1,291 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EditBookForm</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>EditBookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>568</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Books</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQDataBrowser">
+ <property name="name">
+ <cstring>BookDataBrowser</cstring>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ <property name="frameworkCode" stdset="0">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>labelPrice</cstring>
+ </property>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelTitle</cstring>
+ </property>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>QLineEditTitle</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>title</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>QLineEditPrice</cstring>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>price</string>
+ </stringlist>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonFirst</cstring>
+ </property>
+ <property name="text">
+ <string>|&lt; &amp;First</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonPrev</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;&lt; &amp;Prev</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonNext</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Next &gt;&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonLast</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Last &gt;|</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonUpdate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Update</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonClose</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButtonFirst</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>first()</slot>
+ </connection>
+ <connection>
+ <sender>BookDataBrowser</sender>
+ <signal>firstRecordAvailable( bool )</signal>
+ <receiver>PushButtonFirst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>PushButtonPrev</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>prev()</slot>
+ </connection>
+ <connection>
+ <sender>BookDataBrowser</sender>
+ <signal>prevRecordAvailable( bool )</signal>
+ <receiver>PushButtonPrev</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>PushButtonNext</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection>
+ <sender>BookDataBrowser</sender>
+ <signal>nextRecordAvailable( bool )</signal>
+ <receiver>PushButtonNext</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>PushButtonLast</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>last()</slot>
+ </connection>
+ <connection>
+ <sender>BookDataBrowser</sender>
+ <signal>lastRecordAvailable( bool )</signal>
+ <receiver>PushButtonLast</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>PushButtonInsert</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>insert()</slot>
+ </connection>
+ <connection>
+ <sender>PushButtonUpdate</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>update()</slot>
+ </connection>
+ <connection>
+ <sender>PushButtonDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>del()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">editbook.ui.h</include>
+</includes>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui.h
new file mode 100644
index 0000000..4a8a636
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book5/editbook.ui.h
@@ -0,0 +1,10 @@
+void EditBookForm::init()
+{
+
+}
+
+void EditBookForm::destroy()
+{
+
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book5/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book5/main.cpp
new file mode 100644
index 0000000..d244790
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book5/main.cpp
@@ -0,0 +1,27 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui
new file mode 100644
index 0000000..9fc5992
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui
@@ -0,0 +1,189 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="global" impldecl="in declaration">qsqlrecord.h</include>
+<include location="local" impldecl="in declaration">editbook.h</include>
+<include location="global" impldecl="in declaration">qdatabrowser.h</include>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>494</width>
+ <height>506</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSplitter">
+ <property name="name">
+ <cstring>Splitter1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ <property name="field">
+ <string>title</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ <property name="field">
+ <string>price</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="field">
+ <string>notes</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>BookDataTable</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>EditPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Books</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>QuitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>QuitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>EditPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>editClicked()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>primeInsertAuthor(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>currentChanged(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>newCurrentAuthor(QSqlRecord*)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui.h
new file mode 100644
index 0000000..fe0b39d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book6/book.ui.h
@@ -0,0 +1,33 @@
+void BookForm::editClicked()
+{
+ EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE );
+ TQSqlCursor cur( "book" );
+ dialog->BookDataBrowser->setSqlCursor( &cur );
+ dialog->BookDataBrowser->setFilter( BookDataTable->filter() );
+ dialog->BookDataBrowser->setSort(TQSqlIndex::fromStringList(
+ BookDataTable->sort(), &cur ) );
+ dialog->BookDataBrowser->refresh();
+ int i = BookDataTable->currentRow();
+ if ( i == -1 ) i = 0; // Always use the first row
+ dialog->BookDataBrowser->seek( i );
+ dialog->exec();
+ delete dialog;
+ BookDataTable->refresh();
+}
+
+void BookForm::newCurrentAuthor( TQSqlRecord * author )
+{
+ BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() );
+ BookDataTable->refresh();
+}
+
+void BookForm::primeInsertAuthor( TQSqlRecord * buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/book6.pro b/tqtinterface/qt4/tools/designer/examples/book/book6/book6.pro
new file mode 100644
index 0000000..030db5f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book6/book6.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui editbook.ui
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui
new file mode 100644
index 0000000..abbab27
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui
@@ -0,0 +1,300 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EditBookForm</class>
+<include location="global" impldecl="in declaration">qsqlrecord.h</include>
+<include location="local" implDecl="in declaration">editbook.ui.h</include>
+<forward>class QSqlRecord;</forward>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>EditBookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>536</width>
+ <height>285</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Books</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQDataBrowser">
+ <property name="name">
+ <cstring>BookDataBrowser</cstring>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ <property name="frameworkCode" stdset="0">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>labelPrice</cstring>
+ </property>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelTitle</cstring>
+ </property>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>QLineEditTitle</cstring>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>title</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>QLineEditPrice</cstring>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>price</string>
+ </stringlist>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonFirst</cstring>
+ </property>
+ <property name="text">
+ <string>|&lt; &amp;First</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonPrev</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;&lt; &amp;Prev</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonNext</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Next &gt;&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonLast</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Last &gt;|</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonUpdate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Update</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonClose</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>PushButtonFirst</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>first()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>firstRecordAvailable( bool )</signal>
+ <receiver>PushButtonFirst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonPrev</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>prev()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>prevRecordAvailable( bool )</signal>
+ <receiver>PushButtonPrev</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonNext</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>nextRecordAvailable( bool )</signal>
+ <receiver>PushButtonNext</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonLast</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>last()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>lastRecordAvailable( bool )</signal>
+ <receiver>PushButtonLast</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonInsert</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>insert()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonUpdate</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>update()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>del()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>primeInsertBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonClose</sender>
+ <signal>clicked()</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertBook( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui.h
new file mode 100644
index 0000000..28d5035
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book6/editbook.ui.h
@@ -0,0 +1,10 @@
+void EditBookForm::primeInsertBook( TQSqlRecord * buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='book';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='book';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book6/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book6/main.cpp
new file mode 100644
index 0000000..d244790
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book6/main.cpp
@@ -0,0 +1,27 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui
new file mode 100644
index 0000000..cc6f1d8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui
@@ -0,0 +1,189 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="global" impldecl="in declaration">qsqlrecord.h</include>
+<include location="local" impldecl="in declaration">editbook.h</include>
+<include location="global" impldecl="in declaration">qdatabrowser.h</include>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>490</width>
+ <height>504</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSplitter">
+ <property name="name">
+ <cstring>Splitter1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ <property name="field">
+ <string>title</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ <property name="field">
+ <string>price</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="field">
+ <string>notes</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>BookDataTable</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>EditPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Books</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>QuitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>QuitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>EditPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>editClicked()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>primeInsertAuthor(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>currentChanged(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>newCurrentAuthor(QSqlRecord*)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui.h
new file mode 100644
index 0000000..1cb2f0b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book7/book.ui.h
@@ -0,0 +1,33 @@
+void BookForm::editClicked()
+{
+ EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE );
+ TQSqlCursor cur( "book" );
+ dialog->BookDataBrowser->setSqlCursor( &cur );
+ dialog->BookDataBrowser->setFilter( BookDataTable->filter() );
+ dialog->BookDataBrowser->setSort(TQSqlIndex::fromStringList(
+ BookDataTable->sort(), &cur ) );
+ dialog->BookDataBrowser->refresh();
+ int i = BookDataTable->currentRow();
+ if ( i == -1 ) i = 0; // Always use the first row
+ dialog->BookDataBrowser->seek( i );
+ dialog->exec();
+ delete dialog;
+ BookDataTable->refresh();
+}
+
+void BookForm::newCurrentAuthor( TQSqlRecord *author )
+{
+ BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() );
+ BookDataTable->refresh();
+}
+
+void BookForm::primeInsertAuthor( TQSqlRecord *buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='author';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/book7.pro b/tqtinterface/qt4/tools/designer/examples/book/book7/book7.pro
new file mode 100644
index 0000000..22c7e9b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book7/book7.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui editbook.ui
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui
new file mode 100644
index 0000000..c8bf0bf
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui
@@ -0,0 +1,384 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EditBookForm</class>
+<include location="global" impldecl="in declaration">qsqlrecord.h</include>
+<include location="local" implDecl="in declaration">editbook.ui.h</include>
+<forward>class QSqlRecord;</forward>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>EditBookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>528</width>
+ <height>305</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Books</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQDataBrowser">
+ <property name="name">
+ <cstring>BookDataBrowser</cstring>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ <property name="frameworkCode" stdset="0">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>labelPrice</cstring>
+ </property>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelTitle</cstring>
+ </property>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>QLineEditTitle</cstring>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>title</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>QLineEditPrice</cstring>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>price</string>
+ </stringlist>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonUpdate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Update</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonClose</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonFirst</cstring>
+ </property>
+ <property name="text">
+ <string>|&lt; &amp;First</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonPrev</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;&lt; &amp;Prev</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonNext</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Next &gt;&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonLast</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Last &gt;|</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Author</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>ComboBoxAuthor</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author_view</string>
+ <string>name</string>
+ </stringlist>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>PushButtonFirst</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>first()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>firstRecordAvailable( bool )</signal>
+ <receiver>PushButtonFirst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonPrev</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>prev()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>prevRecordAvailable( bool )</signal>
+ <receiver>PushButtonPrev</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonNext</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>nextRecordAvailable( bool )</signal>
+ <receiver>PushButtonNext</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonLast</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>last()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>lastRecordAvailable( bool )</signal>
+ <receiver>PushButtonLast</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonInsert</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>insert()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonUpdate</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>update()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>del()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonClose</sender>
+ <signal>clicked()</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>primeUpdate(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>primeUpdateBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>beforeUpdate(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>beforeUpdateBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>beforeInsert(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>beforeUpdateBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>primeInsertBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>primeInsertBook(QSqlRecord*)</slot>
+ </connection>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">init()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">beforeUpdateBook( QSqlRecord * buffer )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertBook( QSqlRecord * buffer )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeUpdateBook( QSqlRecord * buffer )</slot>
+</connections>
+<tabstops>
+ <tabstop>QLineEditTitle</tabstop>
+ <tabstop>QLineEditPrice</tabstop>
+ <tabstop>ComboBoxAuthor</tabstop>
+ <tabstop>PushButtonFirst</tabstop>
+ <tabstop>PushButtonPrev</tabstop>
+ <tabstop>PushButtonNext</tabstop>
+ <tabstop>PushButtonLast</tabstop>
+ <tabstop>PushButtonInsert</tabstop>
+ <tabstop>PushButtonUpdate</tabstop>
+ <tabstop>PushButtonDelete</tabstop>
+ <tabstop>PushButtonClose</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui.h
new file mode 100644
index 0000000..0bedf8b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book7/editbook.ui.h
@@ -0,0 +1,42 @@
+void EditBookForm::init()
+{
+ TQSqlQuery query( "SELECT surname FROM author ORDER BY surname;" );
+ while ( query.next() )
+ ComboBoxAuthor->insertItem( query.value( 0 ).toString());
+}
+
+void EditBookForm::beforeUpdateBook( TQSqlRecord * buffer )
+{
+ TQSqlQuery query( "SELECT id FROM author WHERE surname ='" +
+ ComboBoxAuthor->currentText() + "';" );
+ if ( query.next() )
+ buffer->setValue( "authorid", query.value( 0 ) );
+}
+
+void EditBookForm::primeInsertBook( TQSqlRecord * buffer )
+{
+ TQSqlQuery query;
+ query.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='book';" );
+ query.exec( "SELECT sequence FROM sequence WHERE tablename='book';" );
+ if ( query.next() ) {
+ buffer->setValue( "id", query.value( 0 ) );
+ }
+}
+
+void EditBookForm::primeUpdateBook( TQSqlRecord * buffer )
+{
+ // Who is this book's author?
+ TQSqlQuery query( "SELECT surname FROM author WHERE id='" +
+ buffer->value( "authorid" ).toString() + "';" );
+ TQString author = "";
+ if ( query.next() )
+ author = query.value( 0 ).toString();
+ // Set the ComboBox to the right author
+ for ( int i = 0; i < ComboBoxAuthor->count(); i++ ) {
+ if ( ComboBoxAuthor->text( i ) == author ) {
+ ComboBoxAuthor->setCurrentItem( i ) ;
+ break;
+ }
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book7/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book7/main.cpp
new file mode 100644
index 0000000..d244790
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book7/main.cpp
@@ -0,0 +1,27 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui b/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui
new file mode 100644
index 0000000..cc6f1d8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui
@@ -0,0 +1,189 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BookForm</class>
+<include location="global" impldecl="in declaration">qsqlrecord.h</include>
+<include location="local" impldecl="in declaration">editbook.h</include>
+<include location="global" impldecl="in declaration">qdatabrowser.h</include>
+<include location="local" implDecl="in declaration">book.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>BookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>490</width>
+ <height>504</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Book</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSplitter">
+ <property name="name">
+ <cstring>Splitter1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Surname</string>
+ </property>
+ <property name="field">
+ <string>surname</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Forename</string>
+ </property>
+ <property name="field">
+ <string>forename</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>AuthorDataTable</cstring>
+ </property>
+ <property name="confirmDelete">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>surname ASC</string>
+ <string>forename ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQDataTable">
+ <column>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ <property name="field">
+ <string>title</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ <property name="field">
+ <string>price</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="field">
+ <string>notes</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>BookDataTable</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>EditPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Books</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>QuitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>QuitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>EditPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>BookForm</receiver>
+ <slot>editClicked()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>primeInsertAuthor(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>AuthorDataTable</sender>
+ <signal>currentChanged(QSqlRecord*)</signal>
+ <receiver>BookForm</receiver>
+ <slot>newCurrentAuthor(QSqlRecord*)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">editClicked()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">newCurrentAuthor( QSqlRecord * author )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertAuthor( QSqlRecord * buffer )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui.h
new file mode 100644
index 0000000..24bb69c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book8/book.ui.h
@@ -0,0 +1,33 @@
+void BookForm::editClicked()
+{
+ EditBookForm *dialog = new EditBookForm( this, "Edit Book Form", TRUE );
+ TQSqlCursor cur( "book" );
+ dialog->BookDataBrowser->setSqlCursor( &cur );
+ dialog->BookDataBrowser->setFilter( BookDataTable->filter() );
+ dialog->BookDataBrowser->setSort(TQSqlIndex::fromStringList(
+ BookDataTable->sort(), &cur ) );
+ dialog->BookDataBrowser->refresh();
+ int i = BookDataTable->currentRow();
+ if ( i == -1 ) i = 0; // Always use the first row
+ dialog->BookDataBrowser->seek( i );
+ dialog->exec();
+ delete dialog;
+ BookDataTable->refresh();
+}
+
+void BookForm::newCurrentAuthor( TQSqlRecord *author )
+{
+ BookDataTable->setFilter( "authorid=" + author->value( "id" ).toString() );
+ BookDataTable->refresh();
+}
+
+void BookForm::primeInsertAuthor( TQSqlRecord *buffer )
+{
+ TQSqlQuery q;
+ q.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='author';" );
+ q.exec( "SELECT sequence FROM sequence WHERE tablename='author';" );
+ if ( q.next() ) {
+ buffer->setValue( "id", q.value( 0 ) );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/book8.pro b/tqtinterface/qt4/tools/designer/examples/book/book8/book8.pro
new file mode 100644
index 0000000..e4bdf75
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book8/book8.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+SOURCES += main.cpp ../connection.cpp
+FORMS = book.ui editbook.ui
+CONFIG += qt warn_on release
+DBFILE = book.db
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui b/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui
new file mode 100644
index 0000000..f4c2cba
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui
@@ -0,0 +1,386 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EditBookForm</class>
+<include location="global" impldecl="in declaration">qsqlrecord.h</include>
+<include location="local" implDecl="in declaration">editbook.ui.h</include>
+<forward>class QSqlRecord;</forward>
+<variable>QMap&lt;QString,int&gt; authorMap;</variable>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>EditBookForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>520</width>
+ <height>369</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Books</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQDataBrowser">
+ <property name="name">
+ <cstring>BookDataBrowser</cstring>
+ </property>
+ <property name="sort">
+ <stringlist>
+ <string>title ASC</string>
+ </stringlist>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ </stringlist>
+ </property>
+ <property name="frameworkCode" stdset="0">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>labelPrice</cstring>
+ </property>
+ <property name="text">
+ <string>Price</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelTitle</cstring>
+ </property>
+ <property name="text">
+ <string>Title</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>QLineEditTitle</cstring>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>title</string>
+ </stringlist>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>QLineEditPrice</cstring>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>book</string>
+ <string>price</string>
+ </stringlist>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonUpdate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Update</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonClose</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonFirst</cstring>
+ </property>
+ <property name="text">
+ <string>|&lt; &amp;First</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonPrev</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;&lt; &amp;Prev</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonNext</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Next &gt;&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButtonLast</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Last &gt;|</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Author</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>ComboBoxAuthor</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="database" stdset="0">
+ <stringlist>
+ <string>(default)</string>
+ <string>author_view</string>
+ <string>name</string>
+ </stringlist>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>PushButtonFirst</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>first()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>firstRecordAvailable( bool )</signal>
+ <receiver>PushButtonFirst</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonPrev</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>prev()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>prevRecordAvailable( bool )</signal>
+ <receiver>PushButtonPrev</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonNext</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>nextRecordAvailable( bool )</signal>
+ <receiver>PushButtonNext</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonLast</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>last()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>lastRecordAvailable( bool )</signal>
+ <receiver>PushButtonLast</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonInsert</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>insert()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonUpdate</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>update()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>BookDataBrowser</receiver>
+ <slot>del()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButtonClose</sender>
+ <signal>clicked()</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>primeUpdate(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>primeUpdateBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>beforeUpdate(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>beforeUpdateBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>beforeInsert(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>beforeUpdateBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>primeInsertBook(QSqlRecord*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>BookDataBrowser</sender>
+ <signal>primeInsert(QSqlRecord*)</signal>
+ <receiver>EditBookForm</receiver>
+ <slot>primeInsertBook(QSqlRecord*)</slot>
+ </connection>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">init()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">beforeUpdateBook( QSqlRecord * buffer )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">mapAuthor( const QString &amp; name, int &amp; id, bool populate )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeInsertBook( QSqlRecord * buffer )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">primeUpdateBook( QSqlRecord * buffer )</slot>
+</connections>
+<tabstops>
+ <tabstop>QLineEditTitle</tabstop>
+ <tabstop>QLineEditPrice</tabstop>
+ <tabstop>ComboBoxAuthor</tabstop>
+ <tabstop>PushButtonFirst</tabstop>
+ <tabstop>PushButtonPrev</tabstop>
+ <tabstop>PushButtonNext</tabstop>
+ <tabstop>PushButtonLast</tabstop>
+ <tabstop>PushButtonInsert</tabstop>
+ <tabstop>PushButtonUpdate</tabstop>
+ <tabstop>PushButtonDelete</tabstop>
+ <tabstop>PushButtonClose</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui.h b/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui.h
new file mode 100644
index 0000000..12e6eb6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book8/editbook.ui.h
@@ -0,0 +1,47 @@
+void EditBookForm::init()
+{
+ TQSqlQuery query( "SELECT surname, id FROM author ORDER BY surname;" );
+ while ( query.next() ) {
+ ComboBoxAuthor->insertItem( query.value( 0 ).toString() );
+ int id = query.value( 1 ).toInt();
+ mapAuthor( query.value( 0 ).toString(), id, TRUE );
+ }
+}
+
+void EditBookForm::beforeUpdateBook( TQSqlRecord * buffer )
+{
+ int id;
+ mapAuthor( ComboBoxAuthor->currentText(), id, FALSE );
+ buffer->setValue( "authorid", id );
+}
+
+void EditBookForm::mapAuthor( const TQString & name, int & id, bool populate )
+{
+ if ( populate )
+ authorMap[ name ] = id;
+ else
+ id = authorMap[ name ];
+}
+
+void EditBookForm::primeInsertBook( TQSqlRecord * buffer )
+{
+ TQSqlQuery q;
+ q.exec( "UPDATE sequence SET sequence = sequence + 1 WHERE tablename='book';" );
+ q.exec( "SELECT sequence FROM sequence WHERE tablename='book';" );
+ if ( q.next() ) {
+ buffer->setValue( "id", q.value( 0 ) );
+ }
+}
+
+void EditBookForm::primeUpdateBook( TQSqlRecord * buffer )
+{
+ int id = buffer->value( "authorid" ).toInt();
+ for ( int i = 0; i < ComboBoxAuthor->count(); i++ ) {
+ TQString author = ComboBoxAuthor->text( i );
+ if ( authorMap.tqcontains( author ) && authorMap[author] == id ) {
+ ComboBoxAuthor->setCurrentItem( i ) ;
+ break;
+ }
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/book8/main.cpp b/tqtinterface/qt4/tools/designer/examples/book/book8/main.cpp
new file mode 100644
index 0000000..d244790
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/book8/main.cpp
@@ -0,0 +1,27 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include <tqsqldatabase.h>
+#include "book.h"
+#include "../connection.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ if ( ! createConnections() )
+ return 1;
+
+ BookForm bookForm;
+ app.setMainWidget( &bookForm );
+ bookForm.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/book/connection.cpp b/tqtinterface/qt4/tools/designer/examples/book/connection.cpp
new file mode 100644
index 0000000..190d4fc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/connection.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+#include <tqsqldatabase.h>
+#include "connection.h"
+
+bool createConnections()
+{
+ // create the default database connection
+ TQSqlDatabase *defaultDB = TQSqlDatabase::addDatabase( DB_BOOKS_DRIVER );
+ defaultDB->setDatabaseName( DB_BOOKS );
+ defaultDB->setUserName( DB_BOOKS_USER );
+ defaultDB->setPassword( DB_BOOKS_PASSWD );
+ defaultDB->setHostName( DB_BOOKS_HOST );
+ if ( ! defaultDB->open() ) {
+ qWarning( "Failed to open books database: " +
+ defaultDB->lastError().driverText() );
+ qWarning( defaultDB->lastError().databaseText() );
+ return FALSE;
+ }
+
+ TQSqlQuery q(TQString(), defaultDB);
+ q.exec("CREATE TABLE author ( id integer primary key, "
+ "forename varchar(40), surname varchar(40) )");
+ q.exec("CREATE TABLE book ( id integer primary key, "
+ "title varchar(40), price numeric(10,2), authorid integer, notes varchar(255) )");
+
+ q.exec("CREATE TABLE sequence ( tablename varchar(10), sequence numeric)");
+
+ q.exec("INSERT INTO author VALUES ( 0, 'Philip K', 'Dick' )");
+ q.exec("INSERT INTO author VALUES ( 1, 'Robert', 'Heinlein' )");
+ q.exec("INSERT INTO author VALUES ( 2, 'Sarah', 'Paretsky' )");
+
+ q.exec("INSERT INTO book VALUES (0, 'The Man Who Japed', 6.99, 0, 'A good book' )");
+ q.exec("INSERT INTO book VALUES (1, 'The Man in the High Castle', 9.99, 0, 'Worth reading' )");
+ q.exec("INSERT INTO book VALUES ( 2, 'The Number of the Beast', 8.99, 1, 'Get this!' )");
+ q.exec("INSERT INTO book VALUES ( 3, 'Indemnity Only', 9.99, 2, 'Cool' )");
+ q.exec("INSERT INTO book VALUES ( 4, 'Burn Marks', 9.99, 2, 'Need to make notes' )");
+ q.exec("INSERT INTO book VALUES ( 5, 'Deadlock', 9.99, 2, 'Hmmm..' )");
+
+ q.exec("INSERT INTO sequence VALUES ( 'author', 2 )");
+ q.exec("INSERT INTO sequence VALUES ( 'book', 5 )");
+
+ return TRUE;
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/book/connection.h b/tqtinterface/qt4/tools/designer/examples/book/connection.h
new file mode 100644
index 0000000..dc71cb4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/book/connection.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+// Add your own connection parameters here
+#define DB_BOOKS_DRIVER "TQSQLITE"
+#define DB_BOOKS ":memory:"
+#define DB_BOOKS_USER ""
+#define DB_BOOKS_PASSWD ""
+#define DB_BOOKS_HOST ""
+
+bool createConnections();
+
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui b/tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui
new file mode 100644
index 0000000..6a5a1f1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui
@@ -0,0 +1,168 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ColorNameForm</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ColorNameForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>348</width>
+ <height>105</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Color Tool -- Color Name</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>colorLabel</cstring>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>80</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>editraise.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colorLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>colorLineEdit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>11</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>okPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>cancelPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ColorNameForm</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>okPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ColorNameForm</receiver>
+ <slot>validate()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">colornameform.ui.h</include>
+</includes>
+<Q_SLOTS>
+ <slot>validate()</slot>
+</Q_SLOTS>
+<functions>
+ <function>setColors( const QMap&lt;QString, QColor&gt; &amp; colors )</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui.h b/tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui.h
new file mode 100644
index 0000000..8c50277
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/colornameform.ui.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions use TQt Designer which will
+** update this file, preserving your code. Create an init() function in place
+** of a constructor, and a destroy() function in place of a destructor.
+*****************************************************************************/
+#include <tqcolor.h>
+#include <tqmap.h>
+#include <tqstring.h>
+
+TQMap<TQString,TQColor> m_colors;
+
+void ColorNameForm::setColors( const TQMap<TQString,TQColor>& colors )
+{
+ m_colors = colors;
+}
+
+void ColorNameForm::validate()
+{
+ TQString name = colorLineEdit->text();
+ if ( ! name.isEmpty() &&
+ ( m_colors.isEmpty() || ! m_colors.tqcontains( name ) ) )
+ accept();
+ else
+ colorLineEdit->selectAll();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/colortool.pro b/tqtinterface/qt4/tools/designer/examples/colortool/colortool.pro
new file mode 100644
index 0000000..81945eb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/colortool.pro
@@ -0,0 +1,27 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+SOURCES += main.cpp
+unix {
+ UI_DIR = .ui
+ TQMOC_DIR = .tqmoc
+ OBJECTS_DIR = .obj
+}
+FORMS = mainform.ui \
+ colornameform.ui \
+ findform.ui \
+ optionsform.ui
+IMAGES = images/filenew.png \
+ images/fileopen.png \
+ images/filesave.png \
+ images/editcut.png \
+ images/editcopy.png \
+ images/searchfind.png \
+ images/tabwidget.png \
+ images/table.png \
+ images/iconview.png \
+ images/richtextedit.png \
+ images/widgetstack.png \
+ images/editraise.png
+CONFIG += qt warn_on release
+DBFILE = colortool.db
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/findform.ui b/tqtinterface/qt4/tools/designer/examples/colortool/findform.ui
new file mode 100644
index 0000000..2863f02
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/findform.ui
@@ -0,0 +1,141 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>FindForm</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>FindForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>301</width>
+ <height>99</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Color Tool -- Find Color</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Look for</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>tqfindLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>tqfindLineEdit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>9</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>tqfindPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>closePushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>closePushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>FindForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>tqfindPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>FindForm</receiver>
+ <slot>tqfind()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">findform.ui.h</include>
+</includes>
+<Q_SIGNALS>
+ <signal>lookfor(const QString&amp;)</signal>
+</Q_SIGNALS>
+<Q_SLOTS>
+ <slot>tqfind()</slot>
+</Q_SLOTS>
+<functions>
+ <function>notfound()</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/findform.ui.h b/tqtinterface/qt4/tools/designer/examples/colortool/findform.ui.h
new file mode 100644
index 0000000..1f6e6b9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/findform.ui.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions use TQt Designer which will
+** update this file, preserving your code. Create an init() function in place
+** of a constructor, and a destroy() function in place of a destructor.
+*****************************************************************************/
+
+
+void FindForm::tqfind()
+{
+ emit lookfor( tqfindLineEdit->text() );
+}
+
+void FindForm::notfound()
+{
+ tqfindLineEdit->selectAll();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/editcopy.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/editcopy.png
new file mode 100644
index 0000000..abfe86e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/editcut.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/editcut.png
new file mode 100644
index 0000000..2d179bc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/editraise.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/editraise.png
new file mode 100644
index 0000000..0241568
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/editraise.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/filenew.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/filenew.png
new file mode 100644
index 0000000..9853d97
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/filenew.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/fileopen.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/fileopen.png
new file mode 100644
index 0000000..85dab43
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/filesave.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/filesave.png
new file mode 100644
index 0000000..21309aa
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/iconview.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/iconview.png
new file mode 100644
index 0000000..d755399
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/iconview.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/richtextedit.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/richtextedit.png
new file mode 100644
index 0000000..9f75c25
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/richtextedit.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/searchfind.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/searchfind.png
new file mode 100644
index 0000000..8f7d8ad
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/searchfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/table.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/table.png
new file mode 100644
index 0000000..4491b6e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/table.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/tabwidget.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/tabwidget.png
new file mode 100644
index 0000000..3a16044
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/tabwidget.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/images/widgetstack.png b/tqtinterface/qt4/tools/designer/examples/colortool/images/widgetstack.png
new file mode 100644
index 0000000..7b5f234
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/images/widgetstack.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/main.cpp b/tqtinterface/qt4/tools/designer/examples/colortool/main.cpp
new file mode 100644
index 0000000..8375c59
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/main.cpp
@@ -0,0 +1,10 @@
+#include <tqapplication.h>
+#include "mainform.h"
+
+int main( int argc, char ** argv )
+{
+ TQApplication a( argc, argv );
+ MainForm *w = new MainForm;
+ w->show();
+ return a.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui b/tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui
new file mode 100644
index 0000000..448a88e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui
@@ -0,0 +1,601 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>MainForm</class>
+<widget class="TQMainWindow">
+ <property name="name">
+ <cstring>MainForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Color Tool</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQWidgetStack">
+ <property name="name">
+ <cstring>colorWidgetStack</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tablePage</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQTable">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Hex</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Web</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>colorTable</cstring>
+ </property>
+ <property name="numRows">
+ <number>0</number>
+ </property>
+ <property name="numCols">
+ <number>3</number>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>iconsPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQIconView">
+ <property name="name">
+ <cstring>colorIconView</cstring>
+ </property>
+ <property name="gridX">
+ <number>100</number>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </hbox>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <item text="&amp;File" name="fileMenu">
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <action name="fileSaveAsAction"/>
+ <separator/>
+ <action name="fileExitAction"/>
+ </item>
+ <item text="&amp;Edit" name="editMenu">
+ <action name="editAddAction"/>
+ <action name="editCutAction"/>
+ <action name="editCopyAction"/>
+ <separator/>
+ <action name="editFindAction"/>
+ <separator/>
+ <action name="optionsAction"/>
+ </item>
+ <item text="&amp;View" name="viewMenu">
+ <action name="viewTableAction"/>
+ <action name="viewIconsAction"/>
+ </item>
+ <item text="&amp;Help" name="helpMenu">
+ <action name="helpContentsAction"/>
+ <action name="helpIndexAction"/>
+ <separator/>
+ <action name="helpAboutAction"/>
+ </item>
+</menubar>
+<toolbars>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>toolBar</cstring>
+ </property>
+ <property name="label">
+ <string>Tools</string>
+ </property>
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <separator/>
+ <action name="editAddAction"/>
+ <action name="editCutAction"/>
+ <action name="editCopyAction"/>
+ <action name="editFindAction"/>
+ <separator/>
+ <action name="optionsAction"/>
+ <separator/>
+ <action name="viewTableAction"/>
+ <action name="viewIconsAction"/>
+ </toolbar>
+</toolbars>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>fileNewAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>filenew.png</iconset>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;New</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileOpenAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>fileopen.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Open...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+O</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>filesave.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Save</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Save As</string>
+ </property>
+ <property name="menuText">
+ <string>Save &amp;As...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileExitAction</cstring>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="menuText">
+ <string>E&amp;xit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCutAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>editcut.png</iconset>
+ </property>
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Delete</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+X</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCopyAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>editcopy.png</iconset>
+ </property>
+ <property name="text">
+ <string>Copy</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Copy</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+C</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editFindAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>searchfind.png</iconset>
+ </property>
+ <property name="text">
+ <string>Find</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Find...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+F</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpContentsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Contents</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Contents...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpIndexAction</cstring>
+ </property>
+ <property name="text">
+ <string>Index</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Index...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpAboutAction</cstring>
+ </property>
+ <property name="text">
+ <string>About</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;About</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>optionsAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>tabwidget.png</iconset>
+ </property>
+ <property name="text">
+ <string>Options</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Options...</string>
+ </property>
+ </action>
+ <actiongroup>
+ <property name="name">
+ <cstring>viewActionGroup</cstring>
+ </property>
+ <property name="text">
+ <string>View</string>
+ </property>
+ <property name="menuText">
+ <string>View</string>
+ </property>
+ <property name="usesDropDown">
+ <bool>false</bool>
+ </property>
+ <action>
+ <property name="name">
+ <cstring>viewTableAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="on">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>table.png</iconset>
+ </property>
+ <property name="text">
+ <string>View Table</string>
+ </property>
+ <property name="menuText">
+ <string>View &amp;Table</string>
+ </property>
+ <property name="toolTip">
+ <string>View Table (Ctrl+T)</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+T</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>viewIconsAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>iconview.png</iconset>
+ </property>
+ <property name="text">
+ <string>View Icons</string>
+ </property>
+ <property name="menuText">
+ <string>View &amp;Icons</string>
+ </property>
+ <property name="toolTip">
+ <string>View Icons (Ctrl+I)</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+I</string>
+ </property>
+ </action>
+ </actiongroup>
+ <action>
+ <property name="name">
+ <cstring>editAddAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>widgetstack.png</iconset>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Add...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+A</string>
+ </property>
+ </action>
+</actions>
+<connections>
+ <connection>
+ <sender>fileNewAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>fileNew()</slot>
+ </connection>
+ <connection>
+ <sender>fileOpenAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>fileOpen()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>fileSave()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAsAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>fileSaveAs()</slot>
+ </connection>
+ <connection>
+ <sender>fileExitAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>fileExit()</slot>
+ </connection>
+ <connection>
+ <sender>editCutAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>editCut()</slot>
+ </connection>
+ <connection>
+ <sender>editCopyAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>editCopy()</slot>
+ </connection>
+ <connection>
+ <sender>editFindAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>editFind()</slot>
+ </connection>
+ <connection>
+ <sender>helpIndexAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>helpIndex()</slot>
+ </connection>
+ <connection>
+ <sender>helpContentsAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>helpContents()</slot>
+ </connection>
+ <connection>
+ <sender>helpAboutAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>helpAbout()</slot>
+ </connection>
+ <connection>
+ <sender>colorTable</sender>
+ <signal>currentChanged(int,int)</signal>
+ <receiver>MainForm</receiver>
+ <slot>changedTableColor(int,int)</slot>
+ </connection>
+ <connection>
+ <sender>colorIconView</sender>
+ <signal>currentChanged(QIconViewItem*)</signal>
+ <receiver>MainForm</receiver>
+ <slot>changedIconColor(QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>viewActionGroup</sender>
+ <signal>selected(QAction*)</signal>
+ <receiver>MainForm</receiver>
+ <slot>changeView(QAction*)</slot>
+ </connection>
+ <connection>
+ <sender>editAddAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>editAdd()</slot>
+ </connection>
+ <connection>
+ <sender>optionsAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainForm</receiver>
+ <slot>editOptions()</slot>
+ </connection>
+ <connection>
+ <sender>colorWidgetStack</sender>
+ <signal>aboutToShow(int)</signal>
+ <receiver>MainForm</receiver>
+ <slot>aboutToShow()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in declaration">tqfindform.h</include>
+ <include location="local" impldecl="in implementation">qsettings.h</include>
+ <include location="local" impldecl="in implementation">qradiobutton.h</include>
+ <include location="local" impldecl="in implementation">qcheckbox.h</include>
+ <include location="local" impldecl="in implementation">colornameform.h</include>
+ <include location="local" impldecl="in implementation">qcolordialog.h</include>
+ <include location="local" impldecl="in implementation">qregexp.h</include>
+ <include location="local" impldecl="in implementation">qfile.h</include>
+ <include location="local" impldecl="in implementation">qfiledialog.h</include>
+ <include location="local" impldecl="in implementation">qapplication.h</include>
+ <include location="local" impldecl="in implementation">qcolor.h</include>
+ <include location="local" impldecl="in implementation">qstring.h</include>
+ <include location="local" impldecl="in implementation">qpainter.h</include>
+ <include location="local" impldecl="in implementation">qstatusbar.h</include>
+ <include location="local" impldecl="in implementation">qmessagebox.h</include>
+ <include location="local" impldecl="in implementation">qclipboard.h</include>
+ <include location="local" impldecl="in implementation">qlabel.h</include>
+ <include location="local" impldecl="in implementation">qlineedit.h</include>
+ <include location="local" impldecl="in implementation">optionsform.h</include>
+ <include location="local" impldecl="in implementation">mainform.ui.h</include>
+</includes>
+<forwards>
+ <forward>class QString;</forward>
+ <forward>class QColor;</forward>
+</forwards>
+<variables>
+ <variable>QStringList m_comments;</variable>
+ <variable>QString m_filename;</variable>
+ <variable>bool m_changed;</variable>
+ <variable>bool m_table_dirty;</variable>
+ <variable>bool m_icons_dirty;</variable>
+ <variable>int m_clip_as;</variable>
+ <variable>bool m_show_web;</variable>
+ <variable>QClipboard *clipboard;</variable>
+ <variable>FindForm *tqfindForm;</variable>
+ <variable>QMap&lt;QString,QColor&gt; m_colors;</variable>
+</variables>
+<Q_SLOTS>
+ <slot>fileNew()</slot>
+ <slot>fileOpen()</slot>
+ <slot>fileSave()</slot>
+ <slot>fileSaveAs()</slot>
+ <slot>closeEvent( QCloseEvent * )</slot>
+ <slot>fileExit()</slot>
+ <slot>editCut()</slot>
+ <slot>editCopy()</slot>
+ <slot>editFind()</slot>
+ <slot>lookfor( const QString &amp; text )</slot>
+ <slot>helpIndex()</slot>
+ <slot>helpContents()</slot>
+ <slot>helpAbout()</slot>
+ <slot>changedTableColor( int row, int )</slot>
+ <slot>changedIconColor( QIconViewItem * item )</slot>
+ <slot>changeView( QAction * action )</slot>
+ <slot>editAdd()</slot>
+ <slot>editOptions()</slot>
+ <slot>aboutToShow()</slot>
+</Q_SLOTS>
+<functions>
+ <function access="private">init()</function>
+ <function>clearData( bool fillWithDefaults )</function>
+ <function>populate()</function>
+ <function returnType="QPixmap">colorSwatch( const QColor color )</function>
+ <function>load( const QString &amp; filename )</function>
+ <function returnType="bool">okToClear()</function>
+ <function>changedColor( const QString &amp; name )</function>
+ <function returnType="bool">isWebColor( QColor color )</function>
+ <function>loadSettings()</function>
+ <function>saveSettings()</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui.h b/tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui.h
new file mode 100644
index 0000000..0026d8a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/mainform.ui.h
@@ -0,0 +1,585 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions use TQt Designer which will
+** update this file, preserving your code. Create an init() function in place
+** of a constructor, and a destroy() function in place of a destructor.
+*****************************************************************************/
+
+
+const int CLIP_AS_HEX = 0;
+const int CLIP_AS_NAME = 1;
+const int CLIP_AS_RGB = 2;
+const int COL_NAME = 0;
+const int COL_HEX = 1;
+const int COL_WEB = 2;
+const TQString WINDOWS_REGISTRY = "/TQtExamples";
+const TQString APP_KEY = "/ColorTool/";
+
+void MainForm::init()
+{
+ clipboard = TQApplication::clipboard();
+ if ( clipboard->supportsSelection() )
+ clipboard->setSelectionMode( TRUE );
+
+ tqfindForm = 0;
+ loadSettings();
+ m_filename = "";
+ m_changed = FALSE;
+ m_table_dirty = TRUE;
+ m_icons_dirty = TRUE;
+ clearData( TRUE );
+}
+
+void MainForm::clearData( bool fillWithDefaults )
+{
+ setCaption( "Color Tool" );
+
+ m_colors.clear();
+ m_comments.clear();
+
+ if ( fillWithDefaults ) {
+ m_colors["black"] = TQt::black;
+ m_colors["blue"] = TQt::blue;
+ m_colors["cyan"] = TQt::cyan;
+ m_colors["darkblue"] = TQt::darkBlue;
+ m_colors["darkcyan"] = TQt::darkCyan;
+ m_colors["darkgray"] = TQt::darkGray;
+ m_colors["darkgreen"] = TQt::darkGreen;
+ m_colors["darkmagenta"] = TQt::darkMagenta;
+ m_colors["darkred"] = TQt::darkRed;
+ m_colors["darkyellow"] = TQt::darkYellow;
+ m_colors["gray"] = TQt::gray;
+ m_colors["green"] = TQt::green;
+ m_colors["lightgray"] = TQt::lightGray;
+ m_colors["magenta"] = TQt::magenta;
+ m_colors["red"] = TQt::red;
+ m_colors["white"] = TQt::white;
+ m_colors["yellow"] = TQt::yellow;
+ }
+
+ populate();
+}
+
+void MainForm::populate()
+{
+ if ( m_table_dirty ) {
+ for ( int r = 0; r < colorTable->numRows(); ++r ) {
+ for ( int c = 0; c < colorTable->numCols(); ++c ) {
+ colorTable->clearCell( r, c );
+ }
+ }
+
+ colorTable->setNumRows( m_colors.count() );
+ if ( ! m_colors.isEmpty() ) {
+ TQPixmap pixmap( 22, 22 );
+ int row = 0;
+ TQMap<TQString,TQColor>::ConstIterator it;
+ for ( it = m_colors.constBegin(); it != m_colors.constEnd(); ++it ) {
+ TQColor color = it.data();
+ pixmap.fill( color );
+ colorTable->setText( row, COL_NAME, it.key() );
+ colorTable->setPixmap( row, COL_NAME, pixmap );
+ colorTable->setText( row, COL_HEX, color.name().upper() );
+ if ( m_show_web ) {
+ TQCheckTableItem *item = new TQCheckTableItem( colorTable, "" );
+ item->setChecked( isWebColor( color ) );
+ colorTable->setItem( row, COL_WEB, item );
+ }
+ row++;
+ }
+ colorTable->setCurrentCell( 0, 0 );
+ }
+ colorTable->adjustColumn( COL_NAME );
+ colorTable->adjustColumn( COL_HEX );
+ if ( m_show_web ) {
+ colorTable->showColumn( COL_WEB );
+ colorTable->adjustColumn( COL_WEB );
+ }
+ else
+ colorTable->hideColumn( COL_WEB );
+ m_table_dirty = FALSE;
+ }
+
+ if ( m_icons_dirty ) {
+ colorIconView->clear();
+
+ TQMap<TQString,TQColor>::ConstIterator it;
+ for ( it = m_colors.constBegin(); it != m_colors.constEnd(); ++it )
+ (void) new TQIconViewItem( colorIconView, it.key(),
+ colorSwatch( it.data() ) );
+ m_icons_dirty = FALSE;
+ }
+}
+
+TQPixmap MainForm::colorSwatch( const TQColor color )
+{
+ TQPixmap pixmap( 80, 80 );
+ pixmap.fill( white );
+ TQPainter painter;
+ painter.begin( &pixmap );
+ painter.setPen( NoPen );
+ painter.setBrush( color );
+ painter.drawEllipse( 0, 0, 80, 80 );
+ painter.end();
+ return pixmap;
+}
+
+void MainForm::fileNew()
+{
+ if ( okToClear() ) {
+ m_filename = "";
+ m_changed = FALSE;
+ m_table_dirty = TRUE;
+ m_icons_dirty = TRUE;
+ clearData( FALSE );
+ }
+}
+
+void MainForm::fileOpen()
+{
+ if ( ! okToClear() )
+ return;
+
+ TQString filename = TQFileDialog::getOpenFileName(
+ TQString(), "Colors (*.txt)", this,
+ "file open", "Color Tool -- File Open" );
+ if ( ! filename.isEmpty() )
+ load( filename );
+ else
+ statusBar()->message( "File Open abandoned", 2000 );
+}
+
+void MainForm::fileSave()
+{
+ if ( m_filename.isEmpty() ) {
+ fileSaveAs();
+ return;
+ }
+
+ TQFile file( m_filename );
+ if ( file.open( IO_WriteOnly ) ) {
+ TQTextStream stream( &file );
+ if ( ! m_comments.isEmpty() )
+ stream << m_comments.join( "\n" ) << "\n";
+ TQMap<TQString,TQColor>::ConstIterator it;
+ for ( it = m_colors.constBegin(); it != m_colors.constEnd(); ++it ) {
+ TQColor color = it.data();
+ stream << TQString( "%1 %2 %3\t\t%4" ).
+ arg( color.red(), 3 ).
+ arg( color.green(), 3 ).
+ arg( color.blue(), 3 ).
+ arg( it.key() ) << "\n";
+ }
+ file.close();
+ setCaption( TQString( "Color Tool -- %1" ).arg( m_filename ) );
+ statusBar()->message( TQString( "Saved %1 colors to '%2'" ).
+ arg( m_colors.count() ).
+ arg( m_filename ), 3000 );
+ m_changed = FALSE;
+ }
+ else
+ statusBar()->message( TQString( "Failed to save '%1'" ).
+ arg( m_filename ), 3000 );
+
+}
+
+void MainForm::fileSaveAs()
+{
+ TQString filename = TQFileDialog::getSaveFileName(
+ TQString(), "Colors (*.txt)", this,
+ "file save as", "Color Tool -- File Save As" );
+ if ( ! filename.isEmpty() ) {
+ int ans = 0;
+ if ( TQFile::exists( filename ) )
+ ans = TQMessageBox::warning(
+ this, "Color Tool -- Overwrite File",
+ TQString( "Overwrite\n'%1'?" ).
+ arg( filename ),
+ "&Yes", "&No", TQString(), 1, 1 );
+ if ( ans == 0 ) {
+ m_filename = filename;
+ fileSave();
+ return;
+ }
+ }
+ statusBar()->message( "Saving abandoned", 2000 );
+}
+
+void MainForm::load( const TQString& filename )
+{
+ clearData( FALSE );
+ m_filename = filename;
+ TQRegExp regex( "^\\s*(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\S+.*)$" );
+ TQFile file( filename );
+ if ( file.open( IO_ReadOnly ) ) {
+ statusBar()->message( TQString( "Loading '%1'..." ).
+ arg( filename ) );
+ TQTextStream stream( &file );
+ TQString line;
+ while ( ! stream.eof() ) {
+ line = stream.readLine();
+ if ( regex.search( line ) == -1 )
+ m_comments += line;
+ else
+ m_colors[regex.cap( 4 )] = TQColor(
+ regex.cap( 1 ).toInt(),
+ regex.cap( 2 ).toInt(),
+ regex.cap( 3 ).toInt() );
+ }
+ file.close();
+ m_filename = filename;
+ setCaption( TQString( "Color Tool -- %1" ).arg( m_filename ) );
+ statusBar()->message( TQString( "Loaded '%1'" ).
+ arg( m_filename ), 3000 );
+ TQWidget *visible = colorWidgetStack->visibleWidget();
+ m_icons_dirty = ! ( m_table_dirty = ( visible == tablePage ) );
+ populate();
+ m_icons_dirty = ! ( m_table_dirty = ( visible != tablePage ) );
+ m_changed = FALSE;
+ }
+ else
+ statusBar()->message( TQString( "Failed to load '%1'" ).
+ arg( m_filename ), 3000 );
+}
+
+
+bool MainForm::okToClear()
+{
+ if ( m_changed ) {
+ TQString msg;
+ if ( m_filename.isEmpty() )
+ msg = "Unnamed colors ";
+ else
+ msg = TQString( "Colors '%1'\n" ).arg( m_filename );
+ msg += TQString( "has been changed." );
+ int ans = TQMessageBox::information(
+ this,
+ "Color Tool -- Unsaved Changes",
+ msg, "&Save", "Cancel", "&Abandon",
+ 0, 1 );
+ if ( ans == 0 )
+ fileSave();
+ else if ( ans == 1 )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void MainForm::closeEvent( TQCloseEvent * )
+{
+ fileExit();
+}
+
+void MainForm::fileExit()
+{
+ if ( okToClear() ) {
+ saveSettings();
+ TQApplication::exit( 0 );
+ }
+}
+
+void MainForm::editCut()
+{
+ TQString name;
+ TQWidget *visible = colorWidgetStack->visibleWidget();
+ statusBar()->message( TQString( "Deleting '%1'" ).arg( name ) );
+
+ if ( visible == tablePage && colorTable->numRows() ) {
+ int row = colorTable->currentRow();
+ name = colorTable->text( row, 0 );
+ colorTable->removeRow( colorTable->currentRow() );
+ if ( row < colorTable->numRows() )
+ colorTable->setCurrentCell( row, 0 );
+ else if ( colorTable->numRows() )
+ colorTable->setCurrentCell( colorTable->numRows() - 1, 0 );
+ m_icons_dirty = TRUE;
+ }
+ else if ( visible == iconsPage && colorIconView->currentItem() ) {
+ TQIconViewItem *item = colorIconView->currentItem();
+ name = item->text();
+ if ( colorIconView->count() == 1 )
+ colorIconView->clear();
+ else {
+ TQIconViewItem *current = item->nextItem();
+ if ( ! current )
+ current = item->prevItem();
+ delete item;
+ if ( current )
+ colorIconView->setCurrentItem( current );
+ colorIconView->arrangeItemsInGrid();
+ }
+ m_table_dirty = TRUE;
+ }
+
+ if ( ! name.isNull() ) {
+ m_colors.remove( name );
+ m_changed = TRUE;
+ statusBar()->message( TQString( "Deleted '%1'" ).arg( name ), 5000 );
+ }
+ else
+ statusBar()->message( TQString( "Failed to delete '%1'" ).arg( name ), 5000 );
+}
+
+void MainForm::editCopy()
+{
+ TQString text;
+ TQWidget *visible = colorWidgetStack->visibleWidget();
+
+ if ( visible == tablePage && colorTable->numRows() ) {
+ int row = colorTable->currentRow();
+ text = colorTable->text( row, 0 );
+ }
+ else if ( visible == iconsPage && colorIconView->currentItem() ) {
+ TQIconViewItem *item = colorIconView->currentItem();
+ text = item->text();
+ }
+ if ( ! text.isNull() ) {
+ TQColor color = m_colors[text];
+ switch ( m_clip_as ) {
+ case CLIP_AS_HEX: text = color.name(); break;
+ case CLIP_AS_NAME: break;
+ case CLIP_AS_RGB:
+ text = TQString( "%1,%2,%3" ).
+ arg( color.red() ).
+ arg( color.green() ).
+ arg( color.blue() );
+ break;
+ }
+ clipboard->setText( text );
+ statusBar()->message( "Copied '" + text + "' to the clipboard" );
+ }
+}
+
+void MainForm::editFind()
+{
+ if ( ! tqfindForm ) {
+ tqfindForm = new FindForm( this );
+ connect( tqfindForm, TQT_SIGNAL( lookfor(const TQString&) ),
+ this, TQT_SLOT( lookfor(const TQString&) ) );
+ }
+ tqfindForm->show();
+}
+
+void MainForm::lookfor( const TQString& text )
+{
+ if ( text.isEmpty() )
+ return;
+ TQString ltext = text.lower();
+ TQWidget *visible = colorWidgetStack->visibleWidget();
+ bool found = FALSE;
+
+ if ( visible == tablePage && colorTable->numRows() ) {
+ int row = colorTable->currentRow();
+ for ( int i = row + 1; i < colorTable->numRows(); ++i )
+ if ( colorTable->text( i, 0 ).lower().tqcontains( ltext ) ) {
+ colorTable->setCurrentCell( i, 0 );
+ colorTable->clearSelection();
+ colorTable->selectRow( i );
+ found = TRUE;
+ break;
+ }
+ if ( ! found )
+ colorTable->setCurrentCell( row, 0 );
+
+ }
+ else if ( visible == iconsPage ) {
+ TQIconViewItem *start = colorIconView->currentItem();
+ for ( TQIconViewItem *item = start->nextItem(); item; item = item->nextItem() )
+ if ( item->text().lower().tqcontains( ltext ) ) {
+ colorIconView->setCurrentItem( item );
+ colorIconView->ensureItemVisible( item );
+ found = TRUE;
+ break;
+ }
+ if ( ! found && start )
+ colorIconView->setCurrentItem( start );
+ }
+ if ( ! found ) {
+ statusBar()->message( TQString( "Could not tqfind '%1' after here" ).
+ arg( text ) );
+ tqfindForm->notfound();
+ }
+}
+
+
+
+void MainForm::helpIndex()
+{
+
+}
+
+void MainForm::helpContents()
+{
+
+}
+
+void MainForm::helpAbout()
+{
+
+}
+
+
+void MainForm::changedTableColor( int row, int )
+{
+ changedColor( colorTable->text( row, COL_NAME ) );
+}
+
+void MainForm::changedIconColor( TQIconViewItem *item )
+{
+ changedColor( item->text() );
+}
+
+void MainForm::changedColor( const TQString& name )
+{
+ TQColor color = m_colors[name];
+ int r = color.red();
+ int g = color.green();
+ int b = color.blue();
+ statusBar()->message( TQString( "%1 \"%2\" (%3,%4,%5)%6 {%7 %8 %9}" ).
+ arg( name ).
+ arg( color.name().upper() ).
+ arg( r ).arg( g ).arg( b ).
+ arg( isWebColor( color ) ? " web" : "" ).
+ arg( r / 255.0, 1, 'f', 3 ).
+ arg( g / 255.0, 1, 'f', 3 ).
+ arg( b / 255.0, 1, 'f', 3 )
+ );
+}
+
+
+void MainForm::changeView(TQAction* action)
+{
+ if ( action == viewTableAction )
+ colorWidgetStack->raiseWidget( tablePage );
+ else
+ colorWidgetStack->raiseWidget( iconsPage );
+}
+
+bool MainForm::isWebColor( TQColor color )
+{
+ int r = color.red();
+ int g = color.green();
+ int b = color.blue();
+
+ return ( ( r == 0 || r == 51 || r == 102 ||
+ r == 153 || r == 204 || r == 255 ) &&
+ ( g == 0 || g == 51 || g == 102 ||
+ g == 153 || g == 204 || g == 255 ) &&
+ ( b == 0 || b == 51 || b == 102 ||
+ b == 153 || b == 204 || b == 255 ) );
+}
+
+
+void MainForm::editAdd()
+{
+ TQColor color = white;
+ if ( ! m_colors.isEmpty() ) {
+ TQWidget *visible = colorWidgetStack->visibleWidget();
+ if ( visible == tablePage )
+ color = colorTable->text( colorTable->currentRow(),
+ colorTable->currentColumn() );
+ else
+ color = colorIconView->currentItem()->text();
+ }
+ color = TQColorDialog::getColor( color, this );
+ if ( color.isValid() ) {
+ TQPixmap pixmap( 80, 10 );
+ pixmap.fill( color );
+ ColorNameForm *colorForm = new ColorNameForm( this, "color", TRUE );
+ colorForm->setColors( m_colors );
+ colorForm->colorLabel->setPixmap( pixmap );
+ if ( colorForm->exec() ) {
+ TQString name = colorForm->colorLineEdit->text();
+ m_colors[name] = color;
+ TQPixmap pixmap( 22, 22 );
+ pixmap.fill( color );
+ int row = colorTable->currentRow();
+ colorTable->insertRows( row, 1 );
+ colorTable->setText( row, COL_NAME, name );
+ colorTable->setPixmap( row, COL_NAME, pixmap );
+ colorTable->setText( row, COL_HEX, color.name().upper() );
+ if ( m_show_web ) {
+ TQCheckTableItem *item = new TQCheckTableItem( colorTable, "" );
+ item->setChecked( isWebColor( color ) );
+ colorTable->setItem( row, COL_WEB, item );
+ }
+ colorTable->setCurrentCell( row, 0 );
+
+ (void) new TQIconViewItem( colorIconView, name,
+ colorSwatch( color ) );
+ m_changed = TRUE;
+ }
+ }
+}
+
+void MainForm::editOptions()
+{
+ OptionsForm *options = new OptionsForm( this, "options", TRUE );
+ switch ( m_clip_as ) {
+ case CLIP_AS_HEX:
+ options->hexRadioButton->setChecked( TRUE );
+ break;
+ case CLIP_AS_NAME:
+ options->nameRadioButton->setChecked( TRUE );
+ break;
+ case CLIP_AS_RGB:
+ options->rgbRadioButton->setChecked( TRUE );
+ break;
+ }
+ options->webCheckBox->setChecked( m_show_web );
+
+ if ( options->exec() ) {
+ if ( options->hexRadioButton->isChecked() )
+ m_clip_as = CLIP_AS_HEX;
+ else if ( options->nameRadioButton->isChecked() )
+ m_clip_as = CLIP_AS_NAME;
+ else if ( options->rgbRadioButton->isChecked() )
+ m_clip_as = CLIP_AS_RGB;
+ m_table_dirty = m_show_web !=
+ options->webCheckBox->isChecked();
+ m_show_web = options->webCheckBox->isChecked();
+
+ populate();
+ }
+}
+
+void MainForm::loadSettings()
+{
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, WINDOWS_REGISTRY );
+ int windowWidth = settings.readNumEntry( APP_KEY + "WindowWidth", 550 );
+ int windowHeight = settings.readNumEntry( APP_KEY + "WindowHeight", 500 );
+ int windowX = settings.readNumEntry( APP_KEY + "WindowX", 0 );
+ int windowY = settings.readNumEntry( APP_KEY + "WindowY", 0 );
+ m_clip_as = settings.readNumEntry( APP_KEY + "ClipAs", CLIP_AS_HEX );
+ m_show_web = settings.readBoolEntry( APP_KEY + "ShowWeb", TRUE );
+ if ( ! settings.readBoolEntry( APP_KEY + "View", TRUE ) ) {
+ colorWidgetStack->raiseWidget( iconsPage );
+ viewIconsAction->setOn( TRUE );
+ }
+
+ resize( windowWidth, windowHeight );
+ move( windowX, windowY );
+}
+
+void MainForm::saveSettings()
+{
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, WINDOWS_REGISTRY );
+ settings.writeEntry( APP_KEY + "WindowWidth", width() );
+ settings.writeEntry( APP_KEY + "WindowHeight", height() );
+ settings.writeEntry( APP_KEY + "WindowX", x() );
+ settings.writeEntry( APP_KEY + "WindowY", y() );
+ settings.writeEntry( APP_KEY + "ClipAs", m_clip_as );
+ settings.writeEntry( APP_KEY + "ShowWeb", m_show_web );
+ settings.writeEntry( APP_KEY + "View",
+ colorWidgetStack->visibleWidget() == tablePage );
+}
+
+
+void MainForm::aboutToShow()
+{
+ populate();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui b/tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui
new file mode 100644
index 0000000..2e8a4c2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui
@@ -0,0 +1,153 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>OptionsForm</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>OptionsForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>306</width>
+ <height>226</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Color Tool -- Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Table View</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>webCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Indicate &amp;Web Colors</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Copy to Clipboard As</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>hexRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Hex, e.g. #AB347F</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>nameRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name, e.g. light blue</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>rgbRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;RGB, e.g. 51,255,102</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>okPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>cancelPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>okPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>OptionsForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>OptionsForm</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">optionsform.ui.h</include>
+</includes>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui.h b/tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui.h
new file mode 100644
index 0000000..e43b8f3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/colortool/optionsform.ui.h
@@ -0,0 +1,7 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions use TQt Designer which will
+** update this file, preserving your code. Create an init() function in place
+** of a constructor, and a destroy() function in place of a destructor.
+*****************************************************************************/
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/credit.pro b/tqtinterface/qt4/tools/designer/examples/credit/credit.pro
new file mode 100644
index 0000000..4dc246d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/credit.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = credit
+
+SOURCES += main.cpp
+HEADERS += creditform.h
+SOURCES += creditform.cpp
+FORMS = creditformbase.ui
+CONFIG += qt warn_on release
+DBFILE = credit.db
+IMAGEFILE = images.cpp
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/creditform.cpp b/tqtinterface/qt4/tools/designer/examples/credit/creditform.cpp
new file mode 100644
index 0000000..2a0b52e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/creditform.cpp
@@ -0,0 +1,20 @@
+#include <tqradiobutton.h>
+#include <tqspinbox.h>
+#include "creditform.h"
+
+CreditForm::CreditForm( TQWidget* tqparent, const char* name,
+ bool modal, WFlags fl )
+ : CreditFormBase( tqparent, name, modal, fl )
+{
+ setAmount();
+}
+
+CreditForm::~CreditForm() { /* NOOP */ }
+
+void CreditForm::setAmount()
+{
+ if ( stdRadioButton->isChecked() )
+ amountSpinBox->setValue( amountSpinBox->maxValue() / 2 );
+ else if ( noneRadioButton->isChecked() )
+ amountSpinBox->setValue( amountSpinBox->minValue() );
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/creditform.h b/tqtinterface/qt4/tools/designer/examples/credit/creditform.h
new file mode 100644
index 0000000..b8998a2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/creditform.h
@@ -0,0 +1,12 @@
+#include "creditformbase.h"
+
+class CreditForm : public CreditFormBase
+{
+ TQ_OBJECT
+public:
+ CreditForm( TQWidget* tqparent = 0, const char* name = 0,
+ bool modal = FALSE, WFlags fl = 0 );
+ ~CreditForm();
+public Q_SLOTS:
+ void setAmount();
+};
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.cpp b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.cpp
new file mode 100644
index 0000000..07543be
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'creditformbase.ui'
+**
+** Created: Fri Aug 10 09:48:16 2001
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "creditformbase.h"
+
+#include <tqvariant.h> // first for gcc 2.7.2
+#include <tqbuttongroup.h>
+#include <tqpushbutton.h>
+#include <tqradiobutton.h>
+#include <tqspinbox.h>
+#include <tqmime.h>
+#include <tqdragobject.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
+#include "creditformbase.ui.h"
+#include <tqimage.h>
+#include <tqpixmap.h>
+
+static TQPixmap uic_load_pixmap_CreditFormBase( const TQString &name )
+{
+ const TQMimeSource *m = TQMimeSourceFactory::defaultFactory()->data( name );
+ if ( !m )
+ return TQPixmap();
+ TQPixmap pix;
+ TQImageDrag::decode( m, pix );
+ return pix;
+}
+/*
+ * Constructs a CreditFormBase which is a child of 'tqparent', with the
+ * name 'name' and widget flags set to 'f'.
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+CreditFormBase::CreditFormBase( TQWidget* tqparent, const char* name, bool modal, WFlags fl )
+ : TQDialog( tqparent, name, modal, fl )
+{
+ if ( !name )
+ setName( "CreditFormBase" );
+ resize( 276, 224 );
+ setCaption( trUtf8( "Credit Rating", "" ) );
+ CreditFormBaseLayout = new TQVBoxLayout( this );
+ CreditFormBaseLayout->setSpacing( 6 );
+ CreditFormBaseLayout->setMargin( 11 );
+
+ creditButtonGroup = new TQButtonGroup( this, "creditButtonGroup" );
+ creditButtonGroup->setTitle( trUtf8( "Credit Rating", "" ) );
+ creditButtonGroup->setColumnLayout(0, Qt::Vertical );
+ creditButtonGroup->tqlayout()->setSpacing( 0 );
+ creditButtonGroup->tqlayout()->setMargin( 0 );
+ creditButtonGroupLayout = new TQVBoxLayout( creditButtonGroup->tqlayout() );
+ creditButtonGroupLayout->tqsetAlignment( TQt::AlignTop );
+ creditButtonGroupLayout->setSpacing( 6 );
+ creditButtonGroupLayout->setMargin( 11 );
+
+ stdRadioButton = new TQRadioButton( creditButtonGroup, "stdRadioButton" );
+ stdRadioButton->setText( trUtf8( "&Standard", "" ) );
+ stdRadioButton->setChecked( TRUE );
+ creditButtonGroupLayout->addWidget( stdRadioButton );
+
+ noneRadioButton = new TQRadioButton( creditButtonGroup, "noneRadioButton" );
+ noneRadioButton->setText( trUtf8( "&None", "" ) );
+ creditButtonGroupLayout->addWidget( noneRadioButton );
+
+ specialRadioButton = new TQRadioButton( creditButtonGroup, "specialRadioButton" );
+ specialRadioButton->setText( trUtf8( "Sp&ecial", "" ) );
+ creditButtonGroupLayout->addWidget( specialRadioButton );
+ CreditFormBaseLayout->addWidget( creditButtonGroup );
+
+ amountSpinBox = new TQSpinBox( this, "amountSpinBox" );
+ amountSpinBox->setEnabled( FALSE );
+ amountSpinBox->setPrefix( trUtf8( "$ ", "" ) );
+ amountSpinBox->setButtonSymbols( TQSpinBox::UpDownArrows );
+ amountSpinBox->setMaxValue( 100000 );
+ amountSpinBox->setLineStep( 10000 );
+ CreditFormBaseLayout->addWidget( amountSpinBox );
+
+ Layout4 = new TQHBoxLayout;
+ Layout4->setSpacing( 6 );
+ Layout4->setMargin( 0 );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
+ Layout4->addItem( spacer );
+
+ okPushButton = new TQPushButton( this, "okPushButton" );
+ okPushButton->setText( trUtf8( "OK", "" ) );
+ okPushButton->setDefault( TRUE );
+ Layout4->addWidget( okPushButton );
+ TQSpacerItem* spacer_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
+ Layout4->addItem( spacer_2 );
+
+ cancelPushButton = new TQPushButton( this, "cancelPushButton" );
+ cancelPushButton->setText( trUtf8( "Cancel", "" ) );
+ Layout4->addWidget( cancelPushButton );
+ TQSpacerItem* spacer_3 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
+ Layout4->addItem( spacer_3 );
+ CreditFormBaseLayout->addLayout( Layout4 );
+
+
+
+
+
+ // Q_SIGNALS and Q_SLOTS connections
+ connect( okPushButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
+ connect( cancelPushButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
+ connect( creditButtonGroup, TQT_SIGNAL( clicked(int) ), this, TQT_SLOT( setAmount() ) );
+ connect( specialRadioButton, TQT_SIGNAL( toggled(bool) ), amountSpinBox, TQT_SLOT( setEnabled(bool) ) );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+CreditFormBase::~CreditFormBase()
+{
+ // no need to delete child widgets, TQt does it all for us
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.h b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.h
new file mode 100644
index 0000000..87c32d4
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'creditformbase.ui'
+**
+** Created: Fri Aug 10 09:48:10 2001
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef CREDITFORMBASE_H
+#define CREDITFORMBASE_H
+
+#include <tqvariant.h>
+#include <tqdialog.h>
+class TQVBoxLayout;
+class TQHBoxLayout;
+class TQGridLayout;
+class TQButtonGroup;
+class TQPushButton;
+class TQRadioButton;
+class TQSpinBox;
+
+class CreditFormBase : public TQDialog
+{
+ TQ_OBJECT
+
+public:
+ CreditFormBase( TQWidget* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~CreditFormBase();
+
+ TQButtonGroup* creditButtonGroup;
+ TQRadioButton* stdRadioButton;
+ TQRadioButton* noneRadioButton;
+ TQRadioButton* specialRadioButton;
+ TQSpinBox* amountSpinBox;
+ TQPushButton* okPushButton;
+ TQPushButton* cancelPushButton;
+
+
+public Q_SLOTS:
+ virtual void setAmount();
+
+protected:
+ TQVBoxLayout* CreditFormBaseLayout;
+ TQVBoxLayout* creditButtonGroupLayout;
+ TQHBoxLayout* Layout4;
+};
+
+#endif // CREDITFORMBASE_H
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui
new file mode 100644
index 0000000..00aa9a0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui
@@ -0,0 +1,212 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>CreditFormBase</class>
+<include location="local" implDecl="in declaration">creditformbase.ui.h</include>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>CreditFormBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>276</width>
+ <height>224</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Credit Rating</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>creditButtonGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Credit Rating</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>stdRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Standard</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>noneRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;None</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>specialRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>Sp&amp;ecial</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQSpinBox">
+ <property name="name">
+ <cstring>amountSpinBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="prefix">
+ <string>$ </string>
+ </property>
+ <property name="buttonSymbols">
+ <enum>UpDownArrows</enum>
+ </property>
+ <property name="maxValue">
+ <number>100000</number>
+ </property>
+ <property name="lineStep">
+ <number>10000</number>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>okPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>cancelPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>okPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CreditFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>cancelPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CreditFormBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>creditButtonGroup</sender>
+ <signal>clicked(int)</signal>
+ <receiver>CreditFormBase</receiver>
+ <slot>setAmount()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>specialRadioButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>amountSpinBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">setAmount()</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui.h b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui.h
new file mode 100644
index 0000000..6cf4faa
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/creditformbase.ui.h
@@ -0,0 +1,5 @@
+void CreditFormBase::setAmount()
+{
+
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/credit/main.cpp b/tqtinterface/qt4/tools/designer/examples/credit/main.cpp
new file mode 100644
index 0000000..a16183d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/credit/main.cpp
@@ -0,0 +1,25 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include "creditform.h"
+
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ CreditForm creditForm;
+ app.setMainWidget( &creditForm );
+ creditForm.show();
+
+ return app.exec();
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.cpp b/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.cpp
new file mode 100644
index 0000000..f256dc9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.cpp
@@ -0,0 +1,95 @@
+#include "plugin.h"
+#include "../widget/filechooser.h"
+
+static const char *filechooser_pixmap[] = {
+ "22 22 8 1",
+ " c Gray100",
+ ". c Gray97",
+ "X c #4f504f",
+ "o c #00007f",
+ "O c Gray0",
+ "+ c none",
+ "@ c Gray0",
+ "# c Gray0",
+ "++++++++++++++++++++++",
+ "++++++++++++++++++++++",
+ "++++++++++++++++++++++",
+ "++++++++++++++++++++++",
+ "+OOOOOOOOOOOOOOOOOOOO+",
+ "OOXXXXXXXXXXXXXXXXXXOO",
+ "OXX. OO OO O",
+ "OX. oo O O",
+ "OX. oo O .O",
+ "OX ooo oooo O O",
+ "OX oo oo oo O O",
+ "OX oooo oo oo O O",
+ "OX oo oo oo oo O O",
+ "OX oo oo oo oo O O",
+ "OX oooo oooo O O",
+ "OX OO OO O",
+ "OO..................OO",
+ "+OOOOOOOOOOOOOOOOOOOO+",
+ "++++++++++++++++++++++",
+ "++++++++++++++++++++++",
+ "++++++++++++++++++++++",
+ "++++++++++++++++++++++"
+};
+
+CustomWidgetPlugin::CustomWidgetPlugin()
+{
+}
+
+TQStringList CustomWidgetPlugin::keys() const
+{
+ TQStringList list;
+ list << "FileChooser";
+ return list;
+}
+
+TQWidget* CustomWidgetPlugin::create( const TQString &key, TQWidget* tqparent, const char* name )
+{
+ if ( key == "FileChooser" )
+ return new FileChooser( tqparent, name );
+ return 0;
+}
+
+TQString CustomWidgetPlugin::group( const TQString& feature ) const
+{
+ if ( feature == "FileChooser" )
+ return "Input";
+ return TQString();
+}
+
+TQIconSet CustomWidgetPlugin::iconSet( const TQString& ) const
+{
+ return TQIconSet( TQPixmap( filechooser_pixmap ) );
+}
+
+TQString CustomWidgetPlugin::includeFile( const TQString& feature ) const
+{
+ if ( feature == "FileChooser" )
+ return "filechooser.h";
+ return TQString();
+}
+
+TQString CustomWidgetPlugin::toolTip( const TQString& feature ) const
+{
+ if ( feature == "FileChooser" )
+ return "File Chooser Widget";
+ return TQString();
+}
+
+TQString CustomWidgetPlugin::whatsThis( const TQString& feature ) const
+{
+ if ( feature == "FileChooser" )
+ return "A widget to choose a file or directory";
+ return TQString();
+}
+
+bool CustomWidgetPlugin::isContainer( const TQString& ) const
+{
+ return FALSE;
+}
+
+
+TQ_EXPORT_PLUGIN( CustomWidgetPlugin )
diff --git a/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.h b/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.h
new file mode 100644
index 0000000..e2bd12f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.h
@@ -0,0 +1,16 @@
+#include <tqwidgetplugin.h>
+
+class CustomWidgetPlugin : public TQWidgetPlugin
+{
+public:
+ CustomWidgetPlugin();
+
+ TQStringList keys() const;
+ TQWidget* create( const TQString &classname, TQWidget* tqparent = 0, const char* name = 0 );
+ TQString group( const TQString& ) const;
+ TQIconSet iconSet( const TQString& ) const;
+ TQString includeFile( const TQString& ) const;
+ TQString toolTip( const TQString& ) const;
+ TQString whatsThis( const TQString& ) const;
+ bool isContainer( const TQString& ) const;
+};
diff --git a/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.pro b/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.pro
new file mode 100644
index 0000000..012f185
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/filechooser/plugin/plugin.pro
@@ -0,0 +1,14 @@
+TEMPLATE = lib
+LANGUAGE = C++
+TARGET = filechooser
+
+SOURCES += plugin.cpp ../widget/filechooser.cpp
+HEADERS += plugin.h ../widget/filechooser.h
+DESTDIR = ../../../../../plugins/designer
+
+target.path=$$plugins.path
+
+INSTALLS += target
+CONFIG += qt warn_on release plugin
+INCLUDEPATH += $$QT_SOURCE_TREE/tools/designer/interfaces
+DBFILE = plugin.db
diff --git a/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.cpp b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.cpp
new file mode 100644
index 0000000..f3f986b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.cpp
@@ -0,0 +1,62 @@
+#include "filechooser.h"
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqfiledialog.h>
+#include <tqlayout.h>
+
+FileChooser::FileChooser( TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name ), md( File )
+{
+ TQHBoxLayout *tqlayout = new TQHBoxLayout( this );
+ tqlayout->setMargin( 0 );
+
+ lineEdit = new TQLineEdit( this, "filechooser_lineedit" );
+ tqlayout->addWidget( lineEdit );
+
+ connect( lineEdit, TQT_SIGNAL( textChanged( const TQString & ) ),
+ this, TQT_SIGNAL( fileNameChanged( const TQString & ) ) );
+
+ button = new TQPushButton( "...", this, "filechooser_button" );
+ button->setFixedWidth( button->fontMetrics().width( " ... " ) );
+ tqlayout->addWidget( button );
+
+ connect( button, TQT_SIGNAL( clicked() ),
+ this, TQT_SLOT( chooseFile() ) );
+
+ setFocusProxy( lineEdit );
+}
+
+void FileChooser::setMode( Mode m )
+{
+ md = m;
+}
+
+FileChooser::Mode FileChooser::mode() const
+{
+ return md;
+}
+
+void FileChooser::setFileName( const TQString &fn )
+{
+ lineEdit->setText( fn );
+}
+
+TQString FileChooser::fileName() const
+{
+ return lineEdit->text();
+}
+
+void FileChooser::chooseFile()
+{
+ TQString fn;
+ if ( mode() == File )
+ fn = TQFileDialog::getOpenFileName( lineEdit->text(), TQString(), this );
+ else
+ fn = TQFileDialog::getExistingDirectory( lineEdit->text(),this );
+
+ if ( !fn.isEmpty() ) {
+ lineEdit->setText( fn );
+ emit fileNameChanged( fn );
+ }
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.h b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.h
new file mode 100644
index 0000000..0062e5b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.h
@@ -0,0 +1,48 @@
+#ifndef FILECHOOSER_H
+#define FILECHOOSER_H
+
+#include <tqwidget.h>
+#include <tqwidgetplugin.h>
+
+class TQLineEdit;
+class TQPushButton;
+
+#ifdef FILECHOOSER_IS_WIDGET
+#undef TQT_WIDGET_PLUGIN_EXPORT
+#define TQT_WIDGET_PLUGIN_EXPORT
+#endif
+
+class TQT_WIDGET_PLUGIN_EXPORT FileChooser : public TQWidget
+{
+ TQ_OBJECT
+
+ TQ_ENUMS( Mode )
+ Q_PROPERTY( Mode mode READ mode WRITE setMode )
+ Q_PROPERTY( TQString fileName READ fileName WRITE setFileName )
+
+public:
+ FileChooser( TQWidget *tqparent = 0, const char *name = 0);
+
+ enum Mode { File, Directory };
+
+ TQString fileName() const;
+ Mode mode() const;
+
+public Q_SLOTS:
+ void setFileName( const TQString &fn );
+ void setMode( Mode m );
+
+Q_SIGNALS:
+ void fileNameChanged( const TQString & );
+
+private Q_SLOTS:
+ void chooseFile();
+
+private:
+ TQLineEdit *lineEdit;
+ TQPushButton *button;
+ Mode md;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.pro b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.pro
new file mode 100644
index 0000000..20ea787
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/filechooser.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = filechooser
+
+SOURCES += filechooser.cpp main.cpp
+HEADERS += filechooser.h
+CONFIG += qt warn_on release
+DBFILE = filechooser.db
+DEFINES += FILECHOOSER_IS_WIDGET
diff --git a/tqtinterface/qt4/tools/designer/examples/filechooser/widget/main.cpp b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/main.cpp
new file mode 100644
index 0000000..6daaddd
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/filechooser/widget/main.cpp
@@ -0,0 +1,10 @@
+#include <tqapplication.h>
+#include "filechooser.h"
+
+int main( int argc, char ** argv )
+{
+ TQApplication a( argc, argv );
+ FileChooser *fc = new FileChooser;
+ fc->show();
+ return a.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/metric/main.cpp b/tqtinterface/qt4/tools/designer/examples/metric/main.cpp
new file mode 100644
index 0000000..9f2b1dc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/metric/main.cpp
@@ -0,0 +1,12 @@
+#include <tqapplication.h>
+#include "metric.h"
+
+int main( int argc, char ** argv )
+{
+ TQApplication a( argc, argv );
+ ConversionForm *w = new ConversionForm;
+ w->show();
+ a.setMainWidget( w );
+ a.connect( &a, TQT_SIGNAL( lastWindowClosed() ), &a, TQT_SLOT( quit() ) );
+ return a.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/metric/metric.pro b/tqtinterface/qt4/tools/designer/examples/metric/metric.pro
new file mode 100644
index 0000000..b31b997
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/metric/metric.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+LANGUAGE = C++
+
+SOURCES += main.cpp
+unix {
+ UI_DIR = .ui
+ TQMOC_DIR = .tqmoc
+ OBJECTS_DIR = .obj
+}
+FORMS = metric.ui
+CONFIG += qt warn_on release
+DBFILE = metric.db
diff --git a/tqtinterface/qt4/tools/designer/examples/metric/metric.ui b/tqtinterface/qt4/tools/designer/examples/metric/metric.ui
new file mode 100644
index 0000000..8ff4427
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/metric/metric.ui
@@ -0,0 +1,366 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConversionForm</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ConversionForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>217</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Metric Conversion</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLayoutWidget" row="4" column="1">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQSpinBox">
+ <property name="name">
+ <cstring>decimalsSpinBox</cstring>
+ </property>
+ <property name="maxValue">
+ <number>6</number>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Kilometers</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Meters</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Centimeters</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Millimeters</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>fromComboBox</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Result:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Convert &amp;From:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fromComboBox</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Convert &amp;To:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>toComboBox</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Decimals:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>decimalsSpinBox</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Enter &amp;Number:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>numberLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="1">
+ <property name="name">
+ <cstring>resultLineEdit</cstring>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>WinPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>numberLineEdit</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="tqalignment">
+ <set>AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="2" column="1">
+ <item>
+ <property name="text">
+ <string>Miles</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Yards</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Feet</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inches</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>toComboBox</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>clearButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Clear</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>calculateButton</cstring>
+ </property>
+ <property name="text">
+ <string>Calculate</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer27</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>quitButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>clearButton</sender>
+ <signal>clicked()</signal>
+ <receiver>numberLineEdit</receiver>
+ <slot>clear()</slot>
+ </connection>
+ <connection>
+ <sender>quitButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ConversionForm</receiver>
+ <slot>close()</slot>
+ </connection>
+ <connection>
+ <sender>calculateButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ConversionForm</receiver>
+ <slot>convert()</slot>
+ </connection>
+ <connection>
+ <sender>clearButton</sender>
+ <signal>clicked()</signal>
+ <receiver>resultLineEdit</receiver>
+ <slot>clear()</slot>
+ </connection>
+ <connection>
+ <sender>decimalsSpinBox</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>ConversionForm</receiver>
+ <slot>convert()</slot>
+ </connection>
+ <connection>
+ <sender>fromComboBox</sender>
+ <signal>activated(int)</signal>
+ <receiver>ConversionForm</receiver>
+ <slot>convert()</slot>
+ </connection>
+ <connection>
+ <sender>toComboBox</sender>
+ <signal>activated(int)</signal>
+ <receiver>ConversionForm</receiver>
+ <slot>convert()</slot>
+ </connection>
+ <connection>
+ <sender>clearButton</sender>
+ <signal>released()</signal>
+ <receiver>numberLineEdit</receiver>
+ <slot>setFocus()</slot>
+ </connection>
+ <connection>
+ <sender>calculateButton</sender>
+ <signal>clicked()</signal>
+ <receiver>numberLineEdit</receiver>
+ <slot>setFocus()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>numberLineEdit</tabstop>
+ <tabstop>fromComboBox</tabstop>
+ <tabstop>toComboBox</tabstop>
+ <tabstop>decimalsSpinBox</tabstop>
+ <tabstop>clearButton</tabstop>
+ <tabstop>calculateButton</tabstop>
+ <tabstop>quitButton</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">metric.ui.h</include>
+</includes>
+<Q_SLOTS>
+ <slot>convert()</slot>
+</Q_SLOTS>
+<functions>
+ <function access="private">init()</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/metric/metric.ui.h b/tqtinterface/qt4/tools/designer/examples/metric/metric.ui.h
new file mode 100644
index 0000000..7a451ee
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/metric/metric.ui.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions respectively Q_SLOTS use
+** TQt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+#include <tqvalidator.h>
+
+void ConversionForm::init()
+{
+ numberLineEdit->setValidator( new TQDoubleValidator( numberLineEdit ) );
+ numberLineEdit->setText( "10" );
+ convert();
+ numberLineEdit->selectAll();
+}
+
+void ConversionForm::convert()
+{
+ enum MetricUnits {
+ Kilometers,
+ Meters,
+ Centimeters,
+ Millimeters
+ };
+ enum OldUnits {
+ Miles,
+ Yards,
+ Feet,
+ Inches
+ };
+
+ // Retrieve the input
+ double input = numberLineEdit->text().toDouble();
+ double scaledInput = input;
+
+ // internally convert the input to millimeters
+ switch ( fromComboBox->currentItem() ) {
+ case Kilometers:
+ scaledInput *= 1000000;
+ break;
+ case Meters:
+ scaledInput *= 1000;
+ break;
+ case Centimeters:
+ scaledInput *= 10;
+ break;
+ }
+
+ //convert to inches
+ double result = scaledInput * 0.0393701;
+
+ switch ( toComboBox->currentItem() ) {
+ case Miles:
+ result /= 63360;
+ break;
+ case Yards:
+ result /= 36;
+ break;
+ case Feet:
+ result /= 12;
+ break;
+ }
+
+ // set the result
+ int decimals = decimalsSpinBox->value();
+ resultLineEdit->setText( TQString::number( result, 'f', decimals ) );
+ numberLineEdit->setText( TQString::number( input, 'f', decimals ) );
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/multiclip/main.cpp b/tqtinterface/qt4/tools/designer/examples/multiclip/main.cpp
new file mode 100644
index 0000000..73b9451
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/multiclip/main.cpp
@@ -0,0 +1,25 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include "multiclip.h"
+
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ MulticlipForm clippingForm;
+ app.setMainWidget( &clippingForm );
+ clippingForm.show();
+
+ return app.exec();
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.pro b/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.pro
new file mode 100644
index 0000000..f9391cb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = multiclip
+
+SOURCES += main.cpp
+FORMS = multiclip.ui
+CONFIG += qt warn_on release
+DBFILE = multiclip.db
+IMAGEFILE = images.cpp
diff --git a/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui b/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui
new file mode 100644
index 0000000..5e78a47
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui
@@ -0,0 +1,206 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MulticlipForm</class>
+<include location="global" impldecl="in declaration">qclipboard.h</include>
+<include location="global" impldecl="in implementation">qapplication.h</include>
+<include location="local" implDecl="in declaration">multiclip.ui.h</include>
+<variable>QClipboard *cb;</variable>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>MulticlipForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>585</width>
+ <height>472</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Multiclip</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Current Clipping</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>currentLineEdit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout19</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>addPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add Clipping</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="7" column="1">
+ <property name="name">
+ <cstring>quitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="1">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Length</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Previous Clippings</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>autoCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;uto Add Clippings</string>
+ </property>
+ </widget>
+ <widget class="TQLCDNumber" row="1" column="1">
+ <property name="name">
+ <cstring>lengthLCDNumber</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="6" column="1">
+ <property name="name">
+ <cstring>deletePushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Clipping</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="1" column="0" rowspan="7" colspan="1">
+ <property name="name">
+ <cstring>clippingsListBox</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>copyPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Copy Previous</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>quitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MulticlipForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>addPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MulticlipForm</receiver>
+ <slot>addClipping()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>copyPushButton</sender>
+ <signal>pressed()</signal>
+ <receiver>MulticlipForm</receiver>
+ <slot>copyPrevious()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>deletePushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MulticlipForm</receiver>
+ <slot>deleteClipping()</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">addClipping()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">dataChanged()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">deleteClipping()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">init()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">selectionChanged()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">copyPrevious()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">clippingChanged( const QString &amp; clipping )</slot>
+</connections>
+<tabstops>
+ <tabstop>currentLineEdit</tabstop>
+ <tabstop>clippingsListBox</tabstop>
+ <tabstop>autoCheckBox</tabstop>
+ <tabstop>addPushButton</tabstop>
+ <tabstop>copyPushButton</tabstop>
+ <tabstop>deletePushButton</tabstop>
+ <tabstop>quitPushButton</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui.h b/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui.h
new file mode 100644
index 0000000..684c367
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/multiclip/multiclip.ui.h
@@ -0,0 +1,70 @@
+void MulticlipForm::addClipping()
+{
+ TQString text = currentLineEdit->text();
+ if ( ! text.isEmpty() ) {
+ lengthLCDNumber->display( (int)text.length() );
+ int i = 0;
+ for ( ; i < (int)clippingsListBox->count(); i++ ) {
+ if ( clippingsListBox->text( i ) == text ) {
+ i = -1; // Do not add duplicates
+ break;
+ }
+ }
+ if ( i != -1 )
+ clippingsListBox->insertItem( text, 0 );
+ }
+}
+
+void MulticlipForm::dataChanged()
+{
+ TQString text;
+ text = cb->text();
+ clippingChanged( text );
+ if ( autoCheckBox->isChecked() )
+ addClipping();
+}
+
+void MulticlipForm::deleteClipping()
+{
+ clippingChanged( "" );
+ clippingsListBox->removeItem( clippingsListBox->currentItem() );
+}
+
+void MulticlipForm::init()
+{
+ lengthLCDNumber->setBackgroundColor( darkBlue );
+ currentLineEdit->setFocus();
+
+ cb = tqApp->clipboard();
+ connect( cb, TQT_SIGNAL( dataChanged() ), TQT_SLOT( dataChanged() ) );
+ if ( cb->supportsSelection() )
+ connect( cb, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( selectionChanged() ) );
+
+ dataChanged();
+}
+
+void MulticlipForm::selectionChanged()
+{
+ cb->setSelectionMode( TRUE );
+ dataChanged();
+ cb->setSelectionMode( FALSE );
+}
+
+void MulticlipForm::copyPrevious()
+{
+ if ( clippingsListBox->currentItem() != -1 ) {
+ cb->setText( clippingsListBox->currentText() );
+ if ( cb->supportsSelection() ) {
+ cb->setSelectionMode( TRUE );
+ cb->setText( clippingsListBox->currentText() );
+ cb->setSelectionMode( FALSE );
+ }
+ }
+}
+
+void MulticlipForm::clippingChanged( const TQString & clipping )
+{
+ currentLineEdit->setText( clipping );
+ lengthLCDNumber->display( (int)clipping.length() );
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/opengl/glwidget.cpp b/tqtinterface/qt4/tools/designer/examples/opengl/glwidget.cpp
new file mode 100644
index 0000000..1109807
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/opengl/glwidget.cpp
@@ -0,0 +1,170 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "glwidget.h"
+
+/*!
+ Create a GLWidget widget
+*/
+
+GLWidget::GLWidget( TQWidget* tqparent, const char* name )
+ : TQGLWidget( tqparent, name )
+{
+ xrot = yrot = zrot = 25; // default object rotation
+ scale_ = 1.25; // default object scale
+ object = 0;
+}
+
+/*!
+ Release allocated resources
+*/
+
+GLWidget::~GLWidget()
+{
+ glDeleteLists( object, 1 );
+}
+
+
+/*!
+ Paint the box. The actual openGL commands for drawing the box are
+ performed here.
+*/
+
+void GLWidget::paintGL()
+{
+ glClear( GL_COLOR_BUFFER_BIT );
+
+ glLoadIdentity();
+ glTranslatef( 0.0, 0.0, -10.0 );
+ glScalef( scale_, scale_, scale_ );
+
+ glRotatef( xrot, 1.0, 0.0, 0.0 );
+ glRotatef( yrot, 0.0, 1.0, 0.0 );
+ glRotatef( zrot, 0.0, 0.0, 1.0 );
+
+ glCallList( object );
+}
+
+/*!
+ Set up the OpenGL rendering state, and define display list
+*/
+
+void GLWidget::initializeGL()
+{
+ qglClearColor( black ); // Let OpenGL clear to black
+ object = makeObject(); // Generate an OpenGL display list
+ glShadeModel( GL_FLAT );
+}
+
+
+
+/*!
+ Set up the OpenGL view port, matrix mode, etc.
+*/
+
+void GLWidget::resizeGL( int w, int h )
+{
+ glViewport( 0, 0, (GLint)w, (GLint)h );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );
+ glMatrixMode( GL_MODELVIEW );
+}
+
+
+/*!
+ Generate an OpenGL display list for the object to be shown, i.e. the box
+*/
+
+GLuint GLWidget::makeObject()
+{
+ GLuint list;
+
+ list = glGenLists( 1 );
+
+ glNewList( list, GL_COMPILE );
+
+ qglColor( white ); // Shorthand for glColor3f or glIndex
+
+ glLineWidth( 2.0 );
+
+ glBegin( GL_LINE_LOOP );
+ glVertex3f( 1.0f, 0.5f, -0.4f );
+ glVertex3f( 1.0f, -0.5f, -0.4f );
+ glVertex3f( -1.0f, -0.5f, -0.4f );
+ glVertex3f( -1.0f, 0.5f, -0.4f );
+ glEnd();
+
+ glBegin( GL_LINE_LOOP );
+ glVertex3f( 1.0f, 0.5f, 0.4f );
+ glVertex3f( 1.0f, -0.5f, 0.4f );
+ glVertex3f( -1.0f, -0.5f, 0.4f );
+ glVertex3f( -1.0f, 0.5f, 0.4f );
+ glEnd();
+
+ glBegin( GL_LINES );
+ glVertex3f( 1.0f, 0.5f, -0.4f ); glVertex3f( 1.0f, 0.5f, 0.4f );
+ glVertex3f( 1.0f, -0.5f, -0.4f ); glVertex3f( 1.0f, -0.5f, 0.4f );
+ glVertex3f( -1.0f, -0.5f, -0.4f ); glVertex3f( -1.0f, -0.5f, 0.4f );
+ glVertex3f( -1.0f, 0.5f, -0.4f ); glVertex3f( -1.0f, 0.5f, 0.4f );
+ glEnd();
+
+ glEndList();
+
+ return list;
+}
+
+void GLWidget::setXRot( double x )
+{
+ xrot = x;
+ update();
+}
+
+void GLWidget::setYRot( double y )
+{
+ yrot = y;
+ update();
+}
+
+void GLWidget::setZRot( double z )
+{
+ zrot = z;
+ update();
+}
+
+void GLWidget::setScale( double s )
+{
+ scale_ = s;
+ update();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/opengl/glwidget.h b/tqtinterface/qt4/tools/designer/examples/opengl/glwidget.h
new file mode 100644
index 0000000..7efe658
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/opengl/glwidget.h
@@ -0,0 +1,75 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef GLWIDGET_H
+#define GLWIDGET_H
+
+#include <tqgl.h>
+
+class GLWidget : public TQGLWidget
+{
+ TQ_OBJECT
+ Q_PROPERTY( double xRot READ xRot WRITE setXRot )
+ Q_PROPERTY( double yRot READ yRot WRITE setYRot )
+ Q_PROPERTY( double zRot READ zRot WRITE setZRot )
+ Q_PROPERTY( double scale READ scale WRITE setScale )
+
+public:
+ GLWidget( TQWidget* tqparent, const char* name );
+ ~GLWidget();
+
+ double xRot() const { return xrot; }
+ double yRot() const { return yrot; }
+ double zRot() const { return zrot; }
+ double scale() const { return scale_; }
+
+public Q_SLOTS:
+ void setXRot( double );
+ void setYRot( double );
+ void setZRot( double );
+ void setScale( double );
+
+protected:
+ void initializeGL();
+ void paintGL();
+ void resizeGL( int w, int h );
+
+ virtual GLuint makeObject();
+
+private:
+ GLuint object;
+ GLfloat xrot, yrot, zrot, scale_;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/examples/opengl/main.cpp b/tqtinterface/qt4/tools/designer/examples/opengl/main.cpp
new file mode 100644
index 0000000..ec2ebbd
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/opengl/main.cpp
@@ -0,0 +1,305 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <widgetinterface.h>
+
+#include <tqobjectcleanuphandler.h>
+#include <tqpixmap.h>
+
+#include "glwidget.h"
+
+/* XPM */
+static char * cube_xmp[] = {
+"48 48 104 2",
+" c None",
+". c #30C230C22081",
+"X c #30C230C230C2",
+"o c #30C2410330C2",
+"O c #410330C24103",
+"+ c #410341034103",
+"@ c #514451445144",
+"# c #514461855144",
+"$ c #618551446185",
+"% c #618561856185",
+"& c #71C671C671C6",
+"* c #71C6820771C6",
+"= c #965882078617",
+"- c #861792488617",
+"; c #965892489658",
+": c #9658A2899658",
+"> c #9E79A2899E79",
+", c #AEBAAEBA9E79",
+"< c #AEBAAEBAAEBA",
+"1 c #AEBABEFBAEBA",
+"2 c #BEFBBEFBBEFB",
+"3 c #CF3CBEFBCF3C",
+"4 c #CF3CCF3CCF3C",
+"5 c #DF7DCF3CCF3C",
+"6 c #DF7DDF7DCF3C",
+"7 c #DF7DDF7DDF7D",
+"8 c #EFBEDF7DDF7D",
+"9 c #DF7DEFBEDF7D",
+"0 c #EFBEDF7DEFBE",
+"q c #EFBEEFBEDF7D",
+"w c #208130C22081",
+"e c #410351445144",
+"r c #514451446185",
+"t c #71C6618571C6",
+"y c #861771C68617",
+"u c #9E7992489E79",
+"i c #9E79AEBA9E79",
+"p c #BEFBAEBABEFB",
+"a c #BEFBCF3CBEFB",
+"s c #BEFBCF3CCF3C",
+"d c #CF3CCF3CDF7D",
+"f c #CF3CDF7DCF3C",
+"g c #DF7DDF7DEFBE",
+"h c #208120812081",
+"j c #30C2208130C2",
+"k c #410330C230C2",
+"l c #4103410330C2",
+"z c #410351444103",
+"x c #618551445144",
+"c c #618561855144",
+"v c #618571C66185",
+"b c #861771C671C6",
+"n c #8617820771C6",
+"m c #965882079658",
+"M c #9E7992489658",
+"N c #AEBAA289AEBA",
+"B c #BEFBAEBAAEBA",
+"V c #DF7DCF3CDF7D",
+"C c #CF3CDF7DDF7D",
+"Z c #208120811040",
+"A c #965892488617",
+"S c #104020812081",
+"D c #861782078617",
+"F c #861792489658",
+"G c #965892489E79",
+"H c #104020811040",
+"J c #208110402081",
+"K c #30C220812081",
+"L c #BEFBBEFBCF3C",
+"P c #104010401040",
+"I c #208110401040",
+"U c #618571C671C6",
+"Y c #71C671C68617",
+"T c #71C682078617",
+"R c #CF3CBEFBBEFB",
+"E c #CF3CCF3CBEFB",
+"W c #000010401040",
+"Q c #104010402081",
+"! c #9E79AEBAAEBA",
+"~ c #104010400000",
+"^ c #AEBAA2899E79",
+"/ c #71C671C66185",
+"( c #000010400000",
+") c #000000000000",
+"_ c #104000001040",
+"` c #2081208130C2",
+"' c #9658A2899E79",
+"] c #104000000000",
+"[ c #000000001040",
+"{ c #30C241034103",
+"} c #9E79A289AEBA",
+"| c #AEBABEFBBEFB",
+" . c #514461856185",
+".. c #9E79A2899658",
+"X. c #71C661856185",
+"o. c #30C230C24103",
+"O. c #514441035144",
+"+. c #514451444103",
+"@. c #410341035144",
+"#. c #AEBAAEBABEFB",
+"$. c #208130C230C2",
+"%. c #6185618571C6",
+"&. c #514441034103",
+"*. c #861782079658",
+" . X o O + @ # $ % & * = - ; : > , < 1 2 2 3 4 5 6 7 7 8 9 0 q ",
+" w X X O + @ e r % t & y - ; : u i < < p a 3 s d f 7 7 g 9 0 9 ; ",
+" h j X k l + z x c t v b n m ; M > N < B 2 2 a 3 4 V 6 7 7 0 9 m ; ",
+" h h w X f d f d f V f V f 7 f 7 C 7 f V f V f d f V f 7 9 g 9 m ; ; ",
+" Z h w j - 4 4 5 4 5 4 5 4 V f V 6 V f V f V 4 5 4 5 4 V 7 7 7 m A ; ; ",
+" S h h j - D s 4 4 4 4 4 4 4 4 d f V f d f d 4 d 4 4 4 V C 7 7 m - ; F G ",
+" H J Z K * D D m ; M 5 4 V 7 = D m - ; ; ",
+" H h S h * y D L F ; : 4 f V C D D m a ; ; G ",
+" P I H J & b n 2 2 m A M 3 4 5 f y D = 2 2 A ; ; ",
+" P P H J U Y & p 1 2 - ; : 4 4 d f y T D 1 p 1 ; F G ",
+" P P H J % t & < < < m ; u R E 4 f b * y B < < A ; ; ",
+" W P P Q % t v < ! < - ; : L a 4 4 & * y < < ! ; ; G ",
+" ~ P ~ I c $ % > ^ > m ; M 2 2 3 4 t / b ^ i ^ ; M ; ",
+" ( P W P # $ % > > > F ; : p a 3 s t U & > > > ; ; G ",
+" ) _ ( _ @ $ # M ; u m ; u p 2 2 a % v t M ; u ; M ; ",
+" ( _ ( P P P H h h ` w X o : ; F F ; : & * D - G ' > i < 1 2 a % v t : ; F ; : u ",
+" ) ] ( _ ~ P P I Z h w j X O m - m ; ; M & y - m ; > i N < 2 2 $ c % m - m ; M : ",
+") [ ( _ W P P Q H h h j X O { D D - F G : y T m ; u > } < p | r .% D D - G : u ",
+"V f 5 4 5 f V f V f V f V f V y * y m ; u f 5 f V f 5 4 V f x @ $ y * y : u ..",
+"4 d f 4 f d f d 4 d f V f V f U & U F G : d f d f d f 4 4 d @ r # U & U G : > ",
+"3 4 3 E 4 E 4 4 3 4 4 4 5 4 5 t v X.; ; u 4 4 4 4 E 4 E 3 4 @ @ x t v X.; u ..",
+"a 4 a o.{ + .% v ; G > 3 a 4 e @ # .% v u ' > ",
+"3 2 3 X O o $ # $ ; ; u 2 3 2 O.+.@ $ # $ : u > ",
+"a 2 a X o + @ @ @ ; u ' 2 2 2 z @ @ @ @ @ u > } ",
+"p < p X k l O.z O.; : u 1 p < O.+.@ O.z O...> i ",
+"1 < 1 o.o + @.z @.; G > #.1 < z O.@ + @.z > > } ",
+"N , N X O o l + o ; ; u 1 1 1 O.+.@ O l + : u > ",
+"i } i o.o + O o o.; u o + z @ # % v } i } e @ @ } < #.| L a 4 f V o o.o G ' > ",
+"> ..u o O + . X . ; o O + O.@ $ % & u u ..@ @ x , < 1 2 2 3 4 5 6 X . X ; u ..",
+"' u : O + + j $.j $.o.{ O.e r % %.U G : u @ r # < < p 2 3 s d f 7 $.j $.u : u ",
+"; A M l + + h j . K h j h K h h h h ; ; A x @ $ h h h h h K h j 6 7 7 0 : u ..",
+"- m - + { @. h h w %.w h h h h h S h S m - m # r # h S h S h h h f 7 9 g F G : ",
+"y D D l + + Z h h t % h Z J Z J Z J Z J D y D x # $ H J Z J Z J f V 7 7 - M ; ",
+"* y * + z O. S h h & U t y * y @ $ . 4 d C 7 - m ; ",
+"& / b l + + P J Z y & t & & / x c $ E 5 4 V n = D ",
+"v %.v + z O. H J H D * & & v %.# % . a 4 f V * D - ",
+"X.% % + &.z P P H D n y c $ % $ c $ a 3 4 V * y D ",
+"# $ # + z @ P P H J m - D $ # $ # $ % 2 3 4 d * y T ",
+"@ @ x + + z W P P Q m D m @ @ @ $ c % 2 R E 4 & b * ",
+"z O.e + z @ P ~ I ; ; *. @ z O. .% % L s 4 U & * ",
+"&.+ &.l &.+.W P M ; m + &.+ $ c X.2 3 v t & ",
+"{ + { @.z O._ u ' ; + { + .$ % 3 v t & ",
+"O o k + O.P P P H h h ` w X o l + z @ c X./ b n m ; u o O o $ % % % t v ",
+"$.X $.@._ ~ P P I Z h w j X O + + @ # % v & * D - ; : X $.X .% v %.v ",
+"j . j _ W P P Q H h h j X O { + &.@ $ c t & y D m ; > . j . % c X.% ",
+"w j w ` w j w ` w ` h ` h h S h h h h ` h ` w ` w j w ` w j .% % ",
+"h h K h h h h h h h J h J H J Z J H J h h h h h h h J h h h $ % ",
+"S h h h H h S h S h S h H Q H J H Q H h H h S h S h S h S h . "};
+
+
+class OpenGLWidgetInterface : public WidgetInterface
+{
+public:
+ OpenGLWidgetInterface();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface ** );
+ TQ_REFCOUNT;
+
+ TQStringList featureList() const;
+
+ TQWidget* create( const TQString &classname, TQWidget* tqparent = 0, const char* name = 0 );
+ TQString group( const TQString& ) const;
+ TQIconSet iconSet( const TQString& ) const;
+ TQString includeFile( const TQString& ) const;
+ TQString toolTip( const TQString& ) const;
+ TQString whatsThis( const TQString& ) const;
+ bool isContainer( const TQString& ) const;
+
+private:
+ TQObjectCleanupHandler objects;
+};
+
+OpenGLWidgetInterface::OpenGLWidgetInterface()
+{
+}
+
+TQStringList OpenGLWidgetInterface::featureList() const
+{
+ TQStringList list;
+
+ list << "GLWidget";
+
+ return list;
+}
+
+TQWidget* OpenGLWidgetInterface::create( const TQString &description, TQWidget* tqparent, const char* name )
+{
+ TQWidget* w = 0;
+
+ if ( description == "GLWidget" )
+ w = new GLWidget( tqparent, name );
+
+ objects.add( w );
+ return w;
+}
+
+TQString OpenGLWidgetInterface::group( const TQString &description ) const
+{
+ if ( description == "GLWidget" )
+ return "Views";
+ return TQString();
+}
+
+TQIconSet OpenGLWidgetInterface::iconSet( const TQString &description ) const
+{
+ if ( description == "GLWidget" )
+ return TQIconSet( (const char**)cube_xmp );
+ return TQIconSet();
+}
+
+TQString OpenGLWidgetInterface::includeFile( const TQString &description ) const
+{
+ if ( description == "GLWidget" )
+ return "glwidget.h";
+ return TQString();
+}
+
+TQString OpenGLWidgetInterface::toolTip( const TQString &description ) const
+{
+ if ( description == "GLWidget" )
+ return TQT_TR_NOOP("OpenGL Widget");
+ return TQString();
+}
+
+TQString OpenGLWidgetInterface::whatsThis( const TQString &description ) const
+{
+ if ( description == "GLWidget" )
+ return "A widget for OpenGL rendering";
+ return TQString();
+}
+
+bool OpenGLWidgetInterface::isContainer( const TQString& ) const
+{
+ return FALSE;
+}
+
+TQRESULT OpenGLWidgetInterface::queryInterface( const TQUuid& uuid, TQUnknownInterface **iface )
+{
+ *iface = 0;
+
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_TQFeatureList )
+ *iface = (TQFeatureListInterface*)this;
+ else if ( uuid == IID_Widget )
+ *iface = (WidgetInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQ_EXPORT_COMPONENT()
+{
+ TQ_CREATE_INSTANCE( OpenGLWidgetInterface );
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/opengl/opengl.pro b/tqtinterface/qt4/tools/designer/examples/opengl/opengl.pro
new file mode 100644
index 0000000..d28eb32
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/opengl/opengl.pro
@@ -0,0 +1,11 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release plugin
+HEADERS = glwidget.h
+SOURCES = main.cpp \
+ glwidget.cpp
+DESTDIR = ../../../../plugins/designer
+INCLUDEPATH += ../../interfaces
+
+TARGET = glwidget
+target.path += $$plugins.path/designer
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver1/main.cpp b/tqtinterface/qt4/tools/designer/examples/receiver1/main.cpp
new file mode 100644
index 0000000..794c4ab
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver1/main.cpp
@@ -0,0 +1,24 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include "mainform.h"
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ MainForm *mainForm = new MainForm;
+ app.setMainWidget( mainForm );
+ mainForm->show();
+
+ return app.exec();
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui b/tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui
new file mode 100644
index 0000000..863b20c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui
@@ -0,0 +1,87 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MainForm</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>MainForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>389</width>
+ <height>115</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Main Form</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>quitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>creditPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Credit Dialog</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Credit Rating</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>ratingTextLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Unrated</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>creditPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>creditDialog()</slot>
+ </connection>
+ <connection>
+ <sender>quitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">tqspinbox.h</include>
+ <include location="global" impldecl="in implementation">tqwidgetfactory.h</include>
+ <include location="local" impldecl="in implementation">mainform.ui.h</include>
+</includes>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot>creditDialog()</slot>
+</Q_SLOTS>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui.h b/tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui.h
new file mode 100644
index 0000000..e19324e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver1/mainform.ui.h
@@ -0,0 +1,25 @@
+void MainForm::init()
+{
+
+}
+
+void MainForm::destroy()
+{
+
+}
+
+void MainForm::creditDialog()
+{
+ TQDialog *creditForm = (TQDialog *)
+ TQWidgetFactory::create( "../credit/creditformbase.ui" );
+ // Set up the dynamic dialog here
+
+ if ( creditForm->exec() ) {
+ // The user accepted, act accordingly
+ TQSpinBox *amount = (TQSpinBox *) creditForm->child( "amountSpinBox", "TQSpinBox" );
+ if ( amount )
+ ratingTextLabel->setText( amount->text() );
+ }
+ delete creditForm;
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver1/receiver.pro b/tqtinterface/qt4/tools/designer/examples/receiver1/receiver.pro
new file mode 100644
index 0000000..0758559
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver1/receiver.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = receiver
+
+CONFIG += qt warn_on release
+INCLUDEPATH += $$QT_SOURCE_TREE/tools/designer/uilib
+LIBS += -lqui
+SOURCES += main.cpp
+IMAGEFILE = images.cpp
+FORMS = mainform.ui
+DBFILE = receiver.db
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver2/main.cpp b/tqtinterface/qt4/tools/designer/examples/receiver2/main.cpp
new file mode 100644
index 0000000..8d0b761
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver2/main.cpp
@@ -0,0 +1,25 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include "mainform.h"
+
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ MainForm *mainForm = new MainForm;
+ app.setMainWidget( mainForm );
+ mainForm->show();
+
+ return app.exec();
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui b/tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui
new file mode 100644
index 0000000..cdcc140
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui
@@ -0,0 +1,82 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MainForm</class>
+<include location="global" impldecl="in implementation">tqwidgetfactory.h</include>
+<include location="global" impldecl="in implementation">tqspinbox.h</include>
+<include location="local" impldecl="in implementation">receiver.h</include>
+<include location="local" implDecl="in declaration">mainform.ui.h</include>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>MainForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>373</width>
+ <height>107</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Main Form</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>quitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>creditPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Credit Dialog</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Credit Rating</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>ratingTextLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Unrated</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>creditPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>creditDialog()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>quitPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainForm</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">creditDialog()</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui.h b/tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui.h
new file mode 100644
index 0000000..65f2ef9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver2/mainform.ui.h
@@ -0,0 +1,20 @@
+void MainForm::creditDialog()
+{
+ Receiver *receiver = new Receiver;
+ TQDialog *creditForm = (TQDialog *)
+ TQWidgetFactory::create( "../credit/creditformbase.ui", receiver );
+ receiver->setParent( creditForm );
+
+ // Set up the dynamic dialog here
+
+ if ( creditForm->exec() ) {
+ // The user accepted, act accordingly
+ TQSpinBox *amount = (TQSpinBox *) creditForm->child( "amountSpinBox", "TQSpinBox" );
+ if ( amount )
+ ratingTextLabel->setText( amount->text() );
+ }
+
+ delete receiver;
+ delete creditForm;
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.cpp b/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.cpp
new file mode 100644
index 0000000..dd40459
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.cpp
@@ -0,0 +1,29 @@
+#include <tqradiobutton.h>
+#include <tqspinbox.h>
+#include "receiver.h"
+
+void Receiver::setParent( TQDialog *tqparent )
+{
+ p = tqparent;
+ setAmount();
+}
+
+void Receiver::setAmount()
+{
+ TQSpinBox *amount =
+ (TQSpinBox *) p->child( "amountSpinBox", "TQSpinBox" );
+
+ TQRadioButton *radio =
+ (TQRadioButton *) p->child( "stdRadioButton", "TQRadioButton" );
+ if ( radio && radio->isChecked() ) {
+ if ( amount )
+ amount->setValue( amount->maxValue() / 2 );
+ return;
+ }
+
+ radio =
+ (TQRadioButton *) p->child( "noneRadioButton", "TQRadioButton" );
+ if ( radio && radio->isChecked() )
+ if ( amount )
+ amount->setValue( amount->minValue() );
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.h b/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.h
new file mode 100644
index 0000000..5d0867f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.h
@@ -0,0 +1,13 @@
+#include <tqobject.h>
+#include <tqdialog.h>
+
+class Receiver : public TQObject
+{
+ TQ_OBJECT
+public:
+ void setParent( TQDialog *tqparent );
+public Q_SLOTS:
+ void setAmount();
+private:
+ TQDialog *p;
+};
diff --git a/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.pro b/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.pro
new file mode 100644
index 0000000..5c7bf79
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/receiver2/receiver.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = receiver
+
+CONFIG += qt warn_on release
+INCLUDEPATH += $$QT_SOURCE_TREE/tools/designer/uilib
+LIBS += -lqui
+SOURCES += main.cpp receiver.cpp
+HEADERS += receiver.h
+FORMS = mainform.ui
+DBFILE = receiver.db
+IMAGEFILE = images.cpp
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/editcopy.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/editcopy.png
new file mode 100644
index 0000000..abfe86e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/editcut.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/editcut.png
new file mode 100644
index 0000000..2d179bc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/editpaste.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/editpaste.png
new file mode 100644
index 0000000..356ee55
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/editpaste.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/filenew.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/filenew.png
new file mode 100644
index 0000000..9853d97
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/filenew.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/fileopen.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/fileopen.png
new file mode 100644
index 0000000..85dab43
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/filesave.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/filesave.png
new file mode 100644
index 0000000..21309aa
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/redo.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/redo.png
new file mode 100644
index 0000000..857d093
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/redo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/textbold.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/textbold.png
new file mode 100644
index 0000000..c51e5c0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/textbold.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/textcenter.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/textcenter.png
new file mode 100644
index 0000000..032a9bb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/textcenter.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/textitalic.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/textitalic.png
new file mode 100644
index 0000000..b725b43
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/textitalic.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/textleft.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/textleft.png
new file mode 100644
index 0000000..4ef081f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/textleft.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/textright.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/textright.png
new file mode 100644
index 0000000..a9b2b55
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/textright.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/textunder.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/textunder.png
new file mode 100644
index 0000000..5093509
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/textunder.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/images/undo.png b/tqtinterface/qt4/tools/designer/examples/richedit/images/undo.png
new file mode 100644
index 0000000..9346c6c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/images/undo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/main.cpp b/tqtinterface/qt4/tools/designer/examples/richedit/main.cpp
new file mode 100644
index 0000000..c2053ee
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/main.cpp
@@ -0,0 +1,25 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of an example program for TQt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include <tqapplication.h>
+#include "richedit.h"
+
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ EditorForm richeditForm;
+ app.setMainWidget( &richeditForm );
+ richeditForm.show();
+
+ return app.exec();
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/richedit.pro b/tqtinterface/qt4/tools/designer/examples/richedit/richedit.pro
new file mode 100644
index 0000000..bcc3d4d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/richedit.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+TARGET = richedit
+LANGUAGE = C++
+
+CONFIG += qt warn_on release
+SOURCES += main.cpp
+IMAGEFILE = images.cpp
+FORMS = richedit.ui
+IMAGES = images/editcopy.png images/editcut.png images/editpaste.png images/filenew.png images/fileopen.png images/filesave.png images/redo.png images/textbold.png images/textcenter.png images/textitalic.png images/textleft.png images/textright.png images/textunder.png images/undo.png
+DBFILE = richedit.db
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui b/tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui
new file mode 100644
index 0000000..eda509d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui
@@ -0,0 +1,612 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>EditorForm</class>
+<include location="global" impldecl="in implementation">qfile.h</include>
+<include location="global" impldecl="in implementation">qfontdatabase.h</include>
+<include location="global" impldecl="in implementation">qmessagebox.h</include>
+<include location="global" impldecl="in implementation">qapplication.h</include>
+<include location="global" impldecl="in implementation">qfiledialog.h</include>
+<include location="global" impldecl="in implementation">qtextstream.h</include>
+<include location="local" implDecl="in declaration">richedit.ui.h</include>
+<variable>QString fileName;</variable>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQMainWindow">
+ <property name="name">
+ <cstring>EditorForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>646</width>
+ <height>436</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Rich Edit</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTextEdit">
+ <property name="name">
+ <cstring>textEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ </widget>
+ </hbox>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <item text="&amp;File" name="fileMenu">
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <action name="fileSaveAsAction"/>
+ <separator/>
+ <action name="fileExitAction"/>
+ </item>
+ <item text="&amp;Edit" name="editMenu">
+ <action name="editUndoAction"/>
+ <action name="editRedoAction"/>
+ <separator/>
+ <action name="editCutAction"/>
+ <action name="editCopyAction"/>
+ <action name="editPasteAction"/>
+ </item>
+ <item text="F&amp;ormat" name="PopupMenu_2">
+ <action name="leftAlignAction"/>
+ <action name="rightAlignAction"/>
+ <action name="centerAlignAction"/>
+ <separator/>
+ <action name="boldAction"/>
+ <action name="italicAction"/>
+ <action name="underlineAction"/>
+ </item>
+ <item text="&amp;Help" name="helpMenu">
+ <action name="helpContentsAction"/>
+ <action name="helpIndexAction"/>
+ <separator/>
+ <action name="helpAboutAction"/>
+ </item>
+</menubar>
+<toolbars>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>toolBar</cstring>
+ </property>
+ <property name="label">
+ <string>Tools</string>
+ </property>
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <separator/>
+ <action name="editUndoAction"/>
+ <action name="editRedoAction"/>
+ <action name="editCutAction"/>
+ <action name="editCopyAction"/>
+ <action name="editPasteAction"/>
+ </toolbar>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>Toolbar</cstring>
+ </property>
+ <property name="label">
+ <string>Toolbar</string>
+ </property>
+ <action name="leftAlignAction"/>
+ <action name="centerAlignAction"/>
+ <action name="rightAlignAction"/>
+ <separator/>
+ <action name="boldAction"/>
+ <action name="italicAction"/>
+ <action name="underlineAction"/>
+ <separator/>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>fontComboBox</cstring>
+ </property>
+ </widget>
+ <widget class="TQSpinBox">
+ <property name="name">
+ <cstring>SpinBox2</cstring>
+ </property>
+ <property name="minValue">
+ <number>6</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ </widget>
+ </toolbar>
+</toolbars>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>fileNewAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>filenew.png</iconset>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;New</string>
+ </property>
+ <property name="accel">
+ <number>4194382</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileOpenAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>fileopen.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Open...</string>
+ </property>
+ <property name="accel">
+ <number>4194383</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>filesave.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Save</string>
+ </property>
+ <property name="accel">
+ <number>4194387</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Save As</string>
+ </property>
+ <property name="menuText">
+ <string>Save &amp;As...</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileExitAction</cstring>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="menuText">
+ <string>E&amp;xit</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editUndoAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>undo.png</iconset>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Undo</string>
+ </property>
+ <property name="accel">
+ <number>4194394</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editRedoAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>redo.png</iconset>
+ </property>
+ <property name="text">
+ <string>Redo</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Redo</string>
+ </property>
+ <property name="accel">
+ <number>4194393</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCutAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>editcut.png</iconset>
+ </property>
+ <property name="text">
+ <string>Cut</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Cut</string>
+ </property>
+ <property name="accel">
+ <number>4194392</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCopyAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>editcopy.png</iconset>
+ </property>
+ <property name="text">
+ <string>Copy</string>
+ </property>
+ <property name="menuText">
+ <string>C&amp;opy</string>
+ </property>
+ <property name="accel">
+ <number>4194371</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editPasteAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>editpaste.png</iconset>
+ </property>
+ <property name="text">
+ <string>Paste</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Paste</string>
+ </property>
+ <property name="accel">
+ <number>4194390</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpContentsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Contents</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Contents...</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpIndexAction</cstring>
+ </property>
+ <property name="text">
+ <string>Index</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Index...</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpAboutAction</cstring>
+ </property>
+ <property name="text">
+ <string>About</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;About</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>boldAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>textbold.png</iconset>
+ </property>
+ <property name="text">
+ <string>bold</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Bold</string>
+ </property>
+ <property name="accel">
+ <number>272629826</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>italicAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>textitalic.png</iconset>
+ </property>
+ <property name="text">
+ <string>italic</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Italic</string>
+ </property>
+ <property name="accel">
+ <number>272629833</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>underlineAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>textunder.png</iconset>
+ </property>
+ <property name="text">
+ <string>underline</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Underline</string>
+ </property>
+ <property name="accel">
+ <number>272629845</number>
+ </property>
+ </action>
+ <actiongroup>
+ <property name="name">
+ <cstring>alignActionGroup</cstring>
+ </property>
+ <property name="text">
+ <string>align</string>
+ </property>
+ <property name="usesDropDown">
+ <bool>false</bool>
+ </property>
+ <action>
+ <property name="name">
+ <cstring>leftAlignAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>textleft.png</iconset>
+ </property>
+ <property name="text">
+ <string>left</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Left</string>
+ </property>
+ <property name="accel">
+ <number>272629836</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>rightAlignAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>textright.png</iconset>
+ </property>
+ <property name="text">
+ <string>right</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Right</string>
+ </property>
+ <property name="accel">
+ <number>272629842</number>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>centerAlignAction</cstring>
+ </property>
+ <property name="toggleAction">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>textcenter.png</iconset>
+ </property>
+ <property name="text">
+ <string>center</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Center</string>
+ </property>
+ </action>
+ </actiongroup>
+</actions>
+<connections>
+ <connection language="C++">
+ <sender>fileNewAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>fileNew()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>fileOpenAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>fileOpen()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>fileSaveAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>fileSave()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>fileSaveAsAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>fileSaveAs()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>fileExitAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>fileExit()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>helpIndexAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>helpIndex()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>helpContentsAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>helpContents()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>helpAboutAction</sender>
+ <signal>activated()</signal>
+ <receiver>EditorForm</receiver>
+ <slot>helpAbout()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>SpinBox2</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>textEdit</receiver>
+ <slot>setPointSize(int)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editCutAction</sender>
+ <signal>activated()</signal>
+ <receiver>textEdit</receiver>
+ <slot>cut()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editPasteAction</sender>
+ <signal>activated()</signal>
+ <receiver>textEdit</receiver>
+ <slot>paste()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editCopyAction</sender>
+ <signal>activated()</signal>
+ <receiver>textEdit</receiver>
+ <slot>copy()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editRedoAction</sender>
+ <signal>activated()</signal>
+ <receiver>textEdit</receiver>
+ <slot>redo()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editUndoAction</sender>
+ <signal>activated()</signal>
+ <receiver>textEdit</receiver>
+ <slot>undo()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>alignActionGroup</sender>
+ <signal>selected(QAction*)</signal>
+ <receiver>EditorForm</receiver>
+ <slot>changeAlignment(QAction*)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>underlineAction</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textEdit</receiver>
+ <slot>setUnderline(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>italicAction</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textEdit</receiver>
+ <slot>setItalic(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>boldAction</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textEdit</receiver>
+ <slot>setBold(bool)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>fontComboBox</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>textEdit</receiver>
+ <slot>setFamily(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>fontComboBox</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>textEdit</receiver>
+ <slot>setFocus()</slot>
+ </connection>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">init()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">fileExit()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">fileNew()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">fileOpen()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">fileSave()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">fileSaveAs()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">helpAbout()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">helpContents()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">helpIndex()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">changeAlignment( QAction * align )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="int">saveAndContinue( const QString &amp; action )</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui.h b/tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui.h
new file mode 100644
index 0000000..087d8d0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/richedit/richedit.ui.h
@@ -0,0 +1,120 @@
+void EditorForm::init()
+{
+ textEdit->setFocus();
+
+ TQFontDatabase fonts;
+ fontComboBox->insertStringList( fonts.families() );
+ TQString font = textEdit->family();
+ font = font.lower();
+ for ( int i = 0 ; i < fontComboBox->count(); i++ ) {
+ if ( font == fontComboBox->text( i ) ) {
+ fontComboBox->setCurrentItem( i );
+ break;
+ }
+ }
+}
+
+void EditorForm::fileExit()
+{
+ if ( saveAndContinue( "Exit" ) )
+ tqApp->exit();
+}
+
+void EditorForm::fileNew()
+{
+ if ( saveAndContinue( "New" ) )
+ textEdit->clear();
+}
+
+void EditorForm::fileOpen()
+{
+ if ( saveAndContinue( "Open" ) ) {
+ TQString fn( TQFileDialog::getOpenFileName(
+ TQString(),
+ "Rich Text Files (*.htm*)", this ) );
+ if ( !fn.isEmpty() ) {
+ fileName = fn;
+ TQFile file( fileName );
+ if ( file.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &file );
+ textEdit->setText( ts.read() );
+ }
+ }
+ }
+}
+
+void EditorForm::fileSave()
+{
+ if ( fileName.isEmpty() ) {
+ fileSaveAs();
+ } else {
+ TQFile f( fileName );
+ if ( f.open( IO_WriteOnly ) ) {
+ TQTextStream ts( &f );
+ ts << textEdit->text();
+ textEdit->setModified( FALSE );
+ }
+ }
+}
+
+void EditorForm::fileSaveAs()
+{
+ TQString fn = TQFileDialog::getSaveFileName(
+ "", "Rich Text Files (*.htm*)", this );
+ if ( !fn.isEmpty() ) {
+ fileName = fn;
+ fileSave();
+ }
+}
+
+void EditorForm::helpAbout()
+{
+
+}
+
+void EditorForm::helpContents()
+{
+
+}
+
+void EditorForm::helpIndex()
+{
+
+}
+
+void EditorForm::changeAlignment(TQAction * align)
+{
+ if ( align == leftAlignAction )
+ textEdit->tqsetAlignment( TQt::AlignLeft );
+ else if ( align == rightAlignAction )
+ textEdit->tqsetAlignment( TQt::AlignRight );
+ else if ( align == centerAlignAction )
+ textEdit->tqsetAlignment( TQt::AlignCenter );
+}
+
+int EditorForm::saveAndContinue(const TQString & action)
+{
+ int continueAction = 1;
+
+ if ( textEdit->isModified() ) {
+ switch( TQMessageBox::information(
+ this, "Rich Edit",
+ "The document tqcontains unsaved changes.\n"
+ "Do you want to save the changes?",
+ "&Save", "&Don't Save", "&Cancel " + action,
+ 0, // Enter == button 0
+ 2 ) ) { // Escape == button 2
+ case 0: // Save; continue
+ fileSave();
+ break;
+ case 1: // Do not save; continue
+ break;
+ case 2: // Cancel
+ continueAction = 0;
+ break;
+ }
+ }
+
+ return continueAction;
+}
+
diff --git a/tqtinterface/qt4/tools/designer/examples/sizeaware/main.cpp b/tqtinterface/qt4/tools/designer/examples/sizeaware/main.cpp
new file mode 100644
index 0000000..11d4e15
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/sizeaware/main.cpp
@@ -0,0 +1,11 @@
+#include <tqapplication.h>
+#include "sizeaware.h"
+
+int main( int argc, char ** argv )
+{
+ TQApplication app( argc, argv );
+ SizeAware *sizeaware = new SizeAware( 0, 0, TRUE );
+ sizeaware->exec();
+ sizeaware->destroy();
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.cpp b/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.cpp
new file mode 100644
index 0000000..45c568e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.cpp
@@ -0,0 +1,38 @@
+#include "sizeaware.h"
+#include <tqsettings.h>
+
+
+SizeAware::SizeAware( TQDialog *tqparent, const char *name, bool modal )
+ : TQDialog( tqparent, name, modal )
+{
+ if ( company().isEmpty() )
+ setCompany( "UnknownCompany" );
+ if ( settingsFile().isEmpty() )
+ setSettingsFile( "UnknownFile" );
+
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, "/" + company() );
+ settings.insertSearchPath( TQSettings::Unix, "/Opt/" + company() + "/share" );
+ int width = settings.readNumEntry( "/" + settingsFile() + "/width", 640 );
+ int height = settings.readNumEntry( "/" + settingsFile() + "/height", 480 );
+ resize( width, height );
+}
+
+
+SizeAware::~SizeAware()
+{
+ // NOOP
+}
+
+void SizeAware::destroy()
+{
+ TQSettings settings;
+ settings.insertSearchPath( TQSettings::Windows, "/" + company() );
+ settings.insertSearchPath( TQSettings::Unix, "/Opt/" + company() + "/share" );
+ settings.writeEntry( "/" + settingsFile() + "/width", width() );
+ settings.writeEntry( "/" + settingsFile() + "/height", height() );
+ close( TRUE );
+}
+
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.h b/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.h
new file mode 100644
index 0000000..7cdca8f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.h
@@ -0,0 +1,23 @@
+#ifndef SIZEAWARE_H
+#define SIZEAWARE_H
+#include <tqdialog.h>
+
+class SizeAware : public TQDialog
+{
+ TQ_OBJECT
+ Q_PROPERTY( TQString company READ company WRITE setCompany )
+ Q_PROPERTY( TQString settingsFile READ settingsFile WRITE setSettingsFile )
+public:
+ SizeAware( TQDialog *tqparent = 0, const char *name = 0, bool modal = FALSE );
+ ~SizeAware();
+ void setCompany( TQString company ) { m_company = company; }
+ TQString company() const { return m_company; }
+ void setSettingsFile( TQString settingsFile ) { m_settingsFile = settingsFile; }
+ TQString settingsFile() const { return m_settingsFile; }
+public Q_SLOTS:
+ void destroy();
+private:
+ TQString m_company;
+ TQString m_settingsFile;
+};
+#endif
diff --git a/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.pro b/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.pro
new file mode 100644
index 0000000..c223ed7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/sizeaware/sizeaware.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = sizeaware
+
+CONFIG += qt warn_on release
+SOURCES += sizeaware.cpp main.cpp
+HEADERS += sizeaware.h
diff --git a/tqtinterface/qt4/tools/designer/examples/vcr/main.cpp b/tqtinterface/qt4/tools/designer/examples/vcr/main.cpp
new file mode 100644
index 0000000..71f04f8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/vcr/main.cpp
@@ -0,0 +1,10 @@
+#include <tqapplication.h>
+#include "vcr.h"
+
+int main( int argc, char ** argv )
+{
+ TQApplication app( argc, argv );
+ Vcr *vcr = new Vcr;
+ vcr->show();
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/examples/vcr/play.xpm b/tqtinterface/qt4/tools/designer/examples/vcr/play.xpm
new file mode 100644
index 0000000..8102ed1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/vcr/play.xpm
@@ -0,0 +1,23 @@
+/* XPM */
+static char * play_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"................",
+".++.............",
+".++++...........",
+".++++++.........",
+".++++++++.......",
+".++++++++++.....",
+".++++++++++++...",
+".+++++++++++++..",
+".+++++++++++++..",
+".++++++++++++...",
+".++++++++++.....",
+".++++++++.......",
+".++++++.........",
+".++++...........",
+".+++............",
+"................"};
+
diff --git a/tqtinterface/qt4/tools/designer/examples/vcr/vcr.cpp b/tqtinterface/qt4/tools/designer/examples/vcr/vcr.cpp
new file mode 100644
index 0000000..c22fb1d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/vcr/vcr.cpp
@@ -0,0 +1,117 @@
+#include "vcr.h"
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+
+static const char * rewind_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"................",
+".++..........++.",
+".++........++++.",
+".++......++++++.",
+".++....++++++++.",
+".++..++++++++++.",
+".++++++++++++++.",
+".++++++++++++++.",
+".++++++++++++++.",
+".++++++++++++++.",
+".++..++++++++++.",
+".++....++++++++.",
+".++......++++++.",
+".++........++++.",
+".++.........+++.",
+"................"};
+
+static const char * play_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"................",
+".++.............",
+".++++...........",
+".++++++.........",
+".++++++++.......",
+".++++++++++.....",
+".++++++++++++...",
+".+++++++++++++..",
+".+++++++++++++..",
+".++++++++++++...",
+".++++++++++.....",
+".++++++++.......",
+".++++++.........",
+".++++...........",
+".+++............",
+"................"};
+
+static const char * next_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"................",
+".++.....+.......",
+".+++....++......",
+".++++...+++.....",
+".+++++..++++....",
+".++++++.+++++...",
+".+++++++++++++..",
+".++++++++++++++.",
+".++++++++++++++.",
+".+++++++++++++..",
+".++++++.+++++...",
+".+++++..++++....",
+".++++...+++.....",
+".+++....++......",
+".++.....+.......",
+"................"};
+
+static const char * stop_xpm[] = {
+"16 16 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+"................",
+".++++++++++++++.",
+".++++++++++++++.",
+".++++++++++++++.",
+".+++........+++.",
+".+++........+++.",
+".+++........+++.",
+".+++........+++.",
+".+++........+++.",
+".+++........+++.",
+".+++........+++.",
+".+++........+++.",
+".++++++++++++++.",
+".++++++++++++++.",
+".++++++++++++++.",
+"................"};
+
+
+Vcr::Vcr( TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
+{
+ TQHBoxLayout *tqlayout = new TQHBoxLayout( this );
+ tqlayout->setMargin( 0 );
+
+ TQPushButton *rewind = new TQPushButton( TQPixmap( rewind_xpm ), 0, this, "vcr_rewind" );
+ tqlayout->addWidget( rewind );
+ connect( rewind, TQT_SIGNAL(clicked()), TQT_SIGNAL(rewind()) );
+
+ TQPushButton *play = new TQPushButton( TQPixmap( play_xpm ), 0, this, "vcr_play" );
+ tqlayout->addWidget( play );
+ connect( play, TQT_SIGNAL(clicked()), TQT_SIGNAL(play()) );
+
+ TQPushButton *next = new TQPushButton( TQPixmap( next_xpm ), 0, this, "vcr_next" );
+ tqlayout->addWidget( next );
+ connect( next, TQT_SIGNAL(clicked()), TQT_SIGNAL(next()) );
+
+ TQPushButton *stop = new TQPushButton( TQPixmap( stop_xpm ), 0, this, "vcr_stop" );
+ tqlayout->addWidget( stop );
+ connect( stop, TQT_SIGNAL(clicked()), TQT_SIGNAL(stop()) );
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/examples/vcr/vcr.h b/tqtinterface/qt4/tools/designer/examples/vcr/vcr.h
new file mode 100644
index 0000000..1dccc8c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/vcr/vcr.h
@@ -0,0 +1,17 @@
+#ifndef VCR_H
+#define VCR_H
+#include <tqwidget.h>
+
+class Vcr : public TQWidget
+{
+ TQ_OBJECT
+public:
+ Vcr( TQWidget *tqparent = 0, const char *name = 0 );
+ ~Vcr() {}
+Q_SIGNALS:
+ void rewind();
+ void play();
+ void next();
+ void stop();
+};
+#endif
diff --git a/tqtinterface/qt4/tools/designer/examples/vcr/vcr.pro b/tqtinterface/qt4/tools/designer/examples/vcr/vcr.pro
new file mode 100644
index 0000000..8bda690
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/examples/vcr/vcr.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+LANGUAGE = C++
+TARGET = vcr
+
+CONFIG += qt warn_on release
+SOURCES += vcr.cpp main.cpp
+HEADERS += vcr.h
+DBFILE = vcr.db
diff --git a/tqtinterface/qt4/tools/designer/integration/designer.el b/tqtinterface/qt4/tools/designer/integration/designer.el
new file mode 100644
index 0000000..4449205
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/integration/designer.el
@@ -0,0 +1,19 @@
+(defvar designer-exec (concat (getenv "QTDIR") "/bin/designer"))
+
+(defun designer-open-ui-file ()
+ (interactive)
+ (defvar procname "designer")
+ (start-process procname nil designer-exec "-style" "windows" "-client" buffer-file-name)
+)
+
+(defun designer-create-ui-file (&optional arg)
+ (interactive "FNew UI-File: ")
+ (tqfind-file arg)
+ (insert "<UI></UI>")
+ (save-buffer)
+ (designer-open-ui-file)
+)
+
+;(global-set-key [f7] 'designer-open-ui-file)
+;(global-set-key [f8] 'designer-create-ui-file)
+
diff --git a/tqtinterface/qt4/tools/designer/interfaces/actioninterface.h b/tqtinterface/qt4/tools/designer/interfaces/actioninterface.h
new file mode 100644
index 0000000..14fa5b1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/actioninterface.h
@@ -0,0 +1,85 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef ACTIONINTERFACE_H
+#define ACTIONINTERFACE_H
+
+#include <private/tqcom_p.h>
+
+class TQAction;
+class TQObject;
+
+// {bb206e09-84e5-4777-9fce-706babfab931}
+#ifndef IID_Action
+#define IID_Action TQUuid( 0xbb206e09, 0x84e5, 0x4777, 0x9f, 0xce, 0x70, 0x6b, 0xab, 0xfa, 0xb9, 0x31 )
+#endif
+
+/*! To add actions to the TQt Designer menubars and toolbars, implement
+ this interface. You have to implement the create(), group() and
+ connectTo() functions.
+
+ You also have to implement the function featureList() (\sa
+ TQFeatureListInterface) to return the names of all actions
+ which this interface provides.
+*/
+
+class ActionInterface : public TQFeatureListInterface
+{
+public:
+ enum Location {
+ Toolbar,
+ Menu
+ };
+
+ /*! This functions is called to create the action with the name \a
+ name. \a tqparent should be used as tqparent of the action.
+
+ In the implementation return the TQAction object for the action
+ \a name.
+ */
+ virtual TQAction* create( const TQString &name, TQObject* tqparent = 0 ) = 0;
+
+ /*! In the implementation of the interface return the name of the
+ group of the action \a name.
+ */
+ virtual TQString group( const TQString &name ) const = 0;
+
+ /*! In the implementation of the interface return whether the
+ action \a name should appear in the location \a l */
+ virtual bool location( const TQString &name, Location l ) const = 0;
+
+ /*! \internal */
+ virtual void connectTo( TQUnknownInterface *appInterface ) = 0;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/classbrowserinterface.h b/tqtinterface/qt4/tools/designer/interfaces/classbrowserinterface.h
new file mode 100644
index 0000000..7e86ca8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/classbrowserinterface.h
@@ -0,0 +1,70 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CLASSBROWSERINTERFACE_H
+#define CLASSBROWSERINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+#include <tqobject.h>
+class TQListView;
+
+// {4ede3c32-ae96-4b7a-9e38-9f1d93592391}
+#ifndef IID_ClassBrowser
+#define IID_ClassBrowser TQUuid( 0x4ede3c32, 0xae96, 0x4b7a, 0x9e, 0x38, 0x9f, 0x1d, 0x93, 0x59, 0x23, 0x91 )
+#endif
+
+struct ClassBrowserInterface : public TQUnknownInterface
+{
+ enum Type { Class, Function };
+
+ virtual TQListView *createClassBrowser( TQWidget *tqparent ) const = 0;
+ virtual void update( const TQString &code ) const = 0;
+ virtual void clear() const = 0;
+
+ virtual void onClick( TQObject *receiver, const char *slot ) = 0;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/designerinterface.h b/tqtinterface/qt4/tools/designer/interfaces/designerinterface.h
new file mode 100644
index 0000000..279d7fa
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/designerinterface.h
@@ -0,0 +1,268 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DESIGNERINTERFACE_H
+#define DESIGNERINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+#include <tqptrlist.h>
+#include <tqstring.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
+#include <tqwidgetlist.h>
+#include <tqobjectlist.h>
+
+struct DesignerProject;
+struct DesignerDatabase;
+struct DesignerFormWindow;
+struct DesignerDock;
+struct DesignerOutputDock;
+struct DesignerOutput;
+struct DesignerOutputError;
+struct DesignerPixmapCollection;
+struct DesignerSourceFile;
+
+class TQDockWindow;
+class TQWidget;
+class TQObject;
+class TQAction;
+class TQIconSet;
+class TQSqlDatabase;
+
+// {0e661da-f45c-4830-af47-03ec53eb1633}
+#ifndef IID_Designer
+#define IID_Designer TQUuid( 0xa0e661da, 0xf45c, 0x4830, 0xaf, 0x47, 0x3, 0xec, 0x53, 0xeb, 0x16, 0x33 )
+#endif
+
+/*! These are the interfaces implemented by the TQt Designer which should
+ be used by plugins to access and use functionality of the TQt Designer.
+*/
+
+struct DesignerInterface : public TQUnknownInterface
+{
+ virtual DesignerProject *currentProject() const = 0;
+ virtual DesignerFormWindow *currentForm() const = 0;
+ virtual DesignerSourceFile *currentSourceFile() const = 0;
+ virtual TQPtrList<DesignerProject> projectList() const = 0;
+ virtual void showtqStatusMessage( const TQString &, int ms = 0 ) const = 0;
+ virtual DesignerDock *createDock() const = 0;
+ virtual DesignerOutputDock *outputDock() const = 0;
+ virtual void setModified( bool b, TQWidget *window ) = 0;
+ virtual void updateFunctionList() = 0;
+
+ virtual void onProjectChange( TQObject *receiver, const char *slot ) = 0;
+ virtual void onFormChange( TQObject *receiver, const char *slot ) = 0;
+
+ virtual bool singleProjectMode() const = 0;
+ virtual void showError( TQWidget *widget, int line, const TQString &message ) = 0;
+ virtual void runFinished() = 0;
+ virtual void showStackFrame( TQWidget *w, int line ) = 0;
+ virtual void showDebugStep( TQWidget *w, int line ) = 0;
+ virtual void runProjectPrecondition() = 0;
+ virtual void runProjectPostcondition( TQObjectList *l ) = 0;
+
+ };
+
+struct DesignerProject
+{
+ virtual TQPtrList<DesignerFormWindow> formList() const = 0;
+ virtual TQStringList formNames() const = 0;
+ virtual TQString formFileName( const TQString &form ) const = 0;
+ virtual void addForm( DesignerFormWindow * ) = 0;
+ virtual void removeForm( DesignerFormWindow * ) = 0;
+ virtual TQString fileName() const = 0;
+ virtual void setFileName( const TQString & ) = 0;
+ virtual TQString projectName() const = 0;
+ virtual void setProjectName( const TQString & ) = 0;
+ virtual TQString databaseFile() const = 0;
+ virtual void setDatabaseFile( const TQString & ) = 0;
+ virtual void setupDatabases() const = 0;
+ virtual TQPtrList<DesignerDatabase> databaseConnections() const = 0;
+ virtual void addDatabase( DesignerDatabase * ) = 0;
+ virtual void removeDatabase( DesignerDatabase * ) = 0;
+ virtual void save() const = 0;
+ virtual void setLanguage( const TQString & ) = 0;
+ virtual TQString language() const = 0;
+ virtual void setCustomSetting( const TQString &key, const TQString &value ) = 0;
+ virtual TQString customSetting( const TQString &key ) const = 0;
+ virtual DesignerPixmapCollection *pixmapCollection() const = 0;
+ virtual void breakPoints( TQMap<TQString, TQValueList<uint> > &bps ) const = 0;
+ virtual TQString breakPointCondition( TQObject *o, int line ) const = 0;
+ virtual void setBreakPointCondition( TQObject *o, int line, const TQString &condition ) = 0;
+ virtual void clearAllBreakpoints() const = 0;
+ virtual void setIncludePath( const TQString &platform, const TQString &path ) = 0;
+ virtual void setLibs( const TQString &platform, const TQString &path ) = 0;
+ virtual void setDefines( const TQString &platform, const TQString &path ) = 0;
+ virtual void setConfig( const TQString &platform, const TQString &config ) = 0;
+ virtual void setTemplate( const TQString &t ) = 0;
+ virtual TQString config( const TQString &platform ) const = 0;
+ virtual TQString libs( const TQString &platform ) const = 0;
+ virtual TQString defines( const TQString &platform ) const = 0;
+ virtual TQString includePath( const TQString &platform ) const = 0;
+ virtual TQString templte() const = 0;
+ virtual bool isGenericObject( TQObject *o ) const = 0;
+
+};
+
+struct DesignerDatabase
+{
+ virtual TQString name() const = 0;
+ virtual void setName( const TQString & ) = 0;
+ virtual TQString driver() const = 0;
+ virtual void setDriver( const TQString & ) = 0;
+ virtual TQString database() const = 0;
+ virtual void setDatabase( const TQString & ) = 0;
+ virtual TQString userName() const = 0;
+ virtual void setUserName( const TQString & ) = 0;
+ virtual TQString password() const = 0;
+ virtual void setPassword( const TQString & ) = 0;
+ virtual TQString hostName() const = 0;
+ virtual void setHostName( const TQString & ) = 0;
+ virtual TQStringList tables() const = 0;
+ virtual void setTables( const TQStringList & ) = 0;
+ virtual TQMap<TQString, TQStringList> fields() const = 0;
+ virtual void setFields( const TQMap<TQString, TQStringList> & ) = 0;
+ virtual void open( bool suppressDialog = FALSE ) const = 0;
+ virtual void close() const = 0;
+ virtual TQSqlDatabase* connection() = 0;
+
+};
+
+struct DesignerPixmapCollection
+{
+ virtual void addPixmap( const TQPixmap &p, const TQString &name, bool force ) = 0;
+ virtual TQPixmap pixmap( const TQString &name ) const = 0;
+};
+
+struct DesignerFormWindow
+{
+ virtual TQString name() const = 0;
+ virtual void setName( const TQString &n ) = 0;
+ virtual TQString fileName() const = 0;
+ virtual void setFileName( const TQString & ) = 0;
+ virtual void save() const = 0;
+ virtual bool isModified() const = 0;
+ virtual void insertWidget( TQWidget * ) = 0;
+ virtual void removeWidget( TQWidget * ) = 0;
+ virtual TQWidget *create( const char *className, TQWidget *tqparent, const char *name ) = 0;
+ virtual TQWidgetList widgets() const = 0;
+ virtual void undo() = 0;
+ virtual void redo() = 0;
+ virtual void cut() = 0;
+ virtual void copy() = 0;
+ virtual void paste() = 0;
+ virtual void adjustSize() = 0;
+ virtual void editConnections() = 0;
+ virtual void checkAccels() = 0;
+ virtual void layoutH() = 0;
+ virtual void layoutV() = 0;
+ virtual void layoutHSplit() = 0;
+ virtual void layoutVSplit() = 0;
+ virtual void layoutG() = 0;
+ virtual void layoutHContainer( TQWidget* w ) = 0;
+ virtual void layoutVContainer( TQWidget* w ) = 0;
+ virtual void layoutGContainer( TQWidget* w ) = 0;
+ virtual void breakLayout() = 0;
+ virtual void selectWidget( TQWidget * w ) = 0;
+ virtual void selectAll() = 0;
+ virtual void clearSelection() = 0;
+ virtual bool isWidgetSelected( TQWidget * ) const = 0;
+ virtual TQWidgetList selectedWidgets() const = 0;
+ virtual TQWidget *currentWidget() const = 0;
+ virtual TQWidget *form() const = 0;
+ virtual void setCurrentWidget( TQWidget * ) = 0;
+ virtual TQPtrList<TQAction> actionList() const = 0;
+ virtual TQAction *createAction( const TQString& text, const TQIconSet& icon, const TQString& menuText, int accel,
+ TQObject* tqparent, const char* name = 0, bool toggle = FALSE ) = 0;
+ virtual void addAction( TQAction * ) = 0;
+ virtual void removeAction( TQAction * ) = 0;
+ virtual void preview() const = 0;
+ virtual void addFunction( const TQCString &slot, const TQString &specifier, const TQString &access,
+ const TQString &type, const TQString &language, const TQString &returnType ) = 0;
+ virtual void addConnection( TQObject *sender, const char *signal, TQObject *receiver, const char *slot ) = 0;
+ virtual void setProperty( TQObject *o, const char *property, const TQVariant &value ) = 0;
+ virtual TQVariant property( TQObject *o, const char *property ) const = 0;
+ virtual void setPropertyChanged( TQObject *o, const char *property, bool changed ) = 0;
+ virtual bool isPropertyChanged( TQObject *o, const char *property ) const = 0;
+ virtual void setColumnFields( TQObject *o, const TQMap<TQString, TQString> & ) = 0;
+ virtual TQStringList implementationIncludes() const = 0;
+ virtual TQStringList declarationIncludes() const = 0;
+ virtual void setImplementationIncludes( const TQStringList &lst ) = 0;
+ virtual void setDeclarationIncludes( const TQStringList &lst ) = 0;
+ virtual TQStringList forwardDeclarations() const = 0;
+ virtual void setForwardDeclarations( const TQStringList &lst ) = 0;
+ virtual TQStringList signalList() const = 0;
+ virtual void setSignalList( const TQStringList &lst ) = 0;
+ virtual void addMenu( const TQString &text, const TQString &name ) = 0;
+ virtual void addMenuAction( const TQString &menu, TQAction *a ) = 0;
+ virtual void addMenuSeparator( const TQString &menu ) = 0;
+ virtual void addToolBar( const TQString &text, const TQString &name ) = 0;
+ virtual void addToolBarAction( const TQString &tb, TQAction *a ) = 0;
+ virtual void addToolBarSeparator( const TQString &tb ) = 0;
+
+ virtual void onModificationChange( TQObject *receiver, const char *slot ) = 0;
+};
+
+struct DesignerSourceFile
+{
+ virtual TQString fileName() const = 0;
+};
+
+struct DesignerDock
+{
+ virtual TQDockWindow *dockWindow() const = 0;
+};
+
+struct DesignerOutputDock
+{
+ virtual TQWidget *addView( const TQString &pageName ) = 0;
+ virtual void appendDebug( const TQString & ) = 0;
+ virtual void clearDebug() = 0;
+ virtual void appendError( const TQString &, int ) = 0;
+ virtual void clearError() = 0;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/editorinterface.h b/tqtinterface/qt4/tools/designer/interfaces/editorinterface.h
new file mode 100644
index 0000000..4a80a12
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/editorinterface.h
@@ -0,0 +1,109 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef EDITORINTERFACE_H
+#define EDITORINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+#include <tqmap.h>
+#include <tqvaluelist.h>
+
+class TQWidget;
+class TQObjectList;
+class TQObject;
+
+// {8668161a-6037-4220-86b6-ccaa20127df8}
+#ifndef IID_Editor
+#define IID_Editor TQUuid( 0x8668161a, 0x6037, 0x4220, 0x86, 0xb6, 0xcc, 0xaa, 0x20, 0x12, 0x7d, 0xf8 )
+#endif
+
+struct EditorInterface : public TQUnknownInterface
+{
+ enum Mode
+ {
+ Editing,
+ Debugging
+ };
+
+ virtual TQWidget *editor( bool readOnly,
+ TQWidget *tqparent,
+ TQUnknownInterface *designerIface ) = 0;
+
+ virtual void setText( const TQString &txt ) = 0;
+ virtual TQString text() const = 0;
+ virtual bool isUndoAvailable() const = 0;
+ virtual bool isRedoAvailable() const = 0;
+ virtual void undo() = 0;
+ virtual void redo() = 0;
+ virtual void cut() = 0;
+ virtual void copy() = 0;
+ virtual void paste() = 0;
+ virtual void selectAll() = 0;
+ virtual bool tqfind( const TQString &expr, bool cs, bool wo, bool forward, bool startAtCursor ) = 0;
+ virtual bool tqreplace( const TQString &tqfind, const TQString &tqreplace, bool cs, bool wo, bool forward, bool startAtCursor, bool tqreplaceAll ) = 0;
+ virtual void gotoLine( int line ) = 0;
+ virtual void indent() = 0;
+ virtual void scrollTo( const TQString &txt, const TQString &first ) = 0;
+ virtual void splitView() = 0;
+ virtual void setContext( TQObject *this_ ) = 0;
+ virtual void setError( int line ) = 0;
+ virtual void setStep( int line ) = 0;
+ virtual void setStackFrame( int line ) = 0;
+ virtual void clearStep() = 0;
+ virtual void clearStackFrame() = 0;
+ virtual void readSettings() = 0;
+ virtual void setModified( bool m ) = 0;
+ virtual bool isModified() const = 0;
+ virtual int numLines() const = 0;
+ virtual void breakPoints( TQValueList<uint> &l ) const = 0;
+ virtual void setBreakPoints( const TQValueList<uint> &l ) = 0;
+ virtual void setMode( Mode m ) = 0;
+
+ virtual void onBreakPointChange( TQObject *receiver, const char *slot ) = 0;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/filterinterface.h b/tqtinterface/qt4/tools/designer/interfaces/filterinterface.h
new file mode 100644
index 0000000..7db2155
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/filterinterface.h
@@ -0,0 +1,75 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef FILTERINTERFACE_H
+#define FILTERINTERFACE_H
+
+#include <private/tqcom_p.h>
+
+// {ea8cb381-59b5-44a8-bae5-9bea8295762a}
+#ifndef IID_ImportFilter
+#define IID_ImportFilter TQUuid( 0xea8cb381, 0x59b5, 0x44a8, 0xba, 0xe5, 0x9b, 0xea, 0x82, 0x95, 0x76, 0x2a )
+#endif
+
+/*! If you write a filter plugin to import dialogs or other user
+ interfaces from a different format than .ui into the TQt Designer,
+ implement this interface in that plugin.
+
+ You also have to implement the function featureList() (\sa
+ TQFeatureListInterface) and return there all filters (names of it)
+ which this interface provides.
+*/
+
+struct ImportFilterInterface : public TQFeatureListInterface
+{
+ /*! This function is called by TQt Designer to open the file \a
+ filename using the filter \a filter. TQt Designer expects to get
+ back one or more .ui files, which it can open then. In the
+ implementation of the interface you have to return these
+ filenames, which the filter created, in this function.*/
+ virtual TQStringList import( const TQString &filter, const TQString &filename ) = 0;
+};
+
+// *************** INTERNAL *************************
+
+// {c32a07e0-b006-471e-afca-d227457a1280}
+#ifndef IID_ExportFilterInterface
+#define IID_ExportFilterInterface TQUuid( 0xc32a07e0, 0xb006, 0x471e, 0xaf, 0xca, 0xd2, 0x27, 0x45, 0x7a, 0x12, 0x80 )
+#endif
+
+struct ExportFilterInterface : public TQFeatureListInterface
+{
+// virtual TQStringList export( const TQString& filter, const TQString& filename ) = 0;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/interpreterinterface.h b/tqtinterface/qt4/tools/designer/interfaces/interpreterinterface.h
new file mode 100644
index 0000000..b88461e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/interpreterinterface.h
@@ -0,0 +1,66 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef INTERPRETERINTERFACE_H
+#define INTERPRETERINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+
+class TQObject;
+
+// {11cad9ec-4e3c-418b-8e90-e1b8c0c1f48f}
+#ifndef IID_Interpreter
+#define IID_Interpreter TQUuid( 0x11cad9ec, 0x4e3c, 0x418b, 0x8e, 0x90, 0xe1, 0xb8, 0xc0, 0xc1, 0xf4, 0x8f )
+#endif
+
+struct InterpreterInterface : public TQUnknownInterface
+{
+ virtual void setBreakPoints( TQObject *obj, const TQValueList<uint> &lst ) = 0;
+};
+
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/languageinterface.h b/tqtinterface/qt4/tools/designer/interfaces/languageinterface.h
new file mode 100644
index 0000000..5c586ee
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/languageinterface.h
@@ -0,0 +1,138 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LANGUAGEINTERFACE_H
+#define LANGUAGEINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+#include <tqvaluelist.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
+#include <tqstrlist.h>
+
+// {f208499a-6f69-4883-9219-6e936e55a330}
+#ifndef IID_Language
+#define IID_Language TQUuid( 0xf208499a, 0x6f69, 0x4883, 0x92, 0x19, 0x6e, 0x93, 0x6e, 0x55, 0xa3, 0x30 )
+#endif
+
+struct LanguageInterface : public TQUnknownInterface
+{
+ struct Function
+ {
+ TQString name;
+ TQString body;
+ TQString returnType;
+ TQString comments;
+ int start;
+ int end;
+ TQString access;
+ bool operator==( const Function &f ) const {
+ return ( name == f.name &&
+ body == f.body &&
+ returnType == f.returnType &&
+ comments == f.comments );
+ }
+ };
+
+ struct Connection
+ {
+ TQString sender;
+ TQString signal;
+ TQString slot;
+ bool operator==( const Connection &c ) const {
+ return ( sender == c.sender &&
+ signal == c.signal &&
+ slot == c.slot );
+ }
+ };
+
+ enum Support
+ {
+ ReturnType,
+ ConnectionsToCustomSlots,
+ CompressProject
+ };
+
+ virtual void functions( const TQString &code, TQValueList<Function> *funcs ) const = 0;
+ virtual void connections( const TQString &code, TQValueList<Connection> *connections ) const = 0;
+ virtual TQString createFunctionStart( const TQString &className, const TQString &func,
+ const TQString &returnType, const TQString &access ) = 0;
+ virtual TQString createArguments( const TQString &cpp_signature ) = 0;
+ virtual TQString createEmptyFunction() = 0;
+ virtual TQStringList definitions() const = 0;
+ virtual TQStringList definitionEntries( const TQString &definition, TQUnknownInterface *designerIface ) const = 0;
+ virtual void setDefinitionEntries( const TQString &definition, const TQStringList &entries, TQUnknownInterface *designerIface ) = 0;
+ virtual bool supports( Support s ) const = 0;
+ virtual TQStringList fileFilterList() const = 0;
+ virtual TQStringList fileExtensionList() const = 0;
+ virtual void preferedExtensions( TQMap<TQString, TQString> &extensionMap ) const = 0;
+ virtual TQString projectKeyForExtension( const TQString &extension ) const = 0;
+ virtual void sourceProjectKeys( TQStringList &keys ) const = 0;
+ virtual TQString cleanSignature( const TQString &sig ) = 0;
+ virtual void loadFormCode( const TQString &form, const TQString &filename,
+ TQValueList<Function> &functions,
+ TQStringList &vars,
+ TQValueList<Connection> &connections ) = 0;
+ virtual TQString formCodeExtension() const = 0;
+
+ virtual bool canConnect( const TQString &signal, const TQString &slot ) = 0;
+
+ virtual void compressProject( const TQString &projectFile, const TQString &compressedFile,
+ bool withWarning ) = 0;
+ virtual TQString uncompressProject( const TQString &projectFile, const TQString &destDir ) = 0;
+ virtual TQString aboutText() const = 0;
+
+ virtual void addConnection( const TQString &sender, const TQString &signal,
+ const TQString &receiver, const TQString &slot,
+ TQString *code ) = 0;
+ virtual void removeConnection( const TQString &sender, const TQString &signal,
+ const TQString &receiver, const TQString &slot,
+ TQString *code ) = 0;
+ virtual TQStrList signalNames( TQObject *obj ) const = 0;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/preferenceinterface.h b/tqtinterface/qt4/tools/designer/interfaces/preferenceinterface.h
new file mode 100644
index 0000000..22e4f36
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/preferenceinterface.h
@@ -0,0 +1,75 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PREFERENCEINTERFACE_H
+#define PREFERENCEINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+#include <tqwidgetlist.h>
+#include <tqcstring.h>
+
+// {5c168ee7-4bee-469f-9995-6afdb04ce5a2}
+#ifndef IID_Preference
+#define IID_Preference TQUuid( 0x5c168ee7, 0x4bee, 0x469f, 0x99, 0x95, 0x6a, 0xfd, 0xb0, 0x4c, 0xe5, 0xa2 )
+#endif
+
+struct PreferenceInterface : public TQUnknownInterface
+{
+ struct Preference
+ {
+ TQWidget *tab;
+ TQString title;
+ TQObject *receiver;
+ const char *init_slot;
+ const char *accept_slot;
+ };
+
+ virtual Preference *preference() = 0;
+ virtual void connectTo( TQUnknownInterface *appInterface ) = 0;
+ virtual void deletePreferenceObject( Preference * ) = 0;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/projectsettingsiface.h b/tqtinterface/qt4/tools/designer/interfaces/projectsettingsiface.h
new file mode 100644
index 0000000..203d796
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/projectsettingsiface.h
@@ -0,0 +1,76 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PROJECTSETTINGSIFACE_H
+#define PROJECTSETTINGSIFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+#include <tqwidgetlist.h>
+#include <tqcstring.h>
+
+// {d332785d-17fb-4894-84fe-50dbd0ad9512}
+#ifndef IID_ProjectSettings
+#define IID_ProjectSettings TQUuid( 0xd332785d, 0x17fb, 0x4894, 0x84, 0xfe, 0x50, 0xdb, 0xd0, 0xad, 0x95, 0x12 )
+#endif
+
+struct ProjectSettingsInterface : public TQUnknownInterface
+{
+ struct ProjectSettings
+ {
+ TQWidget *tab;
+ TQString title;
+ TQObject *receiver;
+ const char *init_slot;
+ const char *accept_slot;
+ };
+
+ virtual ProjectSettings *projectSetting() = 0;
+ virtual TQStringList projectSettings() const = 0;
+ virtual void connectTo( TQUnknownInterface *appInterface ) = 0;
+ virtual void deleteProjectSettingsObject( ProjectSettings * ) = 0;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/sourcetemplateiface.h b/tqtinterface/qt4/tools/designer/interfaces/sourcetemplateiface.h
new file mode 100644
index 0000000..4892545
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/sourcetemplateiface.h
@@ -0,0 +1,72 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SOURCETEMPLATEIFACE_H
+#define SOURCETEMPLATEIFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+#include <tqstring.h>
+
+// {1b3446a4-1c71-424b-8789-1f34eb5697d8}
+#ifndef IID_SourceTemplate
+#define IID_SourceTemplate TQUuid( 0x1b3446a4, 0x1c71, 0x424b, 0x87, 0x89, 0x1f, 0x34, 0xeb, 0x56, 0x97, 0xd8 )
+#endif
+
+struct SourceTemplateInterface : public TQFeatureListInterface
+{
+ struct Source
+ {
+ TQString code;
+ enum Type { FileName, Unnamed, Invalid } type;
+ TQString filename;
+ TQString extension;
+ };
+ virtual Source create( const TQString &templ, TQUnknownInterface *appIface ) = 0;
+ virtual TQString language( const TQString &templ ) const = 0;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/templatewizardiface.h b/tqtinterface/qt4/tools/designer/interfaces/templatewizardiface.h
new file mode 100644
index 0000000..1cd80eb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/templatewizardiface.h
@@ -0,0 +1,67 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TEMPLATEWIZARDIFACE_H
+#define TEMPLATEWIZARDIFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/tqcom_p.h>
+
+class TQWidget;
+struct DesignerFormWindow;
+
+// {983d3eab-fea3-49cc-97ad-d8cc89b7c17b}
+#ifndef IID_TemplateWizard
+#define IID_TemplateWizard TQUuid( 0x983d3eab, 0xfea3, 0x49cc, 0x97, 0xad, 0xd8, 0xcc, 0x89, 0xb7, 0xc1, 0x7b )
+#endif
+
+class TemplateWizardInterface : public TQFeatureListInterface
+{
+public:
+ virtual void setup( const TQString &templ, TQWidget *widget, DesignerFormWindow *fw, TQUnknownInterface *appIface ) = 0;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/interfaces/widgetinterface.h b/tqtinterface/qt4/tools/designer/interfaces/widgetinterface.h
new file mode 100644
index 0000000..ffb2c7a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/interfaces/widgetinterface.h
@@ -0,0 +1,42 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef WIDGETINTERFACE_H
+#define WIDGETINTERFACE_H
+
+#include <private/tqwidgetinterface_p.h>
+
+#define WidgetInterface TQWidgetFactoryInterface
+#define IID_Widget IID_TQWidgetFactory
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/common.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/common.cpp
new file mode 100644
index 0000000..e757fe1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/common.cpp
@@ -0,0 +1,111 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "editorinterfaceimpl.h"
+#include "languageinterfaceimpl.h"
+#include "preferenceinterfaceimpl.h"
+#include "projectsettingsinterfaceimpl.h"
+#include "sourcetemplateinterfaceimpl.h"
+
+class CommonInterface : public TQComponentInformationInterface
+{
+public:
+ CommonInterface();
+ virtual ~CommonInterface();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface** );
+ TQ_REFCOUNT;
+
+ TQString name() const { return "C++"; }
+ TQString description() const { return "C++ Integration"; }
+ TQString version() const { return "0.1"; }
+ TQString author() const { return "Trolltech AS"; }
+
+private:
+ LanguageInterfaceImpl *langIface;
+ PreferenceInterfaceImpl *prefIface;
+ ProjectSettingsInterfaceImpl *proIface;
+ SourceTemplateInterfaceImpl *srcIface;
+
+};
+
+CommonInterface::CommonInterface()
+{
+ langIface = new LanguageInterfaceImpl( this );
+ langIface->addRef();
+ prefIface = new PreferenceInterfaceImpl( this );
+ prefIface->addRef();
+ proIface = new ProjectSettingsInterfaceImpl( this );
+ proIface->addRef();
+ srcIface = new SourceTemplateInterfaceImpl;
+ srcIface->addRef();
+}
+
+CommonInterface::~CommonInterface()
+{
+ langIface->release();
+ prefIface->release();
+ proIface->release();
+ srcIface->release();
+}
+
+TQRESULT CommonInterface::queryInterface( const TQUuid &uuid, TQUnknownInterface** iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_TQComponentInformation )
+ *iface = (TQComponentInformationInterface*)this;
+ else if ( uuid == IID_Editor )
+ *iface = new EditorInterfaceImpl;
+ else if ( uuid == IID_Language )
+ *iface = langIface;
+ else if ( uuid == IID_Preference )
+ *iface = prefIface;
+ else if ( uuid == IID_ProjectSettings )
+ *iface = proIface;
+ else if ( uuid == IID_SourceTemplate )
+ *iface = srcIface;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+
+TQ_EXPORT_COMPONENT()
+{
+ TQ_CREATE_INSTANCE( CommonInterface )
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp
new file mode 100644
index 0000000..00dca68
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp
@@ -0,0 +1,78 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "cppbrowser.h"
+#include <private/tqrichtext_p.h>
+#include <tqprocess.h>
+#include <tqmainwindow.h>
+#include <tqstatusbar.h>
+#include <editor.h>
+
+CppEditorBrowser::CppEditorBrowser( Editor *e )
+ : EditorBrowser( e )
+{
+}
+
+void CppEditorBrowser::showHelp( const TQString &w )
+{
+ TQString word( w );
+ if ( word[ 0 ] == 'Q' ) {
+ if ( word[ (int)word.length() - 1 ] == '&' ||
+ word[ (int)word.length() - 1 ] == '*' )
+ word.remove( word.length() - 1, 1 );
+ word = word.lower() + ".html";
+ TQStringList lst;
+ lst << "assistant" << "-file" << word;
+ TQProcess proc( lst );
+ proc.start();
+ return;
+ }
+
+ if ( word.tqfind( '(' ) != -1 ) {
+ TQString txt = "::" + word.left( word.tqfind( '(' ) );
+ TQTextDocument *doc = curEditor->document();
+ TQTextParagraph *p = doc->firstParagraph();
+ while ( p ) {
+ if ( p->string()->toString().tqfind( txt ) != -1 ) {
+ curEditor->setCursorPosition( p->paragId(), 0 );
+ return;
+ }
+ p = p->next();
+ }
+ }
+
+ TQMainWindow *mw = ::tqqt_cast<TQMainWindow*>(curEditor->tqtopLevelWidget());
+ if ( mw )
+ mw->statusBar()->message( tr( "Nothing available for '%1'" ).arg( w ), 1500 );
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.h
new file mode 100644
index 0000000..c906eaf
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.h
@@ -0,0 +1,50 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CPPBROWSER_H
+#define CPPBROWSER_H
+
+#include <browser.h>
+
+class CppEditorBrowser : public EditorBrowser
+{
+ TQ_OBJECT
+
+public:
+ CppEditorBrowser( Editor *e );
+ void showHelp( const TQString &word );
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp
new file mode 100644
index 0000000..46cd56e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp
@@ -0,0 +1,220 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "cppcompletion.h"
+#include <tqobject.h>
+#include <tqmetaobject.h>
+#include <tqobjectlist.h>
+#include <tqregexp.h>
+
+CppEditorCompletion::CppEditorCompletion( Editor *e )
+ : EditorCompletion( e )
+{
+}
+
+bool CppEditorCompletion::doObjectCompletion( const TQString &objName )
+{
+ if ( !ths )
+ return FALSE;
+ TQString object( objName );
+ int i = -1;
+ if ( ( i = object.tqfindRev( "->" ) ) != -1 )
+ object = object.mid( i + 2 );
+ if ( ( i = object.tqfindRev( "." ) ) != -1 )
+ object = object.mid( i + 1 );
+ object = object.simplifyWhiteSpace();
+ TQObject *obj = 0;
+ if ( ths->name() == object || object == "this" ) {
+ obj = ths;
+ } else {
+ obj = ths->child( object );
+ }
+
+ if ( !obj )
+ return FALSE;
+
+ TQValueList<CompletionEntry> lst;
+
+ if ( !obj->childrenListObject().isEmpty() ) {
+ for ( TQObjectListIt cit( obj->childrenListObject() ); cit.current(); ++cit ) {
+ TQString s( cit.current()->name() );
+ if ( s.tqfind( " " ) == -1 && s.tqfind( "qt_" ) == -1 && s.tqfind( "unnamed" ) == -1 ) {
+ CompletionEntry c;
+ c.type = "variable";
+ c.text = s;
+ c.prefix = "";
+ lst << c;
+ }
+ }
+ }
+
+ TQStrList props = obj->tqmetaObject()->propertyNames( TRUE );
+ for ( TQPtrListIterator<char> pit( props ); pit.current(); ++pit ) {
+ TQString f( pit.current() );
+ TQChar c = f[ 0 ];
+ f.remove( (uint)0, 1 );
+ f.prepend( c.upper() );
+ f.prepend( "set" );
+
+ CompletionEntry ce;
+ ce.type = "property";
+ ce.text = f;
+ ce.postfix = "()";
+
+ if ( lst.tqfind( ce ) == lst.end() )
+ lst << ce;
+ }
+
+ TQStrList slts = obj->tqmetaObject()->slotNames( TRUE );
+ for ( TQPtrListIterator<char> sit( slts ); sit.current(); ++sit ) {
+ TQString f( sit.current() );
+ f = f.left( f.tqfind( "(" ) );
+ CompletionEntry c;
+ c.type = "slot";
+ c.text = f;
+ c.postfix = "()";
+ if ( lst.tqfind( c ) == lst.end() )
+ lst << c;
+ }
+
+ if ( lst.isEmpty() )
+ return FALSE;
+
+ showCompletion( lst );
+ return TRUE;
+}
+
+TQValueList<TQStringList> CppEditorCompletion::functionParameters( const TQString &expr, TQChar &separator,
+ TQString &prefix, TQString &postfix )
+{
+ TQ_UNUSED( prefix );
+ TQ_UNUSED( postfix );
+ separator = ',';
+ if ( !ths )
+ return TQValueList<TQStringList>();
+ TQString func;
+ TQString objName;
+ int i = -1;
+
+ i = expr.tqfindRev( "->" );
+ if ( i == -1 )
+ i = expr.tqfindRev( "." );
+ else
+ ++i;
+ if ( i == -1 ) {
+ i = expr.tqfindRev( " " );
+
+ if ( i == -1 )
+ i = expr.tqfindRev( "\t" );
+ else
+ objName = ths->name();
+
+ if ( i == -1 && expr[ 0 ] != ' ' && expr[ 0 ] != '\t' )
+ objName = ths->name();
+ }
+
+ if ( !objName.isEmpty() ) {
+ func = expr.mid( i + 1 );
+ func = func.simplifyWhiteSpace();
+ } else {
+ func = expr.mid( i + 1 );
+ func = func.simplifyWhiteSpace();
+ TQString ex( expr );
+ ex.remove( i, 0xFFFFFF );
+ if ( ex[ (int)ex.length() - 1 ] == '-' )
+ ex.remove( ex.length() - 1, 1 );
+ int j = -1;
+ j = ex.tqfindRev( "->" );
+ if ( j == -1 )
+ j = ex.tqfindRev( "." );
+ else
+ ++j;
+ if ( j == -1 ) {
+ j = ex.tqfindRev( " " );
+
+ if ( j == -1 )
+ j = ex.tqfindRev( "\t" );
+ else
+ objName = ths->name();
+
+ if ( j == -1 )
+ objName = ths->name();
+ }
+ objName = ex.mid( j + 1 );
+ objName = objName.simplifyWhiteSpace();
+ }
+
+ TQObject *obj = 0;
+ if ( ths->name() == objName || objName == "this" ) {
+ obj = ths;
+ } else {
+ obj = ths->child( objName );
+ }
+
+ if ( !obj )
+ return TQValueList<TQStringList>();
+
+ TQStrList slts = obj->tqmetaObject()->slotNames( TRUE );
+ for ( TQPtrListIterator<char> sit( slts ); sit.current(); ++sit ) {
+ TQString f( sit.current() );
+ f = f.left( f.tqfind( "(" ) );
+ if ( f == func ) {
+ f = TQString( sit.current() );
+ f.remove( (uint)0, f.tqfind( "(" ) + 1 );
+ f = f.left( f.tqfind( ")" ) );
+ TQStringList lst = TQStringList::split( ',', f );
+ if ( !lst.isEmpty() ) {
+ TQValueList<TQStringList> l;
+ l << lst;
+ return l;
+ }
+ }
+ }
+
+ const TQMetaProperty *prop =
+ obj->tqmetaObject()->
+ property( obj->tqmetaObject()->tqfindProperty( func[ 3 ].lower() + func.mid( 4 ), TRUE ), TRUE );
+ if ( prop ) {
+ TQValueList<TQStringList> l;
+ l << TQStringList( prop->type() );
+ return l;
+ }
+
+ return TQValueList<TQStringList>();
+}
+
+void CppEditorCompletion::setContext( TQObject *this_ )
+{
+ ths = this_;
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.h
new file mode 100644
index 0000000..09fb134
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.h
@@ -0,0 +1,60 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CPPCOMPLETION_H
+#define CPPCOMPLETION_H
+
+#include <completion.h>
+#include <tqguardedptr.h>
+
+class CppEditorCompletion : public EditorCompletion
+{
+ TQ_OBJECT
+
+public:
+ CppEditorCompletion( Editor *e );
+
+#if defined(TQ_USING)
+ using EditorCompletion::doObjectCompletion;
+#endif
+ bool doObjectCompletion( const TQString &object );
+ TQValueList<TQStringList> functionParameters( const TQString &func, TQChar &, TQString &prefix, TQString &postfix );
+ void setContext( TQObject *this_ );
+
+private:
+ TQGuardedPtr<TQObject> ths;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.cpp
new file mode 100644
index 0000000..b824959
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.cpp
@@ -0,0 +1,168 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "cppeditor.h"
+#include "syntaxhighliter_cpp.h"
+#include <cindent.h>
+#include "cppcompletion.h"
+#include "cppbrowser.h"
+#include <parenmatcher.h>
+#include <tqsettings.h>
+#include <tqpopupmenu.h>
+#include <tqinputdialog.h>
+#include <designerinterface.h>
+
+CppEditor::CppEditor( const TQString &fn, TQWidget *tqparent, const char *name, DesignerInterface *i )
+ : Editor( fn, tqparent, name ), dIface( i )
+{
+ if ( dIface )
+ dIface->addRef();
+ document()->setPreProcessor( new SyntaxHighlighter_CPP );
+ document()->setIndent( (indent = new CIndent) );
+ completion = new CppEditorCompletion( this );
+ browser = new CppEditorBrowser( this );
+ int j = 0;
+ while ( SyntaxHighlighter_CPP::keywords[ j ] != TQString() )
+ completion->addCompletionEntry( SyntaxHighlighter_CPP::keywords[ j++ ], 0, FALSE );
+ configChanged();
+}
+
+CppEditor::~CppEditor()
+{
+ delete completion;
+ if ( dIface )
+ dIface->release();
+}
+
+void CppEditor::configChanged()
+{
+ TQString path = "/Trolltech/CppEditor/";
+ TQMap<TQString, ConfigStyle> styles = Config::readStyles( path );
+ config()->styles = styles;
+ ( (SyntaxHighlighter_CPP*)document()->preProcessor() )->updateStyles( config()->styles );
+
+ completion->setEnabled( Config::completion( path ) );
+ parenMatcher->setEnabled( Config::parenMatching( path ) );
+ if ( Config::wordWrap( path ) ) {
+ if ( hScrollBarMode() != AlwaysOff ) {
+ document()->setFormatter( new TQTextFormatterBreakInWords );
+ setHScrollBarMode( AlwaysOff );
+ }
+ } else {
+ if ( hScrollBarMode() != AlwaysOn ) {
+ TQTextFormatterBreakWords *f = new TQTextFormatterBreakWords;
+ f->setWrapEnabled( FALSE );
+ document()->setFormatter( f );
+ setHScrollBarMode( AlwaysOn );
+ }
+ }
+
+ setFont( ( (SyntaxHighlighter_CPP*)document()->preProcessor() )->format( 0 )->font() );
+
+ indent->setTabSize( Config::indentTabSize( path ) );
+ indent->setIndentSize( Config::indentIndentSize( path ) );
+ indent->setKeepTabs( Config::indentKeepTabs( path ) );
+ indent->setAutoIndent( Config::indentAutoIndent( path ) );
+ if ( !Config::indentAutoIndent( path ) )
+ document()->setIndent( 0 );
+ else
+ document()->setIndent( indent );
+
+ document()->setTabStops( ( (SyntaxHighlighter_CPP*)document()->preProcessor() )->format( TQTextPreProcessor::Standard )->width( 'x' ) * Config::indentTabSize( path ) );
+
+ Editor::configChanged();
+}
+
+TQPopupMenu *CppEditor::createPopupMenu( const TQPoint &p )
+{
+ TQPopupMenu *m = Editor::createPopupMenu( p );
+ m->insertSeparator();
+ int adddeclid = m->insertItem( tr( "Add Include File (in Declaration)..." ), this, TQT_SLOT( addInclDecl() ) );
+ int addimplid = m->insertItem( tr( "Add Include File (in Implementation)..." ), this, TQT_SLOT( addInclImpl() ) );
+ int addforid = m->insertItem( tr( "Add Forward Declaration..." ), this, TQT_SLOT( addForward() ) );
+ if ( !dIface->currentForm() ) {
+ m->setItemEnabled( adddeclid, FALSE );
+ m->setItemEnabled( addimplid, FALSE );
+ m->setItemEnabled( addforid, FALSE );
+ }
+ return m;
+}
+
+void CppEditor::addInclDecl()
+{
+ if ( !dIface )
+ return;
+ TQString s = TQInputDialog::getText( tr( "Add Include File (In Declaration)" ),
+ tr( "Input this using the format <b>&lt;include.h&gt;</b> or <b>\"include.h\"</b>" ) );
+ if ( s.isEmpty() )
+ return;
+ DesignerFormWindow *form = dIface->currentForm();
+ TQStringList lst = form->declarationIncludes();
+ lst << s;
+ form->setDeclarationIncludes( lst );
+}
+
+void CppEditor::addInclImpl()
+{
+ if ( !dIface )
+ return;
+ TQString s = TQInputDialog::getText( tr( "Add Include File (In Implementation)" ),
+ tr( "Input this using the format <b>&lt;include.h&gt;</b> or <b>\"include.h\"</b>" ) );
+ if ( s.isEmpty() )
+ return;
+ DesignerFormWindow *form = dIface->currentForm();
+ TQStringList lst = form->implementationIncludes();
+ lst << s;
+ form->setImplementationIncludes( lst );
+}
+
+void CppEditor::addForward()
+{
+ if ( !dIface )
+ return;
+ TQString s = TQInputDialog::getText( tr( "Add Forward Declaration" ),
+ tr( "Input this using the format <b>ClassName;</b>" ) );
+ if ( s.isEmpty() )
+ return;
+ DesignerFormWindow *form = dIface->currentForm();
+ TQStringList lst = form->forwardDeclarations();
+ lst << s;
+ form->setForwardDeclarations( lst );
+}
+
+void CppEditor::paste()
+{
+ Editor::paste();
+ emit intervalChanged();
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.h
new file mode 100644
index 0000000..1b4aa62
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.h
@@ -0,0 +1,78 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef CPPEDITOR_H
+#define CPPEDITOR_H
+
+#include <editor.h>
+
+class EditorCompletion;
+class EditorBrowser;
+struct DesignerInterface;
+class CIndent;
+
+class CppEditor : public Editor
+{
+ TQ_OBJECT
+
+public:
+ CppEditor( const TQString &fn, TQWidget *tqparent, const char *name, DesignerInterface *i );
+ ~CppEditor();
+
+ virtual EditorCompletion *completionManager() { return completion; }
+ virtual EditorBrowser *browserManager() { return browser; }
+ void configChanged();
+
+ bool supportsBreakPoints() const { return FALSE; }
+#if defined(TQ_USING)
+ using TQTextEdit::createPopupMenu;
+#endif
+ TQPopupMenu *createPopupMenu( const TQPoint &p );
+
+ void paste();
+
+private Q_SLOTS:
+ void addInclDecl();
+ void addInclImpl();
+ void addForward();
+
+protected:
+ EditorCompletion *completion;
+ EditorBrowser *browser;
+ DesignerInterface *dIface;
+ CIndent *indent;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.pro b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.pro
new file mode 100644
index 0000000..391c1d7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppeditor.pro
@@ -0,0 +1,21 @@
+TEMPLATE = lib
+CONFIG += qt warn_on plugin
+
+SOURCES += cppeditor.cpp syntaxhighliter_cpp.cpp cppcompletion.cpp editorinterfaceimpl.cpp languageinterfaceimpl.cpp common.cpp preferenceinterfaceimpl.cpp yyreg.cpp cppbrowser.cpp projectsettingsinterfaceimpl.cpp sourcetemplateinterfaceimpl.cpp
+HEADERS += cppeditor.h syntaxhighliter_cpp.h cppcompletion.h editorinterfaceimpl.h languageinterfaceimpl.h preferenceinterfaceimpl.h yyreg.h cppbrowser.h projectsettingsinterfaceimpl.h sourcetemplateinterfaceimpl.h
+FORMS = projectsettings.ui mainfilesettings.ui
+
+TARGET = cppeditor
+DESTDIR = ../../../../plugins/designer
+VERSION = 1.0.0
+
+INCLUDEPATH += ../../interfaces ../../editor $$QT_BUILD_TREE/tools/designer/editor
+
+hpux-* {
+ LIBS += $$QT_BUILD_TREE/lib/libeditor.a
+} else {
+ LIBS += -L$$QT_BUILD_TREE/lib -leditor
+}
+
+target.path += $$plugins.path/designer
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp
new file mode 100644
index 0000000..736b082
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp
@@ -0,0 +1,338 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "editorinterfaceimpl.h"
+#include <viewmanager.h>
+#include "cppeditor.h"
+#include <private/tqrichtext_p.h>
+#include <tqapplication.h>
+#include "completion.h"
+#include <designerinterface.h>
+#include <tqtimer.h>
+
+EditorInterfaceImpl::EditorInterfaceImpl()
+ : EditorInterface(), viewManager( 0 ), dIface( 0 )
+{
+ updateTimer = new TQTimer( this );
+ connect( updateTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( update() ) );
+}
+
+EditorInterfaceImpl::~EditorInterfaceImpl()
+{
+ updateTimer->stop();
+ delete (ViewManager*)viewManager;
+ if ( dIface )
+ dIface->release();
+}
+
+TQRESULT EditorInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInterface** iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_Editor )
+ *iface = (EditorInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQWidget *EditorInterfaceImpl::editor( bool readonly,
+ TQWidget *tqparent, TQUnknownInterface *iface )
+{
+ if ( !viewManager ) {
+ ( (EditorInterfaceImpl*)this )->viewManager = new ViewManager( tqparent, 0 );
+ ( (EditorInterfaceImpl*)this )->viewManager->showMarkerWidget( FALSE );
+ if ( iface )
+ iface->queryInterface( IID_Designer, (TQUnknownInterface**) &dIface );
+ CppEditor *e = new CppEditor( TQString(), viewManager, "editor", dIface );
+ e->setEditable( !readonly );
+ e->installEventFilter( this );
+ connect( e, TQT_SIGNAL( intervalChanged() ), this, TQT_SLOT( intervalChanged() ) );
+ TQApplication::sendPostedEvents( viewManager, TQEvent::ChildInserted );
+ }
+ return viewManager->currentView();
+}
+
+void EditorInterfaceImpl::setText( const TQString &txt )
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ CppEditor *e = (CppEditor*)viewManager->currentView();
+ disconnect( e, TQT_SIGNAL( modificationChanged( bool ) ), this, TQT_SLOT( modificationChanged( bool ) ) );
+ e->setText( txt );
+ e->setModified( FALSE );
+ connect( e, TQT_SIGNAL( modificationChanged( bool ) ), this, TQT_SLOT( modificationChanged( bool ) ) );
+}
+
+TQString EditorInterfaceImpl::text() const
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return TQString();
+ TQString txt = ( (CppEditor*)viewManager->currentView() )->text();
+ if ( !txt.isEmpty() && !txt.endsWith("\n") )
+ txt += "\n";
+ return txt;
+}
+
+bool EditorInterfaceImpl::isUndoAvailable() const
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return FALSE;
+ return ( (CppEditor*)viewManager->currentView() )->isUndoAvailable();
+}
+
+bool EditorInterfaceImpl::isRedoAvailable() const
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return FALSE;
+ return ( (CppEditor*)viewManager->currentView() )->isRedoAvailable();
+}
+
+void EditorInterfaceImpl::undo()
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->undo();
+}
+
+void EditorInterfaceImpl::redo()
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->redo();
+}
+
+void EditorInterfaceImpl::cut()
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->cut();
+}
+
+void EditorInterfaceImpl::copy()
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->copy();
+}
+
+void EditorInterfaceImpl::paste()
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->paste();
+}
+
+void EditorInterfaceImpl::selectAll()
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->selectAll();
+}
+
+bool EditorInterfaceImpl::tqfind( const TQString &expr, bool cs, bool wo, bool forward, bool startAtCursor )
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return FALSE;
+ CppEditor *e = (CppEditor*)viewManager->currentView();
+ if ( startAtCursor )
+ return e->tqfind( expr, cs, wo, forward );
+ int dummy = 0;
+ return e->tqfind( expr, cs, wo, forward, &dummy, &dummy );
+}
+
+bool EditorInterfaceImpl::tqreplace( const TQString &tqfind, const TQString &tqreplace, bool cs, bool wo,
+ bool forward, bool startAtCursor, bool tqreplaceAll )
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return FALSE;
+ CppEditor *e = (CppEditor*)viewManager->currentView();
+ bool ok = FALSE;
+ if ( startAtCursor ) {
+ ok = e->tqfind( tqfind, cs, wo, forward );
+ } else {
+ int dummy = 0;
+ ok = e->tqfind( tqfind, cs, wo, forward, &dummy, &dummy );
+ }
+
+ if ( ok ) {
+ e->removeSelectedText();
+ e->insert( tqreplace, FALSE, FALSE );
+ }
+
+ if ( !tqreplaceAll || !ok ) {
+ if ( ok )
+ e->setSelection( e->textCursor()->paragraph()->paragId(),
+ e->textCursor()->index() - tqreplace.length(),
+ e->textCursor()->paragraph()->paragId(),
+ e->textCursor()->index() );
+ return ok;
+ }
+
+ bool ok2 = TRUE;
+ while ( ok2 ) {
+ ok2 = e->tqfind( tqfind, cs, wo, forward );
+ if ( ok2 ) {
+ e->removeSelectedText();
+ e->insert( tqreplace, FALSE, FALSE );
+ }
+ }
+
+ return TRUE;
+}
+
+void EditorInterfaceImpl::gotoLine( int line )
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->setCursorPosition( line, 0 );
+}
+
+void EditorInterfaceImpl::indent()
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->TQTextEdit::indent();
+}
+
+void EditorInterfaceImpl::splitView()
+{
+#if 0
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ TQTextDocument *doc = ( (CppEditor*)viewManager->currentView() )->document();
+ CppEditor *editor = new CppEditor( TQString(), viewManager, "editor" );
+ editor->setDocument( doc );
+#endif
+}
+
+void EditorInterfaceImpl::scrollTo( const TQString &txt, const TQString & )
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->sync();
+ TQTextDocument *doc = ( (CppEditor*)viewManager->currentView() )->document();
+ TQTextParagraph *p = doc->firstParagraph();
+ while ( p ) {
+ if ( p->string()->toString().tqfind( txt ) != -1 ) {
+ ( (CppEditor*)viewManager->currentView() )->setCursorPosition( p->paragId() + 2, 0 );
+ break;
+ }
+ p = p->next();
+ }
+ ( (CppEditor*)viewManager->currentView() )->setFocus();
+}
+
+void EditorInterfaceImpl::setContext( TQObject *this_ )
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->completionManager()->setContext( this_ );
+}
+
+void EditorInterfaceImpl::setError( int line )
+{
+ if ( !viewManager )
+ return;
+ viewManager->setError( line );
+}
+
+void EditorInterfaceImpl::readSettings()
+{
+ if ( !viewManager )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->configChanged();
+}
+
+void EditorInterfaceImpl::modificationChanged( bool m )
+{
+ if ( viewManager && dIface )
+ dIface->setModified( m, viewManager->currentView() );
+}
+
+void EditorInterfaceImpl::setModified( bool m )
+{
+ if ( !viewManager )
+ return;
+ ( (CppEditor*)viewManager->currentView() )->setModified( m );
+}
+
+bool EditorInterfaceImpl::isModified() const
+{
+ if ( !viewManager )
+ return FALSE;
+ return ( (CppEditor*)viewManager->currentView() )->isModified();
+}
+
+bool EditorInterfaceImpl::eventFilter( TQObject *o, TQEvent *e )
+{
+ if ( e->type() == TQEvent::KeyPress )
+ updateTimer->stop();
+ else if ( e->type() == TQEvent::FocusOut )
+ update();
+
+ return TQObject::eventFilter( o, e );
+}
+
+int EditorInterfaceImpl::numLines() const
+{
+ if ( !viewManager || !viewManager->currentView() )
+ return 0;
+ return ( (CppEditor*)viewManager->currentView() )->paragraphs();
+}
+
+void EditorInterfaceImpl::intervalChanged()
+{
+ if ( !dIface )
+ return;
+ updateTimer->start( 2000, TRUE );
+}
+
+void EditorInterfaceImpl::update()
+{
+ if ( !dIface )
+ return;
+ dIface->updateFunctionList();
+}
+
+void EditorInterfaceImpl::onBreakPointChange( TQObject *receiver, const char *slot )
+{
+ if ( !viewManager )
+ return;
+ connect( viewManager, TQT_SIGNAL( markersChanged() ), receiver, slot );
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h
new file mode 100644
index 0000000..997a99b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h
@@ -0,0 +1,107 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef EDITORINTERFACEIMPL_H
+#define EDITORINTERFACEIMPL_H
+
+#include <editorinterface.h>
+#include <tqobject.h>
+#include <tqguardedptr.h>
+
+class TQTimer;
+class ViewManager;
+struct DesignerInterface;
+
+class EditorInterfaceImpl : public TQObject, public EditorInterface
+{
+ TQ_OBJECT
+
+public:
+ EditorInterfaceImpl();
+ virtual ~EditorInterfaceImpl();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface** );
+ TQ_REFCOUNT;
+
+ TQWidget *editor( bool readonly, TQWidget *tqparent, TQUnknownInterface *designerIface );
+
+ void setText( const TQString &txt );
+ TQString text() const;
+ bool isUndoAvailable() const;
+ bool isRedoAvailable() const;
+ void undo();
+ void redo();
+ void cut();
+ void copy();
+ void paste();
+ void selectAll();
+ bool tqfind( const TQString &expr, bool cs, bool wo, bool forward, bool startAtCursor );
+ bool tqreplace( const TQString &tqfind, const TQString &tqreplace, bool cs, bool wo, bool forward, bool startAtCursor, bool tqreplaceAll );
+ void gotoLine( int line );
+ void indent();
+ void scrollTo( const TQString &txt, const TQString &first );
+ void splitView();
+ void setContext( TQObject *this_ );
+ void readSettings();
+
+ void setError( int line );
+ void setStep( int ) {}
+ void clearStep() {}
+ void setModified( bool m );
+ bool isModified() const;
+ void setMode( Mode ) {}
+
+ int numLines() const;
+ void breakPoints( TQValueList<uint> & ) const {}
+ void setBreakPoints( const TQValueList<uint> & ) {}
+ void onBreakPointChange( TQObject *receiver, const char *slot );
+ void clearStackFrame() {}
+ void setStackFrame( int ) {}
+
+protected:
+ bool eventFilter( TQObject*, TQEvent* );
+
+private Q_SLOTS:
+ void modificationChanged( bool m );
+ void intervalChanged();
+ void update();
+
+private:
+ TQGuardedPtr<ViewManager> viewManager;
+ DesignerInterface *dIface;
+ TQTimer *updateTimer;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp
new file mode 100644
index 0000000..14489c5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp
@@ -0,0 +1,249 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "languageinterfaceimpl.h"
+#include <tqobject.h>
+#include <designerinterface.h>
+#include <tqfile.h>
+#include "yyreg.h"
+#include <tqmetaobject.h>
+
+LanguageInterfaceImpl::LanguageInterfaceImpl( TQUnknownInterface *outer )
+ : tqparent( outer ), ref( 0 )
+{
+}
+
+ulong LanguageInterfaceImpl::addRef()
+{
+ return tqparent ? tqparent->addRef() : ref++;
+}
+
+ulong LanguageInterfaceImpl::release()
+{
+ if ( tqparent )
+ return tqparent->release();
+ if ( !--ref ) {
+ delete this;
+ return 0;
+ }
+ return ref;
+}
+
+TQRESULT LanguageInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInterface** iface )
+{
+ if ( tqparent )
+ return tqparent->queryInterface( uuid, iface );
+
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_Language )
+ *iface = (LanguageInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+
+class NormalizeObject : public TQObject
+{
+public:
+ NormalizeObject() : TQObject() {}
+ static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); }
+};
+
+void LanguageInterfaceImpl::functions( const TQString &code, TQValueList<Function> *functionMap ) const
+{
+ TQValueList<CppFunction> l;
+ extractCppFunctions( code, &l );
+ for ( TQValueList<CppFunction>::Iterator it = l.begin(); it != l.end(); ++it ) {
+ Function func;
+ func.name = (*it).prototype();
+ func.name.remove( 0, (*it).returnType().length() );
+ if ( func.name.tqfind( "::" ) == -1 )
+ continue;
+ func.name.remove( (uint)0, func.name.tqfind( "::" ) + 2 );
+ func.body = (*it).body();
+ func.returnType = (*it).returnType();
+ func.start = (*it).functionStartLineNum();
+ func.end = (*it).closingBraceLineNum();
+ functionMap->append( func );
+ }
+}
+
+TQString LanguageInterfaceImpl::createFunctionStart( const TQString &className, const TQString &func,
+ const TQString &returnType,
+ const TQString & )
+{
+ return returnType + " " + className + "::" + func;
+}
+
+TQStringList LanguageInterfaceImpl::definitions() const
+{
+ TQStringList lst;
+ lst << "Includes (in Implementation)" << "Includes (in Declaration)" << "Forward Declarations" << "Signals";
+ return lst;
+}
+
+TQStringList LanguageInterfaceImpl::definitionEntries( const TQString &definition, TQUnknownInterface *designerIface ) const
+{
+ DesignerInterface *iface = 0;
+ designerIface->queryInterface( IID_Designer, (TQUnknownInterface**) &iface );
+ if ( !iface )
+ return TQStringList();
+ DesignerFormWindow *fw = iface->currentForm();
+ if ( !fw )
+ return TQStringList();
+ TQStringList lst;
+ if ( definition == "Includes (in Implementation)" ) {
+ lst = fw->implementationIncludes();
+ } else if ( definition == "Includes (in Declaration)" ) {
+ lst = fw->declarationIncludes();
+ } else if ( definition == "Forward Declarations" ) {
+ lst = fw->forwardDeclarations();
+ } else if ( definition == "Signals" ) {
+ lst = fw->signalList();
+ }
+ iface->release();
+ return lst;
+}
+
+void LanguageInterfaceImpl::setDefinitionEntries( const TQString &definition, const TQStringList &entries, TQUnknownInterface *designerIface )
+{
+ DesignerInterface *iface = 0;
+ designerIface->queryInterface( IID_Designer, (TQUnknownInterface**) &iface );
+ if ( !iface )
+ return;
+ DesignerFormWindow *fw = iface->currentForm();
+ if ( !fw )
+ return;
+ if ( definition == "Includes (in Implementation)" ) {
+ fw->setImplementationIncludes( entries );
+ } else if ( definition == "Includes (in Declaration)" ) {
+ fw->setDeclarationIncludes( entries );
+ } else if ( definition == "Forward Declarations" ) {
+ fw->setForwardDeclarations( entries );
+ } else if ( definition == "Signals" ) {
+ fw->setSignalList( entries );
+ }
+ iface->release();
+}
+
+TQString LanguageInterfaceImpl::createEmptyFunction()
+{
+ return "{\n\n}\n";
+}
+
+bool LanguageInterfaceImpl::supports( Support s ) const
+{
+ if ( s == ReturnType )
+ return TRUE;
+ if ( s == ConnectionsToCustomSlots )
+ return TRUE;
+ return FALSE;
+}
+
+TQStringList LanguageInterfaceImpl::fileFilterList() const
+{
+ TQStringList f;
+ f << "C++ Files (*.cpp *.C *.cxx *.c++ *.c *.h *.H *.hpp *.hxx)";
+ return f;
+
+}
+TQStringList LanguageInterfaceImpl::fileExtensionList() const
+{
+ TQStringList f;
+ f << "cpp" << "C" << "cxx" << "c++" << "c" <<"h" << "H" << "hpp" << "hxx";
+ return f;
+}
+
+TQString LanguageInterfaceImpl::projectKeyForExtension( const TQString &extension ) const
+{
+ // also handle something like foo.ut.cpp
+ TQString ext = extension;
+ int i = ext.tqfindRev('.');
+ if ( i > -1 && i < (int)(ext.length()-1) )
+ ext = ext.mid( i + 1 );
+ if ( ext[ 0 ] == 'c' || ext[ 0 ] == 'C' )
+ return "SOURCES";
+ return "HEADERS";
+}
+
+void LanguageInterfaceImpl::sourceProjectKeys( TQStringList &keys ) const
+{
+ keys << "HEADERS" << "SOURCES";
+}
+
+ class CheckObject : public TQObject
+{
+public:
+ CheckObject() {}
+ bool checkConnectArgs( const char *signal, const char *member ) { return TQObject::checkConnectArgs( signal, 0, member ); }
+
+};
+
+bool LanguageInterfaceImpl::canConnect( const TQString &signal, const TQString &slot )
+{
+ CheckObject o;
+ return o.checkConnectArgs( signal.latin1(), slot.latin1() );
+}
+
+void LanguageInterfaceImpl::loadFormCode( const TQString &, const TQString &filename,
+ TQValueList<Function> &functions,
+ TQStringList &,
+ TQValueList<Connection> & )
+{
+ TQFile f( filename );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQTextStream ts( &f );
+ TQString code( ts.read() );
+ this->functions( code, &functions );
+}
+
+void LanguageInterfaceImpl::preferedExtensions( TQMap<TQString, TQString> &extensionMap ) const
+{
+ extensionMap.insert( "cpp", "C++ Source File" );
+ extensionMap.insert( "h", "C++ Header File" );
+}
+
+TQStrList LanguageInterfaceImpl::signalNames( TQObject *obj ) const
+{
+ TQStrList sigs;
+ sigs = obj->tqmetaObject()->signalNames( TRUE );
+ sigs.remove( "destroyed()" );
+ return sigs;
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.h
new file mode 100644
index 0000000..a998dc6
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.h
@@ -0,0 +1,90 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LANGUAGEINTERFACEIMPL_H
+#define LANGUAGEINTERFACEIMPL_H
+
+#include <languageinterface.h>
+
+class LanguageInterfaceImpl : public LanguageInterface
+{
+public:
+ LanguageInterfaceImpl( TQUnknownInterface *outer = 0 );
+
+ ulong addRef();
+ ulong release();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface** );
+
+ void functions( const TQString &code, TQValueList<Function> *funcs ) const;
+ void connections( const TQString &, TQValueList<Connection> * ) const {};
+ TQString createFunctionStart( const TQString &className, const TQString &func,
+ const TQString &returnType, const TQString &access );
+ TQStringList definitions() const;
+ TQStringList definitionEntries( const TQString &definition, TQUnknownInterface *designerIface ) const;
+ void setDefinitionEntries( const TQString &definition, const TQStringList &entries, TQUnknownInterface *designerIface );
+ TQString createArguments( const TQString & ) { return TQString(); }
+ TQString createEmptyFunction();
+ bool supports( Support s ) const;
+ TQStringList fileFilterList() const;
+ TQStringList fileExtensionList() const;
+ void preferedExtensions( TQMap<TQString, TQString> &extensionMap ) const;
+ void sourceProjectKeys( TQStringList &keys ) const;
+ TQString projectKeyForExtension( const TQString &extension ) const;
+ TQString cleanSignature( const TQString &sig ) { return sig; } // #### implement me
+ void loadFormCode( const TQString &, const TQString &,
+ TQValueList<Function> &,
+ TQStringList &,
+ TQValueList<Connection> & );
+ TQString formCodeExtension() const { return ".h"; }
+ bool canConnect( const TQString &signal, const TQString &slot );
+ void compressProject( const TQString &, const TQString &, bool ) {}
+ TQString uncompressProject( const TQString &, const TQString & ) { return TQString(); }
+ TQString aboutText() const { return ""; }
+
+ void addConnection( const TQString &, const TQString &,
+ const TQString &, const TQString &,
+ TQString * ) {}
+ void removeConnection( const TQString &, const TQString &,
+ const TQString &, const TQString &,
+ TQString * ) {}
+ TQStrList signalNames( TQObject *obj ) const;
+
+private:
+ TQUnknownInterface *tqparent;
+ ulong ref;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui b/tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui
new file mode 100644
index 0000000..468525f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui
@@ -0,0 +1,211 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>CppMainFile</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>CppMainFile</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>308</width>
+ <height>283</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Configure Main-File</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Filename:</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editFileName</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Main-Form:</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>listForms</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>Help</string>
+ </property>
+ <property name="accel">
+ <number>4144</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>CppMainFile</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>CppMainFile</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>listForms</sender>
+ <signal>selectionChanged()</signal>
+ <receiver>CppMainFile</receiver>
+ <slot>updateOkButton()</slot>
+ </connection>
+ <connection>
+ <sender>listForms</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>CppMainFile</receiver>
+ <slot>updateOkButton()</slot>
+ </connection>
+ <connection>
+ <sender>editFileName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppMainFile</receiver>
+ <slot>updateOkButton()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">mainfilesettings.ui.h</include>
+</includes>
+<forwards>
+ <forward>struct QUnknownInterface;</forward>
+</forwards>
+<Q_SLOTS>
+ <slot>init()</slot>
+ <slot>setup( QUnknownInterface * appIface )</slot>
+ <slot>updateOkButton()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui.h
new file mode 100644
index 0000000..9e03dff
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/mainfilesettings.ui.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename Q_SLOTS use TQt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include <designerinterface.h>
+
+void CppMainFile::init()
+{
+}
+
+void CppMainFile::setup( TQUnknownInterface *appIface )
+{
+ DesignerInterface *dIface = 0;
+ appIface->queryInterface( IID_Designer, (TQUnknownInterface**)&dIface );
+ if ( !dIface )
+ return;
+ TQStringList l = dIface->currentProject()->formNames();
+ editFileName->setText( "main.cpp" );
+ listForms->clear();
+ listForms->insertStringList( l );
+ listForms->setCurrentItem( 0 );
+ updateOkButton();
+ editFileName->setFocus();
+ editFileName->selectAll();
+}
+
+void CppMainFile::updateOkButton()
+{
+ buttonOk->setEnabled( editFileName->text().length() > 0 && listForms->currentItem() != -1 );
+}
+
+
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.cpp
new file mode 100644
index 0000000..a9d38e8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.cpp
@@ -0,0 +1,102 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "preferenceinterfaceimpl.h"
+#include <preferences.h>
+
+PreferenceInterfaceImpl::PreferenceInterfaceImpl( TQUnknownInterface *outer )
+ : tqparent( outer ),
+ ref( 0 ),
+ cppEditorSyntax( 0 )
+{
+}
+
+PreferenceInterfaceImpl::~PreferenceInterfaceImpl()
+{
+}
+
+ulong PreferenceInterfaceImpl::addRef()
+{
+ return tqparent ? tqparent->addRef() : ref++;
+}
+
+ulong PreferenceInterfaceImpl::release()
+{
+ if ( tqparent )
+ return tqparent->release();
+ if ( !--ref ) {
+ delete this;
+ return 0;
+ }
+ return ref;
+}
+
+TQRESULT PreferenceInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInterface** iface )
+{
+ if ( tqparent )
+ return tqparent->queryInterface( uuid, iface );
+
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_Preference )
+ *iface = (PreferenceInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+PreferenceInterface::Preference *PreferenceInterfaceImpl::preference()
+{
+ if ( !cppEditorSyntax ) {
+ cppEditorSyntax = new PreferencesBase( 0, "cppeditor_syntax" );
+ ( (PreferencesBase*)cppEditorSyntax )->setPath( "/Trolltech/CppEditor/" );
+ cppEditorSyntax->hide();
+ }
+ Preference *pf = 0;
+ pf = new Preference;
+ pf->tab = cppEditorSyntax;
+ pf->title = "C++ Editor";
+ pf->receiver = pf->tab;
+ pf->init_slot = TQT_SLOT( reInit() );
+ pf->accept_slot = TQT_SLOT( save() );
+ return pf;
+}
+
+void PreferenceInterfaceImpl::deletePreferenceObject( Preference *p )
+{
+ delete p;
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.h
new file mode 100644
index 0000000..af2c838
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/preferenceinterfaceimpl.h
@@ -0,0 +1,64 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PREFERENCEINTERFACEIMPL_H
+#define PREFERENCEINTERFACEIMPL_H
+
+#include <preferenceinterface.h>
+class TQWidget;
+
+class PreferenceInterfaceImpl : public PreferenceInterface
+{
+public:
+ PreferenceInterfaceImpl( TQUnknownInterface *outer = 0 );
+ virtual ~PreferenceInterfaceImpl();
+
+ ulong addRef();
+ ulong release();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface** );
+
+ Preference *preference();
+ void connectTo( TQUnknownInterface * ) {}
+ void deletePreferenceObject( Preference * );
+
+private:
+ TQUnknownInterface *tqparent;
+ int ref;
+ TQWidget *cppEditorSyntax;
+
+};
+
+#endif
+
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui
new file mode 100644
index 0000000..b6d8642
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui
@@ -0,0 +1,347 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>CppProjectSettings</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<include location="local" implDecl="in declaration">projectsettings.ui.h</include>
+<forward>struct QUnknownInterface;</forward>
+<variable>QMap&lt;QString, QString&gt; config, libs, defines, includes;</variable>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>CppProjectSettings</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>373</width>
+ <height>191</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Project Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Config:</string>
+ </property>
+ </widget>
+ <spacer row="5" column="2">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Defines:</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="3" column="2">
+ <property name="name">
+ <cstring>editDefines</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Libs:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>Includepath:</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="3" column="1">
+ <item>
+ <property name="text">
+ <string>(all)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>unix</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>win32</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>mac</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboDefines</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="4" column="1">
+ <item>
+ <property name="text">
+ <string>(all)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>unix</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>win32</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>mac</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboInclude</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="4" column="2">
+ <property name="name">
+ <cstring>editInclude</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="2" column="2">
+ <property name="name">
+ <cstring>editLibs</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="2">
+ <property name="name">
+ <cstring>editConfig</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="2" column="1">
+ <item>
+ <property name="text">
+ <string>(all)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>unix</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>win32</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>mac</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboLibs</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>(all)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>unix</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>win32</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>mac</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboConfig</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Template:</string>
+ </property>
+ </widget>
+ <spacer row="0" column="2">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>app</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>lib</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboTemplate</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>comboConfig</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>configPlatformChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>comboLibs</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>libsPlatformChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>comboDefines</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>definesPlatformChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editConfig</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>configChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editLibs</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>libsChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editDefines</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>definesChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>editInclude</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>includesChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>comboInclude</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CppProjectSettings</receiver>
+ <slot>includesPlatformChanged(const QString&amp;)</slot>
+ </connection>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">reInit( QUnknownInterface * iface )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">save( QUnknownInterface * iface )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">configChanged( const QString &amp; str )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">libsChanged( const QString &amp; str )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">definesChanged( const QString &amp; str )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">includesChanged( const QString &amp; str )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">configPlatformChanged( const QString &amp; plat )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">libsPlatformChanged( const QString &amp; plat )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">definesPlatformChanged( const QString &amp; plat )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">includesPlatformChanged( const QString &amp; plat )</slot>
+</connections>
+<tabstops>
+ <tabstop>comboTemplate</tabstop>
+ <tabstop>comboConfig</tabstop>
+ <tabstop>editConfig</tabstop>
+ <tabstop>comboLibs</tabstop>
+ <tabstop>editLibs</tabstop>
+ <tabstop>comboDefines</tabstop>
+ <tabstop>editDefines</tabstop>
+ <tabstop>comboInclude</tabstop>
+ <tabstop>editInclude</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h
new file mode 100644
index 0000000..72aea91
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** Add custom slot implementations here. Use a slot init() for
+** initialization code called during construction, and a slot destroy()
+** for cleanup code called during destruction.
+**
+** This file gets modified by TQt Designer whenever you add, rename or
+** remove custom Tslots. Implementation code does not get lost.
+*****************************************************************************/
+
+#include <designerinterface.h>
+
+void CppProjectSettings::reInit( TQUnknownInterface *iface )
+{
+ comboConfig->setCurrentItem( 0 );
+ comboLibs->setCurrentItem( 0 );
+ comboDefines->setCurrentItem( 0 );
+ comboInclude->setCurrentItem( 0 );
+
+ DesignerInterface *dIface = 0;
+ iface->queryInterface( IID_Designer, (TQUnknownInterface**)&dIface );
+ if ( !dIface )
+ return;
+ DesignerProject *project = dIface->currentProject();
+ if ( project->templte() == "app" )
+ comboTemplate->setCurrentItem( 0 );
+ else
+ comboTemplate->setCurrentItem( 1 );
+
+ config.clear();
+ defines.clear();
+ libs.clear();
+ defines.clear();
+ includes.clear();
+
+ const TQString platforms[] = { "(all)", "win32", "unix", "mac", TQString() };
+ for ( int i = 0; platforms[ i ] != TQString(); ++i ) {
+ config.tqreplace( platforms[ i ], project->config( platforms[ i ] ) );
+ libs.tqreplace( platforms[ i ], project->libs( platforms[ i ] ) );
+ defines.tqreplace( platforms[ i ], project->defines( platforms[ i ] ) );
+ includes.tqreplace( platforms[ i ], project->includePath( platforms[ i ] ) );
+ }
+ editConfig->setText( config[ "(all)" ] );
+ editLibs->setText( libs[ "(all)" ] );
+ editDefines->setText( defines[ "(all)" ] );
+ editInclude->setText( includes[ "(all)" ] );
+}
+
+void CppProjectSettings::save( TQUnknownInterface *iface )
+{
+ DesignerInterface *dIface = 0;
+ iface->queryInterface( IID_Designer, (TQUnknownInterface**)&dIface );
+ if ( !dIface )
+ return;
+ DesignerProject *project = dIface->currentProject();
+
+ project->setTemplate( comboTemplate->currentText() );
+ const TQString platforms[] = { "(all)", "win32", "unix", "mac", TQString() };
+ for ( int i = 0; platforms[ i ] != TQString(); ++i ) {
+ project->setConfig( platforms[ i ], config[ platforms[ i ] ] );
+ project->setLibs( platforms[ i ], libs[ platforms[ i ] ] );
+ project->setDefines( platforms[ i ], defines[ platforms[ i ] ] );
+ project->setIncludePath( platforms[ i ], includes[ platforms[ i ] ] );
+ }
+}
+
+void CppProjectSettings::configChanged( const TQString &str )
+{
+ config.tqreplace( comboConfig->currentText(), str );
+}
+
+void CppProjectSettings::libsChanged( const TQString &str )
+{
+ libs.tqreplace( comboLibs->currentText(), str );
+}
+
+void CppProjectSettings::definesChanged( const TQString &str )
+{
+ defines.tqreplace( comboDefines->currentText(), str );
+}
+
+void CppProjectSettings::includesChanged( const TQString &str )
+{
+ includes.tqreplace( comboInclude->currentText(), str );
+}
+
+void CppProjectSettings::configPlatformChanged( const TQString &plat )
+{
+ editConfig->setText( config[ plat ] );
+}
+
+void CppProjectSettings::libsPlatformChanged( const TQString &plat )
+{
+ editLibs->setText( libs[ plat ] );
+}
+
+void CppProjectSettings::definesPlatformChanged( const TQString &plat )
+{
+ editDefines->setText( defines[ plat ] );
+}
+
+void CppProjectSettings::includesPlatformChanged( const TQString &plat )
+{
+ editInclude->setText( includes[ plat ] );
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.cpp
new file mode 100644
index 0000000..279a350
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.cpp
@@ -0,0 +1,106 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "projectsettingsinterfaceimpl.h"
+#include "projectsettings.h"
+
+ProjectSettingsInterfaceImpl::ProjectSettingsInterfaceImpl( TQUnknownInterface *outer )
+ : tqparent( outer ),
+ ref( 0 ),
+ settingsTab( 0 )
+{
+}
+
+ulong ProjectSettingsInterfaceImpl::addRef()
+{
+ return tqparent ? tqparent->addRef() : ref++;
+}
+
+ulong ProjectSettingsInterfaceImpl::release()
+{
+ if ( tqparent )
+ return tqparent->release();
+ if ( !--ref ) {
+ delete this;
+ return 0;
+ }
+ return ref;
+}
+
+ProjectSettingsInterface::ProjectSettings *ProjectSettingsInterfaceImpl::projectSetting()
+{
+ if ( !settingsTab ) {
+ settingsTab = new CppProjectSettings( 0 );
+ settingsTab->hide();
+ }
+ ProjectSettings *pf = 0;
+ pf = new ProjectSettings;
+ pf->tab = settingsTab;
+ pf->title = "C++";
+ pf->receiver = pf->tab;
+ pf->init_slot = TQT_SLOT( reInit( TQUnknownInterface * ) );
+ pf->accept_slot = TQT_SLOT( save( TQUnknownInterface * ) );
+ return pf;
+}
+
+TQStringList ProjectSettingsInterfaceImpl::projectSettings() const
+{
+ return TQStringList();
+}
+
+void ProjectSettingsInterfaceImpl::connectTo( TQUnknownInterface * )
+{
+}
+
+void ProjectSettingsInterfaceImpl::deleteProjectSettingsObject( ProjectSettings *pf )
+{
+ delete pf;
+}
+
+TQRESULT ProjectSettingsInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
+{
+ if ( tqparent )
+ return tqparent->queryInterface( uuid, iface );
+
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_ProjectSettings )
+ *iface = (ProjectSettingsInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.h
new file mode 100644
index 0000000..5dd0625
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettingsinterfaceimpl.h
@@ -0,0 +1,62 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PROJECTSETTINGSINTERFACEIMPL_H
+#define PROJECTSETTINGSINTERFACEIMPL_H
+
+#include <projectsettingsiface.h>
+
+class CppProjectSettings;
+
+class ProjectSettingsInterfaceImpl : public ProjectSettingsInterface
+{
+public:
+ ProjectSettingsInterfaceImpl( TQUnknownInterface *outer = 0 );
+
+ ulong addRef();
+ ulong release();
+
+ ProjectSettings *projectSetting();
+ TQStringList projectSettings() const;
+ void connectTo( TQUnknownInterface *appInterface );
+ void deleteProjectSettingsObject( ProjectSettings * );
+ TQRESULT queryInterface( const TQUuid &uuid, TQUnknownInterface **iface );
+
+private:
+ TQUnknownInterface *tqparent;
+ int ref;
+ CppProjectSettings *settingsTab;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp
new file mode 100644
index 0000000..fe84703
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp
@@ -0,0 +1,117 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "sourcetemplateinterfaceimpl.h"
+#include <designerinterface.h>
+#include "mainfilesettings.h"
+#include <tqlineedit.h>
+#include <tqlistbox.h>
+
+SourceTemplateInterfaceImpl::SourceTemplateInterfaceImpl()
+{
+}
+
+TQRESULT SourceTemplateInterfaceImpl::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)this;
+ else if ( uuid == IID_TQFeatureList )
+ *iface = (TQFeatureListInterface*)this;
+ else if ( uuid == IID_SourceTemplate )
+ *iface = (SourceTemplateInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQStringList SourceTemplateInterfaceImpl::featureList() const
+{
+ TQStringList l;
+ l << "C++ Main-File (main.cpp)";
+ return l;
+}
+
+static TQString generateMainCppCode( const TQString &formname, const TQString &include )
+{
+ TQString code;
+ code += "#include <tqapplication.h>\n";
+ code += "#include \"" + include + "\"\n";
+ code += "\n";
+ code += "int main( int argc, char ** argv )\n";
+ code += "{\n";
+ code += " TQApplication a( argc, argv );\n";
+ code += " " + formname + " w;\n";
+ code += " w.show();\n";
+ code += " a.connect( &a, TQT_SIGNAL( lastWindowClosed() ), &a, TQT_SLOT( quit() ) );\n";
+ code += " return a.exec();\n";
+ code += "}\n";
+ return code;
+}
+
+SourceTemplateInterface::Source SourceTemplateInterfaceImpl::create( const TQString &templ,
+ TQUnknownInterface *appIface )
+{
+ SourceTemplateInterface::Source src;
+ src.type = SourceTemplateInterface::Source::Invalid;
+ if ( templ == "C++ Main-File (main.cpp)" ) {
+ CppMainFile dia( 0, 0, TRUE );
+ dia.setup( appIface );
+ if ( dia.exec() == TQDialog::Accepted ) {
+ DesignerInterface *dIface = 0;
+ appIface->queryInterface( IID_Designer, (TQUnknownInterface**)&dIface );
+ if ( dIface ) {
+ src.type = SourceTemplateInterface::Source::FileName;
+ src.filename = dia.editFileName->text();
+ TQString include = dIface->currentProject()->
+ formFileName( dia.listForms->text( dia.listForms->currentItem() ) );
+ include.remove( include.length() - 2, 2 );
+ include += "h";
+ int slashFind = include.tqfindRev('/');
+ if (slashFind != -1)
+ include = include.mid(slashFind+1);
+ src.code = generateMainCppCode( dia.listForms->text( dia.listForms->currentItem() ),
+ include );
+ }
+ }
+ }
+ return src;
+}
+
+TQString SourceTemplateInterfaceImpl::language( const TQString & ) const
+{
+ return "C++";
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.h
new file mode 100644
index 0000000..73163dc
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.h
@@ -0,0 +1,54 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SOURCETEMPLATEINTERFACEIMPL_H
+#define SOURCETEMPLATEINTERFACEIMPL_H
+
+#include <sourcetemplateiface.h>
+
+class SourceTemplateInterfaceImpl : public SourceTemplateInterface
+{
+public:
+ SourceTemplateInterfaceImpl();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface** );
+ TQStringList featureList() const;
+ Source create( const TQString &templ, TQUnknownInterface *appIface );
+ TQString language( const TQString &templ ) const;
+
+ TQ_REFCOUNT
+};
+
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp
new file mode 100644
index 0000000..251e2b5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp
@@ -0,0 +1,550 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "syntaxhighliter_cpp.h"
+#include "paragdata.h"
+#include "tqstring.h"
+#include "tqstringlist.h"
+#include "tqmap.h"
+#include "tqapplication.h"
+#include "tqregexp.h"
+
+const char * const SyntaxHighlighter_CPP::keywords[] = {
+ // C++ keywords
+ "and",
+ "and_eq",
+ "asm",
+ "auto",
+ "bitand",
+ "bitor",
+ "bool",
+ "break",
+ "case",
+ "catch",
+ "char",
+ "class",
+ "compl",
+ "const",
+ "const_cast",
+ "continue",
+ "default",
+ "delete",
+ "do",
+ "double",
+ "dynamic_cast",
+ "else",
+ "enum",
+ "explicit",
+ "export",
+ "extern",
+ "false",
+ "FALSE",
+ "float",
+ "for",
+ "friend",
+ "goto",
+ "if",
+ "inline",
+ "int",
+ "long",
+ "mutable",
+ "namespace",
+ "new",
+ "not",
+ "not_eq",
+ "operator",
+ "or",
+ "or_eq",
+ "private",
+ "protected",
+ "public",
+ "register",
+ "reinterpret_cast",
+ "return",
+ "short",
+ "signed",
+ "sizeof",
+ "static",
+ "static_cast",
+ "struct",
+ "switch",
+ "template",
+ "this",
+ "throw",
+ "true",
+ "TRUE",
+ "try",
+ "typedef",
+ "typeid",
+ "typename",
+ "union",
+ "unsigned",
+ "using",
+ "virtual",
+ "void",
+ "volatile",
+ "wchar_t",
+ "while",
+ "xor",
+ "xor_eq",
+ // additional "keywords" intoduced by TQt
+ "Q_SLOTS",
+ "Q_SIGNALS",
+ "uint",
+ "ushort",
+ "ulong",
+ "emit",
+ // end of array
+ 0
+};
+
+static TQMap<int, TQMap<TQString, int > > *wordMap = 0;
+
+SyntaxHighlighter_CPP::SyntaxHighlighter_CPP()
+ : TQTextPreProcessor(), lastFormat( 0 ), lastFormatId( -1 )
+{
+ TQFont f( tqApp->font() );
+
+ addFormat( Standard, new TQTextFormat( f, TQt::black ) );
+ addFormat( Number, new TQTextFormat( f, TQt::darkBlue ) );
+ addFormat( String, new TQTextFormat( f, TQt::darkGreen ) );
+ addFormat( Type, new TQTextFormat( f, TQt::darkMagenta ) );
+ addFormat( Keyword, new TQTextFormat( f, TQt::darkYellow ) );
+ addFormat( PreProcessor, new TQTextFormat( f, TQt::darkBlue ) );
+ addFormat( Label, new TQTextFormat( f, TQt::darkRed ) );
+ f.setFamily( "times" );
+ addFormat( Comment, new TQTextFormat( f, TQt::red ) );
+
+ if ( wordMap )
+ return;
+
+ wordMap = new TQMap<int, TQMap<TQString, int> >;
+ int len;
+ for ( int i = 0; keywords[ i ]; ++i ) {
+ len = (int)strlen( keywords[ i ] );
+ if ( !wordMap->tqcontains( len ) )
+ wordMap->insert( len, TQMap<TQString, int >() );
+ TQMap<TQString, int> &map = wordMap->operator[]( len );
+ map[ keywords[ i ] ] = Keyword;
+ }
+}
+
+SyntaxHighlighter_CPP::~SyntaxHighlighter_CPP()
+{
+}
+
+static int string2Id( const TQString &s )
+{
+ if ( s == "Standard" )
+ return SyntaxHighlighter_CPP::Standard;
+ if ( s == "Comment" )
+ return SyntaxHighlighter_CPP::Comment;
+ if ( s == "Number" )
+ return SyntaxHighlighter_CPP::Number;
+ if ( s == "String" )
+ return SyntaxHighlighter_CPP::String;
+ if ( s == "Type" )
+ return SyntaxHighlighter_CPP::Type;
+ if ( s == "Preprocessor" )
+ return SyntaxHighlighter_CPP::PreProcessor;
+ if ( s == "Label" )
+ return SyntaxHighlighter_CPP::Label;
+ if ( s == "Keyword" )
+ return SyntaxHighlighter_CPP::Keyword;
+ return SyntaxHighlighter_CPP::Standard;
+}
+
+void SyntaxHighlighter_CPP::updateStyles( const TQMap<TQString, ConfigStyle> &styles )
+{
+ for ( TQMap<TQString, ConfigStyle>::ConstIterator it = styles.begin(); it != styles.end(); ++it ) {
+ int id = string2Id( it.key() );
+ TQTextFormat *f = format( id );
+ if ( !f )
+ continue;
+ f->setFont( (*it).font );
+ f->setColor( (*it).color );
+ }
+}
+
+void SyntaxHighlighter_CPP::process( TQTextDocument *doc, TQTextParagraph *string, int, bool tqinvalidate )
+{
+
+ TQTextFormat *formatStandard = format( Standard );
+ TQTextFormat *formatComment = format( Comment );
+ TQTextFormat *formatNumber = format( Number );
+ TQTextFormat *formatString = format( String );
+ TQTextFormat *formatType = format( Type );
+ TQTextFormat *formatPreProcessor = format( PreProcessor );
+ TQTextFormat *formatLabel = format( Label );
+
+ // states
+ const int StateStandard = 0;
+ const int StateCommentStart1 = 1;
+ const int StateCCommentStart2 = 2;
+ const int StateCppCommentStart2 = 3;
+ const int StateCComment = 4;
+ const int StateCppComment = 5;
+ const int StateCCommentEnd1 = 6;
+ const int StateCCommentEnd2 = 7;
+ const int StateStringStart = 8;
+ const int StateString = 9;
+ const int StateStringEnd = 10;
+ const int StateString2Start = 11;
+ const int StateString2 = 12;
+ const int StateString2End = 13;
+ const int StateNumber = 14;
+ const int StatePreProcessor = 15;
+
+ // tokens
+ const int InputAlpha = 0;
+ const int InputNumber = 1;
+ const int InputAsterix = 2;
+ const int InputSlash = 3;
+ const int InputParen = 4;
+ const int InputSpace = 5;
+ const int InputHash = 6;
+ const int InputQuotation = 7;
+ const int InputApostrophe = 8;
+ const int InputSep = 9;
+
+ static uchar table[ 16 ][ 10 ] = {
+ { StateStandard, StateNumber, StateStandard, StateCommentStart1, StateStandard, StateStandard, StatePreProcessor, StateStringStart, StateString2Start, StateStandard }, // StateStandard
+ { StateStandard, StateNumber, StateCCommentStart2, StateCppCommentStart2, StateStandard, StateStandard, StatePreProcessor, StateStringStart, StateString2Start, StateStandard }, // StateCommentStart1
+ { StateCComment, StateCComment, StateCCommentEnd1, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment }, // StateCCommentStart2
+ { StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment }, // CppCommentStart2
+ { StateCComment, StateCComment, StateCCommentEnd1, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment }, // StateCComment
+ { StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment, StateCppComment }, // StateCppComment
+ { StateCComment, StateCComment, StateCCommentEnd1, StateCCommentEnd2, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment, StateCComment }, // StateCCommentEnd1
+ { StateStandard, StateNumber, StateStandard, StateCommentStart1, StateStandard, StateStandard, StatePreProcessor, StateStringStart, StateString2Start, StateStandard }, // StateCCommentEnd2
+ { StateString, StateString, StateString, StateString, StateString, StateString, StateString, StateStringEnd, StateString, StateString }, // StateStringStart
+ { StateString, StateString, StateString, StateString, StateString, StateString, StateString, StateStringEnd, StateString, StateString }, // StateString
+ { StateStandard, StateStandard, StateStandard, StateCommentStart1, StateStandard, StateStandard, StatePreProcessor, StateStringStart, StateString2Start, StateStandard }, // StateStringEnd
+ { StateString2, StateString2, StateString2, StateString2, StateString2, StateString2, StateString2, StateString2, StateString2End, StateString2 }, // StateString2Start
+ { StateString2, StateString2, StateString2, StateString2, StateString2, StateString2, StateString2, StateString2, StateString2End, StateString2 }, // StateString2
+ { StateStandard, StateStandard, StateStandard, StateCommentStart1, StateStandard, StateStandard, StatePreProcessor, StateStringStart, StateString2Start, StateStandard }, // StateString2End
+ { StateNumber, StateNumber, StateStandard, StateCommentStart1, StateStandard, StateStandard, StatePreProcessor, StateStringStart, StateString2Start, StateStandard }, // StateNumber
+ { StatePreProcessor, StateStandard, StateStandard, StateCommentStart1, StateStandard, StateStandard, StatePreProcessor, StateStringStart, StateString2Start, StateStandard } // StatePreProcessor
+ };
+
+ TQString buffer;
+
+ int state = StateStandard;
+ if ( string->prev() ) {
+ if ( string->prev()->endState() == -1 )
+ process( doc, string->prev(), 0, FALSE );
+ state = string->prev()->endState();
+ }
+ int input = -1;
+ int i = 0;
+ bool lastWasBackSlash = FALSE;
+ bool makeLastStandard = FALSE;
+
+ ParagData *paragData = (ParagData*)string->extraData();
+ if ( paragData )
+ paragData->parenList.clear();
+ else
+ paragData = new ParagData;
+
+ TQString alphabeth = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPTQRSTUVWXYZ";
+ TQString mathChars = "xXeE";
+ TQString numbers = "0123456789";
+ bool questionMark = FALSE;
+ TQChar lastChar;
+ for (;;) {
+ TQChar c = string->at( i )->c;
+
+ if ( lastWasBackSlash ) {
+ input = InputSep;
+ } else {
+ switch ( c ) {
+ case '*':
+ input = InputAsterix;
+ break;
+ case '/':
+ input = InputSlash;
+ break;
+ case '(': case '[': case '{':
+ input = InputParen;
+ if ( state == StateStandard ||
+ state == StateNumber ||
+ state == StatePreProcessor ||
+ state == StateCCommentEnd2 ||
+ state == StateCCommentEnd1 ||
+ state == StateString2End ||
+ state == StateStringEnd )
+ paragData->parenList << Paren( Paren::Open, c, i );
+ break;
+ case ')': case ']': case '}':
+ input = InputParen;
+ if ( state == StateStandard ||
+ state == StateNumber ||
+ state == StatePreProcessor ||
+ state == StateCCommentEnd2 ||
+ state == StateCCommentEnd1 ||
+ state == StateString2End ||
+ state == StateStringEnd )
+ paragData->parenList << Paren( Paren::Closed, c, i );
+ break;
+ case '#':
+ input = InputHash;
+ break;
+ case '"':
+ input = InputQuotation;
+ break;
+ case '\'':
+ input = InputApostrophe;
+ break;
+ case ' ':
+ input = InputSpace;
+ break;
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9': case '0':
+ if ( alphabeth.tqfind( lastChar ) != -1 &&
+ ( mathChars.tqfind( lastChar ) == -1 || numbers.tqfind( string->at( i - 1 )->c ) == -1 ) ) {
+ input = InputAlpha;
+ } else {
+ if ( input == InputAlpha && numbers.tqfind( lastChar ) != -1 )
+ input = InputAlpha;
+ else
+ input = InputNumber;
+ }
+ break;
+ case ':': {
+ input = InputAlpha;
+ TQChar nextChar = ' ';
+ if ( i < string->length() - 1 )
+ nextChar = string->at( i + 1 )->c;
+ if ( state == StateStandard && !questionMark && lastChar != ':' && nextChar != ':' ) {
+ for ( int j = 0; j < i; ++j ) {
+ if ( string->at( j )->format() == formatStandard )
+ string->setFormat( j, 1, formatLabel, FALSE );
+ }
+ }
+ } break;
+ default: {
+ if ( !questionMark && c == '?' )
+ questionMark = TRUE;
+ if ( c.isLetter() || c == '_' )
+ input = InputAlpha;
+ else
+ input = InputSep;
+ } break;
+ }
+ }
+
+ lastWasBackSlash = !lastWasBackSlash && c == '\\';
+
+ if ( input == InputAlpha )
+ buffer += c;
+
+ state = table[ state ][ input ];
+
+ switch ( state ) {
+ case StateStandard: {
+ int len = buffer.length();
+ string->setFormat( i, 1, formatStandard, FALSE );
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ if ( buffer.length() > 0 && input != InputAlpha ) {
+ if ( buffer[ 0 ] == 'Q' ) {
+ string->setFormat( i - buffer.length(), buffer.length(), formatType, FALSE );
+ } else {
+ TQMap<int, TQMap<TQString, int > >::Iterator it = wordMap->tqfind( len );
+ if ( it != wordMap->end() ) {
+ TQMap<TQString, int >::Iterator it2 = ( *it ).tqfind( buffer );
+ if ( it2 != ( *it ).end() )
+ string->setFormat( i - buffer.length(), buffer.length(), format( ( *it2 ) ), FALSE );
+ }
+ }
+ buffer = TQString();
+ }
+ } break;
+ case StateCommentStart1:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = TRUE;
+ buffer = TQString();
+ break;
+ case StateCCommentStart2:
+ string->setFormat( i - 1, 2, formatComment, FALSE );
+ makeLastStandard = FALSE;
+ buffer = TQString();
+ break;
+ case StateCppCommentStart2:
+ string->setFormat( i - 1, 2, formatComment, FALSE );
+ makeLastStandard = FALSE;
+ buffer = TQString();
+ break;
+ case StateCComment:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatComment, FALSE );
+ buffer = TQString();
+ break;
+ case StateCppComment:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatComment, FALSE );
+ buffer = TQString();
+ break;
+ case StateCCommentEnd1:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatComment, FALSE );
+ buffer = TQString();
+ break;
+ case StateCCommentEnd2:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatComment, FALSE );
+ buffer = TQString();
+ break;
+ case StateStringStart:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ buffer = TQString();
+ break;
+ case StateString:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatString, FALSE );
+ buffer = TQString();
+ break;
+ case StateStringEnd:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ buffer = TQString();
+ break;
+ case StateString2Start:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ buffer = TQString();
+ break;
+ case StateString2:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatString, FALSE );
+ buffer = TQString();
+ break;
+ case StateString2End:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ buffer = TQString();
+ break;
+ case StateNumber:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatNumber, FALSE );
+ buffer = TQString();
+ break;
+ case StatePreProcessor:
+ if ( makeLastStandard )
+ string->setFormat( i - 1, 1, formatStandard, FALSE );
+ makeLastStandard = FALSE;
+ string->setFormat( i, 1, formatPreProcessor, FALSE );
+ buffer = TQString();
+ break;
+ }
+
+ lastChar = c;
+ i++;
+ if ( i >= string->length() )
+ break;
+ }
+
+ string->setExtraData( paragData );
+
+ int oldEndState = string->endState();
+ if ( state == StateCComment ||
+ state == StateCCommentEnd1 ) {
+ string->setEndState( StateCComment );
+ } else if ( state == StateString ) {
+ string->setEndState( StateString );
+ } else if ( state == StateString2 ) {
+ string->setEndState( StateString2 );
+ } else {
+ string->setEndState( StateStandard );
+ }
+
+ string->setFirstPreProcess( FALSE );
+
+ TQTextParagraph *p = string->next();
+ if ( (!!oldEndState || !!string->endState()) && oldEndState != string->endState() &&
+ tqinvalidate && p && !p->firstPreProcess() && p->endState() != -1 ) {
+ while ( p ) {
+ if ( p->endState() == -1 )
+ return;
+ p->setEndState( -1 );
+ p = p->next();
+ }
+ }
+}
+
+TQTextFormat *SyntaxHighlighter_CPP::format( int id )
+{
+ if ( lastFormatId == id && lastFormat )
+ return lastFormat;
+
+ TQTextFormat *f = formats[ id ];
+ lastFormat = f ? f : formats[ 0 ];
+ lastFormatId = id;
+ return lastFormat;
+}
+
+void SyntaxHighlighter_CPP::addFormat( int id, TQTextFormat *f )
+{
+ formats.insert( id, f );
+}
+
+void SyntaxHighlighter_CPP::removeFormat( int id )
+{
+ formats.remove( id );
+}
+
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.h
new file mode 100644
index 0000000..ecaed41
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.h
@@ -0,0 +1,73 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TQCPPSYNTAXHIGHLIGHTER_H
+#define TQCPPSYNTAXHIGHLIGHTER_H
+
+#include <private/tqrichtext_p.h>
+#include <conf.h>
+
+class SyntaxHighlighter_CPP : public TQTextPreProcessor
+{
+public:
+ enum CppIds {
+ Comment = 1,
+ Number,
+ String,
+ Type,
+ Keyword,
+ PreProcessor,
+ Label
+ };
+
+ SyntaxHighlighter_CPP();
+ virtual ~SyntaxHighlighter_CPP();
+ void process( TQTextDocument *doc, TQTextParagraph *string, int start, bool tqinvalidate = TRUE );
+ void updateStyles( const TQMap<TQString, ConfigStyle> &styles );
+
+ static const char * const keywords[];
+
+ TQTextFormat *format( int id );
+
+private:
+ void addFormat( int id, TQTextFormat *f );
+ void removeFormat( int id );
+
+ TQTextFormat *lastFormat;
+ int lastFormatId;
+ TQIntDict<TQTextFormat> formats;
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp
new file mode 100644
index 0000000..ab69cce
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp
@@ -0,0 +1,800 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqregexp.h>
+
+#include <ctype.h>
+#include <stdio.h>
+
+#include "yyreg.h"
+
+/*
+ First comes the tokenizer. We don't need something that knows much
+ about C++. However, we need something that gives tokens from the
+ end of the file to the start, which is tricky.
+
+ If you are not familiar with hand-written tokenizers and parsers,
+ you might want to read other simpler parsers written in the same
+ style:
+
+ $(TQTDIR)/src/tools/qregexp.cpp
+ $(TQTDIR)/tools/inspector/cppparser.cpp
+
+ You might also want to read Section 2 in the Dragon Book.
+*/
+
+/*
+ Those are the tokens we are interested in. Tok_Something represents
+ any C++ token that does not interest us, but it's dangerous to
+ ignore tokens completely.
+*/
+enum { Tok_Boi, Tok_Ampersand, Tok_Aster, Tok_LeftParen, Tok_RightParen,
+ Tok_Equal, Tok_LeftBrace, Tok_RightBrace, Tok_Semicolon, Tok_Colon,
+ Tok_LeftAngle, Tok_RightAngle, Tok_Comma, Tok_Ellipsis, Tok_Gulbrandsen,
+ Tok_LeftBracket, Tok_RightBracket, Tok_Tilde, Tok_Something, Tok_Comment,
+ Tok_Ident,
+
+ Tok_char, Tok_const, Tok_double, Tok_int, Tok_long, Tok_operator,
+ Tok_short, Tok_signed, Tok_unsigned };
+
+/*
+ The following variables store the lexical analyzer state. The best way
+ to understand them is to implement a function myGetToken() that calls
+ getToken(), to add some qDebug() statements in there and then to
+ #define getToken() myGetToken().
+*/
+static TQString *yyIn; // the input stream
+static int yyPos; // the position of the current token in yyIn
+static int yyCurPos; // the position of the next lookahead character
+static char *yyLexBuf; // the lexeme buffer
+static const int YYLexBufSize = 65536; // big enough for long comments
+static char *yyLex; // the lexeme itself (a pointer into yyLexBuf)
+static int yyCh; // the lookbehind character
+
+/*
+ Moves back to the previous character in the input stream and
+ updates the tokenizer state. This function is to be used only by
+ getToken(), which provides the right abstraction.
+*/
+static inline void readChar()
+{
+ if ( yyCh == EOF )
+ return;
+
+ if ( yyLex > yyLexBuf )
+ *--yyLex = (char) yyCh;
+
+ if ( yyCurPos < 0 )
+ yyCh = EOF;
+ else
+ yyCh = (*yyIn)[yyCurPos].tqunicode();
+ yyCurPos--;
+}
+
+/*
+ Sets up the tokenizer.
+*/
+static void startTokenizer( const TQString& in )
+{
+ yyIn = new TQString;
+ *yyIn = in;
+ yyPos = yyIn->length() - 1;
+ yyCurPos = yyPos;
+ yyLexBuf = new char[YYLexBufSize];
+ yyLex = yyLexBuf + YYLexBufSize - 1;
+ *yyLex = '\0';
+ yyCh = '\0';
+ readChar();
+}
+
+/*
+ Frees resources allocated by the tokenizer.
+*/
+static void stopTokenizer()
+{
+ delete yyIn;
+ delete[] yyLexBuf;
+ yyLexBuf = 0;
+}
+
+/*
+ These two macros implement quick-and-dirty hashing for telling
+ apart keywords fast.
+*/
+#define HASH( ch, len ) ( (ch) | ((len) << 8) )
+#define CHECK( target ) \
+ if ( strcmp((target), yyLex) != 0 ) \
+ break;
+
+/*
+ Returns the previous token in the abstract token stream. The parser
+ deals only with tokens, not with characters.
+*/
+static int getToken()
+{
+ // why "+ 2"? try putting some qDebug()'s and see
+ yyPos = yyCurPos + 2;
+
+ for ( ;; ) {
+ /*
+ See if the previous token is interesting. If it isn't, we
+ will loop anyway an go to the token before the previous
+ token, and so on.
+ */
+
+ yyLex = yyLexBuf + YYLexBufSize - 1;
+ *yyLex = '\0';
+
+ if ( yyCh == EOF ) {
+ break;
+ } else if ( isspace(yyCh) ) {
+ bool metNL = FALSE;
+ do {
+ metNL = ( metNL || yyCh == '\n' );
+ readChar();
+ } while ( isspace(yyCh) );
+
+ if ( metNL ) {
+ /*
+ C++ style comments are tricky. In left-to-right
+ thinking, C++ comments start with "//" and end with
+ '\n'. In right-to-left thinking, they start with a
+ '\n'; but of course not every '\n' starts a comment.
+
+ When we meet the '\n', we look behind, on the same
+ line, for a "//", and if there is one we mess
+ around with the tokenizer state to effectively
+ ignore the comment. Beware of off-by-one and
+ off-by-two bugs when you modify this code by adding
+ qDebug()'s here and there.
+ */
+ if ( yyCurPos >= 0 ) {
+ int lineStart = yyIn->tqfindRev( TQChar('\n'), yyCurPos ) + 1;
+ TQString line = yyIn->mid( lineStart,
+ yyCurPos - lineStart + 2 );
+ int commentStart = line.tqfind( TQString("//") );
+ if ( commentStart != -1 ) {
+ yyCurPos = lineStart + commentStart - 1;
+ yyPos = yyCurPos + 2;
+ readChar();
+ }
+ }
+ }
+ } else if ( isalnum(yyCh) || yyCh == '_' ) {
+ do {
+ readChar();
+ } while ( isalnum(yyCh) || yyCh == '_' );
+
+ switch ( HASH(yyLex[0], strlen(yyLex)) ) {
+ case HASH( 'c', 4 ):
+ CHECK( "char" );
+ return Tok_char;
+ case HASH( 'c', 5 ):
+ CHECK( "const" );
+ return Tok_const;
+ case HASH( 'd', 6 ):
+ CHECK( "double" );
+ return Tok_double;
+ case HASH( 'i', 3 ):
+ CHECK( "int" );
+ return Tok_int;
+ case HASH( 'l', 4 ):
+ CHECK( "long" );
+ return Tok_long;
+ case HASH( 'o', 8 ):
+ CHECK( "operator" );
+ return Tok_operator;
+ case HASH( 's', 5 ):
+ CHECK( "short" );
+ return Tok_short;
+ case HASH( 's', 6 ):
+ CHECK( "signed" );
+ return Tok_signed;
+ case HASH( 'u', 8 ):
+ CHECK( "unsigned" );
+ return Tok_unsigned;
+ }
+ if ( isdigit(*yyLex) )
+ return Tok_Something;
+ else
+ return Tok_Ident;
+ } else {
+ int quote;
+
+ switch ( yyCh ) {
+ case '!':
+ case '%':
+ case '^':
+ case '+':
+ case '-':
+ case '?':
+ case '|':
+ readChar();
+ return Tok_Something;
+ case '"':
+ case '\'':
+ quote = yyCh;
+ readChar();
+
+ while ( yyCh != EOF && yyCh != '\n' ) {
+ if ( yyCh == quote ) {
+ readChar();
+ if ( yyCh != '\\' )
+ break;
+ } else {
+ readChar();
+ }
+ }
+ return Tok_Something;
+ case '&':
+ readChar();
+ if ( yyCh == '&' ) {
+ readChar();
+ return Tok_Something;
+ } else {
+ return Tok_Ampersand;
+ }
+ case '(':
+ readChar();
+ return Tok_LeftParen;
+ case ')':
+ readChar();
+ return Tok_RightParen;
+ case '*':
+ readChar();
+ return Tok_Aster;
+ case ',':
+ readChar();
+ return Tok_Comma;
+ case '.':
+ readChar();
+ if ( yyCh == '.' ) {
+ do {
+ readChar();
+ } while ( yyCh == '.' );
+ return Tok_Ellipsis;
+ } else {
+ return Tok_Something;
+ }
+ case '/':
+ /*
+ C-style comments are symmetric. C++-style comments
+ are handled elsewhere.
+ */
+ readChar();
+ if ( yyCh == '*' ) {
+ bool metAster = FALSE;
+ bool metAsterSlash = FALSE;
+
+ readChar();
+
+ while ( !metAsterSlash ) {
+ if ( yyCh == EOF )
+ break;
+
+ if ( yyCh == '*' )
+ metAster = TRUE;
+ else if ( metAster && yyCh == '/' )
+ metAsterSlash = TRUE;
+ else
+ metAster = FALSE;
+ readChar();
+ }
+ break;
+ // return Tok_Comment;
+ } else {
+ return Tok_Something;
+ }
+ case ':':
+ readChar();
+ if ( yyCh == ':' ) {
+ readChar();
+ return Tok_Gulbrandsen;
+ } else {
+ return Tok_Colon;
+ }
+ case ';':
+ readChar();
+ return Tok_Semicolon;
+ case '<':
+ readChar();
+ return Tok_LeftAngle;
+ case '=':
+ readChar();
+ return Tok_Equal;
+ case '>':
+ readChar();
+ return Tok_RightAngle;
+ case '[':
+ readChar();
+ return Tok_LeftBracket;
+ case ']':
+ readChar();
+ return Tok_RightBracket;
+ case '{':
+ readChar();
+ return Tok_LeftBrace;
+ case '}':
+ readChar();
+ return Tok_RightBrace;
+ case '~':
+ readChar();
+ return Tok_Tilde;
+ default:
+ readChar();
+ }
+ }
+ }
+ return Tok_Boi;
+}
+
+/*
+ Follow the member function(s) of CppFunction.
+*/
+
+/*
+ Returns the prototype for the C++ function, without the semicolon.
+*/
+TQString CppFunction::prototype() const
+{
+ TQString proto;
+
+ if ( !returnType().isEmpty() )
+ proto = returnType() + TQChar( ' ' );
+ proto += scopedName();
+ proto += TQChar( '(' );
+ if ( !parameterList().isEmpty() ) {
+ TQStringList::ConstIterator p = parameterList().begin();
+ proto += *p;
+ ++p;
+ while ( p != parameterList().end() ) {
+ proto += TQString( ", " );
+ proto += *p;
+ ++p;
+ }
+ }
+ proto += TQChar( ')' );
+ if ( isConst() )
+ proto += TQString( " const" );
+ return proto;
+}
+
+/*
+ The parser follows. We are not really parsing C++, just trying to
+ tqfind the start and end of function definitions.
+
+ One important pitfall is that the parsed code needs not be valid.
+ Parsing from right to left helps cope with that, as explained in
+ comments below.
+
+ In the examples, we will use the symbol @ to stand for the position
+ in the token stream. In "int @ x ;", the lookahead token (yyTok) is
+ 'int'.
+*/
+
+static int yyTok; // the current token
+
+/*
+ Returns TRUE if thingy is a constructor or a destructor; otherwise
+ returns FALSE.
+*/
+static bool isCtorOrDtor( const TQString& thingy )
+{
+ // e.g., Alpha<a>::Beta<Bar<b, c> >::~Beta
+ TQRegExp xtor( TQString(
+ "(?:([A-Z_a-z][0-9A-Z_a-z]*)" // class name
+ "(?:<(?:[^>]|<[^>]*>)*>)*" // template arguments
+ "::)+" // many in a row
+ "~?" // ctor or dtor?
+ "\\1") ); // function has same name as class
+ return xtor.exactMatch( thingy );
+}
+
+/*
+ Skips over any template arguments with balanced angle brackets, and
+ returns the skipped material as a string.
+
+ Before: TQMap < TQString , TQValueList < TQString > > @ m ;
+ After: TQMap @ < TQString , TQValueList < TQString > > m ;
+*/
+static TQString matchTemplateAngles()
+{
+ TQString t;
+
+ if ( yyTok == Tok_RightAngle ) {
+ int depth = 0;
+ do {
+ if ( yyTok == Tok_RightAngle )
+ depth++;
+ else if ( yyTok == Tok_LeftAngle )
+ depth--;
+ t.prepend( yyLex );
+ yyTok = getToken();
+ } while ( depth > 0 && yyTok != Tok_Boi && yyTok != Tok_LeftBrace );
+ }
+ return t;
+}
+
+/*
+ Similar to matchTemplateAngles(), but for array brackets in parameter
+ data types (as in "int *argv[]").
+*/
+static TQString matchArrayBrackets()
+{
+ TQString t;
+
+ while ( yyTok == Tok_RightBracket ) {
+ t.prepend( yyLex );
+ yyTok = getToken();
+ if ( yyTok == Tok_Something ) {
+ t.prepend( yyLex );
+ yyTok = getToken();
+ }
+ if ( yyTok != Tok_LeftBracket )
+ return TQString();
+ t.prepend( yyLex );
+ yyTok = getToken();
+ }
+ return t;
+}
+
+/*
+ Prepends prefix to *type. This operation is in theory trivial, but
+ for the spacing to look good, we have to do something. The original
+ spacing is lost as the input is tokenized.
+*/
+static void prependToType( TQString *type, const TQString& prefix )
+{
+ if ( !type->isEmpty() && !prefix.isEmpty() ) {
+ TQChar left = prefix[(int) prefix.length() - 1];
+ TQChar right = (*type)[0];
+
+ if ( left.isLetter() &&
+ (right.isLetter() || right == TQChar('*') || right == TQChar('&')) )
+ type->prepend( TQChar(' ') );
+ }
+ type->prepend( prefix );
+}
+
+static bool isModifier( int tok )
+{
+ return ( tok == Tok_signed || tok == Tok_unsigned ||
+ tok == Tok_short || tok == Tok_long );
+}
+
+/*
+ Parses a data type (backwards as usual) and returns a textual
+ representation of it.
+*/
+static TQString matchDataType()
+{
+ TQString type;
+
+ while ( yyTok == Tok_Ampersand || yyTok == Tok_Aster ||
+ yyTok == Tok_const ) {
+ prependToType( &type, yyLex );
+ yyTok = getToken();
+ }
+
+ /*
+ This code is really hard to follow... sorry. The loop matches
+ Alpha::Beta::Gamma::...::Omega.
+ */
+ for ( ;; ) {
+ bool modifierMet = FALSE;
+
+ prependToType( &type, matchTemplateAngles() );
+
+ if ( yyTok != Tok_Ident ) {
+ /*
+ People may write 'const unsigned short' or
+ 'short unsigned const' or any other permutation.
+ */
+ while ( yyTok == Tok_const || isModifier(yyTok) ) {
+ prependToType( &type, yyLex );
+ yyTok = getToken();
+ if ( yyTok != Tok_const )
+ modifierMet = TRUE;
+ }
+
+ if ( yyTok == Tok_Tilde ) {
+ prependToType( &type, yyLex );
+ yyTok = getToken();
+ }
+ }
+
+ if ( !modifierMet ) {
+ if ( yyTok == Tok_Ellipsis || yyTok == Tok_Ident ||
+ yyTok == Tok_char || yyTok == Tok_int ||
+ yyTok == Tok_double ) {
+ prependToType( &type, yyLex );
+ yyTok = getToken();
+ } else {
+ return TQString();
+ }
+ } else if ( yyTok == Tok_int || yyTok == Tok_char ||
+ yyTok == Tok_double ) {
+ prependToType( &type, yyLex );
+ yyTok = getToken();
+ }
+
+ while ( yyTok == Tok_const || isModifier(yyTok) ) {
+ prependToType( &type, yyLex );
+ yyTok = getToken();
+ }
+
+ if ( yyTok == Tok_Gulbrandsen ) {
+ prependToType( &type, yyLex );
+ yyTok = getToken();
+ } else {
+ break;
+ }
+ }
+ return type;
+}
+
+/*
+ Parses a function prototype (without the semicolon) and returns an
+ object that stores information about this function.
+*/
+static CppFunction matchFunctionPrototype( bool stripParamNames )
+{
+ CppFunction func;
+#if 0
+ TQString documentation;
+#endif
+ TQString returnType;
+ TQString scopedName;
+ TQStringList params;
+ TQString qualifier;
+ bool cnst = FALSE;
+
+ if ( yyTok == Tok_const ) {
+ cnst = TRUE;
+ yyTok = getToken();
+ }
+
+ if ( yyTok != Tok_RightParen )
+ return func;
+ yyTok = getToken();
+
+ if ( yyTok != Tok_LeftParen ) {
+ for ( ;; ) {
+ TQString brackets = matchArrayBrackets();
+ TQString name;
+ if ( yyTok == Tok_Ident ) {
+ name = yyLex;
+ yyTok = getToken();
+ }
+ TQString type = matchDataType();
+
+ if ( type.isEmpty() ) {
+ if ( name.isEmpty() )
+ return func;
+ type = name;
+ name = TQString();
+ }
+ if ( stripParamNames )
+ name = TQString();
+
+ TQString param = type + TQChar( ' ' ) + name + brackets;
+ params.prepend( param.stripWhiteSpace() );
+
+ if ( yyTok != Tok_Comma )
+ break;
+ yyTok = getToken();
+ }
+ if ( yyTok != Tok_LeftParen )
+ return func;
+ }
+ yyTok = getToken();
+
+ for ( ;; ) {
+ scopedName.prepend( matchTemplateAngles() );
+
+ if ( yyTok != Tok_Ident ) {
+ // the operator keyword should be close
+ int i = 0;
+ while ( i < 4 && yyTok != Tok_operator ) {
+ scopedName.prepend( yyLex );
+ i++;
+ }
+ if ( yyTok != Tok_operator )
+ return func;
+ }
+ scopedName.prepend( yyLex );
+ yyTok = getToken();
+
+ if ( yyTok != Tok_Gulbrandsen )
+ break;
+ scopedName.prepend( yyLex );
+ yyTok = getToken();
+ }
+
+ if ( !isCtorOrDtor(scopedName) ) {
+ returnType = matchDataType();
+ if ( returnType.isEmpty() )
+ return func;
+ }
+
+ /*
+ The documentation feature is unused so far, since we cannot
+ really distinguist between a normal comment between two
+ functions and one that relates to the following function. One
+ good heuristic is to assume that a comment immediately followed
+ by a function with no blank line in between relates to the
+ function, but there's no easy way to tqfind that out with a
+ tokenizer.
+ */
+#if 0
+ if ( yyTok == Tok_Comment ) {
+ documentation = yyLex;
+ yyTok = getToken();
+ }
+
+ func.setDocumentation( documentation );
+#endif
+ func.setReturnType( returnType );
+ func.setScopedName( scopedName );
+ func.setParameterList( params );
+ func.setConst( cnst );
+ return func;
+}
+
+/*
+ Try to set the body. It's not sufficient to call
+ func->setBody(somewhatBody), as the somewhatBody might be too large.
+ Case in point:
+
+ void foo()
+ {
+ printf( "Hello" );
+ }
+
+ int n;
+
+ void bar()
+ {
+ printf( " world!\n" );
+ }
+
+ The parser first tqfinds bar(). Then it tqfinds "void foo() {" and
+ naively expects the body to extend up to "void bar()". This
+ function's job is to count braces and make sure "int n;" is not
+ counted as part of the body.
+
+ Cases where the closing brace of the body is missing require no
+ special processing.
+*/
+static void setBody( CppFunction *func, const TQString& somewhatBody )
+{
+ TQString body = somewhatBody;
+
+ int braceDepth = 0;
+ int i = 0;
+ while ( i < (int) body.length() ) {
+ if ( body[i] == TQChar('{') ) {
+ braceDepth++;
+ } else if ( body[i] == TQChar('}') ) {
+ braceDepth--;
+ if ( braceDepth == 0 ) {
+ body.truncate( i + 1 );
+ break;
+ }
+ }
+ i++;
+ }
+
+ func->setBody( body );
+}
+
+/*
+ Parses a whole C++ file, looking for function definitions. Case in
+ point:
+
+ void foo()
+ {
+ printf( "Hello" );
+
+ void bar()
+ {
+ printf( " world!\n" );
+ }
+
+ The parser looks for left braces and tries to parse a function
+ prototype backwards. First it tqfinds "void bar() {". Then it works
+ up and tqfinds "void foo() {".
+*/
+static void matchTranslationUnit( TQValueList<CppFunction> *flist )
+{
+ int endBody = -1;
+ int startBody;
+
+ for ( ;; ) {
+ if ( endBody == -1 )
+ endBody = yyPos;
+
+ while ( yyTok != Tok_Boi && yyTok != Tok_LeftBrace )
+ yyTok = getToken();
+ if ( yyTok == Tok_Boi )
+ break;
+
+ // found a left brace
+ yyTok = getToken();
+ startBody = yyPos;
+ CppFunction func = matchFunctionPrototype( FALSE );
+ if ( !func.scopedName().isEmpty() ) {
+ TQString body = yyIn->mid( startBody, endBody - startBody );
+ setBody( &func, body );
+ body = func.body(); // setBody() can change the body
+
+ /*
+ Compute important line numbers.
+ */
+ int functionStartLineNo = 1 + TQConstString( yyIn->tqunicode(), yyPos )
+ .string().tqcontains( TQChar('\n') );
+ int startLineNo = functionStartLineNo +
+ TQConstString( yyIn->tqunicode() + yyPos, startBody - yyPos )
+ .string().tqcontains( TQChar('\n') );
+ int endLineNo = startLineNo + body.tqcontains( TQChar('\n') );
+
+ func.setLineNums( functionStartLineNo, startLineNo, endLineNo );
+ flist->prepend( func );
+ endBody = -1;
+ }
+ }
+}
+
+/*
+ Extracts C++ function from source code and put them in a list.
+*/
+void extractCppFunctions( const TQString& code, TQValueList<CppFunction> *flist )
+{
+ startTokenizer( code );
+ yyTok = getToken();
+ matchTranslationUnit( flist );
+ stopTokenizer();
+}
+
+/*
+ Returns the prototype with the parameter names removed.
+*/
+TQString canonicalCppProto( const TQString& proto )
+{
+ startTokenizer( proto );
+ yyTok = getToken();
+ CppFunction func = matchFunctionPrototype( TRUE );
+ stopTokenizer();
+ return func.prototype();
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.h
new file mode 100644
index 0000000..ed6bd52
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.h
@@ -0,0 +1,88 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef YYREG_H
+#define YYREG_H
+
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+
+class CppFunction
+{
+public:
+ CppFunction() : cnst( FALSE ), lineno1( 0 ), lineno2( 0 ) { }
+
+ void setReturnType( const TQString& r ) { ret = r; }
+ void setScopedName( const TQString& n ) { nam = n; }
+ void setParameterList( const TQStringList& p ) { params = p; }
+ void setConst( bool c ) { cnst = c; }
+ void setBody( const TQString& b ) { bod = b; }
+ void setDocumentation( const TQString& d ) { doc = d; }
+ void setLineNums( int functionStart, int openingBrace, int closingBrace ) {
+ lineno0 = functionStart;
+ lineno1 = openingBrace;
+ lineno2 = closingBrace;
+ }
+
+ const TQString& returnType() const { return ret; }
+ const TQString& scopedName() const { return nam; }
+ const TQStringList& parameterList() const { return params; }
+ bool isConst() const { return cnst; }
+ TQString prototype() const;
+ const TQString& body() const { return bod; }
+ const TQString& documentation() const { return doc; }
+ int functionStartLineNum() const { return lineno0; }
+ int openingBraceLineNum() const { return lineno1; }
+ int closingBraceLineNum() const { return lineno2; }
+
+#if defined(TQ_FULL_TEMPLATE_INSTANTIATION)
+ bool operator==( const CppFunction& ) const { return FALSE; }
+#endif
+
+private:
+ TQString ret;
+ TQString nam;
+ TQStringList params;
+ bool cnst;
+ TQString bod;
+ TQString doc;
+ int lineno0;
+ int lineno1;
+ int lineno2;
+};
+
+void extractCppFunctions( const TQString& code, TQValueList<CppFunction> *flist );
+TQString canonicalCppProto( const TQString& proto );
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/dlg/dlg.pro b/tqtinterface/qt4/tools/designer/plugins/dlg/dlg.pro
new file mode 100644
index 0000000..ee93cb9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/dlg/dlg.pro
@@ -0,0 +1,13 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release plugin
+HEADERS = dlg2ui.h
+SOURCES = main.cpp dlg2ui.cpp
+DESTDIR = ../../../../plugins/designer
+DEFINES += QT_INTERNAL_XML
+include( ../../../../src/qt_professional.pri )
+TARGET = dlgplugin
+INCLUDEPATH += ../../interfaces
+
+
+target.path += $$plugins.path/designer
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.cpp b/tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.cpp
new file mode 100644
index 0000000..cb71661
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.cpp
@@ -0,0 +1,1632 @@
+/**********************************************************************
+**
+** Converts a TQt Architect 2.1+ .dlg file into a .ui file.
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "dlg2ui.h"
+#include <tqfile.h>
+#include <tqframe.h>
+#include <tqmessagebox.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
+
+/*
+ Possible improvements:
+
+ 1. Convert tqlayout stretch factors to size policy stretches, now
+ that TQt Designer supports the latter.
+*/
+
+/*
+ These big tables could be more or less eliminated by using TQt's
+ TQMetaObject and TQMetaProperty classes. However, the interface of
+ these classes is unwieldy for an otherwise non-GUI program like this
+ one, as we would have to create one dummy object for most TQObject
+ subclasses in TQt. Let's take the safe road.
+*/
+
+static const char *widgetTypes[] = {
+ "Button", "ButtonGroup", "CheckBox", "ComboBox", "Dial", "DlgWidget",
+ "Frame", "Grid", "GroupBox", "HBox", "HButtonGroup", "HGroupBox",
+ "IconView", "LCDNumber", "Label", "LineEdit", "ListBox", "ListView",
+ "MenuBar", "MultiLineEdit", "ProgressBar", "PushButton", "RadioButton",
+ "ScrollBar", "ScrollView", "Slider", "SpinBox", "Splitter", "TabBar",
+ "TextBrowser", "TextView", "User", "VBox", "VButtonGroup", "VGroupBox", 0
+};
+
+/*
+ This table maps TQt Architect properties to TQt Designer properties.
+ If there is no corresponding TQt Designer property, qtName is 0 and
+ the property can be handled explicitly.
+*/
+static const struct {
+ const char *widgetName;
+ const char *architectName;
+ const char *qtName;
+ const char *type;
+} propertyDefs[] = {
+ { "Button", "AutoRepeat", "autoRepeat", "boolean" },
+ { "Button", "AutoResize", 0, 0 },
+ { "Button", "Text", "text", "qstring" },
+ { "ButtonGroup", "Exclusive", "exclusive", "boolean" },
+ { "ButtonGroup", "RadioButtonExclusive", "radioButtonExclusive",
+ "boolean" },
+ { "CheckBox", "Checked", "checked", "boolean" },
+ { "ComboBox", "AutoCompletion", "autoCompletion", "boolean" },
+ { "ComboBox", "AutoResize", 0, 0 },
+ { "ComboBox", "DuplicatesEnabled", "duplicatesEnabled", "boolean" },
+ { "ComboBox", "MaxCount", "maxCount", "integer" },
+ { "ComboBox", "Policy", "insertionPolicy", "enum" },
+ { "ComboBox", "SizeLimit", "sizeLimit", "integer" },
+ { "ComboBox", "Style", 0, 0 },
+ { "Dial", "Initial", "value", "integer" },
+ { "Dial", "LineStep", "lineStep", "integer" },
+ { "Dial", "MaxValue", "maxValue", "integer" },
+ { "Dial", "MinValue", "minValue", "integer" },
+ { "Dial", "NotchTarget", "notchTarget", "double" },
+ { "Dial", "PageStep", "pageStep", "integer" },
+ { "Dial", "ShowNotches", "notchesVisible", "boolean" },
+ { "Dial", "Tracking", "tracking", "boolean" },
+ { "Dial", "Wrapping", "wrapping", "boolean" },
+ { "DlgWidget", "AdjustSize", 0, 0 },
+ { "DlgWidget", "BackgroundMode", "backgroundMode", "enum" },
+ { "DlgWidget", "BackgroundOrigin", "backgroundOrigin", "enum" },
+ { "DlgWidget", "BackgroundPixmap", "backgroundPixmap", "qpixmap" },
+ { "DlgWidget", "DataLenName", 0, 0 },
+ { "DlgWidget", "DataVarName", 0, 0 },
+ { "DlgWidget", "Enabled", "enabled", "boolean" },
+ { "DlgWidget", "FocusPolicy", "focusPolicy", "enum" },
+ { "DlgWidget", "Font", "font", "qfont" },
+ { "DlgWidget", "FontPropagation", 0, 0 },
+ { "DlgWidget", "MaximumSize", "tqmaximumSize", "qsize" },
+ { "DlgWidget", "MinimumSize", "tqminimumSize", "qsize" },
+ { "DlgWidget", "Name", 0, 0 },
+ { "DlgWidget", "Palette", "palette", "qpalette" },
+ { "DlgWidget", "PalettePropagation", 0, 0 },
+ { "DlgWidget", "ReadPixmapFromData", 0, 0 },
+ { "DlgWidget", "Rect", 0, 0 },
+ { "DlgWidget", "SignalConnection", 0, 0 },
+ { "DlgWidget", "UseBackgroudPixmap", 0, 0 },
+ { "DlgWidget", "Variable", 0, 0 },
+ { "Frame", "FrameMargin", "margin", "integer" },
+ { "Frame", "LineWidth", "lineWidth", "integer" },
+ { "Frame", "MidLineWidth", "midLineWidth", "integer" },
+ { "Frame", "Style", 0, 0 },
+ { "GroupBox", "Title", "title", "qstring" },
+ { "IconView", "AlignMode", 0, 0 },
+ { "IconView", "Aligning", 0, 0 },
+ { "IconView", "Arrangement", "arrangement", "enum" },
+ { "IconView", "AutoArrange", "autoArrange", "boolean" },
+ { "IconView", "EnableMoveItems", "itemsMovable", "boolean" },
+ { "IconView", "GridX", "gridX", "integer" },
+ { "IconView", "GridY", "gridY", "integer" },
+ { "IconView", "ItemTextPos", "itemTextPos", "enum" },
+ { "IconView", "ItemsMovable", "itemsMovable", "boolean" },
+ { "IconView", "MaxItemTextLength", "maxItemTextLength", "integer" },
+ { "IconView", "MaxItemWidth", "maxItemWidth", "integer" },
+ { "IconView", "ResizeMode", "resizeMode", "enum" },
+ { "IconView", "SelectionMode", "selectionMode", "enum" },
+ { "IconView", "ShowToolTips", "showToolTips", "boolean" },
+ { "IconView", "SortAscending", "sortDirection", "bool" },
+ { "IconView", "Spacing", "spacing", "integer" },
+ { "IconView", "WordWrapIconText", "wordWrapIconText", "boolean" },
+ { "LCDNumber", "Digits", "numDigits", "integer" },
+ { "LCDNumber", "Mode", "mode", "enum" },
+ { "LCDNumber", "SegmentStyle", "segmentStyle", "enum" },
+ { "LCDNumber", "SmallDecimalPoint", "smallDecimalPoint", "boolean" },
+ { "LCDNumber", "Value", 0, 0 },
+ { "Label", "AutoResize", 0, 0 },
+ { "Label", "Indent", "indent", "integer" },
+ { "Label", "Text", "text", "qstring" },
+ { "Label", "TextFormat", "textFormat", "enum" },
+ { "LineEdit", "EchoMode", "echoMode", "enum" },
+ { "LineEdit", "FrameShown", "frame", "boolean" },
+ { "LineEdit", "MaxLength", "maxLength", "integer" },
+ { "LineEdit", "Text", "text", "qstring" },
+ { "ListBox", "AutoScroll", 0, 0 },
+ { "ListBox", "AutoUpdate", 0, 0 },
+ { "ListBox", "ColumnMode", "columnMode", "enum" },
+ { "ListBox", "DragSelect", 0, 0 },
+ { "ListBox", "RowMode", "rowMode", "enum" },
+ { "ListBox", "SelectionMode", "selectionMode", "enum" },
+ { "ListBox", "SmoothScrolling", 0, 0 },
+ { "ListView", "AllColumnsShowFocus", "allColumnsShowFocus", "boolean" },
+ { "ListView", "HeaderInformation", 0, 0 },
+ { "ListView", "ItemMargin", "itemMargin", "integer" },
+ { "ListView", "MultiSelection", "multiSelection", "boolean" },
+ { "ListView", "RootIsDecorated", "rootIsDecorated", "boolean" },
+ { "ListView", "TreeStepSize", "treeStepSize", "boolean" },
+ { "MultiLineEdit", "AutoUpdate", 0, 0 },
+ { "MultiLineEdit", "EchoMode", 0, 0 },
+ { "MultiLineEdit", "HorizontalMargin", 0, 0 },
+ { "MultiLineEdit", "MaxLength", 0, 0 },
+ { "MultiLineEdit", "MaxLineLength", 0, 0 },
+ { "MultiLineEdit", "MaxLines", 0, 0 },
+ { "MultiLineEdit", "OverwriteMode", 0, 0 },
+ { "MultiLineEdit", "ReadOnly", 0, 0 },
+ { "MultiLineEdit", "Text", 0, 0 },
+ { "MultiLineEdit", "UndoDepth", "undoDepth", "integer" },
+ { "MultiLineEdit", "UndoEnabled", 0, 0 },
+ { "MultiLineEdit", "WordWrap", 0, 0 },
+ { "MultiLineEdit", "WrapColumnOrWidth", 0, 0 },
+ { "MultiLineEdit", "WrapPolicy", 0, 0 },
+ { "ProgressBar", "CenterIndicator", "centerIndicator", "boolean" },
+ { "ProgressBar", "IndicatorFollowsStyle", "indicatorFollowsStyle",
+ "boolean" },
+ { "ProgressBar", "Progress", "progress", "integer" },
+ { "ProgressBar", "TotalSteps", "totalSteps", "integer" },
+ { "PushButton", "AutoDefault", "autoDefault", "boolean" },
+ { "PushButton", "Default", "default", "boolean" },
+ { "PushButton", "IsMenuButton", 0, 0 },
+ { "PushButton", "ToggleButton", "toggleButton", "boolean" },
+ { "RadioButton", "Checked", "checked", "boolean" },
+ { "ScrollBar", "Initial", "value", "integer" },
+ { "ScrollBar", "LineStep", "lineStep", "integer" },
+ { "ScrollBar", "MaxValue", "maxValue", "integer" },
+ { "ScrollBar", "MinValue", "minValue", "integer" },
+ { "ScrollBar", "Qt::Orientation", "orientation", "enum" },
+ { "ScrollBar", "PageStep", "pageStep", "integer" },
+ { "ScrollBar", "Tracking", "tracking", "boolean" },
+ { "ScrollView", "DragAutoScroll", "dragAutoScroll", "boolean" },
+ { "ScrollView", "HScrollBarMode", "hScrollBarMode", "enum" },
+ { "ScrollView", "ResizePolicy", "resizePolicy", "enum" },
+ { "ScrollView", "VScrollBarMode", "vScrollBarMode", "enum" },
+ { "Slider", "Initial", "value", "integer" },
+ { "Slider", "LineStep", "lineStep", "integer" },
+ { "Slider", "MaxValue", "maxValue", "integer" },
+ { "Slider", "MinValue", "minValue", "integer" },
+ { "Slider", "Qt::Orientation", "orientation", "enum" },
+ { "Slider", "PageStep", "pageStep", "integer" },
+ { "Slider", "TickInterval", "tickInterval", "integer" },
+ { "Slider", "Tickmarks", "tickmarks", "enum" },
+ { "Slider", "Tracking", "tracking", "boolean" },
+ { "SpinBox", "ButtonSymbols", "buttonSymbols", "enum" },
+ { "SpinBox", "MaxValue", "maxValue", "integer" },
+ { "SpinBox", "MinValue", "minValue", "integer" },
+ { "SpinBox", "Prefix", "prefix", "qstring" },
+ { "SpinBox", "SpecialValue", "specialValueText", "qstring" },
+ { "SpinBox", "Step", "lineStep", "integer" },
+ { "SpinBox", "Suffix", "suffix", "qstring" },
+ { "SpinBox", "Wrapping", "wrapping", "boolean" },
+ { "Splitter", "OpaqueResize", 0, 0 },
+ { "Splitter", "Qt::Orientation", "orientation", "enum" },
+ { "TabBar", "Shape", "tqshape", "enum" },
+ { "TabBar", "TabNames", 0, 0 },
+ { "TextView", "Context", 0, 0 },
+ { "TextView", "LinkUnderline", "linkUnderline", "boolean" },
+ { "TextView", "Text", "text", "qstring" },
+ { "TextView", "TextFormat", "textFormat", "enum" },
+ { "User", "UserClassHeader", 0, 0 },
+ { "User", "UserClassName", 0, 0 },
+ { 0, 0, 0, 0 }
+};
+
+/*
+ This is the number of supported color groups in a palette, and
+ supported color roles in a color group. Changing these constants is
+ dangerous.
+*/
+static const int NumColorRoles = 14;
+
+static bool isTrue( const TQString& val )
+{
+ return val.lower() == TQString( "true" );
+}
+
+static AttributeMap attribute( const TQString& name, const TQString& val )
+{
+ AttributeMap attr;
+ attr.insert( name, val );
+ return attr;
+}
+
+static TQString entitize( const TQString& str )
+{
+ TQString t = str;
+ t.tqreplace( '&', TQString("&amp;") );
+ t.tqreplace( '>', TQString("&gt;") );
+ t.tqreplace( '<', TQString("&lt;") );
+ t.tqreplace( '"', TQString("&quot;") );
+ t.tqreplace( '\'', TQString("&apos;") );
+ return t;
+}
+
+TQString Dlg2Ui::alias( const TQString& name ) const
+{
+ if ( yyAliasMap.tqcontains(name) )
+ return yyAliasMap[name];
+ else
+ return name;
+}
+
+TQString Dlg2Ui::opening( const TQString& tag, const AttributeMap& attr )
+{
+ TQString t = TQChar( '<' ) + tag;
+ AttributeMap::ConstIterator a = attr.begin();
+ while ( a != attr.end() ) {
+ t += TQChar( ' ' ) + a.key() + TQString( "=\"" ) + entitize( *a ) +
+ TQChar( '"' );
+ ++a;
+ }
+ t += TQChar( '>' );
+ return t;
+}
+
+TQString Dlg2Ui::closing( const TQString& tag )
+{
+ return opening( TQChar('/') + tag );
+}
+
+void Dlg2Ui::error( const TQString& message )
+{
+ if ( numErrors++ == 0 )
+ TQMessageBox::warning( 0, yyFileName, message );
+}
+
+void Dlg2Ui::syntaxError()
+{
+ error( TQString("Sorry, I met a random syntax error. I did what I could, but"
+ " that was not enough."
+ "<p>You might want to write to"
+ " <tt>qt-bugs@trolltech.com</tt> about this incident.") );
+}
+
+TQString Dlg2Ui::getTextValue( const TQDomNode& node )
+{
+ if ( node.childNodes().count() > 1 ) {
+ syntaxError();
+ return TQString();
+ }
+
+ if ( node.childNodes().count() == 0 )
+ return TQString();
+
+ TQDomText child = node.firstChild().toText();
+ if ( child.isNull() ) {
+ syntaxError();
+ return TQString();
+ }
+ TQString t = child.data().stripWhiteSpace();
+ t.tqreplace( "\\\\", "\\" );
+ t.tqreplace( "\\n", "\n" );
+ return t;
+}
+
+TQVariant Dlg2Ui::getValue( const TQDomNodeList& tqchildren, const TQString& tagName,
+ const TQString& type )
+{
+ for ( int i = 0; i < (int) tqchildren.count(); i++ ) {
+ TQDomNode n = tqchildren.item( i );
+ if ( n.toElement().tagName() == tagName )
+ return getValue( n.toElement(), tagName, type );
+ }
+ return TQVariant();
+}
+
+void Dlg2Ui::emitHeader()
+{
+ yyOut += TQString( "<!DOCTYPE UI><UI version=\"3.0\" stdsetdef=\"1\">\n" );
+}
+
+void Dlg2Ui::emitFooter()
+{
+ yyOut += TQString( "</UI>\n" );
+}
+
+void Dlg2Ui::emitSimpleValue( const TQString& tag, const TQString& value,
+ const AttributeMap& attr )
+{
+ yyOut += yyIndentStr + opening( tag, attr ) + entitize( value ) +
+ closing( tag ) + TQChar( '\n' );
+}
+
+void Dlg2Ui::emitOpening( const TQString& tag, const AttributeMap& attr )
+{
+ yyOut += yyIndentStr + opening( tag, attr ) + TQChar( '\n' );
+ yyIndentStr += TQString( " " );
+}
+
+void Dlg2Ui::emitClosing( const TQString& tag )
+{
+ yyIndentStr.truncate( yyIndentStr.length() - 4 );
+ yyOut += yyIndentStr + closing( tag ) + TQChar( '\n' );
+}
+
+void Dlg2Ui::emitOpeningWidget( const TQString& className )
+{
+ AttributeMap attr = attribute( TQString("class"), className );
+ if ( yyGridColumn >= 0 ) {
+ attr.insert( TQString("row"), TQString::number(yyGridRow) );
+ attr.insert( TQString("column"), TQString::number(yyGridColumn) );
+ yyGridColumn = -1;
+ }
+ emitOpening( TQString("widget"), attr );
+}
+
+TQString Dlg2Ui::widgetClassName( const TQDomElement& e )
+{
+ if ( e.tagName() == TQString("User") ) {
+ return getValue( e.childNodes(), TQString("UserClassName") )
+ .toString();
+ } else if ( e.tagName() == TQString("DlgWidget") ) {
+ return TQString( "TQWidget" );
+ } else {
+ return TQChar( 'Q' ) + e.tagName();
+ }
+}
+
+void Dlg2Ui::emitColor( const TQColor& color )
+{
+ emitOpening( TQString("color") );
+ emitSimpleValue( TQString("red"), TQString::number(color.red()) );
+ emitSimpleValue( TQString("green"), TQString::number(color.green()) );
+ emitSimpleValue( TQString("blue"), TQString::number(color.blue()) );
+ emitClosing( TQString("color") );
+}
+
+void Dlg2Ui::emitColorGroup( const TQString& name, const TQColorGroup& group )
+{
+ emitOpening( name );
+ for ( int i = 0; i < NumColorRoles; i++ )
+ emitColor( group.color((TQColorGroup::ColorRole) i) );
+ emitClosing( name );
+}
+
+void Dlg2Ui::emitVariant( const TQVariant& val, const TQString& stringType )
+{
+ if ( val.isValid() ) {
+ switch ( val.type() ) {
+ case TQVariant::String:
+ emitSimpleValue( stringType, val.toString() );
+ break;
+ case TQVariant::CString:
+ emitSimpleValue( TQString("cstring"), val.toString() );
+ break;
+ case TQVariant::Bool:
+ emitSimpleValue( TQString("bool"),
+ TQString(val.toBool() ? "true" : "false") );
+ break;
+ case TQVariant::Int:
+ case TQVariant::UInt:
+ emitSimpleValue( TQString("number"), val.toString() );
+ break;
+ case TQVariant::Rect:
+ emitOpening( TQString("rect") );
+ emitSimpleValue( TQString("x"), TQString::number(val.toRect().x()) );
+ emitSimpleValue( TQString("y"), TQString::number(val.toRect().y()) );
+ emitSimpleValue( TQString("width"),
+ TQString::number(val.toRect().width()) );
+ emitSimpleValue( TQString("height"),
+ TQString::number(val.toRect().height()) );
+ emitClosing( TQString("rect") );
+ break;
+ case TQVariant::Point:
+ emitOpening( TQString("point") );
+ emitSimpleValue( TQString("x"), TQString::number(val.toPoint().x()) );
+ emitSimpleValue( TQString("y"), TQString::number(val.toPoint().y()) );
+ emitClosing( TQString("point") );
+ break;
+ case TQVariant::Size:
+ emitOpening( TQString("size") );
+ emitSimpleValue( TQString("width"),
+ TQString::number(val.toSize().width()) );
+ emitSimpleValue( TQString("height"),
+ TQString::number(val.toSize().height()) );
+ emitClosing( TQString("size") );
+ break;
+ case TQVariant::Color:
+ emitColor( val.toColor() );
+ break;
+ case TQVariant::Font:
+ emitOpening( TQString("font") );
+ emitSimpleValue( TQString("family"), val.toFont().family() );
+ emitSimpleValue( TQString("pointsize"),
+ TQString::number(val.toFont().pointSize()) );
+ if ( val.toFont().bold() )
+ emitSimpleValue( TQString("bold"), TQChar('1') );
+ if ( val.toFont().italic() )
+ emitSimpleValue( TQString("italic"), TQChar('1') );
+ if ( val.toFont().underline() )
+ emitSimpleValue( TQString("underline"), TQChar('1') );
+ if ( val.toFont().strikeOut() )
+ emitSimpleValue( TQString("strikeout"), TQChar('1') );
+ emitClosing( TQString("font") );
+ break;
+ case TQVariant::Palette:
+ emitOpening( TQString("palette") );
+ emitColorGroup( TQString("active"), val.toPalette().active() );
+ emitColorGroup( TQString("disabled"), val.toPalette().disabled() );
+ emitColorGroup( TQString("inactive"), val.toPalette().inactive() );
+ emitClosing( TQString("palette") );
+ break;
+ default:
+ emitSimpleValue( TQString("fnord"), TQString() );
+ }
+ }
+}
+
+void Dlg2Ui::emitProperty( const TQString& prop, const TQVariant& val,
+ const TQString& stringType )
+{
+ emitOpening( TQString("property"), attribute(TQString("name"), prop) );
+ emitVariant( val, stringType );
+ emitClosing( TQString("property") );
+}
+
+void Dlg2Ui::emitAttribute( const TQString& attr, const TQVariant& val,
+ const TQString& stringType )
+{
+ emitOpening( TQString("attribute"), attribute(TQString("name"), attr) );
+ emitVariant( val, stringType );
+ emitClosing( TQString("attribute") );
+}
+
+void Dlg2Ui::emitOpeningLayout( bool needsWidget, const TQString& layoutKind,
+ const TQString& name, int border,
+ int autoBorder )
+{
+ TQString namex = name;
+
+ if ( namex.isEmpty() )
+ namex = TQString( "Layout%1" ).arg( uniqueLayout++ );
+
+ if ( needsWidget ) {
+ emitOpeningWidget( TQString("TQLayoutWidget") );
+ emitProperty( TQString("name"), namex.latin1() );
+ }
+ emitOpening( layoutKind );
+ if ( !needsWidget )
+ emitProperty( TQString("name"), namex.latin1() );
+ if ( border != 5 )
+ emitProperty( TQString("margin"), border );
+ if ( autoBorder != 5 )
+ emitProperty( TQString("spacing"), autoBorder );
+ yyLayoutDepth++;
+}
+
+void Dlg2Ui::flushWidgets()
+{
+ TQRegExp widgetForLayout( TQString("Q(?:[HV]Box|Grid)") );
+
+ while ( !yyWidgetMap.isEmpty() ) {
+ TQString className = widgetClassName( *yyWidgetMap.begin() );
+ if ( !widgetForLayout.exactMatch(className) ) {
+ emitOpeningWidget( className );
+ emitWidgetBody( *yyWidgetMap.begin(), FALSE );
+ emitClosing( TQString("widget") );
+ }
+ yyWidgetMap.remove( yyWidgetMap.begin() );
+ }
+}
+
+void Dlg2Ui::emitClosingLayout( bool needsWidget, const TQString& layoutKind )
+{
+ yyLayoutDepth--;
+ /*
+ TQt Designer can deal with layouted widgets and with
+ fixed-position widgets, but not both at the same time. If such a
+ thing happens, we arbitrarily put the fixed-position widgets in
+ the tqlayout so that they at least show up in TQt Designer.
+ */
+ if ( yyLayoutDepth == 0 )
+ flushWidgets();
+
+ emitClosing( layoutKind );
+ if ( needsWidget )
+ emitClosing( TQString("widget") );
+}
+
+bool Dlg2Ui::isWidgetType( const TQDomElement& e )
+{
+ return yyWidgetTypeSet.tqcontains( e.tagName() );
+}
+
+void Dlg2Ui::emitSpacer( int spacing, int stretch )
+{
+ TQString orientationStr;
+ TQSize tqsizeHint;
+ TQString sizeType = TQString( "Fixed" );
+
+ if ( yyBoxKind == TQString("hbox") ) {
+ orientationStr = TQString( "Horizontal" );
+ tqsizeHint = TQSize( spacing, 20 );
+ } else {
+ orientationStr = TQString( "Vertical" );
+ tqsizeHint = TQSize( 20, spacing );
+ }
+ if ( stretch > 0 )
+ sizeType = TQString( "Expanding" );
+
+ emitOpening( TQString("spacer") );
+ emitProperty( TQString("name"),
+ TQString("Spacer%1").arg(uniqueSpacer++).latin1() );
+ emitProperty( TQString("orientation"), orientationStr, TQString("enum") );
+ if ( spacing > 0 )
+ emitProperty( TQString("tqsizeHint"), tqsizeHint, TQString("qsize") );
+ emitProperty( TQString("sizeType"), sizeType, TQString("enum") );
+ emitClosing( TQString("spacer") );
+}
+
+TQString Dlg2Ui::filteredFlags( const TQString& flags, const TQRegExp& filter )
+{
+ TQRegExp evil( TQString("[^0-9A-Z_a-z|]") );
+
+ TQString f = flags;
+ f.tqreplace( evil, TQString() );
+ TQStringList splitted = TQStringList::split( TQChar('|'), f );
+ return splitted.grep( filter ).join( TQChar('|') );
+}
+
+void Dlg2Ui::emitFrameStyleProperty( int style )
+{
+ TQString tqshape;
+ TQString shadow;
+
+ switch ( style & TQFrame::MShape ) {
+ case TQFrame::Box:
+ tqshape = TQString( "Box" );
+ break;
+ case TQFrame::Panel:
+ tqshape = TQString( "Panel" );
+ break;
+ case TQFrame::WinPanel:
+ tqshape = TQString( "WinPanel" );
+ break;
+ case TQFrame::HLine:
+ tqshape = TQString( "HLine" );
+ break;
+ case TQFrame::VLine:
+ tqshape = TQString( "VLine" );
+ break;
+ case TQFrame::StyledPanel:
+ tqshape = TQString( "StyledPanel" );
+ break;
+ case TQFrame::PopupPanel:
+ tqshape = TQString( "PopupPanel" );
+ break;
+ case TQFrame::MenuBarPanel:
+ tqshape = TQString( "MenuBarPanel" );
+ break;
+ case TQFrame::ToolBarPanel:
+ tqshape = TQString( "ToolBarPanel" );
+ break;
+ case TQFrame::LineEditPanel:
+ tqshape = TQString( "LineEditPanel" );
+ break;
+ case TQFrame::TabWidgetPanel:
+ tqshape = TQString( "TabWidgetPanel" );
+ break;
+ case TQFrame::GroupBoxPanel:
+ tqshape = TQString( "GroupBoxPanel" );
+ break;
+ default:
+ tqshape = TQString( "NoFrame" );
+ }
+
+ switch ( style & TQFrame::MShadow ) {
+ case TQFrame::Raised:
+ shadow = TQString( "Raised" );
+ break;
+ case TQFrame::Sunken:
+ shadow = TQString( "Sunken" );
+ break;
+ default:
+ shadow = TQString( "Plain" );
+ }
+
+ emitProperty( TQString("frameShape"), tqshape, TQString("enum") );
+ emitProperty( TQString("frameShadow"), shadow, TQString("enum") );
+}
+
+void Dlg2Ui::emitWidgetBody( const TQDomElement& e, bool layouted )
+{
+ TQRegExp align( TQString("^(?:Align|WordBreak$)") );
+ TQRegExp frameShape( TQString(
+ "^(?:NoFrame|Box|(?:Win|Styled|Popup|(?:Menu|Tool)Bar)?Panel|"
+ "[HV]Line)$") );
+ TQRegExp frameShadow( TQString( "^(?:Plain|Raised|Sunken)$") );
+ TQRegExp numeric( TQString("[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+") );
+ TQRegExp connex( TQString(
+ "\\s*\\[(BaseClass|P(?:ublic|rotected))\\]\\s*([0-9A-Z_a-z]+)\\s*"
+ "-->\\s*([0-9A-Z_a-z]+)\\s*(\\([^()]*\\))\\s*") );
+ TQRegExp qdialogSlots( TQString(
+ "done\\(\\s*int\\s*\\)|(?:accept|reject)\\(\\s*\\)") );
+
+ TQString userClassHeader;
+ TQString userClassName;
+ TQString parentTagName;
+ TQString name;
+ TQString variableName;
+ TQMap<TQString, int> pp;
+
+ TQDomNode n = e;
+ while ( !n.isNull() ) {
+ if ( isWidgetType(n.toElement()) ) {
+ parentTagName = n.toElement().tagName();
+ pp = yyPropertyMap[parentTagName];
+ n = n.firstChild();
+ } else {
+ TQString tagName = n.toElement().tagName();
+
+ TQMap<TQString, int>::ConstIterator p = pp.tqfind( tagName );
+ if ( p == pp.end() ) {
+ /*
+ These properties are not in the propertyDefs table,
+ since they are found in many classes anyway and need
+ to be treated the same in each case.
+ */
+ if ( tagName == TQString("Alignement") ||
+ tagName == TQString("Alignment") ) {
+ TQString flags = getValue( n.toElement(), tagName )
+ .toString();
+ flags = filteredFlags( flags, align );
+ if ( !flags.isEmpty() )
+ emitProperty( TQString("tqalignment"), flags,
+ TQString("set") );
+ } else if ( tagName == TQString("ItemList") ) {
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ if ( child.toElement().tagName() == TQString("Item") ) {
+ TQString text = getTextValue( child );
+ emitOpening( TQString("item") );
+ emitProperty( TQString("text"), text );
+ emitClosing( TQString("item") );
+ }
+ child = child.nextSibling();
+ }
+ }
+ } else {
+ TQString propertyName( propertyDefs[*p].qtName );
+
+ if ( propertyName.isEmpty() ) {
+ /*
+ These properties are in the propertyDefs table,
+ but they have no direct TQt equivalent.
+ */
+ if ( parentTagName == TQString("ComboBox") ) {
+ if ( tagName == TQString("Style") ) {
+ if ( getTextValue(n) == TQString("ReadWrite") )
+ emitProperty( TQString("editable"),
+ TQVariant(TRUE, 0) );
+ }
+ } else if ( parentTagName == TQString("DlgWidget") ) {
+ if ( tagName == TQString("Name") ) {
+ name = getTextValue( n );
+ } else if ( tagName == TQString("Rect") ) {
+ TQRect rect = getValue( n.toElement(), tagName,
+ TQString("qrect") )
+ .toRect();
+ if ( !layouted )
+ emitProperty( TQString("geometry"), rect,
+ TQString("qrect") );
+ } else if ( tagName == TQString("SignalConnection") ) {
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ if ( child.toElement().tagName() ==
+ TQString("Signal") ) {
+ TQString text = getTextValue( child );
+ if ( connex.exactMatch(text) ) {
+ DlgConnection c;
+ c.sender = getValue(
+ n.parentNode().childNodes(),
+ TQString("Name") ).toString();
+ c.signal = connex.cap( 2 ) +
+ connex.cap( 4 );
+ c.slot = connex.cap( 3 ) +
+ connex.cap( 4 );
+ yyConnections.append( c );
+
+ if ( connex.cap(1) !=
+ TQString("BaseClass") &&
+ !qdialogSlots.exactMatch(c.slot) )
+ yySlots.insert( c.slot,
+ connex.cap(1) );
+ }
+ }
+ child = child.nextSibling();
+ }
+ } else if ( tagName == TQString("Variable") ) {
+ variableName = getTextValue( n );
+ }
+ } else if ( parentTagName == TQString("Frame") ) {
+ if ( tagName == TQString("Style") ) {
+ int style = getValue( n.toElement(), tagName,
+ TQString("integer") ).toInt();
+ emitFrameStyleProperty( style );
+ }
+ } else if ( parentTagName == TQString("LCDNumber") ) {
+ if ( tagName == TQString("Value") ) {
+ TQString text = getValue( n.toElement(), tagName )
+ .toString();
+ if ( numeric.exactMatch(text) )
+ emitProperty( TQString("value"),
+ text.toDouble() );
+ }
+ } else if ( parentTagName == TQString("ListView") ) {
+ if ( tagName == TQString("HeaderInformation") ) {
+ int columnNo = 1;
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ if ( child.toElement().tagName() ==
+ TQString("Header") ) {
+ TQString text = getValue( child.childNodes(),
+ TQString("Text") )
+ .toString();
+ if ( text.isEmpty() )
+ text = TQString( "Column %1" )
+ .arg( columnNo );
+ emitOpening( TQString("column") );
+ emitProperty( TQString("text"), text );
+ emitClosing( TQString("column") );
+ }
+ child = child.nextSibling();
+ columnNo++;
+ }
+ }
+ } else if ( parentTagName == TQString("TabBar") ) {
+ if ( tagName == TQString("TabNames") ) {
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ if ( child.toElement().tagName() ==
+ TQString("Tab") ) {
+ TQString text = getTextValue( child );
+ emitOpeningWidget( TQString("TQWidget") );
+ emitProperty( TQString("name"), "tab" );
+ emitAttribute( TQString("title"), text );
+ emitClosing( TQString("widget") );
+ }
+ child = child.nextSibling();
+ }
+ }
+ } else if ( parentTagName == TQString("User") ) {
+ if ( tagName == TQString("UserClassHeader") ) {
+ userClassHeader = getTextValue( n );
+ } else if ( tagName == TQString("UserClassName") ) {
+ userClassName = getTextValue( n );
+ }
+ }
+ } else {
+ /*
+ These properties are in the propertyDefs table;
+ they have a direct TQt equivalent.
+ */
+ TQString type( propertyDefs[*p].type );
+ TQVariant val = getValue( n.toElement(), tagName, type );
+
+ if ( type == TQString("qstring") )
+ type = TQString( "string" );
+
+ bool omit = FALSE;
+ if ( propertyName == TQString("backgroundOrigin") &&
+ val.toString() == TQString("WidgetOrigin") )
+ omit = TRUE;
+ if ( propertyName == TQString("enabled") && val.toBool() )
+ omit = TRUE;
+ if ( propertyName == TQString("tqminimumSize") &&
+ val.toSize() == TQSize(-1, -1) )
+ omit = TRUE;
+ if ( propertyName == TQString("tqmaximumSize") &&
+ val.toSize() == TQSize(32767, 32767) )
+ omit = TRUE;
+
+ if ( !omit )
+ emitProperty( propertyName, val, type );
+ }
+ }
+ n = n.nextSibling();
+ }
+ }
+
+ if ( !variableName.isEmpty() ) {
+ yyAliasMap.insert( name, variableName );
+ name = variableName;
+ }
+ if ( !name.isEmpty() )
+ emitProperty( TQString("name"), name.latin1() );
+
+ if ( !userClassName.isEmpty() )
+ yyCustomWidgets.insert( userClassName, userClassHeader );
+}
+
+bool Dlg2Ui::checkTagName( const TQDomElement& e, const TQString& tagName )
+{
+ bool ok = ( e.tagName() == tagName );
+ if ( !ok )
+ syntaxError();
+ return ok;
+}
+
+TQString Dlg2Ui::normalizeType( const TQString& type )
+{
+ TQString t = type;
+ if ( t.isEmpty() || t == TQString("enum") || t == TQString( "qcstring" ) ||
+ t == TQString("set") )
+ t = TQString( "qstring" );
+ return t;
+}
+
+TQVariant Dlg2Ui::getValue( const TQDomElement& e, const TQString& tagName,
+ const TQString& type )
+{
+ TQVariant val;
+
+ if ( e.tagName() != tagName )
+ return val;
+
+ TQString t = e.attributes().namedItem( "type" ).toAttr().value();
+ if ( normalizeType(t) != normalizeType(type) )
+ return val;
+
+ if ( type == TQString("integer") ) {
+ return getTextValue( e ).toInt();
+ } else if ( type == TQString("boolean") ) {
+ return TQVariant( isTrue(getTextValue(e)), 0 );
+ } else if ( type == TQString("double") ) {
+ return getTextValue( e ).toDouble();
+ } else if ( type == TQString("qcstring") ) {
+ return getTextValue( e ).latin1();
+ } else if ( type == TQString("enum") || type == TQString("qstring") ||
+ type == TQString("set") ) {
+ return getTextValue( e );
+ } else {
+ TQDomNodeList tqchildren = e.childNodes();
+
+ if ( type == TQString("qsize") ) {
+ int width = getValue( tqchildren, TQString("Width"),
+ TQString("integer") ).toInt();
+ int height = getValue( tqchildren, TQString("Height"),
+ TQString("integer") ).toInt();
+ return TQSize( width, height );
+ } else if ( type == TQString("qrect") ) {
+ int x = getValue( tqchildren, TQString("X"), TQString("integer") )
+ .toInt();
+ int y = getValue( tqchildren, TQString("Y"), TQString("integer") )
+ .toInt();
+ int width = getValue( tqchildren, TQString("Width"),
+ TQString("integer") ).toInt();
+ int height = getValue( tqchildren, TQString("Height"),
+ TQString("integer") ).toInt();
+ return TQRect( x, y, width, height );
+ } else if ( type == TQString("qpoint") ) {
+ int x = getValue( tqchildren, TQString("X"), TQString("integer") )
+ .toInt();
+ int y = getValue( tqchildren, TQString("Y"), TQString("integer") )
+ .toInt();
+ return TQPoint( x, y );
+ } else if ( type == TQString("qpalette") ) {
+ TQColorGroup active = getValue( tqchildren, TQString("Active"),
+ TQString("qcolorgroup") )
+ .toColorGroup();
+ TQColorGroup disabled = getValue( tqchildren, TQString("Disabled"),
+ TQString("qcolorgroup") )
+ .toColorGroup();
+ TQColorGroup inactive = getValue( tqchildren, TQString("Inactive"),
+ TQString("qcolorgroup") )
+ .toColorGroup();
+ return TQPalette( active, disabled, inactive );
+ } else if ( type == TQString("qfont") ) {
+ TQString family = getValue( tqchildren, TQString("Family"),
+ TQString("qstring") ).toString();
+ int pointSize = getValue( tqchildren, TQString("PointSize"),
+ TQString("integer") ).toInt();
+ int weight = getValue( tqchildren, TQString("weight"),
+ TQString("integer") ).toInt();
+ bool italic = getValue( tqchildren, TQString("Italic"),
+ TQString("boolean") ).toBool();
+ bool underline = getValue( tqchildren, TQString("Underline"),
+ TQString("boolean") ).toBool();
+ bool strikeOut = getValue( tqchildren, TQString("StrikeOut"),
+ TQString("boolean") ).toBool();
+ int tqstyleHint = getValue( tqchildren, TQString("StyleHint"),
+ TQString("integer") ).toInt();
+
+ TQFont f;
+ if ( !family.isEmpty() )
+ f.setFamily( family );
+ if ( pointSize != 0 )
+ f.setPointSize( pointSize );
+ if ( weight != 0 )
+ f.setWeight( weight );
+ f.setItalic( italic );
+ f.setUnderline( underline );
+ f.setStrikeOut( strikeOut );
+ if ( tqstyleHint != 0 )
+ f.setStyleHint( (TQFont::StyleHint) tqstyleHint );
+ return f;
+ } else if ( type == TQString("qcolor") ) {
+ // if any component missing, zero is to be assumed
+ int red = getValue( tqchildren, TQString("Red"), TQString("integer") )
+ .toInt();
+ int green = getValue( tqchildren, TQString("Green"),
+ TQString("integer") ).toInt();
+ int blue = getValue( tqchildren, TQString("Blue"), TQString("integer") )
+ .toInt();
+ return TQColor( red, green, blue );
+ } else if ( type == TQString("qcolorgroup") ) {
+ static const TQColorGroup::ColorRole roles[NumColorRoles] = {
+ TQColorGroup::Foreground, TQColorGroup::Button,
+ TQColorGroup::Light, TQColorGroup::Midlight, TQColorGroup::Dark,
+ TQColorGroup::Mid, TQColorGroup::Text, TQColorGroup::BrightText,
+ TQColorGroup::ButtonText, TQColorGroup::Base,
+ TQColorGroup::Background, TQColorGroup::Shadow,
+ TQColorGroup::Highlight, TQColorGroup::HighlightedText
+ };
+ static const char * const roleNames[NumColorRoles] = {
+ "Foreground", "Button", "Light", "MidLight", "Dark", "Mid",
+ "Text", "BrightText", "ButtonText", "Base", "Background",
+ "Shadow", "HighLighted", "HighLightedText"
+ };
+ TQColorGroup group;
+
+ for ( int i = 0; i < NumColorRoles; i++ )
+ group.setColor( roles[i],
+ getValue(tqchildren, TQString(roleNames[i]),
+ TQString("qcolor")).toColor() );
+ return group;
+ } else {
+ syntaxError();
+ }
+ }
+ return val;
+}
+
+void Dlg2Ui::matchDialogCommon( const TQDomElement& dialogCommon )
+{
+ if ( !checkTagName(dialogCommon, TQString("DialogCommon")) )
+ return;
+
+ TQString sourceDir;
+ TQString classHeader;
+ TQString classSource;
+ TQString dataHeader;
+ TQString dataSource;
+ TQString dataName;
+ TQString windowBaseClass( "TQDialog" );
+ bool isCustom = FALSE;
+ TQString customBaseHeader;
+ TQString windowCaption;
+
+ yyClassName = "Form1";
+
+ TQDomNode n = dialogCommon.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ TQString val = getTextValue( n );
+
+ if ( tagName == TQString("SourceDir") ) {
+ sourceDir = val;
+ } else if ( tagName == TQString("ClassHeader") ) {
+ classHeader = val;
+ } else if ( tagName == TQString("ClassSource") ) {
+ classSource = val;
+ } else if ( tagName == TQString("ClassName") ) {
+ yyClassName = val;
+ } else if ( tagName == TQString("DataHeader") ) {
+ dataHeader = val;
+ } else if ( tagName == TQString("DataSource") ) {
+ dataSource = val;
+ } else if ( tagName == TQString("DataName") ) {
+ dataName = val;
+ } else if ( tagName == TQString("WindowBaseClass") ) {
+ if ( val == TQString("Custom") )
+ isCustom = TRUE;
+ else
+ windowBaseClass = val;
+ } else if ( tagName == TQString("IsModal") ) {
+ } else if ( tagName == TQString("CustomBase") ) {
+ windowBaseClass = val;
+ } else if ( tagName == TQString("CustomBaseHeader") ) {
+ customBaseHeader = val;
+ } else if ( tagName == TQString("WindowCaption") ) {
+ windowCaption = val;
+ }
+ n = n.nextSibling();
+ }
+
+ emitSimpleValue( TQString("class"), yyClassName );
+ emitOpeningWidget( windowBaseClass );
+
+ if ( windowCaption.isEmpty() )
+ windowCaption = yyClassName;
+ emitProperty( TQString("name"), yyClassName.latin1() );
+ emitProperty( TQString("caption"), windowCaption );
+
+ if ( isCustom )
+ yyCustomWidgets.insert( windowBaseClass, customBaseHeader );
+}
+
+bool Dlg2Ui::needsTQLayoutWidget( const TQDomElement& e )
+{
+ TQRegExp widgetExists( TQString("WidgetLayout|Layout_Widget") );
+
+ // we should also check that the widget is not a TQHBox, TQVBox, or TQGrid
+ TQString grandpa = e.parentNode().parentNode().toElement().tagName();
+ return !widgetExists.exactMatch( grandpa );
+}
+
+void Dlg2Ui::matchBoxLayout( const TQDomElement& boxLayout )
+{
+ TQString directionStr;
+ TQString prevBoxKind = yyBoxKind;
+ int border = 5;
+ int autoBorder = 5;
+ TQString name;
+ bool needsWidget = needsTQLayoutWidget( boxLayout );
+ bool opened = FALSE;
+
+ TQDomNode n = boxLayout.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+
+ if ( tagName == TQString("Children") ) {
+ if ( !opened ) {
+ emitOpeningLayout( needsWidget, yyBoxKind, name, border,
+ autoBorder );
+ if ( !directionStr.isEmpty() )
+ emitProperty( TQString("direction"), directionStr,
+ TQString("enum") );
+ opened = TRUE;
+ }
+ matchLayout( n.toElement() );
+ } else {
+ TQString val = getTextValue( n );
+
+ if ( tagName == TQString("Direction") ) {
+ if ( val == TQString("LeftToRight") ) {
+ yyBoxKind = TQString( "hbox" );
+ } else if ( val == TQString("RightToLeft") ) {
+ directionStr = val;
+ yyBoxKind = TQString( "hbox" );
+ } else if ( val == TQString("TopToBottom") ) {
+ yyBoxKind = TQString( "vbox" );
+ } else if ( val == TQString("BottomToTop") ) {
+ directionStr = val;
+ yyBoxKind = TQString( "vbox" );
+ } else {
+ syntaxError();
+ }
+ } else if ( tagName == TQString("Border") ) {
+ border = val.toInt();
+ } else if ( tagName == TQString("AutoBorder") ) {
+ autoBorder = val.toInt();
+ } else if ( tagName == TQString("Name") ) {
+ name = val;
+ }
+ }
+
+ n = n.nextSibling();
+ }
+ if ( opened ) {
+ emitClosingLayout( needsWidget, yyBoxKind );
+ yyBoxKind = prevBoxKind;
+ }
+}
+
+void Dlg2Ui::matchBoxSpacing( const TQDomElement& boxSpacing )
+{
+ int spacing = 7;
+
+ TQDomNode n = boxSpacing.firstChild();
+ while ( !n.isNull() ) {
+ TQString val = getTextValue( n );
+
+ if ( n.toElement().tagName() == TQString("Spacing") )
+ spacing = val.toInt();
+ n = n.nextSibling();
+ }
+ emitSpacer( spacing, 0 );
+}
+
+void Dlg2Ui::matchBoxStretch( const TQDomElement& boxStretch )
+{
+ int stretch = 1;
+
+ TQDomNode n = boxStretch.firstChild();
+ while ( !n.isNull() ) {
+ TQString val = getTextValue( n );
+
+ if ( n.toElement().tagName() == TQString("Stretch") )
+ stretch = val.toInt();
+ n = n.nextSibling();
+ }
+ emitSpacer( 0, stretch );
+}
+
+void Dlg2Ui::matchGridLayout( const TQDomElement& gridLayout )
+{
+ int oldGridRow = yyGridRow;
+ int oldGridColumn = yyGridColumn;
+ int border = 5;
+ int autoBorder = 5;
+ TQString name;
+ TQString menu;
+ bool needsWidget = needsTQLayoutWidget( gridLayout );
+ bool opened = FALSE;
+
+ TQDomNode n = gridLayout.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+
+ if ( tagName == TQString("Children") ) {
+ if ( !opened ) {
+ emitOpeningLayout( needsWidget, TQString("grid"), name, border,
+ autoBorder );
+ yyGridRow = -1;
+ yyGridColumn = -1;
+ opened = TRUE;
+ }
+ matchLayout( n.toElement() );
+ } else {
+ if ( tagName == TQString("Border") ) {
+ border = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("AutoBorder") ) {
+ autoBorder = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("Name") ) {
+ name = getTextValue( n );
+ } else if ( tagName == TQString("Menu") ) {
+ menu = getTextValue( n );
+ }
+ }
+ n = n.nextSibling();
+ }
+ if ( opened )
+ emitClosingLayout( needsWidget, TQString("grid") );
+ yyGridRow = oldGridRow;
+ yyGridColumn = oldGridColumn;
+}
+
+void Dlg2Ui::matchGridRow( const TQDomElement& gridRow )
+{
+ yyGridRow++;
+
+ TQDomNode n = gridRow.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+
+ if ( tagName == TQString("Children") ) {
+ yyGridColumn = 0;
+ matchLayout( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+}
+
+void Dlg2Ui::matchGridSpacer( const TQDomElement& gridSpacer )
+{
+ if ( !gridSpacer.firstChild().isNull() )
+ syntaxError();
+}
+
+void Dlg2Ui::matchLayoutWidget( const TQDomElement& layoutWidget )
+{
+ TQDomElement tqchildren;
+ TQString widget;
+
+ TQDomNode n = layoutWidget.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+
+ if ( tagName == TQString("Children") )
+ tqchildren = n.toElement();
+ else if ( tagName == TQString("Widget") )
+ widget = getTextValue( n );
+ n = n.nextSibling();
+ }
+
+ if ( !widget.isEmpty() ) {
+ TQMap<TQString, TQDomElement>::Iterator w = yyWidgetMap.tqfind( widget );
+ if ( w == yyWidgetMap.end() ) {
+ syntaxError();
+ } else {
+ TQString className = widgetClassName( *w );
+ if ( className == TQString("TQHBox") ||
+ className == TQString("TQVBox") ) {
+ bool needsWidget = needsTQLayoutWidget( layoutWidget );
+
+ TQString prevBoxKind = yyBoxKind;
+ yyBoxKind = className.mid( 1 ).lower();
+
+ int spacing = getValue( (*w).childNodes(), TQString("Spacing"),
+ TQString("integer") ).toInt();
+ if ( spacing < 1 )
+ spacing = 5;
+
+ emitOpeningLayout( needsWidget, yyBoxKind, widget, 0, spacing );
+ if ( !tqchildren.isNull() )
+ matchLayout( tqchildren );
+ emitClosingLayout( needsWidget, yyBoxKind );
+ yyBoxKind = prevBoxKind;
+ } else if ( className == TQString("TQGrid") ) {
+ bool needsWidget = needsTQLayoutWidget( layoutWidget );
+ int n = 0;
+
+ TQString direction = getValue( (*w).childNodes(),
+ TQString("Direction") ).toString();
+ int rowsCols = getValue( (*w).childNodes(), TQString("RowCols"),
+ TQString("integer") ).toInt();
+ if ( rowsCols == 0 )
+ rowsCols = getValue( (*w).childNodes(),
+ TQString("RowsCols"),
+ TQString("integer") ).toInt();
+ if ( rowsCols < 1 )
+ rowsCols = 5;
+ int spacing = getValue( (*w).childNodes(), TQString("Spacing"),
+ TQString("integer") ).toInt();
+ if ( spacing < 1 )
+ spacing = 5;
+
+ emitOpeningLayout( needsWidget, TQString("grid"), widget, 0,
+ spacing );
+
+ TQDomNode child = tqchildren.firstChild();
+ while ( !child.isNull() ) {
+ if ( direction == TQString("Vertical") ) {
+ yyGridColumn = n / rowsCols;
+ yyGridRow = n % rowsCols;
+ } else {
+ yyGridColumn = n % rowsCols;
+ yyGridRow = n / rowsCols;
+ }
+ matchBox( child.toElement() );
+ n++;
+ child = child.nextSibling();
+ }
+ yyGridColumn = -1;
+ yyGridRow = -1;
+ emitClosingLayout( needsWidget, TQString("grid") );
+ } else {
+ emitOpeningWidget( widgetClassName(*w) );
+ emitWidgetBody( *w, TRUE );
+ if ( !tqchildren.isNull() )
+ matchLayout( tqchildren );
+ emitClosing( TQString("widget") );
+ }
+ yyWidgetMap.remove( w );
+ }
+ }
+}
+
+void Dlg2Ui::matchBox( const TQDomElement& box )
+{
+ /*
+ What is this jump table doing in here?
+ */
+ static const struct {
+ const char *tagName;
+ void (Dlg2Ui::*matchFunc)( const TQDomElement& );
+ } jumpTable[] = {
+ { "Box_Layout", &Dlg2Ui::matchBoxLayout },
+ { "Box_Spacing", &Dlg2Ui::matchBoxSpacing },
+ { "Box_Stretch", &Dlg2Ui::matchBoxStretch },
+ { "Grid_Layout", &Dlg2Ui::matchGridLayout },
+ { "Grid_Row", &Dlg2Ui::matchGridRow },
+ { "Grid_Spacer", &Dlg2Ui::matchGridSpacer },
+ { "Layout_Widget", &Dlg2Ui::matchLayoutWidget },
+ { 0, 0 }
+ };
+
+ int i = 0;
+ while ( jumpTable[i].tagName != 0 ) {
+ if ( TQString(jumpTable[i].tagName) == box.tagName() ) {
+ (this->*jumpTable[i].matchFunc)( box );
+ break;
+ }
+ i++;
+ }
+ if ( jumpTable[i].tagName == 0 )
+ syntaxError();
+}
+
+void Dlg2Ui::matchLayout( const TQDomElement& tqlayout )
+{
+ int column = yyGridColumn;
+
+ TQDomNode n = layout.firstChild();
+ while ( !n.isNull() ) {
+ if ( column != -1 )
+ yyGridColumn = column++;
+ matchBox( n.toElement() );
+ n = n.nextSibling();
+ }
+}
+
+void Dlg2Ui::matchWidgetLayoutCommon( const TQDomElement& widgetLayoutCommon )
+{
+ TQDomNodeList tqchildren = widgetLayoutCommon.childNodes();
+
+ /*
+ Since we do not respect the spacing and margins specified in
+ the .dlg file, the specified tqgeometry is slightly wrong (too
+ small). It still seems to be better to take it in.
+ */
+#if 1
+ TQPoint initialPos = getValue( tqchildren, TQString("InitialPos"),
+ TQString("qpoint") ).toPoint();
+ TQSize size = getValue( tqchildren, TQString("Size"), TQString("qsize") )
+ .toSize();
+#endif
+ TQSize minSize = getValue( tqchildren, TQString("MinSize"), TQString("qsize") )
+ .toSize();
+ TQSize maxSize = getValue( tqchildren, TQString("MaxSize"), TQString("qsize") )
+ .toSize();
+
+#if 1
+ if ( initialPos == TQPoint(-1, -1) )
+ initialPos = TQPoint( 0, 0 );
+
+ emitProperty( TQString("geometry"), TQRect(initialPos, size) );
+#endif
+ if ( minSize != TQSize(-1, -1) )
+ emitProperty( TQString("tqminimumSize"), minSize );
+ if ( maxSize != TQSize(32767, 32767) )
+ emitProperty( TQString("tqmaximumSize"), maxSize );
+}
+
+void Dlg2Ui::matchWidget( const TQDomElement& widget )
+{
+ TQString name;
+
+ TQDomNode n = widget;
+ while ( !n.isNull() ) {
+ if ( isWidgetType(n.toElement()) ) {
+ n = n.firstChild();
+ } else {
+ if ( n.toElement().tagName() == TQString("Name") ) {
+ name = getTextValue( n );
+ break;
+ }
+ n = n.nextSibling();
+ }
+ }
+ if ( name.isEmpty() )
+ name = TQString( "Widget%1" ).arg( uniqueWidget++ );
+
+ if ( yyWidgetMap.tqcontains(name) )
+ syntaxError();
+ yyWidgetMap.insert( name, widget );
+}
+
+void Dlg2Ui::matchWidgets( const TQDomElement& widgets )
+{
+ TQDomNode n = widgets.firstChild();
+ while ( !n.isNull() ) {
+ matchWidget( n.toElement() );
+ n = n.nextSibling();
+ }
+}
+
+void Dlg2Ui::matchTabOrder( const TQDomElement& tabOrder )
+{
+ TQDomNode n = tabOrder.firstChild();
+ while ( !n.isNull() ) {
+ if ( n.toElement().tagName() == TQString("Widget") )
+ yyTabStops.append( getTextValue(n.toElement()) );
+ n = n.nextSibling();
+ }
+}
+
+void Dlg2Ui::matchWidgetLayout( const TQDomElement& widgetLayout )
+{
+ if ( !checkTagName(widgetLayout, TQString("WidgetLayout")) )
+ return;
+
+ TQDomNode n = widgetLayout.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+
+ if ( tagName == TQString("WidgetLayoutCommon") ) {
+ matchWidgetLayoutCommon( n.toElement() );
+ } else if ( tagName == TQString("Widgets") ) {
+ matchWidgets( n.toElement() );
+ } else if ( tagName == TQString("TabOrder") ) {
+ matchTabOrder( n.toElement() );
+ } else if ( tagName == TQString("Layout") ) {
+ matchLayout( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+}
+
+void Dlg2Ui::matchDialog( const TQDomElement& dialog )
+{
+ if ( !checkTagName(dialog, TQString("Dialog")) )
+ return;
+
+ TQDomNodeList nodes = dialog.childNodes();
+ if ( nodes.count() == 2 ) {
+ matchDialogCommon( nodes.item(0).toElement() );
+ matchWidgetLayout( nodes.item(1).toElement() );
+ flushWidgets();
+ emitClosing( TQString("widget") );
+
+ if ( !yyCustomWidgets.isEmpty() ) {
+ emitOpening( TQString("customwidgets") );
+
+ TQMap<TQString, TQString>::Iterator w = yyCustomWidgets.begin();
+ while ( w != yyCustomWidgets.end() ) {
+ emitOpening( TQString("customwidget") );
+ emitSimpleValue( TQString("class"), w.key() );
+ if ( !(*w).isEmpty() )
+ emitSimpleValue( TQString("header"), *w,
+ attribute(TQString("location"),
+ TQString("local")) );
+ emitClosing( TQString("customwidget") );
+ ++w;
+ }
+ emitClosing( TQString("customwidgets") );
+ }
+
+ if ( yyConnections.count() + yySlots.count() > 0 ) {
+ emitOpening( TQString("connections") );
+
+ TQValueList<DlgConnection>::Iterator c = yyConnections.begin();
+ while ( c != yyConnections.end() ) {
+ emitOpening( TQString("connection") );
+ emitSimpleValue( TQString("sender"), alias((*c).sender) );
+ emitSimpleValue( TQString("signal"), (*c).signal );
+ emitSimpleValue( TQString("receiver"), yyClassName );
+ emitSimpleValue( TQString("slot"), (*c).slot );
+ emitClosing( TQString("connection") );
+ ++c;
+ }
+
+ TQMap<TQString, TQString>::Iterator s = yySlots.begin();
+ while ( s != yySlots.end() ) {
+ AttributeMap attr;
+ attr.insert( TQString("access"), *s );
+ attr.insert( TQString("language"), TQString("C++") );
+ attr.insert( TQString("returntype"), TQString("void") );
+ emitSimpleValue( TQString("slot"), s.key(), attr );
+ ++s;
+ }
+ emitClosing( TQString("connections") );
+ }
+
+ if ( !yyTabStops.isEmpty() ) {
+ emitOpening( TQString("tabstops") );
+ TQStringList::ConstIterator t = yyTabStops.begin();
+ while ( t != yyTabStops.end() ) {
+ emitSimpleValue( TQString("tabstop"), alias(*t) );
+ ++t;
+ }
+ emitClosing( TQString("tabstops") );
+ }
+ }
+}
+
+TQStringList Dlg2Ui::convertTQtArchitectDlgFile( const TQString& fileName )
+{
+ int i;
+
+ yyFileName = fileName;
+ yyLayoutDepth = 0;
+ yyGridRow = -1;
+ yyGridColumn = -1;
+
+ numErrors = 0;
+ uniqueLayout = 1;
+ uniqueSpacer = 1;
+ uniqueWidget = 1;
+
+ i = 0;
+ while ( widgetTypes[i] != 0 ) {
+ yyWidgetTypeSet.insert( TQString(widgetTypes[i]), 0 );
+ i++;
+ }
+
+ i = 0;
+ while ( propertyDefs[i].widgetName != 0 ) {
+ yyPropertyMap[TQString(propertyDefs[i].widgetName)]
+ .insert( TQString(propertyDefs[i].architectName), i );
+ i++;
+ }
+
+ TQDomDocument doc( TQString("TQtArch") );
+ TQFile f( fileName );
+ if ( !f.open(IO_ReadOnly) ) {
+ return TQStringList();
+ }
+ if ( !doc.setContent(&f) ) {
+ TQString firstLine;
+ f.at( 0 );
+ f.readLine( firstLine, 128 );
+ firstLine = firstLine.stripWhiteSpace();
+ if ( firstLine.startsWith(TQString("DlgEdit:v1")) ) {
+ error( TQString("This file is a TQt Architect 1.x file. TQt Designer"
+ " can only read XML dialog files, as generated by TQt"
+ " Architect 2.1 or above."
+ "<p>To convert this file to the right format,"
+ " first install TQt Architect 2.1 (available at"
+ " <tt>http://qtarch.sourceforge.net/</tt>). Use the"
+ " <i>update20.pl</i> Perl script to update the file"
+ " to the 2.0 format. Load that file in TQt"
+ " Architect and save it. The file should now be in"
+ " XML format and loadable in TQt Designer.") );
+ } else if ( firstLine.startsWith(TQString("DlgEdit::v2")) ) {
+ error( TQString("This file is a TQt Architect 2.0 file. TQt Designer"
+ " can only read XML dialog files, as generated by TQt"
+ " Architect 2.1 or above."
+ "<p>To convert this file to the right format,"
+ " first install TQt Architect 2.1 (available at"
+ " <tt>http://qtarch.sourceforge.net/</tt>). Load the"
+ " 2.0 file in TQt Architect and save it. The file"
+ " should now be in XML format and loadable in TQt"
+ " Designer.") );
+ } else {
+ error( TQString("The file you gave me is not an XML file, as far as"
+ " I can tell.") );
+ }
+
+ f.close();
+ return TQStringList();
+ }
+ f.close();
+
+ TQDomElement root = doc.documentElement();
+ if ( root.tagName() != TQString("TQtArch") ||
+ root.attributeNode("type").value() != TQString("Dialog") ) {
+ error( TQString("The file you gave me is not a TQt Architect dialog"
+ " file.") );
+ return TQStringList();
+ }
+
+ emitHeader();
+
+ TQDomNode n = root.firstChild();
+ while ( !n.isNull() ) {
+ // there should be only one
+ matchDialog( n.toElement() );
+ n = n.nextSibling();
+ }
+
+ emitFooter();
+
+ TQFile outf;
+ TQString outFileName = yyClassName + TQString( ".ui" );
+
+ outf.setName( outFileName );
+ if ( !outf.open(IO_WriteOnly) ) {
+ qWarning( "dlg2ui: Could not open output file '%s'",
+ outFileName.latin1() );
+ return TQStringList();
+ }
+
+ TQTextStream out;
+ out.setEncoding( TQTextStream::Latin1 );
+ out.setDevice( &outf );
+ out << yyOut;
+ outf.close();
+
+ return TQStringList( outFileName );
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.h b/tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.h
new file mode 100644
index 0000000..99564ad
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/dlg/dlg2ui.h
@@ -0,0 +1,144 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DLG2UI_H
+#define DLG2UI_H
+
+#include <tqdom.h>
+#include <tqmap.h>
+#include <tqstring.h>
+#include <tqvariant.h>
+
+typedef TQMap<TQString, TQString> AttributeMap;
+
+struct DlgConnection
+{
+ TQString sender;
+ TQString signal;
+ TQString slot;
+
+#if defined(TQ_FULL_TEMPLATE_INSTANTIATION)
+ bool operator==( const DlgConnection& ) const {
+ return sender == sender && signal == signal && slot == slot;
+ }
+#endif
+};
+
+class Dlg2Ui
+{
+public:
+ TQStringList convertTQtArchitectDlgFile( const TQString& fileName );
+
+private:
+ TQString alias( const TQString& name ) const;
+ TQString opening( const TQString& tag,
+ const AttributeMap& attr = AttributeMap() );
+ TQString closing( const TQString& tag );
+ void error( const TQString& message );
+ void syntaxError();
+ TQString getTextValue( const TQDomNode& node );
+ TQVariant getValue( const TQDomNodeList& tqchildren, const TQString& tagName,
+ const TQString& type = "qstring" );
+ void emitHeader();
+ void emitFooter();
+ void emitSimpleValue( const TQString& tag, const TQString& value,
+ const AttributeMap& attr = AttributeMap() );
+ void emitOpening( const TQString& tag,
+ const AttributeMap& attr = AttributeMap() );
+ void emitClosing( const TQString& tag );
+ void emitOpeningWidget( const TQString& className );
+ TQString widgetClassName( const TQDomElement& e );
+ void emitColor( const TQColor& color );
+ void emitColorGroup( const TQString& name, const TQColorGroup& group );
+ void emitVariant( const TQVariant& val,
+ const TQString& stringType = "string" );
+ void emitProperty( const TQString& prop, const TQVariant& val,
+ const TQString& stringType = "string" );
+ void emitAttribute( const TQString& attr, const TQVariant& val,
+ const TQString& stringType = "string" );
+ void emitOpeningLayout( bool needsWidget, const TQString& layoutKind,
+ const TQString& name, int border, int autoBorder );
+ void flushWidgets();
+ void emitClosingLayout( bool needsWidget, const TQString& layoutKind );
+ bool isWidgetType( const TQDomElement& e );
+ void emitSpacer( int spacing, int stretch );
+ TQString filteredFlags( const TQString& flags, const TQRegExp& filter );
+ void emitFrameStyleProperty( int style );
+ void emitWidgetBody( const TQDomElement& e, bool layouted );
+ bool checkTagName( const TQDomElement& e, const TQString& tagName );
+ TQString normalizeType( const TQString& type );
+ TQVariant getValue( const TQDomElement& e, const TQString& tagName,
+ const TQString& type = "qstring" );
+ void matchDialogCommon( const TQDomElement& dialogCommon );
+ bool needsTQLayoutWidget( const TQDomElement& e );
+ void matchBoxLayout( const TQDomElement& boxLayout );
+ void matchBoxSpacing( const TQDomElement& boxSpacing );
+ void matchBoxStretch( const TQDomElement& boxStretch );
+ void matchGridLayout( const TQDomElement& gridLayout );
+ void matchGridRow( const TQDomElement& gridRow );
+ void matchGridSpacer( const TQDomElement& gridSpacer );
+ void matchLayoutWidget( const TQDomElement& layoutWidget );
+ void matchBox( const TQDomElement& box );
+ void matchLayout( const TQDomElement& tqlayout );
+ void matchWidgetLayoutCommon( const TQDomElement& widgetLayoutCommon );
+ void matchWidget( const TQDomElement& widget );
+ void matchWidgets( const TQDomElement& widgets );
+ void matchTabOrder( const TQDomElement& tabOrder );
+ void matchWidgetLayout( const TQDomElement& widgetLayout );
+ void matchDialog( const TQDomElement& dialog );
+
+ TQString yyOut;
+ TQString yyIndentStr;
+ TQString yyFileName;
+ TQString yyClassName;
+ TQMap<TQString, int> yyWidgetTypeSet;
+ TQMap<TQString, TQMap<TQString, int> > yyPropertyMap;
+ TQMap<TQString, TQDomElement> yyWidgetMap;
+ TQMap<TQString, TQString> yyCustomWidgets;
+ TQValueList<DlgConnection> yyConnections;
+ TQMap<TQString, TQString> yySlots;
+ TQMap<TQString, TQString> yyAliasMap;
+ TQStringList yyTabStops;
+ TQString yyBoxKind;
+ int yyLayoutDepth;
+ int yyGridRow;
+ int yyGridColumn;
+
+ int numErrors;
+ int uniqueLayout;
+ int uniqueSpacer;
+ int uniqueWidget;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/dlg/main.cpp b/tqtinterface/qt4/tools/designer/plugins/dlg/main.cpp
new file mode 100644
index 0000000..0acebb1
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/dlg/main.cpp
@@ -0,0 +1,108 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <filterinterface.h>
+#include <tqapplication.h>
+
+#include "dlg2ui.h"
+
+class DlgFilter : public ImportFilterInterface, public TQLibraryInterface
+{
+public:
+ DlgFilter();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface **iface );
+ TQ_REFCOUNT;
+
+ TQStringList featureList() const;
+ TQStringList import( const TQString& filter, const TQString& filename );
+
+ bool init();
+ void cleanup();
+ bool canUnload() const;
+};
+
+DlgFilter::DlgFilter()
+{
+}
+
+TQRESULT DlgFilter::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)(ImportFilterInterface*)this;
+ else if ( uuid == IID_TQFeatureList )
+ *iface = (TQFeatureListInterface*)this;
+ else if ( uuid == IID_ImportFilter )
+ *iface = (ImportFilterInterface*)this;
+ else if ( uuid == IID_TQLibrary )
+ *iface = (TQLibraryInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQStringList DlgFilter::featureList() const
+{
+ TQStringList list;
+ list << "TQt Architect Dialog Files (*.dlg)" ;
+ return list;
+}
+
+TQStringList DlgFilter::import( const TQString &, const TQString& filename )
+{
+ Dlg2Ui d;
+ return d.convertTQtArchitectDlgFile( filename );
+}
+
+bool DlgFilter::init()
+{
+ return TRUE;
+}
+
+void DlgFilter::cleanup()
+{
+}
+
+bool DlgFilter::canUnload() const
+{
+ return TRUE;
+}
+
+TQ_EXPORT_COMPONENT()
+{
+ TQ_CREATE_INSTANCE( DlgFilter )
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/glade/glade.pro b/tqtinterface/qt4/tools/designer/plugins/glade/glade.pro
new file mode 100644
index 0000000..c1be0c5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/glade/glade.pro
@@ -0,0 +1,13 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release plugin
+HEADERS = glade2ui.h
+SOURCES = main.cpp glade2ui.cpp
+DESTDIR = ../../../../plugins/designer
+DEFINES += QT_INTERNAL_XML
+include( ../../../../src/qt_professional.pri )
+TARGET = gladeplugin
+INCLUDEPATH += ../../interfaces
+
+
+target.path += $$plugins.path/designer
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.cpp b/tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.cpp
new file mode 100644
index 0000000..4571cf5
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.cpp
@@ -0,0 +1,2203 @@
+/**********************************************************************
+**
+** Converts a Glade .glade file into a .ui file.
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "glade2ui.h"
+
+#include <tqapplication.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqprogressdialog.h>
+#include <tqmessagebox.h>
+#include <tqrect.h>
+#include <tqregexp.h>
+#include <tqsizepolicy.h>
+
+#include <ctype.h>
+
+static const struct {
+ const char *gtkName;
+ const char *qtName;
+} classNames[] = {
+ { "Custom", "Custom" },
+ { "GnomeAbout", "TQDialog" },
+ { "GnomeApp", "TQMainWindow" },
+ { "GnomeCanvas", "TQLabel" },
+ { "GnomeColorPicker", "TQComboBox" },
+ { "GnomeDateEdit", "TQDateTimeEdit" },
+ { "GnomeDialog", "TQDialog" },
+ { "GnomeFontPicker", "TQComboBox" },
+ { "GnomeIconSelection", "TQIconView" },
+ { "GnomePixmap", "TQLabel" },
+ { "GnomePropertyBox", "TQDialog" },
+ { "GtkAccelLabel", "TQLabel" },
+ { "GtkAspectFrame", "TQFrame" },
+ { "GtkButton", "TQPushButton" },
+ { "GtkCList", "TQListView" },
+ { "GtkCTree", "TQListView" },
+ { "GtkCheckButton", "TQCheckBox" },
+ { "GtkCombo", "TQComboBox" },
+ { "GtkDial", "TQDial" },
+ { "GtkDialog", "TQDialog" },
+ { "GtkEntry", "TQLineEdit" },
+ { "GtkFixed", "TQLayoutWidget" },
+ { "GtkFrame", "TQFrame" },
+ { "GtkHPaned", "TQSplitter" },
+ { "GtkHScale", "TQSlider" },
+ { "GtkHScrollbar", "TQScrollBar" },
+ { "GtkHSeparator", "Line" },
+ { "GtkHandleBox", "TQFrame" },
+ { "GtkImage", "TQLabel" },
+ { "GtkLabel", "TQLabel" },
+ { "GtkList", "TQListBox" },
+ { "GtkNotebook", "TQTabWidget" },
+ { "GtkOptionMenu", "TQComboBox" },
+ { "GtkPixmap", "TQLabel" },
+ { "GtkPreview", "TQLabel" },
+ { "GtkProgressBar", "TQProgressBar" },
+ { "GtkRadioButton", "TQRadioButton" },
+ { "GtkSpinButton", "TQSpinBox" },
+ { "GtktqStatusbar", "TQtqStatusBar" },
+ { "GtkText", "TQTextEdit" },
+ { "GtkToggleButton", "TQPushButton" },
+ { "GtkTree", "TQListView" },
+ { "GtkVPaned", "TQSplitter" },
+ { "GtkVScale", "TQSlider" },
+ { "GtkVScrollbar", "TQScrollBar" },
+ { "GtkVSeparator", "Line" },
+ { "Placeholder", "TQLabel" },
+ { 0, 0 }
+};
+
+static const struct {
+ const char *name;
+ const char *menuText;
+} stockMenuItems[] = {
+ { "ABOUT", "&About" },
+ { "CLEAR", "C&lear" },
+ { "CLOSE", "&Close" },
+ { "CLOSE_WINDOW", "&Close This Window" },
+ { "COPY", "&Copy" },
+ { "CUT", "C&ut" },
+ { "END_GAME", "&End Game" },
+ { "EXIT", "E&xit" },
+ { "FIND", "&Find..." },
+ { "FIND_AGAIN", "Find &Again" },
+ { "HINT", "&Hint" },
+ { "NEW", "&New" },
+ { "NEW_GAME", "&New Game" },
+ { "NEW_WINDOW", "Create New &Window" },
+ { "OPEN", "&Open..." },
+ { "PASTE", "&Paste" },
+ { "PAUSE_GAME", "&Pause Game" },
+ { "PREFERENCES", "&Preferences..." },
+ { "PRINT", "&Print" },
+ { "PRINT_SETUP", "Print S&etup..." },
+ { "PROPERTIES", "&Properties..." },
+ { "REDO", "&Redo" },
+ { "REDO_MOVE", "&Redo Move" },
+ { "REPLACE", "&Replace..." },
+ { "RESTART_GAME", "&Restart Game" },
+ { "REVERT", "&Revert" },
+ { "SAVE", "&Save" },
+ { "SAVE_AS", "Save &As..." },
+ { "SCORES", "&Scores..." },
+ { "SELECT_ALL", "&Select All" },
+ { "UNDO", "&Undo" },
+ { "UNDO_MOVE", "&Undo Move" },
+ { 0, 0 }
+};
+
+static const struct {
+ const char *gtkName;
+ int qtValue;
+} keys[] = {
+ { "BackSpace", TQt::Key_BackSpace },
+ { "Delete", TQt::Key_Delete },
+ { "Down", TQt::Key_Down },
+ { "End", TQt::Key_End },
+ { "Escape", TQt::Key_Escape },
+ { "F1", TQt::Key_F1 },
+ { "F10", TQt::Key_F10 },
+ { "F11", TQt::Key_F11 },
+ { "F12", TQt::Key_F12 },
+ { "F2", TQt::Key_F2 },
+ { "F3", TQt::Key_F3 },
+ { "F4", TQt::Key_F4 },
+ { "F5", TQt::Key_F5 },
+ { "F6", TQt::Key_F6 },
+ { "F7", TQt::Key_F7 },
+ { "F8", TQt::Key_F8 },
+ { "F9", TQt::Key_F9 },
+ { "Home", TQt::Key_Home },
+ { "Insert", TQt::Key_Insert },
+ { "KP_Enter", TQt::Key_Enter },
+ { "Left", TQt::Key_Left },
+ { "Page_Down", TQt::Key_PageDown },
+ { "Page_Up", TQt::Key_PageUp },
+ { "Return", TQt::Key_Return },
+ { "Right", TQt::Key_Right },
+ { "Tab", TQt::Key_Tab },
+ { "Up", TQt::Key_Up },
+ { "space", TQt::Key_Space },
+ { 0, 0 }
+};
+
+static TQString nonMenuText( const TQString& menuText )
+{
+ TQString t;
+ int len = (int) menuText.length();
+ if ( menuText.endsWith(TQString("...")) )
+ len -= 3;
+ for ( int i = 0; i < len; i++ ) {
+ if ( menuText[i] != TQChar('&') )
+ t += menuText[i];
+ }
+ return t;
+}
+
+/*
+ Some GTK dialog use hyphens in variable names. Let's take no chance.
+*/
+static TQString fixedName( const TQString& name )
+{
+ const char *latin1 = name.latin1();
+ TQString fixed;
+
+ int i = 0;
+ while ( latin1 != 0 && latin1[i] != '\0' ) {
+ if ( isalnum(latin1[i]) )
+ fixed += name[i];
+ else
+ fixed += TQChar( '_' );
+ i++;
+ }
+ return fixed;
+}
+
+/*
+ Returns an hexadecimal rendering of a block of memory.
+*/
+static TQString hexed( const char *data, int length )
+{
+ TQString t;
+ for ( int i = 0; i < length; i++ ) {
+ TQString x;
+ x.sprintf( "%.2x", (uchar) data[i] );
+ t += x;
+ }
+ return t;
+}
+
+static bool isTrue( const TQString& val )
+{
+ return val.lower() == TQString( "true" );
+}
+
+static AttributeMap attribute( const TQString& name, const TQString& val )
+{
+ AttributeMap attr;
+ attr.insert( name, val );
+ return attr;
+}
+
+static TQString entitize( const TQString& str )
+{
+ TQString t = str;
+ t.tqreplace( '&', TQString("&amp;") );
+ t.tqreplace( '>', TQString("&gt;") );
+ t.tqreplace( '<', TQString("&lt;") );
+ t.tqreplace( '"', TQString("&quot;") );
+ t.tqreplace( '\'', TQString("&apos;") );
+ return t;
+}
+
+Glade2Ui::Glade2Ui()
+{
+ int i = 0;
+ while ( classNames[i].gtkName != 0 ) {
+ yyClassNameMap.insert( TQString(classNames[i].gtkName),
+ TQString(classNames[i].qtName) );
+ i++;
+ }
+
+ i = 0;
+ while ( stockMenuItems[i].name != 0 ) {
+ yyStockMap.insert( TQString(stockMenuItems[i].name),
+ TQString(stockMenuItems[i].menuText) );
+ i++;
+ }
+
+ i = 0;
+ while ( keys[i].gtkName != 0 ) {
+ yyKeyMap.insert( TQString(keys[i].gtkName), keys[i].qtValue );
+ i++;
+ }
+}
+
+TQString Glade2Ui::imageName( const TQString& fileName )
+{
+ return *yyImages.insert( fileName, TQString("image%1").arg(yyImages.count()),
+ FALSE );
+}
+
+TQString Glade2Ui::opening( const TQString& tag, const AttributeMap& attr )
+{
+ TQString t = TQChar( '<' ) + tag;
+ AttributeMap::ConstIterator a = attr.begin();
+ while ( a != attr.end() ) {
+ t += TQChar( ' ' ) + a.key() + TQString( "=\"" ) + entitize( *a ) +
+ TQChar( '"' );
+ ++a;
+ }
+ t += TQChar( '>' );
+ return t;
+}
+
+TQString Glade2Ui::closing( const TQString& tag )
+{
+ return opening( TQChar('/') + tag );
+}
+
+TQString Glade2Ui::atom( const TQString& tag, const AttributeMap& attr )
+{
+ TQString t = opening( tag, attr );
+ t.insert( t.length() - 1, TQChar('/') );
+ return t;
+}
+
+void Glade2Ui::error( const TQString& message )
+{
+ if ( numErrors++ == 0 )
+ TQMessageBox::warning( 0, yyFileName, message );
+}
+
+void Glade2Ui::syntaxError()
+{
+ error( TQString("Sorry, I met a random syntax error. I did what I could, but"
+ " that was not enough."
+ "<p>You might want to write to"
+ " <tt>qt-bugs@trolltech.com</tt> about this incident.") );
+}
+
+TQString Glade2Ui::getTextValue( const TQDomNode& node )
+{
+ if ( node.childNodes().count() > 1 ) {
+ syntaxError();
+ return TQString();
+ }
+
+ if ( node.childNodes().count() == 0 )
+ return TQString();
+
+ TQDomText t = node.firstChild().toText();
+ if ( t.isNull() ) {
+ syntaxError();
+ return TQString();
+ }
+ return t.data().stripWhiteSpace();
+}
+
+void Glade2Ui::emitHeader()
+{
+ yyOut += TQString( "<!DOCTYPE UI><UI version=\"3.0\" stdsetdef=\"1\">\n" );
+}
+
+void Glade2Ui::emitFooter()
+{
+ yyOut += TQString( "</UI>\n" );
+}
+
+void Glade2Ui::emitSimpleValue( const TQString& tag, const TQString& value,
+ const AttributeMap& attr )
+{
+ yyOut += yyIndentStr + opening( tag, attr ) + entitize( value ) +
+ closing( tag ) + TQChar( '\n' );
+}
+
+void Glade2Ui::emitOpening( const TQString& tag, const AttributeMap& attr )
+{
+ yyOut += yyIndentStr + opening( tag, attr ) + TQChar( '\n' );
+ yyIndentStr += TQString( " " );
+}
+
+void Glade2Ui::emitClosing( const TQString& tag )
+{
+ yyIndentStr.truncate( yyIndentStr.length() - 4 );
+ yyOut += yyIndentStr + closing( tag ) + TQChar( '\n' );
+}
+
+void Glade2Ui::emitAtom( const TQString& tag, const AttributeMap& attr )
+{
+ yyOut += yyIndentStr + atom( tag, attr ) + TQChar( '\n' );
+}
+
+void Glade2Ui::emitVariant( const TQVariant& val, const TQString& stringType )
+{
+ if ( val.isValid() ) {
+ switch ( val.type() ) {
+ case TQVariant::String:
+ emitSimpleValue( stringType, val.toString() );
+ break;
+ case TQVariant::CString:
+ emitSimpleValue( TQString("cstring"), val.toString() );
+ break;
+ case TQVariant::Bool:
+ emitSimpleValue( TQString("bool"),
+ TQString(val.toBool() ? "true" : "false") );
+ break;
+ case TQVariant::Int:
+ case TQVariant::UInt:
+ emitSimpleValue( TQString("number"), val.toString() );
+ break;
+ case TQVariant::Rect:
+ emitOpening( TQString("rect") );
+ emitSimpleValue( TQString("x"), TQString::number(val.toRect().x()) );
+ emitSimpleValue( TQString("y"), TQString::number(val.toRect().y()) );
+ emitSimpleValue( TQString("width"),
+ TQString::number(val.toRect().width()) );
+ emitSimpleValue( TQString("height"),
+ TQString::number(val.toRect().height()) );
+ emitClosing( TQString("rect") );
+ break;
+ case TQVariant::Size:
+ emitOpening( TQString("size") );
+ emitSimpleValue( TQString("width"),
+ TQString::number(val.toSize().width()) );
+ emitSimpleValue( TQString("height"),
+ TQString::number(val.toSize().height()) );
+ emitClosing( TQString("size") );
+ break;
+ case TQVariant::SizePolicy:
+ emitOpening( TQString("sizepolicy") );
+ emitSimpleValue( TQString("hsizetype"),
+ TQString::number((int) val.toSizePolicy()
+ .horData()) );
+ emitSimpleValue( TQString("vsizetype"),
+ TQString::number((int) val.toSizePolicy()
+ .verData()) );
+ emitClosing( TQString("sizepolicy") );
+ break;
+ default:
+ emitSimpleValue( TQString("fnord"), TQString() );
+ }
+ }
+}
+
+void Glade2Ui::emitProperty( const TQString& prop, const TQVariant& val,
+ const TQString& stringType )
+{
+ emitOpening( TQString("property"), attribute(TQString("name"), prop) );
+ emitVariant( val, stringType );
+ emitClosing( TQString("property") );
+}
+
+void Glade2Ui::emitFontProperty( const TQString& prop, int pointSize, bool bold )
+{
+ emitOpening( TQString("property"), attribute(TQString("name"), prop) );
+ emitOpening( TQString("font") );
+ emitSimpleValue( TQString("pointsize"), TQString::number(pointSize) );
+ if ( bold )
+ emitSimpleValue( TQString("bold"), TQString("1") );
+ emitClosing( TQString("font") );
+ emitClosing( TQString("property") );
+}
+
+void Glade2Ui::emitAttribute( const TQString& prop, const TQVariant& val,
+ const TQString& stringType )
+{
+ emitOpening( TQString("attribute"), attribute(TQString("name"), prop) );
+ emitVariant( val, stringType );
+ emitClosing( TQString("attribute") );
+}
+
+static TQString accelerate( const TQString& gtkLabel )
+{
+ TQString qtLabel = gtkLabel;
+ qtLabel.tqreplace( '&', TQString("&&") );
+ // close but not quite right
+ qtLabel.tqreplace( TQChar('_'), TQChar('&') );
+ return qtLabel;
+}
+
+static TQString decelerate( const TQString& gtkLabel )
+{
+ TQString qtLabel = gtkLabel;
+ // ditto
+ qtLabel.tqreplace( '_', TQString() );
+ return qtLabel;
+}
+
+/*
+ Converting a GTK widget to a corresponding TQt widget is sometimes
+ hard. For example, a GtkScrolledWindow should sometimes be converted
+ into a TQTextView, a TQTextEdit, a TQListView or whatever. What we do
+ is pretty hackish, but it mostly works.
+*/
+TQString Glade2Ui::gtk2qtClass( const TQString& gtkClass,
+ const TQValueList<TQDomElement>& childWidgets )
+{
+ TQRegExp gnomeXEntry( TQString("Gnome(File|Number|Pixmap)?Entry") );
+
+ TQString qtClass;
+
+ if ( gtkClass == TQString("GtkScrolledWindow") ) {
+ if ( childWidgets.count() == 1 ) {
+ TQString g;
+ bool editable = FALSE;
+ bool showTitles = TRUE;
+
+ TQDomNode n = childWidgets.first().firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("class") ) {
+ g = getTextValue( n );
+ } else if ( tagName == TQString("editable") ) {
+ editable = isTrue( getTextValue(n) );
+ } else if ( tagName.startsWith(TQString("show_tit")) ) {
+ showTitles = isTrue( getTextValue(n) );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( g == TQString("GnomeCanvas") ||
+ g == TQString("GtkDrawingArea") ) {
+ qtClass = TQString( "TQLabel" );
+ } else if ( g == TQString("GnomeIconList") ) {
+ qtClass = TQString( "TQIconView" );
+ } else if ( g == TQString("GtkCList") ) {
+ if ( showTitles )
+ qtClass = TQString( "TQListView" );
+ else
+ qtClass = TQString( "TQListBox" );
+ } else if ( g == TQString("GtkCTree") ) {
+ qtClass = TQString( "TQListView" );
+ } else if ( g == TQString("GtkList") ) {
+ qtClass = TQString( "TQListBox" );
+ } else if ( g == TQString("GtkText") ) {
+ if ( editable )
+ qtClass = TQString( "TQTextEdit" );
+ else
+ qtClass = TQString( "TQTextView" );
+ } else if ( g == TQString("GtkTree") ) {
+ qtClass = TQString( "TQListView" );
+ }
+ // else too bad (qtClass is empty)
+ }
+ } else if ( gtkClass == TQString("GtkWindow") ) {
+ qtClass = TQString( "TQDialog" );
+ if ( childWidgets.count() == 1 ) {
+ TQString g;
+
+ TQDomNode n = childWidgets.first().firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("class") )
+ g = getTextValue( n );
+ n = n.nextSibling();
+ }
+ if ( g == TQString("GnomeDruid") )
+ qtClass = TQString( "TQWizard" );
+ }
+ /*
+ GnomeEntry and friends are a wrapper around a GtkEntry. We only
+ want the GtkEntry child.
+ */
+ } else if ( !gnomeXEntry.exactMatch(gtkClass) &&
+ gtkClass != TQString("GtkAlignment") &&
+ gtkClass != TQString("GtkEventBox") ) {
+ qtClass = yyClassNameMap[gtkClass];
+ if ( qtClass.isEmpty() )
+ qtClass = TQString( "Unknown" );
+ }
+ return qtClass;
+}
+
+static TQString gtk2qtScrollBarMode( const TQString& scrollbarPolicy )
+{
+ if ( scrollbarPolicy.endsWith(TQString("_NEVER")) ) {
+ return TQString( "AlwaysOff" );
+ } else if ( scrollbarPolicy.endsWith(TQString("_ALWAYS")) ) {
+ return TQString( "AlwaysOn" );
+ } else {
+ return TQString( "Auto" );
+ }
+}
+
+static TQString gtk2qtSelectionMode( const TQString& selectionMode )
+{
+ if ( selectionMode.endsWith(TQString("_MULTIPLE")) )
+ return TQString( "Multi" );
+ else if ( selectionMode.endsWith(TQString("_EXTENDED")) )
+ return TQString( "Extended" );
+ else
+ return TQString( "Single" );
+}
+
+int Glade2Ui::matchAccelOnActivate( const TQDomElement& accel )
+{
+ TQString key;
+ TQString modifiers;
+
+ TQDomNode n = accel.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("key") ) {
+ key = getTextValue( n );
+ if ( !key.startsWith(TQString("GDK_")) )
+ return 0;
+ } else if ( tagName == TQString("modifiers") ) {
+ modifiers = getTextValue( n );
+ } else if ( tagName == TQString("signal") ) {
+ if ( getTextValue(n) != TQString("activate") )
+ return 0;
+ }
+ n = n.nextSibling();
+ }
+
+ int flags = 0;
+
+ if ( key.length() == 5 ) {
+ flags = key[4].upper().latin1();
+ } else if ( yyKeyMap.tqcontains(key.mid(4)) ) {
+ flags = yyKeyMap[key.mid(4)];
+ } else {
+ return 0;
+ }
+
+ if ( modifiers.tqcontains(TQString("_CONTROL_")) )
+ flags |= TQt::CTRL;
+ if ( modifiers.tqcontains(TQString("_SHIFT_")) )
+ flags |= TQt::SHIFT;
+ if ( modifiers.tqcontains(TQString("_MOD1_")) )
+ flags |= TQt::ALT;
+ return flags;
+}
+
+void Glade2Ui::emitGtkMenu( const TQDomElement& menu )
+{
+ TQRegExp gnomeuiinfoMenuXItem( TQString("GNOMEUIINFO_MENU_(.+)_ITEM") );
+
+ TQDomNode n = menu.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("widget") ) {
+ TQString activateHandler;
+ TQString gtkClass;
+ TQString icon;
+ TQString label;
+ TQString name;
+ TQString stockItem;
+ TQString tooltip;
+ int qtAccel = 0;
+
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ TQString childTagName = child.toElement().tagName();
+ if ( childTagName == TQString("accelerator") ) {
+ qtAccel = matchAccelOnActivate( child.toElement() );
+ } else if ( childTagName == TQString("class") ) {
+ gtkClass = getTextValue( child );
+ } else if ( childTagName == TQString("icon") ) {
+ icon = getTextValue( child );
+ } else if ( childTagName == TQString("label") ) {
+ label = getTextValue( child );
+ } else if ( childTagName == TQString("name") ) {
+ name = getTextValue( child );
+ } else if ( childTagName == TQString("signal") ) {
+ TQString signalName;
+ TQString signalHandler;
+
+ TQDomNode grandchild = child.firstChild();
+ while ( !grandchild.isNull() ) {
+ TQString grandchildTagName =
+ grandchild.toElement().tagName();
+ if ( grandchildTagName == TQString("handler") ) {
+ signalHandler = getTextValue( grandchild );
+ } else if ( grandchildTagName == TQString("name") ) {
+ signalName = getTextValue( grandchild );
+ }
+ grandchild = grandchild.nextSibling();
+ }
+ if ( signalName == TQString("activate") )
+ activateHandler = signalHandler;
+ } else if ( childTagName == TQString("stock_item") ) {
+ stockItem = getTextValue( child );
+ } else if ( childTagName == TQString("tooltip") ) {
+ tooltip = getTextValue( child );
+ }
+ child = child.nextSibling();
+ }
+
+ if ( label.length() + stockItem.length() == 0 ) {
+ emitAtom( TQString("separator") );
+ } else {
+ if ( name.isEmpty() )
+ name = TQString( "action%1" ).arg( uniqueAction++ );
+ emitAtom( TQString("action"), attribute(TQString("name"), name) );
+
+ if ( !activateHandler.isEmpty() ) {
+ TQString slot = activateHandler + TQString( "()" );
+ GladeConnection c;
+ c.sender = name;
+ c.signal = TQString( "activated()" );
+ c.slot = slot;
+ yyConnections.push_back( c );
+ yySlots.insert( slot, TQString("public") );
+ }
+
+ TQString x;
+ GladeAction a;
+
+ if ( gnomeuiinfoMenuXItem.exactMatch(stockItem) ) {
+ x = gnomeuiinfoMenuXItem.cap( 1 );
+ a.menuText = yyStockMap[x];
+ if ( x == TQString("EXIT") && qtAccel == 0 )
+ qtAccel = TQt::CTRL + TQt::Key_Q;
+ } else {
+ a.menuText = accelerate( label );
+ }
+ a.text = nonMenuText( a.menuText );
+ a.toolTip = tooltip;
+ a.accel = qtAccel;
+ a.iconSet = icon;
+ yyActions.insert( name, a );
+ if ( !x.isEmpty() )
+ yyStockItemActions.insert( x, name );
+ }
+ }
+ n = n.nextSibling();
+ }
+}
+
+void Glade2Ui::emitGtkMenuBarChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets )
+{
+ TQRegExp gnomeuiinfoMenuXTree( TQString("GNOMEUIINFO_MENU_(.+)_TREE") );
+
+ emitOpening( TQString("menubar") );
+ emitProperty( TQString("name"),
+ TQString("MenuBar%1").arg(uniqueMenuBar++).latin1() );
+
+ TQValueList<TQDomElement>::ConstIterator c = childWidgets.begin();
+ while ( c != childWidgets.end() ) {
+ TQValueList<TQDomElement> grandchildWidgets;
+ TQString gtkClass;
+ TQString label;
+ TQString name;
+ TQString stockItem;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("class") ) {
+ gtkClass = getTextValue( n );
+ } else if ( tagName == TQString("label") ) {
+ label = getTextValue( n );
+ } else if ( tagName == TQString("name") ) {
+ name = getTextValue( n );
+ } else if ( tagName == TQString("stock_item") ) {
+ stockItem = getTextValue( n );
+ } else if ( tagName == TQString("widget") ) {
+ grandchildWidgets.push_back( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( gtkClass == TQString("GtkMenuItem") &&
+ grandchildWidgets.count() == 1 ) {
+ TQString text;
+ if ( gnomeuiinfoMenuXTree.exactMatch(stockItem) ) {
+ text = gnomeuiinfoMenuXTree.cap( 1 );
+ if ( text == TQString("Files") )
+ text = TQString( "Fi&les" );
+ else
+ text = TQChar( '&' ) + text.left( 1 ) +
+ text.mid( 1 ).lower();
+ } else {
+ text = accelerate( label );
+ }
+
+ AttributeMap attr;
+ attr.insert( TQString("name"), name );
+ attr.insert( TQString("text"), text );
+
+ emitOpening( TQString("item"), attr );
+ emitGtkMenu( grandchildWidgets.first() );
+ emitClosing( TQString("item") );
+ }
+ ++c;
+ }
+ emitClosing( TQString("menubar") );
+}
+
+void Glade2Ui::emitGtkToolbarChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets )
+{
+ TQRegExp gnomeStockPixmapX( TQString("GNOME_STOCK_PIXMAP_(.+)") );
+
+ emitOpening( TQString("toolbar"), attribute(TQString("dock"), TQString("2")) );
+ emitProperty( TQString("name"),
+ TQString("ToolBar%1").arg(uniqueToolBar++).latin1() );
+
+ TQValueList<TQDomElement>::ConstIterator c = childWidgets.begin();
+ while ( c != childWidgets.end() ) {
+ TQString childName;
+ TQString icon;
+ TQString label;
+ TQString name;
+ TQString stockPixmap;
+ TQString tooltip;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("child_name") ) {
+ childName = getTextValue( n );
+ } else if ( tagName == TQString("icon") ) {
+ icon = getTextValue( n );
+ } else if ( tagName == TQString("label") ) {
+ label = getTextValue( n );
+ } else if ( tagName == TQString("name") ) {
+ name = getTextValue( n );
+ } else if ( tagName == TQString("stock_pixmap") ) {
+ stockPixmap = getTextValue( n );
+ } else if ( tagName == TQString("tooltip") ) {
+ tooltip = getTextValue( n );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( childName == TQString("Toolbar:button") ) {
+ TQString actionName;
+ GladeAction a;
+ a.menuText = label;
+ a.text = label;
+ a.accel = 0;
+ a.iconSet = icon;
+
+ if ( gnomeStockPixmapX.exactMatch(stockPixmap) ) {
+ TQString x = gnomeStockPixmapX.cap( 1 );
+ actionName = yyStockItemActions[x];
+ }
+ if ( actionName.isEmpty() ) {
+ if ( name.isEmpty() )
+ actionName = TQString( "action%1" ).arg( uniqueAction++ );
+ else
+ actionName = TQString( "action_%1" ).arg( name );
+ yyActions.insert( actionName, a );
+ }
+ if ( !tooltip.isEmpty() )
+ yyActions[actionName].toolTip = tooltip;
+
+ emitAtom( TQString("action"), attribute(TQString("name"),
+ actionName) );
+ } else {
+ emitAtom( TQString("separator") );
+ }
+ ++c;
+ }
+ emitClosing( TQString("toolbar") );
+}
+
+void Glade2Ui::emitPushButton( const TQString& text, const TQString& name )
+{
+ emitOpening( TQString("widget"),
+ attribute(TQString("class"), TQString("TQPushButton")) );
+ emitProperty( TQString("name"), name.latin1() );
+ emitProperty( TQString("text"), text );
+ if ( name.tqcontains(TQString("ok")) > 0 ) {
+ emitProperty( TQString("default"), TQVariant(TRUE, 0) );
+ } else if ( name.tqcontains(TQString("help")) > 0 ) {
+ emitProperty( TQString("accel"), (int) TQt::Key_F1 );
+ }
+ emitClosing( TQString("widget") );
+}
+
+void Glade2Ui::attach( AttributeMap *attr, int leftAttach, int rightAttach,
+ int topAttach, int bottomAttach )
+{
+ if ( leftAttach >= 0 ) {
+ attr->insert( TQString("row"), TQString::number(topAttach) );
+ attr->insert( TQString("column"), TQString::number(leftAttach) );
+ if ( bottomAttach - topAttach != 1 )
+ attr->insert( TQString("rowspan"),
+ TQString::number(bottomAttach - topAttach) );
+ if ( rightAttach - leftAttach != 1 )
+ attr->insert( TQString("colspan"),
+ TQString::number(rightAttach - leftAttach) );
+ }
+}
+
+void Glade2Ui::emitSpacer( const TQString& orientation, int leftAttach,
+ int rightAttach, int topAttach, int bottomAttach )
+{
+ AttributeMap attr;
+ attach( &attr, leftAttach, rightAttach, topAttach, bottomAttach );
+ emitOpening( TQString("spacer"), attr );
+ emitProperty( TQString("name"),
+ TQString("Spacer%1").arg(uniqueSpacer++).latin1() );
+ emitProperty( TQString("orientation"), orientation, TQString("enum") );
+ emitProperty( TQString("sizeType"), TQString("Expanding"),
+ TQString("enum") );
+ emitClosing( TQString("spacer") );
+}
+
+void Glade2Ui::emitPixmap( const TQString& imageName, int leftAttach,
+ int rightAttach, int topAttach, int bottomAttach )
+{
+ emitOpeningWidget( TQString("TQLabel"), leftAttach, rightAttach, topAttach,
+ bottomAttach );
+ emitProperty( TQString("sizePolicy"),
+ TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed) );
+ emitProperty( TQString("pixmap"), imageName, TQString("pixmap") );
+ emitClosing( TQString("widget") );
+}
+
+void Glade2Ui::emitGnomeAbout( TQString copyright, TQString authors,
+ TQString comments )
+{
+ TQString prog = yyProgramName;
+ if ( prog.isEmpty() )
+ prog = TQString( "Gnomovision 1.69" );
+ if ( copyright.isEmpty() )
+ copyright = TQString( "(C) 2001 Jasmin Blanchette" );
+ if ( authors.isEmpty() )
+ authors = TQString( "Jasmin Blanchette <jasmin@troll.no>" );
+ if ( comments.isEmpty() )
+ comments = TQString( "Gnomovision is the official GNU application." );
+
+ emitOpening( TQString("hbox") );
+ emitSpacer( TQString("Horizontal") );
+ emitOpeningWidget( TQString("TQLayoutWidget") );
+ emitOpening( TQString("vbox") );
+ emitProperty( TQString("spacing"), 17 );
+
+ /*
+ Emit the application name.
+ */
+ emitOpeningWidget( TQString("TQLabel") );
+ emitFontProperty( TQString("font"), 24, TRUE );
+ emitProperty( TQString("text"), prog );
+ emitProperty( TQString("tqalignment"), TQString("AlignAuto|AlignCenter"),
+ TQString("set") );
+ emitClosing( TQString("widget") );
+
+ /*
+ Emit the copyright notice.
+ */
+ emitOpeningWidget( TQString("TQLabel") );
+ emitFontProperty( TQString("font"), 12, TRUE );
+ emitProperty( TQString("text"), copyright );
+ emitClosing( TQString("widget") );
+
+ /*
+ Emit the authors' names.
+ */
+ emitOpeningWidget( TQString("TQLayoutWidget") );
+ emitOpening( TQString("hbox") );
+
+ emitOpeningWidget( TQString("TQLabel") );
+ emitFontProperty( TQString("font"), 12, TRUE );
+ emitProperty( TQString("text"), TQString("Authors:") );
+ emitProperty( TQString("tqalignment"), TQString("AlignAuto|AlignTop"),
+ TQString("set") );
+ emitClosing( TQString("widget") );
+
+ emitOpeningWidget( TQString("TQLabel") );
+ emitFontProperty( TQString("font"), 12, FALSE );
+ emitProperty( TQString("text"), authors );
+ emitProperty( TQString("tqalignment"), TQString("AlignAuto|AlignTop"),
+ TQString("set") );
+ emitClosing( TQString("widget") );
+
+ emitSpacer( TQString("Horizontal") );
+
+ emitClosing( TQString("hbox") );
+ emitClosing( TQString("widget") );
+
+ /*
+ Emit the comments.
+ */
+ emitOpeningWidget( TQString("TQLabel") );
+ emitFontProperty( TQString("font"), 10, FALSE );
+ emitProperty( TQString("text"), comments );
+ emitProperty( TQString("tqalignment"), TQString("AlignAuto|AlignTop"),
+ TQString("set") );
+ emitClosing( TQString("widget") );
+
+ /*
+ Emit the spacer and the OK button.
+ */
+ emitSpacer( TQString("Vertical") );
+
+ emitOpeningWidget( TQString("TQLayoutWidget") );
+ emitOpening( TQString("hbox") );
+ emitSpacer( TQString("Horizontal") );
+
+ emitPushButton( TQString("&OK"), TQString("okButton") );
+
+ emitSpacer( TQString("Horizontal") );
+ emitClosing( TQString("hbox") );
+ emitClosing( TQString("widget") );
+
+ emitClosing( TQString("vbox") );
+ emitClosing( TQString("widget") );
+ emitSpacer( TQString("Horizontal") );
+ emitClosing( TQString("hbox") );
+}
+
+/*
+ GnomeApps are emitted in two passes, because some information goes
+ into the <widget> section, whereas other information goes into the
+ <toolbars> section.
+*/
+void Glade2Ui::emitGnomeAppChildWidgetsPass1(
+ const TQValueList<TQDomElement>& childWidgets )
+{
+ TQValueList<TQDomElement>::ConstIterator c = childWidgets.begin();
+ while ( c != childWidgets.end() ) {
+ TQValueList<TQDomElement> grandchildWidgets;
+ TQString childName;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("child_name") ) {
+ childName = getTextValue( n );
+ } else if ( tagName == TQString("widget") ) {
+ grandchildWidgets.push_back( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( childName == TQString("GnomeTQt::Dock:contents") ) {
+ emitWidget( *c, FALSE );
+ } else {
+ emitGnomeAppChildWidgetsPass1( grandchildWidgets );
+ }
+ ++c;
+ }
+}
+
+void Glade2Ui::doPass2( const TQValueList<TQDomElement>& childWidgets,
+ TQValueList<TQDomElement> *menuBar,
+ TQValueList<TQValueList<TQDomElement> > *toolBars )
+{
+ TQValueList<TQDomElement>::ConstIterator c = childWidgets.begin();
+ while ( c != childWidgets.end() ) {
+ TQValueList<TQDomElement> grandchildWidgets;
+ TQString childName;
+ TQString gtkClass;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("child_name") ) {
+ childName = getTextValue( n );
+ } else if ( tagName == TQString("class") ) {
+ gtkClass = getTextValue( n );
+ } else if ( tagName == TQString("widget") ) {
+ grandchildWidgets.push_back( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( gtkClass == TQString("GtkMenuBar") ) {
+ *menuBar = grandchildWidgets;
+ } else if ( gtkClass == TQString("GtkToolbar") ) {
+ toolBars->push_back( grandchildWidgets );
+ } else if ( childName != TQString("GnomeTQt::Dock:contents") ) {
+ doPass2( grandchildWidgets, menuBar, toolBars );
+ }
+ ++c;
+ }
+}
+
+void Glade2Ui::emitGnomeAppChildWidgetsPass2(
+ const TQValueList<TQDomElement>& childWidgets )
+{
+ TQValueList<TQDomElement> menuBar;
+ TQValueList<TQValueList<TQDomElement> > toolBars;
+
+ doPass2( childWidgets, &menuBar, &toolBars );
+
+ emitGtkMenuBarChildWidgets( menuBar );
+ if ( !toolBars.isEmpty() ) {
+ emitOpening( TQString("toolbars") );
+ while ( !toolBars.isEmpty() ) {
+ emitGtkToolbarChildWidgets( toolBars.first() );
+ toolBars.remove( toolBars.begin() );
+ }
+ emitClosing( TQString("toolbars") );
+ }
+}
+
+void Glade2Ui::emitGtkButtonChildWidgets( TQValueList<TQDomElement> childWidgets )
+{
+ TQValueList<TQDomElement>::ConstIterator c = childWidgets.begin();
+ while ( c != childWidgets.end() ) {
+ TQString label;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("label") ) {
+ label = getTextValue( n );
+ } else if ( tagName == TQString("widget") ) {
+ childWidgets.push_back( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( !label.isEmpty() ) {
+ emitProperty( TQString("text"), accelerate(label) );
+ break;
+ }
+ ++c;
+ }
+}
+
+void Glade2Ui::emitGtkComboChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets, const TQStringList& items )
+{
+ TQString text;
+
+ // there should be exactly one child, of type GtkEntry
+ if ( childWidgets.count() == 1 ) {
+ TQDomNode n = childWidgets.first().firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("name") ) {
+ // grep 'elsewhere'
+ emitProperty( TQString("name"),
+ fixedName(getTextValue(n).latin1()) );
+ } else if ( tagName == TQString("text") ) {
+ text = getTextValue( n );
+ }
+ n = n.nextSibling();
+ }
+ }
+
+ int n = 0;
+ TQStringList::ConstIterator s = items.begin();
+ while ( s != items.end() ) {
+ if ( !text.isEmpty() && *s == text )
+ emitProperty( TQString("currentItem"), n );
+ n++;
+ ++s;
+ }
+
+}
+
+void Glade2Ui::emitGtkNotebookChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets )
+{
+ TQStringList tabNames;
+ TQStringList tabLabels;
+
+ for ( int i = 0; i < (int) childWidgets.count(); i++ ) {
+ tabNames.push_back( TQString("tab%1").arg(i + 1) );
+ tabLabels.push_back( TQString("Tab %1").arg(i + 1) );
+ }
+
+ TQValueList<TQDomElement>::ConstIterator c;
+ c = childWidgets.begin();
+
+ TQStringList::Iterator nam = tabNames.begin();
+ TQStringList::Iterator lab = tabLabels.begin();
+
+ while ( c != childWidgets.end() ) {
+ TQString childName;
+ TQString name;
+ TQString label;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("child_name") ) {
+ childName = getTextValue( n );
+ } else if ( tagName == TQString("name") ) {
+ name = getTextValue( n );
+ } else if ( tagName == TQString("label") ) {
+ label = getTextValue( n );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( childName == TQString("Notebook:tab") ) {
+ if ( !name.isEmpty() )
+ *nam = name;
+ if ( !label.isEmpty() )
+ *lab = label;
+ ++nam;
+ ++lab;
+ }
+ ++c;
+ }
+
+ c = childWidgets.begin();
+ while ( c != childWidgets.end() ) {
+ TQString childName;
+ TQString name;
+ TQString label;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("child_name") )
+ childName = getTextValue( n );
+ n = n.nextSibling();
+ }
+
+ if ( childName != TQString("Notebook:tab") ) {
+ emitOpeningWidget( TQString("TQWidget") );
+ emitProperty( TQString("name"), tabNames.first().latin1() );
+ tabNames.remove( tabNames.begin() );
+ emitAttribute( TQString("title"), accelerate(tabLabels.first()) );
+ tabLabels.remove( tabLabels.begin() );
+ emitWidget( *c, FALSE );
+ emitClosing( TQString("widget") );
+ }
+ ++c;
+ }
+}
+
+void Glade2Ui::emitTQListViewColumns( const TQDomElement& qlistview )
+{
+ TQDomNode n = qlistview.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("widget") ) {
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ TQString tagName = child.toElement().tagName();
+ if ( tagName == TQString("label") ) {
+ emitOpening( TQString("column") );
+ emitProperty( TQString("text"),
+ decelerate(getTextValue(child)) );
+ emitClosing( TQString("column") );
+ }
+ child = child.nextSibling();
+ }
+ } else if ( tagName == TQString("class") ) {
+ TQString gtkClass = getTextValue( n );
+ if ( gtkClass.endsWith(TQString("Tree")) )
+ emitProperty( TQString("rootIsDecorated"), TQVariant(TRUE, 0) );
+ } else if ( tagName == TQString("selection_mode") ) {
+ emitProperty( TQString("selectionMode"),
+ gtk2qtSelectionMode(getTextValue(n)) );
+ }
+ n = n.nextSibling();
+ }
+}
+
+void Glade2Ui::emitGtkScrolledWindowChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets, const TQString& qtClass )
+{
+ if ( childWidgets.count() == 1 ) {
+ if ( qtClass == TQString("TQIconView") ||
+ qtClass == TQString("TQListBox") ||
+ qtClass == TQString("TQListView") ) {
+ TQDomNode n = childWidgets.first().firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("selection_mode") ) {
+ emitProperty( TQString("selectionMode"),
+ gtk2qtSelectionMode(getTextValue(n)) );
+ }
+ n = n.nextSibling();
+ }
+ }
+
+ if ( qtClass == TQString("TQListView") ) {
+ emitTQListViewColumns( childWidgets.first() );
+ } else if ( qtClass == TQString("TQTextEdit") ||
+ qtClass == TQString("TQTextView") ) {
+ TQDomNode n = childWidgets.first().firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("text") )
+ emitProperty( TQString("text"), getTextValue(n) );
+ n = n.nextSibling();
+ }
+ }
+ }
+}
+
+void Glade2Ui::emitGnomeDruidPage( const TQDomElement& druidPage )
+{
+ TQValueList<TQDomElement> childWidgets;
+ TQString gtkClass;
+ TQString logoImage;
+ TQString name;
+ TQString text;
+ TQString title;
+ TQString watermarkImage;
+
+ emitOpeningWidget( TQString("TQWidget") );
+
+ TQDomNode n = druidPage.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("class") ) {
+ gtkClass = getTextValue( n );
+ } else if ( tagName == TQString("logo_image") ) {
+ logoImage = getTextValue( n );
+ } else if ( tagName == TQString("name") ) {
+ name = getTextValue( n );
+ } else if ( tagName == TQString("text") ) {
+ text = getTextValue( n );
+ } else if ( tagName == TQString("title") ) {
+ title = getTextValue( n );
+ } else if ( tagName == TQString("watermark_image") ) {
+ watermarkImage = getTextValue( n );
+ } else if ( tagName == TQString("widget") ) {
+ childWidgets.push_back( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( !name.isEmpty() )
+ emitProperty( TQString("name"), fixedName(name).latin1() );
+ if ( title.isEmpty() )
+ title = TQString( "Page" );
+ emitAttribute( TQString("title"), title );
+
+ /*
+ We're striving to get the logoImage and/or the watermarkImage at
+ the right places with a grid layout.
+ */
+ int leftAttach = 0;
+ int rightAttach = 0;
+ int topAttach = 0;
+ int bottomAttach = 0;
+
+ int numImages = 0;
+ if ( !logoImage.isEmpty() ) {
+ topAttach = 1;
+ numImages++;
+ }
+ if ( !watermarkImage.isEmpty() ) {
+ leftAttach = 1;
+ numImages++;
+ }
+ rightAttach = leftAttach + numImages;
+ bottomAttach = topAttach + numImages;
+
+ bool layouted = ( numImages > 0 );
+ if ( layouted ) {
+ emitOpening( TQString("grid") );
+ if ( !logoImage.isEmpty() )
+ emitPixmap( imageName(logoImage), numImages, numImages + 1, 0, 1 );
+ if ( !watermarkImage.isEmpty() )
+ emitPixmap( imageName(watermarkImage), 0, 1, numImages,
+ numImages + 1 );
+ } else {
+ leftAttach = -1;
+ rightAttach = -1;
+ topAttach = -1;
+ bottomAttach = -1;
+ }
+
+ if ( gtkClass.endsWith(TQString("Standard")) ) {
+ emitChildWidgets( childWidgets, layouted, leftAttach, rightAttach,
+ topAttach, bottomAttach );
+ } else if ( !text.isEmpty() ) {
+ if ( layouted )
+ emitOpeningWidget( TQString("TQLayoutWidget"), leftAttach,
+ rightAttach, topAttach, bottomAttach );
+ emitOpening( TQString("hbox") );
+ emitSpacer( TQString("Horizontal") );
+ emitOpeningWidget( TQString("TQLabel") );
+ emitProperty( TQString("text"), text );
+ emitClosing( TQString("widget") );
+ emitSpacer( TQString("Horizontal") );
+ emitClosing( TQString("hbox") );
+ if ( layouted )
+ emitClosing( TQString("widget") );
+ }
+
+ if ( layouted )
+ emitClosing( TQString("grid") );
+ emitClosing( TQString("widget") );
+}
+
+void Glade2Ui::emitGtkWindowChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets, const TQString& qtClass )
+{
+ if ( childWidgets.count() == 1 && qtClass == TQString("TQWizard") ) {
+ emitFontProperty( TQString("titleFont"), 18, FALSE );
+
+ TQDomNode n = childWidgets.first().firstChild();
+ while ( !n.isNull() ) {
+ if ( n.toElement().tagName() == TQString("widget") )
+ emitGnomeDruidPage( n.toElement() );
+ n = n.nextSibling();
+ }
+ } else {
+ emitChildWidgets( childWidgets, FALSE );
+ }
+}
+
+bool Glade2Ui::packEnd( const TQDomElement& widget )
+{
+ TQDomNode n = widget.firstChild();
+ while ( !n.isNull() ) {
+ if ( n.toElement().tagName() == TQString("child") ) {
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ if ( child.toElement().tagName() == TQString("pack") ) {
+ TQString pack = getTextValue( child );
+ return pack.endsWith( TQString("_END") );
+ }
+ child = child.nextSibling();
+ }
+ }
+ n = n.nextSibling();
+ }
+ return FALSE;
+}
+
+void Glade2Ui::emitChildWidgets( const TQValueList<TQDomElement>& childWidgets,
+ bool layouted, int leftAttach, int rightAttach,
+ int topAttach, int bottomAttach )
+{
+ TQValueList<TQDomElement> start;
+ TQValueList<TQDomElement> end;
+ TQValueList<TQDomElement>::ConstIterator e;
+
+ if ( layouted ) {
+ e = childWidgets.begin();
+ while ( e != childWidgets.end() ) {
+ if ( packEnd(*e) )
+ end.push_front( *e );
+ else
+ start.push_back( *e );
+ ++e;
+ }
+ } else {
+ start = childWidgets;
+ }
+
+ e = start.begin();
+ while ( e != start.end() ) {
+ emitWidget( *e, layouted, leftAttach, rightAttach, topAttach,
+ bottomAttach );
+ ++e;
+ }
+ e = end.begin();
+ while ( e != end.end() ) {
+ emitWidget( *e, layouted, leftAttach, rightAttach, topAttach,
+ bottomAttach );
+ ++e;
+ }
+}
+
+void Glade2Ui::emitOpeningWidget( const TQString& qtClass, int leftAttach,
+ int rightAttach, int topAttach,
+ int bottomAttach )
+{
+ AttributeMap attr = attribute( TQString("class"), qtClass );
+ attach( &attr, leftAttach, rightAttach, topAttach, bottomAttach );
+ emitOpening( TQString("widget"), attr );
+}
+
+/*
+ Returns TRUE if the vbox containing childWidgets should have a
+ spacer at the end to prevent it from looking bad, otherwise returns
+ FALSE.
+
+ The algorithm is very experimental.
+*/
+bool Glade2Ui::shouldPullup( const TQValueList<TQDomElement>& childWidgets )
+{
+ TQRegExp gtkSmallWidget( TQString(
+ "G.*(?:Button|Combo|Dial|Entry|Label|OptionMenu|Picker|ProgressBar"
+ "|Separator|tqStatusbar|Toolbar|VBox)") );
+
+ TQValueList<TQDomElement>::ConstIterator c = childWidgets.begin();
+ while ( c != childWidgets.end() ) {
+ TQValueList<TQDomElement> grandchildWidgets;
+ TQString gtkClass;
+
+ TQDomNode n = (*c).firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( tagName == TQString("class") ) {
+ gtkClass = getTextValue( n );
+ } else if ( tagName == TQString("widget") ) {
+ grandchildWidgets.push_back( n.toElement() );
+ }
+ n = n.nextSibling();
+ }
+
+ if ( !gtkSmallWidget.exactMatch(gtkClass) ||
+ !shouldPullup(grandchildWidgets) )
+ return FALSE;
+ ++c;
+ }
+ return TRUE;
+}
+
+TQString Glade2Ui::emitWidget( const TQDomElement& widget, bool layouted,
+ int leftAttach, int rightAttach, int topAttach,
+ int bottomAttach )
+{
+ TQRegExp gtkLayoutWidget( TQString(
+ "Gtk(?:Packer|Table|Toolbar|[HV](?:(?:Button)?Box))") );
+ TQRegExp gtkOrientedWidget( TQString(
+ "Gtk([HV])(?:Paned|Scale|Scrollbar|Separator)") );
+
+ TQValueList<TQDomElement> childWidgets;
+ TQString gtkClass;
+ TQString name;
+ TQString title;
+ int x = 0;
+ int y = 0;
+ int width = 0;
+ int height = 0;
+ int numRows = 0;
+ int numColumns = 0;
+
+ bool active = FALSE;
+ TQString authors;
+ TQString childName;
+ TQString comments;
+ TQString copyright;
+ TQString creationFunction;
+ bool editable = TRUE;
+ TQString filename;
+ TQString focusTarget;
+ TQString hscrollbarPolicy;
+ TQString icon;
+ int initialChoice = 0;
+ TQStringList items;
+ TQString justify;
+ TQString label;
+ TQString logoImage;
+ int lower = -123456789;
+ int page = 10;
+ int pageSize = 10;
+ TQString selectionMode;
+ TQString shadowType( "GTK_SHADOW_NONE" );
+ bool showText = TRUE;
+ bool showTitles = TRUE;
+ int step = 1;
+ TQString tabPos;
+ TQString text;
+ int textMaxLength = 0;
+ bool textVisible = TRUE;
+ TQString tooltip;
+ TQString type;
+ int upper = 123456789;
+ int value = 123456789;
+ bool valueInList = TRUE;
+ TQString vscrollbarPolicy;
+ TQString watermarkImage;
+ bool wrap = FALSE;
+
+ bool topLevel = yyFormName.isEmpty();
+ if ( topLevel )
+ name = TQString( "Form%1" ).arg( uniqueForm++ );
+
+ TQDomNode n = widget.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+ if ( !tagName.isEmpty() ) {
+ /*
+ Recognize the properties and stores them in variables.
+ This step is a bit silly, and if this function were to
+ be rewritten, almost everything would just be stored, as
+ strings, in a giant map, and looked up for when emitting
+ the properties.
+ */
+ switch ( (uchar) tagName[0].cell() ) {
+ case 'a':
+ if ( tagName == TQString("active") ) {
+ active = isTrue( getTextValue(n) );
+ } else if ( tagName == TQString("authors") ) {
+ authors = getTextValue( n );
+ }
+ break;
+ case 'c':
+ if ( tagName == TQString("child") ) {
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ TQString childTagName = child.toElement().tagName();
+ if ( childTagName == TQString("left_attach") ) {
+ leftAttach = getTextValue( child ).toInt();
+ } else if ( childTagName == TQString("right_attach") ) {
+ rightAttach = getTextValue( child ).toInt();
+ } else if ( childTagName == TQString("top_attach") ) {
+ topAttach = getTextValue( child ).toInt();
+ } else if ( childTagName == TQString("bottom_attach") ) {
+ bottomAttach = getTextValue( child ).toInt();
+ }
+ child = child.nextSibling();
+ }
+ } else if ( tagName == TQString("child_name") ) {
+ childName = getTextValue( n );
+ } else if ( tagName == TQString("class") ) {
+ gtkClass = getTextValue( n );
+ } else if ( tagName == TQString("climb_rate") ) {
+ step = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("columns") ) {
+ numColumns = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("comments") ) {
+ comments = getTextValue( n );
+ } else if ( tagName == TQString("copyright") ) {
+ copyright = getTextValue( n );
+ } else if ( tagName == TQString("creation_function") ) {
+ creationFunction = getTextValue( n );
+ }
+ break;
+ case 'd':
+ if ( tagName == TQString("default_focus_target") ) {
+ if ( focusTarget.isEmpty() )
+ focusTarget = getTextValue( n );
+ }
+ break;
+ case 'e':
+ if ( tagName == TQString("editable") )
+ editable = isTrue( getTextValue(n) );
+ break;
+ case 'f':
+ if ( tagName == TQString("filename") ) {
+ filename = getTextValue( n );
+ } else if ( tagName == TQString("focus_target") ) {
+ focusTarget = getTextValue( n );
+ }
+ break;
+ case 'h':
+ if ( tagName == TQString("height") ) {
+ height = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("hscrollbar_policy") ) {
+ hscrollbarPolicy = getTextValue( n );
+ }
+ break;
+ case 'i':
+ if ( tagName == TQString("icon") ) {
+ icon = getTextValue( n );
+ } else if ( tagName == TQString("initial_choice") ) {
+ initialChoice = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("items") ) {
+ items = TQStringList::split( TQChar('\n'), getTextValue(n) );
+ }
+ break;
+ case 'j':
+ if ( tagName == TQString("justify") )
+ justify = getTextValue( n );
+ break;
+ case 'l':
+ if ( tagName == TQString("label") ) {
+ label = getTextValue( n );
+ } else if ( tagName == TQString("logo_image") ) {
+ logoImage = getTextValue( n );
+ } else if ( tagName == TQString("lower") ) {
+ lower = getTextValue( n ).toInt();
+ }
+ break;
+ case 'n':
+ if ( tagName == TQString("name") )
+ name = getTextValue( n );
+ break;
+ case 'p':
+ if ( tagName == TQString("page") ) {
+ page = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("page_size") ) {
+ pageSize = getTextValue( n ).toInt();
+ }
+ break;
+ case 'r':
+ if ( tagName == TQString("rows") )
+ numRows = getTextValue( n ).toInt();
+ break;
+ case 's':
+ if ( tagName == TQString("selection_mode") ) {
+ selectionMode = getTextValue( n );
+ } else if ( tagName == TQString("shadow_type") ) {
+ shadowType = getTextValue( n );
+ } else if ( tagName == TQString("show_text") ) {
+ showText = isTrue( getTextValue(n) );
+ } else if ( tagName == TQString(TQString("show_titles")) ) {
+ showTitles = isTrue( getTextValue(n) );
+ } else if ( tagName == TQString("step") ) {
+ step = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("stock_button") ) {
+ /*
+ Let's cheat: We convert the symbolic name into a
+ button label.
+ */
+ label = getTextValue( n );
+ int k = label.tqfindRev( TQChar('_') );
+ if ( k != -1 )
+ label = label.mid( k + 1 );
+ if ( !label.isEmpty() && label != TQString("OK") )
+ label = label.left( 1 ) + label.mid( 1 ).lower();
+ }
+ break;
+ case 't':
+ if ( tagName == TQString("tab_pos") ) {
+ tabPos = getTextValue( n );
+ } else if ( tagName == TQString("text") ) {
+ text = getTextValue( n );
+ } else if ( tagName == TQString("textMaxLength") ) {
+ textMaxLength = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("textVisible") ) {
+ textVisible = isTrue( getTextValue(n) );
+ } else if ( tagName == TQString("title") ) {
+ title = getTextValue( n );
+ } else if ( tagName == TQString("tooltip") ) {
+ tooltip = getTextValue( n );
+ } else if ( tagName == TQString("type") ) {
+ type = getTextValue( n );
+ }
+ break;
+ case 'u':
+ if ( tagName == TQString("upper") )
+ upper = getTextValue( n ).toInt();
+ break;
+ case 'v':
+ if ( tagName == TQString("value") ) {
+ value = getTextValue( n ).toInt();
+ } else if ( tagName == TQString("value_in_list") ) {
+ valueInList = isTrue( getTextValue(n) );
+ } else if ( tagName == TQString("vscrollbar_policy") ) {
+ vscrollbarPolicy = getTextValue( n );
+ }
+ break;
+ case 'w':
+ if ( tagName == TQString("watermark_image") ) {
+ watermarkImage = getTextValue( n );
+ } else if ( tagName == TQString("widget") )
+ childWidgets.push_back( n.toElement() );
+ else if ( tagName == TQString("width") )
+ width = getTextValue( n ).toInt();
+ else if ( tagName == TQString("wrap") )
+ wrap = isTrue( getTextValue(n) );
+ break;
+ case 'x':
+ if ( tagName == TQString("x") )
+ x = getTextValue( n ).toInt();
+ break;
+ case 'y':
+ if ( tagName == TQString("y") )
+ y = getTextValue( n ).toInt();
+ }
+ }
+ n = n.nextSibling();
+ }
+
+ if ( topLevel ) {
+ yyFormName = name;
+ emitSimpleValue( TQString("class"), yyFormName );
+ }
+
+ if ( gtkLayoutWidget.exactMatch(gtkClass) ) {
+ TQString boxKind;
+ TQString orientation;
+
+ if ( gtkClass.startsWith(TQString("GtkH")) ||
+ gtkClass == TQString(TQString("GtkToolbar")) ) {
+ /*
+ GtkToolbar, right. Toolbars may appear anywhere in a
+ widget, but then they really are just a row of buttons.
+ */
+ boxKind = TQString( "hbox" );
+ orientation = TQString( "Horizontal" );
+ } else if ( gtkClass.startsWith(TQString("GtkV")) ||
+ gtkClass == TQString("GtkPacker") ) {
+ /*
+ We don't support the GtkPacker, whose trails lead to
+ destruction.
+ */
+ boxKind = TQString( "vbox" );
+ orientation = TQString( "Vertical" );
+ } else {
+ boxKind = TQString( "grid" );
+ }
+
+ if ( layouted )
+ emitOpeningWidget( TQString("TQLayoutWidget"), leftAttach,
+ rightAttach, topAttach, bottomAttach );
+ emitOpening( boxKind );
+ emitProperty( TQString("name"), fixedName(name).latin1() );
+ if ( gtkClass == TQString("GtkHButtonBox") ||
+ childName == TQString("Dialog:action_area") )
+ emitSpacer( orientation );
+ emitChildWidgets( childWidgets, TRUE );
+
+ if ( gtkClass == TQString("GtkVButtonBox") ||
+ childName == TQString("Dialog:action_area") ||
+ (boxKind == TQString("vbox") && shouldPullup(childWidgets)) ) {
+ emitSpacer( orientation );
+ } else if ( boxKind == TQString("grid") && shouldPullup(childWidgets) ) {
+ emitSpacer( TQString("Vertical"), 0, numColumns, numRows,
+ numRows + 1 );
+ }
+
+ emitClosing( boxKind );
+ if ( layouted )
+ emitClosing( TQString("widget") );
+ } else if ( gtkClass == TQString("GtkFixed") && !layouted ) {
+ emitChildWidgets( childWidgets, FALSE );
+ /*
+ Placeholders in a grid are typically needless.
+ */
+ } else if ( !(leftAttach >= 0 && gtkClass == TQString("Placeholder")) ) {
+ bool needFakeLayout = ( !layouted && !topLevel && x == 0 && y == 0 &&
+ width == 0 && height == 0 );
+ TQString qtClass = gtk2qtClass( gtkClass, childWidgets );
+ bool unknown = FALSE;
+
+ if ( qtClass == TQString("TQFrame") && !label.isEmpty() ) {
+ qtClass = TQString( "TQButtonGroup" );
+ } else if ( qtClass == TQString("TQListView") && !showTitles &&
+ gtkClass.endsWith(TQString("List")) ) {
+ qtClass = TQString( "TQListBox" );
+ } else if ( qtClass == TQString("Custom") ) {
+ qtClass = creationFunction;
+ yyCustomWidgets.insert( qtClass, TQString() );
+ } else if ( qtClass == TQString("Unknown") ) {
+ qtClass = TQString( "TQLabel" );
+ unknown = TRUE;
+ }
+
+ if ( qtClass.isEmpty() ) {
+ emitChildWidgets( childWidgets, layouted, leftAttach, rightAttach,
+ topAttach, bottomAttach );
+ } else {
+ if ( needFakeLayout ) {
+ emitOpening( TQString("vbox") );
+ emitProperty( TQString("margin"), 11 );
+ }
+ emitOpeningWidget( qtClass, leftAttach, rightAttach, topAttach,
+ bottomAttach );
+
+ // grep 'elsewhere'
+ if ( gtkClass != TQString("GtkCombo") )
+ emitProperty( TQString("name"), fixedName(name).latin1() );
+ if ( !title.isEmpty() )
+ emitProperty( TQString("caption"), title );
+ if ( !layouted && (x != 0 || y != 0 || width != 0 || height != 0) )
+ emitProperty( TQString("geometry"), TQRect(x, y, width, height) );
+ if ( gtkClass == TQString("GtkToggleButton") ) {
+ emitProperty( TQString("toggleButton"), TQVariant(TRUE, 0) );
+ if ( active )
+ emitProperty( TQString("on"), TQVariant(TRUE, 0) );
+ } else {
+ if ( active )
+ emitProperty( TQString("checked"), TQVariant(TRUE, 0) );
+ }
+
+ if ( !editable )
+ emitProperty( TQString("readOnly"), TQVariant(TRUE, 0) );
+ if ( !focusTarget.isEmpty() )
+ emitProperty( TQString("buddy"),
+ fixedName(focusTarget).latin1() );
+ if ( !hscrollbarPolicy.isEmpty() )
+ emitProperty( TQString("hScrollBarMode"),
+ gtk2qtScrollBarMode(hscrollbarPolicy),
+ TQString("enum") );
+ if ( !vscrollbarPolicy.isEmpty() )
+ emitProperty( TQString("vScrollBarMode"),
+ gtk2qtScrollBarMode(vscrollbarPolicy),
+ TQString("enum") );
+ if ( !justify.isEmpty() ||
+ (wrap && gtkClass != TQString("GtkSpinButton")) ) {
+ TQStringList flags;
+ if ( wrap )
+ flags.push_back( TQString("WordBreak") );
+
+ if ( justify.endsWith(TQString("_CENTER")) ) {
+ flags.push_back( TQString("AlignCenter") );
+ } else {
+ if ( justify.endsWith(TQString("_RIGHT")) )
+ flags.push_back( TQString("AlignRight") );
+ flags.push_back( TQString("AlignVCenter") );
+ }
+
+ if ( !flags.isEmpty() )
+ emitProperty( TQString("tqalignment"), flags.join(TQChar('|')),
+ TQString("set") );
+ }
+ if ( !label.isEmpty() ) {
+ if ( gtkClass.endsWith(TQString("Frame")) ) {
+ emitProperty( TQString("title"), label );
+ } else {
+ emitProperty( TQString("text"), accelerate(label) );
+ }
+ }
+ if ( lower != -123456789 )
+ emitProperty( TQString("minValue"), lower );
+ if ( upper != 123456789 )
+ emitProperty( TQString("maxValue"), upper );
+ if ( value != 123456789 ) {
+ if ( gtkClass == TQString("GtkProgressBar") ) {
+ emitProperty( TQString("progress"), value );
+ } else {
+ emitProperty( TQString("value"), value );
+ }
+ }
+ if ( TQMAX(page, pageSize) != 10 &&
+ gtkClass.endsWith(TQString("Scrollbar")) )
+ emitProperty( TQString("pageStep"), TQMAX(page, pageSize) );
+ if ( !selectionMode.isEmpty() )
+ emitProperty( TQString("selectionMode"),
+ gtk2qtSelectionMode(selectionMode),
+ TQString("enum") );
+ if ( !shadowType.endsWith(TQString("_NONE")) ) {
+ TQString tqshape = shadowType.tqcontains( TQString("_ETCHED_") ) > 0 ?
+ TQString( "Box" ) : TQString( "WinPanel" );
+ TQString shadow = shadowType.endsWith( TQString("_IN") ) ?
+ TQString( "Sunken" ) : TQString( "Raised" );
+ emitProperty( TQString("frameShape"), tqshape, TQString("enum") );
+ emitProperty( TQString("frameShadow"), shadow, TQString("enum") );
+ }
+ if ( !showText )
+ emitProperty( TQString("percentageVisible"),
+ TQVariant(FALSE, 0) );
+ if ( step != 1 )
+ emitProperty( TQString("lineStep"), step );
+ if ( tabPos.endsWith(TQString("_BOTTOM")) ||
+ tabPos.endsWith(TQString("_RIGHT")) )
+ emitProperty( TQString("tabPosition"), TQString("Bottom") );
+ if ( !text.isEmpty() )
+ emitProperty( TQString("text"), text );
+ if ( textMaxLength != 0 )
+ emitProperty( TQString("maxLength"), textMaxLength );
+ if ( !textVisible )
+ emitProperty( TQString("echoMode"), TQString("Password"),
+ TQString("enum") );
+ if ( !tooltip.isEmpty() )
+ emitProperty( TQString("toolTip"), tooltip );
+ if ( !valueInList )
+ emitProperty( TQString("editable"), TQVariant(TRUE, 0) );
+ if ( wrap && gtkClass == TQString("GtkSpinButton") )
+ emitProperty( TQString("wrapping"), TQVariant(TRUE, 0) );
+
+ if ( gtkClass.endsWith(TQString("Tree")) ) {
+ emitProperty( TQString("rootIsDecorated"), TQVariant(TRUE, 0) );
+ } else if ( gtkOrientedWidget.exactMatch(gtkClass) ) {
+ TQString s = ( gtkOrientedWidget.cap(1) == TQChar('H') ) ?
+ TQString( "Horizontal" ) : TQString( "Vertical" );
+ emitProperty( TQString("orientation"), s, TQString("enum") );
+ }
+
+ if ( qtClass == TQString("TQListView") )
+ emitProperty( TQString("resizeMode"), TQString("AllColumns"),
+ TQString("enum") );
+
+ while ( !items.isEmpty() ) {
+ emitOpening( TQString("item") );
+ emitProperty( TQString("text"), items.first() );
+ emitClosing( TQString("item") );
+ items.remove( items.begin() );
+ }
+ if ( initialChoice != 0 )
+ emitProperty( TQString("currentItem"), initialChoice );
+
+ if ( !icon.isEmpty() )
+ emitProperty( TQString("pixmap"), imageName(icon),
+ TQString("pixmap") );
+
+ if ( gtkClass == TQString("GnomeAbout") ) {
+ emitGnomeAbout( copyright, authors, comments );
+ } else if ( gtkClass == TQString("GnomeApp") ) {
+ emitGnomeAppChildWidgetsPass1( childWidgets );
+ } else if ( gtkClass == TQString("GnomePropertyBox") ) {
+ emitOpening( TQString("vbox") );
+ emitChildWidgets( childWidgets, TRUE );
+ emitOpeningWidget( TQString("TQLayoutWidget") );
+ emitOpening( TQString("hbox") );
+ emitPushButton( TQString("&Help"), TQString("helpButton") );
+ emitSpacer( TQString("Horizontal") );
+ emitPushButton( TQString("&OK"), TQString("okButton") );
+ emitPushButton( TQString("&Apply"), TQString("applyButton") );
+ emitPushButton( TQString("&Close"), TQString("closeButton") );
+ emitClosing( TQString("hbox") );
+ emitClosing( TQString("widget") );
+ emitClosing( TQString("vbox") );
+ } else if ( gtkClass.endsWith(TQString("Button")) ) {
+ if ( label.isEmpty() )
+ emitGtkButtonChildWidgets( childWidgets );
+ } else if ( gtkClass == TQString("GtkCombo") ) {
+ emitGtkComboChildWidgets( childWidgets, items );
+ } else if ( gtkClass == TQString("GtkNotebook") ) {
+ emitGtkNotebookChildWidgets( childWidgets );
+ } else if ( gtkClass == TQString("GtkWindow") ) {
+ emitGtkWindowChildWidgets( childWidgets, qtClass );
+ } else if ( gtkClass == TQString("GtkScrolledWindow") ) {
+ emitGtkScrolledWindowChildWidgets( childWidgets, qtClass );
+ } else if ( qtClass == TQString("TQListView") ) {
+ emitTQListViewColumns( widget );
+ } else if ( unknown || gtkClass == TQString("Placeholder") ) {
+ TQString prefix;
+ if ( unknown )
+ prefix = gtkClass;
+ emitProperty( TQString("text"),
+ TQString("<font color=\"red\">%1<b>?</b></font>")
+ .arg(prefix) );
+ emitProperty( TQString("tqalignment"),
+ TQString("AlignAuto|AlignCenter"),
+ TQString("set") );
+ } else if ( qtClass != TQString("TQListBox") ) {
+ emitChildWidgets( childWidgets, FALSE );
+ }
+
+ emitClosing( TQString("widget") );
+ if ( needFakeLayout )
+ emitClosing( TQString("vbox") );
+ if ( gtkClass == TQString("GnomeApp") )
+ emitGnomeAppChildWidgetsPass2( childWidgets );
+ }
+ }
+ return name;
+}
+
+TQStringList Glade2Ui::convertGladeFile( const TQString& fileName )
+{
+ TQStringList outFileNames;
+
+ yyFileName = fileName;
+
+ TQDomDocument doc( TQString("GTK-Interface") );
+ TQFile f( fileName );
+ if ( !f.open(IO_ReadOnly) ) {
+ error( TQString("Cannot open file for reading.") );
+ return TQStringList();
+ }
+ if ( !doc.setContent(&f) ) {
+ error( TQString("File is not an XML file.") );
+ f.close();
+ return TQStringList();
+ }
+ f.close();
+
+ TQDomElement root = doc.documentElement();
+ if ( root.tagName() != TQString("GTK-Interface") ) {
+ error( TQString("File is not a Glade XML file.") );
+ return TQStringList();
+ }
+
+ int widgetNo = 0;
+ int numWidgets = 0;
+ TQDomNode n = root.firstChild();
+ while ( !n.isNull() ) {
+ if ( n.toElement().tagName() == TQString("widget") )
+ numWidgets++;
+ n = n.nextSibling();
+ }
+
+ TQProgressDialog fremskritt( TQString("Converting Glade files..."),
+ TQString("Abort Conversion"), numWidgets, 0,
+ "fremskritt", TRUE );
+
+ n = root.firstChild();
+ while ( !n.isNull() ) {
+ TQString tagName = n.toElement().tagName();
+
+ if ( tagName == TQString("project") ) {
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ TQString childTagName = child.toElement().tagName();
+ if ( childTagName == TQString("pixmaps_directory") ) {
+ yyPixmapDirectory = getTextValue( child );
+ } else if ( childTagName == TQString("program_name") ) {
+ yyProgramName = getTextValue( child );
+ }
+ child = child.nextSibling();
+ }
+ } else if ( tagName == TQString("widget") ) {
+ yyOut = TQString();
+ yyCustomWidgets.clear();
+ yyStockItemActions.clear();
+ yyActions.clear();
+ yyConnections.clear();
+ yySlots.clear();
+ yyFormName = TQString();
+ yyImages.clear();
+
+ uniqueAction = 1;
+ uniqueForm = 1;
+ uniqueMenuBar = 1;
+ uniqueSpacer = 1;
+ uniqueToolBar = 1;
+
+ emitHeader();
+ TQString name = emitWidget( n.toElement(), FALSE );
+
+ if ( !yyCustomWidgets.isEmpty() ) {
+ emitOpening( TQString("customwidgets") );
+
+ TQMap<TQString, TQString>::Iterator c = yyCustomWidgets.begin();
+ while ( c != yyCustomWidgets.end() ) {
+ emitOpening( TQString("customwidget") );
+ emitSimpleValue( TQString("class"), c.key() );
+ if ( !(*c).isEmpty() )
+ emitSimpleValue( TQString("header"), *c,
+ attribute(TQString("location"),
+ TQString("local")) );
+ emitClosing( TQString("customwidget") );
+ ++c;
+ }
+ emitClosing( TQString("customwidgets") );
+ }
+
+ if ( !yyActions.isEmpty() ) {
+ emitOpening( TQString("actions") );
+
+ TQMap<TQString, GladeAction>::Iterator a = yyActions.begin();
+ while ( a != yyActions.end() ) {
+ emitOpening( TQString("action") );
+ emitProperty( TQString("name"),
+ fixedName(a.key()).latin1() );
+ emitProperty( TQString("text"), (*a).text );
+ emitProperty( TQString("menuText"), (*a).menuText );
+ if ( (*a).toolTip )
+ emitProperty( TQString("toolTip"), (*a).toolTip );
+ if ( (*a).accel != 0 )
+ emitProperty( TQString("accel"), (*a).accel );
+ if ( !(*a).iconSet.isEmpty() )
+ emitProperty( TQString("iconSet"),
+ imageName((*a).iconSet),
+ TQString("iconset") );
+ emitClosing( TQString("action") );
+ ++a;
+ }
+ emitClosing( TQString("actions") );
+ }
+
+ if ( !yyImages.isEmpty() ) {
+ uint maxLength = 524288;
+ char *data = new char[maxLength];
+
+ TQString dir = yyFileName;
+ dir.truncate( dir.tqfindRev(TQChar('/')) + 1 );
+ dir += yyPixmapDirectory;
+
+ emitOpening( TQString("images") );
+
+ TQMap<TQString, TQString>::ConstIterator im = yyImages.begin();
+ while ( im != yyImages.end() ) {
+ uint length = 0;
+ const char *format = 0;
+
+ TQString fn = dir + TQChar( '/' ) + im.key();
+ TQFile f( fn );
+ if ( !f.open(IO_ReadOnly) ) {
+ error( TQString("Cannot open image '%1' for reading.")
+ .arg(fn) );
+ } else {
+ length = f.readBlock( data, maxLength );
+ f.at( 0 );
+ format = TQImageIO::imageFormat( &f );
+ f.close();
+ }
+ if ( format == 0 )
+ format = "XPM";
+
+ AttributeMap attr;
+ attr.insert( TQString("format"), TQString(format) );
+ attr.insert( TQString("length"), TQString::number(length) );
+
+ emitOpening( TQString("image"),
+ attribute(TQString("name"), *im) );
+ emitSimpleValue( TQString("data"), hexed(data, length),
+ attr );
+ emitClosing( TQString("image") );
+ ++im;
+ }
+ emitClosing( TQString("images") );
+ delete[] data;
+ }
+
+ if ( yyConnections.count() + yySlots.count() > 0 ) {
+ emitOpening( TQString("connections") );
+
+ TQValueList<GladeConnection>::Iterator c = yyConnections.begin();
+ while ( c != yyConnections.end() ) {
+ emitOpening( TQString("connection") );
+ emitSimpleValue( TQString("sender"), (*c).sender );
+ emitSimpleValue( TQString("signal"), (*c).signal );
+ emitSimpleValue( TQString("receiver"), yyFormName );
+ emitSimpleValue( TQString("slot"), (*c).slot );
+ emitClosing( TQString("connection") );
+ ++c;
+ }
+
+ TQMap<TQString, TQString>::Iterator s = yySlots.begin();
+ while ( s != yySlots.end() ) {
+ AttributeMap attr;
+ attr.insert( TQString("access"), *s );
+ attr.insert( TQString("language"), TQString("C++") );
+ attr.insert( TQString("returntype"), TQString("void") );
+ emitSimpleValue( TQString("slot"), s.key(), attr );
+ ++s;
+ }
+ emitClosing( TQString("connections") );
+ }
+ emitFooter();
+
+ TQString outFileName = fileName;
+ int k = outFileName.tqfindRev( "." );
+ if ( k != -1 )
+ outFileName.truncate( k );
+ if ( widgetNo != 0 )
+ outFileName += TQString::number( widgetNo + 1 );
+ outFileName += TQString( ".ui" );
+ FILE *out = fopen( outFileName.latin1(), "w" );
+ if ( out == 0 ) {
+ qWarning( "glade2ui: Could not open file '%s'",
+ outFileName.latin1() );
+ } else {
+ if ( !yyOut.isEmpty() )
+ fprintf( out, "%s", yyOut.latin1() );
+ fclose( out );
+ outFileNames.push_back( outFileName );
+ }
+ yyOut = TQString();
+ widgetNo++;
+
+ tqApp->processEvents();
+ if ( fremskritt.wasCancelled() )
+ break;
+ fremskritt.setProgress( widgetNo );
+ }
+ n = n.nextSibling();
+ }
+ return outFileNames;
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.h b/tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.h
new file mode 100644
index 0000000..5dc7635
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/glade/glade2ui.h
@@ -0,0 +1,169 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef GLADE2UI_H
+#define GLADE2UI_H
+
+#include <tqdom.h>
+#include <tqmap.h>
+#include <tqstring.h>
+#include <tqvariant.h>
+
+typedef TQMap<TQString, TQString> AttributeMap;
+
+struct GladeAction
+{
+ TQString text;
+ TQString menuText;
+ TQString toolTip;
+ int accel;
+ TQString iconSet;
+};
+
+struct GladeConnection
+{
+ TQString sender;
+ TQString signal;
+ TQString slot;
+};
+
+class Glade2Ui
+{
+public:
+ Glade2Ui();
+
+ TQStringList convertGladeFile( const TQString& fileName );
+
+private:
+ TQString imageName( const TQString& fileName );
+ TQString opening( const TQString& tag,
+ const AttributeMap& attr = AttributeMap() );
+ TQString closing( const TQString& tag );
+ TQString atom( const TQString& tag,
+ const AttributeMap& attr = AttributeMap() );
+ void error( const TQString& message );
+ void syntaxError();
+ TQString getTextValue( const TQDomNode& node );
+ void emitHeader();
+ void emitFooter();
+ void emitSimpleValue( const TQString& tag, const TQString& value,
+ const AttributeMap& attr = AttributeMap() );
+ void emitOpening( const TQString& tag,
+ const AttributeMap& attr = AttributeMap() );
+ void emitClosing( const TQString& tag );
+ void emitAtom( const TQString& tag,
+ const AttributeMap& attr = AttributeMap() );
+ void emitVariant( const TQVariant& val,
+ const TQString& stringType = "string" );
+ void emitProperty( const TQString& prop, const TQVariant& val,
+ const TQString& stringType = "string" );
+ void emitFontProperty( const TQString& prop, int pointSize, bool bold );
+ void emitAttribute( const TQString& prop, const TQVariant& val,
+ const TQString& stringType = "string" );
+ TQString gtk2qtClass( const TQString& gtkClass,
+ const TQValueList<TQDomElement>& childWidgets );
+
+ int matchAccelOnActivate( const TQDomElement& accel );
+ void emitGtkMenu( const TQDomElement& menu );
+ void emitGtkMenuBarChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets );
+ void emitGtkToolbarChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets );
+ void emitPushButton( const TQString& text, const TQString& name );
+ void attach( AttributeMap *attr, int leftAttach, int rightAttach,
+ int topAttach, int bottomAttach );
+ void emitSpacer( const TQString& orientation, int leftAttach = -1,
+ int rightAttach = -1, int topAttach = -1,
+ int bottomAttach = -1 );
+ void emitPixmap( const TQString& imageName, int leftAttach = -1,
+ int rightAttach = -1, int topAttach = -1,
+ int bottomAttach = -1 );
+ void emitGnomeAbout( TQString copyright, TQString authors, TQString comments );
+ void emitGnomeAppChildWidgetsPass1(
+ const TQValueList<TQDomElement>& childWidgets );
+ void doPass2( const TQValueList<TQDomElement>& childWidgets,
+ TQValueList<TQDomElement> *menuBar,
+ TQValueList<TQValueList<TQDomElement> > *toolBars );
+ void emitGnomeAppChildWidgetsPass2(
+ const TQValueList<TQDomElement>& childWidgets );
+ void emitGtkButtonChildWidgets( TQValueList<TQDomElement> childWidgets );
+ void emitGtkComboChildWidgets( const TQValueList<TQDomElement>& childWidgets,
+ const TQStringList& items );
+ void emitGtkNotebookChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets );
+ void emitTQListViewColumns( const TQDomElement& qlistview );
+ void emitGtkScrolledWindowChildWidgets(
+ const TQValueList<TQDomElement>& childWidgets,
+ const TQString& qtClass );
+ void emitGnomeDruidPage( const TQDomElement& druidPage );
+ void emitGtkWindowChildWidgets( const TQValueList<TQDomElement>& childWidgets,
+ const TQString& qtClass );
+ bool packEnd( const TQDomElement& widget );
+ void emitChildWidgets( const TQValueList<TQDomElement>& childWidgets,
+ bool layouted, int leftAttach = -1,
+ int rightAttach = -1, int topAttach = -1,
+ int bottomAttach = -1 );
+ void emitOpeningWidget( const TQString& qtClass, int leftAttach = -1,
+ int rightAttach = -1, int topAttach = -1,
+ int bottomAttach = -1 );
+ bool shouldPullup( const TQValueList<TQDomElement>& childWidgets );
+ TQString emitWidget( const TQDomElement& widget, bool layouted,
+ int leftAttach = -1, int rightAttach = -1,
+ int topAttach = -1, int bottomAttach = -1 );
+
+ TQString yyOut;
+ TQString yyIndentStr;
+ TQString yyFileName;
+ TQString yyProgramName;
+ TQString yyPixmapDirectory;
+ TQMap<TQString, TQString> yyClassNameMap;
+ TQMap<TQString, TQString> yyStockMap;
+ TQMap<TQString, int> yyKeyMap;
+ TQMap<TQString, TQString> yyCustomWidgets;
+ TQMap<TQString, TQString> yyStockItemActions;
+ TQMap<TQString, GladeAction> yyActions;
+ TQValueList<GladeConnection> yyConnections;
+ TQMap<TQString, TQString> yySlots;
+ TQString yyFormName;
+ TQMap<TQString, TQString> yyImages;
+
+ int numErrors;
+ int uniqueAction;
+ int uniqueForm;
+ int uniqueMenuBar;
+ int uniqueSpacer;
+ int uniqueToolBar;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/glade/main.cpp b/tqtinterface/qt4/tools/designer/plugins/glade/main.cpp
new file mode 100644
index 0000000..e729635
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/glade/main.cpp
@@ -0,0 +1,109 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <filterinterface.h>
+#include <tqapplication.h>
+
+#include "glade2ui.h"
+
+class GladeFilter : public ImportFilterInterface, public TQLibraryInterface
+{
+public:
+ GladeFilter();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface **iface );
+ TQ_REFCOUNT;
+
+ TQStringList featureList() const;
+ TQStringList import( const TQString& filter, const TQString& filename );
+
+ bool init();
+ void cleanup();
+ bool canUnload() const;
+
+};
+
+GladeFilter::GladeFilter()
+{
+}
+
+TQRESULT GladeFilter::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)(ImportFilterInterface*)this;
+ else if ( uuid == IID_TQFeatureList )
+ *iface = (TQFeatureListInterface*)this;
+ else if ( uuid == IID_ImportFilter )
+ *iface = (ImportFilterInterface*)this;
+ else if ( uuid == IID_TQLibrary )
+ *iface = (TQLibraryInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQStringList GladeFilter::featureList() const
+{
+ TQStringList list;
+ list << "Glade Files (*.glade)" ;
+ return list;
+}
+
+TQStringList GladeFilter::import( const TQString &, const TQString& filename )
+{
+ Glade2Ui g;
+ return g.convertGladeFile( filename );
+}
+
+bool GladeFilter::init()
+{
+ return TRUE;
+}
+
+void GladeFilter::cleanup()
+{
+}
+
+bool GladeFilter::canUnload() const
+{
+ return TRUE;
+}
+
+TQ_EXPORT_COMPONENT()
+{
+ TQ_CREATE_INSTANCE( GladeFilter )
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg.pro b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg.pro
new file mode 100644
index 0000000..d90d646
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg.pro
@@ -0,0 +1,11 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release plugin
+HEADERS = kdevdlg2ui.h
+SOURCES = main.cpp kdevdlg2ui.cpp
+DESTDIR = ../../../../plugins/designer
+TARGET = kdevdlgplugin
+INCLUDEPATH += ../../interfaces
+
+
+target.path += $$plugins.path/designer
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.cpp b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.cpp
new file mode 100644
index 0000000..0030ab8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.cpp
@@ -0,0 +1,524 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "kdevdlg2ui.h"
+#include <tqdir.h>
+#include <tqstring.h>
+#include <tqptrstack.h>
+
+/// some little helpers ///
+
+void KDEVDLG2UI::wi()
+{
+ for ( int i = 0; i < indentation; i++ )
+ *out << " ";
+}
+
+void KDEVDLG2UI::indent()
+{
+ indentation++;
+}
+
+void KDEVDLG2UI::undent()
+{
+ indentation--;
+}
+
+void KDEVDLG2UI::writeClass( const TQString& name )
+{
+ wi(); *out << "<class>" << name << "</class>" << endl;
+}
+
+void KDEVDLG2UI::writeWidgetStart( const TQString& qclass )
+{
+ wi(); *out << "<widget class=\"" << qclass << "\">" << endl;
+}
+
+void KDEVDLG2UI::writeWidgetEnd()
+{
+ wi(); *out << "</widget>" << endl;
+}
+
+void KDEVDLG2UI::writeCString( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<cstring>" << value << "</cstring>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeString( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<string>" << value << "</string>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeRect( const TQString& name, int x, int y, int w, int h )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<rect>" << endl; indent();
+ wi(); *out << "<x>" << x << "</x>" << endl;
+ wi(); *out << "<y>" << y << "</y>" << endl;
+ wi(); *out << "<width>" << w << "</width>" << endl;
+ wi(); *out << "<height>" << h << "</height>" << endl; undent();
+ wi(); *out << "</rect>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeFont( const TQString& family, int pointsize )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>font</name>" << endl;
+ wi(); *out << "<font>" << endl; indent();
+ wi(); *out << "<family>" << family << "</family>" << endl;
+ wi(); *out << "<pointsize>" << pointsize << "</pointsize>" << endl; undent();
+ wi(); *out << "</font>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeBool( const TQString& name, bool value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<bool>" << (value ? "true" : "false") << "</bool>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeNumber( const TQString& name, int value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<number>" << value << "</number>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeEnum( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<enum>" << value << "</enum>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeSet( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<set>" << value << "</set>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeItem( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<item>" << endl; indent();
+ writeString( name, value ); undent();
+ wi(); *out << "</item>" << endl;
+}
+
+void KDEVDLG2UI::writeColumn( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<column>" << endl; indent();
+ writeString( name, value ); undent();
+ wi(); *out << "</column>" << endl;
+}
+
+void KDEVDLG2UI::writeColor( const TQString& name, const TQString& value )
+{
+ int color = value.toInt();
+
+ int r = color & 0x00ff0000 >> 16;
+ int g = color & 0x0000ff00 >> 8;
+ int b = color & 0x000000ff;
+
+ wi(); *out << "<property>" << endl; indent(); //###FIX
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<color>" << endl; indent();
+ wi(); *out << "<red>" << r << "</red>" << endl;
+ wi(); *out << "<green>" << g << "</green>" << endl;
+ wi(); *out << "<blue>" << b << "</blue>" << endl; undent();
+ wi(); *out << "</color>" << endl;
+ wi(); *out << "</property>" << endl;
+}
+
+void KDEVDLG2UI::writeStyles( const TQStringList styles, bool isFrame )
+{
+ if ( isFrame ) {
+ bool defineFrame = FALSE;
+ TQString shadow = "NoFrame";
+ TQString tqshape = "StyledPanel";
+ int width = 2;
+ if ( styles.tqcontains( "WS_EX_STATICEDGE" ) ) {
+ shadow = "Plain";
+ width = 1;
+ defineFrame = TRUE;
+ }
+ if ( styles.tqcontains( "WS_EX_CLIENTEDGE" ) ) {
+ shadow = "Sunken";
+ defineFrame = TRUE;
+ }
+ if ( styles.tqcontains( "WS_EX_DLGMODALFRAME" ) ) {
+ shadow = "Raised";
+ defineFrame = TRUE;
+ }
+ if ( !styles.tqcontains( "WS_BORDER" ) ) {
+ tqshape = "NoFrame";
+ defineFrame = TRUE;
+ }
+
+ if ( defineFrame ) {
+ writeEnum( "frameShape", "StyledPanel" );
+ writeEnum( "frameShadow", shadow );
+ writeNumber( "lineWidth", width );
+ }
+ }
+
+ if ( styles.tqcontains("WS_DISABLED") )
+ writeBool("enabled", FALSE );
+ if ( styles.tqcontains("WS_EX_ACCEPTFILES") )
+ writeBool("acceptDrops", TRUE );
+ if ( styles.tqcontains("WS_EX_TRANSPARENT") )
+ writeBool("autoMask", TRUE );
+ if ( !styles.tqcontains("WS_TABSTOP") )
+ writeEnum("focusPolicy", "NoFocus");
+}
+
+/*!
+ Constructs a KDEVDLG2UI object
+*/
+
+KDEVDLG2UI::KDEVDLG2UI( TQTextStream* input, const TQString& name )
+{
+ className = name;
+ writeToFile = TRUE;
+ in = input;
+ indentation = 0;
+ out = 0;
+}
+
+/*!
+ Destructs the KDEVDLG2UI object
+*/
+
+KDEVDLG2UI::~KDEVDLG2UI()
+{
+}
+
+/*!
+ Parses the input stream and writes the output to files.
+*/
+
+bool KDEVDLG2UI::parse()
+{
+ TQFile fileOut;
+ TQString buffer;
+
+ if ( writeToFile ) {
+
+ TQString outputFile = TQString( className ) + ".ui";
+ fileOut.setName( outputFile );
+ if (!fileOut.open( IO_WriteOnly ) )
+ qFatal( "kdevdlg2ui: Could not open output file '%s'", outputFile.latin1() );
+ out = new TQTextStream( &fileOut );
+ targetFiles.append( outputFile );
+ } else {
+ out = new TQTextStream( &buffer, IO_WriteOnly );
+ }
+
+ writeDialog( className );
+
+ delete out;
+ out = 0;
+
+ return TRUE;
+}
+
+/*!
+ Parses the input stream and writes the output in \a get.
+*/
+bool KDEVDLG2UI::parse( TQStringList& get )
+{
+ writeToFile = FALSE;
+ bool result = parse();
+ get = target;
+ return result;
+}
+
+/*!
+ Replaces characters like '&', '<' and '>' with the proper encoding.
+*/
+void KDEVDLG2UI::cleanString( TQString * text )
+{
+ if ( !text ) return;
+ text->tqreplace( "\\n", "\n" );
+ text->tqreplace( "\\t", "\t" );
+ text->tqreplace( "&", "&amp;" );
+ text->tqreplace( "<", "&lt;" );
+ text->tqreplace( ">", "&gt;" );
+}
+
+/*!
+ Builds a number of UI dialog out of the current input stream
+*/
+bool KDEVDLG2UI::writeDialog( const TQString& name )
+{
+ *out << "<!DOCTYPE UI><UI>" << endl;
+ writeClass( name );
+
+ while ( !in->eof() ) {
+
+ line = in->readLine().simplifyWhiteSpace();
+
+ if ( line.left( 4 ) == "data" ) {
+ // ignore data section
+ while ( line.left( 1 ) != "}" && !in->eof() ) {
+ line = in->readLine();
+ }
+ } else if ( line.left( 4 ) == "item" ) {
+ writeWidgetStart( line.section( "//", 0, 0 ).section( " ", 1, 1 ) );
+ } else if ( line.left( 1 ) == "{" ) {
+ indent();
+ } else if ( line.left( 1 ) == "}" ) {
+ undent();
+ writeWidgetEnd();
+ } else if ( line.left( 4 ) == "Name" ) {
+ TQString name = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ writeString( "name", name );
+ } else if ( line.left( 4 ) == "Font" ) {
+ TQString font = line.section( "//", 0, 0 ).section( "\"", 1 );
+ TQString family = font.section("\"", 1, 1 );
+ int pointSize = font.section("\"", 3, 3 ).toInt();
+ //int weight = font.section("\"", 5, 5 ).toInt();
+ //bool italic = ( font.section("\"", 7, 7 ) == "TRUE" );
+ writeFont( family, pointSize ); // weight, italic ?
+ } else if ( line.left( 9 ) == "IsEnabled" ) {
+ bool isEnabled =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "enabled", isEnabled );
+ } else if ( line.left( 12 ) == "AcceptsDrops" ) {
+ bool acceptDrops =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "acceptDrops", acceptDrops );
+ } else if ( line.left( 12 ) == "isAutoResize" ) {
+ bool isAutoResize =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "autoResize", isAutoResize ); //###FIX: obsolete
+ } else if ( line.left( 12 ) == "isAutoRepeat" ) {
+ bool isAutoRepeat =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "autoRepeat", isAutoRepeat );
+ } else if ( line.left( 9 ) == "isDefault" ) {
+ bool isDefault =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "default", isDefault );
+ } else if ( line.left( 13 ) == "isAutoDefault" ) {
+ bool isAutoDefault =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "autoDefault", isAutoDefault );
+ } else if ( line.left( 14 ) == "isToggleButton" ) {
+ bool isToggleButton =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "toggleButton", isToggleButton );
+ } else if ( line.left( 11 ) == "isToggledOn" ) {
+ bool isToggledOn =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "on", isToggledOn );
+ } else if ( line.left( 8 ) == "hasFrame" ) {
+ bool hasFrame =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "frame", hasFrame );
+ } else if ( line.left( 10 ) == "isReadOnly" ) {
+ bool isReadOnly =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "readOnly", isReadOnly );
+ } else if ( line.left( 9 ) == "isChecked" ) {
+ bool isChecked =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "checked", isChecked );
+ } else if ( line.left( 16 ) == "isAutoCompletion" ) {
+ bool isAutoCompl =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "autoCompletion", isAutoCompl );
+ } else if ( line.left( 8 ) == "EditText" ) {
+ bool editText =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "editable", editText );
+ } else if ( line.left( 10 ) == "isTracking" ) {
+ bool isTracking =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "tracking", isTracking );
+ } else if ( line.left( 16 ) == "isMultiSelection" ) {
+ bool isMultiSel =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "multiSelection", isMultiSel );
+ } else if ( line.left( 21 ) == "isAllColumnsShowFocus" ) {
+ bool isAllColsShowFocus =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "allColumnsShowFocus", isAllColsShowFocus );
+ } else if ( line.left( 16 ) == "isRootDecorated" ) {
+ bool isRootDec =
+ ( line.section( "//", 0, 0 ).section("\"", 1, 1 ) == "true" );
+ writeBool( "rootIsDecorated", isRootDec );
+ } else if ( line.left( 1 ) == "X" ) {
+ int x = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ line = in->readLine().stripWhiteSpace();
+ int y = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ line = in->readLine().stripWhiteSpace();
+ int w = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ line = in->readLine().stripWhiteSpace();
+ int h = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeRect( "geometry", x, y, w, h );
+ } else if ( line.left( 8 ) == "MinWidth" ) {
+ int minw = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "minimumWidth", minw );
+ } else if ( line.left( 9 ) == "MinHeight" ) {
+ int minh = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "minimumHeight", minh );
+ } else if ( line.left( 8 ) == "MaxWidth" ) {
+ int maxw = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "maximumWidth", maxw );
+ } else if ( line.left( 9 ) == "MaxHeight" ) {
+ int maxh = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "maximumHeight", maxh );
+ } else if ( line.left( 4 ) == "Text" ) {
+ TQString text = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & text );
+ writeString( "text", text );
+ } else if ( line.left( 5 ) == "Title" ) {
+ TQString title = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & title );
+ writeString( "title", title );
+ } else if ( line.left( 5 ) == "Buddy" ) {
+ TQString buddy = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ writeString( "buddy", buddy );
+ } else if ( line.left( 14 ) == "SpecialValText" ) {
+ TQString text = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ writeString( "specialValueText", text );
+ } else if ( line.left( 6 ) == "Prefix" ) {
+ TQString text = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ writeString( "prefix", text );
+ } else if ( line.left( 6 ) == "Suffix" ) {
+ TQString text = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ writeString( "suffix", text );
+ } else if ( line.left( 5 ) == "Value" ) {
+ int v = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "value", v );
+ } else if ( line.left( 8 ) == "MinValue" ) {
+ int minv = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "minValue", minv );
+ } else if ( line.left( 8 ) == "MaxValue" ) {
+ int maxv = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "maxValue", maxv );
+ } else if ( line.left( 9 ) == "SizeLimit" ) {
+ int limit = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "sizeLimit", limit );
+ } else if ( line.left( 9 ) == "MaxLength" ) {
+ int maxl = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "maxLength", maxl );
+ } else if ( line.left( 8 ) == "MaxCount" ) {
+ int maxc = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "maxCount", maxc );
+ } else if ( line.left( 14 ) == "CursorPosition" ) {
+ int pos = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "cursorPosition", pos );
+ } else if ( line.left( 9 ) == "NumDigits" ) {
+ int digits = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "numDigits", digits );
+ } else if ( line.left( 10 ) == "TotalSteps" ) {
+ int steps = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "totalSteps", steps );
+ } else if ( line.left( 12 ) == "TreeStepSize" ) {
+ int stepSize = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "treeStepSize", stepSize );
+ } else if ( line.left( 10 ) == "ItemMargin" ) {
+ int margin = line.section( "//", 0, 0 ).section("\"", 1, 1 ).toInt();
+ writeNumber( "itemMargin", margin );
+ } else if ( line.left( 7 ) == "ToolTip" ) {
+ TQString text = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ writeString( "toolTip", text );
+ } else if ( line.left( 9 ) == "QuickHelp" ) {
+ TQString text = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & text );
+ writeString( "whatsThis", text );
+ } else if ( line.left( 15 ) == "InsertionPolicy" ) {
+ TQString policy = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & policy );
+ writeEnum( "insertionPolicy", policy ); //###FIX: TQComboBox::
+ } else if ( line.left( 11 ) == "Qt::Orientation" ) {
+ TQString orientation =
+ line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & orientation );
+ if ( orientation == "V" )
+ writeEnum( "orientation", "Qt::Vertical" );
+ else if ( orientation == "H" )
+ writeEnum( "orientation", "Qt::Horizontal" );
+ } else if ( line.left( 14 ) == "vScrollBarMode" ) {
+ TQString mode = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & mode );
+ writeEnum( "vScrollBarMode", mode );
+ } else if ( line.left( 14 ) == "hScrollBarMode" ) {
+ TQString mode = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & mode );
+ writeEnum( "hScrollBarMode", mode );
+ } else if ( line.left( 7 ) == "Entries" ) {
+ TQString entries = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & entries );
+ TQStringList l = TQStringList::split( '\n', entries );
+ for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it )
+ writeItem( "text", *it );
+ } else if ( line.left( 7 ) == "Columns" ) {
+ TQString columns = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & columns );
+ TQStringList l = TQStringList::split( '\n', columns );
+ for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it )
+ writeColumn( "text", *it );
+ } else if ( line.left( 6 ) == "BgMode" ) {
+ TQString mode = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & mode );
+ writeString( "backgroundMode", mode ); //###FIX: TQWidget:::
+ } else if ( line.left( 10 ) == "BgPalColor" ) {
+ TQString color = line.section( "//", 0, 0 ).section("\"", 1, 1 );
+ cleanString( & color );
+ writeColor( "paletteBackgroundColor", color );
+ } //else {
+ //if ( line.length() )
+ //qDebug( "IGNORED: %s", line.latin1() );
+ //}
+ }
+ *out << "</UI>" << endl;
+ return TRUE;
+}
+
diff --git a/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.h b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.h
new file mode 100644
index 0000000..c25f7ef
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/kdevdlg2ui.h
@@ -0,0 +1,90 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef KDEVDLG2UI_H
+#define KDEVDLG2UI_H
+
+#include <tqtextstream.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+
+class KDEVDLG2UI
+{
+public:
+ KDEVDLG2UI( TQTextStream* input, const TQString& name = "dialog" );
+ ~KDEVDLG2UI();
+
+ bool parse();
+ bool parse ( TQStringList& get );
+
+ TQStringList targetFiles;
+
+protected:
+
+ bool writeDialog( const TQString& name );
+
+ TQString className;
+ TQString line;
+ TQTextStream *in;
+ TQStringList target;
+
+ void cleanString( TQString* text );
+
+ void indent();
+ void undent();
+ void wi();
+
+ void writeClass( const TQString& name );
+ void writeCString( const TQString& name, const TQString& value );
+ void writeString( const TQString& name, const TQString& value );
+ void writeRect( const TQString& name, int x, int y, int w, int h );
+ void writeFont( const TQString& family, int pointsize );
+ void writeBool( const TQString& name, bool value );
+ void writeNumber( const TQString& name, int value );
+ void writeEnum( const TQString& name, const TQString& value );
+ void writeSet( const TQString& name, const TQString& value );
+ void writeItem( const TQString& name, const TQString& value );
+ void writeColumn( const TQString& name, const TQString& value );
+ void writeColor( const TQString& name, const TQString& value );
+ void writeStyles( const TQStringList styles, bool isFrame );
+ void writeWidgetStart( const TQString& qclass );
+ void writeWidgetEnd();
+
+private:
+ int indentation;
+ bool writeToFile;
+ TQTextStream* out;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/kdevdlg/main.cpp b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/main.cpp
new file mode 100644
index 0000000..9ecac6e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/kdevdlg/main.cpp
@@ -0,0 +1,120 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <filterinterface.h>
+
+#include <tqapplication.h>
+#include <tqstring.h>
+#include <tqdir.h>
+
+#include "kdevdlg2ui.h"
+
+class KDevDlgFilter : public ImportFilterInterface, public TQLibraryInterface
+{
+public:
+ KDevDlgFilter();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface **iface );
+ TQ_REFCOUNT;
+
+ TQStringList featureList() const;
+ TQStringList import( const TQString& filter, const TQString& filename );
+
+ bool init();
+ void cleanup();
+ bool canUnload() const;
+};
+
+KDevDlgFilter::KDevDlgFilter()
+{
+}
+
+TQRESULT KDevDlgFilter::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)(ImportFilterInterface*)this;
+ else if ( uuid == IID_TQFeatureList )
+ *iface = (TQFeatureListInterface*)this;
+ else if ( uuid == IID_ImportFilter )
+ *iface = (ImportFilterInterface*)this;
+ else if ( uuid == IID_TQLibrary )
+ *iface = (TQLibraryInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQStringList KDevDlgFilter::featureList() const
+{
+ TQStringList list;
+ list << "KDevelop Dialog Files (*.kdevdlg)" ;
+ return list;
+}
+
+TQStringList KDevDlgFilter::import( const TQString &, const TQString& filename )
+{
+ TQFile file( filename );
+ if ( !file.open( IO_ReadOnly ) )
+ qWarning( "uic: Could not open file '%s' ", filename.latin1() );
+ TQTextStream in;
+ in.setDevice( &file );
+
+ TQString name = filename.right( filename.length() - filename.tqfindRev( TQDir::separator() ) - 1 ).section( ".", 0, 0 );
+ KDEVDLG2UI c( &in, name );
+ TQStringList files;
+ c.parse();
+ return c.targetFiles;
+}
+
+bool KDevDlgFilter::init()
+{
+ return TRUE;
+}
+
+void KDevDlgFilter::cleanup()
+{
+}
+
+bool KDevDlgFilter::canUnload() const
+{
+ return TRUE;
+}
+
+TQ_EXPORT_COMPONENT()
+{
+ TQ_CREATE_INSTANCE( KDevDlgFilter )
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/plugins.pro b/tqtinterface/qt4/tools/designer/plugins/plugins.pro
new file mode 100644
index 0000000..355f5d0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/plugins.pro
@@ -0,0 +1,9 @@
+TEMPLATE = subdirs
+PLUGIN_DIRS = wizards \
+ cppeditor \
+ dlg \
+ glade \
+ rc \
+ kdevdlg
+shared:SUBDIRS *= $$PLUGIN_DIRS
+dll:SUBDIRS *= $$PLUGIN_DIRS
diff --git a/tqtinterface/qt4/tools/designer/plugins/rc/main.cpp b/tqtinterface/qt4/tools/designer/plugins/rc/main.cpp
new file mode 100644
index 0000000..7abd623
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/rc/main.cpp
@@ -0,0 +1,117 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <filterinterface.h>
+
+#include <tqapplication.h>
+
+#include "rc2ui.h"
+
+class RCFilter : public ImportFilterInterface, public TQLibraryInterface
+{
+public:
+ RCFilter();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface **iface );
+ TQ_REFCOUNT;
+
+ TQStringList featureList() const;
+ TQStringList import( const TQString& filter, const TQString& filename );
+
+ bool init();
+ void cleanup();
+ bool canUnload() const;
+};
+
+RCFilter::RCFilter()
+{
+}
+
+TQRESULT RCFilter::queryInterface( const TQUuid &uuid, TQUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)(ImportFilterInterface*)this;
+ else if ( uuid == IID_TQFeatureList )
+ *iface = (TQFeatureListInterface*)this;
+ else if ( uuid == IID_ImportFilter )
+ *iface = (ImportFilterInterface*)this;
+ else if ( uuid == IID_TQLibrary )
+ *iface = (TQLibraryInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQStringList RCFilter::featureList() const
+{
+ TQStringList list;
+ list << "Microsoft Resource Files (*.rc)" ;
+ return list;
+}
+
+TQStringList RCFilter::import( const TQString &, const TQString& filename )
+{
+ TQFile file( filename );
+ if ( !file.open( IO_ReadOnly ) )
+ qWarning( "uic: Could not open file '%s' ", filename.latin1() );
+ TQTextStream in;
+ in.setDevice( &file );
+
+ RC2UI c( &in );
+ TQStringList files;
+ c.parse();
+ return c.targetFiles;
+}
+
+bool RCFilter::init()
+{
+ return TRUE;
+}
+
+void RCFilter::cleanup()
+{
+}
+
+bool RCFilter::canUnload() const
+{
+ return TRUE;
+}
+
+TQ_EXPORT_COMPONENT()
+{
+ TQ_CREATE_INSTANCE( RCFilter )
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/rc/rc.pro b/tqtinterface/qt4/tools/designer/plugins/rc/rc.pro
new file mode 100644
index 0000000..27ad444
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/rc/rc.pro
@@ -0,0 +1,11 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release plugin
+HEADERS = rc2ui.h
+SOURCES = main.cpp rc2ui.cpp
+DESTDIR = ../../../../plugins/designer
+TARGET = rcplugin
+INCLUDEPATH += ../../interfaces
+
+
+target.path += $$plugins.path/designer
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.cpp b/tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.cpp
new file mode 100644
index 0000000..a9e87b0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.cpp
@@ -0,0 +1,888 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "rc2ui.h"
+#include <tqdir.h>
+
+/// some little helpers ///
+
+void RC2UI::wi()
+{
+ for ( int i = 0; i < indentation; i++ )
+ *out << " ";
+}
+
+void RC2UI::indent()
+{
+ indentation++;
+}
+
+void RC2UI::undent()
+{
+ indentation--;
+}
+
+TQString RC2UI::stripQM( const TQString& string )
+{
+ return string.mid( 1, string.length()-2 );
+}
+
+TQStringList RC2UI::splitStyles( const TQString& styles, char sep )
+{
+ TQString s = styles;
+ TQString style;
+ TQStringList l;
+ while ( s.tqfind( sep ) > -1 ) {
+ style = s.left( s.tqfind( sep ) );
+ l << style.stripWhiteSpace();
+ s = s.right( s.length() - style.length() -1 );
+ }
+ if ( !s.isEmpty() )
+ l << s.stripWhiteSpace();
+ return l;
+}
+
+TQString RC2UI::parseNext( TQString& arg, char sep )
+{
+ TQString next = arg.left( arg.tqfind(sep) );
+ arg = arg.right( arg.length() - next.length() - 1 );
+ return next;
+}
+
+void RC2UI::writeClass( const TQString& name )
+{
+ wi(); *out << "<class>" << name << "</class>" << endl;
+}
+
+void RC2UI::writeCString( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<cstring>" << value << "</cstring>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeString( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<string>" << value << "</string>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeRect( const TQString& name, int x, int y, int w, int h )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<rect>" << endl; indent();
+ wi(); *out << "<x>" << int(double(x)*1.5) << "</x>" << endl;
+ wi(); *out << "<y>" << int(double(y)*1.65) << "</y>" << endl;
+ wi(); *out << "<width>" << int(double(w)*1.5) << "</width>" << endl;
+ wi(); *out << "<height>" << int(double(h)*1.65) << "</height>" << endl; undent();
+ wi(); *out << "</rect>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeFont( const TQString& family, int pointsize )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>font</name>" << endl;
+ wi(); *out << "<font>" << endl; indent();
+ wi(); *out << "<family>" << family << "</family>" << endl;
+ wi(); *out << "<pointsize>" << pointsize << "</pointsize>" << endl; undent();
+ wi(); *out << "</font>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeBool( const TQString& name, bool value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<bool>" << (value ? "true" : "false") << "</bool>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeNumber( const TQString& name, int value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<number>" << value << "</number>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeEnum( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<enum>" << value << "</enum>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeSet( const TQString& name, const TQString& value )
+{
+ wi(); *out << "<property>" << endl; indent();
+ wi(); *out << "<name>" << name << "</name>" << endl;
+ wi(); *out << "<set>" << value << "</set>" << endl; undent();
+ wi(); *out << "</property>" << endl;
+}
+
+void RC2UI::writeStyles( const TQStringList styles, bool isFrame )
+{
+ if ( isFrame ) {
+ bool defineFrame = FALSE;
+ TQString shadow = "NoFrame";
+ TQString tqshape = "StyledPanel";
+ int width = 2;
+ if ( styles.tqcontains( "WS_EX_STATICEDGE" ) ) {
+ shadow = "Plain";
+ width = 1;
+ defineFrame = TRUE;
+ }
+ if ( styles.tqcontains( "WS_EX_CLIENTEDGE" ) ) {
+ shadow = "Sunken";
+ defineFrame = TRUE;
+ }
+ if ( styles.tqcontains( "WS_EX_DLGMODALFRAME" ) ) {
+ shadow = "Raised";
+ defineFrame = TRUE;
+ }
+ if ( !styles.tqcontains( "WS_BORDER" ) ) {
+ tqshape = "NoFrame";
+ defineFrame = TRUE;
+ }
+
+ if ( defineFrame ) {
+ writeEnum( "frameShape", "StyledPanel" );
+ writeEnum( "frameShadow", shadow );
+ writeNumber( "lineWidth", width );
+ }
+ }
+
+ if ( styles.tqcontains("WS_DISABLED") )
+ writeBool("enabled", FALSE );
+ if ( styles.tqcontains("WS_EX_ACCEPTFILES") )
+ writeBool("acceptDrops", TRUE );
+ if ( styles.tqcontains("WS_EX_TRANSPARENT") )
+ writeBool("autoMask", TRUE );
+ if ( !styles.tqcontains("WS_TABSTOP") )
+ writeEnum("focusPolicy", "NoFocus");
+}
+
+/*!
+ Constructs a RC2UI object
+*/
+
+RC2UI::RC2UI( TQTextStream* input )
+: blockStart1( "/////////////////////////////////////////////////////////////////////////////" ),
+ blockStart2( "//" )
+{
+ writeToFile = TRUE;
+ in = input;
+ indentation = 0;
+ out = 0;
+}
+
+/*!
+ Destructs the RC2UI object
+*/
+
+RC2UI::~RC2UI()
+{
+}
+
+/*!
+ Parses the input stream and writes the output to files.
+*/
+
+bool RC2UI::parse()
+{
+ while ( !in->eof() ) {
+ while ( line != blockStart1 && !in->eof() )
+ line = in->readLine();
+ if ( in->eof() )
+ return FALSE;
+ while ( line != blockStart2 && !in->eof() )
+ line = in->readLine();
+ if ( in->eof() )
+ return FALSE;
+
+ line = in->readLine();
+
+ if ( line.left(3) == "// " && !in->eof() ) {
+ TQString type = line.right( line.length() - 3 );
+ if ( in->readLine() == "//" && in->readLine().isEmpty() && !in->eof() ) {
+ if ( type == "Dialog" ) {
+ if ( !makeDialog() )
+ return FALSE;
+ }
+/*
+ else if ( type == "Bitmap" ) {
+ if ( !makeBitmap() )
+ return FALSE;
+ } else if ( type == "String Table" ) {
+ if ( !makeStringTable() )
+ return FALSE;
+ } else if ( type == "Accelerator" ) {
+ if ( !makeAccelerator() )
+ return FALSE;
+ } else if ( type == "Cursor" ) {
+ if ( !makeCursor() )
+ return FALSE;
+ } else if ( type == "HTML" ) {
+ if ( !makeHTML() )
+ return FALSE;
+ } else if ( type == "Icon" ) {
+ if ( !makeIcon() )
+ return FALSE;
+ } else if ( type == "Version" ) {
+ if ( !makeVersion() )
+ return FALSE;
+ }
+*/
+ }
+ } else
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*!
+ Parses the input stream and writes the output in \a get.
+*/
+
+bool RC2UI::parse( TQStringList& get )
+{
+ writeToFile = FALSE;
+ bool result = parse();
+ get = target;
+ return result;
+}
+
+/*!
+ Retrieves a unique name starting with \a start
+*/
+TQString RC2UI::useName( const TQString& start )
+{
+ TQString name = start;
+ int id = 1;
+
+ while ( usedNames.tqcontains( name ) ) {
+ name = start + TQString( "%1" ).arg( id );
+ id++;
+ }
+
+ usedNames.append(name);
+
+ return name;
+}
+
+
+/*!
+ Builds a number of UI dialog out of the current input stream
+*/
+
+bool RC2UI::makeDialog()
+{
+ line = in->readLine();
+ do {
+ TQFile fileOut;
+ TQString buffer;
+ int count;
+ TQCString className;
+ uint x, y, w, h;
+ uint endDesc;
+ bool space = FALSE;
+ for ( endDesc = 0; endDesc < line.length() ; endDesc++ ) {
+ char c = (TQChar)line.at(endDesc);
+ if ( space && (c >= '0') && (c <= '9') )
+ break;
+ space = c==' ';
+ }
+
+ TQString desc = line.left(endDesc-1);
+ line = line.right( line.length() - endDesc );
+
+ className = parseNext( desc, ' ' );
+
+ count = sscanf( line, "%u, %u, %u, %u", &x, &y, &w, &h );
+
+ if ( !count && count == EOF )
+ return FALSE;
+
+ char property[256];
+ TQStringList styles;
+ TQStringList extendedStyles;
+ TQString caption = "";
+ TQString baseClass = "";
+ TQString widgetType;
+ TQString widgetName;
+ TQString arguments;
+ int pointsize = 10;
+ TQString fontname;
+ do {
+ line = "";
+ do {
+ if ( in->eof() )
+ return TRUE;
+ line += in->readLine();
+ } while ( line[(int)line.length()-1] == '|' ||
+ line[(int)line.length()-1] == ',' );
+ count = sscanf( line, "%s", property );
+ line = line.right( line.length() - line.tqfind(" ") -1 );
+ if ( TQString(property) == "STYLE" ) {
+ styles = splitStyles(line);
+ if ( styles.tqcontains( "WS_CAPTION" ) )
+ baseClass = "TQDialog";
+ else
+ baseClass = "TQWidget";
+ } else if ( TQString(property) == "CAPTION" ) {
+ caption = stripQM( line );
+ } else if ( TQString(property) == "FONT" ) {
+ TQString pt = line.left( line.tqfind(",") );
+ pointsize = pt.toInt();
+ fontname = stripQM(line.right( line.length() - line.tqfind(",") - 2 ));
+ }
+ } while ( line != "BEGIN" );
+
+ if ( writeToFile ) {
+
+ TQString outputFile = TQString(className) + ".ui";
+ fileOut.setName( outputFile );
+ if (!fileOut.open( IO_WriteOnly ) )
+ qFatal( "rc2ui: Could not open output file '%s'", outputFile.latin1() );
+ out = new TQTextStream( &fileOut );
+ targetFiles.append( outputFile );
+ } else {
+ out = new TQTextStream( &buffer, IO_WriteOnly );
+ }
+
+ *out << "<!DOCTYPE UI><UI>" << endl;
+ writeClass( className );
+ wi(); *out << "<widget>"<< endl; indent();
+ writeClass( baseClass );
+ writeCString( "name", className );
+ writeRect( "geometry", x, y, w, h );
+ writeString( "caption", caption );
+ writeFont( fontname, pointsize );
+
+ do {
+ if ( in->eof() )
+ return TRUE;
+
+ line = in->readLine().stripWhiteSpace();
+ if ( line == "END" )
+ continue;
+
+ widgetType = parseNext(line, ' ');
+ arguments = line.stripWhiteSpace();
+ while ( arguments[(int)arguments.length()-1] == ',' ||
+ arguments[(int)arguments.length()-1] == '|' )
+ arguments += " "+in->readLine().stripWhiteSpace();
+
+ wi(); *out << "<widget>" << endl; indent();
+
+ WidgetType ID = IDUnknown;
+ TQString controlType;
+ TQString widgetID;
+ TQString widgetText;
+ bool hasText = FALSE;
+ bool isControl = FALSE;
+ bool isFrame = FALSE;
+
+ if ( widgetType == "PUSHBUTTON" ) {
+ ID = IDPushButton;
+ hasText = TRUE;
+ } else if ( widgetType == "DEFPUSHBUTTON" ) {
+ ID = IDPushButton;
+ hasText = TRUE;
+ } else if ( widgetType == "LTEXT" ) {
+ ID = IDLabel;
+ hasText = TRUE;
+ } else if ( widgetType == "CTEXT" ) {
+ ID = IDLabel;
+ hasText = TRUE;
+ } else if ( widgetType == "RTEXT" ) {
+ ID = IDLabel;
+ hasText = TRUE;
+ } else if ( widgetType == "EDITTEXT" ) {
+ ID = IDLineEdit;
+ } else if ( widgetType == "GROUPBOX" ) {
+ ID = IDGroupBox;
+ hasText = TRUE;
+ } else if ( widgetType == "COMBOBOX" ) {
+ ID = IDComboBox;
+ } else if ( widgetType == "LISTBOX" ) {
+ ID = IDListBox;
+ } else if ( widgetType == "SCROLLBAR" ) {
+ ID = IDScrollBar;
+ } else if ( widgetType == "CHECKBOX" ) {
+ ID = IDCheckBox;
+ hasText = TRUE;
+ } else if ( widgetType == "RADIOBUTTON" ) {
+ ID = IDRadioButton;
+ hasText = TRUE;
+ } else if ( widgetType == "CONTROL" ) {
+ isControl = TRUE;
+ widgetText = stripQM(parseNext( arguments ));
+ widgetID = parseNext( arguments );
+ controlType = stripQM(parseNext( arguments ));
+ styles = splitStyles(parseNext( arguments ));
+
+ if ( controlType == "Static" ) {
+ ID = IDLabel;
+ } else if ( controlType == "Button" ) {
+ if ( styles.tqcontains("BS_AUTOCHECKBOX") ||
+ styles.tqcontains("BS_3STATE") )
+ ID = IDCheckBox;
+ else if ( styles.tqcontains("BS_AUTORADIOBUTTON") )
+ ID = IDRadioButton;
+ } else if ( controlType == "msctls_updown32" ) {
+ ID = IDSpinBox;
+ } else if ( controlType == "msctls_progress32" ) {
+ ID = IDProgressBar;
+ } else if ( controlType == "msctls_trackbar32" ) {
+ ID = IDSlider;
+ } else if ( controlType == "SysListView32" ) {
+ ID = IDIconView;
+ } else if ( controlType == "SysTreeView32" ) {
+ ID = IDListView;
+ } else if ( controlType == "SysTabControl32" ) {
+ ID = IDTabWidget;
+ } else if ( controlType == "SysAnimate32" ) {
+ ID = IDLabel;
+ } else if ( controlType == "RICHEDIT" ) {
+ ID = IDMultiLineEdit;
+ } else if ( controlType == "ComboBoxEx32" ) {
+ ID = IDComboBox;
+ } else if ( controlType == "" ) {
+ ID = IDCustom;
+ } else {
+ ID = IDUnknown;
+ }
+ } else
+ ID = IDUnknown;
+
+ if ( hasText )
+ widgetText = stripQM(parseNext( arguments ));
+
+ if ( isControl ) {
+ x = parseNext( arguments ).toInt();
+ y = parseNext( arguments ).toInt();
+ w = parseNext( arguments ).toInt();
+ h = parseNext( arguments ).toInt();
+ } else {
+ widgetID = parseNext( arguments );
+ x = parseNext( arguments ).toInt();
+ y = parseNext( arguments ).toInt();
+ w = parseNext( arguments ).toInt();
+ h = parseNext( arguments ).toInt();
+ styles.clear();
+ }
+
+ do {
+ extendedStyles = splitStyles(parseNext( arguments ));
+ for ( uint i = 0; i < extendedStyles.count(); i++ )
+ styles << (*extendedStyles.at(i));
+ } while ( arguments.tqfind(',') > -1 );
+
+ switch ( ID ) {
+ case IDWidget:
+ break;
+ case IDPushButton:
+ {
+ writeClass("TQPushButton");
+ writeCString( "name", useName("PushButton_"+widgetID) );
+ writeRect( "geometry", x, y, w, h );
+ writeString( "text", widgetText );
+ if ( widgetType == "DEFPUSHBUTTON" )
+ writeBool( "default", TRUE );
+ }
+ break;
+ case IDLabel:
+ {
+ isFrame = TRUE,
+ writeClass("TQLabel");
+ writeCString( "name", useName("Label_"+widgetID) );
+ writeRect( "geometry", x,y,w,h );
+ writeString( "text", widgetText );
+ TQString align;
+ if ( !styles.tqcontains("SS_CENTERIMAGE") )
+ align += "|AlignTop";
+ else
+ align += "|AlignVCenter";
+ if ( widgetType == "LTEXT" ) {
+ align += "|AlignLeft";
+ } else if ( widgetType == "CTEXT") {
+ align += "|AlignHCenter";
+ } else if ( widgetType == "RTEXT") {
+ align += "|AlignRight";
+ }
+ writeSet("tqalignment", align );
+ }
+ break;
+ case IDCheckBox:
+ {
+ writeClass("TQCheckBox");
+ writeCString("name", useName("CheckBox_"+widgetID) );
+ writeRect("geometry", x,y,w,h);
+ writeString("text", widgetText );
+ if ( styles.tqcontains( "BS_3STATE" ) )
+ writeBool( "tristate", TRUE );
+ }
+ break;
+ case IDRadioButton:
+ {
+ writeClass("TQRadioButton");
+ writeCString("name", useName("RadioButton_"+widgetID) );
+ writeRect("geometry", x,y,w,h);
+ writeString("text", widgetText );
+ }
+ break;
+ case IDGroupBox:
+ {
+ isFrame = TRUE;
+ writeClass("TQGroupBox");
+ writeCString( "name", useName("GroupBox_"+widgetID) );
+ writeRect( "geometry", x,y,w,h );
+ writeString( "title", widgetText );
+ if ( !styles.tqcontains( "WS_BORDER" ) )
+ styles.append( "WS_BORDER" );
+ }
+ break;
+ case IDLineEdit:
+ {
+ if ( !styles.tqcontains("ES_MULTILINE") ) {
+ writeClass("TQLineEdit");
+ writeCString( "name", useName("LineEdit_"+widgetID) );
+ } else {
+ writeClass("TQMultiLineEdit");
+ writeCString( "name", useName("MultiLineEdit_"+widgetID) );
+ }
+ writeRect( "geometry", x,y,w,h );
+ TQString align = "AlignTop";
+ if ( styles.tqcontains("ES_CENTER") )
+ align+="|AlignHCenter";
+ else if ( styles.tqcontains("ES_RIGHT") )
+ align+="|AlignRight";
+ else
+ align+="|AlignLeft";
+ writeSet("tqalignment", align);
+ }
+ break;
+ case IDMultiLineEdit:
+ {
+ writeClass("TQMultiLineEdit");
+ writeCString("name", useName("MultiLineEdit_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ }
+ break;
+ case IDIconView:
+ {
+ isFrame = TRUE;
+ writeClass("TQIconView");
+ writeCString("name", useName("IconView_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ if ( !styles.tqcontains( "LVS_SINGLESEL" ) )
+ writeEnum( "selectionMode", "Extended" );
+ if ( styles.tqcontains( "LVS_NOLABELWRAP" ) )
+ writeBool("wordWrapIconText", FALSE );
+ }
+ break;
+ case IDListView:
+ {
+ isFrame = TRUE;
+ writeClass("TQListView");
+ writeCString("name", useName("ListView_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ if ( styles.tqcontains( "TVS_LINESATROOT" ) )
+ writeBool( "rootIsDecorated", TRUE );
+ if ( styles.tqcontains( "TVS_FULLROWSELECT" ) )
+ writeBool( "allColumnsShowFocus", TRUE );
+ }
+ break;
+ case IDProgressBar:
+ {
+ isFrame = TRUE;
+ writeClass("TQProgressBar");
+ writeCString("name", useName("ProgressBar_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ if ( styles.tqcontains("TBS_VERT") )
+ writeEnum("orientation", "Vertical");
+ else
+ writeEnum("orientation", "Horizontal");
+ }
+ break;
+ case IDTabWidget:
+ {
+ writeClass("TQTabWidget");
+ writeCString("name", useName("TabWidget_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ wi(); *out << "<widget>" << endl; indent();
+ writeClass("TQWidget");
+ wi(); *out << "<attribute>" << endl; indent();
+ wi(); *out << "<name>title</name>" << endl;
+ wi(); *out << "<string>Tab1</string>" << endl; undent();
+ wi(); *out << "</attribute>" << endl; undent();
+ wi(); *out << "</widget>" << endl;
+ }
+ break;
+ case IDSpinBox:
+ {
+ isFrame = TRUE;
+ writeClass("TQSpinBox");
+ writeCString("name", useName("SpinBox_"+widgetID) );
+ writeRect("geometry", x,y,w,h);
+ }
+ break;
+ case IDSlider:
+ {
+ writeClass("TQSlider");
+ writeCString("name", useName("Slider_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ if ( styles.tqcontains("TBS_VERT") )
+ writeEnum("orientation", "Vertical");
+ else
+ writeEnum("orientation", "Horizontal");
+ if ( !styles.tqcontains("TBS_NOTICKS") )
+ writeEnum("tickmarks", "Left" );
+ }
+ break;
+ case IDComboBox:
+ {
+ writeClass("TQComboBox");
+ writeCString("name", useName("ComboBox_"+widgetID) );
+ if ( isControl )
+ writeRect( "geometry", x,y,w,14 );
+ else
+ writeRect( "geometry", x,y,w,h );
+ }
+ break;
+ case IDListBox:
+ {
+ isFrame = TRUE;
+ writeClass("TQListBox");
+ writeCString("name", useName("ListBox_"+widgetID) );
+ writeRect( "geometry", x,y,w,h );
+ if ( styles.tqcontains("WS_HSCROLL") )
+ writeEnum("hScrollBarMode", "Auto");
+ else
+ writeEnum("hScrollBarMode", "AlwaysOff");
+ if ( styles.tqcontains("WS_VSCROLL") )
+ writeEnum("vScrollBarMode", "Auto");
+ else
+ writeEnum("vScrollBarMode", "AlwaysOff");
+ if ( styles.tqcontains("LBS_EXTENDEDSEL") )
+ writeEnum("selectionMode", "Extended");
+ else if ( styles.tqcontains("LBS_MULTIPLESEL") )
+ writeEnum("selectionMode", "Multi");
+ else if ( styles.tqcontains("LBS_NOSEL") )
+ writeEnum("selectionMode", "NoSelection");
+ else
+ writeEnum("selectionMode", "Single");
+ if ( !styles.tqcontains( "NO WS_BORDER" ) )
+ styles.append( "WS_BORDER" );
+ }
+ break;
+ case IDScrollBar:
+ {
+ writeClass("TQScrollBar");
+ writeCString("name", useName("ScrollBar_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ if ( styles.tqcontains("SBS_VERT") )
+ writeEnum("orientation", "Vertical");
+ else
+ writeEnum("orientation", "Horizontal");
+ }
+ break;
+ case IDCustom:
+ {
+ writeClass("TQLabel");
+ writeCString("name", useName("Custom_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ writeString("text", "Create a custom widget and place it here." );
+ }
+ default:
+ {
+ writeClass("TQLabel");
+ writeCString("name", useName("Unknown_"+widgetID) );
+ writeRect("geometry", x,y,w,h );
+ writeString("text", TQString("No support for %1.").arg(controlType) );
+ }
+ break;
+ }
+
+ writeStyles( styles, isFrame );
+
+ styles.clear();
+
+ undent();
+ wi(); *out << "</widget>" << endl;
+ } while ( line != "END" );
+
+ undent();
+ wi(); *out << "</widget>" << endl;
+ *out << "</UI>" << endl;
+
+ do {
+ line = in->readLine();
+ } while ( line.isEmpty() );
+
+ if ( !writeToFile )
+ target.append( buffer.copy() );
+
+ if (out) {
+ delete out;
+ out = 0;
+ }
+ fileOut.close();
+
+ } while ( line != blockStart1 );
+
+ return TRUE;
+}
+
+/*! Not yet implemented
+*/
+
+bool RC2UI::makeBitmap()
+{
+ return TRUE;
+}
+
+/*! Not yet implemented
+*/
+
+bool RC2UI::makeAccelerator()
+{
+ return TRUE;
+}
+
+/*! Not yet implemented
+*/
+
+bool RC2UI::makeCursor()
+{
+ return TRUE;
+}
+
+/*! Not yet implemented
+*/
+
+bool RC2UI::makeHTML()
+{
+ return TRUE;
+}
+
+/*! Not yet implemented
+*/
+
+bool RC2UI::makeIcon()
+{
+ return TRUE;
+}
+
+/*!
+ Writes a stringtable from the input stream to a c++ header file.
+ All strings are assigned using TQT_TR_NOOP to enable easy translation.
+*/
+
+bool RC2UI::makeStringTable()
+{
+ if ( !writeToFile )
+ return TRUE;
+
+ TQFile fileOut;
+ line = in->readLine();
+ do {
+ char stringtable[256];
+ char discard[12];
+ sscanf( line, "%s %s", stringtable, discard );
+ if ( TQString(stringtable) != "STRINGTABLE" )
+ return TRUE;
+ do {
+ line = in->readLine();
+ } while ( line != "BEGIN" );
+
+ TQString outputFile = TQString(stringtable).lower() + ".h";
+ if (outputFile ) {
+ fileOut.setName( outputFile );
+ if (!fileOut.open( IO_WriteOnly ) )
+ qFatal( "rc2ui: Could not open output file '%s'", outputFile.latin1() );
+ out = new TQTextStream( &fileOut );
+ }
+
+ *out << "#ifndef STRINGTABLE_H" << endl;
+ *out << "#define STRINGTABLE_H" << endl;
+ *out << endl;
+ *out << "#include <tqstring.h>" << endl;
+ *out << "#include <tqobject.h>" << endl;
+ *out << endl;
+
+ TQString ID;
+ TQString value;
+ do {
+ line = in->readLine().stripWhiteSpace();
+ if ( line == "END" )
+ continue;
+
+ ID = parseNext(line, ' ');
+ value = parseNext(line).stripWhiteSpace();
+
+ *out << "static const TQString " << ID << "= TQT_TR_NOOP(" << value << ");" << endl;
+
+ } while ( line != "END" );
+
+ *out << endl;
+ *out << "#endif // STRINGTABLE_H" << endl;
+
+ do {
+ line = in->readLine();
+ } while ( line.isEmpty() );
+
+ if ( out ) {
+ delete out;
+ out = 0;
+ }
+ } while ( line != blockStart1 );
+
+ return TRUE;
+}
+
+/*! Not yet implemented
+*/
+
+bool RC2UI::makeVersion()
+{
+ return TRUE;
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.h b/tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.h
new file mode 100644
index 0000000..bf2610a
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/rc/rc2ui.h
@@ -0,0 +1,103 @@
+/**********************************************************************
+**
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef RC2UI_H
+#define RC2UI_H
+
+#include <tqtextstream.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+
+class RC2UI
+{
+public:
+ RC2UI( TQTextStream* input );
+ ~RC2UI();
+
+ bool parse();
+ bool parse ( TQStringList& get );
+
+ TQStringList targetFiles;
+
+protected:
+ enum WidgetType { IDWidget, IDPushButton, IDLabel, IDCheckBox, IDRadioButton,
+ IDGroupBox, IDLineEdit, IDMultiLineEdit, IDIconView, IDListView,
+ IDProgressBar, IDTabWidget, IDSpinBox, IDSlider, IDComboBox,
+ IDListBox, IDScrollBar, IDCustom, IDUnknown = 0x0100 };
+ bool makeDialog();
+ bool makeBitmap();
+ bool makeStringTable();
+ bool makeAccelerator();
+ bool makeCursor();
+ bool makeHTML();
+ bool makeIcon();
+ bool makeVersion();
+
+ TQString line;
+ TQTextStream *in;
+ TQStringList target;
+
+ void indent();
+ void undent();
+
+ TQString stripQM( const TQString& string );
+ TQString parseNext( TQString& arg, char sep = ',' );
+ TQStringList splitStyles( const TQString& styles, char sep = '|' );
+ void wi();
+
+ void writeClass( const TQString& name );
+ void writeCString( const TQString& name, const TQString& value );
+ void writeString( const TQString& name, const TQString& value );
+ void writeRect( const TQString& name, int x, int y, int w, int h );
+ void writeFont( const TQString& family, int pointsize );
+ void writeBool( const TQString& name, bool value );
+ void writeNumber( const TQString& name, int value );
+ void writeEnum( const TQString& name, const TQString& value );
+ void writeSet( const TQString& name, const TQString& value );
+
+ void writeStyles( const TQStringList styles, bool isFrame );
+private:
+ int indentation;
+ bool writeToFile;
+ TQTextStream* out;
+
+ TQString useName( const TQString& );
+
+ TQStringList usedNames;
+
+ const TQString blockStart1;
+ const TQString blockStart2;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_1.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_1.png
new file mode 100644
index 0000000..9a62ab9
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_1.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_2.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_2.png
new file mode 100644
index 0000000..fd52607
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_2.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_3.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_3.png
new file mode 100644
index 0000000..7cf15ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_menu_3.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_1.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_1.png
new file mode 100644
index 0000000..425b133
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_1.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_2.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_2.png
new file mode 100644
index 0000000..f729542
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_2.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_3.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_3.png
new file mode 100644
index 0000000..472f267
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_3.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_4.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_4.png
new file mode 100644
index 0000000..493b12e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/qtwizards_table_4.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/re-sort.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/re-sort.png
new file mode 100644
index 0000000..43a8234
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/re-sort.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcopy.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcopy.png
new file mode 100644
index 0000000..080db08
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcut.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcut.png
new file mode 100644
index 0000000..f8bd744
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editpaste.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editpaste.png
new file mode 100644
index 0000000..dc7915e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/editpaste.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filenew.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filenew.png
new file mode 100644
index 0000000..4e5a172
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filenew.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/fileopen.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/fileopen.png
new file mode 100644
index 0000000..cb18a2c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filesave.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filesave.png
new file mode 100644
index 0000000..ad3f6f8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/print.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/print.png
new file mode 100644
index 0000000..8a3640b
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/print.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/redo.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/redo.png
new file mode 100644
index 0000000..3a504a2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/redo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/searchfind.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/searchfind.png
new file mode 100644
index 0000000..900156d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/searchfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/undo.png b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/undo.png
new file mode 100644
index 0000000..2fc8d26
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/images/small/undo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/main.cpp b/tqtinterface/qt4/tools/designer/plugins/wizards/main.cpp
new file mode 100644
index 0000000..b0561cb
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/main.cpp
@@ -0,0 +1,142 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <designerinterface.h>
+#include <tqfeatures.h>
+#include <tqwidget.h>
+#include <templatewizardiface.h>
+#ifndef TQT_NO_SQL
+#include "sqlformwizardimpl.h"
+#endif
+#include "mainwindowwizard.h"
+#include <tqapplication.h>
+
+class StandardTemplateWizardInterface : public TemplateWizardInterface, public TQLibraryInterface
+{
+public:
+ StandardTemplateWizardInterface();
+ virtual ~StandardTemplateWizardInterface();
+
+ TQRESULT queryInterface( const TQUuid&, TQUnknownInterface** );
+ TQ_REFCOUNT;
+
+ TQStringList featureList() const;
+
+ void setup( const TQString &templ, TQWidget *widget, DesignerFormWindow *fw, TQUnknownInterface *aIface );
+
+ bool init();
+ void cleanup();
+ bool canUnload() const;
+
+private:
+ bool inUse;
+};
+
+StandardTemplateWizardInterface::StandardTemplateWizardInterface()
+ : inUse( FALSE )
+{
+}
+
+StandardTemplateWizardInterface::~StandardTemplateWizardInterface()
+{
+}
+
+bool StandardTemplateWizardInterface::init()
+{
+ return TRUE;
+}
+
+void StandardTemplateWizardInterface::cleanup()
+{
+}
+
+bool StandardTemplateWizardInterface::canUnload() const
+{
+ return !inUse;
+}
+
+TQStringList StandardTemplateWizardInterface::featureList() const
+{
+ TQStringList list;
+#ifndef TQT_NO_SQL
+ list << "TQDataBrowser" << "TQDesignerDataBrowser" << "TQDataView" << \
+ "TQDesignerDataView" << "TQDataTable";
+#endif
+ list << "TQMainWindow";
+
+ return list;
+}
+
+void StandardTemplateWizardInterface::setup( const TQString &templ, TQWidget *widget, DesignerFormWindow *fw, TQUnknownInterface *aIface )
+{
+ inUse = TRUE;
+#ifndef TQT_NO_SQL
+ if ( templ == "TQDesignerDataView" ||
+ templ == "TQDesignerDataBrowser" ||
+ templ == "TQDataView" ||
+ templ == "TQDataBrowser" ||
+ templ == "TQDataTable" ) {
+ SqlFormWizard wizard( aIface, widget, tqApp->mainWidget(), fw, 0, TRUE );
+ wizard.exec();
+ }
+#endif
+ if ( templ == "TQMainWindow" ) {
+ MainWindowWizardBase wizard( tqApp->mainWidget(), 0, TRUE );
+ wizard.setAppInterface( aIface, fw, widget );
+ wizard.exec();
+ }
+ inUse = FALSE;
+}
+
+TQRESULT StandardTemplateWizardInterface::queryInterface( const TQUuid& uuid, TQUnknownInterface** iface )
+{
+ *iface = 0;
+ if ( uuid == IID_TQUnknown )
+ *iface = (TQUnknownInterface*)(TemplateWizardInterface*) this;
+ else if ( uuid == IID_TQFeatureList )
+ *iface = (TQFeatureListInterface*)this;
+ else if ( uuid == IID_TemplateWizard )
+ *iface = (TemplateWizardInterface*)this;
+ else if ( uuid == IID_TQLibrary )
+ *iface = (TQLibraryInterface*)this;
+ else
+ return TQE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return TQS_OK;
+}
+
+TQ_EXPORT_COMPONENT()
+{
+ TQ_CREATE_INSTANCE( StandardTemplateWizardInterface )
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui b/tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui
new file mode 100644
index 0000000..7e8dada
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui
@@ -0,0 +1,757 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MainWindowWizardBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<include location="global" impldecl="in implementation">designerinterface.h</include>
+<include location="global" impldecl="in implementation">qiconset.h</include>
+<include location="global" impldecl="in implementation">qaction.h</include>
+<include location="global" impldecl="in implementation">qpixmap.h</include>
+<include location="global" impldecl="in implementation">qdict.h</include>
+<include location="local" implDecl="in declaration">mainwindowwizard.ui.h</include>
+<forward>struct DesignerFormWindow;</forward>
+<forward>struct DesignerInterface;</forward>
+<forward>struct QUnknownInterface;</forward>
+<forward>class QWidget;</forward>
+<variable>QWidget *widget;</variable>
+<variable>DesignerInterface *dIface;</variable>
+<variable>DesignerFormWindow *dfw;</variable>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="TQWizard">
+ <property name="name">
+ <cstring>MainWindowWizardBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>604</width>
+ <height>392</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Main Window Wizard</string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>menuToolbarPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Choose available menus and toolbars</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>Spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_menu_1.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>File Actions</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkFileMenu</cstring>
+ </property>
+ <property name="text">
+ <string>Menu</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkFileToolbar</cstring>
+ </property>
+ <property name="text">
+ <string>Toolbar</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="1" column="3">
+ <property name="name">
+ <cstring>checkCreateConnectionsFile</cstring>
+ </property>
+ <property name="text">
+ <string>Create Slots and Connections for the actions</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>like New, Open File, Save, Print, etc.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="2" column="1">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Edit Actions</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkEditToolbar</cstring>
+ </property>
+ <property name="text">
+ <string>Toolbar</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkEditMenu</cstring>
+ </property>
+ <property name="text">
+ <string>Menu</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="1" column="3">
+ <property name="name">
+ <cstring>checkCreateConnectionsEdit</cstring>
+ </property>
+ <property name="text">
+ <string>Create Slots and Connections for the actions</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>like Cut, Copy, Paste, Undo and Redo, etc.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="3" column="1">
+ <property name="name">
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Help Actions</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>TextLabel2_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>like Contents and About, etc.</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkHelpMenu</cstring>
+ </property>
+ <property name="text">
+ <string>Menu</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkHelpToolbar</cstring>
+ </property>
+ <property name="text">
+ <string>Toolbar</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>Spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="1" column="3">
+ <property name="name">
+ <cstring>checkCreateConnectionsHelp</cstring>
+ </property>
+ <property name="text">
+ <string>Create Slots and Connections for the actions</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>toolbarsPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Setup Toolbar</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="7" column="2">
+ <property name="name">
+ <cstring>buttonToolbarActionUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_up.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="3">
+ <property name="name">
+ <cstring>TextLabel4_3_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Toolbar</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listToolbar</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="8" column="2">
+ <property name="name">
+ <cstring>buttonToolbarActionDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_down.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="3" column="1" rowspan="7" colspan="1">
+ <property name="name">
+ <cstring>listToolbarActions</cstring>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="3" column="3" rowspan="7" colspan="1">
+ <property name="name">
+ <cstring>listToolbar</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout20_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel5_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Category</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboToolbar</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>comboToolbar</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLabel" row="2" column="1">
+ <property name="name">
+ <cstring>TextLabel4_4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Actions</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listToolbarActions</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="5" column="2">
+ <property name="name">
+ <cstring>buttonToolbarRemoveAction</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_left.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0" rowspan="10" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_menu_2.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="4" column="2">
+ <property name="name">
+ <cstring>buttonToolbarAddAction</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_right.png</pixmap>
+ </property>
+ </widget>
+ <spacer row="3" column="2">
+ <property name="name">
+ <cstring>Spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="6" column="2">
+ <property name="name">
+ <cstring>Spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="9" column="2">
+ <property name="name">
+ <cstring>Spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>finishPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Finish</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2_2_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_menu_3.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>TextLabel1_5</cstring>
+ </property>
+ <property name="text">
+ <string>Press Finish to populate the main window.</string>
+ </property>
+ </widget>
+ <spacer row="0" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+</widget>
+<connections>
+ <connection language="C++">
+ <sender>comboToolbar</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>currentToolbarChanged(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>buttonToolbarAddAction</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>toolbarAddAction()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>buttonToolbarRemoveAction</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>toolbarRemoveAction()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>buttonToolbarActionUp</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>toolbarActionUp()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>buttonToolbarActionDown</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>toolbarActionDown()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>MainWindowWizardBase</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>pageSelected(const QString&amp;)</slot>
+ </connection>
+ <connection language="C++">
+ <sender>checkHelpMenu</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>currentSettingChanged()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>checkHelpToolbar</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>currentSettingChanged()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>checkEditMenu</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>currentSettingChanged()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>checkEditToolbar</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>currentSettingChanged()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>checkFileMenu</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>currentSettingChanged()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>checkFileToolbar</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowWizardBase</receiver>
+ <slot>currentSettingChanged()</slot>
+ </connection>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">init()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">currentSettingChanged()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">setupToolbarPage()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">toolbarActionDown()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">toolbarActionUp()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">toolbarAddAction()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">toolbarRemoveAction()</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">accept()</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">currentToolbarChanged( const QString &amp; s )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">getPixmap( const QString &amp; n, QPixmap &amp; pix )</slot>
+ <slot access="protected" specifier="virtual" language="C++" returnType="void">pageSelected( const QString &amp; )</slot>
+ <slot access="public" specifier="virtual" language="C++" returnType="void">setAppInterface( QUnknownInterface * iface, DesignerFormWindow * fw, QWidget * w )</slot>
+</connections>
+<tabstops>
+ <tabstop>checkFileMenu</tabstop>
+ <tabstop>checkFileToolbar</tabstop>
+ <tabstop>checkEditMenu</tabstop>
+ <tabstop>checkEditToolbar</tabstop>
+ <tabstop>checkHelpMenu</tabstop>
+ <tabstop>checkHelpToolbar</tabstop>
+ <tabstop>comboToolbar</tabstop>
+ <tabstop>listToolbarActions</tabstop>
+ <tabstop>buttonToolbarAddAction</tabstop>
+ <tabstop>buttonToolbarRemoveAction</tabstop>
+ <tabstop>buttonToolbarActionUp</tabstop>
+ <tabstop>buttonToolbarActionDown</tabstop>
+ <tabstop>listToolbar</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui.h b/tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui.h
new file mode 100644
index 0000000..3865d12
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/mainwindowwizard.ui.h
@@ -0,0 +1,321 @@
+/**********************************************************************
+**
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+void MainWindowWizardBase::init()
+{
+ dIface = 0;
+ dfw = 0;
+ widget = 0;
+ setHelpEnabled( menuToolbarPage, FALSE );
+ setHelpEnabled( toolbarsPage, FALSE );
+ setHelpEnabled( finishPage, FALSE );
+ setFinishEnabled( finishPage, TRUE );
+}
+
+void MainWindowWizardBase::destroy()
+{
+ if ( dIface )
+ dIface->release();
+}
+
+void MainWindowWizardBase::currentSettingChanged()
+{
+ bool appr = checkFileToolbar->isChecked() || checkEditToolbar->isChecked() || checkHelpToolbar->isChecked();
+ setAppropriate( toolbarsPage, appr );
+}
+
+void MainWindowWizardBase::setupToolbarPage()
+{
+ if ( checkFileToolbar->isChecked() )
+ comboToolbar->insertItem( tr( "File" ) );
+ if ( checkEditToolbar->isChecked() )
+ comboToolbar->insertItem( tr( "Edit" ) );
+ if ( checkHelpToolbar->isChecked() )
+ comboToolbar->insertItem( tr( "Help" ) );
+}
+
+void MainWindowWizardBase::toolbarActionDown()
+{
+ if ( listToolbar->currentItem() < 0 || listToolbar->currentItem() >= (int)listToolbar->count() - 1 )
+ return;
+
+ int next = listToolbar->currentItem() + 1;
+ TQString tmp = listToolbar->text( next );
+ listToolbar->changeItem( listToolbar->text( next - 1 ), next );
+ listToolbar->changeItem( tmp, next - 1 );
+ listToolbar->setCurrentItem( next );
+}
+
+void MainWindowWizardBase::toolbarActionUp()
+{
+ if ( listToolbar->currentItem() < 1 || listToolbar->currentItem() > (int)listToolbar->count() - 1 )
+ return;
+
+ int prev = listToolbar->currentItem() - 1;
+ TQString tmp = listToolbar->text( prev );
+ listToolbar->changeItem( listToolbar->text( prev + 1 ), prev );
+ listToolbar->changeItem( tmp, prev + 1 );
+ listToolbar->setCurrentItem( prev );
+}
+
+void MainWindowWizardBase::toolbarAddAction()
+{
+ if ( listToolbarActions->text( listToolbarActions->currentItem() ).isEmpty() )
+ return;
+ listToolbar->insertItem( listToolbarActions->text( listToolbarActions->currentItem() ) );
+ listToolbar->setCurrentItem( listToolbar->count() - 1 );
+ listToolbarActions->setCurrentItem( listToolbarActions->currentItem() + 1 );
+}
+
+void MainWindowWizardBase::toolbarRemoveAction()
+{
+ listToolbar->removeItem( listToolbar->currentItem() );
+}
+
+static void devNull( TQtMsgType, const char * )
+{
+}
+
+void MainWindowWizardBase::accept()
+{
+ if ( !dfw || !dIface || !widget ) {
+ TQWizard::accept();
+ return;
+ }
+
+ setFinishEnabled( finishPage, FALSE );
+
+ TQPixmap pix;
+
+ TQDict<TQAction> actions;
+ TQPtrList<TQAction> usedActions;
+
+ TQtMsgHandler oldMsgHandler = tqInstallMsgHandler( devNull );
+
+ getPixmap( "filenew", pix );
+
+ TQAction *fileNewAction = dfw->createAction( tr( "New" ), pix, tr( "&New" ), CTRL + Key_N, 0, "fileNewAction" );
+ actions.insert( tr( "New" ), fileNewAction );
+ getPixmap( "fileopen", pix );
+ TQAction *fileOpenAction = dfw->createAction( tr( "Open" ), pix, tr( "&Open..." ), CTRL + Key_O, 0, "fileOpenAction" );
+ actions.insert( tr( "Open" ), fileOpenAction );
+ getPixmap( "filesave", pix );
+ TQAction *fileSaveAction = dfw->createAction( tr( "Save" ), pix, tr( "&Save" ), CTRL + Key_S, 0, "fileSaveAction" );
+ actions.insert( tr( "Save" ), fileSaveAction );
+ TQAction *fileSaveAsAction = dfw->createAction( tr( "Save As" ), TQIconSet(), tr( "Save &As..." ), 0, 0, "fileSaveAsAction" );
+ actions.insert( tr( "Save As" ), fileSaveAsAction );
+ getPixmap( "print", pix );
+ TQAction *filePrintAction = dfw->createAction( tr( "Print" ), pix, tr( "&Print..." ), CTRL + Key_P, 0, "filePrintAction" );
+ actions.insert( tr( "Print" ), filePrintAction );
+ TQAction *fileExitAction = dfw->createAction( tr( "Exit" ), TQIconSet(), tr( "E&xit" ), 0, 0, "fileExitAction" );
+ actions.insert( tr( "Exit" ), fileExitAction );
+
+ getPixmap( "undo", pix );
+ TQAction *editUndoAction = dfw->createAction( tr( "Undo" ), pix, tr( "&Undo" ), CTRL + Key_Z, 0, "editUndoAction" );
+ actions.insert( tr( "Undo" ), editUndoAction );
+ getPixmap( "redo", pix );
+ TQAction *editRedoAction = dfw->createAction( tr( "Redo" ), pix, tr( "&Redo" ), CTRL + Key_Y, 0, "editRedoAction" );
+ actions.insert( tr( "Redo" ), editRedoAction );
+ getPixmap( "editcut", pix );
+ TQAction *editCutAction = dfw->createAction( tr( "Cut" ), pix, tr( "Cu&t" ), CTRL + Key_X, 0, "editCutAction" );
+ actions.insert( tr( "Cut" ), editCutAction );
+ getPixmap( "editcopy", pix );
+ TQAction *editCopyAction = dfw->createAction( tr( "Copy" ), pix, tr( "&Copy" ), CTRL + Key_C, 0, "editCopyAction" );
+ actions.insert( tr( "Copy" ), editCopyAction );
+ getPixmap( "editpaste", pix );
+ TQAction *editPasteAction = dfw->createAction( tr( "Paste" ), pix, tr( "&Paste" ), CTRL + Key_V, 0, "editPasteAction" );
+ actions.insert( tr( "Paste" ), editPasteAction );
+ getPixmap( "searchtqfind", pix );
+ TQAction *editFindAction = dfw->createAction( tr( "Find" ), pix, tr( "&Find..." ), CTRL + Key_F, 0, "editFindAction" );
+ actions.insert( tr( "Find" ), editFindAction );
+
+ TQAction *helpAboutAction = dfw->createAction( tr( "About" ), TQIconSet(), tr( "&About" ), 0, 0, "helpAboutAction" );
+ actions.insert( tr( "About" ), helpAboutAction );
+ TQAction *helpContentsAction = dfw->createAction( tr( "Contents" ), TQIconSet(), tr( "&Contents..." ), 0, 0, "helpContentsAction" );
+ actions.insert( tr( "Contents" ), helpContentsAction );
+ TQAction *helpIndexAction = dfw->createAction( tr( "Index" ), TQIconSet(), tr( "&Index..." ), 0, 0, "helpIndexAction" );
+ actions.insert( tr( "Index" ), helpIndexAction );
+
+ if ( checkFileMenu->isChecked() ) {
+ dfw->addMenu( "&File", "fileMenu" );
+ dfw->addMenuAction( "fileMenu", fileNewAction );
+ dfw->addMenuAction( "fileMenu", fileOpenAction );
+ dfw->addMenuAction( "fileMenu", fileSaveAction );
+ dfw->addMenuAction( "fileMenu", fileSaveAsAction );
+ dfw->addMenuSeparator( "fileMenu" );
+ dfw->addMenuAction( "fileMenu", filePrintAction );
+ dfw->addMenuSeparator( "fileMenu" );
+ dfw->addMenuAction( "fileMenu", fileExitAction );
+ dfw->addAction( fileNewAction );
+ dfw->addAction( fileOpenAction );
+ dfw->addAction( fileSaveAction );
+ dfw->addAction( fileSaveAsAction );
+ dfw->addAction( filePrintAction );
+ dfw->addAction( fileExitAction );
+ usedActions.append( fileNewAction );
+ usedActions.append( fileOpenAction );
+ usedActions.append( fileSaveAction );
+ usedActions.append( fileSaveAsAction );
+ usedActions.append( filePrintAction );
+ usedActions.append( fileExitAction );
+ }
+
+ if ( checkEditMenu->isChecked() ) {
+ dfw->addMenu( "&Edit", "editMenu" );
+ dfw->addMenuAction( "editMenu", editUndoAction );
+ dfw->addMenuAction( "editMenu", editRedoAction );
+ dfw->addMenuSeparator( "editMenu" );
+ dfw->addMenuAction( "editMenu", editCutAction );
+ dfw->addMenuAction( "editMenu", editCopyAction );
+ dfw->addMenuAction( "editMenu", editPasteAction );
+ dfw->addMenuSeparator( "editMenu" );
+ dfw->addMenuAction( "editMenu", editFindAction );
+ dfw->addAction( editUndoAction );
+ dfw->addAction( editRedoAction );
+ dfw->addAction( editCutAction );
+ dfw->addAction( editCopyAction );
+ dfw->addAction( editPasteAction );
+ dfw->addAction( editFindAction );
+ usedActions.append( editUndoAction );
+ usedActions.append( editRedoAction );
+ usedActions.append( editCutAction );
+ usedActions.append( editCopyAction );
+ usedActions.append( editPasteAction );
+ usedActions.append( editFindAction );
+ }
+
+ if ( checkHelpMenu->isChecked() ) {
+ dfw->addMenu( "&Help", "helpMenu" );
+ dfw->addMenuAction( "helpMenu", helpContentsAction );
+ dfw->addMenuAction( "helpMenu", helpIndexAction );
+ dfw->addMenuSeparator( "helpMenu" );
+ dfw->addMenuAction( "helpMenu", helpAboutAction );
+ dfw->addAction( helpContentsAction );
+ dfw->addAction( helpIndexAction );
+ dfw->addAction( helpAboutAction );
+ usedActions.append( helpIndexAction );
+ usedActions.append( helpContentsAction );
+ usedActions.append( helpAboutAction );
+ }
+
+ if ( listToolbar->count() > 0 && appropriate( toolbarsPage ) ) {
+ dfw->addToolBar( "Tools", "toolBar" );
+ for ( int i = 0; i < (int)listToolbar->count(); ++i ) {
+ if ( listToolbar->text( i ) == tr( "<Separator>" ) ) {
+ dfw->addToolBarSeparator( "toolBar" );
+ continue;
+ }
+ TQAction *a = actions.tqfind( listToolbar->text( i ) );
+ if ( !a )
+ continue;
+ dfw->addToolBarAction( "toolBar", a );
+ dfw->addAction( a );
+ if ( usedActions.tqfindRef( a ) == -1 )
+ usedActions.append( a );
+ }
+ }
+ for ( TQAction *ac = usedActions.first(); ac; ac = usedActions.next() ) {
+ if ( TQString( ac->name() ).tqfind( "file" ) != -1 && checkCreateConnectionsFile->isChecked() ||
+ TQString( ac->name() ).tqfind( "edit" ) != -1 && checkCreateConnectionsEdit->isChecked() ||
+ TQString( ac->name() ).tqfind( "help" ) != -1 && checkCreateConnectionsHelp->isChecked() ) {
+ TQString slot = ac->name();
+ slot.remove( slot.length() - 6, 6 );
+ slot += "()";
+ dfw->addFunction( slot.latin1(), "virtual", "public", "slot", dIface->currentProject()->language(), "void" );
+ dfw->addConnection( ac, "activated()", widget, slot );
+ }
+ }
+
+ tqInstallMsgHandler( oldMsgHandler );
+
+ TQWizard::accept();
+}
+
+void MainWindowWizardBase::currentToolbarChanged( const TQString & s )
+{
+ if ( s == tr( "File" ) ) {
+ listToolbarActions->clear();
+ listToolbarActions->insertItem( tr( "New" ) );
+ listToolbarActions->insertItem( tr( "Open" ) );
+ listToolbarActions->insertItem( tr( "Save" ) );
+ listToolbarActions->insertItem( tr( "Save As" ) );
+ listToolbarActions->insertItem( tr( "Print" ) );
+ listToolbarActions->insertItem( tr( "Exit" ) );
+ } else if ( s == tr( "Edit" ) ) {
+ listToolbarActions->clear();
+ listToolbarActions->insertItem( tr( "Undo" ) );
+ listToolbarActions->insertItem( tr( "Redo" ) );
+ listToolbarActions->insertItem( tr( "Cut" ) );
+ listToolbarActions->insertItem( tr( "Copy" ) );
+ listToolbarActions->insertItem( tr( "Paste" ) );
+ listToolbarActions->insertItem( tr( "Find" ) );
+ } else if ( s == tr( "Help" ) ) {
+ listToolbarActions->clear();
+ listToolbarActions->insertItem( tr( "Contents" ) );
+ listToolbarActions->insertItem( tr( "Index" ) );
+ listToolbarActions->insertItem( tr( "About" ) );
+ }
+ listToolbarActions->insertItem( "<Separator>" );
+ listToolbarActions->setCurrentItem( 0 );
+}
+
+void MainWindowWizardBase::getPixmap( const TQString & n, TQPixmap & pix )
+{
+ TQString name = n + ".png";
+ pix = TQPixmap::fromMimeSource( name );
+ DesignerProject *pro = dIface->currentProject();
+ if ( !pro || pro->projectName() == "<No Project>" )
+ return;
+ pro->pixmapCollection()->addPixmap( pix, n, FALSE );
+}
+
+void MainWindowWizardBase::pageSelected( const TQString & )
+{
+ if ( currentPage() == toolbarsPage ) {
+ comboToolbar->clear();
+ setupToolbarPage();
+ listToolbarActions->clear();
+ currentToolbarChanged( comboToolbar->text( comboToolbar->currentItem() ) );
+ }
+}
+
+void MainWindowWizardBase::setAppInterface( TQUnknownInterface * iface, DesignerFormWindow * fw, TQWidget * w )
+{
+ DesignerInterface *d = 0;
+ iface->queryInterface( IID_Designer, (TQUnknownInterface**)&d );
+ dIface = d;
+ dfw = fw;
+ widget = w;
+}
+
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizard.ui b/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizard.ui
new file mode 100644
index 0000000..c08c829
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizard.ui
@@ -0,0 +1,1776 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>SqlFormWizardBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWizard">
+ <property name="name">
+ <cstring>SqlFormWizardBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>577</width>
+ <height>570</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Sql Wizard</string>
+ </property>
+ <property name="icon">
+ <pixmap></pixmap>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <property name="layoutSpacing" stdset="0">
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>databasePage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Choose the Database and Table</string>
+ </attribute>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_table_1.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>TextLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Table:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listBoxTable</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Setup Database Connections...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Click here to manage your database connections</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here you can add, modify and delete your database connections</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel3_3</cstring>
+ </property>
+ <property name="text">
+ <string>Database &amp;Connection:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listBoxConnection</cstring>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="2" column="1">
+ <property name="name">
+ <cstring>listBoxTable</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displays all tables inside the selected Database</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="2" column="0">
+ <property name="name">
+ <cstring>listBoxConnection</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displays a list of available connections on your system</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>populatePage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Displayed Fields</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_table_2.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="4" column="1">
+ <property name="name" stdset="0">
+ <cstring>Spacer1_10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>buttonAddField_2</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_right.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move field to list of displayed fields</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to add the selected field to the list of fields that will be displayed.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>buttonRemoveField_2</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_left.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>remove field from list of displayed fields</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to remove the selected field from the list of fields that will be displayed.</string>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name" stdset="0">
+ <cstring>Spacer2_5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>buttonFieldUp_2</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_up.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move Field up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to move the selected field in the displayed fields list up.</string>
+ </property>
+ </widget>
+ <spacer row="7" column="1">
+ <property name="name" stdset="0">
+ <cstring>Spacer3_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQListBox" row="1" column="0" rowspan="7" colspan="1">
+ <property name="name">
+ <cstring>listBoxField</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This is a list of all available fields in your selected table. Fields in this list will not be displayed.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="6" column="1">
+ <property name="name">
+ <cstring>buttonFieldDown_2</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_down.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move field down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to move the selected field in the displayed fields list down.</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="1" column="2" rowspan="7" colspan="1">
+ <property name="name">
+ <cstring>listBoxSelectedField</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>All fields in this list will be displayed.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="2">
+ <property name="name">
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>Displayed Fields:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_7</cstring>
+ </property>
+ <property name="text">
+ <string>Available Fields:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>navigPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Navigation and Editing</string>
+ </attribute>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel4_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_table_3.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxNavig</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Include Navigation Buttons</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Activates the navigation bar</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Activates the navigation bar</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>&amp;Navigation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>checkBoxPrev</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Previous</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Toggles whether the "Previous" button will be displayed</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Toggles whether the "Previous" button will be displayed</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkBoxNext</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Next</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Toggles whether the "Next" button will be displayed</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Toggles whether the "Next" button will be displayed</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>checkBoxFirst</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;First</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Toggles whether the "First" button will be displayed</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Toggles whether the "First" button will be displayed</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkBoxLast</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Last</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Toggles whether the "Last" button will be displayed</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Toggles whether the "Last" button will be displayed</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxEdit</cstring>
+ </property>
+ <property name="text">
+ <string>In&amp;clude Edit Buttons</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Activates the edit bar</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Activates the edit bar</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>&amp;Editing</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>checkBoxInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>User can insert new rows</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>User can insert new rows</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkBoxUpdate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Update</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>user can edit existing rows</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>user can edit existing rows</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>checkBoxDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>user can delete rows</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>user can delete rows</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tablePropertiesPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Table Properties</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2_2_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_table_4.png</pixmap>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name" stdset="0">
+ <cstring>Spacer1_7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>GroupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Editing</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBoxReadOnly</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Read-Only</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Table will be read-only</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Activate this to prevent editing, deleting and adding of rows</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Confirmations</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>checkBoxConfirmInserts</cstring>
+ </property>
+ <property name="text">
+ <string>Confirm &amp;Inserts</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Query user on inserting rows</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>User will be asked for confirmation if he inserts a new row</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkBoxConfirmUpdates</cstring>
+ </property>
+ <property name="text">
+ <string>Confirm &amp;Updates</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Query user on editing rows</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>User will be asked for confirmation if he edits a row</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>checkBoxConfirmCancels</cstring>
+ </property>
+ <property name="text">
+ <string>Confirm &amp;Cancels</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Query user on canceling</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>User will be asked for confirmation if he cancels an action</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>checkBoxConfirmDeletes</cstring>
+ </property>
+ <property name="text">
+ <string>Confirm &amp;Deletes</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Query user on deleting rows</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>User will be asked for confirmation if he deletes a row</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>checkBoxSorting</cstring>
+ </property>
+ <property name="text">
+ <string>Allow column &amp;sorting</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>User may change sorting</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>User may change sorting of data by clicking on a field in the top row of the table</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>sqlPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>SQL</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_table_2.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel3_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Sort:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listBoxTable</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1_5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel3_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Filter:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listBoxTable</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1_4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="0" column="2" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout13</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>(a valid WHERE clause, e.g. id &gt; 100)</string>
+ </property>
+ </widget>
+ <widget class="TQMultiLineEdit">
+ <property name="name">
+ <cstring>editFilter</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter a valid SQL WHERE statement, for example:
+name like "qt%"
+(name like "q%") and (version &gt; 3)
+((version &gt; 3) and (price &gt; 1000)) or (name like "%embed%")</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="4">
+ <property name="name">
+ <cstring>Layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Sort By</string>
+ </property>
+ </widget>
+ <widget class="TQListBox">
+ <property name="name">
+ <cstring>listBoxSortedField</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Data will be sorted according to the selected fields.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="3">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonAddSortField</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_right.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move field to the right list</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Klick here to add the currently selected field from the available fields list to the sorting criteria</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonRemoveSortField</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_left.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>remove field from the right list</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Klick here to remove the currently selected field from the sorting criteria</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1_6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonUpSortField</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_up.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>move field up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Move selected field in the sort by list up</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonDownSortField</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>designer_down.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>move field down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Move selected field in the sort by list down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer2_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonReSortField</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>re-sort.png</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change field sort from ASC to DESC and back</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Changes the field sort order from ascending to descending for the selected field in the sort by list.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="2">
+ <property name="name">
+ <cstring>Layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1_4</cstring>
+ </property>
+ <property name="text">
+ <string>Available Fields</string>
+ </property>
+ </widget>
+ <widget class="TQListBox">
+ <property name="name">
+ <cstring>listBoxSortField</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This is the list of all available fields in the selected table</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>layoutPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Layout</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2_2_2_3_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_table_3.png</pixmap>
+ </property>
+ </widget>
+ <spacer row="5" column="5">
+ <property name="name" stdset="0">
+ <cstring>Spacer1_9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQButtonGroup" row="1" column="1" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Labels</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>radioLabelsLeft</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Labels to &amp;left</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Create labels to the left of data entry fields.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="1">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Create labels above data entry fields.</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Create labels to the left of data entry fields.</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name" stdset="0">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Maximum</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="3" column="0">
+ <property name="name" stdset="0">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Maximum</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQRadioButton" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>radioLabelsTop</cstring>
+ </property>
+ <property name="text">
+ <string>Labels on &amp;top</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Create labels above data entry fields.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQCheckBox" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkCreateLayouts</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Create tqlayout for all</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Create a BoxLayout around the whole widget</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If you select this a BoxLayout will be created for the whole widget</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkCreateButtonLayout</cstring>
+ </property>
+ <property name="text">
+ <string>Create tqlayout for &amp;buttons</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Create a BoxLayout around the buttons</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If you select this the designer will arrange all buttons inside an BoxLayout</string>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>checkCreateFieldLayout</cstring>
+ </property>
+ <property name="text">
+ <string>Create tqlayout for &amp;fields</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Create a BoxLayout around the fields</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If you select this the designer will arrange all fields inside an BoxLayout</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="0" column="2">
+ <property name="name">
+ <cstring>spinNumberOfColumns</cstring>
+ </property>
+ <property name="maxValue">
+ <number>20</number>
+ </property>
+ <property name="value">
+ <number>2</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter the number of desired columns</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter the number of desired columns</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="1">
+ <property name="name">
+ <cstring>TextLabel1_6</cstring>
+ </property>
+ <property name="text">
+ <string>Number of Columns:</string>
+ </property>
+ </widget>
+ <spacer row="0" column="3">
+ <property name="name" stdset="0">
+ <cstring>Spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>finishPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Finish</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>TextLabel4_2_2_2_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>qtwizards_table_1.png</pixmap>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>TextLabel1_5</cstring>
+ </property>
+ <property name="text">
+ <string>Press Finish to create the widget.</string>
+ </property>
+ </widget>
+ <spacer row="4" column="3">
+ <property name="name" stdset="0">
+ <cstring>Spacer2_4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="2" column="2" rowspan="1" colspan="2">
+ <property name="name" stdset="0">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="0" column="2">
+ <property name="name" stdset="0">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkBoxAutoEdit</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;AutoEditing</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Discard changes when user klicks into another row</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This property holds whether the table automatically applies edits. When the user begins an insert or update in the table there are two possible outcomes when they navigate to another record
+1.the insert or update is is performed -- this occurs if AutoEditing is on
+2.the insert or update is abandoned -- this occurs if AutoEditing is off</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton5</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>setupDatabaseConnections()</slot>
+ </connection>
+ <connection>
+ <sender>checkBoxNavig</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GroupBox2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBoxEdit</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GroupBox3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>buttonReSortField</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>reSortSortField()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveSortField</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>removeSortField()</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddSortField</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>addSortField()</slot>
+ </connection>
+ <connection>
+ <sender>buttonUpSortField</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>sortFieldUp()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDownSortField</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>sortFieldDown()</slot>
+ </connection>
+ <connection>
+ <sender>listBoxSortField</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>addSortField()</slot>
+ </connection>
+ <connection>
+ <sender>listBoxSortedField</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>removeSortField()</slot>
+ </connection>
+ <connection>
+ <sender>listBoxSortedField</sender>
+ <signal>rightButtonClicked(QListBoxItem*,const QPoint&amp;)</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>reSortSortField()</slot>
+ </connection>
+ <connection>
+ <sender>checkBoxReadOnly</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GroupBox4</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>listBoxConnection</sender>
+ <signal>highlighted(const QString&amp;)</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>connectionSelected(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listBoxTable</sender>
+ <signal>highlighted(const QString&amp;)</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>tableSelected(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddField_2</sender>
+ <signal>released()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>addField()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveField_2</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>removeField()</slot>
+ </connection>
+ <connection>
+ <sender>buttonFieldUp_2</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>fieldUp()</slot>
+ </connection>
+ <connection>
+ <sender>buttonFieldDown_2</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlFormWizardBase</receiver>
+ <slot>fieldDown()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>PushButton5</tabstop>
+ <tabstop>listBoxConnection</tabstop>
+ <tabstop>listBoxTable</tabstop>
+ <tabstop>checkBoxNavig</tabstop>
+ <tabstop>checkBoxPrev</tabstop>
+ <tabstop>checkBoxNext</tabstop>
+ <tabstop>checkBoxFirst</tabstop>
+ <tabstop>checkBoxLast</tabstop>
+ <tabstop>checkBoxEdit</tabstop>
+ <tabstop>checkBoxInsert</tabstop>
+ <tabstop>checkBoxUpdate</tabstop>
+ <tabstop>checkBoxDelete</tabstop>
+ <tabstop>checkBoxReadOnly</tabstop>
+ <tabstop>checkBoxConfirmInserts</tabstop>
+ <tabstop>checkBoxConfirmUpdates</tabstop>
+ <tabstop>checkBoxConfirmDeletes</tabstop>
+ <tabstop>checkBoxConfirmCancels</tabstop>
+ <tabstop>checkBoxSorting</tabstop>
+ <tabstop>editFilter</tabstop>
+ <tabstop>listBoxSortField</tabstop>
+ <tabstop>buttonAddSortField</tabstop>
+ <tabstop>buttonRemoveSortField</tabstop>
+ <tabstop>buttonUpSortField</tabstop>
+ <tabstop>buttonDownSortField</tabstop>
+ <tabstop>buttonReSortField</tabstop>
+ <tabstop>listBoxSortedField</tabstop>
+ <tabstop>spinNumberOfColumns</tabstop>
+ <tabstop>radioLabelsLeft</tabstop>
+ <tabstop>radioLabelsTop</tabstop>
+ <tabstop>checkCreateFieldLayout</tabstop>
+ <tabstop>checkCreateButtonLayout</tabstop>
+ <tabstop>checkCreateLayouts</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">addField()</slot>
+ <slot access="protected">addSortField()</slot>
+ <slot access="protected">fieldDown()</slot>
+ <slot access="protected">fieldUp()</slot>
+ <slot access="protected">reSortSortField()</slot>
+ <slot access="protected">removeField()</slot>
+ <slot access="protected">removeSortField()</slot>
+ <slot access="protected">setupDatabaseConnections()</slot>
+ <slot access="protected">sortFieldDown()</slot>
+ <slot access="protected">sortFieldUp()</slot>
+ <slot access="protected">connectionSelected( const QString &amp; )</slot>
+ <slot access="protected">tableSelected( const QString &amp; )</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.cpp
new file mode 100644
index 0000000..e4d1d61
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.cpp
@@ -0,0 +1,624 @@
+ /**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "sqlformwizardimpl.h"
+
+#include <tqlistbox.h>
+#include <tqwidget.h>
+#include <tqcheckbox.h>
+#include <tqlineedit.h>
+
+#include <tqlabel.h>
+#include <tqgroupbox.h>
+#include <tqlayout.h>
+#include <tqregexp.h>
+#include <tqpushbutton.h>
+#include <tqmultilineedit.h>
+#include <tqlistview.h>
+#include <tqfeatures.h>
+#include <tqradiobutton.h>
+#include <tqspinbox.h>
+#include <limits.h>
+
+#ifndef TQT_NO_SQL
+#include <tqdatatable.h>
+#include <tqdatabrowser.h>
+#include <tqdataview.h>
+#include <tqsqleditorfactory.h>
+#include <tqsqlindex.h>
+#include <tqsqlcursor.h>
+#endif
+
+SqlFormWizard::SqlFormWizard( TQUnknownInterface *aIface, TQWidget *w,
+ TQWidget* tqparent, DesignerFormWindow *fw, const char* name, bool modal, WFlags fl )
+ : SqlFormWizardBase( tqparent, name, modal, fl ), widget( w ), appIface( aIface ),
+ mode( None )
+{
+ appIface->addRef();
+ formWindow = fw;
+ setFinishEnabled( finishPage, TRUE );
+
+ /* set mode of operation */
+ if ( ::tqqt_cast<TQDataTable*>(widget) ) {
+ setCaption( "Data Table Wizard" );
+ mode = Table;
+ setAppropriate( navigPage, FALSE );
+ setAppropriate( layoutPage, FALSE );
+ checkBoxAutoEdit->setChecked( FALSE );
+ } else if ( ::tqqt_cast<TQDataBrowser*>(widget) ) {
+ setCaption( "Data Browser Wizard" );
+ setAppropriate( tablePropertiesPage, FALSE );
+ mode = Browser;
+ checkBoxAutoEdit->setChecked( TRUE );
+ } else if ( ::tqqt_cast<TQDataView*>(widget) ) {
+ setCaption( "Data View Wizard" );
+ setAppropriate( tablePropertiesPage, FALSE );
+ setAppropriate( navigPage, FALSE );
+ setAppropriate( sqlPage, FALSE);
+ checkCreateFieldLayout->hide();
+ checkCreateButtonLayout->hide();
+ checkBoxAutoEdit->hide();
+ mode = View;
+ }
+
+ connect( nextButton(), TQT_SIGNAL(clicked()), TQT_SLOT(nextPageClicked()) );
+ setupPage1();
+}
+
+
+SqlFormWizard::~SqlFormWizard()
+{
+ appIface->release();
+}
+
+void SqlFormWizard::nextPageClicked()
+{
+ if ( currentPage() == populatePage ) {
+ autoPopulate( TRUE );
+ }
+}
+
+void SqlFormWizard::connectionSelected( const TQString &c )
+{
+ if ( !appIface )
+ return;
+
+ DesignerProject *proIface = (DesignerProject*)( (DesignerInterface*)appIface )->currentProject();
+ if ( !proIface )
+ return;
+
+ listBoxTable->clear();
+ TQPtrList<DesignerDatabase> databases = proIface->databaseConnections();
+ for ( DesignerDatabase *d = databases.first(); d; d = databases.next() ) {
+ if ( d->name() == c || ( d->name() == "(default)" || d->name().isEmpty() ) && c == "(default)")
+ listBoxTable->insertStringList( d->tables() );
+ }
+ setNextEnabled( databasePage, ( listBoxTable->currentItem() >= 0 ) );
+}
+
+void SqlFormWizard::tableSelected( const TQString & )
+{
+ if ( listBoxTable->currentItem() >= 0 ) {
+ setNextEnabled( databasePage, TRUE );
+ } else {
+ setNextEnabled( databasePage, FALSE );
+ }
+
+}
+
+void SqlFormWizard::autoPopulate( bool populate )
+{
+ DesignerProject *proIface = (DesignerProject*)( (DesignerInterface*)appIface )->currentProject();
+ if ( !proIface )
+ return;
+ TQPtrList<DesignerDatabase> databases = proIface->databaseConnections();
+ listBoxField->clear();
+ listBoxSortField->clear();
+ listBoxSelectedField->clear();
+ if ( populate ) {
+ for ( DesignerDatabase *d = databases.first(); d; d = databases.next() ) {
+ if ( d->name() == listBoxConnection->currentText() ||
+ ( ( d->name() == "(default)" || d->name().isEmpty() ) &&
+ listBoxConnection->currentText() == "(default)" ) ) {
+ TQStringList lst = *d->fields().tqfind( listBoxTable->currentText() );
+ // remove primary index fields, if any
+ listBoxSortField->insertStringList( lst );
+ d->open( FALSE );
+#ifndef TQT_NO_SQL
+ TQSqlCursor tab( listBoxTable->currentText(), TRUE, d->connection() );
+ TQSqlIndex pIdx = tab.primaryIndex();
+ for ( uint i = 0; i < pIdx.count(); i++ ) {
+ listBoxField->insertItem( pIdx.field( i )->name() );
+ lst.remove( pIdx.field( i )->name() );
+ }
+#endif
+ d->close();
+ listBoxSelectedField->insertStringList( lst );
+ }
+ }
+ }
+}
+
+void SqlFormWizard::fieldDown()
+{
+ if ( listBoxSelectedField->currentItem() == -1 ||
+ listBoxSelectedField->currentItem() == (int)listBoxSelectedField->count() - 1 ||
+ listBoxSelectedField->count() < 2 )
+ return;
+ int index = listBoxSelectedField->currentItem() + 1;
+ TQListBoxItem *i = listBoxSelectedField->item( listBoxSelectedField->currentItem() );
+ listBoxSelectedField->takeItem( i );
+ listBoxSelectedField->insertItem( i, index );
+ listBoxSelectedField->setCurrentItem( i );
+}
+
+void SqlFormWizard::fieldUp()
+{
+ if ( listBoxSelectedField->currentItem() <= 0 ||
+ listBoxSelectedField->count() < 2 )
+ return;
+ int index = listBoxSelectedField->currentItem() - 1;
+ TQListBoxItem *i = listBoxSelectedField->item( listBoxSelectedField->currentItem() );
+ listBoxSelectedField->takeItem( i );
+ listBoxSelectedField->insertItem( i, index );
+ listBoxSelectedField->setCurrentItem( i );
+}
+
+void SqlFormWizard::removeField()
+{
+ int i = listBoxSelectedField->currentItem();
+ if ( i != -1 ) {
+ listBoxField->insertItem( listBoxSelectedField->currentText() );
+ listBoxSelectedField->removeItem( i );
+ }
+}
+
+void SqlFormWizard::addField()
+{
+ int i = listBoxField->currentItem();
+ if ( i == -1 )
+ return;
+ TQString f = listBoxField->currentText();
+ if ( !f.isEmpty() )
+ listBoxSelectedField->insertItem( f );
+ listBoxField->removeItem( i );
+}
+
+void SqlFormWizard::addSortField()
+{
+ int i = listBoxSortField->currentItem();
+ if ( i == -1 )
+ return;
+ TQString f = listBoxSortField->currentText();
+ if ( !f.isEmpty() )
+ listBoxSortedField->insertItem( f + " ASC" );
+}
+
+void SqlFormWizard::reSortSortField()
+{
+ int i = listBoxSortedField->currentItem();
+ if ( i != -1 ) {
+ TQString text = listBoxSortedField->currentText();
+ if ( text.mid( text.length() - 3 ) == "ASC" )
+ text = text.mid( 0, text.length() - 3 ) + "DESC";
+ else if ( text.mid( text.length() - 4 ) == "DESC" )
+ text = text.mid( 0, text.length() - 4 ) + "ASC";
+ listBoxSortedField->removeItem( i );
+ listBoxSortedField->insertItem( text, i );
+ listBoxSortedField->setCurrentItem( i );
+ }
+}
+
+void SqlFormWizard::removeSortField()
+{
+ int i = listBoxSortedField->currentItem();
+ if ( i != -1 ) {
+ listBoxSortedField->removeItem( i );
+ }
+}
+
+void SqlFormWizard::sortFieldUp()
+{
+ if ( listBoxSortedField->currentItem() <= 0 ||
+ listBoxSortedField->count() < 2 )
+ return;
+ int index = listBoxSortedField->currentItem() - 1;
+ TQListBoxItem *i = listBoxSortedField->item( listBoxSortedField->currentItem() );
+ listBoxSortedField->takeItem( i );
+ listBoxSortedField->insertItem( i, index );
+ listBoxSortedField->setCurrentItem( i );
+}
+
+void SqlFormWizard::sortFieldDown()
+{
+ if ( listBoxSortedField->currentItem() == -1 ||
+ listBoxSortedField->currentItem() == (int)listBoxSortedField->count() - 1 ||
+ listBoxSortedField->count() < 2 )
+ return;
+ int index = listBoxSortedField->currentItem() + 1;
+ TQListBoxItem *i = listBoxSortedField->item( listBoxSortedField->currentItem() );
+ listBoxSortedField->takeItem( i );
+ listBoxSortedField->insertItem( i, index );
+ listBoxSortedField->setCurrentItem( i );
+}
+
+void SqlFormWizard::setupDatabaseConnections()
+{
+ if ( !appIface )
+ return;
+
+ DesignerProject *proIface = (DesignerProject*)( (DesignerInterface*)appIface )->currentProject();
+ if ( !proIface )
+ return;
+ proIface->setupDatabases();
+ raise();
+ setupPage1();
+}
+
+void SqlFormWizard::setupPage1()
+{
+ if ( !appIface )
+ return;
+
+ DesignerProject *proIface = (DesignerProject*)( (DesignerInterface*)appIface )->currentProject();
+ if ( !proIface )
+ return;
+
+ listBoxTable->clear();
+ listBoxConnection->clear();
+ TQPtrList<DesignerDatabase> databases = proIface->databaseConnections();
+ TQStringList lst;
+ for ( DesignerDatabase *d = databases.first(); d; d = databases.next() )
+ lst << d->name();
+ listBoxConnection->insertStringList( lst );
+ if ( lst.count() )
+ listBoxConnection->setCurrentItem( 0 );
+
+ setNextEnabled( databasePage, FALSE );
+}
+
+static TQPushButton *create_widget( TQWidget *tqparent, const char *name,
+ const TQString &txt, const TQRect &r, DesignerFormWindow *fw )
+{
+ TQPushButton *pb = (TQPushButton*)fw->create( "TQPushButton", tqparent, name );
+ pb->setText( txt );
+ pb->setGeometry( r );
+ fw->setPropertyChanged( pb, "text", TRUE );
+ fw->setPropertyChanged( pb, "geometry", TRUE );
+ return pb;
+}
+
+void SqlFormWizard::accept()
+{
+ if ( !appIface || mode == None )
+ return;
+
+#ifndef TQT_NO_SQL
+ DesignerProject *proIface = (DesignerProject*)( (DesignerInterface*)appIface )->currentProject();
+ if ( !widget || !proIface ) {
+ SqlFormWizardBase::accept();
+ return;
+ }
+
+ TQString conn = listBoxConnection->currentText();
+ TQString table = listBoxTable->currentText();
+ TQStringList lst;
+ lst << conn << table;
+
+ if ( !conn.isEmpty() && !table.isEmpty() ) {
+ formWindow->setProperty( widget, "database", lst );
+ formWindow->setPropertyChanged( widget, "database", TRUE );
+ }
+
+ if ( !editFilter->text().isEmpty() ) {
+ widget->setProperty( "filter", editFilter->text() );
+ formWindow->setPropertyChanged( widget, "filter", TRUE );
+ }
+
+ if ( listBoxSortedField->count() ) {
+ TQStringList lst;
+ for ( uint i = 0; i < listBoxSortedField->count(); ++i )
+ lst << listBoxSortedField->text( i );
+ widget->setProperty( "sort", lst );
+ formWindow->setPropertyChanged( widget, "sort", TRUE );
+ }
+
+ TQPtrList<DesignerDatabase> databases = proIface->databaseConnections();
+ DesignerDatabase *database = 0;
+ for ( DesignerDatabase *d = databases.first(); d; d = databases.next() ) {
+ if ( d->name() == listBoxConnection->currentText() || ( d->name() == "(default)" || d->name().isEmpty() ) && listBoxConnection->currentText() == "(default)" ) {
+ database = d;
+ d->open( FALSE );
+ break;
+ }
+ }
+
+ if (!database) {
+ return;
+ }
+ TQSqlCursor tab( listBoxTable->currentText(), TRUE, database->connection() );
+ int columns = 2;
+
+ TQSqlEditorFactory * f = TQSqlEditorFactory::defaultFactory();
+
+ TQWidget * editorDummy;
+ TQWidget * editor;
+ TQLabel * label;
+
+ int visibleFields = listBoxSelectedField->count();
+ int numPerColumn = visibleFields / columns;
+ if( (visibleFields % columns) > 0)
+ numPerColumn++;
+
+ int row = 0;
+ const int SPACING = 25;
+ const int COL_SPACING = SPACING*9;
+
+ uint j;
+ switch ( mode ) {
+ case None:
+ break;
+ case View:
+ case Browser: {
+
+ if ( mode == Browser && !checkBoxAutoEdit->isChecked() ) {
+ ((TQDataBrowser*)widget)->setAutoEdit( FALSE );
+ formWindow->setPropertyChanged( widget, "autoEdit", TRUE );
+ }
+
+ formWindow->clearSelection();
+ bool createFieldLayout = checkCreateFieldLayout->isChecked();
+ bool createButtonLayout = checkCreateButtonLayout->isChecked();
+ bool createLayouts = checkCreateLayouts->isChecked();
+ bool labelAbove = radioLabelsTop->isOn();
+ uint numCols = spinNumberOfColumns->text().toInt();
+ uint currentCol = 0;
+ uint fieldsPerCol = listBoxSelectedField->count();
+ uint fieldsInCol = 0;
+ if ( listBoxSelectedField->count() )
+ fieldsPerCol = listBoxSelectedField->count() / numCols;
+ /* labels and data field editors */
+ for( j = 0; j < listBoxSelectedField->count(); j++ ){
+
+ TQSqlField* field = tab.field( listBoxSelectedField->text( j ) );
+ if ( !field )
+ continue;
+
+ /* label */
+ TQString labelName = field->name();
+ labelName = labelName.mid(0,1).upper() + labelName.mid(1);
+ label = (TQLabel*)formWindow->create( "TQLabel", widget,
+ TQString( "label" + labelName ) );
+ label->setText( labelName );
+ label->setGeometry( SPACING + currentCol*COL_SPACING, row+SPACING,
+ SPACING*3, SPACING );
+
+ formWindow->setPropertyChanged( label, "geometry", TRUE );
+ formWindow->setPropertyChanged( label, "text", TRUE );
+
+ /* editor */
+ editorDummy = f->createEditor( widget, field );
+ editor = formWindow->create( editorDummy->className(), widget,
+ TQString( TQString( editorDummy->className() )
+ + labelName) );
+ delete editorDummy;
+ if ( labelAbove ) {
+ row += SPACING;
+ editor->setGeometry(SPACING + currentCol*COL_SPACING, row+SPACING,
+ SPACING*3, SPACING );
+ } else {
+ editor->setGeometry(SPACING * 5 + currentCol*COL_SPACING, row+SPACING,
+ SPACING*3, SPACING );
+ }
+ formWindow->setPropertyChanged( editor, "geometry", TRUE );
+ if ( TQString(editor->className()) == "TQLineEdit" &&
+ (field->type() == TQVariant::Double ||
+ field->type() == TQVariant::Int ||
+ field->type() == TQVariant::UInt ) ) {
+ /* default right-align numerics */
+ //##
+ ((TQLineEdit*)editor)->tqsetAlignment( TQt::AlignRight );
+ formWindow->setPropertyChanged( editor, "tqalignment", TRUE );
+ }
+ if ( ::tqqt_cast<TQSpinBox*>(editor) ) {
+ ( (TQSpinBox*)editor )->setMaxValue( INT_MAX );
+ formWindow->setPropertyChanged( editor, "maxValue", TRUE );
+ }
+ TQStringList lst;
+ lst << conn << table << field->name();
+ formWindow->setProperty( editor, "database", lst );
+ formWindow->setPropertyChanged( editor, "database", TRUE );
+
+ /* tqgeometry */
+ if ( createFieldLayout ) {
+ formWindow->selectWidget( label );
+ formWindow->selectWidget( editor );
+ }
+
+ row += SPACING + 5;
+ fieldsInCol++;
+ if ( ( fieldsInCol >= fieldsPerCol ) && ( currentCol < numCols-1 ) ) {
+ currentCol++;
+ fieldsInCol = 0;
+ row = 0;
+ }
+ }
+
+ if ( listBoxSelectedField->count() ) {
+ if ( createFieldLayout )
+ formWindow->layoutG();
+ row += SPACING;
+ }
+
+ if ( mode == Browser ) {
+ if ( checkBoxNavig->isChecked() ) {
+ formWindow->clearSelection();
+ currentCol = 0;
+ if ( checkBoxFirst->isChecked() ) {
+ TQPushButton *pb = create_widget( widget, "PushButtonFirst",
+ "|< &First",
+ TQRect( 3 * SPACING * currentCol, row+SPACING, SPACING * 3, SPACING ),
+ formWindow );
+ formWindow->addConnection( pb, "clicked()", widget, "first()" );
+ formWindow->addConnection( widget, "firstRecordAvailable( bool )",
+ pb, "setEnabled( bool )" );
+ currentCol++;
+ formWindow->selectWidget( pb );
+ }
+ if ( checkBoxPrev->isChecked() ) {
+ TQPushButton *pb = create_widget( widget, "PushButtonPrev",
+ "<< &Prev",
+ TQRect( 3 * SPACING * currentCol, row+SPACING, SPACING * 3, SPACING ),
+ formWindow );
+ formWindow->addConnection( pb, "clicked()", widget, "prev()" );
+ formWindow->addConnection( widget, "prevRecordAvailable( bool )",
+ pb, "setEnabled( bool )" );
+ currentCol++;
+ formWindow->selectWidget( pb );
+ }
+ if ( checkBoxNext->isChecked() ) {
+ TQPushButton *pb = create_widget( widget, "PushButtonNext",
+ "&Next >>",
+ TQRect( 3 * SPACING * currentCol, row+SPACING, SPACING * 3, SPACING ),
+ formWindow );
+ formWindow->addConnection( pb, "clicked()", widget, "next()" );
+ formWindow->addConnection( widget, "nextRecordAvailable( bool )", pb,
+ "setEnabled( bool )" );
+ currentCol++;
+ formWindow->selectWidget( pb );
+ }
+ if ( checkBoxLast->isChecked() ) {
+ TQPushButton *pb = create_widget( widget, "PushButtonLast", "&Last >|",
+ TQRect( 3 * SPACING * currentCol, row+SPACING, SPACING*3, SPACING ), formWindow );
+ formWindow->addConnection( pb, "clicked()", widget, "last()" );
+ formWindow->addConnection( widget, "lastRecordAvailable( bool )", pb,
+ "setEnabled( bool )" );
+ currentCol++;
+ formWindow->selectWidget( pb );
+ }
+ if ( createButtonLayout )
+ formWindow->layoutH();
+ }
+ if ( checkBoxEdit->isChecked() ) {
+ formWindow->clearSelection();
+ row += SPACING;
+ currentCol = 0;
+ if ( checkBoxInsert->isChecked() ) {
+ TQPushButton *pb = create_widget( widget, "PushButtonInsert", "&Insert",
+ TQRect( 3 * SPACING * currentCol, row+SPACING, SPACING * 3, SPACING ), formWindow );
+ formWindow->addConnection( pb, "clicked()", widget, "insert()" );
+ currentCol++;
+ formWindow->selectWidget( pb );
+ }
+ if ( checkBoxUpdate->isChecked() ) {
+ TQPushButton *pb = create_widget( widget, "PushButtonUpdate", "&Update",
+ TQRect( 3 * SPACING * currentCol, row+SPACING, SPACING * 3, SPACING ), formWindow );
+ formWindow->addConnection( pb, "clicked()", widget, "update()" );
+ currentCol++;
+ formWindow->selectWidget( pb );
+ }
+ if ( checkBoxDelete->isChecked() ) {
+ TQPushButton *pb = create_widget( widget, "PushButtonDelete", "&Delete",
+ TQRect( 3 * SPACING * currentCol, row+SPACING, SPACING * 3, SPACING ), formWindow );
+ formWindow->addConnection( pb, "clicked()", widget, "del()" );
+ currentCol++;
+ formWindow->selectWidget( pb );
+ }
+ if ( createButtonLayout )
+ formWindow->layoutH();
+ }
+ }
+ if ( createLayouts )
+ formWindow->layoutGContainer( widget );
+ formWindow->clearSelection();
+ break;
+ }
+ case Table:
+ {
+ TQDataTable* sqlTable = ((TQDataTable*)widget);
+ if ( checkBoxAutoEdit->isChecked() ) {
+ sqlTable->setAutoEdit( TRUE );
+ formWindow->setPropertyChanged( sqlTable, "autoEdit", TRUE );
+ }
+
+ if ( checkBoxReadOnly->isChecked() ) {
+ sqlTable->setReadOnly( TRUE );
+ formWindow->setPropertyChanged( sqlTable, "readOnly", TRUE );
+ } else {
+ if ( checkBoxConfirmInserts->isChecked() ) {
+ sqlTable->setConfirmInsert( TRUE );
+ formWindow->setPropertyChanged( sqlTable, "confirmInsert", TRUE );
+ }
+ if ( checkBoxConfirmUpdates->isChecked() ) {
+ sqlTable->setConfirmUpdate( TRUE );
+ formWindow->setPropertyChanged( sqlTable, "confirmUpdate", TRUE );
+ }
+ if ( checkBoxConfirmDeletes->isChecked() ) {
+ sqlTable->setConfirmDelete( TRUE );
+ formWindow->setPropertyChanged( sqlTable, "confirmDelete", TRUE );
+ }
+ if ( checkBoxConfirmCancels->isChecked() ) {
+ sqlTable->setConfirmCancels( TRUE );
+ formWindow->setPropertyChanged( sqlTable, "confirmCancels", TRUE );
+ }
+ }
+ if ( checkBoxSorting->isChecked() ) {
+ sqlTable->setSorting( TRUE );
+ formWindow->setPropertyChanged( sqlTable, "sorting", TRUE );
+ }
+
+ TQMap<TQString, TQString> columnFields;
+ sqlTable->setNumCols( listBoxSelectedField->count() ); // no need to change property through mdbIface here, since TQDataTable doesn't offer that through Designer
+ for( j = 0; j < listBoxSelectedField->count(); j++ ){
+
+ TQSqlField* field = tab.field( listBoxSelectedField->text( j ) );
+ if ( !field )
+ continue;
+
+ TQString labelName = field->name();
+ labelName = labelName.mid(0,1).upper() + labelName.mid(1);
+
+ ((TQTable*)widget)->horizontalHeader()->setLabel( j, labelName );
+
+ columnFields.insert( labelName, field->name() );
+ }
+ formWindow->setColumnFields( widget, columnFields );
+ break;
+ }
+ }
+
+ database->close();
+#endif
+
+ SqlFormWizardBase::accept();
+}
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.h b/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.h
new file mode 100644
index 0000000..eb6558c
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/sqlformwizardimpl.h
@@ -0,0 +1,87 @@
+ /**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef STQLFORMWIZARDIMPL_H
+#define STQLFORMWIZARDIMPL_H
+
+#include "sqlformwizard.h"
+#include <templatewizardiface.h>
+#include <designerinterface.h>
+#include <tqvaluelist.h>
+
+class SqlFormWizard : public SqlFormWizardBase
+{
+ TQ_OBJECT
+
+public:
+ SqlFormWizard( TQUnknownInterface *aIface, TQWidget *w, TQWidget* tqparent = 0, DesignerFormWindow *fw = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~SqlFormWizard();
+
+ void accept() const;
+
+protected Q_SLOTS:
+ void connectionSelected( const TQString & );
+ void tableSelected( const TQString & );
+ void autoPopulate( bool populate );
+ void fieldDown();
+ void fieldUp();
+ void removeField();
+ void addField();
+ void setupDatabaseConnections();
+ void accept();
+ void addSortField();
+ void reSortSortField();
+ void removeSortField();
+ void sortFieldUp();
+ void sortFieldDown();
+ void nextPageClicked();
+
+private:
+ void setupPage1();
+
+private:
+ TQWidget *widget;
+ TQUnknownInterface *appIface;
+ DesignerFormWindow *formWindow;
+ enum Mode {
+ None,
+ View,
+ Browser,
+ Table
+ };
+ Mode mode;
+
+};
+
+#endif // STQLFORMWIZARDIMPL_H
diff --git a/tqtinterface/qt4/tools/designer/plugins/wizards/wizards.pro b/tqtinterface/qt4/tools/designer/plugins/wizards/wizards.pro
new file mode 100644
index 0000000..1e50693
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/plugins/wizards/wizards.pro
@@ -0,0 +1,21 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release plugin
+
+SOURCES += main.cpp
+FORMS = sqlformwizard.ui mainwindowwizard.ui
+
+sql {
+ HEADERS += sqlformwizardimpl.h
+ SOURCES += sqlformwizardimpl.cpp
+ }
+DESTDIR = ../../../../plugins/designer
+
+PROJECTNAME = Wizards
+IMAGES = images/qtwizards_menu_1.png images/qtwizards_menu_2.png images/qtwizards_menu_3.png images/qtwizards_table_1.png images/qtwizards_table_2.png images/qtwizards_table_3.png images/qtwizards_table_4.png images/re-sort.png images/small/editcopy.png images/small/editcut.png images/small/editpaste.png images/small/filenew.png images/small/fileopen.png images/small/filesave.png images/small/print.png images/small/redo.png images/small/searchfind.png images/small/undo.png
+INCLUDEPATH += ../../interfaces
+DBFILE = wizards.db
+LANGUAGE = C++
+
+
+target.path += $$plugins.path/designer
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/designer/shared/domtool.cpp b/tqtinterface/qt4/tools/designer/shared/domtool.cpp
new file mode 100644
index 0000000..0c50fbf
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/domtool.cpp
@@ -0,0 +1,460 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "domtool.h"
+
+#include <tqsizepolicy.h>
+#include <tqcolor.h>
+#include <tqcursor.h>
+#include <tqdatetime.h>
+#include <tqrect.h>
+#include <tqsize.h>
+#include <tqfont.h>
+#include <tqdom.h>
+
+/*!
+ \class DomTool domtool.h
+ \brief Tools for the dom
+
+ A collection of static functions used by Resource (part of the
+ designer) and Uic.
+
+*/
+
+/*!
+ Returns the contents of property \a name of object \a e as
+ variant or the variant passed as \a defValue if the property does
+ not exist.
+
+ \sa hasProperty()
+*/
+TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment )
+{
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return elementToVariant( n.firstChild().toElement(), defValue, comment );
+ }
+ }
+ return defValue;
+}
+
+
+/*!
+ \overload
+ */
+TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue )
+{
+ TQString comment;
+ return readProperty( e, name, defValue, comment );
+}
+
+/*!
+ Returns wheter object \a e defines property \a name or not.
+
+ \sa readProperty()
+ */
+bool DomTool::hasProperty( const TQDomElement& e, const TQString& name )
+{
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type )
+{
+ TQStringList result;
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ TQDomElement n2 = n.firstChild().toElement();
+ if ( n2.tagName() == type )
+ result += n.attribute( "name" );
+ }
+ }
+ return result;
+}
+
+
+TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue )
+{
+ TQString dummy;
+ return elementToVariant( e, defValue, dummy );
+}
+
+/*!
+ Interprets element \a e as variant and returns the result of the interpretation.
+ */
+TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment )
+{
+ TQVariant v;
+ if ( e.tagName() == "rect" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int x = 0, y = 0, w = 0, h = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "x" )
+ x = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "y" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "width" )
+ w = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "height" )
+ h = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( TQRect( x, y, w, h ) );
+ } else if ( e.tagName() == "point" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int x = 0, y = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "x" )
+ x = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "y" )
+ y = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( TQPoint( x, y ) );
+ } else if ( e.tagName() == "size" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int w = 0, h = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "width" )
+ w = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "height" )
+ h = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( TQSize( w, h ) );
+ } else if ( e.tagName() == "color" ) {
+ v = TQVariant( readColor( e ) );
+ } else if ( e.tagName() == "font" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ TQFont f( defValue.toFont() );
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "family" )
+ f.setFamily( n3.firstChild().toText().data() );
+ else if ( n3.tagName() == "pointsize" )
+ f.setPointSize( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "bold" )
+ f.setBold( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "italic" )
+ f.setItalic( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "underline" )
+ f.setUnderline( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "strikeout" )
+ f.setStrikeOut( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( f );
+ } else if ( e.tagName() == "string" ) {
+ v = TQVariant( e.firstChild().toText().data() );
+ TQDomElement n = e;
+ n = n.nextSibling().toElement();
+ if ( n.tagName() == "comment" )
+ comment = n.firstChild().toText().data();
+ } else if ( e.tagName() == "cstring" ) {
+ v = TQVariant( TQCString( e.firstChild().toText().data() ) );
+ } else if ( e.tagName() == "number" ) {
+ bool ok = TRUE;
+ v = TQVariant( e.firstChild().toText().data().toInt( &ok ) );
+ if ( !ok )
+ v = TQVariant( e.firstChild().toText().data().toDouble() );
+ } else if ( e.tagName() == "bool" ) {
+ TQString t = e.firstChild().toText().data();
+ v = TQVariant( t == "true" || t == "1", 0 );
+ } else if ( e.tagName() == "pixmap" ) {
+ v = TQVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "iconset" ) {
+ v = TQVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "image" ) {
+ v = TQVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "enum" ) {
+ v = TQVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "set" ) {
+ v = TQVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "sizepolicy" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ TQSizePolicy sp;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hsizetype" )
+ sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "vsizetype" )
+ sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "horstretch" )
+ sp.setHorStretch( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "verstretch" )
+ sp.setVerStretch( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( sp );
+ } else if ( e.tagName() == "cursor" ) {
+ v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) );
+ } else if ( e.tagName() == "stringlist" ) {
+ TQStringList lst;
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ lst << n.firstChild().toText().data();
+ v = TQVariant( lst );
+ } else if ( e.tagName() == "date" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int y, m, d;
+ y = m = d = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "year" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "month" )
+ m = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "day" )
+ d = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( TQDate( y, m, d ) );
+ } else if ( e.tagName() == "time" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int h, m, s;
+ h = m = s = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hour" )
+ h = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "minute" )
+ m = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "second" )
+ s = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( TQTime( h, m, s ) );
+ } else if ( e.tagName() == "datetime" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int h, mi, s, y, mo, d ;
+ h = mi = s = y = mo = d = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hour" )
+ h = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "minute" )
+ mi = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "second" )
+ s = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "year" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "month" )
+ mo = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "day" )
+ d = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) );
+ }
+ return v;
+}
+
+
+/*! Returns the color which is returned in the dom element \a e.
+ */
+
+TQColor DomTool::readColor( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ int r= 0, g = 0, b = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "red" )
+ r = n.firstChild().toText().data().toInt();
+ else if ( n.tagName() == "green" )
+ g = n.firstChild().toText().data().toInt();
+ else if ( n.tagName() == "blue" )
+ b = n.firstChild().toText().data().toInt();
+ n = n.nextSibling().toElement();
+ }
+
+ return TQColor( r, g, b );
+}
+
+/*!
+ Returns the contents of attribute \a name of object \a e as
+ variant or the variant passed as \a defValue if the attribute does
+ not exist.
+
+ \sa hasAttribute()
+ */
+TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment )
+{
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "attribute" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return elementToVariant( n.firstChild().toElement(), defValue, comment );
+ }
+ }
+ return defValue;
+}
+
+/*!
+ \overload
+*/
+TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue )
+{
+ TQString comment;
+ return readAttribute( e, name, defValue, comment );
+}
+
+/*!
+ Returns wheter object \a e defines attribute \a name or not.
+
+ \sa readAttribute()
+ */
+bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name )
+{
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "attribute" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static bool toBool( const TQString& s )
+{
+ return s == "true" || s.toInt() != 0;
+}
+
+/*!
+ Convert TQt 2.x format to TQt 3.0 format if necessary
+*/
+void DomTool::fixDocument( TQDomDocument& doc )
+{
+ TQDomElement e;
+ TQDomNode n;
+ TQDomNodeList nl;
+ int i = 0;
+
+ e = doc.firstChild().toElement();
+ if ( e.tagName() != "UI" )
+ return;
+
+ // latest version, don't do anything
+ if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.0 )
+ return;
+
+ nl = doc.elementsByTagName( "property" );
+
+ // in 3.0, we need to fix a spelling error
+ if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) {
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement el = nl.item(i).toElement();
+ TQString s = el.attribute( "name" );
+ if ( s == "resizeable" ) {
+ el.removeAttribute( "name" );
+ el.setAttribute( "name", "resizable" );
+ }
+ }
+ return;
+ }
+
+
+ // in versions smaller than 3.0 we need to change more
+ e.setAttribute( "version", 3.0 );
+
+ e.setAttribute("stdsetdef", 1 );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "name" ) {
+ name = n2.firstChild().toText().data();
+ if ( name == "resizeable" )
+ e.setAttribute( "name", "resizable" );
+ else
+ e.setAttribute( "name", name );
+ e.removeChild( n2 );
+ }
+ bool stdset = toBool( e.attribute( "stdset" ) );
+ if ( stdset || name == "toolTip" || name == "whatsThis" ||
+ name == "buddy" ||
+ e.parentNode().toElement().tagName() == "item" ||
+ e.parentNode().toElement().tagName() == "spacer" ||
+ e.parentNode().toElement().tagName() == "column"
+ )
+ e.removeAttribute( "stdset" );
+ else
+ e.setAttribute( "stdset", 0 );
+ }
+
+ nl = doc.elementsByTagName( "attribute" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "name" ) {
+ name = n2.firstChild().toText().data();
+ e.setAttribute( "name", name );
+ e.removeChild( n2 );
+ }
+ }
+
+ nl = doc.elementsByTagName( "image" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "name" ) {
+ name = n2.firstChild().toText().data();
+ e.setAttribute( "name", name );
+ e.removeChild( n2 );
+ }
+ }
+
+ nl = doc.elementsByTagName( "widget" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ TQString name;
+ TQDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "class" ) {
+ name = n2.firstChild().toText().data();
+ e.setAttribute( "class", name );
+ e.removeChild( n2 );
+ }
+ }
+
+}
+
diff --git a/tqtinterface/qt4/tools/designer/shared/domtool.h b/tqtinterface/qt4/tools/designer/shared/domtool.h
new file mode 100644
index 0000000..fde516d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/domtool.h
@@ -0,0 +1,60 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef DOMTOOL_H
+#define DOMTOOL_H
+
+#include <tqvariant.h>
+#include <tqnamespace.h>
+
+class TQDomElement;
+class TQDomDocument;
+
+class DomTool : public TQt
+{
+public:
+ static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue );
+ static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment );
+ static bool hasProperty( const TQDomElement& e, const TQString& name );
+ static TQStringList propertiesOfType( const TQDomElement& e, const TQString& type );
+ static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue );
+ static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment );
+ static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue );
+ static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment );
+ static bool hasAttribute( const TQDomElement& e, const TQString& name );
+ static TQColor readColor( const TQDomElement &e );
+ static void fixDocument( TQDomDocument& );
+};
+
+
+#endif // DOMTOOL_H
diff --git a/tqtinterface/qt4/tools/designer/shared/globaldefs.h b/tqtinterface/qt4/tools/designer/shared/globaldefs.h
new file mode 100644
index 0000000..d121256
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/globaldefs.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef GLOBALDEFS_H
+#define GLOBALDEFS_H
+
+#include <tqcolor.h>
+#include <tqapplication.h>
+
+#define BOXLAYOUT_DEFAULT_MARGIN 11
+#define BOXLAYOUT_DEFAULT_SPACING 6
+
+#ifndef NO_STATIC_COLORS
+static TQColor *backColor1 = 0;
+static TQColor *backColor2 = 0;
+static TQColor *selectedBack = 0;
+
+static void init_colors()
+{
+ if ( backColor1 )
+ return;
+
+#if 0 // a calculated alternative for backColor1
+ TQColorGroup myCg = tqApp->palette().active();
+ int h1, s1, v1;
+ int h2, s2, v2;
+ myCg.color( TQColorGroup::Base ).hsv( &h1, &s1, &v1 );
+ myCg.color( TQColorGroup::Background ).hsv( &h2, &s2, &v2 );
+ TQColor c( h1, s1, ( v1 + v2 ) / 2, TQColor::Hsv );
+#endif
+
+ backColor1 = new TQColor( 250, 248, 235 );
+ backColor2 = new TQColor( 255, 255, 255 );
+ selectedBack = new TQColor( 230, 230, 230 );
+}
+
+#endif
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/shared/parser.cpp b/tqtinterface/qt4/tools/designer/shared/parser.cpp
new file mode 100644
index 0000000..d9f01ed
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/parser.cpp
@@ -0,0 +1,79 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "parser.h"
+#include <tqobject.h>
+#include <tqstringlist.h>
+
+class NormalizeObject : public TQObject
+{
+public:
+ NormalizeObject() : TQObject() {}
+ static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); }
+};
+
+TQString Parser::cleanArgs( const TQString &func )
+{
+ TQString slot( func );
+ int begin = slot.tqfind( "(" ) + 1;
+ TQString args = slot.mid( begin );
+ args = args.left( args.tqfind( ")" ) );
+ TQStringList lst = TQStringList::split( ',', args );
+ TQString res = slot.left( begin );
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( it != lst.begin() )
+ res += ",";
+ TQString arg = *it;
+ int pos = 0;
+ if ( ( pos = arg.tqfind( "&" ) ) != -1 ) {
+ arg = arg.left( pos + 1 );
+ } else if ( ( pos = arg.tqfind( "*" ) ) != -1 ) {
+ arg = arg.left( pos + 1 );
+ } else {
+ arg = arg.simplifyWhiteSpace();
+ if ( ( pos = arg.tqfind( ':' ) ) != -1 )
+ arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace();
+ TQStringList l = TQStringList::split( ' ', arg );
+ if ( l.count() == 2 ) {
+ if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" )
+ arg = l[ 0 ];
+ } else if ( l.count() == 3 ) {
+ arg = l[ 0 ] + " " + l[ 1 ];
+ }
+ }
+ res += arg;
+ }
+ res += ")";
+
+ return TQString::tqfromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) );
+}
diff --git a/tqtinterface/qt4/tools/designer/shared/parser.h b/tqtinterface/qt4/tools/designer/shared/parser.h
new file mode 100644
index 0000000..75e7e32
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/parser.h
@@ -0,0 +1,46 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#include <tqstring.h>
+
+class Parser
+{
+public:
+ static TQString cleanArgs( const TQString &func );
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/shared/ui2uib.cpp b/tqtinterface/qt4/tools/designer/shared/ui2uib.cpp
new file mode 100644
index 0000000..bf6335d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/ui2uib.cpp
@@ -0,0 +1,900 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "ui2uib.h"
+#include "uib.h"
+
+#include <domtool.h>
+
+#include <tqcolor.h>
+#include <tqcursor.h>
+#include <tqdatetime.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqfont.h>
+#include <tqobject.h>
+#include <tqrect.h>
+#include <tqsizepolicy.h>
+
+/*
+ The .uib file format is the binary counterpart of the .ui file
+ format. It is generated by the ui2uib converter and understood by
+ TQWidgetFactory; in a future version, it might also be understood
+ by a uib2ui converter. Experiments show that .uib files are about
+ 2.5 times faster to load and 6 times smaller than .ui files.
+
+ The .uib format, unlike the .ui format, is internal to Trolltech
+ and is not officially documented; it is assumed that anybody who
+ needs to understand the file format can read the ui2uib and
+ TQWidgetFactory source code, with some guidance. And here's some
+ guidance.
+
+ A .uib file starts with a 32-bit magic number that allows
+ TQWidgetFactory to determine the file type. The magic number is
+ followed by '\n' (0x0a) and '\r' (0x0d), which ensure that the
+ file wasn't corrupted during transfer between different
+ platforms. For example, transferring a .ui file from Windows to
+ Unix using FTP with type ASCII will produce a file with '\r\n\r'
+ in place of '\n\r'. This is followed by the TQDataStream format
+ version number used.
+
+ The rest of the file is made up of blocks, each of which starts
+ with a block type (Block_XXX) and a block length. Block_Intro and
+ Block_Widget are mandatory; the others are optional.
+ TQWidgetFactory makes certain assumptions about the order of the
+ blocks; for example, it expects Block_String before any other
+ block that refers to a string and Block_Images before
+ Block_Widget. The order generated by ui2uib is one of the orders
+ that make sense. Just after the last block, a Block_End marker
+ indicates the end of the file.
+
+ The division of .uib files into blocks corresponds grossly to the
+ division of .ui files in top-level XML elements. Thus,
+ Block_Widget corresponds to <widget> and Block_Toolbars to
+ <toolbars>. The internal organization of each block also mimics
+ the organization of the corresponding XML elements.
+
+ These are the major differences, all of which contribute to
+ making .uib files more compact:
+
+ 1. The strings are gathered in Block_Strings, a string-table.
+ When a string is needed later, it is referenced by a 32-bit
+ index into that table. The UicStringTable class makes the
+ whole process of inserting and looking up strings very
+ simple. The advantage of this scheme is that if a string is
+ used more than once, it is stored only once. Also, the
+ string-table is preinitialized with very common strings, so
+ that these need not be stored along with .uib files.
+
+ 2. TQObjects are referred to by index in a table rather than by
+ name. The table itself is not stored in the .uib file; it is
+ rather build dynamically by ui2uib and TQWidgetFactory as new
+ objects are specified. In ui2uib, the table is represented by
+ a UibIndexMap object; in TQWidgetFactory, a plain array of
+ TQObject pointers suffices.
+
+ 3. The data is packed to take as little place as possible,
+ without slowing down TQLayoutFactory too much. For example, an
+ index into the string-table is a 32-bit integer, but in
+ practice it is rarely above 65534, so only 16 bits are used
+ for them; when an index above 65534 is met, the index is
+ saved as 65535 followed by the 32-bit index, for a total of
+ 48 bits.
+
+ 4. The name of a signal or slot and its signature are saved
+ separately. That way, if a signal 'foo(const TQString&)' is
+ connected to a slot 'bar(const TQString&)', the string-table
+ will only contain 'foo', 'bar', and '(const TQString&)',
+ instead of the longer 'foo(const TQString&)' and 'bar(const
+ TQString&)'. The signatures are normalized beforehand to
+ ensure that trivial spacing problems don't result in multiple
+ string-table entries.
+
+ 5. In a signal-to-slot connection, a sender, signal, receiver,
+ or slot is not repeated if it's the same as for the previous
+ connection. Bit flags indicate what is repeated and what is
+ specified.
+
+ 6. Some of the information stored in a .ui file is useful only
+ by uic, not to TQLayoutFactory. That information is, for now,
+ not taken along in the .uib file. Likewise, needless
+ TQLayoutWidget objects are not taken along.
+
+ The arbitrary constants related to the .uib file formats are
+ defined in uib.h. Constants such as Block_Actions and
+ Object_SubWidget are given values such as 'A' and 'W' to make
+ .uib files easier to read in a hexadecimal editor.
+
+ The file format isn't designed to be extensible. Any extension
+ that prevents an older version of TQLayoutWidget of reading the
+ file correctly must have a different magic number. The plan is to
+ use UibMagic + 1 for version 2, UibMagic + 2 for version 3, etc.
+*/
+
+static TQCString layoutForTag( const TQString& tag )
+{
+ if ( tag == "grid" ) {
+ return "TQGridLayout";
+ } else if ( tag == "hbox" ) {
+ return "TQHBoxLayout";
+ } else if ( tag == "vbox" ) {
+ return "TQVBoxLayout";
+ } else {
+ return "TQLayout";
+ }
+}
+
+class UibHack : public TQObject
+{
+public:
+ static TQString normalize( const TQString& member ) {
+ return TQString::fromUtf8( TQObject::normalizeSignalSlot(member.utf8()) );
+ }
+};
+
+class UibIndexMap
+{
+public:
+ UibIndexMap() : next( 0 ) { }
+
+ void insert( const TQString& name ) { setName( insert(), name ); }
+ int insert() { return next++; }
+ void setName( int no, const TQString& name );
+
+ int tqfind( const TQString& name, int deflt = -1 ) const;
+ int count() const { return next; }
+
+private:
+ TQMap<TQString, int> nameMap;
+ TQMap<TQString, int> conflicts;
+ int next;
+};
+
+void UibIndexMap::setName( int no, const TQString& name )
+{
+ if ( !name.isEmpty() ) {
+ if ( *nameMap.insert(name, no, FALSE) != no )
+ conflicts.insert( name, 0 );
+ }
+}
+
+int UibIndexMap::tqfind( const TQString& name, int deflt ) const
+{
+ TQMap<TQString, int>::ConstIterator no = nameMap.tqfind( name );
+ if ( no == nameMap.end() || conflicts.tqcontains(name) ) {
+ return deflt;
+ } else {
+ return *no;
+ }
+}
+
+static void packUInt16( TQDataStream& out, TQ_UINT16 n )
+{
+ if ( n < 255 ) {
+ out << (TQ_UINT8) n;
+ } else {
+ out << (TQ_UINT8) 255;
+ out << n;
+ }
+}
+
+static void packUInt32( TQDataStream& out, TQ_UINT32 n )
+{
+ if ( n < 65535 ) {
+ out << (TQ_UINT16) n;
+ } else {
+ out << (TQ_UINT16) 65535;
+ out << n;
+ }
+}
+
+static void packByteArray( TQDataStream& out, const TQByteArray& array )
+{
+ packUInt32( out, array.size() );
+ out.writeRawBytes( array.data(), array.size() );
+}
+
+static void packCString( UibStrTable& strings, TQDataStream& out,
+ const char *cstr )
+{
+ packUInt32( out, strings.insertCString(cstr) );
+}
+
+static void packString( UibStrTable& strings, TQDataStream& out,
+ const TQString& str )
+{
+ packUInt32( out, strings.insertString(str) );
+}
+
+static void packStringSplit( UibStrTable& strings, TQDataStream& out,
+ const TQString& str, TQChar sep )
+{
+ int pos = str.tqfind( sep );
+ if ( pos == -1 )
+ pos = str.length();
+ packString( strings, out, str.left(pos) );
+ packString( strings, out, str.mid(pos) );
+}
+
+static void packVariant( UibStrTable& strings, TQDataStream& out,
+ TQVariant value, TQString tag = "" )
+{
+ TQStringList::ConstIterator s;
+
+ TQ_UINT8 type = value.type();
+ if ( tag == "pixmap" ) {
+ type = TQVariant::Pixmap;
+ } else if ( tag == "image" ) {
+ type = TQVariant::Image;
+ } else if ( tag == "iconset" ) {
+ type = TQVariant::IconSet;
+ }
+ out << type;
+
+ switch ( type ) {
+ case TQVariant::String:
+ case TQVariant::Pixmap:
+ case TQVariant::Image:
+ case TQVariant::IconSet:
+ packString( strings, out, value.asString() );
+ break;
+ case TQVariant::StringList:
+ packUInt16( out, value.asStringList().count() );
+ s = value.asStringList().begin();
+ while ( s != value.asStringList().end() ) {
+ packString( strings, out, *s );
+ ++s;
+ }
+ break;
+ case TQVariant::Font:
+ out << value.asFont();
+ break;
+ case TQVariant::Rect:
+ packUInt16( out, value.asRect().x() );
+ packUInt16( out, value.asRect().y() );
+ packUInt16( out, value.asRect().width() );
+ packUInt16( out, value.asRect().height() );
+ break;
+ case TQVariant::Size:
+ packUInt16( out, value.asSize().width() );
+ packUInt16( out, value.asSize().height() );
+ break;
+ case TQVariant::Color:
+ out << value.asColor();
+ break;
+ case TQVariant::Point:
+ packUInt16( out, value.asPoint().x() );
+ packUInt16( out, value.asPoint().y() );
+ break;
+ case TQVariant::Int:
+ packUInt32( out, value.asInt() );
+ break;
+ case TQVariant::Bool:
+ out << (TQ_UINT8) value.asBool();
+ break;
+ case TQVariant::Double:
+ out << value.asDouble();
+ break;
+ case TQVariant::CString:
+ packCString( strings, out, value.asCString() );
+ break;
+ case TQVariant::Cursor:
+ out << value.asCursor();
+ break;
+ case TQVariant::Date:
+ out << value.asDate();
+ break;
+ case TQVariant::Time:
+ out << value.asTime();
+ break;
+ case TQVariant::DateTime:
+ out << value.asDateTime();
+ break;
+ default:
+ out << value;
+ }
+}
+
+static void outputProperty( TQMap<int, TQStringList>& buddies, int objectNo,
+ UibStrTable& strings, TQDataStream& out,
+ TQDomElement elem )
+{
+ TQCString name = elem.attribute( "name" ).latin1();
+ TQDomElement f = elem.firstChild().toElement();
+ TQString tag = f.tagName();
+ TQString comment;
+ TQVariant value;
+
+ if ( name == "resizeable" )
+ name = "resizable";
+
+ if ( tag == "font" ) {
+ TQString family;
+ TQ_UINT16 pointSize = 65535;
+ TQ_UINT8 fontFlags = 0;
+
+ TQDomElement g = f.firstChild().toElement();
+ while ( !g.isNull() ) {
+ TQString text = g.firstChild().toText().data();
+ if ( g.tagName() == "family" ) {
+ fontFlags |= Font_Family;
+ family = text;
+ } else if ( g.tagName() == "pointsize" ) {
+ fontFlags |= Font_PointSize;
+ pointSize = (TQ_UINT16) text.toUInt();
+ } else {
+ if ( g.firstChild().toText().data().toInt() != 0 ) {
+ if ( g.tagName() == "bold" ) {
+ fontFlags |= Font_Bold;
+ } else if ( g.tagName() == "italic" ) {
+ fontFlags |= Font_Italic;
+ } else if ( g.tagName() == "underline" ) {
+ fontFlags |= Font_Underline;
+ } else if ( g.tagName() == "strikeout" ) {
+ fontFlags |= Font_StrikeOut;
+ }
+ }
+ }
+ g = g.nextSibling().toElement();
+ }
+
+ out << (TQ_UINT8) Object_FontProperty;
+ packCString( strings, out, name );
+ out << fontFlags;
+ if ( fontFlags & Font_Family )
+ packString( strings, out, family );
+ if ( fontFlags & Font_PointSize )
+ packUInt16( out, pointSize );
+ } else if ( tag == "palette" ) {
+ out << (TQ_UINT8) Object_PaletteProperty;
+ packCString( strings, out, name );
+
+ TQDomElement g = f.firstChild().toElement();
+ while ( !g.isNull() ) {
+ TQDomElement h = g.firstChild().toElement();
+ while ( !h.isNull() ) {
+ value = DomTool::elementToVariant( h, TQt::gray );
+ if ( h.tagName() == "color" ) {
+ out << (TQ_UINT8) Palette_Color;
+ out << value.asColor();
+ } else if ( h.tagName() == "pixmap" ) {
+ out << (TQ_UINT8) Palette_Pixmap;
+ packVariant( strings, out, value, "pixmap" );
+ }
+ h = h.nextSibling().toElement();
+ }
+
+ if ( g.tagName() == "active" ) {
+ out << (TQ_UINT8) Palette_Active;
+ } else if ( g.tagName() == "inactive" ) {
+ out << (TQ_UINT8) Palette_Inactive;
+ } else {
+ out << (TQ_UINT8) Palette_Disabled;
+ }
+ g = g.nextSibling().toElement();
+ }
+ out << (TQ_UINT8) Palette_End;
+ } else {
+ value = DomTool::elementToVariant( f, value, comment );
+ if ( value.isValid() ) {
+ if ( name == "buddy" ) {
+ buddies[objectNo] += value.asString();
+ } else {
+ if ( tag == "string" ) {
+ out << (TQ_UINT8) Object_TextProperty;
+ packCString( strings, out, name );
+ packCString( strings, out, value.asString().utf8() );
+ packCString( strings, out, comment.utf8() );
+ } else {
+ out << (TQ_UINT8) Object_VariantProperty;
+ packCString( strings, out, name );
+ packVariant( strings, out, value, tag );
+ }
+ }
+ }
+ }
+}
+
+static void outputGridCell( TQDataStream& out, TQDomElement elem )
+{
+ int column = elem.attribute( "column", "0" ).toInt();
+ int row = elem.attribute( "row", "0" ).toInt();
+ int colspan = elem.attribute( "colspan", "1" ).toInt();
+ int rowspan = elem.attribute( "rowspan", "1" ).toInt();
+ if ( colspan < 1 )
+ colspan = 1;
+ if ( rowspan < 1 )
+ rowspan = 1;
+
+ if ( column != 0 || row != 0 || colspan != 1 || rowspan != 1 ) {
+ out << (TQ_UINT8) Object_GridCell;
+ packUInt16( out, column );
+ packUInt16( out, row );
+ packUInt16( out, colspan );
+ packUInt16( out, rowspan );
+ }
+}
+
+static int outputObject( TQMap<int, TQStringList>& buddies,
+ UibIndexMap& objects, UibStrTable& strings,
+ TQDataStream& out, TQDomElement elem,
+ TQCString className = "" );
+
+static void outputLayoutWidgetsSubLayout( TQMap<int, TQStringList>& buddies,
+ UibIndexMap& objects,
+ UibStrTable& strings,
+ TQDataStream& out, TQDomElement elem )
+{
+ int subLayoutNo = -1;
+ TQCString name;
+ TQDomElement nameElem;
+
+ TQDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ TQString tag = f.tagName();
+ if ( tag == "grid" || tag == "hbox" || tag == "vbox" ) {
+ out << (TQ_UINT8) Object_SubLayout;
+ subLayoutNo = outputObject( buddies, objects, strings, out, f,
+ layoutForTag(tag) );
+ } else if ( tag == "property" ) {
+ if ( f.attribute("name") == "name" ) {
+ name = DomTool::elementToVariant( f, name ).asCString();
+ nameElem = f;
+ }
+ }
+ f = f.nextSibling().toElement();
+ }
+
+ if ( subLayoutNo != -1 ) {
+ /*
+ Remove the sub-tqlayout's Object_End marker, append the grid
+ cell and the correct name property, and put the Object_End
+ marker back.
+ */
+ out.tqdevice()->at( out.tqdevice()->at() - 1 );
+ outputGridCell( out, elem );
+ outputProperty( buddies, subLayoutNo, strings, out, nameElem );
+ out << (TQ_UINT8) Object_End;
+
+ objects.setName( subLayoutNo, name );
+ }
+}
+
+static int outputObject( TQMap<int, TQStringList>& buddies,
+ UibIndexMap& objects, UibStrTable& strings,
+ TQDataStream& out, TQDomElement elem,
+ TQCString className )
+{
+ bool isTQObject = !className.isEmpty();
+
+ if ( className == "TQToolBar" )
+ out << (TQ_UINT8) elem.attribute( "dock", "0" ).toInt();
+ if ( className == "TQWidget" )
+ className = elem.attribute( "class", className ).latin1();
+
+ int objectNo = -1;
+ if ( isTQObject ) {
+ packCString( strings, out, className );
+ objectNo = objects.insert();
+ }
+
+ outputGridCell( out, elem );
+
+ // optimization: insert '&Foo' into string-table before 'Foo'
+ if ( className == "TQAction" || className == "TQActionGroup" ) {
+ TQVariant value = DomTool::readProperty( elem, "menuText", TQVariant() );
+ if ( value.asString().startsWith("&") )
+ strings.insertString( value.asString() );
+ }
+
+ TQDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ TQString tag = f.tagName();
+ if ( tag == "action" ) {
+ if ( elem.tagName() == "item" || elem.tagName() == "toolbar" ) {
+ TQString actionName = f.attribute( "name" );
+ int no = objects.tqfind( actionName );
+ if ( no != -1 ) {
+ out << (TQ_UINT8) Object_ActionRef;
+ packUInt16( out, no );
+ }
+ } else {
+ out << (TQ_UINT8) Object_SubAction;
+ outputObject( buddies, objects, strings, out, f, "TQAction" );
+ }
+ } else if ( tag == "actiongroup" ) {
+ out << (TQ_UINT8) Object_SubAction;
+ outputObject( buddies, objects, strings, out, f, "TQActionGroup" );
+ } else if ( tag == "attribute" ) {
+ out << (TQ_UINT8) Object_Attribute;
+ outputProperty( buddies, objectNo, strings, out, f );
+ } else if ( tag == "column" ) {
+ out << (TQ_UINT8) Object_Column;
+ outputObject( buddies, objects, strings, out, f );
+ } else if ( tag == "event" ) {
+ out << (TQ_UINT8) Object_Event;
+ packCString( strings, out, f.attribute("name").latin1() );
+ packVariant( strings, out,
+ TQStringList::split(',', f.attribute("functions")) );
+ } else if ( tag == "grid" || tag == "hbox" || tag == "vbox" ) {
+ out << (TQ_UINT8) Object_SubLayout;
+ outputObject( buddies, objects, strings, out, f,
+ layoutForTag(tag) );
+ } else if ( tag == "item" ) {
+ if ( elem.tagName() == "menubar" ) {
+ out << (TQ_UINT8) Object_MenuItem;
+ packCString( strings, out, f.attribute("name").latin1() );
+ packCString( strings, out, f.attribute("text").utf8() );
+ outputObject( buddies, objects, strings, out, f );
+ } else {
+ out << (TQ_UINT8) Object_Item;
+ outputObject( buddies, objects, strings, out, f );
+ }
+ } else if ( tag == "property" ) {
+ outputProperty( buddies, objectNo, strings, out, f );
+ } else if ( tag == "row" ) {
+ out << (TQ_UINT8) Object_Row;
+ outputObject( buddies, objects, strings, out, f );
+ } else if ( tag == "separator" ) {
+ out << (TQ_UINT8) Object_Separator;
+ } else if ( tag == "spacer" ) {
+ out << (TQ_UINT8) Object_Spacer;
+ outputObject( buddies, objects, strings, out, f );
+ } else if ( tag == "widget" ) {
+ if ( f.attribute("class") == "TQLayoutWidget" &&
+ elem.tagName() != "widget" ) {
+ outputLayoutWidgetsSubLayout( buddies, objects, strings, out,
+ f );
+ } else {
+ out << (TQ_UINT8) Object_SubWidget;
+ outputObject( buddies, objects, strings, out, f, "TQWidget" );
+ }
+ }
+ f = f.nextSibling().toElement();
+ }
+ out << (TQ_UINT8) Object_End;
+ if ( isTQObject )
+ objects.setName( objectNo,
+ DomTool::readProperty(elem, "name", "").asString() );
+ return objectNo;
+}
+
+static void outputBlock( TQDataStream& out, BlockTag tag,
+ const TQByteArray& data )
+{
+ if ( !data.isEmpty() ) {
+ out << (TQ_UINT8) tag;
+ packByteArray( out, data );
+ }
+}
+
+void convertUiToUib( TQDomDocument& doc, TQDataStream& out )
+{
+ TQByteArray introBlock;
+ TQByteArray actionsBlock;
+ TQByteArray buddiesBlock;
+ TQByteArray connectionsBlock;
+ TQByteArray functionsBlock;
+ TQByteArray imagesBlock;
+ TQByteArray menubarBlock;
+ TQByteArray Q_SLOTSBlock;
+ TQByteArray tabstopsBlock;
+ TQByteArray toolbarsBlock;
+ TQByteArray variablesBlock;
+ TQByteArray widgetBlock;
+
+ TQDomElement actionsElem;
+ TQDomElement connectionsElem;
+ TQDomElement imagesElem;
+ TQDomElement menubarElem;
+ TQDomElement tabstopsElem;
+ TQDomElement toolbarsElem;
+ TQDomElement widgetElem;
+
+ TQMap<int, TQStringList> buddies;
+ UibStrTable strings;
+ UibIndexMap objects;
+ int widgetNo = -1;
+ TQCString className;
+ TQ_INT16 defaultMargin = -32768;
+ TQ_INT16 defaultSpacing = -32768;
+ TQ_UINT8 introFlags = 0;
+
+ TQDomElement elem = doc.firstChild().toElement().firstChild().toElement();
+ while ( !elem.isNull() ) {
+ TQString tag = elem.tagName();
+
+ switch ( tag[0].latin1() ) {
+ case 'a':
+ if ( tag == "actions" )
+ actionsElem = elem;
+ break;
+ case 'c':
+ if ( tag == "class" ) {
+ className = elem.firstChild().toText().data().latin1();
+ } else if ( tag == "connections" ) {
+ connectionsElem = elem;
+ }
+ break;
+ case 'f':
+ if ( tag == "functions" ) {
+ TQDataStream out2( functionsBlock, IO_WriteOnly );
+ TQDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "function" ) {
+ packStringSplit( strings, out2,
+ f.attribute("name").latin1(), '(' );
+ packString( strings, out2,
+ f.firstChild().toText().data() );
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 'i':
+ if ( tag == "images" ) {
+ TQDataStream out2( imagesBlock, IO_WriteOnly );
+ TQDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "image" ) {
+ TQString name = f.attribute( "name" );
+ TQDomElement g = f.firstChild().toElement();
+ if ( g.tagName() == "data" ) {
+ TQString format = g.attribute( "format", "PNG" );
+ TQString hex = g.firstChild().toText().data();
+ int n = hex.length() / 2;
+ TQByteArray data( n );
+ for ( int i = 0; i < n; i++ )
+ data[i] = (char) hex.mid( 2 * i, 2 )
+ .toUInt( 0, 16 );
+
+ packString( strings, out2, name );
+ packString( strings, out2, format );
+ packUInt32( out2, g.attribute("length").toInt() );
+ packByteArray( out2, data );
+ }
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 'l':
+ if ( tag == "layoutdefaults" ) {
+ TQString margin = elem.attribute( "margin" );
+ if ( !margin.isEmpty() )
+ defaultMargin = margin.toInt();
+ TQString spacing = elem.attribute( "spacing" );
+ if ( !spacing.isEmpty() )
+ defaultSpacing = spacing.toInt();
+ }
+ break;
+ case 'm':
+ if ( tag == "menubar" )
+ menubarElem = elem;
+ break;
+ case 'p':
+ if ( tag == "pixmapinproject" )
+ introFlags |= Intro_Pixmapinproject;
+ break;
+ case 's':
+ if ( tag == "Q_SLOTS" ) {
+ TQDataStream out2( Q_SLOTSBlock, IO_WriteOnly );
+ TQDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "slot" ) {
+ TQString language = f.attribute( "language", "C++" );
+ TQString slot = UibHack::normalize(
+ f.firstChild().toText().data() );
+ packString( strings, out2, language );
+ packStringSplit( strings, out2, slot, '(' );
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 't':
+ if ( tag == "tabstops" ) {
+ tabstopsElem = elem;
+ } else if ( tag == "toolbars" ) {
+ toolbarsElem = elem;
+ }
+ break;
+ case 'v':
+ if ( tag == "variable" ) {
+ TQDataStream out2( variablesBlock, IO_WriteOnly | IO_Append );
+ packString( strings, out2, elem.firstChild().toText().data() );
+ } else if ( tag == "variables" ) {
+ TQDataStream out2( variablesBlock, IO_WriteOnly );
+ TQDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "variable" )
+ packString( strings, out2,
+ f.firstChild().toText().data() );
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 'w':
+ if ( tag == "widget" )
+ widgetElem = elem;
+ }
+ elem = elem.nextSibling().toElement();
+ }
+
+ {
+ TQDataStream out2( widgetBlock, IO_WriteOnly );
+ widgetNo = outputObject( buddies, objects, strings, out2, widgetElem,
+ "TQWidget" );
+ }
+
+ if ( !tabstopsElem.isNull() ) {
+ TQDataStream out2( tabstopsBlock, IO_WriteOnly );
+ TQDomElement f = tabstopsElem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "tabstop" ) {
+ TQString widgetName = f.firstChild().toText().data();
+ int no = objects.tqfind( widgetName );
+ if ( no != -1 )
+ packUInt16( out2, no );
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+
+ if ( !actionsElem.isNull() ) {
+ TQDataStream out2( actionsBlock, IO_WriteOnly );
+ outputObject( buddies, objects, strings, out2, actionsElem );
+ }
+
+ if ( !menubarElem.isNull() ) {
+ TQDataStream out2( menubarBlock, IO_WriteOnly );
+ outputObject( buddies, objects, strings, out2, menubarElem,
+ "TQMenuBar" );
+ }
+
+ if ( !toolbarsElem.isNull() ) {
+ TQDataStream out2( toolbarsBlock, IO_WriteOnly );
+ TQDomElement f = toolbarsElem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "toolbar" )
+ outputObject( buddies, objects, strings, out2, f, "TQToolBar" );
+ f = f.nextSibling().toElement();
+ }
+ }
+
+ if ( !buddies.isEmpty() ) {
+ TQDataStream out2( buddiesBlock, IO_WriteOnly );
+ TQMap<int, TQStringList>::ConstIterator a = buddies.begin();
+ while ( a != buddies.end() ) {
+ TQStringList::ConstIterator b = (*a).begin();
+ while ( b != (*a).end() ) {
+ int no = objects.tqfind( *b );
+ if ( no != -1 ) {
+ packUInt16( out2, a.key() );
+ packUInt16( out2, no );
+ }
+ ++b;
+ }
+ ++a;
+ }
+ }
+
+ if ( !connectionsElem.isNull() ) {
+ TQString prevLanguage = "C++";
+ int prevSenderNo = 0;
+ TQString prevSignal = "clicked()";
+ int prevReceiverNo = 0;
+ TQString prevSlot = "accept()";
+
+ TQDataStream out2( connectionsBlock, IO_WriteOnly );
+ TQDomElement f = connectionsElem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "connection" ) {
+ TQMap<TQString, TQString> argMap;
+
+ TQDomElement g = f.firstChild().toElement();
+ while ( !g.isNull() ) {
+ argMap[g.tagName()] = g.firstChild().toText().data();
+ g = g.nextSibling().toElement();
+ }
+
+ TQString language = f.attribute( "language", "C++" );
+ int senderNo = objects.tqfind( argMap["sender"], widgetNo );
+ int receiverNo = objects.tqfind( argMap["receiver"], widgetNo );
+ TQString signal = UibHack::normalize( argMap["signal"] );
+ TQString slot = UibHack::normalize( argMap["slot"] );
+
+ TQ_UINT8 connectionFlags = 0;
+ if ( language != prevLanguage )
+ connectionFlags |= Connection_Language;
+ if ( senderNo != prevSenderNo )
+ connectionFlags |= Connection_Sender;
+ if ( signal != prevSignal )
+ connectionFlags |= Connection_Signal;
+ if ( receiverNo != prevReceiverNo )
+ connectionFlags |= Connection_Receiver;
+ if ( slot != prevSlot )
+ connectionFlags |= Connection_Slot;
+ out2 << connectionFlags;
+
+ if ( connectionFlags & Connection_Language )
+ packString( strings, out2, language );
+ if ( connectionFlags & Connection_Sender )
+ packUInt16( out2, senderNo );
+ if ( connectionFlags & Connection_Signal )
+ packStringSplit( strings, out2, signal, '(' );
+ if ( connectionFlags & Connection_Receiver )
+ packUInt16( out2, receiverNo );
+ if ( connectionFlags & Connection_Slot )
+ packStringSplit( strings, out2, slot, '(' );
+
+ prevLanguage = language;
+ prevSenderNo = senderNo;
+ prevSignal = signal;
+ prevReceiverNo = receiverNo;
+ prevSlot = slot;
+ } else if ( f.tagName() == "slot" ) {
+ // ###
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+
+ {
+ TQDataStream out2( introBlock, IO_WriteOnly );
+ out2 << introFlags;
+ out2 << defaultMargin;
+ out2 << defaultSpacing;
+ packUInt16( out2, objects.count() );
+ packCString( strings, out2, className );
+ }
+
+ out << UibMagic;
+ out << (TQ_UINT8) '\n';
+ out << (TQ_UINT8) '\r';
+ out << (TQ_UINT8) out.version();
+ outputBlock( out, Block_Strings, strings.block() );
+ outputBlock( out, Block_Intro, introBlock );
+ outputBlock( out, Block_Images, imagesBlock );
+ outputBlock( out, Block_Widget, widgetBlock );
+ outputBlock( out, Block_Slots, Q_SLOTSBlock );
+ outputBlock( out, Block_Tabstops, tabstopsBlock );
+ outputBlock( out, Block_Actions, actionsBlock );
+ outputBlock( out, Block_Menubar, menubarBlock );
+ outputBlock( out, Block_Toolbars, toolbarsBlock );
+ outputBlock( out, Block_Variables, variablesBlock );
+ outputBlock( out, Block_Functions, functionsBlock );
+ outputBlock( out, Block_Buddies, buddiesBlock );
+ outputBlock( out, Block_Connections, connectionsBlock );
+ out << (TQ_UINT8) Block_End;
+}
diff --git a/tqtinterface/qt4/tools/designer/shared/ui2uib.h b/tqtinterface/qt4/tools/designer/shared/ui2uib.h
new file mode 100644
index 0000000..cde5b67
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/ui2uib.h
@@ -0,0 +1,42 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef UI2UIB_H
+#define UI2UIB_H
+
+class TQDataStream;
+class TQDomDocument;
+
+void convertUiToUib( TQDomDocument& doc, TQDataStream& out );
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/shared/uib.cpp b/tqtinterface/qt4/tools/designer/shared/uib.cpp
new file mode 100644
index 0000000..2856822
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/uib.cpp
@@ -0,0 +1,49 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "uib.h"
+
+static const char commonStrings[] =
+ "\0()\0(bool)\0(const TQString&)\0(int)\0C++\0Layout1\0PNG\0TQCheckBox\0"
+ "TQComboBox\0TQDialog\0TQFrame\0TQGridLayout\0TQGroupBox\0TQHBoxLayout\0TQLabel\0"
+ "TQLineEdit\0TQListView\0TQPushButton\0TQRadioButton\0TQVBoxLayout\0TQWidget\0"
+ "TextLabel1\0XPM.GZ\0accept\0autoDefault\0buddy\0caption\0clicked\0"
+ "default\0destroy\0frameShadow\0frameShape\0tqgeometry\0init\0margin\0"
+ "tqmaximumSize\0tqminimumSize\0name\0reject\0sizePolicy\0spacing\0text\0title\0"
+ "toolTip\0unnamed\0whatsThis";
+
+UibStrTable::UibStrTable()
+ : out( table, IO_WriteOnly ), start( sizeof(commonStrings) )
+{
+ out.writeRawBytes( commonStrings, start );
+}
diff --git a/tqtinterface/qt4/tools/designer/shared/uib.h b/tqtinterface/qt4/tools/designer/shared/uib.h
new file mode 100644
index 0000000..08a69de
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/uib.h
@@ -0,0 +1,159 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef UIB_H
+#define UIB_H
+
+#include <tqdatastream.h>
+
+const TQ_UINT32 UibMagic = 0xb77c61d8;
+
+enum BlockTag { Block_End = '$', Block_Actions = 'A', Block_Buddies = 'B',
+ Block_Connections = 'C', Block_Functions = 'F',
+ Block_Images = 'G', Block_Intro = 'I', Block_Menubar = 'M',
+ Block_Slots = 'S', Block_Strings = 'Z', Block_Tabstops = 'T',
+ Block_Toolbars = 'O', Block_Variables = 'V',
+ Block_Widget = 'W' };
+
+enum ObjectTag { Object_End = '$', Object_ActionRef = 'X',
+ Object_Attribute = 'B', Object_Column = 'C',
+ Object_Event = 'E', Object_FontProperty = 'F',
+ Object_GridCell = 'G', Object_Item = 'I',
+ Object_MenuItem = 'M', Object_PaletteProperty = 'P',
+ Object_Row = 'R', Object_Separator = 'S', Object_Spacer = 'Y',
+ Object_SubAction = 'A', Object_SubLayout = 'L',
+ Object_SubWidget = 'W', Object_TextProperty = 'T',
+ Object_VariantProperty = 'V' };
+
+enum PaletteTag { Palette_End = '$', Palette_Active = 'A',
+ Palette_Inactive = 'I', Palette_Disabled = 'D',
+ Palette_Color = 'C', Palette_Pixmap = 'P' };
+
+enum IntroFlag { Intro_Pixmapinproject = 0x1 };
+
+enum FontFlag { Font_Family = 0x1, Font_PointSize = 0x2, Font_Bold = 0x4,
+ Font_Italic = 0x8, Font_Underline = 0x10,
+ Font_StrikeOut = 0x20 };
+
+enum ConnectionFlag { Connection_Language = 0x1, Connection_Sender = 0x2,
+ Connection_Signal = 0x4, Connection_Receiver = 0x8,
+ Connection_Slot = 0x10 };
+
+class UibStrTable
+{
+public:
+ UibStrTable();
+
+ inline int insertCString( const char *cstr );
+ inline int insertString( const TQString& str );
+ inline void readBlock( TQDataStream& in, int size );
+
+ inline const char *asCString( int offset ) const;
+ inline TQString asString( int offset ) const;
+ inline TQByteArray block() const;
+
+private:
+ TQCString table;
+ TQDataStream out;
+ int start;
+};
+
+/*
+ uic uses insertCString(), insertString(), and block();
+ TQWidgetFactory uses readBlock(), asCString(), and asString(). By
+ implementing these functions inline, we ensure that the binaries
+ don't contain needless code.
+*/
+
+inline int UibStrTable::insertCString( const char *cstr )
+{
+ if ( cstr == 0 || cstr[0] == 0 ) {
+ return 0;
+ } else {
+ int nextPos = table.size();
+ int len = (int)strlen( cstr );
+ int i;
+ for ( i = 0; i < nextPos - len; i++ ) {
+ if ( memcmp(table.data() + i, cstr, len + 1) == 0 )
+ return i;
+ }
+ for ( i = 0; i < len + 1; i++ )
+ out << (TQ_UINT8) cstr[i];
+ return nextPos;
+ }
+}
+
+inline int UibStrTable::insertString( const TQString& str )
+{
+ if ( str.tqcontains('\0') || str[0] == TQChar(0x7f) ) {
+ int nextPos = table.size();
+ out << (TQ_UINT8) 0x7f;
+ out << str;
+ return nextPos;
+ } else {
+ return insertCString( str.utf8() );
+ }
+}
+
+inline void UibStrTable::readBlock( TQDataStream& in, int size )
+{
+ table.resize( start + size );
+ in.readRawBytes( table.data() + start, size );
+}
+
+inline TQString UibStrTable::asString( int offset ) const
+{
+ if ( table[offset] == 0x7f ) {
+ TQDataStream in( table, IO_ReadOnly );
+ in.tqdevice()->at( offset + 1 );
+ TQString str;
+ in >> str;
+ return str;
+ } else {
+ return TQString::fromUtf8( asCString(offset) );
+ }
+}
+
+inline const char *UibStrTable::asCString( int offset ) const
+{
+ return table.data() + offset;
+}
+
+inline TQByteArray UibStrTable::block() const
+{
+ TQByteArray block;
+ block.duplicate( table.data() + start, table.size() - start );
+ return block;
+}
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/shared/widgetdatabase.cpp b/tqtinterface/qt4/tools/designer/shared/widgetdatabase.cpp
new file mode 100644
index 0000000..a35fd61
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/widgetdatabase.cpp
@@ -0,0 +1,960 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "widgetdatabase.h"
+#include "../interfaces/widgetinterface.h"
+
+#include <tqapplication.h>
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include <tqstrlist.h>
+#include <tqdict.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqcleanuphandler.h>
+#include <tqfeatures.h>
+
+#include <stdlib.h>
+
+const int dbsize = 300;
+const int dbcustom = 200;
+const int dbdictsize = 211;
+static WidgetDatabaseRecord* db[ dbsize ];
+static TQDict<int> *className2Id = 0;
+static int dbcount = 0;
+static int dbcustomcount = 200;
+static TQStrList *wGroups;
+static TQStrList *invisibleGroups;
+static bool whatsThisLoaded = FALSE;
+static TQPluginManager<WidgetInterface> *widgetPluginManager = 0;
+static bool plugins_set_up = FALSE;
+static bool was_in_setup = FALSE;
+
+TQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager;
+
+WidgetDatabaseRecord::WidgetDatabaseRecord()
+{
+ isForm = FALSE;
+ isContainer = FALSE;
+ icon = 0;
+ nameCounter = 0;
+ isCommon = FALSE;
+ isPlugin = FALSE;
+}
+
+WidgetDatabaseRecord::~WidgetDatabaseRecord()
+{
+ delete icon;
+}
+
+
+/*!
+ \class WidgetDatabase widgetdatabase.h
+ \brief The WidgetDatabase class holds information about widgets
+
+ The WidgetDatabase holds information about widgets like toolTip(),
+ iconSet(), ... It works Id-based, so all access functions take the
+ widget id as parameter. To get the id for a widget (classname), use
+ idFromClassName().
+
+ All access functions are static. Having multiple widgetdatabases in
+ one application doesn't make sense anyway and so you don't need more
+ than an instance of the widgetdatabase.
+
+ For creating widgets, layouts, etc. see WidgetFactory.
+*/
+
+/*!
+ Creates widget database. Does nothing.
+*/
+
+WidgetDatabase::WidgetDatabase()
+{
+}
+
+/*! Sets up the widget database. If the static widgetdatabase already
+ exists, the functions returns immediately.
+*/
+
+void WidgetDatabase::setupDataBase( int id )
+{
+ was_in_setup = TRUE;
+#ifndef UIC
+ TQ_UNUSED( id )
+ if ( dbcount )
+ return;
+#else
+ if ( dbcount && id != -2 )
+ return;
+ if ( dbcount && !plugins_set_up ) {
+ setupPlugins();
+ return;
+ }
+ if ( dbcount && plugins_set_up)
+ return;
+#endif
+
+ wGroups = new TQStrList;
+ invisibleGroups = new TQStrList;
+ invisibleGroups->append( "Forms" );
+ invisibleGroups->append( "Temp" );
+ className2Id = new TQDict<int>( dbdictsize );
+ className2Id->setAutoDelete( TRUE );
+
+ WidgetDatabaseRecord *r = 0;
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_pushbutton.png";
+ r->name = "TQPushButton";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Push Button";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_toolbutton.png";
+ r->name = "TQToolButton";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Tool Button";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_radiobutton.png";
+ r->name = "TQRadioButton";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Radio Button";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_checkbox.png";
+ r->name = "TQCheckBox";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Check Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_groupbox.png";
+ r->name = "TQGroupBox";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Group Box";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_buttongroup.png";
+ r->name = "TQButtonGroup";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Button Group";
+ r->isContainer = TRUE;
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_frame.png";
+ r->name = "TQFrame";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Frame";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "TQTabWidget";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Tabwidget";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_widgetstack.png";
+ r->name = "TQWidgetStack";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Widget Stack";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_toolbox.png";
+ r->name = "TQToolBox";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Tool Box";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_listbox.png";
+ r->name = "TQListBox";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "List Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_listview.png";
+ r->name = "TQListView";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "List View";
+
+ append( r );
+
+#if !defined(TQT_NO_ICONVIEW) || defined(UIC)
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_iconview.png";
+ r->name = "TQIconView";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "Icon View";
+
+ append( r );
+#endif
+
+#if !defined(TQT_NO_TABLE)
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_table.png";
+ r->name = "TQTable";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "Table";
+
+ append( r );
+#endif
+
+#if !defined(TQT_NO_SQL)
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_datatable.png";
+ r->includeFile = "tqdatatable.h";
+ r->name = "TQDataTable";
+ r->group = widgetGroup( "Database" );
+ r->toolTip = "Data Table";
+
+ append( r );
+#endif
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_lineedit.png";
+ r->name = "TQLineEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Line Edit";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_spinbox.png";
+ r->name = "TQSpinBox";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Spin Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_dateedit.png";
+ r->name = "TQDateEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Date Edit";
+ r->includeFile = "tqdatetimeedit.h";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_timeedit.png";
+ r->name = "TQTimeEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Time Edit";
+ r->includeFile = "tqdatetimeedit.h";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_datetimeedit.png";
+ r->name = "TQDateTimeEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Date-Time Edit";
+ r->includeFile = "tqdatetimeedit.h";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_multilineedit.png";
+ r->name = "TQMultiLineEdit";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Multi Line Edit";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_richtextedit.png";
+ r->name = "TQTextEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Rich Text Edit";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_combobox.png";
+ r->name = "TQComboBox";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Combo Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_slider.png";
+ r->name = "TQSlider";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Slider";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_scrollbar.png";
+ r->name = "TQScrollBar";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Scrollbar";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_dial.png";
+ r->name = "TQDial";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Dial";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_label.png";
+ r->name = "TQLabel";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Label";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_label.png";
+ r->name = "TextLabel";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Text Label";
+ r->whatsThis = "The Text Label provides a widget to display static text.";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_pixlabel.png";
+ r->name = "PixmapLabel";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Pixmap Label";
+ r->whatsThis = "The Pixmap Label provides a widget to display pixmaps.";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_lcdnumber.png";
+ r->name = "TQLCDNumber";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "LCD Number";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_line.png";
+ r->name = "Line";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Line";
+ r->includeFile = "tqframe.h";
+ r->whatsThis = "The Line widget provides horizontal and vertical lines.";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_progress.png";
+ r->name = "TQProgressBar";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Progress Bar";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_textview.png";
+ r->name = "TQTextView";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Text View";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_textbrowser.png";
+ r->name = "TQTextBrowser";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Text Browser";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_spacer.png";
+ r->name = "Spacer";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Spacer";
+ r->whatsThis = "The Spacer provides horizontal and vertical spacing to be able to manipulate the behaviour of layouts.";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "TQWidget";
+ r->isForm = TRUE;
+ r->group = widgetGroup( "Forms" );
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "TQDialog";
+ r->group = widgetGroup( "Forms" );
+ r->isForm = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "TQWizard";
+ r->group = widgetGroup( "Forms" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "TQDesignerWizard";
+ r->group = widgetGroup( "Forms" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "TQLayoutWidget";
+ r->group = widgetGroup( "Temp" );
+ r->includeFile = "";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "TQSplitter";
+ r->group = widgetGroup( "Temp" );
+ r->includeFile = "tqsplitter.h";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "TQDesignerTabWidget";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "TQDesignerWidget";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "TQDesignerDialog";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "TQMainWindow";
+ r->includeFile = "tqmainwindow.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "TQDesignerAction";
+ r->includeFile = "tqaction.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = FALSE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "TQDesignerActionGroup";
+ r->includeFile = "tqaction.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = FALSE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "TQScrollView";
+ r->includeFile = "tqscrollview.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+#ifndef TQT_NO_SQL
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "TQDataBrowser";
+ r->includeFile = "tqdatabrowser.h";
+ r->group = widgetGroup( "Database" );
+ r->toolTip = "Data Browser";
+ r->iconSet = "designer_databrowser.png";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "TQDataView";
+ r->includeFile = "tqdataview.h";
+ r->group = widgetGroup( "Database" );
+ r->toolTip = "Data View";
+ r->iconSet = "designer_dataview.png";
+ r->isContainer = TRUE;
+
+ append( r );
+#endif
+
+#ifndef UIC
+ setupPlugins();
+#endif
+}
+
+void WidgetDatabase::setupPlugins()
+{
+ if ( plugins_set_up )
+ return;
+ plugins_set_up = TRUE;
+ TQStringList widgets = widgetManager()->featureList();
+ for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) {
+ if ( hasWidget( *it ) )
+ continue;
+ WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( *it, &iface );
+ if ( !iface )
+ continue;
+
+#ifndef UIC
+ TQIconSet icon = iface->iconSet( *it );
+ if ( !icon.pixmap().isNull() )
+ r->icon = new TQIconSet( icon );
+#endif
+ TQString grp = iface->group( *it );
+ if ( grp.isEmpty() )
+ grp = "3rd party widgets";
+ r->group = widgetGroup( grp );
+ r->toolTip = iface->toolTip( *it );
+ r->whatsThis = iface->whatsThis( *it );
+ r->includeFile = iface->includeFile( *it );
+ r->isContainer = iface->isContainer( *it );
+ r->name = *it;
+ r->isPlugin = TRUE;
+ append( r );
+ iface->release();
+ }
+}
+
+/*!
+ Returns the number of elements in the widget database.
+*/
+
+int WidgetDatabase::count()
+{
+ setupDataBase( -1 );
+ return dbcount;
+}
+
+/*!
+ Returns the id at which the ids of custom widgets start.
+*/
+
+int WidgetDatabase::startCustom()
+{
+ setupDataBase( -1 );
+ return dbcustom;
+}
+
+/*!
+ Returns the iconset which represents the class registered as \a id.
+*/
+
+TQIconSet WidgetDatabase::iconSet( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return TQIconSet();
+#if !defined(UIC) && !defined(RESOURCE)
+ if ( !r->icon ) {
+ if ( r->iconSet.isEmpty() )
+ return TQIconSet();
+ TQPixmap pix = TQPixmap::fromMimeSource( r->iconSet );
+ if ( pix.isNull() )
+ pix = TQPixmap( r->iconSet );
+ r->icon = new TQIconSet( pix );
+ }
+ return *r->icon;
+#else
+ return TQIconSet();
+#endif
+}
+
+/*!
+ Returns the classname of the widget which is registered as \a id.
+*/
+
+TQString WidgetDatabase::className( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return TQString();
+ return r->name;
+}
+
+/*!
+ Returns the group the widget registered as \a id belongs to.
+*/
+
+TQString WidgetDatabase::group( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return TQString();
+ return r->group;
+}
+
+/*!
+ Returns the tooltip text of the widget which is registered as \a id.
+*/
+
+TQString WidgetDatabase::toolTip( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return TQString();
+ return r->toolTip;
+}
+
+/*!
+ Returns the what's this? text of the widget which is registered as \a id.
+*/
+
+TQString WidgetDatabase::whatsThis( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return TQString();
+ return r->whatsThis;
+}
+
+/*!
+ Returns the include file if the widget which is registered as \a id.
+*/
+
+TQString WidgetDatabase::includeFile( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return TQString();
+ if ( r->includeFile.isNull() )
+ return r->name.lower() + ".h";
+ return r->includeFile;
+}
+
+/*! Returns whether the widget registered as \a id is a form.
+*/
+bool WidgetDatabase::isForm( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isForm;
+}
+
+/*! Returns whether the widget registered as \a id can have tqchildren.
+*/
+
+bool WidgetDatabase::isContainer( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isContainer || r->isForm;
+}
+
+bool WidgetDatabase::isCommon( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isCommon;
+}
+
+TQString WidgetDatabase::createWidgetName( int id )
+{
+ setupDataBase( id );
+ TQString n = className( id );
+ if ( n == "TQLayoutWidget" )
+ n = "Layout";
+ if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] )
+ n = n.mid( 1 );
+ int colonColon = n.tqfindRev( "::" );
+ if ( colonColon != -1 )
+ n = n.mid( colonColon + 2 );
+
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return n;
+ n += TQString::number( ++r->nameCounter );
+ n[0] = n[0].lower();
+ return n;
+}
+
+/*! Returns the id for \a name or -1 if \a name is unknown.
+ */
+int WidgetDatabase::idFromClassName( const TQString &name )
+{
+ setupDataBase( -1 );
+ if ( name.isEmpty() )
+ return 0;
+ int *i = className2Id->tqfind( name );
+ if ( i )
+ return *i;
+ if ( name == "FormWindow" )
+ return idFromClassName( "TQLayoutWidget" );
+#ifdef UIC
+ setupDataBase( -2 );
+ i = className2Id->tqfind( name );
+ if ( i )
+ return *i;
+#endif
+ return -1;
+}
+
+bool WidgetDatabase::hasWidget( const TQString &name )
+{
+ return className2Id->tqfind( name ) != 0;
+}
+
+WidgetDatabaseRecord *WidgetDatabase::at( int index )
+{
+ if ( index < 0 )
+ return 0;
+ if ( index >= dbcustom && index < dbcustomcount )
+ return db[ index ];
+ if ( index < dbcount )
+ return db[ index ];
+ return 0;
+}
+
+void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r )
+{
+ if ( index < 0 || index >= dbsize )
+ return;
+ db[ index ] = r;
+ className2Id->insert( r->name, new int( index ) );
+ if ( index < dbcustom )
+ dbcount = TQMAX( dbcount, index );
+}
+
+void WidgetDatabase::append( WidgetDatabaseRecord *r )
+{
+ if ( !was_in_setup )
+ setupDataBase( -1 );
+ insert( dbcount++, r );
+}
+
+TQString WidgetDatabase::widgetGroup( const TQString &g )
+{
+ if ( wGroups->tqfind( g ) == -1 )
+ wGroups->append( g );
+ return g;
+}
+
+bool WidgetDatabase::isGroupEmpty( const TQString &grp )
+{
+ WidgetDatabaseRecord *r = 0;
+ for ( int i = 0; i < dbcount; ++i ) {
+ if ( !( r = db[ i ] ) )
+ continue;
+ if ( r->group == grp )
+ return FALSE;
+ }
+ return TRUE;
+}
+
+TQString WidgetDatabase::widgetGroup( int i )
+{
+ setupDataBase( -1 );
+ if ( i >= 0 && i < (int)wGroups->count() )
+ return wGroups->at( i );
+ return TQString();
+}
+
+int WidgetDatabase::numWidgetGroups()
+{
+ setupDataBase( -1 );
+ return wGroups->count();
+}
+
+bool WidgetDatabase::isGroupVisible( const TQString &g )
+{
+ setupDataBase( -1 );
+ return invisibleGroups->tqfind( g ) == -1;
+}
+
+int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r )
+{
+ insert( dbcustomcount++, r );
+ return dbcustomcount - 1;
+}
+
+void WidgetDatabase::customWidgetClassNameChanged( const TQString &oldName,
+ const TQString &newName )
+{
+ int id = idFromClassName( oldName );
+ if ( id == -1 )
+ return;
+ WidgetDatabaseRecord *r = db[ id ];
+ r->name = newName;
+ className2Id->remove( oldName );
+ className2Id->insert( newName, new int( id ) );
+}
+
+bool WidgetDatabase::isCustomWidget( int id )
+{
+ if ( id >= dbcustom && id < dbcustomcount )
+ return TRUE;
+ return FALSE;
+}
+
+bool WidgetDatabase::isCustomPluginWidget( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isPlugin;
+}
+
+bool WidgetDatabase::isWhatsThisLoaded()
+{
+ return whatsThisLoaded;
+}
+
+void WidgetDatabase::loadWhatsThis( const TQString &docPath )
+{
+ TQString whatsthisFile = docPath + "/whatsthis";
+ TQFile f( whatsthisFile );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ TQTextStream ts( &f );
+ while ( !ts.atEnd() ) {
+ TQString s = ts.readLine();
+ TQStringList l = TQStringList::split( " | ", s );
+ int id = idFromClassName( l[ 1 ] );
+ WidgetDatabaseRecord *r = at( id );
+ if ( r )
+ r->whatsThis = l[ 0 ];
+ }
+ whatsThisLoaded = TRUE;
+}
+
+
+// ### TQt 3.1: make these publically accessible via TQWidgetDatabase API
+#if defined(UIC)
+bool dbnounload = FALSE;
+TQStringList *dbpaths = 0;
+#else
+extern TQString *qwf_plugin_dir;
+#endif
+
+
+TQPluginManager<WidgetInterface> *widgetManager()
+{
+ if ( !widgetPluginManager ) {
+ TQString pluginDir = "/designer";
+#if !defined(UIC)
+ if ( qwf_plugin_dir )
+ pluginDir = *qwf_plugin_dir;
+#endif
+ widgetPluginManager = new TQPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), pluginDir );
+ cleanup_manager.add( &widgetPluginManager );
+#if defined(UIC)
+ if ( dbnounload )
+ widgetPluginManager->setAutoUnload( FALSE );
+ if ( dbpaths ) {
+ TQStringList::ConstIterator it = dbpaths->begin();
+ for ( ; it != dbpaths->end(); ++it )
+ widgetPluginManager->addLibraryPath( *it );
+ }
+#endif
+ }
+ return widgetPluginManager;
+}
diff --git a/tqtinterface/qt4/tools/designer/shared/widgetdatabase.h b/tqtinterface/qt4/tools/designer/shared/widgetdatabase.h
new file mode 100644
index 0000000..9b083ba
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/shared/widgetdatabase.h
@@ -0,0 +1,103 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef WIDGETDATABASE_H
+#define WIDGETDATABASE_H
+
+#include <tqiconset.h>
+#include <tqstring.h>
+#include "../interfaces/widgetinterface.h" // up here for GCC 2.7.* compatibility
+#include <private/tqpluginmanager_p.h>
+
+
+extern TQPluginManager<WidgetInterface> *widgetManager();
+
+struct WidgetDatabaseRecord
+{
+ WidgetDatabaseRecord();
+ ~WidgetDatabaseRecord();
+ TQString iconSet, name, group, toolTip, whatsThis, includeFile;
+ uint isContainer : 1;
+ uint isForm : 1;
+ uint isCommon : 1;
+ uint isPlugin : 1;
+ TQIconSet *icon;
+ int nameCounter;
+};
+
+class WidgetDatabase : public TQt
+{
+public:
+ WidgetDatabase();
+ static void setupDataBase( int id );
+ static void setupPlugins();
+
+ static int count();
+ static int startCustom();
+
+ static TQIconSet iconSet( int id );
+ static TQString className( int id );
+ static TQString group( int id );
+ static TQString toolTip( int id );
+ static TQString whatsThis( int id );
+ static TQString includeFile( int id );
+ static bool isForm( int id );
+ static bool isContainer( int id );
+ static bool isCommon( int id );
+
+ static int idFromClassName( const TQString &name );
+ static TQString createWidgetName( int id );
+
+ static WidgetDatabaseRecord *at( int index );
+ static void insert( int index, WidgetDatabaseRecord *r );
+ static void append( WidgetDatabaseRecord *r );
+
+ static TQString widgetGroup( const TQString &g );
+ static TQString widgetGroup( int i );
+ static int numWidgetGroups();
+ static bool isGroupVisible( const TQString &g );
+ static bool isGroupEmpty( const TQString &grp );
+
+ static int addCustomWidget( WidgetDatabaseRecord *r );
+ static bool isCustomWidget( int id );
+ static bool isCustomPluginWidget( int id );
+
+ static bool isWhatsThisLoaded();
+ static void loadWhatsThis( const TQString &docPath );
+
+ static bool hasWidget( const TQString &name );
+ static void customWidgetClassNameChanged( const TQString &oldName, const TQString &newName );
+
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/templates/Configuration_Dialog.ui b/tqtinterface/qt4/tools/designer/templates/Configuration_Dialog.ui
new file mode 100644
index 0000000..9ae02fe
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/templates/Configuration_Dialog.ui
@@ -0,0 +1,162 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MyDialog2</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>MyDialog2</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>597</width>
+ <height>364</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog2</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListBox" row="0" column="0">
+ <item>
+ <property name="text">
+ <string>New Item</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>listBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="TQTabWidget" row="0" column="1">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget2</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget3</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <number>4144</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog2</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog2</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Bottom).ui b/tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Bottom).ui
new file mode 100644
index 0000000..24ecc7f
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Bottom).ui
@@ -0,0 +1,122 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MyDialog</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>MyDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>511</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>240</y>
+ <width>476</width>
+ <height>33</height>
+ </rect>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <number>4144</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Right).ui b/tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Right).ui
new file mode 100644
index 0000000..dd354f0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/templates/Dialog_with_Buttons_(Right).ui
@@ -0,0 +1,122 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MyDialog</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>MyDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>592</width>
+ <height>470</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>500</x>
+ <y>30</y>
+ <width>82</width>
+ <height>410</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <number>4144</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/templates/Tab_Dialog.ui b/tqtinterface/qt4/tools/designer/templates/Tab_Dialog.ui
new file mode 100644
index 0000000..64a2ed3
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/templates/Tab_Dialog.ui
@@ -0,0 +1,146 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MyDialog1</class>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>MyDialog1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>528</width>
+ <height>368</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog1</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget8</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>Widget9</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <number>4144</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/designer/tools/conv2ui/conv2ui.pro b/tqtinterface/qt4/tools/designer/tools/conv2ui/conv2ui.pro
new file mode 100644
index 0000000..73ffd7e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/tools/conv2ui/conv2ui.pro
@@ -0,0 +1,10 @@
+######################################################################
+# Automatically generated by qmake (1.04a) Tue Oct 1 18:34:56 2002
+######################################################################
+TEMPLATE = app
+CONFIG -= tqmoc
+
+# Input
+INCLUDEPATH += ../../interfaces
+SOURCES += main.cpp
+DESTDIR = $$QT_BUILD_TREE/bin
diff --git a/tqtinterface/qt4/tools/designer/tools/conv2ui/main.cpp b/tqtinterface/qt4/tools/designer/tools/conv2ui/main.cpp
new file mode 100644
index 0000000..678c7f0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/tools/conv2ui/main.cpp
@@ -0,0 +1,220 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt GUI Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqapplication.h>
+#include <private/tqpluginmanager_p.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
+#include <stdio.h>
+#include "filterinterface.h"
+#include <tqfileinfo.h>
+
+class Conv2ui {
+public:
+ Conv2ui();
+ ~Conv2ui();
+ bool reinit();
+ bool convert( const TQString & filename, const TQDir & dest );
+ TQStringList featureList();
+private:
+ TQString getTag( const TQString & filename );
+ TQString absName( const TQString & filename );
+ TQPluginManager<ImportFilterInterface> * importFiltersManager;
+};
+
+Conv2ui::Conv2ui() : importFiltersManager( 0 )
+{
+ reinit();
+}
+
+Conv2ui::~Conv2ui()
+{
+ if ( importFiltersManager )
+ delete importFiltersManager;
+}
+
+bool Conv2ui::reinit()
+{
+ if ( importFiltersManager )
+ delete importFiltersManager;
+ importFiltersManager = new TQPluginManager<ImportFilterInterface>( IID_ImportFilter,
+ TQApplication::libraryPaths(),
+ "/designer");
+ return !!importFiltersManager;
+}
+
+bool Conv2ui::convert( const TQString & filename, const TQDir & dest )
+{
+ if ( !importFiltersManager ) {
+ qWarning( "Conv2ui: no TQPluginManager was found" );
+ return FALSE;
+ }
+
+ if ( !TQFile::exists( absName( filename ) ) ) {
+ qWarning( "Conv2ui: can not tqfind file %s", filename.latin1() );
+ return FALSE;
+ }
+
+ TQString tag = getTag( filename );
+ TQStringList lst = importFiltersManager->featureList();
+
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+
+ ImportFilterInterface * interface = 0;
+ importFiltersManager->queryInterface( *it, &interface );
+
+ if ( !interface ) continue;
+
+ if ( (*it).tqcontains( tag, FALSE ) ) {
+ // Make sure we output the files in the destination dir
+ TQString absfile = absName( filename );
+ TQString current = TQDir::currentDirPath();
+ TQDir::setCurrent( dest.absPath() );
+ interface->import( *it, absfile ); // resulting files go into the current dir
+ TQDir::setCurrent( current );
+ }
+
+ interface->release();
+
+ }
+
+ return TRUE;
+}
+
+TQStringList Conv2ui::featureList()
+{
+ if ( !importFiltersManager ) {
+ return 0;
+ }
+ return importFiltersManager->featureList();
+}
+
+TQString Conv2ui::getTag( const TQString & filename )
+{
+ TQFileInfo info( filename );
+ return info.extension();
+}
+
+TQString Conv2ui::absName( const TQString & filename )
+{
+ TQString absFileName = TQDir::isRelativePath( filename ) ?
+ TQDir::currentDirPath() +
+ TQDir::separator() +
+ filename :
+ filename;
+ return absFileName;
+}
+
+void printHelpMessage( TQStringList & formats )
+{
+ printf( "Usage: conv2ui [options] <file> <destination directory>\n\n" );
+ printf( "Options:\n");
+ printf( "\t-help\t\tDisplay this information\n" );
+ printf( "\t-silent\t\tDon't write any messages\n");
+ printf( "\t-version\tDisplay version of conv2ui\n");
+ printf( "Supported file formats:\n" );
+ for ( TQStringList::Iterator it = formats.begin(); it != formats.end(); ++it )
+ printf( "\t%s\n", (*it).latin1() );
+}
+
+void printVersion()
+{
+ printf( "TQt user interface file converter for TQt version %s\n", TQT_VERSION_STR );
+}
+
+int main( int argc, char ** argv )
+{
+ Conv2ui conv;
+
+ bool help = TRUE;
+ bool silent = FALSE;
+ bool version = FALSE;
+ bool unrecognized = FALSE;
+
+ // parse options
+ int argi = 1;
+ while ( argi < argc && argv[argi][0] == '-' ) {
+ int i = 1;
+ while ( argv[argi][i] != '\0' ) {
+
+ if ( argv[argi][i] == 's' ) {
+ silent = TRUE;
+ break;
+ } else if ( argv[argi][i] == 'h' ) {
+ help = TRUE;
+ break;
+ } else if ( argv[argi][i] == 'v' ) {
+ version = TRUE;
+ silent = TRUE;
+ break;
+ } else {
+ unrecognized = TRUE;
+ }
+ i++;
+ }
+ argi++;
+ }
+
+ // get source file
+ TQString src;
+ if ( argv[argi] ) {
+ src = argv[argi++];
+ }
+
+ // get destination directory
+ TQDir dst;
+ if ( argv[argi] ) {
+ dst.setPath( argv[argi++] );
+ help = FALSE;
+ }
+
+ if ( !silent ) {
+ printf( "TQt user interface file converter.\n" );
+ if ( unrecognized ) {
+ printf( "conv2ui: Unrecognized option\n" );
+ }
+ }
+ if ( version ) {
+ printVersion();
+ return 0;
+ } else if ( help ) {
+ TQStringList formats = conv.featureList();
+ printHelpMessage( formats );
+ return 0;
+ }
+
+ // do the magic
+ if ( conv.convert( src, dst ) )
+ return 0;
+ return -1;
+}
diff --git a/tqtinterface/qt4/tools/designer/tools/createcw/README b/tqtinterface/qt4/tools/designer/tools/createcw/README
new file mode 100644
index 0000000..81e1676
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/tools/createcw/README
@@ -0,0 +1,18 @@
+This small application makes it much easier to create custom widget
+descriptions for Qt Designer. Using them you can use custom widgets
+in Qt Designer including their Q_SIGNALS, Q_SLOTS and properties.
+
+The usual way to do this is to enter all the information in the custom
+widget dialog in Qt Designer for each widget. But this small tool can
+create these description files for your custom widgets which you then
+can simply import into Qt Designer. So you can use your custom widgets
+without any additional work in your forms in Qt Designer.
+
+To do this you must modify the sourcecode (main.cpp) a bit and
+recompile it afterwards. For further instructions how to use it see
+the comments starting with STEP1 and STEP2 in main.cpp.
+
+Note that Qt Designer now supports widget plugins which are more
+versatile and work just like built-in widgets, so you may prefer to
+make your custom widgets into plugins. See the designer manual for
+more information.
diff --git a/tqtinterface/qt4/tools/designer/tools/createcw/createcw.pro b/tqtinterface/qt4/tools/designer/tools/createcw/createcw.pro
new file mode 100644
index 0000000..521f9c7
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/tools/createcw/createcw.pro
@@ -0,0 +1,5 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+HEADERS =
+SOURCES = main.cpp
+TARGET = createcw
diff --git a/tqtinterface/qt4/tools/designer/tools/createcw/main.cpp b/tqtinterface/qt4/tools/designer/tools/createcw/main.cpp
new file mode 100644
index 0000000..4a5b8ae
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/tools/createcw/main.cpp
@@ -0,0 +1,190 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt GUI Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqvaluelist.h>
+#include <tqstrlist.h>
+#include <tqmetaobject.h>
+#include <tqapplication.h>
+
+// STEP1: Include header files of the widgets for which a description
+// should be created here. If you have a widget which is defined in
+// the file mycustomwidget.h in /home/joedeveloper/src, write here
+//
+// #include "/home/joedeveloper/src/mycustomwidget.h"
+//
+// Now go on to STEP2!
+
+// -----------------------------
+
+struct Widget
+{
+ TQWidget *w; // the widget
+ TQString include; // header file
+ TQString location; // "global" for include <...> or "local" include "..."
+};
+
+static TQString makeIndent( int indent )
+{
+ TQString s;
+ s.fill( ' ', indent * 4 );
+ return s;
+}
+
+static TQString entitize( const TQString &s )
+{
+ TQString s2 = s;
+ s2 = s2.tqreplace( "\"", "&quot;" );
+ s2 = s2.tqreplace( "&", "&amp;" );
+ s2 = s2.tqreplace( ">", "&gt;" );
+ s2 = s2.tqreplace( "<", "&lt;" );
+ s2 = s2.tqreplace( "'", "&apos;" );
+ return s2;
+}
+
+static TQString convert_type( const TQString &s )
+{
+ TQString str( s );
+ if ( str[ 0 ] == 'Q' )
+ str.remove( 0, 1 );
+ str[ 0 ] = str[ 0 ].upper();
+ return str;
+}
+
+static void createDescription( const TQValueList<Widget> &l, TQTextStream &ts )
+{
+ int indent = 0;
+ ts << "<!DOCTYPE CW><CW>" << endl;
+ ts << makeIndent( indent ) << "<customwidgets>" << endl;
+ indent++;
+
+ for ( TQValueList<Widget>::ConstIterator it = l.begin(); it != l.end(); ++it ) {
+ Widget w = *it;
+ ts << makeIndent( indent ) << "<customwidget>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<class>" << w.w->className() << "</class>" << endl;
+ ts << makeIndent( indent ) << "<header location=\"" << w.location << "\">" << w.include << "</header>" << endl;
+ ts << makeIndent( indent ) << "<sizehint>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<width>" << w.w->tqsizeHint().width() << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << w.w->tqsizeHint().height() << "</height>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizehint>" << endl;
+ ts << makeIndent( indent ) << "<container>" << ( w.w->inherits( "TQGroupBox" ) || w.w->inherits( "TQWidgetStack" ) ) << "</container>" << endl;
+ ts << makeIndent( indent ) << "<sizepolicy>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<hordata>" << (int)w.w->sizePolicy().horData() << "</hordata>" << endl;
+ ts << makeIndent( indent ) << "<verdata>" << (int)w.w->sizePolicy().verData() << "</verdata>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizepolicy>" << endl;
+
+ TQStrList sigs = w.w->tqmetaObject()->signalNames( TRUE );
+ if ( !sigs.isEmpty() ) {
+ for ( int i = 0; i < (int)sigs.count(); ++i )
+ ts << makeIndent( indent ) << "<signal>" << entitize( sigs.at( i ) ) << "</signal>" << endl;
+ }
+ TQStrList slts = w.w->tqmetaObject()->slotNames( TRUE );
+ if ( !slts.isEmpty() ) {
+ for ( int i = 0; i < (int)slts.count(); ++i ) {
+ TQMetaData::Access data = w.w->tqmetaObject()->slot( i, TRUE )->access;
+ if ( data == TQMetaData::Private )
+ continue;
+ ts << makeIndent( indent ) << "<slot access=\""
+ << ( data == TQMetaData::Protected ? "protected" : "public" )
+ << "\">" << entitize( slts.at( i ) ) << "</slot>" << endl;
+ }
+ }
+ TQStrList props = w.w->tqmetaObject()->propertyNames( TRUE );
+ if ( !props.isEmpty() ) {
+ for ( int i = 0; i < (int)props.count(); ++i ) {
+ const TQMetaProperty *p = w.w->tqmetaObject()->
+ property( w.w->tqmetaObject()->
+ tqfindProperty( props.at( i ), TRUE ), TRUE );
+ if ( !p )
+ continue;
+ if ( !p->writable() || !p->designable( w.w ) )
+ continue;
+ ts << makeIndent( indent ) << "<property type=\"" << convert_type( p->type() ) << "\">" << entitize( p->name() ) << "</property>" << endl;
+ }
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</customwidget>" << endl;
+ }
+
+ indent--;
+ ts << makeIndent( indent ) << "</customwidgets>" << endl;
+ ts << "</CW>" << endl;
+}
+
+int main( int argc, char **argv )
+{
+ if ( argc < 2 )
+ return -1;
+ TQString fn = argv[1];
+ TQFile f( fn );
+ if ( !f.open( IO_WriteOnly ) )
+ return -1;
+ TQTextStream ts( &f );
+ TQApplication a( argc, argv );
+
+ TQValueList<Widget> wl;
+
+ // STEP2: Instantiate all widgets for which a description should
+ // be created here and add them to the list wl. If your custom widget
+ // is e.g. called MyCustomWidget you would write here
+ //
+ // Widget w;
+ // w.w = new MyCustomWidget( 0, 0 );
+ // w.include = "mycustomwidget.h";
+ // w.location = "global";
+ // wl.append( w );
+ //
+ // After that compile the program, link it with your custom widget
+ // (library or object file) and run it like this:
+ // (unix): ./createcw mywidgets.cw
+ // (win32): createcw mywidgets.cw
+ //
+ // After that you can import this description file into the TQt
+ // Designer using the Custom-Widget Dialog (See
+ // Tools->Custom->Edit Custom Widgets... in the TQt Designer)
+ // and use these custom widget there in your forms.
+
+
+
+ // ----------------------------------------------
+
+ createDescription( wl, ts );
+ f.close();
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/designer/uic/embed.cpp b/tqtinterface/qt4/tools/designer/uic/embed.cpp
new file mode 100644
index 0000000..f6b2f02
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/embed.cpp
@@ -0,0 +1,316 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "uic.h"
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqstringlist.h>
+#include <tqdatetime.h>
+#include <tqfileinfo.h>
+#include <stdio.h>
+#include <ctype.h>
+
+// on embedded, we do not compress image data. Rationale: by mapping
+// the ready-only data directly into memory we are both faster and
+// more memory efficient
+#if defined(TQ_WS_TQWS) && !defined(TQT_NO_IMAGE_COLLECTION_COMPRESSION)
+#define TQT_NO_IMAGE_COLLECTION_COMPRESSION
+#endif
+
+struct EmbedImage
+{
+ ~EmbedImage() { delete[] colorTable; }
+ int width, height, depth;
+ int numColors;
+ TQRgb* colorTable;
+ TQString name;
+ TQString cname;
+ bool alpha;
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ ulong compressed;
+#endif
+};
+
+static TQString convertToCIdentifier( const char *s )
+{
+ TQString r = s;
+ int len = r.length();
+ if ( len > 0 && !isalpha( (char)r[0].latin1() ) )
+ r[0] = '_';
+ for ( int i=1; i<len; i++ ) {
+ if ( !isalnum( (char)r[i].latin1() ) )
+ r[i] = '_';
+ }
+ return r;
+}
+
+
+static ulong embedData( TQTextStream& out, const uchar* input, int nbytes )
+{
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ TQByteArray bazip( tqCompress( input, nbytes ) );
+ ulong len = bazip.size();
+#else
+ ulong len = nbytes;
+#endif
+ static const char hexdigits[] = "0123456789abcdef";
+ TQString s;
+ for ( int i=0; i<(int)len; i++ ) {
+ if ( (i%14) == 0 ) {
+ s += "\n ";
+ out << (const char*)s;
+ s.truncate( 0 );
+ }
+ uint v = (uchar)
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ bazip
+#else
+ input
+#endif
+ [i];
+ s += "0x";
+ s += hexdigits[(v >> 4) & 15];
+ s += hexdigits[v & 15];
+ if ( i < (int)len-1 )
+ s += ',';
+ }
+ if ( s.length() )
+ out << (const char*)s;
+ return len;
+}
+
+static void embedData( TQTextStream& out, const TQRgb* input, int n )
+{
+ out << hex;
+ const TQRgb *v = input;
+ for ( int i=0; i<n; i++ ) {
+ if ( (i%14) == 0 )
+ out << "\n ";
+ out << "0x";
+ out << hex << *v++;
+ if ( i < n-1 )
+ out << ',';
+ }
+ out << dec; // back to decimal mode
+}
+
+void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images )
+{
+
+ TQString cProject = convertToCIdentifier( project );
+
+ TQStringList::ConstIterator it;
+ out << "/****************************************************************************\n";
+ out << "** Image collection for project '" << project << "'.\n";
+ out << "**\n";
+ out << "** Generated from reading image files: \n";
+ for ( it = images.begin(); it != images.end(); ++it )
+ out << "** " << *it << "\n";
+ out << "**\n";
+ out << "** Created: " << TQDateTime::tqcurrentDateTime().toString() << "\n";
+ out << "**\n";
+ out << "** WARNING! All changes made in this file will be lost!\n";
+ out << "****************************************************************************/\n";
+ out << "\n";
+
+ out << "#include <tqimage.h>\n";
+ out << "#include <tqdict.h>\n";
+ out << "#include <tqmime.h>\n";
+ out << "#include <tqdragobject.h>\n";
+ out << "\n";
+
+ TQPtrList<EmbedImage> list_image;
+ list_image.setAutoDelete( TRUE );
+ int image_count = 0;
+ for ( it = images.begin(); it != images.end(); ++it ) {
+ TQImage img;
+ if ( !img.load( *it ) ) {
+ fprintf( stderr, "uic: cannot load image file %s\n", (*it).latin1() );
+ continue;
+ }
+ EmbedImage *e = new EmbedImage;
+ e->width = img.width();
+ e->height = img.height();
+ e->depth = img.depth();
+ e->numColors = img.numColors();
+ e->colorTable = new TQRgb[e->numColors];
+ e->alpha = img.hasAlphaBuffer();
+ memcpy(e->colorTable, img.tqcolorTable(), e->numColors*sizeof(TQRgb));
+ TQFileInfo fi( *it );
+ e->name = fi.fileName();
+ e->cname = TQString("image_%1").arg( image_count++);
+ list_image.append( e );
+ out << "// " << *it << "\n";
+ TQString s;
+ if ( e->depth == 1 )
+ img = img.convertBitOrder(TQImage::BigEndian);
+ out << s.sprintf( "static const unsigned char %s_data[] = {",
+ (const char *)e->cname );
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ e->compressed =
+#endif
+ embedData( out, img.bits(), img.numBytes() );
+ out << "\n};\n\n";
+ if ( e->numColors ) {
+ out << s.sprintf( "static const TQRgb %s_ctable[] = {",
+ (const char *)e->cname );
+ embedData( out, e->colorTable, e->numColors );
+ out << "\n};\n\n";
+ }
+ }
+
+ if ( !list_image.isEmpty() ) {
+ out << "static struct EmbedImage {\n"
+ " int width, height, depth;\n"
+ " const unsigned char *data;\n"
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ " ulong compressed;\n"
+#endif
+ " int numColors;\n"
+ " const TQRgb *colorTable;\n"
+ " bool alpha;\n"
+ " const char *name;\n"
+ "} embed_image_vec[] = {\n";
+ EmbedImage *e = list_image.first();
+ while ( e ) {
+ out << " { "
+ << e->width << ", "
+ << e->height << ", "
+ << e->depth << ", "
+ << "(const unsigned char*)" << e->cname << "_data, "
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ << e->compressed << ", "
+#endif
+ << e->numColors << ", ";
+ if ( e->numColors )
+ out << e->cname << "_ctable, ";
+ else
+ out << "0, ";
+ if ( e->alpha )
+ out << "TRUE, ";
+ else
+ out << "FALSE, ";
+ out << "\"" << e->name << "\" },\n";
+ e = list_image.next();
+ }
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ out << " { 0, 0, 0, 0, 0, 0, 0, 0, 0 }\n};\n";
+#else
+ out << " { 0, 0, 0, 0, 0, 0, 0, 0 }\n};\n";
+#endif
+
+ out << "\n"
+ "static TQImage uic_tqfindImage( const TQString& name )\n"
+ "{\n"
+ " for ( int i=0; embed_image_vec[i].data; i++ ) {\n"
+ " if ( TQString::fromUtf8(embed_image_vec[i].name) == name ) {\n"
+#ifndef TQT_NO_IMAGE_COLLECTION_COMPRESSION
+ " TQByteArray baunzip;\n"
+ " baunzip = tqUncompress( embed_image_vec[i].data, \n"
+ " embed_image_vec[i].compressed );\n"
+ " TQImage img((uchar*)baunzip.data(),\n"
+ " embed_image_vec[i].width,\n"
+ " embed_image_vec[i].height,\n"
+ " embed_image_vec[i].depth,\n"
+ " (TQRgb*)embed_image_vec[i].colorTable,\n"
+ " embed_image_vec[i].numColors,\n"
+ " TQImage::BigEndian\n"
+ " );\n"
+ " img = img.copy();\n"
+#else
+ " TQImage img((uchar*)embed_image_vec[i].data,\n"
+ " embed_image_vec[i].width,\n"
+ " embed_image_vec[i].height,\n"
+ " embed_image_vec[i].depth,\n"
+ " (TQRgb*)embed_image_vec[i].colorTable,\n"
+ " embed_image_vec[i].numColors,\n"
+ " TQImage::BigEndian\n"
+ " );\n"
+#endif
+ " if ( embed_image_vec[i].alpha )\n"
+ " img.setAlphaBuffer(TRUE);\n"
+ " return img;\n"
+ " }\n"
+ " }\n"
+ " return TQImage();\n"
+ "}\n\n";
+
+ out << "class MimeSourceFactory_" << cProject << " : public TQMimeSourceFactory\n";
+ out << "{\n";
+ out << "public:\n";
+ out << " MimeSourceFactory_" << cProject << "() {}\n";
+ out << " ~MimeSourceFactory_" << cProject << "() {}\n";
+ out << " const TQMimeSource* data( const TQString& abs_name ) const {\n";
+ out << "\tconst TQMimeSource* d = TQMimeSourceFactory::data( abs_name );\n";
+ out << "\tif ( d || abs_name.isNull() ) return d;\n";
+ out << "\tTQImage img = uic_tqfindImage( abs_name );\n";
+ out << "\tif ( !img.isNull() )\n";
+ out << "\t ((TQMimeSourceFactory*)this)->setImage( abs_name, img );\n";
+ out << "\treturn TQMimeSourceFactory::data( abs_name );\n";
+ out << " };\n";
+ out << "};\n\n";
+
+ out << "static TQMimeSourceFactory* factory = 0;\n";
+ out << "\n";
+
+ out << "void qInitImages_" << cProject << "()\n";
+ out << "{\n";
+ out << " if ( !factory ) {\n";
+ out << "\tfactory = new MimeSourceFactory_" << cProject << ";\n";
+ out << "\tTQMimeSourceFactory::defaultFactory()->addFactory( factory );\n";
+ out << " }\n";
+ out << "}\n\n";
+
+ out << "void qCleanupImages_" << cProject << "()\n";
+ out << "{\n";
+ out << " if ( factory ) {\n";
+ out << "\tTQMimeSourceFactory::defaultFactory()->removeFactory( factory );\n";
+ out << "\tdelete factory;\n";
+ out << "\tfactory = 0;\n";
+ out << " }\n";
+ out << "}\n\n";
+
+ out << "class StaticInitImages_" << cProject << "\n";
+ out << "{\n";
+ out << "public:\n";
+ out << " StaticInitImages_" << cProject << "() { qInitImages_" << cProject << "(); }\n";
+ out << "#if defined(TQ_OS_SCO) || defined(TQ_OS_UNIXWARE)\n";
+ out << " ~StaticInitImages_" << cProject << "() { }\n";
+ out << "#else\n";
+ out << " ~StaticInitImages_" << cProject << "() { qCleanupImages_" << cProject << "(); }\n";
+ out << "#endif\n";
+ out << "};\n\n";
+
+ out << "static StaticInitImages_" << cProject << " staticImages;\n";
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/uic/form.cpp b/tqtinterface/qt4/tools/designer/uic/form.cpp
new file mode 100644
index 0000000..5fbbf14
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/form.cpp
@@ -0,0 +1,1462 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "uic.h"
+#include "parser.h"
+#include "widgetdatabase.h"
+#include "domtool.h"
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqdir.h>
+#include <tqregexp.h>
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+
+static TQByteArray unzipXPM( TQString data, ulong& length )
+{
+ const int lengthOffset = 4;
+ int baSize = data.length() / 2 + lengthOffset;
+ uchar *ba = new uchar[ baSize ];
+ for ( int i = lengthOffset; i < baSize; ++i ) {
+ char h = data[ 2 * (i-lengthOffset) ].latin1();
+ char l = data[ 2 * (i-lengthOffset) + 1 ].latin1();
+ uchar r = 0;
+ if ( h <= '9' )
+ r += h - '0';
+ else
+ r += h - 'a' + 10;
+ r = r << 4;
+ if ( l <= '9' )
+ r += l - '0';
+ else
+ r += l - 'a' + 10;
+ ba[ i ] = r;
+ }
+ // tqUncompress() expects the first 4 bytes to be the expected length of the
+ // uncompressed data
+ ba[0] = ( length & 0xff000000 ) >> 24;
+ ba[1] = ( length & 0x00ff0000 ) >> 16;
+ ba[2] = ( length & 0x0000ff00 ) >> 8;
+ ba[3] = ( length & 0x000000ff );
+ TQByteArray baunzip = tqUncompress( ba, baSize );
+ delete[] ba;
+ return baunzip;
+}
+
+#if TQT_VERSION >= 0x030900
+#error Add this functionality to TQDir (relativePathTo() maybe?) and \
+remove it from here and from tqmoc
+#endif
+
+TQCString combinePath( const char *infile, const char *outfile )
+{
+ TQFileInfo inFileInfo( TQDir::current(), TQFile::decodeName(infile) );
+ TQFileInfo outFileInfo( TQDir::current(), TQFile::decodeName(outfile) );
+ int numCommonComponents = 0;
+
+ TQStringList inSplitted =
+ TQStringList::split( '/', inFileInfo.dir().canonicalPath(), TRUE );
+ TQStringList outSplitted =
+ TQStringList::split( '/', outFileInfo.dir().canonicalPath(), TRUE );
+
+ while ( !inSplitted.isEmpty() && !outSplitted.isEmpty() &&
+ inSplitted.first() == outSplitted.first() ) {
+ inSplitted.remove( inSplitted.begin() );
+ outSplitted.remove( outSplitted.begin() );
+ numCommonComponents++;
+ }
+
+ if ( numCommonComponents < 2 ) {
+ /*
+ The paths don't have the same drive, or they don't have the
+ same root directory. Use an absolute path.
+ */
+ return TQFile::encodeName( inFileInfo.absFilePath() );
+ } else {
+ /*
+ The paths have something in common. Use a path relative to
+ the output file.
+ */
+ while ( !outSplitted.isEmpty() ) {
+ outSplitted.remove( outSplitted.begin() );
+ inSplitted.prepend( ".." );
+ }
+ inSplitted.append( inFileInfo.fileName() );
+ return TQFile::encodeName( inSplitted.join("/") );
+ }
+}
+
+/*!
+ Creates a declaration (header file) for the form given in \a e
+
+ \sa createFormImpl(), createObjectDecl()
+*/
+void Uic::createFormDecl( const TQDomElement &e )
+{
+ TQDomElement n;
+ TQDomNodeList nl;
+ int i;
+ TQString objClass = getClassName( e );
+ if ( objClass.isEmpty() )
+ return;
+ TQString objName = getObjectName( e );
+
+ TQStringList typeDefs;
+
+ TQMap<TQString, CustomInclude> customWidgetIncludes;
+
+ TQString imageMembers;
+
+ /*
+ We are generating a few TQImage members that are not strictly
+ necessary in some cases. Ideally, we would use requiredImage,
+ which is computed elsewhere, to keep the generated .h and .cpp
+ files synchronized.
+ */
+
+ // at first the images
+ TQMap<TQString, int> customWidgets;
+ TQStringList forwardDecl;
+ TQStringList forwardDecl2;
+ TQString exportMacro;
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "images" ) {
+ nl = n.elementsByTagName( "image" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQString img = registerObject( nl.item(i).toElement().attribute("name") );
+ registerObject( img );
+ imageMembers += TQString( " TQPixmap %1;\n" ).arg( img );
+ }
+ } else if ( n.tagName() == "customwidgets" ) {
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "customwidget" ) {
+ TQDomElement n3 = n2.firstChild().toElement();
+ TQString cl;
+ WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "class" ) {
+ cl = n3.firstChild().toText().data();
+ if ( !nofwd )
+ forwardDecl << cl;
+ customWidgets.insert( cl, 0 );
+ r->name = cl;
+ } else if ( n3.tagName() == "header" ) {
+ CustomInclude ci;
+ ci.header = n3.firstChild().toText().data();
+ ci.location = n3.attribute( "location", "global" );
+ r->includeFile = ci.header;
+ customWidgetIncludes.insert( cl, ci );
+ }
+ WidgetDatabase::append( r );
+ n3 = n3.nextSibling().toElement();
+ }
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ }
+ }
+
+ // register the object and unify its name
+ objName = registerObject( objName );
+ TQString protector = objName.upper() + "_H";
+ protector.tqreplace( "::", "_" );
+ out << "#ifndef " << protector << endl;
+ out << "#define " << protector << endl;
+ out << endl;
+ out << "#include <tqvariant.h>" << endl; // for broken HP-UX compilers
+
+ if ( !imageMembers.isEmpty() )
+ out << "#include <tqpixmap.h>" << endl;
+
+ TQStringList globalIncludes, localIncludes;
+ int wid = WidgetDatabase::idFromClassName( objClass );
+ {
+ TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.tqfind( objClass );
+ if ( it != customWidgetIncludes.end() ) {
+ if ( ( *it ).location == "global" )
+ globalIncludes += (*it).header;
+ else
+ localIncludes += (*it).header;
+ } else {
+ globalIncludes += WidgetDatabase::includeFile( wid );
+ }
+ }
+
+ nl = e.parentNode().toElement().elementsByTagName( "include" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
+ if ( n2.attribute( "impldecl", "in implementation" ) == "in declaration" &&
+ n2.attribute( "location" ) != "local" ) {
+ if ( s.right( 5 ) == ".ui.h" )
+ continue;
+ globalIncludes += s;
+ }
+ }
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
+ if ( n2.attribute( "impldecl", "in implementation" ) == "in declaration" &&
+ n2.attribute( "location" ) == "local" &&!globalIncludes.tqcontains( s ) ) {
+ if ( s.right( 5 ) == ".ui.h" )
+ continue;
+ localIncludes += s;
+ }
+ }
+
+ TQStringList::Iterator it;
+
+ globalIncludes = unique( globalIncludes );
+ for ( it = globalIncludes.begin(); it != globalIncludes.end(); ++it ) {
+ if ( !(*it).isEmpty() )
+ out << "#include <" << *it << ">" << endl;
+ }
+ localIncludes = unique( localIncludes );
+ for ( it = localIncludes.begin(); it != localIncludes.end(); ++it ) {
+ if ( !(*it).isEmpty() )
+ out << "#include \"" << *it << "\"" << endl;
+ }
+ out << endl;
+
+ // forward declarations for child widgets and layouts
+ out << "class TQVBoxLayout;" << endl;
+ out << "class TQHBoxLayout;" << endl;
+ out << "class TQGridLayout;" << endl;
+ out << "class TQSpacerItem;" << endl;
+ if ( objClass == "TQMainWindow" ) {
+ out << "class TQAction;" << endl;
+ out << "class TQActionGroup;" << endl;
+ out << "class TQToolBar;" << endl;
+ out << "class TQPopupMenu;" << endl;
+ }
+
+ bool dbForm = FALSE;
+ registerDatabases( e );
+ dbConnections = unique( dbConnections );
+ if ( dbConnections.count() )
+ forwardDecl += "TQSqlDatabase";
+ if ( dbCursors.count() )
+ forwardDecl += "TQSqlCursor";
+ if ( dbForms[ "(default)" ].count() )
+ dbForm = TRUE;
+ bool subDbForms = FALSE;
+ for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) {
+ if ( !(*it).isEmpty() && (*it) != "(default)" ) {
+ if ( dbForms[ (*it) ].count() ) {
+ subDbForms = TRUE;
+ break;
+ }
+ }
+ }
+ if ( dbForm || subDbForms )
+ forwardDecl += "TQSqlForm";
+
+ for ( it = tags.begin(); it != tags.end(); ++it ) {
+ nl = e.parentNode().toElement().elementsByTagName( *it );
+ for ( i = 1; i < (int) nl.length(); i++ ) { // begin at 1, 0 is the toplevel widget
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQLayoutWidget" )
+ continue; // hide qlayoutwidgets
+ if ( s == "Line" )
+ s = "TQFrame";
+ if ( !(nofwd && customWidgets.tqcontains(s)) )
+ forwardDecl += s;
+ if ( s.mid( 2 ) == "ListBox" || s.mid( 2 ) == "ListView" || s.mid( 2 ) == "IconView" )
+ forwardDecl += "TQ" + s.mid( 2 ) + "Item";
+ if ( s == "TQDataTable" ) { // other convenience classes which are used in TQDataTable Q_SIGNALS, and thus should be forward-declared by uic for us
+ forwardDecl += "TQSqlRecord";
+ }
+ }
+ }
+
+ // some typedefs, maybe
+ typeDefs = unique( typeDefs );
+ for ( it = typeDefs.begin(); it != typeDefs.end(); ++it ) {
+ if ( !(*it).isEmpty() )
+ out << "typedef " << *it << ";" << endl;
+ }
+
+ nl = e.parentNode().toElement().elementsByTagName( "forward" );
+ for ( i = 0; i < (int) nl.length(); i++ )
+ forwardDecl2 << nl.item(i).toElement().firstChild().toText().data();
+
+ nl = e.parentNode().toElement().elementsByTagName( "include" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
+ if ( n2.attribute( "impldecl", "in implementation" ) == "in declaration" &&
+ n2.attribute( "location" ) != "local" )
+ globalIncludes += s;
+ }
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
+ if ( n2.attribute( "impldecl", "in implementation" ) == "in declaration" &&
+ n2.attribute( "location" ) == "local" &&!globalIncludes.tqcontains( s ) )
+ localIncludes += s;
+ }
+ nl = e.parentNode().toElement().elementsByTagName( "exportmacro" );
+ if ( nl.length() == 1 )
+ exportMacro = nl.item( 0 ).firstChild().toText().data();
+
+ forwardDecl = unique( forwardDecl );
+ for ( it = forwardDecl.begin(); it != forwardDecl.end(); ++it ) {
+ if ( !(*it).isEmpty() && (*it) != objClass ) {
+ TQString forwardName = *it;
+ TQStringList forwardNamespaces = TQStringList::split( "::",
+ forwardName );
+ forwardName = forwardNamespaces.last();
+ forwardNamespaces.remove( forwardNamespaces.fromLast() );
+
+ TQStringList::ConstIterator ns = forwardNamespaces.begin();
+ while ( ns != forwardNamespaces.end() ) {
+ out << "namespace " << *ns << " {" << endl;
+ ++ns;
+ }
+ out << "class " << forwardName << ";" << endl;
+ for ( int i = 0; i < (int) forwardNamespaces.count(); i++ )
+ out << "}" << endl;
+ }
+ }
+
+ for ( it = forwardDecl2.begin(); it != forwardDecl2.end(); ++it ) {
+ TQString fd = *it;
+ fd = fd.stripWhiteSpace();
+ if ( !fd.endsWith( ";" ) )
+ fd += ";";
+ out << fd << endl;
+ }
+
+ out << endl;
+
+ TQStringList::ConstIterator ns = namespaces.begin();
+ while ( ns != namespaces.end() ) {
+ out << "namespace " << *ns << " {" << endl;
+ ++ns;
+ }
+
+ out << "class ";
+ if ( !exportMacro.isEmpty() )
+ out << exportMacro << " ";
+ out << bareNameOfClass << " : public " << objClass << endl << "{" << endl;
+
+ /* qmake ignore TQ_OBJECT */
+ out << " Q_OBJECT" << endl;
+ out << " TQ_OBJECT" << endl;
+ out << endl;
+ out << "public:" << endl;
+
+ // constructor
+ if ( objClass == "TQDialog" || objClass == "TQWizard" ) {
+ out << " " << bareNameOfClass << "( TQWidget* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );" << endl;
+ } else if ( objClass == "TQWidget" ) {
+ out << " " << bareNameOfClass << "( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );" << endl;
+ } else if ( objClass == "TQMainWindow" ) {
+ out << " " << bareNameOfClass << "( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = (WFlags)TQt::WType_TopLevel );" << endl;
+ isMainWindow = TRUE;
+ } else {
+ out << " " << bareNameOfClass << "( TQWidget* tqparent = 0, const char* name = 0 );" << endl;
+ }
+
+ // destructor
+ out << " ~" << bareNameOfClass << "();" << endl;
+ out << endl;
+
+ // tqchildren
+ bool needPolish = FALSE;
+ nl = e.parentNode().toElement().elementsByTagName( "widget" );
+ for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget
+ n = nl.item(i).toElement();
+ createObjectDecl( n );
+ TQString t = n.tagName();
+ if ( t == "vbox" || t == "hbox" || t == "grid" )
+ createSpacerDecl( n );
+ TQString s = getClassName( n );
+ if ( s == "TQDataTable" || s == "TQDataBrowser" ) {
+ if ( isFrameworkCodeGenerated( n ) )
+ needPolish = TRUE;
+ }
+ }
+
+ // actions, toolbars, menus
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "actions" ) {
+ for ( TQDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
+ createActionDecl( a );
+ } else if ( n.tagName() == "toolbars" ) {
+ for ( TQDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
+ createToolbarDecl( a );
+ } else if ( n.tagName() == "menubar" ) {
+ out << " " << "TQMenuBar *" << getObjectName( n ) << ";" << endl;
+ for ( TQDomElement a = n.firstChild().toElement(); !a.isNull(); a = a.nextSibling().toElement() )
+ createMenuBarDecl( a );
+ }
+ }
+ out << endl;
+
+ // database connections
+ dbConnections = unique( dbConnections );
+ bool hadOutput = FALSE;
+ for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) {
+ if ( !(*it).isEmpty() ) {
+ // only need pointers to non-default connections
+ if ( (*it) != "(default)" && !(*it).isEmpty() ) {
+ out << indent << "TQSqlDatabase* " << *it << "Connection;" << endl;
+ hadOutput = TRUE;
+ }
+ }
+ }
+ if ( hadOutput )
+ out << endl;
+
+ TQStringList publicSlots, protectedSlots, privateSlots;
+ TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes;
+ TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier;
+
+ nl = e.parentNode().toElement().elementsByTagName( "slot" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ if ( n.parentNode().toElement().tagName() != "Q_SLOTS"
+ && n.parentNode().toElement().tagName() != "connections" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
+ if ( access == "protected" ) {
+ protectedSlots += functionName;
+ protectedSlotTypes += returnType;
+ protectedSlotSpecifier += specifier;
+ } else if ( access == "private" ) {
+ privateSlots += functionName;
+ privateSlotTypes += returnType;
+ privateSlotSpecifier += specifier;
+ } else {
+ publicSlots += functionName;
+ publicSlotTypes += returnType;
+ publicSlotSpecifier += specifier;
+ }
+ }
+
+ TQStringList publicFuncts, protectedFuncts, privateFuncts;
+ TQStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp;
+ TQStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec;
+
+ nl = e.parentNode().toElement().elementsByTagName( "function" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item( i ).toElement();
+ if ( n.parentNode().toElement().tagName() != "functions" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
+ if ( access == "protected" ) {
+ protectedFuncts += functionName;
+ protectedFunctRetTyp += returnType;
+ protectedFunctSpec += specifier;
+ } else if ( access == "private" ) {
+ privateFuncts += functionName;
+ privateFunctRetTyp += returnType;
+ privateFunctSpec += specifier;
+ } else {
+ publicFuncts += functionName;
+ publicFunctRetTyp += returnType;
+ publicFunctSpec += specifier;
+ }
+ }
+
+ TQStringList publicVars, protectedVars, privateVars;
+ nl = e.parentNode().toElement().elementsByTagName( "variable" );
+ for ( i = 0; i < (int)nl.length(); i++ ) {
+ n = nl.item( i ).toElement();
+ // Because of compatibility the next lines have to be commented out.
+ // Someday it should be uncommented.
+ //if ( n.parentNode().toElement().tagName() != "variables" )
+ // continue;
+ TQString access = n.attribute( "access", "protected" );
+ TQString var = n.firstChild().toText().data().stripWhiteSpace();
+ if (var.isEmpty())
+ continue;
+ if ( !var.endsWith( ";" ) )
+ var += ";";
+ if ( access == "public" )
+ publicVars += var;
+ else if ( access == "private" )
+ privateVars += var;
+ else
+ protectedVars += var;
+ }
+
+ if ( !publicVars.isEmpty() ) {
+ for ( it = publicVars.begin(); it != publicVars.end(); ++it )
+ out << indent << *it << endl;
+ out << endl;
+ }
+ if ( !publicFuncts.isEmpty() )
+ writeFunctionsDecl( publicFuncts, publicFunctRetTyp, publicFunctSpec );
+
+ if ( needPolish || !publicSlots.isEmpty() ) {
+ out << "public Q_SLOTS:" << endl;
+ if ( needPolish ) {
+ out << indent << "virtual void polish();" << endl;
+ out << endl;
+ }
+ if ( !publicSlots.isEmpty() )
+ writeFunctionsDecl( publicSlots, publicSlotTypes, publicSlotSpecifier );
+ }
+
+ // tqfind Q_SIGNALS
+ TQStringList extraSignals;
+ nl = e.parentNode().toElement().elementsByTagName( "signal" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item( i ).toElement();
+ if ( n.parentNode().toElement().tagName() != "Q_SIGNALS"
+ && n.parentNode().toElement().tagName() != "connections" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString sigName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( sigName.endsWith( ";" ) )
+ sigName = sigName.left( sigName.length() - 1 );
+ extraSignals += sigName;
+ }
+
+ // create Q_SIGNALS
+ if ( !extraSignals.isEmpty() ) {
+ out << "Q_SIGNALS:" << endl;
+ for ( it = extraSignals.begin(); it != extraSignals.end(); ++it )
+ out << " void " << (*it) << ";" << endl;
+ out << endl;
+ }
+
+ out << "protected:" << endl;
+ if ( !protectedVars.isEmpty() ) {
+ for ( it = protectedVars.begin(); it != protectedVars.end(); ++it )
+ out << indent << *it << endl;
+ out << endl;
+ }
+ if ( !protectedFuncts.isEmpty() )
+ writeFunctionsDecl( protectedFuncts, protectedFunctRetTyp, protectedFunctSpec );
+
+ // child layouts
+ registerLayouts( e );
+ out << endl;
+
+#if TQT_VERSION >= 0x030900
+#error Make languageChange() a virtual protected non-slot member of TQWidget
+#endif
+
+ out << "protected Q_SLOTS:" << endl;
+ out << " virtual void languageChange();" << endl;
+ if ( !protectedSlots.isEmpty() ) {
+ out << endl;
+ writeFunctionsDecl( protectedSlots, protectedSlotTypes, protectedSlotSpecifier );
+ }
+ out << endl;
+
+ // create all private stuff
+ if ( !privateFuncts.isEmpty() || !privateVars.isEmpty() || !imageMembers.isEmpty() ) {
+ out << "private:" << endl;
+ if ( !privateVars.isEmpty() ) {
+ for ( it = privateVars.begin(); it != privateVars.end(); ++it )
+ out << indent << *it << endl;
+ out << endl;
+ }
+ if ( !imageMembers.isEmpty() ) {
+ out << imageMembers;
+ out << endl;
+ }
+ if ( !privateFuncts.isEmpty() )
+ writeFunctionsDecl( privateFuncts, privateFunctRetTyp, privateFunctSpec );
+ }
+
+ if ( !privateSlots.isEmpty() ) {
+ out << "private Q_SLOTS:" << endl;
+ writeFunctionsDecl( privateSlots, privateSlotTypes, privateSlotSpecifier );
+ }
+
+ out << "};" << endl;
+ for ( i = 0; i < (int) namespaces.count(); i++ )
+ out << "}" << endl;
+
+ out << endl;
+ out << "#endif // " << protector << endl;
+}
+
+void Uic::writeFunctionsDecl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst )
+{
+ TQValueListConstIterator<TQString> it, it2, it3;
+ for ( it = fuLst.begin(), it2 = typLst.begin(), it3 = specLst.begin();
+ it != fuLst.end(); ++it, ++it2, ++it3 ) {
+ TQString signature = *it;
+ TQString specifier;
+ TQString pure;
+ TQString type = *it2;
+ if ( type.isEmpty() )
+ type = "void";
+ if ( *it3 == "static" ) {
+ specifier = "static ";
+ } else {
+ if ( *it3 != "non virtual" && *it3 != "nonVirtual" )
+ specifier = "virtual ";
+ if ( *it3 == "pure virtual" || *it3 == "pureVirtual" )
+ pure = " = 0";
+ }
+ type.tqreplace( ">>", "> >" );
+ if ( !signature.tqcontains("operator") )
+ signature.tqreplace( ">>", "> >" );
+ out << " " << specifier << type << " " << signature << pure << ";" << endl;
+ }
+ out << endl;
+}
+
+/*!
+ Creates an implementation (cpp-file) for the form given in \a e.
+
+ \sa createFormDecl(), createObjectImpl()
+ */
+void Uic::createFormImpl( const TQDomElement &e )
+{
+ TQDomElement n;
+ TQDomNodeList nl;
+ int i;
+ TQString objClass = getClassName( e );
+ if ( objClass.isEmpty() )
+ return;
+ TQString objName = getObjectName( e );
+
+ // generate local and local includes required
+ TQStringList globalIncludes, localIncludes;
+ TQStringList::Iterator it;
+
+ TQMap<TQString, CustomInclude> customWidgetIncludes;
+
+ // tqfind additional Q_SLOTS and functions
+ TQStringList extraFuncts;
+ TQStringList extraFunctTyp;
+ TQStringList extraFunctSpecifier;
+
+ nl = e.parentNode().toElement().elementsByTagName( "slot" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ if ( n.parentNode().toElement().tagName() != "Q_SLOTS"
+ && n.parentNode().toElement().tagName() != "connections" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ extraFuncts += functionName;
+ extraFunctTyp += n.attribute( "returnType", "void" );
+ extraFunctSpecifier += n.attribute( "specifier", "virtual" );
+ }
+
+ nl = e.parentNode().toElement().elementsByTagName( "function" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ if ( n.parentNode().toElement().tagName() != "functions" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ extraFuncts += functionName;
+ extraFunctTyp += n.attribute( "returnType", "void" );
+ extraFunctSpecifier += n.attribute( "specifier", "virtual" );
+ }
+
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "customwidgets" ) {
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "customwidget" ) {
+ TQDomElement n3 = n2.firstChild().toElement();
+ TQString cl;
+ WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "class" ) {
+ cl = n3.firstChild().toText().data();
+ r->name = cl;
+ } else if ( n3.tagName() == "header" ) {
+ CustomInclude ci;
+ ci.header = n3.firstChild().toText().data();
+ ci.location = n3.attribute( "location", "global" );
+ r->includeFile = ci.header;
+ customWidgetIncludes.insert( cl, ci );
+ }
+ WidgetDatabase::append( r );
+ n3 = n3.nextSibling().toElement();
+ }
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ } else if ( n.tagName() == "includehints" ) {
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "includehint" ) {
+ TQString file = n2.firstChild().toText().data();
+ localIncludes += file;
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ }
+ }
+
+ // additional includes (local or global) and forward declaractions
+ nl = e.parentNode().toElement().elementsByTagName( "include" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
+ if ( n2.attribute( "location" ) != "local" ) {
+ if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) )
+ continue;
+ if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" )
+ continue;
+ globalIncludes += s;
+ }
+ }
+
+ registerDatabases( e );
+ dbConnections = unique( dbConnections );
+ if ( dbConnections.count() )
+ globalIncludes += "tqsqldatabase.h";
+ if ( dbCursors.count() )
+ globalIncludes += "tqsqlcursor.h";
+ bool dbForm = FALSE;
+ if ( dbForms[ "(default)" ].count() )
+ dbForm = TRUE;
+ bool subDbForms = FALSE;
+ for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) {
+ if ( !(*it).isEmpty() && (*it) != "(default)" ) {
+ if ( dbForms[ (*it) ].count() ) {
+ subDbForms = TRUE;
+ break;
+ }
+ }
+ }
+ if ( dbForm || subDbForms ) {
+ globalIncludes += "tqsqlform.h";
+ globalIncludes += "tqsqlrecord.h";
+ }
+
+ // do the local includes afterwards, since global includes have priority on clashes
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
+ if ( n2.attribute( "location" ) == "local" &&!globalIncludes.tqcontains( s ) ) {
+ if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) )
+ continue;
+ if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" )
+ continue;
+ localIncludes += s;
+ }
+ }
+
+ // additional custom widget headers
+ nl = e.parentNode().toElement().elementsByTagName( "header" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
+ if ( n2.attribute( "location" ) != "local" )
+ globalIncludes += s;
+ else
+ localIncludes += s;
+ }
+
+ // includes for child widgets
+ for ( it = tags.begin(); it != tags.end(); ++it ) {
+ nl = e.parentNode().toElement().elementsByTagName( *it );
+ for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget
+ TQString name = getClassName( nl.item(i).toElement() );
+ if ( name == "Spacer" ) {
+ globalIncludes += "tqlayout.h";
+ globalIncludes += "tqapplication.h";
+ continue;
+ }
+ if ( name.mid( 2 ) == "ListView" )
+ globalIncludes += "tqheader.h";
+ if ( name != objClass ) {
+ int wid = WidgetDatabase::idFromClassName( name );
+ TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.tqfind( name );
+ if ( it == customWidgetIncludes.end() )
+ globalIncludes += WidgetDatabase::includeFile( wid );
+ }
+ }
+ }
+
+ out << "#include <tqvariant.h>" << endl; // first for gcc 2.7.2
+
+ globalIncludes = unique( globalIncludes );
+ for ( it = globalIncludes.begin(); it != globalIncludes.end(); ++it ) {
+ if ( !(*it).isEmpty() )
+ out << "#include <" << *it << ">" << endl;
+ }
+
+ out << "#include <tqlayout.h>" << endl;
+ out << "#include <tqtooltip.h>" << endl;
+ out << "#include <tqwhatsthis.h>" << endl;
+ if ( objClass == "TQMainWindow" ) {
+ out << "#include <tqaction.h>" << endl;
+ out << "#include <tqmenubar.h>" << endl;
+ out << "#include <tqpopupmenu.h>" << endl;
+ out << "#include <tqtoolbar.h>" << endl;
+ }
+
+ // tqfind out what images are required
+ TQStringList requiredImages;
+ static const char *imgTags[] = { "pixmap", "iconset", 0 };
+ for ( i = 0; imgTags[i] != 0; i++ ) {
+ nl = e.parentNode().toElement().elementsByTagName( imgTags[i] );
+ for ( int j = 0; j < (int) nl.length(); j++ ) {
+ TQDomNode nn = nl.item(j);
+ while ( nn.parentNode() != e.parentNode() )
+ nn = nn.parentNode();
+ if ( nn.nodeName() != "customwidgets" )
+ requiredImages += nl.item(j).firstChild().toText().data();
+ }
+ }
+
+ if ( !requiredImages.isEmpty() || externPixmaps ) {
+ out << "#include <tqimage.h>" << endl;
+ out << "#include <tqpixmap.h>" << endl << endl;
+ }
+
+ /*
+ Put local includes after all global includes
+ */
+ localIncludes = unique( localIncludes );
+ for ( it = localIncludes.begin(); it != localIncludes.end(); ++it ) {
+ if ( !(*it).isEmpty() && *it != TQFileInfo( fileName + ".h" ).fileName() )
+ out << "#include \"" << *it << "\"" << endl;
+ }
+
+ TQString uiDotH = fileName + ".h";
+ if ( TQFile::exists( uiDotH ) ) {
+ if ( !outputFileName.isEmpty() )
+ uiDotH = combinePath( uiDotH, outputFileName );
+ out << "#include \"" << uiDotH << "\"" << endl;
+ writeFunctImpl = FALSE;
+ }
+
+ // register the object and unify its name
+ objName = registerObject( objName );
+
+ TQStringList images;
+ TQStringList xpmImages;
+ if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) {
+ // create images
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "images" ) {
+ nl = n.elementsByTagName( "image" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQString img = registerObject( nl.item(i).toElement().attribute("name") );
+ if ( !requiredImages.tqcontains( img ) )
+ continue;
+ TQDomElement tmp = nl.item(i).firstChild().toElement();
+ if ( tmp.tagName() != "data" )
+ continue;
+ TQString format = tmp.attribute("format", "PNG" );
+ TQString data = tmp.firstChild().toText().data();
+ if ( format == "XPM.GZ" ) {
+ xpmImages += img;
+ ulong length = tmp.attribute("length").toULong();
+ TQByteArray baunzip = unzipXPM( data, length );
+ length = baunzip.size();
+ // shouldn't we test the initial 'length' against the
+ // resulting 'length' to catch corrupt UIC files?
+ int a = 0;
+ int column = 0;
+ bool inQuote = FALSE;
+ out << "static const char* const " << img << "_data[] = { " << endl;
+ while ( baunzip[a] != '\"' )
+ a++;
+ for ( ; a < (int) length; a++ ) {
+ out << baunzip[a];
+ if ( baunzip[a] == '\n' ) {
+ column = 0;
+ } else if ( baunzip[a] == '"' ) {
+ inQuote = !inQuote;
+ }
+
+ if ( column++ >= 511 && inQuote ) {
+ out << "\"\n\""; // be nice with MSVC & Co.
+ column = 1;
+ }
+ }
+ out << endl;
+ } else {
+ images += img;
+ out << "static const unsigned char " << img << "_data[] = { " << endl;
+ out << " ";
+ int a ;
+ for ( a = 0; a < (int) (data.length()/2)-1; a++ ) {
+ out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << ",";
+ if ( a % 12 == 11 )
+ out << endl << " ";
+ else
+ out << " ";
+ }
+ out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << endl;
+ out << "};" << endl << endl;
+ }
+ }
+ }
+ }
+ out << endl;
+ } else if ( externPixmaps ) {
+ pixmapLoaderFunction = "TQPixmap::fromMimeSource";
+ }
+
+ // constructor
+ if ( objClass == "TQDialog" || objClass == "TQWizard" ) {
+ out << "/*" << endl;
+ out << " * Constructs a " << nameOfClass << " as a child of 'tqparent', with the" << endl;
+ out << " * name 'name' and widget flags set to 'f'." << endl;
+ out << " *" << endl;
+ out << " * The " << objClass.mid(2).lower() << " will by default be modeless, unless you set 'modal' to" << endl;
+ out << " * TRUE to construct a modal " << objClass.mid(2).lower() << "." << endl;
+ out << " */" << endl;
+ out << nameOfClass << "::" << bareNameOfClass << "( TQWidget* tqparent, const char* name, bool modal, WFlags fl )" << endl;
+ out << " : " << objClass << "( tqparent, name, modal, fl )";
+ } else if ( objClass == "TQWidget" ) {
+ out << "/*" << endl;
+ out << " * Constructs a " << nameOfClass << " as a child of 'tqparent', with the" << endl;
+ out << " * name 'name' and widget flags set to 'f'." << endl;
+ out << " */" << endl;
+ out << nameOfClass << "::" << bareNameOfClass << "( TQWidget* tqparent, const char* name, WFlags fl )" << endl;
+ out << " : " << objClass << "( tqparent, name, fl )";
+ } else if ( objClass == "TQMainWindow" ) {
+ out << "/*" << endl;
+ out << " * Constructs a " << nameOfClass << " as a child of 'tqparent', with the" << endl;
+ out << " * name 'name' and widget flags set to 'f'." << endl;
+ out << " *" << endl;
+ out << " */" << endl;
+ out << nameOfClass << "::" << bareNameOfClass << "( TQWidget* tqparent, const char* name, WFlags fl )" << endl;
+ out << " : " << objClass << "( tqparent, name, fl )";
+ isMainWindow = TRUE;
+ } else {
+ out << "/*" << endl;
+ out << " * Constructs a " << nameOfClass << " which is a child of 'tqparent', with the" << endl;
+ out << " * name 'name'.' " << endl;
+ out << " */" << endl;
+ out << nameOfClass << "::" << bareNameOfClass << "( TQWidget* tqparent, const char* name )" << endl;
+ out << " : " << objClass << "( tqparent, name )";
+ }
+
+ // create pixmaps for all images
+ if ( !xpmImages.isEmpty() ) {
+ for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) {
+ out << "," << endl;
+ out << indent << " " << *it << "( (const char **) " << (*it) << "_data )";
+ }
+ }
+ out << endl;
+
+ out << "{" << endl;
+ if ( isMainWindow )
+ out << indent << "(void)statusBar();" << endl;
+
+ if ( !images.isEmpty() ) {
+ out << indent << "TQImage img;" << endl;
+ for ( it = images.begin(); it != images.end(); ++it ) {
+ out << indent << "img.loadFromData( " << (*it) << "_data, sizeof( " << (*it) << "_data ), \"PNG\" );" << endl;
+ out << indent << (*it) << " = img;" << endl;
+ }
+ }
+
+ // set the properties
+ TQSize tqgeometry( 0, 0 );
+
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ bool stdset = stdsetdef;
+ if ( n.hasAttribute( "stdset" ) )
+ stdset = toBool( n.attribute( "stdset" ) );
+ TQString prop = n.attribute("name");
+ TQDomElement n2 = n.firstChild().toElement();
+ TQString value = setObjectProperty( objClass, TQString(), prop, n2, stdset );
+ if ( value.isEmpty() )
+ continue;
+
+ if ( prop == "geometry" && n2.tagName() == "rect" ) {
+ TQDomElement n3 = n2.firstChild().toElement();
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "width" )
+ tqgeometry.setWidth( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "height" )
+ tqgeometry.setHeight( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ } else {
+ TQString call;
+ if ( stdset ) {
+ call = mkStdSet( prop ) + "( ";
+ } else {
+ call = "setProperty( \"" + prop + "\", ";
+ }
+ call += value + " );";
+
+ if ( n2.tagName() == "string" ) {
+ trout << indent << call << endl;
+ } else if ( prop == "name" ) {
+ out << indent << "if ( !name )" << endl;
+ out << "\t" << call << endl;
+ } else {
+ out << indent << call << endl;
+ }
+ }
+ }
+ }
+
+ // create all tqchildren, some forms have special requirements
+
+ if ( objClass == "TQWizard" ) {
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( tags.tqcontains( n.tagName() ) ) {
+ TQString page = createObjectImpl( n, objClass, "this" );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ out << indent << "addPage( " << page << ", TQString(\"\") );" << endl;
+ trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " );" << endl;
+ TQVariant def( FALSE, 0 );
+ if ( DomTool::hasAttribute( n, "backEnabled" ) )
+ out << indent << "setBackEnabled( " << page << ", " << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << endl;
+ if ( DomTool::hasAttribute( n, "nextEnabled" ) )
+ out << indent << "setNextEnabled( " << page << ", " << mkBool( DomTool::readAttribute( n, "nextEnabled", def).toBool() ) << endl;
+ if ( DomTool::hasAttribute( n, "finishEnabled" ) )
+ out << indent << "setFinishEnabled( " << page << ", " << mkBool( DomTool::readAttribute( n, "finishEnabled", def).toBool() ) << " );" << endl;
+ if ( DomTool::hasAttribute( n, "helpEnabled" ) )
+ out << indent << "setHelpEnabled( " << page << ", " << mkBool( DomTool::readAttribute( n, "helpEnabled", def).toBool() ) << endl;
+ if ( DomTool::hasAttribute( n, "finish" ) )
+ out << indent << "setFinish( " << page << ", " << mkBool( DomTool::readAttribute( n, "finish", def).toBool() ) << endl;
+ }
+ }
+ } else { // standard widgets
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( tags.tqcontains( n.tagName() ) )
+ createObjectImpl( n, objName, "this" );
+ }
+ }
+
+ // database support
+ dbConnections = unique( dbConnections );
+ if ( dbConnections.count() )
+ out << endl;
+ for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) {
+ if ( !(*it).isEmpty() && (*it) != "(default)") {
+ out << indent << (*it) << "Connection = TQSqlDatabase::database( \"" <<(*it) << "\" );" << endl;
+ }
+ }
+
+ nl = e.parentNode().toElement().elementsByTagName( "widget" );
+ for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget
+ n = nl.item(i).toElement();
+ TQString s = getClassName( n );
+ if ( (dbForm || subDbForms) && (s == "TQDataBrowser" || s == "TQDataView") ) {
+ TQString objName = getObjectName( n );
+ TQString tab = getDatabaseInfo( n, "table" );
+ TQString con = getDatabaseInfo( n, "connection" );
+ out << indent << "TQSqlForm* " << objName << "Form = new TQSqlForm( this, \"" << objName << "Form\" );" << endl;
+ TQDomElement n2;
+ for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() )
+ createFormImpl( n2, objName, con, tab );
+ out << indent << objName << "->setForm( " << objName << "Form );" << endl;
+ }
+ }
+
+ // actions, toolbars, menubar
+ bool needEndl = FALSE;
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "actions" ) {
+ if ( !needEndl )
+ out << endl << indent << "// actions" << endl;
+ createActionImpl( n.firstChild().toElement(), "this" );
+ needEndl = TRUE;
+ }
+ }
+ if ( needEndl )
+ out << endl;
+ needEndl = FALSE;
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "toolbars" ) {
+ if ( !needEndl )
+ out << endl << indent << "// toolbars" << endl;
+ createToolbarImpl( n, objClass, objName );
+ needEndl = TRUE;
+ }
+ }
+ if ( needEndl )
+ out << endl;
+ needEndl = FALSE;
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "menubar" ) {
+ if ( !needEndl )
+ out << endl << indent << "// menubar" << endl;
+ createMenuBarImpl( n, objClass, objName );
+ needEndl = TRUE;
+ }
+ }
+ if ( needEndl )
+ out << endl;
+
+ out << indent << "languageChange();" << endl;
+
+ // take tqminimumSizeHint() into account, for height-for-width widgets
+ if ( !tqgeometry.isNull() ) {
+ out << indent << "resize( TQSize(" << tqgeometry.width() << ", "
+ << tqgeometry.height() << ").expandedTo(tqminimumSizeHint()) );" << endl;
+ out << indent << "clearWState( TQt::WState_Polished );" << endl;
+ }
+
+ for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "connections" ) {
+ // setup Q_SIGNALS and Q_SLOTS connections
+ out << endl << indent << "// Q_SIGNALS and Q_SLOTS connections" << endl;
+ nl = n.elementsByTagName( "connection" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQString sender, receiver, signal, slot;
+ for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ if ( n2.tagName() == "sender" )
+ sender = n2.firstChild().toText().data();
+ else if ( n2.tagName() == "receiver" )
+ receiver = n2.firstChild().toText().data();
+ else if ( n2.tagName() == "signal" )
+ signal = n2.firstChild().toText().data();
+ else if ( n2.tagName() == "slot" )
+ slot = n2.firstChild().toText().data();
+ }
+ if ( sender.isEmpty() ||
+ receiver.isEmpty() ||
+ signal.isEmpty() ||
+ slot.isEmpty() )
+ continue;
+ if ( sender[0] == '<' ||
+ receiver[0] == '<' ||
+ signal[0] == '<' ||
+ slot[0] == '<' )
+ continue;
+
+ sender = registeredName( sender );
+ receiver = registeredName( receiver );
+
+ // translate formwindow name to "this"
+ if ( sender == objName )
+ sender = "this";
+ if ( receiver == objName )
+ receiver = "this";
+
+ out << indent << "connect( " << sender << ", TQT_SIGNAL( " << signal << " ), "
+ << receiver << ", TQT_SLOT( " << slot << " ) );" << endl;
+ }
+ } else if ( n.tagName() == "tabstops" ) {
+ // setup tab order
+ out << endl << indent << "// tab order" << endl;
+ TQString lastName;
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "tabstop" ) {
+ TQString name = n2.firstChild().toText().data();
+ name = registeredName( name );
+ if ( !lastName.isEmpty() )
+ out << indent << "setTabOrder( " << lastName << ", " << name << " );" << endl;
+ lastName = name;
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ }
+ }
+
+ // buddies
+ bool firstBuddy = TRUE;
+ for ( TQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) {
+ if ( isObjectRegistered( (*buddy).buddy ) ) {
+ if ( firstBuddy ) {
+ out << endl << indent << "// buddies" << endl;
+ }
+ out << indent << (*buddy).key << "->setBuddy( " << registeredName( (*buddy).buddy ) << " );" << endl;
+ firstBuddy = FALSE;
+ }
+ }
+
+ if ( extraFuncts.tqfind( "init()" ) != extraFuncts.end() )
+ out << indent << "init();" << endl;
+
+ // end of constructor
+ out << "}" << endl;
+ out << endl;
+
+ // destructor
+ out << "/*" << endl;
+ out << " * Destroys the object and frees any allocated resources" << endl;
+ out << " */" << endl;
+ out << nameOfClass << "::~" << bareNameOfClass << "()" << endl;
+ out << "{" << endl;
+ if ( extraFuncts.tqfind( "destroy()" ) != extraFuncts.end() )
+ out << indent << "destroy();" << endl;
+ out << indent << "// no need to delete child widgets, TQt does it all for us" << endl;
+ out << "}" << endl;
+ out << endl;
+
+ // handle application events if required
+ bool needFontEventHandler = FALSE;
+ bool needSqlTableEventHandler = FALSE;
+ bool needSqlDataBrowserEventHandler = FALSE;
+ nl = e.elementsByTagName( "widget" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() )
+ needFontEventHandler = TRUE;
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQDataTable" || s == "TQDataBrowser" ) {
+ if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) )
+ continue;
+ if ( s == "TQDataTable" )
+ needSqlTableEventHandler = TRUE;
+ if ( s == "TQDataBrowser" )
+ needSqlDataBrowserEventHandler = TRUE;
+ }
+ if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler )
+ break;
+ }
+ if ( needFontEventHandler && FALSE ) {
+ // indent = "\t"; // increase indentation for if-clause below
+ out << "/*" << endl;
+ out << " * Main event handler. Reimplemented to handle" << endl;
+ out << " * application font changes";
+ out << " */" << endl;
+ out << "bool " << nameOfClass << "::event( TQEvent* ev )" << endl;
+ out << "{" << endl;
+ out << " bool ret = " << objClass << "::event( ev ); " << endl;
+ if ( needFontEventHandler ) {
+ indent += "\t";
+ out << " if ( ev->type() == TQEvent::ApplicationFontChange ) {" << endl;
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ TQStringList list = DomTool::propertiesOfType( n, "font" );
+ for ( it = list.begin(); it != list.end(); ++it )
+ createExclusiveProperty( n, *it );
+ }
+ out << " }" << endl;
+ indent = " ";
+ }
+ out << "}" << endl;
+ out << endl;
+ }
+
+ if ( needSqlTableEventHandler || needSqlDataBrowserEventHandler ) {
+ out << "/*" << endl;
+ out << " * Widget polish. Reimplemented to handle" << endl;
+ if ( needSqlTableEventHandler )
+ out << " * default data table initialization" << endl;
+ if ( needSqlDataBrowserEventHandler )
+ out << " * default data browser initialization" << endl;
+ out << " */" << endl;
+ out << "void " << nameOfClass << "::polish()" << endl;
+ out << "{" << endl;
+ if ( needSqlTableEventHandler ) {
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQDataTable" ) {
+ n = nl.item(i).toElement();
+ TQString c = getObjectName( n );
+ TQString conn = getDatabaseInfo( n, "connection" );
+ TQString tab = getDatabaseInfo( n, "table" );
+ if ( !( conn.isEmpty() || tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) {
+ out << indent << "if ( " << c << " ) {" << endl;
+ out << indent << indent << "TQSqlCursor* cursor = " << c << "->sqlCursor();" << endl;
+ out << indent << indent << "if ( !cursor ) {" << endl;
+ if ( conn == "(default)" )
+ out << indent << indent << indent << "cursor = new TQSqlCursor( \"" << tab << "\" );" << endl;
+ else
+ out << indent << indent << indent << "cursor = new TQSqlCursor( \"" << tab << "\", TRUE, " << conn << "Connection );" << endl;
+ out << indent << indent << indent << "if ( " << c << "->isReadOnly() ) " << endl;
+ out << indent << indent << indent << indent << "cursor->setMode( TQSqlCursor::ReadOnly );" << endl;
+ out << indent << indent << indent << c << "->setSqlCursor( cursor, FALSE, TRUE );" << endl;
+ out << indent << indent << "}" << endl;
+ out << indent << indent << "if ( !cursor->isActive() )" << endl;
+ out << indent << indent << indent << c << "->refresh( TQDataTable::RefreshAll );" << endl;
+ out << indent << "}" << endl;
+ }
+ }
+ }
+ }
+ if ( needSqlDataBrowserEventHandler ) {
+ nl = e.elementsByTagName( "widget" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQDataBrowser" ) {
+ TQString obj = getObjectName( nl.item(i).toElement() );
+ TQString tab = getDatabaseInfo( nl.item(i).toElement(),
+ "table" );
+ TQString conn = getDatabaseInfo( nl.item(i).toElement(),
+ "connection" );
+ if ( !(tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) {
+ out << indent << "if ( " << obj << " ) {" << endl;
+ out << indent << indent << "if ( !" << obj << "->sqlCursor() ) {" << endl;
+ if ( conn == "(default)" )
+ out << indent << indent << indent << "TQSqlCursor* cursor = new TQSqlCursor( \"" << tab << "\" );" << endl;
+ else
+ out << indent << indent << indent << "TQSqlCursor* cursor = new TQSqlCursor( \"" << tab << "\", TRUE, " << conn << "Connection );" << endl;
+ out << indent << indent << indent << obj << "->setSqlCursor( cursor, TRUE );" << endl;
+ out << indent << indent << indent << obj << "->refresh();" << endl;
+ out << indent << indent << indent << obj << "->first();" << endl;
+ out << indent << indent << "}" << endl;
+ out << indent << "}" << endl;
+ }
+ }
+ }
+ }
+ out << indent << objClass << "::polish();" << endl;
+ out << "}" << endl;
+ out << endl;
+ }
+
+ out << "/*" << endl;
+ out << " * Sets the strings of the subwidgets using the current" << endl;
+ out << " * language." << endl;
+ out << " */" << endl;
+ out << "void " << nameOfClass << "::languageChange()" << endl;
+ out << "{" << endl;
+ out << languageChangeBody;
+ out << "}" << endl;
+ out << endl;
+
+ // create stubs for additional Q_SLOTS if necessary
+ if ( !extraFuncts.isEmpty() && writeFunctImpl ) {
+ it = extraFuncts.begin();
+ TQStringList::Iterator it2 = extraFunctTyp.begin();
+ TQStringList::Iterator it3 = extraFunctSpecifier.begin();
+ while ( it != extraFuncts.end() ) {
+ TQString type = *it2;
+ if ( type.isEmpty() )
+ type = "void";
+ type = type.simplifyWhiteSpace();
+ TQString fname = Parser::cleanArgs( *it );
+ if ( !(*it3).startsWith("pure") ) { // "pure virtual" or "pureVirtual"
+ out << type << " " << nameOfClass << "::" << fname << endl;
+ out << "{" << endl;
+ if ( *it != "init()" && *it != "destroy()" ) {
+ TQRegExp numeric( "^(?:signed|unsigned|u?char|u?short|u?int"
+ "|u?long|TQ_U?INT(?:8|16|32)|TQ_U?LONG|float"
+ "|double)$" );
+ TQString retVal;
+
+ /*
+ We return some kind of dummy value to shut the
+ compiler up.
+
+ 1. If the type is 'void', we return nothing.
+
+ 2. If the type is 'bool', we return 'FALSE'.
+
+ 3. If the type is 'unsigned long' or
+ 'TQ_UINT16' or 'double' or similar, we
+ return '0'.
+
+ 4. If the type is 'Foo *', we return '0'.
+
+ 5. If the type is 'Foo &', we create a static
+ variable of type 'Foo' and return it.
+
+ 6. If the type is 'Foo', we assume there's a
+ default constructor and use it.
+ */
+ if ( type != "void" ) {
+ TQStringList toks = TQStringList::split( " ", type );
+ bool isBasicNumericType =
+ ( toks.grep(numeric).count() == toks.count() );
+
+ if ( type == "bool" ) {
+ retVal = "FALSE";
+ } else if ( isBasicNumericType || type.endsWith("*") ) {
+ retVal = "0";
+ } else if ( type.endsWith("&") ) {
+ do {
+ type.truncate( type.length() - 1 );
+ } while ( type.endsWith(" ") );
+ retVal = "uic_temp_var";
+ out << indent << "static " << type << " " << retVal << ";" << endl;
+ } else {
+ retVal = type + "()";
+ }
+ }
+
+ out << indent << "qWarning( \"" << nameOfClass << "::" << fname << ": Not implemented yet\" );" << endl;
+ if ( !retVal.isEmpty() )
+ out << indent << "return " << retVal << ";" << endl;
+ }
+ out << "}" << endl;
+ out << endl;
+ }
+ ++it;
+ ++it2;
+ ++it3;
+ }
+ }
+}
+
+
+/*! Creates form support implementation code for the widgets given
+ in \a e.
+
+ Traverses recursively over all tqchildren.
+ */
+
+void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table )
+{
+ if ( e.tagName() == "widget" &&
+ e.attribute( "class" ) != "TQDataTable" ) {
+ TQString field = getDatabaseInfo( e, "field" );
+ if ( !field.isEmpty() ) {
+ if ( isWidgetInTable( e, connection, table ) )
+ out << indent << form << "Form->insert( " << getObjectName( e ) << ", " << fixString( field ) << " );" << endl;
+ }
+ }
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ createFormImpl( n, form, connection, table );
+ }
+}
diff --git a/tqtinterface/qt4/tools/designer/uic/main.cpp b/tqtinterface/qt4/tools/designer/uic/main.cpp
new file mode 100644
index 0000000..f3d4f9e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/main.cpp
@@ -0,0 +1,358 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "uic.h"
+#include "domtool.h"
+#if defined(UIB)
+#include "ui2uib.h"
+#endif
+#include <tqapplication.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqdatetime.h>
+#include <tqsettings.h>
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+// see ### in widgetdatabase.cpp
+extern bool dbnounload;
+extern TQStringList *dbpaths;
+
+int main( int argc, char * argv[] )
+{
+ bool impl = FALSE;
+ bool subcl = FALSE;
+ bool imagecollection = FALSE;
+ bool imagecollection_tmpfile = FALSE;
+#if defined(UIB)
+ bool binary = FALSE;
+#endif
+ TQStringList images;
+ const char *error = 0;
+ const char* fileName = 0;
+ const char* className = 0;
+ const char* headerFile = 0;
+ TQCString outputFile;
+ TQCString image_tmpfile;
+ const char* projectName = 0;
+ const char* trmacro = 0;
+ bool nofwd = FALSE;
+ bool fix = FALSE;
+ TQCString pchFile;
+ TQApplication app(argc, argv, FALSE);
+
+ TQString keybase( "/TQt Designer/" +
+ TQString::number( (TQT_VERSION >> 16) & 0xff ) +"." + TQString::number( (TQT_VERSION >> 8) & 0xff ) + "/" );
+ TQSettings config;
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+ TQStringList pluginPaths = config.readListEntry( keybase + "PluginPaths" );
+ if (pluginPaths.count())
+ TQApplication::tqsetLibraryPaths(pluginPaths);
+
+ for ( int n = 1; n < argc && error == 0; n++ ) {
+ TQCString arg = argv[n];
+ if ( arg[0] == '-' ) { // option
+ TQCString opt = arg.tqstringFromPos(1);
+ if ( opt[0] == 'o' ) { // output redirection
+ if ( opt[1] == '\0' ) {
+ if ( !(n < argc-1) ) {
+ error = "Missing output-file name";
+ break;
+ }
+ outputFile = argv[++n];
+ } else
+ outputFile = opt.tqstringFromPos(1);
+ } else if ( opt[0] == 'i' || opt == "impl" ) {
+ impl = TRUE;
+ if ( opt == "impl" || opt[1] == '\0' ) {
+ if ( !(n < argc-1) ) {
+ error = "Missing name of header file";
+ break;
+ }
+ headerFile = argv[++n];
+ } else
+ headerFile = opt.tqstringFromPos(1);
+ } else if ( opt[0] == 'e' || opt == "embed" ) {
+ imagecollection = TRUE;
+ if ( opt == "embed" || opt[1] == '\0' ) {
+ if ( !(n < argc-1) ) {
+ error = "Missing name of project";
+ break;
+ }
+ projectName = argv[++n];
+ } else {
+ projectName = opt.tqstringFromPos(1);
+ }
+ if ( argc > n+1 && qstrcmp( argv[n+1], "-f" ) == 0 ) {
+ imagecollection_tmpfile = TRUE;
+ image_tmpfile = argv[n+2];
+ n += 2;
+ }
+#if defined(UIB)
+
+ } else if ( opt == "binary" ) {
+ binary = TRUE;
+#endif
+ } else if ( opt == "nofwd" ) {
+ nofwd = TRUE;
+ } else if ( opt == "nounload" ) {
+ dbnounload = TRUE;
+ } else if ( opt == "subdecl" ) {
+ subcl = TRUE;
+ if ( !(n < argc-2) ) {
+ error = "Missing arguments";
+ break;
+ }
+ className = argv[++n];
+ headerFile = argv[++n];
+ } else if ( opt == "subimpl" ) {
+ subcl = TRUE;
+ impl = TRUE;
+ if ( !(n < argc-2) ) {
+ error = "Missing arguments";
+ break;
+ }
+ className = argv[++n];
+ headerFile = argv[++n];
+ } else if ( opt == "tr" ) {
+ if ( opt == "tr" || opt[1] == '\0' ) {
+ if ( !(n < argc-1) ) {
+ error = "Missing tr macro.";
+ break;
+ }
+ trmacro = argv[++n];
+ } else {
+ trmacro = opt.tqstringFromPos(1);
+ }
+ } else if ( opt == "L" ) {
+ if ( !(n < argc-1) ) {
+ error = "Missing plugin path.";
+ break;
+ }
+ if ( !dbpaths )
+ dbpaths = new TQStringList();
+ TQString fn = TQFile::decodeName( argv[++n] );
+ dbpaths->append( fn );
+ TQApplication::addLibraryPath( fn );
+ } else if ( opt == "version" ) {
+ fprintf( stderr,
+ "User Interface Compiler for TQt version %s\n",
+ TQT_VERSION_STR );
+ return 1;
+ } else if ( opt == "help" ) {
+ break;
+ } else if ( opt == "fix" ) {
+ fix = TRUE;
+ } else if ( opt == "pch") {
+ if ( !(n < argc-1) ) {
+ error = "Missing name of PCH file";
+ break;
+ }
+ pchFile = argv[++n];
+ } else {
+ error = "Unrecognized option";
+ }
+ } else {
+ if ( imagecollection && !imagecollection_tmpfile )
+ images << argv[n];
+ else if ( fileName ) // can handle only one file
+ error = "Too many input files specified";
+ else
+ fileName = argv[n];
+ }
+ }
+
+ if ( argc < 2 || error || (!fileName && !imagecollection ) ) {
+ fprintf( stderr, "TQt user interface compiler.\n" );
+ if ( error )
+ fprintf( stderr, "uic: %s\n", error );
+
+ fprintf( stderr, "Usage: %s [options] [mode] <uifile>\n\n"
+ "Generate declaration:\n"
+ " %s [options] <uifile>\n"
+ "Generate implementation:\n"
+ " %s [options] -impl <headerfile> <uifile>\n"
+ "\t<headerfile> name of the declaration file\n"
+ "Generate image collection:\n"
+ " %s [options] -embed <project> <image1> <image2> <image3> ...\n"
+ "or\n"
+ " %s [options] -embed <project> -f <temporary file containing image names>\n"
+ "\t<project> project name\n"
+ "\t<image[1-N]> image files\n"
+#if defined(UIB)
+ "Generate binary UI file:\n"
+ " %s [options] -binary <uifile>\n"
+#endif
+ "Generate subclass declaration:\n"
+ " %s [options] -subdecl <subclassname> <baseclassheaderfile> <uifile>\n"
+ "\t<subclassname> name of the subclass to generate\n"
+ "\t<baseclassheaderfile> declaration file of the baseclass\n"
+ "Generate subclass implementation:\n"
+ " %s [options] -subimpl <subclassname> <subclassheaderfile> <uifile>\n"
+ "\t<subclassname> name of the subclass to generate\n"
+ "\t<subclassheaderfile> declaration file of the subclass\n"
+ "Options:\n"
+ "\t-o file Write output to file rather than stdout\n"
+ "\t-pch file Add #include \"file\" as the first statement in implementation\n"
+ "\t-nofwd Omit forward declarations of custom classes\n"
+ "\t-nounload Don't unload plugins after processing\n"
+ "\t-tr func Use func() instead of tr() for i18n\n"
+ "\t-L path Additional plugin search path\n"
+ "\t-version Display version of uic\n"
+ "\t-help Display this information\n"
+ , argv[0], argv[0], argv[0], argv[0], argv[0], argv[0], argv[0]
+#if defined(UIB)
+ , argv[0]
+#endif
+ );
+ return 1;
+ }
+
+ if ( imagecollection_tmpfile ) {
+ TQFile ifile( image_tmpfile );
+ if ( ifile.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &ifile );
+ TQString s = ts.read();
+ s = s.simplifyWhiteSpace();
+ images = TQStringList::split( ' ', s );
+ for ( TQStringList::Iterator it = images.begin(); it != images.end(); ++it )
+ *it = (*it).simplifyWhiteSpace();
+ }
+ }
+
+#if defined(UIB)
+ if ( binary && outputFile.isEmpty() ) {
+ outputFile = fileName;
+ if ( outputFile.mid(outputFile.length() - 3).lower() == ".ui" )
+ outputFile.truncate( outputFile.length() - 3 );
+ outputFile += ".uib";
+ }
+#endif
+
+ TQFile fileOut;
+ if ( !outputFile.isEmpty() ) {
+ fileOut.setName( outputFile );
+ if (!fileOut.open( IO_WriteOnly ) ) {
+ qWarning( "uic: Could not open output file '%s'", outputFile.data() );
+ return 1;
+ }
+ } else {
+ fileOut.open( IO_WriteOnly, stdout );
+ }
+ TQTextStream out( &fileOut );
+
+ if ( imagecollection ) {
+ out.setEncoding( TQTextStream::Latin1 );
+ Uic::embed( out, projectName, images );
+ return 0;
+ }
+
+ out.setEncoding( TQTextStream::UnicodeUTF8 );
+
+ TQFile file( fileName );
+ if ( !file.open( IO_ReadOnly ) ) {
+ qWarning( "uic: Could not open file '%s'", fileName );
+ return 1;
+ }
+
+ TQDomDocument doc;
+ TQString errMsg;
+ int errLine;
+ if ( !doc.setContent( &file, &errMsg, &errLine ) ) {
+ qWarning( TQString("uic: Failed to parse %s: ") + errMsg + TQString (" in line %d"), fileName, errLine );
+ return 1;
+ }
+
+ TQDomElement e = doc.firstChild().toElement();
+ if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.3 ) {
+ qWarning( TQString("uic: File generated with too recent version of TQt Designer (%s vs. %s)"),
+ e.attribute("version").latin1(), TQT_VERSION_STR );
+ return 1;
+ }
+
+ DomTool::fixDocument( doc );
+
+ if ( fix ) {
+ out << doc.toString();
+ return 0;
+#if defined(UIB)
+ } else if ( binary ) {
+ out.unsetDevice();
+ TQDataStream binaryOut( &fileOut );
+ convertUiToUib( doc, binaryOut );
+ return 0;
+#endif
+ }
+
+ if ( !subcl ) {
+ out << "/****************************************************************************" << endl;
+ out << "** Form "<< (impl? "implementation" : "interface") << " generated from reading ui file '" << fileName << "'" << endl;
+ out << "**" << endl;
+ out << "** Created: " << TQDateTime::tqcurrentDateTime().toString() << endl;
+ out << "**" << endl;
+ out << "** WARNING! All changes made in this file will be lost!" << endl;
+ out << "****************************************************************************/" << endl << endl;
+ }
+
+ TQString protector;
+ if ( subcl && className && !impl )
+ protector = TQT_TQSTRING_OBJECT(TQString::fromLocal8Bit( className )).upper() + "_H";
+
+ if ( !protector.isEmpty() ) {
+ out << "#ifndef " << protector << endl;
+ out << "#define " << protector << endl;
+ }
+
+ if ( !pchFile.isEmpty() && impl ) {
+ out << "#include \"" << pchFile << "\" // PCH include" << endl;
+ }
+
+ if ( headerFile ) {
+ out << "#include \"" << headerFile << "\"" << endl << endl;
+ }
+
+ Uic( fileName, outputFile, out, doc, !impl, subcl, trmacro, className, nofwd );
+
+ if ( !protector.isEmpty() ) {
+ out << endl;
+ out << "#endif // " << protector << endl;
+ }
+ if ( fileOut.status() != IO_Ok ) {
+ qWarning( "uic: Error writing to file" );
+ if ( !outputFile.isEmpty() )
+ remove( outputFile );
+ }
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/designer/uic/object.cpp b/tqtinterface/qt4/tools/designer/uic/object.cpp
new file mode 100644
index 0000000..1ce89b8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/object.cpp
@@ -0,0 +1,759 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "uic.h"
+#include "parser.h"
+#include "domtool.h"
+#include <tqregexp.h>
+#include <tqsizepolicy.h>
+#include <tqstringlist.h>
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include "../interfaces/widgetinterface.h"
+#include "../shared/widgetdatabase.h"
+
+/*!
+ Creates a declaration for the object given in \a e.
+
+ Children are not traversed recursively.
+
+ \sa createObjectImpl()
+ */
+void Uic::createObjectDecl( const TQDomElement& e )
+{
+ if ( e.tagName() == "vbox" ) {
+ out << " TQVBoxLayout* " << registerObject(getLayoutName(e) ) << ";" << endl;
+ } else if ( e.tagName() == "hbox" ) {
+ out << " TQHBoxLayout* " << registerObject(getLayoutName(e) ) << ";" << endl;
+ } else if ( e.tagName() == "grid" ) {
+ out << " TQGridLayout* " << registerObject(getLayoutName(e) ) << ";" << endl;
+ } else {
+ TQString objClass = getClassName( e );
+ if ( objClass.isEmpty() )
+ return;
+ TQString objName = getObjectName( e );
+ if ( objName.isEmpty() )
+ return;
+ // ignore TQLayoutWidgets
+ if ( objClass == "TQLayoutWidget" )
+ return;
+ // register the object and unify its name
+ objName = registerObject( objName );
+ if ( objClass == "Line" )
+ objClass = "TQFrame";
+ else if (objClass == "Spacer")
+ objClass = "TQSpacerItem";
+ out << " " << objClass << "* " << objName << ";" << endl;
+ }
+}
+
+
+/*!
+ Creates an implementation for the object given in \a e.
+
+ Traverses recursively over all tqchildren.
+
+ Returns the name of the generated child object.
+
+ \sa createObjectDecl()
+ */
+
+static bool createdCentralWidget = FALSE;
+
+TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& tqlayout )
+{
+ TQString tqparent( par );
+ if ( tqparent == "this" && isMainWindow ) {
+ if ( !createdCentralWidget )
+ out << indent << "setCentralWidget( new TQWidget( this, \"qt_central_widget\" ) );" << endl;
+ createdCentralWidget = TRUE;
+ tqparent = "centralWidget()";
+ }
+ TQDomElement n;
+ TQString objClass, objName;
+ int numItems = 0;
+ int numColumns = 0;
+ int numRows = 0;
+
+ if ( layouts.tqcontains( e.tagName() ) )
+ return createLayoutImpl( e, parentClass, tqparent, tqlayout );
+
+ objClass = getClassName( e );
+ if ( objClass.isEmpty() )
+ return objName;
+ objName = getObjectName( e );
+
+ TQString definedName = objName;
+ bool isTmpObject = objName.isEmpty() || objClass == "TQLayoutWidget";
+ if ( isTmpObject ) {
+ if (( objClass[0] == 'T' ) && ( objClass[1] == 'Q' ))
+ objName = objClass.mid(2);
+ else
+ objName = objClass.lower();
+ objName.prepend( "private" );
+ }
+
+ bool isLine = objClass == "Line";
+ if ( isLine )
+ objClass = "TQFrame";
+
+ out << endl;
+ if ( objClass == "TQLayoutWidget" ) {
+ if ( tqlayout.isEmpty() ) {
+ // register the object and unify its name
+ objName = registerObject( objName );
+ out << " TQWidget* " << objName << " = new TQWidget( " << tqparent << ", \"" << definedName << "\" );" << endl;
+ } else {
+ // the tqlayout widget is not necessary, hide it by creating its child in the tqparent
+ TQString result;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if (tags.tqcontains( n.tagName() ) )
+ result = createObjectImpl( n, parentClass, tqparent, tqlayout );
+ }
+ return result;
+ }
+ } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) {
+ // register the object and unify its name
+ objName = registerObject( objName );
+ out << " ";
+ if ( isTmpObject )
+ out << objClass << "* ";
+ out << objName << " = new " << createObjectInstance( objClass, tqparent, objName ) << ";" << endl;
+ }
+
+ if ( objClass == "TQAxWidget" ) {
+ TQString controlId;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) {
+ controlId = n.firstChild().toElement().text();
+ }
+ }
+ out << " ";
+ out << objName << "->setControl(\"" << controlId << "\");" << endl;
+ }
+
+ lastItem = "0";
+ // set the properties and insert items
+ bool hadFrameShadow = FALSE;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ bool stdset = stdsetdef;
+ if ( n.hasAttribute( "stdset" ) )
+ stdset = toBool( n.attribute( "stdset" ) );
+ TQString prop = n.attribute( "name" );
+ if ( prop == "database" )
+ continue;
+ TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ if ( value.isEmpty() )
+ continue;
+ if ( prop == "name" )
+ continue;
+ if ( isLine && prop == "frameShadow" )
+ hadFrameShadow = TRUE;
+ if ( prop == "buddy" && value.startsWith("\"") && value.endsWith("\"") ) {
+ buddies << Buddy( objName, value.mid(1, value.length() - 2 ) );
+ continue;
+ }
+ if ( isLine && prop == "orientation" ) {
+ prop = "frameShape";
+ if ( value.right(10) == "Horizontal" )
+ value = "TQFrame::HLine";
+ else
+ value = "TQFrame::VLine";
+ if ( !hadFrameShadow ) {
+ prop = "frameStyle";
+ value += " | TQFrame::Sunken";
+ }
+ }
+ if ( prop == "buttonGroupId" ) {
+ if ( parentClass == "TQButtonGroup" )
+ out << indent << tqparent << "->insert( " << objName << ", " << value << " );" << endl;
+ continue;
+ }
+ if ( prop == "frameworkCode" )
+ continue;
+ if ( objClass == "TQMultiLineEdit" &&
+ TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
+ continue;
+
+ TQString call = objName + "->";
+ if ( stdset ) {
+ call += mkStdSet( prop ) + "( ";
+ } else {
+ call += "setProperty( \"" + prop + "\", ";
+ }
+ if ( prop == "accel" )
+ call += "TQKeySequence( " + value + " ) );";
+ else
+ call += value + " );";
+
+ if ( n.firstChild().toElement().tagName() == "string" ||
+ prop == "currentItem" ) {
+ trout << indent << call << endl;
+ } else {
+ out << indent << call << endl;
+ }
+ } else if ( n.tagName() == "item" ) {
+ TQString call;
+ TQString value;
+
+ if ( objClass.tqcontains( "ListBox" ) ) {
+ call = createListBoxItemImpl( n, objName );
+ if ( !call.isEmpty() ) {
+ if ( numItems == 0 )
+ trout << indent << objName << "->clear();" << endl;
+ trout << indent << call << endl;
+ }
+ } else if ( objClass.tqcontains( "ComboBox" ) ) {
+ call = createListBoxItemImpl( n, objName, &value );
+ if ( !call.isEmpty() ) {
+ if ( numItems == 0 )
+ trout << indent << objName << "->clear();" << endl;
+ trout << indent << call << endl;
+ }
+ } else if ( objClass.tqcontains( "IconView" ) ) {
+ call = createIconViewItemImpl( n, objName );
+ if ( !call.isEmpty() ) {
+ if ( numItems == 0 )
+ trout << indent << objName << "->clear();" << endl;
+ trout << indent << call << endl;
+ }
+ } else if ( objClass.tqcontains( "ListView" ) ) {
+ call = createListViewItemImpl( n, objName, TQString() );
+ if ( !call.isEmpty() ) {
+ if ( numItems == 0 )
+ trout << indent << objName << "->clear();" << endl;
+ trout << call << endl;
+ }
+ }
+ if ( !call.isEmpty() )
+ numItems++;
+ } else if ( n.tagName() == "column" || n.tagName() == "row" ) {
+ TQString call;
+ TQString value;
+
+ if ( objClass.tqcontains( "ListView" ) ) {
+ call = createListViewColumnImpl( n, objName, &value );
+ if ( !call.isEmpty() ) {
+ out << call;
+ trout << indent << objName << "->header()->setLabel( "
+ << numColumns++ << ", " << value << " );\n";
+ }
+ } else if ( objClass == "TQTable" || objClass == "TQDataTable" ) {
+ bool isCols = ( n.tagName() == "column" );
+ call = createTableRowColumnImpl( n, objName, &value );
+ if ( !call.isEmpty() ) {
+ out << call;
+ trout << indent << objName << "->"
+ << ( isCols ? "horizontalHeader" : "verticalHeader" )
+ << "()->setLabel( "
+ << ( isCols ? numColumns++ : numRows++ )
+ << ", " << value << " );\n";
+ }
+ }
+ }
+ }
+
+ // create all tqchildren, some widgets have special requirements
+
+ if ( objClass == "TQTabWidget" ) {
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( tags.tqcontains( n.tagName() ) ) {
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ out << indent << objName << "->insertTab( " << page << ", TQString::tqfromLatin1(\"\") );" << endl;
+ trout << indent << objName << "->changeTab( " << page << ", "
+ << trcall( label, comment ) << " );" << endl;
+ }
+ }
+ } else if ( objClass == "TQWidgetStack" ) {
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( tags.tqcontains( n.tagName() ) ) {
+ TQString page = createObjectImpl( n, objClass, objName );
+ int id = DomTool::readAttribute( n, "id", "" ).toInt();
+ out << indent << objName << "->addWidget( " << page << ", " << id << " );" << endl;
+ }
+ }
+ } else if ( objClass == "TQToolBox" ) {
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( tags.tqcontains( n.tagName() ) ) {
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "label", "", comment ).toString();
+ out << indent << objName << "->addItem( " << page << ", TQString::tqfromLatin1(\"\") );" << endl;
+ trout << indent << objName << "->setItemLabel( " << objName
+ << "->indexOf(" << page << "), " << trcall( label, comment )
+ << " );" << endl;
+ }
+ }
+ } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { // standard widgets
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( objClass, &iface );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ int id = WidgetDatabase::idFromClassName( objClass );
+ if ( WidgetDatabase::isContainer( id ) && WidgetDatabase::isCustomPluginWidget( id ) && iface ) {
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ bool supportsPages = iface2->supportsPages( objClass );
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( tags.tqcontains( n.tagName() ) ) {
+ if ( supportsPages ) {
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "label", "", comment ).toString();
+ out << indent << iface2->createCode( objClass, objName, page, label ) << endl;
+ } else {
+ createObjectImpl( n, objClass, objName );
+ }
+ }
+ }
+ iface2->release();
+ }
+ iface->release();
+ } else {
+#endif
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( tags.tqcontains( n.tagName() ) )
+ createObjectImpl( n, objClass, objName );
+ }
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ }
+#endif
+ }
+
+ return objName;
+}
+
+/*!
+ Creates declarations for spacer items that are tqchildren of \a e.
+
+ \sa createObjectDecl()
+*/
+
+void Uic::createSpacerDecl( const TQDomElement &e )
+{
+ for ( TQDomElement n = e.firstChild().toElement();
+ !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "spacer" )
+ out << " TQSpacerItem* " << registerObject(getObjectName(n)) << ";" << endl;
+}
+
+/*!
+ Creates a set-call for property \a exclusiveProp of the object
+ given in \a e.
+
+ If the object does not have this property, the function does nothing.
+
+ Exclusive properties are used to generate the implementation of
+ application font or palette change handlers in createFormImpl().
+
+ */
+void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp )
+{
+ TQDomElement n;
+ TQString objClass = getClassName( e );
+ if ( objClass.isEmpty() )
+ return;
+ TQString objName = getObjectName( e );
+#if 0 // it's not clear whether this check should be here or not
+ if ( objName.isEmpty() )
+ return;
+#endif
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ bool stdset = stdsetdef;
+ if ( n.hasAttribute( "stdset" ) )
+ stdset = toBool( n.attribute( "stdset" ) );
+ TQString prop = n.attribute( "name" );
+ if ( prop != exclusiveProp )
+ continue;
+ TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ if ( value.isEmpty() )
+ continue;
+ // we assume the property isn't of type 'string'
+ out << '\t' << objName << "->setProperty( \"" << prop << "\", " << value << " );" << endl;
+ }
+ }
+}
+
+
+/*! Attention: this function has to be in sync with
+ Resource::saveProperty() and DomTool::elementToVariant. If you
+ change one, change all.
+ */
+TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset )
+{
+ TQString v;
+ if ( e.tagName() == "rect" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int x = 0, y = 0, w = 0, h = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "x" )
+ x = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "y" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "width" )
+ w = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "height" )
+ h = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = "TQRect( %1, %2, %3, %4 )";
+ v = v.arg(x).arg(y).arg(w).arg(h);
+
+ } else if ( e.tagName() == "point" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int x = 0, y = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "x" )
+ x = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "y" )
+ y = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = "TQPoint( %1, %2 )";
+ v = v.arg(x).arg(y);
+ } else if ( e.tagName() == "size" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int w = 0, h = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "width" )
+ w = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "height" )
+ h = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = "TQSize( %1, %2 )";
+ v = v.arg(w).arg(h);
+ } else if ( e.tagName() == "color" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int r = 0, g = 0, b = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "red" )
+ r = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "green" )
+ g = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "blue" )
+ b = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = "TQColor( %1, %2, %3 )";
+ v = v.arg(r).arg(g).arg(b);
+ } else if ( e.tagName() == "font" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString attrname = e.parentNode().toElement().attribute( "name", "font" );
+ TQString fontname;
+ if ( !obj.isEmpty() ) {
+ fontname = registerObject( obj + "_" + attrname );
+ out << indent << "TQFont " << fontname << "( " << obj << "->font() );" << endl;
+ } else {
+ fontname = registerObject( "f" );
+ out << indent << "TQFont " << fontname << "( font() );" << endl;
+ }
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "family" )
+ out << indent << fontname << ".setFamily( \"" << n3.firstChild().toText().data() << "\" );" << endl;
+ else if ( n3.tagName() == "pointsize" )
+ out << indent << fontname << ".setPointSize( " << n3.firstChild().toText().data() << " );" << endl;
+ else if ( n3.tagName() == "bold" )
+ out << indent << fontname << ".setBold( " << mkBool( n3.firstChild().toText().data() ) << " );" << endl;
+ else if ( n3.tagName() == "italic" )
+ out << indent << fontname << ".setItalic( " << mkBool( n3.firstChild().toText().data() ) << " );" << endl;
+ else if ( n3.tagName() == "underline" )
+ out << indent << fontname << ".setUnderline( " << mkBool( n3.firstChild().toText().data() ) << " );" << endl;
+ else if ( n3.tagName() == "strikeout" )
+ out << indent << fontname << ".setStrikeOut( " << mkBool( n3.firstChild().toText().data() ) << " );" << endl;
+ n3 = n3.nextSibling().toElement();
+ }
+
+ if ( prop == "font" ) {
+ if ( !obj.isEmpty() )
+ out << indent << obj << "->setFont( " << fontname << " ); " << endl;
+ else
+ out << indent << "setFont( " << fontname << " ); " << endl;
+ } else {
+ v = fontname;
+ }
+ } else if ( e.tagName() == "string" ) {
+ TQString txt = e.firstChild().toText().data();
+ TQString com = getComment( e.parentNode() );
+
+ if ( prop == "toolTip" && objClass != "TQAction" && objClass != "TQActionGroup" ) {
+ if ( !obj.isEmpty() )
+ trout << indent << "TQToolTip::add( " << obj << ", "
+ << trcall( txt, com ) << " );" << endl;
+ else
+ trout << indent << "TQToolTip::add( this, "
+ << trcall( txt, com ) << " );" << endl;
+ } else if ( prop == "whatsThis" && objClass != "TQAction" && objClass != "TQActionGroup" ) {
+ if ( !obj.isEmpty() )
+ trout << indent << "TQWhatsThis::add( " << obj << ", "
+ << trcall( txt, com ) << " );" << endl;
+ else
+ trout << indent << "TQWhatsThis::add( this, "
+ << trcall( txt, com ) << " );" << endl;
+ } else {
+ v = trcall( txt, com );
+ }
+ } else if ( e.tagName() == "cstring" ) {
+ v = "\"%1\"";
+ v = v.arg( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "number" ) {
+ v = "%1";
+ v = v.arg( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "bool" ) {
+ if ( stdset )
+ v = "%1";
+ else
+ v = "TQVariant( %1, 0 )";
+ v = v.arg( mkBool( e.firstChild().toText().data() ) );
+ } else if ( e.tagName() == "pixmap" ) {
+ v = e.firstChild().toText().data();
+ if ( !pixmapLoaderFunction.isEmpty() ) {
+ v.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ v.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ } else if ( e.tagName() == "iconset" ) {
+ v = "TQIconSet( %1 )";
+ TQString s = e.firstChild().toText().data();
+ if ( !pixmapLoaderFunction.isEmpty() ) {
+ s.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ s.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ v = v.arg( s );
+ } else if ( e.tagName() == "image" ) {
+ v = e.firstChild().toText().data() + ".convertToImage()";
+ } else if ( e.tagName() == "enum" ) {
+ if ( stdset )
+ v = "%1::%2";
+ else
+ v = "\"%1\"";
+ TQString oc = objClass;
+ TQString ev = e.firstChild().toText().data();
+ if ( oc == "TQListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual in 4.0
+ oc = "TQScrollView";
+ if ((ev == "NoFocus")
+ || (ev == "TabFocus")
+ || (ev == "ClickFocus")
+ || (ev == "StrongFocus")
+ || (ev == "WheelFocus")
+ || (ev == "Horizontal")
+ || (ev == "Vertical"))
+ oc = "Qt";
+ if ( stdset )
+ v = v.arg( oc ).arg( ev );
+ else
+ v = v.arg( ev );
+ } else if ( e.tagName() == "set" ) {
+ TQString keys( e.firstChild().toText().data() );
+ TQStringList lst = TQStringList::split( '|', keys );
+ v = "int( ";
+ TQStringList::Iterator it = lst.begin();
+ while ( it != lst.end() ) {
+ if (((*it).tqfind("Align", 0, TRUE) == 0)
+ || ((*it) == "WordBreak")) {
+ v += "TQt::" + *it;
+ }
+ else {
+ v += objClass + "::" + *it;
+ }
+ if ( it != lst.fromLast() )
+ v += " | ";
+ ++it;
+ }
+ v += " )";
+ } else if ( e.tagName() == "sizepolicy" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ TQSizePolicy sp;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hsizetype" )
+ sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "vsizetype" )
+ sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "horstretch" )
+ sp.setHorStretch( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "verstretch" )
+ sp.setVerStretch( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ TQString tmp;
+ if ( !obj.isEmpty() )
+ tmp = obj + "->";
+ v = "TQSizePolicy( (TQSizePolicy::SizeType)%1, (TQSizePolicy::SizeType)%2, %3, %4, " + tmp + "sizePolicy().hasHeightForWidth() )";
+ v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() ).arg( sp.horStretch() ).arg( sp.verStretch() );
+ } else if ( e.tagName() == "palette" ) {
+ TQPalette pal;
+ bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0;
+ TQDomElement n;
+ if ( no_pixmaps ) {
+ n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ TQColorGroup cg;
+ if ( n.tagName() == "active" ) {
+ cg = loadColorGroup( n );
+ pal.setActive( cg );
+ } else if ( n.tagName() == "inactive" ) {
+ cg = loadColorGroup( n );
+ pal.setInactive( cg );
+ } else if ( n.tagName() == "disabled" ) {
+ cg = loadColorGroup( n );
+ pal.setDisabled( cg );
+ }
+ n = n.nextSibling().toElement();
+ }
+ }
+ if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) {
+ v = "TQPalette( TQColor( %1, %2, %3 ), TQColor( %1, %2, %3 ) )";
+ v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() );
+ v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() );
+ } else {
+ TQString palette = "pal";
+ if ( !pal_used ) {
+ out << indent << "TQPalette " << palette << ";" << endl;
+ pal_used = TRUE;
+ }
+ TQString cg = "cg";
+ if ( !cg_used ) {
+ out << indent << "TQColorGroup " << cg << ";" << endl;
+ cg_used = TRUE;
+ }
+ n = e.firstChild().toElement();
+ while ( !n.isNull() && n.tagName() != "active" )
+ n = n.nextSibling().toElement();
+ createColorGroupImpl( cg, n );
+ out << indent << palette << ".setActive( " << cg << " );" << endl;
+
+ n = e.firstChild().toElement();
+ while ( !n.isNull() && n.tagName() != "inactive" )
+ n = n.nextSibling().toElement();
+ createColorGroupImpl( cg, n );
+ out << indent << palette << ".setInactive( " << cg << " );" << endl;
+
+ n = e.firstChild().toElement();
+ while ( !n.isNull() && n.tagName() != "disabled" )
+ n = n.nextSibling().toElement();
+ createColorGroupImpl( cg, n );
+ out << indent << palette << ".setDisabled( " << cg << " );" << endl;
+ v = palette;
+ }
+ } else if ( e.tagName() == "cursor" ) {
+ v = "TQCursor( %1 )";
+ v = v.arg( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "date" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int y, m, d;
+ y = m = d = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "year" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "month" )
+ m = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "day" )
+ d = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = "TQDate( %1, %2, %3 )";
+ v = v.arg(y).arg(m).arg(d);
+ } else if ( e.tagName() == "time" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int h, m, s;
+ h = m = s = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hour" )
+ h = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "minute" )
+ m = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "second" )
+ s = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = "TQTime( %1, %2, %3 )";
+ v = v.arg(h).arg(m).arg(s);
+ } else if ( e.tagName() == "datetime" ) {
+ TQDomElement n3 = e.firstChild().toElement();
+ int h, mi, s, y, mo, d;
+ h = mi = s = y = mo = d = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hour" )
+ h = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "minute" )
+ mi = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "second" )
+ s = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "year" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "month" )
+ mo = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "day" )
+ d = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = "TQDateTime( TQDate( %1, %2, %3 ), TQTime( %4, %5, %6 ) )";
+ v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s);
+ } else if ( e.tagName() == "stringlist" ) {
+ TQStringList l;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString listname = "l";
+ if ( !obj.isEmpty() ) {
+ listname = obj + "_stringlist";
+ listname = registerObject( listname );
+ out << indent << "TQStringList " << listname << ";" << endl;
+ } else {
+ listname = registerObject( listname );
+ out << indent << "TQStringList " << listname << ";" << endl;
+ }
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "string" )
+ out << indent << listname << " << \"" << n3.firstChild().toText().data().simplifyWhiteSpace() << "\";" << endl;
+ n3 = n3.nextSibling().toElement();
+ }
+ v = listname;
+ }
+ return v;
+}
+
+/*! Extracts a named object property from \a e.
+ */
+TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name )
+{
+ TQDomElement n;
+ for ( n = e.firstChild().toElement();
+ !n.isNull();
+ n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" && n.toElement().attribute("name") == name )
+ return n;
+ }
+ return n;
+}
diff --git a/tqtinterface/qt4/tools/designer/uic/subclassing.cpp b/tqtinterface/qt4/tools/designer/uic/subclassing.cpp
new file mode 100644
index 0000000..895c7f8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/subclassing.cpp
@@ -0,0 +1,353 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "uic.h"
+#include "parser.h"
+#include "widgetdatabase.h"
+#include "domtool.h"
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqdatetime.h>
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include <tqregexp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*!
+ Creates a declaration ( headerfile ) for a subclass \a subClass
+ of the form given in \a e
+
+ \sa createSubImpl()
+ */
+void Uic::createSubDecl( const TQDomElement &e, const TQString& subClass )
+{
+ TQDomElement n;
+ TQDomNodeList nl;
+ int i;
+
+ TQString objClass = getClassName( e );
+ if ( objClass.isEmpty() )
+ return;
+
+ out << "class " << subClass << " : public " << nameOfClass << endl;
+ out << "{" << endl;
+
+/* tmake ignore TQ_OBJECT */
+ out << " Q_OBJECT" << endl;
+ out << " TQ_OBJECT" << endl;
+ out << endl;
+ out << "public:" << endl;
+
+ // constructor
+ if ( objClass == "TQDialog" || objClass == "TQWizard" ) {
+ out << " " << subClass << "( TQWidget* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );" << endl;
+ } else { // standard TQWidget
+ out << " " << subClass << "( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );" << endl;
+ }
+
+ // destructor
+ out << " ~" << subClass << "();" << endl;
+ out << endl;
+
+ // tqfind additional functions
+ TQStringList publicSlots, protectedSlots, privateSlots;
+ TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes;
+ TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier;
+ TQStringList publicFuncts, protectedFuncts, privateFuncts;
+ TQStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp;
+ TQStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec;
+
+ nl = e.parentNode().toElement().elementsByTagName( "slot" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ if ( n.parentNode().toElement().tagName() != "Q_SLOTS"
+ && n.parentNode().toElement().tagName() != "connections" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
+ if ( access == "protected" ) {
+ protectedSlots += functionName;
+ protectedSlotTypes += returnType;
+ protectedSlotSpecifier += specifier;
+ } else if ( access == "private" ) {
+ privateSlots += functionName;
+ privateSlotTypes += returnType;
+ privateSlotSpecifier += specifier;
+ } else {
+ publicSlots += functionName;
+ publicSlotTypes += returnType;
+ publicSlotSpecifier += specifier;
+ }
+ }
+
+ nl = e.parentNode().toElement().elementsByTagName( "function" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ if ( n.parentNode().toElement().tagName() != "functions" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
+ if ( access == "protected" ) {
+ protectedFuncts += functionName;
+ protectedFunctRetTyp += returnType;
+ protectedFunctSpec += specifier;
+ } else if ( access == "private" ) {
+ privateFuncts += functionName;
+ privateFunctRetTyp += returnType;
+ privateFunctSpec += specifier;
+ } else {
+ publicFuncts += functionName;
+ publicFunctRetTyp += returnType;
+ publicFunctSpec += specifier;
+ }
+ }
+
+ if ( !publicFuncts.isEmpty() )
+ writeFunctionsSubDecl( publicFuncts, publicFunctRetTyp, publicFunctSpec );
+
+ // create public additional Q_SLOTS
+ if ( !publicSlots.isEmpty() ) {
+ out << "public Q_SLOTS:" << endl;
+ writeFunctionsSubDecl( publicSlots, publicSlotTypes, publicSlotSpecifier );
+ }
+
+ if ( !protectedFuncts.isEmpty() ) {
+ out << "protected:" << endl;
+ writeFunctionsSubDecl( protectedFuncts, protectedFunctRetTyp, protectedFunctSpec );
+ }
+
+ // create protected additional Q_SLOTS
+ if ( !protectedSlots.isEmpty() ) {
+ out << "protected Q_SLOTS:" << endl;
+ writeFunctionsSubDecl( protectedSlots, protectedSlotTypes, protectedSlotSpecifier );
+ }
+
+ if ( !privateFuncts.isEmpty() ) {
+ out << "private:" << endl;
+ writeFunctionsSubDecl( privateFuncts, privateFunctRetTyp, privateFunctSpec );
+ }
+
+ // create private additional Q_SLOTS
+ if ( !privateSlots.isEmpty() ) {
+ out << "private Q_SLOTS:" << endl;
+ writeFunctionsSubDecl( privateSlots, privateSlotTypes, privateSlotSpecifier );
+ }
+ out << "};" << endl;
+}
+
+void Uic::writeFunctionsSubDecl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst )
+{
+ TQValueListConstIterator<TQString> it, it2, it3;
+ for ( it = fuLst.begin(), it2 = typLst.begin(), it3 = specLst.begin();
+ it != fuLst.end(); ++it, ++it2, ++it3 ) {
+ TQString type = *it2;
+ if ( type.isEmpty() )
+ type = "void";
+ if ( *it3 == "non virtual" )
+ continue;
+ out << " " << type << " " << (*it) << ";" << endl;
+ }
+ out << endl;
+}
+
+/*!
+ Creates an implementation for a subclass \a subClass of the form
+ given in \a e
+
+ \sa createSubDecl()
+ */
+void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
+{
+ TQDomElement n;
+ TQDomNodeList nl;
+ int i;
+
+ TQString objClass = getClassName( e );
+ if ( objClass.isEmpty() )
+ return;
+
+ // constructor
+ if ( objClass == "TQDialog" || objClass == "TQWizard" ) {
+ out << "/* " << endl;
+ out << " * Constructs a " << subClass << " which is a child of 'tqparent', with the " << endl;
+ out << " * name 'name' and widget flags set to 'f' " << endl;
+ out << " *" << endl;
+ out << " * The " << objClass.mid(2).lower() << " will by default be modeless, unless you set 'modal' to" << endl;
+ out << " * TRUE to construct a modal " << objClass.mid(2).lower() << "." << endl;
+ out << " */" << endl;
+ out << subClass << "::" << subClass << "( TQWidget* tqparent, const char* name, bool modal, WFlags fl )" << endl;
+ out << " : " << nameOfClass << "( tqparent, name, modal, fl )" << endl;
+ } else { // standard TQWidget
+ out << "/* " << endl;
+ out << " * Constructs a " << subClass << " which is a child of 'tqparent', with the " << endl;
+ out << " * name 'name' and widget flags set to 'f' " << endl;
+ out << " */" << endl;
+ out << subClass << "::" << subClass << "( TQWidget* tqparent, const char* name, WFlags fl )" << endl;
+ out << " : " << nameOfClass << "( tqparent, name, fl )" << endl;
+ }
+ out << "{" << endl;
+ out << "}" << endl;
+ out << endl;
+
+ // destructor
+ out << "/* " << endl;
+ out << " * Destroys the object and frees any allocated resources" << endl;
+ out << " */" << endl;
+ out << subClass << "::~" << subClass << "()" << endl;
+ out << "{" << endl;
+ out << " // no need to delete child widgets, TQt does it all for us" << endl;
+ out << "}" << endl;
+ out << endl;
+
+
+ // tqfind additional functions
+ TQStringList publicSlots, protectedSlots, privateSlots;
+ TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes;
+ TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier;
+ TQStringList publicFuncts, protectedFuncts, privateFuncts;
+ TQStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp;
+ TQStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec;
+
+ nl = e.parentNode().toElement().elementsByTagName( "slot" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ if ( n.parentNode().toElement().tagName() != "Q_SLOTS"
+ && n.parentNode().toElement().tagName() != "connections" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
+ if ( access == "protected" ) {
+ protectedSlots += functionName;
+ protectedSlotTypes += returnType;
+ protectedSlotSpecifier += specifier;
+ } else if ( access == "private" ) {
+ privateSlots += functionName;
+ privateSlotTypes += returnType;
+ privateSlotSpecifier += specifier;
+ } else {
+ publicSlots += functionName;
+ publicSlotTypes += returnType;
+ publicSlotSpecifier += specifier;
+ }
+ }
+
+ nl = e.parentNode().toElement().elementsByTagName( "function" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ n = nl.item(i).toElement();
+ if ( n.parentNode().toElement().tagName() != "functions" )
+ continue;
+ if ( n.attribute( "language", "C++" ) != "C++" )
+ continue;
+ TQString returnType = n.attribute( "returnType", "void" );
+ TQString functionName = n.firstChild().toText().data().stripWhiteSpace();
+ if ( functionName.endsWith( ";" ) )
+ functionName = functionName.left( functionName.length() - 1 );
+ TQString specifier = n.attribute( "specifier" );
+ TQString access = n.attribute( "access" );
+ if ( access == "protected" ) {
+ protectedFuncts += functionName;
+ protectedFunctRetTyp += returnType;
+ protectedFunctSpec += specifier;
+ } else if ( access == "private" ) {
+ privateFuncts += functionName;
+ privateFunctRetTyp += returnType;
+ privateFunctSpec += specifier;
+ } else {
+ publicFuncts += functionName;
+ publicFunctRetTyp += returnType;
+ publicFunctSpec += specifier;
+ }
+ }
+
+ if ( !publicFuncts.isEmpty() )
+ writeFunctionsSubImpl( publicFuncts, publicFunctRetTyp, publicFunctSpec, subClass, "public function" );
+
+ // create stubs for public additional Q_SLOTS
+ if ( !publicSlots.isEmpty() )
+ writeFunctionsSubImpl( publicSlots, publicSlotTypes, publicSlotSpecifier, subClass, "public slot" );
+
+ if ( !protectedFuncts.isEmpty() )
+ writeFunctionsSubImpl( protectedFuncts, protectedFunctRetTyp, protectedFunctSpec, subClass, "protected function" );
+
+ // create stubs for protected additional Q_SLOTS
+ if ( !protectedSlots.isEmpty() )
+ writeFunctionsSubImpl( protectedSlots, protectedSlotTypes, protectedSlotSpecifier, subClass, "protected slot" );
+
+ if ( !privateFuncts.isEmpty() )
+ writeFunctionsSubImpl( privateFuncts, privateFunctRetTyp, privateFunctSpec, subClass, "private function" );
+
+ // create stubs for private additional Q_SLOTS
+ if ( !privateSlots.isEmpty() )
+ writeFunctionsSubImpl( privateSlots, privateSlotTypes, privateSlotSpecifier, subClass, "private slot" );
+}
+
+void Uic::writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst,
+ const TQString &subClass, const TQString &descr )
+{
+ TQValueListConstIterator<TQString> it, it2, it3;
+ for ( it = fuLst.begin(), it2 = typLst.begin(), it3 = specLst.begin();
+ it != fuLst.end(); ++it, ++it2, ++it3 ) {
+ TQString type = *it2;
+ if ( type.isEmpty() )
+ type = "void";
+ if ( *it3 == "non virtual" )
+ continue;
+ out << "/*" << endl;
+ out << " * " << descr << endl;
+ out << " */" << endl;
+ out << type << " " << subClass << "::" << (*it) << endl;
+ out << "{" << endl;
+ out << " qWarning( \"" << subClass << "::" << (*it) << " not yet implemented!\" );" << endl;
+ out << "}" << endl << endl;
+ }
+ out << endl;
+}
diff --git a/tqtinterface/qt4/tools/designer/uic/uic.cpp b/tqtinterface/qt4/tools/designer/uic/uic.cpp
new file mode 100644
index 0000000..5eed175
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/uic.cpp
@@ -0,0 +1,1129 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "uic.h"
+#include "parser.h"
+#include "widgetdatabase.h"
+#include "domtool.h"
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqdatetime.h>
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include <tqregexp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+bool Uic::isMainWindow = FALSE;
+
+TQString Uic::getComment( const TQDomNode& n )
+{
+ TQDomNode child = n.firstChild();
+ while ( !child.isNull() ) {
+ if ( child.toElement().tagName() == "comment" )
+ return child.toElement().firstChild().toText().data();
+ child = child.nextSibling();
+ }
+ return TQString();
+}
+
+TQString Uic::mkBool( bool b )
+{
+ return b? "TRUE" : "FALSE";
+}
+
+TQString Uic::mkBool( const TQString& s )
+{
+ return mkBool( s == "true" || s == "1" );
+}
+
+bool Uic::toBool( const TQString& s )
+{
+ return s == "true" || s.toInt() != 0;
+}
+
+TQString Uic::fixString( const TQString &str, bool encode )
+{
+ TQString s;
+ if ( !encode ) {
+ s = str;
+ s.tqreplace( "\\", "\\\\" );
+ s.tqreplace( "\"", "\\\"" );
+ s.tqreplace( "\r", "" );
+ s.tqreplace( "\n", "\\n\"\n\"" );
+ } else {
+ TQCString utf8 = str.utf8();
+ const int l = utf8.length();
+
+ for ( int i = 0; i < l; ++i ) {
+ uchar c = (uchar)utf8[i];
+ if (c != 0x0d) // skip \r
+ s += "\\x" + TQString::number(c, 16);
+
+ if (i && (i % 20) == 0)
+ s += "\"\n \"";
+ }
+ }
+
+ return "\"" + s + "\"";
+}
+
+TQString Uic::trcall( const TQString& sourceText, const TQString& comment )
+{
+ if ( sourceText.isEmpty() && comment.isEmpty() )
+ return "TQString()";
+
+ TQString t = trmacro;
+ bool encode = FALSE;
+ if ( t.isNull() ) {
+ t = "tqtr";
+ for ( int i = 0; i < (int) sourceText.length(); i++ ) {
+ if ( sourceText[i].tqunicode() >= 0x80 ) {
+ t = "trUtf8";
+ encode = TRUE;
+ break;
+ }
+ }
+ }
+
+ if ( comment.isEmpty() ) {
+ return t + "( " + fixString( sourceText, encode ) + " )";
+ } else {
+ return t + "( " + fixString( sourceText, encode ) + ", " +
+ fixString( comment, encode ) + " )";
+ }
+}
+
+TQString Uic::mkStdSet( const TQString& prop )
+{
+ return TQString( "set" ) + prop[0].upper() + prop.mid(1);
+}
+
+
+
+/*!
+ \class Uic uic.h
+ \brief User Interface Compiler
+
+ The class Uic encapsulates the user interface compiler (uic).
+ */
+Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream,
+ TQDomDocument doc, bool decl, bool subcl, const TQString &trm,
+ const TQString& subClass, bool omitForwardDecls )
+ : out( outStream ), trout( &languageChangeBody ),
+ outputFileName( outputFn ), trmacro( trm ), nofwd( omitForwardDecls )
+{
+ fileName = fn;
+ writeFunctImpl = TRUE;
+ defMargin = BOXLAYOUT_DEFAULT_MARGIN;
+ defSpacing = BOXLAYOUT_DEFAULT_SPACING;
+ externPixmaps = FALSE;
+ indent = " "; // default indent
+
+ item_used = cg_used = pal_used = 0;
+
+ layouts << "hbox" << "vbox" << "grid";
+ tags = layouts;
+ tags << "widget";
+
+ pixmapLoaderFunction = getPixmapLoaderFunction( doc.firstChild().toElement() );
+ nameOfClass = getFormClassName( doc.firstChild().toElement() );
+
+ uiFileVersion = doc.firstChild().toElement().attribute("version");
+ stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") );
+
+ if ( doc.firstChild().isNull() || doc.firstChild().firstChild().isNull() )
+ return;
+ TQDomElement e = doc.firstChild().firstChild().toElement();
+ TQDomElement widget;
+ while ( !e.isNull() ) {
+ if ( e.tagName() == "widget" ) {
+ widget = e;
+ } else if ( e.tagName() == "pixmapinproject" ) {
+ externPixmaps = TRUE;
+ } else if ( e.tagName() == "layoutdefaults" ) {
+ defSpacing = e.attribute( "spacing", defSpacing.toString() );
+ defMargin = e.attribute( "margin", defMargin.toString() );
+ } else if ( e.tagName() == "layoutfunctions" ) {
+ defSpacing = e.attribute( "spacing", defSpacing.toString() );
+ bool ok;
+ defSpacing.toInt( &ok );
+ if ( !ok ) {
+ TQString buf = defSpacing.toString();
+ defSpacing = TQT_TQSTRING_OBJECT(buf.append( "()" ));
+ }
+ defMargin = e.attribute( "margin", defMargin.toString() );
+ defMargin.toInt( &ok );
+ if ( !ok ) {
+ TQString buf = defMargin.toString();
+ defMargin = TQT_TQSTRING_OBJECT(buf.append( "()" ));
+ }
+ }
+ e = e.nextSibling().toElement();
+ }
+ e = widget;
+
+ if ( nameOfClass.isEmpty() )
+ nameOfClass = getObjectName( e );
+ namespaces = TQStringList::split( "::", nameOfClass );
+ bareNameOfClass = namespaces.last();
+ namespaces.remove( namespaces.fromLast() );
+
+ if ( subcl ) {
+ if ( decl )
+ createSubDecl( e, subClass );
+ else
+ createSubImpl( e, subClass );
+ } else {
+ if ( decl )
+ createFormDecl( e );
+ else
+ createFormImpl( e );
+ }
+
+}
+
+/*! Extracts a pixmap loader function from \a e
+ */
+TQString Uic::getPixmapLoaderFunction( const TQDomElement& e )
+{
+ TQDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "pixmapfunction" )
+ return n.firstChild().toText().data();
+ }
+ return TQString();
+}
+
+
+/*! Extracts the forms class name from \a e
+ */
+TQString Uic::getFormClassName( const TQDomElement& e )
+{
+ TQDomElement n;
+ TQString cn;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "class" ) {
+ TQString s = n.firstChild().toText().data();
+ int i;
+ while ( ( i = s.tqfind(' ' )) != -1 )
+ s[i] = '_';
+ cn = s;
+ }
+ }
+ return cn;
+}
+
+/*! Extracts a class name from \a e.
+ */
+TQString Uic::getClassName( const TQDomElement& e )
+{
+ TQString s = e.attribute( "class" );
+ if ( s.isEmpty() && e.tagName() == "toolbar" )
+ s = "TQToolBar";
+ else if ( s.isEmpty() && e.tagName() == "menubar" )
+ s = "TQMenuBar";
+ return s;
+}
+
+/*! Returns TRUE if database framework code is generated, else FALSE.
+*/
+
+bool Uic::isFrameworkCodeGenerated( const TQDomElement& e )
+{
+ TQDomElement n = getObjectProperty( e, "frameworkCode" );
+ if ( n.attribute("name") == "frameworkCode" &&
+ !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( TRUE, 0 ) ).toBool() )
+ return FALSE;
+ return TRUE;
+}
+
+/*! Extracts an object name from \a e. It's stored in the 'name'
+ property.
+ */
+TQString Uic::getObjectName( const TQDomElement& e )
+{
+ TQDomElement n = getObjectProperty( e, "name" );
+ if ( n.firstChild().toElement().tagName() == "cstring" )
+ return n.firstChild().toElement().firstChild().toText().data();
+ return TQString();
+}
+
+/*! Extracts an tqlayout name from \a e. It's stored in the 'name'
+ property of the preceeding sibling (the first child of a TQLayoutWidget).
+ */
+TQString Uic::getLayoutName( const TQDomElement& e )
+{
+ TQDomElement p = e.parentNode().toElement();
+ TQString name;
+
+ if ( getClassName(p) != "TQLayoutWidget" )
+ name = "Layout";
+
+ TQDomElement n = getObjectProperty( p, "name" );
+ if ( n.firstChild().toElement().tagName() == "cstring" ) {
+ name.prepend( n.firstChild().toElement().firstChild().toText().data() );
+ return TQStringList::split( "::", name ).last();
+ }
+ return e.tagName();
+}
+
+
+TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag )
+{
+ TQDomElement n;
+ TQDomElement n1;
+ int child = 0;
+ // database info is a stringlist stored in this order
+ if ( tag == "connection" )
+ child = 0;
+ else if ( tag == "table" )
+ child = 1;
+ else if ( tag == "field" )
+ child = 2;
+ else
+ return TQString();
+ n = getObjectProperty( e, "database" );
+ if ( n.firstChild().toElement().tagName() == "stringlist" ) {
+ // tqfind correct stringlist entry
+ TQDomElement n1 = n.firstChild().firstChild().toElement();
+ for ( int i = 0; i < child && !n1.isNull(); ++i )
+ n1 = n1.nextSibling().toElement();
+ if ( n1.isNull() )
+ return TQString();
+ return n1.firstChild().toText().data();
+ }
+ return TQString();
+}
+
+
+void Uic::registerLayouts( const TQDomElement &e )
+{
+ if ( layouts.tqcontains(e.tagName())) {
+ createObjectDecl(e);
+ TQString t = e.tagName();
+ if ( t == "vbox" || t == "hbox" || t == "grid" )
+ createSpacerDecl( e );
+ }
+
+ TQDomNodeList nl = e.childNodes();
+ for ( int i = 0; i < (int) nl.length(); ++i )
+ registerLayouts( nl.item(i).toElement() );
+}
+
+
+/*!
+ Returns include file for class \a className or a null string.
+ */
+TQString Uic::getInclude( const TQString& className )
+{
+ int wid = WidgetDatabase::idFromClassName( className );
+ if ( wid != -1 )
+ return WidgetDatabase::includeFile( wid );
+ return TQString();
+}
+
+
+void Uic::createActionDecl( const TQDomElement& e )
+{
+ TQString objClass = e.tagName() == "action" ? "TQAction" : "TQActionGroup";
+ TQString objName = getObjectName( e );
+ if ( objName.isEmpty() )
+ return;
+ out << " " << objClass << "* " << objName << ";" << endl;
+ if ( e.tagName() == "actiongroup" ) {
+ for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "action" || n.tagName() == "actiongroup" )
+ createActionDecl( n );
+ }
+ }
+}
+
+void Uic::createToolbarDecl( const TQDomElement &e )
+{
+ if ( e.tagName() == "toolbar" )
+ out << " " << "TQToolBar *" << getObjectName( e ) << ";" << endl;
+}
+
+void Uic::createMenuBarDecl( const TQDomElement &e )
+{
+ if ( e.tagName() == "item" ) {
+ out << " " << "TQPopupMenu *" << e.attribute( "name" ) << ";" << endl;
+ createPopupMenuDecl( e );
+ }
+}
+
+void Uic::createPopupMenuDecl( const TQDomElement &e )
+{
+ for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) {
+ TQDomElement n2 = n.nextSibling().toElement();
+ if ( n2.tagName() == "item" ) { // the action has a sub menu
+ out << " " << "TQPopupMenu *" << n2.attribute( "name" ) << ";" << endl;
+ createPopupMenuDecl( n2 );
+ n = n2;
+ }
+ }
+ }
+}
+
+void Uic::createActionImpl( const TQDomElement &n, const TQString &tqparent )
+{
+ for ( TQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) {
+ TQString objName = registerObject( getObjectName( ae ) );
+ if ( ae.tagName() == "action" )
+ out << indent << objName << " = new TQAction( " << tqparent << ", \"" << objName << "\" );" << endl;
+ else if ( ae.tagName() == "actiongroup" )
+ out << indent << objName << " = new TQActionGroup( " << tqparent << ", \"" << objName << "\" );" << endl;
+ else
+ continue;
+ bool subActionsDone = FALSE;
+ bool hasMenuText = FALSE;
+ TQString actionText;
+ for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ if ( n2.tagName() == "property" ) {
+ bool stdset = stdsetdef;
+ if ( n2.hasAttribute( "stdset" ) )
+ stdset = toBool( n2.attribute( "stdset" ) );
+ TQString prop = n2.attribute("name");
+ if ( prop == "name" )
+ continue;
+ TQString value = setObjectProperty( "TQAction", objName, prop, n2.firstChild().toElement(), stdset );
+ if ( value.isEmpty() )
+ continue;
+
+ TQString call = objName + "->";
+ if ( stdset ) {
+ call += mkStdSet( prop ) + "( ";
+ } else {
+ call += "setProperty( \"" + prop + "\", ";
+ }
+ call += value + " );";
+
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ else if (prop == "text")
+ actionText = value;
+
+ if ( n2.firstChild().toElement().tagName() == "string" ) {
+ trout << indent << call << endl;
+ } else {
+ out << indent << call << endl;
+ }
+ } else if ( !subActionsDone && ( n2.tagName() == "actiongroup" || n2.tagName() == "action" ) ) {
+ createActionImpl( n2, objName );
+ subActionsDone = TRUE;
+ }
+ }
+ // workaround for loading pre-3.3 files expecting bogus TQAction behavior
+ if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3")
+ trout << indent << objName << "->setMenuText(" << actionText << ");" << endl;
+ }
+}
+
+TQString get_dock( const TQString &d )
+{
+ if ( d == "0" )
+ return "TQt::DockUnmanaged";
+ if ( d == "1" )
+ return "TQt::DockTornOff";
+ if ( d == "2" )
+ return "TQt::DockTop";
+ if ( d == "3" )
+ return "TQt::DockBottom";
+ if ( d == "4" )
+ return "TQt::DockRight";
+ if ( d == "5" )
+ return "TQt::DockLeft";
+ if ( d == "6" )
+ return "TQt::DockMinimized";
+ return "";
+}
+
+void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &tqparent )
+{
+ TQDomNodeList nl = n.elementsByTagName( "toolbar" );
+ for ( int i = 0; i < (int) nl.length(); i++ ) {
+ TQDomElement ae = nl.item( i ).toElement();
+ TQString dock = get_dock( ae.attribute( "dock" ) );
+ TQString objName = getObjectName( ae );
+ out << indent << objName << " = new TQToolBar( TQString(\"\"), this, " << dock << " ); " << endl;
+ createObjectImpl( ae, parentClass, tqparent );
+ for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ if ( n2.tagName() == "action" ) {
+ out << indent << n2.attribute( "name" ) << "->addTo( " << objName << " );" << endl;
+ } else if ( n2.tagName() == "separator" ) {
+ out << indent << objName << "->addSeparator();" << endl;
+ } else if ( n2.tagName() == "widget" ) {
+ if ( n2.attribute( "class" ) != "Spacer" ) {
+ createObjectImpl( n2, "TQToolBar", objName );
+ } else {
+ TQString child = createSpacerImpl( n2, parentClass, tqparent, objName );
+ out << indent << "TQApplication::sendPostedEvents( " << objName
+ << ", TQEvent::ChildInserted );" << endl;
+ out << indent << objName << "->boxLayout()->addItem( " << child << " );" << endl;
+ }
+ }
+ }
+ }
+}
+
+void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &tqparent )
+{
+ TQString objName = getObjectName( n );
+ out << indent << objName << " = new TQMenuBar( this, \"" << objName << "\" );" << endl;
+ createObjectImpl( n, parentClass, tqparent );
+ int i = 0;
+ TQDomElement c = n.firstChild().toElement();
+ while ( !c.isNull() ) {
+ if ( c.tagName() == "item" ) {
+ TQString itemName = c.attribute( "name" );
+ out << endl;
+ out << indent << itemName << " = new TQPopupMenu( this );" << endl;
+ createPopupMenuImpl( c, parentClass, itemName );
+ out << indent << objName << "->insertItem( TQString(\"\"), " << itemName << ", " << i << " );" << endl;
+ TQString tqfindItem(objName + "->tqfindItem(%1)");
+ tqfindItem = tqfindItem.arg(i);
+ trout << indent << "if (" << tqfindItem << ")" << endl;
+ trout << indent << indent << tqfindItem << "->setText( " << trcall( c.attribute( "text" ) ) << " );" << endl;
+ } else if ( c.tagName() == "separator" ) {
+ out << endl;
+ out << indent << objName << "->insertSeparator( " << i << " );" << endl;
+ }
+ c = c.nextSibling().toElement();
+ i++;
+ }
+}
+
+void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &tqparent )
+{
+ int i = 0;
+ for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) {
+ TQDomElement n2 = n.nextSibling().toElement();
+ if ( n2.tagName() == "item" ) { // the action has a sub menu
+ TQString itemName = n2.attribute( "name" );
+ TQString itemText = n2.attribute( "text" );
+ out << indent << itemName << " = new TQPopupMenu( this );" << endl;
+ out << indent << tqparent << "->insertItem( " << n.attribute( "name" ) << "->iconSet(), ";
+ out << trcall( itemText ) << ", " << itemName << " );" << endl;
+ trout << indent << tqparent << "->changeItem( " << tqparent << "->idAt( " << i << " ), ";
+ trout << trcall( itemText ) << " );" << endl;
+ createPopupMenuImpl( n2, parentClass, itemName );
+ n = n2;
+ } else {
+ out << indent << n.attribute( "name" ) << "->addTo( " << tqparent << " );" << endl;
+ }
+ } else if ( n.tagName() == "separator" ) {
+ out << indent << tqparent << "->insertSeparator();" << endl;
+ }
+ ++i;
+ }
+}
+
+/*!
+ Creates implementation of an listbox item tag.
+*/
+
+TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &tqparent,
+ TQString *value )
+{
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" ) {
+ txt = v.toString();
+ com = getComment( n );
+ } else if ( attrib == "pixmap" ) {
+ pix = v.toString();
+ if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
+ pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( value )
+ *value = trcall( txt, com );
+
+ if ( pix.isEmpty() ) {
+ return tqparent + "->insertItem( " + trcall( txt, com ) + " );";
+ } else {
+ return tqparent + "->insertItem( " + pix + ", " + trcall( txt, com ) + " );";
+ }
+}
+
+/*!
+ Creates implementation of an iconview item tag.
+*/
+
+TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &tqparent )
+{
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" ) {
+ txt = v.toString();
+ com = getComment( n );
+ } else if ( attrib == "pixmap" ) {
+ pix = v.toString();
+ if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
+ pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( pix.isEmpty() )
+ return "(void) new TQIconViewItem( " + tqparent + ", " + trcall( txt, com ) + " );";
+ else
+ return "(void) new TQIconViewItem( " + tqparent + ", " + trcall( txt, com ) + ", " + pix + " );";
+}
+
+/*!
+ Creates implementation of an listview item tag.
+*/
+
+TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &tqparent,
+ const TQString &parentItem )
+{
+ TQString s;
+
+ TQDomElement n = e.firstChild().toElement();
+
+ bool hasChildren = e.elementsByTagName( "item" ).count() > 0;
+ TQString item;
+
+ if ( hasChildren ) {
+ item = registerObject( "item" );
+ s = indent + "TQListViewItem * " + item + " = ";
+ } else {
+ item = "item";
+ if ( item_used )
+ s = indent + item + " = ";
+ else
+ s = indent + "TQListViewItem * " + item + " = ";
+ item_used = TRUE;
+ }
+
+ if ( !parentItem.isEmpty() )
+ s += "new TQListViewItem( " + parentItem + ", " + lastItem + " );\n";
+ else
+ s += "new TQListViewItem( " + tqparent + ", " + lastItem + " );\n";
+
+ TQStringList texts;
+ TQStringList pixmaps;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute("name");
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ texts << v.toString();
+ else if ( attrib == "pixmap" ) {
+ TQString pix = v.toString();
+ if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
+ pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ pixmaps << pix;
+ }
+ } else if ( n.tagName() == "item" ) {
+ s += indent + item + "->setOpen( TRUE );\n";
+ s += createListViewItemImpl( n, tqparent, item );
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ for ( int i = 0; i < (int)texts.count(); ++i ) {
+ if ( !texts[ i ].isEmpty() )
+ s += indent + item + "->setText( " + TQString::number( i ) + ", " + trcall( texts[ i ] ) + " );\n";
+ if ( !pixmaps[ i ].isEmpty() )
+ s += indent + item + "->setPixmap( " + TQString::number( i ) + ", " + pixmaps[ i ] + " );\n";
+ }
+
+ lastItem = item;
+ return s;
+}
+
+/*!
+ Creates implementation of an listview column tag.
+*/
+
+TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &tqparent,
+ TQString *value )
+{
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
+ bool clickable = FALSE, resizable = FALSE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute("name");
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" ) {
+ txt = v.toString();
+ com = getComment( n );
+ } else if ( attrib == "pixmap" ) {
+ pix = v.toString();
+ if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
+ pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ } else if ( attrib == "clickable" )
+ clickable = v.toBool();
+ else if ( attrib == "resizable" || attrib == "resizeable" )
+ resizable = v.toBool();
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( value )
+ *value = trcall( txt, com );
+
+ TQString s;
+ s = indent + tqparent + "->addColumn( " + trcall( txt, com ) + " );\n";
+ if ( !pix.isEmpty() )
+ s += indent + tqparent + "->header()->setLabel( " + tqparent + "->header()->count() - 1, " + pix + ", " + trcall( txt, com ) + " );\n";
+ if ( !clickable )
+ s += indent + tqparent + "->header()->setClickEnabled( FALSE, " + tqparent + "->header()->count() - 1 );\n";
+ if ( !resizable )
+ s += indent + tqparent + "->header()->setResizeEnabled( FALSE, " + tqparent + "->header()->count() - 1 );\n";
+ return s;
+}
+
+TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &tqparent,
+ TQString *value )
+{
+ TQString objClass = getClassName( e.parentNode().toElement() );
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString com;
+ TQString pix;
+ TQString field;
+ bool isRow = e.tagName() == "row";
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute("name");
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" ) {
+ txt = v.toString();
+ com = getComment( n );
+ } else if ( attrib == "pixmap" ) {
+ pix = v.toString();
+ if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
+ pix.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ } else if ( attrib == "field" )
+ field = v.toString();
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( value )
+ *value = trcall( txt, com );
+
+ // ### This generated code sucks! We have to set the number of
+ // rows/cols before and then only do setLabel/()
+ // ### careful, though, since TQDataTable has an API which makes this code pretty good
+
+ TQString s;
+ if ( isRow ) {
+ s = indent + tqparent + "->setNumRows( " + tqparent + "->numRows() + 1 );\n";
+ if ( pix.isEmpty() )
+ s += indent + tqparent + "->verticalHeader()->setLabel( " + tqparent + "->numRows() - 1, "
+ + trcall( txt, com ) + " );\n";
+ else
+ s += indent + tqparent + "->verticalHeader()->setLabel( " + tqparent + "->numRows() - 1, "
+ + pix + ", " + trcall( txt, com ) + " );\n";
+ } else {
+ if ( objClass == "TQTable" ) {
+ s = indent + tqparent + "->setNumCols( " + tqparent + "->numCols() + 1 );\n";
+ if ( pix.isEmpty() )
+ s += indent + tqparent + "->horizontalHeader()->setLabel( " + tqparent + "->numCols() - 1, "
+ + trcall( txt, com ) + " );\n";
+ else
+ s += indent + tqparent + "->horizontalHeader()->setLabel( " + tqparent + "->numCols() - 1, "
+ + pix + ", " + trcall( txt, com ) + " );\n";
+ } else if ( objClass == "TQDataTable" ) {
+ if ( !txt.isEmpty() && !field.isEmpty() ) {
+ if ( pix.isEmpty() )
+ out << indent << tqparent << "->addColumn( " << fixString( field ) << ", " << trcall( txt, com ) << " );" << endl;
+ else
+ out << indent << tqparent << "->addColumn( " << fixString( field ) << ", " << trcall( txt, com ) << ", " << pix << " );" << endl;
+ }
+ }
+ }
+ return s;
+}
+
+/*!
+ Creates the implementation of a tqlayout tag. Called from createObjectImpl().
+ */
+TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& tqparent, const TQString& tqlayout )
+{
+ TQDomElement n;
+ TQString objClass, objName;
+ objClass = e.tagName();
+
+ TQString qtqlayout = "TQVBoxLayout";
+ if ( objClass == "hbox" )
+ qtqlayout = "TQHBoxLayout";
+ else if ( objClass == "grid" )
+ qtqlayout = "TQGridLayout";
+
+ bool isGrid = e.tagName() == "grid" ;
+ objName = registerObject( getLayoutName( e ) );
+ layoutObjects += objName;
+
+ TQString margin = DomTool::readProperty( e, "margin", defMargin ).toString();
+ TQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString();
+ TQString resizeMode = DomTool::readProperty( e, "resizeMode", TQString() ).toString();
+
+ TQString optcells;
+ if ( isGrid )
+ optcells = "1, 1, ";
+ if ( (parentClass == "TQGroupBox" || parentClass == "TQButtonGroup") && tqlayout.isEmpty() ) {
+ // special case for group box
+ out << indent << tqparent << "->setColumnLayout(0, Qt::Vertical );" << endl;
+ out << indent << tqparent << "->tqlayout()->setSpacing( " << spacing << " );" << endl;
+ out << indent << tqparent << "->tqlayout()->setMargin( " << margin << " );" << endl;
+ out << indent << objName << " = new " << qtqlayout << "( " << tqparent << "->tqlayout() );" << endl;
+ out << indent << objName << "->tqsetAlignment( TQt::AlignTop );" << endl;
+ } else {
+ out << indent << objName << " = new " << qtqlayout << "( ";
+ if ( tqlayout.isEmpty() )
+ out << tqparent;
+ else {
+ out << "0";
+ if ( !DomTool::hasProperty( e, "margin" ) )
+ margin = "0";
+ }
+ out << ", " << optcells << margin << ", " << spacing << ", \"" << objName << "\"); " << endl;
+ }
+ if ( !resizeMode.isEmpty() )
+ out << indent << objName << "->setResizeMode( TQLayout::" << resizeMode << " );" << endl;
+
+ if ( !isGrid ) {
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "spacer" ) {
+ TQString child = createSpacerImpl( n, parentClass, tqparent, objName );
+ out << indent << objName << "->addItem( static_cast<TQLayoutItem*>(static_cast<QLayoutItem*>( " << child << " )) );" << endl;
+ } else if ( tags.tqcontains( n.tagName() ) ) {
+ TQString child = createObjectImpl( n, parentClass, tqparent, objName );
+ if ( isLayout( child ) )
+ out << indent << objName << "->addLayout( static_cast<TQLayout*>(static_cast<QLayout*>( " << child << " )) );" << endl;
+ else
+ out << indent << objName << "->addWidget( " << child << " );" << endl;
+ }
+ }
+ } else {
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ TQDomElement ae = n;
+ int row = ae.attribute( "row" ).toInt();
+ int col = ae.attribute( "column" ).toInt();
+ int rowspan = ae.attribute( "rowspan" ).toInt();
+ int colspan = ae.attribute( "colspan" ).toInt();
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+ if ( n.tagName() == "spacer" ) {
+ TQString child = createSpacerImpl( n, parentClass, tqparent, objName );
+ if ( rowspan * colspan != 1 )
+ out << indent << objName << "->addMultiCell( " << child << ", "
+ << row << ", " << ( row + rowspan - 1 ) << ", " << col << ", " << ( col + colspan - 1 ) << " );" << endl;
+ else
+ out << indent << objName << "->addItem( " << child << ", "
+ << row << ", " << col << " );" << endl;
+ } else if ( tags.tqcontains( n.tagName() ) ) {
+ TQString child = createObjectImpl( n, parentClass, tqparent, objName );
+ out << endl;
+ TQString o = "Widget";
+ if ( isLayout( child ) )
+ o = "Layout";
+ if ( rowspan * colspan != 1 )
+ out << indent << objName << "->addMultiCell" << o << "( " << child << ", "
+ << row << ", " << ( row + rowspan - 1 ) << ", " << col << ", " << ( col + colspan - 1 ) << " );" << endl;
+ else
+ out << indent << objName << "->add" << o << "( " << child << ", "
+ << row << ", " << col << " );" << endl;
+ }
+ }
+ }
+
+ return objName;
+}
+
+
+
+TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*tqparent*/, const TQString& /*tqlayout*/)
+{
+ TQDomElement n;
+ TQString objClass, objName;
+ objClass = e.tagName();
+ objName = registerObject( getObjectName( e ) );
+
+ TQSize size = DomTool::readProperty( e, "tqsizeHint", TQSize( 0, 0 ) ).toSize();
+ TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString();
+ bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical";
+
+ if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" &&
+ DomTool::hasProperty( e, "geometry" ) ) { // compatibility TQt 2.2
+ TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect();
+ size = geom.size();
+ }
+
+ if ( isVspacer )
+ out << " " << objName << " = new TQSpacerItem( "
+ << size.width() << ", " << size.height()
+ << ", TQSizePolicy::Minimum, TQSizePolicy::" << sizeType << " );" << endl;
+ else
+ out << " " << objName << " = new TQSpacerItem( "
+ << size.width() << ", " << size.height()
+ << ", TQSizePolicy::" << sizeType << ", TQSizePolicy::Minimum );" << endl;
+
+ return objName;
+}
+
+static const char* const ColorRole[] = {
+ "Foreground", "Button", "Light", "Midlight", "Dark", "Mid",
+ "Text", "BrightText", "ButtonText", "Base", "Background", "Shadow",
+ "Highlight", "HighlightedText", "Link", "LinkVisited", 0
+};
+
+
+/*!
+ Creates a colorgroup with name \a name from the color group \a cg
+ */
+void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e )
+{
+ TQColorGroup cg;
+ int r = -1;
+ TQDomElement n = e.firstChild().toElement();
+ TQString color;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "color" ) {
+ r++;
+ TQColor col = DomTool::readColor( n );
+ color = "TQColor( %1, %2, %3)";
+ color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() );
+ if ( col == white )
+ color = "white";
+ else if ( col == black )
+ color = "black";
+ if ( n.nextSibling().toElement().tagName() != "pixmap" ) {
+ out << indent << name << ".setColor( TQColorGroup::" << ColorRole[r] << ", " << color << " );" << endl;
+ }
+ } else if ( n.tagName() == "pixmap" ) {
+ TQString pixmap = n.firstChild().toText().data();
+ if ( !pixmapLoaderFunction.isEmpty() ) {
+ pixmap.prepend( pixmapLoaderFunction + "( " + TQString( externPixmaps ? "\"" : "" ) );
+ pixmap.append( TQString( externPixmaps ? "\"" : "" ) + " )" );
+ }
+ out << indent << name << ".setBrush( TQColorGroup::"
+ << ColorRole[r] << ", TQBrush( " << color << ", " << pixmap << " ) );" << endl;
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+/*!
+ Auxiliary function to load a color group. The colorgroup must not
+ contain pixmaps.
+ */
+TQColorGroup Uic::loadColorGroup( const TQDomElement &e )
+{
+ TQColorGroup cg;
+ int r = -1;
+ TQDomElement n = e.firstChild().toElement();
+ TQColor col;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "color" ) {
+ r++;
+ cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ }
+ n = n.nextSibling().toElement();
+ }
+ return cg;
+}
+
+/*! Returns TRUE if the widget properties specify that it belongs to
+ the database \a connection and \a table.
+*/
+
+bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table )
+{
+ TQString conn = getDatabaseInfo( e, "connection" );
+ TQString tab = getDatabaseInfo( e, "table" );
+ if ( conn == connection && tab == table )
+ return TRUE;
+ return FALSE;
+}
+
+/*!
+ Registers all database connections, cursors and forms.
+*/
+
+void Uic::registerDatabases( const TQDomElement& e )
+{
+ TQDomElement n;
+ TQDomNodeList nl;
+ int i;
+ nl = e.parentNode().toElement().elementsByTagName( "widget" );
+ for ( i = 0; i < (int) nl.length(); ++i ) {
+ n = nl.item(i).toElement();
+ TQString conn = getDatabaseInfo( n, "connection" );
+ TQString tab = getDatabaseInfo( n, "table" );
+ TQString fld = getDatabaseInfo( n, "field" );
+ if ( !conn.isNull() ) {
+ dbConnections += conn;
+ if ( !tab.isNull() ) {
+ dbCursors[conn] += tab;
+ if ( !fld.isNull() )
+ dbForms[conn] += tab;
+ }
+ }
+ }
+}
+
+/*!
+ Registers an object with name \a name.
+
+ The returned name is a valid variable identifier, as similar to \a
+ name as possible and guaranteed to be unique within the form.
+
+ \sa registeredName(), isObjectRegistered()
+ */
+TQString Uic::registerObject( const TQString& name )
+{
+ if ( objectNames.isEmpty() ) {
+ // some temporary variables we need
+ objectNames += "img";
+ objectNames += "item";
+ objectNames += "cg";
+ objectNames += "pal";
+ }
+
+ TQString result = name;
+ int i;
+ while ( ( i = result.tqfind(' ' )) != -1 ) {
+ result[i] = '_';
+ }
+
+ if ( objectNames.tqcontains( result ) ) {
+ int i = 2;
+ while ( objectNames.tqcontains( result + "_" + TQString::number(i) ) )
+ i++;
+ result += "_";
+ result += TQString::number(i);
+ }
+ objectNames += result;
+ objectMapper.insert( name, result );
+ return result;
+}
+
+/*!
+ Returns the registered name for the original name \a name
+ or \a name if \a name wasn't registered.
+
+ \sa registerObject(), isObjectRegistered()
+ */
+TQString Uic::registeredName( const TQString& name )
+{
+ if ( !objectMapper.tqcontains( name ) )
+ return name;
+ return objectMapper[name];
+}
+
+/*!
+ Returns whether the object \a name was registered yet or not.
+ */
+bool Uic::isObjectRegistered( const TQString& name )
+{
+ return objectMapper.tqcontains( name );
+}
+
+
+/*!
+ Unifies the entries in stringlist \a list. Should really be a TQStringList feature.
+ */
+TQStringList Uic::unique( const TQStringList& list )
+{
+ if ( list.isEmpty() )
+ return list;
+
+ TQStringList result;
+ for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
+ if ( !result.tqcontains(*it) )
+ result += *it;
+ }
+ return result;
+}
+
+
+
+/*!
+ Creates an instance of class \a objClass, with tqparent \a tqparent and name \a objName
+ */
+TQString Uic::createObjectInstance( const TQString& objClass, const TQString& tqparent, const TQString& objName )
+{
+
+ if ( objClass.mid( 2 ) == "ComboBox" ) {
+ return objClass + "( FALSE, " + tqparent + ", \"" + objName + "\" )";
+ }
+ return objClass + "( " + tqparent + ", \"" + objName + "\" )";
+}
+
+bool Uic::isLayout( const TQString& name ) const
+{
+ return layoutObjects.tqcontains( name );
+}
+
+
+
diff --git a/tqtinterface/qt4/tools/designer/uic/uic.h b/tqtinterface/qt4/tools/designer/uic/uic.h
new file mode 100644
index 0000000..00af1d8
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/uic.h
@@ -0,0 +1,176 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef UIC_H
+#define UIC_H
+#include <tqdom.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
+#include <tqtextstream.h>
+#include <tqpalette.h>
+#include <tqvariant.h>
+
+class Uic : public TQt
+{
+public:
+ Uic( const TQString &fn, const char *outputFn, TQTextStream& out,
+ TQDomDocument doc, bool decl, bool subcl, const TQString &trm,
+ const TQString& subclname, bool omitForwardDecls );
+
+ void createFormDecl( const TQDomElement &e );
+ void createFormImpl( const TQDomElement &e );
+
+ void createSubDecl( const TQDomElement &e, const TQString& subclname );
+ void createSubImpl( const TQDomElement &e, const TQString& subclname );
+
+ void createObjectDecl( const TQDomElement &e );
+ void createSpacerDecl( const TQDomElement &e );
+ void createActionDecl( const TQDomElement &e );
+ void createToolbarDecl( const TQDomElement &e );
+ void createMenuBarDecl( const TQDomElement &e );
+ void createPopupMenuDecl( const TQDomElement &e );
+ void createActionImpl( const TQDomElement &e, const TQString &tqparent );
+ void createToolbarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &tqparent );
+ void createMenuBarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &tqparent );
+ void createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &tqparent );
+ TQString createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& tqparent, const TQString& tqlayout = TQString() );
+ TQString createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& tqparent, const TQString& tqlayout = TQString() );
+ TQString createObjectInstance( const TQString& objClass, const TQString& tqparent, const TQString& objName );
+ TQString createSpacerImpl( const TQDomElement &e, const TQString& parentClass, const TQString& tqparent, const TQString& tqlayout = TQString() );
+ void createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp );
+ TQString createListBoxItemImpl( const TQDomElement &e, const TQString &tqparent, TQString *value = 0 );
+ TQString createIconViewItemImpl( const TQDomElement &e, const TQString &tqparent );
+ TQString createListViewColumnImpl( const TQDomElement &e, const TQString &tqparent, TQString *value = 0 );
+ TQString createTableRowColumnImpl( const TQDomElement &e, const TQString &tqparent, TQString *value = 0 );
+ TQString createListViewItemImpl( const TQDomElement &e, const TQString &tqparent,
+ const TQString &parentItem );
+ void createColorGroupImpl( const TQString& cg, const TQDomElement& e );
+ TQColorGroup loadColorGroup( const TQDomElement &e );
+
+ TQDomElement getObjectProperty( const TQDomElement& e, const TQString& name );
+ TQString getPixmapLoaderFunction( const TQDomElement& e );
+ TQString getFormClassName( const TQDomElement& e );
+ TQString getClassName( const TQDomElement& e );
+ TQString getObjectName( const TQDomElement& e );
+ TQString getLayoutName( const TQDomElement& e );
+ TQString getInclude( const TQString& className );
+
+ TQString setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset );
+
+ TQString registerObject( const TQString& name );
+ TQString registeredName( const TQString& name );
+ bool isObjectRegistered( const TQString& name );
+ TQStringList unique( const TQStringList& );
+
+ TQString trcall( const TQString& sourceText, const TQString& comment = "" );
+
+ static void embed( TQTextStream& out, const char* project, const TQStringList& images );
+
+private:
+ void registerLayouts ( const TQDomElement& e );
+
+ TQTextStream& out;
+ TQTextOStream trout;
+ TQString languageChangeBody;
+ TQCString outputFileName;
+ TQStringList objectNames;
+ TQMap<TQString,TQString> objectMapper;
+ TQString indent;
+ TQStringList tags;
+ TQStringList layouts;
+ TQString formName;
+ TQString lastItem;
+ TQString trmacro;
+ bool nofwd;
+
+ struct Buddy
+ {
+ Buddy( const TQString& k, const TQString& b )
+ : key( k ), buddy( b ) {}
+ Buddy(){} // for valuelist
+ TQString key;
+ TQString buddy;
+ bool operator==( const Buddy& other ) const
+ { return (key == other.key); }
+ };
+ struct CustomInclude
+ {
+ TQString header;
+ TQString location;
+ TQ_DUMMY_COMPARISON_OPERATOR(CustomInclude)
+ };
+ TQValueList<Buddy> buddies;
+
+ TQStringList layoutObjects;
+ bool isLayout( const TQString& name ) const;
+
+ uint item_used : 1;
+ uint cg_used : 1;
+ uint pal_used : 1;
+ uint stdsetdef : 1;
+ uint externPixmaps : 1;
+
+ TQString uiFileVersion;
+ TQString nameOfClass;
+ TQStringList namespaces;
+ TQString bareNameOfClass;
+ TQString pixmapLoaderFunction;
+
+ void registerDatabases( const TQDomElement& e );
+ bool isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table );
+ bool isFrameworkCodeGenerated( const TQDomElement& e );
+ TQString getDatabaseInfo( const TQDomElement& e, const TQString& tag );
+ void createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table );
+ void writeFunctionsDecl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst );
+ void writeFunctionsSubDecl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst );
+ void writeFunctionsSubImpl( const TQStringList &fuLst, const TQStringList &typLst, const TQStringList &specLst,
+ const TQString &subClass, const TQString &descr );
+ TQStringList dbConnections;
+ TQMap< TQString, TQStringList > dbCursors;
+ TQMap< TQString, TQStringList > dbForms;
+
+ static bool isMainWindow;
+ static TQString mkBool( bool b );
+ static TQString mkBool( const TQString& s );
+ bool toBool( const TQString& s );
+ static TQString fixString( const TQString &str, bool encode = FALSE );
+ static bool onlyAscii;
+ static TQString mkStdSet( const TQString& prop );
+ static TQString getComment( const TQDomNode& n );
+ TQVariant defSpacing, defMargin;
+ TQString fileName;
+ bool writeFunctImpl;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/uic/uic.pro b/tqtinterface/qt4/tools/designer/uic/uic.pro
new file mode 100644
index 0000000..c77607d
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uic/uic.pro
@@ -0,0 +1,42 @@
+TEMPLATE = app
+CONFIG += qt console warn_on release professional
+HEADERS = uic.h \
+ ../shared/widgetdatabase.h \
+ ../shared/domtool.h \
+ ../shared/parser.h \
+ ../interfaces/widgetinterface.h
+
+#HEADERS += ../shared/ui2uib.h \
+# ../shared/uib.h
+
+SOURCES = main.cpp uic.cpp form.cpp object.cpp \
+ subclassing.cpp embed.cpp\
+ ../shared/widgetdatabase.cpp \
+ ../shared/domtool.cpp \
+ ../shared/parser.cpp
+
+#SOURCES += ../shared/ui2uib.cpp \
+# ../shared/uib.cpp
+
+DEFINES += QT_INTERNAL_XML
+include( ../../../src/qt_professional.pri )
+
+TARGET = uic-tqt
+INCLUDEPATH += ../shared
+DEFINES += UIC
+DESTDIR = ../../../bin
+
+target.path=$$bins.path
+INSTALLS += target
+
+*-mwerks {
+ TEMPLATE = lib
+ TARGET = McUic
+ CONFIG -= static
+ CONFIG += shared plugin
+ DEFINES += UIC_MWERKS_PLUGIN
+ MWERKSDIR = $(QT_SOURCE_TREE)/util/mwerks_plugin
+ INCLUDEPATH += $$MWERKSDIR/Headers
+ LIBS += $$MWERKSDIR/Libraries/PluginLib4.shlb
+ SOURCES += mwerks_mac.cpp
+}
diff --git a/tqtinterface/qt4/tools/designer/uilib/test/main.cpp b/tqtinterface/qt4/tools/designer/uilib/test/main.cpp
new file mode 100644
index 0000000..dfdef0e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uilib/test/main.cpp
@@ -0,0 +1,50 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt GUI Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqapplication.h>
+#include "../tqwidgetfactory.h"
+
+int main( int argc, char ** argv )
+{
+ TQApplication a( argc, argv );
+ if ( argc == 1 )
+ return 0;
+ if ( argc == 3 )
+ TQWidgetFactory::loadImages( argv[ 2 ] );
+ TQWidget *w = TQWidgetFactory::create( argv[ 1 ] );
+ if ( !w )
+ return 0;
+ w->show();
+ a.connect( &a, TQT_SIGNAL(lastWindowClosed()), &a, TQT_SLOT(quit()) );
+ return a.exec();
+}
diff --git a/tqtinterface/qt4/tools/designer/uilib/test/test.pro b/tqtinterface/qt4/tools/designer/uilib/test/test.pro
new file mode 100644
index 0000000..b2459c0
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uilib/test/test.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+HEADERS =
+SOURCES = main.cpp
+TARGET = test
+LIBS += -L$$QT_BUILD_TREE/lib -lqui
+
diff --git a/tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.cpp b/tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.cpp
new file mode 100644
index 0000000..57ea838
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.cpp
@@ -0,0 +1,2623 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqwidgetfactory.h"
+
+#include "../interfaces/languageinterface.h"
+#include "../interfaces/widgetinterface.h"
+
+#include <tqfeatures.h>
+#include "../designer/database2.h"
+#include <tqdom.h>
+#include <tqdir.h>
+#include <tqlayout.h>
+#include <tqmetaobject.h>
+#include <domtool.h>
+#include <uib.h>
+#include <tqapplication.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
+#include <tqobjectlist.h>
+#include <private/tqpluginmanager_p.h>
+#include <tqmime.h>
+#include <tqdragobject.h>
+
+#ifndef TQT_NO_SQL
+#include <tqsqlrecord.h>
+#include <tqsqldatabase.h>
+#include <tqdatatable.h>
+#endif
+
+// include all TQt widgets we support
+#include <tqpushbutton.h>
+#include <tqtoolbutton.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqgroupbox.h>
+#include <tqbuttongroup.h>
+#include <tqiconview.h>
+#include <tqheader.h>
+#ifndef TQT_NO_TABLE
+#include <tqtable.h>
+#endif
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqlineedit.h>
+#include <tqspinbox.h>
+#include <tqmultilineedit.h>
+#include <tqlabel.h>
+#include <tqwidget.h>
+#include <tqtabwidget.h>
+#include <tqcombobox.h>
+#include <tqdialog.h>
+#include <tqwizard.h>
+#include <tqlcdnumber.h>
+#include <tqprogressbar.h>
+#include <tqtextview.h>
+#include <tqtextbrowser.h>
+#include <tqdial.h>
+#include <tqslider.h>
+#include <tqframe.h>
+#include <tqwidgetstack.h>
+#include <tqtoolbox.h>
+#include <tqtextedit.h>
+#include <tqscrollbar.h>
+#include <tqmainwindow.h>
+#include <tqsplitter.h>
+#include <tqaction.h>
+#include <tqpopupmenu.h>
+#include <tqmenubar.h>
+#include <tqpopupmenu.h>
+#include <tqdatetimeedit.h>
+#include <tqvbox.h>
+#include <tqhbox.h>
+#include <tqgrid.h>
+
+#include <stdlib.h>
+
+class TQWidgetFactoryPrivate
+{
+public:
+ TQCString translationContext;
+ TQListViewItem *lastItem;
+ TQDict<bool> customWidgets;
+};
+
+static TQPtrList<TQWidgetFactory> widgetFactories;
+static TQPluginManager<LanguageInterface> *languageInterfaceManager = 0;
+static TQPluginManager<WidgetInterface> *widgetInterfaceManager = 0;
+
+static TQMap<TQString, bool> *availableWidgetMap = 0;
+static TQStringList *availableWidgetList = 0;
+
+TQMap<TQWidget*, TQString> *qwf_forms = 0;
+TQString *qwf_language = 0;
+bool qwf_execute_code = TRUE;
+bool qwf_stays_on_top = FALSE;
+TQString qwf_currFileName = "";
+TQObject *qwf_form_object = 0;
+TQString *qwf_plugin_dir = 0;
+
+static void setupPluginDir()
+{
+ if ( !qwf_plugin_dir )
+ qwf_plugin_dir = new TQString( "/designer" );
+}
+
+static void setupWidgetListAndMap()
+{
+ if ( availableWidgetMap )
+ return;
+ setupPluginDir();
+ availableWidgetList = new TQStringList;
+ (*availableWidgetList) << "TQPushButton" << "TQToolButton" << "TQCheckBox" << "TQRadioButton"
+ << "TQGroupBox" << "TQButtonGroup" << "TQIconView" << "TQTable"
+ << "TQListBox" << "TQListView" << "TQLineEdit" << "TQSpinBox"
+ << "TQMultiLineEdit" << "TQLabel" << "TextLabel" << "PixmapLabel"
+ << "TQLayoutWidget" << "TQTabWidget" << "TQComboBox"
+ << "TQWidget" << "TQDialog" << "TQWizard" << "TQLCDNumber";
+ // put less stress on the compiler by limiting the template nesting depth
+ (*availableWidgetList) << "TQProgressBar" << "TQTextView" << "TQTextBrowser"
+ << "TQDial" << "TQSlider" << "TQFrame" << "Line" << "TQTextEdit"
+ << "TQDateEdit" << "TQTimeEdit" << "TQDateTimeEdit" << "TQScrollBar"
+ << "TQPopupMenu" << "TQWidgetStack" << "TQMainWindow"
+ << "TQDataTable" << "TQDataBrowser" << "TQDataView"
+ << "TQVBox" << "TQHBox" << "TQGrid" << "TQToolBox" << "TQSplitter";
+
+ if ( !widgetInterfaceManager )
+ widgetInterfaceManager =
+ new TQPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), *qwf_plugin_dir );
+
+ TQStringList l = widgetInterfaceManager->featureList();
+ TQStringList::Iterator it;
+ for ( it = l.begin(); it != l.end(); ++it )
+ (*availableWidgetList) << *it;
+
+ availableWidgetMap = new TQMap<TQString, bool>;
+ for ( it = availableWidgetList->begin(); it != availableWidgetList->end(); ++it )
+ availableWidgetMap->insert( *it, TRUE );
+}
+
+static TQImage loadImageData( const TQString& format, ulong len, TQByteArray data )
+{
+ TQImage img;
+ if ( format == "XPM.GZ" || format == "XBM.GZ" ) {
+ if ( len < data.size() * 10 )
+ len = data.size() * 10;
+ // tqUncompress() expects the first 4 bytes to be the expected length of
+ // the uncompressed data
+ TQByteArray dataTmp( data.size() + 4 );
+ memcpy( dataTmp.data()+4, data.data(), data.size() );
+ dataTmp[0] = ( len & 0xff000000 ) >> 24;
+ dataTmp[1] = ( len & 0x00ff0000 ) >> 16;
+ dataTmp[2] = ( len & 0x0000ff00 ) >> 8;
+ dataTmp[3] = ( len & 0x000000ff );
+ TQByteArray baunzip = tqUncompress( dataTmp );
+ len = baunzip.size();
+ img.loadFromData( (const uchar*)baunzip.data(), len, format.left(format.tqfind('.')) );
+ } else {
+ img.loadFromData( (const uchar*)data.data(), data.size(), format );
+ }
+ return img;
+}
+
+static TQSizePolicy::SizeType stringToSizeType( const TQString& str )
+{
+ if ( str == "Fixed" ) {
+ return TQSizePolicy::Fixed;
+ } else if ( str == "Minimum" ) {
+ return TQSizePolicy::Minimum;
+ } else if ( str == "Maximum" ) {
+ return TQSizePolicy::Maximum;
+ } else if ( str == "Preferred" ) {
+ return TQSizePolicy::Preferred;
+ } else if ( str == "MinimumExpanding" ) {
+ return TQSizePolicy::MinimumExpanding;
+ } else if ( str == "Expanding" ) {
+ return TQSizePolicy::Expanding;
+ } else {
+ return TQSizePolicy::Ignored;
+ }
+}
+
+
+/*!
+ \class TQWidgetFactory
+
+ \brief The TQWidgetFactory class provides for the dynamic creation of widgets
+ from TQt Designer .ui files.
+
+ This class basically offers two things:
+
+ \list
+
+ \i Dynamically creating widgets from \link designer-manual.book TQt
+ Designer\endlink user interface description files.
+ You can do this using the static function TQWidgetFactory::create().
+ This function also performs signal and slot connections, tab
+ ordering, etc., as defined in the .ui file, and returns the
+ top-level widget in the .ui file. After creating the widget you can
+ use TQObject::child() and TQObject::queryList() to access child
+ widgets of this returned widget.
+
+ \i Adding additional widget factories to be able to create custom
+ widgets. See createWidget() for details.
+
+ \endlist
+
+ This class is not included in the TQt library itself. To use it you
+ must link against \c libqui.so (Unix) or \c qui.lib (Windows), which is
+ built into \c INSTALL/lib if you built \e{TQt Designer} (\c INSTALL is
+ the directory where TQt is installed ).
+
+ If you create a TQMainWindow using a TQWidgetFactory, be aware that
+ it already has a central widget. Therefore, you need to delete this
+ one before setting another one.
+
+ See the "Creating Dynamic Dialogs from .ui Files" section of the \link
+ designer-manual.book TQt Designer manual\endlink for an example. See
+ also the \l{TQWidgetPlugin} class and the \link plugins-howto.html
+ Plugins documentation\endlink.
+*/
+
+/*! Constructs a TQWidgetFactory. */
+
+TQWidgetFactory::TQWidgetFactory()
+ : d( new TQWidgetFactoryPrivate() ), dbControls( 0 ),
+ usePixmapCollection( FALSE ), defMargin( 11 ), defSpacing( 6 )
+{
+ widgetFactories.setAutoDelete( TRUE );
+ d->customWidgets.setAutoDelete( TRUE );
+}
+
+/*! \fn TQWidgetFactory::~TQWidgetFactory()
+ Destructor.
+*/
+TQWidgetFactory::~TQWidgetFactory()
+{
+ delete d;
+}
+
+/*!
+
+ Loads the \e{TQt Designer} user interface description file \a uiFile
+ and returns the top-level widget in that description. \a tqparent and
+ \a name are passed to the constructor of the top-level widget.
+
+ This function also performs signal and slot connections, tab
+ ordering, etc., as described in the .ui file. In \e{TQt Designer} it
+ is possible to add custom Q_SLOTS to a form and connect to them. If
+ you want these connections to be made, you must create a class
+ derived from TQObject, which implements all these Tslots. Then pass an
+ instance of the object as \a connector to this function. If you do
+ this, the connections to the custom Q_SLOTS will be done using the \a
+ connector as slot.
+
+ If something fails, 0 is returned.
+
+ The ownership of the returned widget is passed to the caller.
+*/
+
+TQWidget *TQWidgetFactory::create( const TQString &uiFile, TQObject *connector,
+ TQWidget *tqparent, const char *name )
+{
+ setupPluginDir();
+ TQFile f( uiFile );
+ bool failed = FALSE;
+ if ( !f.open( IO_ReadOnly ) )
+ failed = TRUE;
+ if ( failed && tqApp->type() == TQApplication::Tty ) {
+ // for TQSA: If we have no GUI, we have no form definition
+ // files, but just the code. So try if only the code exists.
+ f.setName( uiFile + ".qs" );
+ failed = !f.open( IO_ReadOnly );
+ }
+ if ( failed )
+ return 0;
+
+ qwf_currFileName = uiFile;
+ TQWidget *w = TQWidgetFactory::create( &f, connector, tqparent, name );
+ if ( !qwf_forms )
+ qwf_forms = new TQMap<TQWidget*, TQString>;
+ qwf_forms->insert( w, uiFile );
+ return w;
+}
+
+#undef Q_SLOTS
+
+/*! \overload
+ Loads the user interface description from tqdevice \a dev.
+ */
+
+TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidget *tqparent, const char *name )
+{
+ setupPluginDir();
+ TQWidget *w = 0;
+ TQDomDocument doc;
+ TQString errMsg;
+ int errLine;
+
+ TQWidgetFactory *widgetFactory = new TQWidgetFactory;
+ widgetFactory->toplevel = 0;
+
+ // If we have no GUI, we only want to load the code
+ if ( tqApp->type() != TQApplication::Tty ) {
+ TQIODevice::Offset start = dev->at();
+ TQ_UINT32 magic;
+ TQDataStream in( dev );
+ in >> magic;
+ if ( magic == UibMagic ) {
+ w = widgetFactory->createFromUibFile( in, connector, tqparent, name );
+ } else {
+ in.unsetDevice();
+ dev->at( start );
+ if ( doc.setContent( dev, &errMsg, &errLine ) ) {
+ w = widgetFactory->createFromUiFile( doc, connector, tqparent, name );
+ } else {
+ // qDebug( TQString("Parse error: ") + errMsg + TQString(" in line %d"), errLine );
+ }
+ }
+ if ( !w ) {
+ delete widgetFactory;
+ return 0;
+ }
+ }
+
+ if ( !languageInterfaceManager )
+ languageInterfaceManager =
+ new TQPluginManager<LanguageInterface>( IID_Language, TQApplication::libraryPaths(), *qwf_plugin_dir );
+ widgetFactory->loadExtraSource();
+
+ if ( widgetFactory->toplevel ) {
+#ifndef TQT_NO_SQL
+ TQMap<TQWidget*, SqlWidgetConnection>::Iterator cit = widgetFactory->sqlWidgetConnections.begin();
+ for( ; cit != widgetFactory->sqlWidgetConnections.end(); ++cit ) {
+ if ( widgetFactory->noDatabaseWidgets.tqfind( cit.key()->name() ) !=
+ widgetFactory->noDatabaseWidgets.end() )
+ continue;
+ if ( cit.key()->inherits( "TQDesignerDataBrowser2" ) )
+ ( (TQDesignerDataBrowser2*)cit.key() )->initPreview( (*cit).conn, (*cit).table,
+ TQT_TQOBJECT(cit.key()), *(*cit).dbControls );
+ else if ( cit.key()->inherits( "TQDesignerDataView2" ) )
+ ( (TQDesignerDataView2*)cit.key() )->initPreview( (*cit).conn, (*cit).table,
+ TQT_TQOBJECT(cit.key()), *(*cit).dbControls );
+ }
+
+ for ( TQMap<TQString, TQStringList>::Iterator it = widgetFactory->dbTables.begin();
+ it != widgetFactory->dbTables.end(); ++it ) {
+ TQDataTable *table = (TQDataTable*)widgetFactory->toplevel->child( it.key(), "TQDataTable" );
+ if ( !table )
+ continue;
+ if ( widgetFactory->noDatabaseWidgets.tqfind( table->name() ) !=
+ widgetFactory->noDatabaseWidgets.end() )
+ continue;
+ TQValueList<Field> fieldMap = *widgetFactory->fieldMaps.tqfind( table );
+ TQString conn = (*it)[ 0 ];
+ TQSqlCursor* c = 0;
+ TQSqlDatabase *db = 0;
+ if ( conn.isEmpty() || conn == "(default)" ) {
+ db = TQSqlDatabase::database();
+ c = new TQSqlCursor( (*it)[ 1 ] );
+ } else {
+ db = TQSqlDatabase::database( conn );
+ c = new TQSqlCursor( (*it)[ 1 ], TRUE, db );
+ }
+ if ( db ) {
+ table->setSqlCursor( c, fieldMap.isEmpty(), TRUE );
+ table->refresh( TQDataTable::RefreshAll );
+ }
+ }
+#endif
+ }
+
+ for ( TQMap<TQString, TQString>::Iterator it = widgetFactory->buddies.begin();
+ it != widgetFactory->buddies.end(); ++it ) {
+ TQLabel *label = (TQLabel*)widgetFactory->toplevel->child( it.key(), "TQLabel" );
+ TQWidget *buddy = (TQWidget*)widgetFactory->toplevel->child( *it, "TQWidget" );
+ if ( label && buddy )
+ label->setBuddy( buddy );
+ }
+
+ delete widgetFactory;
+
+ TQApplication::sendPostedEvents();
+
+ return w;
+}
+
+TQWidget *TQWidgetFactory::createFromUiFile( TQDomDocument doc, TQObject *connector,
+ TQWidget *tqparent, const char *name )
+{
+ DomTool::fixDocument( doc );
+
+ uiFileVersion = doc.firstChild().toElement().attribute("version");
+ TQDomElement e = doc.firstChild().toElement().firstChild().toElement();
+
+ TQDomElement variables = e;
+ while ( variables.tagName() != "variables" && !variables.isNull() )
+ variables = variables.nextSibling().toElement();
+
+ TQDomElement Tslots = e;
+ while ( Tslots.tagName() != "Q_SLOTS" && !Tslots.isNull() )
+ Tslots = Tslots.nextSibling().toElement();
+
+ TQDomElement connections = e;
+ while ( connections.tagName() != "connections" && !connections.isNull() )
+ connections = connections.nextSibling().toElement();
+
+ TQDomElement imageCollection = e;
+ while ( imageCollection.tagName() != "images" && !imageCollection.isNull() )
+ imageCollection = imageCollection.nextSibling().toElement();
+
+ TQDomElement tabOrder = e;
+ while ( tabOrder.tagName() != "tabstops" && !tabOrder.isNull() )
+ tabOrder = tabOrder.nextSibling().toElement();
+
+ TQDomElement actions = e;
+ while ( actions.tagName() != "actions" && !actions.isNull() )
+ actions = actions.nextSibling().toElement();
+
+ TQDomElement toolbars = e;
+ while ( toolbars.tagName() != "toolbars" && !toolbars.isNull() )
+ toolbars = toolbars.nextSibling().toElement();
+
+ TQDomElement menubar = e;
+ while ( menubar.tagName() != "menubar" && !menubar.isNull() )
+ menubar = menubar.nextSibling().toElement();
+
+ TQDomElement functions = e;
+ while ( functions.tagName() != "functions" && !functions.isNull() )
+ functions = functions.nextSibling().toElement();
+
+ TQDomElement widget;
+ while ( !e.isNull() ) {
+ if ( e.tagName() == "class" ) {
+ d->translationContext = e.firstChild().toText().data();
+ } else if ( e.tagName() == "widget" ) {
+ widget = e;
+ } else if ( e.tagName() == "pixmapinproject" ) {
+ usePixmapCollection = TRUE;
+ } else if ( e.tagName() == "layoutdefaults" ) {
+ defSpacing = e.attribute( "spacing", TQString::number( defSpacing ) ).toInt();
+ defMargin = e.attribute( "margin", TQString::number( defMargin ) ).toInt();
+ }
+ e = e.nextSibling().toElement();
+ }
+
+ if ( !imageCollection.isNull() )
+ loadImageCollection( imageCollection );
+
+ createWidgetInternal( widget, tqparent, 0, widget.attribute("class", "TQWidget") );
+ TQWidget *w = toplevel;
+ if ( !w )
+ return 0;
+
+ if ( !actions.isNull() )
+ loadActions( actions );
+ if ( !toolbars.isNull() )
+ loadToolBars( toolbars );
+ if ( !menubar.isNull() )
+ loadMenuBar( menubar );
+
+ if ( !connections.isNull() )
+ loadConnections( connections, connector );
+ if ( w && name && tqstrlen( name ) > 0 )
+ w->setName( name );
+
+ if ( !tabOrder.isNull() )
+ loadTabOrder( tabOrder );
+
+#if 0
+ if ( !functions.isNull() ) // compatibiliy with early 3.0 betas
+ loadFunctions( functions );
+#endif
+
+ return w;
+}
+
+void TQWidgetFactory::unpackUInt16( TQDataStream& in, TQ_UINT16& n )
+{
+ TQ_UINT8 half;
+ in >> half;
+ if ( half == 255 ) {
+ in >> n;
+ } else {
+ n = half;
+ }
+}
+
+void TQWidgetFactory::unpackUInt32( TQDataStream& in, TQ_UINT32& n )
+{
+ TQ_UINT16 half;
+ in >> half;
+ if ( half == 65535 ) {
+ in >> n;
+ } else {
+ n = half;
+ }
+}
+
+void TQWidgetFactory::unpackByteArray( TQDataStream& in, TQByteArray& array )
+{
+ TQ_UINT32 size;
+ unpackUInt32( in, size );
+ array.resize( size );
+ in.readRawBytes( array.data(), size );
+}
+
+void TQWidgetFactory::unpackCString( const UibStrTable& strings, TQDataStream& in,
+ TQCString& cstr )
+{
+ TQ_UINT32 n;
+ unpackUInt32( in, n );
+ cstr = strings.asCString( n );
+}
+
+void TQWidgetFactory::unpackString( const UibStrTable& strings, TQDataStream& in,
+ TQString& str )
+{
+ TQ_UINT32 n;
+ unpackUInt32( in, n );
+ str = strings.asString( n );
+}
+
+void TQWidgetFactory::unpackStringSplit( const UibStrTable& strings,
+ TQDataStream& in, TQString& str )
+{
+ TQString remainder;
+ unpackString( strings, in, str );
+ unpackString( strings, in, remainder );
+ str += remainder;
+}
+
+void TQWidgetFactory::unpackVariant( const UibStrTable& strings, TQDataStream& in,
+ TQVariant& value )
+{
+ TQString imageName;
+ TQ_UINT32 number;
+ TQ_UINT16 count;
+ TQ_UINT16 x;
+ TQ_UINT16 y;
+ TQ_UINT16 width;
+ TQ_UINT16 height;
+ TQ_UINT8 bit;
+ TQ_UINT8 type;
+
+ in >> type;
+
+ switch ( type ) {
+ case TQVariant::String:
+ unpackString( strings, in, value.asString() );
+ break;
+ case TQVariant::Pixmap:
+ unpackString( strings, in, imageName );
+ if ( imageName.isEmpty() ) {
+ value.asPixmap() = TQPixmap();
+ } else {
+ value.asPixmap() = loadPixmap( imageName );
+ }
+ break;
+ case TQVariant::Image:
+ unpackString( strings, in, imageName );
+ if ( imageName.isEmpty() ) {
+ value.asImage() = TQImage();
+ } else {
+ value.asImage() = loadFromCollection( imageName );
+ }
+ break;
+ case TQVariant::IconSet:
+ unpackString( strings, in, imageName );
+ if ( imageName.isEmpty() ) {
+ value.asIconSet() = TQIconSet();
+ } else {
+ value.asIconSet() = TQIconSet( loadPixmap(imageName) );
+ }
+ break;
+ case TQVariant::StringList:
+ unpackUInt16( in, count );
+ while ( count-- ) {
+ TQString str;
+ unpackString( strings, in, str );
+ value.asStringList().append( str );
+ }
+ break;
+ case TQVariant::Rect:
+ unpackUInt16( in, x );
+ unpackUInt16( in, y );
+ unpackUInt16( in, width );
+ unpackUInt16( in, height );
+ value = TQRect( x, y, width, height );
+ break;
+ case TQVariant::Size:
+ unpackUInt16( in, width );
+ unpackUInt16( in, height );
+ value = TQSize( width, height );
+ break;
+ case TQVariant::Color:
+ in >> value.asColor();
+ break;
+ case TQVariant::Point:
+ unpackUInt16( in, x );
+ unpackUInt16( in, y );
+ value = TQPoint( x, y );
+ break;
+ case TQVariant::Int:
+ unpackUInt32( in, number );
+ value = (int) number;
+ break;
+ case TQVariant::Bool:
+ in >> bit;
+ value = TQVariant( bit != 0, 0 );
+ break;
+ case TQVariant::Double:
+ in >> value.asDouble();
+ break;
+ case TQVariant::CString:
+ unpackCString( strings, in, value.asCString() );
+ break;
+ case TQVariant::Cursor:
+ in >> value.asCursor();
+ break;
+ case TQVariant::Date:
+ in >> value.asDate();
+ break;
+ case TQVariant::Time:
+ in >> value.asTime();
+ break;
+ case TQVariant::DateTime:
+ in >> value.asDateTime();
+ break;
+ default:
+ in >> value;
+ }
+}
+
+void TQWidgetFactory::inputSpacer( const UibStrTable& strings, TQDataStream& in,
+ TQLayout *tqparent )
+{
+ TQCString name;
+ TQVariant value;
+ TQCString comment;
+ TQSizePolicy::SizeType sizeType = TQSizePolicy::Preferred;
+ bool vertical = FALSE;
+ int w = 0;
+ int h = 0;
+ TQ_UINT16 column = 0;
+ TQ_UINT16 row = 0;
+ TQ_UINT16 colspan = 1;
+ TQ_UINT16 rowspan = 1;
+ TQ_UINT8 objectTag;
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_GridCell:
+ unpackUInt16( in, column );
+ unpackUInt16( in, row );
+ unpackUInt16( in, colspan );
+ unpackUInt16( in, rowspan );
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( name == "orientation" ) {
+ vertical = ( value == "Vertical" );
+ } else if ( name == "tqsizeHint" ) {
+ w = value.toSize().width();
+ h = value.toSize().height();
+ } else if ( name == "sizeType" ) {
+ sizeType = stringToSizeType( value.toString() );
+ }
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+
+ if ( tqparent != 0 ) {
+ TQSpacerItem *spacer;
+ if ( vertical ) {
+ spacer = new TQSpacerItem( w, h, TQSizePolicy::Minimum, sizeType );
+ } else {
+ spacer = new TQSpacerItem( w, h, sizeType, TQSizePolicy::Minimum );
+ }
+
+ if ( tqparent->inherits("TQGridLayout") ) {
+ ((TQGridLayout *) tqparent)->addMultiCell( spacer, row,
+ row + rowspan - 1, column, column + colspan - 1,
+ vertical ? Qt::AlignHCenter : Qt::AlignVCenter );
+ } else {
+ tqparent->addItem( spacer );
+ }
+ }
+}
+
+void TQWidgetFactory::inputColumnOrRow( const UibStrTable& strings,
+ TQDataStream& in, TQObject *tqparent,
+ bool isRow )
+{
+ TQString text;
+ TQPixmap pixmap;
+ TQString field;
+ bool clickable = TRUE;
+ bool resizable = TRUE;
+
+ TQCString name;
+ TQVariant value;
+ TQCString comment;
+ TQString str;
+ TQ_UINT8 objectTag;
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_TextProperty:
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, value.asCString() );
+ unpackCString( strings, in, comment );
+ str = translate( value.asCString().data(), comment.data() );
+
+ if ( name == "field" ) {
+ field = str;
+ } else if ( name == "text" ) {
+ text = str;
+ }
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( name == "clickable" ) {
+ clickable = value.toBool();
+ } else if ( name == "pixmap" ) {
+ pixmap = value.asPixmap();
+ } else if ( name == "resizable" ) {
+ resizable = value.toBool();
+ }
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+
+ if ( tqparent != 0 ) {
+ if ( tqparent->inherits("TQListView") ) {
+ createListViewColumn( (TQListView *) tqparent, text, pixmap, clickable,
+ resizable );
+#ifndef TQT_NO_TABLE
+ } else if ( tqparent->inherits("TQTable") ) {
+ createTableColumnOrRow( (TQTable *) tqparent, text, pixmap, field,
+ isRow );
+#endif
+ }
+ }
+}
+
+void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in,
+ TQObject *tqparent, TQListViewItem *parentItem )
+{
+ TQStringList texts;
+ TQValueList<TQPixmap> pixmaps;
+ TQCString name;
+ TQVariant value;
+ TQCString comment;
+ TQ_UINT8 objectTag;
+
+ TQListView *listView = 0;
+ if ( tqparent != 0 && tqparent->inherits("TQListView") )
+ tqparent = TQT_TQOBJECT((TQListView *) tqparent);
+ TQListViewItem *item = 0;
+ if ( listView != 0 ) {
+ if ( parentItem == 0 ) {
+ item = new TQListViewItem( listView, d->lastItem );
+ } else {
+ item = new TQListViewItem( parentItem, d->lastItem );
+ }
+ d->lastItem = item;
+ }
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_Item:
+ if ( listView != 0 )
+ d->lastItem->setOpen( TRUE );
+ inputItem( strings, in, tqparent, item );
+ break;
+ case Object_TextProperty:
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, value.asCString() );
+ unpackCString( strings, in, comment );
+
+ if ( name == "text" )
+ texts << translate( value.asCString().data(), comment.data() );
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( name == "pixmap" )
+ pixmaps << value.asPixmap();
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+
+ if ( listView != 0 ) {
+ int i = 0;
+ TQStringList::ConstIterator t = texts.begin();
+ while ( t != texts.end() ) {
+ item->setText( i, *t );
+ ++i;
+ ++t;
+ }
+
+ int j = 0;
+ TQValueList<TQPixmap>::ConstIterator p = pixmaps.begin();
+ while ( p != pixmaps.end() ) {
+ item->setPixmap( j, *p );
+ ++j;
+ ++p;
+ }
+ } else {
+ TQString text = texts.last();
+ TQPixmap pixmap = pixmaps.last();
+
+ if ( tqparent != 0 ) {
+ if ( tqparent->inherits("TQComboBox") ||
+ tqparent->inherits("TQListBox") ) {
+ TQListBox *listBox = (TQListBox *) tqparent->tqqt_cast( "TQListBox" );
+ if ( listBox == 0 )
+ listBox = ((TQComboBox *) tqparent)->listBox();
+
+ if ( pixmap.isNull() ) {
+ (void) new TQListBoxText( listBox, text );
+ } else {
+ (void) new TQListBoxPixmap( listBox, pixmap, text );
+ }
+ #ifndef TQT_NO_ICONVIEW
+ } else if ( tqparent->inherits("TQIconView") ) {
+ (void) new TQIconViewItem( (TQIconView *) tqparent, text, pixmap );
+ #endif
+ }
+ }
+ }
+}
+
+void TQWidgetFactory::inputMenuItem( TQObject **objects,
+ const UibStrTable& strings, TQDataStream& in,
+ TQMenuBar *menuBar )
+{
+ TQCString name;
+ TQCString text;
+ TQ_UINT16 actionNo;
+ TQ_UINT8 objectTag;
+
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, text );
+
+ TQPopupMenu *popupMenu = new TQPopupMenu( menuBar->parentWidget(), name );
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_ActionRef:
+ unpackUInt16( in, actionNo );
+ ((TQAction *) objects[actionNo])->addTo( popupMenu );
+ break;
+ case Object_Separator:
+ popupMenu->insertSeparator();
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+ menuBar->insertItem( translate(text.data()), popupMenu );
+}
+
+TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects,
+ const UibStrTable& strings,
+ TQDataStream& in, TQWidget *ancestorWidget,
+ TQObject *tqparent, TQCString className )
+{
+ TQObject *obj = 0;
+ TQWidget *widget = 0;
+ TQLayout *tqlayout = 0;
+ TQWidget *parentWidget = 0;
+ TQLayout *parentLayout = 0;
+
+ bool isTQObject = !className.isEmpty();
+ if ( isTQObject ) {
+ if ( tqparent != 0 ) {
+ if ( tqparent->isWidgetType() ) {
+ if ( tqparent->inherits("TQMainWindow") ) {
+ parentWidget = ((TQMainWindow *) tqparent)->centralWidget();
+ } else {
+ parentWidget = (TQWidget *) tqparent;
+ }
+ } else if ( tqparent->inherits("TQLayout") ) {
+ parentLayout = (TQLayout *) tqparent;
+ parentWidget = ancestorWidget;
+ }
+ }
+
+ if ( className == "TQAction" ) {
+ unpackCString( strings, in, className );
+ if ( className == "TQActionGroup" ) {
+ obj = TQT_TQOBJECT(new TQActionGroup( tqparent ));
+ } else {
+ obj = TQT_TQOBJECT(new TQAction( tqparent ));
+ }
+ } else if ( className == "TQLayout" ) {
+ unpackCString( strings, in, className );
+ LayoutType type = Grid;
+ if ( className == "TQHBoxLayout" ) {
+ type = HBox;
+ } else if ( className == "TQVBoxLayout" ) {
+ type = VBox;
+ }
+ if ( parentLayout != 0 && parentLayout->inherits("TQGridLayout") ) {
+ tqlayout = createLayout( 0, 0, type );
+ } else {
+ tqlayout = createLayout( parentWidget, parentLayout, type );
+ }
+ obj = TQT_TQOBJECT(tqlayout);
+ } else if ( className == "TQMenuBar" ) {
+ unpackCString( strings, in, className );
+ widget = ((TQMainWindow *) tqparent)->menuBar();
+ obj = TQT_TQOBJECT(widget);
+ } else if ( className == "TQToolBar" ) {
+ TQ_UINT8 dock;
+ in >> dock;
+ unpackCString( strings, in, className );
+ widget = new TQToolBar( TQString(), (TQMainWindow *) tqparent,
+ (TQt::TQt::Dock) dock );
+ obj = TQT_TQOBJECT(widget);
+ } else if ( className == "TQWidget" ) {
+ unpackCString( strings, in, className );
+ widget = createWidget( className, parentWidget, 0 );
+ obj = TQT_TQOBJECT(widget);
+ }
+
+ if ( widget != 0 )
+ ancestorWidget = widget;
+ d->lastItem = 0;
+ objects[numObjects++] = obj;
+ }
+
+ TQCString name;
+ TQVariant value;
+ TQCString comment;
+ TQString str;
+ TQ_UINT16 actionNo;
+ int metAttribute = 0;
+ TQ_UINT16 column = 0;
+ TQ_UINT16 row = 0;
+ TQ_UINT16 colspan = 1;
+ TQ_UINT16 rowspan = 1;
+ TQ_UINT8 paletteTag;
+ TQ_UINT8 objectTag;
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_ActionRef:
+ unpackUInt16( in, actionNo );
+ ((TQAction *) objects[actionNo])->addTo( (TQToolBar *) widget );
+ break;
+ case Object_Attribute:
+ metAttribute = 2;
+ break;
+ case Object_Column:
+ inputColumnOrRow( strings, in, obj, FALSE );
+ break;
+ case Object_Event:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+ // ### do something with value.asStringList()
+ break;
+ case Object_FontProperty:
+ {
+ TQFont font;
+ TQString family;
+ TQ_UINT16 pointSize;
+ TQ_UINT8 fontFlags;
+
+ unpackCString( strings, in, name );
+ in >> fontFlags;
+
+ if ( fontFlags & Font_Family ) {
+ unpackString( strings, in, family );
+ font.setFamily( family );
+ }
+ if ( fontFlags & Font_PointSize ) {
+ unpackUInt16( in, pointSize );
+ font.setPointSize( pointSize );
+ }
+ if ( fontFlags & Font_Bold )
+ font.setBold( TRUE );
+ if ( fontFlags & Font_Italic )
+ font.setItalic( TRUE );
+ if ( fontFlags & Font_Underline )
+ font.setUnderline( TRUE );
+ if ( fontFlags & Font_StrikeOut )
+ font.setStrikeOut( TRUE );
+
+ if ( obj != 0 )
+ setProperty( obj, name, font );
+ }
+ break;
+ case Object_GridCell:
+ unpackUInt16( in, column );
+ unpackUInt16( in, row );
+ unpackUInt16( in, colspan );
+ unpackUInt16( in, rowspan );
+ break;
+ case Object_Item:
+ inputItem( strings, in, obj );
+ break;
+ case Object_MenuItem:
+ inputMenuItem( objects, strings, in, (TQMenuBar *) widget );
+ break;
+ case Object_PaletteProperty:
+ {
+ TQPalette palette;
+ TQColorGroup tqcolorGroup;
+ TQColor color;
+ int role = -1;
+
+ unpackCString( strings, in, name );
+
+ in >> paletteTag;
+ while ( !in.atEnd() && paletteTag != Palette_End ) {
+ switch ( paletteTag ) {
+ case Palette_Active:
+ palette.setActive( tqcolorGroup );
+ role = -1;
+ break;
+ case Palette_Inactive:
+ palette.setInactive( tqcolorGroup );
+ role = -1;
+ break;
+ case Palette_Disabled:
+ palette.setDisabled( tqcolorGroup );
+ role = -1;
+ break;
+ case Palette_Color:
+ role++;
+ in >> color;
+ tqcolorGroup.setColor( (TQColorGroup::ColorRole) role,
+ color );
+ break;
+ case Palette_Pixmap:
+ unpackVariant( strings, in, value );
+ tqcolorGroup.setBrush( (TQColorGroup::ColorRole) role,
+ TQBrush(color, value.asPixmap()) );
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> paletteTag;
+ }
+ if ( obj != 0 )
+ setProperty( obj, name, palette );
+ }
+ break;
+ case Object_Row:
+ inputColumnOrRow( strings, in, obj, TRUE );
+ break;
+ case Object_Spacer:
+ inputSpacer( strings, in, tqlayout );
+ break;
+ case Object_Separator:
+ ((TQToolBar *) widget)->addSeparator();
+ break;
+ case Object_SubAction:
+ inputObject( objects, numObjects, strings, in, parentWidget,
+ obj != 0 ? obj : tqparent, "TQAction" );
+ break;
+ case Object_SubLayout:
+ inputObject( objects, numObjects, strings, in, parentWidget, obj,
+ "TQLayout" );
+ break;
+ case Object_SubWidget:
+ inputObject( objects, numObjects, strings, in, parentWidget, obj,
+ "TQWidget" );
+ break;
+ case Object_TextProperty:
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, value.asCString() );
+ unpackCString( strings, in, comment );
+ str = translate( value.asCString().data(), comment.data() );
+
+ if ( metAttribute > 0 ) {
+ if ( name == "title" ) {
+ if ( tqparent != 0 ) {
+ if ( tqparent->inherits("TQTabWidget") ) {
+ ((TQTabWidget *) tqparent)->insertTab( widget, str );
+ } else if ( tqparent->inherits("TQWizard") ) {
+ ((TQWizard *) tqparent)->addPage( widget, str );
+ }
+ }
+ }
+ } else {
+ if ( obj != 0 )
+ setProperty( obj, name, str );
+ }
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( metAttribute > 0 ) {
+ if ( name == "id" ) {
+ if ( tqparent != 0 && tqparent->inherits("TQWidgetStack") )
+ ((TQWidgetStack *) tqparent)->addWidget( widget, value.toInt() );
+ }
+ } else {
+ if ( obj != 0 )
+ setProperty( obj, name, value );
+ }
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ metAttribute--;
+ }
+
+ if ( parentLayout != 0 ) {
+ if ( widget != 0 ) {
+ if ( parentLayout->inherits("TQGridLayout") ) {
+ ((TQGridLayout *) parentLayout)->addMultiCellWidget(
+ widget, row, row + rowspan - 1, column,
+ column + colspan - 1 );
+ } else {
+ ((TQBoxLayout *) parentLayout)->addWidget( widget );
+ }
+ } else if ( tqlayout != 0 ) {
+ if ( parentLayout->inherits("TQGridLayout") ) {
+ ((TQGridLayout *) parentLayout)->addMultiCellLayout(
+ tqlayout, row, row + rowspan - 1, column,
+ column + colspan - 1 );
+ }
+ }
+ }
+ return obj;
+}
+
+TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in,
+ TQObject * /* connector */ , TQWidget *tqparent, const char *name )
+{
+#define END_OF_BLOCK() \
+ ( in.atEnd() || in.tqdevice()->at() >= nextBlock )
+
+ TQ_UINT8 lf;
+ TQ_UINT8 cr;
+ in >> lf;
+ in >> cr;
+ if ( lf != '\n' || cr != '\r' ) {
+ qWarning( "File corrupted" );
+ return 0;
+ }
+
+ TQ_UINT8 qdatastreamVersion;
+ in >> qdatastreamVersion;
+ if ( (int) qdatastreamVersion > in.version() ) {
+ qWarning( "Incompatible version of TQt" );
+ return 0;
+ }
+ in.setVersion( qdatastreamVersion );
+
+ UibStrTable strings;
+ TQObject **objects = 0;
+ int numObjects = 0;
+
+ TQ_UINT8 blockType;
+ TQ_UINT32 blockSize;
+
+ in >> blockType;
+ while ( !in.atEnd() && blockType != Block_End ) {
+ unpackUInt32( in, blockSize );
+ TQIODevice::Offset nextBlock = in.tqdevice()->at() + blockSize;
+
+ switch ( blockType ) {
+ case Block_Actions:
+ inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(toplevel) );
+ break;
+ case Block_Buddies:
+ {
+ TQ_UINT16 labelNo;
+ TQ_UINT16 buddyNo;
+
+ do {
+ unpackUInt16( in, labelNo );
+ unpackUInt16( in, buddyNo );
+ TQLabel *label =
+ (TQLabel *) objects[labelNo]->tqqt_cast( "TQLabel" );
+ if ( label != 0 )
+ label->setBuddy( (TQWidget *) objects[buddyNo] );
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Connections:
+ {
+ TQString language = "C++";
+ TQ_UINT16 senderNo = 0;
+ TQString signal = "clicked()";
+ TQ_UINT16 receiverNo = 0;
+ TQString slot = "accept()";
+ TQ_UINT8 connectionFlags;
+
+ do {
+ in >> connectionFlags;
+ if ( connectionFlags & Connection_Language )
+ unpackString( strings, in, language );
+ if ( connectionFlags & Connection_Sender )
+ unpackUInt16( in, senderNo );
+ if ( connectionFlags & Connection_Signal )
+ unpackStringSplit( strings, in, signal );
+ if ( connectionFlags & Connection_Receiver )
+ unpackUInt16( in, receiverNo );
+ if ( connectionFlags & Connection_Slot )
+ unpackStringSplit( strings, in, slot );
+ // ###
+#if 0
+ qWarning( "connect( %p, %s, %p, %s )", objects[senderNo],
+ signal.latin1(), objects[receiverNo],
+ slot.latin1() );
+#endif
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Functions:
+ // ###
+ qWarning( "Block_Functions not supported" );
+ in.tqdevice()->at( nextBlock );
+ break;
+ case Block_Images:
+ {
+ TQString format;
+ TQ_UINT32 length;
+ TQByteArray data;
+ Image image;
+
+ do {
+ unpackString( strings, in, image.name );
+ unpackString( strings, in, format );
+ unpackUInt32( in, length );
+ unpackByteArray( in, data );
+ image.img = loadImageData( format, length, data );
+ images += image;
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Intro:
+ {
+ TQ_INT16 defaultMargin;
+ TQ_INT16 defaultSpacing;
+ TQ_UINT16 maxObjects;
+ TQ_UINT8 introFlags;
+
+ in >> introFlags;
+ in >> defaultMargin;
+ in >> defaultSpacing;
+ unpackUInt16( in, maxObjects );
+ unpackCString( strings, in, d->translationContext );
+
+ if ( introFlags & Intro_Pixmapinproject )
+ usePixmapCollection = TRUE;
+ if ( defaultMargin != -32768 )
+ defMargin = defaultMargin;
+ if ( defaultSpacing != -32768 )
+ defSpacing = defaultSpacing;
+ objects = new TQObject *[maxObjects];
+ }
+ break;
+ case Block_Menubar:
+ inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(toplevel),
+ "TQMenuBar" );
+ break;
+ case Block_Slots:
+ {
+ TQString language;
+ TQString slot;
+
+ do {
+ unpackString( strings, in, language );
+ unpackStringSplit( strings, in, slot );
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Strings:
+ strings.readBlock( in, blockSize );
+ break;
+ case Block_Tabstops:
+ {
+ TQ_UINT16 beforeNo;
+ TQ_UINT16 afterNo;
+
+ unpackUInt16( in, beforeNo );
+ while ( !END_OF_BLOCK() ) {
+ unpackUInt16( in, afterNo );
+ toplevel->setTabOrder( (TQWidget *) objects[beforeNo],
+ (TQWidget *) objects[afterNo] );
+ beforeNo = afterNo;
+ }
+ }
+ break;
+ case Block_Toolbars:
+ do {
+ inputObject( objects, numObjects, strings, in, toplevel,
+ TQT_TQOBJECT(toplevel), "TQToolBar" );
+ } while ( !END_OF_BLOCK() );
+ break;
+ case Block_Variables:
+ // ###
+ qWarning( "Block_Variables not supported" );
+ in.tqdevice()->at( nextBlock );
+ break;
+ case Block_Widget:
+ toplevel = (TQWidget *)
+ inputObject( objects, numObjects, strings, in, toplevel, TQT_TQOBJECT(tqparent),
+ "TQWidget" );
+ if ( toplevel != 0 )
+ toplevel->setName( name );
+ break;
+ default:
+ qWarning( "Version error" );
+ return 0;
+ }
+ in >> blockType;
+ }
+ delete[] objects;
+ return toplevel;
+}
+
+/*! Installs a widget factory \a factory, which normally tqcontains
+ additional widgets that can then be created using a TQWidgetFactory.
+ See createWidget() for further details.
+*/
+
+void TQWidgetFactory::addWidgetFactory( TQWidgetFactory *factory )
+{
+ widgetFactories.append( factory );
+}
+
+/*!
+ Creates a widget of the type \a className passing \a tqparent and \a
+ name to its constructor.
+
+ If \a className is a widget in the TQt library, it is directly
+ created by this function. If the widget isn't in the TQt library,
+ each of the installed widget plugins is asked, in turn, to create
+ the widget. As soon as a plugin says it can create the widget it
+ is asked to do so. It may occur that none of the plugins can
+ create the widget, in which case each installed widget factory is
+ asked to create the widget (see addWidgetFactory()). If the widget
+ cannot be created by any of these means, 0 is returned.
+
+ If you have a custom widget, and want it to be created using the
+ widget factory, there are two approaches you can use:
+
+ \list 1
+
+ \i Write a widget plugin. This allows you to use the widget in
+ \e{TQt Designer} and in this TQWidgetFactory. See the widget plugin
+ documentation for further details. (See the "Creating Custom
+ Widgets with Plugins" section of the \link designer-manual.book TQt
+ Designer manual\endlink for an example.
+
+ \i Subclass TQWidgetFactory. Then reimplement this function to
+ create and return an instance of your custom widget if \a
+ className equals the name of your widget, otherwise return 0. Then
+ at the beginning of your program where you want to use the widget
+ factory to create widgets do a:
+ \code
+ TQWidgetFactory::addWidgetFactory( new MyWidgetFactory );
+ \endcode
+ where MyWidgetFactory is your TQWidgetFactory subclass.
+
+ \endlist
+*/
+
+TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *tqparent,
+ const char *name ) const
+{
+ // create widgets we know
+ if ( className == "TQPushButton" ) {
+ return new TQPushButton( tqparent, name );
+ } else if ( className == "TQToolButton" ) {
+ return new TQToolButton( tqparent, name );
+ } else if ( className == "TQCheckBox" ) {
+ return new TQCheckBox( tqparent, name );
+ } else if ( className == "TQRadioButton" ) {
+ return new TQRadioButton( tqparent, name );
+ } else if ( className == "TQGroupBox" ) {
+ return new TQGroupBox( tqparent, name );
+ } else if ( className == "TQButtonGroup" ) {
+ return new TQButtonGroup( tqparent, name );
+ } else if ( className == "TQIconView" ) {
+#if !defined(TQT_NO_ICONVIEW)
+ return new TQIconView( tqparent, name );
+#endif
+ } else if ( className == "TQTable" ) {
+#if !defined(TQT_NO_TABLE)
+ return new TQTable( tqparent, name );
+#endif
+ } else if ( className == "TQListBox" ) {
+ return new TQListBox( tqparent, name );
+ } else if ( className == "TQListView" ) {
+ return new TQListView( tqparent, name );
+ } else if ( className == "TQLineEdit" ) {
+ return new TQLineEdit( tqparent, name );
+ } else if ( className == "TQSpinBox" ) {
+ return new TQSpinBox( tqparent, name );
+ } else if ( className == "TQMultiLineEdit" ) {
+ return new TQMultiLineEdit( tqparent, name );
+ } else if ( className == "TQLabel" || className == "TextLabel" || className == "PixmapLabel" ) {
+ return new TQLabel( tqparent, name );
+ } else if ( className == "TQLayoutWidget" ) {
+ return new TQWidget( tqparent, name );
+ } else if ( className == "TQTabWidget" ) {
+ return new TQTabWidget( tqparent, name );
+ } else if ( className == "TQComboBox" ) {
+ return new TQComboBox( FALSE, tqparent, name );
+ } else if ( className == "TQWidget" ) {
+ if ( !qwf_stays_on_top )
+ return new TQWidget( tqparent, name );
+ return new TQWidget( tqparent, name, TQt::WStyle_StaysOnTop );
+ } else if ( className == "TQDialog" ) {
+ if ( !qwf_stays_on_top )
+ return new TQDialog( tqparent, name );
+ return new TQDialog( tqparent, name, FALSE, (WFlags)TQt::WStyle_StaysOnTop );
+ } else if ( className == "TQWizard" ) {
+ return new TQWizard( tqparent, name );
+ } else if ( className == "TQLCDNumber" ) {
+ return new TQLCDNumber( tqparent, name );
+ } else if ( className == "TQProgressBar" ) {
+ return new TQProgressBar( tqparent, name );
+ } else if ( className == "TQTextView" ) {
+ return new TQTextView( tqparent, name );
+ } else if ( className == "TQTextBrowser" ) {
+ return new TQTextBrowser( tqparent, name );
+ } else if ( className == "TQDial" ) {
+ return new TQDial( tqparent, name );
+ } else if ( className == "TQSlider" ) {
+ return new TQSlider( tqparent, name );
+ } else if ( className == "TQFrame" ) {
+ return new TQFrame( tqparent, name );
+ } else if ( className == "TQSplitter" ) {
+ return new TQSplitter( tqparent, name );
+ } else if ( className == "Line" ) {
+ TQFrame *f = new TQFrame( tqparent, name );
+ f->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
+ return f;
+ } else if ( className == "TQTextEdit" ) {
+ return new TQTextEdit( tqparent, name );
+ } else if ( className == "TQDateEdit" ) {
+ return new TQDateEdit( tqparent, name );
+ } else if ( className == "TQTimeEdit" ) {
+ return new TQTimeEdit( tqparent, name );
+ } else if ( className == "TQDateTimeEdit" ) {
+ return new TQDateTimeEdit( tqparent, name );
+ } else if ( className == "TQScrollBar" ) {
+ return new TQScrollBar( tqparent, name );
+ } else if ( className == "TQPopupMenu" ) {
+ return new TQPopupMenu( tqparent, name );
+ } else if ( className == "TQWidgetStack" ) {
+ return new TQWidgetStack( tqparent, name );
+ } else if ( className == "TQToolBox" ) {
+ return new TQToolBox( tqparent, name );
+ } else if ( className == "TQVBox" ) {
+ return new TQVBox( tqparent, name );
+ } else if ( className == "TQHBox" ) {
+ return new TQHBox( tqparent, name );
+ } else if ( className == "TQGrid" ) {
+ return new TQGrid( 4, tqparent, name );
+ } else if ( className == "TQMainWindow" ) {
+ TQMainWindow *mw = 0;
+ if ( !qwf_stays_on_top )
+ mw = new TQMainWindow( tqparent, name );
+ else
+ mw = new TQMainWindow( tqparent, name, (WFlags)(TQt::WType_TopLevel | TQt::WStyle_StaysOnTop) );
+ mw->setCentralWidget( new TQWidget( mw, "qt_central_widget" ) );
+ mw->centralWidget()->show();
+ (void)mw->statusBar();
+ return mw;
+
+ }
+#if !defined(TQT_NO_SQL)
+ else if ( className == "TQDataTable" ) {
+ return new TQDataTable( tqparent, name );
+ } else if ( className == "TQDataBrowser" ) {
+ return new TQDesignerDataBrowser2( tqparent, name );
+ } else if ( className == "TQDataView" ) {
+ return new TQDesignerDataView2( tqparent, name );
+ }
+#endif
+
+ setupPluginDir();
+ // try to create it using the loaded widget plugins
+ if ( !widgetInterfaceManager )
+ widgetInterfaceManager =
+ new TQPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(),
+ *qwf_plugin_dir );
+
+ TQInterfacePtr<WidgetInterface> iface = 0;
+ widgetInterfaceManager->queryInterface( className, &iface );
+ if ( iface ) {
+ TQWidget *w = iface->create( className, tqparent, name );
+ if ( w ) {
+ d->customWidgets.tqreplace( className.latin1(), new bool(TRUE) );
+ return w;
+ }
+ }
+
+ // hope we have a factory which can do it
+ for ( TQWidgetFactory* f = widgetFactories.first(); f; f = widgetFactories.next() ) {
+ TQWidget *w = f->createWidget( className, tqparent, name );
+ if ( w )
+ return w;
+ }
+
+ // no success
+ return 0;
+}
+
+/*! Returns the names of the widgets this factory can create. */
+
+TQStringList TQWidgetFactory::widgets()
+{
+ setupWidgetListAndMap();
+ return *availableWidgetList;
+}
+
+/*! Returns TRUE if the widget factory can create the specified \a widget;
+otherwise returns FALSE. */
+
+bool TQWidgetFactory::supportsWidget( const TQString &widget )
+{
+ setupWidgetListAndMap();
+ return ( availableWidgetMap->tqfind( widget ) != availableWidgetMap->end() );
+}
+
+TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget *tqparent,
+ TQLayout* tqlayout, const TQString &classNameArg )
+{
+ d->lastItem = 0;
+ TQDomElement n = e.firstChild().toElement();
+ TQWidget *w = 0; // the widget that got created
+ TQObject *obj = 0; // gets the properties
+
+ TQString className = classNameArg;
+
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+
+ bool isTQLayoutWidget = FALSE;
+
+ if ( !className.isEmpty() ) {
+ if ( !tqlayout && className == "TQLayoutWidget" ) {
+ className = "TQWidget";
+ isTQLayoutWidget = TRUE;
+ }
+ if ( tqlayout && className == "TQLayoutWidget" ) {
+ // hide tqlayout widgets
+ w = tqparent;
+ } else {
+ obj = TQT_TQOBJECT(TQWidgetFactory::createWidget( className, tqparent, 0 ));
+ if ( !obj )
+ return 0;
+ w = (TQWidget*)obj;
+ if ( !toplevel )
+ toplevel = w;
+ if ( w->inherits( "TQMainWindow" ) )
+ w = ( (TQMainWindow*)w )->centralWidget();
+ if ( tqlayout ) {
+ switch( layoutType( tqlayout ) ) {
+ case HBox:
+ ( (TQHBoxLayout*)tqlayout )->addWidget( w );
+ break;
+ case VBox:
+ ( (TQVBoxLayout*)tqlayout )->addWidget( w );
+ break;
+ case Grid:
+ ( (TQGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1,
+ col, col + colspan - 1 );
+ break;
+ default:
+ break;
+ }
+ }
+
+ tqlayout = 0;
+ }
+ }
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ TQString parentClassName = tqparent ? tqparent->className() : 0;
+ bool isPlugin = tqparent ? !!d->customWidgets.tqfind( tqparent->className() ) : FALSE;
+ if ( isPlugin )
+ qWarning( "####### loading custom container widgets without page support not implemented!" );
+ // ### TODO loading for custom container widgets without pages
+#endif
+
+ int idx = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "spacer" ) {
+ createSpacer( n, tqlayout );
+ } else if ( n.tagName() == "widget" ) {
+ TQMap< TQString, TQString> *oldDbControls = dbControls;
+ createWidgetInternal( n, w, tqlayout, n.attribute( "class", "TQWidget" ) );
+ dbControls = oldDbControls;
+ } else if ( n.tagName() == "hbox" ) {
+ TQLayout *parentLayout = tqlayout;
+ if ( tqlayout && tqlayout->inherits( "TQGridLayout" ) )
+ tqlayout = createLayout( 0, 0, TQWidgetFactory::HBox, isTQLayoutWidget );
+ else
+ tqlayout = createLayout( w, tqlayout, TQWidgetFactory::HBox, isTQLayoutWidget );
+ obj = TQT_TQOBJECT(tqlayout);
+ n = n.firstChild().toElement();
+ if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
+ ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row,
+ row + rowspan - 1, col, col + colspan - 1 );
+ continue;
+ } else if ( n.tagName() == "grid" ) {
+ TQLayout *parentLayout = tqlayout;
+ if ( tqlayout && tqlayout->inherits( "TQGridLayout" ) )
+ tqlayout = createLayout( 0, 0, TQWidgetFactory::Grid, isTQLayoutWidget );
+ else
+ tqlayout = createLayout( w, tqlayout, TQWidgetFactory::Grid, isTQLayoutWidget );
+ obj = TQT_TQOBJECT(tqlayout);
+ n = n.firstChild().toElement();
+ if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
+ ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row,
+ row + rowspan - 1, col, col + colspan - 1 );
+ continue;
+ } else if ( n.tagName() == "vbox" ) {
+ TQLayout *parentLayout = tqlayout;
+ if ( tqlayout && tqlayout->inherits( "TQGridLayout" ) )
+ tqlayout = createLayout( 0, 0, TQWidgetFactory::VBox, isTQLayoutWidget );
+ else
+ tqlayout = createLayout( w, tqlayout, TQWidgetFactory::VBox, isTQLayoutWidget );
+ obj = TQT_TQOBJECT(tqlayout);
+ n = n.firstChild().toElement();
+ if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
+ ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row,
+ row + rowspan - 1, col, col + colspan - 1 );
+ continue;
+ } else if ( n.tagName() == "property" && obj ) {
+ setProperty( obj, n.attribute( "name" ), n.firstChild().toElement() );
+ } else if ( n.tagName() == "attribute" && w ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( tqparent ) {
+ if ( tqparent->inherits( "TQTabWidget" ) ) {
+ if ( attrib == "title" )
+ ( (TQTabWidget*)tqparent )->insertTab( w, translate( v.toString() ) );
+ } else if ( tqparent->inherits( "TQWidgetStack" ) ) {
+ if ( attrib == "id" )
+ ( (TQWidgetStack*)tqparent )->addWidget( w, v.toInt() );
+ } else if ( tqparent->inherits( "TQToolBox" ) ) {
+ if ( attrib == "label" )
+ ( (TQToolBox*)tqparent )->addItem( w, v.toString() );
+ } else if ( tqparent->inherits( "TQWizard" ) ) {
+ if ( attrib == "title" )
+ ( (TQWizard*)tqparent )->addPage( w, translate( v.toString() ) );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( isPlugin ) {
+ if ( attrib == "label" ) {
+ WidgetInterface *iface = 0;
+ widgetInterfaceManager->queryInterface( parentClassName, &iface );
+ if ( iface ) {
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer,
+ (TQUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ iface2->insertPage( parentClassName,
+ (TQWidget*)tqparent, translate( v.toString() ), -1, w );
+ iface2->release();
+ }
+ iface->release();
+ }
+ }
+#endif
+ }
+ }
+ } else if ( n.tagName() == "item" ) {
+ createItem( n, w );
+ } else if ( n.tagName() == "column" || n.tagName() == "row" ) {
+ createColumn( n, w );
+ }
+
+ n = n.nextSibling().toElement();
+ idx++;
+ }
+
+ return w;
+}
+
+TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* tqlayout,
+ LayoutType type, bool isTQLayoutWidget )
+{
+ int spacing = defSpacing;
+ int margin = defMargin;
+
+ if ( tqlayout || !widget || isTQLayoutWidget )
+ margin = 0;
+
+ if ( !tqlayout && widget && widget->inherits( "TQTabWidget" ) )
+ widget = ((TQTabWidget*)widget)->currentPage();
+
+ if ( !tqlayout && widget && widget->inherits( "TQWizard" ) )
+ widget = ((TQWizard*)widget)->currentPage();
+
+ if ( !tqlayout && widget && widget->inherits( "TQWidgetStack" ) )
+ widget = ((TQWidgetStack*)widget)->visibleWidget();
+
+ if ( !tqlayout && widget && widget->inherits( "TQToolBox" ) )
+ widget = ((TQToolBox*)widget)->currentItem();
+
+ TQLayout *l = 0;
+ int align = 0;
+ if ( !tqlayout && widget && widget->inherits( "TQGroupBox" ) ) {
+ TQGroupBox *gb = (TQGroupBox*)widget;
+ gb->setColumnLayout( 0, Qt::Vertical );
+ tqlayout = gb->tqlayout();
+ tqlayout->setMargin( 0 );
+ tqlayout->setSpacing( 0 );
+ align = TQt::AlignTop;
+ }
+ if ( tqlayout ) {
+ switch ( type ) {
+ case HBox:
+ l = new TQHBoxLayout( tqlayout );
+ break;
+ case VBox:
+ l = new TQVBoxLayout( tqlayout );
+ break;
+ case Grid:
+ l = TQT_TQLAYOUT(new TQGridLayout( tqlayout ));
+ break;
+ default:
+ return 0;
+ }
+ } else {
+ switch ( type ) {
+ case HBox:
+ l = new TQHBoxLayout( widget );
+ break;
+ case VBox:
+ l = new TQVBoxLayout( widget );
+ break;
+ case Grid:
+ l = TQT_TQLAYOUT(new TQGridLayout( widget ));
+ break;
+ default:
+ return 0;
+ }
+ }
+ l->setAlignment( (Qt::AlignmentFlag)align );
+ l->setMargin( margin );
+ l->setSpacing( spacing );
+ return l;
+}
+
+TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *tqlayout ) const
+{
+ if ( tqlayout->inherits( "TQHBoxLayout" ) )
+ return HBox;
+ else if ( tqlayout->inherits( "TQVBoxLayout" ) )
+ return VBox;
+ else if ( tqlayout->inherits( "TQGridLayout" ) )
+ return Grid;
+ return NoLayout;
+}
+
+void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop,
+ TQVariant value )
+{
+ int offset = obj->tqmetaObject()->tqfindProperty( prop, TRUE );
+
+ if ( offset != -1 ) {
+ if ( prop == "geometry" && TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(toplevel) ) {
+ toplevel->resize( value.toRect().size() );
+ } else if ( prop == "accel" ) {
+ obj->setProperty( prop, TQVariant(value.toKeySequence()) );
+ } else {
+ if ( value.type() == TQVariant::String ||
+ value.type() == TQVariant::CString ) {
+ const TQMetaProperty *metaProp =
+ obj->tqmetaObject()->property( offset, TRUE );
+ if ( metaProp != 0 && metaProp->isEnumType() ) {
+ if ( metaProp->isSetType() ) {
+ TQStrList flagsCStr;
+ TQStringList flagsStr =
+ TQStringList::split( '|', value.asString() );
+ TQStringList::ConstIterator f = flagsStr.begin();
+ while ( f != flagsStr.end() ) {
+ flagsCStr.append( *f );
+ ++f;
+ }
+ value = TQVariant( metaProp->keysToValue(flagsCStr) );
+ } else {
+ TQCString key = value.toCString();
+ value = TQVariant( metaProp->keyToValue(key) );
+ }
+ }
+ }
+ obj->setProperty( prop, value );
+ }
+ } else {
+ if ( obj->isWidgetType() ) {
+ if ( prop == "toolTip" ) {
+ if ( !value.toString().isEmpty() )
+ TQToolTip::add( (TQWidget*)obj, translate( value.toString() ) );
+ } else if ( prop == "whatsThis" ) {
+ if ( !value.toString().isEmpty() )
+ TQWhatsThis::add( (TQWidget*)obj, translate( value.toString() ) );
+ } else if ( prop == "buddy" ) {
+ buddies.insert( obj->name(), value.toCString() );
+ } else if ( prop == "buttonGroupId" ) {
+ if ( obj->inherits( "TQButton" ) && obj->tqparent()->inherits( "TQButtonGroup" ) )
+ ( (TQButtonGroup*)obj->tqparent() )->insert( (TQButton*)obj, value.toInt() );
+#ifndef TQT_NO_SQL
+ } else if ( prop == "database" && !obj->inherits( "TQDataView" )
+ && !obj->inherits( "TQDataBrowser" ) ) {
+ const TQStringList& lst = value.asStringList();
+ if ( lst.count() > 2 ) {
+ if ( dbControls )
+ dbControls->insert( obj->name(), lst[ 2 ] );
+ } else if ( lst.count() == 2 ) {
+ dbTables.insert( obj->name(), lst );
+ }
+ } else if ( prop == "database" ) {
+ const TQStringList& lst = value.asStringList();
+ if ( lst.count() == 2 && obj->inherits( "TQWidget" ) ) {
+ SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] );
+ sqlWidgetConnections.insert( (TQWidget*)obj, conn );
+ dbControls = conn.dbControls;
+ }
+#endif
+ } else if ( prop == "frameworkCode" ) {
+ if ( value.isValid() && !value.toBool() )
+ noDatabaseWidgets << obj->name();
+ }
+ }
+ }
+}
+
+void TQWidgetFactory::setProperty( TQObject* widget, const TQString &prop, const TQDomElement &e )
+{
+ TQString comment;
+ TQVariant value( DomTool::elementToVariant( e, TQVariant(), comment ) );
+
+ if ( e.tagName() == "string" ) {
+ value = translate( value.asString(), comment );
+ } else if ( e.tagName() == "pixmap" ) {
+ TQPixmap pix = loadPixmap( value.toString() );
+ if ( !pix.isNull() )
+ value = pix;
+ } else if ( e.tagName() == "iconset" ) {
+ TQPixmap pix = loadPixmap( value.toString() );
+ if ( !pix.isNull() )
+ value = TQIconSet( pix );
+ } else if ( e.tagName() == "image" ) {
+ value = loadFromCollection( value.toString() );
+ } else if ( e.tagName() == "palette" ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPalette p;
+ while ( !n.isNull() ) {
+ TQColorGroup cg;
+ if ( n.tagName() == "active" ) {
+ cg = loadColorGroup( n );
+ p.setActive( cg );
+ } else if ( n.tagName() == "inactive" ) {
+ cg = loadColorGroup( n );
+ p.setInactive( cg );
+ } else if ( n.tagName() == "disabled" ) {
+ cg = loadColorGroup( n );
+ p.setDisabled( cg );
+ }
+ n = n.nextSibling().toElement();
+ }
+ value = p;
+ }
+ setProperty( widget, prop, value );
+}
+
+void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout )
+{
+ TQDomElement n = e.firstChild().toElement();
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+
+ Qt::Orientation orient = Qt::Horizontal;
+ int w = 0, h = 0;
+ TQSizePolicy::SizeType sizeType = TQSizePolicy::Preferred;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString prop = n.attribute( "name" );
+ if ( prop == "orientation" ) {
+ if ( n.firstChild().firstChild().toText().data() == "Horizontal" )
+ orient = Qt::Horizontal;
+ else
+ orient = Qt::Vertical;
+ } else if ( prop == "sizeType" ) {
+ sizeType = stringToSizeType( n.firstChild().firstChild().toText().data() );
+ } else if ( prop == "tqsizeHint" ) {
+ w = n.firstChild().firstChild().firstChild().toText().data().toInt();
+ h = n.firstChild().firstChild().nextSibling().firstChild().toText().data().toInt();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+ TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum,
+ orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum );
+ if ( tqlayout ) {
+ if ( tqlayout->inherits( "TQBoxLayout" ) )
+ ( (TQBoxLayout*)tqlayout )->addItem( TQT_TQLAYOUTITEM(item) );
+ else
+ ( (TQGridLayout*)tqlayout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1,
+ orient == Qt::Horizontal ? Qt::AlignVCenter : Qt::AlignHCenter );
+ }
+}
+
+static TQImage loadImageData( TQDomElement &n2 )
+{
+ TQString format = n2.attribute( "format", "PNG" );
+ TQString hex = n2.firstChild().toText().data();
+ int n = hex.length() / 2;
+ TQByteArray data( n );
+ for ( int i = 0; i < n; i++ )
+ data[i] = (char) hex.mid( 2 * i, 2 ).toUInt( 0, 16 );
+ return loadImageData( format, n2.attribute("length").toULong(), data );
+}
+
+void TQWidgetFactory::loadImageCollection( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "image" ) {
+ Image img;
+ img.name = n.attribute( "name" );
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "data" )
+ img.img = loadImageData( n2 );
+ n2 = n2.nextSibling().toElement();
+ }
+ images.append( img );
+ n = n.nextSibling().toElement();
+ }
+ }
+}
+
+TQImage TQWidgetFactory::loadFromCollection( const TQString &name )
+{
+ TQValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ if ( ( *it ).name == name )
+ return ( *it ).img;
+ }
+ return TQImage();
+}
+
+TQPixmap TQWidgetFactory::loadPixmap( const TQString& name )
+{
+ TQPixmap pix;
+ if ( usePixmapCollection ) {
+ const TQMimeSource *m = TQT_TQMIMESOURCE_CONST(TQMimeSourceFactory::defaultFactory()->data( name ));
+ if ( m )
+ TQImageDrag::decode( m, pix );
+ } else {
+ pix.convertFromImage( loadFromCollection(name) );
+ }
+ return pix;
+}
+
+TQPixmap TQWidgetFactory::loadPixmap( const TQDomElement &e )
+{
+ return loadPixmap( e.firstChild().toText().data() );
+}
+
+TQColorGroup TQWidgetFactory::loadColorGroup( const TQDomElement &e )
+{
+ TQColorGroup cg;
+ int r = -1;
+ TQDomElement n = e.firstChild().toElement();
+ TQColor col;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "color" ) {
+ r++;
+ cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ } else if ( n.tagName() == "pixmap" ) {
+ TQPixmap pix = loadPixmap( n );
+ cg.setBrush( (TQColorGroup::ColorRole)r, TQBrush( col, pix ) );
+ }
+ n = n.nextSibling().toElement();
+ }
+ return cg;
+}
+
+struct Connection
+{
+ TQObject *sender, *receiver;
+ TQCString signal, slot;
+ bool operator==( const Connection &c ) const {
+ return sender == c.sender && receiver == c.receiver &&
+ signal == c.signal && slot == c.slot ;
+ }
+
+ Connection() : sender( 0 ), receiver( 0 ) { }
+};
+
+class NormalizeObject : public TQObject
+{
+public:
+ NormalizeObject() : TQObject() {}
+ static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); }
+};
+
+void TQWidgetFactory::loadConnections( const TQDomElement &e, TQObject *connector )
+{
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "connection" ) {
+ TQString lang = n.attribute( "language", "C++" );
+ TQDomElement n2 = n.firstChild().toElement();
+ Connection conn;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "sender" ) {
+ TQString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.sender = TQT_TQOBJECT(toplevel);
+ } else {
+ if ( name == "this" )
+ name = toplevel->name();
+ TQObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.sender = l->first();
+ delete l;
+ }
+ }
+ if ( !conn.sender )
+ conn.sender = tqfindAction( name );
+ } else if ( n2.tagName() == "signal" ) {
+ conn.signal = n2.firstChild().toText().data();
+ } else if ( n2.tagName() == "receiver" ) {
+ TQString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.receiver = TQT_TQOBJECT(toplevel);
+ } else {
+ TQObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.receiver = l->first();
+ delete l;
+ }
+ }
+ } else if ( n2.tagName() == "slot" ) {
+ conn.slot = n2.firstChild().toText().data();
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+
+ conn.signal = NormalizeObject::normalizeSignalSlot( conn.signal );
+ conn.slot = NormalizeObject::normalizeSignalSlot( conn.slot );
+
+ if ( !conn.sender || !conn.receiver ) {
+ n = n.nextSibling().toElement();
+ continue;
+ }
+
+ TQObject *sender = 0, *receiver = 0;
+ TQObjectList *l = toplevel->queryList( 0, conn.sender->name(), FALSE );
+ if ( qstrcmp( conn.sender->name(), toplevel->name() ) == 0 ) {
+ sender = TQT_TQOBJECT(toplevel);
+ } else {
+ if ( !l || !l->first() ) {
+ delete l;
+ n = n.nextSibling().toElement();
+ continue;
+ }
+ sender = l->first();
+ delete l;
+ }
+ if ( !sender )
+ sender = tqfindAction( conn.sender->name() );
+
+ if ( qstrcmp( conn.receiver->name(), toplevel->name() ) == 0 ) {
+ receiver = TQT_TQOBJECT(toplevel);
+ } else {
+ l = toplevel->queryList( 0, conn.receiver->name(), FALSE );
+ if ( !l || !l->first() ) {
+ delete l;
+ n = n.nextSibling().toElement();
+ continue;
+ }
+ receiver = l->first();
+ delete l;
+ }
+
+ TQString s = "2""%1";
+ s = s.arg( TQT_TQSTRING(conn.signal) );
+ TQString s2 = "1""%1";
+ s2 = s2.arg( TQT_TQSTRING(conn.slot) );
+
+ TQStrList signalList = sender->tqmetaObject()->signalNames( TRUE );
+ TQStrList slotList = receiver->tqmetaObject()->slotNames( TRUE );
+
+ // if this is a connection to a custom slot and we have a connector, try this as receiver
+ if ( slotList.tqfind( conn.slot ) == -1 && TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(toplevel) && connector ) {
+ slotList = connector->tqmetaObject()->slotNames( TRUE );
+ receiver = connector;
+ }
+
+ // avoid warnings
+ if ( signalList.tqfind( conn.signal ) == -1 ||
+ slotList.tqfind( conn.slot ) == -1 ) {
+ n = n.nextSibling().toElement();
+ continue;
+ }
+ TQObject::connect( sender, s, receiver, s2 );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void TQWidgetFactory::loadTabOrder( const TQDomElement &e )
+{
+ TQWidget *last = 0;
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "tabstop" ) {
+ TQString name = n.firstChild().toText().data();
+ TQObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() ) {
+ TQWidget *w = (TQWidget*)l->first();
+ if ( last )
+ toplevel->setTabOrder( last, w );
+ last = w;
+ }
+ delete l;
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void TQWidgetFactory::createListViewColumn( TQListView *lv, const TQString& txt,
+ const TQPixmap& pix, bool clickable,
+ bool resizable )
+{
+ if ( pix.isNull() ) {
+ lv->addColumn( txt );
+ } else {
+ lv->addColumn( pix, txt );
+ }
+
+ int i = lv->header()->count() - 1;
+ if ( !pix.isNull() )
+ lv->header()->setLabel( i, pix, txt );
+ if ( !clickable )
+ lv->header()->setClickEnabled( clickable, i );
+ if ( !resizable )
+ lv->header()->setResizeEnabled( resizable, i );
+}
+
+#ifndef TQT_NO_TABLE
+void TQWidgetFactory::createTableColumnOrRow( TQTable *table, const TQString& txt,
+ const TQPixmap& pix,
+ const TQString& field, bool isRow )
+{
+#ifndef TQT_NO_SQL
+ bool isSql = table->inherits( "TQDataTable" );
+#endif
+ if ( isRow )
+ table->setNumRows( table->numRows() + 1 );
+ else {
+#ifndef TQT_NO_SQL
+ if ( !isSql )
+#endif
+ table->setNumCols( table->numCols() + 1 );
+ }
+
+ TQValueList<Field> fieldMap;
+ if ( fieldMaps.tqfind( table ) != fieldMaps.end() ) {
+ fieldMap = *fieldMaps.tqfind( table );
+ fieldMaps.remove( table );
+ }
+
+ int i = isRow ? table->numRows() - 1 : table->numCols() - 1;
+ TQHeader *h = !isRow ? table->horizontalHeader() : table->verticalHeader();
+ if ( !pix.isNull() ) {
+#ifndef TQT_NO_SQL
+ if ( isSql )
+ ((TQDataTable*)table)->addColumn( field, txt, -1, pix );
+ else
+#endif
+ h->setLabel( i, pix, txt );
+ } else {
+#ifndef TQT_NO_SQL
+ if ( isSql )
+ ((TQDataTable*)table)->addColumn( field, txt );
+ else
+#endif
+ h->setLabel( i, txt );
+ }
+ if ( !isRow && !field.isEmpty() ) {
+ fieldMap.append( Field( txt, pix, field ) );
+ fieldMaps.insert( table, fieldMap );
+ }
+
+}
+#endif
+
+void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget )
+{
+ if ( widget->inherits( "TQListView" ) && e.tagName() == "column" ) {
+ TQListView *lv = (TQListView*)widget;
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ TQString txt;
+ bool clickable = TRUE, resizable = TRUE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ txt = translate( v.toString() );
+ else if ( attrib == "pixmap" )
+ pix = loadPixmap( n.firstChild().toElement().toElement() );
+ else if ( attrib == "clickable" )
+ clickable = v.toBool();
+ else if ( attrib == "resizable" || attrib == "resizeable" )
+ resizable = v.toBool();
+ }
+ n = n.nextSibling().toElement();
+ }
+ createListViewColumn( lv, txt, pix, clickable, resizable );
+ }
+#ifndef TQT_NO_TABLE
+ else if ( widget->inherits( "TQTable" ) ) {
+ TQTable *table = (TQTable*)widget;
+
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ TQString txt;
+ TQString field;
+
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ txt = translate( v.toString() );
+ else if ( attrib == "pixmap" ) {
+ if ( !n.firstChild().firstChild().toText().data().isEmpty() )
+ pix = loadPixmap( n.firstChild().toElement().toElement() );
+ } else if ( attrib == "field" )
+ field = translate( v.toString() );
+ }
+ n = n.nextSibling().toElement();
+ }
+ createTableColumnOrRow( table, txt, pix, field, e.tagName() == "row" );
+ }
+#endif
+}
+
+void TQWidgetFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bool &hasPixmap )
+{
+ TQDomElement n = e;
+ hasPixmap = FALSE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ txt = translate( v.toString() );
+ else if ( attrib == "pixmap" ) {
+ pix = loadPixmap( n.firstChild().toElement() );
+ hasPixmap = !pix.isNull();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i )
+{
+ if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ bool hasPixmap = FALSE;
+ TQString txt;
+ loadItem( n, pix, txt, hasPixmap );
+ TQListBox *lb = 0;
+ if ( widget->inherits( "TQListBox" ) ) {
+ lb = (TQListBox*)widget;
+ } else {
+ TQComboBox *cb = (TQComboBox*)widget;
+ lb = cb->listBox();
+ if (!lb) {
+ lb = new TQListBox(cb);
+ cb->setListBox(lb);
+ }
+ }
+ if ( hasPixmap ) {
+ new TQListBoxPixmap( lb, pix, txt );
+ } else {
+ new TQListBoxText( lb, txt );
+ }
+#ifndef TQT_NO_ICONVIEW
+ } else if ( widget->inherits( "TQIconView" ) ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ bool hasPixmap = FALSE;
+ TQString txt;
+ loadItem( n, pix, txt, hasPixmap );
+
+ TQIconView *iv = (TQIconView*)widget;
+ new TQIconViewItem( iv, txt, pix );
+#endif
+ } else if ( widget->inherits( "TQListView" ) ) {
+ TQDomElement n = e.firstChild().toElement();
+ TQPixmap pix;
+ TQValueList<TQPixmap> pixmaps;
+ TQStringList textes;
+ TQListViewItem *item = 0;
+ TQListView *lv = (TQListView*)widget;
+ if ( i )
+ item = new TQListViewItem( i, d->lastItem );
+ else
+ item = new TQListViewItem( lv, d->lastItem );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ TQString attrib = n.attribute( "name" );
+ TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ if ( attrib == "text" )
+ textes << translate( v.toString() );
+ else if ( attrib == "pixmap" ) {
+ TQString s = v.toString();
+ if ( s.isEmpty() ) {
+ pixmaps << TQPixmap();
+ } else {
+ pix = loadPixmap( n.firstChild().toElement() );
+ pixmaps << pix;
+ }
+ }
+ } else if ( n.tagName() == "item" ) {
+ item->setOpen( TRUE );
+ createItem( n, widget, item );
+ }
+
+ n = n.nextSibling().toElement();
+ }
+
+ for ( int i = 0; i < lv->columns(); ++i ) {
+ item->setText( i, textes[ i ] );
+ item->setPixmap( i, pixmaps[ i ] );
+ }
+ d->lastItem = item;
+ }
+}
+
+
+
+void TQWidgetFactory::loadChildAction( TQObject *tqparent, const TQDomElement &e )
+{
+ TQDomElement n = e;
+ TQAction *a = 0;
+ bool hasMenuText = FALSE;
+ if ( n.tagName() == "action" ) {
+ a = new TQAction( tqparent );
+ TQDomElement n2 = n.firstChild().toElement();
+
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ TQString prop(n2.attribute("name"));
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ setProperty( a, prop, n2.firstChild().toElement() );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !tqparent->inherits( "TQAction" ) )
+ actionList.append( a );
+ } else if ( n.tagName() == "actiongroup" ) {
+ a = new TQActionGroup( tqparent );
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ TQString prop(n2.attribute("name"));
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ setProperty( a, prop, n2.firstChild().toElement() );
+ } else if ( n2.tagName() == "action" ||
+ n2.tagName() == "actiongroup" ) {
+ loadChildAction( a, n2 );
+
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !tqparent->inherits( "TQAction" ) )
+ actionList.append( a );
+ }
+
+ if (a && !hasMenuText && !a->text().isEmpty() && uiFileVersion < "3.3")
+ a->setMenuText(a->text());
+}
+
+void TQWidgetFactory::loadActions( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" ) {
+ loadChildAction( TQT_TQOBJECT(toplevel), n );
+ } else if ( n.tagName() == "actiongroup" ) {
+ loadChildAction( TQT_TQOBJECT(toplevel), n );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void TQWidgetFactory::loadToolBars( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ TQMainWindow *mw = ( (TQMainWindow*)toplevel );
+ TQToolBar *tb = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "toolbar" ) {
+ TQt::TQt::Dock dock = (TQt::TQt::Dock)n.attribute( "dock" ).toInt();
+ tb = new TQToolBar( TQString(), mw, dock );
+ tb->setLabel( n.attribute( "label" ) );
+ tb->setName( n.attribute( "name" ) );
+ TQDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "action" ) {
+ TQAction *a = tqfindAction( n2.attribute( "name" ) );
+ if ( a )
+ a->addTo( tb );
+ } else if ( n2.tagName() == "separator" ) {
+ tb->addSeparator();
+ } else if ( n2.tagName() == "widget" ) {
+ (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", "TQWidget" ) );
+ } else if ( n2.tagName() == "property" ) {
+ setProperty( TQT_TQOBJECT(tb), n2.attribute( "name" ), n2.firstChild().toElement() );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void TQWidgetFactory::loadMenuBar( const TQDomElement &e )
+{
+ TQDomElement n = e.firstChild().toElement();
+ TQMainWindow *mw = ( (TQMainWindow*)toplevel );
+ TQMenuBar *mb = mw->menuBar();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "item" ) {
+ TQPopupMenu *popup = new TQPopupMenu( mw );
+ loadPopupMenu( popup, n );
+ popup->setName( n.attribute( "name" ) );
+ mb->insertItem( translate( n.attribute( "text" ) ), popup );
+ } else if ( n.tagName() == "property" ) {
+ setProperty( TQT_TQOBJECT(mb), n.attribute( "name" ), n.firstChild().toElement() );
+ } else if ( n.tagName() == "separator" ) {
+ mb->insertSeparator();
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void TQWidgetFactory::loadPopupMenu( TQPopupMenu *p, const TQDomElement &e )
+{
+ TQMainWindow *mw = ( (TQMainWindow*)toplevel );
+ TQDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) {
+ TQAction *a = tqfindAction( n.attribute( "name" ) );
+ TQDomElement n2 = n.nextSibling().toElement();
+ if ( n2.tagName() == "item") { // load submenu
+ TQPopupMenu *popup = new TQPopupMenu( mw );
+ popup->setName( n2.attribute( "name" ) );
+ if ( a ) {
+ p->setAccel( a->accel(), p->insertItem( a->iconSet(),
+ translate( n2.attribute( "text" ).utf8().data() ),
+ popup ) );
+ } else {
+ p->insertItem( translate( n2.attribute( "text" ).utf8().data() ), popup );
+ }
+ loadPopupMenu( popup, n2 );
+ n = n2;
+ } else {
+ if ( a ) {
+ a->addTo( p );
+ }
+ }
+ a = 0;
+ } else if ( n.tagName() == "separator" ) {
+ p->insertSeparator();
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+// compatibility with early 3.0 betas
+// ### remove for 4.0
+void TQWidgetFactory::loadFunctions( const TQDomElement & )
+{
+}
+
+TQAction *TQWidgetFactory::tqfindAction( const TQString &name )
+{
+ for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
+ if ( TQString( a->name() ) == name )
+ return a;
+ TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" );
+ if ( ac )
+ return ac;
+ }
+ return 0;
+}
+
+/*!
+ If you use a pixmap collection (which is the default for new
+ projects) rather than saving the pixmaps within the .ui XML file,
+ you must load the pixmap collection. TQWidgetFactory looks in the
+ default TQMimeSourceFactory for the pixmaps. Either add it there
+ manually, or call this function and specify the directory where
+ the images can be found, as \a dir. This is normally the
+ directory called \c images in the project's directory.
+*/
+
+void TQWidgetFactory::loadImages( const TQString &dir )
+{
+ TQDir d( dir );
+ TQStringList l = d.entryList( TQDir::Files );
+ for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it )
+ TQMimeSourceFactory::defaultFactory()->setPixmap( *it, TQPixmap( d.path() + "/" + *it, "PNG" ) );
+
+}
+
+void TQWidgetFactory::loadExtraSource()
+{
+ if ( !qwf_language || !languageInterfaceManager )
+ return;
+ TQString lang = *qwf_language;
+ LanguageInterface *iface = 0;
+ languageInterfaceManager->queryInterface( lang, &iface );
+ if ( !iface )
+ return;
+ TQFile f( qwf_currFileName + iface->formCodeExtension() );
+ if ( f.open( IO_ReadOnly ) ) {
+ TQTextStream ts( &f );
+ code = ts.read();
+ }
+}
+
+TQString TQWidgetFactory::translate( const TQString& sourceText, const TQString& comment )
+{
+ return tqApp->translate( d->translationContext, sourceText.utf8(), comment.utf8(),
+ TQApplication::UnicodeUTF8 );
+}
+
+TQString TQWidgetFactory::translate( const char *sourceText, const char *comment )
+{
+ return tqApp->translate( d->translationContext, sourceText, comment,
+ TQApplication::UnicodeUTF8 );
+}
diff --git a/tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.h b/tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.h
new file mode 100644
index 0000000..06227a2
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uilib/tqwidgetfactory.h
@@ -0,0 +1,188 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TQWIDGETFACTORY_H
+#define TQWIDGETFACTORY_H
+
+#ifndef TQT_H
+#include <tqstring.h>
+#include <tqptrlist.h>
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
+#include <tqaction.h>
+#endif // TQT_H
+
+class TQDomDocument;
+class TQDomElement;
+class TQLayout;
+class TQListView;
+class TQListViewItem;
+class TQMenuBar;
+class TQTable;
+class TQWidget;
+class TQWidgetFactoryPrivate;
+class UibStrTable;
+
+class TQWidgetFactory
+{
+public:
+ TQWidgetFactory();
+ virtual ~TQWidgetFactory();
+
+ static TQWidget *create( const TQString &uiFile, TQObject *connector = 0, TQWidget *tqparent = 0, const char *name = 0 );
+ static TQWidget *create( TQIODevice *dev, TQObject *connector = 0, TQWidget *tqparent = 0, const char *name = 0 );
+ inline static TQWidget *create( TQFile *dev, TQObject *connector = 0, TQWidget *tqparent = 0, const char *name = 0 ) { return create(TQT_TQIODEVICE(dev), connector, tqparent, name); }
+ static void addWidgetFactory( TQWidgetFactory *factory );
+ static void loadImages( const TQString &dir );
+
+ virtual TQWidget *createWidget( const TQString &className, TQWidget *tqparent, const char *name ) const;
+ static TQStringList widgets();
+ static bool supportsWidget( const TQString &widget );
+
+private:
+ enum LayoutType { HBox, VBox, Grid, NoLayout };
+ void loadImageCollection( const TQDomElement &e );
+ void loadConnections( const TQDomElement &e, TQObject *connector );
+ void loadTabOrder( const TQDomElement &e );
+ TQWidget *createWidgetInternal( const TQDomElement &e, TQWidget *tqparent, TQLayout* tqlayout, const TQString &classNameArg );
+ TQLayout *createLayout( TQWidget *widget, TQLayout* tqlayout, LayoutType type, bool isTQLayoutWidget = FALSE );
+ LayoutType layoutType( TQLayout *l ) const;
+ void setProperty( TQObject* widget, const TQString &prop, TQVariant value );
+ void setProperty( TQObject* widget, const TQString &prop, const TQDomElement &e );
+ void createSpacer( const TQDomElement &e, TQLayout *tqlayout );
+ TQImage loadFromCollection( const TQString &name );
+ TQPixmap loadPixmap( const TQString &name );
+ TQPixmap loadPixmap( const TQDomElement &e );
+ TQColorGroup loadColorGroup( const TQDomElement &e );
+ void createListViewColumn( TQListView *lv, const TQString& txt,
+ const TQPixmap& pix, bool clickable,
+ bool resizable );
+#ifndef TQT_NO_TABLE
+ void createTableColumnOrRow( TQTable *table, const TQString& txt,
+ const TQPixmap& pix, const TQString& field,
+ bool isRow );
+#endif
+ void createColumn( const TQDomElement &e, TQWidget *widget );
+ void loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bool &hasPixmap );
+ void createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i = 0 );
+ void loadChildAction( TQObject *tqparent, const TQDomElement &e );
+ void loadActions( const TQDomElement &e );
+ void loadToolBars( const TQDomElement &e );
+ void loadMenuBar( const TQDomElement &e );
+ void loadPopupMenu( TQPopupMenu *p, const TQDomElement &e );
+ void loadFunctions( const TQDomElement &e );
+ TQAction *tqfindAction( const TQString &name );
+ void loadExtraSource();
+ TQString translate( const char *sourceText, const char *comment = "" );
+ TQString translate( const TQString& sourceText, const TQString& comment = TQString() );
+
+ void unpackUInt16( TQDataStream& in, TQ_UINT16& n );
+ void unpackUInt32( TQDataStream& in, TQ_UINT32& n );
+ void unpackByteArray( TQDataStream& in, TQByteArray& array );
+ void unpackCString( const UibStrTable& strings, TQDataStream& in,
+ TQCString& cstr );
+ void unpackString( const UibStrTable& strings, TQDataStream& in,
+ TQString& str );
+ void unpackStringSplit( const UibStrTable& strings, TQDataStream& in,
+ TQString& str );
+ void unpackVariant( const UibStrTable& strings, TQDataStream& in,
+ TQVariant& value );
+ void inputSpacer( const UibStrTable& strings, TQDataStream& in,
+ TQLayout *tqparent );
+ void inputColumnOrRow( const UibStrTable& strings, TQDataStream& in,
+ TQObject *tqparent, bool isRow );
+ void inputItem( const UibStrTable& strings, TQDataStream& in,
+ TQObject *tqparent, TQListViewItem *parentItem = 0 );
+ void inputMenuItem( TQObject **objects, const UibStrTable& strings,
+ TQDataStream& in, TQMenuBar *menuBar );
+ TQObject *inputObject( TQObject **objects, int& numObjects,
+ const UibStrTable& strings, TQDataStream& in,
+ TQWidget *ancestorWidget, TQObject *tqparent,
+ TQCString className = "" );
+ TQWidget *createFromUiFile( TQDomDocument doc, TQObject *connector,
+ TQWidget *tqparent, const char *name );
+ TQWidget *createFromUibFile( TQDataStream& in, TQObject *connector,
+ TQWidget *tqparent, const char *name );
+
+private:
+ struct Image {
+ TQImage img;
+ TQString name;
+ bool operator==( const Image &i ) const {
+ return ( i.name == name &&
+ i.img == img );
+ }
+ };
+
+ struct Field
+ {
+ Field() {}
+ Field( const TQString &s1, const TQPixmap &p, const TQString &s2 ) : name( s1 ), pix( p ), field( s2 ) {}
+ TQString name;
+ TQPixmap pix;
+ TQString field;
+ TQ_DUMMY_COMPARISON_OPERATOR( Field )
+ };
+
+ struct SqlWidgetConnection
+ {
+ SqlWidgetConnection() {}
+ SqlWidgetConnection( const TQString &c, const TQString &t )
+ : conn( c ), table( t ), dbControls( new TQMap<TQString, TQString>() ) {}
+ TQString conn;
+ TQString table;
+ TQMap<TQString, TQString> *dbControls;
+ TQ_DUMMY_COMPARISON_OPERATOR( SqlWidgetConnection )
+ };
+
+ TQValueList<Image> images;
+ TQWidget *toplevel;
+ TQWidgetFactoryPrivate *d;
+ TQMap<TQString, TQString> *dbControls;
+ TQMap<TQString, TQStringList> dbTables;
+ TQMap<TQWidget*, SqlWidgetConnection> sqlWidgetConnections;
+ TQMap<TQString, TQString> buddies;
+ TQMap<TQTable*, TQValueList<Field> > fieldMaps;
+ TQPtrList<TQAction> actionList;
+ TQMap<TQString, TQString> languageSlots;
+ TQStringList noDatabaseWidgets;
+ bool usePixmapCollection;
+ int defMargin;
+ int defSpacing;
+ TQString code;
+ TQString uiFileVersion;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/designer/uilib/uilib.pro b/tqtinterface/qt4/tools/designer/uilib/uilib.pro
new file mode 100644
index 0000000..35fff6e
--- /dev/null
+++ b/tqtinterface/qt4/tools/designer/uilib/uilib.pro
@@ -0,0 +1,30 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+win32:CONFIG += static
+win32:CONFIG -= dll
+SOURCES = tqwidgetfactory.cpp \
+ ../shared/domtool.cpp \
+ ../shared/uib.cpp
+
+HEADERS = ../shared/domtool.h \
+ ../shared/uib.h
+
+sql:SOURCES += ../designer/database.cpp
+sql:HEADERS += ../designer/database2.h
+
+DEFINES += QT_INTERNAL_XML
+!win32-borland:DEFINES += Q_TEMPLATE_EXTERN=extern
+include( ../../../src/qt_professional.pri )
+TARGET = qui
+INCLUDEPATH += ../shared
+DESTDIR = ../../../lib
+VERSION = 1.0.0
+DEFINES += RESOURCE
+
+unix {
+ target.path=$$libs.path
+
+ INSTALLS += target
+}
+
+mac:QMAKE_LFLAGS_PREBIND = -prebind -seg1addr 0xB9000000
diff --git a/tqtinterface/qt4/tools/linguist/LICENSE.GPL b/tqtinterface/qt4/tools/linguist/LICENSE.GPL
new file mode 100644
index 0000000..149f4ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/LICENSE.GPL
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which tqcontains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part tqcontains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it tqcontains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/tqtinterface/qt4/tools/linguist/book/images/doneandnext.png b/tqtinterface/qt4/tools/linguist/book/images/doneandnext.png
new file mode 100644
index 0000000..47efaec
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/doneandnext.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/editcopy.png b/tqtinterface/qt4/tools/linguist/book/images/editcopy.png
new file mode 100644
index 0000000..efe8d03
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/editcut.png b/tqtinterface/qt4/tools/linguist/book/images/editcut.png
new file mode 100644
index 0000000..146388a
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/editfind.png b/tqtinterface/qt4/tools/linguist/book/images/editfind.png
new file mode 100644
index 0000000..59c63bf
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/editfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/editpaste.png b/tqtinterface/qt4/tools/linguist/book/images/editpaste.png
new file mode 100644
index 0000000..13f9a0f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/editpaste.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/editredo.png b/tqtinterface/qt4/tools/linguist/book/images/editredo.png
new file mode 100644
index 0000000..6a30e26
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/editredo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/editundo.png b/tqtinterface/qt4/tools/linguist/book/images/editundo.png
new file mode 100644
index 0000000..38a7357
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/editundo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/fileopen.png b/tqtinterface/qt4/tools/linguist/book/images/fileopen.png
new file mode 100644
index 0000000..44107d3
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/fileprint.png b/tqtinterface/qt4/tools/linguist/book/images/fileprint.png
new file mode 100644
index 0000000..2936658
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/fileprint.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/filesave.png b/tqtinterface/qt4/tools/linguist/book/images/filesave.png
new file mode 100644
index 0000000..03e10f9
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/finddialog.png b/tqtinterface/qt4/tools/linguist/book/images/finddialog.png
new file mode 100644
index 0000000..c3b0f43
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/finddialog.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/linguist.png b/tqtinterface/qt4/tools/linguist/book/images/linguist.png
new file mode 100644
index 0000000..519c185
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/linguist.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/menubar.png b/tqtinterface/qt4/tools/linguist/book/images/menubar.png
new file mode 100644
index 0000000..7ba43c6
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/menubar.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/next.png b/tqtinterface/qt4/tools/linguist/book/images/next.png
new file mode 100644
index 0000000..7434fa2
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/next.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/nextunfinished.png b/tqtinterface/qt4/tools/linguist/book/images/nextunfinished.png
new file mode 100644
index 0000000..618fc94
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/nextunfinished.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/phrasebookdialog.png b/tqtinterface/qt4/tools/linguist/book/images/phrasebookdialog.png
new file mode 100644
index 0000000..d1a323a
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/phrasebookdialog.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/phrasebookopen.png b/tqtinterface/qt4/tools/linguist/book/images/phrasebookopen.png
new file mode 100644
index 0000000..4f76b7d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/phrasebookopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/prev.png b/tqtinterface/qt4/tools/linguist/book/images/prev.png
new file mode 100644
index 0000000..f9fbd93
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/prev.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/prevunfinished.png b/tqtinterface/qt4/tools/linguist/book/images/prevunfinished.png
new file mode 100644
index 0000000..25cc1a2
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/prevunfinished.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/toolbar.png b/tqtinterface/qt4/tools/linguist/book/images/toolbar.png
new file mode 100644
index 0000000..5e6021f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/toolbar.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt1_en.png b/tqtinterface/qt4/tools/linguist/book/images/tt1_en.png
new file mode 100644
index 0000000..66e54e0
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt1_en.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt1_la.png b/tqtinterface/qt4/tools/linguist/book/images/tt1_la.png
new file mode 100644
index 0000000..a701349
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt1_la.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt2_en.png b/tqtinterface/qt4/tools/linguist/book/images/tt2_en.png
new file mode 100644
index 0000000..c71e201
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt2_en.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt2_fr.png b/tqtinterface/qt4/tools/linguist/book/images/tt2_fr.png
new file mode 100644
index 0000000..acc2515
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt2_fr.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt2_nl.png b/tqtinterface/qt4/tools/linguist/book/images/tt2_nl.png
new file mode 100644
index 0000000..4631de2
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt2_nl.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt3_10_en.png b/tqtinterface/qt4/tools/linguist/book/images/tt3_10_en.png
new file mode 100644
index 0000000..e95bff9
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt3_10_en.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_bad.png b/tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_bad.png
new file mode 100644
index 0000000..05cb5f3
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_bad.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_good.png b/tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_good.png
new file mode 100644
index 0000000..b0f855f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt3_10_pt_good.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt3_11_about_pt.png b/tqtinterface/qt4/tools/linguist/book/images/tt3_11_about_pt.png
new file mode 100644
index 0000000..4467314
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt3_11_about_pt.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt3_11_en.png b/tqtinterface/qt4/tools/linguist/book/images/tt3_11_en.png
new file mode 100644
index 0000000..7d98b98
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt3_11_en.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/tt3_11_pt.png b/tqtinterface/qt4/tools/linguist/book/images/tt3_11_pt.png
new file mode 100644
index 0000000..02910cf
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/tt3_11_pt.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/validateaccelerators.png b/tqtinterface/qt4/tools/linguist/book/images/validateaccelerators.png
new file mode 100644
index 0000000..68201fe
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/validateaccelerators.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/validatephrases.png b/tqtinterface/qt4/tools/linguist/book/images/validatephrases.png
new file mode 100644
index 0000000..62fe5f2
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/validatephrases.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/images/validatepunctuation.png b/tqtinterface/qt4/tools/linguist/book/images/validatepunctuation.png
new file mode 100644
index 0000000..8ce2648
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/images/validatepunctuation.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/book/linguist-manager.leaf b/tqtinterface/qt4/tools/linguist/book/linguist-manager.leaf
new file mode 100644
index 0000000..bdbdb5b
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/linguist-manager.leaf
@@ -0,0 +1,138 @@
+\chapter Release Manager
+
+\index Release Manager
+
+Two tools are provided for the release manager, \l lupdate and \l
+lrelease. These tools depend on \e qmake project files. You don't
+have to use \e qmake, though.
+
+A third tool, \c qm2ts, can be used for converting Qt 2.x message
+files to \c .ts files.
+
+\section1 Qt Project Files
+
+\index .pro Files
+\index Project Files
+\index qmake!Project Files
+
+\l lupdate and \l lrelease depend on information in the application's
+\c .pro Qt project file. There must be an entry in the \c TRANSLATIONS
+section of the project file for each language that is additional to
+the native language. A typical entry looks like this:
+
+\index TRANSLATIONS!in Project Files
+
+\quotefile tt2/tt2.pro
+\skipto TRANSLATIONS
+\printline tt2_fr
+\printline tt2_nl
+
+Using a locale within the translation file name is useful for
+determining which language to load at runtime. This is explained in
+\link Programmers Chapter 4: Programmers \endlink.
+
+\index HEADERS!in Project Files
+\index SOURCES!in Project Files
+\index FORMS!in Project Files
+\index TRANSLATIONS!in Project Files
+
+An example of a complete \c .pro file with four translation source files:
+\code
+ HEADERS = main-dlg.h \
+ options-dlg.h
+ SOURCES = main-dlg.cpp \
+ options-dlg.cpp \
+ main.cpp
+ FORMS = search-dlg.ui
+ TRANSLATIONS = superapp_dk.ts \
+ superapp_fi.ts \
+ superapp_no.ts \
+ superapp_se.ts
+\endcode
+
+\index QApplication!defaultCodec()
+\index defaultCodec()!QApplication
+\index DEFAULTCODEC!in Project Files
+\index Chinese Language
+\index Japanese Language
+
+\l QTextCodec::setCodecForTr() makes it possible to choose a
+8-bit encoding for literal strings that appear within \c tr() calls.
+This is useful for applications whose source language is, for example,
+Chinese or Japanese. If no encoding is set, \c tr() uses Latin-1.
+
+If you do use the \l QTextCodec::codecForTr() mechanism in your
+application, \e {Qt Linguist} needs you to set the \c DEFAULTCODEC
+entry in the \c .pro file as well. For example:
+\code
+ DEFAULTCODEC = ISO-8859-5
+\endcode
+
+\section1 lupdate
+
+\index lupdate
+
+Usage: \c {lupdate myproject.pro}
+
+ \index Qt Designer
+
+This is a simple command line tool. \l lupdate reads a Qt \c .pro
+project file, tqfinds the translatable strings in the specified source,
+header and \e {Qt Designer} interface files, and produces or updates
+the \c .ts translation files listed in the project file. The
+translation files are given to the translator who uses \e {Qt
+Linguist} to read the files and insert the translations.
+
+Companies that have their own translators in-house may tqfind it useful
+to run \l lupdate regularly, perhaps monthly, as the application
+develops. This will lead to a fairly low volume of translation work
+spread evenly over the life of the project and will allow the
+translators to support a number of projects simultaneously.
+
+Companies that hire in translators as required may prefer to run \l
+lupdate only a few times in the application's life cycle, the first
+time might be just before the first test phase. This will provide the
+translator with a substantial single block of work and any bugs that
+the translator detects may easily be included with those found during
+the initial test phase. The second and any subsequent \l lupdate runs
+would probably take place during the final beta phase.
+
+\index .ts Files
+\index Translation Source Files
+\index XML
+
+The \c .ts file format is a simple human-readable XML format that can
+be used with version control systems if required.
+
+\section1 lrelease
+
+\index lrelease
+
+Usage: \c {lrelease myproject.pro}
+
+\index .qm Files
+\index Qt Message Files
+
+This is another simple command line tool. It reads a Qt \c .pro
+project file and produces the \c .qm files used by the application,
+one for each \c .ts translation source file listed in the project
+file. The \c .qm file format is a compact binary format that provides
+extremely fast lookups for translations.
+
+This tool is run whenever a release of the application is to be made,
+from initial test version through to final release version. If the \c
+.qm files are not created, e.g. because an alpha release is required
+before any translation has been undertaken, the application will run
+perfectly well using the text the programmers placed in the source
+files. Once the \c .qm files are available the application will
+detect them and use them automatically.
+
+Note that \l lrelease will only incorporate translations that are
+marked as "done". If a translation is missing, or has failed
+validation, the original text will be used instead.
+
+\section1 Missing Translations
+
+Both \l lupdate and \l lrelease may be used with \c .ts translation
+source files which are incomplete. Missing translations will be tqreplaced
+with the native language phrases at runtime.
diff --git a/tqtinterface/qt4/tools/linguist/book/linguist-manual.book b/tqtinterface/qt4/tools/linguist/book/linguist-manual.book
new file mode 100644
index 0000000..b98cd9b
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/linguist-manual.book
@@ -0,0 +1,90 @@
+\title Guide to the Qt Translation Tools
+\granularity chapter
+
+\chapter Introduction
+
+Qt provides excellent support for translating applications into local
+languages. This Guide explains how to use Qt's translation tools for
+each of the roles involved in translating an application. The Guide
+begins with a brief overview of the issues that must be considered,
+followed by chapters devoted to each role and the supporting tools
+provided.
+
+\link Release... Chapter 2: Release Manager \endlink is aimed at the
+person with overall responsibility for the release of the
+application. They will typically coordinate the work of the software
+engineers and the translator. The chapter describes the use of two
+tools. The \l lupdate tool is used to synchronize source code and
+translations. The \l lrelease tool is used to create runtime
+translation files for use by the released application.
+
+\link Translators Chapter 3: Translators \endlink is for translators.
+It describes the use of the \e {Qt Linguist} tool. No computer
+knowledge beyond the ability to start a program and use a text editor
+or word processor is required.
+
+\link Programmers Chapter 4: Programmers \endlink is for Qt
+programmers. It explains how to create Qt applications that are able
+to use translated text. It also provides guidance on how to help the
+translator identify the context in which phrases appear. This
+chapter's three short tutorials cover everything the programmer needs
+to do.
+
+\section1 Overview of the Translation Process
+
+Most of the text that must be translated in an application program
+consists of either single words or short phrases. These typically
+appear as window titles, menu items, pop-up help text (balloon help),
+and labels to buttons, check boxes and radio buttons.
+
+The phrases are entered into the source code by the programmer in
+their native language using a simple but special syntax to identify
+that the phrases require translation. The Qt tools provide context
+information for each of the phrases to help the translator, and the
+programmer is able to add additional context information to phrases
+when necessary. The release manager generates a set of translation
+files that are produced from the source files and passes these to the
+translator. The translator opens the translation files using \e {Qt
+Linguist}, enters their translations and saves the results back into
+the translation files, which they pass back to the release manager.
+The release manager then generates fast compact versions of these
+translation files ready for use by the application. The tools are
+designed to be used in repeated cycles as applications change and
+evolve, preserving existing translations and making it easy to
+identify which new translations are required. \e {Qt Linguist} also
+provides a phrase book facility to help ensure consistent
+translations across multiple applications and projects.
+
+Translators and programmers must address a number of issues because
+of the subtleties and complexities of human language:
+
+\list
+\i A single phrase may need to be translated into several different
+forms depending on context, e.g. \e open in English might become \e
+\OEFFNEN, "open file", or \e aufbauen, "open internet connection", in
+German.
+\i Keyboard accelerators may need to be changed but without
+introducing conflicts, e.g. "\&Quit" in English becomes "Avslutt" in
+Norwegian which doesn't contain a "Q". We cannot use a letter that is
+already in use -- unless we change several accelerators.
+\i Phrases that contain variables, for example, "The 25 files selected will
+take 63 seconds to process", where the two numbers are inserted
+programmatically at runtime may need to be reworded because in a
+different language the word order and therefore the placement of the
+variables may have to change.
+\endlist
+
+The Qt translation tools provide clear and simple solutions to these
+issues.
+
+\RULE
+
+Please send comments and suggestions regarding this tutorial to the
+\link mailto:doc@trolltech.com?subject=Translation_Tutorial Qt doc
+team \endlink. Bugs in the tools should be sent to \link
+mailto:qt-bugs@trolltech.com?subject=Translation_Tutorial
+qt-bugs\endlink.
+
+\input linguist-manager.leaf
+\input linguist-translator.leaf
+\input linguist-programmer.leaf
diff --git a/tqtinterface/qt4/tools/linguist/book/linguist-programmer.leaf b/tqtinterface/qt4/tools/linguist/book/linguist-programmer.leaf
new file mode 100644
index 0000000..a4dfa64
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/linguist-programmer.leaf
@@ -0,0 +1,1145 @@
+\chapter Programmers
+
+Support for multiple languages is extremely simple in Qt
+applications, and adds little overhead to the programmer's workload.
+
+Qt minimizes the performance cost of using translations by
+translating the phrases for each window as they are created. In most
+applications the main window is created just once. Dialogs are often
+created once and then shown and hidden as required. Once the initial
+translation has taken place there is no further runtime overhead for
+the translated windows. Only those windows that are created,
+destroyed and subsequently created will have a translation
+performance cost.
+
+Creating applications that can switch language at runtime is possible
+with Qt, but requires a certain amount of programmer intervention and
+will of course incur some runtime performance cost.
+
+\section1 Making the Application Translation Aware
+
+Programmers should make their application look for and load the
+appropriate translation file and mark user-visible text and Ctrl
+keyboard accelerators as targets for translation.
+
+Each piece of text that requires translating requires context to help
+the translator identify where in the program the text occurs. In the
+case of multiple identical texts that require different translations,
+the translator also requires some information to disambiguate the
+source texts. Marking text for translation will automatically cause
+the class name to be used as basic context information. In some cases
+the programmer may be required to add additional information to help
+the translator.
+
+\section2 Creating Translation Files
+
+\index .ts Files
+\index Translation Source Files
+
+Translation files consist of all the user-visible text and Ctrl key
+accelerators in an application and translations of that text.
+Translation files are created as follows:
+
+\index lupdate
+\index lrelease
+
+\list 1
+\i Run \l lupdate initially to generate the first set of \c .ts
+translation source files with all the user-visible text but no
+translations.
+\i The \c .ts files are given to the translator who adds translations
+using \e {Qt Linguist}. \e {Qt Linguist} takes care of any changed
+or deleted source text.
+\i Run \l lupdate to incorporate any new text added to the
+application. \l lupdate synchronizes the user-visible text from the
+application with the translations; it does not destroy any data.
+\i Steps 2 and 3 are repeated as often as necessary.
+\i When a release of the application is needed \l lrelease is run to
+read the \c .ts files and produce the \c .qm files used by the
+application at runtime.
+\endlist
+
+\index .pro Files
+\index Project Files
+\index qmake!Project Files
+
+For \l lupdate to work successfully, it must know which translation
+files to produce. The files are simply listed in the application's \c
+.pro Qt project file, for example:
+\quotefile tt2/tt2.pro
+\skipto TRANSLATIONS
+\printline TRANSLATIONS
+\printline
+
+See the \link lupdate "lupdate" \endlink and \link lrelease
+"lrelease" \endlink sections.
+
+\section2 Loading Translations
+
+\quotefile tt1/main.cpp
+\skipto main(
+\printline main(
+\printuntil QApplication
+
+\index main()
+
+This is how a simple \c main() function of a Qt application begins.
+
+\index QTranslator!load()
+\index load()!QTranslator
+\index QApplication!installTranslator()
+\index installTranslator()!QApplication
+
+\quotefile tt1/main.cpp
+\skipto main(
+\printline main(
+\printuntil app.installTrans
+
+For a translation-aware application a translator object is created, a
+translation is loaded and the translator object installed into the
+application.
+
+\quotefile tt2/main.cpp
+\skipto main(
+\printline main(
+\printuntil app.installTrans
+
+In production applications a more flexible approach, for example,
+loading translations according to locale, might be more appropriate. If
+the \c .ts files are all named according to a convention such as
+\e appname_locale, e.g. \c tt2_fr, \c tt2_de etc, then the
+code above will load the current locale's translation at runtime.
+
+If there is no translation file for the current locale the application
+will fall back to using the original source text.
+
+\section2 Making the Application Translate User-Visible Strings
+
+\index tr()
+\index TQT_BASE_OBJECT_NAME!tr()
+
+User-visible strings are marked as translation targets by wrapping them
+in a \c tr() call, for example:
+\code
+ button = new QPushButton( "&Quit", this );
+\endcode
+
+would become
+
+\code
+ button = new QPushButton( tr("&Quit"), this);
+\endcode
+
+\index Q_OBJECT
+
+All \l TQT_BASE_OBJECT_NAME subclasses that use the \c Q_OBJECT macro implement
+the \c tr() function.
+
+Although the \c tr() call is normally made directly since it is
+usually called as a member function of a \l TQT_BASE_OBJECT_NAME subclass, in
+other cases an explicit class name can be supplied, for example:
+
+\code
+ QPushButton::tr("&Quit")
+\endcode
+
+or
+
+\code
+ TQT_BASE_OBJECT_NAME::tr("&Quit")
+\endcode
+
+\section2 Distinguishing Identical Strings That Require Different
+Translations
+
+\index Translation Contexts
+\index Contexts!for Translation
+\index lupdate
+
+The \l lupdate program automatically provides a \e context for every
+source text. This context is the class name of the class that tqcontains
+the \c tr() call. This is sufficient in the vast majority of cases.
+Sometimes however, the translator will need further information to
+uniquely identify a source text; for example, a dialog that contained
+two separate frames, each of which contained an "Enabled" option would
+need each identified because in some languages the translation would
+differ between the two. This is easily achieved using the
+two argument form of the \c tr() call, e.g.
+
+\code
+ rbc = new QRadioButton( tr("Enabled", "Color frame"), this );
+\endcode
+
+and
+
+\code
+ rbh = new QRadioButton( tr("Enabled", "Hue frame"), this );
+\endcode
+
+\index Ctrl Key
+
+Ctrl key accelerators are also translatable:
+
+\quotefile tt3/mainwindow.cpp
+\skipto quit()
+\printline quit()
+\printuntil Quit
+
+It is strongly recommended that the two argument form of \c tr() is used
+for Ctrl key accelerators. The second argument is the only clue the
+translator has as to the function performed by the accelerator.
+
+\section2 Helping The Translator With Navigation Information
+
+\index TRANSLATOR!in Comments
+\index Translator Comments
+\index Comments!for Translators
+
+In large complex applications it may be difficult for the translator to
+see where a particular source text comes from. This problem can be
+solved by adding a comment using the keyword \e TRANSLATOR which
+describes the navigation steps to reach the text in question; e.g.
+
+\code
+ /* TRANSLATOR FindDialog
+
+ Choose Edit|Find from the menu bar or press Ctrl+F to pop up the
+ Find dialog.
+ */
+\endcode
+
+These comments are particularly useful for widget classes.
+
+\section2 Coping With C++ Namespaces
+
+\index Namespaces
+\index C++!Namespaces
+\index lupdate
+
+C++ namespaces and the \c {using namespace} statement can confuse
+\l lupdate. It will interpret \c MyClass::tr() as meaning just
+that, not as \c MyNamespace::MyClass::tr(), even if \c MyClass is
+defined in the \c MyNamespace namespace. Runtime translation of
+these strings will fail because of that.
+
+\index TRANSLATOR!in Comments
+\index Translator Comments
+\index Comments!for Translators
+
+You can work around this limitation by putting a \e TRANSLATOR
+comment at the beginning of the source files that use \c
+MyClass::tr():
+\code
+ /* TRANSLATOR MyNamespace::MyClass */
+\endcode
+After the comment, all references to \c MyClass::tr() will be
+understood as meaning \c MyNamespace::MyClass::tr().
+
+\section2 Translating Text that is Outside of a TQT_BASE_OBJECT_NAME subclass
+
+\section3 Using QApplication::translate()
+
+If the quoted text is not in a member function of a TQT_BASE_OBJECT_NAME subclass,
+use either the tr() function of an appropriate class, or the
+QApplication::translate() function directly:
+
+\code
+ void some_global_function( LoginWidget *logwid )
+ {
+ QLabel *label = new QLabel(
+ LoginWidget::tr("Password:"), logwid );
+ }
+
+ void same_global_function( LoginWidget *logwid )
+ {
+ QLabel *label = new QLabel(
+ tqApp->translate("LoginWidget", "Password:"),
+ logwid );
+ }
+\endcode
+
+\section3 Using QT_TR_NOOP() and QT_TRANSLATE_NOOP()
+
+If you need to have translatable text completely outside a function,
+there are two macros to help: QT_TR_NOOP() and QT_TRANSLATE_NOOP().
+These macros merely mark the text for extraction by \l{lupdate}.
+The macros expand to just the text (without the context).
+
+Example of QT_TR_NOOP():
+\code
+ QString FriendlyConversation::greeting( int greet_type )
+ {
+ static const char* greeting_strings[] = {
+ QT_TR_NOOP( "Hello" ),
+ QT_TR_NOOP( "Goodbye" )
+ };
+ return tr( greeting_strings[greet_type] );
+ }
+\endcode
+
+Example of QT_TRANSLATE_NOOP():
+\code
+ static const char* greeting_strings[] = {
+ QT_TRANSLATE_NOOP( "FriendlyConversation", "Hello" ),
+ QT_TRANSLATE_NOOP( "FriendlyConversation", "Goodbye" )
+ };
+
+ QString FriendlyConversation::greeting( int greet_type )
+ {
+ return tr( greeting_strings[greet_type] );
+ }
+
+ QString global_greeting( int greet_type )
+ {
+ return tqApp->translate( "FriendlyConversation",
+ greeting_strings[greet_type] );
+ }
+\endcode
+
+\section1 Tutorials
+
+Three tutorials are presented. The first demonstrates the creation of
+a \l QTranslator object. It also shows the simplest use of the \c
+tr() function to mark user-visible source text for translation. The
+second tutorial explains how to make the application load the
+translation file applicable to the current locale. It also shows the
+use of the two-argument form of \c tr() which provides additional
+information to the translator. The third tutorial explains how
+identical source texts can be distinguished even when they occur in
+the same context. This tutorial also discusses how the translation
+tools help minimize the translator's work when an application is
+upgraded.
+
+\section2 Tutorial 1: Loading and Using Translations
+
+\img tt1_en.png
+\caption Tutorial 1 Screenshot, English version
+
+\include tt1/tt1.pro
+\caption \c tt1.pro
+
+\include tt1/main.cpp
+\caption \c main.cpp
+
+This example is a reworking of the \link tutorial1-01.html
+"hello-world" \endlink example from \link tutorial.html Tutorial
+#1\endlink, with a Latin translation. The \e {Tutorial 1 Screenshot,
+English version}, above, shows the English version.
+
+\quotefile tt1/main.cpp
+
+\section3 Line by Line Walk-through
+
+\quotefile tt1/main.cpp
+
+\skipto qtranslator
+\printline qtranslator
+
+\index QTranslator
+
+This line includes the definition of the \l QTranslator class.
+Objects of this class provide translations for user-visible text.
+
+\skipto QTranslator
+\printuntil tor
+
+Creates a \l QTranslator object without a tqparent.
+
+\printline load
+
+\index tt1_la.qm
+
+Tries to load a file called \c tt1_la.qm (the \c .qm file extension is
+implicit) that tqcontains Latin translations for the source texts used in
+the program. No error will occur if the file is not found.
+
+\index QApplication!installTranslator()
+\index installTranslator()!QApplication
+
+\printline installTranslator
+
+Adds the translations from \c tt1_la.qm to the pool of translations used
+by the program.
+
+\index Hello World
+
+\printline hello
+
+Creates a push button that displays "Hello world!". If \c tt1_la.qm
+was found and tqcontains a translation for "Hello world!", the
+translation appears; if not, the source text appears.
+
+\index tr()
+\index TQT_BASE_OBJECT_NAME!tr()
+
+All classes that inherit \l TQT_BASE_OBJECT_NAME have a \c tr() function. Inside
+a member function of a \l TQT_BASE_OBJECT_NAME class, we simply write \c tr("Hello
+world!") instead of \c QPushButton::tr("Hello world!") or \c
+QObject::tr("Hello world!").
+
+\section3 Running the Application in English
+
+\index English Language
+
+Since we haven't made the translation file \c tt1_la.qm, the source text
+is shown when we run the application:
+
+\img tt1_en.png
+\caption Tutorial 1 Screenshot, English version
+
+\section3 Creating a Latin Message File
+
+\index tt1.pro
+\index Latin
+
+The first step is to create a project file, \c tt1.pro, that lists
+all the source files for the project. The project file can be a qmake
+project file, or even an ordinary makefile. Any file that tqcontains
+
+\index SOURCES!in Project Files
+\index TRANSLATIONS!in Project Files
+
+\quotefile tt1/tt1.pro
+\skipto SOURCES
+\printline SOURCES
+\skipto TRANSLATIONS
+\printline TRANSLATIONS
+
+will work. \e TRANSLATIONS specifies the message files we want to
+maintain. In this example, we just maintain one set of translations,
+namely Latin.
+
+\index .ts Files
+\index Translation Source Files
+\index .qm Files
+\index Qt Message Files
+
+Note that the file extension is \c .ts, not \c .qm. The \c .ts
+translation source format is designed for use during the
+application's development. Programmers or release managers run the \l
+lupdate program to generate and update \c .ts files with the source
+text that is extracted from the source code. Translators read and
+update the \c .ts files using \e {Qt Linguist} adding and editing
+their translations.
+
+\index XML
+
+The \c .ts format is human-readable XML that can be emailed directly
+and is easy to put under version control. If you edit this file
+manually, be aware that the default encoding for XML is UTF-8, not
+Latin-1 (ISO 8859-1). One way to type in a Latin-1 character such as
+'\OSLASH' (Norwegian o with slash) is to use an XML entity:
+"\&#xf8;". This will work for any Unicode character.
+
+Once the translations are complete the \l lrelease program is used to
+convert the \c .ts files into the \c .qm Qt message file format. The
+\c .qm format is a compact binary format designed to deliver very
+fast lookup performance. Both \l lupdate and \l lrelease read all the
+project's source and header files (as specified in the HEADERS and
+SOURCES lines of the project file) and extract the strings that
+appear in \c tr() function calls.
+
+\index lupdate
+
+\l lupdate is used to create and update the message files (\c tt1_la.ts
+in this case) to keep them in sync with the source code. It is safe to
+run \l lupdate at any time, as \l lupdate does not remove any
+information. For example, you can put it in the makefile, so the \c .ts
+files are updated whenever the source changes.
+
+\index .ts Files
+\index Translation Source Files
+\index XML
+
+Try running \l lupdate right now, like this:
+\code
+ lupdate -verbose tt1.pro
+\endcode
+(The \c -verbose option instructs \c lupdate to display messages that
+explain what it is doing.) You should now have a file \c tt1_la.ts in
+the current directory, containing this:
+\code
+ <!DOCTYPE TS><TS>
+ <context>
+ <name>QPushButton</name>
+ <message>
+ <source>Hello world!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ </context>
+ </TS>
+\endcode
+You don't need to understand the file format since it is read and
+updated using tools (\l lupdate, \e {Qt Linguist}, \l lrelease).
+
+\section3 Translating to Latin with Qt Linguist
+
+\index Qt Linguist
+\index Linguist
+
+We will use \e {Qt Linguist} to provide the translation, although
+you can use any XML or plain text editor to enter a translation into a
+\c .ts file.
+
+To start \e {Qt Linguist}, type
+\code
+ linguist tt1_la.ts
+\endcode
+
+You should now see the text "QPushButton" in the top left pane.
+Double-click it, then click on "Hello world!" and enter "Orbis, te
+saluto!" in the \e Translation pane (the middle right of the
+window). Don't forget the exclamation mark!
+
+Click the \e Done checkbox and choose \e File|Save from the
+menu bar. The \c .ts file will no longer contain
+\code
+ <translation type='unfinished'></translation>
+\endcode
+but instead will have
+\code
+ <translation>Orbis, te saluto!</translation>
+\endcode
+
+\section3 Running the Application in Latin
+
+\index Latin
+\index lrelease
+
+To see the application running in Latin, we have to generate a \c .qm
+file from the \c .ts file. Generating a \c .qm file can be achieved
+either from within \e {Qt Linguist} (for a single \c .ts file), or
+by using the command line program \l lrelease which will produce one \c
+.qm file for each of the \c .ts files listed in the project file.
+Generate \c tt1_la.qm from \c tt1_la.ts by choosing
+\e File|Release from \e {Qt Linguist}'s menu bar and pressing
+\e Save in the file save dialog that pops up. Now run the \e tt1 example
+program again. This time the button will be labelled "Orbis, te
+saluto!".
+
+\img tt1_la.png
+\caption Tutorial 1 Screenshot, Latin version
+
+\section2 Tutorial 2: Using Two or More Languages
+
+\img tt2_en.png
+\caption Tutorial 2 Screenshot, English version
+
+\index .pro Files
+\index Project Files
+\index qmake!Project Files
+
+\include tt2/tt2.pro
+\caption tt2.pro
+
+\index Translation Contexts
+\index Contexts!for Translation
+
+This example is a slightly more involved and introduces a key
+\e {Qt Linguist} concept: "contexts".
+
+\list
+\i \c arrowpad.h tqcontains the definition of \c ArrowPad, a custom widget;
+\i \c arrowpad.cpp tqcontains the implementation of \c ArrowPad;
+\i \c mainwindow.h tqcontains the definition of \c MainWindow, a subclass of
+ \l QMainWindow
+\i \c mainwindow.cpp tqcontains the implementation of \c MainWindow;
+\i \c main.cpp tqcontains main().
+\endlist
+
+\index tt2.pro
+\index French Language
+\index Dutch Language
+
+We will use two translations, French and Dutch, although there is no
+effective limit on the number of possible translations that can be used
+with an application. The relevant lines of \c tt2.pro are
+
+\quotefile tt2/tt2.pro
+\skipto HEADERS
+\printuntil tt2_nl.ts
+
+\index lupdate
+\index tt2_fr.ts
+\index tt2_nl.ts
+
+Run \l lupdate; it should produce two identical message files
+\c tt2_fr.ts and \c tt2_nl.ts. These files will contain all the source
+texts marked for translation with \c tr() calls and their contexts.
+
+\section3 Line by Line Walk-through
+
+\index ArrowPad!in Translation Tutorial
+\index English Language
+
+In \c arrowpad.h we define the \c ArrowPad subclass which is a
+subclass of \l QWidget. In the \e {Tutorial 2 Screenshot, English
+version}, above, the central widget with the four buttons is an
+\c ArrowPad.
+
+\quotefile tt2/arrowpad.h
+\skipto class ArrowPad
+\printline class ArrowPad
+
+\index Q_OBJECT
+\index tr()
+\index TQT_BASE_OBJECT_NAME!tr()
+\index Translation Contexts
+\index Contexts!for Translation
+
+When \l lupdate is run it not only extracts the source texts but it
+also groups them into contexts. A context is the name of the class in
+which the source text appears. Thus, in this example, "ArrowPad" is a
+context: it is the context of the texts in the \c ArrowPad class.
+The \c Q_OBJECT macro defines \c tr(x) in \c ArrowPad like this
+
+\index QApplication!translate()
+\index translate()!QApplication
+
+\code
+ tqApp->translate( "ArrowPad", x )
+\endcode
+
+Knowing which class each source text appears in enables \e {Qt
+Linguist} to group texts that are logically related together, e.g.
+all the text in a dialog will have the context of the dialog's class
+name and will be shown together. This provides useful information for
+the translator since the context in which text appears may influence how
+it should be translated. For some translations keyboard
+accelerators may need to be changed and having all the source texts in a
+particular context (class) grouped together makes it easier for the
+translator to perform any accelerator changes without introducing
+conflicts.
+
+In \c arrowpad.cpp we implement the \c ArrowPad class.
+
+\quotefile tt2/arrowpad.cpp
+\skipto QPushButton
+\printline QPushButton
+
+We call \c ArrowPad::tr() for each button's label since the labels are
+user-visible text.
+
+\img tt2_en.png
+\caption Tutorial 2 Screenshot, English version
+
+\index Q_OBJECT
+\index MainWindow!in Translation Tutorial
+
+\quotefile tt2/mainwindow.h
+\skipto QMainWindow
+\printline QMainWindow
+\printuntil Q_OBJECT
+
+In the \e {Tutorial 2 Screenshot, English version}, above, the whole
+window is a \c MainWindow. This is defined in the \c mainwindow.h
+header file. Here too, we use \c Q_OBJECT, so that \c MainWindow will
+become a context in \e {Qt Linguist}.
+
+In the implementation of \c MainWindow, \c mainwindow.cpp, we create
+an instance of our \c ArrowPad class
+
+\quotefile tt2/mainwindow.cpp
+\skipto arrow pad
+\printline arrow pad
+
+We also call \c MainWindow::tr() twice, once for the menu item and
+once for the accelerator.
+
+\index Ctrl Key
+\index Alt Key
+
+\skipto quit()
+\printline quit()
+\printuntil Ctrl+Q
+
+Note the use of \c tr() to support different keys in other languages.
+"Ctrl+Q" is a good choice for Quit in English, but a Dutch translator
+might want to use "Ctrl+A" (for Afsluiten) and a German translator
+"Strg+E" (for Beenden). When using \c tr() for Ctrl key accelerators,
+the two argument form should be used with the second argument
+describing the function that the accelerator performs.
+
+\index main()
+
+Our \c main() function is defined in \c main.cpp as usual.
+
+\quotefile tt2/main.cpp
+\skipto QTranslator
+\printline QTranslator
+\printuntil install
+
+\index QTextCodec!locale()
+\index locale()!QTextCodec
+\index LANG!Environment Variable
+\index Environment Variables!LANG
+
+We choose which translation to use according to the current locale.
+\l QTextCodec::locale() can be influenced by setting the \c LANG
+environment variable, for example. Notice that the use of a naming
+convention that incorporates the locale for \c .qm message files,
+(and \c .ts files), makes it easy to implement choosing the
+translation file according to locale.
+
+If there is no \c .qm message file for the locale chosen the original
+source text will be used and no error raised.
+
+\section3 Translating to French and Dutch
+
+We'll begin by translating the example application into French. Start
+\e {Qt Linguist} with \c tt2_fr.ts. You should get the seven source
+texts ("\&Up", "\&Left", etc.) grouped in two contexts ("ArrowPad"
+and "MainWindow").
+
+Now, enter the following translations:
+
+\list
+\i \c ArrowPad
+ \list
+ \i \&Up - \&Haut
+ \i \&Left - \&Gauche
+ \i \&Right - \&Droite
+ \i \&Down - \&Bas
+ \endlist
+\i \c MainWindow
+ \list
+ \i E\&xit - \&Quitter
+ \i Ctrl+Q - Ctrl+Q
+ \i \&File - \&Fichier
+ \endlist
+\endlist
+
+It's quickest to press \Key Alt+D (which clicks the \e {Done \& Next}
+button) after typing each translation, since this marks the
+translation as done and moves on to the next source text.
+
+Save the file and do the same for Dutch working with \c tt2_nl.ts:
+
+\list
+\i \c ArrowPad
+ \list
+ \i \&Up - \&Boven
+ \i \&Left - \&Links
+ \i \&Right - \&Rechts
+ \i \&Down - \&Onder
+ \endlist
+\i \c MainWindow
+ \list
+ \i E\&xit - \&Afsluiten
+ \i Ctrl+Q - Ctrl+A
+ \i File - \&Bestand
+ \endlist
+\endlist
+
+We have to convert the \c tt1_fr.ts and \c tt1_nl.ts translation source
+files into \c .qm files. We could use \e {Qt Linguist} as we've done
+before; however using the command line tool \l lrelease ensures that
+\e all the \c .qm files for the application are created without us
+having to remember to load and \e File|Release each one
+individually from \e {Qt Linguist}.
+
+In practice we would include calls to \l lupdate and \l lrelease in the
+application's makefile to ensure that the latest translations are
+used.
+
+\omit
+an example of a makefile or .pro file that did this would be nice
+\endomit
+
+Type
+
+\code
+ lrelease tt2.pro
+\endcode
+
+\index LANG!Environment Variable
+\index export!Unix Command
+\index setenv!Unix Command
+
+This should create both \c tt2_fr.qm and \c tt2_nl.qm. Set the \c
+LANG environment variable to \c fr. In Unix, one of the two following
+commands should work
+
+\code
+ export LANG=fr
+ setenv LANG fr
+\endcode
+
+\index
+
+\index autoexec.bat
+\index set!Windows Command
+
+In Windows, either modify \c autoexec.bat or run
+
+\code
+ set LANG=fr
+\endcode
+
+When you run the program, you should now see the French version:
+
+\img tt2_fr.png
+\caption Tutorial 2 Screenshot, French version
+
+Try the same with Dutch, by setting \c LANG=nl. Now the Dutch
+version should appear:
+
+\img tt2_nl.png
+\caption Tutorial 2 Screenshot, Dutch version
+
+\section3 Exercises
+
+Mark one of the translations in \e {Qt Linguist} as not done, i.e.
+by unchecking the "done" checkbox; run \l lupdate, then \l lrelease,
+then the example. What effect did this change have?
+
+\index Canada
+\index French Canada
+
+Set \c LANG=fr_CA (French Canada) and run the example program again.
+Explain why the result is the same as with \c LANG=fr.
+
+Change one of the accelerators in the Dutch translation to eliminate the
+conflict between \e \&Bestand and \e \&Boven.
+
+
+\section2 Tutorial 3: Disambiguating Identical Strings
+
+\img tt3_10_en.png
+\caption Tutorial 3 Screenshot, "Troll Print 1.0", English version
+
+\include tt3/tt3.pro
+\caption \c tt3.pro
+
+\index Portuguese Language
+\index Brazilian Language
+
+We've included a translation file, \c tt3_pt.ts, which tqcontains some
+Portuguese translations for this example.
+
+\index Troll Print
+
+We will consider two releases of the same application: Troll Print
+1.0 and 1.1. We will learn to reuse the translations created for one
+release in a subsequent release. (In this tutorial, you need to edit
+some source files. It's probably best to copy all the files to a new
+temporary directory and work from there.)
+
+Troll Print is a toy example application that lets the user choose
+printer settings. It comes in two versions: English and Portuguese.
+
+Version 1.0 consists of these files:
+
+\index tt3.pro
+\index tt3_pt.ts
+
+\list
+\i \c printpanel.h tqcontains the definition of PrintPanel;
+\i \c printpanel.cpp tqcontains the implementation of PrintPanel;
+\i \c mainwindow.h tqcontains the definition of \c MainWindow;
+\i \c mainwindow.cpp tqcontains the implementation of \c MainWindow;
+\i \c main.cpp tqcontains main();
+\i \c tt3.pro is the \e qmake project file.
+\i \c tt3_pt.ts is the Portuguese message file.
+\endlist
+
+\section3 Line by Line Walk-through
+
+The PrintPanel is defined in \c printpanel.h.
+
+\quotefile tt3/printpanel.h
+\skipto QVBox
+\printline QVBox
+\printuntil Q_OBJECT
+
+\index Q_OBJECT
+
+\index PrintPanel!in Translation Tutorial
+
+PrintPanel is a \l QWidget. It needs the \c Q_OBJECT macro for \c
+tr() to work properly.
+
+The implementation file is \c printpanel.cpp.
+
+\quotefile tt3/printpanel.cpp
+\skipto setSpacing
+\skipto /
+\printline /
+\printline
+\printline
+\printline
+
+\index Troll Print
+
+Some of the code is commented out in Troll Print 1.0; you will uncomment
+it later, for Troll Print 1.1.
+
+\quotefile tt3/printpanel.cpp
+\skipto twoSided
+\printline twoSided
+\printuntil toggle
+\printline
+\printuntil toggle
+
+Notice the two occurrences of \c tr("Enabled") and of \c
+tr("Disabled") in PrintPanel. Since both "Enabled"s and "Disabled"s
+appear in the same context \e {Qt Linguist} will only display one
+occurrence of each and will use the same translations for the
+duplicates that it doesn't display. Whilst this is a useful
+timesaver, in some languages, such as Portuguese, the second
+occurrence requires a separate translation. We will see how \e {Qt
+Linguist} can be made to display all the occurrences for separate
+translation shortly.
+
+\index MainWindow!in Translation Tutorial
+
+The header file for \c MainWindow, \c mainwindow.h, tqcontains no
+surprises. In the implementation, \c mainwindow.cpp, we have some
+user-visible source texts that must be marked for translation.
+
+\quotefile tt3/mainwindow.cpp
+\skipto setCaption
+\printline setCaption
+
+We must translate the window's caption.
+
+\skipto quit
+\printline quit
+\printuntil Help
+
+We also need to translate the menu items. Note that the two argument
+form of \c tr() is used for the keyboard accelerator, "Ctrl+Q", since
+the second argument is the only clue the translator has to indicate
+what function that accelerator will perform.
+
+\quotefile tt3/main.cpp
+\skipto QTranslator
+\printuntil installTranslator
+
+\index main()
+
+The \c main() function in \c main.cpp is the same as the one in \link
+{Tutorial 2...} Tutorial 2 \endlink. In particular it chooses a
+translation file based on the current locale.
+
+\section3 Running Troll Print 1.0 in English and in Portuguese
+
+We will use the translations in the \c tt3_pt.ts file that is provided.
+
+Set the \c LANG environment variable to \c pt, and then run \c tt3.
+You should still see the English version, as shown in the \e
+{Tutorial 3 Screenshot, "Troll Print 1.0", English version}, above.
+Now run \l lrelease, e.g. \c {lrelease tt3.pro}, and then run the
+example again. Now you should see the Portuguese edition (Troll
+Imprimir 1.0):
+
+\img tt3_10_pt_bad.png
+\caption Tutorial 3 Screenshot, "Troll Imprimir 1.0", (Bad) Portuguese version
+
+Whilst the translation has appeared correctly, it is in fact wrong. In
+good Portuguese, the second occurrence of "Enabled" should be
+"Ativadas", not "Ativado" and the ending for the second translation of
+"Disabled" must change similarly too.
+
+If you open \c tt3_pt.ts using \e {Qt Linguist}, you will see that
+there is just one occurrence of "Enabled" and of "Disabled" in the
+translation source file, even though there are two of each in the
+source code. This is because \e {Qt Linguist} tries to minimize the
+translator's work by using the same translation for duplicate source
+texts. In cases such as this where an identical translation is wrong,
+the programmer must disambiguate the duplicate occurrences. This is
+easily achieved by using the two argument form of \c tr().
+
+We can easily determine which file must be changed because the
+translator's "context" is in fact the class name for the class where
+the texts that must be changed appears. In this case the file is \c
+printpanel.cpp, where the there are four lines to change. Add the
+second argument "two-sided" in the appropriate \c tr() calls to the
+first pair of radio buttons:
+
+\code
+ but = new QRadioButton( tr("Enabled", "two-sided"), twoSided );
+ but = new QRadioButton( tr("Disabled", "two-sided"), twoSided );
+\endcode
+
+and add the second argument "colors" in the appropriate \c tr() calls
+for the second pair of radio buttons:
+
+\code
+ but = new QRadioButton( tr("Enabled", "colors"), colors );
+ but = new QRadioButton( tr("Disabled", "colors"), colors );
+\endcode
+
+\index lupdate
+\index tt3_pt.ts
+
+Now run \l lupdate and open \c tt3_pt.ts with \e {Qt Linguist}. You
+should now see two changes.
+
+First, the translation source file now tqcontains \e three "Enabled",
+"Disabled" pairs. The first pair is marked "(obs.)" signifying that they
+are obsolete. This is because these texts appeared in \c tr() calls that
+have been tqreplaced by new calls with two arguments. The second pair has
+"two-sided" as their comment, and the third pair has "colors" as their
+comment. The comments are shown in the \e {Source text and comments}
+area in \e {Qt Linguist}.
+
+Second, the translation text "Ativado" and "Desativado" have been
+automatically used as translations for the new "Enabled" and "Disabled"
+texts, again to minimize the translator's work. Of course in this case
+these are not correct for the second occurrence of each word, but they
+provide a good starting point.
+
+Change the second "Ativado" into "Ativadas" and the second
+"Desativado" into "Desativadas", then save and quit. Run \l lrelease
+to obtain an up-to-date binary \c tt3_pt.qm file, and run Troll Print
+(or rather Troll Imprimir).
+
+\img tt3_10_pt_good.png
+\caption Tutorial 3 Screenshot, "Troll Imprimir 1.0", (Good) Portuguese version
+
+\index Translator Comments
+\index Comments!for Translators
+
+The second argument to \c tr() calls, called "comments" in \e {Qt
+Linguist}, distinguish between identical source texts that occur in
+the same context (class). They are also useful in other cases to give
+clues to the translator, and in the case of Ctrl key accelerators are
+the only means of conveying the function performed by the accelerator to
+the translator.
+
+\index TRANSLATOR!in Comments
+\index Translator Comments
+\index Comments!for Translators
+
+An additional way of helping the translator is to provide information on
+how to navigate to the particular part of the application that tqcontains
+the source texts they must translate. This helps them see the context
+in which the translation appears and also helps them to tqfind and test
+the translations. This can be achieved by using a \e TRANSLATOR comment
+in the source code:
+\code
+ /* TRANSLATOR MainWindow
+
+ In this application the whole application is a MainWindow.
+ Choose Help|About from the menu bar to see some text
+ belonging to MainWindow.
+ */
+\endcode
+
+Try adding these comments to some source files, particularly to
+dialog classes, describing the navigation necessary to reach the
+dialogs. You could also add them to the example files, e.g. \c
+mainwindow.cpp and \c printpanel.cpp are appropriate files. Run \l
+lupdate and then start \e {Qt Linguist} and load in \c tt3_pt.ts.
+You should see the comments in the \e {Source text and comments} area
+as you browse through the list of source texts.
+
+Sometimes, particularly with large programs, it can be difficult for
+the translator to tqfind their translations and check that they're
+correct. Comments that provide good navigation information can save
+them time:
+
+\code
+ /* TRANSLATOR ZClientErrorDialog
+
+ Choose Client|Edit to reach the Client Edit dialog, then choose
+ Client Specification from the drop down list at the top and pick
+ client Bartel Leendert van der Waerden. Now check the Profile
+ checkbox and then click the Start Processing button. You should
+ now see a pop up window with the text "Error: Name too long!".
+ This window is a ZClientErrorDialog.
+ */
+\endcode
+
+
+\section3 Troll Print 1.1
+
+We'll now prepare release 1.1 of Troll Print. Start your favorite text
+editor and follow these steps:
+
+\list
+\i Uncomment the two lines that create a \l QLabel with the text
+ "\<b\>TROLL PRINT\</b\>" in \c printpanel.cpp.
+\i Word-tidying: Replace "2-sided" by "Two-sided" in \c printpanel.cpp.
+\i Replace "1.0" with "1.1" everywhere it occurs in \c mainwindow.cpp.
+\i Update the copyright year to 1999-2000 in \c mainwindow.cpp.
+\endlist
+
+(Of course the version number and copyright year would be consts or
+#defines in a real application.)
+
+Once finished, run \l lupdate, then open \c tt3_pt.ts in \e {Qt
+Linguist}. The following items are of special interest:
+
+\list
+\i \c MainWindow
+ \list
+ \i Troll Print 1.0 - marked "(obs.)", obsolete
+ \i About Troll Print 1.0 - marked "(obs.)", obsolete
+ \i Troll Print 1.0. Copyright 1999 Macroshaft, Inc. -
+ marked "(obs.)", obsolete
+ \i Troll Print 1.1 - automatically translated as
+ "Troll Imprimir 1.1"
+ \i About Troll Print 1.1 - automatically translated as
+ "Troll Imprimir 1.1"
+ \i Troll Print 1.1. Copyright 1999-2000 Macroshaft,
+ Inc. - automatically translated as "Troll Imprimir 1.1.
+ Copyright 1999-2000 Macroshaft, Inc."
+ \endlist
+\i \c PrintPanel
+ \list
+ \i 2-sided - marked "(obs.)", obsolete
+ \i \<b\>TROLL PRINT\</b\> - unmarked, i.e. untranslated
+ \i Two-sided - unmarked, i.e. untranslated.
+ \endlist
+\endlist
+
+Notice that \l lupdate works hard behind the scenes to make revisions
+easier, and it's pretty smart with numbers.
+
+Go over the translations in \c MainWindow and mark these as "done".
+Translate "\<b\>TROLL PRINT\</b\>" as "\<b\>TROLL IMPRIMIR\</b\>".
+When you're translating "Two-sided", press the \e {Guess Again}
+button to translate "Two-sided", but change the "2" into "Dois".
+
+Save and quit, then run \l lrelease. The Portuguese version
+should look like this:
+
+\img tt3_11_pt.png
+\caption Tutorial 3 Screenshot, "Troll Imprimir 1.1", Portuguese version
+
+Choose \e{Ajuda|Sobre}, (\e{Help|About}), to see the about box
+
+\img tt3_11_about_pt.png
+\caption Tutorial 3 Screenshot, About box, Portuguese version
+
+\index English Language
+\index Translating Qt
+\index Qt!Translating Qt
+
+If you choose \e {Ajuda|Sobre Qt}, (\e {Help|About Qt}), you'll get
+an English dialog. Oops! Qt itself needs to be translated. See the
+document \link i18n.html#qt-itself Internationalization with Qt
+\endlink for details.
+
+Now set \c LANG=en to get the original English version:
+
+\img tt3_11_en.png
+\caption Tutorial 3 Screenshot, "Troll Print 1.1", English version
+
+\section2 Summary
+
+These tutorials cover all that you need to know to prepare your Qt
+applications for translation.
+
+At the beginning of a project add the translation source files to be
+used to the project file and add calls to \l lupdate and \l lrelease to
+the make file.
+
+During the project all the programmer must do is wrap any user-visible
+text in \c tr() calls. They should also use the two argument form for
+Ctrl key accelerators, or when asked by the translator for the cases
+where the same text translates into two different forms in the same
+context. The programmer should also include \e TRANSLATION comments to
+help the translator navigate the application.
diff --git a/tqtinterface/qt4/tools/linguist/book/linguist-translator.leaf b/tqtinterface/qt4/tools/linguist/book/linguist-translator.leaf
new file mode 100644
index 0000000..572c903
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/book/linguist-translator.leaf
@@ -0,0 +1,582 @@
+\chapter Translators
+
+\img linguist.png
+\caption Linguist Main Window
+
+\section1 The One Minute Guide to Using Qt Linguist
+
+\index Linguist
+\index Qt Linguist
+\index Contexts!for Translation
+
+\e {Qt Linguist} is a tool for adding translations to Qt
+applications. It introduces the concept of a translation "context"
+which means a group of phrases that appear together on the screen
+e.g. in the same menu or dialog.
+
+To start, run \e {Qt Linguist}, either from the taskbar menu, or by
+double clicking the desktop icon, or type \c {linguist} (followed by
+\Key Enter) at the command line. Once \e {Qt Linguist} has started
+choose \Menu File|Open from the menu bar and select a \c .ts
+translation source file to work on.
+
+\e {Qt Linguist}'s main window is divided into four main areas. The
+left hand side tqcontains the Context list, the top right is the Source
+text area, the middle right is the translation area and the bottom
+right is the phrases and guesses area. We'll describe them in detail
+later.
+
+Click on one of the contexts in the context list (left hand side) and
+then click on one of the phrases that appears in the Source text area
+(top right). The phrase will be copied into the translation area
+(middle right). Click under the word 'Translation' and type in the
+translation. Click \Key Ctrl+Enter (Done \& Next) to confirm that you
+have completed the translation and to move on to the next phrase that
+requires translation.
+
+The cycle of entering a translation then pressing \Key Ctrl+Enter can
+be repeated until all the translations are done or until you finish
+the session. Linguist will attempt to fill the "phrases and guesses"
+area with possible translations from any open phrase books and any
+previous translations. Each has a keyboard shortcut, e.g.
+\Key Ctrl+1, \Key Ctrl+2, etc., which you can use to copy the
+guess into the Translation area. (Mouse users can double click a
+phrase or guess to move it into the Translation area.) At the end of
+the session choose \Menu File|Save from the menu bar and then
+\Menu File|Exit to quit.
+
+\section1 Qt Linguist's Main Window
+
+\section2 Context List
+
+\index Contexts!for Translation
+
+This appears at the left hand side of the main window by default. The
+first column, 'Done', identifies whether or not the translations for the
+context have been done. A tick indicates that all the translations have
+been done and are valid. A question mark indicates that one or more
+translations have not been done or have failed validation. The second
+column, 'Context' is the name of the context in which the translation
+phrases appear. The third column, 'Items' shows two numbers, the first
+is the number of translations that have been done, and the second is the
+number of phrases that are in the context; if the numbers are equal then
+all the translations have been done. Note that a greyed out tick
+indicates an obsolete translation, i.e. a phrase that was translated in
+a previous version of the application but which does not occur in the
+new version.
+
+The contexts are ordered alphabetically. The phrases within each context
+are in the order in which they appear in the source program and this may
+not be the order in which they are shown on screen.
+
+The Context List is a dockable window so it can be dragged to another
+position in the main window, or dragged out of the main window to be a
+window in its own right. If you move the Context List, \e {Qt
+Linguist} will remember its position and restore it whenever you
+start the program.
+
+\section2 Source Text Area
+
+This appears at the top right of the main window by default. The first
+column, 'Done', signifies the status of the translation. A tick
+indicates that the phrase has been translated and passed validation. A
+question mark indicates that the translation has not been done. An
+exclamation mark indicates that the translation has failed validation.
+The second column 'Source text' shows the text that must be translated.
+The third column shows the translation.
+
+\e{Qt Linguist} provides three kinds of validation: accelerator,
+punctuation and phrase. If the source text tqcontains an accelerator
+i.e. an ampersand, '\&' and the translated text does not contain an
+ampersand the translation will fail the accelerator validation.
+Similarly, if the source text ends with a particular punctuation
+mark, e.g. '?', '!' or '.' and the translation ends with a different
+punctuation mark the translation will fail the punctuation
+validation. If the source text has a translation in one of the open
+phrase books that differs from the translation used the translation
+will fail phrase validation. (See \l Validation.)
+
+The Source Text Area is a dockable window.
+
+\section2 Translation Area
+
+This area appears at the middle right of the main window by default. It
+is comprised of three vertical sections. The first section is labelled
+'Source text' below which the source text appears. The second section
+tqcontains contextual information on a light blue background that the
+programmer has added to assist the translator. If no contextual
+information has been given this section does not appear. The third
+section is labelled 'Translation' and this is where you enter the
+translation of the source text.
+
+\section2 Phrases and Guesses Area
+
+\index Phrases!in Qt Linguist
+\index Guesses!in Qt Linguist
+
+This area appears at the bottom right of the main window by default.
+When you move to a new phrase if the phrase is in one of the phrase
+books that has been loaded the phrase will appear in this area with its
+translation. If the phrase is the same or similar to another phrase that
+has already been translated the phrase and translation will be shown in
+this area. To copy a translation from the phrases and guesses area press
+\Key F6 to move to the phrases and guesses area, use the up and down arrow
+keys to move to the phrase you want to use and press Enter to copy it.
+If you decide that you don't want to copy a phrase after all, press Esc.
+In both cases the focus will return to the Translation area.
+Alternatively, double click the translation you want to use and it will
+be copied into the translation area.
+
+The Phrases and Guesses Area is a dockable window.
+
+\section1 Common Tasks
+
+\section2 Leaving a Translation for Later
+
+If you wish to leave a translation press \Key Ctrl+L (Next Unfinished) to
+move to the next unfinished translation. An unfinished translation is
+one that either has not been translated at all or one which fails
+validation. To move to the next phrase press \Key Shift+Ctrl+L. You can also
+navigate using the Translation menu. If you want to go to a different
+context entirely, click the context you want to work on in the Context
+list, then click the source text in the Source Text area.
+
+\section2 Phrases That Require Multiple Translations Depending on Context
+
+\index Contexts!for Translation
+\index Comments!for Translators
+
+The same phrase may occur in two or more contexts without conflict. Once
+a phrase has been translated in one context, \e {Qt Linguist} notes
+that the translation has been made and when the translator reaches a
+later occurrence of the same phrase \e {Qt Linguist} will provide
+the previous translation as a possible translation candidate in the
+phrases and guesses area. If the
+previous translation is acceptable just click the \e {Done \& Next}
+button (press \Key Ctrl+Enter) to move on to the next unfinished phrase.
+
+If a phrase occurs more than once in a particular context it will only
+be shown once in \e {Qt Linguist}'s context list and
+the translation will be applied to every occurrence within the context.
+If the same phrase needs to be translated differently within the same
+context the programmer must provide a distinguishing comment for each of
+the phrases concerned. If such comments are used the duplicate phrases
+will appear in the context list. The programmers comments will appear in
+the translation area on a light blue background.
+
+\section2 Changing Keyboard Accelerators
+
+\index Accelerators
+\index Keyboard Accelerators
+
+A keyboard accelerator is a key combination that when pressed will
+cause an application to perform an action. Keyboard accelerators
+normally come in two forms: Alt key and Ctrl key accelerators.
+
+\index Alt Key
+
+Alt key accelerators are used for menus and buttons. The underlining
+signifies that pressing the Alt key with the underlined letter is the
+same as clicking the menu item with the mouse. For example, most
+applications have a \e File menu with the "F" in the word "file"
+underlined. In these applications the file menu can be invoked either by
+clicking the word "File" on the menu bar or by pressing Alt+F. The
+accelerator key which is underlined is signified by preceeding it with
+an ampersand, e.g. \e \&File. If a source phrase appears with an
+ampersand in it then the translation should also contain an ampersand,
+preferably in front of the same letter. The meaning of Alt key
+accelerators can be determined from the phrase in which the ampersand is
+embedded. The translator may need to change the letter used with the Alt
+key, e.g. if the translated phrase does not contain the original
+accelerator letter. Conflicts with other keys, i.e. having two Alt key
+accelerators using the same letter in the same context, must be avoided.
+Note that some Alt key accelerators, usually those on the menu bar, may
+apply in other contexts.
+
+\index Ctrl Key
+
+Ctrl key accelerators can exist independently of any visual control.
+They are often used to invoke actions in menus that would otherwise
+take several keystrokes or mouse clicks. They may also be used to
+perform actions that do not appear in any menu or on any button. For
+example, most applications that have a \e File menu have a submenu
+item called \e New. In many applications this will appear as "\NEW
+Ctrl+N". This menu option could be invoked by clicking \e File then
+clicking \e New with the mouse. Or you could press Alt+F then press N
+since these letters are underlined. But the same thing can be achieved
+simply by pressing \Key Ctrl+N. Accelerators that use the Ctrl key are
+shown literally in the source text, e.g. \Key Ctrl+Enter. Ctrl key
+accelerators have no phrase so the translator \index Comments!for
+Translators must rely on the programmer to add a "comment" which
+appears in the top right hand pane. This comment should explain what
+action the Ctrl key accelerator performs. Ideally Ctrl key
+accelerators are translated simply by copying them by chossing the \e
+{Begin from Source} entry in the \Menu Translations menu. However in
+some cases the letter will not make sense in the target language and
+must be changed. Whatever letter (or digit) is chosen, the translation
+should always be in the form "Ctrl+" followed by the letter or digit
+in upper case. As with Alt key accelerators, if the translator changes
+the key it must not conflict with any other Ctrl key accelerator.
+
+Later versions of \e {Qt Linguist} are expected to help the
+translator avoid accelerator conflicts.
+
+\section2 Dealing with Phrases that Contain Variables
+
+Some phrases contain variables. Variables are placeholders for items of
+text that are filled in at runtime. They are signified in the source
+text with a percent sign followed by a digit, e.g. \e {After processing
+file %1, file %2 is next in line}. In this example, \c %1 will be
+tqreplaced at runtime with the name of the first file to be processed and
+\c %2 with the name of the next file to be processed. In the translated
+version the variables must still appear. For example a German
+translation might reverse the phrases, e.g. \e {Datei %2 wird
+bearbeitet, wenn. Datei %1 fertig ist}. Note that both variables
+are still used but their order has changed. The order in which variables
+appear does not matter; \c %1 will always be tqreplaced by the same text
+at runtime no matter where it appears in the source text or translation
+and similarly \c %2, etc.
+
+\section2 Reusing Translations
+
+If the translated text is similar to the source text, choose the \e
+{Begin from Source} entry in the \Menu Translations menu (press \Key
+Ctrl+B) which will copy the source text into the translation area.
+
+\e {Qt Linguist} automatically lists phrases from the open phrase
+books and similar or identical phrases that have already been translated
+in the Phrases and guesses area.
+
+\section1 Creating and Using Phrase Books
+
+\index Phrases!in Qt Linguist
+\index Phrase Books
+
+\img phrasebookdialog.png
+\caption Phrase Book Dialog
+
+A \e {Qt Linguist} phrase book is a set of source phrases, target
+(translated) phrases, and optional definitions. Phrase Books are created
+independently of any application, although typically one phrase book
+will be created per application or family of applications.
+
+If the translator reaches an untranslated phrase that is the same as a
+source phrase in the phrase book, \e {Qt Linguist} will show the
+phrase book entry in the \e {Relevant phrases} panel at the bottom
+right of the main window. Phrases which have translations that conflict
+with those given in the phrase book are marked with a question mark in
+the source text pane. Phrase Books are used to provide a common set of
+translations to help ensure consistency. They can also be used to avoid
+duplication of effort since the translations for a family of
+applications can be produced once in the phrase book and the phrase book
+used for the majority of translations in each application.
+
+Before a phrase book can be edited it must be created or if it already
+exists, opened. Create a new phrase book by selecting
+\Menu {Phrase|New Phrase Book} from the menu bar. You must enter a
+filename and may change the location of the file if you wish. A newly
+created phrase book is automatically opened. Open an existing phrase
+book by choosing \Menu {Phrase|Open Phrase Book} from the menu bar.
+
+To add a new phrase click the \Button {New Phrase} button (or press
+Alt+N) and type in a new source phrase. Press Tab and type in the
+translation. Optionally press Tab and enter a definition -- this is
+useful to distinguish different translations of the same source phrase.
+This process may be repeated as often as necessary.
+
+You can delete a phrase by selecting it in the phrases list and clicking
+Remove Phrase.
+
+Click the \e Save button (press Alt+S) and then click the \e Close
+button (press Esc) once you've finished adding (and removing) phrases.
+
+When a phrase or set of phrases appears in the phrase book double
+clicking the required target phrase will copy it to the translation
+pane at the text cursor position. If you want to \e tqreplace the text
+in the translation pane with the target phrase, click the translation
+pane, choose \Menu {Edit|Select All} (press \Key Alt+A) and then
+double click the target phrase.
+
+\section1 Validation
+
+\index Validation of Translations
+\index Accelerators!Validation
+\index Punctuation!Validation
+\index Phrases!Validation
+
+\e {Qt Linguist} provides three kinds of validation on translated
+phrases.
+
+\list 1
+\i \e {Accelerator validation} detects translated phrases
+that do not have an ampersand when the source phrase does and vice
+versa.
+\i \e {Punctuation validation} detects differences in the
+terminating punctuation between source and translated phrases when this
+may be significant, e.g. warns if the source phrase ends with an
+ellipsis, exclamation mark or question mark, and the translated phrase
+doesn't and vice versa.
+\i \e {Phrases validation} detects source phrases that are
+also in the phrase book but whose translation differs from that given in
+the phrase book.
+\endlist
+
+Validation may be switched on or off from the menu bar's Validation item
+or using the toolbar buttons. Phrases that fail validation are marked
+with a question mark in the source text pane. If you switch validation
+off and then switch it on later, \e{Qt Linguist} will recheck all
+phrases and mark any that fail validation.
+
+If any phrase in a context is invalid then the context itself will be
+marked with a question mark; if all the phrases in a context are done
+and are valid the context will be marked with a tick.
+
+Note that only phrases which are marked as done (with a tick) will
+appear in the application. Invalid phrases and phrases which are
+translated but not marked as done are kept in the translation source
+file but are not used by the application.
+
+\section1 Qt Linguist Reference
+
+\section2 File Types
+
+\e {Qt Linguist} makes use of three kinds of file:
+
+\index .ts Files
+\index Translation Source Files
+\index .qm Files
+\index Qt Message Files
+\index .qph Files
+\index Qt Phrase Book Files
+
+\list
+\i \c .ts \e {translation source files} \BR are human-readable XML
+files containing source phrases and their translations. These files are
+usually created and updated by \l lupdate and are specific to an
+application.
+\i \c .qm \e {Qt message files} \BR are binary files that contain
+translations used by an application at runtime. These files are
+generated by \l lrelease, but can also be generated by \e {Qt
+Linguist}.
+\i \c .qph \e {Qt phrase book files} \BR are human-readable XML
+files containing standard phrases and their translations. These files
+are created and updated by \e {Qt Linguist} and may be used by any
+number of projects and applications.
+\endlist
+
+\section2 The Menu Bar
+
+\img menubar.png
+\caption Menu Bar
+
+\list
+\i \e {File}
+ \list
+ \i \e {Open... Ctrl+O} \BR pops up an open file dialog from which a
+ translation source \c .ts file can be chosen.
+ \i \e {Save Ctrl+S} \BR saves the current translation source \c .ts file.
+ \i \e {Save As...} \BR pops up a save as file dialog so that the
+ current translation source \c .ts file may be saved with a different
+ name and/or put in a different location.
+ \i \e {Release...} \BR pops up a save as file dialog. The
+ filename entered will be a Qt message \c .qm file of the translation
+ based on the current translation source file. The release manager's
+ command line tool \l lrelease performs the same function on
+ \e all of an application's translation source files.
+ \i \e {Print... Ctrl+P} \BR pops up a print dialog. If you click
+ OK the translation source and the translations will be printed.
+ \i \e {Recently opened files} \BR shows the \c .ts files that
+ have been opened recently, click one to open it.
+ \i \e {Exit Ctrl+Q} \BR closes \e {Qt Linguist}.
+ \endlist
+
+\i \e {Edit}
+ \list
+ \i \e {Undo Ctrl+Z} \BR undoes the last editing action in the
+ translation pane.
+ \i \e {Redo Ctrl+Y} \BR redoes the last editing action in the
+ translation pane.
+ \i \e {Cut Ctrl+X} \BR deletes any highlighted text in the
+ translation pane and saves a copy to the clipboard.
+ \i \e {Copy Ctrl+C} \BR copies the highlighted text in the
+ translation pane to the clipboard.
+ \i \e {Paste Ctrl+V} \BR pastes the clipboard text into the
+ translation pane.
+\omit
+ \i \e {Delete} \BR deletes the highlighted text in the
+ translation pane.
+\endomit
+ \i \e {Select All Ctrl+A} \BR selects all the text in the
+ translation pane ready for copying or deleting.
+ \i \e {Find... Ctrl+F} \BR pops up the
+ \link {The Find Dialog} Find dialog \endlink. When the dialog pops up
+ enter the text to be found and click the \e {Find Next} button.
+ Source phrases, translations and comments may be searched.
+ \i \e {Find Next F3} \BR tqfinds the next occurrence of the text that
+ was last entered in the Find dialog.
+ \endlist
+
+\i \e {Translation}
+ \list
+ \i \e {Prev Unfinished Ctrl+K} \BR moves to the nearest previous
+ unfinished source phrase (unfinished means untranslated or
+ translated but failed validation).
+ \i \e {Next Unfinished Ctrl+L} \BR moves to the next unfinished source
+ phrase.
+ \i \e {Prev Shift+Ctrl+K} \BR moves to the previous source phrase.
+ \i \e {Next Shift+Ctrl+L} \BR moves to the next source phrase.
+ \i \e {Done \& NextCtrl+Enter} \BR mark this phrase as 'done'
+ (translated) and move to the next unfinished source phrase.
+ \i \e {Begin from Source Ctrl+B} \BR copies the source text into
+ the translation.
+ \endlist
+
+\i \e {Validation} (See the \l Validation section)
+ \list
+ \i \e {Accelerators} \BR toggles validation on or off for Alt
+ accelerators.
+ \i \e {Ending Punctuation} \BR switches validation on or off
+ for phrase ending punctuation, e.g. ellipsis, exclamation mark,
+ question mark, etc.
+ \i \e {Phrase Matches} \BR sets validation on or off for
+ matching against translations that are in the current phrase book.
+ \endlist
+
+\i \e {Phrase} (See the section \l {Creating ... Phrase
+Books} for details.)
+ \list
+ \i \e {New Phrase Book... Ctrl+N} \BR pops up a save as file dialog.
+ You must enter a filename to be used for the phrase book and save
+ the file. Once saved you should open the phrase book to begin using
+ it.
+ \i \e {Open Phrase Book... Ctrl+H} \BR pops up an open file dialog.
+ Find and choose a phrase book to open.
+ \i \e {Close Phrase Book} \BR closes the current phrase book.
+ This will stop any further phrase validation taking place.
+ The same effect can be achieved by switching off phrase validation
+ using the Validation menu or the phrase toolbar button.
+ \i \e {Edit Phrase Book...} \BR pops up the
+ \link {The Phrase Dialog} phrase book dialog \endlink where you can
+ add, edit or delete phrases.
+ \i \e {Print Phrase Book...} \BR pops up a print dialog. If
+ you click OK the phrase book will be printed.
+ \endlist
+
+\i \e {View}
+ \list
+ \i \e {Revert Sorting} \BR puts the phrases in the source text
+ pane into their original order.
+ \i \e {Display Guesses} \BR turns the display of phrases and
+ guesses on or off.
+ \i \e {Statistics} \BR toggles the visibility of the Statistics dialog.
+ \i \e {Views} \BR toggles the visibility of the Context, Source text and
+ Phrase views.
+ \i \e {Toolbars} \BR toggles the visibility of the different toolbars.
+\omit
+ \i \e {Large Icons} \BR switches between large or standard
+ size icons on the toolbar.
+ \i \e {Text Labels} \BR toggles the use of text labels on the
+ toolbar icons.
+\endomit
+ \endlist
+
+\endlist
+
+\section2 The Toolbar
+
+\img toolbar.png
+\caption Toolbar
+
+\list
+\i \img fileopen.png
+\BR
+Pops up the open file dialog to open a new translation source \c .ts
+file.
+
+\i \img filesave.png
+\BR
+Saves the current translation source \c .ts file.
+
+\i \img fileprint.png
+\BR
+Prints the current translation source \c .ts file.
+
+\i \img phrasebookopen.png
+\BR
+Pops up the file open dialog to open a new phrase book \c .qph file.
+
+\i \img editundo.png
+\BR
+Undoes the last editing action in the translation pane.
+
+\i \img editredo.png
+\BR
+Redoes the last editing action in the translation pane.
+
+\i \img editcut.png
+\BR
+Deletes any highlighted text in the translation pane and save a copy to
+the clipboard.
+
+\i \img editcopy.png
+\BR
+Copies the highlighted text in the translation pane to the clipboard.
+
+\i \img editpaste.png
+\BR
+Pastes the clipboard text into the translation pane.
+
+\i \img editfind.png
+\BR
+Pops up the \link {The Find Dialog} Find dialog \endlink.
+
+\i \img prev.png
+\BR
+Moves to the previous source phrase.
+
+\i \img next.png
+\BR
+Moves to the next source phrase.
+
+\i \img prevunfinished.png
+\BR
+Moves to the previous unfinished source phrase.
+
+\i \img nextunfinished.png
+\BR
+Moves to the next unfinished source phrase.
+
+\i \img doneandnext.png
+\BR
+Marks the phrase as 'done' (translated) and move to the next
+unfinished source phrase.
+
+\i \img validateaccelerators.png
+\BR
+Toggles accelerator validation on and off.
+
+\i \img validatepunctuation.png
+\BR
+Toggles phrase ending punctuation validation on and off.
+
+\i \img validatephrases.png
+\BR
+Toggles phrase book validation on or off.
+\endlist
+
+\section2 The Find Dialog
+
+\img tqfinddialog.png
+\caption The Find Dialog
+
+Choose \Menu Edit|Find from the menu bar or press \Key Ctrl+F to pop
+up the Find dialog. Press \Key F3 to repeat the last search. By
+default the source phrases, translations and comments will all be
+searched and the search will be case-insensitive. These settings can
+be changed by checking or unchecking the checkboxes to reflect your
+preferences.
+
+\section2 The Phrase Dialog
+
+This dialog is explained in the \l {Creating and Using Phrase Books}
+section.
diff --git a/tqtinterface/qt4/tools/linguist/linguist.pro b/tqtinterface/qt4/tools/linguist/linguist.pro
new file mode 100644
index 0000000..3f1f286
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist.pro
@@ -0,0 +1,11 @@
+TEMPLATE = subdirs
+SUBDIRS = linguist \
+ tutorial/tt1 \
+ tutorial/tt2 \
+ tutorial/tt3 \
+ lrelease \
+ lupdate \
+ qm2ts
+CONFIG += ordered
+
+REQUIRES=full-config nocrosscompiler
diff --git a/tqtinterface/qt4/tools/linguist/linguist/about.ui b/tqtinterface/qt4/tools/linguist/linguist/about.ui
new file mode 100644
index 0000000..4d57398
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/about.ui
@@ -0,0 +1,223 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AboutDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>AboutDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>484</width>
+ <height>640</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Qt Linguist</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>PixmapLabel1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="pixmap">
+ <pixmap>splash.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="tqalignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>versionLabel</cstring>
+ </property>
+ <property name="tqalignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Copyright (C) 2000-2008 Trolltech ASA. All Rights Reserved.</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Qt Commercial Edition license holders: This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Qt Open Source Edition users: This program is licensed to you under the terms of the GNU General Public License Version 2. For details, see the file LICENSE.GPL that came with this software distribution.&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</string>
+ </property>
+ <property name="tqalignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>AboutDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/linguist/linguist/finddialog.cpp b/tqtinterface/qt4/tools/linguist/linguist/finddialog.cpp
new file mode 100644
index 0000000..6dc876c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/finddialog.cpp
@@ -0,0 +1,183 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+/* TRANSLATOR FindDialog
+
+ Choose Edit|Find from the menu bar or press Ctrl+F to pop up the
+ Find dialog
+*/
+
+#include "finddialog.h"
+
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqwhatsthis.h>
+
+FindDialog::FindDialog( bool tqreplace, TQWidget *tqparent, const char *name,
+ bool modal )
+ : TQDialog( tqparent, name, modal )
+{
+ sourceText = 0;
+
+ led = new TQLineEdit( this, "tqfind line edit" );
+ TQLabel *tqfindWhat = new TQLabel( led, tr("Fi&nd what:"), this, "tqfind what" );
+ TQLabel *tqreplaceWith = 0;
+ TQPushButton *tqfindNxt = new TQPushButton( tr("&Find Next"), this,
+ "tqfind next" );
+ tqfindNxt->setDefault( TRUE );
+ connect( tqfindNxt, TQT_SIGNAL(clicked()), this, TQT_SLOT(emitFindNext()) );
+ TQPushButton *cancel = new TQPushButton( tr("Cancel"), this, "cancel tqfind" );
+ connect( cancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()) );
+
+ TQVBoxLayout *bl = new TQVBoxLayout( 6, "tqfind button tqlayout" );
+ bl->addWidget( tqfindNxt );
+
+ matchCase = new TQCheckBox( tr("&Match case"), this, "tqfind match case" );
+ matchCase->setChecked( FALSE );
+
+ if ( tqreplace ) {
+ TQWhatsThis::add( this, tr("This window allows you to search and tqreplace"
+ " some text in the translations.") );
+
+ red = new TQLineEdit( this, "tqreplace line edit" );
+ tqreplaceWith = new TQLabel( red, tr("Replace &with:"), this,
+ "tqreplace with" );
+ setTabOrder( led, red );
+
+ TQPushButton *tqreplace = new TQPushButton( tr("&Replace"), this,
+ "tqreplace" );
+ connect( tqreplace, TQT_SIGNAL(clicked()), this, TQT_SLOT(emitReplace()) );
+ TQPushButton *tqreplaceAll = new TQPushButton( tr("Replace &All"), this,
+ "tqreplace all" );
+ connect( tqreplaceAll, TQT_SIGNAL(clicked()), this, TQT_SLOT(emitReplaceAll()) );
+ setTabOrder( tqfindNxt, tqreplace );
+ setTabOrder( tqreplace, tqreplaceAll );
+ setTabOrder( tqreplaceAll, cancel );
+
+ TQWhatsThis::add( tqreplace, tr("Click here to tqreplace the next occurrence"
+ " of the text you typed in.") );
+ TQWhatsThis::add( tqreplaceAll, tr("Click here to tqreplace all occurrences"
+ " of the text you typed in.") );
+
+ bl->addWidget( tqreplace );
+ bl->addWidget( tqreplaceAll );
+
+ TQGridLayout *gl = new TQGridLayout( this, 4, 3, 11, 11,
+ "tqfind outer tqlayout" );
+ gl->addWidget( tqfindWhat, 0, 0 );
+ gl->addWidget( led, 0, 1 );
+ gl->addWidget( tqreplaceWith, 1, 0 );
+ gl->addWidget( red, 1, 1 );
+ gl->addMultiCellWidget( matchCase, 2, 2, 0, 1 );
+ gl->addMultiCell( bl, 0, 3, 3, 3 );
+ } else {
+ TQWhatsThis::add( this, tr("This window allows you to search for some"
+ " text in the translation source file.") );
+
+ sourceText = new TQCheckBox( tr("&Source texts"), this,
+ "tqfind in source texts" );
+ sourceText->setChecked( TRUE );
+ translations = new TQCheckBox( tr("&Translations"), this,
+ "tqfind in translations" );
+ translations->setChecked( TRUE );
+ comments = new TQCheckBox( tr("&Comments"), this, "tqfind in comments" );
+ comments->setChecked( TRUE );
+
+ TQWhatsThis::add( sourceText, tr("Source texts are searched when"
+ " checked.") );
+ TQWhatsThis::add( translations, tr("Translations are searched when"
+ " checked.") );
+ TQWhatsThis::add( comments, tr("Comments and contexts are searched when"
+ " checked.") );
+
+ TQVBoxLayout *cl = new TQVBoxLayout( 6, "tqfind checkbox tqlayout" );
+
+ TQGridLayout *gl = new TQGridLayout( this, 3, 4, 11, 11,
+ "tqfind outer tqlayout" );
+ gl->addWidget( tqfindWhat, 0, 0 );
+ gl->addMultiCellWidget( led, 0, 0, 1, 2 );
+ gl->addWidget( matchCase, 1, 2 );
+ gl->addMultiCell( bl, 0, 2, 3, 3 );
+ gl->addMultiCell( cl, 1, 2, 0, 1 );
+ gl->setColStretch( 0, 0 );
+ gl->addColSpacing( 1, 40 );
+ gl->setColStretch( 2, 1 );
+ gl->setColStretch( 3, 0 );
+
+ cl->addWidget( sourceText );
+ cl->addWidget( translations );
+ cl->addWidget( comments );
+ cl->addStretch( 1 );
+ }
+
+ TQWhatsThis::add( led, tr("Type in the text to search for.") );
+
+ TQWhatsThis::add( matchCase, tr("Texts such as 'TeX' and 'tex' are"
+ " considered as different when checked.") );
+ TQWhatsThis::add( tqfindNxt, tr("Click here to tqfind the next occurrence of the"
+ " text you typed in.") );
+ TQWhatsThis::add( cancel, tr("Click here to close this window.") );
+
+ bl->addWidget( cancel );
+ bl->addStretch( 1 );
+
+ resize( 400, 1 );
+ setMaximumHeight( height() );
+
+ led->setFocus();
+}
+
+void FindDialog::emitFindNext()
+{
+ int where;
+ if ( sourceText != 0 )
+ where = ( sourceText->isChecked() ? SourceText : 0 ) |
+ ( translations->isChecked() ? Translations : 0 ) |
+ ( comments->isChecked() ? Comments : 0 );
+ else
+ where = Translations;
+ emit tqfindNext( led->text(), where, matchCase->isChecked() );
+}
+
+void FindDialog::emitReplace()
+{
+ emit tqreplace( led->text(), red->text(), matchCase->isChecked(), FALSE );
+}
+
+void FindDialog::emitReplaceAll()
+{
+ emit tqreplace( led->text(), red->text(), matchCase->isChecked(), TRUE );
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/finddialog.h b/tqtinterface/qt4/tools/linguist/linguist/finddialog.h
new file mode 100644
index 0000000..2cf8e43
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/finddialog.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef FINDDIALOG_H
+#define FINDDIALOG_H
+
+#include <tqdialog.h>
+
+class TQCheckBox;
+class TQLineEdit;
+
+class FindDialog : public TQDialog
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ enum { SourceText = 0x1, Translations = 0x2, Comments = 0x4 };
+
+ FindDialog( bool tqreplace, TQWidget *tqparent = 0, const char *name = 0, bool modal = FALSE );
+
+Q_SIGNALS:
+ void tqfindNext( const TQString& text, int where, bool matchCase );
+ void tqreplace( const TQString& before, const TQString& after, bool matchCase, bool all );
+
+private Q_SLOTS:
+ void emitFindNext();
+ void emitReplace();
+ void emitReplaceAll();
+
+private:
+ TQLineEdit *led;
+ TQLineEdit *red;
+ TQCheckBox *sourceText;
+ TQCheckBox *translations;
+ TQCheckBox *comments;
+ TQCheckBox *matchCase;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/accelerator.png b/tqtinterface/qt4/tools/linguist/linguist/images/accelerator.png
new file mode 100644
index 0000000..173adb4
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/accelerator.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/appicon.png b/tqtinterface/qt4/tools/linguist/linguist/images/appicon.png
new file mode 100644
index 0000000..90e143b
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/appicon.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/book.png b/tqtinterface/qt4/tools/linguist/linguist/images/book.png
new file mode 100644
index 0000000..dd850ab
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/book.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_accelerator.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_accelerator.png
new file mode 100644
index 0000000..eaa2be6
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_accelerator.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_book.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_book.png
new file mode 100644
index 0000000..b61d611
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_book.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_doneandnext.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_doneandnext.png
new file mode 100644
index 0000000..e3a3fe1
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_doneandnext.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_editcopy.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_editcopy.png
new file mode 100644
index 0000000..578b591
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_editcut.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_editcut.png
new file mode 100644
index 0000000..8d50ae0
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_editpaste.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_editpaste.png
new file mode 100644
index 0000000..78cab10
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_editpaste.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_fileopen.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_fileopen.png
new file mode 100644
index 0000000..ddbd33d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_filesave.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_filesave.png
new file mode 100644
index 0000000..5d1476d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_next.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_next.png
new file mode 100644
index 0000000..f455e1f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_next.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_nextunfinished.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_nextunfinished.png
new file mode 100644
index 0000000..c2b06ec
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_nextunfinished.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_phrase.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_phrase.png
new file mode 100644
index 0000000..acdd253
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_phrase.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_prev.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_prev.png
new file mode 100644
index 0000000..a68fe54
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_prev.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_prevunfinished.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_prevunfinished.png
new file mode 100644
index 0000000..ce956a7
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_prevunfinished.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_print.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_print.png
new file mode 100644
index 0000000..b2791a7
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_print.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_punctuation.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_punctuation.png
new file mode 100644
index 0000000..8eebab8
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_punctuation.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_redo.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_redo.png
new file mode 100644
index 0000000..6e993cc
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_redo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_danger.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_danger.png
new file mode 100644
index 0000000..3fadeb1
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_danger.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_obs.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_obs.png
new file mode 100644
index 0000000..4836e2f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_obs.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_off.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_off.png
new file mode 100644
index 0000000..58f7fb6
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_off.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_on.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_on.png
new file mode 100644
index 0000000..4836e2f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_s_check_on.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_searchfind.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_searchfind.png
new file mode 100644
index 0000000..e85e33f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_searchfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/d_undo.png b/tqtinterface/qt4/tools/linguist/linguist/images/d_undo.png
new file mode 100644
index 0000000..22ac97f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/d_undo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/doneandnext.png b/tqtinterface/qt4/tools/linguist/linguist/images/doneandnext.png
new file mode 100644
index 0000000..1cf8888
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/doneandnext.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/editcopy.png b/tqtinterface/qt4/tools/linguist/linguist/images/editcopy.png
new file mode 100644
index 0000000..804c98c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/editcopy.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/editcut.png b/tqtinterface/qt4/tools/linguist/linguist/images/editcut.png
new file mode 100644
index 0000000..a911482
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/editcut.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/editpaste.png b/tqtinterface/qt4/tools/linguist/linguist/images/editpaste.png
new file mode 100644
index 0000000..1938141
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/editpaste.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/fileopen.png b/tqtinterface/qt4/tools/linguist/linguist/images/fileopen.png
new file mode 100644
index 0000000..3005290
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/fileopen.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/filesave.png b/tqtinterface/qt4/tools/linguist/linguist/images/filesave.png
new file mode 100644
index 0000000..c137165
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/filesave.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/next.png b/tqtinterface/qt4/tools/linguist/linguist/images/next.png
new file mode 100644
index 0000000..4b29ff4
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/next.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/nextunfinished.png b/tqtinterface/qt4/tools/linguist/linguist/images/nextunfinished.png
new file mode 100644
index 0000000..9892b65
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/nextunfinished.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/pagecurl.png b/tqtinterface/qt4/tools/linguist/linguist/images/pagecurl.png
new file mode 100644
index 0000000..2d3f2ff
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/pagecurl.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/phrase.png b/tqtinterface/qt4/tools/linguist/linguist/images/phrase.png
new file mode 100644
index 0000000..d7dfcb5
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/phrase.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/prev.png b/tqtinterface/qt4/tools/linguist/linguist/images/prev.png
new file mode 100644
index 0000000..4e3556c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/prev.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/prevunfinished.png b/tqtinterface/qt4/tools/linguist/linguist/images/prevunfinished.png
new file mode 100644
index 0000000..a3bed54
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/prevunfinished.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/print.png b/tqtinterface/qt4/tools/linguist/linguist/images/print.png
new file mode 100644
index 0000000..cc083ed
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/print.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/punctuation.png b/tqtinterface/qt4/tools/linguist/linguist/images/punctuation.png
new file mode 100644
index 0000000..849d4a9
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/punctuation.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/redo.png b/tqtinterface/qt4/tools/linguist/linguist/images/redo.png
new file mode 100644
index 0000000..abdad26
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/redo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/s_check_danger.png b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_danger.png
new file mode 100644
index 0000000..7005304
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_danger.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/s_check_obs.png b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_obs.png
new file mode 100644
index 0000000..b171b2a
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_obs.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/s_check_off.png b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_off.png
new file mode 100644
index 0000000..cf45bc0
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_off.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/s_check_on.png b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_on.png
new file mode 100644
index 0000000..b5238f7
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/s_check_on.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/searchfind.png b/tqtinterface/qt4/tools/linguist/linguist/images/searchfind.png
new file mode 100644
index 0000000..3f369fd
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/searchfind.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/splash.png b/tqtinterface/qt4/tools/linguist/linguist/images/splash.png
new file mode 100644
index 0000000..8e80718
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/splash.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/undo.png b/tqtinterface/qt4/tools/linguist/linguist/images/undo.png
new file mode 100644
index 0000000..839a823
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/undo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/images/whatsthis.xpm b/tqtinterface/qt4/tools/linguist/linguist/images/whatsthis.xpm
new file mode 100644
index 0000000..e45dc26
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/images/whatsthis.xpm
@@ -0,0 +1,24 @@
+/* XPM */
+static char *magick[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 3 1",
+" c None",
+"o c #000000000000",
+"a c #000000008000",
+/* pixels */
+"o aaaaa ",
+"oo aaa aaa ",
+"ooo aaa aaa",
+"oooo aa aa",
+"ooooo aa aa",
+"oooooo a aaa",
+"ooooooo aaa ",
+"oooooooo aaa ",
+"ooooooooo aaa ",
+"ooooo aaa ",
+"oo ooo ",
+"o ooo aaa ",
+" ooo aaa ",
+" ooo ",
+" ooo ",
+" ooo "};
diff --git a/tqtinterface/qt4/tools/linguist/linguist/linguist.icns b/tqtinterface/qt4/tools/linguist/linguist/linguist.icns
new file mode 100644
index 0000000..f51565e
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/linguist.icns
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/linguist.ico b/tqtinterface/qt4/tools/linguist/linguist/linguist.ico
new file mode 100644
index 0000000..2816c7c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/linguist.ico
Binary files differ
diff --git a/tqtinterface/qt4/tools/linguist/linguist/linguist.pro b/tqtinterface/qt4/tools/linguist/linguist/linguist.pro
new file mode 100644
index 0000000..bd51ac3
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/linguist.pro
@@ -0,0 +1,109 @@
+TEMPLATE = app
+LANGUAGE = C++
+CONFIG += qt warn_on
+
+
+SOURCES += finddialog.cpp \
+ main.cpp \
+ msgedit.cpp \
+ phrase.cpp \
+ phrasebookbox.cpp \
+ phraselv.cpp \
+ printout.cpp \
+ simtexth.cpp \
+ trwindow.cpp \
+ listviews.cpp \
+ ../shared/metatranslator.cpp
+HEADERS += finddialog.h \
+ msgedit.h \
+ phrase.h \
+ phrasebookbox.h \
+ phraselv.h \
+ printout.h \
+ trwindow.h \
+ listviews.h \
+ ../shared/metatranslator.h
+
+
+TRANSLATIONS = linguist_de.ts \
+ linguist_fr.ts
+
+DEFINES += QT_INTERNAL_XML
+include( ../../../src/qt_professional.pri )
+
+DESTDIR = ../../../bin
+TARGET = linguist
+
+
+LIBS += -L$$QT_BUILD_TREE/lib -ltqassistantclient
+
+win32:RC_FILE = linguist.rc
+
+mac {
+ staticlib:CONFIG -= global_init_link_order #yuck
+ RC_FILE = linguist.icns
+}
+
+PROJECTNAME = Qt Linguist
+
+target.path=$$bins.path
+INSTALLS += target
+
+linguisttranslations.files = *.qm
+linguisttranslations.path = $$translations.path
+INSTALLS += linguisttranslations
+
+phrasebooks.path=$$data.path/phrasebooks
+phrasebooks.files = ../phrasebooks/*
+INSTALLS += phrasebooks
+FORMS = about.ui \
+ statistics.ui
+IMAGES = images/accelerator.png \
+ images/book.png \
+ images/s_check_danger.png \
+ images/s_check_obs.png \
+ images/s_check_off.png \
+ images/s_check_on.png \
+ images/d_s_check_danger.png \
+ images/d_s_check_obs.png \
+ images/d_s_check_off.png \
+ images/d_s_check_on.png \
+ images/d_accelerator.png \
+ images/d_book.png \
+ images/d_doneandnext.png \
+ images/d_editcopy.png \
+ images/d_editcut.png \
+ images/d_editpaste.png \
+ images/d_fileopen.png \
+ images/d_filesave.png \
+ images/d_next.png \
+ images/d_nextunfinished.png \
+ images/d_prev.png \
+ images/d_prevunfinished.png \
+ images/d_phrase.png \
+ images/d_print.png \
+ images/d_punctuation.png \
+ images/d_redo.png \
+ images/d_searchfind.png \
+ images/d_undo.png \
+ images/doneandnext.png \
+ images/editcopy.png \
+ images/editcut.png \
+ images/editpaste.png \
+ images/punctuation.png \
+ images/fileopen.png \
+ images/filesave.png \
+ images/appicon.png \
+ images/next.png \
+ images/nextunfinished.png \
+ images/pagecurl.png \
+ images/phrase.png \
+ images/prev.png \
+ images/prevunfinished.png \
+ images/print.png \
+ images/redo.png \
+ images/searchfind.png \
+ images/splash.png \
+ images/undo.png \
+ images/whatsthis.xpm
+INCLUDEPATH += ../shared
diff --git a/tqtinterface/qt4/tools/linguist/linguist/linguist.rc b/tqtinterface/qt4/tools/linguist/linguist/linguist.rc
new file mode 100644
index 0000000..865e021
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/linguist.rc
@@ -0,0 +1 @@
+IDI_ICON1 ICON DISCARDABLE "linguist.ico"
diff --git a/tqtinterface/qt4/tools/linguist/linguist/linguist_de.ts b/tqtinterface/qt4/tools/linguist/linguist/linguist_de.ts
new file mode 100644
index 0000000..31e6737
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/linguist_de.ts
@@ -0,0 +1,993 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copyright (C) 2000-2008 Trolltech ASA. All Rights Reserved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;This program is licensed to you under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation. This gives you legal permission to copy, distribute and/or modify this software under certain conditions. For details, see the file &apos;LICENSE.GPL&apos; that came with this software distribution. If you did not get the file, send email to info@trolltech.com.&lt;/p&gt;
+&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>EditorPage</name>
+ <message>
+ <source>Source text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FindDialog</name>
+ <comment>Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog</comment>
+ <message>
+ <source>Fi&amp;nd what:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Find Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Match case</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This window allows you to search and tqreplace some text in the translations.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace &amp;with:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to tqreplace the next occurrence of the text you typed in.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to tqreplace all occurrences of the text you typed in.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This window allows you to search for some text in the translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Source texts</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Translations</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source texts are searched when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translations are searched when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Comments and contexts are searched when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type in the text to search for.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Texts such as &apos;TeX&apos; and &apos;tex&apos; are considered as different when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to tqfind the next occurrence of the text you typed in.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to close this window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MessageEditor</name>
+ <message>
+ <source>bell</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>backspace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>new page</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>new line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>carriage return</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>tab</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrases</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrases and guesses:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This whole panel allows you to view and edit the translation of some source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This area shows the source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This area shows a comment that may guide you, and the context in which the text occurs.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is where you can enter or modify the translation of some source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Guess</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Guess (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PageCurl</name>
+ <message>
+ <source>Next unfinished phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Previous unfinished phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PhraseBookBox</name>
+ <comment>Go to Phrase &gt; Edit Phrase Book... The dialog that pops up is a PhraseBookBox.</comment>
+ <message>
+ <source>S&amp;ource phrase:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Translation:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Definition:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;New Phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Remove Phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This window allows you to add, modify, or delete phrases in a phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is the phrase in the source language.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is the phrase in the target language corresponding to the source phrase.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is a definition for the source phrase.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to add the phrase to the phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to remove the phrase from the phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to save the changes made.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to close this window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot save phrase book &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PhraseLV</name>
+ <comment>The phrase list in the right panel of the main window (with Source phrase, Target phrase, and Definition in its header) is a PhraseLV object.</comment>
+ <message>
+ <source>(New Phrase)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is a list of phrase entries relevant to the source text. Each phrase is supplemented with a suggested translation and a definition.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;u&gt;%1:&lt;/u&gt;&amp;nbsp;&amp;nbsp;%2&lt;/p&gt;&lt;p&gt;&lt;u&gt;%3:&lt;/u&gt;&amp;nbsp;&amp;nbsp;%4&lt;/p&gt;&lt;p&gt;&lt;u&gt;%5:&lt;/u&gt;&amp;nbsp;&amp;nbsp;%6&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Definition</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TQT_BASE_OBJECT_NAME</name>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TrWindow</name>
+ <comment>This is the application&apos;s main window.</comment>
+ <message>
+ <source>Context</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Items</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This panel lists the source contexts.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This panel lists the source texts. Items that violate validation rules are marked with a warning.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Loading...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 source phrase(s) loaded.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot open &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt translation source (*.ts)
+All files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File saved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot save &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt message files for released applications (*.qm)
+All files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Context: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>finished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>unresolved</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>obsolete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing... (page %1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing completed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing aborted</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search wrapped.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot tqfind the string &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt phrase books (*.qph)
+All files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create New Phrase Book</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A file called &apos;%1&apos; already exists. Please choose another name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrase book created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 phrase(s) loaded.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 - %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Do you want to save &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist by Trolltech</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No phrase to translate.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No untranslated phrases left.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>V&amp;alidation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Phrases</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;View</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+O</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+S</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save &amp;As...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Release...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Print...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+P</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Re&amp;cently opened files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E&amp;xit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Q</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Z</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Y</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cu&amp;t</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+X</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+C</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+V</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+A</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Find...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+F</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find &amp;Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Replace...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+H</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Prev Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+K</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Next Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+L</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>P&amp;rev</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Shift+K</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ne&amp;xt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Shift+L</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done and &amp;Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Enter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Return</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Begin from Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;New Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+N</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Close Phrase Book</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Edit Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Print Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Ending Punctuation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Phrase Matches</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Revert Sorting</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Display guesses</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Vie&amp;ws</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Toolbars</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About &amp;Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;What&apos;s This?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open a Qt translation source file (TS file) for editing.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes made to this Qt translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes made to this Qt translationsource file into a new file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create a Qt message file suitable for released applications from the current message file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Print a list of all the phrases in the current Qt translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close this window and exit.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Undo the last editing operation performed on the translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redo an undone editing operation performed on the translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy the selected translation text to the clipboard and deletes it.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy the selected translation text to the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste the clipboard text into the translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select the whole translation text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search for some text in the translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Continue the search where it was left.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search for some text in the translation source file and tqreplace it by another text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create a new phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open a phrase book to assist translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Toggle validity checks of accelerators.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Toggle validity checks of ending punctuation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Toggle checking that phrase suggestions are used.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sort the items back in the same order as in the message file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set whether or not to display translation guesses.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display the manual for %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display information about %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display information about the Qt toolkit by Trolltech.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enter What&apos;s This? mode.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copies the source text into the translation field.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the next item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the previous item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the next unfinished item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the previous unfinished item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Marks this item as done and moves to the next unfinished item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Validation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Print</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open Phrase Book</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cut</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Prev</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Prev Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done and Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Punctuation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrases</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>What&apos;s This?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot read from phrase book &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close this phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Allow you to add, modify, or delete phrases of this phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Print the entries of the phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot create phrase book &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Accelerator possibly superfluous in translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Accelerator possibly missing in translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation does not end with the same punctuation as the source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A phrase book suggestion for &apos;%1&apos; was ignored.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Version %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tqtinterface/qt4/tools/linguist/linguist/linguist_fr.ts b/tqtinterface/qt4/tools/linguist/linguist/linguist_fr.ts
new file mode 100644
index 0000000..31e6737
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/linguist_fr.ts
@@ -0,0 +1,993 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>AboutDialog</name>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copyright (C) 2000-2008 Trolltech ASA. All Rights Reserved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;This program is licensed to you under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation. This gives you legal permission to copy, distribute and/or modify this software under certain conditions. For details, see the file &apos;LICENSE.GPL&apos; that came with this software distribution. If you did not get the file, send email to info@trolltech.com.&lt;/p&gt;
+&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>EditorPage</name>
+ <message>
+ <source>Source text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FindDialog</name>
+ <comment>Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog</comment>
+ <message>
+ <source>Fi&amp;nd what:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Find Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Match case</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This window allows you to search and tqreplace some text in the translations.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace &amp;with:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to tqreplace the next occurrence of the text you typed in.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to tqreplace all occurrences of the text you typed in.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This window allows you to search for some text in the translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Source texts</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Translations</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source texts are searched when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translations are searched when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Comments and contexts are searched when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type in the text to search for.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Texts such as &apos;TeX&apos; and &apos;tex&apos; are considered as different when checked.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to tqfind the next occurrence of the text you typed in.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to close this window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>MessageEditor</name>
+ <message>
+ <source>bell</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>backspace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>new page</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>new line</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>carriage return</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>tab</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrases</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrases and guesses:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This whole panel allows you to view and edit the translation of some source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This area shows the source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This area shows a comment that may guide you, and the context in which the text occurs.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is where you can enter or modify the translation of some source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Guess</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Guess (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PageCurl</name>
+ <message>
+ <source>Next unfinished phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Previous unfinished phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PhraseBookBox</name>
+ <comment>Go to Phrase &gt; Edit Phrase Book... The dialog that pops up is a PhraseBookBox.</comment>
+ <message>
+ <source>S&amp;ource phrase:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Translation:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Definition:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;New Phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Remove Phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This window allows you to add, modify, or delete phrases in a phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is the phrase in the source language.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is the phrase in the target language corresponding to the source phrase.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is a definition for the source phrase.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to add the phrase to the phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to remove the phrase from the phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to save the changes made.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Click here to close this window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot save phrase book &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>PhraseLV</name>
+ <comment>The phrase list in the right panel of the main window (with Source phrase, Target phrase, and Definition in its header) is a PhraseLV object.</comment>
+ <message>
+ <source>(New Phrase)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This is a list of phrase entries relevant to the source text. Each phrase is supplemented with a suggested translation and a definition.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;&lt;u&gt;%1:&lt;/u&gt;&amp;nbsp;&amp;nbsp;%2&lt;/p&gt;&lt;p&gt;&lt;u&gt;%3:&lt;/u&gt;&amp;nbsp;&amp;nbsp;%4&lt;/p&gt;&lt;p&gt;&lt;u&gt;%5:&lt;/u&gt;&amp;nbsp;&amp;nbsp;%6&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Source phrase</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Definition</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TQT_BASE_OBJECT_NAME</name>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TrWindow</name>
+ <comment>This is the application&apos;s main window.</comment>
+ <message>
+ <source>Context</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Items</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This panel lists the source contexts.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>This panel lists the source texts. Items that violate validation rules are marked with a warning.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Loading...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 source phrase(s) loaded.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot open &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt translation source (*.ts)
+All files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File saved.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot save &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt message files for released applications (*.qm)
+All files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Context: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>finished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>unresolved</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>obsolete</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing... (page %1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing completed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Printing aborted</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search wrapped.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot tqfind the string &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt phrase books (*.qph)
+All files (*)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create New Phrase Book</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A file called &apos;%1&apos; already exists. Please choose another name.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrase book created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 phrase(s) loaded.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%1 - %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Do you want to save &apos;%1&apos;?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Qt Linguist by Trolltech</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No phrase to translate.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No untranslated phrases left.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>V&amp;alidation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Phrases</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;View</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+O</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+S</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save &amp;As...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Release...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Print...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+P</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Re&amp;cently opened files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E&amp;xit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Q</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Z</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Y</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cu&amp;t</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+X</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+C</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+V</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select &amp;All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+A</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Find...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+F</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find &amp;Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Replace...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+H</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Prev Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+K</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Next Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+L</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>P&amp;rev</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Shift+K</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ne&amp;xt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Shift+L</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done and &amp;Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Enter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+Return</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Begin from Source</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;New Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ctrl+N</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Open Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Close Phrase Book</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Edit Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Print Phrase Book...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Ending Punctuation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Phrase Matches</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Revert Sorting</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Display guesses</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Vie&amp;ws</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Toolbars</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Manual</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About &amp;Qt</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;What&apos;s This?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open a Qt translation source file (TS file) for editing.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes made to this Qt translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save changes made to this Qt translationsource file into a new file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create a Qt message file suitable for released applications from the current message file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Print a list of all the phrases in the current Qt translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close this window and exit.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Undo the last editing operation performed on the translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redo an undone editing operation performed on the translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy the selected translation text to the clipboard and deletes it.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy the selected translation text to the clipboard.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste the clipboard text into the translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Select the whole translation text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search for some text in the translation source file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Continue the search where it was left.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Search for some text in the translation source file and tqreplace it by another text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Create a new phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open a phrase book to assist translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Toggle validity checks of accelerators.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Toggle validity checks of ending punctuation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Toggle checking that phrase suggestions are used.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sort the items back in the same order as in the message file.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set whether or not to display translation guesses.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display the manual for %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display information about %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display information about the Qt toolkit by Trolltech.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enter What&apos;s This? mode.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copies the source text into the translation field.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the next item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the previous item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the next unfinished item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Moves to the previous unfinished item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Marks this item as done and moves to the next unfinished item.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>File</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Validation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Help</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Print</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Open Phrase Book</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Undo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Redo</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cut</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Paste</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Find</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Replace</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Prev</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Prev Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next Unfinished</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Done and Next</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Accelerators</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Punctuation</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Phrases</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>What&apos;s This?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot read from phrase book &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Close this phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Allow you to add, modify, or delete phrases of this phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Print the entries of the phrase book.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot create phrase book &apos;%1&apos;.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Accelerator possibly superfluous in translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Accelerator possibly missing in translation.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Translation does not end with the same punctuation as the source text.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>A phrase book suggestion for &apos;%1&apos; was ignored.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Version %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tqtinterface/qt4/tools/linguist/linguist/listviews.cpp b/tqtinterface/qt4/tools/linguist/linguist/listviews.cpp
new file mode 100644
index 0000000..5c298b2
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/listviews.cpp
@@ -0,0 +1,350 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "listviews.h"
+
+#include <tqpainter.h>
+
+static const int Text0MaxLen = 150;
+static const int Text1MaxLen = 150;
+
+/*
+ LVI implementation
+*/
+
+static TQString rho( int n )
+{
+ TQString s;
+ s.sprintf( "%.10d", n );
+ return s;
+}
+
+int LVI::count = 0;
+
+LVI::LVI( TQListView * tqparent, TQString text )
+ : TQListViewItem( tqparent, text )
+{
+ setText( 0, rho(count++) );
+}
+
+LVI::LVI( TQListViewItem * tqparent, TQString text )
+ : TQListViewItem( tqparent, text )
+{
+ setText( 0, rho(count++) );
+}
+
+/*
+ This is a cut-down version of TQListViewItem::paintCell() -
+ it is needed to produce the effect we want on obsolete items
+ */
+void LVI::drawObsoleteText( TQPainter * p, const TQColorGroup & cg, int column,
+ int width, int align )
+{
+ TQListView * lv = listView();
+ int marg = lv ? lv->itemMargin() : 1;
+ int r = marg;
+ p->fillRect( 0, 0, width, height(), cg.brush( TQColorGroup::Base ) );
+ if ( isSelected() && (column==0 || listView()->allColumnsShowFocus()) )
+ p->fillRect( r - marg, 0, width - r + marg, height(),
+ cg.brush( TQColorGroup::Highlight ) );
+
+ // Do the ellipsis thingy
+ TQString t = text( column );
+ TQString tmp;
+ int i = 0;
+ if ( p->fontMetrics().width( t ) > width ) {
+ tmp = "...";
+ while ( p->fontMetrics().width( tmp + t[i] ) < width )
+ tmp += t[ i++ ];
+ tmp.remove( (uint)0, 3 );
+ if ( tmp.isEmpty() )
+ tmp = t.left( 1 );
+ tmp += "...";
+ t = tmp;
+ }
+ if ( isSelected() )
+ p->setPen( lv->tqpalette().disabled().highlightedText() );
+ else
+ p->setPen( lv->tqpalette().disabled().text() );
+
+ if ( !t.isEmpty() ) {
+ p->drawText( r, 0, width-marg-r, height(),
+ align | AlignVCenter | SingleLine, t );
+ }
+
+}
+
+int LVI::compare( TQListViewItem *other, int column, bool ascending ) const
+{
+ TQString thisKey = key( column, ascending );
+ TQString otherKey = other->key( column, ascending );
+
+ if ( thisKey.tqcontains('&') || otherKey.tqcontains('&') ) {
+ TQString nicerThisKey = thisKey;
+ TQString nicerOtherKey = otherKey;
+
+ nicerThisKey.tqreplace( "&", "" );
+ nicerOtherKey.tqreplace( "&", "" );
+
+ int delta = nicerThisKey.localeAwareCompare( nicerOtherKey );
+ if ( delta != 0 )
+ return delta;
+ }
+ return thisKey.localeAwareCompare( otherKey );
+}
+
+static TQString fixEllipsis( const TQString & str, int len )
+{
+ TQString shortened = str.simplifyWhiteSpace();
+ if ( (int) shortened.length() > len ) {
+ TQString dots = TrWindow::tr( "..." );
+ shortened.truncate( len - dots.length() );
+ shortened.append( dots );
+ }
+ return shortened;
+}
+
+/*
+ MessageLVI implementation
+*/
+MessageLVI::MessageLVI( TQListView *tqparent,
+ const MetaTranslatorMessage & message,
+ const TQString& text, const TQString& comment,
+ ContextLVI * c )
+ : LVI( tqparent ), m( message ), tx( text ), com( comment ), ctxt( c )
+{
+ if ( m.translation().isEmpty() ) {
+ TQString t = "";
+ m.setTranslation( t );
+ }
+ setText( 1, fixEllipsis( text, Text0MaxLen ) );
+ fini = TRUE;
+ d = FALSE;
+
+ if( m.type() == MetaTranslatorMessage::Unfinished )
+ setFinished( FALSE );
+}
+
+void MessageLVI::updateTranslationText()
+{
+ setText( 2, fixEllipsis( m.translation(), Text1MaxLen ) );
+}
+
+void MessageLVI::paintCell( TQPainter * p, const TQColorGroup & cg, int column,
+ int width, int align )
+{
+ if ( column == 0 ) {
+ int x = (width/2) - TrWindow::pxOn->width()/2;
+ int y = (height()/2) - TrWindow::pxOn->height()/2;
+
+ int marg = listView() ? listView()->itemMargin() : 1;
+ int r = marg;
+
+ if ( isSelected() )
+ p->fillRect( r - marg, 0, width - r + marg, height(),
+ cg.brush( TQColorGroup::Highlight ) );
+ else
+ p->fillRect( 0, 0, width, height(),
+ cg.brush( TQColorGroup::Base ) );
+
+ if ( m.type() == MetaTranslatorMessage::Unfinished && danger() )
+ p->drawPixmap( x, y, *TrWindow::pxDanger );
+ else if ( m.type() == MetaTranslatorMessage::Finished )
+ p->drawPixmap( x, y, *TrWindow::pxOn );
+ else if ( m.type() == MetaTranslatorMessage::Unfinished )
+ p->drawPixmap( x, y, *TrWindow::pxOff );
+ else if ( m.type() == MetaTranslatorMessage::Obsolete )
+ p->drawPixmap( x, y, *TrWindow::pxObsolete );
+ } else {
+ if ( m.type() == MetaTranslatorMessage::Obsolete )
+ drawObsoleteText( p, cg, column, width, align );
+ else
+ TQListViewItem::paintCell( p, cg, column, width, align );
+ }
+}
+
+
+void MessageLVI::setTranslation( const TQString& translation )
+{
+ m.setTranslation( translation );
+}
+
+void MessageLVI::setFinished( bool finished )
+{
+ if ( !fini && finished ) {
+ m.setType( MetaTranslatorMessage::Finished );
+ tqrepaint();
+ ctxt->decrementUnfinishedCount();
+ } else if ( fini && !finished ) {
+ m.setType( MetaTranslatorMessage::Unfinished );
+ tqrepaint();
+ ctxt->incrementUnfinishedCount();
+ }
+ fini = finished;
+}
+
+void MessageLVI::setDanger( bool danger )
+{
+ if ( !d && danger ) {
+ ctxt->incrementDangerCount();
+ tqrepaint();
+ } else if ( d && !danger ) {
+ ctxt->decrementDangerCount();
+ tqrepaint();
+ }
+ d = danger;
+}
+
+TQString MessageLVI::context() const
+{
+ return TQString( m.context() );
+}
+
+MetaTranslatorMessage MessageLVI::message() const
+{
+ return m;
+}
+
+/*
+ ContextLVI implementation
+*/
+ContextLVI::ContextLVI( TQListView *lv, const TQString& context )
+ : LVI( lv ), com( "" )
+{
+ messageItems.setAutoDelete( TRUE );
+
+ unfinishedCount = 0;
+ dangerCount = 0;
+ obsoleteCount = 0;
+ itemCount = 0;
+ setText( 1, context );
+}
+
+void ContextLVI::instantiateMessageItem( TQListView * lv, MessageLVI * i )
+{
+ itemCount++;
+ appendMessageItem( lv, i );
+}
+
+void ContextLVI::appendMessageItem( TQListView * lv, MessageLVI * i )
+{
+ lv->takeItem( i );
+ messageItems.append( i );
+}
+
+void ContextLVI::updatetqStatus()
+{
+ TQString s;
+ s.sprintf( "%d/%d", itemCount - unfinishedCount - obsoleteCount,
+ itemCount - obsoleteCount );
+ setText( 2, s );
+}
+
+void ContextLVI::paintCell( TQPainter * p, const TQColorGroup & cg, int column,
+ int width, int align )
+{
+ if ( column == 0 ) {
+ int x = (width/2) - TrWindow::pxOn->width()/2;
+ int y = (height()/2) - TrWindow::pxOn->height()/2;
+
+ int marg = listView() ? listView()->itemMargin() : 1;
+ int r = marg;
+
+ if ( isSelected() )
+ p->fillRect( r - marg, 0, width - r + marg, height(),
+ cg.brush( TQColorGroup::Highlight ) );
+ else
+ p->fillRect( 0, 0, width, height(),
+ cg.brush( TQColorGroup::Base ) );
+
+ if ( isContextObsolete() )
+ p->drawPixmap( x, y, *TrWindow::pxObsolete );
+ else if ( unfinishedCount == 0 )
+ p->drawPixmap( x, y, *TrWindow::pxOn );
+ else
+ p->drawPixmap( x, y, *TrWindow::pxOff );
+
+ } else {
+ if ( isContextObsolete() )
+ drawObsoleteText( p, cg, column, width, align );
+ else
+ TQListViewItem::paintCell( p, cg, column, width, align );
+ }
+}
+
+void ContextLVI::appendToComment( const TQString& x )
+{
+ if ( !com.isEmpty() )
+ com += TQString( "\n\n" );
+ com += x;
+}
+
+void ContextLVI::incrementUnfinishedCount()
+{
+ if ( unfinishedCount++ == 0 )
+ tqrepaint();
+}
+
+void ContextLVI::decrementUnfinishedCount()
+{
+ if ( --unfinishedCount == 0 )
+ tqrepaint();
+}
+
+void ContextLVI::incrementDangerCount()
+{
+ if ( dangerCount++ == 0 )
+ tqrepaint();
+}
+
+void ContextLVI::decrementDangerCount()
+{
+ if ( --dangerCount == 0 )
+ tqrepaint();
+}
+
+void ContextLVI::incrementObsoleteCount()
+{
+ if ( obsoleteCount++ == 0 )
+ tqrepaint();
+}
+
+bool ContextLVI::isContextObsolete()
+{
+ return (obsoleteCount == itemCount);
+}
+
+TQString ContextLVI::fullContext() const
+{
+ return comment().stripWhiteSpace();
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/listviews.h b/tqtinterface/qt4/tools/linguist/linguist/listviews.h
new file mode 100644
index 0000000..de37b66
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/listviews.h
@@ -0,0 +1,135 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef LISTVIEWS_H
+#define LISTVIEWS_H
+
+#include "msgedit.h"
+
+#include <tqstring.h>
+#include <tqptrlist.h>
+#include <tqregexp.h>
+#include <tqlistview.h>
+
+class LVI : public TQListViewItem
+{
+public:
+ LVI( TQListView *tqparent, TQString text = TQString() );
+ LVI( TQListViewItem *tqparent, TQString text = TQString() );
+ virtual int compare( TQListViewItem *other, int column,
+ bool ascending ) const;
+ virtual bool danger() const { return FALSE; }
+
+protected:
+ void drawObsoleteText( TQPainter * p, const TQColorGroup & cg, int column,
+ int width, int align );
+
+private:
+ static int count;
+};
+
+class MessageLVI;
+class ContextLVI : public LVI
+{
+public:
+ ContextLVI( TQListView *lv, const TQString& context );
+
+ virtual bool danger() const { return dangerCount > 0; }
+
+ void appendToComment( const TQString& x );
+ void incrementUnfinishedCount();
+ void decrementUnfinishedCount();
+ void incrementDangerCount();
+ void decrementDangerCount();
+ void incrementObsoleteCount();
+ bool isContextObsolete();
+ void updatetqStatus();
+
+ TQString context() const { return text( 1 ); }
+ TQString comment() const { return com; }
+ TQString fullContext() const;
+ bool finished() const { return unfinishedCount == 0; }
+
+ MessageLVI * firstMessageItem() { return messageItems.first(); }
+ MessageLVI * nextMessageItem() { return messageItems.next(); }
+ MessageLVI * takeMessageItem( int i ) { return messageItems.take( i ); }
+ void appendMessageItem( TQListView * lv, MessageLVI * i );
+ void instantiateMessageItem( TQListView * lv, MessageLVI * i );
+ int messageItemsInList() { return messageItems.count(); }
+
+ void paintCell( TQPainter * p, const TQColorGroup & cg, int column,
+ int width, int align );
+private:
+ TQPtrList<MessageLVI> messageItems;
+ TQString com;
+ int unfinishedCount;
+ int dangerCount;
+ int obsoleteCount;
+ int itemCount;
+};
+
+class MessageLVI : public LVI
+{
+public:
+ MessageLVI( TQListView *tqparent, const MetaTranslatorMessage & message,
+ const TQString& text, const TQString& comment, ContextLVI * c );
+
+ virtual bool danger() const { return d; }
+
+ void setTranslation( const TQString& translation );
+ void setFinished( bool finished );
+ void setDanger( bool danger );
+
+ void setContextLVI( ContextLVI * c ) { ctxt = c; }
+ ContextLVI * contextLVI() const { return ctxt; }
+ void updateTranslationText();
+
+ TQString context() const;
+ TQString sourceText() const { return tx; }
+ TQString comment() const { return com; }
+ TQString translation() const { return m.translation(); }
+ bool finished() const { return fini; }
+ MetaTranslatorMessage message() const;
+
+ void paintCell( TQPainter * p, const TQColorGroup & cg, int column,
+ int width, int align );
+private:
+ MetaTranslatorMessage m;
+ TQString tx;
+ TQString com;
+ bool fini;
+ bool d;
+ ContextLVI * ctxt;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/main.cpp b/tqtinterface/qt4/tools/linguist/linguist/main.cpp
new file mode 100644
index 0000000..13dd525
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/main.cpp
@@ -0,0 +1,89 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "trwindow.h"
+
+#include <tqapplication.h>
+#include <tqlabel.h>
+#include <tqpixmap.h>
+#include <tqtimer.h>
+#include <tqtextcodec.h>
+#include <tqtranslator.h>
+#include <tqsettings.h>
+#include <tqsplashscreen.h>
+
+int main( int argc, char **argv )
+{
+ TQApplication app( argc, argv );
+ TQApplication::setOverrideCursor( Qt::WaitCursor );
+
+
+ TQTranslator translator( 0 );
+ translator.load( TQString( "linguist_" ) + TQTextCodec::locale(), "." );
+ app.installTranslator( &translator );
+
+ bool showSplash = TRUE;
+
+ TQString keybase("/TQt Linguist/3.1/");
+ TQSettings config;
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+
+ TQRect r( TQApplication::desktop()->screenGeometry() );
+ r.setX( config.readNumEntry( keybase + "Geometry/MainwindowX", r.x() ) );
+ r.setY( config.readNumEntry( keybase + "Geometry/MainwindowY", r.y() ) );
+ r.setWidth( config.readNumEntry( keybase + "Geometry/MainwindowWidth", r.width() ) );
+ r.setHeight( config.readNumEntry( keybase + "Geometry/MainwindowHeight", r.height() ) );
+
+ TQSplashScreen *splash = 0;
+ if ( showSplash ) {
+ splash = new TQSplashScreen( TQPixmap::fromMimeSource("splash.png"),
+ (WFlags)TQt::WDestructiveClose );
+ splash->show();
+ }
+
+ TrWindow *tw = new TrWindow;
+ app.setMainWidget( tw );
+
+ if ( app.argc() > 1 )
+ tw->openFile( TQString(app.argv()[app.argc() - 1]) );
+
+ if ( config.readBoolEntry( keybase + "Geometry/MainwindowMaximized", FALSE ) )
+ tw->showMaximized();
+ else
+ tw->show();
+ if ( splash )
+ splash->finish( tw );
+ TQApplication::restoreOverrideCursor();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/msgedit.cpp b/tqtinterface/qt4/tools/linguist/linguist/msgedit.cpp
new file mode 100644
index 0000000..744cd16
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/msgedit.cpp
@@ -0,0 +1,835 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+/* TRANSLATOR MsgEdit
+
+ This is the right panel of the main window.
+*/
+
+#include "msgedit.h"
+
+#include "trwindow.h"
+#include "phraselv.h"
+#include "simtexth.h"
+
+#include <tqapplication.h>
+#include <tqcheckbox.h>
+#include <tqclipboard.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqtextedit.h>
+#include <tqpalette.h>
+#include <tqpushbutton.h>
+#include <tqstring.h>
+#include <tqtextview.h>
+#include <tqwhatsthis.h>
+#include <tqvbox.h>
+#include <tqmainwindow.h>
+#include <tqheader.h>
+#include <tqregexp.h>
+#include <tqdockarea.h>
+#include <tqdockwindow.h>
+#include <tqscrollview.h>
+#include <tqfont.h>
+#include <tqaccel.h>
+#include <tqpainter.h>
+#include <private/tqrichtext_p.h>
+
+static const int MaxCandidates = 5;
+
+class MED : public TQTextEdit
+{
+public:
+ MED( TQWidget *tqparent, const char *name = 0 )
+ : TQTextEdit( tqparent, name ) {}
+
+ int cursorX() const { return textCursor()->x(); }
+ int cursorY() const { return textCursor()->paragraph()->rect().y() +
+ textCursor()->y(); }
+};
+
+
+TQString richMeta( const TQString& text )
+{
+ return TQString( "<small><font color=blue>(" ) + text +
+ TQString( ")</font></small>" );
+}
+
+TQString richText( const TQString& text )
+{
+ const char backTab[] = "\a\b\f\n\r\t";
+ const char * const friendlyBackTab[] = {
+ TQT_TRANSLATE_NOOP( "MessageEditor", "bell" ),
+ TQT_TRANSLATE_NOOP( "MessageEditor", "backspace" ),
+ TQT_TRANSLATE_NOOP( "MessageEditor", "new page" ),
+ TQT_TRANSLATE_NOOP( "MessageEditor", "new line" ),
+ TQT_TRANSLATE_NOOP( "MessageEditor", "carriage return" ),
+ TQT_TRANSLATE_NOOP( "MessageEditor", "tab" )
+ };
+ TQString rich;
+
+ for ( int i = 0; i < (int) text.length(); i++ ) {
+ int ch = text[i].tqunicode();
+
+ if ( ch < 0x20 ) {
+ const char *p = strchr( backTab, ch );
+ if ( p == 0 )
+ rich += richMeta( TQString::number(ch, 16) );
+ else
+ rich += richMeta( MessageEditor::tr(friendlyBackTab[p - backTab]) );
+ } else if ( ch == '<' ) {
+ rich += TQString( "&lt;" );
+ } else if ( ch == '>' ) {
+ rich += TQString( "&gt;" );
+ } else if ( ch == '&' ) {
+ rich += TQString( "&amp;" );
+ } else if ( ch == ' ' ) {
+ if ( i == 0 || i == (text.length()-1) || text[i - 1] == ' ' || text[i + 1] == ' ' ) {
+ rich += richMeta( MessageEditor::tr("sp") );
+ } else {
+ rich += ' ';
+ }
+ } else {
+ rich += TQChar( ch );
+ }
+ if ( ch == '\n' )
+ rich += TQString( "<br>" );
+ }
+ return rich;
+}
+
+/*
+ ShadowWidget class impl.
+
+ Used to create a shadow like effect for a widget
+*/
+ShadowWidget::ShadowWidget( TQWidget * tqparent, const char * name )
+ : TQWidget( tqparent, name ), sWidth( 10 ), wMargin( 3 ), childWgt( 0 )
+{
+}
+
+ShadowWidget::ShadowWidget( TQWidget * child, TQWidget * tqparent,
+ const char * name )
+ : TQWidget( tqparent, name ), sWidth( 10 ), wMargin( 3 ), childWgt( 0 )
+{
+ setWidget( child );
+}
+
+void ShadowWidget::setWidget( TQWidget * child )
+{
+ childWgt = child;
+ if ( childWgt && TQT_BASE_OBJECT(childWgt->tqparent()) != TQT_BASE_OBJECT(this) ) {
+ childWgt->reparent( this, TQPoint( 0, 0 ), TRUE );
+ }
+}
+
+void ShadowWidget::resizeEvent( TQResizeEvent * )
+{
+ if( childWgt ) {
+ childWgt->move( wMargin, wMargin );
+ childWgt->resize( width() - sWidth - wMargin, height() - sWidth -
+ wMargin );
+ }
+}
+
+void ShadowWidget::paintEvent( TQPaintEvent * e )
+{
+ TQPainter p;
+ int w = width() - sWidth;
+ int h = height() - sWidth;
+
+
+ if ( !((w > 0) && (h > 0)) )
+ return;
+
+ if ( p.begin( this ) ) {
+ p.setPen( tqcolorGroup().shadow() );
+
+ p.drawPoint( w + 5, 6 );
+ p.drawLine( w + 3, 6, w + 5, 8 );
+ p.drawLine( w + 1, 6, w + 5, 10 );
+ int i;
+ for( i=7; i < h; i += 2 )
+ p.drawLine( w, i, w + 5, i + 5 );
+ for( i = w - i + h; i > 6; i -= 2 )
+ p.drawLine( i, h, i + 5, h + 5 );
+ for( ; i > 0 ; i -= 2 )
+ p.drawLine( 6, h + 6 - i, i + 5, h + 5 );
+
+// p.eraseRect( w, 0, sWidth, 45 ); // Cheap hack for the page curl..
+ p.end();
+ }
+ TQWidget::paintEvent( e );
+}
+
+/*
+ EditorPage class impl.
+
+ A frame that tqcontains the source text, translated text and any
+ source code comments and hints.
+*/
+EditorPage::EditorPage( TQWidget * tqparent, const char * name )
+ : TQFrame( tqparent, name )
+{
+ setLineWidth( 1 );
+ setFrameStyle( TQFrame::Box | TQFrame::Plain );
+
+ // Use white explicitly as the background color for the editor page.
+ TQPalette p = palette();
+ p.setColor( TQPalette::Active, TQColorGroup::Base, TQColor( Qt::white ) );
+ p.setColor( TQPalette::Inactive, TQColorGroup::Base, TQColor( Qt::white ) );
+ p.setColor( TQPalette::Disabled, TQColorGroup::Base, TQColor( Qt::white ) );
+ p.setColor( TQPalette::Active, TQColorGroup::Background,
+ p.active().color( TQColorGroup::Base ) );
+ p.setColor( TQPalette::Inactive, TQColorGroup::Background,
+ p.inactive().color( TQColorGroup::Base ) );
+ p.setColor( TQPalette::Disabled, TQColorGroup::Background,
+ p.disabled().color( TQColorGroup::Base ) );
+ setPalette( p );
+
+ srcTextLbl = new TQLabel( tr("Source text"), this, "source text label" );
+ transLbl = new TQLabel( tr("Translation"), this, "translation label" );
+
+ TQFont fnt = font();
+ fnt.setBold( TRUE );
+ srcTextLbl->setFont( fnt );
+ transLbl->setFont( fnt );
+
+ srcText = new TQTextView( this, "source text view" );
+ srcText->setFrameStyle( TQFrame::NoFrame );
+ srcText->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding,
+ TQSizePolicy::Minimum ) );
+ srcText->setResizePolicy( TQScrollView::AutoOne );
+ srcText->setHScrollBarMode( TQScrollView::AlwaysOff );
+ srcText->setVScrollBarMode( TQScrollView::AlwaysOff );
+ p = srcText->palette();
+ p.setColor( TQPalette::Disabled, TQColorGroup::Base, p.active().base() );
+ srcText->setPalette( p );
+ connect( srcText, TQT_SIGNAL(textChanged()), TQT_SLOT(handleSourceChanges()) );
+
+ cmtText = new TQTextView( this, "comment/context view" );
+ cmtText->setFrameStyle( TQFrame::NoFrame );
+ cmtText->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding,
+ TQSizePolicy::Minimum ) );
+ cmtText->setResizePolicy( TQScrollView::AutoOne );
+ cmtText->setHScrollBarMode( TQScrollView::AlwaysOff );
+ cmtText->setVScrollBarMode( TQScrollView::AlwaysOff );
+ p = cmtText->palette();
+ p.setColor( TQPalette::Active, TQColorGroup::Base, TQColor( 236,245,255 ) );
+ p.setColor( TQPalette::Inactive, TQColorGroup::Base, TQColor( 236,245,255 ) );
+ cmtText->setPalette( p );
+ connect( cmtText, TQT_SIGNAL(textChanged()), TQT_SLOT(handleCommentChanges()) );
+
+ translationMed = new MED( this, "translation editor" );
+ translationMed->setFrameStyle( TQFrame::NoFrame );
+ translationMed->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding,
+ TQSizePolicy::MinimumExpanding ) );
+ translationMed->setHScrollBarMode( TQScrollView::AlwaysOff );
+ translationMed->setVScrollBarMode( TQScrollView::AlwaysOff );
+ translationMed->setResizePolicy( TQScrollView::AutoOne );
+ translationMed->setWrapPolicy( TQTextView::AtWhiteSpace );
+ translationMed->setWordWrap( TQTextView::WidgetWidth );
+ translationMed->setTextFormat( TQt::PlainText );
+ p = translationMed->palette();
+ p.setColor( TQPalette::Disabled, TQColorGroup::Base, p.active().base() );
+ translationMed->setPalette( p );
+ connect( translationMed, TQT_SIGNAL(textChanged()),
+ TQT_SLOT(handleTranslationChanges()) );
+
+ pageCurl = new PageCurl( this, "page curl" );
+
+ // Focus
+ setFocusPolicy( Qt::StrongFocus );
+ transLbl->setFocusProxy( translationMed );
+ srcTextLbl->setFocusProxy( translationMed );
+ cmtText->setFocusProxy( translationMed );
+ srcText->setFocusProxy( translationMed );
+ setFocusProxy( translationMed );
+
+ updateCommentField();
+}
+
+/*
+ Don't show the comment field if there are no comments.
+*/
+void EditorPage::updateCommentField()
+{
+ if( cmtText->text().isEmpty() )
+ cmtText->hide();
+ else
+ cmtText->show();
+
+ layoutWidgets();
+}
+
+/*
+ Handle the widget tqlayout manually
+*/
+void EditorPage::layoutWidgets()
+ {
+ int margin = 6;
+ int space = 2;
+ int w = width();
+
+ pageCurl->move( width() - pageCurl->width(), 0 );
+
+ TQFontMetrics fm( srcTextLbl->font() );
+ srcTextLbl->move( margin, margin );
+ srcTextLbl->resize( fm.width( srcTextLbl->text() ), srcTextLbl->height() );
+
+ srcText->move( margin, srcTextLbl->y() + srcTextLbl->height() + space );
+ srcText->resize( w - margin*2, srcText->height() );
+
+ cmtText->move( margin, srcText->y() + srcText->height() + space );
+ cmtText->resize( w - margin*2, cmtText->height() );
+
+ if( cmtText->isHidden() )
+ transLbl->move( margin, srcText->y() + srcText->height() + space );
+ else
+ transLbl->move( margin, cmtText->y() + cmtText->height() + space );
+ transLbl->resize( w - margin*2, transLbl->height() );
+
+ translationMed->move( margin, transLbl->y() + transLbl->height() + space );
+ translationMed->resize( w - margin*2, translationMed->height() );
+
+ // Calculate the total height for the editor page - emit a signal
+ // if the actual page size is larger/smaller
+ int totHeight = margin + srcTextLbl->height() +
+ srcText->height() + space +
+ transLbl->height() + space +
+ translationMed->height() + space +
+ frameWidth()*lineWidth()*2 + space * 3;
+
+ if( !cmtText->isHidden() )
+ totHeight += cmtText->height() + space;
+
+ if( height() != totHeight )
+ emit pageHeightUpdated( totHeight );
+}
+
+void EditorPage::resizeEvent( TQResizeEvent * )
+{
+ handleTranslationChanges();
+ handleSourceChanges();
+ handleCommentChanges();
+ layoutWidgets();
+}
+
+void EditorPage::handleTranslationChanges()
+{
+ calculateFieldHeight( (TQTextView *) translationMed );
+}
+
+void EditorPage::handleSourceChanges()
+{
+ calculateFieldHeight( srcText );
+}
+
+void EditorPage::handleCommentChanges()
+{
+ calculateFieldHeight( cmtText );
+}
+
+/*
+ Check if the translation text field is big enough to show all text
+ that has been entered. If it isn't, resize it.
+*/
+void EditorPage::calculateFieldHeight( TQTextView * field )
+{
+ field->sync(); // make sure the text formatting is done!
+ int contentsHeight = field->contentsHeight();
+
+ if( contentsHeight != field->height() ) {
+ int oldHeight = field->height();
+ if( contentsHeight < 30 )
+ contentsHeight = 30;
+ field->resize( field->width(), contentsHeight );
+ emit pageHeightUpdated( height() + (field->height() - oldHeight) );
+ }
+}
+
+void EditorPage::fontChange( const TQFont & )
+{
+ TQFont fnt = font();
+
+ fnt.setBold( TRUE );
+ TQFontMetrics fm( fnt );
+ srcTextLbl->setFont( fnt );
+ srcTextLbl->resize( fm.width( srcTextLbl->text() ), srcTextLbl->height() );
+ transLbl->setFont( fnt );
+ transLbl->resize( fm.width( transLbl->text() ), transLbl->height() );
+ update();
+}
+
+/*
+ MessageEditor class impl.
+
+ Handle tqlayout of dock windows and the editor page.
+*/
+MessageEditor::MessageEditor( MetaTranslator * t, TQWidget * tqparent,
+ const char * name )
+ : TQWidget( tqparent, name ),
+ tor( t )
+{
+ doGuesses = TRUE;
+ v = new TQVBoxLayout( this );
+ topDock = new TQDockArea( Qt::Horizontal, TQDockArea::Normal, this,
+ "top dock area" );
+ topDock->setMinimumHeight( 10 );
+ topDock->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum,
+ TQSizePolicy::Minimum) );
+
+ topDockWnd = new TQDockWindow( TQDockWindow::InDock, topDock,
+ "top dock window" );
+ TQMainWindow *mw = (TQMainWindow*)tqtopLevelWidget();
+ if ( mw ) {
+ mw->setDockEnabled( topDockWnd, TQt::DockTop, TRUE );
+ mw->setDockEnabled( topDockWnd, TQt::DockLeft, TRUE );
+ mw->setDockEnabled( topDockWnd, TQt::DockRight, TRUE );
+ mw->setDockEnabled( topDockWnd, TQt::DockBottom, TRUE );
+ }
+
+ topDockWnd->setCaption( tr("Source text") );
+ topDockWnd->setCloseMode( TQDockWindow::Always );
+ topDockWnd->setResizeEnabled( TRUE );
+ topDockWnd->setFixedExtentHeight( 110 );
+
+ srcTextList = new TQListView( topDockWnd, "source text list view" );
+ srcTextList->setShowSortIndicator( TRUE );
+ srcTextList->setAllColumnsShowFocus( TRUE );
+ srcTextList->setSorting( 0 );
+ TQFontMetrics fm( font() );
+ srcTextList->addColumn( tr("Done"), fm.width( tr("Done") ) + 10 );
+ srcTextList->addColumn( tr("Source text") );
+ srcTextList->addColumn( tr("Translation"), 300 );
+ srcTextList->setColumnAlignment( 0, TQt::AlignCenter );
+ srcTextList->setColumnWidthMode( 1, TQListView::Manual );
+ srcTextList->header()->setStretchEnabled( TRUE, 1 );
+ srcTextList->setMinimumSize( TQSize( 50, 50 ) );
+ srcTextList->setHScrollBarMode( TQScrollView::AlwaysOff );
+ srcTextList->installEventFilter( this );
+ topDockWnd->setWidget( srcTextList );
+
+ sv = new TQScrollView( this, "scroll view" );
+ sv->setHScrollBarMode( TQScrollView::AlwaysOff );
+ sv->viewport()->setBackgroundMode( TQt::PaletteBackground );
+
+ editorPage = new EditorPage( sv, "editor page" );
+ connect( editorPage, TQT_SIGNAL(pageHeightUpdated(int)),
+ TQT_SLOT(updatePageHeight(int)) );
+
+ editorPage->translationMed->installEventFilter( this );
+
+ sw = new ShadowWidget( editorPage, sv, "editor page shadow" );
+ sw->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding,
+ TQSizePolicy::Expanding) );
+ sw->setMinimumSize( TQSize( 100, 150 ) );
+ sv->addChild( sw );
+
+ bottomDock = new TQDockArea( Qt::Horizontal, TQDockArea::Reverse,
+ this, "bottom dock area" );
+ bottomDock->setMinimumHeight( 10 );
+ bottomDock->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum,
+ TQSizePolicy::Minimum) );
+ bottomDockWnd = new TQDockWindow( TQDockWindow::InDock, bottomDock,
+ "bottom dock window" );
+ if ( mw ) {
+ mw->setDockEnabled( bottomDockWnd, TQt::DockTop, TRUE );
+ mw->setDockEnabled( bottomDockWnd, TQt::DockLeft, TRUE );
+ mw->setDockEnabled( bottomDockWnd, TQt::DockRight, TRUE );
+ mw->setDockEnabled( bottomDockWnd, TQt::DockBottom, TRUE );
+ }
+ bottomDockWnd->setCaption( tr("Phrases") );
+ bottomDockWnd->setCloseMode( TQDockWindow::Always );
+ bottomDockWnd->setResizeEnabled( TRUE );
+
+ TQWidget * w = new TQWidget( bottomDockWnd );
+ w->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum,
+ TQSizePolicy::Minimum ) );
+ TQHBoxLayout *hl = new TQHBoxLayout( w, 6 );
+ TQVBoxLayout *vl = new TQVBoxLayout( 6 );
+
+ phraseLbl = new TQLabel( tr("Phrases and guesses:"), w );
+ phraseLv = new PhraseLV( w, "phrase list view" );
+ phraseLv->setSorting( PhraseLVI::DefinitionText );
+ phraseLv->installEventFilter( this );
+ hl->addLayout( vl );
+ vl->addWidget( phraseLbl );
+ vl->addWidget( phraseLv );
+
+ accel = new TQAccel( this, "accel" );
+ connect( accel, TQT_SIGNAL(activated(int)), this, TQT_SLOT(guessActivated(int)) );
+ for ( int i = 0; i < 9; i++ )
+ accel->insertItem( Qt::CTRL + (Qt::Key_1 + i), i + 1 );
+
+ bottomDockWnd->setWidget( w );
+
+ v->addWidget( topDock );
+ v->addWidget( sv );
+ v->addWidget( bottomDock );
+
+ // Signals
+ connect( editorPage->pageCurl, TQT_SIGNAL(nextPage()),
+ TQT_SIGNAL(nextUnfinished()) );
+ connect( editorPage->pageCurl, TQT_SIGNAL(prevPage()),
+ TQT_SIGNAL(prevUnfinished()) );
+
+ connect( editorPage->translationMed, TQT_SIGNAL(textChanged()),
+ this, TQT_SLOT(emitTranslationChanged()) );
+ connect( editorPage->translationMed, TQT_SIGNAL(textChanged()),
+ this, TQT_SLOT(updateButtons()) );
+ connect( editorPage->translationMed, TQT_SIGNAL(undoAvailable(bool)),
+ this, TQT_SIGNAL(undoAvailable(bool)) );
+ connect( editorPage->translationMed, TQT_SIGNAL(redoAvailable(bool)),
+ this, TQT_SIGNAL(redoAvailable(bool)) );
+ connect( editorPage->translationMed, TQT_SIGNAL(copyAvailable(bool)),
+ this, TQT_SIGNAL(cutAvailable(bool)) );
+ connect( editorPage->translationMed, TQT_SIGNAL(copyAvailable(bool)),
+ this, TQT_SIGNAL(copyAvailable(bool)) );
+ connect( tqApp->clipboard(), TQT_SIGNAL(dataChanged()),
+ this, TQT_SLOT(updateCanPaste()) );
+ connect( phraseLv, TQT_SIGNAL(doubleClicked(TQListViewItem *)),
+ this, TQT_SLOT(insertPhraseInTranslation(TQListViewItem *)) );
+ connect( phraseLv, TQT_SIGNAL(returnPressed(TQListViewItem *)),
+ this, TQT_SLOT(insertPhraseInTranslationAndLeave(TQListViewItem *)) );
+
+ // What's this
+ TQWhatsThis::add( this, tr("This whole panel allows you to view and edit "
+ "the translation of some source text.") );
+ TQWhatsThis::add( editorPage->srcText,
+ tr("This area shows the source text.") );
+ TQWhatsThis::add( editorPage->cmtText, tr("This area shows a comment that"
+ " may guide you, and the context in which the text"
+ " occurs.") );
+ TQWhatsThis::add( editorPage->translationMed,
+ tr("This is where you can enter or modify"
+ " the translation of some source text.") );
+}
+
+void MessageEditor::toggleFinished()
+{
+ if ( itemFinished )
+ itemFinished = FALSE;
+ else
+ itemFinished = TRUE;
+ emit finished( itemFinished );
+}
+
+bool MessageEditor::eventFilter( TQObject *o, TQEvent *e )
+{
+ // Handle keypresses in the message editor - scroll the view if the current
+ // line is hidden.
+ if ( e->type() == TQEvent::KeyPress || e->type() == TQEvent::KeyRelease ) {
+ TQKeyEvent * ke = (TQKeyEvent*)e;
+ const int k = ke->key();
+
+ if ( ::tqqt_cast<TQTextEdit*>(o) ) {
+ if ( e->type() == TQEvent::KeyPress ) {
+ // Hardcode the Tab key to do focus changes when pressed
+ // inside the editor
+ if ( k == TQt::Key_BackTab ) {
+ emit focusSourceList();
+ return TRUE;
+ }
+ } else if ( e->type() == TQEvent::KeyRelease ) {
+ MED * ed = (MED *) o;
+ switch( k ) {
+ case Qt::Key_Up:
+ if (ed->cursorY() < 10)
+ sv->verticalScrollBar()->subtractLine();
+ break;
+
+ case Qt::Key_Down:
+ if (ed->cursorY() >= ed->height() - 20)
+ sv->verticalScrollBar()->addLine();
+ break;
+
+ case Qt::Key_PageUp:
+ if (ed->cursorY() < 10)
+ sv->verticalScrollBar()->subtractPage();
+ break;
+
+ case Qt::Key_PageDown:
+ if (ed->cursorY() >= ed->height() - 50)
+ sv->verticalScrollBar()->addPage();
+ break;
+ default:
+ sv->ensureVisible( sw->margin() + ed->x() + ed->cursorX(),
+ sw->margin() + ed->y() + ed->cursorY() );
+ break;
+ }
+ }
+ } else if ( ::tqqt_cast<TQListView*>(o) ) {
+ // handle the ESC key in the list views
+ if ( e->type() == TQEvent::KeyRelease && k == Key_Escape )
+ editorPage->translationMed->setFocus();
+ }
+ }
+ return TQWidget::eventFilter( o, e );
+}
+
+void MessageEditor::updatePageHeight( int height )
+{
+ sw->resize( sw->width(), height + sw->margin() + sw->shadowWidth() );
+}
+
+void MessageEditor::resizeEvent( TQResizeEvent * )
+{
+ sw->resize( sv->viewport()->width(), sw->height() );
+}
+
+TQListView * MessageEditor::sourceTextList() const
+{
+ return srcTextList;
+}
+
+TQListView * MessageEditor::phraseList() const
+{
+ return phraseLv;
+}
+
+void MessageEditor::showNothing()
+{
+ editorPage->srcText->setText( "" );
+ showContext( TQString(""), FALSE );
+}
+
+void MessageEditor::showContext( const TQString& context, bool finished )
+{
+ setEditionEnabled( FALSE );
+ sourceText = TQString();
+ guesses.clear();
+
+ if( context.isEmpty() )
+ editorPage->cmtText->setText("");
+ else
+ editorPage->cmtText->setText( richText(context.simplifyWhiteSpace()) );
+ setTranslation( TQString(""), FALSE );
+ setFinished( finished );
+ phraseLv->clear();
+ editorPage->handleSourceChanges();
+ editorPage->handleCommentChanges();
+ editorPage->handleTranslationChanges();
+ editorPage->updateCommentField();
+}
+
+void MessageEditor::showMessage( const TQString& text,
+ const TQString& comment,
+ const TQString& fullContext,
+ const TQString& translation,
+ MetaTranslatorMessage::Type type,
+ const TQValueList<Phrase>& phrases )
+{
+ bool obsolete = ( type == MetaTranslatorMessage::Obsolete );
+ setEditionEnabled( !obsolete );
+ sourceText = text;
+ guesses.clear();
+
+ editorPage->srcText->setText( TQString("<p>") + richText( text ) +
+ TQString("</p>") );
+
+ if ( !fullContext.isEmpty() && !comment.isEmpty() )
+ editorPage->cmtText->setText( richText(fullContext.simplifyWhiteSpace()) +
+ "\n" + richText(comment.simplifyWhiteSpace()) );
+ else if ( !fullContext.isEmpty() && comment.isEmpty() )
+ editorPage->cmtText->setText(richText(fullContext.simplifyWhiteSpace() ) );
+ else if ( fullContext.isEmpty() && !comment.isEmpty() )
+ editorPage->cmtText->setText( richText(comment.simplifyWhiteSpace() ) );
+ else
+ editorPage->cmtText->setText( "" );
+
+ setTranslation( translation, FALSE );
+ setFinished( type != MetaTranslatorMessage::Unfinished );
+ TQValueList<Phrase>::ConstIterator p;
+ phraseLv->clear();
+ for ( p = phrases.begin(); p != phrases.end(); ++p )
+ (void) new PhraseLVI( phraseLv, *p );
+
+ if ( doGuesses && !sourceText.isEmpty() ) {
+ CandidateList cl = similarTextHeuristicCandidates( tor,
+ sourceText.latin1(),
+ MaxCandidates );
+ int n = 0;
+ TQValueList<Candidate>::Iterator it = cl.begin();
+ while ( it != cl.end() ) {
+ TQString def;
+ if ( n < 9 )
+ def = tr( "Guess (%1)" ).arg( TQString(TQKeySequence(Qt::CTRL | (Qt::Key_0 + (n + 1)))) );
+ else
+ def = tr( "Guess" );
+ (void) new PhraseLVI( phraseLv,
+ Phrase((*it).source, (*it).target, def),
+ n + 1 );
+ n++;
+ ++it;
+ }
+ }
+ editorPage->handleSourceChanges();
+ editorPage->handleCommentChanges();
+ editorPage->handleTranslationChanges();
+ editorPage->updateCommentField();
+}
+
+void MessageEditor::setTranslation( const TQString& translation, bool emitt )
+{
+ // Block Q_SIGNALS so that 'textChanged()' is not emitted when
+ // for example a new source text item is selected and *not*
+ // the actual translation.
+ editorPage->translationMed->blockSignals( !emitt );
+ editorPage->translationMed->setText( translation );
+ editorPage->translationMed->blockSignals( FALSE );
+ if ( !emitt )
+ updateButtons();
+ emit cutAvailable( FALSE );
+ emit copyAvailable( FALSE );
+}
+
+void MessageEditor::setEditionEnabled( bool enabled )
+{
+ editorPage->transLbl->setEnabled( enabled );
+ editorPage->translationMed->setReadOnly( !enabled );
+
+ phraseLbl->setEnabled( enabled );
+ phraseLv->setEnabled( enabled );
+ updateCanPaste();
+}
+
+void MessageEditor::undo()
+{
+ editorPage->translationMed->undo();
+}
+
+void MessageEditor::redo()
+{
+ editorPage->translationMed->redo();
+}
+
+void MessageEditor::cut()
+{
+ editorPage->translationMed->cut();
+}
+
+void MessageEditor::copy()
+{
+ editorPage->translationMed->copy();
+}
+
+void MessageEditor::paste()
+{
+ editorPage->translationMed->paste();
+}
+
+void MessageEditor::del()
+{
+ editorPage->translationMed->del();
+}
+
+void MessageEditor::selectAll()
+{
+ editorPage->translationMed->selectAll();
+}
+
+void MessageEditor::emitTranslationChanged()
+{
+ emit translationChanged( editorPage->translationMed->text() );
+}
+
+void MessageEditor::guessActivated( int accelKey )
+{
+ TQListViewItem *item = phraseLv->firstChild();
+ while ( item != 0 && ((PhraseLVI *) item)->accelKey() != accelKey )
+ item = item->nextSibling();
+ if ( item != 0 )
+ insertPhraseInTranslation( item );
+}
+
+void MessageEditor::insertPhraseInTranslation( TQListViewItem *item )
+{
+ editorPage->translationMed->insert(((PhraseLVI *) item)->phrase().target());
+ emit translationChanged( editorPage->translationMed->text() );
+}
+
+void MessageEditor::insertPhraseInTranslationAndLeave( TQListViewItem *item )
+{
+ editorPage->translationMed->insert(((PhraseLVI *) item)->phrase().target());
+ emit translationChanged( editorPage->translationMed->text() );
+ editorPage->translationMed->setFocus();
+}
+
+void MessageEditor::updateButtons()
+{
+ bool overwrite = ( !editorPage->translationMed->isReadOnly() &&
+ (editorPage->translationMed->text().stripWhiteSpace().isEmpty() ||
+ mayOverwriteTranslation) );
+ mayOverwriteTranslation = FALSE;
+ emit updateActions( overwrite );
+}
+
+void MessageEditor::beginFromSource()
+{
+ mayOverwriteTranslation = TRUE;
+ setTranslation( sourceText, TRUE );
+ if ( !editorPage->hasFocus() )
+ editorPage->setFocus();
+}
+
+void MessageEditor::finishAndNext()
+{
+ setFinished( TRUE );
+ emit nextUnfinished();
+ if ( !editorPage->hasFocus() )
+ editorPage->setFocus();
+}
+
+void MessageEditor::updateCanPaste()
+{
+ bool oldCanPaste = canPaste;
+ canPaste = ( !editorPage->translationMed->isReadOnly() &&
+ !tqApp->clipboard()->text().isNull() );
+ if ( canPaste != oldCanPaste )
+ emit pasteAvailable( canPaste );
+}
+
+void MessageEditor::setFinished( bool finished )
+{
+ if ( !finished != !itemFinished )
+ toggleFinished();
+}
+
+void MessageEditor::toggleGuessing()
+{
+ doGuesses = !doGuesses;
+ if ( !doGuesses ) {
+ phraseLv->clear();
+ }
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/msgedit.h b/tqtinterface/qt4/tools/linguist/linguist/msgedit.h
new file mode 100644
index 0000000..21e6710
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/msgedit.h
@@ -0,0 +1,247 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef MSGEDIT_H
+#define MSGEDIT_H
+
+#include "trwindow.h"
+#include "phrase.h"
+
+#include <metatranslator.h>
+
+#include <tqsplitter.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqscrollview.h>
+#include <tqpixmap.h>
+#include <tqbitmap.h>
+#include <tqtooltip.h>
+
+class TQAccel;
+class TQDockArea;
+class TQDockWindow;
+class TQLabel;
+class TQListView;
+class TQListViewItem;
+class TQTextView;
+class TQVBoxLayout;
+
+class EditorPage;
+class MED;
+class PhraseLV;
+
+class PageCurl : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ PageCurl( TQWidget * tqparent = 0, const char * name = 0,
+ WFlags f = 0 )
+ : TQWidget( tqparent, name, f )
+ {
+ TQPixmap px = TrWindow::pageCurl();
+ if ( px.tqmask() ) {
+ setMask( *px.tqmask() );
+ }
+ setBackgroundPixmap( px );
+ setFixedSize( px.size() );
+
+ TQRect r( 34, 0, width()-34, 19 );
+ TQToolTip::add( this, r, tr("Next unfinished phrase") );
+ r.setSize( TQSize(width()-34, height()-20) );
+ r.setX( 0 );
+ r.setY( 20 );
+ TQToolTip::add( this, r, tr("Previous unfinished phrase") );
+ }
+
+protected:
+ void mouseReleaseEvent( TQMouseEvent * e )
+ {
+ int x = e->pos().x() - 14;
+ int y = e->pos().y() - 8;
+
+ if ( y <= x )
+ emit nextPage();
+ else
+ emit prevPage();
+ }
+
+Q_SIGNALS:
+ void prevPage();
+ void nextPage();
+};
+
+class ShadowWidget : public TQWidget
+{
+public:
+ ShadowWidget( TQWidget * tqparent = 0, const char * name = 0 );
+ ShadowWidget( TQWidget * child, TQWidget * tqparent = 0, const char * name = 0 );
+
+ void setShadowWidth( int width ) { sWidth = width; }
+ int shadowWidth() const { return sWidth; }
+ void setMargin( int margin ){ wMargin = margin; }
+ int margin() const { return wMargin; }
+ void setWidget( TQWidget * child);
+
+protected:
+ void resizeEvent( TQResizeEvent * e );
+ void paintEvent( TQPaintEvent * e );
+
+private:
+ int sWidth;
+ int wMargin;
+ TQWidget * childWgt;
+};
+
+class EditorPage : public TQFrame
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ EditorPage( TQWidget * tqparent = 0, const char * name = 0 );
+
+protected:
+ void resizeEvent( TQResizeEvent * );
+ void layoutWidgets();
+ void updateCommentField();
+ void calculateFieldHeight( TQTextView * field );
+ void fontChange( const TQFont & );
+
+private:
+ PageCurl * pageCurl;
+ TQLabel * srcTextLbl;
+ TQLabel * transLbl;
+ TQTextView * srcText;
+ TQTextView * cmtText;
+ MED * translationMed;
+
+ friend class MessageEditor;
+
+private Q_SLOTS:
+ void handleTranslationChanges();
+ void handleSourceChanges();
+ void handleCommentChanges();
+
+Q_SIGNALS:
+ void pageHeightUpdated( int height );
+};
+
+class MessageEditor : public TQWidget
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ MessageEditor( MetaTranslator * t, TQWidget * tqparent = 0,
+ const char * name = 0 );
+ TQListView * sourceTextList() const;
+ TQListView * phraseList() const;
+
+ void showNothing();
+ void showContext( const TQString& context, bool finished );
+ void showMessage( const TQString& text, const TQString& comment,
+ const TQString& fullContext, const TQString& translation,
+ MetaTranslatorMessage::Type type,
+ const TQValueList<Phrase>& phrases );
+ void setFinished( bool finished );
+ bool eventFilter( TQObject *, TQEvent * );
+
+Q_SIGNALS:
+ void translationChanged( const TQString& translation );
+ void finished( bool finished );
+ void prevUnfinished();
+ void nextUnfinished();
+ void updateActions( bool enable );
+
+ void undoAvailable( bool avail );
+ void redoAvailable( bool avail );
+ void cutAvailable( bool avail );
+ void copyAvailable( bool avail );
+ void pasteAvailable( bool avail );
+
+ void focusSourceList();
+ void focusPhraseList();
+
+public Q_SLOTS:
+ void undo();
+ void redo();
+ void cut();
+ void copy();
+ void paste();
+ void del();
+ void selectAll();
+ void beginFromSource();
+ void toggleGuessing();
+ void finishAndNext();
+
+private Q_SLOTS:
+ void emitTranslationChanged();
+ void guessActivated( int accelKey );
+ void insertPhraseInTranslation( TQListViewItem *item );
+ void insertPhraseInTranslationAndLeave( TQListViewItem *item );
+ void updateButtons();
+ void updateCanPaste();
+ void toggleFinished();
+
+ void updatePageHeight( int height );
+
+protected:
+ void resizeEvent( TQResizeEvent * );
+
+private:
+ void setTranslation( const TQString& translation, bool emitt );
+ void setEditionEnabled( bool enabled );
+
+ TQListView * srcTextList;
+ TQDockArea * topDock, * bottomDock;
+ TQDockWindow * topDockWnd, *bottomDockWnd;
+ EditorPage * editorPage;
+ TQVBoxLayout * v;
+
+ TQLabel * phraseLbl;
+ PhraseLV * phraseLv;
+ TQAccel * accel;
+ bool itemFinished;
+
+ ShadowWidget * sw;
+ TQScrollView * sv;
+
+ MetaTranslator *tor;
+ TQString sourceText;
+ TQStringList guesses;
+ bool mayOverwriteTranslation;
+ bool canPaste;
+ bool doGuesses;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/phrase.cpp b/tqtinterface/qt4/tools/linguist/linguist/phrase.cpp
new file mode 100644
index 0000000..95b4fc2
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/phrase.cpp
@@ -0,0 +1,189 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "phrase.h"
+
+#include <tqapplication.h>
+#include <tqcstring.h>
+#include <tqfile.h>
+#include <tqmessagebox.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
+#include <tqxml.h>
+
+static TQString protect( const TQString& str )
+{
+ TQString p = str;
+ p.tqreplace( "&", "&amp;" );
+ p.tqreplace( "\"", "&quot;" );
+ p.tqreplace( ">", "&gt;" );
+ p.tqreplace( "<", "&lt;" );
+ p.tqreplace( "'", "&apos;" );
+ return p;
+}
+
+Phrase::Phrase( const TQString& source, const TQString& target,
+ const TQString& definition )
+ : s( source ), t( target ), d( definition )
+{
+}
+
+bool operator==( const Phrase& p, const Phrase& q )
+{
+ return p.source() == q.source() && p.target() == q.target() &&
+ p.definition() == q.definition();
+}
+
+class QphHandler : public TQXmlDefaultHandler
+{
+public:
+ QphHandler( PhraseBook *phraseBook )
+ : pb( phraseBook ), ferrorCount( 0 ) { }
+
+ virtual bool startElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName,
+ const TQXmlAttributes& atts );
+ virtual bool endElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName );
+ virtual bool characters( const TQString& ch );
+ virtual bool fatalError( const TQXmlParseException& exception );
+
+private:
+ PhraseBook *pb;
+ TQString source;
+ TQString target;
+ TQString definition;
+
+ TQString accum;
+ int ferrorCount;
+};
+
+bool QphHandler::startElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName,
+ const TQXmlAttributes& /* atts */ )
+{
+ if ( qName == TQString("phrase") ) {
+ source.truncate( 0 );
+ target.truncate( 0 );
+ definition.truncate( 0 );
+ }
+ accum.truncate( 0 );
+ return TRUE;
+}
+
+bool QphHandler::endElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName )
+{
+ if ( qName == TQString("source") )
+ source = accum;
+ else if ( qName == TQString("target") )
+ target = accum;
+ else if ( qName == TQString("definition") )
+ definition = accum;
+ else if ( qName == TQString("phrase") )
+ pb->append( Phrase(source, target, definition) );
+ return TRUE;
+}
+
+bool QphHandler::characters( const TQString& ch )
+{
+ accum += ch;
+ return TRUE;
+}
+
+bool QphHandler::fatalError( const TQXmlParseException& exception )
+{
+ if ( ferrorCount++ == 0 ) {
+ TQString msg;
+ msg.sprintf( "Parse error at line %d, column %d (%s).",
+ exception.lineNumber(), exception.columnNumber(),
+ exception.message().latin1() );
+ TQMessageBox::information( tqApp->mainWidget(),
+ TQObject::tr("TQt Linguist"), msg );
+ }
+ return FALSE;
+}
+
+bool PhraseBook::load( const TQString& filename )
+{
+ TQFile f( filename );
+ if ( !f.open(IO_ReadOnly) )
+ return FALSE;
+
+ TQTextStream t( &f );
+ TQXmlInputSource in( t );
+ TQXmlSimpleReader reader;
+ // don't click on these!
+ reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE );
+ reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE );
+ reader.setFeature( "http://trolltech.com/xml/features/report-whitespace"
+ "-only-CharData", FALSE );
+ TQXmlDefaultHandler *hand = new QphHandler( this );
+ reader.setContentHandler( hand );
+ reader.setErrorHandler( hand );
+
+ bool ok = reader.parse( in );
+ reader.setContentHandler( 0 );
+ reader.setErrorHandler( 0 );
+ delete hand;
+ f.close();
+ if ( !ok )
+ clear();
+ return ok;
+}
+
+bool PhraseBook::save( const TQString& filename ) const
+{
+ TQFile f( filename );
+ if ( !f.open(IO_WriteOnly) )
+ return FALSE;
+
+ TQTextStream t( &f );
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << "<!DOCTYPE TQPH><TQPH>\n";
+ ConstIterator p;
+ for ( p = begin(); p != end(); ++p ) {
+ t << "<phrase>\n";
+ t << " <source>" << protect( (*p).source() ) << "</source>\n";
+ t << " <target>" << protect( (*p).target() ) << "</target>\n";
+ if ( !(*p).definition().isEmpty() )
+ t << " <definition>" << protect( (*p).definition() )
+ << "</definition>\n";
+ t << "</phrase>\n";
+ }
+ t << "</TQPH>\n";
+ f.close();
+ return TRUE;
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/phrase.h b/tqtinterface/qt4/tools/linguist/linguist/phrase.h
new file mode 100644
index 0000000..6152cd5
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/phrase.h
@@ -0,0 +1,74 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PHRASE_H
+#define PHRASE_H
+
+#include <tqstring.h>
+#include <tqvaluelist.h>
+
+class Phrase
+{
+public:
+ Phrase() { }
+ Phrase( const TQString& source, const TQString& target,
+ const TQString& definition );
+
+ TQString source() const { return s; }
+ void setSource( const TQString& ns ) { s = ns; }
+ TQString target() const { return t; }
+ void setTarget( const TQString& nt ) { t = nt; }
+ TQString definition() const { return d; }
+ void setDefinition ( const TQString& nd ) { d = nd; }
+
+private:
+ TQString s;
+ TQString t;
+ TQString d;
+};
+
+bool operator==( const Phrase& p, const Phrase& q );
+inline bool operator!=( const Phrase& p, const Phrase& q ) {
+ return !( p == q );
+}
+
+class PhraseBook : public TQValueList<Phrase>
+{
+public:
+ PhraseBook() { }
+
+ bool load( const TQString& filename );
+ bool save( const TQString& filename ) const;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.cpp b/tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.cpp
new file mode 100644
index 0000000..2c0c640
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.cpp
@@ -0,0 +1,244 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+/* TRANSLATOR PhraseBookBox
+
+ Go to Phrase > Edit Phrase Book... The dialog that pops up is a
+ PhraseBookBox.
+*/
+
+#include "phrasebookbox.h"
+#include "phraselv.h"
+
+#include <tqapplication.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqmessagebox.h>
+#include <tqpushbutton.h>
+#include <tqwhatsthis.h>
+
+PhraseBookBox::PhraseBookBox( const TQString& filename,
+ const PhraseBook& phraseBook, TQWidget *tqparent,
+ const char *name, bool modal )
+ : TQDialog( tqparent, name, modal ), fn( filename ), pb( phraseBook )
+{
+ TQGridLayout *gl = new TQGridLayout( this, 4, 3, 11, 11,
+ "phrase book outer tqlayout" );
+ TQVBoxLayout *bl = new TQVBoxLayout( 6, "phrase book button tqlayout" );
+
+ sourceLed = new TQLineEdit( this, "source line edit" );
+ TQLabel *source = new TQLabel( sourceLed, tr("S&ource phrase:"), this,
+ "source label" );
+ targetLed = new TQLineEdit( this, "target line edit" );
+ TQLabel *target = new TQLabel( targetLed, tr("&Translation:"), this,
+ "target label" );
+ definitionLed = new TQLineEdit( this, "definition line edit" );
+ TQLabel *definition = new TQLabel( definitionLed, tr("&Definition:"), this,
+ "target label" );
+ lv = new PhraseLV( this, "phrase book list view" );
+
+ newBut = new TQPushButton( tr("&New Phrase"), this );
+ newBut->setDefault( TRUE );
+
+ removeBut = new TQPushButton( tr("&Remove Phrase"), this );
+ removeBut->setEnabled( FALSE );
+ TQPushButton *saveBut = new TQPushButton( tr("&Save"), this );
+ TQPushButton *closeBut = new TQPushButton( tr("Close"), this );
+
+ gl->addWidget( source, 0, 0 );
+ gl->addWidget( sourceLed, 0, 1 );
+ gl->addWidget( target, 1, 0 );
+ gl->addWidget( targetLed, 1, 1 );
+ gl->addWidget( definition, 2, 0 );
+ gl->addWidget( definitionLed, 2, 1 );
+ gl->addMultiCellWidget( lv, 3, 3, 0, 1 );
+ gl->addMultiCell( bl, 0, 3, 2, 2 );
+
+ bl->addWidget( newBut );
+ bl->addWidget( removeBut );
+ bl->addWidget( saveBut );
+ bl->addWidget( closeBut );
+ bl->addStretch( 1 );
+
+ connect( sourceLed, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(sourceChanged(const TQString&)) );
+ connect( targetLed, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(targetChanged(const TQString&)) );
+ connect( definitionLed, TQT_SIGNAL(textChanged(const TQString&)),
+ this, TQT_SLOT(definitionChanged(const TQString&)) );
+ connect( lv, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
+ this, TQT_SLOT(selectionChanged(TQListViewItem *)) );
+ connect( newBut, TQT_SIGNAL(clicked()), this, TQT_SLOT(newPhrase()) );
+ connect( removeBut, TQT_SIGNAL(clicked()), this, TQT_SLOT(removePhrase()) );
+ connect( saveBut, TQT_SIGNAL(clicked()), this, TQT_SLOT(save()) );
+ connect( closeBut, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) );
+
+ PhraseBook::ConstIterator it;
+ for ( it = phraseBook.begin(); it != phraseBook.end(); ++it )
+ (void) new PhraseLVI( lv, (*it) );
+ enableDisable();
+
+ TQWhatsThis::add( this, tr("This window allows you to add, modify, or delete"
+ " phrases in a phrase book.") );
+ TQWhatsThis::add( sourceLed, tr("This is the phrase in the source"
+ " language.") );
+ TQWhatsThis::add( targetLed, tr("This is the phrase in the target language"
+ " corresponding to the source phrase.") );
+ TQWhatsThis::add( definitionLed, tr("This is a definition for the source"
+ " phrase.") );
+ TQWhatsThis::add( newBut, tr("Click here to add the phrase to the phrase"
+ " book.") );
+ TQWhatsThis::add( removeBut, tr("Click here to remove the phrase from the"
+ " phrase book.") );
+ TQWhatsThis::add( saveBut, tr("Click here to save the changes made.") );
+ TQWhatsThis::add( closeBut, tr("Click here to close this window.") );
+}
+
+void PhraseBookBox::keyPressEvent( TQKeyEvent *ev )
+{
+ if ( ev->key() == Qt::Key_Down || ev->key() == Qt::Key_Up ||
+ ev->key() == TQt::Key_Next || ev->key() == TQt::Key_Prior )
+ TQApplication::sendEvent( lv,
+ new TQKeyEvent(ev->type(), ev->key(), ev->ascii(), ev->state(),
+ ev->text(), ev->isAutoRepeat(), ev->count()) );
+ else
+ TQDialog::keyPressEvent( ev );
+}
+
+void PhraseBookBox::newPhrase()
+{
+ Phrase ph;
+ ph.setSource( NewPhrase );
+ TQListViewItem *item = new PhraseLVI( lv, ph );
+ selectItem( item );
+}
+
+void PhraseBookBox::removePhrase()
+{
+ TQListViewItem *item = lv->currentItem();
+ TQListViewItem *next = item->itemBelow() != 0 ? item->itemBelow()
+ : item->itemAbove();
+ delete item;
+ if ( next != 0 )
+ selectItem( next );
+ enableDisable();
+}
+
+void PhraseBookBox::save()
+{
+ pb.clear();
+ TQListViewItem *item = lv->firstChild();
+ while ( item != 0 ) {
+ if ( !item->text(PhraseLVI::SourceTextShown).isEmpty() &&
+ item->text(PhraseLVI::SourceTextShown) != NewPhrase )
+ pb.append( Phrase(((PhraseLVI *) item)->phrase()) );
+ item = item->nextSibling();
+ }
+ if ( !pb.save( fn ) )
+ TQMessageBox::warning( this, tr("TQt Linguist"),
+ tr("Cannot save phrase book '%1'.").arg(fn) );
+}
+
+void PhraseBookBox::sourceChanged( const TQString& source )
+{
+ if ( lv->currentItem() != 0 ) {
+ lv->currentItem()->setText( PhraseLVI::SourceTextShown,
+ source.stripWhiteSpace() );
+ lv->currentItem()->setText( PhraseLVI::SourceTextOriginal, source );
+ lv->sort();
+ lv->ensureItemVisible( lv->currentItem() );
+ }
+}
+
+void PhraseBookBox::targetChanged( const TQString& target )
+{
+ if ( lv->currentItem() != 0 ) {
+ lv->currentItem()->setText( PhraseLVI::TargetTextShown,
+ target.stripWhiteSpace() );
+ lv->currentItem()->setText( PhraseLVI::TargetTextOriginal, target );
+ lv->sort();
+ lv->ensureItemVisible( lv->currentItem() );
+ }
+}
+
+void PhraseBookBox::definitionChanged( const TQString& definition )
+{
+ if ( lv->currentItem() != 0 ) {
+ lv->currentItem()->setText( PhraseLVI::DefinitionText, definition );
+ lv->sort();
+ lv->ensureItemVisible( lv->currentItem() );
+ }
+}
+
+void PhraseBookBox::selectionChanged( TQListViewItem * /* item */ )
+{
+ enableDisable();
+}
+
+void PhraseBookBox::selectItem( TQListViewItem *item )
+{
+ lv->setSelected( item, TRUE );
+ lv->ensureItemVisible( item );
+}
+
+void PhraseBookBox::enableDisable()
+{
+ TQListViewItem *item = lv->currentItem();
+
+ sourceLed->blockSignals( TRUE );
+ targetLed->blockSignals( TRUE );
+ definitionLed->blockSignals( TRUE );
+
+ if ( item == 0 ) {
+ sourceLed->setText( TQString() );
+ targetLed->setText( TQString() );
+ definitionLed->setText( TQString() );
+ } else {
+ sourceLed->setText( item->text(0) );
+ targetLed->setText( item->text(1) );
+ definitionLed->setText( item->text(2) );
+ }
+ sourceLed->setEnabled( item != 0 );
+ targetLed->setEnabled( item != 0 );
+ definitionLed->setEnabled( item != 0 );
+ removeBut->setEnabled( item != 0 );
+
+ sourceLed->blockSignals( FALSE );
+ targetLed->blockSignals( FALSE );
+ definitionLed->blockSignals( FALSE );
+
+ TQLineEdit *led = ( sourceLed->text() == NewPhrase ? sourceLed : targetLed );
+ led->setFocus();
+ led->selectAll();
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.h b/tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.h
new file mode 100644
index 0000000..bf3261b
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/phrasebookbox.h
@@ -0,0 +1,85 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PHRASEBOOKBOX_H
+#define PHRASEBOOKBOX_H
+
+#include "phrase.h"
+
+#include <tqdialog.h>
+#include <tqvaluelist.h>
+
+class TQLineEdit;
+class TQPushButton;
+class TQListViewItem;
+
+class PhraseLV;
+
+class PhraseBookBox : public TQDialog
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ PhraseBookBox( const TQString& filename, const PhraseBook& phraseBook,
+ TQWidget *tqparent = 0, const char *name = 0,
+ bool modal = FALSE );
+
+ const PhraseBook& phraseBook() const { return pb; }
+
+protected:
+ virtual void keyPressEvent( TQKeyEvent *ev );
+
+private Q_SLOTS:
+ void newPhrase();
+ void removePhrase();
+ void save();
+ void sourceChanged( const TQString& source );
+ void targetChanged( const TQString& target );
+ void definitionChanged( const TQString& definition );
+ void selectionChanged( TQListViewItem *item );
+
+private:
+ void selectItem( TQListViewItem *item );
+ void enableDisable();
+
+ TQLineEdit *sourceLed;
+ TQLineEdit *targetLed;
+ TQLineEdit *definitionLed;
+ TQPushButton *newBut;
+ TQPushButton *removeBut;
+ PhraseLV *lv;
+ TQString fn;
+ PhraseBook pb;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/phraselv.cpp b/tqtinterface/qt4/tools/linguist/linguist/phraselv.cpp
new file mode 100644
index 0000000..15177c0
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/phraselv.cpp
@@ -0,0 +1,171 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+/* TRANSLATOR PhraseLV
+
+ The phrase list in the right panel of the main window (with Source phrase,
+ Target phrase, and Definition in its header) is a PhraseLV object.
+*/
+
+#include "phraselv.h"
+
+#include <tqregexp.h>
+#include <tqwhatsthis.h>
+#include <tqheader.h>
+
+class WhatPhrase : public TQWhatsThis
+{
+public:
+ WhatPhrase( PhraseLV *w );
+
+ virtual TQString text( const TQPoint& p );
+
+private:
+ PhraseLV *tqparent;
+};
+
+WhatPhrase::WhatPhrase( PhraseLV *w )
+ : TQWhatsThis( w )
+{
+ tqparent = w;
+}
+
+TQString WhatPhrase::text( const TQPoint& p )
+{
+ TQListViewItem *item = tqparent->itemAt( p );
+ if ( item == 0 )
+ return PhraseLV::tr( "This is a list of phrase entries relevant to the"
+ " source text. Each phrase is supplemented with a suggested"
+ " translation and a definition." );
+ else
+ return TQString( PhraseLV::tr("<p><u>%1:</u>&nbsp;&nbsp;%2</p>"
+ "<p><u>%3:</u>&nbsp;&nbsp;%4</p>"
+ "<p><u>%5:</u>&nbsp;&nbsp;%6</p>") )
+ .arg( tqparent->columnText(PhraseLVI::SourceTextShown) )
+ .arg( item->text(PhraseLVI::SourceTextShown) )
+ .arg( tqparent->columnText(PhraseLVI::TargetTextShown) )
+ .arg( item->text(PhraseLVI::TargetTextShown) )
+ .arg( tqparent->columnText(PhraseLVI::DefinitionText) )
+ .arg( item->text(PhraseLVI::DefinitionText) );
+}
+
+PhraseLVI::PhraseLVI( PhraseLV *tqparent, const Phrase& phrase, int accelKey )
+ : TQListViewItem( tqparent ),
+ akey( accelKey )
+{
+ setPhrase( phrase );
+}
+
+TQString PhraseLVI::key( int column, bool ascending ) const
+{
+ if ( column == SourceTextShown ) {
+ if ( sourceTextKey.isEmpty() ) {
+ if ( ascending ) {
+ return "";
+ } else {
+ return TQString();
+ }
+ } else {
+ return sourceTextKey;
+ }
+ } else if ( column == TargetTextShown ) {
+ return targetTextKey;
+ } else {
+ return TQChar( '0' + akey ) + text( column );
+ }
+}
+
+void PhraseLVI::setText( int column, const TQString& text )
+{
+ if ( column == SourceTextShown ) {
+ sourceTextKey = makeKey( text );
+ } else if ( column == TargetTextShown ) {
+ targetTextKey = makeKey( text );
+ }
+ TQListViewItem::setText( column, text );
+}
+
+void PhraseLVI::setPhrase( const Phrase& phrase )
+{
+ setText( SourceTextShown, phrase.source().simplifyWhiteSpace() );
+ setText( TargetTextShown, phrase.target().simplifyWhiteSpace() );
+ setText( DefinitionText, phrase.definition() );
+ setText( SourceTextOriginal, phrase.source() );
+ setText( TargetTextOriginal, phrase.target() );
+}
+
+Phrase PhraseLVI::phrase() const
+{
+ return Phrase( text(SourceTextOriginal), text(TargetTextOriginal),
+ text(DefinitionText) );
+}
+
+TQString PhraseLVI::makeKey( const TQString& text ) const
+{
+ if ( text == NewPhrase )
+ return TQString();
+
+ TQString key;
+ for ( int i = 0; i < (int) text.length(); i++ ) {
+ if ( text[i] != TQChar('&') )
+ key += text[i].lower();
+ }
+ // see Section 5, Exercise 4 of The Art of Computer Programming
+ key += TQChar::null;
+ key += text;
+ return key;
+}
+
+PhraseLV::PhraseLV( TQWidget *tqparent, const char *name )
+ : TQListView( tqparent, name )
+{
+ setAllColumnsShowFocus( TRUE );
+ setShowSortIndicator( TRUE );
+ for ( int i = 0; i < 3; i++ )
+ addColumn( TQString(), 120 );
+ setColumnText( PhraseLVI::SourceTextShown, tr("Source phrase") );
+ setColumnText( PhraseLVI::TargetTextShown, tr("Translation") );
+ setColumnText( PhraseLVI::DefinitionText, tr("Definition") );
+ header()->setStretchEnabled( TRUE, -1 );
+ what = new WhatPhrase( this );
+}
+
+PhraseLV::~PhraseLV()
+{
+// delete what;
+}
+
+TQSize PhraseLV::tqsizeHint() const
+{
+ return TQSize( TQListView::tqsizeHint().width(), 50 );
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/phraselv.h b/tqtinterface/qt4/tools/linguist/linguist/phraselv.h
new file mode 100644
index 0000000..e6fedd6
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/phraselv.h
@@ -0,0 +1,83 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PHRASELV_H
+#define PHRASELV_H
+
+#include "phrase.h"
+
+#include <tqlistview.h>
+
+class TQWhatsThis;
+
+class PhraseLV;
+
+#define NewPhrase PhraseLV::tr( "(New Phrase)" )
+
+class PhraseLVI : public TQListViewItem
+{
+public:
+ enum { SourceTextShown, TargetTextShown, DefinitionText, SourceTextOriginal,
+ TargetTextOriginal };
+
+ PhraseLVI( PhraseLV *tqparent, const Phrase& phrase, int accelKey = 0 );
+
+ virtual void setText( int column, const TQString& text );
+ virtual TQString key( int column, bool ascending ) const;
+
+ void setPhrase( const Phrase& phrase );
+ Phrase phrase() const;
+ int accelKey() const { return akey; }
+
+private:
+ TQString makeKey( const TQString& text ) const;
+
+ int akey;
+ TQString sourceTextKey;
+ TQString targetTextKey;
+};
+
+class PhraseLV : public TQListView
+{
+ TQ_OBJECT
+public:
+ PhraseLV( TQWidget *tqparent, const char *name );
+ ~PhraseLV();
+
+ virtual TQSize tqsizeHint() const;
+
+private:
+ TQWhatsThis *what;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/printout.cpp b/tqtinterface/qt4/tools/linguist/linguist/printout.cpp
new file mode 100644
index 0000000..1aae592
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/printout.cpp
@@ -0,0 +1,182 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "printout.h"
+
+#include <tqprinter.h>
+#include <tqfontmetrics.h>
+
+PrintOut::PrintOut( TQPrinter *printer )
+ : pr( printer ), pdmetrics( printer ), nextRule( NoRule ), page( 0 )
+{
+ p.begin( pr );
+ TQFont f( "Arial" );
+ f8 = f;
+ f8.setPointSize( 8 );
+ f10 = f;
+ f10.setPointSize( 10 );
+ p.setFont( f10 );
+ fmetrics = new TQFontMetrics( p.fontMetrics() );
+ hmargin = 5 * pdmetrics.width() / pdmetrics.widthMM(); // 5 mm
+ vmargin = 5 * pdmetrics.height() / pdmetrics.heightMM(); // 5 mm
+ hsize = pdmetrics.width() - 2 * hmargin;
+ vsize = pdmetrics.height() - vmargin;
+ dateTime = TQDateTime::tqcurrentDateTime();
+ breakPage();
+ vsize -= voffset;
+ cp = Paragraph( TQPoint(hmargin, voffset) );
+}
+
+PrintOut::~PrintOut()
+{
+ flushLine();
+ delete fmetrics;
+ p.end();
+}
+
+void PrintOut::setRule( Rule rule )
+{
+ if ( (int) nextRule < (int) rule )
+ nextRule = rule;
+}
+
+void PrintOut::setGuide( const TQString& guide )
+{
+ g = guide;
+}
+
+void PrintOut::vskip()
+{
+ if ( !firstParagraph )
+ voffset += 14;
+}
+
+void PrintOut::flushLine( bool /* mayBreak */ )
+{
+ if ( voffset + cp.rect.height() > vsize )
+ breakPage();
+ else if ( !firstParagraph )
+ drawRule( nextRule );
+
+ for ( int i = 0; i < (int) cp.boxes.count(); i++ ) {
+ Box b = cp.boxes[i];
+ b.rect.moveBy( 0, voffset );
+ TQRect r = b.rect;
+ p.setFont( b.font );
+ p.drawText( r, b.align, b.text );
+ }
+ voffset += cp.rect.height();
+
+ nextRule = NoRule;
+ cp = Paragraph( TQPoint(hmargin, voffset) );
+ firstParagraph = FALSE;
+}
+
+void PrintOut::addBox( int percent, const TQString& text, Style style,
+ int halign )
+{
+ int align = halign | TQt::AlignTop;
+ TQFont f = f10;
+ if ( style == Strong )
+ f.setBold( TRUE );
+ else if ( style == Emphasis )
+ f.setItalic( TRUE );
+ int wd = hsize * percent / 100;
+ TQRect r( cp.rect.x() + cp.rect.width(), 0, wd, vsize );
+ int ht = p.boundingRect( r, align, text ).height();
+
+ Box b( r, text, f, align );
+ cp.boxes.append( b );
+ cp.rect.setSize( TQSize(cp.rect.width() + wd, TQMAX(cp.rect.height(), ht)) );
+}
+
+void PrintOut::breakPage()
+{
+ static const int LeftAlign = TQt::AlignLeft | TQt::AlignTop;
+ static const int RightAlign = TQt::AlignRight | TQt::AlignTop;
+ TQRect r1, r2;
+ int h1 = 0;
+ int h2 = 0;
+
+ if ( page++ > 0 )
+ pr->newPage();
+ voffset = 0;
+
+ p.setFont( f10 );
+ r1 = TQRect( hmargin, voffset, 3 * hsize / 4, vsize );
+ r2 = TQRect( r1.x() + r1.width(), voffset, hsize - r1.width(), vsize );
+ h1 = p.boundingRect( r1, LeftAlign, pr->docName() ).height();
+ p.drawText( r1, LeftAlign, pr->docName() );
+ h2 = p.boundingRect( r2, RightAlign, TQString::number(page) ).height();
+ p.drawText( r2, RightAlign, TQString::number(page) );
+ voffset += TQMAX( h1, h2 );
+
+ r1 = TQRect( hmargin, voffset, hsize / 2, LeftAlign );
+ p.setFont( f8 );
+ h1 = p.boundingRect( r1, LeftAlign, dateTime.toString() ).height();
+ p.drawText( r1, LeftAlign, dateTime.toString() );
+ p.setFont( f10 );
+ voffset += TQMAX( h1, h2 );
+
+ voffset += 4;
+ p.drawLine( TQPoint(hmargin, voffset), TQPoint(hmargin + hsize, voffset) );
+ voffset += 14;
+ firstParagraph = TRUE;
+}
+
+void PrintOut::drawRule( Rule rule )
+{
+ TQPen pen;
+
+ switch ( rule ) {
+ case NoRule:
+ voffset += 5;
+ break;
+ case ThinRule:
+ pen.setColor( TQColor(192, 192, 192) );
+ pen.setStyle( Qt::DotLine );
+ pen.setWidth( 0 );
+ p.setPen( pen );
+ voffset += 5;
+ p.drawLine( TQPoint(hmargin, voffset),
+ TQPoint(hmargin + hsize, voffset) );
+ p.setPen( TQPen() );
+ voffset += 2;
+ break;
+ case ThickRule:
+ voffset += 7;
+ p.drawLine( TQPoint(hmargin, voffset),
+ TQPoint(hmargin + hsize, voffset) );
+ voffset += 4;
+ }
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/printout.h b/tqtinterface/qt4/tools/linguist/linguist/printout.h
new file mode 100644
index 0000000..efcb4d1
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/printout.h
@@ -0,0 +1,126 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PRINTOUT_H
+#define PRINTOUT_H
+
+#include <tqfont.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpainter.h>
+#include <tqrect.h>
+#include <tqvaluelist.h>
+#include <tqdatetime.h>
+
+class TQPrinter;
+class TQFontMetrics;
+
+class PrintOut
+{
+public:
+ enum Rule { NoRule, ThinRule, ThickRule };
+ enum Style { Normal, Strong, Emphasis };
+
+ PrintOut( TQPrinter *printer );
+ ~PrintOut();
+
+ void setRule( Rule rule );
+ void setGuide( const TQString& guide );
+ void vskip();
+ void flushLine( bool mayBreak = FALSE );
+ void addBox( int percent, const TQString& text = TQString(),
+ Style style = Normal,
+ int halign = TQt::AlignLeft | TQt::WordBreak );
+
+ int pageNum() const { return page; }
+
+ struct Box
+ {
+ TQRect rect;
+ TQString text;
+ TQFont font;
+ int align;
+
+ Box() : align( 0 ) { }
+ Box( const TQRect& r, const TQString& t, const TQFont& f, int a )
+ : rect( r ), text( t ), font( f ), align( a ) { }
+ Box( const Box& b )
+ : rect( b.rect ), text( b.text ), font( b.font ),
+ align( b.align ) { }
+
+ Box& operator=( const Box& b ) {
+ rect = b.rect;
+ text = b.text;
+ font = b.font;
+ align = b.align;
+ return *this;
+ }
+
+ bool operator==( const Box& b ) const {
+ return rect == b.rect && text == b.text && font == b.font &&
+ align == b.align;
+ }
+ };
+
+private:
+ void breakPage();
+ void drawRule( Rule rule );
+
+ struct Paragraph {
+ TQRect rect;
+ TQValueList<Box> boxes;
+
+ Paragraph() { }
+ Paragraph( TQPoint p ) : rect( p, TQSize(0, 0) ) { }
+ };
+
+ TQPrinter *pr;
+ TQPainter p;
+ TQFont f8;
+ TQFont f10;
+ TQFontMetrics *fmetrics;
+ TQPaintDeviceMetrics pdmetrics;
+ Rule nextRule;
+ Paragraph cp;
+ int page;
+ bool firstParagraph;
+ TQString g;
+ TQDateTime dateTime;
+
+ int hmargin;
+ int vmargin;
+ int voffset;
+ int hsize;
+ int vsize;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/simtexth.cpp b/tqtinterface/qt4/tools/linguist/linguist/simtexth.cpp
new file mode 100644
index 0000000..2d13965
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/simtexth.cpp
@@ -0,0 +1,239 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "simtexth.h"
+
+#include <metatranslator.h>
+
+#include <tqcstring.h>
+#include <tqdict.h>
+#include <tqmap.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+
+#include <string.h>
+
+typedef TQValueList<MetaTranslatorMessage> TML;
+
+/*
+ How similar are two texts? The approach used here relies on co-occurrence
+ matrices and is very efficient.
+
+ Let's see with an example: how similar are "here" and "hither"? The
+ co-occurrence matrix M for "here" is M[h,e] = 1, M[e,r] = 1, M[r,e] = 1, and 0
+ elsewhere; the matrix N for "hither" is N[h,i] = 1, N[i,t] = 1, ...,
+ N[h,e] = 1, N[e,r] = 1, and 0 elsewhere. The union U of both matrices is the
+ matrix U[i,j] = max { M[i,j], N[i,j] }, and the intersection V is
+ V[i,j] = min { M[i,j], N[i,j] }. The score for a pair of texts is
+
+ score = (sum of V[i,j] over all i, j) / (sum of U[i,j] over all i, j),
+
+ a formula suggested by Arnt Gulbrandsen. Here we have
+
+ score = 2 / 6,
+
+ or one third.
+
+ The implementation differs from this in a few details. Most importantly,
+ repetitions are ignored; for input "xxx", M[x,x] equals 1, not 2.
+*/
+
+/*
+ Every character is assigned to one of 20 buckets so that the co-occurrence
+ matrix requires only 20 * 20 = 400 bits, not 256 * 256 = 65536 bits or even
+ more if we want the whole Unicode. Which character falls in which bucket is
+ arbitrary.
+
+ The second half of the table is a replica of the first half, because of
+ laziness.
+*/
+static const int indexOf[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+// ! " # $ % & ' ( ) * + , - . /
+ 0, 2, 6, 7, 10, 12, 15, 19, 2, 6, 7, 10, 12, 15, 19, 0,
+// 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ 1, 3, 4, 5, 8, 9, 11, 13, 14, 16, 2, 6, 7, 10, 12, 15,
+// @ A B C D E F G H I J K L M N O
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 10, 11, 12, 13, 14,
+// P Q R S T U V W X Y Z [ \ ] ^ _
+ 15, 12, 16, 17, 18, 19, 2, 10, 15, 7, 19, 2, 6, 7, 10, 0,
+// ` a b c d e f g h i j k l m n o
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 10, 11, 12, 13, 14,
+// p q r s t u v w x y z { | } ~
+ 15, 12, 16, 17, 18, 19, 2, 10, 15, 7, 19, 2, 6, 7, 10, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 6, 7, 10, 12, 15, 19, 2, 6, 7, 10, 12, 15, 19, 0,
+ 1, 3, 4, 5, 8, 9, 11, 13, 14, 16, 2, 6, 7, 10, 12, 15,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 10, 11, 12, 13, 14,
+ 15, 12, 16, 17, 18, 19, 2, 10, 15, 7, 19, 2, 6, 7, 10, 0,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 10, 11, 12, 13, 14,
+ 15, 12, 16, 17, 18, 19, 2, 10, 15, 7, 19, 2, 6, 7, 10, 0
+};
+
+/*
+ The entry bitCount[i] (for i between 0 and 255) is the number of bits used to
+ represent i in binary.
+*/
+static const int bitCount[256] = {
+ 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
+ 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
+};
+
+struct CoMatrix
+{
+ /*
+ The matrix has 20 * 20 = 400 entries. This requires 50 bytes, or 13
+ words. Some operations are performed on words for more efficiency.
+ */
+ union {
+ TQ_UINT8 b[52];
+ TQ_UINT32 w[13];
+ };
+
+ CoMatrix() { memset( b, 0, 52 ); }
+ CoMatrix( const char *text ) {
+ char c = '\0', d;
+ memset( b, 0, 52 );
+ /*
+ The Knuth books are not in the office only for show; they help make
+ loops 30% faster and 20% as readable.
+ */
+ while ( (d = *text) != '\0' ) {
+ setCoocc( c, d );
+ if ( (c = *++text) != '\0' ) {
+ setCoocc( d, c );
+ text++;
+ }
+ }
+ }
+
+ void setCoocc( char c, char d ) {
+ int k = indexOf[(uchar) c] + 20 * indexOf[(uchar) d];
+ b[k >> 3] |= k & 0x7;
+ }
+
+ int worth() const {
+ int w = 0;
+ for ( int i = 0; i < 50; i++ )
+ w += bitCount[b[i]];
+ return w;
+ }
+};
+
+static inline CoMatrix reunion( const CoMatrix& m, const CoMatrix& n )
+{
+ CoMatrix p;
+ for ( int i = 0; i < 13; i++ )
+ p.w[i] = m.w[i] | n.w[i];
+ return p;
+}
+
+static inline CoMatrix intersection( const CoMatrix& m, const CoMatrix& n )
+{
+ CoMatrix p;
+ for ( int i = 0; i < 13; i++ )
+ p.w[i] = m.w[i] & n.w[i];
+ return p;
+}
+
+CandidateList similarTextHeuristicCandidates( const MetaTranslator *tor,
+ const char *text,
+ int maxCandidates )
+{
+ TQValueList<int> scores;
+ CandidateList candidates;
+ CoMatrix cmTarget( text );
+ int targetLen = tqstrlen( text );
+
+ TML all = tor->translatedMessages();
+ TML::Iterator it;
+
+ for ( it = all.begin(); it != all.end(); ++it ) {
+ if ( (*it).type() == MetaTranslatorMessage::Unfinished ||
+ (*it).translation().isEmpty() )
+ continue;
+
+ TQString s = tor->toUnicode( (*it).sourceText(), (*it).utf8() );
+ CoMatrix cm( s.latin1() );
+ int delta = TQABS( (int) s.length() - targetLen );
+
+ /*
+ Here is the score formula. A comment above tqcontains a
+ discussion on a similar (but simpler) formula.
+ */
+ int score = ( (intersection(cm, cmTarget).worth() + 1) << 10 ) /
+ ( reunion(cm, cmTarget).worth() + (delta << 1) + 1 );
+
+ if ( (int) candidates.count() == maxCandidates &&
+ score > scores[maxCandidates - 1] )
+ candidates.remove( candidates.last() );
+ if ( (int) candidates.count() < maxCandidates && score >= 190 ) {
+ Candidate cand( s, (*it).translation() );
+
+ int i;
+ for ( i = 0; i < (int) candidates.count(); i++ ) {
+ if ( score >= scores[i] ) {
+ if ( score == scores[i] ) {
+ if ( candidates[i] == cand )
+ goto continue_outer_loop;
+ } else {
+ break;
+ }
+ }
+ }
+ scores.insert( scores.at(i), score );
+ candidates.insert( candidates.at(i), cand );
+ }
+ continue_outer_loop:
+ ;
+ }
+ return candidates;
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/simtexth.h b/tqtinterface/qt4/tools/linguist/linguist/simtexth.h
new file mode 100644
index 0000000..e28cdf7
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/simtexth.h
@@ -0,0 +1,64 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef SIMTEXTH_H
+#define SIMTEXTH_H
+
+#include <tqstring.h>
+#include <tqvaluelist.h>
+
+class MetaTranslator;
+
+struct Candidate {
+ TQString source;
+ TQString target;
+
+ Candidate() { }
+ Candidate( const TQString& source0, const TQString& target0 )
+ : source( source0 ), target( target0 ) { }
+};
+
+inline bool operator==( const Candidate& c, const Candidate& d ) {
+ return c.target == d.target && c.source == d.source;
+}
+inline bool operator!=( const Candidate& c, const Candidate& d ) {
+ return !operator==( c, d );
+}
+
+typedef TQValueList<Candidate> CandidateList;
+
+CandidateList similarTextHeuristicCandidates( const MetaTranslator *tor,
+ const char *text,
+ int maxCandidates );
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/linguist/statistics.ui b/tqtinterface/qt4/tools/linguist/linguist/statistics.ui
new file mode 100644
index 0000000..1d304d7
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/statistics.ui
@@ -0,0 +1,259 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Statistics</class>
+<comment>*********************************************************************
+** Copyright (C) 2002-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>Statistics</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>336</width>
+ <height>164</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Statistics</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>tqlayout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>closeBtn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="TQFrame" row="0" column="0">
+ <property name="name">
+ <cstring>frame4</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="2">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Translation</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Source</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1">
+ <property name="name">
+ <cstring>untrWords</cstring>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="2">
+ <property name="name">
+ <cstring>trWords</cstring>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Words:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="2">
+ <property name="name">
+ <cstring>trChars</cstring>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="1">
+ <property name="name">
+ <cstring>untrChars</cstring>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Characters:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel6</cstring>
+ </property>
+ <property name="text">
+ <string>Characters (with spaces):</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="2">
+ <property name="name">
+ <cstring>trCharsSpc</cstring>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="1">
+ <property name="name">
+ <cstring>untrCharsSpc</cstring>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>closeBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>Statistics</receiver>
+ <slot>close()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">statistics.ui.h</include>
+</includes>
+<Q_SIGNALS>
+ <signal>closed()</signal>
+</Q_SIGNALS>
+<Q_SLOTS>
+ <slot>updateStats( int w1, int c1, int cs1, int w2, int c2, int cs2 )</slot>
+ <slot>closeEvent( TQCloseEvent * e )</slot>
+</Q_SLOTS>
+<functions>
+ <function access="private" specifier="non virtual">init()</function>
+</functions>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/linguist/linguist/statistics.ui.h b/tqtinterface/qt4/tools/linguist/linguist/statistics.ui.h
new file mode 100644
index 0000000..0207d0a
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/statistics.ui.h
@@ -0,0 +1,53 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+void Statistics::init()
+{
+ setFixedHeight( tqsizeHint().height() );
+}
+
+void Statistics::updateStats( int w1, int c1, int cs1, int w2, int c2, int cs2 )
+{
+ untrWords->setText( TQString::number( w1 ) );
+ untrChars->setText( TQString::number( c1 ) );
+ untrCharsSpc->setText( TQString::number( cs1 ) );
+ trWords->setText( TQString::number( w2 ) );
+ trChars->setText( TQString::number( c2 ) );
+ trCharsSpc->setText( TQString::number( cs2 ) );
+}
+
+void Statistics::closeEvent( TQCloseEvent * e )
+{
+ emit closed();
+ TQDialog::closeEvent( e );
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/trwindow.cpp b/tqtinterface/qt4/tools/linguist/linguist/trwindow.cpp
new file mode 100644
index 0000000..8ebc932
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/trwindow.cpp
@@ -0,0 +1,2072 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+/* TRANSLATOR TrWindow
+
+ This is the application's main window.
+*/
+
+#include "trwindow.h"
+#include "listviews.h"
+#include "finddialog.h"
+#include "msgedit.h"
+#include "phrasebookbox.h"
+#include "printout.h"
+#include "about.h"
+#include "phraselv.h"
+#include "statistics.h"
+
+#include <tqaccel.h>
+#include <tqaction.h>
+#include <tqapplication.h>
+#include <tqbitmap.h>
+#include <tqdict.h>
+#include <tqdockarea.h>
+#include <tqdockwindow.h>
+#include <tqfile.h>
+#include <tqfiledialog.h>
+#include <tqfileinfo.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqmenubar.h>
+#include <tqmessagebox.h>
+#include <tqpopupmenu.h>
+#include <tqregexp.h>
+#include <tqsettings.h>
+#include <tqstatusbar.h>
+#include <tqtoolbar.h>
+#include <tqwhatsthis.h>
+#include <tqprocess.h>
+#include <tqobject.h>
+#include <tqassistantclient.h>
+
+#include <stdlib.h>
+
+#define pagecurl_mask_width 53
+#define pagecurl_mask_height 51
+static const uchar pagecurl_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x0f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
+ 0xfc, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x0f,
+ 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff,
+ 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0,
+ 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff,
+ 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
+ 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f,
+ 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff,
+ 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0,
+ 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc,
+ 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 };
+
+typedef TQValueList<MetaTranslatorMessage> TML;
+
+static const int ErrorMS = 600000; // for error messages
+static const int MessageMS = 2500;
+
+TQPixmap * TrWindow::pxOn = 0;
+TQPixmap * TrWindow::pxOff = 0;
+TQPixmap * TrWindow::pxObsolete = 0;
+TQPixmap * TrWindow::pxDanger = 0;
+
+enum Ending { End_None, End_FullStop, End_Interrobang, End_Colon,
+ End_Ellipsis };
+
+static Ending ending( TQString str )
+{
+ str = str.simplifyWhiteSpace();
+ int ch = 0;
+ if ( !str.isEmpty() )
+ ch = str.right( 1 )[0].tqunicode();
+
+ switch ( ch ) {
+ case 0x002e: // full stop
+ if ( str.endsWith(TQString("...")) )
+ return End_Ellipsis;
+ else
+ return End_FullStop;
+ case 0x0589: // armenian full stop
+ case 0x06d4: // arabic full stop
+ case 0x3002: // ideographic full stop
+ return End_FullStop;
+ case 0x0021: // exclamation mark
+ case 0x003f: // question mark
+ case 0x00a1: // inverted exclamation mark
+ case 0x00bf: // inverted question mark
+ case 0x01c3: // latin letter retroflex click
+ case 0x037e: // greek question mark
+ case 0x061f: // arabic question mark
+ case 0x203c: // double exclamation mark
+ case 0x203d: // interrobang
+ case 0x2048: // question exclamation mark
+ case 0x2049: // exclamation question mark
+ case 0x2762: // heavy exclamation mark ornament
+ return End_Interrobang;
+ case 0x003a: // colon
+ return End_Colon;
+ case 0x2026: // horizontal ellipsis
+ return End_Ellipsis;
+ default:
+ return End_None;
+ }
+}
+
+class Action : public TQAction
+{
+public:
+ Action( TQPopupMenu *pop, const TQString& menuText, TQObject *receiver,
+ const char *member, const TQString &imageName = TQString(),
+ int accel = 0, bool toggle = FALSE );
+ Action( TQPopupMenu *pop, const TQString& menuText, int accel = 0,
+ bool toggle = FALSE );
+
+ virtual void setWhatsThis( const TQString& whatsThis );
+
+ bool addToToolbar( TQToolBar *tb, const TQString& text );
+};
+
+Action::Action( TQPopupMenu *pop, const TQString& menuText, TQObject *receiver,
+ const char *member, const TQString &imageName, int accel,
+ bool toggle )
+ : TQAction( pop->tqparent(), (const char *) 0, toggle )
+{
+ setMenuText( menuText );
+ setAccel( accel );
+
+ if ( !imageName.isEmpty() ) {
+ TQPixmap enabledPix = TQPixmap::fromMimeSource( imageName );
+ TQIconSet s( enabledPix );
+ if ( imageName != "whatsthis.xpm" ) {
+ TQPixmap disabledPix = TQPixmap::fromMimeSource( "d_" + imageName );
+ s.setPixmap( disabledPix, TQIconSet::Small, TQIconSet::Disabled );
+ }
+ setIconSet( s );
+ }
+ TQAction::addTo( pop );
+ connect( this, TQT_SIGNAL(activated()), receiver, member );
+}
+
+Action::Action( TQPopupMenu *pop, const TQString& menuText, int accel,
+ bool toggle )
+ : TQAction( pop->tqparent(), (const char *) 0, toggle )
+{
+ TQAction::addTo( pop );
+ setMenuText( menuText );
+ setAccel( accel );
+}
+
+void Action::setWhatsThis( const TQString& whatsThis )
+{
+ TQAction::setWhatsThis( whatsThis );
+ setStatusTip( whatsThis );
+}
+
+bool Action::addToToolbar( TQToolBar *tb, const TQString& text )
+{
+ setText( text );
+ return TQAction::addTo( tb );
+}
+
+const TQPixmap TrWindow::pageCurl()
+{
+ TQPixmap pixmap;
+ pixmap = TQPixmap::fromMimeSource( "pagecurl.png" );
+ if ( !pixmap.isNull() ) {
+ TQBitmap pageCurlMask( pagecurl_mask_width, pagecurl_mask_height,
+ pagecurl_mask_bits, TRUE );
+ pixmap.setMask( pageCurlMask );
+ }
+
+ return pixmap;
+}
+
+TrWindow::TrWindow()
+ : TQMainWindow( 0, "translation window", (WFlags)(TQt::WType_TopLevel | TQt::WDestructiveClose) )
+{
+
+#ifndef TQ_WS_MACX
+ setIcon( TQPixmap::fromMimeSource( "appicon.png" ) );
+#endif
+
+ // Create the application global listview symbols
+ pxOn = new TQPixmap( TQPixmap::fromMimeSource( "s_check_on.png" ) );
+ pxOff = new TQPixmap( TQPixmap::fromMimeSource( "s_check_off.png" ) );
+ pxObsolete = new TQPixmap( TQPixmap::fromMimeSource( "d_s_check_obs.png" ) );
+ pxDanger = new TQPixmap( TQPixmap::fromMimeSource( "s_check_danger.png" ) );
+
+ // Set up the Scope dock window
+ TQDockWindow * dwScope = new TQDockWindow( TQDockWindow::InDock, this,
+ "context");
+ dwScope->setResizeEnabled( TRUE );
+ dwScope->setCloseMode( TQDockWindow::Always );
+ addDockWindow( dwScope, tqtr("Context"), TQt::DockLeft );
+ dwScope->setCaption( tqtr("Context") );
+ dwScope->setFixedExtentWidth( 200 );
+ lv = new TQListView( dwScope, "context list view" );
+ lv->setShowSortIndicator( TRUE );
+ lv->setAllColumnsShowFocus( TRUE );
+ lv->header()->setStretchEnabled( TRUE, 1 );
+ TQFontMetrics fm( font() );
+ lv->addColumn( tqtr("Done"), fm.width( tqtr("Done") ) + 10 );
+ lv->addColumn( tqtr("Context") );
+ lv->addColumn( tqtr("Items"), 55 );
+ lv->setColumnAlignment( 0, TQt::AlignCenter );
+ lv->setColumnAlignment( 2, TQt::AlignRight );
+ lv->setSorting( 0 );
+ lv->setHScrollBarMode( TQScrollView::AlwaysOff );
+ dwScope->setWidget( lv );
+
+ messageIsShown = FALSE;
+ me = new MessageEditor( &tor, this, "message editor" );
+ setCentralWidget( me );
+ slv = me->sourceTextList();
+ plv = me->phraseList();
+
+ setupMenuBar();
+ setupToolBars();
+
+ progress = new TQLabel( statusBar(), "progress" );
+ statusBar()->addWidget( progress, 0, TRUE );
+ modified = new TQLabel( TQString(" %1 ").arg(tqtr("MOD")), statusBar(),
+ "modified?" );
+ statusBar()->addWidget( modified, 0, TRUE );
+
+ dirtyItem = -1;
+ numFinished = 0;
+ numNonobsolete = 0;
+ numMessages = 0;
+ updateProgress();
+
+ dirty = FALSE;
+ updateCaption();
+
+ phraseBooks.setAutoDelete( TRUE );
+
+ f = new FindDialog( FALSE, this, "tqfind", FALSE );
+ f->setCaption( tqtr("TQt Linguist") );
+ h = new FindDialog( TRUE, this, "tqreplace", FALSE );
+ h->setCaption( tqtr("TQt Linguist") );
+ tqfindMatchCase = FALSE;
+ tqfindWhere = 0;
+ foundItem = 0;
+ foundScope = 0;
+ foundWhere = 0;
+ foundOffset = 0;
+
+ connect( lv, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
+ this, TQT_SLOT(showNewScope(TQListViewItem *)) );
+
+ connect( slv, TQT_SIGNAL(currentChanged(TQListViewItem *)),
+ this, TQT_SLOT(showNewCurrent(TQListViewItem *)) );
+
+ connect( slv, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint&, int)),
+ this, TQT_SLOT(showNewCurrent(TQListViewItem *)) );
+
+ connect( slv, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint&, int)),
+ this, TQT_SLOT(toggleFinished(TQListViewItem *, const TQPoint&, int)) );
+
+ connect( me, TQT_SIGNAL(translationChanged(const TQString&)),
+ this, TQT_SLOT(updateTranslation(const TQString&)) );
+ connect( me, TQT_SIGNAL(finished(bool)), this, TQT_SLOT(updateFinished(bool)) );
+ connect( me, TQT_SIGNAL(prevUnfinished()), this, TQT_SLOT(prevUnfinished()) );
+ connect( me, TQT_SIGNAL(nextUnfinished()), this, TQT_SLOT(nextUnfinished()) );
+ connect( me, TQT_SIGNAL(focusSourceList()), this, TQT_SLOT(focusSourceList()) );
+ connect( me, TQT_SIGNAL(focusPhraseList()), this, TQT_SLOT(focusPhraseList()) );
+ connect( f, TQT_SIGNAL(tqfindNext(const TQString&, int, bool)),
+ this, TQT_SLOT(tqfindNext(const TQString&, int, bool)) );
+
+ TQWhatsThis::add( lv, tqtr("This panel lists the source contexts.") );
+
+ TQWhatsThis::add( slv, tqtr("This panel lists the source texts. "
+ "Items that violate validation rules "
+ "are marked with a warning.") );
+ showNewCurrent( 0 );
+
+ TQSize as( tqApp->desktop()->size() );
+ as -= TQSize( 30, 30 );
+ resize( TQSize( 1000, 800 ).boundedTo( as ) );
+ readConfig();
+ stats = 0;
+ srcWords = 0;
+ srcChars = 0;
+ srcCharsSpc = 0;
+}
+
+TrWindow::~TrWindow()
+{
+ writeConfig();
+ delete stats;
+}
+
+void TrWindow::openFile( const TQString& name )
+{
+ if ( !name.isEmpty() ) {
+ statusBar()->message( tqtr("Loading...") );
+ tqApp->processEvents();
+ tor.clear();
+ if ( tor.load(name) ) {
+ slv->clear();
+ slv->tqrepaint();
+ slv->viewport()->tqrepaint();
+ slv->setUpdatesEnabled( FALSE );
+ slv->viewport()->setUpdatesEnabled( FALSE );
+ lv->clear();
+ lv->tqrepaint();
+ lv->viewport()->tqrepaint();
+ lv->setUpdatesEnabled( FALSE );
+ lv->viewport()->setUpdatesEnabled( FALSE );
+ setEnabled( FALSE );
+ numFinished = 0;
+ numNonobsolete = 0;
+ numMessages = 0;
+ foundScope = 0;
+
+ TML all = tor.messages();
+ TML::Iterator it;
+ TQDict<ContextLVI> contexts( 1009 );
+
+ srcWords = 0;
+ srcChars = 0;
+ srcCharsSpc = 0;
+ for ( it = all.begin(); it != all.end(); ++it ) {
+ tqApp->processEvents();
+ ContextLVI *c = contexts.tqfind( TQString((*it).context()) );
+ if ( c == 0 ) {
+ c = new ContextLVI( lv, tor.toUnicode((*it).context(),
+ (*it).utf8()) );
+ contexts.insert( TQString((*it).context()), c );
+ }
+ if ( TQCString((*it).sourceText()) == ContextComment ) {
+ c->appendToComment( tor.toUnicode((*it).comment(),
+ (*it).utf8()) );
+ } else {
+ MessageLVI * tmp = new MessageLVI( slv, *it,
+ tor.toUnicode((*it).sourceText(),
+ (*it).utf8()),
+ tor.toUnicode((*it).comment(),
+ (*it).utf8()), c );
+ tmp->setDanger( danger(tmp->sourceText(),
+ tmp->translation()) &&
+ tmp->message().type() ==
+ MetaTranslatorMessage::Finished );
+ c->instantiateMessageItem( slv, tmp );
+ if ( (*it).type() != MetaTranslatorMessage::Obsolete ) {
+ numNonobsolete++;
+ if ( (*it).type() == MetaTranslatorMessage::Finished )
+ numFinished++;
+ doCharCounting( tmp->sourceText(), srcWords, srcChars, srcCharsSpc );
+ } else {
+ c->incrementObsoleteCount();
+ }
+ numMessages++;
+ }
+ c->updatetqStatus();
+ }
+ slv->viewport()->setUpdatesEnabled( TRUE );
+ slv->setUpdatesEnabled( TRUE );
+ lv->viewport()->setUpdatesEnabled( TRUE );
+ lv->setUpdatesEnabled( TRUE );
+ setEnabled( TRUE );
+ slv->tqrepaint();
+ slv->viewport()->tqrepaint();
+ lv->triggerUpdate();
+ updateProgress();
+ filename = name;
+ dirty = FALSE;
+ updateCaption();
+ me->showNothing();
+ doneAndNextAct->setEnabled( FALSE );
+ doneAndNextAlt->setEnabled( FALSE );
+ messageIsShown = FALSE;
+ statusBar()->message(
+ tqtr("%1 source phrase(s) loaded.").arg(numMessages),
+ MessageMS );
+
+ foundItem = 0;
+ foundWhere = 0;
+ foundOffset = 0;
+ if ( lv->childCount() > 0 ) {
+ tqfindAct->setEnabled( TRUE );
+ tqfindAgainAct->setEnabled( FALSE );
+#ifdef notyet
+ tqreplaceAct->setEnabled( TRUE );
+#endif
+ lv->setCurrentItem( lv->firstChild() );
+ }
+ addRecentlyOpenedFile( name, recentFiles );
+ updateStatistics();
+ } else {
+ statusBar()->clear();
+ TQMessageBox::warning( this, tqtr("TQt Linguist"),
+ tqtr("Cannot open '%1'.").arg(name) );
+ }
+ }
+}
+
+void TrWindow::open()
+{
+ if ( maybeSave() ) {
+ TQString newFilename = TQFileDialog::getOpenFileName( filename,
+ tqtr("TQt translation source (*.ts)\n"
+ "All files (*)"),
+ this, "open" );
+ openFile( newFilename );
+ }
+}
+
+void TrWindow::save()
+{
+ if ( filename.isEmpty() )
+ return;
+
+ if ( tor.save(filename) ) {
+ dirty = FALSE;
+ updateCaption();
+ statusBar()->message( tqtr("File saved."), MessageMS );
+ } else {
+ TQMessageBox::warning( this, tqtr("TQt Linguist"), tqtr("Cannot save '%1'.")
+ .arg(filename) );
+ }
+}
+
+void TrWindow::saveAs()
+{
+ TQString newFilename = TQFileDialog::getSaveFileName( filename,
+ tqtr( "TQt translation source (*.ts)\n"
+ "All files (*)"),
+ this, "save_as" );
+ if ( !newFilename.isEmpty() ) {
+ filename = newFilename;
+ save();
+ updateCaption();
+ }
+}
+
+void TrWindow::release()
+{
+ TQString newFilename = filename;
+ newFilename.tqreplace( TQRegExp(".ts$"), "" );
+ newFilename += TQString( ".qm" );
+
+ newFilename = TQFileDialog::getSaveFileName( newFilename,
+ tqtr("TQt message files for released applications (*.qm)\n"
+ "All files (*)"),
+ this, "release",
+ tqtr("Release") );
+ if ( !newFilename.isEmpty() ) {
+ if ( tor.release(newFilename) )
+ statusBar()->message( tqtr("File created."), MessageMS );
+ else
+ TQMessageBox::warning( this, tqtr("TQt Linguist"),
+ tqtr("Cannot save '%1'.").arg(newFilename) );
+ }
+}
+
+void TrWindow::print()
+{
+ int pageNum = 0;
+
+ if ( printer.setup(this) ) {
+ TQApplication::setOverrideCursor( WaitCursor );
+ printer.setDocName( filename );
+ statusBar()->message( tqtr("Printing...") );
+ PrintOut pout( &printer );
+ ContextLVI *c = (ContextLVI *) lv->firstChild();
+ while ( c != 0 ) {
+ setCurrentContextItem( c );
+ pout.vskip();
+ pout.setRule( PrintOut::ThickRule );
+ pout.setGuide( c->context() );
+ pout.addBox( 100, tqtr("Context: %1").arg(c->context()),
+ PrintOut::Strong );
+ pout.flushLine();
+ pout.addBox( 4 );
+ pout.addBox( 92, c->comment(), PrintOut::Emphasis );
+ pout.flushLine();
+ pout.setRule( PrintOut::ThickRule );
+
+ MessageLVI *m = (MessageLVI *) slv->firstChild();
+ while ( m != 0 ) {
+ pout.setRule( PrintOut::ThinRule );
+
+ TQString type;
+ switch ( m->message().type() ) {
+ case MetaTranslatorMessage::Finished:
+ type = tqtr( "finished" );
+ break;
+ case MetaTranslatorMessage::Unfinished:
+ type = m->danger() ? tqtr( "unresolved" ) : TQString( "unfinished" );
+ break;
+ case MetaTranslatorMessage::Obsolete:
+ type = tqtr( "obsolete" );
+ break;
+ default:
+ type = TQString( "" );
+ }
+ pout.addBox( 40, m->sourceText() );
+ pout.addBox( 4 );
+ pout.addBox( 40, m->translation() );
+ pout.addBox( 4 );
+ pout.addBox( 12, type, PrintOut::Normal, TQt::AlignRight );
+ if ( !m->comment().isEmpty() ) {
+ pout.flushLine();
+ pout.addBox( 4 );
+ pout.addBox( 92, m->comment(), PrintOut::Emphasis );
+ }
+ pout.flushLine( TRUE );
+
+ if ( pout.pageNum() != pageNum ) {
+ pageNum = pout.pageNum();
+ statusBar()->message( tqtr("Printing... (page %1)")
+ .arg(pageNum) );
+ }
+ m = (MessageLVI *) m->nextSibling();
+ }
+ c = (ContextLVI *) c->nextSibling();
+ }
+ pout.flushLine( TRUE );
+ TQApplication::restoreOverrideCursor();
+ statusBar()->message( tqtr("Printing completed"), MessageMS );
+ } else {
+ statusBar()->message( tqtr("Printing aborted"), MessageMS );
+ }
+}
+
+void TrWindow::tqfind()
+{
+ h->hide();
+ f->show();
+ f->setActiveWindow();
+ f->raise();
+}
+
+void TrWindow::tqfindAgain()
+{
+ int pass = 0;
+ int oldItemNo = itemToIndex( slv, slv->currentItem() );
+ TQString delayedMsg;
+ TQListViewItem * j = foundScope;
+ TQListViewItem * k = indexToItem( slv, foundItem );
+ TQListViewItem * oldScope = lv->currentItem();
+
+ if ( lv->childCount() == 0 )
+ return;
+#if 1
+ /*
+ As long as we don't implement highlighting of the text in the TQTextView,
+ we may have only one match per message.
+ */
+ foundOffset = (int) 0x7fffffff;
+#else
+ foundOffset++;
+#endif
+ slv->setUpdatesEnabled( FALSE );
+ do {
+ // Iterate through every item in all contexts
+ if ( j == 0 ) {
+ j = lv->firstChild();
+ setCurrentContextItem( j );
+ if ( foundScope != 0 )
+ delayedMsg = tqtr("Search wrapped.");
+ }
+ if ( k == 0 )
+ k = slv->firstChild();
+
+ while ( k ) {
+ MessageLVI * m = (MessageLVI *) k;
+ switch ( foundWhere ) {
+ case 0:
+ foundWhere = FindDialog::SourceText;
+ foundOffset = 0;
+ // fall-through
+ case FindDialog::SourceText:
+ if ( searchItem( m->sourceText(), j, k ) ) {
+ f->hide();
+ if ( !delayedMsg.isEmpty() )
+ statusBar()->message( delayedMsg, MessageMS );
+ return;
+ }
+ foundWhere = FindDialog::Translations;
+ foundOffset = 0;
+ // fall-through
+ case FindDialog::Translations:
+ if ( searchItem( m->translation(), j, k ) ) {
+ f->hide();
+ if ( !delayedMsg.isEmpty() )
+ statusBar()->message( delayedMsg, MessageMS );
+ return;
+ }
+ foundWhere = FindDialog::Comments;
+ foundOffset = 0;
+ // fall-through
+ case FindDialog::Comments:
+ if ( searchItem( ((ContextLVI *) j)->fullContext(), j, k) ) {
+ f->hide();
+ if ( !delayedMsg.isEmpty() )
+ statusBar()->message( delayedMsg, MessageMS );
+ return;
+ }
+ foundWhere = 0;
+ foundOffset = 0;
+ }
+ k = k->nextSibling();
+ }
+
+ j = j->nextSibling();
+ if ( j ) {
+ setCurrentContextItem( j );
+ k = slv->firstChild();
+ }
+ } while ( pass++ != lv->childCount() );
+
+ // This is just to keep the current scope and source text item
+ // selected after a search failed.
+ if ( oldScope ) {
+ setCurrentContextItem( oldScope );
+ TQListViewItem * tmp = indexToItem( slv, oldItemNo );
+ if( tmp )
+ setCurrentMessageItem( tmp );
+ } else {
+ if( lv->firstChild() )
+ setCurrentContextItem( lv->firstChild() );
+ if( slv->firstChild() )
+ setCurrentMessageItem( slv->firstChild() );
+ }
+
+ slv->setUpdatesEnabled( TRUE );
+ slv->triggerUpdate();
+ tqApp->beep();
+ TQMessageBox::warning( this, tqtr("TQt Linguist"),
+ TQString( tqtr("Cannot tqfind the string '%1'.") ).arg(tqfindText) );
+ foundItem = 0;
+ foundWhere = 0;
+ foundOffset = 0;
+}
+
+void TrWindow::tqreplace()
+{
+ f->hide();
+ h->show();
+ h->setActiveWindow();
+ h->raise();
+}
+
+int TrWindow::itemToIndex( TQListView * view, TQListViewItem * item )
+{
+ int no = 0;
+ TQListViewItem * tmp;
+
+ if( view && item ){
+ if( (tmp = view->firstChild()) != 0 )
+ do {
+ no++;
+ tmp = tmp->nextSibling();
+ } while( tmp && (tmp != item) );
+ }
+ return no;
+}
+
+TQListViewItem * TrWindow::indexToItem( TQListView * view, int index )
+{
+ TQListViewItem * item = 0;
+
+ if ( view && index > 0 ) {
+ item = view->firstChild();
+ while( item && index-- > 0 )
+ item = item->nextSibling();
+ }
+ return item;
+}
+
+bool TrWindow::searchItem( const TQString & searchWhat, TQListViewItem * j,
+ TQListViewItem * k )
+{
+ if ( (tqfindWhere & foundWhere) != 0 ) {
+ foundOffset = searchWhat.tqfind( tqfindText, foundOffset, tqfindMatchCase );
+ if ( foundOffset >= 0 ) {
+ foundItem = itemToIndex( slv, k );
+ foundScope = j;
+ setCurrentMessageItem( k );
+ slv->setUpdatesEnabled( TRUE );
+ slv->triggerUpdate();
+ return TRUE;
+ }
+ }
+ foundOffset = 0;
+ return FALSE;
+}
+
+void TrWindow::newPhraseBook()
+{
+ TQString name;
+ for (;;) {
+ name = TQFileDialog::getSaveFileName( TQString(),
+ tqtr("TQt phrase books (*.qph)\n"
+ "All files (*)"),
+ this, "new_phrasebook",
+ tqtr("Create New Phrase Book") );
+ if ( !TQFile::exists(name) )
+ break;
+ TQMessageBox::warning( this, tqtr("TQt Linguist"),
+ tqtr("A file called '%1' already exists."
+ " Please choose another name.").arg(name) );
+ }
+ if ( !name.isEmpty() ) {
+ PhraseBook pb;
+ if ( savePhraseBook(name, pb) ) {
+ if ( openPhraseBook(name) )
+ statusBar()->message( tqtr("Phrase book created."), MessageMS );
+ }
+ }
+}
+
+void TrWindow::openPhraseBook()
+{
+ TQString phrasebooks( qInstallPathData() );
+ TQString name = TQFileDialog::getOpenFileName( phrasebooks + "/phrasebooks",
+ tqtr("TQt phrase books (*.qph)\n"
+ "All files (*)"),
+ this, "open_phrasebook",
+ tqtr("Open Phrase Book") );
+ if ( !name.isEmpty() && !phraseBookNames.tqcontains(name) ) {
+ if ( openPhraseBook(name) ) {
+ int n = (int)(phraseBooks.at( phraseBooks.count() - 1 )->count());
+ statusBar()->message( tqtr("%1 phrase(s) loaded.").arg(n),
+ MessageMS );
+ }
+ }
+}
+
+void TrWindow::closePhraseBook( int id )
+{
+ int index = closePhraseBookp->indexOf( id );
+ phraseBooks.remove( index );
+ phraseBookNames.remove( phraseBookNames.at(index) );
+ updatePhraseDict();
+
+ dirtyItem = index; // remove the item next time the menu is opened
+ editPhraseBookp->removeItem( editPhraseBookp->idAt(index) );
+ printPhraseBookp->removeItem( printPhraseBookp->idAt(index) );
+}
+
+void TrWindow::editPhraseBook( int id )
+{
+ int index = editPhraseBookp->indexOf( id );
+ PhraseBookBox box( phraseBookNames[index], *phraseBooks.at(index), this,
+ "phrase book box", TRUE );
+ box.setCaption( tqtr("%1 - %2").arg(tqtr("TQt Linguist"))
+ .arg(friendlyPhraseBookName(index)) );
+ box.resize( 500, 300 );
+ box.exec();
+ *phraseBooks.at( index ) = box.phraseBook();
+ updatePhraseDict();
+}
+
+void TrWindow::printPhraseBook( int id )
+{
+ int index = printPhraseBookp->indexOf( id );
+ int pageNum = 0;
+
+ if ( printer.setup(this) ) {
+ printer.setDocName( phraseBookNames[index] );
+ statusBar()->message( tqtr("Printing...") );
+ PrintOut pout( &printer );
+ PhraseBook *phraseBook = phraseBooks.at( index );
+ PhraseBook::Iterator p;
+ pout.setRule( PrintOut::ThinRule );
+ for ( p = phraseBook->begin(); p != phraseBook->end(); ++p ) {
+ pout.setGuide( (*p).source() );
+ pout.addBox( 29, (*p).source() );
+ pout.addBox( 4 );
+ pout.addBox( 29, (*p).target() );
+ pout.addBox( 4 );
+ pout.addBox( 34, (*p).definition(), PrintOut::Emphasis );
+
+ if ( pout.pageNum() != pageNum ) {
+ pageNum = pout.pageNum();
+ statusBar()->message( tqtr("Printing... (page %1)")
+ .arg(pageNum) );
+ }
+ pout.setRule( PrintOut::NoRule );
+ pout.flushLine( TRUE );
+ }
+ pout.flushLine( TRUE );
+ statusBar()->message( tqtr("Printing completed"), MessageMS );
+ } else {
+ statusBar()->message( tqtr("Printing aborted"), MessageMS );
+ }
+}
+
+void TrWindow::revertSorting()
+{
+ lv->setSorting( 0 );
+ slv->setSorting( 0 );
+}
+
+void TrWindow::manual()
+{
+ TQAssistantClient *ac = new TQAssistantClient( qInstallPathBins(), TQT_TQOBJECT(this) );
+ ac->showPage( TQString( qInstallPathDocs() ) + "/html/linguist-manual.html" );
+}
+
+void TrWindow::about()
+{
+ AboutDialog about( this, 0, TRUE );
+ about.versionLabel->setText( tqtr("Version %1").arg(TQT_VERSION_STR) );
+ about.exec();
+}
+
+void TrWindow::aboutTQt()
+{
+ TQMessageBox::aboutTQt( this, tqtr("TQt Linguist") );
+}
+
+void TrWindow::setupPhrase()
+{
+ bool enabled = !phraseBooks.isEmpty();
+ phrasep->setItemEnabled( closePhraseBookId, enabled );
+ phrasep->setItemEnabled( editPhraseBookId, enabled );
+ phrasep->setItemEnabled( printPhraseBookId, enabled );
+}
+
+void TrWindow::closeEvent( TQCloseEvent *e )
+{
+ if ( maybeSave() )
+ e->accept();
+ else
+ e->ignore();
+}
+
+bool TrWindow::maybeSave()
+{
+ if ( dirty ) {
+ switch ( TQMessageBox::information(this, tqtr("TQt Linguist"),
+ tqtr("Do you want to save '%1'?")
+ .arg(filename),
+ TQMessageBox::Yes | TQMessageBox::Default,
+ TQMessageBox::No,
+ TQMessageBox::Cancel | TQMessageBox::Escape ) )
+ {
+ case TQMessageBox::Cancel:
+ return FALSE;
+ case TQMessageBox::Yes:
+ save();
+ return !dirty;
+ case TQMessageBox::No:
+ break;
+ }
+ }
+ return TRUE;
+}
+
+void TrWindow::updateCaption()
+{
+ TQString cap;
+ bool enable = !filename.isEmpty();
+ saveAct->setEnabled( enable );
+ saveAsAct->setEnabled( enable );
+ releaseAct->setEnabled( enable );
+ printAct->setEnabled( enable );
+ acceleratorsAct->setEnabled( enable );
+ endingPunctuationAct->setEnabled( enable );
+ phraseMatchesAct->setEnabled( enable );
+ revertSortingAct->setEnabled( enable );
+
+ if ( filename.isEmpty() )
+ cap = tqtr( "TQt Linguist by Trolltech" );
+ else
+ cap = tqtr( "%1 - %2" ).arg( tqtr("TQt Linguist by Trolltech") )
+ .arg( filename );
+ setCaption( cap );
+ modified->setEnabled( dirty );
+}
+
+//
+// New scope selected - build a new list of source text items
+// for that scope.
+//
+void TrWindow::showNewScope( TQListViewItem *item )
+{
+ static ContextLVI * oldContext = 0;
+
+ if( item != 0 ) {
+ ContextLVI * c = (ContextLVI *) item;
+ bool upe = slv->isUpdatesEnabled();
+ slv->setUpdatesEnabled( FALSE );
+ slv->viewport()->setUpdatesEnabled( FALSE );
+ if ( oldContext != 0 ) {
+ MessageLVI * tmp;
+ slv->blockSignals( TRUE );
+ while ( (tmp = (MessageLVI *) slv->firstChild()) != 0 )
+ oldContext->appendMessageItem( slv, tmp );
+ slv->blockSignals( FALSE );
+ }
+ MessageLVI * tmp;
+ while ( c->messageItemsInList() ) {
+ tmp = c->takeMessageItem( c->messageItemsInList() - 1);
+ slv->insertItem( tmp );
+ tmp->updateTranslationText();
+ }
+
+ // Make sure that we update the source text and translation text. Use the first message in the new scope.
+ setCurrentMessageItem(slv->firstChild());
+ // This must be explicitly called since the signal is not emitted if the context only tqcontains one item
+ showNewCurrent(slv->firstChild());
+ slv->viewport()->setUpdatesEnabled( upe );
+ slv->setUpdatesEnabled( upe );
+ if( upe )
+ slv->triggerUpdate();
+ oldContext = (ContextLVI *) item;
+ statusBar()->clear();
+ }
+}
+
+void TrWindow::showNewCurrent( TQListViewItem *item )
+{
+ messageIsShown = (item != 0);
+ MessageLVI *m = (MessageLVI *) item;
+ ContextLVI *c = (ContextLVI *) m ? m->contextLVI() : 0;
+
+ if ( messageIsShown ) {
+ me->showMessage( m->sourceText(), m->comment(), c->fullContext(),
+ m->translation(), m->message().type(),
+ getPhrases(m->sourceText()) );
+ if ( (m->message().type() != MetaTranslatorMessage::Finished) &&
+ m->danger() )
+ danger( m->sourceText(), m->translation(), TRUE );
+ else
+ statusBar()->clear();
+
+ doneAndNextAct->setEnabled( m->message().type() !=
+ MetaTranslatorMessage::Obsolete );
+ } else {
+ if ( item == 0 )
+ me->showNothing();
+ else
+ me->showContext( c->fullContext(), c->finished() );
+ doneAndNextAct->setEnabled( FALSE );
+ }
+ doneAndNextAlt->setEnabled( doneAndNextAct->isEnabled() );
+
+ selectAllAct->setEnabled( messageIsShown );
+}
+
+void TrWindow::updateTranslation( const TQString& translation )
+{
+ TQListViewItem *item = slv->currentItem();
+ if ( item != 0 ) {
+ MessageLVI *m = (MessageLVI *) item;
+ if ( translation != m->translation() ) {
+ bool dngr;
+ m->setTranslation( translation );
+ if ( m->finished() &&
+ (dngr = danger( m->sourceText(), m->translation(), TRUE )) ) {
+ numFinished -= 1;
+ m->setDanger( dngr );
+ m->setFinished( FALSE );
+ m->contextLVI()->updatetqStatus();
+ updateProgress();
+ }
+ tor.insert( m->message() );
+ if ( !dirty ) {
+ dirty = TRUE;
+ updateCaption();
+ }
+ m->updateTranslationText();
+ }
+ }
+}
+
+void TrWindow::updateFinished( bool finished )
+{
+ TQListViewItem *item = slv->currentItem();
+ if ( item != 0 ) {
+ MessageLVI *m = (MessageLVI *) item;
+ if ( finished != m->finished() ) {
+ numFinished += finished ? +1 : -1;
+ updateProgress();
+ m->setFinished( finished );
+ bool oldDanger = m->danger();
+ m->setDanger( /*m->finished() &&*/
+ danger(m->sourceText(), m->translation(),
+ !oldDanger) );
+ if ( !oldDanger && m->danger() )
+ tqApp->beep();
+ tor.insert( m->message() );
+ if ( !dirty ) {
+ dirty = TRUE;
+ updateCaption();
+ }
+ }
+ }
+}
+
+void TrWindow::doneAndNext()
+{
+ MessageLVI * m = (MessageLVI *) slv->currentItem();
+ bool dngr = FALSE;
+
+ if ( !m ) return;
+ dngr = danger( m->sourceText(), m->translation(), TRUE );
+ if ( !dngr ) {
+ me->finishAndNext();
+ m->contextLVI()->updatetqStatus();
+ } else {
+ if ( m->danger() != dngr )
+ m->setDanger( dngr );
+ tor.insert( m->message() );
+ if ( !dirty ) {
+ dirty = TRUE;
+ updateCaption();
+ }
+ tqApp->beep();
+ }
+ updateStatistics();
+}
+
+void TrWindow::toggleFinished( TQListViewItem *item, const TQPoint& /* p */,
+ int column )
+{
+ if ( item != 0 && column == 0 ) {
+ MessageLVI *m = (MessageLVI *) item;
+ bool dngr = FALSE;
+
+ if ( m->message().type() == MetaTranslatorMessage::Unfinished ) {
+ dngr = danger( m->sourceText(), m->translation(), TRUE );
+ }
+ if ( !dngr && m->message().type() != MetaTranslatorMessage::Obsolete) {
+ setCurrentMessageItem( m );
+ me->setFinished( !m->finished() );
+ m->contextLVI()->updatetqStatus();
+ } else {
+ bool oldDanger = m->danger();
+ m->setDanger( danger(m->sourceText(), m->translation(),
+ !oldDanger) );
+ if ( !oldDanger && m->danger() )
+ tqApp->beep();
+ tor.insert( m->message() );
+ if ( !dirty ) {
+ dirty = TRUE;
+ updateCaption();
+ }
+ }
+ updateStatistics();
+ }
+}
+
+void TrWindow::nextUnfinished()
+{
+ if ( nextUnfinishedAct->isEnabled() ) {
+ // Select a message to translate, grab the first available if
+ // there are no current selection.
+ TQListViewItem * cItem = lv->currentItem(); // context item
+ TQListViewItem * mItem = slv->currentItem(); // message item
+
+ // Make sure an item is selected from both the context and the
+ // message list.
+ if( (mItem == 0) && !(mItem = slv->firstChild()) ) {
+ if( (cItem == 0) && !(cItem = lv->firstChild()) ) {
+ statusBar()->message( tqtr("No phrase to translate."),
+ MessageMS );
+ tqApp->beep();
+ return;
+ } else {
+ showNewScope( cItem );
+ while( cItem && !(mItem = slv->firstChild()) ) {
+ // no tqchildren in this node - try next one
+ cItem = cItem->nextSibling();
+ showNewScope( cItem );
+ }
+ setCurrentContextItem( cItem );
+ if( mItem ) {
+ setCurrentMessageItem( mItem );
+ } else {
+ statusBar()->message( tqtr("No phrase to translate."),
+ MessageMS );
+ tqApp->beep();
+ return;
+ }
+ }
+ } else {
+ setCurrentMessageItem( mItem );
+ }
+
+ MessageLVI * m = (MessageLVI *) mItem;
+ MessageLVI * n;
+ ContextLVI * p = (ContextLVI *) cItem;
+ ContextLVI * q;
+
+ // Find the next Unfinished sibling within the same context.
+ m = (MessageLVI *) mItem->nextSibling();
+ n = m;
+ do {
+ if ( n == 0 )
+ break;
+ if ( n && !n->finished() && n != mItem ) {
+ setCurrentMessageItem( n );
+ return;
+ }
+ n = (MessageLVI *) n->nextSibling();
+ } while ( n != m );
+
+ // If all siblings are Finished or Obsolete, look in the first
+ // Unfinished context.
+ p = (ContextLVI *) p->nextSibling();
+ q = p;
+ do {
+ if ( q == 0 )
+ q = (ContextLVI *) lv->firstChild();
+ if ( q && !q->finished() ) {
+ showNewScope( q );
+ setCurrentContextItem( q );
+ n = (MessageLVI *) slv->firstChild();
+ while ( n && n->finished() )
+ n = (MessageLVI *) n->nextSibling();
+ if ( n && q ) {
+ setCurrentMessageItem( n );
+ showNewCurrent( n );
+ return;
+ }
+ }
+ q = (ContextLVI *) q->nextSibling();
+ } while ( q != p );
+ }
+
+ // If no Unfinished message is left, the user has finished the job. We
+ // congratulate on a job well done with this ringing bell.
+ statusBar()->message( tqtr("No untranslated phrases left."), MessageMS );
+ tqApp->beep();
+}
+
+static TQListViewItem * lastChild( TQListView * view )
+{
+ if ( view ) {
+ TQListViewItem * ret, * tmp;
+ ret = view->firstChild();
+ while ( ret ) {
+ tmp = ret->nextSibling();
+ if ( tmp == 0 )
+ return ret;
+ ret = tmp;
+ }
+ }
+ return 0;
+}
+
+void TrWindow::prevUnfinished()
+{
+ if ( prevUnfinishedAct->isEnabled() ) {
+ // Select a message to translate, grab the first available if
+ // there are no current selection.
+ TQListViewItem * cItem = lv->currentItem(); // context item
+ TQListViewItem * mItem = slv->currentItem(); // message item
+
+ // Make sure an item is selected from both the context and the
+ // message list.
+ if( (mItem == 0) && !(mItem = slv->firstChild()) ) {
+ if( (cItem == 0) && !(cItem = lv->firstChild()) ) {
+ statusBar()->message( tqtr("No phrase to translate."),
+ MessageMS );
+ tqApp->beep();
+ return;
+ } else {
+ showNewScope( cItem );
+ while( cItem && !(mItem = slv->firstChild()) ) {
+ // no tqchildren in this node - try next one
+ cItem = cItem->nextSibling();
+ showNewScope( cItem );
+ }
+ setCurrentContextItem( cItem );
+ if( mItem ) {
+ setCurrentMessageItem( cItem );
+ } else {
+ statusBar()->message( tqtr("No phrase to translate."),
+ MessageMS );
+ tqApp->beep();
+ return;
+ }
+ }
+ } else {
+ setCurrentMessageItem( mItem );
+ }
+
+ MessageLVI * m = (MessageLVI *) mItem;
+ MessageLVI * n;
+ ContextLVI * p = (ContextLVI *) cItem;
+ ContextLVI * q;
+
+ // Find the next Unfinished sibling within the same context.
+ n = m;
+ do {
+ n = (MessageLVI * ) n->itemAbove();
+ if ( n == 0 )
+ break;
+ if ( n && !n->finished() ) {
+ setCurrentMessageItem( n );
+ return;
+ }
+ } while ( !((ContextLVI *) cItem)->finished() && n != 0 );
+
+ // If all siblings are Finished or Obsolete, look in the prev
+ // Unfinished context.
+ q = p;
+ do {
+ q = (ContextLVI *) q->itemAbove();
+ if ( q == 0 )
+ q = (ContextLVI *) lastChild( lv );
+ if ( q && !q->finished() ) {
+ showNewScope( q );
+ setCurrentContextItem( q );
+ n = (MessageLVI *) lastChild( slv );
+ while ( n && n->finished() )
+ n = (MessageLVI *) n->itemAbove();
+ if ( n && q ) {
+ setCurrentMessageItem( n );
+ return;
+ }
+ }
+ } while ( q != 0 );
+ }
+ statusBar()->message( tqtr("No untranslated phrases left."), MessageMS );
+ tqApp->beep();
+}
+
+void TrWindow::prev()
+{
+ TQListViewItem * cItem = lv->currentItem(); // context item
+ TQListViewItem * mItem = slv->currentItem(); // message item
+ TQListViewItem * tmp;
+
+ if ( !cItem ) {
+ cItem = lv->firstChild();
+ if ( !cItem ) return;
+ setCurrentContextItem( cItem );
+ }
+
+ if ( !mItem ) {
+ mItem = lastChild( slv );
+ if ( !mItem ) return;
+ setCurrentMessageItem( mItem );
+ } else {
+ if ( (tmp = mItem->itemAbove()) != 0 ) {
+ setCurrentMessageItem( tmp );
+ return;
+ } else {
+ if ( (tmp = cItem->itemAbove()) == 0 ) {
+ tmp = lastChild( lv );
+ }
+ if ( !tmp ) return;
+ setCurrentContextItem( tmp );
+ setCurrentMessageItem( lastChild( slv ) );
+ }
+ }
+}
+
+void TrWindow::next()
+{
+ TQListViewItem * cItem = lv->currentItem(); // context item
+ TQListViewItem * mItem = slv->currentItem(); // message item
+ TQListViewItem * tmp;
+
+ if ( !cItem ) {
+ cItem = lv->firstChild();
+ if ( !cItem ) return;
+ setCurrentContextItem( cItem );
+ }
+
+ if ( !mItem ) {
+ mItem = slv->firstChild();
+ if ( !mItem ) return;
+ setCurrentMessageItem( mItem );
+ } else {
+ if ( (tmp = mItem->nextSibling()) != 0 ) {
+ setCurrentMessageItem( tmp );
+ return;
+ } else {
+ if ( (tmp = cItem->nextSibling()) == 0 ) {
+ tmp = lv->firstChild();
+ }
+ if ( !tmp ) return;
+ setCurrentContextItem( tmp );
+ setCurrentMessageItem( slv->firstChild() );
+ }
+ }
+}
+
+
+void TrWindow::tqfindNext( const TQString& text, int where, bool matchCase )
+{
+ tqfindText = text;
+ if ( tqfindText.isEmpty() )
+ tqfindText = TQString( "magicwordthatyoushouldavoid" );
+ tqfindWhere = where;
+ tqfindMatchCase = matchCase;
+ tqfindAgainAct->setEnabled( TRUE );
+ tqfindAgain();
+}
+
+void TrWindow::revalidate()
+{
+ ContextLVI *c = (ContextLVI *) lv->firstChild();
+ TQListViewItem * oldScope = lv->currentItem();
+ int oldItemNo = itemToIndex( slv, slv->currentItem() );
+ slv->setUpdatesEnabled( FALSE );
+
+ while ( c != 0 ) {
+ showNewScope( c );
+ MessageLVI *m = (MessageLVI *) slv->firstChild();
+ while ( m != 0 ) {
+ m->setDanger( danger(m->sourceText(), m->translation()) &&
+ m->message().type() == MetaTranslatorMessage::Finished );
+ m = (MessageLVI *) m->nextSibling();
+ }
+ c = (ContextLVI *) c->nextSibling();
+ }
+
+ if ( oldScope ){
+ showNewScope( oldScope );
+ TQListViewItem * tmp = indexToItem( slv, oldItemNo );
+ if( tmp )
+ setCurrentMessageItem( tmp );
+ }
+ slv->setUpdatesEnabled( TRUE );
+ slv->triggerUpdate();
+}
+
+TQString TrWindow::friendlyString( const TQString& str )
+{
+ TQString f = str.lower();
+ f.tqreplace( TQRegExp(TQString("[.,:;!?()-]")), TQString(" ") );
+ f.tqreplace( "&", TQString("") );
+ f = f.simplifyWhiteSpace();
+ f = f.lower();
+ return f;
+}
+
+void TrWindow::setupMenuBar()
+{
+ TQMenuBar * m = menuBar();
+ TQPopupMenu * filep = new TQPopupMenu( this );
+ TQPopupMenu * editp = new TQPopupMenu( this );
+ TQPopupMenu * translationp = new TQPopupMenu( this );
+ TQPopupMenu * validationp = new TQPopupMenu( this );
+ validationp->setCheckable( TRUE );
+ phrasep = new TQPopupMenu( this );
+ closePhraseBookp = new TQPopupMenu( this );
+ editPhraseBookp = new TQPopupMenu( this );
+ printPhraseBookp = new TQPopupMenu( this );
+ TQPopupMenu * viewp = new TQPopupMenu( this );
+ viewp->setCheckable( TRUE );
+ TQPopupMenu * helpp = new TQPopupMenu( this );
+
+ m->insertItem( tqtr("&File"), filep );
+ m->insertItem( tqtr("&Edit"), editp );
+ m->insertItem( tqtr("&Translation"), translationp );
+ m->insertItem( tqtr("V&alidation"), validationp );
+ m->insertItem( tqtr("&Phrases"), phrasep );
+ m->insertItem( tqtr("&View"), viewp );
+ m->insertSeparator();
+ m->insertItem( tqtr("&Help"), helpp );
+
+ connect( closePhraseBookp, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(closePhraseBook(int)) );
+ connect( closePhraseBookp, TQT_SIGNAL(aboutToShow()),
+ this, TQT_SLOT(updateClosePhraseBook()) );
+ connect( editPhraseBookp, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(editPhraseBook(int)) );
+ connect( printPhraseBookp, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(printPhraseBook(int)) );
+ // File menu
+ openAct = new Action( filep, tqtr("&Open..."), TQT_TQOBJECT(this), TQT_SLOT(open()),
+ "fileopen.png", TQAccel::stringToKey(tqtr("Ctrl+O")) );
+
+ filep->insertSeparator();
+
+ saveAct = new Action( filep, tqtr("&Save"), TQT_TQOBJECT(this), TQT_SLOT(save()),
+ "filesave.png", TQAccel::stringToKey(tqtr("Ctrl+S")) );
+ saveAsAct = new Action( filep, tqtr("Save &As..."), TQT_TQOBJECT(this), TQT_SLOT(saveAs()) );
+ releaseAct = new Action( filep, tqtr("&Release..."), TQT_TQOBJECT(this), TQT_SLOT(release()) );
+ filep->insertSeparator();
+ printAct = new Action( filep, tqtr("&Print..."), TQT_TQOBJECT(this), TQT_SLOT(print()),
+ "print.png", TQAccel::stringToKey(tqtr("Ctrl+P")) );
+
+ filep->insertSeparator();
+
+ recentFilesMenu = new TQPopupMenu( this );
+ filep->insertItem( tqtr("Re&cently opened files"), recentFilesMenu );
+ connect( recentFilesMenu, TQT_SIGNAL(aboutToShow()), this,
+ TQT_SLOT(setupRecentFilesMenu()) );
+ connect( recentFilesMenu, TQT_SIGNAL(activated( int )), this,
+ TQT_SLOT(recentFileActivated( int )) );
+
+ filep->insertSeparator();
+
+ exitAct = new Action( filep, tqtr("E&xit"), TQT_TQOBJECT(this), TQT_SLOT(close()),
+ TQString(), TQAccel::stringToKey(tqtr("Ctrl+Q")) );
+ // Edit menu
+ undoAct = new Action( editp, tqtr("&Undo"), TQT_TQOBJECT(me), TQT_SLOT(undo()),
+ "undo.png", TQAccel::stringToKey(tqtr("Ctrl+Z")) );
+ undoAct->setEnabled( FALSE );
+ connect( me, TQT_SIGNAL(undoAvailable(bool)), undoAct, TQT_SLOT(setEnabled(bool)) );
+ redoAct = new Action( editp, tqtr("&Redo"), TQT_TQOBJECT(me), TQT_SLOT(redo()),
+ "redo.png", TQAccel::stringToKey(tqtr("Ctrl+Y")) );
+ redoAct->setEnabled( FALSE );
+ connect( me, TQT_SIGNAL(redoAvailable(bool)), redoAct, TQT_SLOT(setEnabled(bool)) );
+ editp->insertSeparator();
+ cutAct = new Action( editp, tqtr("Cu&t"), TQT_TQOBJECT(me), TQT_SLOT(cut()),
+ "editcut.png", TQAccel::stringToKey(tqtr("Ctrl+X")) );
+ cutAct->setEnabled( FALSE );
+ connect( me, TQT_SIGNAL(cutAvailable(bool)), cutAct, TQT_SLOT(setEnabled(bool)) );
+ copyAct = new Action( editp, tqtr("&Copy"), TQT_TQOBJECT(me), TQT_SLOT(copy()),
+ "editcopy.png", TQAccel::stringToKey(tqtr("Ctrl+C")) );
+ copyAct->setEnabled( FALSE );
+ connect( me, TQT_SIGNAL(copyAvailable(bool)), copyAct, TQT_SLOT(setEnabled(bool)) );
+ pasteAct = new Action( editp, tqtr("&Paste"), TQT_TQOBJECT(me), TQT_SLOT(paste()),
+ "editpaste.png", TQAccel::stringToKey(tqtr("Ctrl+V")) );
+ pasteAct->setEnabled( FALSE );
+ connect( me, TQT_SIGNAL(pasteAvailable(bool)),
+ pasteAct, TQT_SLOT(setEnabled(bool)) );
+ selectAllAct = new Action( editp, tqtr("Select &All"), TQT_TQOBJECT(me), TQT_SLOT(selectAll()),
+ TQString(), TQAccel::stringToKey(tqtr("Ctrl+A")) );
+ selectAllAct->setEnabled( FALSE );
+ editp->insertSeparator();
+ tqfindAct = new Action( editp, tqtr("&Find..."), TQT_TQOBJECT(this), TQT_SLOT(tqfind()),
+ "searchfind.png", TQAccel::stringToKey(tqtr("Ctrl+F")) );
+ tqfindAct->setEnabled( FALSE );
+ tqfindAgainAct = new Action( editp, tqtr("Find &Next"),
+ TQT_TQOBJECT(this), TQT_SLOT(tqfindAgain()), TQString(), Qt::Key_F3 );
+ tqfindAgainAct->setEnabled( FALSE );
+#ifdef notyet
+ tqreplaceAct = new Action( editp, tqtr("&Replace..."), TQT_TQOBJECT(this), TQT_SLOT(tqreplace()),
+ TQAccel::stringToKey(tqtr("Ctrl+H")) );
+ tqreplaceAct->setEnabled( FALSE );
+#endif
+
+ // Translation menu
+ // when updating the accelerators, remember the status bar
+ prevUnfinishedAct = new Action( translationp, tqtr("&Prev Unfinished"),
+ TQT_TQOBJECT(this), TQT_SLOT(prevUnfinished()),
+ "prevunfinished.png", TQAccel::stringToKey(tqtr("Ctrl+K")) );
+ nextUnfinishedAct = new Action( translationp, tqtr("&Next Unfinished"),
+ TQT_TQOBJECT(this), TQT_SLOT(nextUnfinished()),
+ "nextunfinished.png", TQAccel::stringToKey(tqtr("Ctrl+L")) );
+
+ prevAct = new Action( translationp, tqtr("P&rev"),
+ TQT_TQOBJECT(this), TQT_SLOT(prev()), "prev.png",
+ TQAccel::stringToKey(tqtr("Ctrl+Shift+K")) );
+ nextAct = new Action( translationp, tqtr("Ne&xt"),
+ TQT_TQOBJECT(this), TQT_SLOT(next()), "next.png",
+ TQAccel::stringToKey(tqtr("Ctrl+Shift+L")) );
+ doneAndNextAct = new Action( translationp, tqtr("Done and &Next"),
+ TQT_TQOBJECT(this), TQT_SLOT(doneAndNext()), "doneandnext.png",
+ TQAccel::stringToKey(tqtr("Ctrl+Enter")) );
+ doneAndNextAlt = new TQAction( this );
+ doneAndNextAlt->setAccel( TQAccel::stringToKey(tqtr("Ctrl+Return")) );
+ connect( doneAndNextAlt, TQT_SIGNAL(activated()), this, TQT_SLOT(doneAndNext()) );
+ beginFromSourceAct = new Action( translationp, tqtr("&Begin from Source"),
+ TQT_TQOBJECT(me), TQT_SLOT(beginFromSource()),
+ TQString(), TQAccel::stringToKey(tqtr("Ctrl+B")) );
+ connect( me, TQT_SIGNAL(updateActions(bool)), beginFromSourceAct,
+ TQT_SLOT(setEnabled(bool)) );
+
+ // Phrasebook menu
+ newPhraseBookAct = new Action( phrasep, tqtr("&New Phrase Book..."),
+ TQT_TQOBJECT(this), TQT_SLOT(newPhraseBook()),
+ TQString(), TQAccel::stringToKey(tqtr("Ctrl+N")) );
+ openPhraseBookAct = new Action( phrasep, tqtr("&Open Phrase Book..."),
+ TQT_TQOBJECT(this), TQT_SLOT(openPhraseBook()),
+ "book.png", TQAccel::stringToKey(tqtr("Ctrl+H")) );
+ closePhraseBookId = phrasep->insertItem( tqtr("&Close Phrase Book"),
+ closePhraseBookp );
+ phrasep->insertSeparator();
+ editPhraseBookId = phrasep->insertItem( tqtr("&Edit Phrase Book..."),
+ editPhraseBookp );
+ printPhraseBookId = phrasep->insertItem( tqtr("&Print Phrase Book..."),
+ printPhraseBookp );
+ connect( phrasep, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(setupPhrase()) );
+
+ // Validation menu
+ acceleratorsAct = new Action( validationp, tqtr("&Accelerators"),
+ TQT_TQOBJECT(this), TQT_SLOT(revalidate()), "accelerator.png", 0, TRUE );
+ acceleratorsAct->setOn( TRUE );
+ endingPunctuationAct = new Action( validationp, tqtr("&Ending Punctuation"),
+ TQT_TQOBJECT(this), TQT_SLOT(revalidate()), "punctuation.png", 0, TRUE );
+ endingPunctuationAct->setOn( TRUE );
+ phraseMatchesAct = new Action( validationp, tqtr("&Phrase Matches"),
+ TQT_TQOBJECT(this), TQT_SLOT(revalidate()), "phrase.png", 0, TRUE );
+ phraseMatchesAct->setOn( TRUE );
+
+ // View menu
+ revertSortingAct = new Action( viewp, tqtr("&Revert Sorting"),
+ TQT_TQOBJECT(this), TQT_SLOT(revertSorting()) );
+ doGuessesAct = new Action( viewp, tqtr("&Display guesses"),
+ TQT_TQOBJECT(this), TQT_SLOT(toggleGuessing()) );
+ doGuessesAct->setToggleAction( TRUE );
+ doGuessesAct->setOn( TRUE );
+ toggleStats = new Action( viewp, tqtr("&Statistics"), TQT_TQOBJECT(this), TQT_SLOT(toggleStatistics()) );
+ toggleStats->setToggleAction( TRUE );
+ viewp->insertSeparator();
+ viewp->insertItem( tqtr("Vie&ws"), createDockWindowMenu( NoToolBars ) );
+ viewp->insertItem( tqtr("&Toolbars"), createDockWindowMenu( OnlyToolBars ) );
+
+ // Help
+ manualAct = new Action( helpp, tqtr("&Manual"), TQT_TQOBJECT(this), TQT_SLOT(manual()), 0,
+ Qt::Key_F1 );
+ helpp->insertSeparator();
+ aboutAct = new Action( helpp, tqtr("&About"), TQT_TQOBJECT(this), TQT_SLOT(about()) );
+ aboutTQtAct = new Action( helpp, tqtr("About &TQt"), TQT_TQOBJECT(this), TQT_SLOT(aboutTQt()) );
+ helpp->insertSeparator();
+ whatsThisAct = new Action( helpp, tqtr("&What's This?"),
+ TQT_TQOBJECT(this), TQT_SLOT(whatsThis()), "whatsthis.xpm", Qt::SHIFT + Qt::Key_F1 );
+
+ openAct->setWhatsThis( tqtr("Open a TQt translation source file (TS file) for"
+ " editing.") );
+ saveAct->setWhatsThis( tqtr("Save changes made to this TQt translation "
+ "source file.") );
+ saveAsAct->setWhatsThis( tqtr("Save changes made to this TQt translation"
+ "source file into a new file.") );
+ releaseAct->setWhatsThis( tqtr("Create a TQt message file suitable for"
+ " released applications"
+ " from the current message file.") );
+ printAct->setWhatsThis( tqtr("Print a list of all the phrases in the current"
+ " TQt translation source file.") );
+ exitAct->setWhatsThis( tqtr("Close this window and exit.") );
+
+ undoAct->setWhatsThis( tqtr("Undo the last editing operation performed on the"
+ " translation.") );
+ redoAct->setWhatsThis( tqtr("Redo an undone editing operation performed on"
+ " the translation.") );
+ cutAct->setWhatsThis( tqtr("Copy the selected translation text to the"
+ " clipboard and deletes it.") );
+ copyAct->setWhatsThis( tqtr("Copy the selected translation text to the"
+ " clipboard.") );
+ pasteAct->setWhatsThis( tqtr("Paste the clipboard text into the"
+ " translation.") );
+ selectAllAct->setWhatsThis( tqtr("Select the whole translation text.") );
+ tqfindAct->setWhatsThis( tqtr("Search for some text in the translation "
+ "source file.") );
+ tqfindAgainAct->setWhatsThis( tqtr("Continue the search where it was left.") );
+#ifdef notyet
+ tqreplaceAct->setWhatsThis( tqtr("Search for some text in the translation"
+ " source file and tqreplace it by another"
+ " text.") );
+#endif
+
+ newPhraseBookAct->setWhatsThis( tqtr("Create a new phrase book.") );
+ openPhraseBookAct->setWhatsThis( tqtr("Open a phrase book to assist"
+ " translation.") );
+ acceleratorsAct->setWhatsThis( tqtr("Toggle validity checks of"
+ " accelerators.") );
+ endingPunctuationAct->setWhatsThis( tqtr("Toggle validity checks"
+ " of ending punctuation.") );
+ phraseMatchesAct->setWhatsThis( tqtr("Toggle checking that phrase"
+ " suggestions are used.") );
+
+ revertSortingAct->setWhatsThis( tqtr("Sort the items back in the same order"
+ " as in the message file.") );
+
+ doGuessesAct->setWhatsThis( tqtr("Set whether or not to display translation guesses.") );
+ manualAct->setWhatsThis( tqtr("Display the manual for %1.")
+ .arg(tqtr("TQt Linguist")) );
+ aboutAct->setWhatsThis( tqtr("Display information about %1.")
+ .arg(tqtr("TQt Linguist")) );
+ aboutTQtAct->setWhatsThis( tqtr("Display information about the TQt toolkit by"
+ " Trolltech.") );
+ whatsThisAct->setWhatsThis( tqtr("Enter What's This? mode.") );
+
+ beginFromSourceAct->setWhatsThis( tqtr("Copies the source text into"
+ " the translation field.") );
+ nextAct->setWhatsThis( tqtr("Moves to the next item.") );
+ prevAct->setWhatsThis( tqtr("Moves to the previous item.") );
+ nextUnfinishedAct->setWhatsThis( tqtr("Moves to the next unfinished item.") );
+ prevUnfinishedAct->setWhatsThis( tqtr("Moves to the previous unfinished item.") );
+ doneAndNextAct->setWhatsThis( tqtr("Marks this item as done and moves to the"
+ " next unfinished item.") );
+ doneAndNextAlt->setWhatsThis( doneAndNextAct->whatsThis() );
+}
+
+void TrWindow::setupToolBars()
+{
+ TQToolBar *filet = new TQToolBar( tqtr("File"), this );
+ TQToolBar *editt = new TQToolBar( tqtr("Edit"), this );
+ TQToolBar *translationst = new TQToolBar( tqtr("Translation"), this );
+ TQToolBar *validationt = new TQToolBar( tqtr("Validation"), this );
+ TQToolBar *helpt = new TQToolBar( tqtr("Help"), this );
+
+ openAct->addToToolbar( filet, tqtr("Open") );
+ saveAct->addToToolbar( filet, tqtr("Save") );
+ printAct->addToToolbar( filet, tqtr("Print") );
+ filet->addSeparator();
+ openPhraseBookAct->addToToolbar( filet, tqtr("Open Phrase Book") );
+
+ undoAct->addToToolbar( editt, tqtr("Undo") );
+ redoAct->addToToolbar( editt, tqtr("Redo") );
+ editt->addSeparator();
+ cutAct->addToToolbar( editt, tqtr("Cut") );
+ copyAct->addToToolbar( editt, tqtr("Copy") );
+ pasteAct->addToToolbar( editt, tqtr("Paste") );
+ editt->addSeparator();
+ tqfindAct->addToToolbar( editt, tqtr("Find") );
+#ifdef notyet
+ tqreplaceAct->addToToolbar( editt, tqtr("Replace") );
+#endif
+
+ // beginFromSourceAct->addToToolbar( translationst,
+ // tqtr("Begin from Source"), "searchtqfind" );
+ prevAct->addToToolbar( translationst, tqtr("Prev") );
+ nextAct->addToToolbar( translationst, tqtr("Next") );
+ prevUnfinishedAct->addToToolbar( translationst, tqtr("Prev Unfinished") );
+ nextUnfinishedAct->addToToolbar( translationst, tqtr("Next Unfinished") );
+ doneAndNextAct->addToToolbar( translationst, tqtr("Done and Next") );
+
+ acceleratorsAct->addToToolbar( validationt, tqtr("Accelerators") );
+ endingPunctuationAct->addToToolbar( validationt, tqtr("Punctuation") );
+ phraseMatchesAct->addToToolbar( validationt, tqtr("Phrases") );
+
+ whatsThisAct->addToToolbar( helpt, tqtr("What's This?") );
+}
+
+void TrWindow::setCurrentContextItem( TQListViewItem *item )
+{
+ lv->ensureItemVisible( item );
+ lv->setSelected( item, TRUE );
+}
+
+void TrWindow::setCurrentMessageItem( TQListViewItem *item )
+{
+ slv->ensureItemVisible( item );
+ slv->setSelected( item, TRUE );
+}
+
+TQString TrWindow::friendlyPhraseBookName( int k )
+{
+ return TQFileInfo( phraseBookNames[k] ).fileName();
+}
+
+bool TrWindow::openPhraseBook( const TQString& name )
+{
+ PhraseBook *pb = new PhraseBook;
+ if ( !pb->load(name) ) {
+ TQMessageBox::warning( this, tqtr("TQt Linguist"),
+ tqtr("Cannot read from phrase book '%1'.")
+ .arg(name) );
+ return FALSE;
+ }
+
+ int index = (int) phraseBooks.count();
+ phraseBooks.append( pb );
+ phraseBookNames.append( name );
+ int id = closePhraseBookp->insertItem( friendlyPhraseBookName(index) );
+ closePhraseBookp->TQMenuData::setWhatsThis( id, tqtr("Close this phrase book.") );
+ id = editPhraseBookp->insertItem( friendlyPhraseBookName(index) );
+ editPhraseBookp->TQMenuData::setWhatsThis( id, tqtr("Allow you to add, modify, or delete"
+ " phrases of this phrase book.") );
+ id = printPhraseBookp->insertItem( friendlyPhraseBookName(index) );
+ printPhraseBookp->TQMenuData::setWhatsThis( id, tqtr("Print the entries of the phrase"
+ " book.") );
+ updatePhraseDict();
+ return TRUE;
+}
+
+bool TrWindow::savePhraseBook( TQString& name, const PhraseBook& pb )
+{
+ if ( !name.tqcontains( ".qph" ) && !name.tqcontains(".") )
+ name += ".qph";
+
+ if ( !pb.save(name) ) {
+ TQMessageBox::warning( this, tqtr("TQt Linguist"),
+ tqtr("Cannot create phrase book '%1'.")
+ .arg(name) );
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void TrWindow::updateProgress()
+{
+ if ( numNonobsolete == 0 )
+ progress->setText( TQString(" " " ") );
+ else
+ progress->setText( TQString(" %1/%2 ").arg(numFinished)
+ .arg(numNonobsolete) );
+ prevUnfinishedAct->setEnabled( numFinished != numNonobsolete );
+ nextUnfinishedAct->setEnabled( numFinished != numNonobsolete );
+ prevAct->setEnabled( lv->firstChild() != 0 );
+ nextAct->setEnabled( lv->firstChild() != 0 );
+}
+
+void TrWindow::updatePhraseDict()
+{
+ TQPtrListIterator<PhraseBook> pb = phraseBooks;
+ PhraseBook::Iterator p;
+ PhraseBook *ent;
+ phraseDict.clear();
+ while ( pb.current() != 0 ) {
+ for ( p = (*pb)->begin(); p != (*pb)->end(); ++p ) {
+ TQString f = friendlyString( (*p).source() );
+ if ( f.length() > 0 ) {
+ f = TQStringList::split( TQChar(' '), f ).first();
+ ent = phraseDict.tqfind( f );
+ if ( ent == 0 ) {
+ ent = new PhraseBook;
+ phraseDict.insert( f, ent );
+ }
+ ent->append( *p );
+ }
+ }
+ ++pb;
+ }
+ revalidate();
+}
+
+PhraseBook TrWindow::getPhrases( const TQString& source )
+{
+ PhraseBook phrases;
+ TQString f = friendlyString( source );
+ TQStringList lookupWords = TQStringList::split( TQChar(' '), f );
+ TQStringList::Iterator w;
+ PhraseBook::Iterator p;
+
+ for ( w = lookupWords.begin(); w != lookupWords.end(); ++w ) {
+ PhraseBook *ent = phraseDict.tqfind( *w );
+ if ( ent != 0 ) {
+ for ( p = ent->begin(); p != ent->end(); ++p ) {
+ if ( f.tqfind(friendlyString((*p).source())) >= 0 )
+ phrases.append( *p );
+ }
+ }
+ }
+ return phrases;
+}
+
+bool TrWindow::danger( const TQString& source, const TQString& translation,
+ bool verbose )
+{
+ if ( acceleratorsAct->isOn() ) {
+ int sk = TQAccel::shortcutKey( source );
+ int tk = TQAccel::shortcutKey( translation );
+ if ( sk == 0 && tk != 0 ) {
+ if ( verbose )
+ statusBar()->message( tqtr("Accelerator possibly superfluous in"
+ " translation."), ErrorMS );
+ return TRUE;
+ } else if ( sk != 0 && tk == 0 ) {
+ if ( verbose )
+ statusBar()->message( tqtr("Accelerator possibly missing in"
+ " translation."), ErrorMS );
+ return TRUE;
+ }
+ }
+ if ( endingPunctuationAct->isOn() ) {
+ if ( ending(source) != ending(translation) ) {
+ if ( verbose )
+ statusBar()->message( tqtr("Translation does not end with the"
+ " same punctuation as the source"
+ " text."), ErrorMS );
+ return TRUE;
+ }
+ }
+ if ( phraseMatchesAct->isOn() ) {
+ TQString fsource = friendlyString( source );
+ TQString ftranslation = friendlyString( translation );
+ TQStringList lookupWords = TQStringList::split( TQChar(' '), fsource );
+ TQStringList::Iterator w;
+ PhraseBook::Iterator p;
+
+ for ( w = lookupWords.begin(); w != lookupWords.end(); ++w ) {
+ PhraseBook *ent = phraseDict.tqfind( *w );
+ if ( ent != 0 ) {
+ for ( p = ent->begin(); p != ent->end(); ++p ) {
+ if ( fsource.tqfind(friendlyString((*p).source())) < 0 ||
+ ftranslation.tqfind(friendlyString((*p).target())) >= 0 )
+ break;
+ }
+ if ( p == ent->end() ) {
+ if ( verbose )
+ statusBar()->message( tqtr("A phrase book suggestion for"
+ " '%1' was ignored.")
+ .arg(*w), ErrorMS );
+ return TRUE;
+ }
+ }
+ }
+ }
+ if ( verbose )
+ statusBar()->clear();
+
+ return FALSE;
+}
+
+void TrWindow::readConfig()
+{
+ TQString keybase( "/TQt Linguist/" +
+ TQString::number( (TQT_VERSION >> 16) & 0xff ) +
+ "." + TQString::number( (TQT_VERSION >> 8) & 0xff ) + "/" );
+ TQSettings config;
+
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+
+ TQRect r( pos(), size() );
+ recentFiles = config.readListEntry( keybase + "RecentlyOpenedFiles" );
+ if ( !config.readBoolEntry( keybase + "Geometry/MainwindowMaximized", FALSE ) ) {
+ r.setX( config.readNumEntry( keybase + "Geometry/MainwindowX", r.x() ) );
+ r.setY( config.readNumEntry( keybase + "Geometry/MainwindowY", r.y() ) );
+ r.setWidth( config.readNumEntry( keybase + "Geometry/MainwindowWidth", r.width() ) );
+ r.setHeight( config.readNumEntry( keybase + "Geometry/MainwindowHeight", r.height() ) );
+
+ TQRect desk = TQApplication::desktop()->tqgeometry();
+ TQRect inter = desk.intersect( r );
+ resize( r.size() );
+ if ( inter.width() * inter.height() > ( r.width() * r.height() / 20 ) ) {
+ move( r.topLeft() );
+ }
+ }
+
+ TQDockWindow * dw;
+ dw = (TQDockWindow *) lv->tqparent();
+ int place;
+ place = config.readNumEntry( keybase + "Geometry/ContextwindowInTQt::Dock" );
+ r.setX( config.readNumEntry( keybase + "Geometry/ContextwindowX" ) );
+ r.setY( config.readNumEntry( keybase + "Geometry/ContextwindowY" ) );
+ r.setWidth( config.readNumEntry( keybase +
+ "Geometry/ContextwindowWidth" ) );
+ r.setHeight( config.readNumEntry( keybase +
+ "Geometry/ContextwindowHeight" ) );
+ if ( place == TQDockWindow::OutsideDock ) {
+ dw->undock();
+ dw->show();
+ }
+ dw->setGeometry( r );
+
+ dw = (TQDockWindow *) slv->tqparent();
+ place = config.readNumEntry( keybase + "Geometry/SourcewindowInTQt::Dock" );
+ r.setX( config.readNumEntry( keybase + "Geometry/SourcewindowX" ) );
+ r.setY( config.readNumEntry( keybase + "Geometry/SourcewindowY" ) );
+ r.setWidth( config.readNumEntry( keybase +
+ "Geometry/SourcewindowWidth" ) );
+ r.setHeight( config.readNumEntry( keybase +
+ "Geometry/SourcewindowHeight" ) );
+ if ( place == TQDockWindow::OutsideDock ) {
+ dw->undock();
+ dw->show();
+ }
+ dw->setGeometry( r );
+
+ dw = (TQDockWindow *) plv->tqparent()->tqparent();
+ place = config.readNumEntry( keybase + "Geometry/PhrasewindowInTQt::Dock" );
+ r.setX( config.readNumEntry( keybase + "Geometry/PhrasewindowX" ) );
+ r.setY( config.readNumEntry( keybase + "Geometry/PhrasewindowY" ) );
+ r.setWidth( config.readNumEntry( keybase +
+ "Geometry/PhrasewindowWidth" ) );
+ r.setHeight( config.readNumEntry( keybase +
+ "Geometry/PhrasewindowHeight" ) );
+ if ( place == TQDockWindow::OutsideDock ) {
+ dw->undock();
+ dw->show();
+ }
+ dw->setGeometry( r );
+ TQApplication::sendPostedEvents();
+}
+
+void TrWindow::writeConfig()
+{
+ TQString keybase( "/TQt Linguist/" +
+ TQString::number( (TQT_VERSION >> 16) & 0xff ) +
+ "." + TQString::number( (TQT_VERSION >> 8) & 0xff ) + "/" );
+ TQSettings config;
+
+ config.insertSearchPath( TQSettings::Windows, "/Trolltech" );
+ config.writeEntry( keybase + "RecentlyOpenedFiles", recentFiles );
+ config.writeEntry( keybase + "Geometry/MainwindowMaximized", isMaximized() );
+ config.writeEntry( keybase + "Geometry/MainwindowX", x() );
+ config.writeEntry( keybase + "Geometry/MainwindowY", y() );
+ config.writeEntry( keybase + "Geometry/MainwindowWidth", width() );
+ config.writeEntry( keybase + "Geometry/MainwindowHeight", height() );
+
+ TQDockWindow * dw =(TQDockWindow *) lv->tqparent();
+ config.writeEntry( keybase + "Geometry/ContextwindowInTQt::Dock", dw->place() );
+ config.writeEntry( keybase + "Geometry/ContextwindowX", dw->x() );
+ config.writeEntry( keybase + "Geometry/ContextwindowY", dw->y() );
+ config.writeEntry( keybase + "Geometry/ContextwindowWidth", dw->width() );
+ config.writeEntry( keybase + "Geometry/ContextwindowHeight", dw->height() );
+
+ dw =(TQDockWindow *) slv->tqparent();
+ config.writeEntry( keybase + "Geometry/SourcewindowInTQt::Dock",
+ dw->place() );
+ config.writeEntry( keybase + "Geometry/SourcewindowX", dw->tqgeometry().x() );
+ config.writeEntry( keybase + "Geometry/SourcewindowY", dw->tqgeometry().y() );
+ config.writeEntry( keybase + "Geometry/SourcewindowWidth", dw->width() );
+ config.writeEntry( keybase + "Geometry/SourcewindowHeight", dw->height() );
+
+ dw =(TQDockWindow *) plv->tqparent()->tqparent();
+ config.writeEntry( keybase + "Geometry/PhrasewindowInTQt::Dock",
+ dw->place() );
+ config.writeEntry( keybase + "Geometry/PhrasewindowX", dw->tqgeometry().x() );
+ config.writeEntry( keybase + "Geometry/PhrasewindowY", dw->tqgeometry().y() );
+ config.writeEntry( keybase + "Geometry/PhrasewindowWidth", dw->width() );
+ config.writeEntry( keybase + "Geometry/PhrasewindowHeight", dw->height() );
+}
+
+void TrWindow::setupRecentFilesMenu()
+{
+ recentFilesMenu->clear();
+ int id = 0;
+ TQStringList::Iterator it = recentFiles.begin();
+ for ( ; it != recentFiles.end(); ++it )
+ {
+ recentFilesMenu->insertItem( *it, id );
+ id++;
+ }
+}
+
+void TrWindow::recentFileActivated( int id )
+{
+ if ( id != -1 ) {
+ if ( maybeSave() )
+ openFile( *recentFiles.at( id ) );
+ }
+}
+
+void TrWindow::addRecentlyOpenedFile( const TQString &fn, TQStringList &lst )
+{
+ if ( lst.tqfind( fn ) != lst.end() )
+ return;
+ if ( lst.count() >= 10 )
+ lst.remove( lst.begin() );
+ lst << fn;
+}
+
+void TrWindow::toggleGuessing()
+{
+ me->toggleGuessing();
+}
+
+void TrWindow::focusSourceList()
+{
+ slv->setFocus();
+}
+
+void TrWindow::focusPhraseList()
+{
+ plv->setFocus();
+}
+
+void TrWindow::updateClosePhraseBook()
+{
+ if ( dirtyItem != -1 ) {
+ closePhraseBookp->removeItem( closePhraseBookp->idAt(dirtyItem) );
+ dirtyItem = -1;
+ }
+}
+
+void TrWindow::toggleStatistics()
+{
+ if ( toggleStats->isOn() ) {
+ if ( !stats ) {
+ stats = new Statistics( this, "linguist_stats" );
+ connect( this, TQT_SIGNAL(statsChanged(int,int,int,int,int,int)), stats,
+ TQT_SLOT(updateStats(int,int,int,int,int,int)) );
+ connect( stats, TQT_SIGNAL(closed()), toggleStats, TQT_SLOT(toggle()) );
+ }
+ updateStatistics();
+ stats->show();
+ } else if ( stats ) {
+ stats->close();
+ }
+}
+
+void TrWindow::updateStatistics()
+{
+ TQListViewItem * ci = lv->firstChild();
+ int trW = 0;
+ int trC = 0;
+ int trCS = 0;
+ while ( ci ) {
+ countStats( ci, ((ContextLVI *)ci)->firstMessageItem(), trW, trC, trCS );
+ ci = ci->nextSibling();
+ }
+ // ..and the items in the source list
+ countStats( 0, slv->firstChild(), trW, trC, trCS );
+ emit statsChanged( srcWords, srcChars, srcCharsSpc, trW, trC, trCS );
+}
+
+
+void TrWindow::countStats( TQListViewItem* ci, TQListViewItem* mi, int& trW, int& trC, int& trCS )
+{
+ MessageLVI * m;
+ while ( mi ) {
+ m = (MessageLVI *) mi;
+ if ( m->finished() && !(m->message().type() == MetaTranslatorMessage::Obsolete) )
+ doCharCounting( m->translation(), trW, trC, trCS );
+ if ( ci )
+ mi = ((ContextLVI *)ci)->nextMessageItem();
+ else
+ mi = mi->nextSibling();
+ }
+}
+
+void TrWindow::doCharCounting( const TQString& text, int& trW, int& trC, int& trCS )
+{
+ trCS += text.length();
+ bool inWord = FALSE;
+ for ( int i = 0; i < (int) text.length(); i++ ) {
+ if ( text[i].isLetterOrNumber() || text[i] == TQChar('_') ) {
+ if ( !inWord ) {
+ trW++;
+ inWord = TRUE;
+ }
+ } else {
+ inWord = FALSE;
+ }
+ if ( !text[i].isSpace() )
+ trC++;
+ }
+}
diff --git a/tqtinterface/qt4/tools/linguist/linguist/trwindow.h b/tqtinterface/qt4/tools/linguist/linguist/trwindow.h
new file mode 100644
index 0000000..3e69534
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/linguist/trwindow.h
@@ -0,0 +1,238 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TRWINDOW_H
+#define TRWINDOW_H
+
+#include "phrase.h"
+
+#include <metatranslator.h>
+
+#include <tqmainwindow.h>
+#include <tqptrlist.h>
+#include <tqdict.h>
+#include <tqprinter.h>
+#include <tqstringlist.h>
+#include <tqpixmap.h>
+#include <tqlistview.h>
+
+class TQAction;
+class TQDialog;
+class TQLabel;
+class TQListView;
+class TQListViewItem;
+class TQPrinter;
+
+class Action;
+class FindDialog;
+class MessageEditor;
+
+class PhraseLV;
+class ContextLVI;
+class Statistics;
+
+class TrWindow : public TQMainWindow
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ static TQPixmap * pxOn;
+ static TQPixmap * pxOff;
+ static TQPixmap * pxObsolete;
+ static TQPixmap * pxDanger;
+ static const TQPixmap pageCurl();
+
+ TrWindow();
+ ~TrWindow();
+
+ void openFile( const TQString& name );
+
+protected:
+ void readConfig();
+ void writeConfig();
+ void closeEvent( TQCloseEvent * );
+
+Q_SIGNALS:
+ void statsChanged( int w, int c, int cs, int w2, int c2, int cs2 );
+
+private Q_SLOTS:
+ void doneAndNext();
+ void prev();
+ void next();
+ void recentFileActivated( int );
+ void setupRecentFilesMenu();
+ void open();
+ void save();
+ void saveAs();
+ void release();
+ void print();
+ void tqfind();
+ void tqfindAgain();
+ void tqreplace();
+ void newPhraseBook();
+ void openPhraseBook();
+ void closePhraseBook( int id );
+ void editPhraseBook( int id );
+ void printPhraseBook( int id );
+ void manual();
+ void revertSorting();
+ void about();
+ void aboutTQt();
+
+ void setupPhrase();
+ bool maybeSave();
+ void updateCaption();
+ void showNewScope( TQListViewItem *item );
+ void showNewCurrent( TQListViewItem *item );
+ void updateTranslation( const TQString& translation );
+ void updateFinished( bool finished );
+ void toggleFinished( TQListViewItem *item, const TQPoint& p, int column );
+ void prevUnfinished();
+ void nextUnfinished();
+ void tqfindNext( const TQString& text, int where, bool matchCase );
+ void revalidate();
+ void toggleGuessing();
+ void focusSourceList();
+ void focusPhraseList();
+ void updateClosePhraseBook();
+ void toggleStatistics();
+ void updateStatistics();
+
+private:
+ typedef TQPtrList<PhraseBook> PBL;
+ typedef TQDict<PhraseBook> PBD;
+
+ static TQString friendlyString( const TQString& str );
+
+ void addRecentlyOpenedFile( const TQString & fn, TQStringList & lst );
+ void setupMenuBar();
+ void setupToolBars();
+ void setCurrentContextItem( TQListViewItem *item );
+ void setCurrentMessageItem( TQListViewItem *item );
+ TQString friendlyPhraseBookName( int k );
+ bool openPhraseBook( const TQString& name );
+ bool savePhraseBook( TQString& name, const PhraseBook& pb );
+ void updateProgress();
+ void updatePhraseDict();
+ PhraseBook getPhrases( const TQString& source );
+ bool danger( const TQString& source, const TQString& translation,
+ bool verbose = FALSE );
+
+ int itemToIndex( TQListView * view, TQListViewItem * item );
+ TQListViewItem * indexToItem( TQListView * view, int index );
+ bool searchItem( const TQString & searchWhat, TQListViewItem * j,
+ TQListViewItem * k );
+ void countStats( TQListViewItem * ci, TQListViewItem * mi, int& trW, int& trC, int& trCS );
+ void doCharCounting( const TQString& text, int& trW, int& trC, int& trCS );
+
+ TQListView * plv;
+ TQListView * lv;
+ TQListView * slv;
+ MessageEditor * me;
+ TQLabel * progress;
+ TQLabel * modified;
+ MetaTranslator tor;
+ bool dirty;
+ bool messageIsShown;
+ int numFinished;
+ int numNonobsolete;
+ int numMessages;
+ int dirtyItem;
+ TQStringList recentFiles;
+ TQString filename;
+
+ PBD phraseDict;
+ PBL phraseBooks;
+ TQStringList phraseBookNames;
+
+ TQPrinter printer;
+
+ FindDialog *f;
+ FindDialog *h;
+ TQString tqfindText;
+ int tqfindWhere;
+ bool tqfindMatchCase;
+ int foundItem;
+ TQListViewItem *foundScope;
+ int foundWhere;
+ int foundOffset;
+
+ TQPopupMenu * phrasep;
+ TQPopupMenu * closePhraseBookp;
+ TQPopupMenu * editPhraseBookp;
+ TQPopupMenu * printPhraseBookp;
+ TQPopupMenu * recentFilesMenu;
+ int closePhraseBookId;
+ int editPhraseBookId;
+ int printPhraseBookId;
+ Action *openAct;
+ Action *saveAct;
+ Action *saveAsAct;
+ Action *releaseAct;
+ Action *printAct;
+ Action *exitAct;
+ Action *undoAct;
+ Action *redoAct;
+ Action *cutAct;
+ Action *copyAct;
+ Action *pasteAct;
+ Action *selectAllAct;
+ Action *tqfindAct;
+ Action *tqfindAgainAct;
+ Action *tqreplaceAct;
+ Action *newPhraseBookAct;
+ Action *openPhraseBookAct;
+ Action *acceleratorsAct;
+ Action *endingPunctuationAct;
+ Action *phraseMatchesAct;
+ Action *revertSortingAct;
+ Action *aboutAct;
+ Action *aboutTQtAct;
+ Action *manualAct;
+ Action *whatsThisAct;
+ Action *beginFromSourceAct;
+ Action *prevAct;
+ Action *nextAct;
+ Action *prevUnfinishedAct;
+ Action *nextUnfinishedAct;
+ Action *doneAndNextAct;
+ TQAction *doneAndNextAlt;
+ Action *doGuessesAct;
+ Action *toggleStats;
+ Statistics * stats;
+ int srcWords;
+ int srcChars;
+ int srcCharsSpc;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/lrelease/lrelease.pro b/tqtinterface/qt4/tools/linguist/lrelease/lrelease.pro
new file mode 100644
index 0000000..755ea46
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lrelease/lrelease.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+CONFIG += qt warn_on console
+HEADERS = ../shared/metatranslator.h \
+ ../shared/proparser.h
+SOURCES = main.cpp \
+ ../shared/metatranslator.cpp \
+ ../shared/proparser.cpp
+
+DEFINES += QT_INTERNAL_XML
+include( ../../../src/qt_professional.pri )
+
+TARGET = lrelease
+INCLUDEPATH += ../shared
+DESTDIR = ../../../bin
+
+target.path=$$bins.path
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/linguist/lrelease/main.cpp b/tqtinterface/qt4/tools/linguist/lrelease/main.cpp
new file mode 100644
index 0000000..a23f2ec
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lrelease/main.cpp
@@ -0,0 +1,203 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <metatranslator.h>
+#include <proparser.h>
+
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
+
+#include <errno.h>
+
+typedef TQValueList<MetaTranslatorMessage> TML;
+
+static void printUsage()
+{
+ fprintf( stderr, "Usage:\n"
+ " lrelease [options] project-file\n"
+ " lrelease [options] ts-files [-qm qm-file]\n"
+ "Options:\n"
+ " -help Display this information and exit\n"
+ " -nocompress\n"
+ " Do not compress the .qm files\n"
+ " -verbose\n"
+ " Explain what is being done\n"
+ " -version\n"
+ " Display the version of lrelease and exit\n" );
+}
+
+static bool loadTsFile( MetaTranslator& tor, const TQString& tsFileName,
+ bool /* verbose */ )
+{
+ TQString qmFileName = tsFileName;
+ qmFileName.tqreplace( TQRegExp("\\.ts$"), "" );
+ qmFileName += ".qm";
+
+ bool ok = tor.load( tsFileName );
+ if ( !ok )
+ fprintf( stderr,
+ "lrelease warning: For some reason, I cannot load '%s'\n",
+ tsFileName.latin1() );
+ return ok;
+}
+
+static void releaseMetaTranslator( const MetaTranslator& tor,
+ const TQString& qmFileName, bool verbose,
+ bool stripped )
+{
+ if ( verbose )
+ fprintf( stderr, "Updating '%s'...\n", qmFileName.latin1() );
+ if ( !tor.release(qmFileName, verbose,
+ stripped ? TQTranslator::Stripped
+ : TQTranslator::Everything) )
+ fprintf( stderr,
+ "lrelease warning: For some reason, I cannot save '%s'\n",
+ qmFileName.latin1() );
+}
+
+static void releaseTsFile( const TQString& tsFileName, bool verbose,
+ bool stripped )
+{
+ MetaTranslator tor;
+ if ( loadTsFile(tor, tsFileName, verbose) ) {
+ TQString qmFileName = tsFileName;
+ qmFileName.tqreplace( TQRegExp("\\.ts$"), "" );
+ qmFileName += ".qm";
+ releaseMetaTranslator( tor, qmFileName, verbose, stripped );
+ }
+}
+
+int main( int argc, char **argv )
+{
+ bool verbose = FALSE;
+ bool stripped = TRUE;
+ bool metTranslations = FALSE;
+ MetaTranslator tor;
+ TQString outputFile;
+ int numFiles = 0;
+ int i;
+
+ for ( i = 1; i < argc; i++ ) {
+ if ( qstrcmp(argv[i], "-nocompress") == 0 ) {
+ stripped = FALSE;
+ continue;
+ } else if ( qstrcmp(argv[i], "-verbose") == 0 ) {
+ verbose = TRUE;
+ continue;
+ } else if ( qstrcmp(argv[i], "-version") == 0 ) {
+ fprintf( stderr, "lrelease version %s\n", TQT_VERSION_STR );
+ return 0;
+ } else if ( qstrcmp(argv[i], "-qm") == 0 ) {
+ if ( i == argc - 1 ) {
+ printUsage();
+ return 1;
+ } else {
+ i++;
+ outputFile = argv[i];
+ argv[i][0] = '-';
+ }
+ } else if ( qstrcmp(argv[i], "-help") == 0 ) {
+ printUsage();
+ return 0;
+ } else if ( argv[i][0] == '-' ) {
+ printUsage();
+ return 1;
+ } else {
+ numFiles++;
+ }
+ }
+
+ if ( numFiles == 0 ) {
+ printUsage();
+ return 1;
+ }
+
+ for ( i = 1; i < argc; i++ ) {
+ if ( argv[i][0] == '-' )
+ continue;
+
+ TQFile f( argv[i] );
+ if ( !f.open(IO_ReadOnly) ) {
+ fprintf( stderr,
+ "lrelease error: Cannot open file '%s': %s\n", argv[i],
+ strerror(errno) );
+ return 1;
+ }
+
+ TQTextStream t( &f );
+ TQString fullText = t.read();
+ f.close();
+
+ if ( fullText.tqfind(TQString("<!DOCTYPE TS>")) >= 0 ) {
+ if ( outputFile.isEmpty() ) {
+ releaseTsFile( argv[i], verbose, stripped );
+ } else {
+ loadTsFile( tor, argv[i], verbose );
+ }
+ } else {
+ TQString oldDir = TQDir::currentDirPath();
+ TQDir::setCurrent( TQFileInfo(argv[i]).dirPath() );
+
+ TQMap<TQString, TQString> tagMap = proFileTagMap( fullText );
+ TQMap<TQString, TQString>::Iterator it;
+
+ for ( it = tagMap.begin(); it != tagMap.end(); ++it ) {
+ TQStringList toks = TQStringList::split( ' ', it.data() );
+ TQStringList::Iterator t;
+
+ for ( t = toks.begin(); t != toks.end(); ++t ) {
+ if ( it.key() == TQString("TRANSLATIONS") ) {
+ metTranslations = TRUE;
+ releaseTsFile( *t, verbose, stripped );
+ }
+ }
+ }
+ if ( !metTranslations )
+ fprintf( stderr,
+ "lrelease warning: Met no 'TRANSLATIONS' entry in"
+ " project file '%s'\n",
+ argv[i] );
+ TQDir::setCurrent( oldDir );
+ }
+ }
+
+ if ( !outputFile.isEmpty() )
+ releaseMetaTranslator( tor, outputFile, verbose, stripped );
+
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/linguist/lupdate/fetchtr.cpp b/tqtinterface/qt4/tools/linguist/lupdate/fetchtr.cpp
new file mode 100644
index 0000000..3d3f185
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lupdate/fetchtr.cpp
@@ -0,0 +1,824 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <metatranslator.h>
+
+#include <tqfile.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
+#include <tqvaluestack.h>
+#include <tqxml.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+/* qmake ignore TQ_OBJECT */
+
+static const char MagicComment[] = "TRANSLATOR ";
+
+static TQMap<TQCString, int> needs_TQ_OBJECT;
+static TQMap<TQCString, int> lacks_TQ_OBJECT;
+
+/*
+ The first part of this source file is the C++ tokenizer. We skip
+ most of C++; the only tokens that interest us are defined here.
+ Thus, the code fragment
+
+ int main()
+ {
+ printf( "Hello, world!\n" );
+ return 0;
+ }
+
+ is broken down into the following tokens (Tok_ omitted):
+
+ Ident Ident LeftParen RightParen
+ LeftBrace
+ Ident LeftParen String RightParen Semicolon
+ return Semicolon
+ RightBrace.
+
+ The 0 doesn't produce any token.
+*/
+
+enum { Tok_Eof, Tok_class, Tok_namespace, Tok_return, Tok_tr,
+ Tok_trUtf8, Tok_translate, Tok_TQ_OBJECT, Tok_Ident,
+ Tok_Comment, Tok_String, Tok_Arrow, Tok_Colon,
+ Tok_Gulbrandsen, Tok_LeftBrace, Tok_RightBrace, Tok_LeftParen,
+ Tok_RightParen, Tok_Comma, Tok_Semicolon };
+
+/*
+ The tokenizer maintains the following global variables. The names
+ should be self-explanatory.
+*/
+static TQCString yyFileName;
+static int yyCh;
+static char yyIdent[128];
+static size_t yyIdentLen;
+static char yyComment[65536];
+static size_t yyCommentLen;
+static char yyString[65536];
+static size_t yyStringLen;
+static TQValueStack<int> yySavedBraceDepth;
+static TQValueStack<int> yySavedParenDepth;
+static int yyBraceDepth;
+static int yyParenDepth;
+static int yyLineNo;
+static int yyCurLineNo;
+static int yyBraceLineNo;
+static int yyParenLineNo;
+
+// the file to read from (if reading from a file)
+static FILE *yyInFile;
+
+// the string to read from and current position in the string (otherwise)
+static TQString yyInStr;
+static int yyInPos;
+
+static int (*getChar)();
+
+static int getCharFromFile()
+{
+ int c = getc( yyInFile );
+ if ( c == '\n' )
+ yyCurLineNo++;
+ return c;
+}
+
+static int getCharFromString()
+{
+ if ( yyInPos == (int) yyInStr.length() ) {
+ return EOF;
+ } else {
+ return yyInStr[yyInPos++].latin1();
+ }
+}
+
+static void startTokenizer( const char *fileName, int (*getCharFunc)() )
+{
+ yyInPos = 0;
+ getChar = getCharFunc;
+
+ yyFileName = fileName;
+ yyCh = getChar();
+ yySavedBraceDepth.clear();
+ yySavedParenDepth.clear();
+ yyBraceDepth = 0;
+ yyParenDepth = 0;
+ yyCurLineNo = 1;
+ yyBraceLineNo = 1;
+ yyParenLineNo = 1;
+}
+
+static int getToken()
+{
+ const char tab[] = "abfnrtv";
+ const char backTab[] = "\a\b\f\n\r\t\v";
+ uint n;
+
+ yyIdentLen = 0;
+ yyCommentLen = 0;
+ yyStringLen = 0;
+
+ while ( yyCh != EOF ) {
+ yyLineNo = yyCurLineNo;
+
+ if ( isalpha(yyCh) || yyCh == '_' ) {
+ do {
+ if ( yyIdentLen < sizeof(yyIdent) - 1 )
+ yyIdent[yyIdentLen++] = (char) yyCh;
+ yyCh = getChar();
+ } while ( isalnum(yyCh) || yyCh == '_' );
+ yyIdent[yyIdentLen] = '\0';
+
+ switch ( yyIdent[0] ) {
+ case 'Q':
+ if ( strcmp(yyIdent + 1, "_OBJECT") == 0 ) {
+ return Tok_TQ_OBJECT;
+ } else if ( strcmp(yyIdent + 1, "T_TR_NOOP") == 0 ) {
+ return Tok_tr;
+ } else if ( strcmp(yyIdent + 1, "T_TRANSLATE_NOOP") == 0 ) {
+ return Tok_translate;
+ }
+ break;
+ case 'T':
+ // TR() for when all else fails
+ if ( qstricmp(yyIdent + 1, "R") == 0 )
+ return Tok_tr;
+ break;
+ case 'c':
+ if ( strcmp(yyIdent + 1, "lass") == 0 )
+ return Tok_class;
+ break;
+ case 'f':
+ /*
+ TQTranslator::tqfindMessage() has the same parameters as
+ TQApplication::translate().
+ */
+ if ( strcmp(yyIdent + 1, "indMessage") == 0 )
+ return Tok_translate;
+ break;
+ case 'n':
+ if ( strcmp(yyIdent + 1, "amespace") == 0 )
+ return Tok_namespace;
+ break;
+ case 'r':
+ if ( strcmp(yyIdent + 1, "eturn") == 0 )
+ return Tok_return;
+ break;
+ case 's':
+ if ( strcmp(yyIdent + 1, "truct") == 0 )
+ return Tok_class;
+ break;
+ case 't':
+ if ( strcmp(yyIdent + 1, "r") == 0 ) {
+ return Tok_tr;
+ } else if ( qstrcmp(yyIdent + 1, "rUtf8") == 0 ) {
+ return Tok_trUtf8;
+ } else if ( qstrcmp(yyIdent + 1, "ranslate") == 0 ) {
+ return Tok_translate;
+ }
+ }
+ return Tok_Ident;
+ } else {
+ switch ( yyCh ) {
+ case '#':
+ /*
+ Early versions of lupdate complained about
+ unbalanced braces in the following code:
+
+ #ifdef ALPHA
+ while ( beta ) {
+ #else
+ while ( gamma ) {
+ #endif
+ delta;
+ }
+
+ The code tqcontains, indeed, two opening braces for
+ one closing brace; yet there's no reason to panic.
+
+ The solution is to remember yyBraceDepth as it was
+ when #if, #ifdef or #ifndef was met, and to set
+ yyBraceDepth to that value when meeting #elif or
+ #else.
+ */
+ do {
+ yyCh = getChar();
+ } while ( isspace(yyCh) && yyCh != '\n' );
+
+ switch ( yyCh ) {
+ case 'i':
+ yyCh = getChar();
+ if ( yyCh == 'f' ) {
+ // if, ifdef, ifndef
+ yySavedBraceDepth.push( yyBraceDepth );
+ yySavedParenDepth.push( yyParenDepth );
+ }
+ break;
+ case 'e':
+ yyCh = getChar();
+ if ( yyCh == 'l' ) {
+ // elif, else
+ if ( !yySavedBraceDepth.isEmpty() ) {
+ yyBraceDepth = yySavedBraceDepth.top();
+ yyParenDepth = yySavedParenDepth.top();
+ }
+ } else if ( yyCh == 'n' ) {
+ // endif
+ if ( !yySavedBraceDepth.isEmpty() ) {
+ yySavedBraceDepth.pop();
+ yySavedParenDepth.pop();
+ }
+ }
+ }
+ while ( isalnum(yyCh) || yyCh == '_' )
+ yyCh = getChar();
+ break;
+ case '/':
+ yyCh = getChar();
+ if ( yyCh == '/' ) {
+ do {
+ yyCh = getChar();
+ } while ( yyCh != EOF && yyCh != '\n' );
+ } else if ( yyCh == '*' ) {
+ bool metAster = FALSE;
+ bool metAsterSlash = FALSE;
+
+ while ( !metAsterSlash ) {
+ yyCh = getChar();
+ if ( yyCh == EOF ) {
+ fprintf( stderr,
+ "%s: Unterminated C++ comment starting at"
+ " line %d\n",
+ (const char *) yyFileName, yyLineNo );
+ yyComment[yyCommentLen] = '\0';
+ return Tok_Comment;
+ }
+ if ( yyCommentLen < sizeof(yyComment) - 1 )
+ yyComment[yyCommentLen++] = (char) yyCh;
+
+ if ( yyCh == '*' )
+ metAster = TRUE;
+ else if ( metAster && yyCh == '/' )
+ metAsterSlash = TRUE;
+ else
+ metAster = FALSE;
+ }
+ yyCh = getChar();
+ yyCommentLen -= 2;
+ yyComment[yyCommentLen] = '\0';
+ return Tok_Comment;
+ }
+ break;
+ case '"':
+ yyCh = getChar();
+
+ while ( yyCh != EOF && yyCh != '\n' && yyCh != '"' ) {
+ if ( yyCh == '\\' ) {
+ yyCh = getChar();
+
+ if ( yyCh == '\n' ) {
+ yyCh = getChar();
+ } else if ( yyCh == 'x' ) {
+ TQCString hex = "0";
+
+ yyCh = getChar();
+ while ( isxdigit(yyCh) ) {
+ hex += (char) yyCh;
+ yyCh = getChar();
+ }
+ sscanf( hex, "%x", &n );
+ if ( yyStringLen < sizeof(yyString) - 1 )
+ yyString[yyStringLen++] = (char) n;
+ } else if ( yyCh >= '0' && yyCh < '8' ) {
+ TQCString oct = "";
+
+ do {
+ oct += (char) yyCh;
+ yyCh = getChar();
+ } while ( yyCh >= '0' && yyCh < '8' );
+ sscanf( oct, "%o", &n );
+ if ( yyStringLen < sizeof(yyString) - 1 )
+ yyString[yyStringLen++] = (char) n;
+ } else {
+ const char *p = strchr( tab, yyCh );
+ if ( yyStringLen < sizeof(yyString) - 1 )
+ yyString[yyStringLen++] = ( p == 0 ) ?
+ (char) yyCh : backTab[p - tab];
+ yyCh = getChar();
+ }
+ } else {
+ if ( yyStringLen < sizeof(yyString) - 1 )
+ yyString[yyStringLen++] = (char) yyCh;
+ yyCh = getChar();
+ }
+ }
+ yyString[yyStringLen] = '\0';
+
+ if ( yyCh != '"' )
+ qWarning( "%s:%d: Unterminated C++ string",
+ (const char *) yyFileName, yyLineNo );
+
+ if ( yyCh == EOF ) {
+ return Tok_Eof;
+ } else {
+ yyCh = getChar();
+ return Tok_String;
+ }
+ break;
+ case '-':
+ yyCh = getChar();
+ if ( yyCh == '>' ) {
+ yyCh = getChar();
+ return Tok_Arrow;
+ }
+ break;
+ case ':':
+ yyCh = getChar();
+ if ( yyCh == ':' ) {
+ yyCh = getChar();
+ return Tok_Gulbrandsen;
+ }
+ return Tok_Colon;
+ case '\'':
+ yyCh = getChar();
+ if ( yyCh == '\\' )
+ yyCh = getChar();
+
+ do {
+ yyCh = getChar();
+ } while ( yyCh != EOF && yyCh != '\'' );
+ yyCh = getChar();
+ break;
+ case '{':
+ if (yyBraceDepth == 0)
+ yyBraceLineNo = yyCurLineNo;
+ yyBraceDepth++;
+ yyCh = getChar();
+ return Tok_LeftBrace;
+ case '}':
+ if (yyBraceDepth == 0)
+ yyBraceLineNo = yyCurLineNo;
+ yyBraceDepth--;
+ yyCh = getChar();
+ return Tok_RightBrace;
+ case '(':
+ if (yyParenDepth == 0)
+ yyParenLineNo = yyCurLineNo;
+ yyParenDepth++;
+ yyCh = getChar();
+ return Tok_LeftParen;
+ case ')':
+ if (yyParenDepth == 0)
+ yyParenLineNo = yyCurLineNo;
+ yyParenDepth--;
+ yyCh = getChar();
+ return Tok_RightParen;
+ case ',':
+ yyCh = getChar();
+ return Tok_Comma;
+ case ';':
+ yyCh = getChar();
+ return Tok_Semicolon;
+ default:
+ yyCh = getChar();
+ }
+ }
+ }
+ return Tok_Eof;
+}
+
+/*
+ The second part of this source file is the parser. It accomplishes
+ a very easy task: It tqfinds all strings inside a tr() or translate()
+ call, and possibly tqfinds out the context of the call. It supports
+ three cases: (1) the context is specified, as in
+ FunnyDialog::tr("Hello") or translate("FunnyDialog", "Hello");
+ (2) the call appears within an inlined function; (3) the call
+ appears within a function defined outside the class definition.
+*/
+
+static int yyTok;
+
+static bool match( int t )
+{
+ bool matches = ( yyTok == t );
+ if ( matches )
+ yyTok = getToken();
+ return matches;
+}
+
+static bool matchString( TQCString *s )
+{
+ bool matches = ( yyTok == Tok_String );
+ *s = "";
+ while ( yyTok == Tok_String ) {
+ *s += yyString;
+ yyTok = getToken();
+ }
+ return matches;
+}
+
+static bool matchEncoding( bool *utf8 )
+{
+ if ( yyTok == Tok_Ident ) {
+ if ( strcmp(yyIdent, "TQApplication") == 0 ) {
+ yyTok = getToken();
+ if ( yyTok == Tok_Gulbrandsen )
+ yyTok = getToken();
+ }
+ *utf8 = TQString( yyIdent ).endsWith( TQString("UTF8") );
+ yyTok = getToken();
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static void parse( MetaTranslator *tor, const char *initialContext,
+ const char *defaultContext )
+{
+ TQMap<TQCString, TQCString> qualifiedContexts;
+ TQStringList namespaces;
+ TQCString context;
+ TQCString text;
+ TQCString com;
+ TQCString functionContext = initialContext;
+ TQCString prefix;
+ bool utf8 = FALSE;
+ bool missing_TQ_OBJECT = FALSE;
+
+ yyTok = getToken();
+ while ( yyTok != Tok_Eof ) {
+ switch ( yyTok ) {
+ case Tok_class:
+ /*
+ Partial support for inlined functions.
+ */
+ yyTok = getToken();
+ if ( yyBraceDepth == (int) namespaces.count() &&
+ yyParenDepth == 0 ) {
+ do {
+ /*
+ This code should execute only once, but we play
+ safe with impure definitions such as
+ 'class TQ_EXPORT TQMessageBox', in which case
+ 'TQMessageBox' is the class name, not 'TQ_EXPORT'.
+ */
+ functionContext = yyIdent;
+ yyTok = getToken();
+ } while ( yyTok == Tok_Ident );
+
+ while ( yyTok == Tok_Gulbrandsen ) {
+ yyTok = getToken();
+ functionContext += "::";
+ functionContext += yyIdent;
+ yyTok = getToken();
+ }
+
+ if ( yyTok == Tok_Colon ) {
+ missing_TQ_OBJECT = TRUE;
+ } else {
+ functionContext = defaultContext;
+ }
+ }
+ break;
+ case Tok_namespace:
+ yyTok = getToken();
+ if ( yyTok == Tok_Ident ) {
+ TQCString ns = yyIdent;
+ yyTok = getToken();
+ if ( yyTok == Tok_LeftBrace &&
+ yyBraceDepth == (int) namespaces.count() + 1 )
+ namespaces.append( TQString(ns) );
+ }
+ break;
+ case Tok_tr:
+ case Tok_trUtf8:
+ utf8 = ( yyTok == Tok_trUtf8 );
+ yyTok = getToken();
+ if ( match(Tok_LeftParen) && matchString(&text) ) {
+ com = "";
+ if ( match(Tok_RightParen) || (match(Tok_Comma) &&
+ matchString(&com) && match(Tok_RightParen)) ) {
+ if ( prefix.isNull() ) {
+ context = functionContext;
+ if ( !namespaces.isEmpty() )
+ context.prepend( (namespaces.join(TQString("::")) +
+ TQString("::")).latin1() );
+ } else {
+ context = prefix;
+ }
+ prefix = (const char *) 0;
+
+ if ( qualifiedContexts.tqcontains(context) )
+ context = qualifiedContexts[context];
+ tor->insert( MetaTranslatorMessage(context, text, com,
+ TQString(), utf8) );
+
+ if ( lacks_TQ_OBJECT.tqcontains(context) ) {
+ qWarning( "%s:%d: Class '%s' lacks TQ_OBJECT macro",
+ (const char *) yyFileName, yyLineNo,
+ (const char *) context );
+ lacks_TQ_OBJECT.remove( context );
+ } else {
+ needs_TQ_OBJECT.insert( context, 0 );
+ }
+ }
+ }
+ break;
+ case Tok_translate:
+ utf8 = FALSE;
+ yyTok = getToken();
+ if ( match(Tok_LeftParen) &&
+ matchString(&context) &&
+ match(Tok_Comma) &&
+ matchString(&text) ) {
+ com = "";
+ if ( match(Tok_RightParen) ||
+ (match(Tok_Comma) &&
+ matchString(&com) &&
+ (match(Tok_RightParen) ||
+ match(Tok_Comma) &&
+ matchEncoding(&utf8) &&
+ match(Tok_RightParen))) )
+ tor->insert( MetaTranslatorMessage(context, text, com,
+ TQString(), utf8) );
+ }
+ break;
+ case Tok_TQ_OBJECT:
+ missing_TQ_OBJECT = FALSE;
+ yyTok = getToken();
+ break;
+ case Tok_Ident:
+ if ( !prefix.isNull() )
+ prefix += "::";
+ prefix += yyIdent;
+ yyTok = getToken();
+ if ( yyTok != Tok_Gulbrandsen )
+ prefix = (const char *) 0;
+ break;
+ case Tok_Comment:
+ com = yyComment;
+ com = com.simplifyWhiteSpace();
+ if ( com.left(sizeof(MagicComment) - 1) == MagicComment ) {
+ com.remove( 0, sizeof(MagicComment) - 1 );
+ int k = com.tqfind( ' ' );
+ if ( k == -1 ) {
+ context = com;
+ } else {
+ context = com.left( k );
+ com.remove( 0, k + 1 );
+ tor->insert( MetaTranslatorMessage(context, "", com,
+ TQString(), FALSE) );
+ }
+
+ /*
+ Provide a backdoor for people using "using
+ namespace". See the manual for details.
+ */
+ k = 0;
+ while ( (k = context.tqfind("::", k)) != -1 ) {
+ qualifiedContexts.insert( context.mid(k + 2), context );
+ k++;
+ }
+ }
+ yyTok = getToken();
+ break;
+ case Tok_Arrow:
+ yyTok = getToken();
+ if ( yyTok == Tok_tr || yyTok == Tok_trUtf8 )
+ qWarning( "%s:%d: Cannot invoke tr() like this",
+ (const char *) yyFileName, yyLineNo );
+ break;
+ case Tok_Gulbrandsen:
+ // at top level?
+ if ( yyBraceDepth == (int) namespaces.count() && yyParenDepth == 0 )
+ functionContext = prefix;
+ yyTok = getToken();
+ break;
+ case Tok_RightBrace:
+ case Tok_Semicolon:
+ if ( yyBraceDepth >= 0 &&
+ yyBraceDepth + 1 == (int) namespaces.count() )
+ namespaces.remove( namespaces.fromLast() );
+ if ( yyBraceDepth == (int) namespaces.count() ) {
+ if ( missing_TQ_OBJECT ) {
+ if ( needs_TQ_OBJECT.tqcontains(functionContext) ) {
+ qWarning( "%s:%d: Class '%s' lacks TQ_OBJECT macro",
+ (const char *) yyFileName, yyLineNo,
+ (const char *) functionContext );
+ } else {
+ lacks_TQ_OBJECT.insert( functionContext, 0 );
+ }
+ }
+ functionContext = defaultContext;
+ missing_TQ_OBJECT = FALSE;
+ }
+ yyTok = getToken();
+ break;
+ default:
+ yyTok = getToken();
+ }
+ }
+
+ if ( yyBraceDepth != 0 )
+ fprintf( stderr,
+ "%s:%d: Unbalanced braces in C++ code (or abuse of the C++"
+ " preprocessor)\n",
+ (const char *)yyFileName, yyBraceLineNo );
+ else if ( yyParenDepth != 0 )
+ fprintf( stderr,
+ "%s:%d: Unbalanced parentheses in C++ code (or abuse of the C++"
+ " preprocessor)\n",
+ (const char *)yyFileName, yyParenLineNo );
+}
+
+void fetchtr_cpp( const char *fileName, MetaTranslator *tor,
+ const char *defaultContext, bool mustExist )
+{
+ yyInFile = fopen( fileName, "r" );
+ if ( yyInFile == 0 ) {
+ if ( mustExist )
+ fprintf( stderr,
+ "lupdate error: Cannot open C++ source file '%s': %s\n",
+ fileName, strerror(errno) );
+ return;
+ }
+
+ startTokenizer( fileName, getCharFromFile );
+ parse( tor, 0, defaultContext );
+ fclose( yyInFile );
+}
+
+/*
+ In addition to C++, we support TQt Designer UI files.
+*/
+
+/*
+ Fetches tr() calls in C++ code in UI files (inside "<function>"
+ tag). This mechanism is obsolete.
+*/
+void fetchtr_inlined_cpp( const char *fileName, const TQString& in,
+ MetaTranslator *tor, const char *context )
+{
+ yyInStr = in;
+ startTokenizer( fileName, getCharFromString );
+ parse( tor, context, 0 );
+ yyInStr = TQString();
+}
+
+class UiHandler : public TQXmlDefaultHandler
+{
+public:
+ UiHandler( MetaTranslator *translator, const char *fileName )
+ : tor( translator ), fname( fileName ), comment( "" ) { }
+
+ virtual bool startElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName,
+ const TQXmlAttributes& atts );
+ virtual bool endElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName );
+ virtual bool characters( const TQString& ch );
+ virtual bool fatalError( const TQXmlParseException& exception );
+
+private:
+ void flush();
+
+ MetaTranslator *tor;
+ TQCString fname;
+ TQString context;
+ TQString source;
+ TQString comment;
+
+ TQString accum;
+};
+
+bool UiHandler::startElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName,
+ const TQXmlAttributes& atts )
+{
+ if ( qName == TQString("item") ) {
+ flush();
+ if ( !atts.value(TQString("text")).isEmpty() )
+ source = atts.value( TQString("text") );
+ } else if ( qName == TQString("string") ) {
+ flush();
+ }
+ accum.truncate( 0 );
+ return TRUE;
+}
+
+bool UiHandler::endElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName )
+{
+ accum.tqreplace( TQRegExp(TQString("\r\n")), "\n" );
+
+ if ( qName == TQString("class") ) {
+ if ( context.isEmpty() )
+ context = accum;
+ } else if ( qName == TQString("string") ) {
+ source = accum;
+ } else if ( qName == TQString("comment") ) {
+ comment = accum;
+ flush();
+ } else if ( qName == TQString("function") ) {
+ fetchtr_inlined_cpp( (const char *) fname, accum, tor,
+ context.latin1() );
+ } else {
+ flush();
+ }
+ return TRUE;
+}
+
+bool UiHandler::characters( const TQString& ch )
+{
+ accum += ch;
+ return TRUE;
+}
+
+bool UiHandler::fatalError( const TQXmlParseException& exception )
+{
+ TQString msg;
+ msg.sprintf( "Parse error at line %d, column %d (%s).",
+ exception.lineNumber(), exception.columnNumber(),
+ exception.message().latin1() );
+ fprintf( stderr, "XML error: %s\n", msg.latin1() );
+ return FALSE;
+}
+
+void UiHandler::flush()
+{
+ if ( !context.isEmpty() && !source.isEmpty() )
+ tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(),
+ comment.utf8(), TQString(),
+ TRUE) );
+ source.truncate( 0 );
+ comment.truncate( 0 );
+}
+
+void fetchtr_ui( const char *fileName, MetaTranslator *tor,
+ const char * /* defaultContext */, bool mustExist )
+{
+ TQFile f( fileName );
+ if ( !f.open(IO_ReadOnly) ) {
+ if ( mustExist )
+ fprintf( stderr, "lupdate error: cannot open UI file '%s': %s\n",
+ fileName, strerror(errno) );
+ return;
+ }
+
+ TQTextStream t( &f );
+ TQXmlInputSource in( t );
+ TQXmlSimpleReader reader;
+ reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE );
+ reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE );
+ reader.setFeature( "http://trolltech.com/xml/features/report-whitespace"
+ "-only-CharData", FALSE );
+ TQXmlDefaultHandler *hand = new UiHandler( tor, fileName );
+ reader.setContentHandler( hand );
+ reader.setErrorHandler( hand );
+
+ if ( !reader.parse(in) )
+ fprintf( stderr, "%s: Parse error in UI file\n", fileName );
+ reader.setContentHandler( 0 );
+ reader.setErrorHandler( 0 );
+ delete hand;
+ f.close();
+}
diff --git a/tqtinterface/qt4/tools/linguist/lupdate/lupdate.pro b/tqtinterface/qt4/tools/linguist/lupdate/lupdate.pro
new file mode 100644
index 0000000..1dad999
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lupdate/lupdate.pro
@@ -0,0 +1,21 @@
+TEMPLATE = app
+CONFIG += qt warn_on console
+HEADERS = ../shared/metatranslator.h \
+ ../shared/proparser.h
+SOURCES = fetchtr.cpp \
+ main.cpp \
+ merge.cpp \
+ numberh.cpp \
+ sametexth.cpp \
+ ../shared/metatranslator.cpp \
+ ../shared/proparser.cpp
+
+DEFINES += QT_INTERNAL_XML
+include( ../../../src/qt_professional.pri )
+
+TARGET = lupdate
+INCLUDEPATH += ../shared
+DESTDIR = ../../../bin
+
+target.path=$$bins.path
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/linguist/lupdate/main.cpp b/tqtinterface/qt4/tools/linguist/lupdate/main.cpp
new file mode 100644
index 0000000..4bc833d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lupdate/main.cpp
@@ -0,0 +1,241 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <metatranslator.h>
+#include <proparser.h>
+
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
+
+#include <errno.h>
+#include <string.h>
+
+// defined in fetchtr.cpp
+extern void fetchtr_cpp( const char *fileName, MetaTranslator *tor,
+ const char *defaultContext, bool mustExist );
+extern void fetchtr_ui( const char *fileName, MetaTranslator *tor,
+ const char *defaultContext, bool mustExist );
+
+// defined in merge.cpp
+extern void merge( MetaTranslator *tor, const MetaTranslator *virginTor,
+ bool verbose );
+
+typedef TQValueList<MetaTranslatorMessage> TML;
+
+static void printUsage()
+{
+ fprintf( stderr, "Usage:\n"
+ " lupdate [options] project-file\n"
+ " lupdate [options] source-files -ts ts-files\n"
+ "Options:\n"
+ " -help Display this information and exit\n"
+ " -noobsolete\n"
+ " Drop all obsolete strings\n"
+ " -verbose\n"
+ " Explain what is being done\n"
+ " -version\n"
+ " Display the version of lupdate and exit\n" );
+}
+
+static void updateTsFiles( const MetaTranslator& fetchedTor,
+ const TQStringList& tsFileNames, const TQString& codec,
+ bool noObsolete, bool verbose )
+{
+ TQStringList::ConstIterator t = tsFileNames.begin();
+ while ( t != tsFileNames.end() ) {
+ MetaTranslator tor;
+ tor.load( *t );
+ if ( !codec.isEmpty() )
+ tor.setCodec( codec );
+ if ( verbose )
+ fprintf( stderr, "Updating '%s'...\n", (*t).latin1() );
+ merge( &tor, &fetchedTor, verbose );
+ if ( noObsolete )
+ tor.stripObsoleteMessages();
+ tor.stripEmptyContexts();
+ if ( !tor.save(*t) )
+ fprintf( stderr, "lupdate error: Cannot save '%s': %s\n",
+ (*t).latin1(), strerror(errno) );
+ ++t;
+ }
+}
+
+int main( int argc, char **argv )
+{
+ TQString defaultContext = "@default";
+ MetaTranslator fetchedTor;
+ TQCString codec;
+ TQStringList tsFileNames;
+
+ bool verbose = FALSE;
+ bool noObsolete = FALSE;
+ bool metSomething = FALSE;
+ int numFiles = 0;
+ bool standardSyntax = TRUE;
+ bool metTsFlag = FALSE;
+
+ int i;
+
+ for ( i = 1; i < argc; i++ ) {
+ if ( qstrcmp(argv[i], "-ts") == 0 )
+ standardSyntax = FALSE;
+ }
+
+ for ( i = 1; i < argc; i++ ) {
+ if ( qstrcmp(argv[i], "-help") == 0 ) {
+ printUsage();
+ return 0;
+ } else if ( qstrcmp(argv[i], "-noobsolete") == 0 ) {
+ noObsolete = TRUE;
+ continue;
+ } else if ( qstrcmp(argv[i], "-verbose") == 0 ) {
+ verbose = TRUE;
+ continue;
+ } else if ( qstrcmp(argv[i], "-version") == 0 ) {
+ fprintf( stderr, "lupdate version %s\n", TQT_VERSION_STR );
+ return 0;
+ } else if ( qstrcmp(argv[i], "-ts") == 0 ) {
+ metTsFlag = TRUE;
+ continue;
+ }
+
+ numFiles++;
+
+ TQString fullText;
+
+ if ( !metTsFlag ) {
+ TQFile f( argv[i] );
+ if ( !f.open(IO_ReadOnly) ) {
+ fprintf( stderr, "lupdate error: Cannot open file '%s': %s\n",
+ argv[i], strerror(errno) );
+ return 1;
+ }
+
+ TQTextStream t( &f );
+ fullText = t.read();
+ f.close();
+ }
+
+ TQString oldDir = TQDir::currentDirPath();
+ TQDir::setCurrent( TQFileInfo(argv[i]).dirPath() );
+
+ if ( standardSyntax ) {
+ fetchedTor = MetaTranslator();
+ codec.truncate( 0 );
+ tsFileNames.clear();
+
+ TQMap<TQString, TQString> tagMap = proFileTagMap( fullText );
+ TQMap<TQString, TQString>::Iterator it;
+
+ for ( it = tagMap.begin(); it != tagMap.end(); ++it ) {
+ TQStringList toks = TQStringList::split( ' ', it.data() );
+ TQStringList::Iterator t;
+
+ for ( t = toks.begin(); t != toks.end(); ++t ) {
+ if ( it.key() == "HEADERS" || it.key() == "SOURCES" ) {
+ fetchtr_cpp( *t, &fetchedTor, defaultContext, TRUE );
+ metSomething = TRUE;
+ } else if ( it.key() == "INTERFACES" ||
+ it.key() == "FORMS" ) {
+ fetchtr_ui( *t, &fetchedTor, defaultContext, TRUE );
+ fetchtr_cpp( *t + ".h", &fetchedTor, defaultContext,
+ FALSE );
+ metSomething = TRUE;
+ } else if ( it.key() == "TRANSLATIONS" ) {
+ tsFileNames.append( *t );
+ metSomething = TRUE;
+ } else if ( it.key() == "CODEC" ||
+ it.key() == "DEFAULTCODEC" ) {
+ codec = (*t).latin1();
+ }
+ }
+ }
+
+ updateTsFiles( fetchedTor, tsFileNames, codec, noObsolete,
+ verbose );
+
+ if ( !metSomething ) {
+ fprintf( stderr,
+ "lupdate warning: File '%s' does not look like a"
+ " project file\n",
+ argv[i] );
+ } else if ( tsFileNames.isEmpty() ) {
+ fprintf( stderr,
+ "lupdate warning: Met no 'TRANSLATIONS' entry in"
+ " project file '%s'\n",
+ argv[i] );
+ }
+ } else {
+ if ( metTsFlag ) {
+ if ( TQString(argv[i]).lower().endsWith(".ts") ) {
+ TQFileInfo fi( argv[i] );
+ if ( !fi.exists() || fi.isWritable() ) {
+ tsFileNames.append( argv[i] );
+ } else {
+ fprintf( stderr,
+ "lupdate warning: For some reason, I cannot"
+ " save '%s'\n",
+ argv[i] );
+ }
+ } else {
+ fprintf( stderr,
+ "lupdate error: File '%s' lacks .ts extension\n",
+ argv[i] );
+ }
+ } else {
+ TQFileInfo fi(argv[i]);
+ if ( TQString(argv[i]).lower().endsWith(".ui") ) {
+ fetchtr_ui( fi.fileName(), &fetchedTor, defaultContext, TRUE );
+ fetchtr_cpp( TQString(fi.fileName()) + ".h", &fetchedTor,
+ defaultContext, FALSE );
+ } else {
+ fetchtr_cpp( fi.fileName(), &fetchedTor, defaultContext, TRUE );
+ }
+ }
+ }
+ TQDir::setCurrent( oldDir );
+ }
+
+ if ( !standardSyntax )
+ updateTsFiles( fetchedTor, tsFileNames, codec, noObsolete, verbose );
+
+ if ( numFiles == 0 ) {
+ printUsage();
+ return 1;
+ }
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/linguist/lupdate/merge.cpp b/tqtinterface/qt4/tools/linguist/lupdate/merge.cpp
new file mode 100644
index 0000000..bc409db
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lupdate/merge.cpp
@@ -0,0 +1,129 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <metatranslator.h>
+
+// defined in numberh.cpp
+extern void applyNumberHeuristic( MetaTranslator *tor, bool verbose );
+// defined in sametexth.cpp
+extern void applySameTextHeuristic( MetaTranslator *tor, bool verbose );
+
+typedef TQValueList<MetaTranslatorMessage> TML;
+
+/*
+ Merges two MetaTranslator objects into the first one. The first one
+ is a set of source texts and translations for a previous version of
+ the internationalized program; the second one is a set of fresh
+ source texts newly extracted from the source code, without any
+ translation yet.
+*/
+
+void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose )
+{
+ int known = 0;
+ int neww = 0;
+ int obsoleted = 0;
+ TML all = tor->messages();
+ TML::Iterator it;
+
+ /*
+ The types of all the messages from the vernacular translator
+ are updated according to the virgin translator.
+ */
+ for ( it = all.begin(); it != all.end(); ++it ) {
+ MetaTranslatorMessage::Type newType;
+ MetaTranslatorMessage m = *it;
+
+ // skip context comment
+ if ( !TQCString((*it).sourceText()).isEmpty() ) {
+ if ( !virginTor->tqcontains((*it).context(), (*it).sourceText(),
+ (*it).comment()) ) {
+ newType = MetaTranslatorMessage::Obsolete;
+ if ( m.type() != MetaTranslatorMessage::Obsolete )
+ obsoleted++;
+ } else {
+ switch ( m.type() ) {
+ case MetaTranslatorMessage::Finished:
+ newType = MetaTranslatorMessage::Finished;
+ known++;
+ break;
+ case MetaTranslatorMessage::Unfinished:
+ default:
+ newType = MetaTranslatorMessage::Unfinished;
+ known++;
+ break;
+ case MetaTranslatorMessage::Obsolete:
+ newType = MetaTranslatorMessage::Unfinished;
+ neww++;
+ }
+ }
+
+ if ( newType != m.type() ) {
+ m.setType( newType );
+ tor->insert( m );
+ }
+ }
+ }
+
+ /*
+ Messages found only in the virgin translator are added to the
+ vernacular translator. Among these are all the context comments.
+ */
+ all = virginTor->messages();
+
+ for ( it = all.begin(); it != all.end(); ++it ) {
+ if ( !tor->tqcontains((*it).context(), (*it).sourceText(),
+ (*it).comment()) ) {
+ tor->insert( *it );
+ if ( !TQCString((*it).sourceText()).isEmpty() )
+ neww++;
+ }
+ }
+
+ /*
+ The same-text heuristic handles cases where a message has an
+ obsolete counterpart with a different context or comment.
+ */
+ applySameTextHeuristic( tor, verbose );
+
+ /*
+ The number heuristic handles cases where a message has an
+ obsolete counterpart with mostly numbers differing in the
+ source text.
+ */
+ applyNumberHeuristic( tor, verbose );
+
+ if ( verbose )
+ fprintf( stderr, " %d known, %d new and %d obsoleted messages\n", known,
+ neww, obsoleted );
+}
diff --git a/tqtinterface/qt4/tools/linguist/lupdate/numberh.cpp b/tqtinterface/qt4/tools/linguist/lupdate/numberh.cpp
new file mode 100644
index 0000000..ba54dae
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lupdate/numberh.cpp
@@ -0,0 +1,248 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <metatranslator.h>
+
+#include <tqmemarray.h>
+#include <tqcstring.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
+
+#include <ctype.h>
+
+typedef TQMap<TQCString, MetaTranslatorMessage> TMM;
+typedef TQValueList<MetaTranslatorMessage> TML;
+
+static bool isDigitFriendly( int c )
+{
+ return ispunct((uchar)c) || isspace((uchar)c);
+}
+
+static int numberLength( const char *s )
+{
+ int i = 0;
+
+ if ( isdigit((uchar)s[0]) ) {
+ do {
+ i++;
+ } while (isdigit((uchar)s[i]) ||
+ (isDigitFriendly(s[i]) &&
+ (isdigit((uchar)s[i + 1]) ||
+ (isDigitFriendly(s[i + 1]) && isdigit((uchar)s[i + 2])))));
+ }
+ return i;
+}
+
+/*
+ Returns a version of 'key' where all numbers have been tqreplaced by zeroes. If
+ there were none, returns "".
+*/
+static TQCString zeroKey( const char *key )
+{
+ TQCString zeroed( (int)strlen(key) + 1 );
+ char *z = zeroed.data();
+ int i = 0, j = 0;
+ int len;
+ bool metSomething = FALSE;
+
+ while ( key[i] != '\0' ) {
+ len = numberLength( key + i );
+ if ( len > 0 ) {
+ i += len;
+ z[j++] = '0';
+ metSomething = TRUE;
+ } else {
+ z[j++] = key[i++];
+ }
+ }
+ z[j] = '\0';
+
+ if ( metSomething )
+ return zeroed;
+ else
+ return "";
+}
+
+static TQString translationAttempt( const TQString& oldTranslation,
+ const char *oldSource,
+ const char *newSource )
+{
+ int p = zeroKey( oldSource ).tqcontains( '0' );
+ int oldSourceLen = tqstrlen( oldSource );
+ TQString attempt;
+ TQStringList oldNumbers;
+ TQStringList newNumbers;
+ TQMemArray<bool> met( p );
+ TQMemArray<int> matchedYet( p );
+ int i, j;
+ int k = 0, ell, best;
+ int m, n;
+ int pass;
+
+ /*
+ This algorithm is hard to follow, so we'll consider an example
+ all along: oldTranslation is "XeT 3.0", oldSource is "TeX 3.0"
+ and newSource is "XeT 3.1".
+
+ First, we set up two tables: oldNumbers and newNumbers. In our
+ example, oldNumber[0] is "3.0" and newNumber[0] is "3.1".
+ */
+ for ( i = 0, j = 0; i < oldSourceLen; i++, j++ ) {
+ m = numberLength( oldSource + i );
+ n = numberLength( newSource + j );
+ if ( m > 0 ) {
+ oldNumbers.append( TQCString(oldSource + i, m + 1) );
+ newNumbers.append( TQCString(newSource + j, n + 1) );
+ i += m;
+ j += n;
+ met[k] = FALSE;
+ matchedYet[k] = 0;
+ k++;
+ }
+ }
+
+ /*
+ We now go over the old translation, "XeT 3.0", one letter at a
+ time, looking for numbers found in oldNumbers. Whenever such a
+ number is met, it is tqreplaced with its newNumber equivalent. In
+ our example, the "3.0" of "XeT 3.0" becomes "3.1".
+ */
+ for ( i = 0; i < (int) oldTranslation.length(); i++ ) {
+ attempt += oldTranslation[i];
+ for ( k = 0; k < p; k++ ) {
+ if ( oldTranslation[i] == oldNumbers[k][matchedYet[k]] )
+ matchedYet[k]++;
+ else
+ matchedYet[k] = 0;
+ }
+
+ /*
+ Let's tqfind out if the last character ended a match. We make
+ two passes over the data. In the first pass, we try to
+ match only numbers that weren't matched yet; if that fails,
+ the second pass does the trick. This is useful in some
+ suspicious cases, flagged below.
+ */
+ for ( pass = 0; pass < 2; pass++ ) {
+ best = p; // an impossible value
+ for ( k = 0; k < p; k++ ) {
+ if ( (!met[k] || pass > 0) &&
+ matchedYet[k] == (int) oldNumbers[k].length() &&
+ numberLength(oldTranslation.latin1() + (i + 1) -
+ matchedYet[k]) == matchedYet[k] ) {
+ // the longer the better
+ if ( best == p || matchedYet[k] > matchedYet[best] )
+ best = k;
+ }
+ }
+ if ( best != p ) {
+ attempt.truncate( attempt.length() - matchedYet[best] );
+ attempt += newNumbers[best];
+ met[best] = TRUE;
+ for ( k = 0; k < p; k++ )
+ matchedYet[k] = 0;
+ break;
+ }
+ }
+ }
+
+ /*
+ We flag two kinds of suspicious cases. They are identified as
+ such with comments such as "{2000?}" at the end.
+
+ Example of the first kind: old source text "TeX 3.0" translated
+ as "XeT 2.0" is flagged "TeX 2.0 {3.0?}", no matter what the
+ new text is.
+ */
+ for ( k = 0; k < p; k++ ) {
+ if ( !met[k] )
+ attempt += TQString( " {" ) + newNumbers[k] + TQString( "?}" );
+ }
+
+ /*
+ Example of the second kind: "1 of 1" translated as "1 af 1",
+ with new source text "1 of 2", generates "1 af 2 {1 or 2?}"
+ because it's not clear which of "1 af 2" and "2 af 1" is right.
+ */
+ for ( k = 0; k < p; k++ ) {
+ for ( ell = 0; ell < p; ell++ ) {
+ if ( k != ell && oldNumbers[k] == oldNumbers[ell] &&
+ newNumbers[k] < newNumbers[ell] )
+ attempt += TQString( " {" ) + newNumbers[k] + TQString( " or " ) +
+ newNumbers[ell] + TQString( "?}" );
+ }
+ }
+ return attempt;
+}
+
+/*
+ Augments a MetaTranslator with translations easily derived from
+ similar existing (probably obsolete) translations.
+
+ For example, if "TeX 3.0" is translated as "XeT 3.0" and "TeX 3.1"
+ has no translation, "XeT 3.1" is added to the translator and is
+ marked Unfinished.
+*/
+void applyNumberHeuristic( MetaTranslator *tor, bool verbose )
+{
+ TMM translated, untranslated;
+ TMM::Iterator t, u;
+ TML all = tor->messages();
+ TML::Iterator it;
+ int inserted = 0;
+
+ for ( it = all.begin(); it != all.end(); ++it ) {
+ if ( (*it).type() == MetaTranslatorMessage::Unfinished ) {
+ if ( (*it).translation().isEmpty() )
+ untranslated.insert(TQCString((*it).context()) + "\n" + (*it).sourceText() + "\n"
+ + (*it).comment(), *it);
+ } else if ( !(*it).translation().isEmpty() ) {
+ translated.insert( zeroKey((*it).sourceText()), *it );
+ }
+ }
+
+ for ( u = untranslated.begin(); u != untranslated.end(); ++u ) {
+ t = translated.tqfind( zeroKey((*u).sourceText()) );
+ if ( t != translated.end() && !t.key().isEmpty() &&
+ qstrcmp((*t).sourceText(), (*u).sourceText()) != 0 ) {
+ MetaTranslatorMessage m( *u );
+ m.setTranslation(translationAttempt((*t).translation(), (*t).sourceText(),
+ (*u).sourceText()));
+ tor->insert( m );
+ inserted++;
+ }
+ }
+ if ( verbose && inserted != 0 )
+ fprintf( stderr, " number heuristic provided %d translation%s\n",
+ inserted, inserted == 1 ? "" : "s" );
+}
diff --git a/tqtinterface/qt4/tools/linguist/lupdate/sametexth.cpp b/tqtinterface/qt4/tools/linguist/lupdate/sametexth.cpp
new file mode 100644
index 0000000..456ad7d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/lupdate/sametexth.cpp
@@ -0,0 +1,97 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <metatranslator.h>
+
+#include <tqcstring.h>
+#include <tqmap.h>
+
+typedef TQMap<TQCString, MetaTranslatorMessage> TMM;
+typedef TQValueList<MetaTranslatorMessage> TML;
+
+/*
+ Augments a MetaTranslator with trivially derived translations.
+
+ For example, if "Enabled:" is consistendly translated as "Eingeschaltet:" no
+ matter the context or the comment, "Eingeschaltet:" is added as the
+ translation of any untranslated "Enabled:" text and is marked Unfinished.
+*/
+
+void applySameTextHeuristic( MetaTranslator *tor, bool verbose )
+{
+ TMM translated;
+ TMM avoid;
+ TMM::Iterator t;
+ TML untranslated;
+ TML::Iterator u;
+ TML all = tor->messages();
+ TML::Iterator it;
+ int inserted = 0;
+
+ for ( it = all.begin(); it != all.end(); ++it ) {
+ if ( (*it).type() == MetaTranslatorMessage::Unfinished ) {
+ if ( (*it).translation().isEmpty() )
+ untranslated.append( *it );
+ } else {
+ TQCString key = (*it).sourceText();
+ t = translated.tqfind( key );
+ if ( t != translated.end() ) {
+ /*
+ The same source text is translated at least two
+ different ways. Do nothing then.
+ */
+ if ( (*t).translation() != (*it).translation() ) {
+ translated.remove( key );
+ avoid.insert( key, *it );
+ }
+ } else if ( !avoid.tqcontains(key) &&
+ !(*it).translation().isEmpty() ) {
+ translated.insert( key, *it );
+ }
+ }
+ }
+
+ for ( u = untranslated.begin(); u != untranslated.end(); ++u ) {
+ TQCString key = (*u).sourceText();
+ t = translated.tqfind( key );
+ if ( t != translated.end() ) {
+ MetaTranslatorMessage m( *u );
+ m.setTranslation( (*t).translation() );
+ tor->insert( m );
+ inserted++;
+ }
+ }
+ if ( verbose && inserted != 0 )
+ fprintf( stderr, " same-text heuristic provided %d translation%s\n",
+ inserted, inserted == 1 ? "" : "s" );
+}
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/danish.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/danish.qph
new file mode 100644
index 0000000..7a71500
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/danish.qph
@@ -0,0 +1,1018 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Om</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>hurtigtast</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>brugervenlighed</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>genvejshåndtag</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>aktiv</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>markeringsafslutning</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>aktivt objekt</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>aktivt vindue</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>værktøjselement</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Altid øverst</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>forankringspunkt</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Anvend</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>tekstboks med automatisk udgang</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>automatisk gentagelse</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>automatisk kæde</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>automatisk rulning</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>automatisk rulning</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Tilbage</target>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Gennemse</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Annuller</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>undermenu</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>afkrydsningsfelt</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>afkrydsning</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>underordnet vindue</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>vælge</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>klikke</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Udklipsholder</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Luk</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>lukknap</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>skjule</target>
+ <definition>outline/disposition</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>kolonneoverskrift</target>
+ <definition>control/kontrolelement</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>kombinationsboks</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>kommandoknap</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>objektbeholder</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>kontekstafhængig hjælp</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>kontekstafhængig</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>kontrolelement</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Kopier</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Kopier hertil</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Opret genvej</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Opret genvej her</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Klip</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>standard</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>standardknap</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Slet</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>skrivebord</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>destination</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>dialogboks</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>handicap</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>usammenhængende markering</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>forankre</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>dokument</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>dobbeltklikke</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>trække</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>trække og slippe</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>kombinationsboks med rullepil</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>rulleliste</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>rullemenu</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Rediger</target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>Menuen Rediger</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>ellipse</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>integreret objekt</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Afslut</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>udvide</target>
+ <definition>an outline/en disposition</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Stitqfinder</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>udvidet markering</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>liste</target>
+ <definition>der tillader udvidet markering</definition>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>fil</target>
+</phrase>
+<phrase>
+ <source>File menu</source>
+ <target>Menuen Filer</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Søg</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Find næste</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Søg efter</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>mappe</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>skrifttype</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>skriftstørrelse</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>typografi</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>funktionstast</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>gruppeboks</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>håndtag</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Hjælp</target>
+</phrase>
+<phrase>
+ <source>Help menu</source>
+ <target>Menuen Hjælp</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Skjul</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>hierarkisk markering</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>holde nede</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>aktivt punkt</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>aktiv zone</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>ikon</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>ikke-aktiv</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>ikke-aktivt vindue</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>inputfokus</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>Menuen Indsæt</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Indsæt objekt</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>indsætningspunkt</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>kursiv</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>etiket</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>liggende</target>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>sammenkæde</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>kæde</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Indsæt kæde her</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>liste</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>listevisningsboks</target>
+ <definition>control/kontrolelement</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>manuel kæde</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Maksimer</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>maksimeringsknap</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>menu</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>menulinje</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>menuknap</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>menupunkt</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>menutitel</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>meddelelsesboks</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Minimer</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>minimeringsknap</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>blandet værdi</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>modal</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>tilstand</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>ikke-modal</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>ændringstast</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>mus</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Flyt</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Flyt hertil</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>multiple document interface</target>
+ <definition>MDI</definition>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>liste</target>
+ <definition>der tillader flere markeringer</definition>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Denne computer</target>
+ <definition>icon/ikon</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Andre computere</target>
+ <definition>icon/ikon</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Ny</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Næste</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>objekt</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>OLE-træk og slip</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>integreret OLE-objekt</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>sammenkædet OLE-objekt</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>interaktiv OLE-træk og slip</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Åbn</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Åbn med</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>alternativknap</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>aktiveret indstilling</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>objektpakke</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Sideopsætning</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>paletvindue</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>rude</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>overordnet vindue</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>adgangskode</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Sæt ind</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Indsæt kæde</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Indsæt genvej</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Indsæt speciel</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>sti</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Pause</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Afspil</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>punkt</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>pege</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>markør</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>pop-up-menu</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>pop-up-vindue</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>stående</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>trykke på</target>
+ <definition>and hold a mouse button/og holde en museknap nede</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>trykke på</target>
+ <definition>a key/en tast</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>primært destinationsobjekt</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>primært vindue</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Udskriv</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>printer</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>statusindikator</target>
+ <definition>control/kontrolelement</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>projekt</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Egenskaber</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>egenskabsfremviser</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>egenskabsside</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>egenskabsark</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>kontrolelement på egenskabsark</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Hurtig visning</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>skrivebeskyttet</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Papirkurv</target>
+ <definition>Icon/ikon</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Annuller Fortryd</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>områdemarkering</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>registreringsdatabase</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Gentag</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Erstat</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Gendan</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>gendannelsesknap</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Fortsæt</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Forsøg igen</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>tekstboks til formateret tekst</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Kør</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Gem</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Gem som</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>rulle</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>rullepil</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>rullepanel</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>rulleboks</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>sekundært vindue</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>markere</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>vælge</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Marker alt</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>det markerede</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>markeringshåndtag</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Overfør til</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>separator</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Indstillinger</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Indstillinger</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Installation</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>genvej</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>genvejsknap</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>genvejsikon</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>genvejstast</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>kontrolelement til genvejstast</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Vis</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Luk computeren</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>liste</target>
+ <definition>der kun tillader en enkelt markering</definition>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Tilpas størrelse</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>størrelseshåndtag</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>skala</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>rotationsboks</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Opdel</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>delelinje</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>deleboks</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>startknap</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>Startmappe</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>statuslinje</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Stop</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>fane</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>proceslinje</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>opgaveafhængig Hjælp</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>skabelon</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>tekstboks</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>titellinje</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>titeltekst</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>til/fra-tast</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>verktøjslinje</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>verktøjstip</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>træstruktur</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>skrive</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>type</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>ikke tilgængelig</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Fortryd</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Fjern installationen</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>Menuen Vis</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>lokal redigering</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>grafikpalet</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Hvad er det?</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>Menuen Vindue</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>vindue</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Windows Stitqfinder</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>guide</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>projektmappe</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>arbejdsgruppe</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>arbejdsområde</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Ja</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/dutch.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/dutch.qph
new file mode 100644
index 0000000..bd94682
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/dutch.qph
@@ -0,0 +1,1044 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Info</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>toegangstoets</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>toegankelijkheid</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>bewerkingsgreep</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>actief</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>selecie-einde</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>actief object</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>actief venster</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>grafisch hulpmiddel</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Altijd op voorgrond</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>fixeerpunt</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Toepassen</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>automatisch verlaten</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>zich automatisch herhalen</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>automatisch herhalen</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>automatische koppeling</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>automatisch schuiven</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>automatisch schuiven</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Vorige</target>
+ <definition>wanneer het een logisch paar vormt met Volgende</definition>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Bladeren</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Annuleren</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>vervolgmenu</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>selectievakje</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>vinkje</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>subvenster</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>kiezen</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>klikken</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Klembord</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Sluiten</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>knop Sluiten</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>samenvouwen</target>
+ <definition>outline</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>kolomnaam</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>keuzelijst met invoervak</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>opdrachtknop</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>hoofdobject</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>contextafhankelijke Help</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>contextafhankelijk</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>besturingselement</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Kopiëren</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Hierheen kopiëren</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Snelkoppeling maken</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Hier snelkoppeling maken</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Knippen</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>standaard</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>standaardknop</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Verwijderen</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>bureaublad</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>doel</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>dialoogvenster</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>handicap</target>
+ <definition>voorzichtig in context, maar handicap niet verbloemen:VB: persoon met een handicap (beter dan gehandicapte)</definition>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>niet-aaneengesloten selectie</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>in werkbalkdok plaatsen</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>document</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>dubbelklikken</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>slepen</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>slepen en neerzetten</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>vervolgkeuzelijst met invoervak</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>vervolgkeuzelijst</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>menu</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Bewerken</target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>menu Bewerken</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>puntjes</target>
+ <definition>(...)</definition>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>ingesloten object</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Afsluiten</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>uitvouwen</target>
+ <definition>an outline</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Verkennen</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>uitgebreide selectie</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>keuzelijst met uitgebreide selectie</target>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>bestand</target>
+</phrase>
+<phrase>
+ <source>File menu</source>
+ <target>menu Bestand</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Zoeken</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Volgende zoeken</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Zoeken naar</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>map</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>lettertype</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>tekengrootte</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>tekenstijl</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>functietoets</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>groepsvak</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>greep</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Help</target>
+</phrase>
+<phrase>
+ <source>Help menu</source>
+ <target>menu Help</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Verbergen</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>hiërarchische selectie</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>ingedrukt houden</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>selectiepunt</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>selectiegebied</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>pictogram</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>niet-actief</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>niet-actief venster</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>invoerfocus</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>menu Invoegen</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Object Invoegen</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>invoegpositie</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>cursief</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>label</target>
+ <definition>gender, Masc.: de</definition>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>liggend</target>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>koppeling</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>koppelen</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Hier koppeling maken</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>keuzelijst</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>weergaveknoppen</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>handmatige koppeling</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Maximaliseren</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>knop Maximaliseren</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>menu</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>menubalk</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>menuknop</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>opdracht</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>menunaam</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>berichtvak</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Minimaliseren</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>knop Minimaliseren</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>met gemengde waarden</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>modusgebonden</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>modi</target>
+ <definition>plural</definition>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>modus</target>
+ <definition>singular</definition>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>niet-modusgebonden</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>modificatietoets</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>muis</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Verplaatsen</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Hierheen verplaatsen</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>interface voor meerdere documenten</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>keuzelijst met meervoudige selectie</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Deze computer</target>
+ <definition>icon/pictogram</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Netwerkomgeving</target>
+ <definition>icon/pictogram</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Nieuw</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Volgende</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>object</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+ <definition>OLE (objecten koppelen en insluiten): voluit alleen in doc en Help</definition>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>slepen en neerzetten</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>slepen en neerzetten via OLE</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>ingesloten OLE-object</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>gekoppeld OLE-object</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>Aangepast slepen en neerzetten</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>Aangepast slepen en neerzetten via OLE</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Openen</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Openen met</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>keuzerondje</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>opties</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>OLE-pakket</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Pagina-instelling</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>paletvenster</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>deelvenster</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>hoofdvenster</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>wachtwoord</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Plakken</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Koppeling plakken</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Snelkoppeling plakken</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Plakken speciaal</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>pad</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Pauze</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Afspelen</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug en Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>aanwijzen</target>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>aanwijzer</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>pop-up-menu</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>pop-up-venster</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>staand</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>drukken op</target>
+ <definition>a key/een toets</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>ingedrukt houden</target>
+ <definition>and hold a mouse button/een muisknop</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>een muisknop ingedrukt houden</target>
+ <definition>and hold a mouse button</definition>
+</phrase>
+<phrase>
+ <source>press a mouse botton</source>
+ <target>een muisknop indrukken </target>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>primair hoofdobject</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>primair venster</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Afdrukken</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>printer</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>voortgangsindicator</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>project</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Eigenschappen</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>eigenschappenweergave</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>eigenschappenpagina</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>eigenschappenblad</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>besturingselement op een eigenschappenblad</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Snel weergeven</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>alleen-lezen</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Prullenbak</target>
+ <definition>Icon/pictogram</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Opnieuw</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>gebiedsselectie</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>het Register</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Herhalen</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Vervangen</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Vorig formaat</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>knop Vorig formaat</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Doorgaan</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Nogmaals</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>RTF-vak</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Uitvoeren</target>
+ <definition>Maar: macro starten</definition>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Opslaan</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Opslaan als</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>schuiven door</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>schuifpijl</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>schuifbalk</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>schuifblok</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>secundair venster</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>selecteren</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Alles selecteren</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>selectie</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>selectiegreep</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Kopiëren naar</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>scheidingsteken</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Instellingen</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Instellen</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Setup</target>
+ <definition>als het programma Setup wordt bedoeld</definition>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>snelkoppeling</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>snelkoppelingsknop</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>snelkoppelingspictogram</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>sneltoets</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>sneltoetsvak</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Weergeven</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Afsluiten</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>keuzelijst met enkelvoudige selectie</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Formaat wijzigen</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>formaatgreep</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>schuifregelaar</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>kringveld</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Splitsen</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>splitsbalk</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>splitsblokje</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>knop Start</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>map Opstarten</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>statusbalk</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Stoppen</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>tab</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>taakbalk</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>taakgeoriënteerde Help</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>sjabloon</target>
+ <definition>de</definition>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>tekstvak</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>titelbalk</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>venstertitel</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>wisseltoets</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>werkbalk</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>knopinfo</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>besturingselement voor structuurweergave</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>structuurweergave</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>typen</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>type</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>niet beschikbaar</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Ongedaan maken</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Installatie ongedaan maken</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>menu Beeld</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>direct bewerken</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>keuzelijst met grafische opties</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Wat is dit?</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>menu Venster</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>venster</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Windows Verkenner</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>wizard</target>
+ <definition>geen hoofdletter meer in lopende tekst</definition>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>werkmap</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>werkgroep</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>werkruimte</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Ja</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/finnish.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/finnish.qph
new file mode 100644
index 0000000..914c722
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/finnish.qph
@@ -0,0 +1,1033 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Tietoja</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>valintanäppäin</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>helppokäyttötoiminto</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>toimintokahva</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>aktiivinen</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>valinnan aktiivinen päätöskohta</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>aktiivinen objekti</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>aktiivinen ikkuna</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>graafinen lisäke</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Aina päällimmäisenä</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>ankkurikohta</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Käytä</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>automaattinen siirtyminen</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>automaattinen toisto</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>automaattinen linkki</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>automaattinen vieritys</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>automaattinen vieritys</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Takaisin</target>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Selaa</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Peruuta</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>alivalikko</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>valintaruutu</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>valintamerkki</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>ali-ikkuna</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>valita</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>napsautta</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Leikepöytä</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Sulje</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>sulkemispainike</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>tiivistää</target>
+ <definition>outline/jäsennys</definition>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>kutistaa</target>
+ <definition>outline/jäsennys</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>saraketunnus</target>
+ <definition>control/ohjausobjekti</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>sarakeotsikko</target>
+ <definition>control/ohjausobjekti</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>yhdistelmäruutu</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>painike</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>komento painike</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>säilö</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>tilannekohtainen ohje</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>tilannekohtainen</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>ohjausobjekti</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Kopioi</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Kopioi tähän</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Luo pikakuvake</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Luo pikakuvake tähän</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Leikkaa</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>oletus</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>oletuspainike</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Poista</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>työpöytä</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>kohde</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>valintaikkuna</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>invaliditeetti</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>hajavalinta</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>telakoida</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>tiedosto</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>asiakirja</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>kaksoisnapsauttaa</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>vetää</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>vetää ja pudottaa</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>avattava yhdistelmäruutu</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>avattava luetteloruutu</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>avattava valikko</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Muokkaa</target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>Muokkaa-valikko</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>kolme pistettä</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>upotettu objekti</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Lopeta</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>laajentaa</target>
+ <definition>an outline/jäsennys</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Selaa</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>laajennettu valinta</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>laajennettu valinta-luetteloruutu</target>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>tiedosto</target>
+</phrase>
+<phrase>
+ <source>File menu</source>
+ <target>Tiedosto-valikko</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Etsi</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Etsi seuraava</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Etsittävä</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>kansio</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>fontti</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>fonttikoko</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>fonttityyli</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>funktionäppäin</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>ryhmän kehys</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>kahva</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Ohje</target>
+</phrase>
+<phrase>
+ <source>Help menu</source>
+ <target>Ohje-valikko</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Piilota</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>hierarkkinen valinta</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>pitää painettuna</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>kohdepiste</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>kohdealue</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>kuvake</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>passiivinen</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>passiivinen ikkuna</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>syöttöalue</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>Lisää-valikko</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Lisää objekti</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>lisäyskohta</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>kursivoitu</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>otsikko</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>nimi</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>vaaka</target>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>linkki</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>linkittää</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Linkitä tähän</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>luetteloruutu</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>luettelonäyttö</target>
+ <definition>control/ohjausobjekti</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>manuaalinen linkki</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Suurenna</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>suurennuspainike</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>valikko</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>valikkorivi</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>valikkopainike</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>valikon vaihtoehto</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>valikon otsikko</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>sanomaruutu</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Pienennä</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>pienennyspainike</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>monitila</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>modaalinen</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>tila</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>ei-modaalinen</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>yhdistelmänäppäin</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>hiiri</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Siirrä</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Siirrä tähän</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>MDI-liittymä</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>monivalintainen luetteloruutu</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Oma tietokone</target>
+ <definition>icon/kuvake</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Verkkoympäristö</target>
+ <definition>icon/kuvake</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Uusi</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Seuraava</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>objekti</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>vedä ja pudota-OLE-toiminto</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>upotettu OLE-objekti</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>linkitetty OLE-objekti</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>käyttäjän määrittämä vedä ja pudota-OLE-toiminto</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Avaa</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Avaa sovelluksessa</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>valintanappi</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>valitsimen tila</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>pakkaus</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Sivun asetukset</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>valikoimaikkuna</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>ruutu</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>ylemmän tason ikkuna</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>salasana</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Liitä</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Liitä linkki</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Liitä pikakuvake</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Liitä määräten</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>polku</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Tauko</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Soita</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>piste</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>osoittaa</target>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>osoitin</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>pikavalikko</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>ponnahdusikkuna</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>pysty</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>painaa</target>
+ <definition>and hold a mouse button/ja pitää painettuna hiiripainiketta</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>painaa</target>
+ <definition>a key/näppäintä</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>ensisijainen säilö</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>ensisijainen ikkuna</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Tulosta</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>kirjoitin</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>tilanneilmaisin</target>
+ <definition>control/ohjausobjekti</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>projekti</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Ominaisuudet</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>ominaisuuksien tarkastelu</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>ominaisuusryhmä</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>ominaisuusikkuna</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>ominaisuusikkuna-ohjausobjekti</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Pikanäyttö</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>vain luku</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Roskakori</target>
+ <definition>Icon/kuvake</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Tee uudelleen</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>aluevalinta</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>rekisteri</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Toista</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Korvaa</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Palauta</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>palautuspainike</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Jatka</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Yritä uudelleen</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>monimuotoruutu</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Suorita</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Tallenna</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Tallenna nimellä</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>vierittää</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>vieritysnuoli</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>vierityspalkki</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>vieritysruutu</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>toissijainen ikkuna</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>valita</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Valitse kaikki</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>valinta</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>valintakahva</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Lähetä tiedosto</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>erotin</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Asetukset</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Asennus</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>pika-</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>pikapainike</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>pikakuvake</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>pikanäppäin</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>pikanäppäin-ohjausobjekti</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Näytä</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Sammuta</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>yksivalintainen luetteloruutu</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Muuta kokoa</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>koonmuuttokahva</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>liukusäädin</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>askellusruutu</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Jaa</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>jakopalkki</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>jakoruutu</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>Käynnistä-painike</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>Käynnistys-kansio</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>tilarivi</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Pysäytä</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>välilehti</target>
+ <definition>ohjausobjekti</definition>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>tehtäväpalkki</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>tehtäväohje</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>malli</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>muokkausruutu</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>otsikkorivi</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>otsikkoteksti</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>tilanvaihtonäppäin</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>työkalurivi</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>työkaluvihje</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>puunäyttö</target>
+ <definition>ohjausobjekti</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>tyyppi</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>laji</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>kirjoittaa</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>ei käytettävissä</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Kumoa</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Pura asennus</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>Näytä-valikko</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>visuaalinen muokkaus</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>graafisen valinnan ohjausobjekti</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Lisätietoja</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>Ikkuna-valikko</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>ikkuna</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Resurssienhallinta</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>ohjattu toiminto</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>työkirja</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>työryhmä</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>työtila</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Kyllä</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/french.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/french.qph
new file mode 100644
index 0000000..834f29b
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/french.qph
@@ -0,0 +1,1104 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>A propos</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>touche d&apos;accès rapide</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>accessibilité</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>handle d&apos;action</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>actif</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>active</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>point de fin de sélecion</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>objet actif</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>fenêtre activ</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>barre</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Toujours visible</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>point de début de sélection</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Appliquer</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>sortie automatique</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>répétition automatique</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>Liaison automatique</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>défilement automatique</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>défilement automatique</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Précédent</target>
+</phrase>
+<phrase>
+ <source>barrel button</source>
+ <target>Bouton du stylet</target>
+</phrase>
+<phrase>
+ <source>barrel-tap</source>
+ <target>toucher-maintenir enfoncé</target>
+</phrase>
+<phrase>
+ <source>boxed edit</source>
+ <target>édition contrôlée</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Parcourir</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Annuler</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>menu en cascade</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>case à cocher</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>coche</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>fenêtre enfant</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>choisir</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>cliquer sur</target>
+ <definition>verb, à l&apos;écran</definition>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>clic</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>cliquer le</target>
+ <definition>verb, bouton souris</definition>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Presse-papiers</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Fermer</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Fermeture</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>Fermer</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>réduire</target>
+ <definition>outline</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>en-tête de colonne</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>zone de liste modifiable</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>bouton de commande</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>conteneur</target>
+ <definition>d&apos;objets</definition>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>aide contextuelle</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>contextuelle</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>contextuel</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>contrôle</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Copier</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Copier ici</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Copier un raccourci</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Copier un raccourci ice</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Couper</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>par défaut</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>bouton par défaut</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Supprimer</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>bureau</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>destination</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>boîte de dialogue</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>incapacité</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>sélection d&apos;objets disjoints</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>aligner</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>document</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>cliquer deux fois</target>
+</phrase>
+<phrase>
+ <source>double-tap</source>
+ <target>toucher deux fois</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>faire glisser</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>glisser-déplacer</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>zone de liste déroulante modifiable</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>zone de liste déroulante fixe</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>menu déroulant</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Edition</target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>modifier</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>points de suspension</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>objet incorporé</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Quitter</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>développer</target>
+ <definition>an outline</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Explorer</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>sélection étendue</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>zone de liste à sélection étendue</target>
+</phrase>
+<phrase>
+ <source>File</source>
+ <target>Fichier</target>
+ <definition>menu</definition>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>fichier</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Rechercher</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Suivant</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Rechercher</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>dossier</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>police</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>taille de police</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>style de police</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>touche de fonction</target>
+</phrase>
+<phrase>
+ <source>gesture</source>
+ <target>signe</target>
+</phrase>
+<phrase>
+ <source>glyph</source>
+ <target>glyphe</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>zone de groupe</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>handle</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>?</target>
+ <definition>menu</definition>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Aide</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Masquer</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>sélection hiérarchique</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>maintenir</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>point d&apos;impact</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>zone critique</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>icône</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>inactive</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>inactif</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>fenêtre inactive</target>
+</phrase>
+<phrase>
+ <source>ink</source>
+ <target>dessin à main levée</target>
+</phrase>
+<phrase>
+ <source>ink edit</source>
+ <target>éditeur de dissin à main levée</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>zone d&apos;interaction</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>Insertion</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Insérer un objet</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>point d&apos;insertion</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>italique</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>nom de volume</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>étiquette</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>paysage</target>
+</phrase>
+<phrase>
+ <source>lasso-tap</source>
+ <target>toucher lasso</target>
+</phrase>
+<phrase>
+ <source>lens</source>
+ <target>loupe</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>lier</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>liaison</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Lier ici</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>zone de liste</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>presentación de iconos </target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>Liste icônes</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>liaison manuelle</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Agrandissement</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>agrandir</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>menu</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>barre de menus</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>bouton de menus</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>élément de menu</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>titre de menu</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>boîte de message</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Réduction</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>réduire</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>valeurs multiples</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>modal</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>mode</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>non modal</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>touche de modification</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>souris</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Déplacement</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Transférer ici</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>Interface documents multiples</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>zone de liste à sélection multiple</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Poste de travail</target>
+ <definition>icon</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Voisinage réseau</target>
+ <definition>icon</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Nouveau</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Suivant</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>objet</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>glisser-déplacer OLE</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>Objet OLE incorporé</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>Objet OLE lié</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>glisser-déplacer OLE non standard</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Ouvrir</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Ouvrir avec</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>case d&apos;option</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>état des caractéristiques</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>ensemble</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Mise en page</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>palette</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>volet</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>fenêtre tqparent</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>mot de passe</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Coller</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Coller avec liaison</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Coller le raccourci</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Collage spécial</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>chemin</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Pause</target>
+</phrase>
+<phrase>
+ <source>pen</source>
+ <target>stylet</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Exécuter</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>point</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>amener le pointeur sur</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>pointeur</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>menu autonome</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>fenêtre autonome</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>portrait</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>appuyer</target>
+ <definition>and hold a mouse button/et maintenir enfoncé</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>appuyer</target>
+ <definition>a key/sur une touche</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>contenuer principale</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>fenêtre principale</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Imprimer</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>imprimante</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>indicateur d&apos;état</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>projet</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Propriétés</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>inspecteur de propriétés</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>page de propriétés</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>feuille de propriétés</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>feuille de propriétés</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Aperçu</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>en lecture seule</target>
+</phrase>
+<phrase>
+ <source>recognition</source>
+ <target>reconnaissance</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Corbeille</target>
+ <definition>Icon</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Annuler Annuler</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>sélection par zone</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>base des registres</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Répéter</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Remplacer</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Restauration</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>Restaurer</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Reprendre</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Essayer de nouveau</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>zone de texte RTF</target>
+ <definition>Rich Text Format</definition>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Exécuter</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Enregistrer</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Enregistrer sous</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>faire défiler</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>flèche de défilement</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>barre de défilement</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>curseur de défilement</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>fenêtre secondaire</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>sélectionner</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Tout sélectionner</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>sélection</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>handle de sélection</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Envoyer vers</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>séparateur</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Paramètres</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Installation</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>INSTALL</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>raccourci</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>raccourci</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>raccourci</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>touche de raccourci</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>touche de raccourci</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Afficher</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Arrêter l&apos;ordinateur</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>zone de liste à sélection unique</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Dimension</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>poignée de redimensionnement</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>défileur</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>compteur</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Fractionner</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>barre de fractionnement</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>curseur de fractionnement</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>Démarrer</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>dossier de démarrage</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>barre d&apos;état</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Arrêter</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>onglet</target>
+</phrase>
+<phrase>
+ <source>tap</source>
+ <target>toucher</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>barre des tâches</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>aide spécifique aux tâches</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>modèle</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>zone de texte</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>barre de titre</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>texte de la barre de titre</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>touche bascule</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>barre d&apos;outils</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>info-bulle</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>arborescencel</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>type</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>taper</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>pas disponible</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Annuler</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Désinstaller</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>Affichage</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>activation sur place</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>sélection graphique</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Qu&apos;est-ce que c&apos;est?</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>Fenêtre</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>fenêtre</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Explorateur Windows</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>assistant</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>classeur</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>groupe de travail</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>espace de travail</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Oui</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/german.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/german.qph
new file mode 100644
index 0000000..be8d30d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/german.qph
@@ -0,0 +1,1075 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Info</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>Zugriffstaste</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>Eingabehilfe</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>Aktionspunkt</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>Aktiv</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>Aktives Ende</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>Aktives Objekt</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>Aktives Fenster</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>Zubehör</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Immer im Vordergrund</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>Ankerpunkt</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Zuweisen</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>Textfeld mit automatischer Freigabe</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>Automatische Wiederholung</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>Automatische OLE-Verknüpfung</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>Automatischer Bildlauf</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>Automatischer Bildlauf</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Zurück</target>
+</phrase>
+<phrase>
+ <source>barrel button</source>
+ <target>Pen-Knopf</target>
+ <definition>pen</definition>
+</phrase>
+<phrase>
+ <source>barrel-tap</source>
+ <target>Tippen mit Pen-Knopf</target>
+</phrase>
+<phrase>
+ <source>boxed edit</source>
+ <target>Texteditor</target>
+ <definition>control/Steuerelement</definition>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Durchsuchen</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Abbrechen</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>Überlappendes Menü</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>Kontrollkästchen</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>Markierung</target>
+ <definition>Kontrollkästchen</definition>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>Untergeordnetes Fenster</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>Wählen</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>Klicken</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Zwischenablage</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Schließen</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>Schließen</target>
+ <definition>Schaltfläche</definition>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>Ausblenden</target>
+ <definition>outline/Gliederung</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>Spaltenüberschrift</target>
+ <definition>control/Steuerelement</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>Kombinationsfeld</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>Schaltfläche</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>Container</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>Kontextbezogene Hilfe</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>Kontextbezogen</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>Steuerelement</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Kopieren</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Hierher kopieren</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Verknüpfung erstellen</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Hiermit verknüpfen</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Ausschneiden</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>Standard</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>Standardschaltfläche</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Löschen</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>Desktop</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>Ziel</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>Dialogfeld</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>Behinderung</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>Nichtzusammenhängende Auswahl</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>Verankern</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>Dokument</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>Doppelklicken</target>
+</phrase>
+<phrase>
+ <source>double-tap</source>
+ <target>Doppeltippen</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>Ziehen</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>Drag &amp; Drop</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>Dropdown-Kombinationsfeld</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>Dropdown-Listenfeld</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>Dropdown-Menü</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Bearbeiten</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Bearbeiten</target>
+ <definition>menu/Menü</definition>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>Auslassungspunkte</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>Eingebettetes</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Beenden</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>Einblenden</target>
+ <definition>an outline/einer Struktur</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Explorer</target>
+ <definition>Befehl</definition>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>Erweiterte Auswahl</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>Listenfeld für erweiterte Auswahl</target>
+</phrase>
+<phrase>
+ <source>File</source>
+ <target>Datei</target>
+ <definition>menu</definition>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>Datei</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Suchen</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Weitersuchen</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Suchen nach</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>Ordner</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>Schriftart</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>Schriftgrad</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>Schriftschnitt</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>Funktionstaste</target>
+</phrase>
+<phrase>
+ <source>gesture</source>
+ <target>Schriftzug</target>
+</phrase>
+<phrase>
+ <source>glyph</source>
+ <target>Zeichen</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>Gruppenfeld</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>Ziehpunkt</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>?</target>
+ <definition>menu</definition>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Hilfe</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Ausblenden</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>Hierarchische Auswahl</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>Halten</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>Hot Spot</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>Hot Zone</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>Symbol</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>Inaktiv</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>Inaktives Fenster</target>
+</phrase>
+<phrase>
+ <source>ink</source>
+ <target>Ink</target>
+</phrase>
+<phrase>
+ <source>ink edit</source>
+ <target>Inkeditor</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>Eingabefokus</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>Einfügen</target>
+ <definition>Menü</definition>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Objekt einfügen</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>Einfügemarke</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>Kursiv</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>Bezeichnung</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>Querformat</target>
+</phrase>
+<phrase>
+ <source>lasso-tap</source>
+ <target>Lasso-tippen</target>
+</phrase>
+<phrase>
+ <source>lens</source>
+ <target>Lupe</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>Verknüpfung</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>Verknüpfen</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Hiermit verknüpfen</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>Listenfeld</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>Listenansicht</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>Manuelle OLE-Verknüpfung</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Maximieren</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>Maximieren</target>
+ <definition>Schaltfläche</definition>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>Menü</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>Menüleiste</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>Menü</target>
+ <definition>Schaltfläche</definition>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>Menüelement</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>Menütitel</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>Meldungsfeld</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Minimieren</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>Minimieren</target>
+ <definition>Schaltfläche</definition>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>Gemischt</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>Modal</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>Modus</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>Interaktiv</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>Zusatztaste</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>Maus</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Verschieben</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Hierher verschieben</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>MDI</target>
+ <definition>Multiple Document Interface</definition>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>Listenfeld für Mehrfachauswahl</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Arbeitsplatz</target>
+ <definition>icon/Symbol</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Netzwerk</target>
+ <definition>icon/Symbol</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Neu</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Weiter</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>Objekt</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>OLE-Drag &amp; Drop</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>Eingebettetes OLE-Objekt</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>Verknüpftes OLE-Objekt</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>Vom Standard abweichendes OLE-Drag &amp; Drop</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>Aangepast slepen en neerzetten via OLE</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Öffnen</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Öffnen mit</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>Optionsfeld</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>Aktivierte Option</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>Paket</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Seite einrichten</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>Palettenfenster</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>Fensterbereich</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>Übergeordnetes Fenster</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>Kennwort</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Einfügen</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Verknüpfung einfügen</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Verknüpfung einfügen</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Inhalte einfügen</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>Pfad</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Anhalten</target>
+</phrase>
+<phrase>
+ <source>pen</source>
+ <target>Pen</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Wiedergeben</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug &amp; Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>Zeigen</target>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>Zeiger</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>Kontextmenü</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>Popup-Fenster</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>Hochformat</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>Drücken</target>
+ <definition>and hold a mouse button/und Halten einer Maustaste</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>Drücken</target>
+ <definition>a key/einer Taste</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>Primär-Container</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>Primärfenster</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Drucken</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>Drucker</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>tqStatusanzeige</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>Projekt</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Eigenschaften</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>Eigenschaftenanzeige</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>Eigenschaftengruppe</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>Eigenschaftenfenster</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>Eigenschaftenfenster-Steuerelement</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Schnellansicht</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>Schreibgeschützt</target>
+</phrase>
+<phrase>
+ <source>recognition</source>
+ <target>Schrifterkennung</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Papierkorb</target>
+ <definition>Icon/Symbol</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Wiederherstellen</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>Bereichsauswahl</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>Registrierung</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Wiederholen</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Ersetzen</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Wiederherstellen</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>Wiederherstellen </target>
+ <definition>Schaltfläche</definition>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Fortsetzen</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Wiederholen</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>RTF-Textfeld</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Ausführen</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Speichern</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Speichern unter</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>Bildlauf durchführen</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>Bildlaufpfeil</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>Bildlaufleiste</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>Bildlauffeld</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>Sekundärfenster</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>Auswählen</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Alle markieren</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>Auswahl</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>Auswahlpunkt</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Senden an</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>Trennelement</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Einstellungen</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Einrichten</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>Verknüpfung</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>Verknüpfte Schaltfläche</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>Verknüpfungssymbol</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>Tastenkombination</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>Steuerelement für Tastenbelegung</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Anzeigen</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Beenden</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>Listenfeld für Einfachauswahl</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Größe ändern</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>Element für Größenänderung</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>Schieber</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>Drehfeld</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Teilen</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>Fensterteiler</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>Teilungsfeld</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>Start</target>
+ <definition>Schaltfläche</definition>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>Autostart</target>
+ <definition>Ordner</definition>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>tqStatusleiste</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Beenden</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>Register</target>
+</phrase>
+<phrase>
+ <source>tap</source>
+ <target>Tippen</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>Task-Leiste</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>Vorgangsbezogene Hilfe</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>Vorlage</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>Textfeld</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>Titelleiste</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>Titeltext</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>Ein-/Aus-Taste</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>Symbolleiste</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>QuickInfo</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>Strukturansicht</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>Eingeben</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>Typ</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>Nicht verfügbar</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Rückgängig</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Deinstallieren</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>Ansicht</target>
+ <definition>Menü</definition>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>Direkte Bearbeitung</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>Steuerelement zur Grafikanzeige</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Direkthilfe</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>Fenster</target>
+ <definition>Menü</definition>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>Fenster</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Explorer</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>Assistent</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>Arbeitsmappe</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>Arbeitsgruppe</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>Arbeitsbereich</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Ja</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/italian.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/italian.qph
new file mode 100644
index 0000000..534214d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/italian.qph
@@ -0,0 +1,1105 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Informazioni su</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>tasto di scelta</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>accesso facilitato</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>identificatore dell&apos;azione</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>attivo</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>punto finale</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>oggetto attivo</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>finestra attiva</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>barra</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Sempre in primo piano</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>punto di ancoraggio</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Applica</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>ad uscita automatica</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>a ripetizione automatica</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>collegamento automatico</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>scorrimento automatico</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>scorrimento automatico</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Indietro</target>
+</phrase>
+<phrase>
+ <source>barrel button</source>
+ <target>pulsante della penna</target>
+ <definition>pen</definition>
+</phrase>
+<phrase>
+ <source>barrel-tap</source>
+ <target>tocco con il pulsante premuto</target>
+</phrase>
+<phrase>
+ <source>boxed edit</source>
+ <target>casella di testo a griglia</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Sfoglia</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Annulla</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>menu sovrapposto</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>casella di controllo</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>segno di spunta</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>finestra secondaria</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>scegliere</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>fare clic</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Appunti</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Chiudi</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>pulsante di chiusura</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>comprimere</target>
+ <definition>outline, verb</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>intestazione di colonna</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>casella combinata</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>pulsante di comando</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>contenitore</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>guida sensibile al contesto</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>contestuale</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>controllo</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Copia</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Copia</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Crea collegamento</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Crea collegamento</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Taglia</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>predefinito</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>pulsante predefinito</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Elimina</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>desktop</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>destinazione</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>finestra di dialogo</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>disabilità</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>selezione multipla</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>posizionare</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>documento</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>doppio clic</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>fare doppio clic</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>double-tap</source>
+ <target>toccare due volte in rapida successione</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>double-tap</source>
+ <target>doppio tocco</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>trascinare</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>trascinare e rilasciare</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>caratteristica Trascina selezione</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>casella combinata a discesa</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>casella di riepilogo a discesa</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>menu a discesa</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Modifica </target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>menu Modifica</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>puntini di sospensione</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>oggetto incorporato</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Esci</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>espandere</target>
+ <definition>an outline/una struttura</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Gestione risorse</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>selezione estesa</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>casella di riepilogo a selezione estesa</target>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>file</target>
+</phrase>
+<phrase>
+ <source>File menu</source>
+ <target>menu File</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Trova</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Trova successivo</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Trova</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>cartella</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>tipo di carattere</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>dimensione carattere</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>stile carattere</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>tasto funzione</target>
+</phrase>
+<phrase>
+ <source>gesture</source>
+ <target>segno</target>
+</phrase>
+<phrase>
+ <source>glyph</source>
+ <target>icona</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>casella di gruppo</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>quadratino di ridimensionamento </target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Guida</target>
+</phrase>
+<phrase>
+ <source>Help menu</source>
+ <target>menu ?</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Nascondi</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>selezione gerarchica</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>tenere premuto</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>area sensibile del puntatore</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>area sensibile dell&apos;oggetto</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>icona</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>inattivo</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>finestra inattiva</target>
+</phrase>
+<phrase>
+ <source>ink</source>
+ <target>tratto</target>
+</phrase>
+<phrase>
+ <source>ink edit</source>
+ <target>modifica tratto</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>elemento attivo</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>menu Inserisci</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Inserisci oggetto</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>punto di inserimento</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>corsivo</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>etichetta</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>orizzontale</target>
+</phrase>
+<phrase>
+ <source>lasso-tap</source>
+ <target>selezione circolare</target>
+</phrase>
+<phrase>
+ <source>lens</source>
+ <target>lente</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>collegamento</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>collegare</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Collega</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>casella di riepilogo</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>visualizzazione elementi</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>collegamento manuale</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Ingrandisci</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>pulsante di ingrandimento</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>menu</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>barra dei menu</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>pulsante menu</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>voce di menu</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>titolo di menu</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>finestra di messaggio</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Riduci a icona</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>pulsante di riduzione ad icona</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>valori misti</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>a scelta obbligatoria</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>modalità</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>non a scelta obbligatoria</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>tasto di modifica delle funzioni di tastiera</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>tasto di modifica dell&apos;output di tastiera</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>mouse</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Sposta</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Sposta</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>interfaccia a documenti multipli</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>casella di riepilogo a selezione multipla</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Risorse del computer</target>
+ <definition>icon/icono</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Risorse di rete</target>
+ <definition>icon</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Nuovo</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Avanti</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>oggetto</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>caratteristica Trascina selezione</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>oggetto incorporato OLE</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>oggetto collegato OLE</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>caratteristica Trascina selezione OLE non predefinita</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Apri</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Apri con</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>pulsante di opzione</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>opzione impostata</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>opzione attivata</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>package</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Imposta pagina</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>casella degli tavolozza di colori</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>casella degli strumenti</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>riquadro</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>finestra principale</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>password</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Incolla </target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Incolla collegamento</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Incolla collegamento</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Incolla speciale</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>percorso</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Interrompi</target>
+</phrase>
+<phrase>
+ <source>pen</source>
+ <target>penna</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Riproduci</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>punto</target>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>puntatore</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>menu di scelta rapida</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>finestra popup</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>verticale</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>premere</target>
+ <definition>a key/un tasto</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>premere</target>
+ <definition>and hold a mouse button/e tenere premuto un pulsante del mouse</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>contenitore principale</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>finestra principale</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Stampa</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>stampante</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>indicatore di avanzamento del processo</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>progetto</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Proprietà</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>visualizzatore proprietà</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>scheda proprietà</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>finestra proprietà</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>controllo finestra proprietà</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Anteprima</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>sola lettura</target>
+</phrase>
+<phrase>
+ <source>recognition</source>
+ <target>riconoscimento</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Cestino</target>
+ <definition>Icon</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Ripeti</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>selezione dell&apos;area</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>registro di configurazione</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Ripeti</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Sostituisci</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Ripristina</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>pulsante di ripristino</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Riprendi</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Riprova</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>casello di testo RTF</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Esegui</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Salva</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Salva con nome</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>scorrere</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>freccia di scorrimento</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>barra di scorrimento</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>casella di scorrimento</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>finestra secondaria</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>selezionare</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Seleziona tutto</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>selezione</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>quadratino di selezione</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Invia a</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>separatore</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Impostazioni</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Imposta</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>collegamento</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>pulsante di collegamento</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>icona di collegamento</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>tasto di scelta rapida</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>controllo tasto di scelta rapida</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Mostra</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Chiudi sessione</target>
+ <definition>comando del menu Avvio</definition>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Arresta il sistema</target>
+ <definition>pulsanti e opzioni</definition>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>casella di riepilogo a selezione singola</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Dimensione</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>punto di ridimensionamento</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>dispositivo di scorrimento</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>casella di selezione</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Dividi</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>barra di divisione</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>casella di divisione</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>pulsante Avvio</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>cartella Esecuzione automatica</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>barra di stato</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Ferma</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>controllo a schede</target>
+</phrase>
+<phrase>
+ <source>tap</source>
+ <target>toccare</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>tap</source>
+ <target>tocco</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>barra delle applicazioni</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>guida orientata alle attività</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>modello</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>casella di testo</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>barra del titolo</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>testo della barra del titolo</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>tasto interruttore</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>barra degli strumenti</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>descrizione comando</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>controllo per la visualizzazione ad albero</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>inserire</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>digitare</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>tipo</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>non disponibile</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Annulla</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Rimozione</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>menu Visualizza</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>modifica diretta</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>controllo di selezione grafica</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Guida rapida</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>menu Finestra</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>finestra</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Gestione risorse</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>installazione guidata</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>cartella di lavoro</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>gruppo di lavoro</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>area di lavoro</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Sì</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/norwegian.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/norwegian.qph
new file mode 100644
index 0000000..ca16dbc
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/norwegian.qph
@@ -0,0 +1,1004 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Om</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>tilgangstast</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>tilgjengelighet</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>handlingshåndtak</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>aktiv</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>markeringsavslutning</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>aktivt objekt</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>aktivt vindu</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>verktøyselement</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Alltid øverst</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>forankringspunkt</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Bruk</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>automatisk avslutning</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>automatisk gjentagelse</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>automatisk kobling</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>automatisk rulling</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>autorulling</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Tilbake</target>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Bla gjennom</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Avbryt</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>undermeny</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>avmerkingsboks</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>merke</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>undervindu</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>velge</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>klikke</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>utklippstavle</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Lukk</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>lukkeknapp</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>skjule</target>
+ <definition>outline/disposisjon</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>kolonneoverskrift</target>
+ <definition>control/kontroll</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>kombinasjonsboks</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>kommandoknapp</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>beholder</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>kontekstavhengig hjelp</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>kontekstavhengig</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>kontroll</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Kopier</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Kopier hit</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Lag snarvei</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Lag snarvei her</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Klipp ut</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>standard</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>standardknapp</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Slett</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>skrivebord</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>mål</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>dialogboks</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>funksjonshemning</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>ikke sammenhengende utvalg</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>forankre</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>dokument</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>dobbeltklikke</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>dra</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>dra och slippe</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>kombinasjonsboks</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>rullegardinliste</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>rullegardinmeny</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Rediger</target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>Rediger-menyen</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>ellipse</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>innebygd objekt</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Avslutt</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>utvide</target>
+ <definition>an outline/en disposisjon</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Utforsk</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>utvidet merking</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>liste med utvidet merking</target>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>fil</target>
+</phrase>
+<phrase>
+ <source>File menu</source>
+ <target>Fil-menyen</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Søk etter</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Søk etter neste</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Søk etter</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>mappe</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>skrift</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>skriftstørrelse</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>skriftstil</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>funksjonstast</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>gruppeboks</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>håndtak</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Hjelp</target>
+</phrase>
+<phrase>
+ <source>Help menu</source>
+ <target>Hjelp-menyen</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Skjul</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>hierarkisk merking</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>holde</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>fokus</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>fokuseringssone</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>ikon</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>inaktiv</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>inaktivt vindu</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>indatafokus</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>Sett inn-menyen</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Sett inn objekt</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>innsettingspunkt</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>kursiv</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>etikett</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>liggende</target>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>koble</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>kobling</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Lag kobling her</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>listeboks</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>listevisning</target>
+ <definition>control/kontroll</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>manuell kobling</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Maksimer</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>maksimeringsknapp</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>meny</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>menylinje</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>menyknapp</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>menyelement</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>menytittel</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>meldingsboks</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Minimer</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>minimeringsknapp</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>blandet verdi</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>modal</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>modus</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>icke-modal</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>modifiseringstast</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>mus</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Flytt</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Flytt hit</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>flerdokumentgrensesnitt</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>flervalgsliste</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Min datamaskin</target>
+ <definition>icon/ikon</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Andre maskiner</target>
+ <definition>icon/ikon</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Ny</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Neste</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>objekt</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>OLE dra og slipp</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>innebyggd OLE-objekt</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>koblet OLE-objekt</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>utvidet OLE dra og slipp</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Åpne</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Åpne i</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>alternativknapp</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>valgt alternativ</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>pakke</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Utskriftsformat</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>palettvindu</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>rute</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>hovedvindu</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>passord</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Lim inn</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Lim inn kobling</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Lim inn snarvei</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Lim inn utvalg</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>bane</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Pause</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Spill</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>punkt</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>peke</target>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>peker</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>hurtigmeny</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>forklaringsvindu</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>stående</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>klikke</target>
+ <definition>and hold a mouse button/og holde nede en musetast</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>trykke</target>
+ <definition>a key/en tast</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>primærbeholder</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>primærvindu</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Skriv ut</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>skriver</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>fremdriftsindikator</target>
+ <definition>control/kontroll</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>prosjekt</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Egenskaper</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>egenskapsvisning</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>egenskapsside</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>egenskapsark</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>egenskapsarkkontroll</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Hurtigvisning</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>skrivebeskyttet</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Papirkurv</target>
+ <definition>Icon/ikon</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Gjør om</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>områdemerking</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>register</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Gjenta</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Erstatt</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Gjenopprett</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>gjenopprettingsknapp</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Fortsett</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Prøv på nytt</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>boks for rik tekst</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Kjør</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Lagre</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Lagre som</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>rulle</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>rullepil</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>rullefelt</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>rulleboks</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>sekundærvindu</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>merke</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Merk alt</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>merket område</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>markeringshåndtak</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Send til</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>skilletegn</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Innstillinger</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Installasjon</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>snarvei</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>snarveisknapp</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>snarveisikon</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>hurtigtast</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>hurtigtastkontroll</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Vis</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Avslutt</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>enkeltvalgsliste</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Størrelse</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>skaleringshåndtak</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>glidebryter</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>verdisettingsboks</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Del</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>delelinje</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>deleboks</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>startknapp</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>Oppstart-mappen</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>statuslinje</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Stopp</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>kategorikontroll</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>oppgavelinje</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>oppgaveorientert hjelp</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>mal</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>tekstboks</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>tittellinje</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>titteltekst</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>veksletast</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>verktøylinje</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>verktøytips</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>trevisningskontroll</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>skrive</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>type</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>ikke tilgjengelig</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Angre</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Avinstaller</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>Vis-meny</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>visuell redigering</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>grafikkontroll</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Hva er dette?</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>Vindu-menyen</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>vindu</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Windows Utforsker</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>veiviser</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>arbeidsbok</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>arbeidsgruppe</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>arbeidsområde</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Ja</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/russian.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/russian.qph
new file mode 100644
index 0000000..5bb2503
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/russian.qph
@@ -0,0 +1,982 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>О программе</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>горячая клавиша</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>удобство</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>управление поведением</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>активный</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>окончание выбора</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>активный объект</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>активное окно</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>украшение</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Всегда наверху</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>точка начала выбора</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Применить</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>автоматический выход</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>авто-повтор</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>автоматическое связывание</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>автоматическая прокрутка</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>авто-прокрутка</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Назад</target>
+</phrase>
+<phrase>
+ <source>boxed edit</source>
+ <target>окно редактирования</target>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Обзор</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Отмена</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>ниспадающее меню</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>флажок</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>флажок</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>дочернее окно</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>выбрать</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>щелчок</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Буфер обмена</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Закрыть</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>кнопка закрытия</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>крах</target>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>заголовок колонки</target>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>поле со списком</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>кнопка</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>контейнер</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>контекстная помощь</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>контекстный</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>элемент управления</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Копировать</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Копировать сюда</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Создать ярлык</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Создать ярлык здесь</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Вырезать</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>по умолчанию</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>кнопка по умолчанию</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Удалить</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>рабочий стол</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>цель</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>окно диалога</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>неспособность</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>разделить выбранные элементы</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>док</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>документ</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>двойной щелчок</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>перетащить</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>drag-and-drop</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>раскрыть поле со списком</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>прокрутить список</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>открыть меню</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Правка</target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>меню Правка</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>эллипс</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>встроенный объект</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Выход</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>расширять</target>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Исследовать</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>расширенный выбор</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>список с расширенным выбором</target>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>файл</target>
+</phrase>
+<phrase>
+ <source>File menu</source>
+ <target>меню Файл</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Поиск</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Продолжить поиск</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Поиск</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>каталог</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>шрифт</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>размер шрифта</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>стиль шрифта</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>функциональная клавиша</target>
+</phrase>
+<phrase>
+ <source>glyph</source>
+ <target>глиф</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>контейнер элементов</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>управление</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Справка</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Скрыть</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>иерархический выбор</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>удерживать</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>фокус</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>активная зона</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>пиктограмма</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>неактивный</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>неактивное окно</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>фокус ввода</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>Вставить</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Вставить объект</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>место вставки</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>курсив</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>надпись</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>альбом</target>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>ссылка</target>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>связать</target>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Создать ссылку здесь</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>список</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>древовидный список</target>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>ручное связывание</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Распахнуть</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>кнопка максимизации</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>меню</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>строка меню</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>кнопка меню</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>элемент меню</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>заголовок меню</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>окно сообщений</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Свернуть</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>кнопка минимизации</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>модальный</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>режим</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>немодальный</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>клавиша-модификатор</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>мышь</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Переместить</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Переместить сюда</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>Multiple Document Interface</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>список с множественным выбором</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Мой компьютер</target>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Сетевое окружение</target>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Новый</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Следующий</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>объект</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>OLE-механизм</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>внедренный OLE-объект</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>связанный OLE-объект</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>предопределенный OLE-механизм</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Открыть</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Открыть с помощью</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>переключатель</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>набор параметров</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>пакет</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>шаг установки</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>окно выбора палитры</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>панель</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>родительское окно</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>пароль</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Вставить</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Вставить ссылку</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Вставить ярлык</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Специальная вставка</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>путь</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Пауза</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Воспроизведение</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>пункт</target>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>указатель</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>всплывающее меню</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>всплывающее окно</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>портрет</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>нажимать</target>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>корневой контейнер</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>главное окно</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Печать</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>принтер</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>индикатор хода процесса</target>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>проект</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Свойства</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>инспектор свойств</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>страница свойств</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>группа свойств</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>управление группой свойств</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Быстрый просмотр</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>только чтение</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Корзина</target>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Повторить</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>область выделения</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>реестр</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Повторить</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Заменить</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Восстановить</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>Кнопка восстановления</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Продолжить</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Повторить</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>окно RTF-редактора</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Выполнить</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Сохранить</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Сохранить как</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>прокрутить</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>кнопка прокрутки</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>полоса прокрутки</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>окно с полосами прокрутки</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>подчиненное окно</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>выбрать</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Выделить все</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>выбор</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>осуществление выбора</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Отправить</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>разделитель</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Настройки</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Установить</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>ярлык</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>кнопка</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>пиктограмма</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>комбинация клавиш</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>настройка комбинации клавиш</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Показать</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Выключение</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>список с одиночным выбором</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Размер</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>уголок для изменения размера</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>ползунок</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>поле со счетчиком</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Разделить</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>разделительная черта</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>разделительная рамка</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>кнопка Пуск</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>каталог Автозапуска</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>статусная строка</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Стоп</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>вкладка</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>панель задач</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>контекстная справка</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>шаблон</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>текстовое поле</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>заголовок</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>текст заголовка</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>кнопка-выключатель</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>панель инструментов</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>всплывающая подсказка</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>древовидный список</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>тип</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>набирать</target>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>недоступный</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Отменить</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Удалить</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>Вид</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>визуальное редактирование</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>элемент графического интерфейса</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Что это?</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>Окно</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>окно</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Проводник Windows</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>мастер</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>учебник</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>рабочая группа</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>рабочая область</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Да</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/spanish.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/spanish.qph
new file mode 100644
index 0000000..8c21be6
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/spanish.qph
@@ -0,0 +1,1086 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Acerca de</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>tecla de acceso</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>accesibilidad</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>controlador de acciones</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>activo</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>fin de la selección activa</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>objeto activo</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>ventana activa</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>opción gráfica</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Siempre visible</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>inicio de la selección activa</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Aplicar</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>salida automática</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>repetición automática</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>vínculo automático</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>desplazamiento automático</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>desplazamiento automático</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Atrás</target>
+</phrase>
+<phrase>
+ <source>barrel button</source>
+ <target>botón del lápiz</target>
+ <definition>pen</definition>
+</phrase>
+<phrase>
+ <source>barrel-tap</source>
+ <target>puntenar con el botón presionado</target>
+</phrase>
+<phrase>
+ <source>boxed edit</source>
+ <target>edición en casilla</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Examinar</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Cancelar</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>menú en cascada</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>casilla de verificación</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>marca de verificación</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>ventana secundaria</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>elegir</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>hacer clic</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Portapapeles</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Cerrar</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>botón &amp;quot;Cerrar&amp;quot;</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>contraer</target>
+ <definition>outline/esquerna</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>encabezado de columna</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>cuadro combinado</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>botón de comando</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>contenedor</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>ayuda interactiva</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>contextual</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>control</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Copiar</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Copiar aquí</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Crear acceso directo</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Crear acceso directo aquí</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Cortar</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>predeterminado</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>botón predeterminado</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Eliminar</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>escritorio</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>destino</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>cuadro de diálogo</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>Discapacidades</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>selección disjunta</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>acoplar</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>documento</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>hacer doble clic</target>
+</phrase>
+<phrase>
+ <source>double-tap</source>
+ <target>puntear dos veces</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>arrastrar</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>arrastrar y colocar</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>cuadro combinado desplegable</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>cuadro de lista desplegable</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>menú desplegable</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Edición</target>
+</phrase>
+<phrase>
+ <source>Edit menu</source>
+ <target>menú Edición</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>puntos suspensivos</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>objeto incrustado</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Salir</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>expandir</target>
+ <definition>an outline/un esquema</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Explorar</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>selección extendida</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>cuadro de lista de selección extendida</target>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>archivo</target>
+</phrase>
+<phrase>
+ <source>File menu</source>
+ <target>menú Archivo</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Buscar</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Buscar siguiente</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Buscar</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>carpeta</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>fuente</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>tamaño de fuente</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>estilo de fuente</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>tecla de función</target>
+</phrase>
+<phrase>
+ <source>gesture</source>
+ <target>signo</target>
+</phrase>
+<phrase>
+ <source>glyph</source>
+ <target>símbolo gráfico</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>cuadro de grupo</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>controlar</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>controlador</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Ayuda</target>
+</phrase>
+<phrase>
+ <source>Help menu</source>
+ <target>menú Ayuda</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Ocultar</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>selección jerárquica</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>mantener presionado</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>punto interactivo</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>zona interactiva</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>icono</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>inactivo</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>ventana inactiva</target>
+</phrase>
+<phrase>
+ <source>ink</source>
+ <target>trazo</target>
+</phrase>
+<phrase>
+ <source>ink edit</source>
+ <target>editor de trazos</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>zona de entrada</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>zona de entrada de datos</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>menú Insertar</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Insertar objeto</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>punto de inserción</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>cursiva</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>etiqueta</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>horizontal</target>
+</phrase>
+<phrase>
+ <source>lasso-tap</source>
+ <target>punteo en la selección</target>
+</phrase>
+<phrase>
+ <source>lens</source>
+ <target>lente</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>vincular</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>vínculo</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Vincular aquí</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>cuadro de lista</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>ver lista</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>presentación de iconos </target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>vínculo manual</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Maximizar</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>botón de maximizar</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>menú</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>barra de menús</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>botón de menú</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>elemento de menú</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>título de menú</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>cuadro de mensaje</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Minimizar</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>botón de minimizar</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>valores mezclados</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>modal</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>modo</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>sin modo</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>tecla modificadora</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>mouse</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Mover</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Mover aquí</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>interfaz de documentos múltiples</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>cuadro de lista de selección múltiple</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Mi PC</target>
+ <definition>icon/icono</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Entorno de red</target>
+ <definition>icon/icono</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Nuevo</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Sigulente</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>objeto</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>Aceptar</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>Arrastrar y colocar de OLE</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>Objeto incrustado de OLE</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>Objeto vinculado de OLE</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>Arrastrar y colocar no predeterminado de OLE</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Abrir</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Abrir con</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>botón de opción</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>opción establecida</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>paquete</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Preparar página</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>ventana de paleta</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>panel</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>ventana principal</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>contraseña</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Pegar</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Pegar vínculo</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Pegar acceso directo</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Pegado especial</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>ruta de acceso</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Pausa</target>
+</phrase>
+<phrase>
+ <source>pen</source>
+ <target>lápiz</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Reproducir</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>señalar</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>punto</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>puntero</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>menú emergente</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>ventana emergente</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>vertical</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>presionar</target>
+ <definition>and hold a mouse button/y mantener presionado un botón del mouse</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>presionar</target>
+ <definition>a key/una tecla</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>contenedor primario</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>ventana principal</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Imprimir</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>impresora</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>indicador de progreso</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>proyecto</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Propiedades</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>monitor de propiedades</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>página de propiedades</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>hoja de propiedades</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>control de la hoja de propiedades</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Vista rápida</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>sólo lectura</target>
+</phrase>
+<phrase>
+ <source>recognition</source>
+ <target>reconocimiento</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Papelera de reciclaje</target>
+ <definition>Icon/icono</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Rehacer</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>selección de área</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>Registro de configuraciones</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Repetir</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Reemplazar</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Restaurar</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>botón &amp;quot;Restaurar&amp;quot;</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Reanudar</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Reintentar</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>cuadro de texto enriquecido</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Ejecutar</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Guardar</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Guardar como</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>desplazar</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>flecha de desplazamiento</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>barra de desplazamiento</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>cuadro de desplazamiento</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>ventana secundaria</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>seleccionar</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Seleccionar todo</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>selección</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>controlador de selección</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Enviar a</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>separador</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Configuración</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Configurar</target>
+ <definition>for a tqdevice already installed</definition>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Instalar</target>
+ <definition>for an application</definition>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>acceso directo</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>botón de acceso directo</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>icono de acceso directo</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>tecla de método abreviado</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>control de la tecla de método abreviado</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Mostrar</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Apagar el sistema</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>cuadro de lista de selección simple</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Tamaño</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>ajuste de tamaño</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>control deslizante</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>cuadro selector</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Dividir</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>barra de división</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>cuadro de división</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>botón &amp;quot;Inicio&amp;quot;</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>carpeta Inicio</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>barra de estado</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Detener</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>control de fichas</target>
+</phrase>
+<phrase>
+ <source>tap</source>
+ <target>puntear</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>barra de tareas</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>Ayuda relativa a la tarea</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>plantilla</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>cuadro de texto</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>barra de título</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>texto de título</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>tecla para alternar</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>barra de herramientas</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>sugerencias</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>control de visión en árbol</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>escribir</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>tipo</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>no disponible</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Deshacer</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Desinstalar</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>menú Ver</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>edición visual</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>control de opciones gráficas</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>¿Qué es esto?</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>menú Ventana</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>ventana</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Explorador de Windows</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>asistente</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>libro</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>libro de trabajo</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>grupo de trabajo</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>área de trabajo</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Sí</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/phrasebooks/swedish.qph b/tqtinterface/qt4/tools/linguist/phrasebooks/swedish.qph
new file mode 100644
index 0000000..4093175
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/phrasebooks/swedish.qph
@@ -0,0 +1,1010 @@
+<!DOCTYPE QPH><QPH>
+<phrase>
+ <source>About</source>
+ <target>Om</target>
+</phrase>
+<phrase>
+ <source>access key</source>
+ <target>snabbtangent</target>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>Hjälpmedel</target>
+ <definition>ikonen Accessibility</definition>
+</phrase>
+<phrase>
+ <source>accessibility</source>
+ <target>tillgänglighet</target>
+</phrase>
+<phrase>
+ <source>action handle</source>
+ <target>funktionshandtag</target>
+</phrase>
+<phrase>
+ <source>active</source>
+ <target>aktiv</target>
+</phrase>
+<phrase>
+ <source>active end</source>
+ <target>aktiv slutpunkt</target>
+</phrase>
+<phrase>
+ <source>active object</source>
+ <target>aktivt objekt</target>
+</phrase>
+<phrase>
+ <source>active window</source>
+ <target>aktivt fönster</target>
+</phrase>
+<phrase>
+ <source>adornment</source>
+ <target>fönsterfält</target>
+</phrase>
+<phrase>
+ <source>Always on Top</source>
+ <target>Alltid överst</target>
+</phrase>
+<phrase>
+ <source>anchor point</source>
+ <target>startpunkt</target>
+</phrase>
+<phrase>
+ <source>Apply</source>
+ <target>Verkställ</target>
+</phrase>
+<phrase>
+ <source>auto-exit</source>
+ <target>flytta automatiskt</target>
+</phrase>
+<phrase>
+ <source>auto-repeat</source>
+ <target>upprepa automatiskt</target>
+</phrase>
+<phrase>
+ <source>automatic link</source>
+ <target>automatisk länk</target>
+</phrase>
+<phrase>
+ <source>automatic scrolling</source>
+ <target>automatisk rullning</target>
+</phrase>
+<phrase>
+ <source>autoscroll</source>
+ <target>automatisk rullning</target>
+</phrase>
+<phrase>
+ <source>Back</source>
+ <target>Föregående</target>
+</phrase>
+<phrase>
+ <source>Browse</source>
+ <target>Bläddra</target>
+</phrase>
+<phrase>
+ <source>Cancel</source>
+ <target>Avbryt</target>
+</phrase>
+<phrase>
+ <source>cascading menu</source>
+ <target>undermeny</target>
+</phrase>
+<phrase>
+ <source>check box</source>
+ <target>kryssruta</target>
+</phrase>
+<phrase>
+ <source>check mark</source>
+ <target>markering</target>
+</phrase>
+<phrase>
+ <source>child window</source>
+ <target>underfönster</target>
+</phrase>
+<phrase>
+ <source>choose</source>
+ <target>välj</target>
+</phrase>
+<phrase>
+ <source>click</source>
+ <target>klicka</target>
+</phrase>
+<phrase>
+ <source>Clipboard</source>
+ <target>Urklipp</target>
+</phrase>
+<phrase>
+ <source>Close</source>
+ <target>Stäng</target>
+</phrase>
+<phrase>
+ <source>Close button</source>
+ <target>stängningsknapp</target>
+</phrase>
+<phrase>
+ <source>collapse</source>
+ <target>komprimera</target>
+ <definition>outline</definition>
+</phrase>
+<phrase>
+ <source>column heading</source>
+ <target>kolumnrubrik</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>combo box</source>
+ <target>kombinationsruta</target>
+</phrase>
+<phrase>
+ <source>command button</source>
+ <target>kommandoknapp</target>
+</phrase>
+<phrase>
+ <source>container</source>
+ <target>behållare</target>
+</phrase>
+<phrase>
+ <source>context-sensitive Help</source>
+ <target>sammanhangsberoende hjälp</target>
+</phrase>
+<phrase>
+ <source>contextual</source>
+ <target>sammanhangsberoende</target>
+</phrase>
+<phrase>
+ <source>control</source>
+ <target>kontroll</target>
+</phrase>
+<phrase>
+ <source>Copy</source>
+ <target>Kopiera</target>
+</phrase>
+<phrase>
+ <source>Copy here</source>
+ <target>Kopiera hit</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut</source>
+ <target>Skapa genväg</target>
+</phrase>
+<phrase>
+ <source>Create Shortcut Here</source>
+ <target>Skapa genväg här</target>
+</phrase>
+<phrase>
+ <source>Cut</source>
+ <target>Klipp ut</target>
+</phrase>
+<phrase>
+ <source>default</source>
+ <target>standard</target>
+</phrase>
+<phrase>
+ <source>default button</source>
+ <target>standardknapp</target>
+</phrase>
+<phrase>
+ <source>Delete</source>
+ <target>Ta bort</target>
+</phrase>
+<phrase>
+ <source>desktop</source>
+ <target>skrivbord</target>
+</phrase>
+<phrase>
+ <source>destination</source>
+ <target>mål</target>
+</phrase>
+<phrase>
+ <source>dialog box</source>
+ <target>dialogruta</target>
+</phrase>
+<phrase>
+ <source>disability</source>
+ <target>oförmåga</target>
+</phrase>
+<phrase>
+ <source>disjoint selection</source>
+ <target>osammanhängande markering</target>
+</phrase>
+<phrase>
+ <source>dock</source>
+ <target>docka</target>
+</phrase>
+<phrase>
+ <source>document</source>
+ <target>dokument</target>
+</phrase>
+<phrase>
+ <source>double-click</source>
+ <target>dubbelklicka på</target>
+</phrase>
+<phrase>
+ <source>drag</source>
+ <target>dra</target>
+</phrase>
+<phrase>
+ <source>drag-and-drop</source>
+ <target>dra och släpp</target>
+</phrase>
+<phrase>
+ <source>drop-down combo box</source>
+ <target>nedrullningsbar kombinationsruta</target>
+</phrase>
+<phrase>
+ <source>drop-down list box</source>
+ <target>nedrullningsbar listruta</target>
+</phrase>
+<phrase>
+ <source>drop-down menu</source>
+ <target>nedrullningsbar meny</target>
+</phrase>
+<phrase>
+ <source>Edit</source>
+ <target>Redigera</target>
+</phrase>
+<phrase>
+ <source>ellipsis</source>
+ <target>punkter</target>
+</phrase>
+<phrase>
+ <source>embedded object</source>
+ <target>inbäddat objekt</target>
+</phrase>
+<phrase>
+ <source>Exit</source>
+ <target>Avsluta</target>
+</phrase>
+<phrase>
+ <source>expand</source>
+ <target>expandera</target>
+ <definition>an outline</definition>
+</phrase>
+<phrase>
+ <source>Explore</source>
+ <target>Utforska</target>
+</phrase>
+<phrase>
+ <source>extended selection</source>
+ <target>utökad markering</target>
+</phrase>
+<phrase>
+ <source>extended selection list box</source>
+ <target>listruta för utökad markering</target>
+</phrase>
+<phrase>
+ <source>File</source>
+ <target>Arkiv</target>
+ <definition>menu/meny</definition>
+</phrase>
+<phrase>
+ <source>file</source>
+ <target>fil</target>
+</phrase>
+<phrase>
+ <source>Find</source>
+ <target>Sök</target>
+</phrase>
+<phrase>
+ <source>Find Next</source>
+ <target>Sök nästa</target>
+</phrase>
+<phrase>
+ <source>Find What</source>
+ <target>Sök efter</target>
+</phrase>
+<phrase>
+ <source>folder</source>
+ <target>mapp</target>
+</phrase>
+<phrase>
+ <source>font</source>
+ <target>teckensnitt</target>
+</phrase>
+<phrase>
+ <source>font size</source>
+ <target>teckenstorlek</target>
+</phrase>
+<phrase>
+ <source>font style</source>
+ <target>teckenstil</target>
+</phrase>
+<phrase>
+ <source>function key</source>
+ <target>funktionstangent</target>
+</phrase>
+<phrase>
+ <source>group box</source>
+ <target>gruppruta</target>
+</phrase>
+<phrase>
+ <source>handle</source>
+ <target>handtag</target>
+</phrase>
+<phrase>
+ <source>Help</source>
+ <target>Hjälp</target>
+</phrase>
+<phrase>
+ <source>Hide</source>
+ <target>Dölj</target>
+</phrase>
+<phrase>
+ <source>hierarchical selection</source>
+ <target>hierarkisk markering</target>
+</phrase>
+<phrase>
+ <source>hold</source>
+ <target>hålla ned</target>
+</phrase>
+<phrase>
+ <source>hot spot</source>
+ <target>aktiv punkt</target>
+</phrase>
+<phrase>
+ <source>hot zone</source>
+ <target>aktiveringszon</target>
+</phrase>
+<phrase>
+ <source>icon</source>
+ <target>ikon</target>
+</phrase>
+<phrase>
+ <source>inactive</source>
+ <target>inaktiv</target>
+</phrase>
+<phrase>
+ <source>inactive window</source>
+ <target>inaktivt fönster</target>
+</phrase>
+<phrase>
+ <source>input focus</source>
+ <target>inmatningsfokus</target>
+</phrase>
+<phrase>
+ <source>Insert</source>
+ <target>Infoga-meny</target>
+</phrase>
+<phrase>
+ <source>Insert Object</source>
+ <target>Infoga objekt</target>
+</phrase>
+<phrase>
+ <source>insertion point</source>
+ <target>insättningspunkt</target>
+</phrase>
+<phrase>
+ <source>italic</source>
+ <target>kursiv</target>
+</phrase>
+<phrase>
+ <source>label</source>
+ <target>titel</target>
+</phrase>
+<phrase>
+ <source>landscape</source>
+ <target>liggande</target>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>länk</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>link</source>
+ <target>länka</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>Link Here</source>
+ <target>Länka hit</target>
+</phrase>
+<phrase>
+ <source>list box</source>
+ <target>listruta</target>
+</phrase>
+<phrase>
+ <source>list view</source>
+ <target>listvy</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>manual link</source>
+ <target>manuell länk</target>
+</phrase>
+<phrase>
+ <source>Maximize</source>
+ <target>Maximera</target>
+</phrase>
+<phrase>
+ <source>maximize button</source>
+ <target>maximeringsknapp</target>
+</phrase>
+<phrase>
+ <source>MDI</source>
+ <target>MDI</target>
+</phrase>
+<phrase>
+ <source>menu</source>
+ <target>meny</target>
+</phrase>
+<phrase>
+ <source>menu bar</source>
+ <target>menyrad</target>
+</phrase>
+<phrase>
+ <source>menu button</source>
+ <target>menyknapp</target>
+</phrase>
+<phrase>
+ <source>menu item</source>
+ <target>menyobjekt</target>
+</phrase>
+<phrase>
+ <source>menu title</source>
+ <target>menytitel</target>
+</phrase>
+<phrase>
+ <source>message box</source>
+ <target>meddelanderuta</target>
+</phrase>
+<phrase>
+ <source>Minimize</source>
+ <target>Minimera</target>
+</phrase>
+<phrase>
+ <source>minimize button</source>
+ <target>minimeringsknapp</target>
+</phrase>
+<phrase>
+ <source>mixed-value</source>
+ <target>blandvärde</target>
+</phrase>
+<phrase>
+ <source>modal</source>
+ <target>modal</target>
+</phrase>
+<phrase>
+ <source>mode</source>
+ <target>läge</target>
+</phrase>
+<phrase>
+ <source>modeless</source>
+ <target>icke-modal</target>
+</phrase>
+<phrase>
+ <source>modifier key</source>
+ <target>ändringstangent</target>
+</phrase>
+<phrase>
+ <source>mouse</source>
+ <target>mus</target>
+</phrase>
+<phrase>
+ <source>Move</source>
+ <target>Flytta</target>
+</phrase>
+<phrase>
+ <source>Move Here</source>
+ <target>Flytta hit</target>
+</phrase>
+<phrase>
+ <source>Multiple Document Interface</source>
+ <target>multiple document interface</target>
+</phrase>
+<phrase>
+ <source>multiple selection list box</source>
+ <target>listruta för multipel markering</target>
+</phrase>
+<phrase>
+ <source>My Computer</source>
+ <target>Den här datorn</target>
+ <definition>icon</definition>
+</phrase>
+<phrase>
+ <source>Network Neighborhood</source>
+ <target>Nätverket</target>
+ <definition>icon</definition>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Ny</target>
+</phrase>
+<phrase>
+ <source>New</source>
+ <target>Nytt</target>
+</phrase>
+<phrase>
+ <source>Next</source>
+ <target>Nästa</target>
+</phrase>
+<phrase>
+ <source>object</source>
+ <target>objekt</target>
+</phrase>
+<phrase>
+ <source>OK</source>
+ <target>OK</target>
+</phrase>
+<phrase>
+ <source>OLE</source>
+ <target>OLE</target>
+</phrase>
+<phrase>
+ <source>OLE drag and drop</source>
+ <target>dra och släpp (OLE)</target>
+</phrase>
+<phrase>
+ <source>OLE embedded object</source>
+ <target>inbäddat objekt (OLE)</target>
+</phrase>
+<phrase>
+ <source>OLE linked object</source>
+ <target>länkat objekt (OLE)</target>
+</phrase>
+<phrase>
+ <source>OLE nondefault drag and drop</source>
+ <target>utökat drag och släpp (OLE)</target>
+</phrase>
+<phrase>
+ <source>Open</source>
+ <target>Öppna</target>
+</phrase>
+<phrase>
+ <source>Open With</source>
+ <target>Öppna med</target>
+</phrase>
+<phrase>
+ <source>option button</source>
+ <target>alternativknapp</target>
+</phrase>
+<phrase>
+ <source>option-set</source>
+ <target>valt alternativ</target>
+</phrase>
+<phrase>
+ <source>package</source>
+ <target>paket</target>
+</phrase>
+<phrase>
+ <source>Page Setup</source>
+ <target>Utskriftsformat</target>
+</phrase>
+<phrase>
+ <source>palette window</source>
+ <target>palettfönster</target>
+</phrase>
+<phrase>
+ <source>pane</source>
+ <target>fönsterruta</target>
+</phrase>
+<phrase>
+ <source>tqparent window</source>
+ <target>moderfönster</target>
+</phrase>
+<phrase>
+ <source>password</source>
+ <target>lösenord</target>
+</phrase>
+<phrase>
+ <source>Paste</source>
+ <target>Klistra in</target>
+</phrase>
+<phrase>
+ <source>Paste Link</source>
+ <target>Klistra in länk</target>
+</phrase>
+<phrase>
+ <source>Paste Shortcut</source>
+ <target>Klistra in genväg</target>
+</phrase>
+<phrase>
+ <source>Paste Special</source>
+ <target>Klistra in special</target>
+</phrase>
+<phrase>
+ <source>path</source>
+ <target>sökväg</target>
+</phrase>
+<phrase>
+ <source>Pause</source>
+ <target>Paus</target>
+</phrase>
+<phrase>
+ <source>Play</source>
+ <target>Spela upp</target>
+</phrase>
+<phrase>
+ <source>Plug and Play</source>
+ <target>Plug and Play</target>
+</phrase>
+<phrase>
+ <source>point</source>
+ <target>peka</target>
+</phrase>
+<phrase>
+ <source>pointer</source>
+ <target>pekare</target>
+</phrase>
+<phrase>
+ <source>pop-up menu</source>
+ <target>pop up-meny</target>
+</phrase>
+<phrase>
+ <source>pop-up window</source>
+ <target>pop up-fönster</target>
+</phrase>
+<phrase>
+ <source>portrait</source>
+ <target>stående</target>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>håll ned</target>
+ <definition>and hold a mouse button</definition>
+</phrase>
+<phrase>
+ <source>press</source>
+ <target>tryck på</target>
+ <definition>a key</definition>
+</phrase>
+<phrase>
+ <source>primary container</source>
+ <target>primär behållare</target>
+</phrase>
+<phrase>
+ <source>primary window</source>
+ <target>primärt fönster</target>
+</phrase>
+<phrase>
+ <source>Print</source>
+ <target>Skriv ut</target>
+</phrase>
+<phrase>
+ <source>printer</source>
+ <target>skrivare</target>
+</phrase>
+<phrase>
+ <source>progress indicator</source>
+ <target>förloppsindikator</target>
+ <definition>control</definition>
+</phrase>
+<phrase>
+ <source>project</source>
+ <target>projekt</target>
+</phrase>
+<phrase>
+ <source>Properties</source>
+ <target>Egenskaper</target>
+</phrase>
+<phrase>
+ <source>property inspector</source>
+ <target>egenskapsgranskare</target>
+</phrase>
+<phrase>
+ <source>property page</source>
+ <target>egenskapssida</target>
+</phrase>
+<phrase>
+ <source>property sheet</source>
+ <target>egenskapsförteckning</target>
+</phrase>
+<phrase>
+ <source>property sheet control</source>
+ <target>kontroll i egenskapsförteckning</target>
+</phrase>
+<phrase>
+ <source>Quick View</source>
+ <target>Snabbgranskning</target>
+</phrase>
+<phrase>
+ <source>read-only</source>
+ <target>skrivskydd</target>
+</phrase>
+<phrase>
+ <source>Recycle Bin</source>
+ <target>Papperskorgen</target>
+ <definition>Icon</definition>
+</phrase>
+<phrase>
+ <source>Redo</source>
+ <target>Gör om</target>
+</phrase>
+<phrase>
+ <source>region selection</source>
+ <target>områdesmarkering</target>
+</phrase>
+<phrase>
+ <source>registry</source>
+ <target>Registret</target>
+</phrase>
+<phrase>
+ <source>Repeat</source>
+ <target>Upprepa</target>
+</phrase>
+<phrase>
+ <source>Replace</source>
+ <target>Ersätt</target>
+</phrase>
+<phrase>
+ <source>Restore</source>
+ <target>Återställ</target>
+</phrase>
+<phrase>
+ <source>Restore button</source>
+ <target>knappen Återställ</target>
+</phrase>
+<phrase>
+ <source>Resume</source>
+ <target>Fortsätt</target>
+</phrase>
+<phrase>
+ <source>Retry</source>
+ <target>Försök igen</target>
+</phrase>
+<phrase>
+ <source>rich-text box</source>
+ <target>rich text-ruta</target>
+</phrase>
+<phrase>
+ <source>Run</source>
+ <target>Kör</target>
+</phrase>
+<phrase>
+ <source>Save</source>
+ <target>Spara</target>
+</phrase>
+<phrase>
+ <source>Save as</source>
+ <target>Spara som</target>
+</phrase>
+<phrase>
+ <source>scroll</source>
+ <target>rulla</target>
+</phrase>
+<phrase>
+ <source>scroll arrow</source>
+ <target>rullningspil</target>
+</phrase>
+<phrase>
+ <source>scroll bar</source>
+ <target>rullningslist</target>
+</phrase>
+<phrase>
+ <source>scroll box</source>
+ <target>rullningsruta</target>
+</phrase>
+<phrase>
+ <source>secondary window</source>
+ <target>sekundärt fönster</target>
+</phrase>
+<phrase>
+ <source>select</source>
+ <target>markera</target>
+</phrase>
+<phrase>
+ <source>Select All</source>
+ <target>Markera allt</target>
+</phrase>
+<phrase>
+ <source>selection</source>
+ <target>markering</target>
+</phrase>
+<phrase>
+ <source>selection handle</source>
+ <target>markeringshandtag</target>
+</phrase>
+<phrase>
+ <source>Send To</source>
+ <target>Skicka till</target>
+</phrase>
+<phrase>
+ <source>separator</source>
+ <target>avgränsare</target>
+</phrase>
+<phrase>
+ <source>Settings</source>
+ <target>Inställningar</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>installationsprogram</target>
+</phrase>
+<phrase>
+ <source>Setup</source>
+ <target>Inställningar</target>
+</phrase>
+<phrase>
+ <source>shortcut</source>
+ <target>genväg</target>
+</phrase>
+<phrase>
+ <source>shortcut button</source>
+ <target>genvägsknapp</target>
+</phrase>
+<phrase>
+ <source>shortcut icon</source>
+ <target>genvägsikon</target>
+</phrase>
+<phrase>
+ <source>shortcut key</source>
+ <target>kortkommando</target>
+</phrase>
+<phrase>
+ <source>shortcut key control</source>
+ <target>kortkommandokontroll</target>
+</phrase>
+<phrase>
+ <source>Show</source>
+ <target>Visa</target>
+</phrase>
+<phrase>
+ <source>Shutdown</source>
+ <target>Avsluta</target>
+</phrase>
+<phrase>
+ <source>single selection list box</source>
+ <target>listruta för enkel markering</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Ändra storlek</target>
+</phrase>
+<phrase>
+ <source>Size</source>
+ <target>Storlek</target>
+</phrase>
+<phrase>
+ <source>size grip</source>
+ <target>storleksgrepp</target>
+</phrase>
+<phrase>
+ <source>slider</source>
+ <target>skjutreglage</target>
+</phrase>
+<phrase>
+ <source>spin box</source>
+ <target>rotationsruta</target>
+</phrase>
+<phrase>
+ <source>Split</source>
+ <target>Dela</target>
+</phrase>
+<phrase>
+ <source>split bar</source>
+ <target>delningslist</target>
+</phrase>
+<phrase>
+ <source>split box</source>
+ <target>delningsruta</target>
+</phrase>
+<phrase>
+ <source>Start button</source>
+ <target>startknappen</target>
+</phrase>
+<phrase>
+ <source>StartUp folder</source>
+ <target>mappen Autostart</target>
+</phrase>
+<phrase>
+ <source>status bar</source>
+ <target>statusfält</target>
+</phrase>
+<phrase>
+ <source>Stop</source>
+ <target>Stanna</target>
+</phrase>
+<phrase>
+ <source>tab control</source>
+ <target>flik</target>
+</phrase>
+<phrase>
+ <source>task bar</source>
+ <target>Aktivitetsfältet</target>
+</phrase>
+<phrase>
+ <source>task-oriented Help</source>
+ <target>aktivitetsberoende hjälp</target>
+</phrase>
+<phrase>
+ <source>template</source>
+ <target>mall</target>
+</phrase>
+<phrase>
+ <source>text box</source>
+ <target>textruta</target>
+</phrase>
+<phrase>
+ <source>title bar</source>
+ <target>namnlist</target>
+</phrase>
+<phrase>
+ <source>title text</source>
+ <target>text i namnlist</target>
+</phrase>
+<phrase>
+ <source>toggle key</source>
+ <target>växlingstangent</target>
+</phrase>
+<phrase>
+ <source>toolbar</source>
+ <target>verktygsfält</target>
+</phrase>
+<phrase>
+ <source>tooltip</source>
+ <target>funktionsbeskrivning</target>
+</phrase>
+<phrase>
+ <source>tree view control</source>
+ <target>trädkontroll</target>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>typ</target>
+ <definition>noun</definition>
+</phrase>
+<phrase>
+ <source>type</source>
+ <target>skriva</target>
+ <definition>verb</definition>
+</phrase>
+<phrase>
+ <source>unavailable</source>
+ <target>ej tillgänglig</target>
+</phrase>
+<phrase>
+ <source>Undo</source>
+ <target>Ångra</target>
+</phrase>
+<phrase>
+ <source>Uninstall</source>
+ <target>Avinstallera</target>
+</phrase>
+<phrase>
+ <source>View</source>
+ <target>Visa-meny</target>
+</phrase>
+<phrase>
+ <source>visual editing</source>
+ <target>direktredigering</target>
+</phrase>
+<phrase>
+ <source>well control</source>
+ <target>grafikkontroll</target>
+</phrase>
+<phrase>
+ <source>What&apos;s This?</source>
+ <target>Förklaring</target>
+</phrase>
+<phrase>
+ <source>Window</source>
+ <target>Fönster-meny</target>
+</phrase>
+<phrase>
+ <source>window</source>
+ <target>fönster</target>
+</phrase>
+<phrase>
+ <source>Windows Explorer</source>
+ <target>Utforskaren</target>
+</phrase>
+<phrase>
+ <source>wizard</source>
+ <target>guide</target>
+</phrase>
+<phrase>
+ <source>workbook</source>
+ <target>arbetsbok</target>
+</phrase>
+<phrase>
+ <source>workgroup</source>
+ <target>arbetsgrupp</target>
+</phrase>
+<phrase>
+ <source>workspace</source>
+ <target>arbetsyta</target>
+</phrase>
+<phrase>
+ <source>Yes</source>
+ <target>Ja</target>
+</phrase>
+</QPH>
diff --git a/tqtinterface/qt4/tools/linguist/qdoc.conf b/tqtinterface/qt4/tools/linguist/qdoc.conf
new file mode 100644
index 0000000..c798f7b
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/qdoc.conf
@@ -0,0 +1,15 @@
+SOURCEDIRS = $TQTDIR/tools/linguist/doc
+DOCDIRS = $TQTDIR/tools/linguist/doc
+EXAMPLEDIRS = $TQTDIR/tools/linguist/tutorial
+OUTPUTDIR = $TQTDIR/tools/linguist/doc/html
+BASE = file:$TQTDIR/tools/linguist/doc/html/
+COMPANY = Trolltech
+PRODUCT = TQt Linguist
+VERSIONSYM = TQT_VERSION_STR
+DEFINE = TQT_TQDOC TQT_.*_SUPPORT _WS_.*_
+FALSE = 0 1
+INTERNAL = no
+STYLE = "h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
+a:link { color: #af4f00; text-decoration: none }
+a:visited { color: #8f2f00; text-decoration: none }
+body { background: #ffffff; color: black; }"
diff --git a/tqtinterface/qt4/tools/linguist/qm2ts/main.cpp b/tqtinterface/qt4/tools/linguist/qm2ts/main.cpp
new file mode 100644
index 0000000..71e361d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/qm2ts/main.cpp
@@ -0,0 +1,128 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <metatranslator.h>
+
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqtranslator.h>
+
+typedef TQValueList<TQTranslatorMessage> TML;
+
+static void printUsage()
+{
+ fprintf( stderr, "Usage:\n"
+ " qm2ts [ options ] qm-files\n"
+ "Options:\n"
+ " -help Display this information and exit\n"
+ " -verbose\n"
+ " Explain what is being done\n"
+ " -version\n"
+ " Display the version of qm2ts and exit\n" );
+}
+
+int main( int argc, char **argv )
+{
+ bool verbose = FALSE;
+ int numQmFiles = 0;
+
+ for ( int i = 1; i < argc; i++ ) {
+ if ( qstrcmp(argv[i], "-help") == 0 ) {
+ printUsage();
+ return 0;
+ } else if ( qstrcmp(argv[i], "-verbose") == 0 ) {
+ verbose = TRUE;
+ continue;
+ } else if ( qstrcmp(argv[i], "-version") == 0 ) {
+ fprintf( stderr, "qm2ts version %s\n", TQT_VERSION_STR );
+ return 0;
+ }
+
+ numQmFiles++;
+ TQTranslator tor( 0 );
+ if ( tor.load(argv[i], ".") ) {
+ TQString g = argv[i];
+ g.tqreplace( TQRegExp(TQString("\\.qm$")), TQString() );
+ g += TQString( ".ts" );
+
+ if ( verbose )
+ fprintf( stderr, "Generating '%s'...\n", g.latin1() );
+
+ MetaTranslator metator;
+ int ignored = 0;
+
+ TML all = tor.messages();
+ TML::Iterator it;
+ for ( it = all.begin(); it != all.end(); ++it ) {
+ if ( (*it).sourceText() == 0 ) {
+ ignored++;
+ } else {
+ TQCString context = (*it).context();
+ if ( context.isEmpty() )
+ context = "@default";
+ metator.insert( MetaTranslatorMessage(context,
+ (*it).sourceText(), (*it).comment(),
+ (*it).translation(), FALSE,
+ MetaTranslatorMessage::Finished) );
+ }
+ }
+
+ if ( !metator.save(g) ) {
+ fprintf( stderr,
+ "qm2ts warning: For some reason, I cannot save '%s'\n",
+ g.latin1() );
+ } else {
+ if ( verbose ) {
+ int converted = (int) metator.messages().count();
+ fprintf( stderr, " %d message%s converted (%d ignored)\n",
+ converted, converted == 1 ? "" : "s", ignored );
+ }
+ if ( ignored > 0 )
+ fprintf( stderr,
+ "qm2ts warning: File '%s' is not a TQt 2.x .qm"
+ " file (some information is lost)\n",
+ argv[i] );
+ }
+ } else {
+ fprintf( stderr,
+ "qm2ts warning: For some reason, I cannot load '%s'\n",
+ argv[i] );
+ }
+ }
+
+ if ( numQmFiles == 0 ) {
+ printUsage();
+ return 1;
+ }
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.1 b/tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.1
new file mode 100644
index 0000000..6cdf129
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.1
@@ -0,0 +1,55 @@
+.TH qm2ts 1 "18 October 2001" "Trolltech AS" \" -*- nroff -*-
+.\"
+.\" Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.
+.\"
+.\" This file is part of Qt and may be distributed and used according to
+.\" the terms and conditions described in the LICENSE file.
+.\"
+.SH NAME
+qm2ts \- generate Qt Linguist translation files from Qt 2.x message files
+.SH SYNOPSIS
+.B qm2ts
+.RI "[ " options " ] " qm-files
+.SH DESCRIPTION
+This page documents the
+.B Qt Linguist Qm2ts
+tool for the Qt GUI toolkit.
+.B Qm2ts
+converts Qt 2.x message files (.qm files) into source message files
+(.ts files).
+.PP
+The .ts file format is a simple human-readable XML format that can be
+used with version control systems if required. It is understood by
+.B lupdate,
+.B lrelease
+and
+.B Qt Linguist.
+.PP
+.B qm2ts
+is provided to ease porting from the old internationalization
+tools
+.B (tqfindtr,
+.B mergetr
+and
+.B msg2qm)
+to the new ones. It will not accept Qt message files generated by
+.B lrelease,
+as
+.B lrelease
+compresses .qm files by stripping unnecessary information for lookup.
+.SH OPTIONS
+.TP
+.I "-help"
+Display the usage and exit.
+.TP
+.I "-verbose"
+Explain what is being done.
+.TP
+.I "-version"
+Display the version of
+.B qm2ts
+and exit.
+.SH "SEE ALSO"
+.BR http://doc.trolltech.com/i18n.html
+.SH AUTHOR
+Jasmin Blanchette, Trolltech ASA <jasmin@trolltech.com>
diff --git a/tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.pro b/tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.pro
new file mode 100644
index 0000000..3868e30
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/qm2ts/qm2ts.pro
@@ -0,0 +1,15 @@
+TEMPLATE = app
+CONFIG += qt warn_on console
+HEADERS = ../shared/metatranslator.h
+SOURCES = main.cpp \
+ ../shared/metatranslator.cpp
+
+DEFINES += QT_INTERNAL_XML
+include( ../../../src/qt_professional.pri )
+
+TARGET = qm2ts
+INCLUDEPATH += ../shared
+DESTDIR = ../../../bin
+
+target.path=$$bins.path
+INSTALLS += target
diff --git a/tqtinterface/qt4/tools/linguist/shared/metatranslator.cpp b/tqtinterface/qt4/tools/linguist/shared/metatranslator.cpp
new file mode 100644
index 0000000..e6cde6c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/shared/metatranslator.cpp
@@ -0,0 +1,601 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "metatranslator.h"
+
+#include <tqapplication.h>
+#include <tqcstring.h>
+#include <tqfile.h>
+#include <tqmessagebox.h>
+#include <tqtextcodec.h>
+#include <tqtextstream.h>
+#include <tqxml.h>
+
+static bool encodingIsUtf8( const TQXmlAttributes& atts )
+{
+ for ( int i = 0; i < atts.length(); i++ ) {
+ // utf8="true" is a pre-3.0 syntax
+ if ( atts.qName(i) == TQString("utf8") ) {
+ return ( atts.value(i) == TQString("true") );
+ } else if ( atts.qName(i) == TQString("encoding") ) {
+ return ( atts.value(i) == TQString("UTF-8") );
+ }
+ }
+ return FALSE;
+}
+
+class TsHandler : public TQXmlDefaultHandler
+{
+public:
+ TsHandler( MetaTranslator *translator )
+ : tor( translator ), type( MetaTranslatorMessage::Finished ),
+ inMessage( FALSE ), ferrorCount( 0 ), contextIsUtf8( FALSE ),
+ messageIsUtf8( FALSE ) { }
+
+ virtual bool startElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName,
+ const TQXmlAttributes& atts );
+ virtual bool endElement( const TQString& namespaceURI,
+ const TQString& localName, const TQString& qName );
+ virtual bool characters( const TQString& ch );
+ virtual bool fatalError( const TQXmlParseException& exception );
+
+private:
+ MetaTranslator *tor;
+ MetaTranslatorMessage::Type type;
+ bool inMessage;
+ TQString context;
+ TQString source;
+ TQString comment;
+ TQString translation;
+
+ TQString accum;
+ int ferrorCount;
+ bool contextIsUtf8;
+ bool messageIsUtf8;
+};
+
+bool TsHandler::startElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName,
+ const TQXmlAttributes& atts )
+{
+ if ( qName == TQString("byte") ) {
+ for ( int i = 0; i < atts.length(); i++ ) {
+ if ( atts.qName(i) == TQString("value") ) {
+ TQString value = atts.value( i );
+ int base = 10;
+ if ( value.startsWith("x") ) {
+ base = 16;
+ value = value.mid( 1 );
+ }
+ int n = value.toUInt( 0, base );
+ if ( n != 0 )
+ accum += TQChar( n );
+ }
+ }
+ } else {
+ if ( qName == TQString("context") ) {
+ context.truncate( 0 );
+ source.truncate( 0 );
+ comment.truncate( 0 );
+ translation.truncate( 0 );
+ contextIsUtf8 = encodingIsUtf8( atts );
+ } else if ( qName == TQString("message") ) {
+ inMessage = TRUE;
+ type = MetaTranslatorMessage::Finished;
+ source.truncate( 0 );
+ comment.truncate( 0 );
+ translation.truncate( 0 );
+ messageIsUtf8 = encodingIsUtf8( atts );
+ } else if ( qName == TQString("translation") ) {
+ for ( int i = 0; i < atts.length(); i++ ) {
+ if ( atts.qName(i) == TQString("type") ) {
+ if ( atts.value(i) == TQString("unfinished") )
+ type = MetaTranslatorMessage::Unfinished;
+ else if ( atts.value(i) == TQString("obsolete") )
+ type = MetaTranslatorMessage::Obsolete;
+ else
+ type = MetaTranslatorMessage::Finished;
+ }
+ }
+ }
+ accum.truncate( 0 );
+ }
+ return TRUE;
+}
+
+bool TsHandler::endElement( const TQString& /* namespaceURI */,
+ const TQString& /* localName */,
+ const TQString& qName )
+{
+ if ( qName == TQString("codec") || qName == TQString("defaultcodec") ) {
+ // "codec" is a pre-3.0 syntax
+ tor->setCodec( accum );
+ } else if ( qName == TQString("name") ) {
+ context = accum;
+ } else if ( qName == TQString("source") ) {
+ source = accum;
+ } else if ( qName == TQString("comment") ) {
+ if ( inMessage ) {
+ comment = accum;
+ } else {
+ if ( contextIsUtf8 )
+ tor->insert( MetaTranslatorMessage(context.utf8(),
+ ContextComment,
+ accum.utf8(), TQString(), TRUE,
+ MetaTranslatorMessage::Unfinished) );
+ else
+ tor->insert( MetaTranslatorMessage(context.ascii(),
+ ContextComment,
+ accum.ascii(), TQString(), FALSE,
+ MetaTranslatorMessage::Unfinished) );
+ }
+ } else if ( qName == TQString("translation") ) {
+ translation = accum;
+ } else if ( qName == TQString("message") ) {
+ if ( messageIsUtf8 )
+ tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(),
+ comment.utf8(), translation,
+ TRUE, type) );
+ else
+ tor->insert( MetaTranslatorMessage(context.ascii(), source.ascii(),
+ comment.ascii(), translation,
+ FALSE, type) );
+ inMessage = FALSE;
+ }
+ return TRUE;
+}
+
+bool TsHandler::characters( const TQString& ch )
+{
+ TQString t = ch;
+ t.tqreplace( "\r", "" );
+ accum += t;
+ return TRUE;
+}
+
+bool TsHandler::fatalError( const TQXmlParseException& exception )
+{
+ if ( ferrorCount++ == 0 ) {
+ TQString msg;
+ msg.sprintf( "Parse error at line %d, column %d (%s).",
+ exception.lineNumber(), exception.columnNumber(),
+ exception.message().latin1() );
+ if ( tqApp == 0 )
+ fprintf( stderr, "XML error: %s\n", msg.latin1() );
+ else
+ TQMessageBox::information( tqApp->mainWidget(),
+ TQObject::tr("TQt Linguist"), msg );
+ }
+ return FALSE;
+}
+
+static TQString numericEntity( int ch )
+{
+ return TQString( ch <= 0x20 ? "<byte value=\"x%1\"/>" : "&#x%1;" )
+ .arg( ch, 0, 16 );
+}
+
+static TQString protect( const TQCString& str )
+{
+ TQString result;
+ int len = (int) str.length();
+ for ( int k = 0; k < len; k++ ) {
+ switch( str[k] ) {
+ case '\"':
+ result += TQString( "&quot;" );
+ break;
+ case '&':
+ result += TQString( "&amp;" );
+ break;
+ case '>':
+ result += TQString( "&gt;" );
+ break;
+ case '<':
+ result += TQString( "&lt;" );
+ break;
+ case '\'':
+ result += TQString( "&apos;" );
+ break;
+ default:
+ if ( (uchar) str[k] < 0x20 && str[k] != '\n' )
+ result += numericEntity( (uchar) str[k] );
+ else
+ result += str[k];
+ }
+ }
+ return result;
+}
+
+static TQString evilBytes( const TQCString& str, bool utf8 )
+{
+ if ( utf8 ) {
+ return protect( str );
+ } else {
+ TQString result;
+ TQCString t = protect( str ).latin1();
+ int len = (int) t.length();
+ for ( int k = 0; k < len; k++ ) {
+ if ( (uchar) t[k] >= 0x7f )
+ result += numericEntity( (uchar) t[k] );
+ else
+ result += TQChar( t[k] );
+ }
+ return result;
+ }
+}
+
+MetaTranslatorMessage::MetaTranslatorMessage()
+ : utfeight( FALSE ), ty( Unfinished )
+{
+}
+
+MetaTranslatorMessage::MetaTranslatorMessage( const char *context,
+ const char *sourceText,
+ const char *comment,
+ const TQString& translation,
+ bool utf8, Type type )
+ : TQTranslatorMessage( context, sourceText, comment, translation ),
+ utfeight( FALSE ), ty( type )
+{
+ /*
+ Don't use UTF-8 if it makes no difference. UTF-8 should be
+ reserved for the real problematic case: non-ASCII (possibly
+ non-Latin-1) characters in .ui files.
+ */
+ if ( utf8 ) {
+ if ( sourceText != 0 ) {
+ int i = 0;
+ while ( sourceText[i] != '\0' ) {
+ if ( (uchar) sourceText[i] >= 0x80 ) {
+ utfeight = TRUE;
+ break;
+ }
+ i++;
+ }
+ }
+ if ( !utfeight && comment != 0 ) {
+ int i = 0;
+ while ( comment[i] != '\0' ) {
+ if ( (uchar) comment[i] >= 0x80 ) {
+ utfeight = TRUE;
+ break;
+ }
+ i++;
+ }
+ }
+ }
+}
+
+MetaTranslatorMessage::MetaTranslatorMessage( const MetaTranslatorMessage& m )
+ : TQTranslatorMessage( m ), utfeight( m.utfeight ), ty( m.ty )
+{
+}
+
+MetaTranslatorMessage& MetaTranslatorMessage::operator=(
+ const MetaTranslatorMessage& m )
+{
+ TQTranslatorMessage::operator=( m );
+ utfeight = m.utfeight;
+ ty = m.ty;
+ return *this;
+}
+
+bool MetaTranslatorMessage::operator==( const MetaTranslatorMessage& m ) const
+{
+ return qstrcmp( context(), m.context() ) == 0 &&
+ qstrcmp( sourceText(), m.sourceText() ) == 0 &&
+ qstrcmp( comment(), m.comment() ) == 0;
+}
+
+bool MetaTranslatorMessage::operator<( const MetaTranslatorMessage& m ) const
+{
+ int delta = qstrcmp( context(), m.context() );
+ if ( delta == 0 )
+ delta = qstrcmp( sourceText(), m.sourceText() );
+ if ( delta == 0 )
+ delta = qstrcmp( comment(), m.comment() );
+ return delta < 0;
+}
+
+MetaTranslator::MetaTranslator()
+{
+ clear();
+}
+
+MetaTranslator::MetaTranslator( const MetaTranslator& tor )
+ : mm( tor.mm ), codecName( tor.codecName ), codec( tor.codec )
+{
+}
+
+MetaTranslator& MetaTranslator::operator=( const MetaTranslator& tor )
+{
+ mm = tor.mm;
+ codecName = tor.codecName;
+ codec = tor.codec;
+ return *this;
+}
+
+void MetaTranslator::clear()
+{
+ mm.clear();
+ codecName = "ISO-8859-1";
+ codec = 0;
+}
+
+bool MetaTranslator::load( const TQString& filename )
+{
+ TQFile f( filename );
+ if ( !f.open(IO_ReadOnly) )
+ return FALSE;
+
+ TQTextStream t( &f );
+ TQXmlInputSource in( t );
+ TQXmlSimpleReader reader;
+ reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE );
+ reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE );
+ TQXmlDefaultHandler *hand = new TsHandler( this );
+ reader.setContentHandler( hand );
+ reader.setErrorHandler( hand );
+
+ bool ok = reader.parse( in );
+ reader.setContentHandler( 0 );
+ reader.setErrorHandler( 0 );
+ delete hand;
+ f.close();
+ return ok;
+}
+
+bool MetaTranslator::save( const TQString& filename ) const
+{
+ TQFile f( filename );
+ if ( !f.open(IO_WriteOnly) )
+ return FALSE;
+
+ TQTextStream t( &f );
+ t.setCodec( TQTextCodec::codecForName("ISO-8859-1") );
+
+ t << "<!DOCTYPE TS><TS>\n";
+ if ( codecName != "ISO-8859-1" )
+ t << "<defaultcodec>" << codecName << "</defaultcodec>\n";
+ TMM::ConstIterator m = mm.begin();
+ while ( m != mm.end() ) {
+ TMMInv inv;
+ TMMInv::Iterator i;
+ bool contextIsUtf8 = m.key().utf8();
+ TQCString context = m.key().context();
+ TQCString comment = "";
+
+ do {
+ if ( TQCString(m.key().sourceText()) == ContextComment ) {
+ if ( m.key().type() != MetaTranslatorMessage::Obsolete ) {
+ contextIsUtf8 = m.key().utf8();
+ comment = TQCString( m.key().comment() );
+ }
+ } else {
+ inv.insert( *m, m.key() );
+ }
+ } while ( ++m != mm.end() && TQCString(m.key().context()) == context );
+
+ t << "<context";
+ if ( contextIsUtf8 )
+ t << " encoding=\"UTF-8\"";
+ t << ">\n";
+ t << " <name>" << evilBytes( context, contextIsUtf8 )
+ << "</name>\n";
+ if ( !comment.isEmpty() )
+ t << " <comment>" << evilBytes( comment, contextIsUtf8 )
+ << "</comment>\n";
+
+ for ( i = inv.begin(); i != inv.end(); ++i ) {
+ // no need for such noise
+ if ( (*i).type() == MetaTranslatorMessage::Obsolete &&
+ (*i).translation().isEmpty() )
+ continue;
+
+ t << " <message";
+ if ( (*i).utf8() )
+ t << " encoding=\"UTF-8\"";
+ t << ">\n"
+ << " <source>" << evilBytes( (*i).sourceText(),
+ (*i).utf8() )
+ << "</source>\n";
+ if ( !TQCString((*i).comment()).isEmpty() )
+ t << " <comment>" << evilBytes( (*i).comment(),
+ (*i).utf8() )
+ << "</comment>\n";
+ t << " <translation";
+ if ( (*i).type() == MetaTranslatorMessage::Unfinished )
+ t << " type=\"unfinished\"";
+ else if ( (*i).type() == MetaTranslatorMessage::Obsolete )
+ t << " type=\"obsolete\"";
+ t << ">" << protect( (*i).translation().utf8() )
+ << "</translation>\n";
+ t << " </message>\n";
+ }
+ t << "</context>\n";
+ }
+ t << "</TS>\n";
+ f.close();
+ return TRUE;
+}
+
+bool MetaTranslator::release( const TQString& filename, bool verbose,
+ TQTranslator::SaveMode mode ) const
+{
+ TQTranslator tor( 0 );
+ int finished = 0;
+ int unfinished = 0;
+ int untranslated = 0;
+ TMM::ConstIterator m;
+
+ for ( m = mm.begin(); m != mm.end(); ++m ) {
+ if ( m.key().type() != MetaTranslatorMessage::Obsolete ) {
+ if ( m.key().translation().isEmpty() ) {
+ untranslated++;
+ } else {
+ if ( m.key().type() == MetaTranslatorMessage::Unfinished )
+ unfinished++;
+ else
+ finished++;
+
+ TQCString context = m.key().context();
+ TQCString sourceText = m.key().sourceText();
+ TQCString comment = m.key().comment();
+ TQString translation = m.key().translation();
+
+ /*
+ Drop the comment in (context, sourceText, comment),
+ unless (context, sourceText, "") already exists, or
+ unless we already dropped the comment of (context,
+ sourceText, comment0).
+ */
+ if ( comment.isEmpty()
+ || tqcontains(context, sourceText, "")
+ || !tor.tqfindMessage(context, sourceText, "").translation()
+ .isNull() ) {
+ tor.insert( m.key() );
+ } else {
+ tor.insert( TQTranslatorMessage(context, sourceText, "",
+ translation) );
+ }
+ }
+ }
+ }
+
+ bool saved = tor.save( filename, mode );
+ if ( saved && verbose )
+ fprintf( stderr,
+ " %d finished, %d unfinished and %d untranslated messages\n",
+ finished, unfinished, untranslated );
+
+ return saved;
+}
+
+bool MetaTranslator::tqcontains( const char *context, const char *sourceText,
+ const char *comment ) const
+{
+ return mm.tqfind( MetaTranslatorMessage(context, sourceText, comment) ) !=
+ mm.end();
+}
+
+void MetaTranslator::insert( const MetaTranslatorMessage& m )
+{
+ int pos = (int)mm.count();
+ TMM::Iterator n = mm.tqfind( m );
+ if ( n != mm.end() )
+ pos = *n;
+ mm.tqreplace( m, pos );
+}
+
+void MetaTranslator::stripObsoleteMessages()
+{
+ TMM newmm;
+
+ TMM::Iterator m = mm.begin();
+ while ( m != mm.end() ) {
+ if ( m.key().type() != MetaTranslatorMessage::Obsolete )
+ newmm.insert( m.key(), *m );
+ ++m;
+ }
+ mm = newmm;
+}
+
+void MetaTranslator::stripEmptyContexts()
+{
+ TMM newmm;
+
+ TMM::Iterator m = mm.begin();
+ while ( m != mm.end() ) {
+ if ( TQCString(m.key().sourceText()) == ContextComment ) {
+ TMM::Iterator n = m;
+ ++n;
+ // the context comment is followed by other messages
+ if ( n != newmm.end() &&
+ qstrcmp(m.key().context(), n.key().context()) == 0 )
+ newmm.insert( m.key(), *m );
+ } else {
+ newmm.insert( m.key(), *m );
+ }
+ ++m;
+ }
+ mm = newmm;
+}
+
+void MetaTranslator::setCodec( const char *name )
+{
+ const int latin1 = 4;
+
+ codecName = name;
+ codec = TQTextCodec::codecForName( name );
+ if ( codec == 0 || codec->mibEnum() == latin1 )
+ codec = 0;
+}
+
+TQString MetaTranslator::toUnicode( const char *str, bool utf8 ) const
+{
+ if ( utf8 )
+ return TQString::fromUtf8( str );
+ else if ( codec == 0 )
+ return TQString( str );
+ else
+ return codec->toUnicode( str );
+}
+
+TQValueList<MetaTranslatorMessage> MetaTranslator::messages() const
+{
+ int n = (int)mm.count();
+ TMM::ConstIterator *t = new TMM::ConstIterator[n + 1];
+ TMM::ConstIterator m;
+ for ( m = mm.begin(); m != mm.end(); ++m )
+ t[*m] = m;
+
+ TQValueList<MetaTranslatorMessage> val;
+ for ( int i = 0; i < n; i++ )
+ val.append( t[i].key() );
+
+ delete[] t;
+ return val;
+}
+
+TQValueList<MetaTranslatorMessage> MetaTranslator::translatedMessages() const
+{
+ TQValueList<MetaTranslatorMessage> val;
+ TMM::ConstIterator m;
+ for ( m = mm.begin(); m != mm.end(); ++m ) {
+ if ( m.key().type() == MetaTranslatorMessage::Finished )
+ val.append( m.key() );
+ }
+ return val;
+}
diff --git a/tqtinterface/qt4/tools/linguist/shared/metatranslator.h b/tqtinterface/qt4/tools/linguist/shared/metatranslator.h
new file mode 100644
index 0000000..1673d57
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/shared/metatranslator.h
@@ -0,0 +1,120 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef METATRANSLATOR_H
+#define METATRANSLATOR_H
+
+#include <tqmap.h>
+#include <tqstring.h>
+#include <tqtranslator.h>
+#include <tqvaluelist.h>
+
+class TQTextCodec;
+
+class MetaTranslatorMessage : public TQTranslatorMessage
+{
+public:
+ enum Type { Unfinished, Finished, Obsolete };
+
+ MetaTranslatorMessage();
+ MetaTranslatorMessage( const char *context, const char *sourceText,
+ const char *comment,
+ const TQString& translation = TQString(),
+ bool utf8 = FALSE, Type type = Unfinished );
+ MetaTranslatorMessage( const MetaTranslatorMessage& m );
+
+ MetaTranslatorMessage& operator=( const MetaTranslatorMessage& m );
+
+ void setType( Type nt ) { ty = nt; }
+ Type type() const { return ty; }
+ bool utf8() const { return utfeight; }
+
+ bool operator==( const MetaTranslatorMessage& m ) const;
+ bool operator!=( const MetaTranslatorMessage& m ) const
+ { return !operator==( m ); }
+ bool operator<( const MetaTranslatorMessage& m ) const;
+ bool operator<=( const MetaTranslatorMessage& m )
+ { return !operator>( m ); }
+ bool operator>( const MetaTranslatorMessage& m ) const
+ { return this->operator<( m ); }
+ bool operator>=( const MetaTranslatorMessage& m ) const
+ { return !operator<( m ); }
+
+private:
+ bool utfeight;
+ Type ty;
+};
+
+class MetaTranslator
+{
+public:
+ MetaTranslator();
+ MetaTranslator( const MetaTranslator& tor );
+
+ MetaTranslator& operator=( const MetaTranslator& tor );
+
+ void clear();
+ bool load( const TQString& filename );
+ bool save( const TQString& filename ) const;
+ bool release( const TQString& filename, bool verbose = FALSE,
+ TQTranslator::SaveMode mode = TQTranslator::Stripped ) const;
+
+ bool tqcontains( const char *context, const char *sourceText,
+ const char *comment ) const;
+ void insert( const MetaTranslatorMessage& m );
+
+ void stripObsoleteMessages();
+ void stripEmptyContexts();
+
+ void setCodec( const char *name );
+ TQString toUnicode( const char *str, bool utf8 ) const;
+
+ TQValueList<MetaTranslatorMessage> messages() const;
+ TQValueList<MetaTranslatorMessage> translatedMessages() const;
+
+private:
+ typedef TQMap<MetaTranslatorMessage, int> TMM;
+ typedef TQMap<int, MetaTranslatorMessage> TMMInv;
+
+ TMM mm;
+ TQCString codecName;
+ TQTextCodec *codec;
+};
+
+/*
+ This is a quick hack. The proper way to handle this would be
+ to extend MetaTranslator's interface.
+*/
+#define ContextComment "TQT_LINGUIST_INTERNAL_CONTEXT_COMMENT"
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/shared/proparser.cpp b/tqtinterface/qt4/tools/linguist/shared/proparser.cpp
new file mode 100644
index 0000000..12af0ec
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/shared/proparser.cpp
@@ -0,0 +1,217 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "proparser.h"
+
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
+
+#ifdef TQ_OS_UNIX
+#include <unistd.h>
+#endif
+
+#ifdef TQ_OS_WIN32
+#define TQT_POPEN _popen
+#else
+#define TQT_POPEN popen
+#endif
+
+TQString loadFile( const TQString &fileName )
+{
+ TQFile file( fileName );
+ if ( !file.open(IO_ReadOnly) ) {
+ fprintf( stderr, "error: Cannot load '%s': %s\n",
+ file.name().latin1(),
+ TQT_TQSTRING_OBJECT(file.errorString()).latin1() );
+ return TQString();
+ }
+
+ TQTextStream in( &file );
+ return in.read();
+}
+
+TQMap<TQString, TQString> proFileTagMap( const TQString& text )
+{
+ TQString t = text;
+ TQMap<TQString, TQString> tagMap;
+ bool stillProcess = true; // If include() has a $$tag then we need to reprocess
+
+ while(stillProcess) {
+
+ /*
+ Strip any commments before we try to include. We
+ still need to do it after we include to make sure the
+ included file does not have comments
+ */
+ t.tqreplace( TQRegExp(TQString("#[^\n]*\n")), TQString(" ") );
+
+ /*
+ Process include() commands.
+ $$PWD is a special case so we have to change it while
+ we know where the included file is.
+ */
+ TQRegExp callToInclude("include\\s*\\(\\s*([^()\\s]+)\\s*\\)");
+ int i = 0;
+ while ( (i = callToInclude.search(t, i)) != -1 ) {
+ bool doneWithVar = false;
+ TQString fileName = callToInclude.cap(1);
+ TQString after = fileName.tqreplace("$$PWD", TQDir::currentDirPath());
+ if (!tagMap.isEmpty() && after.tqcontains("$$")) {
+ TQRegExp var( "\\$\\$[({]?([a-zA-Z0-9_]+)[)}]?" );
+ int ii = 0;
+ while ((ii = after.tqfind(var, ii)) != -1) {
+ if (tagMap.tqcontains(var.cap(1))) {
+ after.tqreplace(ii, var.cap(0).length(), tagMap[var.cap(1)]);
+ } else { // Couldn't tqfind it
+ doneWithVar = true;
+ break;
+ }
+ }
+
+ }
+ if (doneWithVar || !after.tqcontains("$$")) {
+ after = loadFile(after);
+ TQFileInfo fi(callToInclude.cap(1));
+ after.tqreplace("$$PWD", fi.dirPath());
+ t.tqreplace( i, callToInclude.matchedLength(), after );
+ }
+ i += after.length();
+ }
+
+ /*
+ Strip comments, merge lines ending with backslash, add
+ spaces around '=' and '+=', tqreplace '\n' with ';', and
+ simplify white spaces.
+ */
+ t.tqreplace( TQRegExp(TQString("#[^\n]*\n")), TQString(" ") );
+ t.tqreplace( TQRegExp(TQString("\\\\[^\n\\S]*\n")), TQString(" ") );
+ t.tqreplace( "=", TQString(" = ") );
+ t.tqreplace( "+ =", TQString(" += ") );
+ t.tqreplace( "\n", TQString(";") );
+ t = t.simplifyWhiteSpace();
+
+ /*
+ Populate tagMap with 'key = value' entries.
+ */
+ TQStringList lines = TQStringList::split( TQChar(';'), t );
+ TQStringList::Iterator line;
+ for ( line = lines.begin(); line != lines.end(); ++line ) {
+ TQStringList toks = TQStringList::split( TQChar(' '), *line );
+
+ if ( toks.count() >= 3 &&
+ (toks[1] == TQString("=") || toks[1] == TQString("+=")) ) {
+ TQString tag = toks.first();
+ int k = tag.tqfindRev( TQChar(':') ); // as in 'unix:'
+ if ( k != -1 )
+ tag = tag.mid( k + 1 );
+ toks.remove( toks.begin() );
+
+ TQString action = toks.first();
+ toks.remove( toks.begin() );
+
+ if ( tagMap.tqcontains(tag) ) {
+ if ( action == TQString("=") )
+ tagMap.tqreplace( tag, toks.join(TQChar(' ')) );
+ else
+ tagMap[tag] += TQChar( ' ' ) + toks.join( TQChar(' ') );
+ } else {
+ tagMap[tag] = toks.join( TQChar(' ') );
+ }
+ }
+ }
+
+ /*
+ Expand $$variables within the 'value' part of a 'key = value'
+ pair.
+ */
+ TQRegExp var( "\\$\\$[({]?([a-zA-Z0-9_]+)[)}]?" );
+ TQMap<TQString, TQString>::Iterator it;
+ for ( it = tagMap.begin(); it != tagMap.end(); ++it ) {
+ int i = 0;
+ while ( (i = var.search((*it), i)) != -1 ) {
+ int len = var.matchedLength();
+ TQString invocation = var.cap(1);
+ TQString after;
+
+ if ( invocation == "system" ) {
+ // skip system(); it will be handled in the next pass
+ ++i;
+ } else {
+ if ( tagMap.tqcontains(invocation) )
+ after = tagMap[invocation];
+ else if (invocation.lower() == "pwd")
+ after = TQDir::currentDirPath();
+ (*it).tqreplace( i, len, after );
+ i += after.length();
+ }
+ }
+ }
+
+ /*
+ Execute system() calls.
+ */
+ TQRegExp callToSystem( "\\$\\$system\\s*\\(([^()]*)\\)" );
+ for ( it = tagMap.begin(); it != tagMap.end(); ++it ) {
+ int i = 0;
+ while ( (i = callToSystem.search((*it), i)) != -1 ) {
+ /*
+ This code is stolen from qmake's project.cpp file.
+ Ideally we would use the same parser, so we wouldn't
+ have this code duplication.
+ */
+ TQString after;
+ char buff[256];
+ FILE *proc = TQT_POPEN( TQT_TQSTRING_OBJECT(callToSystem.cap(1)).latin1(), "r" );
+ while ( proc && !feof(proc) ) {
+ int read_in = (int)fread( buff, 1, 255, proc );
+ if ( !read_in )
+ break;
+ for ( int i = 0; i < read_in; i++ ) {
+ if ( buff[i] == '\n' || buff[i] == '\t' )
+ buff[i] = ' ';
+ }
+ buff[read_in] = '\0';
+ after += buff;
+ }
+ (*it).tqreplace( i, callToSystem.matchedLength(), after );
+ i += after.length();
+ }
+ }
+ stillProcess = callToInclude.search(t) != -1;
+ }
+ return tagMap;
+}
diff --git a/tqtinterface/qt4/tools/linguist/shared/proparser.h b/tqtinterface/qt4/tools/linguist/shared/proparser.h
new file mode 100644
index 0000000..abfb68c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/shared/proparser.h
@@ -0,0 +1,42 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Linguist.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PROPARSER_H
+#define PROPARSER_H
+
+#include <tqmap.h>
+#include <tqstring.h>
+
+TQMap<TQString, TQString> proFileTagMap( const TQString& text );
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt1/main.cpp b/tqtinterface/qt4/tools/linguist/tutorial/tt1/main.cpp
new file mode 100644
index 0000000..27373be
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt1/main.cpp
@@ -0,0 +1,25 @@
+/****************************************************************
+**
+** Translation tutorial 1
+**
+****************************************************************/
+
+#include <tqapplication.h>
+#include <tqpushbutton.h>
+#include <tqtranslator.h>
+
+
+int main( int argc, char **argv )
+{
+ TQApplication app( argc, argv );
+
+ TQTranslator translator( 0 );
+ translator.load( "tt1_la", "." );
+ app.installTranslator( &translator );
+
+ TQPushButton hello( TQPushButton::tr("Hello world!"), 0 );
+
+ app.setMainWidget( &hello );
+ hello.show();
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt1/tt1.pro b/tqtinterface/qt4/tools/linguist/tutorial/tt1/tt1.pro
new file mode 100644
index 0000000..3b5249c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt1/tt1.pro
@@ -0,0 +1,4 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+SOURCES = main.cpp
+TRANSLATIONS = tt1_la.ts
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.cpp b/tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.cpp
new file mode 100644
index 0000000..722320d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.cpp
@@ -0,0 +1,31 @@
+/****************************************************************
+**
+** Implementation of ArrowPad class, translation tutorial 2
+**
+****************************************************************/
+
+#include "arrowpad.h"
+
+#include <tqpushbutton.h>
+
+ArrowPad::ArrowPad( TQWidget *tqparent, const char *name )
+ : TQGrid( 3, Qt::Horizontal, tqparent, name )
+{
+ setMargin( 10 );
+ setSpacing( 10 );
+
+ skip();
+ (void) new TQPushButton( tqtr("&Up"), this );
+ skip();
+ (void) new TQPushButton( tqtr("&Left"), this );
+ skip();
+ (void) new TQPushButton( tqtr("&Right"), this );
+ skip();
+ (void) new TQPushButton( tqtr("&Down"), this );
+ skip();
+}
+
+void ArrowPad::skip()
+{
+ (void) new TQWidget( this );
+}
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.h b/tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.h
new file mode 100644
index 0000000..b273791
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt2/arrowpad.h
@@ -0,0 +1,22 @@
+/****************************************************************
+**
+** Definition of ArrowPad class, translation tutorial 2
+**
+****************************************************************/
+
+#ifndef ARROWPAD_H
+#define ARROWPAD_H
+
+#include <tqgrid.h>
+
+class ArrowPad : public TQGrid
+{
+ TQ_OBJECT
+public:
+ ArrowPad( TQWidget *tqparent = 0, const char *name = 0 );
+
+private:
+ void skip();
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt2/main.cpp b/tqtinterface/qt4/tools/linguist/tutorial/tt2/main.cpp
new file mode 100644
index 0000000..f4cbea9
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt2/main.cpp
@@ -0,0 +1,26 @@
+/****************************************************************
+**
+** Translation tutorial 2
+**
+****************************************************************/
+
+#include "mainwindow.h"
+
+#include <tqapplication.h>
+#include <tqstring.h>
+#include <tqtextcodec.h>
+#include <tqtranslator.h>
+
+int main( int argc, char **argv )
+{
+ TQApplication app( argc, argv );
+
+ TQTranslator translator( 0 );
+ translator.load( TQString("tt2_") + TQTextCodec::locale(), "." );
+ app.installTranslator( &translator );
+
+ MainWindow *mw = new MainWindow;
+ app.setMainWidget( mw );
+ mw->show();
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.cpp b/tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.cpp
new file mode 100644
index 0000000..e91a4ce
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.cpp
@@ -0,0 +1,26 @@
+/****************************************************************
+**
+** Implementation of MainWindow class, translation tutorial 2
+**
+****************************************************************/
+
+#include "arrowpad.h"
+#include "mainwindow.h"
+
+#include <tqaccel.h>
+#include <tqapplication.h>
+#include <tqmenubar.h>
+#include <tqpopupmenu.h>
+
+MainWindow::MainWindow( TQWidget *tqparent, const char *name )
+ : TQMainWindow( tqparent, name )
+{
+ ArrowPad *ap = new ArrowPad( this, "arrow pad" );
+ setCentralWidget( ap );
+
+ TQPopupMenu *file = new TQPopupMenu( this );
+ file->insertItem( tqtr("E&xit"), tqApp, TQT_SLOT(quit()),
+ tqtr("Ctrl+Q", "Quit") );
+ menuBar()->insertItem( tqtr("&File"), file );
+ menuBar()->setSeparator( TQMenuBar::InWindowsStyle );
+}
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.h b/tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.h
new file mode 100644
index 0000000..46bdf50
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt2/mainwindow.h
@@ -0,0 +1,19 @@
+/****************************************************************
+**
+** Definition of MainWindow class, translation tutorial 2
+**
+****************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <tqmainwindow.h>
+
+class MainWindow : public TQMainWindow
+{
+ TQ_OBJECT
+public:
+ MainWindow( TQWidget *tqparent = 0, const char *name = 0 );
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt2/tt2.pro b/tqtinterface/qt4/tools/linguist/tutorial/tt2/tt2.pro
new file mode 100644
index 0000000..8c1ea6d
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt2/tt2.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+HEADERS = arrowpad.h \
+ mainwindow.h
+SOURCES = arrowpad.cpp \
+ main.cpp \
+ mainwindow.cpp
+TRANSLATIONS = tt2_fr.ts \
+ tt2_nl.ts
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt3/main.cpp b/tqtinterface/qt4/tools/linguist/tutorial/tt3/main.cpp
new file mode 100644
index 0000000..141b8c8
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt3/main.cpp
@@ -0,0 +1,26 @@
+/****************************************************************
+**
+** Translation tutorial 3
+**
+****************************************************************/
+
+#include "mainwindow.h"
+
+#include <tqapplication.h>
+#include <tqstring.h>
+#include <tqtextcodec.h>
+#include <tqtranslator.h>
+
+int main( int argc, char **argv )
+{
+ TQApplication app( argc, argv );
+
+ TQTranslator translator( 0 );
+ translator.load( TQString("tt3_") + TQTextCodec::locale(), "." );
+ app.installTranslator( &translator );
+
+ MainWindow *mw = new MainWindow;
+ app.setMainWidget( mw );
+ mw->show();
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.cpp b/tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.cpp
new file mode 100644
index 0000000..c533344
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.cpp
@@ -0,0 +1,47 @@
+/****************************************************************
+**
+** Implementation of MainWindow class, translation tutorial 3
+**
+****************************************************************/
+
+#include "mainwindow.h"
+#include "printpanel.h"
+
+#include <tqaccel.h>
+#include <tqapplication.h>
+#include <tqmenubar.h>
+#include <tqmessagebox.h>
+#include <tqpopupmenu.h>
+
+MainWindow::MainWindow( TQWidget *tqparent, const char *name )
+ : TQMainWindow( tqparent, name )
+{
+ setCaption( tqtr("Troll Print 1.0") );
+
+ PrintPanel *pp = new PrintPanel( this );
+ setCentralWidget( pp );
+
+ TQPopupMenu *file = new TQPopupMenu( this );
+ file->insertItem( tqtr("E&xit"), tqApp, TQT_SLOT(quit()),
+ tqtr("Ctrl+Q", "Quit") );
+ TQPopupMenu *help = new TQPopupMenu( this );
+ help->insertItem( tqtr("&About"), this, TQT_SLOT(about()), Qt::Key_F1 );
+ help->insertItem( tqtr("About &TQt"), this, TQT_SLOT(aboutTQt()) );
+
+ menuBar()->insertItem( tqtr("&File"), file );
+ menuBar()->insertSeparator();
+ menuBar()->insertItem( tqtr("&Help"), help );
+ menuBar()->setSeparator( TQMenuBar::InWindowsStyle );
+}
+
+void MainWindow::about()
+{
+ TQMessageBox::information( this, tqtr("About Troll Print 1.0"),
+ tqtr("Troll Print 1.0.\n\n"
+ "Copyright 1999 Macroshaft, Inc.") );
+}
+
+void MainWindow::aboutTQt()
+{
+ TQMessageBox::aboutTQt( this );
+}
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.h b/tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.h
new file mode 100644
index 0000000..723072c
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt3/mainwindow.h
@@ -0,0 +1,24 @@
+/****************************************************************
+**
+** Definition of MainWindow class, translation tutorial 3
+**
+****************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <tqmainwindow.h>
+
+class MainWindow : public TQMainWindow
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ MainWindow( TQWidget *tqparent = 0, const char *name = 0 );
+
+private Q_SLOTS:
+ void about();
+ void aboutTQt();
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.cpp b/tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.cpp
new file mode 100644
index 0000000..85c507b
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.cpp
@@ -0,0 +1,37 @@
+/****************************************************************
+**
+** Implementation of PrintPanel class, translation tutorial 3
+**
+****************************************************************/
+
+#include "printpanel.h"
+
+#include <tqlabel.h>
+#include <tqradiobutton.h>
+#include <tqhbuttongroup.h>
+
+PrintPanel::PrintPanel( TQWidget *tqparent, const char *name )
+ : TQVBox( tqparent, name )
+{
+ setMargin( 10 );
+ setSpacing( 10 );
+
+/*
+ TQLabel *lab = new TQLabel( tr("<b>TROLL PRINT</b>"), this );
+ lab->tqsetAlignment( AlignCenter );
+*/
+
+ TQRadioButton *but;
+
+ TQHButtonGroup *twoSided = new TQHButtonGroup( this );
+ twoSided->setTitle( tr("2-sided") );
+ but = new TQRadioButton( tr("Enabled"), twoSided );
+ but = new TQRadioButton( tr("Disabled"), twoSided );
+ but->toggle();
+
+ TQHButtonGroup *colors = new TQHButtonGroup( this );
+ colors->setTitle( tr("Colors") );
+ but = new TQRadioButton( tr("Enabled"), colors );
+ but = new TQRadioButton( tr("Disabled"), colors );
+ but->toggle();
+}
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.h b/tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.h
new file mode 100644
index 0000000..07bd83f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt3/printpanel.h
@@ -0,0 +1,19 @@
+/****************************************************************
+**
+** Definition of PrintPanel class, translation tutorial 3
+**
+****************************************************************/
+
+#ifndef PRINTPANEL_H
+#define PRINTPANEL_H
+
+#include <tqvbox.h>
+
+class PrintPanel : public TQVBox
+{
+ TQ_OBJECT
+public:
+ PrintPanel( TQWidget *tqparent = 0, const char *name = 0 );
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3.pro b/tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3.pro
new file mode 100644
index 0000000..c219d1e
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+HEADERS = mainwindow.h \
+ printpanel.h
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ printpanel.cpp
+TRANSLATIONS = tt3_pt.ts
diff --git a/tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3_pt.ts b/tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3_pt.ts
new file mode 100644
index 0000000..cf8ff4f
--- /dev/null
+++ b/tqtinterface/qt4/tools/linguist/tutorial/tt3/tt3_pt.ts
@@ -0,0 +1,65 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Troll Print 1.0</source>
+ <translation>Troll Imprimir 1.0</translation>
+ </message>
+ <message>
+ <source>E&amp;xit</source>
+ <translation>&amp;Sair</translation>
+ </message>
+ <message>
+ <source>&amp;About</source>
+ <translation>&amp;Sobre</translation>
+ </message>
+ <message>
+ <source>About &amp;Qt</source>
+ <translation>Sobre &amp;Qt</translation>
+ </message>
+ <message>
+ <source>&amp;File</source>
+ <translation>&amp;Arquivo</translation>
+ </message>
+ <message>
+ <source>&amp;Help</source>
+ <translation>A&amp;juda</translation>
+ </message>
+ <message>
+ <source>About Troll Print 1.0</source>
+ <translation>Sobre Troll Imprimir 1.0</translation>
+ </message>
+ <message>
+ <source>Troll Print 1.0.
+
+Copyright 1999 Macroshaft, Inc.</source>
+ <translation>Troll Imprimir 1.0
+
+Copyright 1999 Macroshaft, Inc.</translation>
+ </message>
+ <message>
+ <source>Ctrl+Q</source>
+ <comment>Quit</comment>
+ <translation>Ctrl+Q</translation>
+ </message>
+</context>
+<context>
+ <name>PrintPanel</name>
+ <message>
+ <source>2-sided</source>
+ <translation>2-lados</translation>
+ </message>
+ <message>
+ <source>Enabled</source>
+ <translation>Ativado</translation>
+ </message>
+ <message>
+ <source>Disabled</source>
+ <translation>Desativado</translation>
+ </message>
+ <message>
+ <source>Colors</source>
+ <translation>Cores</translation>
+ </message>
+</context>
+</TS>
diff --git a/tqtinterface/qt4/tools/makeqpf/main.cpp b/tqtinterface/qt4/tools/makeqpf/main.cpp
new file mode 100644
index 0000000..00e6cb0
--- /dev/null
+++ b/tqtinterface/qt4/tools/makeqpf/main.cpp
@@ -0,0 +1,322 @@
+/**********************************************************************
+** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt/Embedded.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqapplication.h>
+#include <tqtextstream.h>
+#include <tqscrollview.h>
+#include <tqfile.h>
+#include <tqfont.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
+#include <tqstringlist.h>
+#include <tqlistview.h>
+#include <tqmainwindow.h>
+#include <tqmessagebox.h>
+#include <tqpainter.h>
+#ifdef TQ_WS_TQWS
+#include <tqmemorymanager_qws.h>
+#endif
+
+#include <stdlib.h>
+
+
+class FontViewItem : public TQListViewItem {
+ TQString family;
+ int pointSize;
+ int weight;
+ bool italic;
+ TQFont font;
+
+public:
+ FontViewItem(const TQString& f, int pt, int w, bool ital, TQListView* tqparent) :
+ TQListViewItem(tqparent),
+ family(f), pointSize(pt), weight(w), italic(ital)
+ {
+ }
+
+ void renderAndSave()
+ {
+ font = TQFont(family,pointSize,weight,italic);
+#ifdef TQ_WS_TQWS
+ memorymanager->savePrerenderedFont((TQMemoryManager::FontID)font.handle());
+#endif
+ setHeight(TQFontMetrics(font).lineSpacing());
+ tqrepaint();
+ }
+
+ void render(int from, int to)
+ {
+ font = TQFont(family,pointSize,weight,italic);
+#ifdef TQ_WS_TQWS
+ for (int i=from; i<=to; i++) {
+ if ( memorymanager->inFont((TQMemoryManager::FontID)font.handle(),TQChar(i))) {
+ memorymanager->lockGlyph((TQMemoryManager::FontID)font.handle(),TQChar(i));
+ memorymanager->unlockGlyph((TQMemoryManager::FontID)font.handle(),TQChar(i));
+ }
+ }
+#endif
+ }
+
+ void save()
+ {
+ font = TQFont(family,pointSize,weight,italic);
+#ifdef TQ_WS_TQWS
+ memorymanager->savePrerenderedFont((TQMemoryManager::FontID)font.handle(),FALSE);
+#endif
+ setHeight(TQFontMetrics(font).lineSpacing());
+ tqrepaint();
+ }
+
+ void paintCell( TQPainter *p, const TQColorGroup & cg,
+ int column, int width, int tqalignment )
+ {
+ p->setFont(font);
+ TQListViewItem::paintCell(p,cg,column,width,tqalignment);
+ }
+
+ int width( const TQFontMetrics&,
+ const TQListView* lv, int column) const
+ {
+ TQFontMetrics fm(font);
+ return TQListViewItem::width(fm,lv,column);
+ }
+
+ TQString text(int col) const
+ {
+ switch (col) {
+ case 0:
+ return family;
+ case 1:
+ return TQString::number(pointSize)+"pt";
+ case 2:
+ if ( weight < TQFont::Normal ) {
+ return "Light";
+ } else if ( weight >= TQFont::Black ) {
+ return "Black";
+ } else if ( weight >= TQFont::Bold ) {
+ return "Bold";
+ } else if ( weight >= TQFont::DemiBold ) {
+ return "DemiBold";
+ } else {
+ return "Normal";
+ }
+ case 3:
+ return italic ? "Italic" : "Roman";
+ }
+ return TQString();
+ }
+};
+
+extern TQString qws_topdir();
+
+class MakeTQPF : public TQMainWindow
+{
+ TQ_OBJECT
+ TQListView* view;
+public:
+ MakeTQPF()
+ {
+ view = new TQListView(this);
+ view->addColumn("Family");
+ view->addColumn("Size");
+ view->addColumn("Weight");
+ view->addColumn("Style");
+ setCentralWidget(view);
+ TQString fontdir = qws_topdir() + "/lib/fonts";
+ readFontDir(fontdir);
+
+ connect(view,TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this,TQT_SLOT(renderAndSave(TQListViewItem*)));
+ }
+
+ void readFontDir(const TQString& fntd)
+ {
+ TQString fontdir = fntd + "/fontdir";
+ TQFile fd(fontdir);
+ if ( !fd.open(IO_ReadOnly) ) {
+ TQMessageBox::warning(this, "Read Error",
+ "<p>Cannot read "+fontdir);
+ return;
+ }
+ while ( !fd.atEnd() ) {
+ TQString line;
+ fd.readLine(line,9999);
+ if ( line[0] != '#' ) {
+ TQStringList attr = TQStringList::split(" ",line);
+ if ( attr.count() >= 7 ) {
+ TQString family = attr[0];
+ int weight = TQString(attr[4]).toInt();
+ bool italic = TQString(attr[3]) == "y";
+ TQStringList sizes = attr[5];
+ if ( sizes[0] == "0" ) {
+ if ( attr[7].isNull() )
+ sizes = TQStringList::split(',',attr[6]);
+ else
+ sizes = TQStringList::split(',',attr[7]);
+ }
+ for (TQStringList::Iterator it = sizes.begin(); it != sizes.end(); ++it) {
+ int pointSize = (*it).toInt()/10;
+ if ( pointSize )
+ new FontViewItem(
+ family, pointSize, weight, italic, view);
+ }
+ }
+ }
+ }
+ }
+
+ void renderAndSaveAll()
+ {
+ TQListViewItem* c = view->firstChild();
+ while ( c ) {
+ renderAndSave(c);
+ tqApp->processEvents();
+ c = c->nextSibling();
+ }
+ }
+
+ void renderAndSave(const TQString& family)
+ {
+ TQListViewItem* c = view->firstChild();
+ while ( c ) {
+ if ( c->text(0).lower() == family.lower() )
+ renderAndSave(c);
+ c = c->nextSibling();
+ }
+ }
+
+ void render(const TQString& family, int from, int to)
+ {
+ TQListViewItem* c = view->firstChild();
+ while ( c ) {
+ if ( c->text(0).lower() == family.lower() )
+ ((FontViewItem*)c)->render(from,to);
+ c = c->nextSibling();
+ }
+ }
+
+ void save(const TQString& family)
+ {
+ TQListViewItem* c = view->firstChild();
+ while ( c ) {
+ if ( c->text(0).lower() == family.lower() )
+ ((FontViewItem*)c)->save();
+ c = c->nextSibling();
+ }
+ }
+
+private Q_SLOTS:
+ void renderAndSave(TQListViewItem* i)
+ {
+ ((FontViewItem*)i)->renderAndSave();
+ }
+};
+
+static void usage()
+{
+ qWarning("Usage: makeqpf [-A] [-f spec-file] [font ...]");
+ qWarning("");
+ qWarning(" Saves TQPF font files by rendering and saving fonts.");
+ qWarning("");
+ qWarning(" -A = Render and save all fonts in fontdir");
+ qWarning(" -f = File of lines:");
+ qWarning(" fontname character-ranges");
+ qWarning(" eg.");
+ qWarning(" smoothtimes 0-ff,20a0-20af");
+ qWarning(" font = Font to render and save");
+}
+
+int main(int argc, char** argv)
+{
+ TQApplication app(argc, argv, TQApplication::GuiServer);
+ MakeTQPF m;
+ if ( argc > 1 ) {
+ argv++;
+ TQString specfile;
+ while ( *argv && argv[0][0] == '-' ) {
+ if (argv[0][1] == 'A' )
+ m.renderAndSaveAll();
+ else if (argv[0][1] == 'f' )
+ specfile = *++argv;
+ else {
+ usage();
+ specfile=TQString();
+ *argv=0;
+ break;
+ }
+ argv++;
+ }
+ if ( !specfile.isNull() ) {
+ TQFile f(specfile);
+ if ( f.open(IO_ReadOnly) ) {
+ TQTextStream s(&f);
+ while (!s.atEnd()) {
+ TQString family,ranges;
+ s >> family >> ranges;
+ TQStringList r = TQStringList::split(',',ranges);
+ for (TQStringList::Iterator it=r.begin(); it!=r.end(); ++it) {
+ TQString rng = *it;
+ int dash = rng.tqfind('-');
+ int from,to;
+ if ( dash==0 ) {
+ from=0;
+ to=rng.mid(1).toInt(0,16);
+ } else if ( dash==(int)rng.length()-1 ) {
+ from=rng.left(dash).toInt(0,16);
+ to=65535;
+ } else if ( dash<0 ) {
+ from=to=rng.toInt(0,16);
+ } else {
+ from=rng.left(dash).toInt(0,16);
+ to=rng.mid(dash+1).toInt(0,16);
+ }
+ m.render(family,from,to);
+ }
+ m.save(family);
+ }
+ } else {
+ qWarning("Cannot open %s",specfile.latin1());
+ }
+ } else {
+ while (*argv)
+ m.renderAndSave(*argv++);
+ }
+ } else {
+ // Interactive
+ app.setMainWidget(&m);
+ m.show();
+ return app.exec();
+ }
+}
+
+#include "main.tqmoc"
diff --git a/tqtinterface/qt4/tools/makeqpf/makeall b/tqtinterface/qt4/tools/makeqpf/makeall
new file mode 100755
index 0000000..cd5008c
--- /dev/null
+++ b/tqtinterface/qt4/tools/makeqpf/makeall
@@ -0,0 +1,4 @@
+for dpy in LinuxFb Transformed:Rot90 Transformed:Rot180 Transformed:Rot270
+do
+ QWS_DISPLAY=$dpy ./makeqpf
+done
diff --git a/tqtinterface/qt4/tools/makeqpf/makeqpf.pro b/tqtinterface/qt4/tools/makeqpf/makeqpf.pro
new file mode 100644
index 0000000..f434228
--- /dev/null
+++ b/tqtinterface/qt4/tools/makeqpf/makeqpf.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+HEADERS =
+SOURCES = main.cpp
+INTERFACES =
+TARGET = makeqpf
+REQUIRES=full-config nocrosscompiler
diff --git a/tqtinterface/qt4/tools/mergetr/mergetr.cpp b/tqtinterface/qt4/tools/mergetr/mergetr.cpp
new file mode 100644
index 0000000..c0a33b6
--- /dev/null
+++ b/tqtinterface/qt4/tools/mergetr/mergetr.cpp
@@ -0,0 +1,347 @@
+/**********************************************************************
+** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved.
+**
+** This is a utility program for merging tqfindtr msgfiles
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqfile.h>
+#include <tqbuffer.h>
+#include <tqtextstream.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+bool isEmpty( const TQString& line )
+{
+ int i = 0;
+ while ( i < int(line.length()) ) {
+ if ( !line[i].isSpace() )
+ return FALSE;
+ i++;
+ }
+ return TRUE;
+}
+
+
+bool hasHandle( const TQString& line, const TQString& handle)
+{
+ return line.left(handle.length()) == handle;
+}
+
+bool isUserComment( const TQString& line )
+{
+ return line.length() > 2 && line[0] == '#' && line[1].isSpace();
+}
+
+bool isSystemComment( const TQString& line )
+{
+ return line.length() > 1 && line[0] == '#' && !line[1].isSpace();
+}
+
+
+TQString extractContents( const TQString& line )
+{
+ TQString contents;
+ int pos = 0;
+ bool inStr = FALSE;
+ while ( pos < int(line.length()) ) {
+ if ( line[pos] == '"' ) {
+ inStr = !inStr;
+ pos++;
+ } else {
+ if ( inStr ) {
+ if ( line[pos] == '\\') {
+ pos++;
+ switch (char(line[pos]) ) {
+ case 'n':
+ contents += '\n';
+ break;
+ case 't':
+ contents += '\t';
+ break;
+ case 'r':
+ contents += '\r';
+ break;
+ case 'a':
+ contents += '\a';
+ break;
+ case 'f':
+ contents += '\f';
+ break;
+ case 'v':
+ contents += '\v';
+ break;
+ case 'b':
+ contents += '\b';
+ break;
+ default:
+ contents += char(line[pos]);
+ break;
+ }
+ } else {
+ contents += line[pos];
+ }
+ }
+ pos++;
+ }
+ }
+ return contents;
+}
+
+struct Item
+{
+ Item() {}
+ Item( const Item &i ) :usercomments(i.usercomments),
+ systemcomments(i.systemcomments), msgid(i.msgid), msgstr(i.msgstr){}
+ Item &operator=( const Item &i ) {
+ usercomments = i.usercomments; systemcomments = i.systemcomments;
+ msgid = i.msgid; msgstr = i.msgstr;
+ return *this;
+ }
+ bool isNull() const { return usercomments.isNull()&&systemcomments.isNull()
+ &&msgstr.isNull() &&msgid.isNull(); }
+
+ TQString usercomments;
+ TQString systemcomments;
+ TQString msgid;
+ TQString msgstr;
+};
+
+enum tqStatus { Equal, First, Second, FirstJunk, SecondJunk };
+
+Item getItem( TQTextStream &str, TQString &s )
+{
+ Item i;
+ while ( !str.atEnd() && s.isEmpty() ) {
+ s = str.readLine().stripWhiteSpace();
+ }
+ while ( !str.atEnd() && !s.isEmpty() ) {
+ if ( isSystemComment(s) ) {
+ i.systemcomments += s + "\n";
+ s = str.readLine().stripWhiteSpace();
+ } else if ( isUserComment(s) ) {
+ i.usercomments += s + "\n";
+ s = str.readLine().stripWhiteSpace();
+ } else if ( hasHandle( s, "msgid" ) ) {
+ TQString r = s + "\n";
+ s = str.readLine().stripWhiteSpace();
+ while ( !str.atEnd() && hasHandle(s, "\"") ) {
+ r += s;
+ s = str.readLine().stripWhiteSpace();
+ r += "\n";
+ }
+ i.msgid = r;
+ } else if ( hasHandle( s, "msgstr" ) ) {
+ TQString r = s + "\n";
+ s = str.readLine().stripWhiteSpace();
+ while ( hasHandle(s, "\"") ) {
+ r += s;
+ s = str.readLine().stripWhiteSpace();
+ r += "\n";
+ }
+ i.msgstr = r;
+ } else {
+ s = str.readLine().stripWhiteSpace();
+ }
+ }
+ return i;
+}
+
+static int nMerge, nNew, nOld, nJunk;
+
+
+void writecomment( TQTextStream &str, const TQString &s )
+{
+ if ( s.isEmpty() )
+ return;
+ int idx = 0;
+ int len = s.length();
+ while ( idx < len ) {
+ int nl = s.tqfind( '\n', idx );
+ if ( nl < 0 ) {
+ qWarning( "writecomment: string lacks newline" );
+ str << "# " << s.mid( idx ) << '\n';
+ return;
+ }
+ str << "# " << s.mid( idx, nl-idx+1 );
+ idx = nl+1;
+ }
+}
+
+void writemerge( TQTextStream &str, const Item &i1, const Item &i2 )
+{
+ nMerge++;
+ if ( !i2.usercomments.isEmpty() )
+ str << i2.usercomments;
+ if ( !i1.systemcomments.isEmpty() )
+ str << i1.systemcomments;
+ str << i1.msgid;
+ str << i2.msgstr;
+ str << "\n";
+}
+void writenew( TQTextStream &str, const Item &i1 )
+{
+ nNew++;
+ if ( !i1.usercomments.isEmpty() )
+ str << i1.usercomments;
+ if ( !i1.systemcomments.isEmpty() )
+ str << i1.systemcomments;
+ str << i1.msgid;
+ str << i1.msgstr;
+ str << "\n";
+}
+
+void writeold( TQTextStream &str, const Item &i2 )
+{
+ nOld++;
+ writecomment( str, i2.usercomments );
+ writecomment( str, i2.systemcomments );
+ writecomment( str, i2.msgid );
+ writecomment( str, i2.msgstr );
+ str << "\n";
+}
+
+void writejunk( TQTextStream &str, const Item &it )
+{
+ nJunk++;
+ if ( !it.usercomments.isEmpty() )
+ str << it.usercomments;
+ writecomment( str, it.systemcomments );
+ writecomment( str, it.msgid );
+ writecomment( str, it.msgstr );
+ str << "\n";
+}
+
+tqStatus compare( const Item &i1, const Item &i2 )
+{
+ if ( i1.isNull() && i2.isNull() )
+ return Equal;
+ if ( i1.isNull() )
+ return Second;
+ if ( i2.isNull() )
+ return First;
+ if ( i1.msgid.isEmpty() )
+ return FirstJunk;
+ if ( i2.msgid.isEmpty() )
+ return SecondJunk;
+ TQString s1 = extractContents( i1.msgid );
+ TQString s2 = extractContents( i2.msgid );
+ if ( !s1 && !s2 )
+ return Equal;
+ if ( !s1 )
+ return First;
+ if ( !s2 )
+ return Second;
+ int i = strcmp( s1.ascii(), s2.ascii() );
+ if ( i < 0 )
+ return First;
+ if ( i == 0 )
+ return Equal;
+ // i > 0
+ return Second;
+}
+
+void merge( const TQString& newname, const TQString& oldname,
+ const TQString& resname )
+{
+ TQFile f1(newname);
+ if ( !f1.open( IO_ReadOnly) )
+ return;
+
+ TQFile f2(oldname);
+ if ( !f2.open( IO_ReadOnly) )
+ return;
+
+ TQBuffer fout;
+ fout.open(IO_WriteOnly);
+
+ TQTextStream in1( &f1 );
+ TQTextStream in2( &f2 );
+ TQTextStream out( &fout );
+
+ TQString buf1 = in1.readLine().stripWhiteSpace();
+ TQString buf2 = in2.readLine().stripWhiteSpace();
+
+ Item i1 = getItem( in1, buf1 );
+ Item i2 = getItem( in2, buf2 );
+ while ( !i1.isNull() || !i2.isNull() ) {
+ tqStatus s = compare( i1, i2 );
+ if ( s == Equal ) {
+ writemerge(out,i1,i2);
+ i1 = getItem( in1, buf1 );
+ i2 = getItem( in2, buf2 );
+ } else if ( s == First ) {
+ writenew( out, i1 );
+ i1 = getItem( in1, buf1 );
+ } else if ( s == FirstJunk ) {
+ //solitary comment
+ writejunk( out, i1 );
+ i1 = getItem( in1, buf1 );
+ } else if ( s == Second ) {
+ writeold( out, i2 );
+ i2 = getItem( in2, buf2 );
+ } else if ( s == SecondJunk ) {
+ //solitary comment
+ writejunk( out, i2 );
+ i2 = getItem( in2, buf2 );
+ }
+ }
+
+ f1.close();
+ f2.close();
+ fout.close();
+ TQFile fileout(resname);
+ if ( !fileout.open( IO_WriteOnly | IO_Translate ) )
+ return;
+ fileout.writeBlock(fout.buffer());
+ fileout.close();
+}
+
+
+int main( int argc, char* argv[] )
+{
+
+ int orgfile = 1;
+ int newfile = 2;
+
+ if ( argc <= newfile || argc > 1 && argv[1][0] == '-') {
+ printf("usage: %s orgfile newfile [outfile]\n", argv[0]);
+ exit(1);
+ }
+
+ merge( argv[newfile], argv[orgfile],
+ argc > newfile+1 ? argv[newfile+1] : argv[orgfile] );
+
+ printf( "Merged %d entries, added %d new entries and removed %d entries\n",
+ nMerge, nNew, nOld );
+ if ( nJunk > 0 )
+ printf( "Found %d junk entries\n", nJunk );
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/mergetr/mergetr.pro b/tqtinterface/qt4/tools/mergetr/mergetr.pro
new file mode 100644
index 0000000..041afe8
--- /dev/null
+++ b/tqtinterface/qt4/tools/mergetr/mergetr.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+CONFIG += console qt warn_on release
+HEADERS =
+SOURCES = mergetr.cpp
+TARGET = mergetr
+REQUIRES=full-config nocrosscompiler
diff --git a/tqtinterface/qt4/tools/msg2qm/msg2qm.cpp b/tqtinterface/qt4/tools/msg2qm/msg2qm.cpp
new file mode 100644
index 0000000..96e77c3
--- /dev/null
+++ b/tqtinterface/qt4/tools/msg2qm/msg2qm.cpp
@@ -0,0 +1,236 @@
+/**********************************************************************
+** Copyright (C) 1998-2008 Trolltech ASA. All rights reserved.
+**
+** This is a utility program for converting tqfindtr msgfiles to
+** qtranslator message files
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqtextcodec.h>
+#include <tqtranslator.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static TQString* defaultScope = 0;
+
+bool hasHandle( const TQString& line, const TQString& handle)
+{
+ return line.left(handle.length()) == handle;
+}
+
+
+TQString extractContents( const TQString& line )
+{
+ TQString contents;
+ if ( line.tqcontains('\"') < 2)
+ return contents;
+ int pos = 0;
+ while ( pos < int(line.length()) && line[pos] != '\"' )
+ pos++;
+ pos++;
+ while ( pos < int(line.length()) && line[pos] != '\"' ) {
+ // 0xa5: the yen sign is the Japanese backslash
+ if ( line[pos] == '\\' || line[pos] == TQChar(0xa5) ) {
+ pos++;
+ switch (char(line[pos]) ) {
+ case 'n':
+ contents += '\n';
+ break;
+ case 't':
+ contents += '\t';
+ break;
+ case 'r':
+ contents += '\r';
+ break;
+ case 'a':
+ contents += '\a';
+ break;
+ case 'f':
+ contents += '\f';
+ break;
+ case 'v':
+ contents += '\v';
+ break;
+ case 'b':
+ contents += '\b';
+ break;
+ default:
+ contents += char(line[pos]);
+ break;
+ }
+ }
+ else
+ contents += line[pos];
+ pos++;
+ }
+ return contents;
+}
+
+
+void addTranslation( TQTranslator* translator, const TQString& msgid, const TQString& msgstr)
+{
+ if (!msgid.isNull() && !msgstr.isNull() ) {
+ TQString scope = "";
+ TQString id = msgid;
+ int coloncolon = msgid.tqfind("::");
+ if (coloncolon != -1) {
+ scope = msgid.left( coloncolon );
+ id = msgid.right( msgid.length() - scope.length() - 2 );
+ }
+ else if (defaultScope)
+ scope = *defaultScope;
+
+ if (translator->tqcontains( scope.ascii(), id.ascii() ) ) {
+ qWarning("Error: \"%s\" already in use", msgid.ascii() );
+ }
+ else {
+ translator->insert( scope.latin1(), id.latin1(), msgstr );
+ }
+ }
+}
+
+
+
+void translate( const TQString& filename, const TQString& qmfile )
+{
+ TQFile f(filename);
+ if ( !f.open( IO_ReadOnly) )
+ return;
+ TQTranslator* translator = new TQTranslator(0);
+ TQTextCodec *codec = 0;
+ for (int pass = 0; pass < 2; pass++) {
+ f.at(0);
+ TQTextStream t( &f );
+ TQString line;
+ TQString msgid;
+ TQString msgstr;
+ if ( codec != 0 ) {
+ t.setCodec( codec );
+ }
+ while ( !t.atEnd() || !line.isEmpty() ) {
+ if (line.isEmpty()) {
+ t.skipWhiteSpace();
+ line = t.readLine();
+ }
+ if ( hasHandle( line, "msgid") ) {
+ msgstr = TQString();
+ msgid = extractContents( line );
+ if (!t.atEnd()) {
+ t.skipWhiteSpace();
+ line = t.readLine();
+ }
+ else
+ line = TQString();
+ while ( hasHandle( line, "\"") ) {
+ msgid += extractContents( line );
+ if (!t.atEnd()) {
+ t.skipWhiteSpace();
+ line = t.readLine();
+ }
+ else
+ line = TQString();
+ }
+ }
+ else if ( hasHandle( line, "msgstr") ) {
+ msgstr = extractContents( line );
+ if (!t.atEnd()) {
+ t.skipWhiteSpace();
+ line = t.readLine();
+ }
+ else
+ line = TQString();
+ while ( hasHandle( line, "\"") ) {
+ msgstr += extractContents( line );
+ if (!t.atEnd()) {
+ t.skipWhiteSpace();
+ line = t.readLine();
+ }
+ else
+ line = TQString();
+ }
+ if ( pass == 1 )
+ addTranslation( translator, msgid, msgstr);
+
+ if ( pass == 0 && msgid.isEmpty() ) {
+ // Check for the encoding.
+ int cpos = msgstr.tqfind( "charset=" );
+ if ( cpos >= 0 ) {
+ cpos = cpos + 8; //skip "charset="
+ int i = cpos;
+ int len = msgstr.length();
+ while ( i < len && !msgstr[i].isSpace() )
+ i++;
+ TQString charset = msgstr.mid( cpos, i-cpos );
+ codec = TQTextCodec::codecForName( charset.ascii() );
+ if ( codec ) {
+ debug( "PO file character set: %s. Codec: %s",
+ charset.ascii(), codec->name() );
+ } else {
+ debug( "No codec for %s", charset.ascii() );
+ }
+ }
+ break;
+ }
+ }
+ else
+ line = TQString();
+ }
+ }
+ f.close();
+ translator->save( qmfile );
+}
+
+
+// workaround for BCC problem, qtranslator.h includes qwindowdefs.h via qobject.h, see NEEDS_TQMAIN
+#if defined(main)
+#undef main
+#endif
+
+int main( int argc, char* argv[] )
+{
+
+ int infile = 1;
+ if (argc > 1) {
+ if ( TQString("-scope") == argv[1] ) {
+ defaultScope = new TQString(argv[2]);
+ infile += 2;
+ }
+ }
+
+ if ( argc <= infile ) {
+ printf("usage: %s [-scope default] infile [outfile]\n", argv[0]);
+ exit(1);
+ }
+
+ translate(argv[infile], argc > infile+1 ? argv[infile+1] : "tr.qm");
+ return 0;
+}
diff --git a/tqtinterface/qt4/tools/msg2qm/msg2qm.pro b/tqtinterface/qt4/tools/msg2qm/msg2qm.pro
new file mode 100644
index 0000000..d83b12b
--- /dev/null
+++ b/tqtinterface/qt4/tools/msg2qm/msg2qm.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+DEPENDPATH = ../../include
+CONFIG += console qt warn_on release
+HEADERS =
+SOURCES = msg2qm.cpp
+TARGET = msg2qm
+REQUIRES=full-config nocrosscompiler
diff --git a/tqtinterface/qt4/tools/qconfig/LICENSE.GPL b/tqtinterface/qt4/tools/qconfig/LICENSE.GPL
new file mode 100644
index 0000000..149f4ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/qconfig/LICENSE.GPL
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which tqcontains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part tqcontains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it tqcontains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/tqtinterface/qt4/tools/qconfig/main.cpp b/tqtinterface/qt4/tools/qconfig/main.cpp
new file mode 100644
index 0000000..22b6a8b
--- /dev/null
+++ b/tqtinterface/qt4/tools/qconfig/main.cpp
@@ -0,0 +1,734 @@
+/**********************************************************************
+** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt/Embedded.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "main.h"
+#include <tqapplication.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqlistview.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqmessagebox.h>
+#include <tqpopupmenu.h>
+#include <tqmenubar.h>
+#include <tqtoolbutton.h>
+#include <tqstatusbar.h>
+#include <tqsplitter.h>
+#include <tqregexp.h>
+#if defined(TQ_OS_WIN32)
+#include <direct.h>
+#else
+#include <unistd.h>
+#endif
+#include <stdlib.h>
+
+using namespace Qt;
+
+/* XPM */
+static const char * const logo_xpm[] = {
+/* width height ncolors chars_per_pixel */
+"50 50 17 1",
+/* colors */
+" c #000000",
+". c #495808",
+"X c #2A3304",
+"o c #242B04",
+"O c #030401",
+"+ c #9EC011",
+"@ c #93B310",
+"# c #748E0C",
+"$ c #A2C511",
+"% c #8BA90E",
+"& c #99BA10",
+"* c #060701",
+"= c #181D02",
+"- c #212804",
+"; c #61770A",
+": c #0B0D01",
+"/ c None",
+/* pixels */
+"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$@;.o=::=o.;@$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$+#X* **X#+$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$#oO* O **o#+$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$&.* OO O*.&$$$$$$$$$$$$$",
+"$$$$$$$$$$$$@XOO * OO X&$$$$$$$$$$$$",
+"$$$$$$$$$$$@XO OO O **:::OOO OOO X@$$$$$$$$$$$",
+"$$$$$$$$$$&XO O-;#@++@%.oOO X&$$$$$$$$$$",
+"$$$$$$$$$$.O : *-#+$$$$$$$$+#- : O O*.$$$$$$$$$$",
+"$$$$$$$$$#*OO O*.&$$$$$$$$$$$$+.OOOO **#$$$$$$$$$",
+"$$$$$$$$+-OO O *;$$$$$$$$$$$&$$$$;* o+$$$$$$$$",
+"$$$$$$$$#O* O .+$$$$$$$$$$@X;$$$+.O *#$$$$$$$$",
+"$$$$$$$$X* -&$$$$$$$$$$@- :;$$$&- OX$$$$$$$$",
+"$$$$$$$@*O *O#$$$$$$$$$$@oOO**;$$$# O*%$$$$$$$",
+"$$$$$$$; -+$$$$$$$$$@o O OO ;+$$-O *;$$$$$$$",
+"$$$$$$$. ;$$$$$$$$$@-OO OO X&$$;O .$$$$$$$",
+"$$$$$$$o *#$$$$$$$$@o O O O-@$$$#O *o$$$$$$$",
+"$$$$$$+= *@$$$$$$$@o* OO -@$$$$&: =$$$$$$$",
+"$$$$$$+: :+$$$$$$@- *-@$$$$$$: :+$$$$$$",
+"$$$$$$+: :+$$$$$@o* O *-@$$$$$$: :+$$$$$$",
+"$$$$$$$= :@$$$$@o*OOO -@$$$$@: =+$$$$$$",
+"$$$$$$$- O%$$$@o* O O O O-@$$$#* OX$$$$$$$",
+"$$$$$$$. O *O;$$&o O*O* *O -@$$; O.$$$$$$$",
+"$$$$$$$;* Oo+$$;O*O:OO-- Oo@+= *;$$$$$$$",
+"$$$$$$$@* O O#$$$;*OOOo@@-O Oo;O* **@$$$$$$$",
+"$$$$$$$$X* OOO-+$$$;O o@$$@- O O OX$$$$$$$$",
+"$$$$$$$$#* * O.$$$$;X@$$$$@-O O O#$$$$$$$$",
+"$$$$$$$$+oO O OO.+$$+&$$$$$$@-O o+$$$$$$$$",
+"$$$$$$$$$#* **.&$$$$$$$$$$@o OO:#$$$$$$$$$",
+"$$$$$$$$$+. O* O-#+$$$$$$$$+;O OOO:@$$$$$$$$$",
+"$$$$$$$$$$&X *O -;#@++@#;=O O -@$$$$$$$$",
+"$$$$$$$$$$$&X O O*O::::O OO Oo@$$$$$$$",
+"$$$$$$$$$$$$@XOO OO O*X+$$$$$$",
+"$$$$$$$$$$$$$&.* ** O :: *:#$$$$$$$",
+"$$$$$$$$$$$$$$$#o*OO O Oo#@-OOO=#$$$$$$$$",
+"$$$$$$$$$$$$$$$$+#X:* * O**X#+$$@-*:#$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$%;.o=::=o.#@$$$$$$@X#$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$+++$$$$$$$$$$$+$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"/$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/",
+};
+
+
+#define FIXED_LAYOUT
+
+static const char*back_xpm[]={
+"16 16 5 1",
+"# c #000000",
+"a c #ffffff",
+"c c #808080",
+"b c #c0c0c0",
+". c None",
+"................",
+".......#........",
+"......##........",
+".....#a#........",
+"....#aa########.",
+"...#aabaaaaaaa#.",
+"..#aabbbbbbbbb#.",
+"...#abbbbbbbbb#.",
+"...c#ab########.",
+"....c#a#ccccccc.",
+".....c##c.......",
+"......c#c.......",
+".......cc.......",
+"........c.......",
+"................",
+"......................"};
+
+static const char*forward_xpm[]={
+"16 16 5 1",
+"# c #000000",
+"a c #ffffff",
+"c c #808080",
+"b c #c0c0c0",
+". c None",
+"................",
+"................",
+".........#......",
+".........##.....",
+".........#a#....",
+"..########aa#...",
+"..#aaaaaaabaa#..",
+"..#bbbbbbbbbaa#.",
+"..#bbbbbbbbba#..",
+"..########ba#c..",
+"..ccccccc#a#c...",
+"........c##c....",
+"........c#c.....",
+"........cc......",
+"........c.......",
+"................",
+"................"};
+
+class ChoiceItem : public TQCheckListItem {
+public:
+ TQString id;
+ ChoiceItem(const TQString& i, TQListViewItem* tqparent) :
+ TQCheckListItem(tqparent,
+ i.mid(6), // strip "TQT_NO_" as we reverse the logic
+ CheckBox),
+ id(i)
+ {
+ setOpen(TRUE);
+ label = text(0);
+ avl = TRUE;
+ }
+
+ // We reverse the logic
+ void setDefined(bool y) { setOn(!y); }
+ bool isDefined() const { return !isOn(); }
+
+ void setAvailable(bool y)
+ {
+ if ( avl != y ) {
+ avl = y;
+ tqrepaint();
+ }
+ }
+ bool isAvailable() const { return avl; }
+
+ virtual void setOn(bool y)
+ {
+ TQCheckListItem::setOn(y);
+ setOpen(y);
+/*
+ for (TQListViewItem* i=firstChild(); i; i = i->nextSibling() ) {
+ ChoiceItem* ci = (ChoiceItem*)i; // all are ChoiceItem
+ if ( ci->isSelectable() != y ) {
+ ci->setSelectable(y);
+ listView()->repaintItem(ci);
+ }
+ }
+*/
+ }
+
+ void paintBranches( TQPainter * p, const TQColorGroup & cg,
+ int w, int y, int h)
+ {
+ TQListViewItem::paintBranches(p,cg,w,y,h);
+ }
+
+ void paintCell( TQPainter * p, const TQColorGroup & cg,
+ int column, int width, int align )
+ {
+ if ( !isSelectable() || !isAvailable() ) {
+ TQColorGroup c = cg;
+ c.setColor(TQColorGroup::Text, lightGray);
+ TQCheckListItem::paintCell(p,c,column,width,align);
+ } else {
+ TQCheckListItem::paintCell(p,cg,column,width,align);
+ }
+ }
+
+ void setInfo(const TQString& l, const TQString& d)
+ {
+ label = l;
+ doc = d;
+ setText(0,label);
+ }
+
+ TQString label;
+
+ TQString info() const
+ {
+ return "<h2>"+label+"</h2>"+doc;
+ }
+
+private:
+ TQString doc;
+ bool avl;
+};
+
+Main::Main()
+{
+ setIcon( (const char**)logo_xpm );
+#ifdef FIXED_LAYOUT
+ TQHBox* horizontal = new TQHBox(this);
+#else
+ TQSplitter* horizontal = new TQSplitter(this);
+#endif
+
+ lv = new TQListView(horizontal);
+ lv->setSorting(-1);
+ lv->setRootIsDecorated(TRUE);
+ lv->addColumn("ID");
+
+ info = new Info(horizontal);
+ info->setBackgroundMode(TQt::PaletteBase);
+ info->setMargin(10);
+ info->setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken);
+ info->tqsetAlignment(AlignTop);
+
+ connect(info, TQT_SIGNAL(idClicked(const TQString&)),
+ this, TQT_SLOT(selectId(const TQString&)));
+
+#ifdef FIXED_LAYOUT
+ horizontal->setStretchFactor(info,2);
+#endif
+
+ connect(lv, TQT_SIGNAL(pressed(TQListViewItem*)),
+ this, TQT_SLOT(updateAvailability(TQListViewItem*)));
+ connect(lv, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(showInfo(TQListViewItem*)));
+
+ setCentralWidget(horizontal);
+
+ TQToolBar* tb = new TQToolBar( this, "browser controls" );
+ tb->setLabel( "Browser Controls" );
+ (void)new TQToolButton( TQPixmap(back_xpm), "Back", TQString(),
+ info, TQT_SLOT(back()), tb, "back" );
+ (void)new TQToolButton( TQPixmap(forward_xpm), "Forward", TQString(),
+ info, TQT_SLOT(forward()), tb, "forward" );
+
+ TQPopupMenu* file = new TQPopupMenu( menuBar() );
+ file->insertItem( "&Open", this, TQT_SLOT(open()), CTRL+Key_O );
+ file->insertItem( "&Save", this, TQT_SLOT(save()), CTRL+Key_S );
+ file->insertSeparator();
+ file->insertItem( "&Test all", this, TQT_SLOT(testAll()), CTRL+Key_T );
+ file->insertSeparator();
+ file->insertItem( "E&xit", tqApp, TQT_SLOT(quit()), CTRL+Key_Q );
+
+ menuBar()->insertItem( "&File",file );
+
+ menuBar()->insertSeparator();
+
+ TQPopupMenu *help = new TQPopupMenu( menuBar() );
+ help->insertItem( "&About", this, TQT_SLOT(about()) );
+ help->insertItem( "About &TQt", this, TQT_SLOT(aboutTQt()) );
+
+ menuBar()->insertItem( "&Help", help );
+
+ statusBar()->message( "Ready" );
+}
+
+void Main::open()
+{
+}
+
+void Main::save()
+{
+}
+
+void Main::testAll()
+{
+ TQString qtdir = getenv("TQTDIR");
+ chdir((qtdir+"/src").ascii());
+ TQString c;
+ for (TQStringList::ConstIterator it = choices.begin(); it != choices.end(); ++it)
+ {
+ c += "Feature: ";
+ c += *it;
+ c += "\n";
+
+ c += "Section: ";
+ c += section[*it];
+ c += "\n";
+
+ c += "Requires: ";
+ c += dependencies[*it].join(" ");
+ c += "\n";
+
+ c += "Name: ";
+ c += label[*it];
+ c += "\n";
+
+ c += "SeeAlso: ???\n";
+
+ c += "\n";
+ }
+ TQFile f("features.txt");
+ f.open(IO_WriteOnly);
+ f.writeBlock(c.ascii(),c.length());
+ f.close();
+ // system("./feature_size_calculator");
+
+#if 0
+ system("mv ../include/qconfig.h ../include/qconfig.h-orig");
+ for (TQStringList::ConstIterator it = choices.begin(); it != choices.end(); ++it)
+ {
+ TQString choice = *it;
+ TQFile f("../include/tqconfig.h");
+ f.open(IO_WriteOnly);
+ TQCString s = "#define ";
+ s += choice.latin1();
+ s += "\n";
+ f.writeBlock(s,s.length());
+ f.close();
+ int err = system("make");
+ if ( err != 0 )
+ break;
+ }
+ system("mv ../include/tqconfig.h-orig ../include/qconfig.h");
+#endif
+}
+
+
+// ##### should be in TQMap?
+template <class K, class D>
+TQValueList<K> keys(TQMap<K,D> map)
+{
+ TQValueList<K> result;
+ for (TQ_TYPENAME TQMap<K,D>::ConstIterator it = map.begin(); it!=map.end(); ++it)
+ result.append(it.key());
+ return result;
+}
+
+void Main::loadFeatures(const TQString& filename)
+{
+ TQFile file(filename);
+ if ( !file.open(IO_ReadOnly) ) {
+ TQMessageBox::warning(this,"Warning",
+ "Cannot open file " + filename);
+ return;
+ }
+ TQTextStream s(&file);
+ TQRegExp qt_no_xxx("TQT_NO_[A-Z_0-9]*");
+ TQStringList sections;
+
+#if 1
+ TQString line = s.readLine();
+ TQString feature, lab, sec;
+ TQStringList deps, seealso;
+ TQMap<TQString,TQStringList> sectioncontents;
+ while (!s.atEnd()) {
+ if ( line.length() <= 1 ) {
+ if ( !feature.isEmpty() ) {
+ dependencies[feature] = deps;
+ for (TQStringList::ConstIterator it = deps.begin(); it!=deps.end(); ++it)
+ rdependencies[*it].append(feature);
+ label[feature] = lab;
+ links[feature] = seealso;
+ section[feature] = sec;
+ sectioncontents[sec].append(feature);
+ choices.append(feature);
+ } else {
+ qDebug("Unparsed text");
+ }
+
+ feature = lab = sec = TQString();
+ deps.clear(); seealso.clear();
+ line = s.readLine();
+ continue;
+ }
+
+ TQString nextline = s.readLine();
+ while ( nextline[0] == ' ' ) {
+ line += nextline;
+ nextline = s.readLine();
+ }
+
+ int colon = line.tqfind(':');
+ if ( colon < 0 ) {
+ qDebug("Cannot parse: %s",line.ascii());
+ } else {
+ TQString tag = line.left(colon);
+ TQString value = line.mid(colon+1).stripWhiteSpace();
+ if ( tag == "Feature" )
+ feature = value;
+ else if ( tag == "Requires" )
+ deps = TQStringList::split(TQChar(' '),value);
+ else if ( tag == "Name" )
+ lab = value;
+ else if ( tag == "Section" )
+ sec = value;
+ else if ( tag == "SeeAlso" )
+ seealso = TQStringList::split(TQChar(' '),value);
+ }
+
+ line = nextline;
+ }
+ sections = keys(sectioncontents);
+
+#else
+ TQString sec;
+ TQString lab;
+ TQString doc;
+ bool on = FALSE;
+ bool docmode = FALSE;
+ TQStringList deps;
+
+ do {
+ TQString line = s.readLine();
+ line.tqreplace(TQRegExp("# *define"),"#define");
+
+ TQStringList token = TQStringList::split(TQChar(' '),line);
+ if ( on ) {
+ if ( docmode ) {
+ if ( token[0] == "*/" )
+ docmode = FALSE;
+ else if ( lab.isEmpty() )
+ lab = line.stripWhiteSpace();
+ else
+ doc += line.simplifyWhiteSpace() + "\n";
+ } else if ( token[0] == "//#define" || token[0] == "#define" ) {
+ dependencies[token[1]] = deps;
+ for (TQStringList::ConstIterator it = deps.begin(); it!=deps.end(); ++it)
+ rdependencies[*it].append(token[1]);
+ section[token[1]] = sec;
+ documentation[token[1]] = doc;
+ label[token[1]] = lab;
+ choices.append(token[1]);
+ doc = "";
+ lab = "";
+ } else if ( token[0] == "/*!" ) {
+ docmode = TRUE;
+ } else if ( token[0] == "//" ) {
+ token.remove(token.begin());
+ sec = token.join(" ");
+ sections.append(sec);
+ } else if ( token[0] == "#if" ) {
+ TQ_ASSERT(deps.isEmpty());
+ for (int i=1; i<(int)token.count(); i++) {
+ if ( token[i][0] == 'd' ) {
+ int index;
+ int len;
+ index = qt_no_xxx.match(token[i],0,&len);
+ if ( index >= 0 ) {
+ TQString d = token[i].mid(index,len);
+ deps.append(d);
+ }
+ }
+ }
+ } else if ( token[0] == "#endif" ) {
+ deps.clear();
+ } else if ( token[0].isEmpty() ) {
+ } else {
+ qDebug("Cannot parse: %s",token.join(" ").ascii());
+ }
+ } else if ( token[0] == "#include" ) {
+ on = TRUE;
+ }
+ } while (!s.atEnd());
+#endif
+
+ lv->clear();
+ sections.sort();
+ // ##### TQListView default sort order is reverse of insertion order
+ for (TQStringList::Iterator se = sections.fromLast(); se != sections.end(); --se) {
+ sectionitem[*se] = new TQListViewItem(lv,*se);
+ }
+ for (TQStringList::Iterator ch = choices.begin(); ch != choices.end(); ++ch) {
+ createItem(*ch);
+ }
+
+#ifdef FIXED_LAYOUT
+ lv->setFixedWidth(lv->tqsizeHint().width());
+#endif
+}
+
+void Main::createItem(const TQString& ch)
+{
+ if ( !item[ch] ) {
+ TQStringList deps = dependencies[ch];
+ TQString sec = section[ch];
+ TQListViewItem* tqparent = 0;
+ for (TQStringList::Iterator dp = deps.begin(); dp != deps.end(); ++dp) {
+ TQString dsec = section[*dp];
+ if ( dsec.isEmpty() )
+ qDebug("No section for %s",(*dp).latin1());
+ if ( !tqparent && dsec == sec ) {
+ createItem(*dp);
+ tqparent = item[*dp];
+ }
+ }
+ if ( !tqparent )
+ tqparent = sectionitem[section[ch]];
+ ChoiceItem* ci = new ChoiceItem(ch,tqparent);
+ item[ch] = ci;
+ if ( !label[ch].isEmpty() )
+ ci->setInfo(label[ch],documentation[ch]);
+ }
+}
+
+void Main::loadConfig(const TQString& filename)
+{
+ TQFile file(filename);
+ if ( !file.open(IO_ReadOnly) ) {
+ TQMessageBox::warning(this,"Warning",
+ "Cannot open file " + filename);
+ return;
+ }
+ TQTextStream s(&file);
+ TQRegExp qt_no_xxx("TQT_NO_[A-Z_0-9]*");
+
+ for (TQStringList::Iterator ch = choices.begin(); ch != choices.end(); ++ch) {
+ item[*ch]->setDefined(FALSE);
+ }
+ do {
+ TQString line = s.readLine();
+ TQStringList token = TQStringList::split(TQChar(' '),line);
+ if ( token[0] == "#define" ) {
+ ChoiceItem* i = item[token[1]];
+ if ( i )
+ i->setDefined(TRUE);
+ else
+ qDebug("The item %s is not used by qfeatures.h", token[1].latin1());
+ }
+ } while (!s.atEnd());
+}
+
+void Main::updateAvailability(TQListViewItem* i)
+{
+ if ( !i || !i->tqparent() ) {
+ // section. do nothing for now
+ } else {
+ ChoiceItem* choice = (ChoiceItem*)i;
+ TQStringList deps = rdependencies[choice->id];
+ for (TQStringList::ConstIterator it = deps.begin();
+ it != deps.end(); ++it)
+ {
+ ChoiceItem* d = item[*it];
+ TQStringList ddeps = dependencies[d->id];
+ bool av = TRUE;
+ for (TQStringList::ConstIterator dit = ddeps.begin();
+ av && dit != ddeps.end(); ++dit)
+ {
+ ChoiceItem* dd = item[*dit];
+ if ( dd ) {
+ if ( dd->isDefined() || !dd->isAvailable() )
+ av = FALSE;
+ } else
+ qDebug("%s ???",(*dit).latin1());
+ }
+ if ( d->isAvailable() != av ) {
+ d->setAvailable(av);
+ updateAvailability(d);
+ }
+ }
+qDebug("%s: %d",choice->id.latin1(),choice->isAvailable());
+ }
+}
+
+void Main::showInfo(TQListViewItem* i)
+{
+ if ( !i )
+ return;
+ if ( !i->tqparent() ) {
+ // section. do nothing for now
+ } else {
+ ChoiceItem* choice = (ChoiceItem*)i;
+ TQString i = choice->info();
+ TQStringList deps = dependencies[choice->id];
+ if ( !deps.isEmpty() ) {
+ i += "<h3>Requires:</h3><ul>";
+ for (TQStringList::ConstIterator it = deps.begin();
+ it != deps.end(); ++it)
+ {
+ ChoiceItem* d = item[*it];
+ if ( d ) {
+ bool got = d->isAvailable() && !d->isDefined();
+ i += "<li>";
+ if ( !got ) i += "<font color=red>";
+ i += "<a href=id://"+d->id+">"+d->label+"</a>";
+ if ( !got ) i += "</font>";
+ }
+ }
+ i += "</ul>";
+ }
+ TQStringList rdeps = rdependencies[choice->id];
+ if ( !rdeps.isEmpty() ) {
+ i += "<h3>Required for:</h3><ul>";
+ for (TQStringList::ConstIterator it = rdeps.begin();
+ it != rdeps.end(); ++it)
+ {
+ ChoiceItem* d = item[*it];
+ if ( d )
+ i += "<li><a href=id://"+d->id+">"+d->label+"</a>";
+ }
+ i += "</ul>";
+ }
+ info->setText(i);
+ }
+}
+
+void Main::selectId(const TQString& id)
+{
+ TQListViewItem* it = item[id];
+ if ( it ) {
+ lv->setSelected(it,TRUE);
+ lv->ensureItemVisible(it);
+ }
+}
+
+Info::Info( TQWidget* tqparent, const char* name ) :
+ TQTextBrowser(tqparent, name)
+{
+}
+
+void Info::setSource(const TQString& name)
+{
+ if ( name.left(5) == "id://" ) {
+ emit idClicked(name.mid(5,name.length()-6)); // skip trailing "/" too
+ } else {
+ TQTextBrowser::setSource(name);
+ }
+}
+
+void Main::about()
+{
+ TQMessageBox::about(this, "About qconfig",
+ "<p><b><font size=+2>TQt/Embedded build configuration</font></b></p>"
+ "<p></p>"
+ "<p>Version 1.0</p>"
+ "<p>Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.</p>"
+ "<p></p>"
+ "<p>This program is licensed to you under the terms of the GNU General "
+ "Public License Version 2 as published by the Free Software Foundation. This "
+ "gives you legal permission to copy, distribute and/or modify this software "
+ "under certain conditions. For details, see the file 'LICENSE.GPL' that came with "
+ "this software distribution. If you did not get the file, send email to "
+ "info@trolltech.com.</p>\n\n<p>The program is provided AS IS with NO WARRANTY "
+ "OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS "
+ "FOR A PARTICULAR PURPOSE.</p>"
+ );
+}
+
+void Main::aboutTQt()
+{
+ TQMessageBox::aboutTQt( this, tr("qconfig") );
+}
+
+int main(int argc, char** argv)
+{
+ TQApplication app(argc,argv);
+ Main m;
+ TQString qtdir = getenv("TQTDIR");
+ TQString qfeatures = qtdir + "/src/tools/qfeatures.txt";
+ //TQString qfeatures = qtdir + "/include/tqfeatures.h";
+ TQString qconfig = qtdir + "/include/tqconfig.h";
+ for (int i=1; i<argc; i++) {
+ TQString arg = argv[i];
+ if ( arg == "-f" && i+i<argc ) {
+ qfeatures = argv[++i];
+ } else {
+ qconfig = argv[i];
+ }
+ }
+ m.loadFeatures(qfeatures);
+ m.loadConfig(qconfig);
+ m.resize(m.tqsizeHint()+TQSize(500,300));
+ app.setMainWidget(&m);
+ m.show();
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/qconfig/main.h b/tqtinterface/qt4/tools/qconfig/main.h
new file mode 100644
index 0000000..c4e5150
--- /dev/null
+++ b/tqtinterface/qt4/tools/qconfig/main.h
@@ -0,0 +1,86 @@
+/**********************************************************************
+** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt/Embedded.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqmainwindow.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
+#include <tqtextbrowser.h>
+
+class ChoiceItem;
+class TQListViewItem;
+class TQListView;
+class TQLabel;
+
+class Info : public TQTextBrowser {
+ TQ_OBJECT
+public:
+ Info( TQWidget* tqparent, const char* name=0 );
+
+Q_SIGNALS:
+ void idClicked(const TQString& name);
+
+public Q_SLOTS:
+ void setSource(const TQString& name);
+};
+
+class Main : public TQMainWindow {
+ TQ_OBJECT
+public:
+ Main();
+ void loadFeatures(const TQString& filename);
+ void loadConfig(const TQString& filename);
+
+private:
+ void createItem(const TQString& ch);
+ TQMap<TQString,TQString> label;
+ TQMap<TQString,TQString> documentation;
+ TQMap<TQString,TQStringList> links;
+ TQMap<TQString,TQStringList> dependencies;
+ TQMap<TQString,TQStringList> rdependencies;
+ TQMap<TQString,TQString> section;
+ TQMap<TQString,ChoiceItem*> item;
+ TQMap<TQString,TQListViewItem*> sectionitem;
+ TQStringList choices;
+ TQListView* lv;
+ TQTextBrowser* info;
+
+private Q_SLOTS:
+ void updateAvailability(TQListViewItem* i);
+ void showInfo(TQListViewItem* i);
+ void selectId(const TQString&);
+ void open();
+ void save();
+ void testAll();
+ void about();
+ void aboutTQt();
+};
diff --git a/tqtinterface/qt4/tools/qconfig/qconfig.pro b/tqtinterface/qt4/tools/qconfig/qconfig.pro
new file mode 100644
index 0000000..bc05273
--- /dev/null
+++ b/tqtinterface/qt4/tools/qconfig/qconfig.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+HEADERS = main.h
+SOURCES = main.cpp
+INTERFACES =
+TARGET = qconfig
+REQUIRES=full-config nocrosscompiler
diff --git a/tqtinterface/qt4/tools/qembed/qembed.cpp b/tqtinterface/qt4/tools/qembed/qembed.cpp
new file mode 100644
index 0000000..9c11bc2
--- /dev/null
+++ b/tqtinterface/qt4/tools/qembed/qembed.cpp
@@ -0,0 +1,338 @@
+/****************************************************************************
+**
+** Utility program for embedding binary data into a C/C++ source code.
+** It reads a binary file and generates a C array with the binary data.
+** The C code is written to standard output.
+**
+** Created : 951017
+**
+** Copyright (C) 1995-2008 Trolltech ASA. All rights reserved.
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation for any purpose and without fee is hereby granted, provided
+** that this copyright notice appears in all copies.
+** No representations are made about the suitability of this software for any
+** purpose. It is provided "as is" without express or implied warranty.
+**
+*****************************************************************************/
+
+#include <tqstring.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqptrlist.h>
+#include <tqtextstream.h>
+#include <tqdatetime.h>
+#include <tqimage.h>
+#include <tqdict.h>
+#include <tqdir.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+static void embedData( const TQByteArray &input, TQFile *output );
+static void embedData( const uchar* input, int size, TQFile *output );
+static void embedData( const TQRgb* input, int size, TQFile *output );
+static TQString convertFileNameToCIdentifier( const char * );
+
+static const char header[] = "/* Generated by qembed */\n";
+
+struct Embed {
+ uint size;
+ TQString name;
+ TQString cname;
+};
+
+struct EmbedImage {
+ int width;
+ int height;
+ int depth;
+ int numColors;
+ TQRgb* colorTable;
+ TQString name;
+ TQString cname;
+ bool alpha;
+};
+
+int main( int argc, char **argv )
+{
+ if ( argc < 2 ) {
+ qWarning( "Usage:\n\t%s [--images] files", argv[0] );
+ return 1;
+ }
+
+ TQFile output;
+ bool output_hdr = FALSE;
+ bool images = FALSE;
+ output.open( IO_WriteOnly, stdout );
+ TQTextStream out( &output );
+
+ TQPtrList<EmbedImage> list_image;
+ TQPtrList<Embed> list;
+ list.setAutoDelete( TRUE );
+ list_image.setAutoDelete( TRUE );
+
+ long l = rand();
+ out << "#ifndef _TQEMBED_" << l << endl;
+ out << "#define _TQEMBED_" << l << endl;
+
+ TQStringList args;
+ for ( int i = 1; i < argc; ++i ) {
+ TQString file( argv[i] );
+#ifdef TQ_WS_WIN
+ // Since wildcards are not expanded automatically for us on Windows, we need to do
+ // it ourselves
+ if ( file.tqcontains( '*' ) || file.tqcontains( '?' ) ) {
+ TQDir d;
+ const TQFileInfoList *fiList = d.entryInfoList( file, TQDir::Files );
+ TQFileInfoListIterator it(*fiList);
+ while ( it.current() ) {
+ args << (*it)->filePath();
+ ++it;
+ }
+ } else
+#endif
+ args << file;
+ }
+ for ( TQStringList::Iterator it = args.begin(); it != args.end(); ++it ) {
+ TQString arg = (*it);
+ if ( arg == "--images" ) {
+ if ( !images ) {
+ out << "#include <tqimage.h>\n";
+ out << "#include <tqdict.h>\n";
+ images = TRUE;
+ }
+ } else {
+ TQFile f( *it );
+ if ( !f.open(IO_ReadOnly) ) {
+ qWarning( "Cannot open file %s, ignoring it", (*it).latin1() );
+ continue;
+ }
+ TQByteArray a( f.size() );
+ if ( f.size() == 0
+ || f.readBlock(a.data(), f.size()) != (int)f.size() ) {
+ qWarning( "Cannot read file %s, ignoring it", (*it).latin1() );
+ continue;
+ }
+ if ( images ) {
+ TQImage img;
+ if ( !img.loadFromData(a) ) {
+ qWarning( "Cannot read image from file %s, ignoring it", (*it).latin1() );
+ continue;
+ }
+ EmbedImage *e = new EmbedImage;
+ e->width = img.width();
+ e->height = img.height();
+ e->depth = img.depth();
+ e->numColors = img.numColors();
+ e->colorTable = new TQRgb[e->numColors];
+ e->alpha = img.hasAlphaBuffer();
+ memcpy(e->colorTable, img.tqcolorTable(), e->numColors*sizeof(TQRgb));
+ TQFileInfo fi( (*it) );
+ e->name = fi.baseName();
+ e->cname = convertFileNameToCIdentifier( e->name.latin1() );
+ list_image.append( e );
+ TQString s;
+ if ( e->depth == 32 ) {
+ out << s.sprintf( "static const TQRgb %s_data[] = {",
+ (const char *)e->cname );
+ embedData( (TQRgb*)img.bits(), e->width*e->height, &output );
+ } else {
+ if ( e->depth == 1 )
+ img = img.convertBitOrder(TQImage::BigEndian);
+ out << s.sprintf( "static const unsigned char %s_data[] = {",
+ (const char *)e->cname );
+ embedData( img.bits(), img.numBytes(), &output );
+ }
+ out << "\n};\n\n";
+ if ( e->numColors ) {
+ out << s.sprintf( "static const TQRgb %s_ctable[] = {",
+ (const char *)e->cname );
+ embedData( e->colorTable, e->numColors, &output );
+ out << "\n};\n\n";
+ }
+ } else {
+ Embed *e = new Embed;
+ e->size = f.size();
+ e->name = (*it);
+ e->cname = convertFileNameToCIdentifier( (*it) );
+ list.append( e );
+ TQString s;
+ out << s.sprintf( "static const unsigned int %s_len = %d;\n",
+ (const char *)e->cname, e->size );
+ out << s.sprintf( "static const unsigned char %s_data[] = {",
+ (const char *)e->cname );
+ embedData( a, &output );
+ out << "\n};\n\n";
+ }
+ if ( !output_hdr ) {
+ output_hdr = TRUE;
+ out << header;
+ }
+ }
+ }
+
+ if ( list.count() > 0 ) {
+ out << "#include <tqcstring.h>\n";
+ if ( !images )
+ out << "#include <tqdict.h>\n";
+
+ out << "static struct Embed {\n"
+ " unsigned int size;\n"
+ " const unsigned char *data;\n"
+ " const char *name;\n"
+ "} embed_vec[] = {\n";
+ Embed *e = list.first();
+ while ( e ) {
+ out << " { " << e->size << ", " << e->cname << "_data, "
+ << "\"" << e->name << "\" },\n";
+ e = list.next();
+ }
+ out << " { 0, 0, 0 }\n};\n";
+
+ out << "\n"
+"static const TQByteArray& qembed_tqfindData( const char* name )\n"
+"{\n"
+" static TQDict<TQByteArray> dict;\n"
+" TQByteArray* ba = dict.tqfind( name );\n"
+" if ( !ba ) {\n"
+" for ( int i = 0; embed_vec[i].data; i++ ) {\n"
+" if ( strcmp(embed_vec[i].name, name) == 0 ) {\n"
+" ba = new TQByteArray;\n"
+" ba->setRawData( (char*)embed_vec[i].data,\n"
+" embed_vec[i].size );\n"
+" dict.insert( name, ba );\n"
+" break;\n"
+" }\n"
+" }\n"
+" if ( !ba ) {\n"
+" static TQByteArray dummy;\n"
+" return dummy;\n"
+" }\n"
+" }\n"
+" return *ba;\n"
+"}\n\n";
+ }
+
+ if ( list_image.count() > 0 ) {
+ out << "static struct EmbedImage {\n"
+ " int width, height, depth;\n"
+ " const unsigned char *data;\n"
+ " int numColors;\n"
+ " const TQRgb *colorTable;\n"
+ " bool alpha;\n"
+ " const char *name;\n"
+ "} embed_image_vec[] = {\n";
+ EmbedImage *e = list_image.first();
+ while ( e ) {
+ out << " { "
+ << e->width << ", "
+ << e->height << ", "
+ << e->depth << ", "
+ << "(const unsigned char*)" << e->cname << "_data, "
+ << e->numColors << ", ";
+ if ( e->numColors )
+ out << e->cname << "_ctable, ";
+ else
+ out << "0, ";
+ if ( e->alpha )
+ out << "TRUE, ";
+ else
+ out << "FALSE, ";
+ out << "\"" << e->name << "\" },\n";
+ e = list_image.next();
+ }
+ out << " { 0, 0, 0, 0, 0, 0, 0, 0 }\n};\n";
+
+ out << "\n"
+"static const TQImage& qembed_tqfindImage( const TQString& name )\n"
+"{\n"
+" static TQDict<TQImage> dict;\n"
+" TQImage* img = dict.tqfind( name );\n"
+" if ( !img ) {\n"
+" for ( int i = 0; embed_image_vec[i].data; i++ ) {\n"
+" if ( strcmp(embed_image_vec[i].name, name.latin1()) == 0 ) {\n"
+" img = new TQImage((uchar*)embed_image_vec[i].data,\n"
+" embed_image_vec[i].width,\n"
+" embed_image_vec[i].height,\n"
+" embed_image_vec[i].depth,\n"
+" (TQRgb*)embed_image_vec[i].colorTable,\n"
+" embed_image_vec[i].numColors,\n"
+" TQImage::BigEndian );\n"
+" if ( embed_image_vec[i].alpha )\n"
+" img->setAlphaBuffer( TRUE );\n"
+" dict.insert( name, img );\n"
+" break;\n"
+" }\n"
+" }\n"
+" if ( !img ) {\n"
+" static TQImage dummy;\n"
+" return dummy;\n"
+" }\n"
+" }\n"
+" return *img;\n"
+"}\n\n";
+ }
+
+ out << "#endif" << endl;
+
+ return 0;
+}
+
+
+TQString convertFileNameToCIdentifier( const char *s )
+{
+ TQString r = s;
+ int len = r.length();
+ if ( len > 0 && !isalpha( (char)r[0].latin1() ) )
+ r[0] = '_';
+ for ( int i = 1; i < len; i++ ) {
+ if ( !isalnum( (char)r[i].latin1() ) )
+ r[i] = '_';
+ }
+ return r;
+}
+
+
+void embedData( const TQByteArray &input, TQFile *output )
+{
+ embedData((uchar*)input.data(), input.size(), output);
+}
+
+void embedData( const uchar* input, int nbytes, TQFile *output )
+{
+ static const char hexdigits[] = "0123456789abcdef";
+ TQString s;
+ for ( int i=0; i<nbytes; i++ ) {
+ if ( (i%14) == 0 ) {
+ s += "\n ";
+ output->writeBlock( (const char*)s, s.length() );
+ s.truncate( 0 );
+ }
+ uint v = input[i];
+ s += "0x";
+ s += hexdigits[(v >> 4) & 15];
+ s += hexdigits[v & 15];
+ if ( i < nbytes-1 )
+ s += ',';
+ }
+ if ( s.length() )
+ output->writeBlock( (const char*)s, s.length() );
+}
+
+void embedData( const TQRgb* input, int n, TQFile *output )
+{
+ TQString s;
+ for ( int i = 0; i < n; i++ ) {
+ if ( (i % 14) == 0 ) {
+ s += "\n ";
+ output->writeBlock( (const char*)s, s.length() );
+ s.truncate( 0 );
+ }
+ TQRgb v = input[i];
+ s += "0x";
+ s += TQString::number( v, 16 );
+ if ( i < n-1 )
+ s += ',';
+ }
+ if ( s.length() )
+ output->writeBlock( (const char*)s, s.length() );
+}
diff --git a/tqtinterface/qt4/tools/qembed/qembed.pro b/tqtinterface/qt4/tools/qembed/qembed.pro
new file mode 100644
index 0000000..4a3217c
--- /dev/null
+++ b/tqtinterface/qt4/tools/qembed/qembed.pro
@@ -0,0 +1,4 @@
+CONFIG += console qt warn_on release
+SOURCES = qembed.cpp
+TARGET = qembed
+REQUIRES=full-config nocrosscompiler
diff --git a/tqtinterface/qt4/tools/qtconfig/LICENSE.GPL b/tqtinterface/qt4/tools/qtconfig/LICENSE.GPL
new file mode 100644
index 0000000..149f4ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/LICENSE.GPL
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which tqcontains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part tqcontains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it tqcontains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/tqtinterface/qt4/tools/qtconfig/colorbutton.cpp b/tqtinterface/qt4/tools/qtconfig/colorbutton.cpp
new file mode 100644
index 0000000..4dd152f
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/colorbutton.cpp
@@ -0,0 +1,177 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "colorbutton.h"
+
+#include <tqapplication.h>
+#include <tqcolordialog.h>
+#include <tqpainter.h>
+#include <tqdragobject.h>
+#include <tqstyle.h>
+
+
+ColorButton::ColorButton(TQWidget *tqparent, const char *name)
+ : TQButton(tqparent, name), mousepressed(FALSE)
+{
+ setAcceptDrops(TRUE);
+ col = Qt::black;
+ connect(this, TQT_SIGNAL(clicked()), TQT_SLOT(changeColor()));
+}
+
+
+ColorButton::ColorButton(const TQColor &c, TQWidget *tqparent, const char *name)
+ : TQButton(tqparent, name)
+{
+ setAcceptDrops(TRUE);
+ col = c;
+ connect(this, TQT_SIGNAL(clicked()), TQT_SLOT(changeColor()));
+}
+
+
+void ColorButton::setColor(const TQColor &c)
+{
+ col = c;
+ update();
+}
+
+
+void ColorButton::changeColor()
+{
+ TQColor c = TQColorDialog::getColor(col, TQT_TQWIDGET(tqApp->activeWindow()));
+
+ if (c.isValid()) {
+ setColor(c);
+ emit colorChanged(color());
+ }
+}
+
+
+TQSize ColorButton::tqsizeHint() const
+{
+ return TQSize(40, 25);
+}
+
+
+TQSize ColorButton::tqminimumSizeHint() const
+{
+ return TQSize(40, 25);
+}
+
+
+void ColorButton::drawButton(TQPainter *p)
+{
+ tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonBevel, p, rect(), tqcolorGroup(),
+ isDown() ? TQStyle::Style_Down : TQStyle::Style_Raised);
+ drawButtonLabel(p);
+
+ if (hasFocus())
+ tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, p,
+ tqstyle().subRect(TQStyle::SR_PushButtonFocusRect, this),
+ tqcolorGroup(), TQStyle::Style_Default);
+}
+
+
+void ColorButton::drawButtonLabel(TQPainter *p)
+{
+ TQColor pen = (isEnabled() ?
+ (hasFocus() ? tqpalette().active().buttonText() :
+ tqpalette().inactive().buttonText())
+ : tqpalette().disabled().buttonText());
+ p->setPen( pen );
+ p->setBrush(col);
+ p->drawRect(width() / 4, height() / 4, width() / 2, height() / 2);
+}
+
+
+void ColorButton::dragEnterEvent(TQDragEnterEvent *e)
+{
+ if (! TQColorDrag::canDecode(e)) {
+ e->ignore();
+ return;
+ }
+}
+
+
+void ColorButton::dragMoveEvent(TQDragMoveEvent *e)
+{
+ if (! TQColorDrag::canDecode(e)) {
+ e->ignore();
+ return;
+ }
+
+ e->accept();
+}
+
+
+void ColorButton::dropEvent(TQDropEvent *e)
+{
+ if (! TQColorDrag::canDecode(e)) {
+ e->ignore();
+ return;
+ }
+
+ TQColor c;
+ TQColorDrag::decode(e, c);
+ setColor(c);
+ emit colorChanged(color());
+}
+
+
+void ColorButton::mousePressEvent(TQMouseEvent *e)
+{
+ presspos = e->pos();
+ mousepressed = TRUE;
+ TQButton::mousePressEvent(e);
+}
+
+
+void ColorButton::mouseReleaseEvent(TQMouseEvent *e)
+{
+ mousepressed = FALSE;
+ TQButton::mouseReleaseEvent(e);
+}
+
+
+void ColorButton::mouseMoveEvent(TQMouseEvent *e)
+{
+ if (! mousepressed)
+ return;
+
+ if ((presspos - e->pos()).manhattanLength() > TQApplication::startDragDistance()) {
+ mousepressed = FALSE;
+ setDown(FALSE);
+
+ TQColorDrag *cd = new TQColorDrag(color(), this);
+ cd->dragCopy();
+ }
+}
diff --git a/tqtinterface/qt4/tools/qtconfig/colorbutton.h b/tqtinterface/qt4/tools/qtconfig/colorbutton.h
new file mode 100644
index 0000000..451c6df
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/colorbutton.h
@@ -0,0 +1,83 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef COLORBUTTON_H
+#define COLORBUTTON_H
+
+#include <tqbutton.h>
+
+
+class ColorButton : public TQButton
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ ColorButton(TQWidget *, const char * = 0);
+ ColorButton(const TQColor &, TQWidget *, const char * = 0);
+
+ const TQColor &color() const { return col; }
+
+ void setColor(const TQColor &);
+ TQSize tqsizeHint() const;
+ TQSize tqminimumSizeHint() const;
+
+ void mousePressEvent(TQMouseEvent *);
+ void mouseReleaseEvent(TQMouseEvent *);
+ void mouseMoveEvent(TQMouseEvent *);
+ void dragEnterEvent(TQDragEnterEvent *);
+ void dragMoveEvent(TQDragMoveEvent *);
+ void dropEvent(TQDropEvent *);
+
+
+Q_SIGNALS:
+ void colorChanged(const TQColor &);
+
+
+protected:
+ void drawButton(TQPainter *);
+ void drawButtonLabel(TQPainter *);
+
+
+private Q_SLOTS:
+ void changeColor();
+
+
+private:
+ TQColor col;
+ TQPoint presspos;
+ bool mousepressed;
+};
+
+
+#endif // COLORBUTTON_H
diff --git a/tqtinterface/qt4/tools/qtconfig/images/appicon.png b/tqtinterface/qt4/tools/qtconfig/images/appicon.png
new file mode 100644
index 0000000..0cb2b68
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/images/appicon.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/qtconfig/main.cpp b/tqtinterface/qt4/tools/qtconfig/main.cpp
new file mode 100644
index 0000000..ef8bbb5
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/main.cpp
@@ -0,0 +1,45 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "mainwindow.h"
+#include <tqapplication.h>
+
+
+int main(int argc, char **argv)
+{
+ TQApplication app(argc, argv);
+ MainWindow mw;
+ app.setMainWidget(&mw);
+ mw.show();
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/qtconfig/mainwindow.cpp b/tqtinterface/qt4/tools/qtconfig/mainwindow.cpp
new file mode 100644
index 0000000..754f139
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/mainwindow.cpp
@@ -0,0 +1,1074 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "mainwindow.h"
+#include "colorbutton.h"
+#include "previewframe.h"
+#include "paletteeditoradvanced.h"
+
+#include <tqlabel.h>
+#include <tqapplication.h>
+#include <tqcombobox.h>
+#include <tqstylefactory.h>
+#include <tqobjectlist.h>
+#include <tqfontdatabase.h>
+#include <tqlineedit.h>
+#include <tqlistbox.h>
+#include <tqspinbox.h>
+#include <tqcheckbox.h>
+#include <tqfiledialog.h>
+#include <tqaction.h>
+#include <tqstatusbar.h>
+#include <tqsettings.h>
+#include <tqmessagebox.h>
+#include <tqtextview.h>
+#include <tqstyle.h>
+
+#include <stdlib.h>
+
+
+// from qapplication.cpp and qapplication_x11.cpp - These are NOT for
+// external use ignore them
+extern bool TQ_EXPORT qt_resolve_symlinks;
+
+
+static const char *appearance_text =
+"<p><b><font size+=2>Appearance</font></b></p>"
+"<hr>"
+"<p>Use this tab to customize the appearance of your TQt applications.</p>"
+"<p>You can select the default GUI Style from the drop down list and "
+"customize the colors.</p>"
+"<p>Any GUI Style plugins in your plugin path will automatically be added "
+"to the list of built-in TQt styles. (See the Library Paths tab for "
+"information on adding new plugin paths.)</p>"
+"<p>When you choose 3-D Effects and Background colors, the TQt Configuration "
+"program will automatically generate a palette for you. To customize "
+"colors further, press the Tune Palette button to open the advanced "
+"palette editor."
+"<p>The Preview Window shows what the selected Style and colors look "
+"like.";
+
+static const char *font_text =
+"<p><b><font size+=2>Fonts</font></b></p>"
+"<hr>"
+"<p>Use this tab to select the default font for your TQt applications. "
+"The selected font is shown (initially as 'Sample Text') in the line "
+"edit below the Family, "
+"Style and Point Size drop down lists.</p>"
+"<p>TQt has a powerful font substitution feature that allows you to "
+"specify a list of substitute fonts. Substitute fonts are used "
+"when a font cannot be loaded, or if the specified font doesn't have "
+"a particular character."
+"<p>For example, if you select the font Lucida, which doesn't have Korean "
+"characters, but need to show some Korean text using the Mincho font family "
+"you can do so by adding Mincho to the list. Once Mincho is added, any "
+"Korean characters that are not found in the Lucida font will be taken "
+"from the Mincho font. Because the font substitutions are "
+"lists, you can also select multiple families, such as Song Ti (for "
+"use with Chinese text).";
+
+static const char *interface_text =
+"<p><b><font size+=2>Interface</font></b></p>"
+"<hr>"
+"<p>Use this tab to customize the feel of your TQt applications.</p>"
+"<p>If the Resolve Symlinks checkbox is checked TQt will follow symlinks "
+"when handling URLs. For example, in the file dialog, if this setting is turned "
+"on and /usr/tmp is a symlink to /var/tmp, entering the /usr/tmp directory "
+"will cause the file dialog to change to /var/tmp. With this setting turned "
+"off, symlinks are not resolved or followed.</p>"
+"<p>The Global Strut setting is useful for people who require a "
+"minimum size for all widgets (e.g. when using a touch panel or for users "
+"who are visually impaired). Leaving the Global Strut width and height "
+"at 0 will disable the Global Strut feature</p>"
+"<p>XIM (Extended Input Methods) are used for entering characters in "
+"languages that have large character sets, for example, Chinese and "
+"Japanese.";
+// ### What does the 'Enhanced support for languages written R2L do?
+
+static const char *libpath_text =
+"<p><b><font size+=2>Library Paths</font></b></p>"
+"<hr>"
+"<p>Use this tab to select additional directories where TQt should search "
+"for component plugins."
+"<p>These directories should be the base directory of where your plugins "
+"are stored. For example, if you wish to store GUI Style plugins in "
+"$HOME/plugins/styles and TQt Designer plugins in $HOME/plugins/designer, "
+"you would add $HOME/plugins to your Library Path. <p>Notes:"
+"<ul><li>The TQt Configuration program does <i>not</i> support environment "
+"variables, so you must give full path names, for example "
+"<tt>/home/brad/myplugins</tt> not <tt>$HOME/myplugins</tt>"
+"<li> TQt automatically "
+"searches in the directory where you installed TQt for component plugins. "
+"Removing that path is not possible.</ul>";
+
+static const char *printer_text =
+"<p><b><font size+=2>Printer</font></b></p>"
+"<hr>"
+"<p>Use this tab to configure the way TQt generates output for the printer."
+"You can specify if TQt should try to embed fonts into its generated output."
+"If you enable font embedding, the resulting postscript will be more "
+"portable and will more accurately reflect the "
+"visual output on the screen; however the resulting postscript file "
+"size will be bigger."
+"<p>When using font embedding you can select additional directories where "
+"TQt should search for embeddable font files. By default, the X "
+"server font path is used.";
+
+static const char *about_text =
+"<p><b><font size=+2>TQt Configuration</font></b></p>"
+"<p>A graphical configuration tool for programs using TQt</p>"
+"<p>Version 1.0</p>"
+"<p>Copyright (C) 2010 Timothy Pearson. All rights reserved.<br>"
+"Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.</p>"
+"<p></p>"
+"<p>This program is licensed to you under the terms of the GNU General "
+"Public License Version 2 as published by the Free Software Foundation. This "
+"gives you legal permission to copy, distribute and/or modify this software "
+"under certain conditions. For details, see the file 'LICENSE.GPL' that came with "
+"this software distribution. If you did not get the file, send email to "
+"info@trolltech.com.</p>\n\n<p>The program is provided AS IS with NO WARRANTY "
+"OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS "
+"FOR A PARTICULAR PURPOSE.</p>";
+
+
+static TQColorGroup::ColorRole centralFromItem( int item )
+{
+ switch( item ) {
+ case 0: return TQColorGroup::Background;
+ case 1: return TQColorGroup::Foreground;
+ case 2: return TQColorGroup::Button;
+ case 3: return TQColorGroup::Base;
+ case 4: return TQColorGroup::Text;
+ case 5: return TQColorGroup::BrightText;
+ case 6: return TQColorGroup::ButtonText;
+ case 7: return TQColorGroup::Highlight;
+ case 8: return TQColorGroup::HighlightedText;
+ default: return TQColorGroup::NColorRoles;
+ }
+}
+
+
+static TQColorGroup::ColorRole effectFromItem( int item )
+{
+ switch( item ) {
+ case 0: return TQColorGroup::Light;
+ case 1: return TQColorGroup::Midlight;
+ case 2: return TQColorGroup::Mid;
+ case 3: return TQColorGroup::Dark;
+ case 4: return TQColorGroup::Shadow;
+ default: return TQColorGroup::NColorRoles;
+ }
+}
+
+
+static void setStyleHelper(TQWidget *w, TQStyle *s)
+{
+ w->unsetPalette();
+ w->setStyle(s);
+
+ if (w->childrenListObject().isEmpty())
+ return;
+
+ TQPtrListIterator<TQObject> childit(w->childrenListObject());
+ TQObject *child;
+ while ((child = childit.current()) != 0) {
+ ++childit;
+
+ if (child->isWidgetType())
+ setStyleHelper((TQWidget *) child, s);
+ }
+}
+
+
+MainWindow::MainWindow()
+ : MainWindowBase(0, "main window"),
+ editPalette(tqpalette()), previewPalette(tqpalette()), previewstyle(0)
+{
+ modified = TRUE;
+
+ TQStringList gstyles = TQStyleFactory::keys();
+ gstyles.sort();
+ gstylecombo->insertStringList(gstyles);
+
+ TQSettings settings;
+ TQString currentstyle = settings.readEntry("/qt/style");
+ if (currentstyle.isNull())
+ currentstyle = TQApplication::tqstyle().className();
+ {
+ int s = 0;
+ TQStringList::Iterator git = gstyles.begin();
+ while (git != gstyles.end()) {
+ if (*git == currentstyle)
+ break;
+ s++;
+ git++;
+ }
+
+ if (s < gstylecombo->count()) {
+ gstylecombo->setCurrentItem(s);
+ } else {
+ // no predefined style, try to tqfind the closest match
+ // class names usually contain the name of the style, so we
+ // iterate over the items in the combobox, and use the one whose
+ // name is contained in the classname of the style
+ s = 0;
+ git = gstyles.begin();
+ while (git != gstyles.end()) {
+ if (currentstyle.tqcontains(*git))
+ break;
+ s++;
+ git++;
+ }
+
+ if (s < gstylecombo->count()) {
+ gstylecombo->setCurrentItem(s);
+ } else {
+ // we give up
+ gstylecombo->insertItem("Unknown");
+ gstylecombo->setCurrentItem(gstylecombo->count() - 1);
+ }
+ }
+ }
+
+ buttonMainColor->setColor(tqpalette().color(TQPalette::Active,
+ TQColorGroup::Button));
+ buttonMainColor2->setColor(tqpalette().color(TQPalette::Active,
+ TQColorGroup::Background));
+
+ TQFontDatabase db;
+ TQStringList families = TQT_TQSTRINGLIST_OBJECT(db.families());
+ familycombo->insertStringList(families);
+
+ TQStringList fs = families;
+ TQStringList fs2 = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutions());
+ TQStringList::Iterator fsit = fs2.begin();
+ while (fsit != fs2.end()) {
+ if (! fs.tqcontains(*fsit))
+ fs += *fsit;
+ fsit++;
+ }
+ fs.sort();
+ familysubcombo->insertStringList(fs);
+
+ choosesubcombo->insertStringList(families);
+ TQValueList<int> sizes = db.tqstandardSizes();
+ TQValueList<int>::Iterator it = sizes.begin();
+ while (it != sizes.end())
+ psizecombo->insertItem(TQString::number(*it++));
+
+ dcispin->setValue(TQApplication::doubleClickInterval());
+ cfispin->setValue(TQApplication::cursorFlashTime());
+ wslspin->setValue(TQApplication::wheelScrollLines());
+ resolvelinks->setChecked(qt_resolve_symlinks);
+
+ effectcheckbox->setChecked(TQApplication::isEffectEnabled(Qt::UI_General));
+ effectbase->setEnabled(effectcheckbox->isChecked());
+
+ if (TQApplication::isEffectEnabled(Qt::UI_FadeMenu))
+ menueffect->setCurrentItem(2);
+ else if (TQApplication::isEffectEnabled(Qt::UI_AnimateMenu))
+ menueffect->setCurrentItem(1);
+
+ if (TQApplication::isEffectEnabled(Qt::UI_AnimateCombo))
+ comboeffect->setCurrentItem(1);
+
+ if (TQApplication::isEffectEnabled(Qt::UI_FadeTooltip))
+ tooltipeffect->setCurrentItem(2);
+ else if (TQApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
+ tooltipeffect->setCurrentItem(1);
+
+ if ( TQApplication::isEffectEnabled( Qt::UI_AnimateToolBox ) )
+ toolboxeffect->setCurrentItem( 1 );
+
+ TQSize globalStrut = TQApplication::globalStrut();
+ strutwidth->setValue(globalStrut.width());
+ strutheight->setValue(globalStrut.height());
+
+ libpathlistbox->clear();
+ libpathlistbox->insertStringList(TQApplication::libraryPaths());
+
+ // tqfind the default family
+ TQStringList::Iterator sit = families.begin();
+ int i = 0, possible = -1;
+ while (sit != families.end()) {
+ if (*sit == TQApplication::font().family())
+ break;
+ if ((*sit).tqcontains(TQApplication::font().family()))
+ possible = i;
+
+ i++;
+ sit++;
+ }
+ if (sit == families.end())
+ i = possible;
+ if (i == -1) // no clue about the current font
+ i = 0;
+
+ familycombo->setCurrentItem(i);
+
+ TQStringList styles = TQT_TQSTRINGLIST_OBJECT(db.styles(familycombo->currentText()));
+ stylecombo->insertStringList(styles);
+
+ TQString stylestring = db.styleString(TQApplication::font());
+ sit = styles.begin();
+ i = 0;
+ possible = -1;
+ while (sit != styles.end()) {
+ if (*sit == stylestring)
+ break;
+ if ((*sit).tqcontains(stylestring))
+ possible = i;
+
+ i++;
+ sit++;
+ }
+ if (sit == styles.end())
+ i = possible;
+ if (i == -1) // no clue about the current font
+ i = 0;
+ stylecombo->setCurrentItem(i);
+
+ i = 0;
+ while (i < psizecombo->count()) {
+ if (psizecombo->text(i) == TQString::number(TQApplication::font().pointSize())) {
+ psizecombo->setCurrentItem(i);
+ break;
+ }
+
+ i++;
+ }
+
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(familysubcombo->currentText()));
+ sublistbox->clear();
+ sublistbox->insertStringList(subs);
+
+ rtlExtensions->setChecked( settings.readBoolEntry( "/qt/useRtlExtensions", FALSE ) );
+
+#ifdef TQ_WS_X11
+ inputStyle->setCurrentText( settings.readEntry( "/qt/XIMInputStyle", trUtf8( "On The Spot" ) ) );
+#else
+ inputStyle->hide();
+ inputStyleLabel->hide();
+#endif
+
+ fontembeddingcheckbox->setChecked( settings.readBoolEntry("/qt/embedFonts", TRUE) );
+ fontpaths = settings.readListEntry("/qt/fontPath", ':');
+ fontpathlistbox->insertStringList(fontpaths);
+
+ setModified(FALSE);
+}
+
+
+MainWindow::~MainWindow()
+{
+}
+
+
+void MainWindow::fileSave()
+{
+ if (! modified) {
+ statusBar()->message("No changes to be saved.", 2000);
+ return;
+ }
+
+ statusBar()->message("Saving changes...");
+
+ {
+ TQSettings settings;
+ TQFontDatabase db;
+ TQFont font = db.font(familycombo->currentText(),
+ stylecombo->currentText(),
+ psizecombo->currentText().toInt());
+ TQStringList actcg, inactcg, discg;
+
+ int i;
+ for (i = 0; i < TQColorGroup::NColorRoles; i++)
+ actcg << editPalette.color(TQPalette::Active,
+ (TQColorGroup::ColorRole) i).name();
+ for (i = 0; i < TQColorGroup::NColorRoles; i++)
+ inactcg << editPalette.color(TQPalette::Inactive,
+ (TQColorGroup::ColorRole) i).name();
+ for (i = 0; i < TQColorGroup::NColorRoles; i++)
+ discg << editPalette.color(TQPalette::Disabled,
+ (TQColorGroup::ColorRole) i).name();
+
+ settings.writeEntry("/qt/font", font.toString());
+ settings.writeEntry("/qt/Palette/active", actcg);
+ settings.writeEntry("/qt/Palette/inactive", inactcg);
+ settings.writeEntry("/qt/Palette/disabled", discg);
+
+ TQStringList libpath = TQApplication::libraryPaths();
+ TQString libpathkey =
+ TQString("/qt/%1.%2/libraryPath").arg( TQT_VERSION >> 16 ).arg( (TQT_VERSION & 0xff00 ) >> 8 );
+ settings.writeEntry(libpathkey, libpath, ':');
+ settings.writeEntry("/qt/fontPath", fontpaths, ':');
+ settings.writeEntry("/qt/embedFonts", fontembeddingcheckbox->isChecked() );
+ settings.writeEntry("/qt/style", gstylecombo->currentText());
+ settings.writeEntry("/qt/doubleClickInterval",
+ dcispin->value());
+ settings.writeEntry("/qt/cursorFlashTime", cfispin->value() == 9 ? 0 : cfispin->value() );
+ settings.writeEntry("/qt/wheelScrollLines", wslspin->value());
+ settings.writeEntry("/qt/resolveSymlinks", resolvelinks->isChecked());
+
+ TQStringList strut;
+ strut << TQString::number(strutwidth->value());
+ strut << TQString::number(strutheight->value());
+ settings.writeEntry("/qt/globalStrut", strut);
+
+ settings.writeEntry("/qt/useRtlExtensions", rtlExtensions->isChecked() );
+
+#ifdef TQ_WS_X11
+ TQString style = inputStyle->currentText();
+ TQString str = "On The Spot";
+ if ( style == trUtf8( "Over The Spot" ) )
+ str = "Over The Spot";
+ else if ( style == trUtf8( "Off The Spot" ) )
+ str = "Off The Spot";
+ else if ( style == trUtf8( "Root" ) )
+ str = "Root";
+ settings.writeEntry( "/qt/XIMInputStyle", inputStyle->currentText() );
+#endif
+
+ TQStringList effects;
+ if (effectcheckbox->isChecked()) {
+ effects << "general";
+
+ switch (menueffect->currentItem()) {
+ case 1: effects << "animatemenu"; break;
+ case 2: effects << "fademenu"; break;
+ }
+
+ switch (comboeffect->currentItem()) {
+ case 1: effects << "animatecombo"; break;
+ }
+
+ switch (tooltipeffect->currentItem()) {
+ case 1: effects << "animatetooltip"; break;
+ case 2: effects << "fadetooltip"; break;
+ }
+
+ switch ( toolboxeffect->currentItem() ) {
+ case 1: effects << "animatetoolbox"; break;
+ }
+ } else
+ effects << "none";
+ settings.writeEntry("/qt/GUIEffects", effects);
+
+ TQStringList familysubs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutions());
+ TQStringList::Iterator fit = familysubs.begin();
+ while (fit != familysubs.end()) {
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(*fit));
+ settings.writeEntry("/qt/Font Substitutions/" + *fit, subs);
+ fit++;
+ }
+ }
+
+#if defined(TQ_WS_X11)
+ TQApplication::x11_apply_settings();
+#endif // TQ_WS_X11
+
+ setModified(FALSE);
+ statusBar()->message("Saved changes.");
+}
+
+
+void MainWindow::fileExit()
+{
+ tqApp->closeAllWindows();
+}
+
+
+void MainWindow::setModified(bool m)
+{
+ if (modified == m)
+ return;
+
+ modified = m;
+ fileSaveAction->setEnabled(m);
+}
+
+
+void MainWindow::buildPalette()
+{
+ int i;
+ TQColorGroup cg;
+ TQColor btn = buttonMainColor->color();
+ TQColor back = buttonMainColor2->color();
+ TQPalette automake( btn, back );
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), automake.active().color( centralFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ buildActiveEffect();
+
+ cg = editPalette.inactive();
+
+ TQPalette temp( editPalette.active().color( TQColorGroup::Button ),
+ editPalette.active().color( TQColorGroup::Background ) );
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), temp.inactive().color( centralFromItem(i) ) );
+
+ editPalette.setInactive( cg );
+ buildInactiveEffect();
+
+ cg = editPalette.disabled();
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), temp.disabled().color( centralFromItem(i) ) );
+
+ editPalette.setDisabled( cg );
+ buildDisabledEffect();
+
+ updateColorButtons();
+
+ setModified(TRUE);
+}
+
+
+void MainWindow::buildActiveEffect()
+{
+ TQColorGroup cg = editPalette.active();
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ TQPalette temp( btn, btn );
+
+ for (int i = 0; i<5; i++)
+ cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ setPreviewPalette( editPalette );
+
+ updateColorButtons();
+}
+
+
+void MainWindow::buildInactive()
+{
+ editPalette.setInactive( editPalette.active() );
+ buildInactiveEffect();
+}
+
+
+void MainWindow::buildInactiveEffect()
+{
+ TQColorGroup cg = editPalette.inactive();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setInactive( cg );
+ setPreviewPalette( editPalette );
+ updateColorButtons();
+}
+
+
+void MainWindow::buildDisabled()
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( TQColorGroup::ButtonText, Qt::darkGray );
+ cg.setColor( TQColorGroup::Foreground, Qt::darkGray );
+ cg.setColor( TQColorGroup::Text, Qt::darkGray );
+ cg.setColor( TQColorGroup::HighlightedText, Qt::darkGray );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+}
+
+
+void MainWindow::buildDisabledEffect()
+{
+ TQColorGroup cg = editPalette.disabled();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setDisabled( cg );
+ setPreviewPalette( editPalette );
+ updateColorButtons();
+}
+
+
+void MainWindow::setPreviewPalette( const TQPalette& pal )
+{
+ TQColorGroup cg;
+
+ switch (paletteCombo->currentItem()) {
+ case 0:
+ default:
+ cg = pal.active();
+ break;
+ case 1:
+ cg = pal.inactive();
+ break;
+ case 2:
+ cg = pal.disabled();
+ break;
+ }
+ previewPalette.setActive( cg );
+ previewPalette.setInactive( cg );
+ previewPalette.setDisabled( cg );
+
+ previewFrame->setPreviewPalette(previewPalette);
+}
+
+
+void MainWindow::updateColorButtons()
+{
+ buttonMainColor->setColor( editPalette.active().color( TQColorGroup::Button ));
+ buttonMainColor2->setColor( editPalette.active().color( TQColorGroup::Background ));
+}
+
+
+void MainWindow::tunePalette()
+{
+ bool ok;
+ TQPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette,
+ backgroundMode(), this);
+ if (! ok)
+ return;
+
+ editPalette = pal;
+ setPreviewPalette(editPalette);
+ setModified(TRUE);
+}
+
+
+void MainWindow::paletteSelected(int)
+{
+ setPreviewPalette(editPalette);
+}
+
+
+void MainWindow::styleSelected(const TQString &stylename)
+{
+ TQStyle *style = TQStyleFactory::create(stylename);
+ if (! style)
+ return;
+
+ setStyleHelper(previewFrame, style);
+ delete previewstyle;
+ previewstyle = style;
+
+ setModified(TRUE);
+}
+
+
+void MainWindow::familySelected(const TQString &family)
+{
+ TQFontDatabase db;
+ TQStringList styles = TQT_TQSTRINGLIST_OBJECT(db.styles(family));
+ stylecombo->clear();
+ stylecombo->insertStringList(styles);
+ familysubcombo->insertItem(family);
+ buildFont();
+}
+
+
+void MainWindow::buildFont()
+{
+ TQFontDatabase db;
+ TQFont font = db.font(familycombo->currentText(),
+ stylecombo->currentText(),
+ psizecombo->currentText().toInt());
+ samplelineedit->setFont(font);
+ setModified(TRUE);
+}
+
+
+void MainWindow::substituteSelected(const TQString &family)
+{
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(family));
+ sublistbox->clear();
+ sublistbox->insertStringList(subs);
+}
+
+
+void MainWindow::removeSubstitute()
+{
+ if (sublistbox->currentItem() < 0 ||
+ uint(sublistbox->currentItem()) > sublistbox->count())
+ return;
+
+ int item = sublistbox->currentItem();
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(familysubcombo->currentText()));
+ subs.remove(subs.at(sublistbox->currentItem()));
+ sublistbox->clear();
+ sublistbox->insertStringList(subs);
+ if (uint(item) > sublistbox->count())
+ item = int(sublistbox->count()) - 1;
+ sublistbox->setCurrentItem(item);
+ TQFont::removeSubstitution(familysubcombo->currentText());
+ TQFont::insertSubstitutions(familysubcombo->currentText(), subs);
+ setModified(TRUE);
+}
+
+
+void MainWindow::addSubstitute()
+{
+ if (sublistbox->currentItem() < 0 ||
+ uint(sublistbox->currentItem()) > sublistbox->count()) {
+ TQFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText());
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(familysubcombo->currentText()));
+ sublistbox->clear();
+ sublistbox->insertStringList(subs);
+ setModified(TRUE);
+ return;
+ }
+
+ int item = sublistbox->currentItem();
+ TQFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText());
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(familysubcombo->currentText()));
+ sublistbox->clear();
+ sublistbox->insertStringList(subs);
+ sublistbox->setCurrentItem(item);
+ setModified(TRUE);
+}
+
+
+void MainWindow::downSubstitute()
+{
+ if (sublistbox->currentItem() < 0 ||
+ uint(sublistbox->currentItem()) >= sublistbox->count())
+ return;
+
+ int item = sublistbox->currentItem();
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(familysubcombo->currentText()));
+ TQStringList::Iterator it = subs.at(item);
+ TQString fam = *it;
+ subs.remove(it);
+ it = subs.at(item);
+ subs.insert(++it, fam);
+ sublistbox->clear();
+ sublistbox->insertStringList(subs);
+ sublistbox->setCurrentItem(item + 1);
+ TQFont::removeSubstitution(familysubcombo->currentText());
+ TQFont::insertSubstitutions(familysubcombo->currentText(), subs);
+ setModified(TRUE);
+}
+
+
+void MainWindow::upSubstitute()
+{
+ if (sublistbox->currentItem() < 1)
+ return;
+
+ int item = sublistbox->currentItem();
+ TQStringList subs = TQT_TQSTRINGLIST_OBJECT(TQFont::substitutes(familysubcombo->currentText()));
+ TQStringList::Iterator it = subs.at(item);
+ TQString fam = *it;
+ subs.remove(it);
+ it = subs.at(item - 1);
+ subs.insert(it, fam);
+ sublistbox->clear();
+ sublistbox->insertStringList(subs);
+ sublistbox->setCurrentItem(item - 1);
+ TQFont::removeSubstitution(familysubcombo->currentText());
+ TQFont::insertSubstitutions(familysubcombo->currentText(), subs);
+ setModified(TRUE);
+}
+
+
+void MainWindow::removeLibpath()
+{
+ if (libpathlistbox->currentItem() < 0 ||
+ uint(libpathlistbox->currentItem()) > libpathlistbox->count())
+ return;
+
+ int item = libpathlistbox->currentItem();
+ TQStringList paths = TQApplication::libraryPaths();
+ paths.remove(paths.at(libpathlistbox->currentItem()));
+ libpathlistbox->clear();
+ libpathlistbox->insertStringList(paths);
+ if (uint(item) > libpathlistbox->count())
+ item = int(libpathlistbox->count()) - 1;
+ libpathlistbox->setCurrentItem(item);
+ TQApplication::tqsetLibraryPaths(paths);
+ setModified(TRUE);
+}
+
+
+void MainWindow::addLibpath()
+{
+ if (libpathlineedit->text().isEmpty())
+ return;
+
+ if (libpathlistbox->currentItem() < 0 ||
+ uint(libpathlistbox->currentItem()) > libpathlistbox->count()) {
+ TQStringList paths = TQApplication::libraryPaths();
+ paths.append(libpathlineedit->text());
+ libpathlistbox->clear();
+ libpathlistbox->insertStringList(paths);
+ TQApplication::tqsetLibraryPaths(paths);
+ setModified(TRUE);
+
+ return;
+ }
+
+ int item = libpathlistbox->currentItem();
+ TQStringList paths =TQApplication::libraryPaths();
+ paths.insert(++paths.at(libpathlistbox->currentItem()),
+ libpathlineedit->text());
+ libpathlistbox->clear();
+ libpathlistbox->insertStringList(paths);
+ libpathlistbox->setCurrentItem(item);
+ TQApplication::tqsetLibraryPaths(paths);
+ setModified(TRUE);
+}
+
+
+void MainWindow::downLibpath()
+{
+ if (libpathlistbox->currentItem() < 0 ||
+ uint(libpathlistbox->currentItem()) >= libpathlistbox->count() - 1)
+ return;
+
+ int item = libpathlistbox->currentItem();
+ TQStringList paths = TQApplication::libraryPaths();
+ TQStringList::Iterator it = paths.at(item);
+ TQString fam = *it;
+ paths.remove(it);
+ it = paths.at(item);
+ paths.insert(++it, fam);
+ libpathlistbox->clear();
+ libpathlistbox->insertStringList(paths);
+ libpathlistbox->setCurrentItem(item + 1);
+ TQApplication::tqsetLibraryPaths(paths);
+ setModified(TRUE);
+}
+
+
+void MainWindow::upLibpath()
+{
+ if (libpathlistbox->currentItem() < 1)
+ return;
+
+ int item = libpathlistbox->currentItem();
+ TQStringList paths = TQApplication::libraryPaths();
+ TQStringList::Iterator it = paths.at(item);
+ TQString fam = *it;
+ paths.remove(it);
+ it = paths.at(item - 1);
+ paths.insert(it, fam);
+ libpathlistbox->clear();
+ libpathlistbox->insertStringList(paths);
+ libpathlistbox->setCurrentItem(item - 1);
+ TQApplication::tqsetLibraryPaths(paths);
+ setModified(TRUE);
+}
+
+
+void MainWindow::browseLibpath()
+{
+ TQString dirname = TQFileDialog::getExistingDirectory(TQString(), this, 0,
+ tr("Select a Directory"));
+ if (dirname.isNull())
+ return;
+
+ libpathlineedit->setText(dirname);
+}
+
+
+void MainWindow::removeFontpath()
+{
+ if (fontpathlistbox->currentItem() < 0 ||
+ uint(fontpathlistbox->currentItem()) > fontpathlistbox->count())
+ return;
+
+ int item = fontpathlistbox->currentItem();
+ fontpaths.remove(fontpaths.at(fontpathlistbox->currentItem()));
+ fontpathlistbox->clear();
+ fontpathlistbox->insertStringList(fontpaths);
+ if (uint(item) > fontpathlistbox->count())
+ item = int(fontpathlistbox->count()) - 1;
+ fontpathlistbox->setCurrentItem(item);
+ setModified(TRUE);
+}
+
+
+void MainWindow::addFontpath()
+{
+ if (fontpathlineedit->text().isEmpty())
+ return;
+
+ if (fontpathlistbox->currentItem() < 0 ||
+ uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) {
+ fontpaths.append(fontpathlineedit->text());
+ fontpathlistbox->clear();
+ fontpathlistbox->insertStringList(fontpaths);
+ setModified(TRUE);
+
+ return;
+ }
+
+ int item = fontpathlistbox->currentItem();
+ fontpaths.insert(++fontpaths.at(fontpathlistbox->currentItem()),
+ fontpathlineedit->text());
+ fontpathlistbox->clear();
+ fontpathlistbox->insertStringList(fontpaths);
+ fontpathlistbox->setCurrentItem(item);
+ setModified(TRUE);
+}
+
+
+void MainWindow::downFontpath()
+{
+ if (fontpathlistbox->currentItem() < 0 ||
+ uint(fontpathlistbox->currentItem()) >= fontpathlistbox->count() - 1)
+ return;
+
+ int item = fontpathlistbox->currentItem();
+ TQStringList::Iterator it = fontpaths.at(item);
+ TQString fam = *it;
+ fontpaths.remove(it);
+ it = fontpaths.at(item);
+ fontpaths.insert(++it, fam);
+ fontpathlistbox->clear();
+ fontpathlistbox->insertStringList(fontpaths);
+ fontpathlistbox->setCurrentItem(item + 1);
+ setModified(TRUE);
+}
+
+
+void MainWindow::upFontpath()
+{
+ if (fontpathlistbox->currentItem() < 1)
+ return;
+
+ int item = fontpathlistbox->currentItem();
+ TQStringList::Iterator it = fontpaths.at(item);
+ TQString fam = *it;
+ fontpaths.remove(it);
+ it = fontpaths.at(item - 1);
+ fontpaths.insert(it, fam);
+ fontpathlistbox->clear();
+ fontpathlistbox->insertStringList(fontpaths);
+ fontpathlistbox->setCurrentItem(item - 1);
+ setModified(TRUE);
+}
+
+
+void MainWindow::browseFontpath()
+{
+ TQString dirname = TQFileDialog::getExistingDirectory(TQString(), this, 0,
+ tr("Select a Directory"));
+ if (dirname.isNull())
+ return;
+
+ fontpathlineedit->setText(dirname);
+}
+
+
+void MainWindow::somethingModified()
+{
+ setModified(TRUE);
+}
+
+
+void MainWindow::helpAbout()
+{
+ TQMessageBox::about(this, tr("TQt Configuration"),
+ tr(about_text));
+}
+
+
+void MainWindow::helpAboutTQt()
+{
+ TQMessageBox::aboutTQt(this, tr("TQt Configuration"));
+}
+
+
+void MainWindow::pageChanged(TQWidget *page)
+{
+ if (page == tab)
+ helpview->setText(tr(appearance_text));
+ else if (page == tab_2)
+ helpview->setText(tr(font_text));
+ else if (page == tab_3)
+ helpview->setText(tr(interface_text));
+ else if (page == tab_4)
+ helpview->setText(tr(libpath_text));
+ else if (page == tab_5)
+ helpview->setText(tr(printer_text));
+}
+
+
+void MainWindow::closeEvent(TQCloseEvent *e)
+{
+ if (modified) {
+ switch(TQMessageBox::warning(this, tr("Save Changes"),
+ tr("Save changes to settings?"),
+ tr("&Yes"), tr("&No"), tr("&Cancel"), 0, 2)) {
+ case 0: // save
+ tqApp->processEvents();
+ fileSave();
+
+ // fall through intended
+ case 1: // don't save
+ e->accept();
+ break;
+
+ case 2: // cancel
+ e->ignore();
+ break;
+
+ default: break;
+ }
+ } else
+ e->accept();
+}
diff --git a/tqtinterface/qt4/tools/qtconfig/mainwindow.h b/tqtinterface/qt4/tools/qtconfig/mainwindow.h
new file mode 100644
index 0000000..6f22c06
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/mainwindow.h
@@ -0,0 +1,104 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include "mainwindowbase.h"
+
+
+class MainWindow : public MainWindowBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ MainWindow();
+ ~MainWindow();
+
+ void closeEvent(TQCloseEvent *);
+
+
+public Q_SLOTS:
+ virtual void buildPalette();
+ virtual void buildFont();
+ virtual void tunePalette();
+ virtual void paletteSelected(int);
+ virtual void styleSelected(const TQString &);
+ virtual void familySelected(const TQString &);
+ virtual void substituteSelected(const TQString &);
+ virtual void removeSubstitute();
+ virtual void addSubstitute();
+ virtual void downSubstitute();
+ virtual void upSubstitute();
+ virtual void removeLibpath();
+ virtual void addLibpath();
+ virtual void downLibpath();
+ virtual void upLibpath();
+ virtual void browseLibpath();
+ virtual void removeFontpath();
+ virtual void addFontpath();
+ virtual void downFontpath();
+ virtual void upFontpath();
+ virtual void browseFontpath();
+ virtual void fileSave();
+ virtual void fileExit();
+ virtual void somethingModified();
+ virtual void helpAbout();
+ virtual void helpAboutTQt();
+ virtual void pageChanged(TQWidget *);
+
+
+private:
+ void buildActive();
+ void buildActiveEffect();
+ void buildInactive();
+ void buildInactiveEffect();
+ void buildDisabled();
+ void buildDisabledEffect();
+
+ void updateColorButtons();
+ void updateFontSample();
+
+ void setPreviewPalette(const TQPalette &);
+
+ void setModified(bool);
+
+ TQPalette editPalette, previewPalette;
+ TQStyle *previewstyle;
+ TQStringList fontpaths;
+ bool modified;
+};
+
+
+#endif // MAINWINDOW_H
diff --git a/tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui b/tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui
new file mode 100644
index 0000000..fb56464
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/mainwindowbase.ui
@@ -0,0 +1,1827 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>MainWindowBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQMainWindow">
+ <property name="name">
+ <cstring>MainWindowBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>700</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>TQt Configuration</string>
+ </property>
+ <property name="icon">
+ <pixmap>appicon.png</pixmap>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQTextView">
+ <property name="name">
+ <cstring>helpview</cstring>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;p align=center&gt;&lt;b&gt;Documentation&lt;/b&gt;&lt;/p&gt;
+&lt;p&gt;This TQTextView will display a brief explanation about the current page, so that the user isn't confused about the settings he/she is twiddling.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQTabWidget">
+ <property name="name">
+ <cstring>TabWidget3</cstring>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Appearance</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox40</cstring>
+ </property>
+ <property name="title">
+ <string>GUI Style</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>gstylebuddy</cstring>
+ </property>
+ <property name="text">
+ <string>Select GUI &amp;Style:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>gstylecombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>gstylecombo</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>groupAutoPalette</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Build Palette</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignAuto</set>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelMainColor</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;3-D Effects:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonMainColor</cstring>
+ </property>
+ </widget>
+ <widget class="ColorButton">
+ <property name="name">
+ <cstring>buttonMainColor</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelMainColor2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string>Back&amp;ground:</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignVCenter</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonMainColor2</cstring>
+ </property>
+ </widget>
+ <widget class="ColorButton">
+ <property name="name">
+ <cstring>buttonMainColor2</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>70</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>btnAdvanced</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Tune Palette...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox126</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Preview</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Select &amp;Palette:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ <widget class="PreviewFrame" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>previewFrame</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>410</width>
+ <height>260</height>
+ </size>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Fonts</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Default Font</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>stylecombo</cstring>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>familycombo</cstring>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="2" column="1">
+ <property name="name">
+ <cstring>psizecombo</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>stylebuddy</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Style:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>stylecombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>psizebuddy</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Point Size:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>psizecombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>familybuddy</cstring>
+ </property>
+ <property name="text">
+ <string>F&amp;amily:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>familycombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>samplelineedit</cstring>
+ </property>
+ <property name="text">
+ <string>Sample Text</string>
+ </property>
+ <property name="tqalignment">
+ <set>AlignHCenter</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Font Substitution</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>famsubbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;elect or Enter a Family:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>familysubcombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>familysubcombo</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Current Substitutions:</string>
+ </property>
+ </widget>
+ <widget class="TQListBox">
+ <property name="name">
+ <cstring>sublistbox</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>Up</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>Down</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>Line2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>choosebuddy</cstring>
+ </property>
+ <property name="text">
+ <string>Select s&amp;ubstitute Family:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>choosesubcombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <property name="name">
+ <cstring>choosesubcombo</cstring>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Interface</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Feel Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>dcispin</cstring>
+ </property>
+ <property name="suffix">
+ <string> ms</string>
+ </property>
+ <property name="maxValue">
+ <number>10000</number>
+ </property>
+ <property name="minValue">
+ <number>10</number>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>dcibuddy</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Double Click Interval:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>dcispin</cstring>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>cfispin</cstring>
+ </property>
+ <property name="suffix">
+ <string> ms</string>
+ </property>
+ <property name="maxValue">
+ <number>10000</number>
+ </property>
+ <property name="minValue">
+ <number>9</number>
+ </property>
+ <property name="specialValueText">
+ <string>No blinking</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>cfibuddy</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cursor Flash Time:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cfispin</cstring>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>wslspin</cstring>
+ </property>
+ <property name="suffix">
+ <string> lines</string>
+ </property>
+ <property name="maxValue">
+ <number>20</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>wslbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>Wheel &amp;Scroll Lines:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>wslspin</cstring>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>resolvelinks</cstring>
+ </property>
+ <property name="text">
+ <string>Resolve symlinks in URLs</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>GUI Effects</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>effectcheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable</string>
+ </property>
+ <property name="accel">
+ <string>Alt+E</string>
+ </property>
+ </widget>
+ <widget class="TQFrame">
+ <property name="name">
+ <cstring>effectbase</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>meffectbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Menu Effect:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>menueffect</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>ceffectbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;omboBox Effect:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboeffect</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>teffectbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;ToolTip Effect:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>tooltipeffect</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>beffectbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>Tool&amp;Box Effect:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>toolboxeffect</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Disable</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Animate</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Fade</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>menueffect</cstring>
+ </property>
+ <property name="currentItem">
+ <number>0</number>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Disable</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Animate</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboeffect</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="2" column="1">
+ <item>
+ <property name="text">
+ <string>Disable</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Animate</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Fade</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>tooltipeffect</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox" row="3" column="1">
+ <item>
+ <property name="text">
+ <string>Disable</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Animate</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>toolboxeffect</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Global Strut</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>swbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>Minimum &amp;Width:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>strutwidth</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>shbuddy</cstring>
+ </property>
+ <property name="text">
+ <string>Minimum Hei&amp;ght:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>strutheight</cstring>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>strutwidth</cstring>
+ </property>
+ <property name="suffix">
+ <string> pixels</string>
+ </property>
+ <property name="maxValue">
+ <number>1000</number>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>strutheight</cstring>
+ </property>
+ <property name="suffix">
+ <string> pixels</string>
+ </property>
+ <property name="maxValue">
+ <number>1000</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>rtlExtensions</cstring>
+ </property>
+ <property name="text">
+ <string>Enhanced support for languages written right-to-left</string>
+ </property>
+ </widget>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>inputStyleLabel</cstring>
+ </property>
+ <property name="text">
+ <string>XIM Input Style:</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>On The Spot</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Over The Spot</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Off The Spot</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Root</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>inputStyle</cstring>
+ </property>
+ <property name="currentItem">
+ <number>0</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Library Paths</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox39</cstring>
+ </property>
+ <property name="title">
+ <string>Library Paths</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout68</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQListBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>libpathlistbox</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton8</cstring>
+ </property>
+ <property name="text">
+ <string>Down</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>PushButton9</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>PushButton7</cstring>
+ </property>
+ <property name="text">
+ <string>Up</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout71</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>TextLabel15</cstring>
+ </property>
+ <property name="text">
+ <string>Press the &lt;b&gt;Browse&lt;/b&gt; button or enter a directory and press Enter to add them to the list.</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>libpathlineedit</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>PushButton5</cstring>
+ </property>
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>PushButton6</cstring>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Printer</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>fontembeddingcheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>Enable Font embedding</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox10</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Font Paths</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <widget class="TQPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>PushButton11</cstring>
+ </property>
+ <property name="text">
+ <string>Up</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>PushButton13</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="TQListBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>fontpathlistbox</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton12</cstring>
+ </property>
+ <property name="text">
+ <string>Down</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout10</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>TextLabel15_2</cstring>
+ </property>
+ <property name="text">
+ <string>Press the &lt;b&gt;Browse&lt;/b&gt; button or enter a directory and press Enter to add them to the list.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>PushButton15</cstring>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ <widget class="TQLineEdit" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>fontpathlineedit</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>PushButton14</cstring>
+ </property>
+ <property name="text">
+ <string>Browse...</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </hbox>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <item text="&amp;File" name="PopupMenu">
+ <action name="fileSaveAction"/>
+ <separator/>
+ <action name="fileExitAction"/>
+ </item>
+ <item text="&amp;Help" name="PopupMenu_2">
+ <action name="helpAboutAction"/>
+ <action name="helpAboutTQtAction"/>
+ </item>
+</menubar>
+<toolbars>
+</toolbars>
+<customwidgets>
+ <customwidget>
+ <class>ColorButton</class>
+ <header location="local">colorbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>clicked()</signal>
+ <signal>colorChanged(const TQColor &amp;)</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ <property type="Bool">scale</property>
+ </customwidget>
+ <customwidget>
+ <class>PreviewFrame</class>
+ <header location="local">previewframe.h</header>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image1</pixmap>
+ </customwidget>
+</customwidgets>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset></iconset>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Save</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileExitAction</cstring>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="menuText">
+ <string>E&amp;xit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpAboutAction</cstring>
+ </property>
+ <property name="text">
+ <string>About</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;About</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpAboutTQtAction</cstring>
+ </property>
+ <property name="text">
+ <string>About TQt</string>
+ </property>
+ <property name="menuText">
+ <string>About &amp;TQt</string>
+ </property>
+ </action>
+</actions>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="4350">789c6dd7594f23471007f0f7fd14d6d6db2aaaf58c3db647511eb831b7317794879ac30760cc61c010e5bba7dcf5af5688167664fdb66bbaababbb67cccf1f8dab93c3c68f9fdf5e16b298968d7222cf8d1fd5eb6cf6f1e75f7ffcfded7b9a3656ff9aad46fafdb76fdf078b46d9389a3fd42bf04841699e964933b830b79a7019dd0b96955b895b5a703bcd572e08eea576ff6570ae0eedd477b792103f854b8b2fc6d1163f77237e646e37113f89b6f8307e3bf1785a8b0eedbc696eb7ad9db7e01ee6476ee4ffe0c6fd158c7c69182cde4eec6e87fea50dfbf8176e6ba7d07f96669999cfa325ccaf862bcc97a36dbccf60f178cee11cde706761f16917ae30fe6b7488a7851bf14d7327417f676eb4f756eea41e2f57e6d83e83919f6cba117f04235fd9765b3b0fa36dfc398cf973edc67a6fb951ffe768ab6765ee26b8dff213ef5f4630e2b9e7463ea7ee8ee5ff60ee2618af8eb6fe3238437eb91bf1299cdbfacad3cadd5617f5a11738c7fe4adcb8ffd68d7aeec15e8fc3683b9f62ee2518ef33dafa3f75e3bc957086f86eb4d56f3db8e8e6dd56f01a5cc1bbe65e629673d8ebd18d0efdc9058cf9f2c08df9e630ce037db8719ec37c7a9a7fb708f10267b65e7cef46fb3e9ca3fd23dad6ef0cf67abe99f304f95ec3a8871cbb71be52d8d777e8b6fee412f6f958be3adf5ea817b561afe7d86ded7c67ce13c46fc37ede2766c17a17059cd9f38e466e8c3f8eb6fd700f0b9ef7095c37cd3d37de178f2be76dcf876fa343bd790267f012f67a77cc319f69b4ed872e2ca8e732daeabfe3c6fa9cc235f21f9b8bd4f2a5cd687bfedbfd659ee7ede017b842becf6eb44fa3cbd0df8559b0ffe808ceb0ff37e01afba3652e52cc87a26dbe276ecca7097790ff73b4cdef0616ac4fdf6df1c2d1d67ee8c6f80318eb4bd1180ff529513f0ecf7b694b62f5a002ceccb2662e523c2fb7605f9f0fd8fbbf75e3bc2dcd3e9ebcb9f17ce8c05e8f83685bcf701e44eb2db65e4fd1b65eebe62245be53b8c6f3ffdd8dfd3933fbf884761f5f0edcd88f951bf118bf44bde926dae24fe01ae7af76e3f9169e2f45bb143c0f5fdcf6fea23b18f773eac6f3e63ddac6db75e37df5e8c6fbae65aebcde6d37beaf84f528aa52f03c9dc3359ea79939c627d136deab1befaf75b883ef23e76e3ccfaea36d7dc2f795322b05ebfb0ad738af7db7ad371f99fd7e59b8b13f276e9cdf1318f5e54337e6d78cb67cf761ec170efba1acaa1afd9db92d3f3a36d729ea77efc6f33cbccf2beddfe6478fe6d85e45dbfd851bf1577007f5d877e3bc86f5a9ea3a2d6cffdfc1debe116df5db73a39e37b0e777191dda257c7fa83b6e8a2eaae00eeceb13d6b7d69f325b79b058fd32b170c1a55ebffaac2ccae2b9e6118f79c253bd6ef9ee3fd7587fef79c60f7acf3cc617fcc84ffcac6d8ffcc20b7ee5377ee7257ff027aff1bac66ff0269716cf5b1ab7cd3bbcabb17ddee37d3ee0433ee2633ee1019ff290cff89c2ff89229c48b66f1ac3d5df135df7093134eb9c56dcef4b3c35dee71ce393111dbfa8c784a4205955451cd1d1ad1982634a55bbad3f80eddd38c1ef882e66cf52ab5ff2b8d7ea4277aa6175ad06bb866f446efb4d4df0ffad4fed762ffb7b44e1b9cd2266dd142c75e5ddb3cd0bb3e347a477bd9d5f83ee245e3f7689f0ee830f67d44c77412ee186946033aa5e197fecfe85c7bf7be2fe892aee89a6ea84989f6bfa434f4eff9df52c509b5d0779b32ea684d13ea528f728d1e882ebfce37f6cf077422b4ea5b440ad14af1a15452ab473aee52c65ff39789b64fe955f44eb9937b5d858c5b32d377c0c32a7fee7ecd5fe61aff284ff22c2fb290577993775db1443fb53ef2219f5ff2bf93356d5b970dd9d41eb77820dbb223bbab155ed55ffab2f725ffb1eccb81aed6931cca116ab490633909d10339fd5ffdef795d869ae7923bc27226e772415d5986b51d683663b9d4fcfbb1ff190fe54aaec35aeaa577ee20f24673e94b531249a585fc2b69ebfe3ed7dae91f75ba964b5c03e9d344ba1add93bce0826c3f87f3b2a9fb6f18aeba10ba2f563f25eb1b563771a5d17531e2513c5fba538b3111cd690dd73c7ef6a95f4c8aa99de12fe77da4951de9ffffea730be7fd9fdfbffd0b690edc6c</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="857">789c6d92cd4ec3300c80ef7d8a68b94da8dbba51a9423c02882312e210c7f95d3a241807847877eca4e93a84d54af9fcd5899374b316cf4f0f62bd693eceea1cb4d05ebd8b357e8ee3d7cbebfd77b3ea3a41cfae17bbd54db36a85168f6f27c3634563b9dfedb7db2da3acd8778cb1607f5bd0331ed4411f142330f65db5a1e0301444c64157d41507cd980a6a53d67515cbc723a3c66a6dc5624dc532d5a9a0b5058f8cd6566cdb56aaeba05436a0f43210a4826294369c31c63a4404002f55362c02e50d2f8001207a2f6531d4d131e729128227a32643152ed14ce86c4a09168605440ac031a57031b404091f3d861872d16c6ca9a01d87885cb430b9c29cac8b90122e0c7205094b4dd374b3a16d70056f15fc1f6323d8bc550757b3510680d3fc5e75e0f2b72e00f2212cbb464701d45d449796060199318490079775e8dc4b660e980c9dad9f1dd2f10428b7d02a991d9f58001ec0747374dbf24fa8c9fcff87fcdc35bf3990fd9c</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>fontpathlineedit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>addFontpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton15</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>addFontpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton6</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>addLibpath()</slot>
+ </connection>
+ <connection>
+ <sender>libpathlineedit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>addLibpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>addSubstitute()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton14</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>browseFontpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton5</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>browseLibpath()</slot>
+ </connection>
+ <connection>
+ <sender>stylecombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>buildFont()</slot>
+ </connection>
+ <connection>
+ <sender>psizecombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>buildFont()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton12</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>downFontpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton8</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>downLibpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>downSubstitute()</slot>
+ </connection>
+ <connection>
+ <sender>familycombo</sender>
+ <signal>activated(const TQString&amp;)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>familySelected(const TQString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>fileExitAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>fileExit()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>fileSave()</slot>
+ </connection>
+ <connection>
+ <sender>helpAboutAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>helpAbout()</slot>
+ </connection>
+ <connection>
+ <sender>helpAboutTQtAction</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>helpAboutTQt()</slot>
+ </connection>
+ <connection>
+ <sender>TabWidget3</sender>
+ <signal>currentChanged(TQWidget*)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>pageChanged(TQWidget*)</slot>
+ </connection>
+ <connection>
+ <sender>paletteCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>paletteSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>PushButton13</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>removeFontpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton9</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>removeLibpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>removeSubstitute()</slot>
+ </connection>
+ <connection>
+ <sender>effectcheckbox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>effectbase</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>fontembeddingcheckbox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GroupBox10</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>toolboxeffect</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>dcispin</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>cfispin</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>wslspin</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>menueffect</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>comboeffect</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>tooltipeffect</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>strutwidth</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>strutheight</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>effectcheckbox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>resolvelinks</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>fontembeddingcheckbox</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>rtlExtensions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>inputStyle</sender>
+ <signal>activated(int)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>somethingModified()</slot>
+ </connection>
+ <connection>
+ <sender>gstylecombo</sender>
+ <signal>activated(const TQString&amp;)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>styleSelected(const TQString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>familysubcombo</sender>
+ <signal>activated(const TQString&amp;)</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>substituteSelected(const TQString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>btnAdvanced</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>tunePalette()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton11</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>upFontpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton7</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>upLibpath()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindowBase</receiver>
+ <slot>upSubstitute()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>helpview</tabstop>
+ <tabstop>TabWidget3</tabstop>
+ <tabstop>familycombo</tabstop>
+ <tabstop>stylecombo</tabstop>
+ <tabstop>psizecombo</tabstop>
+ <tabstop>samplelineedit</tabstop>
+ <tabstop>familysubcombo</tabstop>
+ <tabstop>PushButton2</tabstop>
+ <tabstop>PushButton3</tabstop>
+ <tabstop>PushButton4</tabstop>
+ <tabstop>choosesubcombo</tabstop>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>dcispin</tabstop>
+ <tabstop>cfispin</tabstop>
+ <tabstop>wslspin</tabstop>
+ <tabstop>effectcheckbox</tabstop>
+ <tabstop>menueffect</tabstop>
+ <tabstop>comboeffect</tabstop>
+ <tabstop>tooltipeffect</tabstop>
+ <tabstop>strutwidth</tabstop>
+ <tabstop>strutheight</tabstop>
+ <tabstop>libpathlineedit</tabstop>
+ <tabstop>PushButton5</tabstop>
+ <tabstop>PushButton6</tabstop>
+ <tabstop>PushButton7</tabstop>
+ <tabstop>PushButton8</tabstop>
+ <tabstop>PushButton9</tabstop>
+ <tabstop>sublistbox</tabstop>
+ <tabstop>libpathlistbox</tabstop>
+</tabstops>
+<Q_SLOTS>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot>addFontpath()</slot>
+ <slot>addLibpath()</slot>
+ <slot>addSubstitute()</slot>
+ <slot>browseFontpath()</slot>
+ <slot>browseLibpath()</slot>
+ <slot>buildFont()</slot>
+ <slot>buildPalette()</slot>
+ <slot>downFontpath()</slot>
+ <slot>downLibpath()</slot>
+ <slot>downSubstitute()</slot>
+ <slot>familySelected( const TQString &amp; )</slot>
+ <slot>fileExit()</slot>
+ <slot>fileSave()</slot>
+ <slot>helpAbout()</slot>
+ <slot>helpAboutTQt()</slot>
+ <slot>new_slot()</slot>
+ <slot>pageChanged( TQWidget * )</slot>
+ <slot>paletteSelected( int )</slot>
+ <slot>removeFontpath()</slot>
+ <slot>removeLibpath()</slot>
+ <slot>removeSubstitute()</slot>
+ <slot>somethingModified()</slot>
+ <slot>styleSelected( const TQString &amp; )</slot>
+ <slot>substituteSelected( const TQString &amp; )</slot>
+ <slot>tunePalette()</slot>
+ <slot>upFontpath()</slot>
+ <slot>upLibpath()</slot>
+ <slot>upSubstitute()</slot>
+</Q_SLOTS>
+<pixmapinproject/>
+<layoutdefaults spacing="4" margin="8"/>
+<includehints>
+ <includehint>colorbutton.h</includehint>
+ <includehint>colorbutton.h</includehint>
+ <includehint>previewframe.h</includehint>
+</includehints>
+</UI>
diff --git a/tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.cpp b/tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.cpp
new file mode 100644
index 0000000..6939cef
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.cpp
@@ -0,0 +1,615 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "paletteeditoradvanced.h"
+#include "colorbutton.h"
+
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqapplication.h>
+#include <tqpushbutton.h>
+#include <tqlistbox.h>
+#include <tqpainter.h>
+#include <tqgroupbox.h>
+
+/*!
+ Class used by PaletteEditor for bold combobox items
+*/
+
+class BoldListBoxText : public TQListBoxText
+{
+public:
+ BoldListBoxText( TQString text, TQListBox* lb = 0 );
+
+protected:
+ virtual void paint( TQPainter* );
+};
+
+BoldListBoxText::BoldListBoxText( TQString text, TQListBox* lb )
+ : TQListBoxText( lb )
+{
+ setText( text );
+}
+
+void BoldListBoxText::paint( TQPainter* painter )
+{
+ TQFont f = painter->font();
+ f.setBold( TRUE );
+ painter->setFont( f );
+
+ TQListBoxText::paint( painter );
+}
+
+PaletteEditorAdvanced::PaletteEditorAdvanced( TQWidget * tqparent,
+ const char * name, bool modal, WFlags f )
+ : PaletteEditorAdvancedBase( tqparent, name, modal, f ), selectedPalette(0)
+{
+ editPalette = TQApplication::palette();
+ setPreviewPalette( editPalette );
+}
+
+PaletteEditorAdvanced::~PaletteEditorAdvanced()
+{
+}
+
+void PaletteEditorAdvanced::onToggleBuildInactive( bool v )
+{
+ if (selectedPalette == 1) {
+ groupCentral->setDisabled(v);
+ groupEffect->setDisabled(v);
+ }
+
+ if (v) {
+ buildInactive();
+ updateColorButtons();
+ }
+}
+
+void PaletteEditorAdvanced::onToggleBuildDisabled( bool v )
+{
+ if (selectedPalette == 2) {
+ groupCentral->setDisabled(v);
+ groupEffect->setDisabled(v);
+ }
+
+ if (v) {
+ buildDisabled();
+ updateColorButtons();
+ }
+}
+
+void PaletteEditorAdvanced::paletteSelected(int p)
+{
+ selectedPalette = p;
+
+ if(p == 1) { // inactive
+ groupCentral->setDisabled(checkBuildInactive->isChecked());
+ groupEffect->setDisabled(checkBuildInactive->isChecked());
+ }
+ else if (p == 2) { // disabled
+ groupCentral->setDisabled(checkBuildDisabled->isChecked());
+ groupEffect->setDisabled(checkBuildDisabled->isChecked());
+ }
+ else {
+ groupCentral->setEnabled(TRUE);
+ groupEffect->setEnabled(TRUE);
+ }
+ updateColorButtons();
+}
+
+void PaletteEditorAdvanced::onChooseCentralColor()
+{
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActiveCentralRole( buttonCentral->color() );
+ break;
+ case 1:
+ mapToInactiveCentralRole( buttonCentral->color() );
+ break;
+ case 2:
+ mapToDisabledCentralRole( buttonCentral->color() );
+ break;
+ }
+ updateColorButtons();
+}
+
+void PaletteEditorAdvanced::onChooseEffectColor()
+{
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActiveEffectRole( buttonEffect->color() );
+ break;
+ case 1:
+ mapToInactiveEffectRole( buttonEffect->color() );
+ break;
+ case 2:
+ mapToDisabledEffectRole( buttonEffect->color() );
+ break;
+ }
+ updateColorButtons();
+}
+
+void PaletteEditorAdvanced::onToggleBuildEffects( bool on )
+{
+ if (!on) return;
+ buildActiveEffect();
+ buildInactiveEffect();
+ buildDisabledEffect();
+}
+
+TQColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item )
+{
+ switch( item ) {
+ case 0:
+ return TQColorGroup::Background;
+ case 1:
+ return TQColorGroup::Foreground;
+ case 2:
+ return TQColorGroup::Button;
+ case 3:
+ return TQColorGroup::Base;
+ case 4:
+ return TQColorGroup::Text;
+ case 5:
+ return TQColorGroup::BrightText;
+ case 6:
+ return TQColorGroup::ButtonText;
+ case 7:
+ return TQColorGroup::Highlight;
+ case 8:
+ return TQColorGroup::HighlightedText;
+ case 9:
+ return TQColorGroup::Link;
+ case 10:
+ return TQColorGroup::LinkVisited;
+ default:
+ return TQColorGroup::NColorRoles;
+ }
+}
+
+TQColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item )
+{
+ switch( item ) {
+ case 0:
+ return TQColorGroup::Light;
+ case 1:
+ return TQColorGroup::Midlight;
+ case 2:
+ return TQColorGroup::Mid;
+ case 3:
+ return TQColorGroup::Dark;
+ case 4:
+ return TQColorGroup::Shadow;
+ default:
+ return TQColorGroup::NColorRoles;
+ }
+}
+
+void PaletteEditorAdvanced::onCentral( int item )
+{
+ TQColor c;
+
+ switch(selectedPalette) {
+ case 0:
+ default:
+ c = editPalette.active().color( centralFromItem(item) );
+ break;
+ case 1:
+ c = editPalette.inactive().color( centralFromItem(item) );
+ break;
+ case 2:
+ c = editPalette.disabled().color( centralFromItem(item) );
+ break;
+ }
+
+ buttonCentral->setColor(c);
+}
+
+void PaletteEditorAdvanced::onEffect( int item )
+{
+ TQColor c;
+ switch(selectedPalette) {
+ case 0:
+ default:
+ c = editPalette.active().color( effectFromItem(item) );
+ break;
+ case 1:
+ editPalette.inactive().color( effectFromItem(item) );
+ break;
+ case 2:
+ editPalette.disabled().color( effectFromItem(item) );
+ break;
+ }
+ buttonEffect->setColor(c);
+}
+
+void PaletteEditorAdvanced::mapToActiveCentralRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setActive( cg );
+
+ buildActiveEffect();
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToActiveEffectRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setActive( cg );
+
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToActivePixmapRole( const TQPixmap& pm )
+{
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.active();
+ if ( !pm.isNull() )
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
+ editPalette.setActive( cg );
+
+
+ buildActiveEffect();
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactiveCentralRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.inactive();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setInactive( cg );
+
+ buildInactiveEffect();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactiveEffectRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.inactive();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setInactive( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactivePixmapRole( const TQPixmap& pm )
+{
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.inactive();
+ if ( !pm.isNull() )
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
+ editPalette.setInactive( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledCentralRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.disabled();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledEffectRole( const TQColor& c )
+{
+ TQColorGroup cg = editPalette.disabled();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setDisabled( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledPixmapRole( const TQPixmap& pm )
+{
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.disabled();
+ if ( !pm.isNull() )
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
+
+ editPalette.setDisabled( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::buildActiveEffect()
+{
+ TQColorGroup cg = editPalette.active();
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ TQPalette temp( btn, btn );
+
+ for (int i = 0; i<5; i++)
+ cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ setPreviewPalette( editPalette );
+
+ updateColorButtons();
+}
+
+void PaletteEditorAdvanced::buildInactive()
+{
+ editPalette.setInactive( editPalette.active() );
+ if ( checkBuildEffect->isChecked() )
+ buildInactiveEffect();
+ else {
+ setPreviewPalette( editPalette );
+ updateColorButtons();
+ }
+
+}
+
+void PaletteEditorAdvanced::buildInactiveEffect()
+{
+ TQColorGroup cg = editPalette.inactive();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setInactive( cg );
+ setPreviewPalette( editPalette );
+ updateColorButtons();
+}
+
+void PaletteEditorAdvanced::buildDisabled()
+{
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( TQColorGroup::ButtonText, Qt::darkGray );
+ cg.setColor( TQColorGroup::Foreground, Qt::darkGray );
+ cg.setColor( TQColorGroup::Text, Qt::darkGray );
+ cg.setColor( TQColorGroup::HighlightedText, Qt::darkGray );
+ editPalette.setDisabled( cg );
+
+ if ( checkBuildEffect->isChecked() )
+ buildDisabledEffect();
+ else {
+ setPreviewPalette( editPalette );
+ updateColorButtons();
+ }
+}
+
+void PaletteEditorAdvanced::buildDisabledEffect()
+{
+ TQColorGroup cg = editPalette.disabled();
+
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = Qt::black;
+
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
+
+ editPalette.setDisabled( cg );
+ setPreviewPalette( editPalette );
+ updateColorButtons();
+}
+
+void PaletteEditorAdvanced::setPreviewPalette( const TQPalette& pal )
+{
+ TQColorGroup cg;
+
+ switch (selectedPalette) {
+ case 0:
+ default:
+ cg = pal.active();
+ break;
+ case 1:
+ cg = pal.inactive();
+ break;
+ case 2:
+ cg = pal.disabled();
+ break;
+ }
+ previewPalette.setActive( cg );
+ previewPalette.setInactive( cg );
+ previewPalette.setDisabled( cg );
+}
+
+void PaletteEditorAdvanced::updateColorButtons()
+{
+ TQColor central, effect;
+ switch (selectedPalette) {
+ case 0:
+ default:
+ central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) );
+ break;
+ case 1:
+ central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) );
+ break;
+ case 2:
+ central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) );
+ break;
+ }
+
+ buttonCentral->setColor(central);
+ buttonEffect->setColor(effect);
+}
+
+void PaletteEditorAdvanced::setPal( const TQPalette& pal )
+{
+ editPalette = pal;
+ setPreviewPalette( pal );
+ updateColorButtons();
+}
+
+TQPalette PaletteEditorAdvanced::pal() const
+{
+ return editPalette;
+}
+
+void PaletteEditorAdvanced::setupBackgroundMode( TQt::BackgroundMode mode )
+{
+ int initRole = 0;
+
+ switch( mode ) {
+ case TQt::PaletteBackground:
+ initRole = 0;
+ break;
+ case TQt::PaletteForeground:
+ initRole = 1;
+ break;
+ case TQt::PaletteButton:
+ initRole = 2;
+ break;
+ case TQt::PaletteBase:
+ initRole = 3;
+ break;
+ case TQt::PaletteText:
+ initRole = 4;
+ break;
+ case TQt::PaletteBrightText:
+ initRole = 5;
+ break;
+ case TQt::PaletteButtonText:
+ initRole = 6;
+ break;
+ case TQt::PaletteHighlight:
+ initRole = 7;
+ break;
+ case TQt::PaletteHighlightedText:
+ initRole = 8;
+ break;
+ case TQt::PaletteLight:
+ initRole = 9;
+ break;
+ case TQt::PaletteMidlight:
+ initRole = 10;
+ break;
+ case TQt::PaletteDark:
+ initRole = 11;
+ break;
+ case TQt::PaletteMid:
+ initRole = 12;
+ break;
+ case TQt::PaletteShadow:
+ initRole = 13;
+ break;
+ default:
+ initRole = -1;
+ break;
+ }
+
+ if ( initRole <= -1 ) return;
+
+ if (initRole > 8 ) {
+ comboEffect->setCurrentItem( initRole - 9 );
+ if ( comboEffect->listBox() ) {
+ TQString text = comboEffect->currentText();
+ comboEffect->listBox()->changeItem( new BoldListBoxText( text ), initRole - 9 );
+ }
+ }
+ else {
+ comboCentral->setCurrentItem( initRole );
+ if ( comboCentral->listBox() ) {
+ TQString text = comboCentral->currentText();
+ comboCentral->listBox()->changeItem( new BoldListBoxText( text ), initRole );
+ }
+ }
+}
+
+TQPalette PaletteEditorAdvanced::getPalette( bool *ok, const TQPalette &init,
+ TQt::BackgroundMode mode, TQWidget* tqparent,
+ const char* name )
+{
+ PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( tqparent, name, TRUE );
+ dlg->setupBackgroundMode( mode );
+
+ if ( init != TQPalette() )
+ dlg->setPal( init );
+ int resultCode = dlg->exec();
+
+ TQPalette result = init;
+ if ( resultCode == TQDialog::Accepted ) {
+ if ( ok )
+ *ok = TRUE;
+ result = dlg->pal();
+ } else {
+ if ( ok )
+ *ok = FALSE;
+ }
+ delete dlg;
+ return result;
+}
diff --git a/tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.h b/tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.h
new file mode 100644
index 0000000..be78f5b
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/paletteeditoradvanced.h
@@ -0,0 +1,99 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PALETTEEDITORADVANCED_H
+#define PALETTEEDITORADVANCED_H
+
+#include "paletteeditoradvancedbase.h"
+
+class PaletteEditorAdvanced : public PaletteEditorAdvancedBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+public:
+ PaletteEditorAdvanced( TQWidget * tqparent=0, const char * name=0,
+ bool modal=FALSE, WFlags f=0 );
+ ~PaletteEditorAdvanced();
+
+ static TQPalette getPalette( bool *ok, const TQPalette &pal, TQt::BackgroundMode mode = TQt::PaletteBackground,
+ TQWidget* tqparent = 0, const char* name = 0 );
+
+protected Q_SLOTS:
+ void paletteSelected(int);
+
+ void onCentral( int );
+ void onEffect( int );
+
+ void onChooseCentralColor();
+ void onChooseEffectColor();
+
+ void onToggleBuildEffects( bool );
+ void onToggleBuildInactive( bool );
+ void onToggleBuildDisabled( bool );
+
+protected:
+ void mapToActiveCentralRole( const TQColor& );
+ void mapToActiveEffectRole( const TQColor& );
+ void mapToActivePixmapRole( const TQPixmap& );
+ void mapToInactiveCentralRole( const TQColor& );
+ void mapToInactiveEffectRole( const TQColor& );
+ void mapToInactivePixmapRole( const TQPixmap& );
+ void mapToDisabledCentralRole( const TQColor& );
+ void mapToDisabledEffectRole( const TQColor& );
+ void mapToDisabledPixmapRole( const TQPixmap& );
+
+
+ void buildPalette();
+ void buildActiveEffect();
+ void buildInactive();
+ void buildInactiveEffect();
+ void buildDisabled();
+ void buildDisabledEffect();
+
+private:
+ void setPreviewPalette( const TQPalette& );
+ void updateColorButtons();
+ void setupBackgroundMode( TQt::BackgroundMode );
+
+ TQPalette pal() const;
+ void setPal( const TQPalette& );
+
+ TQColorGroup::ColorRole centralFromItem( int );
+ TQColorGroup::ColorRole effectFromItem( int );
+ TQPalette editPalette;
+ TQPalette previewPalette;
+
+ int selectedPalette;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/qtconfig/paletteeditoradvancedbase.ui b/tqtinterface/qt4/tools/qtconfig/paletteeditoradvancedbase.ui
new file mode 100644
index 0000000..8daf961
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/paletteeditoradvancedbase.ui
@@ -0,0 +1,682 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PaletteEditorAdvancedBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>PaletteEditorAdvancedBase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>295</width>
+ <height>346</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Tune Palette</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Palette&lt;/b&gt;&lt;p&gt;Change the palette of the current widget or form.&lt;/p&gt;&lt;p&gt;Use a generated palette or select colors for each color group and each color role.&lt;/p&gt;&lt;p&gt;The palette can be tested with different widget layouts in the preview section.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout14</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="text">
+ <string>Select &amp;Palette:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Auto</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBuildInactive</cstring>
+ </property>
+ <property name="text">
+ <string>Build inactive palette from active.</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBuildDisabled</cstring>
+ </property>
+ <property name="text">
+ <string>Build disabled palette from active.</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>groupCentral</cstring>
+ </property>
+ <property name="title">
+ <string>Central color &amp;roles</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Background</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Foreground</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Button</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Base</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BrightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ButtonText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Highlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>HighlightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Link</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>LinkVisited</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboCentral</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose central color role</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available central roles are: &lt;ul&gt; &lt;li&gt;Background - general background color.&lt;/li&gt; &lt;li&gt;Foreground - general foreground color. &lt;/li&gt; &lt;li&gt;Base - used as background color for e.g. text entry widgets, usually white or another light color. &lt;/li&gt; &lt;li&gt;Text - the forground color used with Base. Usually this is the same as the Foreground, in what case it must provide good contrast both with Background and Base. &lt;/li&gt; &lt;li&gt;Button - general button background color, where buttons need a background different from Background, as in the Macintosh style. &lt;/li&gt; &lt;li&gt;ButtonText - a foreground color used with the Button color. &lt;/li&gt; &lt;li&gt;Highlight - a color to indicate a selected or highlighted item. &lt;/li&gt; &lt;li&gt;HighlightedText - a text color that contrasts to Highlight. &lt;/li&gt; &lt;li&gt;BrightText - a text color that is very different from Foreground and contrasts well with e.g. black. &lt;/li&gt; &lt;/ul&gt; &lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout32_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelCentral</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&amp;Select Color:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonCentral</cstring>
+ </property>
+ </widget>
+ <widget class="ColorButton">
+ <property name="name">
+ <cstring>buttonCentral</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a color for the selected central color role.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>groupEffect</cstring>
+ </property>
+ <property name="title">
+ <string>3-D shadow &amp;effects</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout32_3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>checkBuildEffect</cstring>
+ </property>
+ <property name="text">
+ <string>Build &amp;from button color</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Generate shadings</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check to let 3D-effect colors be calculated from button-color.</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>Light</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Midlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Mid</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dark</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Shadow</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboEffect</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose 3D-effect color role</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available effect roles are: &lt;ul&gt; &lt;li&gt;Light - lighter than Button color. &lt;/li&gt; &lt;li&gt;Midlight - between Button and Light. &lt;/li&gt; &lt;li&gt;Mid - between Button and Dark. &lt;/li&gt; &lt;li&gt;Dark - darker than Button. &lt;/li&gt; &lt;li&gt;Shadow - a very dark color. &lt;/li&gt; &lt;/ul&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout31_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel">
+ <property name="name">
+ <cstring>labelEffect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="tqminimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Select Co&amp;lor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonEffect</cstring>
+ </property>
+ </widget>
+ <widget class="ColorButton">
+ <property name="name">
+ <cstring>buttonEffect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a color for the selected effect color role.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close dialog and apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close dialog and discard all changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>ColorButton</class>
+ <header location="local">colorbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>clicked()</signal>
+ <signal>colorChanged(const QColor &amp;)</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>paletteCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>paletteSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>comboCentral</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onCentral(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonCentral</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChooseCentralColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonEffect</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChooseEffectColor()</slot>
+ </connection>
+ <connection>
+ <sender>comboEffect</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onEffect(int)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildEffects(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comboEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildInactive</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildInactive(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildDisabled</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildDisabled(bool)</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">onCentral(int)</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseCentralColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseEffectColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onEffect(int)</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildDisabled(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildEffects(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildInactive(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">paletteSelected(int)</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>paletteCombo</tabstop>
+ <tabstop>checkBuildInactive</tabstop>
+ <tabstop>checkBuildDisabled</tabstop>
+ <tabstop>comboCentral</tabstop>
+ <tabstop>buttonCentral</tabstop>
+ <tabstop>checkBuildEffect</tabstop>
+ <tabstop>comboEffect</tabstop>
+ <tabstop>buttonEffect</tabstop>
+</tabstops>
+</UI>
diff --git a/tqtinterface/qt4/tools/qtconfig/previewframe.cpp b/tqtinterface/qt4/tools/qtconfig/previewframe.cpp
new file mode 100644
index 0000000..2129787
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/previewframe.cpp
@@ -0,0 +1,63 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "previewframe.h"
+
+#include <tqvbox.h>
+#include <tqpainter.h>
+
+PreviewFrame::PreviewFrame( TQWidget *tqparent, const char *name )
+ : TQVBox( tqparent, name )
+{
+ setMinimumSize(200, 200);
+ setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken);
+ setLineWidth(1);
+
+ Workspace * w = new Workspace( this );
+ w->setEraseColor(tqcolorGroup().dark());
+ previewWidget = new PreviewWidget( w );
+ previewWidget->move( 10, 10 );
+}
+
+void PreviewFrame::setPreviewPalette(TQPalette pal)
+{
+ previewWidget->setPalette(pal);
+}
+
+void Workspace::paintEvent( TQPaintEvent* )
+{
+ TQPainter p ( this );
+ p.setPen( TQPen( Qt::white ) );
+ p.drawText ( 0, height() / 2, width(), height(), TQt::AlignHCenter,
+ "The moose in the noose\nate the goose who was loose." );
+}
diff --git a/tqtinterface/qt4/tools/qtconfig/previewframe.h b/tqtinterface/qt4/tools/qtconfig/previewframe.h
new file mode 100644
index 0000000..bbb03ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/previewframe.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PREVIEWFRAME_H
+#define PREVIEWFRAME_H
+
+#include "previewwidget.h"
+
+#include <tqvbox.h>
+#include <tqworkspace.h>
+
+class Workspace : public TQWorkspace
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ Workspace( TQWidget* tqparent = 0, const char* name = 0 )
+ : TQWorkspace( tqparent, name ) {}
+ ~Workspace() {}
+
+protected:
+ void paintEvent( TQPaintEvent* );
+};
+
+class PreviewFrame : public TQVBox
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PreviewFrame( TQWidget *tqparent = 0, const char *name = 0 );
+ void setPreviewPalette(TQPalette);
+
+private:
+ PreviewWidget *previewWidget;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/qtconfig/previewwidget.cpp b/tqtinterface/qt4/tools/qtconfig/previewwidget.cpp
new file mode 100644
index 0000000..9ab0554
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/previewwidget.cpp
@@ -0,0 +1,75 @@
+/**********************************************************************
+** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "previewwidget.h"
+
+#include <tqobjectlist.h>
+
+PreviewWidget::PreviewWidget( TQWidget *tqparent, const char *name )
+ : PreviewWidgetBase( tqparent, name )
+{
+ // install event filter on child widgets
+ TQObjectList *l = queryList("TQWidget");
+ TQObjectListIt it(*l);
+ TQObject * obj;
+ while ((obj = it.current()) != 0) {
+ ++it;
+ obj->installEventFilter(this);
+ ((TQWidget*)obj)->setFocusPolicy(Qt::NoFocus);
+ }
+}
+
+
+void PreviewWidget::closeEvent(TQCloseEvent *e)
+{
+ e->ignore();
+}
+
+
+bool PreviewWidget::eventFilter(TQObject *, TQEvent *e)
+{
+ switch ( e->type() ) {
+ case TQEvent::MouseButtonPress:
+ case TQEvent::MouseButtonRelease:
+ case TQEvent::MouseButtonDblClick:
+ case TQEvent::MouseMove:
+ case TQEvent::KeyPress:
+ case TQEvent::KeyRelease:
+ case TQEvent::Enter:
+ case TQEvent::Leave:
+ return TRUE; // ignore;
+ default:
+ break;
+ }
+ return FALSE;
+}
diff --git a/tqtinterface/qt4/tools/qtconfig/previewwidget.h b/tqtinterface/qt4/tools/qtconfig/previewwidget.h
new file mode 100644
index 0000000..8fb12d6
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/previewwidget.h
@@ -0,0 +1,51 @@
+/**********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of TQt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef PREVIEWWIDGET_H
+#define PREVIEWWIDGET_H
+
+#include "previewwidgetbase.h"
+
+class PreviewWidget : public PreviewWidgetBase
+{
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ PreviewWidget( TQWidget *tqparent = 0, const char *name = 0 );
+
+ void closeEvent(TQCloseEvent *);
+ bool eventFilter(TQObject *, TQEvent *);
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/qtconfig/previewwidgetbase.ui b/tqtinterface/qt4/tools/qtconfig/previewwidgetbase.ui
new file mode 100644
index 0000000..a01b57c
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/previewwidgetbase.ui
@@ -0,0 +1,311 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PreviewWidgetBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of Qt Configuration.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>PreviewWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>378</width>
+ <height>236</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Preview Window</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout17</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>ButtonGroup</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>RadioButton1</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>RadioButton2</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton2</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>RadioButton3</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton3</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>ButtonGroup2</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>CheckBox1</cstring>
+ </property>
+ <property name="text">
+ <string>CheckBox1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox">
+ <property name="name">
+ <cstring>CheckBox2</cstring>
+ </property>
+ <property name="text">
+ <string>CheckBox2</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQProgressBar">
+ <property name="name">
+ <cstring>ProgressBar1</cstring>
+ </property>
+ <property name="progress">
+ <number>50</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLineEdit">
+ <property name="name">
+ <cstring>LineEdit1</cstring>
+ </property>
+ <property name="text">
+ <string>LineEdit</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>ComboBox</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>ComboBox1</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQSpinBox">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQScrollBar">
+ <property name="name">
+ <cstring>ScrollBar1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQSlider">
+ <property name="name">
+ <cstring>Slider1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQTextView">
+ <property name="name">
+ <cstring>textView</cstring>
+ </property>
+ <property name="tqmaximumSize">
+ <size>
+ <width>32767</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;
+&lt;a href="http://tqt.pearsoncomputing.net"&gt;http://tqt.pearsoncomputing.net&lt;/a&gt;
+&lt;/p&gt;
+&lt;p&gt;
+&lt;a href="http://trinity.pearsoncomputing.net"&gt;http://trinity.pearsoncomputing.net&lt;/a&gt;
+&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+</connections>
+</UI>
diff --git a/tqtinterface/qt4/tools/qtconfig/qtconfig.pro b/tqtinterface/qt4/tools/qtconfig/qtconfig.pro
new file mode 100644
index 0000000..aaef136
--- /dev/null
+++ b/tqtinterface/qt4/tools/qtconfig/qtconfig.pro
@@ -0,0 +1,18 @@
+TEMPLATE = app
+CONFIG += qt warn_on
+LANGUAGE = C++
+
+SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp
+HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h
+FORMS = mainwindowbase.ui paletteeditoradvancedbase.ui previewwidgetbase.ui
+IMAGES = images/appicon.png
+
+PROJECTNAME = Qt Configuration
+TARGET = qtconfig
+DESTDIR = ../../bin
+
+target.path=$$bins.path
+INSTALLS += target
+INCLUDEPATH += .
+DBFILE = qtconfig.db
+REQUIRES=full-config nocrosscompiler !win32*
diff --git a/tqtinterface/qt4/tools/qvfb/LICENSE.GPL b/tqtinterface/qt4/tools/qvfb/LICENSE.GPL
new file mode 100644
index 0000000..149f4ac
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/LICENSE.GPL
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which tqcontains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part tqcontains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it tqcontains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/tqtinterface/qt4/tools/qvfb/README b/tqtinterface/qt4/tools/qvfb/README
new file mode 100644
index 0000000..a4fac58
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/README
@@ -0,0 +1,55 @@
+Qt/Embedded Virtual Framebuffer
+===============================
+
+Please note that the qvfb program needs to be compiled with the X11 version
+of Qt.
+
+The virtual frame buffer allows a Qt/Embedded program to be developed on your
+desktop machine, without switching between consoles and X11. The virtual
+framebuffer consists of a shared memory region (the virtual frame buffer)
+and a utility to display the framebuffer in a window. The display is updated
+periodically, so you will see discrete snapshots of the framebuffer rather
+than each individual drawing operation. For this reason drawing problems
+such as flickering may not be aptqparent until the program is run using a real
+framebuffer.
+
+To use the virtual framebuffer:
+
+1. Ensure QT_NO_QWS_VFB is not set in qconfig.h (when you configure Qt,
+ add the -qvfb option).
+2. Start qvfb (qvfb should be compiled as a normal Qt/X11 application,
+ NOT as a Qt/Embedded application!).
+3. Start a Qt/Embedded server (i.e. construct QApplication with
+ QApplication::GuiServer flag, or run a client with the -qws option).
+
+qvfb supports the following command line options:
+
+[-width width] the width of the virtual framebuffer (default: 240).
+[-height height] the height of the virtual framebuffer (default: 320).
+[-depth depth] the depth of the virtual framebuffer (1,4,8 or 32, default: 8).
+[-nocursor] do not display the X11 cursor in the framebuffer window.
+[-qwsdisplay] the Qt/Embedded display ID, e.g. -qwsdisplay :1 (default :0).
+[-skin skinfile] tells qvfb to load a skin file, e.g. -skin pda.skin
+
+Please refer to the file "pda.skin" for an example of what a skin file looks like.
+The format for skin files is:
+ Image filename of skin with buttons in their up positions
+ Image filename of skin with buttons in their down positions
+ X offset of top left corner of the virtual screen on the skin image
+ Y offset of top left corner of the virtual screen on the skin image
+ Width of the virtual screen on the skin image
+ Height of the virtual screen on the skin image
+ Transparancy level of the Virtual Frame Buffer
+ Number of defined button regions
+Then for each button region the format is:
+ Button identifier
+ Qt scan codes to generate for the button
+ Top left X coordinate of the button region
+ Top left Y coordinate of the button region
+ Bottom right X coordinate of the button region
+ Bottom right Y coordinate of the button region
+
+The virtual framebuffer is a development tool only. No security issues have
+been considered in the virtual framebuffer design. It should not be used
+in a production environment and QT_NO_QWS_VFB should always be in force
+in production libraries.
diff --git a/tqtinterface/qt4/tools/qvfb/config.ui b/tqtinterface/qt4/tools/qvfb/config.ui
new file mode 100644
index 0000000..f7a8b6c
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/config.ui
@@ -0,0 +1,1684 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>Config</class>
+<comment>*********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of the Qt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free Qt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*********************************************************************</comment>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>Config</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>481</width>
+ <height>645</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Configure</string>
+ </property>
+ <property name="icon">
+ <pixmap>logo.png</pixmap>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQButtonGroup" row="0" column="1">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Depth</string>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>depth_1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>19</y>
+ <width>229</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>1 bit monochrome</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>depth_4gray</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>44</y>
+ <width>229</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>4 bit grayscale</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>depth_8</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>69</y>
+ <width>229</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>8 bit</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>depth_12</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>94</y>
+ <width>229</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>12 (16) bit</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>depth_16</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>119</y>
+ <width>229</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>16 bit</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>depth_32</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>11</x>
+ <y>144</y>
+ <width>229</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>32 bit</string>
+ </property>
+ </widget>
+ </widget>
+ <widget class="TQLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>touchScreen</cstring>
+ </property>
+ <property name="text">
+ <string>Emulate touch screen (no mouse move).</string>
+ </property>
+ </widget>
+ <widget class="TQGroupBox" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Gamma</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="6" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Blue</string>
+ </property>
+ </widget>
+ <widget class="TQSlider" row="6" column="1">
+ <property name="name">
+ <cstring>bslider</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>127</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>63</red>
+ <green>63</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>170</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>127</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>38</red>
+ <green>38</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>170</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>127</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>38</red>
+ <green>38</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>170</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="maxValue">
+ <number>400</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="6" column="2">
+ <property name="name">
+ <cstring>blabel</cstring>
+ </property>
+ <property name="text">
+ <string>1.0</string>
+ </property>
+ </widget>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Green</string>
+ </property>
+ </widget>
+ <widget class="TQSlider" row="4" column="1">
+ <property name="name">
+ <cstring>gslider</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>255</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>63</red>
+ <green>255</green>
+ <blue>63</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>127</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>255</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>38</red>
+ <green>255</green>
+ <blue>38</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>127</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>255</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>38</red>
+ <green>255</green>
+ <blue>38</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>127</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="maxValue">
+ <number>400</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="2">
+ <property name="name">
+ <cstring>glabel</cstring>
+ </property>
+ <property name="text">
+ <string>1.0</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="2">
+ <property name="name">
+ <cstring>TextLabel8</cstring>
+ </property>
+ <property name="text">
+ <string>1.0</string>
+ </property>
+ </widget>
+ <widget class="TQSlider" row="0" column="1">
+ <property name="name">
+ <cstring>gammaslider</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>127</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>170</red>
+ <green>170</green>
+ <blue>170</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>127</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>170</red>
+ <green>170</green>
+ <blue>170</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>127</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>170</red>
+ <green>170</green>
+ <blue>170</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="maxValue">
+ <number>400</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Red</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="2">
+ <property name="name">
+ <cstring>rlabel</cstring>
+ </property>
+ <property name="text">
+ <string>1.0</string>
+ </property>
+ </widget>
+ <widget class="TQSlider" row="2" column="1">
+ <property name="name">
+ <cstring>rslider</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>127</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>63</green>
+ <blue>63</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>170</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>127</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>38</green>
+ <blue>38</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>170</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>127</green>
+ <blue>127</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>38</green>
+ <blue>38</blue>
+ </color>
+ <color>
+ <red>127</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>170</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>10</red>
+ <green>95</green>
+ <blue>137</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="maxValue">
+ <number>400</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQPushButton" row="8" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>Set all to 1.0</string>
+ </property>
+ </widget>
+ <widget class="GammaView" row="0" column="3" rowspan="9" colspan="1">
+ <property name="name">
+ <cstring>MyCustomWidget1</cstring>
+ </property>
+ </widget>
+ <spacer row="7" column="1">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="tqsizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Size</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>size_240_320</cstring>
+ </property>
+ <property name="text">
+ <string>240x320 "PDA"</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>size_320_240</cstring>
+ </property>
+ <property name="text">
+ <string>320x240 "TV"</string>
+ </property>
+ </widget>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>size_640_480</cstring>
+ </property>
+ <property name="text">
+ <string>640x480 "VGA"</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>size_custom</cstring>
+ </property>
+ <property name="text">
+ <string>Custom</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox">
+ <property name="name">
+ <cstring>size_width</cstring>
+ </property>
+ <property name="maxValue">
+ <number>1280</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="lineStep">
+ <number>16</number>
+ </property>
+ <property name="value">
+ <number>400</number>
+ </property>
+ </widget>
+ <widget class="TQSpinBox">
+ <property name="name">
+ <cstring>size_height</cstring>
+ </property>
+ <property name="maxValue">
+ <number>1024</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="lineStep">
+ <number>16</number>
+ </property>
+ <property name="value">
+ <number>300</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton">
+ <property name="name">
+ <cstring>size_skin</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Skin</string>
+ </property>
+ </widget>
+ <widget class="TQComboBox">
+ <item>
+ <property name="text">
+ <string>pda.skin</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ipaq.skin</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>qpe.skin</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>cassiopeia.skin</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>other.skin</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>skin</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="TQLabel" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth &lt;i&gt;above&lt;/i&gt;. You may freely modify the Gamma &lt;i&gt;below&lt;/i&gt;.</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>GammaView</class>
+ <header location="local">gammaview.h</header>
+ <sizehint>
+ <width>64</width>
+ <height>64</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>3</hordata>
+ <verdata>3</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>Config</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>Config</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<pixmapinproject/>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tqtinterface/qt4/tools/qvfb/gammaview.h b/tqtinterface/qt4/tools/qvfb/gammaview.h
new file mode 100644
index 0000000..2acd3da
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/gammaview.h
@@ -0,0 +1,49 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef GAMMAVIEW_H
+#define GAMMAVIEW_H
+
+#include <tqwidget.h>
+
+class GammaView: public TQWidget
+{
+ TQ_OBJECT
+public:
+ GammaView( TQWidget *tqparent = 0,
+ const char *name = 0, WFlags f = 0 ) :
+ TQWidget(tqparent,name,f)
+ { }
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/qvfb/images/logo.png b/tqtinterface/qt4/tools/qvfb/images/logo.png
new file mode 100644
index 0000000..0cb2b68
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/images/logo.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/qvfb/main.cpp b/tqtinterface/qt4/tools/qvfb/main.cpp
new file mode 100644
index 0000000..8a11a44
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/main.cpp
@@ -0,0 +1,97 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqvfb.h"
+
+#include <tqapplication.h>
+#include <tqpainter.h>
+#include <tqregexp.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+void usage( const char *app )
+{
+ printf( "Usage: %s [-width width] [-height height] [-depth depth] "
+ "[-nocursor] [-qwsdisplay :id]\n"
+ "Supported depths: 1, 4, 8, 32\n", app );
+}
+
+int main( int argc, char *argv[] )
+{
+ TQApplication app( argc, argv );
+
+ int width = 240;
+ int height = 320;
+ int depth = 32;
+ bool cursor = TRUE;
+ TQString displaySpec( ":0" );
+ TQString skin;
+
+ for ( int i = 1; i < argc; i++ ){
+ TQString arg = argv[i];
+ if ( arg == "-width" ) {
+ width = atoi( argv[++i] );
+ } else if ( arg == "-height" ) {
+ height = atoi( argv[++i] );
+ } else if ( arg == "-skin" ) {
+ skin = argv[++i];
+ } else if ( arg == "-depth" ) {
+ depth = atoi( argv[++i] );
+ } else if ( arg == "-nocursor" ) {
+ cursor = FALSE;
+ } else if ( arg == "-qwsdisplay" ) {
+ displaySpec = argv[++i];
+ } else {
+ printf( "Unknown parameter %s\n", arg.latin1() );
+ usage( argv[0] );
+ exit(1);
+ }
+ }
+
+ int displayId = 0;
+ TQRegExp rx( ":[0-9]" );
+ int m = rx.search( displaySpec, 0 );
+ if ( m >= 0 ) {
+ displayId = displaySpec.mid( m+1, rx.matchedLength()-1 ).toInt();
+ }
+
+ qDebug( "Using display %d", displayId );
+
+ TQVFb mw( displayId, width, height, depth, skin );
+ app.setMainWidget( &mw );
+ mw.enableCursor(cursor);
+ mw.show();
+
+ return app.exec();
+}
diff --git a/tqtinterface/qt4/tools/qvfb/pda.skin b/tqtinterface/qt4/tools/qvfb/pda.skin
new file mode 100644
index 0000000..135e6b6
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/pda.skin
@@ -0,0 +1,15 @@
+pda_up.png pda_down.png
+57 81
+240 320
+0.5
+11
+"Power" 0x100a 277 36 302 57
+"F1" 0x1030 52 439 81 470
+"F2" 0x1031 101 422 130 451
+"F3" 0x1032 232 423 260 452
+"F4" 0x1033 279 445 309 473
+"Left" 0x1012 155 438 176 472
+"Down" 0x1015 169 471 203 486
+"Right" 0x1014 193 448 215 472
+"Up" 0x1013 166 427 199 451
+"Enter" 0x1005 177 448 193 468
diff --git a/tqtinterface/qt4/tools/qvfb/pda_down.png b/tqtinterface/qt4/tools/qvfb/pda_down.png
new file mode 100644
index 0000000..bc1f5ee
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/pda_down.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/qvfb/pda_up.png b/tqtinterface/qt4/tools/qvfb/pda_up.png
new file mode 100644
index 0000000..05e97df
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/pda_up.png
Binary files differ
diff --git a/tqtinterface/qt4/tools/qvfb/qanimationwriter.cpp b/tqtinterface/qt4/tools/qvfb/qanimationwriter.cpp
new file mode 100644
index 0000000..b3917f4
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qanimationwriter.cpp
@@ -0,0 +1,414 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqanimationwriter.h"
+
+#define TQT_CLEAN_NAMESPACE
+#include <tqfile.h>
+
+#include <png.h>
+#include <netinet/in.h> // for htonl
+
+class TQAnimationWriterData {
+public:
+ TQAnimationWriterData(TQIODevice* d) : dev(d)
+ {
+ framerate = 1000;
+ }
+ void setFrameRate(int d) { framerate = d; }
+ virtual ~TQAnimationWriterData() { }
+ virtual void setImage(const TQImage& src)=0;
+ virtual bool canCompose() const { return FALSE; }
+ virtual void composeImage(const TQImage&, const TQPoint& ) { }
+
+protected:
+ int framerate;
+ TQIODevice* dev;
+};
+
+
+class TQAnimationWriterMNG : public TQAnimationWriterData {
+ bool first;
+ png_structp png_ptr;
+ png_infop info_ptr;
+public:
+ TQAnimationWriterMNG(TQIODevice* d) : TQAnimationWriterData(d)
+ {
+ first = TRUE;
+ begin_png();
+ }
+
+ ~TQAnimationWriterMNG()
+ {
+ if ( first ) {
+ // Eh? Not images.
+ TQImage dummy(1,1,32);
+ setImage(dummy);
+ }
+ writeMEND();
+ end_png();
+ }
+
+ void begin_png()
+ {
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,0,0,0);
+ info_ptr = png_create_info_struct(png_ptr);
+ png_set_compression_level(png_ptr,9);
+ png_set_write_fn(png_ptr, (void*)this, write, 0);
+ }
+
+ void end_png()
+ {
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ }
+
+
+ static void write( png_structp png_ptr, png_bytep data, png_size_t length)
+ {
+ TQAnimationWriterMNG* that = (TQAnimationWriterMNG*)png_get_io_ptr(png_ptr);
+ /*uint nw =*/ that->dev->writeBlock((const char*)data,length);
+ }
+
+ void writePNG(const TQImage& image)
+ {
+ info_ptr->channels = 4;
+ png_set_sig_bytes(png_ptr, 8); // Pretend we already wrote the sig
+ png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(),
+ 8, image.hasAlphaBuffer()
+ ? PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB,
+ 0, 0, 0);
+ png_write_info(png_ptr, info_ptr);
+ if ( !image.hasAlphaBuffer() )
+ png_set_filler(png_ptr, 0,
+ TQImage::systemByteOrder() == TQImage::BigEndian ?
+ PNG_FILLER_BEFORE : PNG_FILLER_AFTER);
+ //if ( TQImage::systemByteOrder() == TQImage::BigEndian ) {
+ //png_set_swap_alpha(png_ptr);
+ //}
+ if ( TQImage::systemByteOrder() == TQImage::LittleEndian ) {
+ png_set_bgr(png_ptr);
+ }
+
+ png_bytep* row_pointers;
+ uint height = image.height();
+ uchar** jt = image.jumpTable();
+ row_pointers=new png_bytep[height];
+ uint y;
+ for (y=0; y<height; y++) {
+ row_pointers[y]=jt[y];
+ }
+ png_write_image(png_ptr, row_pointers);
+ delete [] row_pointers;
+ png_write_end(png_ptr, info_ptr);
+ end_png();
+ begin_png();
+ }
+
+ void writeMHDR( const TQSize& size, int framerate )
+ {
+ dev->writeBlock("\212MNG\r\n\032\n", 8);
+
+ struct {
+ int width;
+ int height;
+ int framerate;
+ int a,b,c;
+ int profile;
+ } chunk;
+ chunk.width = htonl(size.width());
+ chunk.height = htonl(size.height());
+ chunk.framerate = htonl(framerate);
+ chunk.a=0;
+ chunk.b=0;
+ chunk.c=0;
+ chunk.profile= htonl(0x00000003);
+
+ png_write_chunk(png_ptr, (png_byte*)"MHDR", (png_byte*)&chunk, sizeof(chunk));
+ }
+
+ void writeMEND()
+ {
+ png_write_chunk(png_ptr, (png_byte*)"MEND", 0, 0);
+ }
+
+ void writeDEFI( const TQPoint& offset, const TQSize& size )
+ {
+ struct {
+ ushort o;
+ uchar s;
+ uchar concrete;
+ int x,y;
+ int lc,rc,tc,bc;
+ } chunk;
+ chunk.o=0;
+ chunk.s=0;
+ chunk.concrete=1;
+ chunk.x=htonl(offset.x());
+ chunk.y=htonl(offset.y());
+ chunk.lc=0;
+ chunk.rc=0;
+ chunk.tc=htonl(INT_MAX);
+ chunk.bc=htonl(INT_MAX);
+
+ png_write_chunk(png_ptr, (png_byte*)"DEFI", (png_byte*)&chunk, sizeof(chunk));
+ }
+
+ void writeFRAM( const TQSize& size )
+ {
+ struct {
+ uchar mode;
+ uchar n;
+ uchar nu;
+ uchar d;
+ uchar t;
+ uchar clip;
+ uchar s;
+ uchar deltatype;
+ uint left;
+ uint right;
+ uint top;
+ uint bottom;
+ } chunk;
+ chunk.mode=1;
+ chunk.n='a';
+ chunk.nu=0;
+ chunk.d=0;
+ chunk.clip=1;
+ chunk.t=0;
+ chunk.s=0;
+ chunk.deltatype=0;
+ chunk.left=0;
+ chunk.right=htonl(size.width());
+ chunk.top=0;
+ chunk.bottom=htonl(size.height());
+
+ png_write_chunk(png_ptr, (png_byte*)"FRAM", (png_byte*)&chunk, sizeof(chunk));
+ }
+
+ void writeMOVE( const TQPoint& offset )
+ {
+ struct {
+ uchar filler[3];
+ uchar z[5];
+ int x,y;
+ } chunk;
+ memset(chunk.z,0,5);
+ chunk.x=htonl(offset.x());
+ chunk.y=htonl(offset.y());
+
+ png_write_chunk(png_ptr, (png_byte*)"MOVE", ((png_byte*)&chunk)+3, sizeof(chunk)-3);
+ }
+
+ void setImage(const TQImage& src)
+ {
+ if ( first ) {
+ first = FALSE;
+ writeMHDR(src.size(),framerate);
+ }
+ composeImage(src,TQPoint(0,0));
+ }
+
+ bool canCompose() const { return TRUE; }
+
+ void composeImage(const TQImage& src, const TQPoint& offset)
+ {
+ writeMOVE(offset);
+ //writeFRAM(src.size());
+ writePNG(src);
+ }
+};
+
+TQAnimationWriter::TQAnimationWriter( const TQString& filename, const char* format )
+{
+ if ( TQCString(format) != "MNG" ) {
+ qWarning("Format \"%s\" not supported, only MNG", format);
+ dev = 0;
+ d = 0;
+ } else {
+ TQFile *f = new TQFile(filename);
+ f->open(IO_WriteOnly);
+ dev = f;
+ d = new TQAnimationWriterMNG(dev);
+ }
+}
+
+bool TQAnimationWriter::okay() const
+{
+ return dev && dev->status() == IO_Ok;
+}
+
+TQAnimationWriter::~TQAnimationWriter()
+{
+ delete d;
+ delete dev;
+}
+
+void TQAnimationWriter::setFrameRate(int r)
+{
+ if (d) d->setFrameRate(r);
+}
+
+void TQAnimationWriter::appendFrame(const TQImage& frm, const TQPoint& offset)
+{
+ TQImage frame = frm.convertDepth(32);
+ const int alignx = 1;
+ if ( dev ) {
+ if ( prev.isNull() || !d->canCompose() ) {
+ d->setImage(frame);
+ } else {
+ bool done;
+ int minx, maxx, miny, maxy;
+ int w = frame.width();
+ int h = frame.height();
+
+ TQRgb** jt = (TQRgb**)frame.jumpTable();
+ TQRgb** pjt = (TQRgb**)prev.jumpTable() + offset.y();
+
+ // Find left edge of change
+ done = FALSE;
+ for (minx = 0; minx < w && !done; minx++) {
+ for (int ty = 0; ty < h; ty++) {
+ if ( jt[ty][minx] != pjt[ty][minx+offset.x()] ) {
+ done = TRUE;
+ break;
+ }
+ }
+ }
+ minx--;
+
+ // Find right edge of change
+ done = FALSE;
+ for (maxx = w-1; maxx >= 0 && !done; maxx--) {
+ for (int ty = 0; ty < h; ty++) {
+ if ( jt[ty][maxx] != pjt[ty][maxx+offset.x()] ) {
+ done = TRUE;
+ break;
+ }
+ }
+ }
+ maxx++;
+
+ // Find top edge of change
+ done = FALSE;
+ for (miny = 0; miny < h && !done; miny++) {
+ for (int tx = 0; tx < w; tx++) {
+ if ( jt[miny][tx] != pjt[miny][tx+offset.x()] ) {
+ done = TRUE;
+ break;
+ }
+ }
+ }
+ miny--;
+
+ // Find right edge of change
+ done = FALSE;
+ for (maxy = h-1; maxy >= 0 && !done; maxy--) {
+ for (int tx = 0; tx < w; tx++) {
+ if ( jt[maxy][tx] != pjt[maxy][tx+offset.x()] ) {
+ done = TRUE;
+ break;
+ }
+ }
+ }
+ maxy++;
+
+ if ( minx > maxx ) minx=maxx=0;
+ if ( miny > maxy ) miny=maxy=0;
+
+ if ( alignx > 1 ) {
+ minx -= minx % alignx;
+ maxx = maxx - maxx % alignx + alignx - 1;
+ }
+
+ int dw = maxx-minx+1;
+ int dh = maxy-miny+1;
+
+ TQImage diff(dw, dh, 32);
+
+ diff.setAlphaBuffer(TRUE);
+ int x, y;
+ for (y = 0; y < dh; y++) {
+ TQRgb* li = (TQRgb*)frame.scanLine(y+miny)+minx;
+ TQRgb* lp = (TQRgb*)prev.scanLine(y+miny+offset.y())+minx+offset.x();
+ TQRgb* ld = (TQRgb*)diff.scanLine(y);
+ if ( alignx ) {
+ for (x = 0; x < dw; x+=alignx) {
+ int i;
+ for (i=0; i<alignx; i++) {
+ if ( li[x+i] != lp[x+i] )
+ break;
+ }
+ if ( i == alignx ) {
+ // All the same
+ for (i=0; i<alignx; i++) {
+ ld[x+i] = tqRgba(0,0,0,0);
+ }
+ } else {
+ // Some different
+ for (i=0; i<alignx; i++) {
+ ld[x+i] = 0xff000000 | li[x+i];
+ }
+ }
+ }
+ } else {
+ for (x = 0; x < dw; x++) {
+ if ( li[x] != lp[x] )
+ ld[x] = 0xff000000 | li[x];
+ else
+ ld[x] = tqRgba(0,0,0,0);
+ }
+ }
+ }
+qDebug("%d,%d %d,%d",minx,miny,offset.x(),offset.y());
+ d->composeImage(diff,TQPoint(minx,miny)+offset);
+ }
+ if ( prev.isNull() || prev.size() == frame.size() && offset == TQPoint(0,0) ) {
+ prev = frame;
+ } else {
+ bitBlt(&prev,offset.x(),offset.y(),&frame,0,0,frame.width(),frame.height());
+ }
+ }
+}
+
+void TQAnimationWriter::appendFrame(const TQImage& frm)
+{
+ appendFrame(frm,TQPoint(0,0));
+}
+
+void TQAnimationWriter::appendBlankFrame()
+{
+ TQImage i(1,1,32);
+ i.setAlphaBuffer(TRUE);
+ i.fill(0);
+ d->composeImage(i,TQPoint(0,0));
+}
diff --git a/tqtinterface/qt4/tools/qvfb/qanimationwriter.h b/tqtinterface/qt4/tools/qvfb/qanimationwriter.h
new file mode 100644
index 0000000..7ba107d
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qanimationwriter.h
@@ -0,0 +1,59 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#ifndef TQANIMATIONWRITER_H
+#define TQANIMATIONWRITER_H
+
+#include <tqimage.h>
+
+class TQAnimationWriterData;
+
+class TQAnimationWriter
+{
+public:
+ TQAnimationWriter( const TQString& filename, const char* format="MNG" );
+ ~TQAnimationWriter();
+
+ bool okay() const;
+ void setFrameRate(int);
+ void appendBlankFrame();
+ void appendFrame(const TQImage&);
+ void appendFrame(const TQImage&, const TQPoint& offset);
+
+private:
+ TQImage prev;
+ TQIODevice* dev;
+ TQAnimationWriterData* d;
+};
+
+#endif
diff --git a/tqtinterface/qt4/tools/qvfb/qvfb.cpp b/tqtinterface/qt4/tools/qvfb/qvfb.cpp
new file mode 100644
index 0000000..8fb4cb1
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qvfb.cpp
@@ -0,0 +1,389 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqvfb.h"
+#include "tqvfbview.h"
+#include "tqvfbratedlg.h"
+#include "config.h"
+#include "skin.h"
+
+#include <tqmenubar.h>
+#include <tqpopupmenu.h>
+#include <tqapplication.h>
+#include <tqmessagebox.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
+#include <tqfiledialog.h>
+#include <tqslider.h>
+#include <tqspinbox.h>
+#include <tqradiobutton.h>
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqcursor.h>
+#include <tqdragobject.h>
+#include <tqcheckbox.h>
+
+TQVFb::TQVFb( int display_id, int w, int h, int d, const TQString &skin, TQWidget *tqparent,
+ const char *name, uint flags )
+ : TQMainWindow( tqparent, name, flags )
+{
+ const TQMimeSource *m = TQMimeSourceFactory::defaultFactory()->data( "logo.png" );
+ if ( m ) {
+ TQPixmap pix;
+ TQImageDrag::decode( m, pix );
+ setIcon( pix );
+ }
+
+ imagesave = new TQFileDialog( this, 0, TRUE );
+
+ rateDlg = 0;
+ view = 0;
+ init( display_id, w, h, d, skin );
+ createMenu( menuBar() );
+ adjustSize();
+}
+
+TQVFb::~TQVFb()
+{
+}
+
+void TQVFb::popupMenu()
+{
+ TQPopupMenu *pm = new TQPopupMenu( this );
+ createMenu( pm );
+ pm->exec(TQCursor::pos());
+}
+
+void TQVFb::init( int display_id, int w, int h, int d, const TQString &skin_name )
+{
+ setCaption( TQString("Virtual framebuffer %1x%2 %3bpp Display :%4")
+ .arg(w).arg(h).arg(d).arg(display_id) );
+ delete view;
+
+ if ( !skin_name.isEmpty() && TQFile::exists(skin_name) ) {
+ bool vis = isVisible();
+ if ( vis ) hide();
+ menuBar()->hide();
+ Skin *skin = new Skin( this, skin_name, w, h );
+ view = new TQVFbView( display_id, w, h, d, skin );
+ skin->setView( view );
+ view->setMargin( 0 );
+ view->setFrameStyle( TQFrame::NoFrame );
+ view->setFixedSize( w, h );
+ setCentralWidget( skin );
+ adjustSize();
+ view->show();
+ if ( vis ) show();
+ } else {
+ if ( !currentSkin.isEmpty() ) {
+ clearMask();
+ reparent( 0, 0, pos(), TRUE );
+ }
+ menuBar()->show();
+ view = new TQVFbView( display_id, w, h, d, this );
+ view->setMargin( 0 );
+ view->setFrameStyle( TQFrame::NoFrame );
+ setCentralWidget( view );
+ resize( tqsizeHint() );
+ view->show();
+ }
+
+ currentSkin = skin_name;
+}
+
+void TQVFb::enableCursor( bool e )
+{
+ view->viewport()->setCursor( e ? ArrowCursor : BlankCursor );
+ viewMenu->setItemChecked( cursorId, e );
+}
+
+void TQVFb::createMenu(TQMenuData *menu)
+{
+ TQPopupMenu *file = new TQPopupMenu( this );
+ file->insertItem( "&Configure...", this, TQT_SLOT(configure()), ALT+CTRL+Key_C );
+ file->insertSeparator();
+ file->insertItem( "&Save image...", this, TQT_SLOT(saveImage()), ALT+CTRL+Key_S );
+ file->insertItem( "&Animation...", this, TQT_SLOT(toggleAnimation()), ALT+CTRL+Key_A );
+ file->insertSeparator();
+ file->insertItem( "&Quit", tqApp, TQT_SLOT(quit()) );
+
+ menu->insertItem( "&File", file );
+
+ viewMenu = new TQPopupMenu( this );
+ viewMenu->setCheckable( TRUE );
+ cursorId = viewMenu->insertItem( "Show &Cursor", this, TQT_SLOT(toggleCursor()) );
+ enableCursor(TRUE);
+ viewMenu->insertItem( "&Refresh Rate...", this, TQT_SLOT(changeRate()) );
+ viewMenu->insertSeparator();
+ viewMenu->insertItem( "Zoom scale &1", this, TQT_SLOT(setZoom1()) );
+ viewMenu->insertItem( "Zoom scale &2", this, TQT_SLOT(setZoom2()) );
+ viewMenu->insertItem( "Zoom scale &3", this, TQT_SLOT(setZoom3()) );
+ viewMenu->insertItem( "Zoom scale &4", this, TQT_SLOT(setZoom4()) );
+ viewMenu->insertItem( "Zoom scale &0.5", this, TQT_SLOT(setZoomHalf()) );
+
+ menu->insertItem( "&View", viewMenu );
+
+ TQPopupMenu *help = new TQPopupMenu( this );
+ help->insertItem("&About", this, TQT_SLOT(about()));
+ help->insertItem("About &TQt", this, TQT_SLOT(aboutTQt()));
+ menu->insertSeparator();
+ menu->insertItem( "&Help", help );
+}
+
+void TQVFb::setZoom(double z)
+{
+ view->setZoom(z);
+}
+
+void TQVFb::setZoomHalf()
+{
+ setZoom(0.5);
+}
+
+void TQVFb::setZoom1()
+{
+ setZoom(1);
+}
+
+void TQVFb::setZoom2()
+{
+ setZoom(2);
+}
+
+void TQVFb::setZoom3()
+{
+ setZoom(3);
+}
+
+void TQVFb::setZoom4()
+{
+ setZoom(4);
+}
+
+void TQVFb::saveImage()
+{
+ TQImage img = view->image();
+ TQString filename = imagesave->getSaveFileName("snapshot.png", "*.png", this, "", "Save Image");
+ if ( !!filename )
+ img.save(filename,"PNG");
+}
+
+void TQVFb::toggleAnimation()
+{
+ if ( view->animating() ) {
+ view->stopAnimation();
+ } else {
+ TQString filename = imagesave->getSaveFileName("animation.mng", "*.mng", this, "", "Save animation");
+ if ( !filename ) {
+ view->stopAnimation();
+ } else {
+ view->startAnimation(filename);
+ }
+ }
+}
+
+void TQVFb::toggleCursor()
+{
+ enableCursor( !viewMenu->isItemChecked( cursorId ) );
+}
+
+void TQVFb::changeRate()
+{
+ if ( !rateDlg ) {
+ rateDlg = new TQVFbRateDialog( view->rate(), this );
+ connect( rateDlg, TQT_SIGNAL(updateRate(int)), view, TQT_SLOT(setRate(int)) );
+ }
+
+ rateDlg->show();
+}
+
+void TQVFb::about()
+{
+#if defined( TQ_WS_MAC )
+ TQString platform("Mac OS X");
+ TQString qt("Mac");
+#elif defined( TQ_WS_WIN )
+ TQString platform("Windows");
+ TQString qt("Windows");
+#else
+ TQString platform("X11");
+ TQString qt("X11");
+#endif
+ TQMessageBox::about(this, "About TQVFB",
+ "<p><b><font size=+2>TQt/Embedded Virtual " + platform + " Framebuffer</font></b></p>"
+ "<p></p>"
+ "<p>Version 1.0</p>"
+ "<p>Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.</p>"
+ "<p></p>"
+ "<p>This program is licensed to you under the terms of the GNU General "
+ "Public License Version 2 as published by the Free Software Foundation. This "
+ "gives you legal permission to copy, distribute and/or modify this software "
+ "under certain conditions. For details, see the file 'LICENSE.GPL' that came with "
+ "this software distribution. If you did not get the file, send email to "
+ "info@trolltech.com.</p>\n\n<p>The program is provided AS IS with NO WARRANTY "
+ "OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS "
+ "FOR A PARTICULAR PURPOSE.</p>"
+ );
+}
+
+void TQVFb::aboutTQt()
+{
+ TQMessageBox::aboutTQt( this, tr("TQVFB") );
+}
+
+void TQVFb::configure()
+{
+ config = new Config(this,0,TRUE);
+
+ int w = view->displayWidth();
+ int h = view->displayHeight();
+ TQString skin;
+ config->size_width->setValue(w);
+ config->size_height->setValue(h);
+ config->size_custom->setChecked(TRUE); // unless changed by settings below
+ config->size_240_320->setChecked(w==240&&h==320);
+ config->size_320_240->setChecked(w==320&&h==240);
+ config->size_640_480->setChecked(w==640&&h==480);
+ config->skin->setEditable(TRUE);
+ if (!currentSkin.isNull()) {
+ config->size_skin->setChecked(TRUE);
+ config->skin->setEditText(currentSkin);
+ }
+ config->touchScreen->setChecked(view->touchScreenEmulation());
+ config->depth_1->setChecked(view->displayDepth()==1);
+ config->depth_4gray->setChecked(view->displayDepth()==4);
+ config->depth_8->setChecked(view->displayDepth()==8);
+ config->depth_12->setChecked(view->displayDepth()==12);
+ config->depth_16->setChecked(view->displayDepth()==16);
+ config->depth_32->setChecked(view->displayDepth()==32);
+ if ( view->gammaRed() == view->gammaGreen() && view->gammaGreen() == view->gammaBlue() ) {
+ config->gammaslider->setValue(int(view->gammaRed()*400));
+ config->rslider->setValue(100);
+ config->gslider->setValue(100);
+ config->bslider->setValue(100);
+ } else {
+ config->gammaslider->setValue(100);
+ config->rslider->setValue(int(view->gammaRed()*400));
+ config->gslider->setValue(int(view->gammaGreen()*400));
+ config->bslider->setValue(int(view->gammaBlue()*400));
+ }
+ connect(config->gammaslider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setGamma400(int)));
+ connect(config->rslider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setR400(int)));
+ connect(config->gslider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setG400(int)));
+ connect(config->bslider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setB400(int)));
+ updateGammaLabels();
+
+ double ogr=view->gammaRed(), ogg=view->gammaGreen(), ogb=view->gammaBlue();
+
+ if ( config->exec() ) {
+ int id = view->displayId(); // not settable yet
+ if ( config->size_240_320->isChecked() ) {
+ w=240; h=320;
+ } else if ( config->size_320_240->isChecked() ) {
+ w=320; h=240;
+ } else if ( config->size_640_480->isChecked() ) {
+ w=640; h=480;
+ } else if ( config->size_skin->isChecked() ) {
+ skin = config->skin->currentText();
+ } else {
+ w=config->size_width->value();
+ h=config->size_height->value();
+ }
+ int d;
+ if ( config->depth_1->isChecked() )
+ d=1;
+ else if ( config->depth_4gray->isChecked() )
+ d=4;
+ else if ( config->depth_8->isChecked() )
+ d=8;
+ else if ( config->depth_12->isChecked() )
+ d=12;
+ else if ( config->depth_16->isChecked() )
+ d=16;
+ else
+ d=32;
+
+ if ( w != view->displayWidth() || h != view->displayHeight()
+ || d != view->displayDepth() || skin != currentSkin )
+ init( id, w, h, d, skin );
+ view->setTouchscreenEmulation( config->touchScreen->isChecked() );
+ } else {
+ view->setGamma(ogr, ogg, ogb);
+ }
+
+ delete config;
+ config=0;
+}
+
+void TQVFb::setGamma400(int n)
+{
+ double g = n/100.0;
+ view->setGamma(config->rslider->value()/100.0*g,
+ config->gslider->value()/100.0*g,
+ config->bslider->value()/100.0*g);
+ updateGammaLabels();
+}
+
+void TQVFb::setR400(int n)
+{
+ double g = n/100.0;
+ view->setGamma(config->rslider->value()/100.0*g,
+ view->gammaGreen(),
+ view->gammaBlue());
+ updateGammaLabels();
+}
+
+void TQVFb::setG400(int n)
+{
+ double g = n/100.0;
+ view->setGamma(view->gammaRed(),
+ config->gslider->value()/100.0*g,
+ view->gammaBlue());
+ updateGammaLabels();
+}
+
+void TQVFb::setB400(int n)
+{
+ double g = n/100.0;
+ view->setGamma(view->gammaRed(),
+ view->gammaGreen(),
+ config->bslider->value()/100.0*g);
+ updateGammaLabels();
+}
+
+void TQVFb::updateGammaLabels()
+{
+ config->rlabel->setText(TQString::number(view->gammaRed(),'g',2));
+ config->glabel->setText(TQString::number(view->gammaGreen(),'g',2));
+ config->blabel->setText(TQString::number(view->gammaBlue(),'g',2));
+}
diff --git a/tqtinterface/qt4/tools/qvfb/qvfb.h b/tqtinterface/qt4/tools/qvfb/qvfb.h
new file mode 100644
index 0000000..5906232
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qvfb.h
@@ -0,0 +1,91 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqmainwindow.h>
+
+class TQVFbView;
+class TQVFbRateDialog;
+class TQPopupMenu;
+class TQMenuData;
+class TQFileDialog;
+class Config;
+
+class TQVFb: public TQMainWindow
+{
+ TQ_OBJECT
+public:
+ TQVFb( int display_id, int w, int h, int d, const TQString &skin, TQWidget *tqparent = 0,
+ const char *name = 0, uint wflags = 0 );
+ ~TQVFb();
+
+ void enableCursor( bool e );
+ void popupMenu();
+
+protected Q_SLOTS:
+ void saveImage();
+ void toggleAnimation();
+ void toggleCursor();
+ void changeRate();
+ void about();
+ void aboutTQt();
+
+ void configure();
+
+ void setZoom(double);
+ void setZoom1();
+ void setZoom2();
+ void setZoom3();
+ void setZoom4();
+ void setZoomHalf();
+
+protected:
+ void createMenu(TQMenuData *menu);
+
+private:
+ void init( int display_id, int w, int h, int d, const TQString &skin );
+ TQVFbView *view;
+ TQVFbRateDialog *rateDlg;
+ TQFileDialog* imagesave;
+ TQPopupMenu *viewMenu;
+ int cursorId;
+ Config* config;
+ TQString currentSkin;
+
+private Q_SLOTS:
+ void setGamma400(int n);
+ void setR400(int n);
+ void setG400(int n);
+ void setB400(int n);
+ void updateGammaLabels();
+};
+
diff --git a/tqtinterface/qt4/tools/qvfb/qvfb.pro b/tqtinterface/qt4/tools/qvfb/qvfb.pro
new file mode 100644
index 0000000..7896e7c
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qvfb.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+HEADERS = qvfb.h qvfbview.h qvfbratedlg.h qanimationwriter.h \
+ gammaview.h skin.h
+SOURCES = qvfb.cpp qvfbview.cpp qvfbratedlg.cpp \
+ main.cpp qanimationwriter.cpp skin.cpp
+INTERFACES = config.ui
+IMAGES = images/logo.png
+TARGET = qvfb
+INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/libpng $$QT_SOURCE_TREE/src/3rdparty/zlib
+DEPENDPATH = ../../include
diff --git a/tqtinterface/qt4/tools/qvfb/qvfbratedlg.cpp b/tqtinterface/qt4/tools/qvfb/qvfbratedlg.cpp
new file mode 100644
index 0000000..9a61c37
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qvfbratedlg.cpp
@@ -0,0 +1,80 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqvfbratedlg.h"
+
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqslider.h>
+#include <tqpushbutton.h>
+
+TQVFbRateDialog::TQVFbRateDialog( int rate, TQWidget *tqparent, const char *name,
+ bool modal )
+ : TQDialog( tqparent, name, modal )
+{
+ oldRate = rate;
+
+ TQVBoxLayout *tl = new TQVBoxLayout( this, 5 );
+
+ TQLabel *label = new TQLabel( "Target frame rate:", this );
+ tl->addWidget( label );
+
+ TQHBoxLayout *hl = new TQHBoxLayout( tl );
+ rateSlider = new TQSlider( 1, 100, 10, rate, TQSlider::Horizontal, this );
+ hl->addWidget( rateSlider );
+ connect( rateSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(rateChanged(int)) );
+ rateLabel = new TQLabel( TQString( "%1fps" ).arg(rate), this );
+ hl->addWidget( rateLabel );
+
+ hl = new TQHBoxLayout( tl );
+ TQPushButton *pb = new TQPushButton( "OK", this );
+ connect( pb, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) );
+ hl->addWidget( pb );
+ pb = new TQPushButton( "Cancel", this );
+ connect( pb, TQT_SIGNAL(clicked()), this, TQT_SLOT(cancel()) );
+ hl->addWidget( pb );
+}
+
+void TQVFbRateDialog::rateChanged( int r )
+{
+ if ( rateSlider->value() != r )
+ rateSlider->setValue( r );
+ rateLabel->setText( TQString( "%1fps" ).arg(r) );
+ emit updateRate(r);
+}
+
+void TQVFbRateDialog::cancel()
+{
+ rateChanged( oldRate );
+ reject();
+}
diff --git a/tqtinterface/qt4/tools/qvfb/qvfbratedlg.h b/tqtinterface/qt4/tools/qvfb/qvfbratedlg.h
new file mode 100644
index 0000000..387c28b
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qvfbratedlg.h
@@ -0,0 +1,59 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqdialog.h>
+
+class TQLabel;
+class TQSlider;
+
+class TQVFbRateDialog : public TQDialog
+{
+ TQ_OBJECT
+public:
+ TQVFbRateDialog( int value, TQWidget *tqparent=0, const char *name=0,
+ bool modal=FALSE );
+
+Q_SIGNALS:
+ void updateRate( int r );
+
+protected Q_SLOTS:
+ void rateChanged( int r );
+ void cancel();
+
+private:
+ TQLabel *rateLabel;
+ TQSlider *rateSlider;
+ int oldRate;
+};
+
+
diff --git a/tqtinterface/qt4/tools/qvfb/qvfbview.cpp b/tqtinterface/qt4/tools/qvfb/qvfbview.cpp
new file mode 100644
index 0000000..f7d0669
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qvfbview.cpp
@@ -0,0 +1,615 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "tqglobal.h"
+#if !defined( TQ_WS_TQWS ) || defined( TQT_NO_TQWS_MULTIPROCESS )
+#define TQLock TQWSSemaphore
+#undef TQT_NO_TQWS_MULTIPROCESS
+#include "../../src/kernel/qlock.cpp"
+#else
+#include "tqlock_p.h"
+#endif
+
+#include "tqvfbview.h"
+#include "tqvfbhdr.h"
+
+#define TQTE_PIPE "TQtEmbedded-%1"
+
+#include <tqapplication.h>
+#include <tqimage.h>
+#include <tqbitmap.h>
+#include <tqtimer.h>
+#include <tqwmatrix.h>
+#include <tqpainter.h>
+#include "tqanimationwriter.h"
+
+#include <unistd.h>
+#include <sys/ipc.h>
+#include <sys/types.h>
+#include <sys/shm.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <math.h>
+
+//#define TQT_TQWS_EXPERIMENTAL_REVERSE_BIT_ENDIANNESS
+
+TQVFbView::TQVFbView( int display_id, int w, int h, int d, TQWidget *tqparent,
+ const char *name, uint flags )
+ : TQScrollView( tqparent, name, flags ), emulateTouchscreen(FALSE), qwslock(NULL)
+{
+ displayid = display_id;
+ viewport()->setMouseTracking( TRUE );
+ viewport()->setFocusPolicy( StrongFocus );
+ zm = 1;
+ animation = 0;
+ int actualdepth=d;
+
+ switch ( d ) {
+ case 12:
+ actualdepth=16;
+ break;
+ case 1:
+ case 4:
+ case 8:
+ case 16:
+ case 32:
+ break;
+
+ default:
+ qFatal( "Unsupported bit depth %d\n", d );
+ }
+
+ mousePipe = TQString(TQT_VFB_MOUSE_PIPE).arg(display_id);
+ keyboardPipe = TQString(TQT_VFB_KEYBOARD_PIPE).arg(display_id);
+
+ unlink( mousePipe.latin1() );
+ mkfifo( mousePipe.latin1(), 0666 );
+
+ mouseFd = open( mousePipe.latin1(), O_RDWR | O_NDELAY );
+ if ( mouseFd == -1 ) {
+ qFatal( "Cannot open mouse pipe" );
+ }
+
+ unlink( keyboardPipe );
+ mkfifo( keyboardPipe, 0666 );
+ keyboardFd = open( keyboardPipe, O_RDWR | O_NDELAY );
+ if ( keyboardFd == -1 ) {
+ qFatal( "Cannot open keyboard pipe" );
+ }
+
+ key_t key = ftok( mousePipe.latin1(), 'b' );
+
+ int bpl;
+ if ( d == 1 )
+ bpl = (w*d+7)/8;
+ else
+ bpl = ((w*actualdepth+31)/32)*4;
+
+ int dataSize = bpl * h + sizeof( TQVFbHeader );
+ shmId = shmget( key, dataSize, IPC_CREAT|0666);
+ if ( shmId != -1 )
+ data = (unsigned char *)shmat( shmId, 0, 0 );
+ else {
+ struct shmid_ds shm;
+ shmctl( shmId, IPC_RMID, &shm );
+ shmId = shmget( key, dataSize, IPC_CREAT|0666);
+ data = (unsigned char *)shmat( shmId, 0, 0 );
+ }
+
+ if ( (int)data == -1 )
+ qFatal( "Cannot attach to shared memory" );
+
+ hdr = (TQVFbHeader *)data;
+ hdr->width = w;
+ hdr->height = h;
+ viewdepth = d;
+ hdr->depth = actualdepth;
+ hdr->linestep = bpl;
+ hdr->numcols = 0;
+ hdr->dataoffset = sizeof( TQVFbHeader );
+ hdr->update = TQRect();
+
+ resizeContents( w, h );
+
+ timer = new TQTimer( this );
+ connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout()) );
+
+ gammatable=0;
+ setGamma(1.0,1.0,1.0);
+ setRate( 30 );
+}
+
+TQVFbView::~TQVFbView()
+{
+ stopAnimation();
+ sendKeyboardData( 0, 0, 0, TRUE, FALSE ); // magic die key
+ delete qwslock;
+ struct shmid_ds shm;
+ shmdt( (char*)data );
+ shmctl( shmId, IPC_RMID, &shm );
+ ::close( mouseFd );
+ ::close( keyboardFd );
+ unlink( mousePipe );
+ unlink( keyboardPipe );
+}
+
+TQSize TQVFbView::tqsizeHint() const
+{
+ int f = 2 * frameWidth();
+ return TQSize( contentsWidth() + f, contentsHeight() + f );
+}
+
+void TQVFbView::setGamma(double gr, double gg, double gb)
+{
+ if ( viewdepth < 12 )
+ return; // not implemented
+
+ gred=gr; ggreen=gg; gblue=gb;
+
+ switch ( viewdepth ) {
+ case 12:
+ rsh = 12;
+ gsh = 7;
+ bsh = 1;
+ rmax = 15;
+ gmax = 15;
+ bmax = 15;
+ break;
+ case 16:
+ rsh = 11;
+ gsh = 5;
+ bsh = 0;
+ rmax = 31;
+ gmax = 63;
+ bmax = 31;
+ break;
+ case 32:
+ rsh = 16;
+ gsh = 8;
+ bsh = 0;
+ rmax = 255;
+ gmax = 255;
+ bmax = 255;
+ }
+ int mm = TQMAX(rmax,TQMAX(gmax,bmax))+1;
+ if ( gammatable )
+ delete [] gammatable;
+ gammatable = new TQRgb[mm];
+ for (int i=0; i<mm; i++) {
+ int r = int(pow(i,gr)*255/rmax);
+ int g = int(pow(i,gg)*255/gmax);
+ int b = int(pow(i,gb)*255/bmax);
+ if ( r > 255 ) r = 255;
+ if ( g > 255 ) g = 255;
+ if ( b > 255 ) b = 255;
+ gammatable[i] = tqRgb(r,g,b);
+//qDebug("%d: %d,%d,%d",i,r,g,b);
+ }
+
+ setDirty(rect());
+}
+
+void TQVFbView::getGamma(int i, TQRgb& rgb)
+{
+ if ( i > 255 ) i = 255;
+ if ( i < 0 ) i = 0;
+ rgb = tqRgb(tqRed(gammatable[i*rmax/255]),
+ tqGreen(gammatable[i*rmax/255]),
+ tqBlue(gammatable[i*rmax/255]));
+}
+
+int TQVFbView::displayId() const
+{
+ return displayid;
+}
+
+int TQVFbView::displayWidth() const
+{
+ return hdr->width;
+}
+
+int TQVFbView::displayHeight() const
+{
+ return hdr->height;
+}
+
+int TQVFbView::displayDepth() const
+{
+ return viewdepth;
+}
+
+void TQVFbView::setZoom( double z )
+{
+ if ( zm != z ) {
+ zm = z;
+ setDirty(TQRect(0,0,hdr->width,hdr->height));
+ resizeContents( int(hdr->width*z), int(hdr->height*z) );
+ updateGeometry();
+ tqApp->sendPostedEvents();
+ tqtopLevelWidget()->adjustSize();
+ drawScreen();
+ }
+}
+
+void TQVFbView::setRate( int r )
+{
+ refreshRate = r;
+ timer->start( 1000/r );
+}
+
+#ifndef TQ_WS_TQWS
+// Get the name of the directory where TQt/Embedded temporary data should
+// live.
+static TQString qws_dataDir()
+{
+ TQString username = "unknown";
+ const char *logname = getenv("LOGNAME");
+ if ( logname )
+ username = logname;
+
+ TQString dataDir = "/tmp/qtembedded-" + username;
+ if ( mkdir( dataDir.latin1(), 0700 ) ) {
+ if ( errno != EEXIST ) {
+ qFatal( TQString("Cannot create TQt/Embedded data directory: %1")
+ .arg( dataDir ) );
+ }
+ }
+
+ struct stat buf;
+ if ( lstat( dataDir.latin1(), &buf ) )
+ qFatal( TQString( "stat failed for TQt/Embedded data directory: %1" )
+ .arg( dataDir ) );
+
+ if ( !S_ISDIR( buf.st_mode ) )
+ qFatal( TQString( "%1 is not a directory" ).arg( dataDir ) );
+
+ if ( buf.st_uid != getuid() )
+ qFatal( TQString( "TQt/Embedded data directory is not owned by user %1" )
+ .arg( getuid() ) );
+
+ if ( (buf.st_mode & 0677) != 0600 )
+ qFatal( TQString( "TQt/Embedded data directory has incorrect permissions: %1" )
+ .arg( dataDir ) );
+
+ dataDir += "/";
+
+ return dataDir;
+}
+#endif
+
+void TQVFbView::initLock()
+{
+ TQString username = "unknown";
+ const char *logname = getenv("LOGNAME");
+ if ( logname )
+ username = logname;
+ qwslock = new TQLock(qws_dataDir() + TQString( TQTE_PIPE ).arg( displayid ),
+ 'd', TRUE);
+}
+
+void TQVFbView::lock()
+{
+ if ( !qwslock )
+ initLock();
+ qwslock->lock(TQLock::Read);
+}
+
+void TQVFbView::unlock()
+{
+ if ( qwslock )
+ qwslock->unlock();
+}
+
+void TQVFbView::sendMouseData( const TQPoint &pos, int buttons )
+{
+ write( mouseFd, &pos, sizeof( TQPoint ) );
+ write( mouseFd, &buttons, sizeof( int ) );
+}
+
+void TQVFbView::sendKeyboardData( int tqunicode, int keycode, int modifiers,
+ bool press, bool repeat )
+{
+ TQVFbKeyData kd;
+ kd.tqunicode = tqunicode | (keycode << 16);
+ kd.modifiers = modifiers;
+ kd.press = press;
+ kd.repeat = repeat;
+ write( keyboardFd, &kd, sizeof( TQVFbKeyData ) );
+}
+
+void TQVFbView::timeout()
+{
+ lock();
+ if ( animation ) {
+ TQRect r( hdr->update );
+ r = r.intersect( TQRect(0, 0, hdr->width, hdr->height ) );
+ if ( r.isEmpty() ) {
+ animation->appendBlankFrame();
+ } else {
+ int l;
+ TQImage img = getBuffer( r, l );
+ animation->appendFrame(img,TQPoint(r.x(),r.y()));
+ }
+ }
+ if ( hdr->dirty ) {
+ drawScreen();
+ }
+ unlock();
+}
+
+TQImage TQVFbView::getBuffer( const TQRect &r, int &leading ) const
+{
+ switch ( viewdepth ) {
+ case 12:
+ case 16: {
+ static unsigned char *imgData = 0;
+ if ( !imgData ) {
+ int bpl = ((hdr->width*32+31)/32)*4;
+ imgData = new unsigned char [ bpl * hdr->height ];
+ }
+ TQImage img( imgData, r.width(), r.height(), 32, 0, 0, TQImage::IgnoreEndian );
+ const int rsh = viewdepth == 12 ? 12 : 11;
+ const int gsh = viewdepth == 12 ? 7 : 5;
+ const int bsh = viewdepth == 12 ? 1 : 0;
+ const int rmax = viewdepth == 12 ? 15 : 31;
+ const int gmax = viewdepth == 12 ? 15 : 63;
+ const int bmax = viewdepth == 12 ? 15 : 31;
+ for ( int row = 0; row < r.height(); row++ ) {
+ TQRgb *dptr = (TQRgb*)img.scanLine( row );
+ ushort *sptr = (ushort*)(data + hdr->dataoffset + (r.y()+row)*hdr->linestep);
+ sptr += r.x();
+#ifdef TQT_TQWS_REVERSE_BYTE_ENDIANNESS
+ for ( int col=0; col < r.width()/2; col++ ) {
+#else
+ for ( int col=0; col < r.width(); col++ ) {
+#endif
+ ushort s = *sptr++;
+#ifdef TQT_TQWS_REVERSE_BYTE_ENDIANNESS
+ ushort s2 = *sptr++;
+ *dptr++ = tqRgb(tqRed(gammatable[(s2>>rsh)&rmax]),tqGreen(gammatable[(s2>>gsh)&gmax]),tqBlue(gammatable[(s2>>bsh)&bmax]));
+#endif
+ *dptr++ = tqRgb(tqRed(gammatable[(s>>rsh)&rmax]),tqGreen(gammatable[(s>>gsh)&gmax]),tqBlue(gammatable[(s>>bsh)&bmax]));
+ //*dptr++ = tqRgb(((s>>rsh)&rmax)*255/rmax,((s>>gsh)&gmax)*255/gmax,((s>>bsh)&bmax)*255/bmax);
+ }
+ }
+ leading = 0;
+ return img;
+ }
+ case 4: {
+ static unsigned char *imgData = 0;
+ if ( !imgData ) {
+ int bpl = ((hdr->width*8+31)/32)*4;
+ imgData = new unsigned char [ bpl * hdr->height ];
+ }
+ TQImage img( imgData, r.width(), r.height(), 8, hdr->clut, 16,
+ TQImage::IgnoreEndian );
+ for ( int row = 0; row < r.height(); row++ ) {
+ unsigned char *dptr = img.scanLine( row );
+ unsigned char *sptr = data + hdr->dataoffset + (r.y()+row)*hdr->linestep;
+ sptr += r.x()/2;
+ int col = 0;
+#ifdef TQT_TQWS_EXPERIMENTAL_REVERSE_BIT_ENDIANNESS
+ if ( r.x() & 1 ) {
+ *dptr++ = *sptr++ & 0x0f;
+ col++;
+ }
+ for ( ; col < r.width()-1; col+=2 ) {
+ unsigned char s = *sptr++;
+ *dptr++ = s >> 4;
+ *dptr++ = s & 0x0f;
+ }
+ if ( !(r.right() & 1) )
+ *dptr = *sptr >> 4;
+#else
+ if ( r.x() & 1 ) {
+ *dptr++ = *sptr++ >> 4;
+ col++;
+ }
+ for ( ; col < r.width()-1; col+=2 ) {
+ unsigned char s = *sptr++;
+ *dptr++ = s & 0x0f;
+ *dptr++ = s >> 4;
+ }
+ if ( !(r.right() & 1) )
+ *dptr = *sptr & 0x0f;
+#endif
+ }
+ leading = 0;
+ return img;
+ }
+ case 32: {
+ leading = r.x();
+ return TQImage( data + hdr->dataoffset + r.y() * hdr->linestep,
+ hdr->width, r.height(), hdr->depth, 0,
+ 0, TQImage::LittleEndian );
+ }
+ case 8: {
+ leading = r.x();
+ return TQImage( data + hdr->dataoffset + r.y() * hdr->linestep,
+ hdr->width, r.height(), hdr->depth, hdr->clut,
+ 256, TQImage::LittleEndian );
+ }
+ case 1: {
+ leading = r.x();
+ return TQImage( data + hdr->dataoffset + r.y() * hdr->linestep,
+ hdr->width, r.height(), hdr->depth, hdr->clut,
+#ifndef TQT_TQWS_EXPERIMENTAL_REVERSE_BIT_ENDIANNESS
+ 0, TQImage::LittleEndian );
+#else
+ 0, TQImage::BigEndian );
+#endif
+ }
+ }
+ return TQImage();
+}
+
+void TQVFbView::drawScreen()
+{
+ TQPainter p( viewport() );
+
+ p.translate( -contentsX(), -contentsY() );
+
+ lock();
+ TQRect r( hdr->update );
+ hdr->dirty = FALSE;
+ hdr->update = TQRect();
+ // qDebug( "update %d, %d, %dx%d", r.y(), r.x(), r.width(), r.height() );
+ r = r.intersect( TQRect(0, 0, hdr->width, hdr->height ) );
+ if ( !r.isEmpty() ) {
+ if ( int(zm) != zm ) {
+ r.rLeft() = int(int(r.left()*zm)/zm);
+ r.rTop() = int(int(r.top()*zm)/zm);
+ r.rRight() = int(int(r.right()*zm+zm+0.0000001)/zm+1.9999);
+ r.rBottom() = int(int(r.bottom()*zm+zm+0.0000001)/zm+1.9999);
+ r.rRight() = TQMIN(r.right(),hdr->width-1);
+ r.rBottom() = TQMIN(r.bottom(),hdr->height-1);
+ }
+ int leading;
+ TQImage img( getBuffer( r, leading ) );
+ TQPixmap pm;
+ if ( zm == 1 ) {
+ pm.convertFromImage( img );
+ } else if ( int(zm) == zm ) {
+ TQWMatrix m;
+ m.scale(zm,zm);
+ pm.convertFromImage( img );
+ pm = pm.xForm(m);
+ } else {
+ pm.convertFromImage( img.smoothScale(int(img.width()*zm),int(img.height()*zm)) );
+ }
+ unlock();
+ p.setPen( black );
+ p.setBrush( white );
+ p.drawPixmap( int(r.x()*zm), int(r.y()*zm), pm,
+ int(leading*zm), 0, pm.width(), pm.height() );
+ } else {
+ unlock();
+ }
+}
+
+bool TQVFbView::eventFilter( TQObject *obj, TQEvent *e )
+{
+ if ( obj == viewport() &&
+ (e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut) )
+ return TRUE;
+
+ return TQScrollView::eventFilter( obj, e );
+}
+
+void TQVFbView::viewportPaintEvent( TQPaintEvent *pe )
+{
+ TQRect r( pe->rect() );
+ r.moveBy( contentsX(), contentsY() );
+ r = TQRect(int(r.x()/zm),int(r.y()/zm),
+ int(r.width()/zm)+1,int(r.height()/zm)+1);
+ setDirty(r);
+ drawScreen();
+}
+
+void TQVFbView::setDirty( const TQRect& r )
+{
+ lock();
+ hdr->update |= r;
+ hdr->dirty = TRUE;
+ unlock();
+}
+
+void TQVFbView::contentsMousePressEvent( TQMouseEvent *e )
+{
+ sendMouseData( e->pos()/zm, e->stateAfter() );
+}
+
+void TQVFbView::contentsMouseDoubleClickEvent( TQMouseEvent *e )
+{
+ sendMouseData( e->pos()/zm, e->stateAfter() );
+}
+
+void TQVFbView::contentsMouseReleaseEvent( TQMouseEvent *e )
+{
+ sendMouseData( e->pos()/zm, e->stateAfter() );
+}
+
+void TQVFbView::contentsMouseMoveEvent( TQMouseEvent *e )
+{
+ if ( !emulateTouchscreen || (e->state() & MouseButtonMask ) )
+ sendMouseData( e->pos()/zm, e->state() );
+}
+
+
+
+void TQVFbView::keyPressEvent( TQKeyEvent *e )
+{
+ sendKeyboardData(e->text()[0].tqunicode(), e->key(),
+ e->stateAfter()&(ShiftButton|ControlButton|AltButton),
+ TRUE, e->isAutoRepeat());
+}
+
+void TQVFbView::keyReleaseEvent( TQKeyEvent *e )
+{
+ sendKeyboardData(e->ascii(), e->key(),
+ e->stateAfter()&(ShiftButton|ControlButton|AltButton),
+ FALSE, e->isAutoRepeat());
+}
+
+
+TQImage TQVFbView::image() const
+{
+ ((TQVFbView*)this)->lock();
+ int l;
+ TQImage r = getBuffer( TQRect(0, 0, hdr->width, hdr->height), l ).copy();
+ ((TQVFbView*)this)->unlock();
+ return r;
+}
+
+void TQVFbView::startAnimation( const TQString& filename )
+{
+ delete animation;
+ animation = new TQAnimationWriter(filename,"MNG");
+ animation->setFrameRate(refreshRate);
+ animation->appendFrame(TQImage(data + hdr->dataoffset,
+ hdr->width, hdr->height, hdr->depth, hdr->clut,
+ 256, TQImage::LittleEndian));
+}
+
+void TQVFbView::stopAnimation()
+{
+ delete animation;
+ animation = 0;
+}
+
+void TQVFbView::setTouchscreenEmulation( bool b )
+{
+ emulateTouchscreen = b;
+}
diff --git a/tqtinterface/qt4/tools/qvfb/qvfbview.h b/tqtinterface/qt4/tools/qvfb/qvfbview.h
new file mode 100644
index 0000000..df5adcc
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/qvfbview.h
@@ -0,0 +1,126 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqscrollview.h>
+
+class TQImage;
+class TQTimer;
+class TQAnimationWriter;
+class TQLock;
+struct TQVFbHeader;
+
+class TQVFbView : public TQScrollView
+{
+ TQ_OBJECT
+public:
+ TQVFbView( int display_id, int w, int h, int d, TQWidget *tqparent = 0,
+ const char *name = 0, uint wflags = 0 );
+ ~TQVFbView();
+
+ int displayId() const;
+ int displayWidth() const;
+ int displayHeight() const;
+ int displayDepth() const;
+
+ bool touchScreenEmulation() const { return emulateTouchscreen; }
+ int rate() { return refreshRate; }
+ bool animating() const { return !!animation; }
+ TQImage image() const;
+
+ void setGamma(double gr, double gg, double gb);
+ double gammaRed() const { return gred; }
+ double gammaGreen() const { return ggreen; }
+ double gammaBlue() const { return gblue; }
+ void getGamma(int i, TQRgb& rgb);
+ void skinKeyPressEvent( TQKeyEvent *e ) { keyPressEvent(e); }
+ void skinKeyReleaseEvent( TQKeyEvent *e ) { keyReleaseEvent(e); }
+
+ double zoom() const { return zm; }
+
+ TQSize tqsizeHint() const;
+public Q_SLOTS:
+ void setTouchscreenEmulation( bool );
+
+ void setRate( int );
+ void setZoom( double );
+ void startAnimation( const TQString& );
+ void stopAnimation();
+
+protected Q_SLOTS:
+ void timeout();
+
+protected:
+ void initLock();
+ void lock();
+ void unlock();
+ TQImage getBuffer( const TQRect &r, int &leading ) const;
+ void drawScreen();
+ void sendMouseData( const TQPoint &pos, int buttons );
+ void sendKeyboardData( int tqunicode, int keycode, int modifiers,
+ bool press, bool repeat );
+ virtual bool eventFilter( TQObject *obj, TQEvent *e );
+ virtual void viewportPaintEvent( TQPaintEvent *pe );
+ virtual void contentsMousePressEvent( TQMouseEvent *e );
+ virtual void contentsMouseDoubleClickEvent( TQMouseEvent *e );
+ virtual void contentsMouseReleaseEvent( TQMouseEvent *e );
+ virtual void contentsMouseMoveEvent( TQMouseEvent *e );
+ virtual void keyPressEvent( TQKeyEvent *e );
+ virtual void keyReleaseEvent( TQKeyEvent *e );
+
+private:
+ bool emulateTouchscreen;
+ void setDirty( const TQRect& );
+ int shmId;
+ unsigned char *data;
+ TQVFbHeader *hdr;
+ int viewdepth; // "faked" depth
+ int rsh;
+ int gsh;
+ int bsh;
+ int rmax;
+ int gmax;
+ int bmax;
+ double gred, ggreen, gblue;
+ TQRgb* gammatable;
+ TQLock *qwslock;
+ TQTimer *timer;
+ int mouseFd;
+ int keyboardFd;
+ int refreshRate;
+ TQString mousePipe;
+ TQString keyboardPipe;
+ TQAnimationWriter *animation;
+ int displayid;
+ double zm;
+};
+
diff --git a/tqtinterface/qt4/tools/qvfb/skin.cpp b/tqtinterface/qt4/tools/qvfb/skin.cpp
new file mode 100644
index 0000000..da6304b
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/skin.cpp
@@ -0,0 +1,174 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include "skin.h"
+#include "tqvfb.h"
+#include "tqvfbview.h"
+
+#include <tqbitmap.h>
+#include <tqpixmap.h>
+#include <tqtextstream.h>
+#include <tqfile.h>
+#include <tqpainter.h>
+#ifdef TQ_WS_MAC
+# include <tqt_mac.h>
+#endif
+
+Skin::Skin( TQVFb *p, const TQString &skinFile, int &viewW, int &viewH ) : TQWidget(p)
+{
+ TQFile f( skinFile );
+ f.open( IO_ReadOnly );
+ TQTextStream ts( &f );
+ ts >> skinImageUpFileName;
+ ts >> skinImageDownFileName;
+ ts >> viewX1;
+ ts >> viewY1;
+ ts >> viewW;
+ ts >> viewH;
+ ts >> transparancy;
+ ts >> numberOfAreas;
+// Debug the skin file parsing
+// printf("read: -%s- -%i- -%i- -%i-\n", skinImage.latin1(), viewX1, viewY1, numberOfAreas );
+ areas = new ButtonAreas[numberOfAreas];
+
+ for (int i = 0; i < numberOfAreas; i++) {
+ ts >> areas[i].name;
+ ts >> areas[i].keyCode;
+ ts >> areas[i].x1;
+ ts >> areas[i].y1;
+ ts >> areas[i].x2;
+ ts >> areas[i].y2;
+// Debug the skin file parsing
+// printf("read: -%s- -%i- -%i- -%i- -%i- -%i-\n", areas[i].name.latin1(),
+// areas[i].keyCode, areas[i].x1, areas[i].y1, areas[i].x2, areas[i].y2 );
+ }
+
+ tqparent = p;
+ skinImageUp = new TQPixmap( skinImageUpFileName );
+ skinImageDown = new TQPixmap( skinImageDownFileName );
+// setPixmap( ipaq );
+ setFixedSize( skinImageUp->size() );
+ TQBitmap tqmask = skinImageUp->createHeuristicMask();
+ int wf = WStyle_Customize | WType_TopLevel | WStyle_NoBorder;
+ tqparent->reparent( 0, wf, pos(), TRUE );
+ tqparent->setMask( tqmask );
+ tqparent->setFixedSize( skinImageUp->size() );
+ buttonPressed = FALSE;
+ buttonIndex = 0;
+}
+
+
+Skin::~Skin( )
+{
+}
+
+
+void Skin::setView( TQVFbView *v )
+{
+ view = v;
+ view->move( viewX1, viewY1 );
+#ifdef TQ_WS_MAC
+ TQMacSavedPortInfo::setAlphaTransparancy(view, transparancy);
+#endif
+}
+
+
+void Skin::paintEvent( TQPaintEvent * )
+{
+ TQPainter p( this );
+// printf("read: -%s-\n", skinImageUp.latin1());
+ if (skinImageUp)
+ p.drawPixmap( 0, 0, *skinImageUp );
+ if (buttonPressed == TRUE) {
+ ButtonAreas *ba = &areas[buttonIndex];
+ if (skinImageDown)
+ p.drawPixmap( ba->x1, ba->y1, *skinImageDown, ba->x1, ba->y1, ba->x2 - ba->x1, ba->y2 - ba->y1 );
+ }
+}
+
+
+void Skin::mousePressEvent( TQMouseEvent *e )
+{
+ if (e->button() == RightButton) {
+ tqparent->popupMenu();
+ } else {
+ buttonPressed = FALSE;
+
+ for (int i = 0; i < numberOfAreas; i++) {
+ TQPoint p1( areas[i].x1, areas[i].y1 );
+ TQPoint p2( areas[i].x2, areas[i].y2 );
+ TQRect r( p1, p2 );
+ if ( r.tqcontains( e->pos() ) ) {
+ buttonPressed = TRUE;
+ buttonIndex = i;
+ buttonCode = areas[buttonIndex].keyCode;
+ TQKeyEvent keyEvent( TQEvent::KeyPress, buttonCode, 0, 0 );
+ if (view)
+ view->skinKeyPressEvent( &keyEvent );
+// Debug message to be sure we are clicking the right areas
+// printf("%s clicked\n", areas[i].name);
+ ButtonAreas *ba = &areas[buttonIndex];
+ tqrepaint( ba->x1, ba->y1, ba->x2 - ba->x1, ba->y2 - ba->y1, FALSE );
+ continue;
+ }
+ }
+
+// This is handy for tqfinding the areas to define rectangles for new skins
+// printf("Clicked in %i,%i\n", e->pos().x(), e->pos().y());
+ clickPos = e->pos();
+ }
+}
+
+
+void Skin::mouseMoveEvent( TQMouseEvent *e )
+{
+ if ( buttonPressed == FALSE ) {
+ TQPoint newpos = e->globalPos() - clickPos;
+ tqparent->move( newpos );
+ }
+}
+
+
+void Skin::mouseReleaseEvent( TQMouseEvent * )
+{
+ if ( buttonPressed ) {
+ TQKeyEvent keyEvent( TQEvent::KeyRelease, buttonCode, 0, 0 );
+ if (view)
+ view->skinKeyReleaseEvent( &keyEvent );
+ buttonPressed = FALSE;
+ ButtonAreas *ba = &areas[buttonIndex];
+ tqrepaint( ba->x1, ba->y1, ba->x2 - ba->x1, ba->y2 - ba->y1, FALSE );
+ }
+}
+
+
diff --git a/tqtinterface/qt4/tools/qvfb/skin.h b/tqtinterface/qt4/tools/qvfb/skin.h
new file mode 100644
index 0000000..5c5d112
--- /dev/null
+++ b/tqtinterface/qt4/tools/qvfb/skin.h
@@ -0,0 +1,78 @@
+/**********************************************************************
+** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
+**
+** This file is part of TQt/Embedded virtual framebuffer.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing requirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at sales@trolltech.com.
+**
+** Licensees holding valid TQt Commercial licenses may use this file in
+** accordance with the TQt Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+**********************************************************************/
+
+#include <tqwidget.h>
+
+
+class TQVFb;
+class TQVFbView;
+
+
+class Skin : public TQWidget
+{
+public:
+ Skin( TQVFb *p, const TQString &skinFile, int &viewW, int &viewH );
+ ~Skin( );
+ void setView( TQVFbView *v );
+protected:
+ virtual void paintEvent( TQPaintEvent * );
+ virtual void mousePressEvent( TQMouseEvent *e );
+ virtual void mouseMoveEvent( TQMouseEvent *e );
+ virtual void mouseReleaseEvent( TQMouseEvent * );
+private:
+ TQVFb *tqparent;
+ TQVFbView *view;
+ TQPoint clickPos;
+ bool buttonPressed;
+ int buttonCode;
+ int buttonIndex;
+ float transparancy;
+
+ TQString skinImageUpFileName;
+ TQString skinImageDownFileName;
+ TQPixmap *skinImageUp;
+ TQPixmap *skinImageDown;
+ int viewX1, viewY1;
+ int numberOfAreas;
+
+ typedef struct {
+ TQString name;
+ int keyCode;
+ int x1, y1;
+ int x2, y2;
+ } ButtonAreas;
+
+ ButtonAreas *areas;
+};
+
+
diff --git a/tqtinterface/qt4/tools/tools.pro b/tqtinterface/qt4/tools/tools.pro
new file mode 100644
index 0000000..1192059
--- /dev/null
+++ b/tqtinterface/qt4/tools/tools.pro
@@ -0,0 +1,19 @@
+TEMPLATE = subdirs
+no-png {
+ message("Tools not available without PNG support")
+} else {
+
+# SUBDIRS = assistant/lib \
+# designer \
+# assistant \
+# linguist
+
+ SUBDIRS = assistant/lib \
+ designer \
+ assistant
+
+ unix:SUBDIRS += qtconfig
+}
+
+CONFIG+=ordered
+REQUIRES=full-config