From: <mrj...@us...> - 2008-02-02 23:56:32
|
Revision: 2508 http://tora.svn.sourceforge.net/tora/?rev=2508&view=rev Author: mrjohnson0 Date: 2008-02-02 15:56:36 -0800 (Sat, 02 Feb 2008) Log Message: ----------- q3groupbox ported Modified Paths: -------------- trunk/tora/src/tosgatrace.cpp trunk/tora/src/tosgatrace.h Modified: trunk/tora/src/tosgatrace.cpp =================================================================== --- trunk/tora/src/tosgatrace.cpp 2008-02-02 23:53:27 UTC (rev 2507) +++ trunk/tora/src/tosgatrace.cpp 2008-02-02 23:56:36 UTC (rev 2508) @@ -50,7 +50,7 @@ #include <qcheckbox.h> #include <qcombobox.h> -#include <q3groupbox.h> +#include <QGroupBox> #include <qlabel.h> #include <qmenubar.h> #include <qmessagebox.h> @@ -72,20 +72,37 @@ #define CONF_AUTO_UPDATE "AutoUpdate" -class toSGATracePrefs : public Q3GroupBox, public toSettingTab { +class toSGATracePrefs : public QGroupBox, public toSettingTab { QCheckBox* AutoUpdate; toTool *Tool; public: toSGATracePrefs(toTool *tool, QWidget* parent = 0, const char* name = 0) - : Q3GroupBox(1, Qt::Horizontal, parent, name), toSettingTab("trace.html"), Tool(tool) { + : QGroupBox(parent), toSettingTab("trace.html"), Tool(tool) { + if(name) + setObjectName(name); + + QVBoxLayout *vbox = new QVBoxLayout; + vbox->setSpacing(6); + vbox->setContentsMargins(11, 11, 11, 11); + + setLayout(vbox); + setTitle(qApp->translate("toSGATracePrefs", "SGA Trace")); AutoUpdate = new QCheckBox(this, "AutoRefresh"); AutoUpdate->setText(qApp->translate("toSGATracePrefs", "&Auto update")); QToolTip::add (AutoUpdate, qApp->translate("toSGATracePrefs", "Update automatically after change of schema.")); + vbox->addWidget(AutoUpdate); + QSpacerItem *spacer = new QSpacerItem( + 20, + 20, + QSizePolicy::Minimum, + QSizePolicy::Expanding); + vbox->addItem(spacer); + if (!Tool->config(CONF_AUTO_UPDATE, "Yes").isEmpty()) AutoUpdate->setChecked(true); } Modified: trunk/tora/src/tosgatrace.h =================================================================== --- trunk/tora/src/tosgatrace.h 2008-02-02 23:53:27 UTC (rev 2507) +++ trunk/tora/src/tosgatrace.h 2008-02-02 23:56:36 UTC (rev 2508) @@ -42,7 +42,6 @@ #include "totool.h" #include <qstring.h> -#include <Q3PopupMenu> #define TOSQL_LONGOPS "toSGATrace:LongOps" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-03 03:21:59
|
Revision: 2509 http://tora.svn.sourceforge.net/tora/?rev=2509&view=rev Author: mrjohnson0 Date: 2008-02-02 19:22:04 -0800 (Sat, 02 Feb 2008) Log Message: ----------- ported q3 networking had to add a global config option for smtp server because qt4 no longer has any way to lookup mx values... Modified Paths: -------------- trunk/tora/src/toconf.h trunk/tora/src/toglobalsetting.cpp trunk/tora/src/toglobalsettingui.ui trunk/tora/src/tosmtp.cpp trunk/tora/src/tosmtp.h Modified: trunk/tora/src/toconf.h =================================================================== --- trunk/tora/src/toconf.h 2008-02-02 23:56:36 UTC (rev 2508) +++ trunk/tora/src/toconf.h 2008-02-03 03:22:04 UTC (rev 2509) @@ -149,6 +149,10 @@ #define CONF_DISPLAY_GRIDLINES "Gridlines" #define DEFAULT_DISPLAY_GRIDLINES "Yes" #define DEFAULT_EXTENSIONS "SQL (*.sql *.pkg *.pkb), Text (*.txt), All (*)" +#define CONF_SMTP "SmtpServer" +#define DEFAULT_SMTP "localhost" +#define CONF_SMTP_PORT "SmtpServerPort" +#define DEFAULT_SMTP_PORT "25" # ifndef Q_OS_WIN32 // Undefining this will leave out the style selection option stuff from the program Modified: trunk/tora/src/toglobalsetting.cpp =================================================================== --- trunk/tora/src/toglobalsetting.cpp 2008-02-02 23:56:36 UTC (rev 2508) +++ trunk/tora/src/toglobalsetting.cpp 2008-02-03 03:22:04 UTC (rev 2509) @@ -47,9 +47,7 @@ #include <qcheckbox.h> #include <qcombobox.h> -#include <q3filedialog.h> #include <qfontdialog.h> -#include <q3groupbox.h> #include <qlabel.h> #include <qdir.h> #include <qlayout.h> @@ -61,16 +59,18 @@ #include <qtooltip.h> #include <qvalidator.h> #include <qvariant.h> -#include <q3whatsthis.h> #include <qcolordialog.h> -//Added by qt3to4: + #include <QString> #include <QFileDialog> toGlobalSetting::toGlobalSetting(QWidget *parent, const char *name, Qt::WFlags fl) - : QWidget(parent/*, name, fl*/), toSettingTab("preferences.html#global") + : QWidget(parent, fl), toSettingTab("preferences.html#global") { + if(name) + setObjectName(name); + setupUi(this); SavePassword->setChecked(!toConfigurationSingle::Instance().globalConfig(CONF_SAVE_PWD, "").isEmpty()); @@ -167,6 +167,11 @@ CustomSQL->setText(toConfigurationSingle::Instance().globalConfig(CONF_SQL_FILE, DEFAULT_SQL_FILE)); Locale->setText(toConfigurationSingle::Instance().globalConfig(CONF_LOCALE, QTextCodec::locale())); + + SmtpServer->setText(toConfigurationSingle::Instance().globalConfig( + CONF_SMTP, DEFAULT_SMTP)); + SmtpPort->setValue(toConfigurationSingle::Instance().globalConfig( + CONF_SMTP_PORT, DEFAULT_SMTP_PORT).toInt()); } void toGlobalSetting::pluginBrowse(void) @@ -251,6 +256,9 @@ toConfigurationSingle::Instance().globalSetConfig(CONF_CHART_SAMPLES, QString::number(ChartSamples->value())); toConfigurationSingle::Instance().globalSetConfig(CONF_LOCALE, Locale->text()); + + toConfigurationSingle::Instance().globalSetConfig(CONF_SMTP, SmtpServer->text()); + toConfigurationSingle::Instance().globalSetConfig(CONF_SMTP_PORT, QString::number(SmtpPort->value())); } void toDatabaseSetting::numberFormatChange() Modified: trunk/tora/src/toglobalsettingui.ui =================================================================== --- trunk/tora/src/toglobalsettingui.ui 2008-02-02 23:56:36 UTC (rev 2508) +++ trunk/tora/src/toglobalsettingui.ui 2008-02-03 03:22:04 UTC (rev 2509) @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>729</width> - <height>553</height> + <width>733</width> + <height>629</height> </rect> </property> <property name="windowTitle" > @@ -32,7 +32,7 @@ <number>6</number> </property> <item row="0" column="0" > - <widget class="Q3GroupBox" name="GroupBox2" > + <widget class="QGroupBox" name="GroupBox2" > <property name="title" > <string>Paths</string> </property> @@ -186,7 +186,7 @@ </widget> </item> <item row="1" column="0" > - <widget class="Q3GroupBox" name="OptionGroup" > + <widget class="QGroupBox" name="OptionGroup" > <property name="title" > <string>Options</string> </property> @@ -620,6 +620,37 @@ </property> </widget> </item> + <item row="9" column="0" colspan="6" > + <layout class="QHBoxLayout" > + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string>SMTP Server</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="SmtpServer" /> + </item> + <item> + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>:</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="SmtpPort" > + <property name="minimum" > + <number>1</number> + </property> + <property name="maximum" > + <number>65536</number> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> </item> @@ -627,14 +658,6 @@ </widget> <layoutdefault spacing="6" margin="11" /> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <customwidgets> - <customwidget> - <class>Q3GroupBox</class> - <extends>QGroupBox</extends> - <header>Qt3Support/Q3GroupBox</header> - <container>1</container> - </customwidget> - </customwidgets> <tabstops> <tabstop>CustomSQL</tabstop> <tabstop>SQLBrowse</tabstop> Modified: trunk/tora/src/tosmtp.cpp =================================================================== --- trunk/tora/src/tosmtp.cpp 2008-02-02 23:56:36 UTC (rev 2508) +++ trunk/tora/src/tosmtp.cpp 2008-02-03 03:22:04 UTC (rev 2509) @@ -1,162 +1,146 @@ /***** -* -* TOra - An Oracle Toolkit for DBA's and developers -* Copyright (C) 2003-2005 Quest Software, Inc -* Portions Copyright (C) 2005 Other Contributors -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; only version 2 of -* the License is valid for this program. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* -* As a special exception, you have permission to link this program -* with the Oracle Client libraries and distribute executables, as long -* as you follow the requirements of the GNU GPL in regard to all of the -* software in the executable aside from Oracle client libraries. -* -* Specifically you are not permitted to link this program with the -* Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. -* And you are not permitted to distribute binaries compiled against -* these libraries without written consent from Quest Software, Inc. -* Observe that this does not disallow linking to the Qt Free Edition. -* -* You may link this product with any GPL'd Qt library such as Qt/Free -* -* All trademarks belong to their respective owners. -* -*****/ + * + * TOra - An Oracle Toolkit for DBA's and developers + * Copyright (C) 2003-2005 Quest Software, Inc + * Portions Copyright (C) 2005 Other Contributors + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 of + * the License is valid for this program. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * As a special exception, you have permission to link this program + * with the Oracle Client libraries and distribute executables, as long + * as you follow the requirements of the GNU GPL in regard to all of the + * software in the executable aside from Oracle client libraries. + * + * Specifically you are not permitted to link this program with the + * Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. + * And you are not permitted to distribute binaries compiled against + * these libraries without written consent from Quest Software, Inc. + * Observe that this does not disallow linking to the Qt Free Edition. + * + * You may link this product with any GPL'd Qt library such as Qt/Free + * + * All trademarks belong to their respective owners. + * + *****/ #include "utils.h" #include "tosmtp.h" +#include "toconf.h" +#include "toconfiguration.h" #include <qapplication.h> -#include <q3dns.h> #include <qmessagebox.h> #include <qregexp.h> -#include <q3socket.h> #include <QTextStream> #include <qtimer.h> -//Added by qt3to4: -#include <Q3ValueList> +#include <QTcpSocket> -toSMTP::toSMTP(const QString &from, const QString &to, - const QString &subject, const QString &body) -{ - Socket = new Q3Socket( this ); + +toSMTP::toSMTP(const QString &from, + const QString &to, + const QString &subject, + const QString &body) { + From = from; + Recipient = to; + State = Init; + Stream = 0; + + Socket = new QTcpSocket(this); connect(Socket, SIGNAL(readyRead()), - this, SLOT( readyRead())); + this, SLOT(readyRead())); connect(Socket, SIGNAL(connected()), this, SLOT(connected())); - Stream = 0; - MXLookup = new Q3Dns(to.mid(to.find('@') + 1), Q3Dns::Mx); - connect(MXLookup, SIGNAL(resultsReady()), - this, SLOT(dnsLookupHelper()) ); - Message = QString::fromLatin1("From: ") + from + - QString::fromLatin1("\nTo: ") + to + - QString::fromLatin1("\nSubject: ") + subject + - QString::fromLatin1("\n\n") + body + "\n"; + QString::fromLatin1("\nTo: ") + to + + QString::fromLatin1("\nSubject: ") + subject + + QString::fromLatin1("\n\n") + body + "\n"; Message.replace(QRegExp(QString::fromLatin1("\n")), QString::fromLatin1("\r\n")); Message.replace(QRegExp(QString::fromLatin1("\r\n.\r\n")), QString::fromLatin1("\r\n..\r\n")); - From = from; - Recipient = to; + QString server = toConfigurationSingle::Instance().globalConfig( + CONF_SMTP, DEFAULT_SMTP); + int port = toConfigurationSingle::Instance().globalConfig( + CONF_SMTP_PORT, DEFAULT_SMTP_PORT).toInt(); - State = Init; + if(server.isNull() || server.isEmpty()) + toStatusMessage("No SMTP Server configured. Please check the preferences dialog."); + else { + Socket->connectToHost(server, port); + Stream = new QTextStream(Socket); + } } -toSMTP::~toSMTP() -{ +toSMTP::~toSMTP() { delete Stream; delete Socket; } -void toSMTP::dnsLookupHelper() -{ - Q3ValueList<Q3Dns::MailServer> s = MXLookup->mailServers(); - if (s.isEmpty() && MXLookup->isWorking()) - return ; - - toStatusMessage(tr("Connecting to %1").arg(s.first().name), false, false); - - Socket->connectToHost(s.first().name, 25); - Stream = new QTextStream(Socket); +void toSMTP::connected() { + toStatusMessage(tr("Connected to %1").arg(Socket->peerName()), false, false); } -void toSMTP::connected() -{ - toStatusMessage(tr("Connected to %1" ).arg(Socket->peerName()), false, false); -} - -void toSMTP::readyRead() -{ +void toSMTP::readyRead() { // SMTP is line-oriented - if (!Socket->canReadLine()) + if(!Socket->canReadLine()) return ; QString responseLine; - do - { + do { responseLine = Socket->readLine(); Response += responseLine; } - while (Socket->canReadLine() && responseLine[3] != ' '); + while(Socket->canReadLine() && responseLine[3] != ' '); responseLine.truncate(3); - if (State == Init && responseLine[0] == '2') - { + if (State == Init && responseLine[0] == '2') { // banner was okay, let's go on *Stream << "HELO there\r\n"; State = Mail; } - else if (State == Mail && responseLine[0] == '2') - { + else if (State == Mail && responseLine[0] == '2') { // HELO response was okay (well, it has to be) *Stream << "MAIL FROM: <" << From << ">\r\n"; State = Rcpt; } - else if (State == Rcpt && responseLine[0] == '2') - { + else if (State == Rcpt && responseLine[0] == '2') { *Stream << "RCPT TO: <" << Recipient << ">\r\n"; State = Data; } - else if (State == Data && responseLine[0] == '2') - { + else if (State == Data && responseLine[0] == '2') { *Stream << "DATA\r\n"; State = Body; } - else if (State == Body && responseLine[0] == '3') - { + else if (State == Body && responseLine[0] == '3') { *Stream << Message << ".\r\n"; State = Quit; } - else if (State == Quit && responseLine[0] == '2') - { + else if (State == Quit && responseLine[0] == '2') { *Stream << "QUIT\r\n"; // here, we just close. State = Close; toStatusMessage(tr("Message sent"), false, false); } - else if (State == Close) - { + else if (State == Close) { delete this; } - else - { + else { toStatusMessage(tr("Unexpected reply from SMTP server:\n\n") + Response); State = Close; Modified: trunk/tora/src/tosmtp.h =================================================================== --- trunk/tora/src/tosmtp.h 2008-02-02 23:56:36 UTC (rev 2508) +++ trunk/tora/src/tosmtp.h 2008-02-03 03:22:04 UTC (rev 2509) @@ -43,20 +43,19 @@ #include <qobject.h> #include <qstring.h> -class Q3Dns; -class Q3Socket; +class QTcpSocket; class QTextStream; + // Adapted from Qt smtp example. -/** Used to send mail asyncronously. Just create an instance and forget it. - * It will delete itself when done. +/** + * Used to send mail asyncronously. Just create an instance and forget + * it. It will delete itself when done. */ +class toSMTP : public QObject { + Q_OBJECT; -class toSMTP : public QObject -{ - Q_OBJECT - public: /** Send an email. * @param from From field of email. @@ -64,18 +63,18 @@ * @param subject Subject of mail. * @param body Body of email message. */ - toSMTP(const QString &from, const QString &to, - const QString &subject, const QString &body); + toSMTP(const QString &from, + const QString &to, + const QString &subject, + const QString &body); ~toSMTP(); private slots: - void dnsLookupHelper(); void readyRead(); void connected(); private: - enum state - { + enum state { Init, Mail, Rcpt, @@ -85,14 +84,13 @@ Close }; - QString Message; - QString From; - QString Recipient; - Q3Socket *Socket; + QString Message; + QString From; + QString Recipient; + QTcpSocket *Socket; QTextStream *Stream; - int State; - QString Response; - Q3Dns * MXLookup; + int State; + QString Response; }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-03 03:37:17
|
Revision: 2512 http://tora.svn.sourceforge.net/tora/?rev=2512&view=rev Author: mrjohnson0 Date: 2008-02-02 19:37:23 -0800 (Sat, 02 Feb 2008) Log Message: ----------- ported q3popupmenu Modified Paths: -------------- trunk/tora/src/tostorage.cpp trunk/tora/src/tostorage.h Modified: trunk/tora/src/tostorage.cpp =================================================================== --- trunk/tora/src/tostorage.cpp 2008-02-03 03:23:24 UTC (rev 2511) +++ trunk/tora/src/tostorage.cpp 2008-02-03 03:37:23 UTC (rev 2512) @@ -50,15 +50,12 @@ #include "totool.h" #include <qcheckbox.h> -#include <q3filedialog.h> -#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qmenubar.h> #include <qmessagebox.h> #include <qpainter.h> -#include <q3popupmenu.h> #include <qpushbutton.h> #include <qradiobutton.h> #include <qregexp.h> @@ -68,11 +65,11 @@ #include <qtoolbar.h> #include <qtoolbutton.h> #include <qtooltip.h> -#include <q3whatsthis.h> #include <qworkspace.h> -//Added by qt3to4: + #include <QPixmap> #include <QFileDialog> +#include <QMenu> #include "icons/addfile.xpm" #include "icons/addtablespace.xpm" @@ -833,6 +830,7 @@ UpdateAct = new QAction(QPixmap(const_cast<const char**>(refresh_xpm)), tr("Update"), this); connect(UpdateAct, SIGNAL(triggered()), this, SLOT(refresh())); + UpdateAct->setShortcut(QKeySequence::Refresh); toolbar->addAction(UpdateAct); toolbar->addSeparator(); @@ -977,88 +975,45 @@ setFocusProxy(Storage); } -#if 0 // todo -#define TO_ID_ONLINE (toMain::TO_TOOL_MENU_ID+ 0) -#define TO_ID_OFFLINE (toMain::TO_TOOL_MENU_ID+ 1) -#define TO_ID_LOGGING (toMain::TO_TOOL_MENU_ID+ 2) -#define TO_ID_NOLOGGING (toMain::TO_TOOL_MENU_ID+ 3) -#define TO_ID_READ_WRITE (toMain::TO_TOOL_MENU_ID+ 4) -#define TO_ID_READ_ONLY (toMain::TO_TOOL_MENU_ID+ 5) -#define TO_ID_MODIFY_TABLESPACE (toMain::TO_TOOL_MENU_ID+ 6) -#define TO_ID_MODIFY_DATAFILE (toMain::TO_TOOL_MENU_ID+ 7) -#define TO_ID_NEW_TABLESPACE (toMain::TO_TOOL_MENU_ID+ 8) -#define TO_ID_ADD_DATAFILE (toMain::TO_TOOL_MENU_ID+ 9) -#define TO_ID_COALESCE (toMain::TO_TOOL_MENU_ID+ 10) -#define TO_ID_MOVE_FILE (toMain::TO_TOOL_MENU_ID+ 11) -#define TO_ID_DROP_TABLESPACE (toMain::TO_TOOL_MENU_ID+ 12) -#endif -void toStorage::windowActivated(QWidget *widget) -{ - if (widget == this) - { - if (!ToolMenu) - { -#if 0 // todo - ToolMenu = new Q3PopupMenu(this); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(refresh_xpm)), tr("&Refresh"), - this, SLOT(refresh(void)), - toKeySequence(tr("F5", "Storage|Refresh"))); - ToolMenu->insertSeparator(); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(online_xpm)), tr("Tablespace online"), - this, SLOT(online()), 0, TO_ID_ONLINE); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(offline_xpm)), tr("Tablespace offline"), - this, SLOT(offline()), 0, TO_ID_OFFLINE); - ToolMenu->insertSeparator(); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(logging_xpm)), tr("Default logging"), - this, SLOT(logging()), 0, TO_ID_LOGGING); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(eraselog_xpm)), tr("Default not logging"), - this, SLOT(noLogging()), 0, TO_ID_NOLOGGING); - ToolMenu->insertSeparator(); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(writetablespace_xpm)), tr("Read write access"), - this, SLOT(readWrite()), 0, TO_ID_READ_WRITE); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(readtablespace_xpm)), tr("Read only access"), - this, SLOT(readOnly()), 0, TO_ID_READ_ONLY); - ToolMenu->insertSeparator(); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(droptablespace_xpm)), tr("Drop tablespace..."), - this, SLOT(dropTablespace()), 0, TO_ID_DROP_TABLESPACE); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(modtablespace_xpm)), tr("Modify tablespace..."), - this, SLOT(modifyTablespace()), 0, TO_ID_MODIFY_TABLESPACE); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(modfile_xpm)), tr("Modify datafile..."), - this, SLOT(modifyDatafile()), 0, TO_ID_MODIFY_DATAFILE); - ToolMenu->insertSeparator(); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(addtablespace_xpm)), tr("New tablespace..."), - this, SLOT(newTablespace()), 0, TO_ID_NEW_TABLESPACE); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(addfile_xpm)), tr("Add datafile..."), - this, SLOT(newDatafile()), 0, TO_ID_ADD_DATAFILE); - ToolMenu->insertSeparator(); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(coalesce_xpm)), tr("Coalesce tablespace"), - this, SLOT(coalesce()), 0, TO_ID_COALESCE); - ToolMenu->insertItem(QPixmap(const_cast<const char**>(movefile_xpm)), tr("Move datafile..."), - this, SLOT(moveFile()), 0, TO_ID_MOVE_FILE); +void toStorage::windowActivated(QWidget *widget) { + if (widget == this) { + if (!ToolMenu) { + ToolMenu = new QMenu(tr("&Storage"), this); - toMainWidget()->menuBar()->insertItem(tr("&Storage"), ToolMenu, -1, toToolMenuIndex()); + ToolMenu->addAction(UpdateAct); - ToolMenu->setItemEnabled(TO_ID_ONLINE, OnlineButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_OFFLINE, OfflineButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_LOGGING, LoggingButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_NOLOGGING, EraseLogButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_READ_WRITE, ReadWriteButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_READ_ONLY, ReadOnlyButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_MODIFY_TABLESPACE, - ModTablespaceButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_DROP_TABLESPACE, - DropTablespaceButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_MODIFY_DATAFILE, - ModFileButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_ADD_DATAFILE, NewFileButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_COALESCE, CoalesceButton->isEnabled()); - ToolMenu->setItemEnabled(TO_ID_MOVE_FILE, MoveFileButton->isEnabled()); -#endif + ToolMenu->addSeparator(); + + ToolMenu->addAction(OnlineAct); + ToolMenu->addAction(OfflineAct); + + ToolMenu->addSeparator(); + + ToolMenu->addAction(LoggingAct); + ToolMenu->addAction(EraseLogAct); + + ToolMenu->addSeparator(); + + ToolMenu->addAction(ReadWriteAct); + ToolMenu->addAction(ReadOnlyAct); + + ToolMenu->addSeparator(); + + ToolMenu->addAction(DropTablespaceAct); + ToolMenu->addAction(ModTablespaceAct); + ToolMenu->addAction(ModFileAct); + ToolMenu->addAction(NewFileAct); + + ToolMenu->addSeparator(); + + ToolMenu->addAction(CoalesceAct); + ToolMenu->addAction(MoveFileAct); + + toMainWidget()->addCustomMenu(ToolMenu); } } - else - { + else { delete ToolMenu; ToolMenu = NULL; } Modified: trunk/tora/src/tostorage.h =================================================================== --- trunk/tora/src/tostorage.h 2008-02-03 03:23:24 UTC (rev 2511) +++ trunk/tora/src/tostorage.h 2008-02-03 03:37:23 UTC (rev 2512) @@ -49,15 +49,12 @@ #include <list> #include <qdialog.h> -//Added by qt3to4: #include <QLabel> -#include <Q3PopupMenu> class QCheckBox; -class Q3GroupBox; class QLabel; class QLineEdit; -class Q3PopupMenu; +class QMenu; class QPushButton; class QRadioButton; class QSpinBox; @@ -183,7 +180,7 @@ toStorageExtent *Extents; QSplitter *ExtentParent; - Q3PopupMenu *ToolMenu; + QMenu *ToolMenu; QAction * UpdateAct; QAction *OnlineAct; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-03 04:01:27
|
Revision: 2513 http://tora.svn.sourceforge.net/tora/?rev=2513&view=rev Author: mrjohnson0 Date: 2008-02-02 20:01:32 -0800 (Sat, 02 Feb 2008) Log Message: ----------- port q3listbox Modified Paths: -------------- trunk/tora/src/tosyntaxsetup.cpp trunk/tora/src/tosyntaxsetup.h trunk/tora/src/tosyntaxsetupui.ui Modified: trunk/tora/src/tosyntaxsetup.cpp =================================================================== --- trunk/tora/src/tosyntaxsetup.cpp 2008-02-03 03:37:23 UTC (rev 2512) +++ trunk/tora/src/tosyntaxsetup.cpp 2008-02-03 04:01:32 UTC (rev 2513) @@ -51,16 +51,20 @@ #include <qfont.h> #include <qlabel.h> #include <qlineedit.h> -#include <q3listbox.h> #include <totreewidget.h> #include <qspinbox.h> -//Added by qt3to4: + #include <QString> +#include <QListWidget> + toSyntaxSetup::toSyntaxSetup(QWidget *parent, const char *name, Qt::WFlags fl) - : QWidget(parent), toSettingTab("fonts.html"), - Analyzer(toSyntaxAnalyzer::defaultAnalyzer()) -{ + : QWidget(parent), toSettingTab("fonts.html"), + Analyzer(toSyntaxAnalyzer::defaultAnalyzer()) { + + if(name) + setObjectName(name); + setupUi(this); KeywordUpper->setChecked(!toConfigurationSingle::Instance().globalConfig(CONF_KEYWORD_UPPER, DEFAULT_KEYWORD_UPPER).isEmpty()); SyntaxHighlighting->setChecked(!toConfigurationSingle::Instance().globalConfig(CONF_HIGHLIGHT, "Yes").isEmpty()); @@ -81,24 +85,23 @@ { QString str = toConfigurationSingle::Instance().globalConfig(CONF_LIST, ""); QFont font; - if (str.isEmpty()) - { + if (str.isEmpty()) { QWidget *wid = new toTreeWidget; font = qApp->font(wid); } - else - { + else { font = toStringToFont(str); } List = toFontToString(font); ResultExample->setFont(font); } - try - { -#define INIT_COL(c) { \ - Colors[Analyzer.typeString(c)] = Analyzer.getColor(c); \ - SyntaxComponent->insertItem(tr(Analyzer.typeString(c))); \ - } + + try { +#define INIT_COL(c) { \ + Colors[Analyzer.typeString(c)] = Analyzer.getColor(c); \ + SyntaxComponent->addItem(tr(Analyzer.typeString(c))); \ + } + INIT_COL(toSyntaxAnalyzer::Default); INIT_COL(toSyntaxAnalyzer::Comment); INIT_COL(toSyntaxAnalyzer::Number); @@ -108,12 +111,12 @@ INIT_COL(toSyntaxAnalyzer::ErrorBg); INIT_COL(toSyntaxAnalyzer::DebugBg); } - TOCATCH + TOCATCH; Example->setAnalyzer(Analyzer); Example->setReadOnly(true); -#ifdef TO_NO_ORACLE +#ifdef TO_NO_ORACLE Example->setText(QString::fromLatin1("create procedure CheckObvious\n" "begin\n" " set Quest = 'Great'; -- This variable doesn't exist\n" @@ -122,7 +125,6 @@ " end if;\n" "end")); #else - Example->setText(QString::fromLatin1("create procedure CheckObvious as\n" "begin\n" " Quest:='Great'; -- This variable doesn't exist\n" @@ -144,16 +146,14 @@ Current = NULL; } -void toSyntaxAnalyzer::readColor(const QColor &def, infoType typ) -{ +void toSyntaxAnalyzer::readColor(const QColor &def, infoType typ) { QString conf(CONF_COLOR ":"); conf += typeString(typ); QString res = toConfigurationSingle::Instance().globalConfig(conf, ""); if (res.isEmpty()) Colors[typ] = def; - else - { + else { int r, g, b; if (sscanf(res, "%d,%d,%d", &r, &g, &b) != 3) throw qApp->translate("toSyntaxAnalyzer", "Wrong format of color in setings"); @@ -162,8 +162,7 @@ } } -toSyntaxAnalyzer::infoType toSyntaxAnalyzer::typeString(const QString &str) -{ +toSyntaxAnalyzer::infoType toSyntaxAnalyzer::typeString(const QString &str) { if (str == "Default") return Default; if (str == "Comment") @@ -183,10 +182,8 @@ throw qApp->translate("toSyntaxAnalyzer", "Unknown type"); } -QString toSyntaxAnalyzer::typeString(infoType typ) -{ - switch (typ) - { +QString toSyntaxAnalyzer::typeString(infoType typ) { + switch (typ) { case Default: return "Default"; case Comment: @@ -207,18 +204,16 @@ throw qApp->translate("toSyntaxAnalyzer", "Unknown type"); } -void toSyntaxAnalyzer::updateSettings(void) -{ - try - { +void toSyntaxAnalyzer::updateSettings(void) { + try { const QColorGroup &cg = qApp->palette().active(); readColor(cg.text(), Default); // readColor(Qt::green, Comment); - readColor(QColor(160, 160, 160), Comment); + readColor(QColor(160, 160, 160), Comment); // readColor(Qt::cyan, Number); - readColor(QColor(0, 160, 13), Number); + readColor(QColor(0, 160, 13), Number); // readColor(Qt::blue, Keyword); - readColor(QColor(13, 0, 160), Keyword); + readColor(QColor(13, 0, 160), Keyword); readColor(Qt::red, String); readColor(cg.base(), DefaultBg); readColor(Qt::darkRed, ErrorBg); @@ -227,54 +222,46 @@ TOCATCH } -void toSyntaxSetup::checkFixedWidth(const QFont &fnt) -{ +void toSyntaxSetup::checkFixedWidth(const QFont &fnt) { QFontMetrics mtr(fnt); if (mtr.width(QString::fromLatin1("iiiiiiii")) == mtr.width(QString::fromLatin1("MMMMMMMM"))) KeywordUpper->setEnabled(true); - else - { + else { KeywordUpper->setChecked(false); KeywordUpper->setEnabled(false); } } -void toSyntaxSetup::selectFont(void) -{ +void toSyntaxSetup::selectFont(void) { bool ok = true; - QFont font = QFontDialog::getFont (&ok, CodeExample->font(), this); + QFont font = QFontDialog::getFont(&ok, CodeExample->font(), this); - if (ok) - { + if (ok) { CodeExample->setFont(font); Example->setFont(font); checkFixedWidth(font); } } -void toSyntaxSetup::selectText(void) -{ +void toSyntaxSetup::selectText(void) { bool ok = true; - QFont font = QFontDialog::getFont (&ok, TextExample->font(), this); + QFont font = QFontDialog::getFont(&ok, TextExample->font(), this); if (ok) TextExample->setFont(font); } -void toSyntaxSetup::selectResultFont(void) -{ +void toSyntaxSetup::selectResultFont(void) { bool ok = true; - QFont font = QFontDialog::getFont (&ok, toStringToFont(List), this); + QFont font = QFontDialog::getFont(&ok, toStringToFont(List), this); - if (ok) - { + if (ok) { List = toFontToString(font); ResultExample->setFont(font); } } -QString toSyntaxSetup::color() -{ +QString toSyntaxSetup::color() { QString t = Current->text(); for (std::map<QString, QColor>::iterator i = Colors.begin();i != Colors.end();i++) if (qApp->translate("toSyntaxSetup", (*i).first) == t) @@ -282,26 +269,20 @@ throw tr("Unknown color name %1").arg(t); } -void toSyntaxSetup::changeLine(Q3ListBoxItem *item) -{ +void toSyntaxSetup::changeLine(QListWidgetItem *item) { Current = item; - if (Current) - { + if (Current) { QColor col = Colors[color()]; ExampleColor->setBackgroundColor(col); } } -void toSyntaxSetup::selectColor(void) -{ - try - { - if (Current) - { +void toSyntaxSetup::selectColor(void) { + try { + if (Current) { QString coleng = color(); QColor col = QColorDialog::getColor(Colors[coleng]); - if (col.isValid()) - { + if (col.isValid()) { Colors[coleng] = col; ExampleColor->setBackgroundColor(col); Example->analyzer().Colors[toSyntaxAnalyzer::typeString(coleng)] = col; @@ -313,8 +294,7 @@ TOCATCH } -void toSyntaxSetup::saveSetting(void) -{ +void toSyntaxSetup::saveSetting(void) { toConfigurationSingle::Instance().globalSetConfig(CONF_TEXT, toFontToString(TextExample->font())); toConfigurationSingle::Instance().globalSetConfig(CONF_CODE, toFontToString(CodeExample->font())); toConfigurationSingle::Instance().globalSetConfig(CONF_LIST, List); @@ -326,8 +306,7 @@ toConfigurationSingle::Instance().globalSetConfig(CONF_AUTO_INDENT, AutoIndent->isChecked() ? "Yes" : ""); toMarkedText::setDefaultTabWidth(TabStop->value()); toConfigurationSingle::Instance().globalSetConfig(CONF_TAB_STOP, QString::number(toMarkedText::defaultTabWidth())); - for (std::map<QString, QColor>::iterator i = Colors.begin();i != Colors.end();i++) - { + for (std::map<QString, QColor>::iterator i = Colors.begin();i != Colors.end();i++) { QString str(CONF_COLOR); str += ":"; str += (*i).first; Modified: trunk/tora/src/tosyntaxsetup.h =================================================================== --- trunk/tora/src/tosyntaxsetup.h 2008-02-03 03:37:23 UTC (rev 2512) +++ trunk/tora/src/tosyntaxsetup.h 2008-02-03 04:01:32 UTC (rev 2513) @@ -45,37 +45,39 @@ #include "totool.h" #include <map> -//Added by qt3to4: + #include <QString> class QFont; -class toSyntaxSetup : public QWidget, public Ui::toSyntaxSetupUI, public toSettingTab -{ - Q_OBJECT +class toSyntaxSetup : public QWidget, + public Ui::toSyntaxSetupUI, + public toSettingTab { + Q_OBJECT; + QString List; - Q3ListBoxItem *Current; + QListWidgetItem *Current; std::map<QString, QColor> Colors; toSyntaxAnalyzer Analyzer; QString color(); + public: toSyntaxSetup(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0); virtual void saveSetting(void); void checkFixedWidth(const QFont &fnt); + public slots: - virtual void changeLine(Q3ListBoxItem *); + virtual void changeLine(QListWidgetItem *); virtual void selectColor(void); virtual void selectFont(void); virtual void selectText(void); virtual void selectResultFont(void); - virtual void changeUpper(bool val) - { + virtual void changeUpper(bool val) { Example->setKeywordUpper(val); Example->update(); } - virtual void changeHighlight(bool val) - { + virtual void changeHighlight(bool val) { Example->setSyntaxColoring(val); Example->update(); } Modified: trunk/tora/src/tosyntaxsetupui.ui =================================================================== --- trunk/tora/src/tosyntaxsetupui.ui 2008-02-03 03:37:23 UTC (rev 2512) +++ trunk/tora/src/tosyntaxsetupui.ui 2008-02-03 04:01:32 UTC (rev 2513) @@ -1,344 +1,453 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toSyntaxSetupUI</class> - <widget class="QWidget" name="toSyntaxSetupUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>548</width> - <height>527</height> - </rect> - </property> - <property name="windowTitle" > - <string>Form1</string> - </property> - <property name="toolTip" > - <string/> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>0</number> +<ui version="4.0" > + <class>toSyntaxSetupUI</class> + <widget class="QWidget" name="toSyntaxSetupUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>548</width> + <height>527</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form1</string> + </property> + <property name="toolTip" > + <string/> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>0</number> + </property> + <property name="topMargin" > + <number>0</number> + </property> + <property name="rightMargin" > + <number>0</number> + </property> + <property name="bottomMargin" > + <number>0</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="1" > + <widget class="QGroupBox" name="Options" > + <property name="title" > + <string>Options</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> </property> - <property name="spacing" > - <number>6</number> + <property name="topMargin" > + <number>11</number> </property> - <item row="0" column="1" > - <widget class="Q3GroupBox" name="Options" > - <property name="title" > - <string>Options</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item rowspan="1" row="1" column="0" colspan="3" > - <widget class="QCheckBox" name="KeywordUpper" > - <property name="text" > - <string>&Keyword upper</string> - </property> - <property name="toolTip" > - <string>Convert all keywords to uppercase when displayingsyntaxhighlighted text. Only available for monospaced fonts.</string> - </property> - </widget> - </item> - <item rowspan="1" row="2" column="0" colspan="3" > - <widget class="QCheckBox" name="CodeCompletion" > - <property name="text" > - <string>&Code completion</string> - </property> - <property name="toolTip" > - <string>Activate code completion in SQL editors. Not recommended on slow connections.</string> - </property> - </widget> - </item> - <item rowspan="1" row="3" column="0" colspan="3" > - <widget class="QCheckBox" name="CompletionSort" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="text" > - <string>&Sort completion rows</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - <property name="toolTip" > - <string>Sort the available completion rows alphabetically or in the order the are.</string> - </property> - </widget> - </item> - <item rowspan="1" row="0" column="0" colspan="3" > - <widget class="QCheckBox" name="SyntaxHighlighting" > - <property name="text" > - <string>S&yntax highlighting</string> - </property> - <property name="toolTip" > - <string>Enable syntax highlighting, or use simple text editor</string> - </property> - </widget> - </item> - <item rowspan="1" row="4" column="0" colspan="3" > - <widget class="QCheckBox" name="AutoIndent" > - <property name="text" > - <string>&Indent same as previous line</string> - </property> - <property name="toolTip" > - <string>Indent a new line in an editor to the same column as the previous line</string> - </property> - </widget> - </item> - <item row="7" column="2" > - <widget class="QPushButton" name="PushButton1" > - <property name="text" > - <string>Choose</string> - </property> - </widget> - </item> - <item row="7" column="0" > - <widget class="QLabel" name="ResultExample" > - <property name="text" > - <string>List example</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="6" column="0" > - <widget class="QLabel" name="CodeExample" > - <property name="text" > - <string>Code example</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="6" column="2" > - <widget class="QPushButton" name="PushButton1_2" > - <property name="text" > - <string>Choose</string> - </property> - </widget> - </item> - <item row="5" column="2" > - <widget class="QPushButton" name="PushButton1_2_2" > - <property name="text" > - <string>Choose</string> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="TextExample" > - <property name="text" > - <string>Text example</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item rowspan="1" row="8" column="1" colspan="2" > - <widget class="QLineEdit" name="Extensions" /> - </item> - <item row="8" column="0" > - <widget class="QLabel" name="TextLabel1" > - <property name="text" > - <string>Filename extensions</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="10" column="1" > - <spacer name="Spacer1" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> - </item> - <item row="9" column="2" > - <widget class="QSpinBox" name="TabStop" > - <property name="minimum" > - <number>1</number> - </property> - </widget> - </item> - <item rowspan="1" row="9" column="0" colspan="2" > - <widget class="QLabel" name="TextLabel1_2" > - <property name="text" > - <string>Tab stop width</string> - </property> - <property name="buddy" > - <cstring>TabStop</cstring> - </property> - <property name="toolTip" > - <string>Number of character width of tabstops</string> - </property> - <property name="whatsThis" > - <string>Number of character width of tabstops</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="1" column="0" colspan="3" > + <widget class="QCheckBox" name="KeywordUpper" > + <property name="toolTip" > + <string>Convert all keywords to uppercase when displayingsyntaxhighlighted text. Only available for monospaced fonts.</string> + </property> + <property name="text" > + <string>&Keyword upper</string> + </property> + </widget> </item> - <item rowspan="1" row="1" column="0" colspan="2" > - <widget class="toHighlightedText" name="Example" /> + <item row="2" column="0" colspan="3" > + <widget class="QCheckBox" name="CodeCompletion" > + <property name="toolTip" > + <string>Activate code completion in SQL editors. Not recommended on slow connections.</string> + </property> + <property name="text" > + <string>&Code completion</string> + </property> + </widget> </item> - <item row="0" column="0" > - <widget class="Q3GroupBox" name="GroupBox2" > - <property name="title" > - <string>Sy&ntax components</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="1" column="0" > - <widget class="QLabel" name="ExampleColor" > - <property name="text" > - <string/> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QPushButton" name="PushButton3" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>4</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property name="text" > - <string>&Pick</string> - </property> - </widget> - </item> - <item rowspan="1" row="0" column="0" colspan="2" > - <widget class="Q3ListBox" name="SyntaxComponent" /> - </item> - </layout> - </widget> + <item row="3" column="0" colspan="3" > + <widget class="QCheckBox" name="CompletionSort" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="toolTip" > + <string>Sort the available completion rows alphabetically or in the order the are.</string> + </property> + <property name="text" > + <string>&Sort completion rows</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>toHighlightedText</class> - <extends>QWidget</extends> - <header location="local" >tohighlightedtext.h</header> - <sizehint> - <width>100</width> - <height>100</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>5</hordata> - <verdata>5</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> - </customwidgets> - <tabstops> - <tabstop>SyntaxComponent</tabstop> - <tabstop>PushButton3</tabstop> - <tabstop>SyntaxHighlighting</tabstop> - <tabstop>KeywordUpper</tabstop> - <tabstop>CodeCompletion</tabstop> - <tabstop>AutoIndent</tabstop> - <tabstop>PushButton1_2_2</tabstop> - <tabstop>PushButton1_2</tabstop> - <tabstop>PushButton1</tabstop> - <tabstop>Extensions</tabstop> - <tabstop>TabStop</tabstop> - <tabstop>Example</tabstop> - <tabstop>CompletionSort</tabstop> - </tabstops> - <images> - <image name="image0" > - <data format="XPM.GZ" length="646" >789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> - </image> - </images> - <connections> - <connection> - <sender>PushButton1</sender> - <signal>clicked()</signal> - <receiver>toSyntaxSetupUI</receiver> - <slot>selectResultFont()</slot> - </connection> - <connection> - <sender>PushButton1_2</sender> - <signal>clicked()</signal> - <receiver>toSyntaxSetupUI</receiver> - <slot>selectFont()</slot> - </connection> - <connection> - <sender>SyntaxHighlighting</sender> - <signal>toggled(bool)</signal> - <receiver>toSyntaxSetupUI</receiver> - <slot>changeHighlight(bool)</slot> - </connection> - <connection> - <sender>KeywordUpper</sender> - <signal>toggled(bool)</signal> - <receiver>toSyntaxSetupUI</receiver> - <slot>changeUpper(bool)</slot> - </connection> - <connection> - <sender>PushButton3</sender> - <signal>clicked()</signal> - <receiver>toSyntaxSetupUI</receiver> - <slot>selectColor()</slot> - </connection> - <connection> - <sender>SyntaxComponent</sender> - <signal>selectionChanged(Q3ListBoxItem*)</signal> - <receiver>toSyntaxSetupUI</receiver> - <slot>changeLine(Q3ListBoxItem*)</slot> - </connection> - <connection> - <sender>CodeCompletion</sender> - <signal>toggled(bool)</signal> - <receiver>CompletionSort</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>SyntaxHighlighting</sender> - <signal>toggled(bool)</signal> - <receiver>CodeCompletion</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>PushButton1_2_2</sender> - <signal>clicked()</signal> - <receiver>toSyntaxSetupUI</receiver> - <slot>selectText()</slot> - </connection> - </connections> + <item row="0" column="0" colspan="3" > + <widget class="QCheckBox" name="SyntaxHighlighting" > + <property name="toolTip" > + <string>Enable syntax highlighting, or use simple text editor</string> + </property> + <property name="text" > + <string>S&yntax highlighting</string> + </property> + </widget> + </item> + <item row="4" column="0" colspan="3" > + <widget class="QCheckBox" name="AutoIndent" > + <property name="toolTip" > + <string>Indent a new line in an editor to the same column as the previous line</string> + </property> + <property name="text" > + <string>&Indent same as previous line</string> + </property> + </widget> + </item> + <item row="7" column="2" > + <widget class="QPushButton" name="PushButton1" > + <property name="text" > + <string>Choose</string> + </property> + </widget> + </item> + <item row="7" column="0" > + <widget class="QLabel" name="ResultExample" > + <property name="text" > + <string>List example</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="6" column="0" > + <widget class="QLabel" name="CodeExample" > + <property name="text" > + <string>Code example</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="6" column="2" > + <widget class="QPushButton" name="PushButton1_2" > + <property name="text" > + <string>Choose</string> + </property> + </widget> + </item> + <item row="5" column="2" > + <widget class="QPushButton" name="PushButton1_2_2" > + <property name="text" > + <string>Choose</string> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="TextExample" > + <property name="text" > + <string>Text example</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="8" column="1" colspan="2" > + <widget class="QLineEdit" name="Extensions" /> + </item> + <item row="8" column="0" > + <widget class="QLabel" name="TextLabel1" > + <property name="text" > + <string>Filename extensions</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="10" column="1" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="9" column="2" > + <widget class="QSpinBox" name="TabStop" > + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + <item row="9" column="0" colspan="2" > + <widget class="QLabel" name="TextLabel1_2" > + <property name="toolTip" > + <string>Number of character width of tabstops</string> + </property> + <property name="whatsThis" > + <string>Number of character width of tabstops</string> + </property> + <property name="text" > + <string>Tab stop width</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>TabStop</cstring> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0" colspan="2" > + <widget class="toHighlightedText" native="1" name="Example" /> + </item> + <item row="0" column="0" > + <widget class="QGroupBox" name="GroupBox2" > + <property name="title" > + <string>Sy&ntax components</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="1" column="0" > + <widget class="QLabel" name="ExampleColor" > + <property name="text" > + <string/> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QPushButton" name="PushButton3" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>&Pick</string> + </property> + </widget> + </item> + <item row="0" column="0" colspan="2" > + <widget class="QListWidget" name="SyntaxComponent" /> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>toHighlightedText</class> + <extends>QWidget</extends> + <header>tohighlightedtext.h</header> + </customwidget> + </customwidgets> + <tabstops> + <tabstop>SyntaxComponent</tabstop> + <tabstop>PushButton3</tabstop> + <tabstop>SyntaxHighlighting</tabstop> + <tabstop>KeywordUpper</tabstop> + <tabstop>CodeCompletion</tabstop> + <tabstop>AutoIndent</tabstop> + <tabstop>PushButton1_2_2</tabstop> + <tabstop>PushButton1_2</tabstop> + <tabstop>PushButton1</tabstop> + <tabstop>Extensions</tabstop> + <tabstop>TabStop</tabstop> + <tabstop>Example</tabstop> + <tabstop>CompletionSort</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>PushButton1</sender> + <signal>clicked()</signal> + <receiver>toSyntaxSetupUI</receiver> + <slot>selectResultFont()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>PushButton1_2</sender> + <signal>clicked()</signal> + <receiver>toSyntaxSetupUI</receiver> + <slot>selectFont()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>SyntaxHighlighting</sender> + <signal>toggled(bool)</signal> + <receiver>toSyntaxSetupUI</receiver> + <slot>changeHighlight(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>KeywordUpper</sender> + <signal>toggled(bool)</signal> + <receiver>toSyntaxSetupUI</receiver> + <slot>changeUpper(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>PushButton3</sender> + <signal>clicked()</signal> + <receiver>toSyntaxSetupUI</receiver> + <slot>selectColor()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>SyntaxComponent</sender> + <signal>itemClicked(QListWidgetItem*)</signal> + <receiver>toSyntaxSetupUI</receiver> + <slot>changeLine(QListWidgetItem*)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>CodeCompletion</sender> + <signal>toggled(bool)</signal> + <receiver>CompletionSort</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>SyntaxHighlighting</sender> + <signal>toggled(bool)</signal> + <receiver>CodeCompletion</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>PushButton1_2_2</sender> + <signal>clicked()</signal> + <receiver>toSyntaxSetupUI</receiver> + <slot>selectText()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> </ui> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-03 04:10:12
|
Revision: 2514 http://tora.svn.sourceforge.net/tora/?rev=2514&view=rev Author: mrjohnson0 Date: 2008-02-02 20:10:16 -0800 (Sat, 02 Feb 2008) Log Message: ----------- ported q3groupbox Modified Paths: -------------- trunk/tora/src/totableselect.cpp trunk/tora/src/totableselect.h Modified: trunk/tora/src/totableselect.cpp =================================================================== --- trunk/tora/src/totableselect.cpp 2008-02-03 04:01:32 UTC (rev 2513) +++ trunk/tora/src/totableselect.cpp 2008-02-03 04:10:16 UTC (rev 2514) @@ -5,11 +5,15 @@ #include "totableselect.h" #include <qlabel.h> +#include <QVBoxLayout> -void toTableSelect::setup() -{ +void toTableSelect::setup() { + QVBoxLayout *vbox = new QVBoxLayout; + vbox->setSpacing(0); + vbox->setContentsMargins(0, 0, 0, 0); + setLayout(vbox); + setTitle(tr("Table selection")); - setColumnLayout(1, Qt::Vertical); bool mysql = false; try { @@ -19,14 +23,21 @@ {} QLabel *label = new QLabel(mysql ? tr("Database") : tr("Schema"), this); label->show(); + vbox->addWidget(label); + Schema = new toResultCombo(this); Schema->show(); Schema->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + vbox->addWidget(Schema); + label = new QLabel(tr("Table"), this); label->show(); + vbox->addWidget(label); + Table = new toResultCombo(this); Table->show(); Table->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + vbox->addWidget(Table); Schema->additionalItem(mysql ? tr("Select database") : tr("Select schema")); Schema->query(toSQL::sql(toSQL::TOSQL_USERLIST)); @@ -42,7 +53,7 @@ } toTableSelect::toTableSelect(QWidget *parent, const char *name) - : Q3GroupBox(parent, name) + : QGroupBox(parent, name) { Schema = Table = NULL; QTimer::singleShot(1, this, SLOT(setup())); Modified: trunk/tora/src/totableselect.h =================================================================== --- trunk/tora/src/totableselect.h 2008-02-03 04:01:32 UTC (rev 2513) +++ trunk/tora/src/totableselect.h 2008-02-03 04:10:16 UTC (rev 2514) @@ -4,12 +4,12 @@ #include "config.h" #include "totool.h" -#include <q3groupbox.h> +#include <QGroupBox> class toConnection; class toResultCombo; -class toTableSelect : public Q3GroupBox +class toTableSelect : public QGroupBox { Q_OBJECT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-03 04:18:48
|
Revision: 2515 http://tora.svn.sourceforge.net/tora/?rev=2515&view=rev Author: mrjohnson0 Date: 2008-02-02 20:18:48 -0800 (Sat, 02 Feb 2008) Log Message: ----------- ported q3textview Modified Paths: -------------- trunk/tora/src/totemplate.cpp trunk/tora/src/totemplate.h Modified: trunk/tora/src/totemplate.cpp =================================================================== --- trunk/tora/src/totemplate.cpp 2008-02-03 04:10:16 UTC (rev 2514) +++ trunk/tora/src/totemplate.cpp 2008-02-03 04:18:48 UTC (rev 2515) @@ -46,21 +46,19 @@ #include "totemplate.h" #include "totool.h" -#include <q3filedialog.h> #include <qfileinfo.h> -#include <q3header.h> #include <qlabel.h> #include <qlineedit.h> #include <qmessagebox.h> #include <qpushbutton.h> #include <qsplitter.h> -#include <q3textview.h> #include <qtimer.h> #include <QToolBar> -//Added by qt3to4: + #include <QString> #include <QHideEvent> #include <QShowEvent> +#include <QTextEdit> #include "icons/totemplate.xpm" @@ -701,7 +699,7 @@ QWidget *toTemplateText::selectedWidget(QWidget *parent) { - QWidget *ret = new Q3TextView(Note, QString::null, parent); + QWidget *ret = new QTextEdit(Note, parent); if(parent->layout()) parent->layout()->addWidget(ret); return ret; @@ -710,7 +708,7 @@ void toTemplate::setWidget(QWidget *widget) { if (!widget) { - widget = new Q3TextView(frame()); + widget = new QTextEdit(frame()); frame()->layout()->addWidget(widget); } Modified: trunk/tora/src/totemplate.h =================================================================== --- trunk/tora/src/totemplate.h 2008-02-03 04:10:16 UTC (rev 2514) +++ trunk/tora/src/totemplate.h 2008-02-03 04:18:48 UTC (rev 2515) @@ -60,7 +60,6 @@ class toTreeWidget; class toTreeWidgetItem; class QSplitter; -class Q3TextView; class QToolBar; class toConnection; class toListView; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-03 05:03:00
|
Revision: 2517 http://tora.svn.sourceforge.net/tora/?rev=2517&view=rev Author: mrjohnson0 Date: 2008-02-02 21:03:03 -0800 (Sat, 02 Feb 2008) Log Message: ----------- ported q3gridlayout. did this the lazy man's way -- by not accounting for a second column. it's pretty much the same as a vboxlayout. i like it better though... Modified Paths: -------------- trunk/tora/src/totuning.cpp trunk/tora/src/totuning.h Modified: trunk/tora/src/totuning.cpp =================================================================== --- trunk/tora/src/totuning.cpp 2008-02-03 04:20:22 UTC (rev 2516) +++ trunk/tora/src/totuning.cpp 2008-02-03 05:03:03 UTC (rev 2517) @@ -59,8 +59,6 @@ #include <stdio.h> #include <qcombobox.h> -#include <q3grid.h> -#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qmenubar.h> @@ -78,6 +76,7 @@ #include <QString> #include <QAction> #include <QVBoxLayout> +#include <QGridLayout> #include "icons/refresh.xpm" #include "icons/totuning.xpm" @@ -1557,16 +1556,23 @@ parts.append(parts[2]); parts[2] = QString::fromLatin1("Charts"); } - std::map<QString, Q3Grid *>::iterator j = Charts.find(QString(CONF_CHART) + parts[2].latin1()); - Q3Grid *cchart; - if (j == Charts.end()) - Charts[QString(CONF_CHART) + parts[2].latin1()] = cchart = new Q3Grid(2, Tabs, QString(CONF_CHART) + parts[2].latin1()); + std::map<QString, QWidget *>::iterator j = Charts.find(QString(CONF_CHART) + parts[2].latin1()); + QWidget *cchart; + if (j == Charts.end()) { + cchart = new QWidget(Tabs); + cchart->setObjectName(QString(CONF_CHART) + parts[2]); + cchart->setLayout(new QGridLayout); + Charts[QString(CONF_CHART) + parts[2].latin1()] = cchart; + } else cchart = (*j).second; + QGridLayout *grid = dynamic_cast<QGridLayout *>(cchart->layout()); + if (parts[3].mid(1, 1) == QString::fromLatin1("B")) { toResultBar *chart = new toResultBar(cchart); + grid->addWidget(chart); chart->setTitle(parts[3].mid(3)); toQList par; if (parts[3].mid(2, 1) == QString::fromLatin1("B")) @@ -1593,6 +1599,7 @@ chart = new toTuningMiss(cchart); else chart = new toResultLine(cchart); + grid->addWidget(chart); chart->setTitle(parts[3].mid(3)); toQList par; if (parts[3].mid(2, 1) == QString::fromLatin1("B")) @@ -1617,6 +1624,7 @@ { toResultPie *chart = new toResultPie(cchart); chart->setTitle(parts[3].mid(3)); + grid->addWidget(chart); if (parts[3].mid(2, 1) == QString::fromLatin1("S")) { chart->query(toSQL::sql(*i), unit); @@ -1630,7 +1638,7 @@ } } - for (std::map<QString, Q3Grid *>::iterator k = Charts.begin(); + for (std::map<QString, QWidget *>::iterator k = Charts.begin(); k != Charts.end(); k++) Tabs->addTab((*k).second, tr((*k).first.mid(strlen(CONF_CHART)))); @@ -1752,7 +1760,7 @@ } else if (Charts.find(QString(CONF_CHART) + name) != Charts.end()) { - Q3Grid *chart = Charts[QString(CONF_CHART) + name]; + QWidget *chart = Charts[QString(CONF_CHART) + name]; QObjectList childs = chart->children(); for (int i = 0;i < childs.count();i++) { @@ -1963,9 +1971,6 @@ h->setSpacing(0); h->setContentsMargins(0, 0, 0, 0); -// setAutoFillBackground(true); -// setPalette(QPalette(Qt::red)); - QScrollArea *sa = new QScrollArea(this); h->addWidget(sa); setLayout(h); @@ -1983,11 +1988,16 @@ vbox->addWidget(combo); connect(combo, SIGNAL(activated(int)), this, SLOT(changeCharts(int))); - FileReads = new Q3Grid(2, Box); - FileTime = new Q3Grid(2, Box); - TablespaceReads = new Q3Grid(2, Box); - TablespaceTime = new Q3Grid(2, Box); + FileReads = new QWidget(Box); + FileTime = new QWidget(Box); + TablespaceReads = new QWidget(Box); + TablespaceTime = new QWidget(Box); + FileReads->setLayout(new QGridLayout); + FileTime->setLayout(new QGridLayout); + TablespaceReads->setLayout(new QGridLayout); + TablespaceTime->setLayout(new QGridLayout); + vbox->addWidget(FileReads); vbox->addWidget(FileTime); vbox->addWidget(TablespaceReads); @@ -2048,10 +2058,14 @@ labelTime.insert(labelTime.end(), tr("Maximum Write")); toResultBar *barchart; - if (name.startsWith(QString::fromLatin1("tspc:"))) + if (name.startsWith(QString::fromLatin1("tspc:"))) { barchart = new toResultBar(TablespaceReads); - else + TablespaceReads->layout()->addWidget(barchart); + } + else { barchart = new toResultBar(FileReads); + FileReads->layout()->addWidget(barchart); + } ReadsCharts[name] = barchart; barchart->setTitle(name.mid(5)); barchart->setMinimumSize(200, 170); @@ -2061,10 +2075,14 @@ barchart->show(); toResultLine *linechart; - if (name.startsWith(QString::fromLatin1("tspc:"))) + if (name.startsWith(QString::fromLatin1("tspc:"))) { linechart = new toResultLine(TablespaceTime); - else + TablespaceTime->layout()->addWidget(linechart); + } + else { linechart = new toResultLine(FileTime); + FileTime->layout()->addWidget(linechart); + } TimeCharts[name] = linechart; linechart->setTitle(name.mid(5)); linechart->setMinimumSize(200, 170); Modified: trunk/tora/src/totuning.h =================================================================== --- trunk/tora/src/totuning.h 2008-02-03 04:20:22 UTC (rev 2516) +++ trunk/tora/src/totuning.h 2008-02-03 05:03:03 UTC (rev 2517) @@ -56,7 +56,7 @@ class QAction; class QMenu; class QComboBox; -class Q3Grid; +class QWidget; class QLabel; class QTabWidget; class toBarChart; @@ -81,10 +81,10 @@ { Q_OBJECT - Q3Grid *TablespaceTime; - Q3Grid *TablespaceReads; - Q3Grid *FileTime; - Q3Grid *FileReads; + QWidget *TablespaceTime; + QWidget *TablespaceReads; + QWidget *FileTime; + QWidget *FileReads; QString LastTablespace; double TblReads; @@ -179,7 +179,7 @@ toResultTableView *ControlFiles; toWaitEvents *Waits; - std::map<QString, Q3Grid *> Charts; + std::map<QString, QWidget *> Charts; QComboBox *Refresh; toTuningOverview *Overview; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <su...@us...> - 2008-02-04 16:37:49
|
Revision: 2522 http://tora.svn.sourceforge.net/tora/?rev=2522&view=rev Author: subik Date: 2008-02-04 08:37:41 -0800 (Mon, 04 Feb 2008) Log Message: ----------- qt4 port Modified Paths: -------------- trunk/tora/src/toscript.h trunk/tora/src/totextview.cpp trunk/tora/src/totextview.h Modified: trunk/tora/src/toscript.h =================================================================== --- trunk/tora/src/toscript.h 2008-02-03 20:03:16 UTC (rev 2521) +++ trunk/tora/src/toscript.h 2008-02-04 16:37:41 UTC (rev 2522) @@ -45,7 +45,7 @@ #include <list> #include <algorithm> -class Q3TextView; +class QTextBrowser; class toConnection; class toExtract; class toListView; @@ -60,7 +60,7 @@ toListView *DropList; toListView *CreateList; toListView *SearchList; - Q3TextView *Report; + QTextBrowser *Report; void setupExtract(toExtract &); void changeConnection(int, bool source); Modified: trunk/tora/src/totextview.cpp =================================================================== --- trunk/tora/src/totextview.cpp 2008-02-03 20:03:16 UTC (rev 2521) +++ trunk/tora/src/totextview.cpp 2008-02-04 16:37:41 UTC (rev 2522) @@ -34,11 +34,12 @@ * All trademarks belong to their respective owners. * *****/ +#include <QFocusEvent> #include "utils.h" - #include "totextview.h" + bool toTextView::editSave(bool) { QString fn = toSaveFilename(QString::null, QString::fromLatin1("*.html"), this); @@ -51,3 +52,18 @@ return false; } +void toTextView::editCopy(void) +{ + copy(); +} + +void toTextView::editSelectAll(void) +{ + selectAll(); +} + +void toTextView::focusInEvent (QFocusEvent *e) +{ + receivedFocus(); + QTextBrowser::focusInEvent(e); +} Modified: trunk/tora/src/totextview.h =================================================================== --- trunk/tora/src/totextview.h 2008-02-03 20:03:16 UTC (rev 2521) +++ trunk/tora/src/totextview.h 2008-02-04 16:37:41 UTC (rev 2522) @@ -42,20 +42,19 @@ #include "toeditwidget.h" -#include <q3textview.h> -//Added by qt3to4: -#include <QFocusEvent> +#include <QTextBrowser> + /** A tora editwidget version of the @ref QTextView widget. */ -class toTextView : public Q3TextView, public toEditWidget +class toTextView : public QTextBrowser, public toEditWidget { public: /** See @ref QTextView */ toTextView(QWidget *parent = 0, const char *name = 0) - : Q3TextView(parent, name) + : QTextBrowser(parent)//, name) , toEditWidget(false, true, false, false, false, false, true, false, @@ -63,36 +62,26 @@ { } /** See @ref QTextView */ - toTextView(const QString&text, const QString &context = QString::null, - QWidget *parent = 0, const char *name = 0) - : Q3TextView(text, context, parent, name) - , toEditWidget(false, true, false, - false, false, - false, true, false, - false, true, false) - { } +// toTextView(const QString&text, const QString &context = QString::null, +// QWidget *parent = 0, const char *name = 0) +// : Q3TextView(text, context, parent, name) +// , toEditWidget(false, true, false, +// false, false, +// false, true, false, +// false, true, false) +// { } /** Reimplemented for internal reasons. */ - virtual void editCopy(void) - { - copy(); - } + virtual void editCopy(void); /** Reimplemented for internal reasons. */ - virtual void editSelectAll(void) - { - selectAll(); - } + virtual void editSelectAll(void); /** Reimplemented for internal reasons. */ virtual bool editSave(bool); /** Reimplemented for internal reasons. */ - virtual void focusInEvent (QFocusEvent *e) - { - receivedFocus(); - Q3TextView::focusInEvent(e); - } + virtual void focusInEvent (QFocusEvent *e); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-07 04:31:35
|
Revision: 2527 http://tora.svn.sourceforge.net/tora/?rev=2527&view=rev Author: mrjohnson0 Date: 2008-02-06 20:31:40 -0800 (Wed, 06 Feb 2008) Log Message: ----------- removing qt3support Modified Paths: -------------- trunk/tora/src/tooracleconnection.cpp trunk/tora/src/tooracleextract.cpp Modified: trunk/tora/src/tooracleconnection.cpp =================================================================== --- trunk/tora/src/tooracleconnection.cpp 2008-02-07 04:26:34 UTC (rev 2526) +++ trunk/tora/src/tooracleconnection.cpp 2008-02-07 04:31:40 UTC (rev 2527) @@ -75,6 +75,7 @@ #include <qvalidator.h> #include <QString> +#include <QTextStream> #define CONF_OPEN_CURSORS "OpenCursors" #define DEFAULT_OPEN_CURSORS "40" // Defined to be able to update tuning view @@ -578,7 +579,7 @@ description[i].prec, description[i].scale); } - desc.Datatype.sprintf(desc.Datatype, datatypearg1, datatypearg2); + desc.Datatype.sprintf(desc.Datatype.toAscii().constData(), datatypearg1, datatypearg2); desc.Null = description[i].nullok; @@ -593,13 +594,13 @@ QString connectString(void) { QString ret; - ret = connection().user().utf8(); + ret = connection().user().toUtf8(); ret += QString::fromLatin1("/"); - ret += connection().password().utf8(); + ret += connection().password().toUtf8(); if (!connection().host().isEmpty()) { ret += QString::fromLatin1("@"); - ret += connection().database().utf8(); + ret += connection().database().toUtf8(); } return ret; } @@ -624,19 +625,19 @@ bool ok = true; for (int i = 0;i < name.length();i++) { - if (name.at(i).upper() != name.at(i) || !toIsIdent(name.at(i))) + if (name.at(i).toUpper() != name.at(i) || !toIsIdent(name.at(i))) ok = false; } if (ok) - return name.lower(); + return name.toLower(); else return QString::fromLatin1("\"") + name + QString::fromLatin1("\""); } virtual QString unQuote(const QString &str) { - if (str.at(0).latin1() == '\"' && str.at(str.length() - 1).latin1() == '\"') + if (str.at(0).toLatin1() == '\"' && str.at(str.length() - 1).toLatin1() == '\"') return str.left(str.length() - 1).right(str.length() - 2); - return str.upper(); + return str.toUpper(); } virtual std::list<toConnection::objectName> objectNames(void) @@ -665,7 +666,7 @@ toConnection::objectName cur; cur.Type = QString::fromLatin1("A"); std::list<toQValue> par; - par.insert(par.end(), toQValue(connection().user().upper())); + par.insert(par.end(), toQValue(connection().user().toUpper())); toQuery synonyms(connection(), toQuery::Long, SQLListSynonyms, par); std::list<toConnection::objectName>::iterator i = objects.begin(); @@ -843,13 +844,13 @@ { char buffer[1024]; version >> buffer; - QStringList vl = QStringList::split('.', QString::fromUtf8(buffer)); + QStringList vl = QString(buffer).split('.'); QString ve; QString verrj; for ( QStringList::iterator vi = vl.begin(); vi != vl.end(); ++vi ) { ve = *vi; - verrj += ve.rightJustify(2, '0'); + verrj += ve.rightJustified(2, '0'); } return verrj.toUtf8(); // FIXME! } @@ -874,7 +875,7 @@ { try { - otl_cursor::direct_exec(*(conn->Connection), sql); + otl_cursor::direct_exec(*(conn->Connection), sql.toAscii().constData()); } catch (const otl_exception &exc) { @@ -882,7 +883,7 @@ } } else - toQuery query(connection(), QString::fromUtf8(sql), params); + toQuery query(connection(), sql, params); } virtual void parse(toConnectionSub *sub, const QString &sql) @@ -891,7 +892,7 @@ try { conn->Connection->reset_throw_count(); - conn->Connection->syntax_check(sql); + conn->Connection->syntax_check(sql.toAscii().constData()); } catch (const otl_exception &exc) @@ -909,7 +910,7 @@ virtual void initialize(void) { toMaxLong = toConfigurationSingle::Instance().globalConfig(CONF_MAX_LONG, - QString::number(DEFAULT_MAX_LONG).latin1()).toInt(); + QString::number(DEFAULT_MAX_LONG).toLatin1()).toInt(); if (otl_connect::otl_initialize(1)) addProvider("Oracle"); else @@ -1011,26 +1012,19 @@ if (!file.open(QIODevice::ReadOnly)) return ret; - int size = file.size(); + QTextStream in(&file); + QByteArray barray = in.readAll().toUtf8(); + const char *buf = barray.constData(); - char *buf = new char[size + 1]; - if (file.readBlock(buf, size) == -1) - { - delete[] buf; - return ret; - } - - buf[size] = 0; - int begname = -1; int parambeg = -1; int pos = 0; int param = 0; - while (pos < size) + while (pos < barray.size()) { if (buf[pos] == '#') { - while (pos < size && buf[pos] != '\n') + while (pos < barray.size() && buf[pos] != '\n') pos++; } else if (buf[pos] == '=') @@ -1053,7 +1047,7 @@ { QString tmp = QString::fromLatin1(buf + parambeg, pos - parambeg); tmp.replace(QRegExp(QString::fromLatin1("\\s+")), QString::null); - if (tmp.lower().startsWith(QString::fromLatin1("sid="))) + if (tmp.toLower().startsWith(QString::fromLatin1("sid="))) ret.insert(ret.end(), tmp.mid(4)); } begname = -1; @@ -1066,7 +1060,6 @@ } pos++; } - delete[] buf; return ret; } virtual QWidget *providerConfigurationTab(const QString &provider, QWidget *parent); @@ -1108,7 +1101,7 @@ QString sql = query()->sql(); sql.replace(stripnl, ""); Query->open(1, - sql, + sql.toAscii().constData(), *(conn->Connection)); } catch (...) @@ -1163,13 +1156,13 @@ case otl_var_clob: { QString buf = (*i).utf8(); - otl_long_string str(buf, buf.length(), buf.length()); + otl_long_string str(buf.toAscii().constData(), buf.length(), buf.length()); (*Query) << str; } break; default: // FIXME! quick hack for Qt4 - PV - (*Query) << (const char*)(*i).utf8(); + (*Query) << (const char *) (*i).utf8().constData(); break; } } @@ -1221,7 +1214,7 @@ if (!sqlNet) { oldSid = getenv("ORACLE_SID"); - toSetEnv("ORACLE_SID", connection().database().utf8()); + toSetEnv("ORACLE_SID", connection().database().toUtf8()); } otl_connect *conn = NULL; try @@ -1243,12 +1236,15 @@ if (!sqlNet) conn->server_attach(); else - conn->server_attach(connection().database().utf8()); - QString user = connection().user().utf8(); - QString pass = connection().password().utf8(); + conn->server_attach(connection().database().toUtf8()); + QString user = connection().user().toUtf8(); + QString pass = connection().password().toUtf8(); try { - conn->session_begin(user.isEmpty() ? "" : (const char *)user, pass.isEmpty() ? "" : (const char *)pass, 0, session_mode); + conn->session_begin(user.isEmpty() ? "" : user.toAscii().constData(), + pass.isEmpty() ? "" : pass.toAscii().constData(), + 0, + session_mode); } catch (const otl_exception &exc) { @@ -1256,29 +1252,29 @@ { bool ok = false; QString newpass = QInputDialog::getText( - qApp->translate("toOracleConnection", "Password expired"), - qApp->translate("toOracleConnection", "Enter new password"), - QLineEdit::Password, - QString::null, - &ok, - toMainWidget()); + toMainWidget(), + qApp->translate("toOracleConnection", "Password expired"), + qApp->translate("toOracleConnection", "Enter new password"), + QLineEdit::Password, + QString::null, + &ok); if (ok) { QString newpass2 = QInputDialog::getText( - qApp->translate("toOracleConnection", "Password expired"), - qApp->translate("toOracleConnection", "Enter password again for confirmation"), - QLineEdit::Password, - QString::null, - &ok, - toMainWidget()); + toMainWidget(), + qApp->translate("toOracleConnection", "Password expired"), + qApp->translate("toOracleConnection", "Enter password again for confirmation"), + QLineEdit::Password, + QString::null, + &ok); if (ok) { if (newpass2 != newpass) throw qApp->translate("toOracleConnection", "The two passwords doesn't match"); - QString nputf = newpass.utf8(); - conn->change_password(user.isEmpty() ? "" : (const char *)user, - pass.isEmpty() ? "" : (const char *)pass, - newpass.isEmpty() ? "" : (const char *)nputf); + QString nputf = newpass.toUtf8(); + conn->change_password(user.isEmpty() ? "" : user.toAscii().constData(), + pass.isEmpty() ? "" : pass.toAscii().constData(), + newpass.isEmpty() ? "" : nputf.toAscii().constData()); connection().setPassword(newpass); delete conn; conn = NULL; @@ -1304,7 +1300,7 @@ if (oldSid.isNull()) toUnSetEnv("ORACLE_SID"); else - toSetEnv("ORACLE_SID", oldSid.latin1()); + toSetEnv("ORACLE_SID", oldSid.toLatin1()); } delete conn; ThrowException(exc); @@ -1315,7 +1311,7 @@ toUnSetEnv("ORACLE_SID"); else { - toSetEnv("ORACLE_SID", oldSid.latin1()); + toSetEnv("ORACLE_SID", oldSid.toLatin1()); } } @@ -1325,7 +1321,7 @@ QString str = QString::fromLatin1("ALTER SESSION SET NLS_DATE_FORMAT = '"); str += toConfigurationSingle::Instance().globalConfig(CONF_DATE_FORMAT, DEFAULT_DATE_FORMAT); str += QString::fromLatin1("'"); - otl_stream date(1, str.utf8(), *conn); + otl_stream date(1, str.toUtf8(), *conn); } { otl_stream info(1, @@ -1404,7 +1400,7 @@ DEFAULT_OPEN_CURSORS).toInt()); KeepPlans->setChecked(!toConfigurationSingle::Instance().globalConfig(CONF_KEEP_PLANS, "").isEmpty()); int len = toConfigurationSingle::Instance().globalConfig(CONF_MAX_LONG, - QString::number(DEFAULT_MAX_LONG).latin1()).toInt(); + QString::number(DEFAULT_MAX_LONG).toLatin1()).toInt(); if (len >= 0) { MaxLong->setText(QString::number(len)); Modified: trunk/tora/src/tooracleextract.cpp =================================================================== --- trunk/tora/src/tooracleextract.cpp 2008-02-07 04:26:34 UTC (rev 2526) +++ trunk/tora/src/tooracleextract.cpp 2008-02-07 04:31:40 UTC (rev 2527) @@ -368,7 +368,7 @@ QString re("^\\s*"); re += type; re += "\\s+"; - QRegExp StripType(re, false); + QRegExp StripType(re, Qt::CaseInsensitive); toQuery inf(CONNECTION, SQLDisplaySource, type, name, owner); if (inf.eof()) @@ -813,9 +813,9 @@ QString pre_obj = toShift(resultset); QString pre_attr = toShift(resultset); QString pre_val = toShift(resultset); - QString pre_val1 = pre_val.left(pre_val.find(':', 0, false)); + QString pre_val1 = pre_val.left(pre_val.indexOf(':', 0, Qt::CaseInsensitive)); pre_val = pre_val.right(pre_val.length() - pre_val1.length() - 1); - QString pre_val2 = pre_val.left(pre_val.find(':', 0, false)); + QString pre_val2 = pre_val.left(pre_val.indexOf(':', 0, Qt::CaseInsensitive)); QString pre_val4 = pre_val.right(1); if (pre_val4 == "Y") pre_val4 = "TRUE"; @@ -1251,7 +1251,7 @@ bool done = false; QString initial = createIndex(ext, schema, owner, name); - QStringList linesIn = QStringList::split("\n", initial, true); + QStringList linesIn = initial.split("\n"); QString ret; for (QStringList::Iterator i = linesIn.begin();i != linesIn.end() && !done;i++) @@ -1382,7 +1382,7 @@ bool done = false; QString initial = createTable(ext, schema, owner, name); - QStringList linesIn = QStringList::split("\n", initial, true); + QStringList linesIn = initial.split("\n"); QString ret; for (QStringList::Iterator i = linesIn.begin();i != linesIn.end() && !done;i++) @@ -2311,7 +2311,7 @@ toQList result = toQuery::readQueryNull(CONNECTION, SQLSystemPrivs, name); while (!result.empty()) { - QString priv = QString(toShift(result)).lower(); + QString priv = QString(toShift(result)).toLower(); QString sql = QString("GRANT %1 TO %2 %3"). arg(priv). arg(dest). @@ -2332,7 +2332,7 @@ toQList result = toQuery::readQueryNull(CONNECTION, SQLRolePrivs, name); while (!result.empty()) { - QString priv = QString(toShift(result)).lower(); + QString priv = QString(toShift(result)).toLower(); QString sql = QString("GRANT %1 TO %2 %3"). arg(priv). arg(dest). @@ -2353,11 +2353,11 @@ toQList result = toQuery::readQueryNull(CONNECTION, SQLObjectPrivs, name); while (!result.empty()) { - QString priv = QString(toShift(result)).lower(); + QString priv = QString(toShift(result)).toLower(); QString schema = ext.intSchema(toShift(result), false); QString object = QUOTE(toShift(result)); QString sql = QString("GRANT %1 ON %2%3 TO %4 %5"). - arg(priv.lower()). + arg(priv.toLower()). arg(schema). arg(object). arg(dest). @@ -2412,7 +2412,7 @@ const QString &name) const { static QRegExp quote("\""); - static QRegExp func("^sys_nc[0-9]+", false); + static QRegExp func("^sys_nc[0-9]+", Qt::CaseInsensitive); toQuery inf(CONNECTION, SQLIndexColumns, name, owner); QString ret = indent; ret += "(\n"; @@ -2987,7 +2987,7 @@ first = false; else ret += "\n , "; - ret += QString(QUOTE(toShift(cols))).leftJustify(32); + ret += QString(QUOTE(toShift(cols))).leftJustified(32); ret += " "; ret += toShift(cols); QString def = toShift(cols); @@ -2995,7 +2995,7 @@ if (!def.isEmpty()) { ret += "DEFAULT "; - ret += def.stripWhiteSpace(); + ret += def.trimmed(); ret += " "; } ret += notNull; @@ -3130,7 +3130,7 @@ result = toQuery::readQueryNull(CONNECTION, SQLSystemPrivs, name); while (!result.empty()) { - QString priv = QString(toShift(result)).lower(); + QString priv = QString(toShift(result)).toLower(); addDescription(lst, ctx, "GRANT", priv, toShift(result)); } @@ -3141,7 +3141,7 @@ QString schema = ext.intSchema(toShift(result), false); QString res = schema; res += QUOTE(toShift(result)); - addDescription(lst, ctx, "GRANT", priv.lower(), "ON", res, toShift(result)); + addDescription(lst, ctx, "GRANT", priv.toLower(), "ON", res, toShift(result)); } } @@ -3253,7 +3253,7 @@ static QString ReContext(std::list<QString> &ctx, int strip, const QString &str) { - QStringList lst = QStringList::split("\01", str); + QStringList lst = str.split("\01"); QString ret; QString sep = ""; for (std::list<QString>::iterator i = ctx.begin();i != ctx.end();i++) @@ -3840,8 +3840,8 @@ } ret += sql; ret += QString("\nCONNECT TO %1 IDENTIFIED BY %2 USING '%3';\n\n"). - arg(user.lower()). - arg(password.lower()). + arg(user.toLower()). + arg(password.toLower()). arg(prepareDB(host)); return ret; } @@ -3922,7 +3922,7 @@ const QString &owner, const QString &name) const { - QStringList str = QStringList::split(":", name); + QStringList str = name.split(":"); if (str.count() != 2) throw ("When calling createExchangeIndex name should contain :"); QString segment = str.first(); @@ -4026,7 +4026,7 @@ const QString &owner, const QString &name) const { - QStringList str = QStringList::split(":", name); + QStringList str = name.split(":"); if (str.count() != 2) throw ("When calling createExchangeTable name should contain :"); QString segment = str.first(); @@ -5453,24 +5453,24 @@ QString status = toShift(result); QString trgType; - if (triggerType.find("BEFORE") >= 0) + if (triggerType.indexOf("BEFORE") >= 0) trgType = "BEFORE"; - else if (triggerType.find("AFTER") >= 0) + else if (triggerType.indexOf("AFTER") >= 0) trgType = "AFTER"; - else if (triggerType.find("INSTEAD OF") >= 0) + else if (triggerType.indexOf("INSTEAD OF") >= 0) trgType = "INSTEAD OF"; QString trgPart = trgType + " " + event; - QRegExp src("\\s" + trgPart + "\\s", false); + QRegExp src("\\s" + trgPart + "\\s", Qt::CaseInsensitive); description.replace(QRegExp("\nON"), QString("\n ON")); - int pos = description.find(src); + int pos = description.indexOf(src); //QString columns=description; QString columns; if (pos >= 0) { pos += trgPart.length() + 2; - int endPos = description.find(" ON ", pos, false); + int endPos = description.indexOf(" ON ", pos); if (endPos >= 0) { columns = description.right(description.length() - pos); @@ -5503,12 +5503,12 @@ } ret += sql; ret += QString("%1 %2 %3 ON %4\n").arg(trgType).arg(event).arg(columns).arg(object); - if (baseType.find("TABLE") >= 0 || baseType.find("VIEW") >= 0) + if (baseType.indexOf("TABLE") >= 0 || baseType.indexOf("VIEW") >= 0) { ret += refNames; ret += "\n"; } - if (triggerType.find("EACH ROW") >= 0) + if (triggerType.indexOf("EACH ROW") >= 0) ret += "FOR EACH ROW\n"; if (!when.isEmpty()) { @@ -5586,7 +5586,7 @@ QString ret; QString nam; if (ext.getSchema() != "1" && !ext.getSchema().isEmpty()) - nam = ext.getSchema().lower(); + nam = ext.getSchema().toLower(); else nam = QUOTE(name); if (PROMPT) @@ -5724,7 +5724,7 @@ else { ret += " "; - ret += constraintColumns(ext, owner, name).simplifyWhiteSpace(); + ret += constraintColumns(ext, owner, name).simplified(); if (tchr == "R") { @@ -5778,8 +5778,8 @@ ctx.insert(ctx.end(), QUOTE(name)); addDescription(lst, ctx, publ, QString("%1 IDENTIFIED BY %2 USING '%3'"). - arg(user.lower()). - arg(password.lower()). + arg(user.toLower()). + arg(password.toLower()). arg(prepareDB(host))); } @@ -5789,7 +5789,7 @@ const QString &owner, const QString &name) const { - QStringList str = QStringList::split(":", name); + QStringList str = name.split(":"); if (str.count() != 2) throw ("When calling createExchangeIndex name should contain :"); QString segment = str.first(); @@ -5836,7 +5836,7 @@ const QString &owner, const QString &name) const { - QStringList str = QStringList::split(":", name); + QStringList str = name.split(":"); if (str.count() != 2) throw ("When calling createExchangeTable name should contain :"); QString segment = str.first(); @@ -6335,23 +6335,23 @@ QString status = toShift(result); QString trgType; - if (triggerType.find("BEFORE") >= 0) + if (triggerType.indexOf("BEFORE") >= 0) trgType = "BEFORE"; - else if (triggerType.find("AFTER") >= 0) + else if (triggerType.indexOf("AFTER") >= 0) trgType = "AFTER"; - else if (triggerType.find("INSTEAD OF") >= 0) + else if (triggerType.indexOf("INSTEAD OF") >= 0) trgType = "INSTEAD OF"; QString src = trgType; src += " "; src += event; description.replace(QRegExp("\nON"), QString("\n ON")); - int pos = description.find(src); + int pos = description.indexOf(src); QString columns; if (pos >= 0) { pos += src.length(); - int endPos = description.find(" ON ", pos, false); + int endPos = description.indexOf(" ON ", pos); if (endPos >= 0) { columns = description.right(description.length() - pos); @@ -6434,7 +6434,7 @@ ctx.insert(ctx.end(), "USER"); QString nam; if (ext.getSchema() != "1" && !ext.getSchema().isEmpty()) - nam = ext.getSchema().lower(); + nam = ext.getSchema().toLower(); else nam = QUOTE(name); ctx.insert(ctx.end(), nam); @@ -8037,7 +8037,7 @@ catch (...) { DbaSegments = QString("(select '%1' owner,user_segments.* from sys.user_segments)"). - arg(CONNECTION.user().upper()); + arg(CONNECTION.user().toUpper()); } ext.setState("Segments", DbaSegments); @@ -8122,7 +8122,7 @@ { QString nam; if (ext.getSchema() != "1" && !ext.getSchema().isEmpty()) - nam = ext.getSchema().lower(); + nam = ext.getSchema().toLower(); else nam = QUOTE(name); stream << grantedPrivs(ext, nam, name, 4); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-07 05:00:49
|
Revision: 2528 http://tora.svn.sourceforge.net/tora/?rev=2528&view=rev Author: mrjohnson0 Date: 2008-02-06 21:00:54 -0800 (Wed, 06 Feb 2008) Log Message: ----------- removing qt3support Modified Paths: -------------- trunk/tora/src/tomain.cpp trunk/tora/src/utils.cpp trunk/tora/src/utils.h Modified: trunk/tora/src/tomain.cpp =================================================================== --- trunk/tora/src/tomain.cpp 2008-02-07 04:31:40 UTC (rev 2527) +++ trunk/tora/src/tomain.cpp 2008-02-07 05:00:54 UTC (rev 2528) @@ -1648,3 +1648,13 @@ return BackgroundLabel; } +toMain* toMainWidget() { + QWidgetList widgets = qApp->topLevelWidgets(); + for(QWidgetList::iterator it = widgets.begin(); it != widgets.end(); it++) { + toMain *main = dynamic_cast<toMain *>((*it)); + if(main) + return main; + } + + return NULL; +} Modified: trunk/tora/src/utils.cpp =================================================================== --- trunk/tora/src/utils.cpp 2008-02-07 04:31:40 UTC (rev 2527) +++ trunk/tora/src/utils.cpp 2008-02-07 05:00:54 UTC (rev 2528) @@ -53,7 +53,6 @@ #include <qcombobox.h> #include <qcursor.h> #include <qfile.h> -#include <q3filedialog.h> #include <qlabel.h> #include <qlayout.h> #include <totreewidget.h> @@ -72,6 +71,7 @@ #include <QColor> #include <QFileDialog> #include <QDockWidget> +#include <QTextStream> #ifdef Q_OS_WIN32 # include "windows.h" @@ -170,7 +170,7 @@ for (int i = 0;i < sql.length();i++) { QChar rc = sql.at(i); - char c = rc.latin1(); + char c = rc.toLatin1(); if (inString) { if (c == inString) @@ -196,7 +196,7 @@ for (i++;i < sql.length();i++) { rc = sql.at(i); - c = rc.latin1(); + c = rc.toLatin1(); if (!rc.isLetterOrNumber()) break; ret += rc; @@ -207,7 +207,7 @@ for (i++;i < sql.length();i++) { rc = sql.at(i); - c = rc.latin1(); + c = rc.toLatin1(); ret += QString::fromLatin1(" "); if (c == '>') { @@ -232,10 +232,10 @@ char inString = 0; for (int i = 0;i < sql.length();i++) { QChar rc = sql.at(i); - char c = rc.latin1(); // current + char c = rc.toLatin1(); // current char n = 0; // next if(i + 1 < sql.length()) - n = sql.at(i + 1).latin1(); + n = sql.at(i + 1).toLatin1(); if (inString) { @@ -270,7 +270,7 @@ for (i++;i < sql.length();i++) { rc = sql.at(i); - c = rc.latin1(); + c = rc.toLatin1(); if (!rc.isLetterOrNumber()) break; } @@ -279,7 +279,7 @@ for (i++;i < sql.length();i++) { rc = sql.at(i); - c = rc.latin1(); + c = rc.toLatin1(); if (c == '>') { i++; @@ -329,16 +329,16 @@ // } // #endif - toMain *main = dynamic_cast<toMain *>(qApp->mainWidget()); + toMain *main = toMainWidget(); if (main) { if (!str.isEmpty()) { int sec = toConfigurationSingle::Instance().globalConfig(CONF_STATUS_MESSAGE, DEFAULT_STATUS_MESSAGE).toInt(); if (save || sec == 0) - main->statusBar()->message(str.simplifyWhiteSpace()); + main->statusBar()->showMessage(str.simplified()); else - main->statusBar()->message(str.simplifyWhiteSpace(), sec*1000); + main->statusBar()->showMessage(str.simplified(), sec*1000); if (!save && log) { if (toConfigurationSingle::Instance().globalConfig(CONF_MESSAGE_STATUSBAR, "").isEmpty()) @@ -359,48 +359,46 @@ return LastMessages; } -toMain *toMainWidget(void) -{ - return dynamic_cast<toMain *>(qApp->mainWidget()); -} - QComboBox *toRefreshCreate(QWidget *parent, const char *name, const QString &def, QComboBox *item) { QComboBox *refresh; if (item) refresh = item; - else - refresh = new QComboBox(false, parent, name); + else { + refresh = new QComboBox(parent); + refresh->setObjectName(name); + refresh->setEditable(false); + } - refresh->insertItem(qApp->translate("toRefreshCreate", "None")); - refresh->insertItem(qApp->translate("toRefreshCreate", "2 seconds")); - refresh->insertItem(qApp->translate("toRefreshCreate", "5 seconds")); - refresh->insertItem(qApp->translate("toRefreshCreate", "10 seconds")); - refresh->insertItem(qApp->translate("toRefreshCreate", "30 seconds")); - refresh->insertItem(qApp->translate("toRefreshCreate", "1 min")); - refresh->insertItem(qApp->translate("toRefreshCreate", "5 min")); - refresh->insertItem(qApp->translate("toRefreshCreate", "10 min")); + refresh->addItem(qApp->translate("toRefreshCreate", "None")); + refresh->addItem(qApp->translate("toRefreshCreate", "2 seconds")); + refresh->addItem(qApp->translate("toRefreshCreate", "5 seconds")); + refresh->addItem(qApp->translate("toRefreshCreate", "10 seconds")); + refresh->addItem(qApp->translate("toRefreshCreate", "30 seconds")); + refresh->addItem(qApp->translate("toRefreshCreate", "1 min")); + refresh->addItem(qApp->translate("toRefreshCreate", "5 min")); + refresh->addItem(qApp->translate("toRefreshCreate", "10 min")); QString str; if (!def.isNull()) str = def; else str = toConfigurationSingle::Instance().globalConfig(CONF_REFRESH, DEFAULT_REFRESH); if (str == "2 seconds") - refresh->setCurrentItem(1); + refresh->setCurrentIndex(1); else if (str == "5 seconds") - refresh->setCurrentItem(2); + refresh->setCurrentIndex(2); else if (str == "10 seconds") - refresh->setCurrentItem(3); + refresh->setCurrentIndex(3); else if (str == "30 seconds") - refresh->setCurrentItem(4); + refresh->setCurrentIndex(4); else if (str == "1 min") - refresh->setCurrentItem(5); + refresh->setCurrentIndex(5); else if (str == "5 min") - refresh->setCurrentItem(6); + refresh->setCurrentIndex(6); else if (str == "10 min") - refresh->setCurrentItem(7); + refresh->setCurrentIndex(7); else - refresh->setCurrentItem(0); + refresh->setCurrentIndex(0); return refresh; } @@ -430,9 +428,8 @@ throw qApp->translate("toRefreshParse", "Unknown timer value"); } -QString toDeepCopy(const QString &str) -{ - return str.copy(); +QString toDeepCopy(const QString &str) { + return QString(str.data(), str.length()); } // Why is this optional? @@ -458,7 +455,7 @@ QStyle *t = QStyleFactory::create(name); if (!t) continue; - if (t->className() == style->className()) + if (t->metaObject()->className() == style->metaObject()->className()) { delete t; return name; @@ -467,7 +464,7 @@ } // Weird should never get here. - return style->className(); + return style->metaObject()->className(); } void toSetSessionType(const QString &str) @@ -589,7 +586,7 @@ static QRegExp findQuotes("\"([^\"]*)\""); if (findQuotes.search(str) >= 0) str = findQuotes.cap(1); - int ind = str.findRev('\\'); + int ind = str.lastIndexOf('\\'); if (ind >= 0) str = str.mid(0, ind); } @@ -656,21 +653,11 @@ { QString expanded = toExpandFile(filename); QFile file(expanded); - if (!file.open(QIODevice::ReadOnly)) + if(!file.open(QIODevice::ReadOnly)) throw QT_TRANSLATE_NOOP("toReadFile", "Couldn't open file %1.").arg(filename); - int size = file.size(); - - char *buf = new char[size + 1]; - if (file.readBlock(buf, size) == -1) - { - delete[] buf; - throw QT_TRANSLATE_NOOP("toReadFile", "Encountered problems read configuration"); - } - buf[size] = 0; - QByteArray ret(buf, size + 1); - delete[] buf; - return ret; + QTextStream in(&file); + return in.readAll().toUtf8(); } QString toExpandFile(const QString &file) @@ -722,11 +709,12 @@ TOMessageBox::warning( toMainWidget(), QT_TRANSLATE_NOOP("toWriteFile", "File error"), - QT_TRANSLATE_NOOP("toWriteFile", - QString::fromLatin1("Couldn't open %1 for writing").arg(filename))); + QT_TRANSLATE_NOOP( + "toWriteFile", + QString("Couldn't open %1 for writing").arg(filename).toAscii().constData())); return false; } - file.writeBlock(data, data.length()); + file.write(data); if (file.error() != QFile::NoError) { TOMessageBox::warning( @@ -741,7 +729,7 @@ bool toWriteFile(const QString &filename, const QString &data) { - return toWriteFile(filename, data.local8Bit()); + return toWriteFile(filename, data.toUtf8()); } bool toCompareLists(QStringList &lsta, QStringList &lstb, int len) @@ -817,7 +805,7 @@ void toSetEnv(const QString &var, const QString &val) { #if HAVE_SETENV && !defined(Q_OS_WIN32) - setenv(var, val, 1); + setenv(var.toAscii().constData(), val.toAscii().constData(), 1); #else // Has a memory leak, but just a minor one. @@ -832,9 +820,9 @@ void toUnSetEnv(const QString &var) { #if HAVE_SETENV && !defined(Q_OS_WIN32) - unsetenv(var); + unsetenv(var.toAscii().constData()); #else - toSetEnv(var, ""); + toSetEnv(var.toAscii().constData(), ""); #endif } @@ -951,7 +939,7 @@ if (toThread::mainThread()) { if (!Count) - qApp->setOverrideCursor(Qt::waitCursor); + qApp->setOverrideCursor(Qt::WaitCursor); Count++; } BusyLock.unlock(); @@ -977,7 +965,7 @@ { if (name.at(i) == '_') { - name.ref(i) = ' '; + name[i] = ' '; inWord = false; } else if (name.at(i).isSpace()) @@ -987,9 +975,9 @@ else if (name.at(i).isLetter()) { if (inWord) - name.ref(i) = name.at(i).lower(); + name[i] = name.at(i).toLower(); else - name.ref(i) = name.at(i).upper(); + name[i] = name.at(i).toUpper(); inWord = true; } } @@ -1057,7 +1045,7 @@ } title += caption; - widget->setCaption(title); + widget->setWindowTitle(title); toMainWidget()->updateWindowsMenu(); } @@ -1067,7 +1055,7 @@ std::map<QString, QString>::iterator i = src.begin(); if (i != src.end()) { - data[prefix + ":First"] = QString::fromLatin1((*i).first); + data[prefix + ":First"] = QString((*i).first); QString key = prefix + ":d:"; do { @@ -1086,7 +1074,7 @@ if (i != data.end()) { QString key = prefix + ":d:"; - i = data.find(key + (*i).second.latin1()); + i = data.find(key + (*i).second.toLatin1()); while (i != data.end() && (*i).first.mid(0, key.length()) == key) { QString t = (*i).first.mid(key.length()); @@ -1146,29 +1134,28 @@ QString toTranslateMayby(const QString &ctx, const QString &text) { - if (ctx.contains(QString::fromLatin1(" ")) || ctx.latin1() != ctx.utf8() || text.latin1() != text.utf8() || ctx.isEmpty() || text.isEmpty()) + if (ctx.contains(QString::fromLatin1(" ")) || ctx.toLatin1() != ctx.toUtf8() || text.toLatin1() != text.toUtf8() || ctx.isEmpty() || text.isEmpty()) return text; - return QT_TRANSLATE_NOOP(ctx.latin1(), text.latin1()); + return QT_TRANSLATE_NOOP(ctx.toLatin1(), text.toLatin1()); } -toPopupButton::toPopupButton(const QIcon &iconSet, const QString &textLabel, - const QString &grouptext, QToolBar *parent, const char *name) - : QToolButton(iconSet, textLabel, grouptext, NULL, NULL, parent, name) -{ - connect(this, SIGNAL(clicked()), this, SLOT(click())); - setPopupDelay(0); +toPopupButton::toPopupButton(const QIcon &iconSet, + const QString &textLabel, + const QString &grouptext, + QToolBar *parent, + const char *name) + : QToolButton(parent) { + + setObjectName(name); + setIcon(iconSet); + setText(textLabel); + setToolTip(grouptext); } toPopupButton::toPopupButton(QWidget *parent, const char *name) - : QToolButton(parent, name) -{ - connect(this, SIGNAL(clicked()), this, SLOT(click())); - setPopupDelay(0); -} + : QToolButton(parent) { -void toPopupButton::click(void) -{ - openPopup(); + setObjectName(name); } QString toObfuscate(const QString &str) @@ -1176,7 +1163,7 @@ if (str.isEmpty()) return str; - QByteArray arr = qCompress(str.utf8()); + QByteArray arr = qCompress(str.toUtf8()); QString ret = "\002"; char buf[100]; // Just to be on the safe side @@ -1196,7 +1183,7 @@ if (str.at(0) != '\001' && str.at(0) != '\002') return str; - QByteArray arr(int(str.length() / 2)); + QByteArray arr; for (int i = 1;i < str.length();i += 2) // qt4 arr.at(i / 2) = str.mid(i, 2).toInt(0, 16); arr[i / 2] = str.mid(i, 2).toInt(0, 16); @@ -1213,7 +1200,7 @@ { QKeySequence ret = key; if (key.isEmpty() && ret.isEmpty()) - printf("Key sequence %s is not valid\n", (const char *)key); + printf("Key sequence %s is not valid\n", key.toAscii().constData()); return ret; } @@ -1224,17 +1211,17 @@ return false; int val = key[0]; if ((val&Qt::META) == Qt::META) - state |= Qt::MetaButton; + state |= Qt::META; if ((val&Qt::SHIFT) == Qt::SHIFT) - state |= Qt::ShiftButton; + state |= Qt::SHIFT; if ((val&Qt::CTRL) == Qt::CTRL) - state |= Qt::ControlButton; + state |= Qt::CTRL; if ((val&Qt::ALT) == Qt::ALT) - state |= Qt::AltButton; + state |= Qt::ALT; val &= 0xfffff; - return (event->state() == state && event->key() == val); + return (event->modifiers() == Qt::NoModifier && event->key() == val); } int countChars(const QString &source, const char find) Modified: trunk/tora/src/utils.h =================================================================== --- trunk/tora/src/utils.h 2008-02-07 04:31:40 UTC (rev 2527) +++ trunk/tora/src/utils.h 2008-02-07 05:00:54 UTC (rev 2528) @@ -437,8 +437,6 @@ /** Create button somewhere else than in a toolbar. */ toPopupButton(QWidget *parent, const char *name = 0); -private slots: - void click(void); }; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-09 17:11:23
|
Revision: 2535 http://tora.svn.sourceforge.net/tora/?rev=2535&view=rev Author: mrjohnson0 Date: 2008-02-09 09:11:17 -0800 (Sat, 09 Feb 2008) Log Message: ----------- removing qt3support Modified Paths: -------------- trunk/tora/src/tobackup.cpp trunk/tora/src/tobrowser.cpp trunk/tora/src/tobrowser.h trunk/tora/src/tobrowserconstraint.cpp trunk/tora/src/tobrowserindex.cpp trunk/tora/src/tobrowsertable.cpp trunk/tora/src/tochartmanager.cpp trunk/tora/src/tochartmanager.h trunk/tora/src/toconfiguration.cpp trunk/tora/src/toconnection.cpp trunk/tora/src/toconnection.h trunk/tora/src/todatatype.cpp trunk/tora/src/todebug.cpp trunk/tora/src/todebugtext.cpp trunk/tora/src/toeditextensions.cpp trunk/tora/src/toextract.cpp trunk/tora/src/tofilesize.cpp trunk/tora/src/tofyracleconnection.cpp trunk/tora/src/toglobalsetting.cpp trunk/tora/src/tohelp.cpp trunk/tora/src/tohelp.h trunk/tora/src/tohighlightedtext.cpp trunk/tora/src/tohtml.cpp trunk/tora/src/tohtml.h trunk/tora/src/toinvalid.cpp trunk/tora/src/tolegendchart.cpp trunk/tora/src/tolinechart.cpp trunk/tora/src/tolinechart.h trunk/tora/src/tolistviewformattersql.cpp trunk/tora/src/tomain.h trunk/tora/src/tomarkedtext.cpp trunk/tora/src/tomemoeditor.cpp trunk/tora/src/tonewconnection.cpp trunk/tora/src/tonewconnection.h trunk/tora/src/tonoblockquery.cpp trunk/tora/src/tooracleconnection.cpp trunk/tora/src/tooracleextract.cpp trunk/tora/src/tooutput.cpp trunk/tora/src/toparamget.cpp trunk/tora/src/toparamget.h trunk/tora/src/topassword.cpp trunk/tora/src/topiechart.cpp trunk/tora/src/topreferences.cpp trunk/tora/src/toprofiler.cpp trunk/tora/src/toproject.cpp trunk/tora/src/toqsqlconnection.cpp trunk/tora/src/toqvalue.h trunk/tora/src/toresult.cpp trunk/tora/src/toresultcols.cpp trunk/tora/src/toresultcombo.cpp trunk/tora/src/toresultdatasingle.cpp trunk/tora/src/toresultextract.cpp trunk/tora/src/toresultitem.cpp trunk/tora/src/toresultlabel.cpp trunk/tora/src/toresultlong.cpp trunk/tora/src/toresultparam.cpp trunk/tora/src/toresultplan.cpp trunk/tora/src/toresultstorage.cpp trunk/tora/src/toresulttableviewedit.cpp trunk/tora/src/toresultview.cpp trunk/tora/src/torollback.cpp trunk/tora/src/toscript.cpp trunk/tora/src/tosearchreplace.cpp trunk/tora/src/tosearchreplaceui.ui trunk/tora/src/tosecurity.cpp trunk/tora/src/tosession.cpp trunk/tora/src/tosgatrace.cpp trunk/tora/src/tosplash.cpp trunk/tora/src/tosql.cpp trunk/tora/src/tosql.h trunk/tora/src/tosqledit.cpp trunk/tora/src/tosqlparse.cpp trunk/tora/src/tostorage.cpp trunk/tora/src/tostoragedefinition.cpp trunk/tora/src/tosyntaxsetup.cpp trunk/tora/src/totableselect.cpp trunk/tora/src/totemplate.cpp trunk/tora/src/totemporary.cpp trunk/tora/src/totextview.cpp trunk/tora/src/tothread.cpp trunk/tora/src/totimer.cpp trunk/tora/src/totool.cpp trunk/tora/src/totuning.cpp trunk/tora/src/tovisualize.cpp trunk/tora/src/towaitevents.cpp trunk/tora/src/toworksheet.cpp trunk/tora/src/toworksheetstatistic.cpp trunk/tora/src/toworksheettext.cpp trunk/tora/src/toworksheetwidget.cpp Modified: trunk/tora/src/tobackup.cpp =================================================================== --- trunk/tora/src/tobackup.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tobackup.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -47,7 +47,6 @@ #include <qlabel.h> #include <qmenubar.h> -#include <q3popupmenu.h> #include <qtabwidget.h> #include <qtoolbar.h> #include <qtoolbutton.h> @@ -333,7 +332,7 @@ Tabs = new QTabWidget(this); layout()->addWidget(Tabs); - QWidget *box = new QWidget(Tabs, "history"); + QWidget *box = new QWidget(Tabs); QVBoxLayout *vbox = new QVBoxLayout; vbox->setSpacing(0); vbox->setContentsMargins(0, 0, 0, 0); Modified: trunk/tora/src/tobrowser.cpp =================================================================== --- trunk/tora/src/tobrowser.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tobrowser.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -221,7 +221,7 @@ : Type(type), IgnoreCase(cas), Invert(invert), - Text(cas ? str.upper() : str), + Text(cas ? str.toUpper() : str), TablespaceType(tablespace), Tablespaces(tablespaces), OnlyOwnSchema(onlyOwnSchema), @@ -229,7 +229,7 @@ if (!str.isEmpty()) { Match.setPattern(str); - Match.setCaseSensitive(cas); + Match.setCaseSensitivity(cas ? Qt::CaseSensitive : Qt::CaseInsensitive); } storeFilterSettings(); @@ -289,7 +289,7 @@ data[prefix + ":Text"] = Text; int id = 1; for (std::list<QString>::iterator i = Tablespaces.begin();i != Tablespaces.end();i++, id++) - data[prefix + ":Space:" + QString::number(id).latin1()] = *i; + data[prefix + ":Space:" + QString::number(id).toLatin1()] = *i; if (OnlyOwnSchema) data[prefix + ":OwnlyOwnSchema"] = "Yes"; } @@ -303,12 +303,12 @@ Text = data[prefix + ":Text"]; if (!Text.isEmpty()) { Match.setPattern(Text); - Match.setCaseSensitive(IgnoreCase); + Match.setCaseSensitivity(IgnoreCase ? Qt::CaseSensitive : Qt::CaseInsensitive); } int id = 1; std::map<QString, QString>::iterator i; Tablespaces.clear(); - while ((i = data.find(prefix + ":Space:" + QString::number(id).latin1())) != data.end()) { + while ((i = data.find(prefix + ":Space:" + QString::number(id).toLatin1())) != data.end()) { Tablespaces.insert(Tablespaces.end(), (*i).second); i++; id++; @@ -324,11 +324,11 @@ default: return QString::fromLatin1("%"); case 1: - return Text.upper() + QString::fromLatin1("%"); + return Text.toUpper() + QString::fromLatin1("%"); case 2: - return QString::fromLatin1("%") + Text.upper(); + return QString::fromLatin1("%") + Text.toUpper(); case 3: - return QString::fromLatin1("%") + Text.upper() + QString::fromLatin1("%"); + return QString::fromLatin1("%") + Text.toUpper() + QString::fromLatin1("%"); } } @@ -385,7 +385,7 @@ return true; case 1: if (IgnoreCase) { - if (str.upper().startsWith(Text)) + if (str.toUpper().startsWith(Text)) return !Invert; } else if (str.startsWith(Text)) @@ -393,21 +393,21 @@ break; case 2: if (IgnoreCase) { - if (str.right(Text.length()).upper() == Text) + if (str.right(Text.length()).toUpper() == Text) return !Invert; } else if (str.right(Text.length()) == Text) return !Invert; break; case 3: - if (str.contains(Text, !IgnoreCase)) + if (str.contains(Text, IgnoreCase ? Qt::CaseSensitive : Qt::CaseInsensitive)) return !Invert; break; case 4: { - QStringList lst = QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")), Text); + QStringList lst = Text.split(QRegExp(QString("\\s*,\\s*"))); for (int i = 0;i < lst.count();i++) if (IgnoreCase) { - if (str.upper() == lst[i]) + if (str.toUpper() == lst[i]) return !Invert; } else if (str == lst[i]) @@ -504,8 +504,14 @@ const char * slot, QToolBar * parent, const char * name) - : QToolButton(iconSet, textLabel, grouptext, receiver, slot, parent, name) -{ + : QToolButton(parent) { + + setIcon(iconSet); + setText(textLabel); + connect(this, SIGNAL(triggered(QAction *)), receiver, slot); + setObjectName(name); + setToolTip(grouptext); + try { connect(toCurrentTool(this), SIGNAL(connectionChange()), this, SLOT(connectionChanged())); } @@ -1281,7 +1287,7 @@ QLabel *strech; toolbar->addWidget(strech = new QLabel(toolbar)); - strech->setAlignment(Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs); + strech->setAlignment(Qt::AlignRight | Qt::AlignVCenter); strech->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum)); @@ -1292,7 +1298,7 @@ if (toIsMySQL(connection)) Schema->setSelected(connection.database()); else if (toIsOracle(connection) || toIsSapDB(connection)) - Schema->setSelected(connection.user().upper()); + Schema->setSelected(connection.user().toUpper()); else Schema->setSelected(connection.user()); toolbar->addWidget(Schema); @@ -1302,7 +1308,8 @@ TopTab = new toTabWidget(this); layout()->addWidget(TopTab); - QSplitter *splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_TABLES); + QSplitter *splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_TABLES); TopTab->addTab(splitter, tr("T&ables")); CurrentTop = splitter; @@ -1375,7 +1382,7 @@ tableView->setSQL(SQLListTables); setFocusProxy(tableView); box->resize(FIRST_WIDTH, tableView->height()); - splitter->setResizeMode(box, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(box), 0); connect(tableView, SIGNAL(done()), this, SLOT(firstDone())); FirstTab = tableView; Map[TAB_TABLES] = tableView; @@ -1389,7 +1396,7 @@ toTabWidget *curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); toResultCols *resultCols = new toResultCols(curr, TAB_TABLE_COLUMNS); curr->addTab(resultCols, tr("&Columns")); @@ -1455,7 +1462,8 @@ connect(curr, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeSecondTab(QWidget *))); - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_VIEWS); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_VIEWS); TopTab->addTab(splitter, tr("&Views")); tableView = new toResultTableView(true, false, splitter); tableView->setReadAll(true); @@ -1466,10 +1474,10 @@ tableView->resize(FIRST_WIDTH, tableView->height()); connect(tableView, SIGNAL(selectionChanged()), this, SLOT(changeItem())); - splitter->setResizeMode(tableView, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(tableView), 0); curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); resultCols = new toResultCols(curr, TAB_VIEW_COLUMNS); curr->addTab(resultCols, tr("&Columns")); SecondMap[TAB_VIEWS] = resultCols; @@ -1499,7 +1507,8 @@ SecondMap[TAB_VIEW_EXTRACT] = resultExtract; connect(curr, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeSecondTab(QWidget *))); - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_INDEX); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_INDEX); TopTab->addTab(splitter, tr("Inde&xes")); @@ -1549,9 +1558,9 @@ connect(tableView, SIGNAL(displayMenu(QMenu *)), this, SLOT(displayIndexMenu(QMenu *))); box->resize(FIRST_WIDTH, tableView->height()); - splitter->setResizeMode(box, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(box), 0); curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); tableView = new toResultTableView(true, false, curr, TAB_INDEX_COLS); tableView->setSQL(SQLIndexCols); @@ -1582,7 +1591,8 @@ SecondMap[TAB_INDEX_EXTRACT] = resultExtract; connect(curr, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeSecondTab(QWidget *))); - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_SEQUENCES); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_SEQUENCES); TopTab->addTab(splitter, tr("Se&quences")); tableView = new toResultTableView(true, false, splitter); tableView->setReadAll(true); @@ -1594,10 +1604,10 @@ tableView->resize(FIRST_WIDTH, tableView->height()); connect(tableView, SIGNAL(selectionChanged()), this, SLOT(changeItem())); - splitter->setResizeMode(tableView, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(tableView), 0); curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); toResultItem *resultSequences = new toResultItem(2, true, curr, TAB_SEQUENCES_INFO); resultSequences->setSQL(SQLSequenceInfo); curr->addTab(resultSequences, tr("Info")); @@ -1615,7 +1625,8 @@ SecondMap[TAB_SEQUENCES_EXTRACT] = resultExtract; connect(curr, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeSecondTab(QWidget *))); - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_SYNONYM); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_SYNONYM); TopTab->addTab(splitter, tr("S&ynonyms")); tableView = new toResultTableView(true, false, splitter); tableView->setReadAll(true); @@ -1626,10 +1637,10 @@ tableView->resize(FIRST_WIDTH, tableView->height()); connect(tableView, SIGNAL(selectionChanged()), this, SLOT(changeItem())); - splitter->setResizeMode(tableView, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(tableView), 0); curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); toResultItem *resultSynonym = new toResultItem(2, true, curr, TAB_SYNONYM_INFO); resultSynonym->setSQL(SQLSynonymInfo); curr->addTab(resultSynonym, tr("Info")); @@ -1648,7 +1659,8 @@ connect(curr, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeSecondTab(QWidget *))); - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_PLSQL); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_PLSQL); TopTab->addTab(splitter, tr("Cod&e")); tableView = new toResultTableView(true, false, splitter); tableView->setReadAll(true); @@ -1659,10 +1671,10 @@ tableView->resize(FIRST_WIDTH*2, tableView->height()); connect(tableView, SIGNAL(selectionChanged()), this, SLOT(changeItem())); - splitter->setResizeMode(tableView, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(tableView), 0); curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); resultField = new toResultField(curr, TAB_PLSQL_SOURCE); resultField->setSQL(SQLSQLHead); curr->addTab(resultField, tr("&Declaration")); @@ -1689,7 +1701,8 @@ SecondMap[TAB_PLSQL_EXTRACT] = resultExtract; connect(curr, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeSecondTab(QWidget *))); - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_TRIGGER); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_TRIGGER); TopTab->addTab(splitter, tr("Tri&ggers")); tableView = new toResultTableView(true, false, splitter); tableView->setReadAll(true); @@ -1700,10 +1713,10 @@ tableView->resize(FIRST_WIDTH, tableView->height()); connect(tableView, SIGNAL(selectionChanged()), this, SLOT(changeItem())); - splitter->setResizeMode(tableView, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(tableView), 0); curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); toResultItem *resultTrigger = new toResultItem(2, true, curr, TAB_TRIGGER_INFO); resultTrigger->setSQL(SQLTriggerInfo); curr->addTab(resultTrigger, tr("Info")); @@ -1808,7 +1821,8 @@ SLOT(changeSecondTab(QWidget *))); #endif - splitter = new QSplitter(Qt::Horizontal, TopTab, TAB_ACCESS); + splitter = new QSplitter(Qt::Horizontal, TopTab); + splitter->setObjectName(TAB_ACCESS); TopTab->addTab(splitter, tr("Access")); #ifdef TOEXTENDED_MYSQL @@ -1848,7 +1862,7 @@ this, SLOT(changeItem())); curr = new toTabWidget(splitter); - splitter->setResizeMode(curr, QSplitter::Stretch); + splitter->setStretchFactor(splitter->indexOf(curr), 1); #ifdef TOEXTENDED_MYSQL splitter->setResizeMode(box, QSplitter::KeepSize); @@ -1882,7 +1896,7 @@ curr->addTab(AccessContent, tr("&Hosts")); SecondMap[TAB_ACCESS_CONTENT] = AccessContent; #else - splitter->setResizeMode(tableView, QSplitter::KeepSize); + splitter->setStretchFactor(splitter->indexOf(tableView), 1); tableView->setSQL(SQLMySQLAccess); AccessContent = new toResultData(curr, TAB_ACCESS_CONTENT); @@ -2013,7 +2027,7 @@ if (toIsMySQL(connection())) Schema->setSelected(connection().database()); else if (toIsOracle(connection()) || toIsSapDB(connection())) - Schema->setSelected(connection().user().upper()); + Schema->setSelected(connection().user().toUpper()); else Schema->setSelected(connection().user()); SecondText = QString::null; @@ -2061,19 +2075,21 @@ QModelIndex item = selectedItem(); if(item.isValid()) { SecondText = item.data(Qt::EditRole).toString(); - if(SecondTab && !SecondText.isEmpty()) - Poll.start(250, true); + if(SecondTab && !SecondText.isEmpty()) { + Poll.setSingleShot(true); + Poll.start(250); + } } } void toBrowser::changeSecond(void) { - QWidget *tab = TopTab->currentPage(); + QWidget *tab = TopTab->currentWidget(); QWidget *tab2 = dynamic_cast<QWidget *>(SecondTab); - if (tab && !strcmp(tab->name(), TAB_SYNONYM)) { + if (tab && tab->objectName() == TAB_SYNONYM) { QString owner; QString name; - int pos = SecondText.find(QString::fromLatin1(".")); + int pos = SecondText.indexOf(QString(".")); if (pos >= 0) { owner = SecondText.mid(0, pos); @@ -2088,19 +2104,19 @@ #ifdef TOEXTENDED_MYSQL } - else if (tab && !strcmp(tab->name(), TAB_ACCESS) && - !strcmp(tab2->name(), TAB_ACCESS_CONTENT)) { + else if (tab && tab->objectName() == TAB_ACCESS && + tab2->objectName() == TAB_ACCESS_CONTENT) { SecondTab->changeParams("mysql", "host"); #else } - else if (tab && !strcmp(tab->name(), TAB_ACCESS)) { + else if (tab && tab->objectName() == TAB_ACCESS) { SecondTab->changeParams("mysql", SecondText); #endif } - else if (tab && !strcmp(tab->name(), TAB_INDEX) && - !strcmp(tab2->name(), TAB_INDEX_EXTRACT)) { + else if (tab && tab->objectName() == TAB_INDEX && + tab2->objectName() == TAB_INDEX_EXTRACT) { QModelIndex item = selectedItem(); if(item.isValid()) SecondTab->changeParams(schema(), @@ -2112,12 +2128,12 @@ void toBrowser::changeSecondTab(QWidget *tab) { - for (QWidget *t = tab->parentWidget();t != TopTab->currentPage();t = t->parentWidget()) + for (QWidget *t = tab->parentWidget();t != TopTab->currentWidget();t = t->parentWidget()) if (!t) return; if (tab) { - toResult *newtab = SecondMap[tab->name()]; + toResult *newtab = SecondMap[tab->objectName()]; if (newtab == SecondTab) return; @@ -2130,7 +2146,7 @@ return; SecondTab = newtab; - SecondMap[TopTab->currentPage()->name()] = SecondTab; + SecondMap[TopTab->currentWidget()->objectName()] = SecondTab; if (SecondTab && !SecondText.isEmpty()) changeSecond(); } @@ -2139,13 +2155,13 @@ void toBrowser::changeTab(QWidget *tab) { if (tab && this == toMainWidget()->workspace()->activeWindow()) { - toResultTableView *newtab = Map[tab->name()]; + toResultTableView *newtab = Map[tab->objectName()]; if(newtab == FirstTab) return ; CurrentTop = tab; setFocusProxy(newtab); FirstTab = newtab; - SecondTab = SecondMap[tab->name()]; + SecondTab = SecondMap[tab->objectName()]; SecondText = ""; if (FirstTab && SecondTab) @@ -2236,46 +2252,56 @@ } void toBrowser::displayTableMenu(QMenu *menu) { - menu->insertSeparator(0); - menu->insertItem(QPixmap(const_cast<const char**>(trash_xpm)), tr("Drop table"), this, SLOT(dropTable()), 0, 0, 0); - menu->insertItem(tr("Truncate table"), this, SLOT(truncateTable()), 0, 0, 0); - menu->insertSeparator(0); - if (toIsMySQL(connection())) { - menu->insertItem(tr("Check table"), this, SLOT(checkTable()), 0, 0, 0); - menu->insertItem(tr("Optimize table"), this, SLOT(optimizeTable()), 0, 0, 0); - menu->insertItem(tr("Analyze table"), this, SLOT(analyzeTable()), 0, 0, 0); - menu->insertItem(tr("Change type"), this, SLOT(changeType()), 0, 0, 0); - menu->insertSeparator(0); + menu->addSeparator(); + + menu->addAction(dropTableAct); + menu->addAction(tr("Truncate table"), this, SLOT(truncateTable())); + + menu->addSeparator(); + + if(toIsMySQL(connection())) { + menu->addAction(tr("Check table"), this, SLOT(checkTable())); + menu->addAction(tr("Optimize table"), this, SLOT(optimizeTable())); + menu->addAction(tr("Analyze table"), this, SLOT(analyzeTable())); + menu->addAction(tr("Change type"), this, SLOT(changeType())); + + menu->addSeparator(); } - menu->insertItem(QPixmap(const_cast<const char**>(modconstraint_xpm)), tr("Modify constraints"), this, SLOT(modifyConstraint()), 0, 0, 0); - menu->insertItem(QPixmap(const_cast<const char**>(modindex_xpm)), tr("Modify indexes"), this, SLOT(modifyIndex()), 0, 0, 0); - menu->insertItem(QPixmap(const_cast<const char**>(addtable_xpm)), tr("Create table"), this, SLOT(addTable()), 0, 0, 0); - menu->insertSeparator(0); - menu->insertItem(QPixmap(const_cast<const char**>(refresh_xpm)), tr("Refresh"), this, SLOT(refresh()), 0, 0, 0); + + menu->addAction(modConstraintAct); + menu->addAction(modIndexAct); + menu->addAction(addTableAct); + + menu->addSeparator(); + + menu->addAction(refreshAct); } -void toBrowser::displayIndexMenu(QMenu *menu) -{ - menu->insertSeparator(0); - menu->insertItem(QPixmap(const_cast<const char**>(trash_xpm)), tr("Drop index"), this, SLOT(dropIndex()), 0, 0, 0); - menu->insertItem(QPixmap(const_cast<const char**>(modindex_xpm)), tr("Modify index"), this, SLOT(modifyIndex()), 0, 0, 0); - menu->insertItem(QPixmap(const_cast<const char**>(addindex_xpm)), tr("Create index"), this, SLOT(addIndex()), 0, 0, 0); - menu->insertSeparator(0); - menu->insertItem(QPixmap(const_cast<const char**>(refresh_xpm)), tr("Refresh"), this, SLOT(refresh()), 0, 0, 0); +void toBrowser::displayIndexMenu(QMenu *menu) { + menu->addSeparator(); + + menu->addAction(QIcon(trash_xpm), tr("Drop index"), this, SLOT(dropIndex())); + menu->addAction(QIcon(modindex_xpm), tr("Modify index"), this, SLOT(modifyIndex())); + menu->addAction(QIcon(addindex_xpm), tr("Create index"), this, SLOT(addIndex())); + + menu->addSeparator(); + + menu->addAction(QIcon(refresh_xpm), tr("Refresh"), this, SLOT(refresh())); } void toBrowser::dropSomething(const QString &type, const QString &what) { if (what.isEmpty()) return ; - if (TOMessageBox::warning(this, tr("Dropping %1?").arg(tr(type)), + if (TOMessageBox::warning(this, tr("Dropping %1?").arg(tr(type.toAscii().constData())), tr("Are you sure you want to drop the %1 %2.%3,\n" - "this action can not be undone?").arg(tr(type)).arg(Schema->selected()).arg(what), + "this action can not be undone?").arg(tr(type.toAscii().constData())).arg( + Schema->selected()).arg(what), tr("&Yes"), tr("&Cancel"), QString::null, 0) == 0) { std::list<QString> ctx; toPush(ctx, Schema->selected()); - toPush(ctx, QString(type.upper())); - QStringList parts = QStringList::split(".", what); + toPush(ctx, QString(type.toUpper())); + QStringList parts = what.split("."); if (parts.count() > 1) { toPush(ctx, parts[1]); toPush(ctx, QString("ON")); @@ -2299,12 +2325,12 @@ QString sql = extractor.migrate(drop, empty); std::list<toSQLParse::statement> statements = toSQLParse::parse(sql, connection()); - QProgressDialog prog(tr("Executing %1 change script").arg(tr(type)), + QProgressDialog prog(tr("Executing %1 change script").arg(tr(type.toAscii().constData())), tr("Stop"), 0, statements.size(), this); - prog.setCaption(tr("Performing %1 changes").arg(tr(type))); + prog.setWindowTitle(tr("Performing %1 changes").arg(tr(type.toAscii().constData()))); for (std::list<toSQLParse::statement>::iterator j = statements.begin();j != statements.end();j++) { QString sql = toSQLParse::indentStatement(*j, connection()); int i = sql.length() - 1; @@ -2314,7 +2340,7 @@ connection().execute(sql.mid(0, i + 1)); qApp->processEvents(); if (prog.wasCanceled()) - throw tr("Canceled ongoing %1 modification, %2 might be corrupt").arg(tr(type)).arg(tr(type)); + throw tr("Canceled ongoing %1 modification, %2 might be corrupt").arg(tr(type.toAscii().constData())).arg(tr(type.toAscii().constData())); } } TOCATCH @@ -2378,7 +2404,8 @@ if (!sql.isEmpty()) { toResultTableView *result = new toResultTableView(true, false, this); - result->setWindowFlags(Qt::WType_TopLevel | Qt::WDestructiveClose); + result->setWindowFlags(Qt::Window); + result->setAttribute(Qt::WA_DeleteOnClose); result->query(sql); result->show(); } @@ -2401,7 +2428,8 @@ if (!sql.isEmpty()) { toResultTableView *result = new toResultTableView(true, false, this); - result->setWindowFlags(Qt::WType_TopLevel | Qt::WDestructiveClose); + result->setWindowFlags(Qt::Window); + result->setAttribute(Qt::WA_DeleteOnClose); result->query(sql); result->show(); } @@ -2410,8 +2438,12 @@ void toBrowser::changeType(void) { bool ok; - QString text = QInputDialog::getText("Change table type", "Enter new table type", QLineEdit::Normal, - "MyISAM", &ok, this); + QString text = QInputDialog::getText(this, + "Change table type", + "Enter new table type", + QLineEdit::Normal, + "MyISAM", + &ok); if (ok && !text.isEmpty()) { for(toResultTableView::iterator it(FirstTab); (*it).isValid(); it++) { if (FirstTab->isRowSelected(*it)) { @@ -2444,7 +2476,8 @@ if (!sql.isEmpty()) { toResultTableView *result = new toResultTableView(true, false, this); - result->setWindowFlags(Qt::WType_TopLevel | Qt::WDestructiveClose); + result->setWindowFlags(Qt::Window); + result->setAttribute(Qt::WA_DeleteOnClose); result->query(sql); result->show(); } @@ -2490,7 +2523,7 @@ void toBrowser::exportData(std::map<QString, QString> &data, const QString &prefix) { data[prefix + ":Schema"] = Schema->selected(); - data[prefix + ":FirstTab"] = TopTab->currentPage()->name(); + data[prefix + ":FirstTab"] = TopTab->currentWidget()->objectName(); data[prefix + ":SecondText"] = SecondText; for (std::map<QString, toResult *>::iterator i = SecondMap.begin();i != SecondMap.end();i++) { if ((*i).second == SecondTab && Map.find((*i).first) == Map.end()) { @@ -2530,16 +2563,16 @@ QString str = data[prefix + ":Schema"]; Schema->setSelected(str); for (int i = 0;i < Schema->count();i++) - if (Schema->text(i) == str) - Schema->setCurrentItem(i); + if (Schema->itemText(i) == str) + Schema->setCurrentIndex(i); str = data[prefix + ":FirstTab"]; - QWidget *chld = (QWidget *)child(str); + QWidget *chld = findChild<QWidget *>(str); if (chld && str.length()) { SecondText = QString::null; - TopTab->showPage(chld); + TopTab->setCurrentIndex(TopTab->indexOf(chld)); - toResultTableView *newtab = Map[chld->name()]; + toResultTableView *newtab = Map[chld->objectName()]; if(newtab != FirstTab && newtab) { CurrentTop = chld; setFocusProxy(newtab); @@ -2547,13 +2580,16 @@ } str = data[prefix + ":SecondTab"]; - chld = (QWidget *)child(str); + chld = findChild<QWidget *>(str); if (chld && str.length()) { QWidget *par = chld->parentWidget(); while (par && !par->inherits("toTabWidget")) par = par->parentWidget(); - if (par) - ((toTabWidget *)par)->showPage(chld); + if(par) { + toTabWidget *tab = dynamic_cast<toTabWidget *>(par); + if(tab) + tab->setCurrentIndex(tab->indexOf(chld)); + } changeSecondTab(chld); } SecondText = data[prefix + ":SecondText"]; @@ -2628,7 +2664,7 @@ } if (Filter) { disconnect(FilterButton, SIGNAL(toggled(bool)), this, SLOT(defineFilter())); - FilterButton->setOn(true); + FilterButton->setChecked(true); connect(FilterButton, SIGNAL(toggled(bool)), this, SLOT(defineFilter())); } } @@ -2638,7 +2674,7 @@ delete Filter; Filter = new toBrowserFilter; disconnect(FilterButton, SIGNAL(toggled(bool)), this, SLOT(defineFilter())); - FilterButton->setOn(false); + FilterButton->setChecked(false); connect(FilterButton, SIGNAL(toggled(bool)), this, SLOT(defineFilter())); } @@ -2664,7 +2700,7 @@ QString typ = text(0); QString schema = parent()->parent()->parent()->text(0); if (ptyp == "Synonyms") { - int pos = object.find(QString::fromLatin1(".")); + int pos = object.indexOf(QString::fromLatin1(".")); if (pos >= 0) { schema = object.mid(0, pos); object = object.mid(pos + 1); @@ -2886,7 +2922,7 @@ toResultItem *resultItem = new toResultItem(2, true, tool); if (typ == qApp->translate("toBrowser", "Synonyms")) { resultItem->setSQL(SQLSynonymInfo); - int pos = object.find(QString::fromLatin1(".")); + int pos = object.indexOf(QString::fromLatin1(".")); if (pos >= 0) { schema = object.mid(0, pos); object = object.mid(pos + 1); @@ -2964,7 +3000,7 @@ toBrowserFilter *filter = BrowseTemplate.filter(); if (filter && filter->onlyOwnSchema() && - name.upper() != connection().user().upper()) { + name.toUpper() != connection().user().toUpper()) { delete item; return NULL; } @@ -3051,8 +3087,8 @@ Parents.insert(Parents.end(), dbitem); FilterButton = new QToolButton(toolbar); - FilterButton->setToggleButton(true); - FilterButton->setIconSet(QIcon(QPixmap(const_cast<const char**>(filter_xpm)))); + FilterButton->setCheckable(true); + FilterButton->setIcon(QIcon(QPixmap(const_cast<const char**>(filter_xpm)))); FilterButton->setToolTip(tr("Define the object filter for database browser")); toolbar->addWidget(FilterButton); connect(FilterButton, SIGNAL(toggled(bool)), this, SLOT(defineFilter())); Modified: trunk/tora/src/tobrowser.h =================================================================== --- trunk/tora/src/tobrowser.h 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tobrowser.h 2008-02-09 17:11:17 UTC (rev 2535) @@ -179,7 +179,7 @@ public: toBrowseTemplate(void) - : QObject(NULL, "browsertemplate"), toTemplateProvider("Browser") { + : QObject(NULL), toTemplateProvider("Browser") { Registered = false; Filter = NULL; } Modified: trunk/tora/src/tobrowserconstraint.cpp =================================================================== --- trunk/tora/src/tobrowserconstraint.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tobrowserconstraint.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -71,7 +71,7 @@ 0, statements.size(), &dialog); - prog.setCaption(tr("Performing constraint changes")); + prog.setWindowTitle(tr("Performing constraint changes")); for (std::list<toSQLParse::statement>::iterator j = statements.begin();j != statements.end();j++) { QString sql = toSQLParse::indentStatement(*j, conn); @@ -90,8 +90,11 @@ } toBrowserConstraint::toBrowserConstraint(toConnection &conn, const QString &owner, const QString &table, QWidget *parent, const char *name) - : QDialog(parent, name, true), toConnectionWidget(conn, this), Extractor(conn, NULL) + : QDialog(parent), toConnectionWidget(conn, this), Extractor(conn, NULL) { + setObjectName(name); + setModal(true); + setupUi(this); Extractor.setIndexes(false); Extractor.setConstraints(true); @@ -122,7 +125,7 @@ { try { - QStringList parts = QStringList::split(".", table); + QStringList parts = table.split("."); if (parts.size() > 1) { Owner = connection().unQuote(parts[0]); @@ -173,7 +176,7 @@ } Name->clear(); for (std::map<QString, QString>::iterator i = Constraints.begin();i != Constraints.end();i++) - Name->insertItem((*i).first); + Name->addItem((*i).first); SourceColList->changeParams(Owner, Table); UniqueColList->changeParams(Owner, Table); @@ -185,7 +188,7 @@ for (std::list<toConnection::objectName>::iterator i = objects.begin();i != objects.end();i++) { if ((*i).Type == "TABLE" && (*i).Owner == Owner) - ReferTable->insertItem((*i).Name); + ReferTable->addItem((*i).Name); } } @@ -267,13 +270,16 @@ if (Table.isEmpty()) return ; bool ok = false; - QString name = QInputDialog::getText(tr("Enter new constraint name"), + QString name = QInputDialog::getText(this, + tr("Enter new constraint name"), tr("Enter name of new constraint."), - QLineEdit::Normal, QString::null, &ok, this); + QLineEdit::Normal, + QString::null, + &ok); if (ok) { - Name->insertItem(name); - Name->setCurrentItem(Name->count() - 1); + Name->addItem(name); + Name->setCurrentIndex(Name->count() - 1); changeConstraint(); } } @@ -284,7 +290,7 @@ { Constraints.erase(Current); Current = QString::null; - Name->removeItem(Name->currentItem()); + Name->removeItem(Name->currentIndex()); changeConstraint(); } } @@ -307,12 +313,12 @@ return ; Type->setEnabled(false); - QString type = (*i).String.upper(); + QString type = (*i).String.toUpper(); i++; if (type == "FOREIGN") { WidgetStack->setCurrentIndex(WidgetStack->indexOf(ReferentialPage)); - Type->setCurrentItem(0); + Type->setCurrentIndex(0); if (i == statement.subTokens().end()) return ; @@ -332,7 +338,7 @@ i++; // Refered table finally if (i == statement.subTokens().end()) return ; - ReferTable->setCurrentText((*i).String); + ReferTable->setItemText(ReferTable->currentIndex(), (*i).String); changeRefered(); while (i != statement.subTokens().end() && (*i).Type != toSQLParse::statement::List) i++; @@ -342,7 +348,7 @@ else if (type == "PRIMARY" || type == "UNIQUE") { WidgetStack->setCurrentIndex(WidgetStack->indexOf(PrimaryPage)); - Type->setCurrentItem(2); + Type->setCurrentIndex(2); Primary->setChecked(type == "PRIMARY"); Unique->setChecked(type == "UNIQUE"); while (i != statement.subTokens().end() && (*i).Type != toSQLParse::statement::List) @@ -353,7 +359,7 @@ else if (type == "CHECK") { WidgetStack->setCurrentIndex(WidgetStack->indexOf(CheckPage)); - Type->setCurrentItem(1); + Type->setCurrentIndex(1); while (i != statement.subTokens().end() && (*i).Type != toSQLParse::statement::List) i++; if (i != statement.subTokens().end()) @@ -402,7 +408,7 @@ void toBrowserConstraint::changeRefered(void) { - QStringList parts = QStringList::split(".", ReferTable->currentText()); + QStringList parts = ReferTable->currentText().split("."); if (parts.size() > 1) ReferColList->changeParams(parts[0], parts[1]); else Modified: trunk/tora/src/tobrowserindex.cpp =================================================================== --- trunk/tora/src/tobrowserindex.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tobrowserindex.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -86,7 +86,7 @@ 0, statements.size(), this); - prog.setCaption(tr("Performing index changes")); + prog.setWindowTitle(tr("Performing index changes")); for (std::list<toSQLParse::statement>::iterator i = statements.begin();i != statements.end();i++) { QString sql = toSQLParse::indentStatement(*i, connection()); @@ -128,7 +128,7 @@ Extractor.setHeading(false); if (toIsMySQL(connection())) - Type->insertItem("Fulltext Index"); + Type->addItem("Fulltext Index"); if (!owner.isEmpty() && !table.isEmpty()) { @@ -142,9 +142,9 @@ connect(TableSelect, SIGNAL(selectTable(const QString &)), this, SLOT(changeTable(const QString &))); for (int i = 0;i < Name->count();i++) - if (connection().unQuote(Name->text(i)) == index) + if (connection().unQuote(Name->itemText(i)) == index) { - Name->setCurrentItem(Name->count() - 1); + Name->setCurrentIndex(Name->count() - 1); break; } } @@ -160,7 +160,7 @@ { try { - QStringList parts = QStringList::split(".", table); + QStringList parts = table.split("."); if (parts.size() > 1) { Owner = connection().unQuote(parts[0]); @@ -232,7 +232,7 @@ Name->clear(); for (std::map<QString, QString>::iterator i = IndexType.begin();i != IndexType.end();i++) - Name->insertItem((*i).first); + Name->addItem((*i).first); ColList->displayHeader(false); ColList->changeParams(Owner, Table); @@ -263,7 +263,7 @@ toPush(ctx, QString("INDEX")); toPush(ctx, (*i).first); - QStringList lst = QStringList::split(",", IndexCols[(*i).first]); + QStringList lst = IndexCols[(*i).first].split(","); for (int j = 0;j < lst.count();j++) { toExtract::addDescription(migrateTable, ctx, "COLUMN", lst[j]); @@ -317,13 +317,16 @@ if (Table.isEmpty()) return ; bool ok = false; - QString name = QInputDialog::getText(tr("Enter new index name"), + QString name = QInputDialog::getText(this, + tr("Enter new index name"), tr("Enter name of new index."), - QLineEdit::Normal, QString::null, &ok, this); + QLineEdit::Normal, + QString::null, + &ok); if (ok) { - Name->insertItem(name); - Name->setCurrentItem(Name->count() - 1); + Name->addItem(name); + Name->setCurrentIndex(Name->count() - 1); IndexType[name] = "Normal Index"; changeIndex(); } @@ -336,7 +339,7 @@ IndexType.erase(Current); IndexCols.erase(Current); Current = QString::null; - Name->removeItem(Name->currentItem()); + Name->removeItem(Name->currentIndex()); changeIndex(); } } @@ -345,7 +348,7 @@ { if (!Current.isEmpty()) { - QString type = Type->currentText().upper(); + QString type = Type->currentText().toUpper(); if (type == "NORMAL INDEX") type = "INDEX"; IndexType[Current] = type; @@ -368,16 +371,16 @@ type = "NORMAL INDEX"; for (i = 0;i < Type->count();i++) { - if (Type->text(i).upper() == type) + if (Type->itemText(i).toUpper() == type) { - Type->setCurrentItem(i); + Type->setCurrentIndex(i); break; } } if (i == Type->count()) { - Type->insertItem(IndexType[Current]); - Type->setCurrentItem(Type->count() - 1); + Type->addItem(IndexType[Current]); + Type->setCurrentIndex(Type->count() - 1); } } } Modified: trunk/tora/src/tobrowsertable.cpp =================================================================== --- trunk/tora/src/tobrowsertable.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tobrowsertable.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -76,7 +76,7 @@ 0, statements.size(), &dialog); - prog.setCaption(tr("Performing table changes")); + prog.setWindowTitle(tr("Performing table changes")); for (std::list<toSQLParse::statement>::iterator i = statements.begin();i != statements.end();i++) { QString sql = toSQLParse::indentStatement(*i, conn); int l = sql.length() - 1; @@ -191,7 +191,7 @@ else if (type == "PARAMETERS") { QString t = toShift(row); if (t.startsWith("TABLESPACE")) { - tablespace = connection().unQuote(t.mid(10).stripWhiteSpace()); + tablespace = connection().unQuote(t.mid(10).trimmed()); } else declarations += t + " "; @@ -202,9 +202,9 @@ Columns = toExtract::parseColumnDescription(OriginalDescription); - ExtraDeclarations->setText(declarations.stripWhiteSpace()); - StorageDeclarations->setText(storage.stripWhiteSpace()); - ParallelDeclarations->setText(parallel.stripWhiteSpace()); + ExtraDeclarations->setText(declarations.trimmed()); + StorageDeclarations->setText(storage.trimmed()); + ParallelDeclarations->setText(parallel.trimmed()); { for (unsigned int i = 0;i < Columns.size();i++) addColumn(); @@ -243,9 +243,9 @@ toQuery query(connection(), SQLListTablespaces); while (!query.eof()) { QString t = query.readValueNull(); - Tablespace->insertItem(t); + Tablespace->addItem(t); if (t == tablespace) - Tablespace->setCurrentItem(Tablespace->count() - 1); + Tablespace->setCurrentIndex(Tablespace->count() - 1); } } catch (...) { @@ -287,7 +287,7 @@ end++; } if (beg != end) - toExtract::addDescription(migrateTable, ctx, type, Extractor.createFromParse(beg, end).stripWhiteSpace()); + toExtract::addDescription(migrateTable, ctx, type, Extractor.createFromParse(beg, end).trimmed()); } QString toBrowserTable::sql() { Modified: trunk/tora/src/tochartmanager.cpp =================================================================== --- trunk/tora/src/tochartmanager.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tochartmanager.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -86,8 +86,8 @@ { Window = new toChartManager(toMainWidget()->workspace()); toMainWidget()->workspace()->addWindow(Window); - Window->setCaption(qApp->translate("toChartTool", "Chart Manager")); - Window->setIcon(QPixmap(const_cast<const char**>(chart_xpm))); + Window->setWindowTitle(qApp->translate("toChartTool", "Chart Manager")); + Window->setWindowIcon(QPixmap(const_cast<const char**>(chart_xpm))); } Window->refresh(); Window->show(); @@ -175,9 +175,9 @@ QString toChartSetup::modifyAlarm(const QString &str, bool &persistent) { toChartManager::chartAlarm alarm(str, persistent); toChartAlarm diag(this, NULL, true); - diag.Operation->setCurrentItem((int)alarm.Operation); - diag.Comparison->setCurrentItem((int)alarm.Comparison); - diag.Action->setCurrentItem((int)alarm.Action); + diag.Operation->setCurrentIndex((int)alarm.Operation); + diag.Comparison->setCurrentIndex((int)alarm.Comparison); + diag.Action->setCurrentIndex((int)alarm.Action); diag.Value->setText(QString::number(alarm.Value)); diag.changeValue((int)alarm.Action); diag.Value->setValidator(new QDoubleValidator(diag.Value)); @@ -208,9 +208,9 @@ alarm.Columns.insert(alarm.Columns.end(), i); i++; } - alarm.Action = (toChartManager::action)diag.Action->currentItem(); - alarm.Operation = (toChartManager::chartAlarm::operation)diag.Operation->currentItem(); - alarm.Comparison = (toChartManager::chartAlarm::comparison)diag.Comparison->currentItem(); + alarm.Action = (toChartManager::action)diag.Action->currentIndex(); + alarm.Operation = (toChartManager::chartAlarm::operation)diag.Operation->currentIndex(); + alarm.Comparison = (toChartManager::chartAlarm::comparison)diag.Comparison->currentIndex(); alarm.Value = diag.Value->text().toDouble(); alarm.Extra = diag.Extra->text(); return alarm.toString(); @@ -266,7 +266,7 @@ return QString::null; try { - LastName = Result->connection().description(false) + QString::fromLatin1(":") + QString::fromLatin1(Result->sqlName()); + LastName = Result->connection().description(false) + QString(":") + QString(Result->sqlName()); } catch (...) {} @@ -332,8 +332,10 @@ { Charts.insert(Charts.end(), new toChartReceiver(this, chart)); toChartManager *manager = ChartTool.manager(); - if (manager) - manager->Refresh.start(1, true); + if (manager) { + manager->Refresh.setSingleShot(true); + manager->Refresh.start(1); + } } void toChartHandler::removeChart(toLineChart *chart) @@ -377,8 +379,10 @@ delete *i; Charts.erase(i); toChartManager *manager = ChartTool.manager(); - if (manager) - manager->Refresh.start(1, true); + if (manager) { + manager->Refresh.setSingleShot(true); + manager->Refresh.start(1); + } return ; } } @@ -400,7 +404,7 @@ Persistent = pers; // The \01 is just one character unlikely to be in an email address - int ret = sscanf(inp.utf8(), "%s %s %s %lf %s %[^\01]", oper, cols, comp, &Value, act, extra); + int ret = sscanf(inp.toUtf8(), "%s %s %s %lf %s %[^\01]", oper, cols, comp, &Value, act, extra); if (ret != 5 && ret != 6) { Operation = Any; @@ -427,7 +431,7 @@ t = QString::fromUtf8(cols); if (t.length() > 2) { - QStringList lst = QStringList::split(QString::fromLatin1(","), t.mid(1, t.length() - 2)); + QStringList lst = t.mid(1, t.length() - 2).split(","); for (int i = 0;i < lst.count();i++) Columns.insert(Columns.end(), lst[i].toInt()); Columns.sort(); @@ -692,7 +696,8 @@ return ; handler->SignalAlarms.insert(handler->SignalAlarms.end(), alarmSignal(Action, xValue, str, toString(), Extra)); - handler->Timer.start(1, true); + handler->Timer.setSingleShot(true); + handler->Timer.start(1); Signal = true; } else @@ -708,9 +713,9 @@ if ((*i).second.Persistent) { num++; - QString name = QString("Files:") + QString::number(num).latin1(); + QString name = QString("Files:") + QString::number(num).toLatin1(); ChartTool.setConfig(name + ":Name", (*i).first); - ChartTool.setConfig(name + ":Spec", (*i).second.File.name()); + ChartTool.setConfig(name + ":Spec", (*i).second.File.fileName()); } } ChartTool.setConfig("FilesCount", QString::number(num)); @@ -725,7 +730,7 @@ if ((*j).Persistent) { num++; - QString name = QString("Alarms:") + QString::number(num).latin1(); + QString name = QString("Alarms:") + QString::number(num).toLatin1(); ChartTool.setConfig(name + ":Name", (*i).first); ChartTool.setConfig(name + ":Spec", (*j).toString()); } @@ -741,7 +746,7 @@ { for (int num = ChartTool.config("FilesCount", "0").toInt();num > 0;num--) { - QString name = QString("Files:") + QString::number(num).latin1(); + QString name = QString("Files:") + QString::number(num).toLatin1(); QString t = ChartTool.config(name + ":Name", ""); QString s = ChartTool.config(name + ":Spec", ""); if (!t.isEmpty() && !s.isEmpty()) @@ -751,7 +756,7 @@ { for (int num = ChartTool.config("AlarmCount", "0").toInt();num > 0;num--) { - QString name = QString("Alarms:") + QString::number(num).latin1(); + QString name = QString("Alarms:") + QString::number(num).toLatin1(); QString t = ChartTool.config(name + ":Name", ""); QString s = ChartTool.config(name + ":Spec", ""); if (!t.isEmpty() && !s.isEmpty()) @@ -807,27 +812,27 @@ { QString t = chart->title(); t.replace(quote, QString::fromLatin1("\"\"")); - out += t.utf8(); + out += t.toUtf8(); std::list<QString> labels = chart->labels(); for (std::list<QString>::iterator i = labels.begin();i != labels.end();i++) { out += "\";\""; QString t = (*i); t.replace(quote, QString::fromLatin1("\"\"")); - out += t.utf8(); + out += t.toUtf8(); } out += "\"\n\""; } QString t = xValue; t.replace(quote, QString::fromLatin1("\"\"")); - out += t.utf8(); + out += t.toUtf8(); for (std::list<double>::iterator i = value.begin();i != value.end();i++) { out += "\";\""; out += QString::number(*i); } out += "\"\n"; - file.writeBlock(out, out.length()); + file.write(out.toUtf8()); } } } @@ -879,12 +884,12 @@ tr("Cancel"))) { case 0: - chart = new toBarChart(toMainWidget()->workspace(), NULL, - Qt::WDestructiveClose); + chart = new toBarChart(toMainWidget()->workspace(), NULL); + chart->setAttribute(Qt::WA_DeleteOnClose); break; case 1: - chart = new toLineChart(toMainWidget()->workspace(), NULL, - Qt::WDestructiveClose); + chart = new toLineChart(toMainWidget()->workspace(), NULL); + chart->setAttribute(Qt::WA_DeleteOnClose); break; default: return ; @@ -965,7 +970,7 @@ setup.Alarms->setSorting(0); setup.Alarms->setSelectionMode(toTreeWidget::Single); setup.Persistent->setChecked(file.Persistent); - setup.Filename->setText(file.File.name()); + setup.Filename->setText(file.File.fileName()); if (!setup.Filename->text().isEmpty()) setup.Enabled->setChecked(true); setup.ChartFrame->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, @@ -1048,7 +1053,7 @@ std::map<QString, chartTrack>::iterator fndt = ChartTool.handler()->Files.find(name); if (fndt != ChartTool.handler()->Files.end()) - item->setText(3, (*fndt).second.File.name()); + item->setText(3, (*fndt).second.File.fileName()); } } } Modified: trunk/tora/src/tochartmanager.h =================================================================== --- trunk/tora/src/tochartmanager.h 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/tochartmanager.h 2008-02-09 17:11:17 UTC (rev 2535) @@ -126,16 +126,16 @@ Persistent = pers; } chartTrack(const chartTrack &fil) - : File(fil.File.name()) + : File(fil.File.fileName()) { Persistent = fil.Persistent; } const chartTrack &operator =(const chartTrack &fil) { - if (fil.File.name() != File.name()) + if (fil.File.fileName() != File.fileName()) { File.close(); - File.setName(fil.File.name()); + File.setFileName(fil.File.fileName()); } Persistent = fil.Persistent; return *this; Modified: trunk/tora/src/toconfiguration.cpp =================================================================== --- trunk/tora/src/toconfiguration.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/toconfiguration.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -103,7 +103,7 @@ { QString tag = ((const char *)data) + bol; QString val = ((const char *)data) + endtag + 1; - pairs[tag] = QString::fromUtf8(val); + pairs[tag] = val; } bol = pos + 1; endtag = -1; @@ -183,7 +183,7 @@ } else { - char *t = strdup(value.utf8()); + char *t = strdup(value.toUtf8()); if (RegSetValueA(key, toKeyValue(path), REG_SZ, @@ -232,7 +232,7 @@ QString line = (*i).second; line.replace(backslash, QString::fromLatin1("\\\\")); line.replace(newline, QString::fromLatin1("\\n")); - str += line.utf8(); + str += line.toUtf8(); str += QString::fromLatin1("\n"); data += str; } @@ -294,7 +294,7 @@ } #endif - (Configuration)[tag] = QString::fromLatin1(def); + (Configuration)[tag] = QString(def); return (Configuration)[tag]; } Modified: trunk/tora/src/toconnection.cpp =================================================================== --- trunk/tora/src/toconnection.cpp 2008-02-09 16:32:34 UTC (rev 2534) +++ trunk/tora/src/toconnection.cpp 2008-02-09 17:11:17 UTC (rev 2535) @@ -358,7 +358,7 @@ if(isNull()) return QVariant(); if(isString()) - return QVariant(utf8()); + return QVariant(toUtf8()); if(isBinary()) return QVariant(toString()); if(isLong()) @@ -408,7 +408,7 @@ static char HexString[] = "0123456789ABCDEF"; -QString toQValue::utf8(void) const { +QString toQValue::toUtf8(void) const { switch (Type) { case nullType: { QString ret; @@ -452,7 +452,7 @@ return ret; } case stringType: - return Value.String->utf8(); + return Value.String->toUtf8(); case binaryType: { QString ret(Value.Array->size()*2 + 1); for (int i = 0;i < Value.Array->size();i++) { @@ -613,7 +613,7 @@ } toQValue toQValue::createFromHex(const QByteArray &hex) { - QByteArray arr((hex.length() + 1) / 2); + QByteArray arr; for (int i = 0;i < hex.length();i += 2) { int num; char c = hex.at(i); @@ -638,7 +638,7 @@ } toQValue toQValue::createFromHex(const QString &hex) { - QByteArray arr((hex.length() + 1) / 2); + QByteArray arr; for (int i = 0;i < hex.length();i += 2) { int num; // qt4 char c = hex.at(i); @@ -777,7 +777,7 @@ const QString &arg9) : Connection(QPointer<toConnection>(&conn)), ConnectionSub(conn.mainConnection()), - SQL(sql.utf8()) + SQL(sql.toUtf8()) { Mode = Normal; int numArgs; @@ -862,7 +862,7 @@ : Connection(QPointer<toConnection>(&conn)), ConnectionSub(conn.mainConnection()), Params(params), - SQL(sql.utf8()) + SQL(sql.toUtf8()) { Mode = Normal; toBusy busy; @@ -923,7 +923,7 @@ const toQList ¶ms) : Connection(QPointer<toConnection>(&conn)), Params(params), - SQL(sql.utf8()) + SQL(sql.toUtf8()) { Mode = mode; @@ -995,7 +995,7 @@ void toQuery::execute(const QString &sql, const toQList ¶ms) { toBusy busy; - SQL = sql.utf8(); + SQL = sql.toUtf8(); Params = params; Query->execute(); } @@ -1168,7 +1168,7 @@ toQList params; for (std::list<QString>::iterator i = InitStrings.begin();i != InitStrings.end();i++) { try { - Connection->execute(sub, (*i).utf8(), params); + Connection->execute(sub, (*i).toUtf8(), params); } TOCATCH } @@ -1426,7 +1426,7 @@ if (version) { if (!Version.isEmpty()) { ret += QString::fromLatin1(" ["); - ret += QString::fromLatin1(Version); + ret += Version; ret += QString::fromLatin1("]"); } } @@ -1454,7 +1454,7 @@ void toConnection::parse(const QString &sql) { toBusy busy; - Connection->parse(mainConnection(), sql.utf8()); + Connection->parse(mainConnection(), sql.toUtf8()); } void toConnection::parse(const toSQL &sql) { @@ -1469,7 +1469,7 @@ ... [truncated message content] |
From: <mrj...@us...> - 2008-02-09 21:02:20
|
Revision: 2540 http://tora.svn.sourceforge.net/tora/?rev=2540&view=rev Author: mrjohnson0 Date: 2008-02-09 13:02:24 -0800 (Sat, 09 Feb 2008) Log Message: ----------- open a memo editor on double click if widget is not editable Modified Paths: -------------- trunk/tora/src/toresulttableview.cpp trunk/tora/src/toresulttableview.h Modified: trunk/tora/src/toresulttableview.cpp =================================================================== --- trunk/tora/src/toresulttableview.cpp 2008-02-09 20:24:05 UTC (rev 2539) +++ trunk/tora/src/toresulttableview.cpp 2008-02-09 21:02:24 UTC (rev 2540) @@ -117,6 +117,10 @@ SIGNAL(sectionResized(int, int, int)), this, SLOT(columnWasResized(int, int, int))); + connect(this, + SIGNAL(doubleClicked(const QModelIndex &)), + this, + SLOT(handleDoubleClick(const QModelIndex &))); } @@ -359,6 +363,16 @@ } +void toResultTableView::handleDoubleClick(const QModelIndex &index) { + if(Editable) + return; + + QVariant data = model()->data(index, Qt::EditRole); + toMemoEditor *ed = new toMemoEditor(this, data.toString()); + ed->exec(); +} + + void toResultTableView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { QTableView::selectionChanged(selected, deselected); Modified: trunk/tora/src/toresulttableview.h =================================================================== --- trunk/tora/src/toresulttableview.h 2008-02-09 20:24:05 UTC (rev 2539) +++ trunk/tora/src/toresulttableview.h 2008-02-09 21:02:24 UTC (rev 2540) @@ -119,6 +119,7 @@ void handleFirst(const QString &sql, const toConnection::exception &res, bool error); + void handleDoubleClick(const QModelIndex &); // override parent virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-02-08 20:12:43
|
Revision: 2533 http://tora.svn.sourceforge.net/tora/?rev=2533&view=rev Author: kuem01 Date: 2008-02-08 12:12:34 -0800 (Fri, 08 Feb 2008) Log Message: ----------- correct some buttons Modified Paths: -------------- trunk/tora/src/tohelpaddfileui.ui trunk/tora/src/totemplateaddfileui.ui trunk/tora/src/totemplateeditui.ui Modified: trunk/tora/src/tohelpaddfileui.ui =================================================================== --- trunk/tora/src/tohelpaddfileui.ui 2008-02-07 15:17:47 UTC (rev 2532) +++ trunk/tora/src/tohelpaddfileui.ui 2008-02-08 20:12:34 UTC (rev 2533) @@ -1,142 +1,202 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toHelpAddFileUI</class> - <widget class="QDialog" name="toHelpAddFileUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>434</width> - <height>164</height> - </rect> - </property> - <property name="windowTitle" > - <string>Add help directory</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item rowspan="1" row="3" column="0" colspan="2" > - <widget class="QLineEdit" name="Filename" /> - </item> - <item row="3" column="2" > - <widget class="QPushButton" name="Browse" > - <property name="text" > - <string>&Browse</string> - </property> - </widget> - </item> - <item rowspan="1" row="1" column="0" colspan="3" > - <widget class="QLineEdit" name="Root" /> - </item> - <item rowspan="1" row="4" column="0" colspan="3" > - <widget class="Line" name="Line1" /> - </item> - <item row="5" column="0" > - <spacer name="Spacer1" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </spacer> - </item> - <item row="5" column="2" > - <widget class="QPushButton" name="PushButton2_2" > - <property name="text" > - <string>Canel</string> - </property> - </widget> - </item> - <item row="5" column="1" > - <widget class="QPushButton" name="OkButton" > - <property name="text" > - <string>&Ok</string> - </property> - <property name="default" > - <bool>true</bool> - </property> - </widget> - </item> - <item rowspan="1" row="2" column="0" colspan="3" > - <widget class="QLabel" name="TextLabel1_2" > - <property name="text" > - <string>&Table of contents file</string> - </property> - <property name="buddy" > - <cstring>Root</cstring> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item rowspan="1" row="0" column="0" colspan="3" > - <widget class="QLabel" name="TextLabel1" > - <property name="text" > - <string>&Title</string> - </property> - <property name="buddy" > - <cstring>Root</cstring> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <tabstops> - <tabstop>Root</tabstop> - <tabstop>Filename</tabstop> - <tabstop>Browse</tabstop> - <tabstop>OkButton</tabstop> - <tabstop>PushButton2_2</tabstop> - </tabstops> - <connections> - <connection> - <sender>OkButton</sender> - <signal>clicked()</signal> - <receiver>toHelpAddFileUI</receiver> - <slot>accept()</slot> - </connection> - <connection> - <sender>PushButton2_2</sender> - <signal>clicked()</signal> - <receiver>toHelpAddFileUI</receiver> - <slot>reject()</slot> - </connection> - <connection> - <sender>Browse</sender> - <signal>clicked()</signal> - <receiver>toHelpAddFileUI</receiver> - <slot>browse()</slot> - </connection> - <connection> - <sender>Root</sender> - <signal>textChanged(QString)</signal> - <receiver>toHelpAddFileUI</receiver> - <slot>valid()</slot> - </connection> - <connection> - <sender>Filename</sender> - <signal>textChanged(QString)</signal> - <receiver>toHelpAddFileUI</receiver> - <slot>valid()</slot> - </connection> - </connections> +<ui version="4.0" > + <class>toHelpAddFileUI</class> + <widget class="QDialog" name="toHelpAddFileUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>434</width> + <height>164</height> + </rect> + </property> + <property name="windowTitle" > + <string>Add help directory</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="3" column="0" colspan="2" > + <widget class="QLineEdit" name="Filename" /> + </item> + <item row="3" column="2" > + <widget class="QPushButton" name="Browse" > + <property name="text" > + <string>&Browse</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="3" > + <widget class="QLineEdit" name="Root" /> + </item> + <item row="4" column="0" colspan="3" > + <widget class="Line" name="Line1" /> + </item> + <item row="5" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="5" column="2" > + <widget class="QPushButton" name="PushButton2_2" > + <property name="text" > + <string>Cancel</string> + </property> + </widget> + </item> + <item row="5" column="1" > + <widget class="QPushButton" name="OkButton" > + <property name="text" > + <string>&Ok</string> + </property> + <property name="default" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="0" colspan="3" > + <widget class="QLabel" name="TextLabel1_2" > + <property name="text" > + <string>&Table of contents file</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Root</cstring> + </property> + </widget> + </item> + <item row="0" column="0" colspan="3" > + <widget class="QLabel" name="TextLabel1" > + <property name="text" > + <string>&Title</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Root</cstring> + </property> + </widget> + </item> + </layout> + </widget> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <tabstops> + <tabstop>Root</tabstop> + <tabstop>Filename</tabstop> + <tabstop>Browse</tabstop> + <tabstop>OkButton</tabstop> + <tabstop>PushButton2_2</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>OkButton</sender> + <signal>clicked()</signal> + <receiver>toHelpAddFileUI</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>PushButton2_2</sender> + <signal>clicked()</signal> + <receiver>toHelpAddFileUI</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Browse</sender> + <signal>clicked()</signal> + <receiver>toHelpAddFileUI</receiver> + <slot>browse()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Root</sender> + <signal>textChanged(QString)</signal> + <receiver>toHelpAddFileUI</receiver> + <slot>valid()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Filename</sender> + <signal>textChanged(QString)</signal> + <receiver>toHelpAddFileUI</receiver> + <slot>valid()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> </ui> Modified: trunk/tora/src/totemplateaddfileui.ui =================================================================== --- trunk/tora/src/totemplateaddfileui.ui 2008-02-07 15:17:47 UTC (rev 2532) +++ trunk/tora/src/totemplateaddfileui.ui 2008-02-08 20:12:34 UTC (rev 2533) @@ -1,142 +1,202 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toTemplateAddFileUI</class> - <widget class="QDialog" name="toTemplateAddFileUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>438</width> - <height>164</height> - </rect> - </property> - <property name="windowTitle" > - <string>Add template file</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item rowspan="1" row="3" column="0" colspan="3" > - <widget class="QLineEdit" name="Filename" /> - </item> - <item row="3" column="4" > - <widget class="QPushButton" name="Browse" > - <property name="text" > - <string>&Browse</string> - </property> - </widget> - </item> - <item rowspan="1" row="1" column="0" colspan="5" > - <widget class="QLineEdit" name="Root" /> - </item> - <item rowspan="1" row="4" column="0" colspan="2" > - <widget class="Line" name="Line1" /> - </item> - <item rowspan="2" row="4" column="4" colspan="1" > - <widget class="QPushButton" name="PushButton2_2" > - <property name="text" > - <string>Canel</string> - </property> - </widget> - </item> - <item rowspan="2" row="4" column="2" colspan="1" > - <widget class="QPushButton" name="OkButton" > - <property name="text" > - <string>&Ok</string> - </property> - <property name="default" > - <bool>true</bool> - </property> - </widget> - </item> - <item rowspan="1" row="2" column="0" colspan="5" > - <widget class="QLabel" name="TextLabel1_2" > - <property name="text" > - <string>&File</string> - </property> - <property name="buddy" > - <cstring>Root</cstring> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item rowspan="1" row="0" column="0" colspan="5" > - <widget class="QLabel" name="TextLabel1" > - <property name="text" > - <string>&Root</string> - </property> - <property name="buddy" > - <cstring>Root</cstring> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="5" column="1" > - <spacer name="Spacer1" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </spacer> - </item> - </layout> - </widget> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <tabstops> - <tabstop>Root</tabstop> - <tabstop>Filename</tabstop> - <tabstop>Browse</tabstop> - <tabstop>OkButton</tabstop> - <tabstop>PushButton2_2</tabstop> - </tabstops> - <connections> - <connection> - <sender>OkButton</sender> - <signal>clicked()</signal> - <receiver>toTemplateAddFileUI</receiver> - <slot>accept()</slot> - </connection> - <connection> - <sender>PushButton2_2</sender> - <signal>clicked()</signal> - <receiver>toTemplateAddFileUI</receiver> - <slot>reject()</slot> - </connection> - <connection> - <sender>Browse</sender> - <signal>clicked()</signal> - <receiver>toTemplateAddFileUI</receiver> - <slot>browse()</slot> - </connection> - <connection> - <sender>Root</sender> - <signal>textChanged(QString)</signal> - <receiver>toTemplateAddFileUI</receiver> - <slot>valid()</slot> - </connection> - <connection> - <sender>Filename</sender> - <signal>textChanged(QString)</signal> - <receiver>toTemplateAddFileUI</receiver> - <slot>valid()</slot> - </connection> - </connections> +<ui version="4.0" > + <class>toTemplateAddFileUI</class> + <widget class="QDialog" name="toTemplateAddFileUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>438</width> + <height>164</height> + </rect> + </property> + <property name="windowTitle" > + <string>Add template file</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="3" column="0" colspan="3" > + <widget class="QLineEdit" name="Filename" /> + </item> + <item row="3" column="4" > + <widget class="QPushButton" name="Browse" > + <property name="text" > + <string>&Browse</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="5" > + <widget class="QLineEdit" name="Root" /> + </item> + <item row="4" column="0" colspan="2" > + <widget class="Line" name="Line1" /> + </item> + <item rowspan="2" row="4" column="4" > + <widget class="QPushButton" name="PushButton2_2" > + <property name="text" > + <string>Cancel</string> + </property> + </widget> + </item> + <item rowspan="2" row="4" column="2" > + <widget class="QPushButton" name="OkButton" > + <property name="text" > + <string>&Ok</string> + </property> + <property name="default" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="0" colspan="5" > + <widget class="QLabel" name="TextLabel1_2" > + <property name="text" > + <string>&File</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Root</cstring> + </property> + </widget> + </item> + <item row="0" column="0" colspan="5" > + <widget class="QLabel" name="TextLabel1" > + <property name="text" > + <string>&Root</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Root</cstring> + </property> + </widget> + </item> + <item row="5" column="1" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <tabstops> + <tabstop>Root</tabstop> + <tabstop>Filename</tabstop> + <tabstop>Browse</tabstop> + <tabstop>OkButton</tabstop> + <tabstop>PushButton2_2</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>OkButton</sender> + <signal>clicked()</signal> + <receiver>toTemplateAddFileUI</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>PushButton2_2</sender> + <signal>clicked()</signal> + <receiver>toTemplateAddFileUI</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Browse</sender> + <signal>clicked()</signal> + <receiver>toTemplateAddFileUI</receiver> + <slot>browse()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Root</sender> + <signal>textChanged(QString)</signal> + <receiver>toTemplateAddFileUI</receiver> + <slot>valid()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Filename</sender> + <signal>textChanged(QString)</signal> + <receiver>toTemplateAddFileUI</receiver> + <slot>valid()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> </ui> Modified: trunk/tora/src/totemplateeditui.ui =================================================================== --- trunk/tora/src/totemplateeditui.ui 2008-02-07 15:17:47 UTC (rev 2532) +++ trunk/tora/src/totemplateeditui.ui 2008-02-08 20:12:34 UTC (rev 2533) @@ -165,7 +165,7 @@ <string>Remove the current template</string> </property> <property name="text" > - <string/> + <string>Remove</string> </property> <property name="icon" > <iconset/> @@ -184,7 +184,7 @@ <string>Add new template</string> </property> <property name="text" > - <string/> + <string>Add</string> </property> <property name="icon" > <iconset/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-02-09 18:16:57
|
Revision: 2537 http://tora.svn.sourceforge.net/tora/?rev=2537&view=rev Author: kuem01 Date: 2008-02-09 10:16:38 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/tora/src/totemplate.cpp trunk/tora/src/totemplate.h Modified: trunk/tora/src/totemplate.cpp =================================================================== --- trunk/tora/src/totemplate.cpp 2008-02-09 17:18:04 UTC (rev 2536) +++ trunk/tora/src/totemplate.cpp 2008-02-09 18:16:38 UTC (rev 2537) @@ -69,8 +69,8 @@ QString file = toPluginPath(); #if !defined(TO_NO_ORACLE) - file += QString::fromLatin1("/sqlfunctions.tpl"); - def["PL/SQL Functions"] = file; + file += QString::fromLatin1("/sqlfunctions.tpl"); + def["PL/SQL Functions"] = file; file = toPluginPath(); file += QString::fromLatin1("/hints.tpl"); def["Optimizer Hints"] = file; @@ -82,234 +82,215 @@ return def; } -class toTemplateEdit : public QDialog, public Ui::toTemplateEditUI, public toHelpContext +toTemplateEdit::toTemplateEdit(std::map<QString, QString> &pairs, + QWidget *parent, const char *name) : + QDialog(parent),//, name, true, Qt::WStyle_Maximize), + toHelpContext(QString::fromLatin1("template.html#editor")), + TemplateMap(pairs) { + setupUi(this); + toHelp::connectDialog(this); + LastTemplate = TemplateMap.end(); + updateFromMap(); + Description->setWrapMode(QsciScintilla::WrapWord); +} + +void toTemplateEdit::connectList(bool conn) { + if (conn) + connect(Templates, SIGNAL(selectionChanged()), this, + SLOT(changeSelection())); + else + disconnect(Templates, SIGNAL(selectionChanged()), this, + SLOT(changeSelection())); +} + +toTreeWidgetItem *toTemplateEdit::findLast(void) { - std::map<QString, QString> &TemplateMap; - std::map<QString, QString>::iterator LastTemplate; - void connectList(bool conn) - { - if (conn) - connect(Templates, SIGNAL(selectionChanged()), this, SLOT(changeSelection())); - else - disconnect(Templates, SIGNAL(selectionChanged()), this, SLOT(changeSelection())); - } - toTreeWidgetItem *findLast(void) - { - QString name = (*LastTemplate).first; - return toFindItem(Templates, name); - } - void allocateItem(void) - { - QStringList lst = Name->text().split(QString::fromLatin1(":")); - int li = 0; - toTreeWidgetItem *parent = NULL; - for (toTreeWidgetItem *item = Templates->firstChild();item && li < lst.count();) - { - if (item->text(0) == lst[li]) - { - li++; - parent = item; - item = item->firstChild(); - } - else - item = item->nextSibling(); - } - while (li < lst.count()) - { - if (parent) - parent = new toTreeWidgetItem(parent, lst[li]); - else - parent = new toTreeWidgetItem(Templates, lst[li]); - li++; - } - } - bool clearUnused(toTreeWidgetItem *first, const QString &pre) - { - bool ret = false; - while (first) - { - toTreeWidgetItem *delitem = first; - QString str = pre; - if (!str.isEmpty()) - str += ":"; - str += first->text(0).toLatin1(); - if (first->firstChild() && clearUnused(first->firstChild(), str)) - delitem = NULL; - if (delitem && TemplateMap.find(str) != TemplateMap.end()) - delitem = NULL; - first = first->nextSibling(); - if (!delitem) - ret = true; - else - delete delitem; - } - return ret; - } -public: - virtual void updateFromMap(void) - { - try - { - while (Templates->firstChild()) - delete Templates->firstChild(); - toTreeWidgetItem *last = NULL; - int lastLevel = 0; - QStringList lstCtx; - for (std::map<QString, QString>::iterator i = TemplateMap.begin();i != TemplateMap.end();i++) - { - QStringList ctx = (*i).first.split(":"); - if (last) - { - while (last && lastLevel >= int(ctx.count())) - { - last = last->parent(); - lastLevel--; - } - while (last && lastLevel >= 0 && !toCompareLists(lstCtx, ctx, (unsigned int)lastLevel)) - { - last = last->parent(); - lastLevel--; - } - } - if (lastLevel < 0) - throw qApp->translate("toTemplateEdit", "Internal error, lastLevel < 0"); - while (lastLevel < int(ctx.count()) - 1) - { - if (last) - last = new toTreeWidgetItem(last, ctx[lastLevel]); - else - last = new toTreeWidgetItem(Templates, ctx[lastLevel]); - last->setOpen(true); - lastLevel++; - } - if (last) - last = new toTreeWidgetItem(last, ctx[lastLevel]); - else - last = new toTreeWidgetItem(Templates, ctx[lastLevel]); - last->setOpen(true); - if (i == LastTemplate) - last->setSelected(true); - lstCtx = ctx; - lastLevel++; - } - } - catch (const QString &str) - { - toStatusMessage(str); - reject(); - } - } - toTemplateEdit(std::map<QString, QString> &pairs, QWidget *parent, const char *name = 0) - : QDialog(parent),//, name, true, Qt::WStyle_Maximize), - toHelpContext(QString::fromLatin1("template.html#editor")), - TemplateMap(pairs) - { - setupUi(this); - toHelp::connectDialog(this); - LastTemplate = TemplateMap.end(); - updateFromMap(); - Description->setWrapMode(QsciScintilla::WrapWord); - } - virtual void remove - (void) - { - if (LastTemplate != TemplateMap.end()) - { - toTreeWidgetItem *item = findLast(); - TemplateMap.erase(LastTemplate); - LastTemplate = TemplateMap.end(); - Name->setText(QString::null); - Description->setText(QString::null); - if (item) - { - connectList(false); - clearUnused(Templates->firstChild(), ""); - connectList(true); - } - } - } - virtual void preview(void) - { - Preview->setText(Description->text()); - } - QString name(toTreeWidgetItem *item) - { - QString str = item->text(0).toLatin1(); - for (item = item->parent();item;item = item->parent()) - { - str.prepend(":"); - str.prepend(item->text(0).toLatin1()); - } - return str; - } - virtual void newTemplate(void) - { - changeSelection(); - LastTemplate = TemplateMap.end(); - Description->setText(QString::null); - toTreeWidgetItem *item = Templates->selectedItem(); - if (item) - { - connectList(false); - Templates->setSelected(item, false); - connectList(true); - item = item->parent(); - } - QString str; - if (item) - { - str = name(item); - str += ":"; - } - Name->setText(str); - } - virtual void changeSelection(void) - { - bool update = false; - if (LastTemplate != TemplateMap.end()) - { - if (Name->text().toLatin1() != (*LastTemplate).first || - Description->text() != (*LastTemplate).second) - { - TemplateMap.erase(LastTemplate); - TemplateMap[Name->text().toLatin1()] = Description->text(); - allocateItem(); - update = true; - } - } - else if (!Name->text().isEmpty()) - { - TemplateMap[Name->text().toLatin1()] = Description->text(); - allocateItem(); - update = true; - } - LastTemplate = TemplateMap.end(); + QString name = (*LastTemplate).first; + return toFindItem(Templates, name); +} +void toTemplateEdit::allocateItem(void) { + QStringList lst = + QStringList::split(QString::fromLatin1(":"), Name->text()); + int li = 0; + toTreeWidgetItem *parent = NULL; + for (toTreeWidgetItem *item = Templates->firstChild(); item && li + < lst.count();) { + if (item->text(0) == lst[li]) { + li++; + parent = item; + item = item->firstChild(); + } else + item = item->nextSibling(); + } + while (li < lst.count()) { + if (parent) + parent = new toTreeWidgetItem(parent, lst[li]); + else + parent = new toTreeWidgetItem(Templates, lst[li]); + li++; + } +} - toTreeWidgetItem *item = Templates->selectedItem(); - if (item) - { - QString str = name(item); - LastTemplate = TemplateMap.find(str); - if (LastTemplate != TemplateMap.end()) - { - Name->setText(QString((*LastTemplate).first)); - Description->setText((*LastTemplate).second); - Preview->setText((*LastTemplate).second); - } - else - { - Name->setText(QString::null); - Description->clear(); - Preview->setText(QString::null); - } - } - else - LastTemplate = TemplateMap.end(); - clearUnused(Templates->firstChild(), ""); - } -}; +bool toTemplateEdit::clearUnused(toTreeWidgetItem *first, const QString &pre) { + bool ret = false; + while (first) { + toTreeWidgetItem *delitem = first; + QString str = pre; + if (!str.isEmpty()) + str += ":"; + str += first->text(0).latin1(); + if (first->firstChild() && clearUnused(first->firstChild(), str)) + delitem = NULL; + if (delitem && TemplateMap.find(str) != TemplateMap.end()) + delitem = NULL; + first = first->nextSibling(); + if (!delitem) + ret = true; + else + delete delitem; + } + return ret; +} +void toTemplateEdit::updateFromMap(void) { + try + { + while (Templates->firstChild()) + delete Templates->firstChild(); + toTreeWidgetItem *last = NULL; + int lastLevel = 0; + QStringList lstCtx; + for (std::map<QString, QString>::iterator i = TemplateMap.begin();i != TemplateMap.end();i++) + { + QStringList ctx = QStringList::split(QString::fromLatin1(":"), QString::fromLatin1((*i).first)); + if (last) + { + while (last && lastLevel >= int(ctx.count())) + { + last = last->parent(); + lastLevel--; + } + while (last && lastLevel >= 0 && !toCompareLists(lstCtx, ctx, (unsigned int)lastLevel)) + { + last = last->parent(); + lastLevel--; + } + } + if (lastLevel < 0) + throw qApp->translate("toTemplateEdit", "Internal error, lastLevel < 0"); + while (lastLevel < int(ctx.count()) - 1) + { + if (last) + last = new toTreeWidgetItem(last, ctx[lastLevel]); + else + last = new toTreeWidgetItem(Templates, ctx[lastLevel]); + last->setOpen(true); + lastLevel++; + } + if (last) + last = new toTreeWidgetItem(last, ctx[lastLevel]); + else + last = new toTreeWidgetItem(Templates, ctx[lastLevel]); + last->setOpen(true); + if (i == LastTemplate) + last->setSelected(true); + lstCtx = ctx; + lastLevel++; + } + } + catch (const QString &str) + { + toStatusMessage(str); + reject(); + } +} +void toTemplateEdit::remove(void) { + if (LastTemplate != TemplateMap.end()) { + toTreeWidgetItem *item = findLast(); + TemplateMap.erase(LastTemplate); + LastTemplate = TemplateMap.end(); + Name->setText(QString::null); + Description->setText(QString::null); + if (item) + { + connectList(false); + clearUnused(Templates->firstChild(), ""); + connectList(true); + } + } +} + +void toTemplateEdit::preview(void) { + Preview->setText(Description->text()); +} + +QString toTemplateEdit::name(toTreeWidgetItem *item) { + QString str = item->text(0).latin1(); + for (item = item->parent(); item; item = item->parent()) { + str.prepend(":"); + str.prepend(item->text(0).latin1()); + } + return str; +} + +void toTemplateEdit::newTemplate(void) { + changeSelection(); + LastTemplate = TemplateMap.end(); + Description->setText(QString::null); + toTreeWidgetItem *item = Templates->selectedItem(); + if (item) + { + connectList(false); + Templates->setSelected(item, false); + connectList(true); + item = item->parent(); + } + QString str; + if (item) + { + str = name(item); + str += ":"; + } + Name->setText(str); +} + +void toTemplateEdit::changeSelection(void) { + bool update = false; + if (LastTemplate != TemplateMap.end()) { + if (Name->text().latin1() != (*LastTemplate).first || Description->text() != (*LastTemplate).second) { + TemplateMap.erase(LastTemplate); + TemplateMap[Name->text().latin1()] = Description->text(); + allocateItem(); + update = true; + } + } else if (!Name->text().isEmpty()) { + TemplateMap[Name->text().latin1()] = Description->text(); + allocateItem(); + update = true; + } + LastTemplate = TemplateMap.end(); + + toTreeWidgetItem *item = Templates->selectedItem(); + if (item) { + QString str = name(item); + LastTemplate = TemplateMap.find(str); + if (LastTemplate != TemplateMap.end()) { + Name->setText(QString::fromLatin1((*LastTemplate).first)); + Description->setText((*LastTemplate).second); + Preview->setText((*LastTemplate).second); + } else { + Name->setText(QString::null); + Description->clear(); + Preview->setText(QString::null); + } + } + else + LastTemplate = TemplateMap.end(); + clearUnused(Templates->firstChild(), ""); +} + + toTemplateAddFile::toTemplateAddFile(QWidget *parent, const char *name) : QDialog(parent) { Modified: trunk/tora/src/totemplate.h =================================================================== --- trunk/tora/src/totemplate.h 2008-02-09 17:18:04 UTC (rev 2536) +++ trunk/tora/src/totemplate.h 2008-02-09 18:16:38 UTC (rev 2537) @@ -363,4 +363,29 @@ virtual void valid(void); }; +class toTemplateEdit : public QDialog, + public Ui::toTemplateEditUI, + public toHelpContext { + Q_OBJECT; + + std::map<QString, QString> &TemplateMap; + std::map<QString, QString>::iterator LastTemplate; + +public: + void connectList(bool conn); + toTreeWidgetItem *findLast(void); + void allocateItem(void); + bool clearUnused(toTreeWidgetItem *first, const QString &pre); + toTemplateEdit(std::map<QString, QString> &pairs, QWidget *parent, const char *name = 0); + QString name(toTreeWidgetItem *item); + +public slots: + virtual void updateFromMap(void); + virtual void remove(void); + virtual void preview(void); + virtual void newTemplate(void); + virtual void changeSelection(void); + +}; + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 17:30:29
|
Revision: 2541 http://tora.svn.sourceforge.net/tora/?rev=2541&view=rev Author: mrjohnson0 Date: 2008-02-10 09:30:35 -0800 (Sun, 10 Feb 2008) Log Message: ----------- ported q3buttongroup Modified Paths: -------------- trunk/tora/src/tobrowser.cpp trunk/tora/src/tobrowserfilterui.ui Modified: trunk/tora/src/tobrowser.cpp =================================================================== --- trunk/tora/src/tobrowser.cpp 2008-02-09 21:02:24 UTC (rev 2540) +++ trunk/tora/src/tobrowser.cpp 2008-02-10 17:30:35 UTC (rev 2541) @@ -85,6 +85,7 @@ #include <QPixmap> #include <QString> #include <QVBoxLayout> +#include <QButtonGroup> #include "icons/addindex.xpm" #include "icons/addtable.xpm" @@ -431,9 +432,29 @@ }; class toBrowserFilterSetup : public QDialog, public Ui::toBrowserFilterUI { +private: + QButtonGroup *ButtonsGroup; + QButtonGroup *TypeGroup; + public: void setup(bool temp) { toHelp::connectDialog(this); + + // qbuttongroup is not a widget. awesome. guess they'll fix + // that in qt5. + ButtonsGroup = new QButtonGroup(ButtonsBox); + ButtonsGroup->addButton(None, 0); + ButtonsGroup->addButton(StartWith, 1); + ButtonsGroup->addButton(EndWith, 2); + ButtonsGroup->addButton(Contains, 3); + ButtonsGroup->addButton(CommaSeparate, 4); + ButtonsGroup->addButton(RegExp, 5); + + TypeGroup = new QButtonGroup(TablespaceType); + TypeGroup->addButton(IncludeAll, 0); + TypeGroup->addButton(Include, 1); + TypeGroup->addButton(Exclude, 2); + if (!temp) { OnlyOwnSchema->hide(); Tablespaces->setNumberColumn(false); @@ -460,9 +481,15 @@ setupUi(this); setup(temp); - Buttons->setButton(cur.Type); + QAbstractButton *b = ButtonsGroup->button(cur.Type); + if(b) + b->setChecked(true); + if (!TablespaceType->isHidden()) { - TablespaceType->setButton(cur.TablespaceType); + b = TypeGroup->button(cur.TablespaceType); + if(b) + b->setChecked(true); + for(std::list<QString>::iterator i = cur.Tablespaces.begin(); i != cur.Tablespaces.end(); i++) { @@ -487,11 +514,11 @@ tablespaces.insert(tablespaces.end(), (*it)->text(0)); } - return new toBrowserFilter(Buttons->id(Buttons->selected()), + return new toBrowserFilter(ButtonsGroup->id(ButtonsGroup->checkedButton()), IgnoreCase->isChecked(), Invert->isChecked(), String->text(), - TablespaceType->id(TablespaceType->selected()), + TypeGroup->id(TypeGroup->checkedButton()), tablespaces, OnlyOwnSchema->isChecked()); } Modified: trunk/tora/src/tobrowserfilterui.ui =================================================================== --- trunk/tora/src/tobrowserfilterui.ui 2008-02-09 21:02:24 UTC (rev 2540) +++ trunk/tora/src/tobrowserfilterui.ui 2008-02-10 17:30:35 UTC (rev 2541) @@ -1,362 +1,426 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toBrowserFilterUI</class> - <widget class="QDialog" name="toBrowserFilterUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>464</width> - <height>378</height> - </rect> - </property> - <property name="windowTitle" > - <string>Filter setting</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="4" column="0" > - <spacer name="Spacer1" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> +<ui version="4.0" > + <class>toBrowserFilterUI</class> + <widget class="QDialog" name="toBrowserFilterUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>646</width> + <height>484</height> + </rect> + </property> + <property name="windowTitle" > + <string>Filter setting</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="4" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="4" column="1" > + <widget class="QPushButton" name="OkButton" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>&Ok</string> + </property> + <property name="default" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="4" column="2" > + <widget class="QPushButton" name="Cancel" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Cancel</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="3" > + <widget class="QGroupBox" name="ButtonsBox" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Maximum" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="title" > + <string>Filter on name</string> + </property> + <layout class="QVBoxLayout" > + <item> + <layout class="QHBoxLayout" > + <item> + <widget class="QRadioButton" name="None" > + <property name="text" > + <string>&No filter</string> </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> + <property name="checked" > + <bool>true</bool> </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> + <property name="buttonGroupId" stdset="0" > + <number>0</number> </property> - </spacer> - </item> - <item row="4" column="1" > - <widget class="QPushButton" name="OkButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> + </widget> + </item> + <item> + <widget class="QRadioButton" name="StartWith" > + <property name="toolTip" > + <string>Object name start with</string> </property> <property name="text" > - <string>&Ok</string> + <string>&Start with</string> </property> - <property name="default" > - <bool>true</bool> + <property name="buttonGroupId" stdset="0" > + <number>1</number> </property> - </widget> - </item> - <item row="4" column="2" > - <widget class="QPushButton" name="Cancel" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> + </widget> + </item> + <item> + <widget class="QRadioButton" name="EndWith" > + <property name="toolTip" > + <string>Object name ends in</string> </property> <property name="text" > - <string>Cancel</string> + <string>&End with</string> </property> - </widget> - </item> - <item rowspan="1" row="1" column="0" colspan="3" > - <widget class="Q3ButtonGroup" name="Buttons" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>4</vsizetype> - </sizepolicy> + <property name="buttonGroupId" stdset="0" > + <number>2</number> </property> - <property name="title" > - <string>Filter on name</string> + </widget> + </item> + <item> + <widget class="QRadioButton" name="Contains" > + <property name="toolTip" > + <string>Object name contains</string> </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item rowspan="1" row="1" column="0" colspan="6" > - <widget class="QLineEdit" name="String" > - <property name="enabled" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="0" > - <widget class="QRadioButton" name="None" > - <property name="text" > - <string>&No filter</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - <property name="buttonGroupId" > - <number>0</number> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QRadioButton" name="StartWith" > - <property name="text" > - <string>&Start with</string> - </property> - <property name="buttonGroupId" > - <number>1</number> - </property> - <property name="toolTip" > - <string>Object name start with</string> - </property> - </widget> - </item> - <item row="0" column="2" > - <widget class="QRadioButton" name="EndWith" > - <property name="text" > - <string>&End with</string> - </property> - <property name="buttonGroupId" > - <number>2</number> - </property> - <property name="toolTip" > - <string>Object name ends in</string> - </property> - </widget> - </item> - <item row="0" column="3" > - <widget class="QRadioButton" name="Contains" > - <property name="text" > - <string>&Contains</string> - </property> - <property name="buttonGroupId" > - <number>3</number> - </property> - <property name="toolTip" > - <string>Object name contains</string> - </property> - </widget> - </item> - <item row="0" column="5" > - <widget class="QRadioButton" name="RegExp" > - <property name="text" > - <string>&RegExp</string> - </property> - <property name="buttonGroupId" > - <number>5</number> - </property> - <property name="toolTip" > - <string>Object name matches RegExp</string> - </property> - </widget> - </item> - <item row="0" column="4" > - <widget class="QRadioButton" name="CommaSeparate" > - <property name="text" > - <string>&Comma list</string> - </property> - <property name="buttonGroupId" > - <number>4</number> - </property> - <property name="toolTip" > - <string>Comma separated list of object names</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="3" column="0" > - <spacer name="Spacer2" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> + <property name="text" > + <string>&Contains</string> </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> + <property name="buttonGroupId" stdset="0" > + <number>3</number> </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> + </widget> + </item> + <item> + <widget class="QRadioButton" name="CommaSeparate" > + <property name="toolTip" > + <string>Comma separated list of object names</string> </property> - </spacer> - </item> - <item rowspan="1" row="2" column="0" colspan="3" > - <widget class="Q3ButtonGroup" name="TablespaceType" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>7</vsizetype> - </sizepolicy> + <property name="text" > + <string>&Comma list</string> </property> - <property name="title" > - <string>Filter on tablespace</string> + <property name="buttonGroupId" stdset="0" > + <number>4</number> </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QRadioButton" name="IncludeAll" > - <property name="text" > - <string>Include &All</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QRadioButton" name="Include" > - <property name="text" > - <string>&Include</string> - </property> - </widget> - </item> - <item row="0" column="2" > - <widget class="QRadioButton" name="Exclude" > - <property name="text" > - <string>&Exclude</string> - </property> - </widget> - </item> - <item rowspan="1" row="1" column="0" colspan="3" > - <widget class="toResultView" name="Tablespaces" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="focusPolicy" > - <enum>Qt::StrongFocus</enum> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item rowspan="1" row="0" column="0" colspan="3" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> + </widget> + </item> + <item> + <widget class="QRadioButton" name="RegExp" > + <property name="toolTip" > + <string>Object name matches RegExp</string> </property> - <property name="spacing" > - <number>6</number> + <property name="text" > + <string>&RegExp</string> </property> - <item> - <widget class="QCheckBox" name="OnlyOwnSchema" > - <property name="text" > - <string>Only display own schema</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="IgnoreCase" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="text" > - <string>Ignore &Case</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="Invert" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="text" > - <string>&Invert selection</string> - </property> - </widget> - </item> - </layout> + <property name="buttonGroupId" stdset="0" > + <number>5</number> + </property> + </widget> + </item> + </layout> </item> + <item> + <widget class="QLineEdit" name="String" > + <property name="enabled" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="0" colspan="3" > + <widget class="QGroupBox" name="TablespaceType" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Filter on tablespace</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="0" > + <widget class="QRadioButton" name="IncludeAll" > + <property name="text" > + <string>Include &All</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QRadioButton" name="Include" > + <property name="text" > + <string>&Include</string> + </property> + </widget> + </item> + <item row="0" column="2" > + <widget class="QRadioButton" name="Exclude" > + <property name="text" > + <string>&Exclude</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="3" > + <widget class="toResultView" native="1" name="Tablespaces" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="focusPolicy" > + <enum>Qt::StrongFocus</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="0" colspan="3" > + <layout class="QHBoxLayout" > + <property name="spacing" > + <number>6</number> + </property> + <property name="leftMargin" > + <number>0</number> + </property> + <property name="topMargin" > + <number>0</number> + </property> + <property name="rightMargin" > + <number>0</number> + </property> + <property name="bottomMargin" > + <number>0</number> + </property> + <item> + <widget class="QCheckBox" name="OnlyOwnSchema" > + <property name="text" > + <string>Only display own schema</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="IgnoreCase" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="text" > + <string>Ignore &Case</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="Invert" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="text" > + <string>&Invert selection</string> + </property> + </widget> + </item> </layout> - </widget> - <customwidgets> - <customwidget> - <class>toResultView</class> - <extends>QWidget</extends> - <header location="local" >toresultview.h</header> - <sizehint> - <width>50</width> - <height>50</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>5</hordata> - <verdata>5</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> - </customwidgets> - <tabstops> - <tabstop>OnlyOwnSchema</tabstop> - <tabstop>IgnoreCase</tabstop> - <tabstop>Invert</tabstop> - <tabstop>None</tabstop> - <tabstop>String</tabstop> - <tabstop>IncludeAll</tabstop> - <tabstop>Include</tabstop> - <tabstop>Exclude</tabstop> - <tabstop>Tablespaces</tabstop> - <tabstop>OkButton</tabstop> - <tabstop>Cancel</tabstop> - </tabstops> - <images> - <image name="image0" > - <data format="XPM.GZ" length="646" >789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> - </image> - </images> - <connections> - <connection> - <sender>None</sender> - <signal>toggled(bool)</signal> - <receiver>String</receiver> - <slot>setDisabled(bool)</slot> - </connection> - <connection> - <sender>None</sender> - <signal>toggled(bool)</signal> - <receiver>IgnoreCase</receiver> - <slot>setDisabled(bool)</slot> - </connection> - <connection> - <sender>None</sender> - <signal>toggled(bool)</signal> - <receiver>Invert</receiver> - <slot>setDisabled(bool)</slot> - </connection> - <connection> - <sender>Cancel</sender> - <signal>clicked()</signal> - <receiver>toBrowserFilterUI</receiver> - <slot>reject()</slot> - </connection> - <connection> - <sender>OkButton</sender> - <signal>clicked()</signal> - <receiver>toBrowserFilterUI</receiver> - <slot>accept()</slot> - </connection> - <connection> - <sender>IncludeAll</sender> - <signal>toggled(bool)</signal> - <receiver>Tablespaces</receiver> - <slot>setDisabled(bool)</slot> - </connection> - </connections> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>toResultView</class> + <extends>QWidget</extends> + <header>toresultview.h</header> + </customwidget> + </customwidgets> + <tabstops> + <tabstop>OnlyOwnSchema</tabstop> + <tabstop>IgnoreCase</tabstop> + <tabstop>Invert</tabstop> + <tabstop>None</tabstop> + <tabstop>String</tabstop> + <tabstop>IncludeAll</tabstop> + <tabstop>Include</tabstop> + <tabstop>Exclude</tabstop> + <tabstop>Tablespaces</tabstop> + <tabstop>OkButton</tabstop> + <tabstop>Cancel</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>None</sender> + <signal>toggled(bool)</signal> + <receiver>String</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>None</sender> + <signal>toggled(bool)</signal> + <receiver>IgnoreCase</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>None</sender> + <signal>toggled(bool)</signal> + <receiver>Invert</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Cancel</sender> + <signal>clicked()</signal> + <receiver>toBrowserFilterUI</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>OkButton</sender> + <signal>clicked()</signal> + <receiver>toBrowserFilterUI</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>IncludeAll</sender> + <signal>toggled(bool)</signal> + <receiver>Tablespaces</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> </ui> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 19:14:47
|
Revision: 2547 http://tora.svn.sourceforge.net/tora/?rev=2547&view=rev Author: mrjohnson0 Date: 2008-02-10 11:14:51 -0800 (Sun, 10 Feb 2008) Log Message: ----------- simple replace of q3groupbox Modified Paths: -------------- trunk/tora/src/tolinechartsetupui.ui trunk/tora/src/toscriptui.ui trunk/tora/src/tostoragedatafileui.ui trunk/tora/src/totuning.cpp trunk/tora/src/totuningoverviewui.ui trunk/tora/src/totuningsettingui.ui trunk/tora/src/toworksheetsetupui.ui Modified: trunk/tora/src/tolinechartsetupui.ui =================================================================== --- trunk/tora/src/tolinechartsetupui.ui 2008-02-10 19:13:15 UTC (rev 2546) +++ trunk/tora/src/tolinechartsetupui.ui 2008-02-10 19:14:51 UTC (rev 2547) @@ -1,301 +1,368 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toLineChartSetupUI</class> - <widget class="QDialog" name="toLineChartSetupUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>596</width> - <height>483</height> - </rect> - </property> - <property name="windowTitle" > - <string>Chart setup</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> +<ui version="4.0" > + <class>toLineChartSetupUI</class> + <widget class="QDialog" name="toLineChartSetupUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>596</width> + <height>483</height> + </rect> + </property> + <property name="windowTitle" > + <string>Chart setup</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="5" column="1" > + <widget class="QSpinBox" name="Samples" > + <property name="maximum" > + <number>1000</number> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="TextLabel1_2" > + <property name="text" > + <string>Number of samples to keep</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="0" column="0" colspan="3" > + <widget class="QGroupBox" name="GroupBox1" > + <property name="title" > + <string>Y-axis</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> </property> - <property name="spacing" > - <number>6</number> + <property name="topMargin" > + <number>11</number> </property> - <item row="5" column="1" > - <widget class="QSpinBox" name="Samples" > - <property name="maximum" > - <number>1000</number> - </property> - </widget> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="0" > + <widget class="QLabel" name="TextLabel1" > + <property name="text" > + <string>Max value</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> </item> + <item row="3" column="0" > + <widget class="QLabel" name="TextLabel4" > + <property name="text" > + <string>Min value</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> <item row="5" column="0" > - <widget class="QLabel" name="TextLabel1_2" > - <property name="text" > - <string>Number of samples to keep</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> + <widget class="QLineEdit" name="MinValue" /> </item> - <item rowspan="1" row="0" column="0" colspan="3" > - <widget class="Q3GroupBox" name="GroupBox1" > - <property name="title" > - <string>Y-axis</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="TextLabel1" > - <property name="text" > - <string>Max value</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="TextLabel4" > - <property name="text" > - <string>Min value</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLineEdit" name="MinValue" /> - </item> - <item row="2" column="0" > - <widget class="QLineEdit" name="MaxValue" /> - </item> - <item row="1" column="0" > - <widget class="QCheckBox" name="AutoMax" > - <property name="text" > - <string>Auto detect</string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QCheckBox" name="AutoMin" > - <property name="text" > - <string>Auto detect</string> - </property> - </widget> - </item> - </layout> - </widget> + <item row="2" column="0" > + <widget class="QLineEdit" name="MaxValue" /> </item> - <item row="7" column="1" > - <spacer name="Spacer2" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> + <item row="1" column="0" > + <widget class="QCheckBox" name="AutoMax" > + <property name="text" > + <string>Auto detect</string> + </property> + </widget> </item> - <item rowspan="1" row="1" column="0" colspan="3" > - <widget class="QCheckBox" name="ShowLast" > - <property name="text" > - <string>Show last value</string> - </property> - </widget> - </item> - <item rowspan="1" row="2" column="0" colspan="3" > - <widget class="QCheckBox" name="ShowAxis" > - <property name="text" > - <string>Show axis legend</string> - </property> - </widget> - </item> - <item rowspan="1" row="3" column="0" colspan="3" > - <widget class="QCheckBox" name="ShowLegend" > - <property name="text" > - <string>Show chart legend</string> - </property> - </widget> - </item> - <item row="8" column="3" > - <widget class="QPushButton" name="OkButton" > - <property name="text" > - <string>&Ok</string> - </property> - <property name="default" > - <bool>true</bool> - </property> - </widget> - </item> - <item row="8" column="4" > - <widget class="QPushButton" name="CancelButton" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - <item rowspan="1" row="8" column="0" colspan="3" > - <spacer name="Spacer1" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </spacer> - </item> - <item rowspan="8" row="0" column="3" colspan="2" > - <widget class="toListView" name="Enabled" /> - </item> - <item row="6" column="1" > - <widget class="QSpinBox" name="DisplaySamples" > - <property name="maximum" > - <number>1000</number> - </property> - </widget> - </item> - <item row="6" column="2" > - <widget class="QCheckBox" name="AllSamples" > - <property name="text" > - <string>All</string> - </property> - </widget> - </item> - <item row="6" column="0" > - <widget class="QLabel" name="TextLabel1_2_2" > - <property name="text" > - <string>Maximum number of samples to display</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="5" column="2" > - <widget class="QCheckBox" name="UnlimitedSamples" > - <property name="text" > - <string>Unlimited</string> - </property> - </widget> - </item> <item row="4" column="0" > - <widget class="QLabel" name="TextLabel5" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>1</vsizetype> - </sizepolicy> - </property> - <property name="text" > - <string>Divide chart in grids?</string> - </property> - <property name="buddy" > - <cstring>Grids</cstring> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> + <widget class="QCheckBox" name="AutoMin" > + <property name="text" > + <string>Auto detect</string> + </property> + </widget> </item> - <item row="4" column="1" > - <widget class="QSpinBox" name="Grids" /> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>toListView</class> - <extends>QWidget</extends> - <header location="local" >toresultview.h</header> - <sizehint> - <width>-1</width> - <height>-1</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>5</hordata> - <verdata>5</verdata> + </layout> + </widget> + </item> + <item row="7" column="1" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0" colspan="3" > + <widget class="QCheckBox" name="ShowLast" > + <property name="text" > + <string>Show last value</string> + </property> + </widget> + </item> + <item row="2" column="0" colspan="3" > + <widget class="QCheckBox" name="ShowAxis" > + <property name="text" > + <string>Show axis legend</string> + </property> + </widget> + </item> + <item row="3" column="0" colspan="3" > + <widget class="QCheckBox" name="ShowLegend" > + <property name="text" > + <string>Show chart legend</string> + </property> + </widget> + </item> + <item row="8" column="3" > + <widget class="QPushButton" name="OkButton" > + <property name="text" > + <string>&Ok</string> + </property> + <property name="default" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="8" column="4" > + <widget class="QPushButton" name="CancelButton" > + <property name="text" > + <string>Cancel</string> + </property> + </widget> + </item> + <item row="8" column="0" colspan="3" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item rowspan="8" row="0" column="3" colspan="2" > + <widget class="toListView" native="1" name="Enabled" /> + </item> + <item row="6" column="1" > + <widget class="QSpinBox" name="DisplaySamples" > + <property name="maximum" > + <number>1000</number> + </property> + </widget> + </item> + <item row="6" column="2" > + <widget class="QCheckBox" name="AllSamples" > + <property name="text" > + <string>All</string> + </property> + </widget> + </item> + <item row="6" column="0" > + <widget class="QLabel" name="TextLabel1_2_2" > + <property name="text" > + <string>Maximum number of samples to display</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="5" column="2" > + <widget class="QCheckBox" name="UnlimitedSamples" > + <property name="text" > + <string>Unlimited</string> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="TextLabel5" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> - </customwidgets> - <tabstops> - <tabstop>AutoMax</tabstop> - <tabstop>MaxValue</tabstop> - <tabstop>AutoMin</tabstop> - <tabstop>MinValue</tabstop> - <tabstop>ShowLast</tabstop> - <tabstop>ShowAxis</tabstop> - <tabstop>ShowLegend</tabstop> - <tabstop>Grids</tabstop> - <tabstop>Samples</tabstop> - <tabstop>UnlimitedSamples</tabstop> - <tabstop>DisplaySamples</tabstop> - <tabstop>AllSamples</tabstop> - <tabstop>OkButton</tabstop> - <tabstop>CancelButton</tabstop> - </tabstops> - <images> - <image name="image0" > - <data format="XPM.GZ" length="646" >789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> - </image> - </images> - <connections> - <connection> - <sender>AutoMax</sender> - <signal>toggled(bool)</signal> - <receiver>MaxValue</receiver> - <slot>setDisabled(bool)</slot> - </connection> - <connection> - <sender>AutoMin</sender> - <signal>toggled(bool)</signal> - <receiver>MinValue</receiver> - <slot>setDisabled(bool)</slot> - </connection> - <connection> - <sender>OkButton</sender> - <signal>clicked()</signal> - <receiver>toLineChartSetupUI</receiver> - <slot>accept()</slot> - </connection> - <connection> - <sender>CancelButton</sender> - <signal>clicked()</signal> - <receiver>toLineChartSetupUI</receiver> - <slot>reject()</slot> - </connection> - <connection> - <sender>UnlimitedSamples</sender> - <signal>toggled(bool)</signal> - <receiver>Samples</receiver> - <slot>setDisabled(bool)</slot> - </connection> - <connection> - <sender>AllSamples</sender> - <signal>toggled(bool)</signal> - <receiver>DisplaySamples</receiver> - <slot>setDisabled(bool)</slot> - </connection> - </connections> + </property> + <property name="text" > + <string>Divide chart in grids?</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Grids</cstring> + </property> + </widget> + </item> + <item row="4" column="1" > + <widget class="QSpinBox" name="Grids" /> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>toListView</class> + <extends>QWidget</extends> + <header>toresultview.h</header> + </customwidget> + </customwidgets> + <tabstops> + <tabstop>AutoMax</tabstop> + <tabstop>MaxValue</tabstop> + <tabstop>AutoMin</tabstop> + <tabstop>MinValue</tabstop> + <tabstop>ShowLast</tabstop> + <tabstop>ShowAxis</tabstop> + <tabstop>ShowLegend</tabstop> + <tabstop>Grids</tabstop> + <tabstop>Samples</tabstop> + <tabstop>UnlimitedSamples</tabstop> + <tabstop>DisplaySamples</tabstop> + <tabstop>AllSamples</tabstop> + <tabstop>OkButton</tabstop> + <tabstop>CancelButton</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>AutoMax</sender> + <signal>toggled(bool)</signal> + <receiver>MaxValue</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>AutoMin</sender> + <signal>toggled(bool)</signal> + <receiver>MinValue</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>OkButton</sender> + <signal>clicked()</signal> + <receiver>toLineChartSetupUI</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>CancelButton</sender> + <signal>clicked()</signal> + <receiver>toLineChartSetupUI</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>UnlimitedSamples</sender> + <signal>toggled(bool)</signal> + <receiver>Samples</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>AllSamples</sender> + <signal>toggled(bool)</signal> + <receiver>DisplaySamples</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> </ui> Modified: trunk/tora/src/toscriptui.ui =================================================================== --- trunk/tora/src/toscriptui.ui 2008-02-10 19:13:15 UTC (rev 2546) +++ trunk/tora/src/toscriptui.ui 2008-02-10 19:14:51 UTC (rev 2547) @@ -78,7 +78,7 @@ <number>6</number> </property> <item rowspan="3" row="0" column="2" > - <widget class="Q3GroupBox" name="Destination" > + <widget class="QGroupBox" name="Destination" > <property name="sizePolicy" > <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > <horstretch>0</horstretch> @@ -652,7 +652,7 @@ </widget> </item> <item rowspan="3" row="0" column="1" > - <widget class="Q3GroupBox" name="GroupBox2" > + <widget class="QGroupBox" name="GroupBox2" > <property name="sizePolicy" > <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > <horstretch>0</horstretch> @@ -1112,12 +1112,6 @@ </widget> <customwidgets> <customwidget> - <class>Q3GroupBox</class> - <extends>QGroupBox</extends> - <header>Qt3Support/Q3GroupBox</header> - <container>1</container> - </customwidget> - <customwidget> <class>Q3ButtonGroup</class> <extends>Q3GroupBox</extends> <header>Qt3Support/Q3ButtonGroup</header> Modified: trunk/tora/src/tostoragedatafileui.ui =================================================================== --- trunk/tora/src/tostoragedatafileui.ui 2008-02-10 19:13:15 UTC (rev 2546) +++ trunk/tora/src/tostoragedatafileui.ui 2008-02-10 19:14:51 UTC (rev 2547) @@ -1,179 +1,226 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toStorageDatafileUI</class> - <widget class="QWidget" name="toStorageDatafileUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>580</width> - <height>480</height> - </rect> - </property> - <property name="windowTitle" > - <string>Form1</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> +<ui version="4.0" > + <class>toStorageDatafileUI</class> + <widget class="QWidget" name="toStorageDatafileUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>580</width> + <height>480</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form1</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="0" colspan="3" > + <widget class="QLabel" name="NameLabel" > + <property name="text" > + <string>&Tablespace name</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Name</cstring> + </property> + </widget> + </item> + <item row="1" column="0" colspan="3" > + <widget class="QLineEdit" name="Name" /> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="TextLabel1_2" > + <property name="text" > + <string>&Filename</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Name</cstring> + </property> + </widget> + </item> + <item row="3" column="2" > + <widget class="QPushButton" name="PushButton1" > + <property name="text" > + <string>&Browse</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLineEdit" name="Filename" /> + </item> + <item row="4" column="0" colspan="3" > + <widget class="toFilesize" native="1" name="InitialSize" /> + </item> + <item row="7" column="1" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="6" column="0" colspan="3" > + <widget class="QGroupBox" name="AutoExtendGroup" > + <property name="title" > + <string>Auto extend</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> </property> - <property name="spacing" > - <number>6</number> + <property name="topMargin" > + <number>11</number> </property> - <item rowspan="1" row="0" column="0" colspan="3" > - <widget class="QLabel" name="NameLabel" > - <property name="text" > - <string>&Tablespace name</string> - </property> - <property name="buddy" > - <cstring>Name</cstring> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="0" > + <widget class="QCheckBox" name="AutoExtend" > + <property name="text" > + <string>&Auto extend datafile</string> + </property> + </widget> </item> - <item rowspan="1" row="1" column="0" colspan="3" > - <widget class="QLineEdit" name="Name" /> - </item> <item row="2" column="0" > - <widget class="QLabel" name="TextLabel1_2" > - <property name="text" > - <string>&Filename</string> - </property> - <property name="buddy" > - <cstring>Name</cstring> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> + <widget class="QCheckBox" name="UnlimitedMax" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="text" > + <string>&Unlimited max size</string> + </property> + </widget> </item> - <item row="3" column="2" > - <widget class="QPushButton" name="PushButton1" > - <property name="text" > - <string>&Browse</string> - </property> - </widget> - </item> <item row="3" column="0" > - <widget class="QLineEdit" name="Filename" /> + <widget class="toFilesize" native="1" name="MaximumSize" > + <property name="enabled" > + <bool>false</bool> + </property> + </widget> </item> - <item rowspan="1" row="4" column="0" colspan="3" > - <widget class="toFilesize" name="InitialSize" /> + <item row="1" column="0" > + <widget class="toFilesize" native="1" name="NextSize" > + <property name="enabled" > + <bool>false</bool> + </property> + </widget> </item> - <item row="7" column="1" > - <spacer name="Spacer1" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> - </item> - <item rowspan="1" row="6" column="0" colspan="3" > - <widget class="Q3GroupBox" name="AutoExtendGroup" > - <property name="title" > - <string>Auto extend</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QCheckBox" name="AutoExtend" > - <property name="text" > - <string>&Auto extend datafile</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QCheckBox" name="UnlimitedMax" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="text" > - <string>&Unlimited max size</string> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="toFilesize" name="MaximumSize" > - <property name="enabled" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="toFilesize" name="NextSize" > - <property name="enabled" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>toFilesize</class> - <extends>QWidget</extends> - <header location="local" >tofilesize.h</header> - <sizehint> - <width>200</width> - <height>40</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>5</hordata> - <verdata>1</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> - </customwidgets> - <images> - <image name="image0" > - <data format="XPM.GZ" length="646" >789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> - </image> - </images> - <connections> - <connection> - <sender>AutoExtend</sender> - <signal>toggled(bool)</signal> - <receiver>toStorageDatafileUI</receiver> - <slot>autoExtend(bool)</slot> - </connection> - <connection> - <sender>UnlimitedMax</sender> - <signal>toggled(bool)</signal> - <receiver>toStorageDatafileUI</receiver> - <slot>maximumSize(bool)</slot> - </connection> - <connection> - <sender>PushButton1</sender> - <signal>clicked()</signal> - <receiver>toStorageDatafileUI</receiver> - <slot>browseFile()</slot> - </connection> - <connection> - <sender>Filename</sender> - <signal>textChanged(QString)</signal> - <receiver>toStorageDatafileUI</receiver> - <slot>valueChanged(QString)</slot> - </connection> - </connections> + </layout> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>toFilesize</class> + <extends>QWidget</extends> + <header>tofilesize.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>AutoExtend</sender> + <signal>toggled(bool)</signal> + <receiver>toStorageDatafileUI</receiver> + <slot>autoExtend(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>UnlimitedMax</sender> + <signal>toggled(bool)</signal> + <receiver>toStorageDatafileUI</receiver> + <slot>maximumSize(bool)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>PushButton1</sender> + <signal>clicked()</signal> + <receiver>toStorageDatafileUI</receiver> + <slot>browseFile()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>Filename</sender> + <signal>textChanged(QString)</signal> + <receiver>toStorageDatafileUI</receiver> + <slot>valueChanged(QString)</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> </ui> Modified: trunk/tora/src/totuning.cpp =================================================================== --- trunk/tora/src/totuning.cpp 2008-02-10 19:13:15 UTC (rev 2546) +++ trunk/tora/src/totuning.cpp 2008-02-10 19:14:51 UTC (rev 2547) @@ -943,7 +943,6 @@ : QWidget(parent) { setupUi(this); - BackgroundGroup->setColumnLayout(1, Qt::Horizontal); setupChart(ArchiveWrite, tr("< Archive write"), " " + tr("blocks/s"), SQLOverviewArchiveWrite); setupChart(BufferHit, tr("Hitrate"), QString::fromLatin1("%"), SQLOverviewBufferHit); Modified: trunk/tora/src/totuningoverviewui.ui =================================================================== --- trunk/tora/src/totuningoverviewui.ui 2008-02-10 19:13:15 UTC (rev 2546) +++ trunk/tora/src/totuningoverviewui.ui 2008-02-10 19:14:51 UTC (rev 2547) @@ -1,1122 +1,1238 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toTuningOverviewUI</class> - <widget class="QWidget" name="toTuningOverviewUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>906</width> - <height>552</height> - </rect> - </property> - <property name="windowTitle" > - <string>Form1</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> +<ui version="4.0" > + <class>toTuningOverviewUI</class> + <widget class="QWidget" name="toTuningOverviewUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>906</width> + <height>552</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form1</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="4" column="3" > + <widget class="toResultLine" native="1" name="RedoEntries" /> + </item> + <item row="0" column="1" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="1" > + <widget class="toResultLine" native="1" name="ClientInput" /> + </item> + <item row="2" column="5" > + <widget class="toResultLine" native="1" name="PhysicalWrite" /> + </item> + <item row="1" column="3" > + <widget class="toResultLine" native="1" name="LogicalRead" /> + </item> + <item row="2" column="3" > + <widget class="toResultLine" native="1" name="LogicalChange" /> + </item> + <item row="1" column="5" > + <widget class="toResultLine" native="1" name="PhysicalRead" /> + </item> + <item row="0" column="5" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="3" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="1" > + <widget class="toResultLine" native="1" name="ClientOutput" /> + </item> + <item row="3" column="3" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item rowspan="9" row="0" column="4" > + <widget class="QGroupBox" name="GroupBox1_42" > + <property name="title" > + <string>SGA</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> </property> - <property name="spacing" > - <number>6</number> + <property name="topMargin" > + <number>11</number> </property> - <item row="4" column="3" > - <widget class="toResultLine" name="RedoEntries" /> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="3" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="0" column="1" > - <spacer name="Spacer1" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> + <item row="2" column="0" > + <widget class="QGroupBox" name="GroupBox7" > + <property name="title" > + <string>Buffer Cache</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="1" column="0" > + <widget class="toResultLine" native="1" name="BufferHit" /> + </item> + <item row="0" column="0" > + <widget class="QLabel" name="BufferSize" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text" > + <string>TextLabel3</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> </item> - <item row="1" column="1" > - <widget class="toResultLine" name="ClientInput" /> + <item row="0" column="0" > + <widget class="QLabel" name="TextLabel2_2_2_2" > + <property name="text" > + <string>Total</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> </item> - <item row="2" column="5" > - <widget class="toResultLine" name="PhysicalWrite" /> + <item row="1" column="0" > + <widget class="QLabel" name="SGATotal" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text" > + <string>TextLabel3</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> </item> - <item row="1" column="3" > - <widget class="toResultLine" name="LogicalRead" /> + <item row="4" column="0" > + <widget class="QLabel" name="TextLabel2_2_2_2_2" > + <property name="text" > + <string>Redo Buffer</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> </item> - <item row="2" column="3" > - <widget class="toResultLine" name="LogicalChange" /> + <item row="5" column="0" > + <widget class="QLabel" name="RedoBuffer" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> </item> - <item row="1" column="5" > - <widget class="toResultLine" name="PhysicalRead" /> + <item row="8" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="0" column="5" > - <spacer name="Spacer6" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> + <item row="7" column="0" > + <widget class="QGroupBox" name="GroupBox8" > + <property name="title" > + <string>Shared Pool</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="0" > + <widget class="QLabel" name="SharedSize" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text" > + <string>TextLabel3</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="toResultBar" native="1" name="SharedUsed" /> + </item> + </layout> + </widget> </item> - <item row="0" column="3" > - <spacer name="Spacer4" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> + <item row="6" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="2" column="1" > - <widget class="toResultLine" name="ClientOutput" /> + </layout> + </widget> + </item> + <item row="5" column="3" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="6" column="3" > + <widget class="toResultLine" native="1" name="ParseCount" /> + </item> + <item row="7" column="3" > + <widget class="toResultLine" native="1" name="ExecuteCount" /> + </item> + <item rowspan="2" row="9" column="4" > + <widget class="QGroupBox" name="GroupBox11" > + <property name="title" > + <string>Archive logs</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="1" column="0" > + <widget class="QLabel" name="ArchiveInfo" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text" > + <string>TextLabel3</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> </item> - <item row="3" column="3" > - <spacer name="Spacer10" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> + <item row="0" column="0" > + <widget class="QLabel" name="TextLabel2_2_2_2_3_2_2" > + <property name="text" > + <string>Files/Size</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> </item> - <item rowspan="9" row="0" column="4" colspan="1" > - <widget class="Q3GroupBox" name="GroupBox1_42" > - <property name="title" > - <string>SGA</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="3" column="0" > - <spacer name="Spacer14_2" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> - </item> - <item row="2" column="0" > - <widget class="Q3GroupBox" name="GroupBox7" > - <property name="title" > - <string>Buffer Cache</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="1" column="0" > - <widget class="toResultLine" name="BufferHit" /> - </item> - <item row="0" column="0" > - <widget class="QLabel" name="BufferSize" > - <property name="font" > - <font> - <bold>true</bold> - </font> - </property> - <property name="text" > - <string>TextLabel3</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="0" > - <widget class="QLabel" name="TextLabel2_2_2_2" > - <property name="text" > - <string>Total</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="SGATotal" > - <property name="font" > - <font> - <bold>true</bold> - </font> - </property> - <property name="text" > - <string>TextLabel3</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="TextLabel2_2_2_2_2" > - <property name="text" > - <string>Redo Buffer</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="RedoBuffer" > - <property name="font" > - <font> - <bold>true</bold> - </font> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="8" column="0" > - <spacer name="Spacer14" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> - </item> - <item row="7" column="0" > - <widget class="Q3GroupBox" name="GroupBox8" > - <property name="title" > - <string>Shared Pool</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="SharedSize" > - <property name="font" > - <font> - <bold>true</bold> - </font> - </property> - <property name="text" > - <string>TextLabel3</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="toResultBar" name="SharedUsed" /> - </item> - </layout> - </widget> - </item> - <item row="6" column="0" > - <spacer name="Spacer16" > - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </spacer> - </item> - </layout> - </widget> + </layout> + </widget> + </item> + <item rowspan="11" row="0" column="6" > + <widget class="QGroupBox" name="GroupBox1_4" > + <property name="title" > + <string>Files</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="0" column="0" > + <widget class="QGroupBox" name="GroupBox9" > + <property name="title" > + <string>Datafiles</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="5" column="0" > + <widget class="QLabel" name="Filesize" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text" > + <string>TextLabel3</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="Files" > + <property name="font" > + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text" > + <string>TextLabel3</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="TextLabel2_2_2_2_4" > + <property name="text" > + <string>Used/Total</string> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap" > + <bool>false</bool> + ... [truncated message content] |
From: <mrj...@us...> - 2008-02-10 21:48:46
|
Revision: 2550 http://tora.svn.sourceforge.net/tora/?rev=2550&view=rev Author: mrjohnson0 Date: 2008-02-10 13:48:49 -0800 (Sun, 10 Feb 2008) Log Message: ----------- ported Q3ButtonGroup Modified Paths: -------------- trunk/tora/src/todebug.cpp trunk/tora/src/todebug.h trunk/tora/src/todebugwatch.ui Modified: trunk/tora/src/todebug.cpp =================================================================== --- trunk/tora/src/todebug.cpp 2008-02-10 21:35:06 UTC (rev 2549) +++ trunk/tora/src/todebug.cpp 2008-02-10 21:48:49 UTC (rev 2550) @@ -71,6 +71,7 @@ #include <QAction> #include <QWorkspace> #include <QMessageBox> +#include <QButtonGroup> #include "icons/addwatch.xpm" #include "icons/changewatch.xpm" @@ -150,9 +151,10 @@ static toDebugTool DebugTool; toDebugWatch::toDebugWatch(toDebug *parent) - : QDialog(parent/*, "AddWatch", true*/), Debugger(parent) + : QDialog(parent), Debugger(parent) { setupUi(this); + setModal(true); toHelp::connectDialog(this); { @@ -172,7 +174,16 @@ Object = Debugger->currentEditor()->object(); - connect(Scope, SIGNAL(clicked(int)), this, SLOT(changeScope(int))); + ScopeGroup = new QButtonGroup(Scope); + ScopeGroup->addButton(LocalScope_2, 1); + ScopeGroup->addButton(LocalScope, 2); + ScopeGroup->addButton(Package, 3); + ScopeGroup->addButton(GlobalScope, 4); + + connect(ScopeGroup, + SIGNAL(buttonClicked(int)), + this, + SLOT(changeScope(int))); changeScope(1); } @@ -204,7 +215,7 @@ toTreeWidgetItem *toDebugWatch::createWatch(toTreeWidget *watches) { QString str; - switch (Scope->id(Scope->selected())) + switch (ScopeGroup->checkedId()) { case 1: case 5: @@ -215,7 +226,7 @@ item->setText(2, Name->currentText()); item->setText(3, QString::null); item->setText(4, QString::fromLatin1("NOCHANGE")); - item->setText(6, Scope->id(Scope->selected()) == 5 ? "AUTO" : ""); + item->setText(6, ScopeGroup->checkedId() == 5 ? "AUTO" : ""); return item; } case 3: Modified: trunk/tora/src/todebug.h =================================================================== --- trunk/tora/src/todebug.h 2008-02-10 21:35:06 UTC (rev 2549) +++ trunk/tora/src/todebug.h 2008-02-10 21:48:49 UTC (rev 2550) @@ -93,6 +93,7 @@ class toDebugText; class toMarkedText; class toOutput; +class QButtonGroup; class toDebug : public toToolWidget { @@ -292,18 +293,22 @@ class toDebugWatch : public QDialog, public Ui::toDebugWatchUI { - Q_OBJECT + Q_OBJECT; toTreeWidgetItem *HeadItems; toTreeWidgetItem *BodyItems; - toDebug *Debugger; - QString Object; - QString Default; + toDebug *Debugger; + QString Object; + QString Default; + QButtonGroup *ScopeGroup; + toTreeWidgetItem *findMisc(const QString &str, toTreeWidgetItem *); + public: toDebugWatch(toDebug *parent); toTreeWidgetItem *createWatch(toTreeWidget *watches); + public slots: void changeScope(int num); }; Modified: trunk/tora/src/todebugwatch.ui =================================================================== --- trunk/tora/src/todebugwatch.ui 2008-02-10 21:35:06 UTC (rev 2549) +++ trunk/tora/src/todebugwatch.ui 2008-02-10 21:48:49 UTC (rev 2550) @@ -1,179 +1,221 @@ -<ui version="4.0" stdsetdef="1" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>toDebugWatchUI</class> - <widget class="QDialog" name="toDebugWatchUI" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>188</width> - <height>228</height> - </rect> - </property> - <property name="windowTitle" > - <string>Add variable watch</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> +<ui version="4.0" > + <class>toDebugWatchUI</class> + <widget class="QDialog" name="toDebugWatchUI" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>188</width> + <height>264</height> + </rect> + </property> + <property name="windowTitle" > + <string>Add variable watch</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> + </property> + <property name="topMargin" > + <number>11</number> + </property> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> + <item row="3" column="1" > + <widget class="QPushButton" name="PushButton1_2" > + <property name="text" > + <string>Cancel</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QPushButton" name="PushButton1" > + <property name="text" > + <string>&Ok</string> + </property> + <property name="default" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="0" colspan="2" > + <widget class="QComboBox" name="Name" > + <property name="editable" > + <bool>true</bool> + </property> + <property name="duplicatesEnabled" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0" colspan="2" > + <widget class="QLabel" name="TextLabel1" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip" > + <string>Variable name to watch.</string> + </property> + <property name="text" > + <string>&Variable name</string> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + <property name="buddy" > + <cstring>Name</cstring> + </property> + </widget> + </item> + <item row="0" column="0" colspan="2" > + <widget class="QGroupBox" name="Scope" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>&Scope</string> + </property> + <layout class="QGridLayout" > + <property name="leftMargin" > + <number>11</number> </property> - <property name="spacing" > - <number>6</number> + <property name="topMargin" > + <number>11</number> </property> - <item row="3" column="1" > - <widget class="QPushButton" name="PushButton1_2" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> + <property name="rightMargin" > + <number>11</number> + </property> + <property name="bottomMargin" > + <number>11</number> + </property> + <property name="horizontalSpacing" > + <number>6</number> + </property> + <property name="verticalSpacing" > + <number>6</number> + </property> <item row="3" column="0" > - <widget class="QPushButton" name="PushButton1" > - <property name="text" > - <string>&Ok</string> - </property> - <property name="default" > - <bool>true</bool> - </property> - </widget> + <widget class="QRadioButton" name="GlobalScope" > + <property name="toolTip" > + <string>Global scope of variable.</string> + </property> + <property name="text" > + <string>&Global</string> + </property> + <property name="buttonGroupId" stdset="0" > + <number>4</number> + </property> + </widget> </item> - <item rowspan="1" row="2" column="0" colspan="2" > - <widget class="QComboBox" name="Name" > - <property name="editable" > - <bool>true</bool> - </property> - <property name="duplicatesEnabled" > - <bool>false</bool> - </property> - </widget> + <item row="1" column="0" > + <widget class="QRadioButton" name="LocalScope" > + <property name="toolTip" > + <string>Currently running scope.</string> + </property> + <property name="text" > + <string>&Local</string> + </property> + <property name="checked" > + <bool>false</bool> + </property> + <property name="buttonGroupId" stdset="0" > + <number>1</number> + </property> + </widget> </item> - <item rowspan="1" row="1" column="0" colspan="2" > - <widget class="QLabel" name="TextLabel1" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property name="text" > - <string>&Variable name</string> - </property> - <property name="buddy" > - <cstring>Name</cstring> - </property> - <property name="toolTip" > - <string>Variable name to watch.</string> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> - </widget> + <item row="0" column="0" > + <widget class="QRadioButton" name="LocalScope_2" > + <property name="toolTip" > + <string>Currently running scope.</string> + </property> + <property name="text" > + <string>&Autodetect</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + <property name="buttonGroupId" stdset="0" > + <number>5</number> + </property> + </widget> </item> - <item rowspan="1" row="0" column="0" colspan="2" > - <widget class="Q3ButtonGroup" name="Scope" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>7</vsizetype> - </sizepolicy> - </property> - <property name="title" > - <string>&Scope</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>11</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="3" column="0" > - <widget class="QRadioButton" name="GlobalScope" > - <property name="text" > - <string>&Global</string> - </property> - <property name="buttonGroupId" > - <number>4</number> - </property> - <property name="toolTip" > - <string>Global scope of variable.</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QRadioButton" name="LocalScope" > - <property name="text" > - <string>&Local</string> - </property> - <property name="checked" > - <bool>false</bool> - </property> - <property name="buttonGroupId" > - <number>1</number> - </property> - <property name="toolTip" > - <string>Currently running scope.</string> - </property> - </widget> - </item> - <item row="0" column="0" > - <widget class="QRadioButton" name="LocalScope_2" > - <property name="text" > - <string>&Autodetect</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - <property name="buttonGroupId" > - <number>5</number> - </property> - <property name="toolTip" > - <string>Currently running scope.</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QRadioButton" name="Package" > - <property name="text" > - <string>&Package</string> - </property> - <property name="buttonGroupId" > - <number>3</number> - </property> - <property name="toolTip" > - <string>The scope of the file in the body editor.</string> - </property> - </widget> - </item> - </layout> - </widget> + <item row="2" column="0" > + <widget class="QRadioButton" name="Package" > + <property name="toolTip" > + <string>The scope of the file in the body editor.</string> + </property> + <property name="text" > + <string>&Package</string> + </property> + <property name="buttonGroupId" stdset="0" > + <number>3</number> + </property> + </widget> </item> - </layout> - </widget> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <tabstops> - <tabstop>LocalScope_2</tabstop> - <tabstop>Name</tabstop> - <tabstop>PushButton1</tabstop> - <tabstop>PushButton1_2</tabstop> - <tabstop>LocalScope</tabstop> - <tabstop>Package</tabstop> - <tabstop>GlobalScope</tabstop> - </tabstops> - <connections> - <connection> - <sender>PushButton1</sender> - <signal>clicked()</signal> - <receiver>toDebugWatchUI</receiver> - <slot>accept()</slot> - </connection> - <connection> - <sender>PushButton1_2</sender> - <signal>clicked()</signal> - <receiver>toDebugWatchUI</receiver> - <slot>reject()</slot> - </connection> - </connections> + </layout> + </widget> + </item> + </layout> + </widget> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <tabstops> + <tabstop>LocalScope_2</tabstop> + <tabstop>Name</tabstop> + <tabstop>PushButton1</tabstop> + <tabstop>PushButton1_2</tabstop> + <tabstop>LocalScope</tabstop> + <tabstop>Package</tabstop> + <tabstop>GlobalScope</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>PushButton1</sender> + <signal>clicked()</signal> + <receiver>toDebugWatchUI</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>PushButton1_2</sender> + <signal>clicked()</signal> + <receiver>toDebugWatchUI</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>20</x> + <y>20</y> + </hint> + <hint type="destinationlabel" > + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + </connections> </ui> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 22:05:09
|
Revision: 2552 http://tora.svn.sourceforge.net/tora/?rev=2552&view=rev Author: mrjohnson0 Date: 2008-02-10 14:05:11 -0800 (Sun, 10 Feb 2008) Log Message: ----------- ported Q3ButtonGroup Modified Paths: -------------- trunk/tora/src/toscript.cpp trunk/tora/src/toscriptui.ui Modified: trunk/tora/src/toscript.cpp =================================================================== --- trunk/tora/src/toscript.cpp 2008-02-10 21:56:23 UTC (rev 2551) +++ trunk/tora/src/toscript.cpp 2008-02-10 22:05:11 UTC (rev 2552) @@ -70,8 +70,8 @@ #include <QFileDialog> #include <QScrollArea> #include <QVBoxLayout> +#include <QButtonGroup> - #include "icons/execute.xpm" #include "icons/toscript.xpm" @@ -284,10 +284,17 @@ layout = new QGridLayout(ScriptUI->DifferenceTab); layout->addWidget(hsplitter, 0, 0); + QButtonGroup *group = new QButtonGroup(ScriptUI->ModeGroup); + group->addButton(ScriptUI->Compare, 1); + group->addButton(ScriptUI->Extract, 2); + group->addButton(ScriptUI->Search, 3); + group->addButton(ScriptUI->Migrate, 4); + group->addButton(ScriptUI->Report, 5); + ScriptUI->Initial->setTitle(tr("&Initial")); ScriptUI->Limit->setTitle(tr("&Limit")); ScriptUI->Next->setTitle(tr("&Next")); - connect(ScriptUI->ModeGroup, SIGNAL(clicked(int)), this, SLOT(changeMode(int))); + connect(group, SIGNAL(buttonClicked(int)), this, SLOT(changeMode(int))); ScriptUI->Tabs->setTabEnabled(ScriptUI->Tabs->indexOf(ScriptUI->ResizeTab), false); ScriptUI->SourceObjects->setSorting(0); ScriptUI->SourceObjects->setResizeMode(toTreeWidget::AllColumns); Modified: trunk/tora/src/toscriptui.ui =================================================================== --- trunk/tora/src/toscriptui.ui 2008-02-10 21:56:23 UTC (rev 2551) +++ trunk/tora/src/toscriptui.ui 2008-02-10 22:05:11 UTC (rev 2552) @@ -55,7 +55,7 @@ <x>0</x> <y>0</y> <width>607</width> - <height>723</height> + <height>735</height> </rect> </property> <layout class="QGridLayout" > @@ -180,7 +180,7 @@ </widget> </item> <item row="0" column="0" > - <widget class="Q3ButtonGroup" name="ModeGroup" > + <widget class="QGroupBox" name="ModeGroup" > <property name="title" > <string>&Options</string> </property> @@ -561,7 +561,7 @@ </widget> </item> <item row="2" column="0" > - <widget class="Q3ButtonGroup" name="SearchGroup" > + <widget class="QGroupBox" name="SearchGroup" > <property name="enabled" > <bool>false</bool> </property> @@ -754,7 +754,7 @@ </widget> </item> <item row="1" column="0" > - <widget class="Q3ButtonGroup" name="OutputGroup" > + <widget class="QGroupBox" name="OutputGroup" > <property name="enabled" > <bool>false</bool> </property> @@ -885,7 +885,7 @@ <number>6</number> </property> <item row="0" column="0" > - <widget class="Q3ButtonGroup" name="ButtonGroup2_2" > + <widget class="QGroupBox" name="ButtonGroup2_2" > <property name="sizePolicy" > <sizepolicy vsizetype="Maximum" hsizetype="Preferred" > <horstretch>0</horstretch> @@ -1112,12 +1112,6 @@ </widget> <customwidgets> <customwidget> - <class>Q3ButtonGroup</class> - <extends>Q3GroupBox</extends> - <header>Qt3Support/Q3ButtonGroup</header> - <container>1</container> - </customwidget> - <customwidget> <class>toTreeWidget</class> <extends>QTreeWidget</extends> <header>totreewidget.h</header> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 22:16:32
|
Revision: 2553 http://tora.svn.sourceforge.net/tora/?rev=2553&view=rev Author: mrjohnson0 Date: 2008-02-10 14:16:35 -0800 (Sun, 10 Feb 2008) Log Message: ----------- ported Q3ButtonGroup Modified Paths: -------------- trunk/tora/src/tosecurity.cpp trunk/tora/src/tosecurityquotaui.ui Modified: trunk/tora/src/tosecurity.cpp =================================================================== --- trunk/tora/src/tosecurity.cpp 2008-02-10 22:05:11 UTC (rev 2552) +++ trunk/tora/src/tosecurity.cpp 2008-02-10 22:16:35 UTC (rev 2553) @@ -66,6 +66,7 @@ #include <QPixmap> #include <QVBoxLayout> +#include <QButtonGroup> #include "ui_tosecurityuserui.h" #include "ui_tosecurityroleui.h" @@ -229,9 +230,14 @@ CurrentItem = NULL; update(); + QButtonGroup *group = new QButtonGroup(SizeGroup); + group->addButton(Value, 1); + group->addButton(None, 2); + group->addButton(Unlimited, 3); + connect(Tablespaces, SIGNAL(selectionChanged()), this, SLOT(changeTablespace())); - connect(SizeGroup, SIGNAL(clicked(int)), + connect(group, SIGNAL(buttonClicked(int)), this, SLOT(changeSize())); connect(Size, SIGNAL(valueChanged()), this, SLOT(changeSize())); Modified: trunk/tora/src/tosecurityquotaui.ui =================================================================== --- trunk/tora/src/tosecurityquotaui.ui 2008-02-10 22:05:11 UTC (rev 2552) +++ trunk/tora/src/tosecurityquotaui.ui 2008-02-10 22:16:35 UTC (rev 2553) @@ -51,14 +51,14 @@ </widget> </item> <item row="2" column="0" > - <widget class="Q3ButtonGroup" name="SizeGroup" > + <widget class="QGroupBox" name="SizeGroup" > <property name="enabled" > <bool>false</bool> </property> <property name="title" > <string/> </property> - <property name="lineWidth" > + <property name="lineWidth" stdset="0" > <number>0</number> </property> <layout class="QGridLayout" > @@ -131,12 +131,6 @@ </widget> <customwidgets> <customwidget> - <class>Q3ButtonGroup</class> - <extends>Q3GroupBox</extends> - <header>Qt3Support/Q3ButtonGroup</header> - <container>1</container> - </customwidget> - <customwidget> <class>toTreeWidget</class> <extends>QTreeWidget</extends> <header>totreewidget.h</header> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 22:53:36
|
Revision: 2557 http://tora.svn.sourceforge.net/tora/?rev=2557&view=rev Author: mrjohnson0 Date: 2008-02-10 14:53:41 -0800 (Sun, 10 Feb 2008) Log Message: ----------- removing qt3support Modified Paths: -------------- trunk/tora/src/toabout.cpp trunk/tora/src/tolegendchart.cpp trunk/tora/src/tolistviewformattercsv.cpp trunk/tora/src/tolistviewformatterhtml.cpp trunk/tora/src/tolistviewformattersql.cpp trunk/tora/src/tolistviewformattertabdel.cpp trunk/tora/src/tolistviewformattertext.cpp trunk/tora/src/tomemoeditor.cpp trunk/tora/src/toresultitem.cpp trunk/tora/src/toresultlong.cpp trunk/tora/src/toresultstorage.cpp trunk/tora/src/totemplate.cpp Modified: trunk/tora/src/toabout.cpp =================================================================== --- trunk/tora/src/toabout.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/toabout.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -37,7 +37,6 @@ #include "toabout.h" -#include <q3textview.h> #include <qmime.h> #include <qpushbutton.h> //Added by qt3to4: Modified: trunk/tora/src/tolegendchart.cpp =================================================================== --- trunk/tora/src/tolegendchart.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/tolegendchart.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -40,7 +40,6 @@ #include "tolegendchart.h" #include <qpainter.h> -#include <q3paintdevicemetrics.h> //Added by qt3to4: #include <QPaintEvent> Modified: trunk/tora/src/tolistviewformattercsv.cpp =================================================================== --- trunk/tora/src/tolistviewformattercsv.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/tolistviewformattercsv.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -40,7 +40,6 @@ #include "tolistviewformatteridentifier.h" #include "toresultview.h" -#include <q3header.h> #include <qregexp.h> #include <iostream> Modified: trunk/tora/src/tolistviewformatterhtml.cpp =================================================================== --- trunk/tora/src/tolistviewformatterhtml.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/tolistviewformatterhtml.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -40,7 +40,6 @@ #include "tolistviewformatteridentifier.h" #include "toresultview.h" -#include <q3header.h> #include <iostream> namespace Modified: trunk/tora/src/tolistviewformattersql.cpp =================================================================== --- trunk/tora/src/tolistviewformattersql.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/tolistviewformattersql.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -14,7 +14,6 @@ #include "tolistviewformatteridentifier.h" #include "toresultview.h" -#include <q3header.h> namespace { Modified: trunk/tora/src/tolistviewformattertabdel.cpp =================================================================== --- trunk/tora/src/tolistviewformattertabdel.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/tolistviewformattertabdel.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -40,7 +40,6 @@ #include "tolistviewformatteridentifier.h" #include "toresultview.h" -#include <q3header.h> #include <iostream> namespace Modified: trunk/tora/src/tolistviewformattertext.cpp =================================================================== --- trunk/tora/src/tolistviewformattertext.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/tolistviewformattertext.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -40,7 +40,6 @@ #include "tolistviewformatteridentifier.h" #include "toresultview.h" -#include <q3header.h> #include <iostream> namespace Modified: trunk/tora/src/tomemoeditor.cpp =================================================================== --- trunk/tora/src/tomemoeditor.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/tomemoeditor.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -44,7 +44,6 @@ #include "toresultview.h" #include <qcheckbox.h> -#include <q3header.h> #include <qlabel.h> #include <qlayout.h> #include <qpixmap.h> Modified: trunk/tora/src/toresultitem.cpp =================================================================== --- trunk/tora/src/toresultitem.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/toresultitem.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -45,8 +45,6 @@ #include "tosql.h" #include "totool.h" -#include <q3grid.h> -#include <q3header.h> #include <qlabel.h> #include <qlayout.h> #include <qtooltip.h> Modified: trunk/tora/src/toresultlong.cpp =================================================================== --- trunk/tora/src/toresultlong.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/toresultlong.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -46,7 +46,6 @@ #include <qregexp.h> #include <qclipboard.h> -#include <q3header.h> #include <qtooltip.h> toResultLong::toResultLong(bool readable, bool dispCol, toQuery::queryMode mode, Modified: trunk/tora/src/toresultstorage.cpp =================================================================== --- trunk/tora/src/toresultstorage.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/toresultstorage.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -45,7 +45,6 @@ #include "tosql.h" #include "totool.h" -#include <q3header.h> #include <qpainter.h> //Added by qt3to4: #include <QList> Modified: trunk/tora/src/totemplate.cpp =================================================================== --- trunk/tora/src/totemplate.cpp 2008-02-10 22:45:00 UTC (rev 2556) +++ trunk/tora/src/totemplate.cpp 2008-02-10 22:53:41 UTC (rev 2557) @@ -109,8 +109,7 @@ return toFindItem(Templates, name); } void toTemplateEdit::allocateItem(void) { - QStringList lst = - QStringList::split(QString::fromLatin1(":"), Name->text()); + QStringList lst = Name->text().split(QString(":")); int li = 0; toTreeWidgetItem *parent = NULL; for (toTreeWidgetItem *item = Templates->firstChild(); item && li @@ -138,7 +137,7 @@ QString str = pre; if (!str.isEmpty()) str += ":"; - str += first->text(0).latin1(); + str += first->text(0).toLatin1(); if (first->firstChild() && clearUnused(first->firstChild(), str)) delitem = NULL; if (delitem && TemplateMap.find(str) != TemplateMap.end()) @@ -162,7 +161,7 @@ QStringList lstCtx; for (std::map<QString, QString>::iterator i = TemplateMap.begin();i != TemplateMap.end();i++) { - QStringList ctx = QStringList::split(QString::fromLatin1(":"), QString::fromLatin1((*i).first)); + QStringList ctx = (*i).first.split(":"); if (last) { while (last && lastLevel >= int(ctx.count())) @@ -226,10 +225,10 @@ } QString toTemplateEdit::name(toTreeWidgetItem *item) { - QString str = item->text(0).latin1(); + QString str = item->text(0); for (item = item->parent(); item; item = item->parent()) { str.prepend(":"); - str.prepend(item->text(0).latin1()); + str.prepend(item->text(0)); } return str; } @@ -258,14 +257,14 @@ void toTemplateEdit::changeSelection(void) { bool update = false; if (LastTemplate != TemplateMap.end()) { - if (Name->text().latin1() != (*LastTemplate).first || Description->text() != (*LastTemplate).second) { + if (Name->text() != (*LastTemplate).first || Description->text() != (*LastTemplate).second) { TemplateMap.erase(LastTemplate); - TemplateMap[Name->text().latin1()] = Description->text(); + TemplateMap[Name->text()] = Description->text(); allocateItem(); update = true; } } else if (!Name->text().isEmpty()) { - TemplateMap[Name->text().latin1()] = Description->text(); + TemplateMap[Name->text()] = Description->text(); allocateItem(); update = true; } @@ -276,7 +275,7 @@ QString str = name(item); LastTemplate = TemplateMap.find(str); if (LastTemplate != TemplateMap.end()) { - Name->setText(QString::fromLatin1((*LastTemplate).first)); + Name->setText((*LastTemplate).first); Description->setText((*LastTemplate).second); Preview->setText((*LastTemplate).second); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 23:05:45
|
Revision: 2559 http://tora.svn.sourceforge.net/tora/?rev=2559&view=rev Author: mrjohnson0 Date: 2008-02-10 15:04:39 -0800 (Sun, 10 Feb 2008) Log Message: ----------- port a couple COMPAT signals Modified Paths: -------------- trunk/tora/src/tonewconnectionui.ui trunk/tora/src/toworksheet.cpp trunk/tora/src/toworksheet.h Modified: trunk/tora/src/tonewconnectionui.ui =================================================================== --- trunk/tora/src/tonewconnectionui.ui 2008-02-10 22:54:27 UTC (rev 2558) +++ trunk/tora/src/tonewconnectionui.ui 2008-02-10 23:04:39 UTC (rev 2559) @@ -363,7 +363,7 @@ </connection> <connection> <sender>Host</sender> - <signal>textChanged(QString)</signal> + <signal>editTextChanged(QString)</signal> <receiver>toNewConnectionUI</receiver> <slot>changeHost()</slot> <hints> Modified: trunk/tora/src/toworksheet.cpp =================================================================== --- trunk/tora/src/toworksheet.cpp 2008-02-10 22:54:27 UTC (rev 2558) +++ trunk/tora/src/toworksheet.cpp 2008-02-10 23:04:39 UTC (rev 2559) @@ -514,8 +514,8 @@ connect(Logging, SIGNAL(selectionChanged(toTreeWidgetItem *)), this, SLOT(executeLog())); LastLogItem = NULL; - connect(ResultTab, SIGNAL(currentChanged(QWidget *)), - this, SLOT(changeResult(QWidget *))); + connect(ResultTab, SIGNAL(currentChanged(int)), + this, SLOT(changeResult(int))); if (autoLoad) { Editor->setFilename(WorksheetTool.config(CONF_AUTO_LOAD, "")); @@ -733,7 +733,8 @@ #define LARGE_BUFFER 4096 -void toWorksheet::changeResult(QWidget *widget) { +void toWorksheet::changeResult(int index) { + QWidget *widget = ResultTab->widget(index); if(!widget) return; @@ -1082,7 +1083,7 @@ } if(!error) - changeResult(CurrentTab); + changeResult(ResultTab->indexOf(CurrentTab)); static QRegExp re(QString::fromLatin1("^[1-9]\\d* rows processed$")); try { @@ -1677,7 +1678,7 @@ else { std::map<int, QWidget *>::iterator i = History.find(item->text(4).toInt()); QueryString = item->allText(0); - changeResult(ResultTab->currentWidget()); + changeResult(ResultTab->currentIndex()); if (i != History.end() && (*i).second) { Current->hide(); Current = (*i).second; Modified: trunk/tora/src/toworksheet.h =================================================================== --- trunk/tora/src/toworksheet.h 2008-02-10 22:54:27 UTC (rev 2558) +++ trunk/tora/src/toworksheet.h 2008-02-10 23:04:39 UTC (rev 2559) @@ -205,7 +205,7 @@ void executeNewline(); void describe(); void eraseLogButton(); - void changeResult(QWidget *widget); + void changeResult(int); void windowActivated(QWidget *w); void queryDone(void); void enableStatistic(bool); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 23:17:05
|
Revision: 2560 http://tora.svn.sourceforge.net/tora/?rev=2560&view=rev Author: mrjohnson0 Date: 2008-02-10 15:17:05 -0800 (Sun, 10 Feb 2008) Log Message: ----------- add signal currentTabChanged(QWidget *) for compatibility with existing source. this will be nice when qt5 comes out, too. Modified Paths: -------------- trunk/tora/src/totabwidget.cpp trunk/tora/src/totabwidget.h Modified: trunk/tora/src/totabwidget.cpp =================================================================== --- trunk/tora/src/totabwidget.cpp 2008-02-10 23:04:39 UTC (rev 2559) +++ trunk/tora/src/totabwidget.cpp 2008-02-10 23:17:05 UTC (rev 2560) @@ -42,6 +42,17 @@ #include <qobject.h> #include <QTabWidget> + +toTabWidget::toTabWidget(QWidget *parent) + : QTabWidget(parent) { + + connect(this, + SIGNAL(currentChanged(int)), + this, + SLOT(tabChanged(int))); +} + + void toTabWidget::setTabShown(QWidget *w, bool show) { int pos; QWidget *parent = w; @@ -87,6 +98,13 @@ } +void toTabWidget::tabChanged(int index) { + QWidget *widget = QTabWidget::widget(index); + if(widget) + emit currentTabChanged(widget); +} + + // ---------------------------------------- unused int toTabWidget::insertTab(int index, QWidget *widget, const QString &label) { Modified: trunk/tora/src/totabwidget.h =================================================================== --- trunk/tora/src/totabwidget.h 2008-02-10 23:04:39 UTC (rev 2559) +++ trunk/tora/src/totabwidget.h 2008-02-10 23:17:05 UTC (rev 2560) @@ -63,9 +63,7 @@ public: /** Constructor. */ - toTabWidget(QWidget *parent = 0) - : QTabWidget(parent) { - } + toTabWidget(QWidget *parent = 0); /** Specify if a tab is shown. * @param w Widget to change visibility. @@ -102,6 +100,12 @@ const QString &label); void removeTab(int index); + +private slots: + void tabChanged(int index); + +signals: + void currentTabChanged(QWidget *); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-10 23:29:05
|
Revision: 2562 http://tora.svn.sourceforge.net/tora/?rev=2562&view=rev Author: mrjohnson0 Date: 2008-02-10 15:29:02 -0800 (Sun, 10 Feb 2008) Log Message: ----------- ported more compat signals Modified Paths: -------------- trunk/tora/src/tosgastatement.cpp trunk/tora/src/tosgastatement.h trunk/tora/src/totuning.cpp trunk/tora/src/totuning.h Modified: trunk/tora/src/tosgastatement.cpp =================================================================== --- trunk/tora/src/tosgastatement.cpp 2008-02-10 23:17:22 UTC (rev 2561) +++ trunk/tora/src/tosgastatement.cpp 2008-02-10 23:29:02 UTC (rev 2562) @@ -79,13 +79,14 @@ addTab(Plan, tr("Execution plan")); Resources = new toResultResources(this); addTab(Resources, tr("Information")); - connect(this, SIGNAL(currentChanged(QWidget *)), - this, SLOT(changeTab(QWidget *))); + connect(this, SIGNAL(currentChanged(int)), + this, SLOT(changeTab(int))); CurrentTab = SQLText; } -void toSGAStatement::changeTab(QWidget *widget) +void toSGAStatement::changeTab(int index) { + QWidget *widget = QTabWidget::widget(index); try { CurrentTab = widget; @@ -115,5 +116,5 @@ void toSGAStatement::changeAddress(const QString &str) { Address = str; - changeTab(CurrentTab); + changeTab(QTabWidget::indexOf(CurrentTab)); } Modified: trunk/tora/src/tosgastatement.h =================================================================== --- trunk/tora/src/tosgastatement.h 2008-02-10 23:17:22 UTC (rev 2561) +++ trunk/tora/src/tosgastatement.h 2008-02-10 23:29:02 UTC (rev 2562) @@ -78,7 +78,7 @@ private slots: /** Change the displayed tab. */ - void changeTab(QWidget *widget); + void changeTab(int); public: /** Create widget. * @param parent Parent widget. @@ -93,7 +93,7 @@ */ void refresh(void) { - changeTab(CurrentTab); + changeTab(QTabWidget::indexOf(CurrentTab)); } }; Modified: trunk/tora/src/totuning.cpp =================================================================== --- trunk/tora/src/totuning.cpp 2008-02-10 23:17:22 UTC (rev 2561) +++ trunk/tora/src/totuning.cpp 2008-02-10 23:29:02 UTC (rev 2562) @@ -1685,7 +1685,7 @@ LastTab = NULL; - connect(Tabs, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeTab(QWidget *))); + connect(Tabs, SIGNAL(currentChanged(int)), this, SLOT(changeTab(int))); ToolMenu = NULL; connect(toMainWidget()->workspace(), SIGNAL(windowActivated(QWidget *)), this, SLOT(windowActivated(QWidget *))); @@ -1810,10 +1810,11 @@ Tabs->setTabEnabled(Tabs->indexOf(widget), enable); } -void toTuning::changeTab(QWidget *widget) +void toTuning::changeTab(int index) { - if (LastTab == widget) - return ; + QWidget *widget = Tabs->widget(index); + if(!widget || LastTab == widget) + return; refresh(); } Modified: trunk/tora/src/totuning.h =================================================================== --- trunk/tora/src/totuning.h 2008-02-10 23:17:22 UTC (rev 2561) +++ trunk/tora/src/totuning.h 2008-02-10 23:29:02 UTC (rev 2562) @@ -202,7 +202,7 @@ public slots: virtual void refresh(void); - virtual void changeTab(QWidget *widget); + virtual void changeTab(int); virtual void changeRefresh(const QString &str); virtual void windowActivated(QWidget *widget); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-11 00:40:09
|
Revision: 2563 http://tora.svn.sourceforge.net/tora/?rev=2563&view=rev Author: mrjohnson0 Date: 2008-02-10 16:40:14 -0800 (Sun, 10 Feb 2008) Log Message: ----------- port 'activated' signal Modified Paths: -------------- trunk/tora/src/toworksheetstatistic.cpp trunk/tora/src/toworksheetstatistic.h Modified: trunk/tora/src/toworksheetstatistic.cpp =================================================================== --- trunk/tora/src/toworksheetstatistic.cpp 2008-02-10 23:29:02 UTC (rev 2562) +++ trunk/tora/src/toworksheetstatistic.cpp 2008-02-11 00:40:14 UTC (rev 2563) @@ -55,6 +55,7 @@ #include <QPixmap> #include <QMenu> #include <QVBoxLayout> +#include <QAction> #include "icons/fileopen.xpm" #include "icons/filesave.xpm" @@ -84,7 +85,7 @@ SaveMenu->setTitle(tr("Save statistics to file")); toolbar->addAction(SaveMenu->menuAction()); connect(SaveMenu, SIGNAL(aboutToShow()), this, SLOT(displayMenu())); - connect(SaveMenu, SIGNAL(activated(int)), this, SLOT(save(int))); + connect(SaveMenu, SIGNAL(triggered(QAction *)), this, SLOT(save(QAction *))); toolbar->addSeparator(); @@ -93,7 +94,7 @@ RemoveMenu->setTitle(tr("Remove statistics")); toolbar->addAction(RemoveMenu->menuAction()); connect(RemoveMenu, SIGNAL(aboutToShow()), this, SLOT(displayMenu())); - connect(RemoveMenu, SIGNAL(activated(int)), this, SLOT(remove(int))); + connect(RemoveMenu, SIGNAL(triggered(QAction *)), this, SLOT(remove(QAction *))); Splitter = new QSplitter(Qt::Vertical, this); vlayout->addWidget(Splitter); @@ -160,6 +161,8 @@ QSizePolicy::Fixed)); vbox->addWidget(hcontainer); + cur.Action = new QAction(stats["Description"], cur.Top); + cur.Label = new QLabel(stats["Description"], hcontainer); cur.Label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); box->addWidget(cur.Label); @@ -245,10 +248,9 @@ } } -void toWorksheetStatistic::save(int selid) { - int id = 1; +void toWorksheetStatistic::save(QAction *action) { for (std::list<data>::iterator i = Open.begin();i != Open.end();i++) { - if (selid == id) { + if((*i).Action == action) { QString fn = toSaveFilename(QString::null, QString::fromLatin1("*.stat"), this); if (!fn.isEmpty()) { std::map<QString, QString> stat; @@ -261,18 +263,16 @@ try { toConfigurationSingle::Instance().saveMap(fn, stat); } - TOCATCH + TOCATCH; } break; } - id++; } } -void toWorksheetStatistic::remove(int selid) { - int id = 1; +void toWorksheetStatistic::remove(QAction *action) { for (std::list<data>::iterator i = Open.begin();i != Open.end();i++) { - if (selid == id) { + if ((*i).Action == action) { delete(*i).Top; if (Open.size() == 1) { Dummy = new QWidget(Splitter); @@ -281,7 +281,6 @@ Open.erase(i); break; } - id++; } } @@ -300,10 +299,8 @@ void toWorksheetStatistic::displayMenu(void) { SaveMenu->clear(); RemoveMenu->clear(); - int id = 1; - for (std::list<data>::iterator i = Open.begin();i != Open.end();i++) { - SaveMenu->addAction((*i).Label->text()); - RemoveMenu->addAction((*i).Label->text()); - id++; + for (std::list<data>::iterator i = Open.begin(); i != Open.end(); i++) { + SaveMenu->addAction((*i).Action); + RemoveMenu->addAction((*i).Action); } } Modified: trunk/tora/src/toworksheetstatistic.h =================================================================== --- trunk/tora/src/toworksheetstatistic.h 2008-02-10 23:29:02 UTC (rev 2562) +++ trunk/tora/src/toworksheetstatistic.h 2008-02-11 00:40:14 UTC (rev 2563) @@ -56,12 +56,14 @@ class toBarChart; class toListView; class toWorksheetStatistic; +class QAction; class toWorksheetStatistic : public QWidget { Q_OBJECT; struct data { + QAction *Action; QWidget *Top; QLabel *Label; QSplitter *Charts; @@ -97,8 +99,8 @@ virtual void showPlans(bool); virtual void showCharts(bool); - virtual void save(int); - virtual void remove(int); + virtual void save(QAction *); + virtual void remove(QAction *); virtual void load(void); virtual void displayMenu(void); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2008-02-11 06:58:01
|
Revision: 2564 http://tora.svn.sourceforge.net/tora/?rev=2564&view=rev Author: mrjohnson0 Date: 2008-02-10 22:58:05 -0800 (Sun, 10 Feb 2008) Log Message: ----------- should extend toEditWidget to get edit events Modified Paths: -------------- trunk/tora/src/toresulttableview.cpp trunk/tora/src/toresulttableview.h Modified: trunk/tora/src/toresulttableview.cpp =================================================================== --- trunk/tora/src/toresulttableview.cpp 2008-02-11 00:40:14 UTC (rev 2563) +++ trunk/tora/src/toresulttableview.cpp 2008-02-11 06:58:05 UTC (rev 2564) @@ -44,6 +44,10 @@ #include "toconnection.h" #include "tomemoeditor.h" #include "tomain.h" +#include "toresultlistformat.h" +#include "tolistviewformatter.h" +#include "tolistviewformatterfactory.h" +#include "tolistviewformatteridentifier.h" #include <QClipboard> #include <QScrollBar> @@ -86,6 +90,17 @@ bool editable) : QTableView(parent), toResult(), + toEditWidget(false, // open + true, // save + true, // print + false, // undo + false, // redo + false, // cut + false, // copy + false, // past + true, // search + true, // selectall + false), // readall Model(NULL) { if(name) @@ -303,9 +318,8 @@ if(!index.isValid()) return; - QVariant data = model()->data(index, Qt::EditRole); - if(action == displayAct) { + QVariant data = model()->data(index, Qt::EditRole); toMemoEditor *ed = new toMemoEditor(this, data.toString()); ed->exec(); } @@ -315,18 +329,12 @@ Model->setAlignment(index.column(), Qt::AlignRight); else if(action == centerAct) Model->setAlignment(index.column(), Qt::AlignHCenter); - else if(action == copyAct) { - QClipboard *clip = qApp->clipboard(); - - if(data.canConvert<QString>()) - clip->setText(data.toString()); - } - else if(action == selectAllAct) { - selectAll(); - } - else if(action == editAct) { + else if(action == copyAct) + editCopy(); + else if(action == selectAllAct) + editSelectAll(); + else if(action == editAct) toMainWidget()->editSQL(sqlName()); - } else if(action == readAllAct) { QModelIndex index; while(Model->canFetchMore(index)) @@ -334,6 +342,8 @@ } else if(action == refreshAct) refresh(); + else if(action == exportAct) + editSave(false); } @@ -416,6 +426,107 @@ } +int toResultTableView::exportType(QString &separator, QString &delimiter) { + toResultListFormat format(this, NULL); + if(!format.exec()) + return -1; + + format.saveDefault(); + + separator = format.Separator->text(); + delimiter = format.Delimiter->text(); + + return format.Format->currentIndex(); +} + + +QString toResultTableView::exportAsText(bool includeHeader, + bool onlySelection, + int type, + QString &separator, + QString &delimiter) { + QString result; + + if(type < 0) + type = exportType(separator, delimiter); + if(type < 0) + return QString::null; + + toExportSettings settings(includeHeader, + onlySelection, + type, + separator, + delimiter); + + std::auto_ptr<toListViewFormatter> pFormatter( + toListViewFormatterFactory::Instance().CreateObject(type)); + result = pFormatter->getFormattedString(settings, model()); + + return result; +} + + +// ---------------------------------------- overrides toEditWidget + +bool toResultTableView::editSave(bool askfile) { + try { + QString delimiter; + QString separator; + int type = exportType(separator, delimiter); + + QString nam; + switch(type) { + case - 1: + return false; + default: + nam = "*.txt"; + break; + case 2: + nam = "*.csv"; + break; + case 3: + nam = "*.html"; + break; + case 4: + nam = "*.sql"; + break; + } + + QString filename = toSaveFilename(QString::null, nam, this); + if(filename.isEmpty()) + return false; + + return toWriteFile(filename, exportAsText(true, + false, + type, + separator, + delimiter)); + } + TOCATCH; + + return false; +} + + +void toResultTableView::editPrint() { +} + + +void toResultTableView::editCopy() { + QClipboard *clip = qApp->clipboard(); + + QModelIndex index = currentIndex(); + QVariant data = model()->data(index, Qt::EditRole); + if(data.canConvert<QString>()) + clip->setText(data.toString()); +} + + +void toResultTableView::editSelectAll() { + selectAll(); +} + + void toResultTableView::resizeColumnsToContents() { if(!ColumnsResized) QTableView::resizeColumnsToContents(); Modified: trunk/tora/src/toresulttableview.h =================================================================== --- trunk/tora/src/toresulttableview.h 2008-02-11 00:40:14 UTC (rev 2563) +++ trunk/tora/src/toresulttableview.h 2008-02-11 06:58:05 UTC (rev 2564) @@ -44,6 +44,7 @@ #include "toresult.h" #include "toconnection.h" #include "toresultmodel.h" +#include "toeditwidget.h" #include <QObject> #include <QAbstractTableModel> @@ -58,7 +59,10 @@ class toTableViewIterator; -class toResultTableView : public QTableView, public toResult { +class toResultTableView : public QTableView, + public toResult, + public toEditWidget { + Q_OBJECT; // Widget to store query statistics to. @@ -305,6 +309,63 @@ } + /** + * Helper function to display a toResultListFormat. + * + * @param separator + * @param delimiter + */ + virtual int exportType(QString &separator, QString &delimiter); + + + /** + * Export list as a string. + * + * @param includeHeader Include header. + * @param onlySelection Only include selection. + * @param type Format of exported list. + * @param separator Separator for CSV format. + * @param delimiter Delimiter for CSV format. + */ + QString exportAsText(bool includeHeader, + bool onlySelection, + int type, + QString &separator, + QString &delimiter); + + + // ---------------------------------------- overrides toEditWidget + + /** + * Perform a save on this widget. + * + * @param askfile Ask filename even if default filename is available. + */ + virtual bool editSave(bool askfile); + + + /** + * Print this widgets contents. + * + */ + virtual void editPrint(void); + + + /** + * Perform copy. + * + */ + virtual void editCopy(void); + + + /** + * Select all contents. + * + */ + virtual void editSelectAll(void); + + + public slots: /** * Resizes all columns based on the size hints of the delegate This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |