diff options
Diffstat (limited to 'tools/designer/plugins/wizards')
25 files changed, 3728 insertions, 0 deletions
diff --git a/tools/designer/plugins/wizards/images/qtwizards_menu_1.png b/tools/designer/plugins/wizards/images/qtwizards_menu_1.png Binary files differnew file mode 100644 index 000000000..9a62ab905 --- /dev/null +++ b/tools/designer/plugins/wizards/images/qtwizards_menu_1.png diff --git a/tools/designer/plugins/wizards/images/qtwizards_menu_2.png b/tools/designer/plugins/wizards/images/qtwizards_menu_2.png Binary files differnew file mode 100644 index 000000000..fd5260745 --- /dev/null +++ b/tools/designer/plugins/wizards/images/qtwizards_menu_2.png diff --git a/tools/designer/plugins/wizards/images/qtwizards_menu_3.png b/tools/designer/plugins/wizards/images/qtwizards_menu_3.png Binary files differnew file mode 100644 index 000000000..7cf15ac5b --- /dev/null +++ b/tools/designer/plugins/wizards/images/qtwizards_menu_3.png diff --git a/tools/designer/plugins/wizards/images/qtwizards_table_1.png b/tools/designer/plugins/wizards/images/qtwizards_table_1.png Binary files differnew file mode 100644 index 000000000..425b133ea --- /dev/null +++ b/tools/designer/plugins/wizards/images/qtwizards_table_1.png diff --git a/tools/designer/plugins/wizards/images/qtwizards_table_2.png b/tools/designer/plugins/wizards/images/qtwizards_table_2.png Binary files differnew file mode 100644 index 000000000..f7295423c --- /dev/null +++ b/tools/designer/plugins/wizards/images/qtwizards_table_2.png diff --git a/tools/designer/plugins/wizards/images/qtwizards_table_3.png b/tools/designer/plugins/wizards/images/qtwizards_table_3.png Binary files differnew file mode 100644 index 000000000..472f26700 --- /dev/null +++ b/tools/designer/plugins/wizards/images/qtwizards_table_3.png diff --git a/tools/designer/plugins/wizards/images/qtwizards_table_4.png b/tools/designer/plugins/wizards/images/qtwizards_table_4.png Binary files differnew file mode 100644 index 000000000..493b12e7c --- /dev/null +++ b/tools/designer/plugins/wizards/images/qtwizards_table_4.png diff --git a/tools/designer/plugins/wizards/images/re-sort.png b/tools/designer/plugins/wizards/images/re-sort.png Binary files differnew file mode 100644 index 000000000..43a823499 --- /dev/null +++ b/tools/designer/plugins/wizards/images/re-sort.png diff --git a/tools/designer/plugins/wizards/images/small/editcopy.png b/tools/designer/plugins/wizards/images/small/editcopy.png Binary files differnew file mode 100644 index 000000000..080db0896 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/editcopy.png diff --git a/tools/designer/plugins/wizards/images/small/editcut.png b/tools/designer/plugins/wizards/images/small/editcut.png Binary files differnew file mode 100644 index 000000000..f8bd744f2 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/editcut.png diff --git a/tools/designer/plugins/wizards/images/small/editpaste.png b/tools/designer/plugins/wizards/images/small/editpaste.png Binary files differnew file mode 100644 index 000000000..dc7915e27 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/editpaste.png diff --git a/tools/designer/plugins/wizards/images/small/filenew.png b/tools/designer/plugins/wizards/images/small/filenew.png Binary files differnew file mode 100644 index 000000000..4e5a17233 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/filenew.png diff --git a/tools/designer/plugins/wizards/images/small/fileopen.png b/tools/designer/plugins/wizards/images/small/fileopen.png Binary files differnew file mode 100644 index 000000000..cb18a2c01 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/fileopen.png diff --git a/tools/designer/plugins/wizards/images/small/filesave.png b/tools/designer/plugins/wizards/images/small/filesave.png Binary files differnew file mode 100644 index 000000000..ad3f6f88a --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/filesave.png diff --git a/tools/designer/plugins/wizards/images/small/print.png b/tools/designer/plugins/wizards/images/small/print.png Binary files differnew file mode 100644 index 000000000..8a3640b62 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/print.png diff --git a/tools/designer/plugins/wizards/images/small/redo.png b/tools/designer/plugins/wizards/images/small/redo.png Binary files differnew file mode 100644 index 000000000..3a504a201 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/redo.png diff --git a/tools/designer/plugins/wizards/images/small/searchfind.png b/tools/designer/plugins/wizards/images/small/searchfind.png Binary files differnew file mode 100644 index 000000000..900156db5 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/searchfind.png diff --git a/tools/designer/plugins/wizards/images/small/undo.png b/tools/designer/plugins/wizards/images/small/undo.png Binary files differnew file mode 100644 index 000000000..2fc8d2697 --- /dev/null +++ b/tools/designer/plugins/wizards/images/small/undo.png diff --git a/tools/designer/plugins/wizards/main.cpp b/tools/designer/plugins/wizards/main.cpp new file mode 100644 index 000000000..0dbc5262a --- /dev/null +++ b/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 retquirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid TQt Commercial licenses may use this file in +** accordance with the TQt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with 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 <qfeatures.h> +#include <qwidget.h> +#include <templatewizardiface.h> +#ifndef QT_NO_SQL +#include "sqlformwizardimpl.h" +#endif +#include "mainwindowwizard.h" +#include <qapplication.h> + +class StandardTemplateWizardInterface : public TemplateWizardInterface, public TQLibraryInterface +{ +public: + StandardTemplateWizardInterface(); + virtual ~StandardTemplateWizardInterface(); + + TQRESULT queryInterface( const TQUuid&, TQUnknownInterface** ); + Q_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 QT_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 QT_NO_SQL + if ( templ == "TQDesignerDataView" || + templ == "TQDesignerDataBrowser" || + templ == "TQDataView" || + templ == "TQDataBrowser" || + templ == "TQDataTable" ) { + SqlFormWizard wizard( aIface, widget, qApp->mainWidget(), fw, 0, TRUE ); + wizard.exec(); + } +#endif + if ( templ == "TQMainWindow" ) { + MainWindowWizardBase wizard( qApp->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_QUnknown ) + *iface = (TQUnknownInterface*)(TemplateWizardInterface*) this; + else if ( uuid == IID_QFeatureList ) + *iface = (TQFeatureListInterface*)this; + else if ( uuid == IID_TemplateWizard ) + *iface = (TemplateWizardInterface*)this; + else if ( uuid == IID_QLibrary ) + *iface = (TQLibraryInterface*)this; + else + return TQE_NOINTERFACE; + + (*iface)->addRef(); + return TQS_OK; +} + +Q_EXPORT_COMPONENT() +{ + Q_CREATE_INSTANCE( StandardTemplateWizardInterface ) +} diff --git a/tools/designer/plugins/wizards/mainwindowwizard.ui b/tools/designer/plugins/wizards/mainwindowwizard.ui new file mode 100644 index 000000000..cdb8f59de --- /dev/null +++ b/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 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 retquirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid TQt Commercial licenses may use this file in +** accordance with the TQt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with 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 TQUnknownInterface;</forward> +<forward>class TQWidget;</forward> +<variable>TQWidget *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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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>&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>&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>&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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> +</widget> +<connections> + <connection language="C++"> + <sender>comboToolbar</sender> + <signal>activated(const TQString&)</signal> + <receiver>MainWindowWizardBase</receiver> + <slot>currentToolbarChanged(const TQString&)</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 TQString&)</signal> + <receiver>MainWindowWizardBase</receiver> + <slot>pageSelected(const TQString&)</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 TQString & s )</slot> + <slot access="public" specifier="virtual" language="C++" returnType="void">getPixmap( const TQString & n, TQPixmap & pix )</slot> + <slot access="protected" specifier="virtual" language="C++" returnType="void">pageSelected( const TQString & )</slot> + <slot access="public" specifier="virtual" language="C++" returnType="void">setAppInterface( TQUnknownInterface * iface, DesignerFormWindow * fw, TQWidget * 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/tools/designer/plugins/wizards/mainwindowwizard.ui.h b/tools/designer/plugins/wizards/mainwindowwizard.ui.h new file mode 100644 index 000000000..fa491b5e3 --- /dev/null +++ b/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 retquirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid TQt Commercial licenses may use this file in +** accordance with the TQt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with 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 = qInstallMsgHandler( 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( "searchfind", 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.find( listToolbar->text( i ) ); + if ( !a ) + continue; + dfw->addToolBarAction( "toolBar", a ); + dfw->addAction( a ); + if ( usedActions.findRef( a ) == -1 ) + usedActions.append( a ); + } + } + for ( TQAction *ac = usedActions.first(); ac; ac = usedActions.next() ) { + if ( TQString( ac->name() ).find( "file" ) != -1 && checkCreateConnectionsFile->isChecked() || + TQString( ac->name() ).find( "edit" ) != -1 && checkCreateConnectionsEdit->isChecked() || + TQString( ac->name() ).find( "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 ); + } + } + + qInstallMsgHandler( 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/tools/designer/plugins/wizards/sqlformwizard.ui b/tools/designer/plugins/wizards/sqlformwizard.ui new file mode 100644 index 000000000..fee38f7a9 --- /dev/null +++ b/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 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 retquirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid TQt Commercial licenses may use this file in +** accordance with the TQt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with 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>&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>&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="sizeHint"> + <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 &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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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>&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>&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>&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>&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>&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>&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&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>&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>&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>&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>&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="sizeHint"> + <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="sizeHint"> + <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>&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 &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 &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 &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 &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 &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>&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="sizeHint"> + <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>&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="sizeHint"> + <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 > 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 > 3) +((version > 3) and (price > 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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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>&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 &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="sizeHint"> + <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="sizeHint"> + <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 &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>&Create layout 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 layout for &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 layout for &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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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="sizeHint"> + <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>&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(TQListBoxItem*)</signal> + <receiver>SqlFormWizardBase</receiver> + <slot>addSortField()</slot> + </connection> + <connection> + <sender>listBoxSortedField</sender> + <signal>doubleClicked(TQListBoxItem*)</signal> + <receiver>SqlFormWizardBase</receiver> + <slot>removeSortField()</slot> + </connection> + <connection> + <sender>listBoxSortedField</sender> + <signal>rightButtonClicked(TQListBoxItem*,const TQPoint&)</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 TQString&)</signal> + <receiver>SqlFormWizardBase</receiver> + <slot>connectionSelected(const TQString&)</slot> + </connection> + <connection> + <sender>listBoxTable</sender> + <signal>highlighted(const TQString&)</signal> + <receiver>SqlFormWizardBase</receiver> + <slot>tableSelected(const TQString&)</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> +<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 TQString & )</slot> + <slot access="protected">tableSelected( const TQString & )</slot> +</slots> +<pixmapinproject/> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/tools/designer/plugins/wizards/sqlformwizardimpl.cpp b/tools/designer/plugins/wizards/sqlformwizardimpl.cpp new file mode 100644 index 000000000..63678756e --- /dev/null +++ b/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 retquirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid TQt Commercial licenses may use this file in +** accordance with the TQt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with 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 <qlistbox.h> +#include <qwidget.h> +#include <qcheckbox.h> +#include <qlineedit.h> + +#include <qlabel.h> +#include <qgroupbox.h> +#include <qlayout.h> +#include <qregexp.h> +#include <qpushbutton.h> +#include <qmultilineedit.h> +#include <qlistview.h> +#include <qfeatures.h> +#include <qradiobutton.h> +#include <qspinbox.h> +#include <limits.h> + +#ifndef QT_NO_SQL +#include <qdatatable.h> +#include <qdatabrowser.h> +#include <qdataview.h> +#include <qsqleditorfactory.h> +#include <qsqlindex.h> +#include <qsqlcursor.h> +#endif + +SqlFormWizard::SqlFormWizard( TQUnknownInterface *aIface, TQWidget *w, + TQWidget* parent, DesignerFormWindow *fw, const char* name, bool modal, WFlags fl ) + : SqlFormWizardBase( parent, name, modal, fl ), widget( w ), appIface( aIface ), + mode( None ) +{ + appIface->addRef(); + formWindow = fw; + setFinishEnabled( finishPage, TRUE ); + + /* set mode of operation */ + if ( ::qt_cast<TQDataTable*>(widget) ) { + setCaption( "Data Table Wizard" ); + mode = Table; + setAppropriate( navigPage, FALSE ); + setAppropriate( layoutPage, FALSE ); + checkBoxAutoEdit->setChecked( FALSE ); + } else if ( ::qt_cast<TQDataBrowser*>(widget) ) { + setCaption( "Data Browser Wizard" ); + setAppropriate( tablePropertiesPage, FALSE ); + mode = Browser; + checkBoxAutoEdit->setChecked( TRUE ); + } else if ( ::qt_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(), SIGNAL(clicked()), 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().find( listBoxTable->currentText() ); + // remove primary index fields, if any + listBoxSortField->insertStringList( lst ); + d->open( FALSE ); +#ifndef QT_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 *parent, const char *name, + const TQString &txt, const TQRect &r, DesignerFormWindow *fw ) +{ + TQPushButton *pb = (TQPushButton*)fw->create( "TQPushButton", parent, 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 QT_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)->setAlignment( TQt::AlignRight ); + formWindow->setPropertyChanged( editor, "alignment", TRUE ); + } + if ( ::qt_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 ); + + /* geometry */ + 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/tools/designer/plugins/wizards/sqlformwizardimpl.h b/tools/designer/plugins/wizards/sqlformwizardimpl.h new file mode 100644 index 000000000..a03ed49f2 --- /dev/null +++ b/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 retquirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid TQt Commercial licenses may use this file in +** accordance with the TQt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with 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 SQLFORMWIZARDIMPL_H +#define SQLFORMWIZARDIMPL_H + +#include "sqlformwizard.h" +#include <templatewizardiface.h> +#include <designerinterface.h> +#include <qvaluelist.h> + +class SqlFormWizard : public SqlFormWizardBase +{ + Q_OBJECT + +public: + SqlFormWizard( TQUnknownInterface *aIface, TQWidget *w, TQWidget* parent = 0, DesignerFormWindow *fw = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~SqlFormWizard(); + + void accept() const; + +protected 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 // SQLFORMWIZARDIMPL_H diff --git a/tools/designer/plugins/wizards/wizards.pro b/tools/designer/plugins/wizards/wizards.pro new file mode 100644 index 000000000..1e506934a --- /dev/null +++ b/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 |