Update of /cvsroot/tora/tora In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32160 Modified Files: NEWS configure main.cpp toabout.cpp tobrowser.cpp tobrowser.h tobrowserconstraint.cpp tobrowserindex.cpp toconf.h toconnection.cpp toconnection.h toeditextensions.cpp tohighlightedtext.h tomain.cpp tonewconnection.cpp tonewconnection.h tonewconnectionui.ui tooracleconnection.cpp toparamget.cpp toparamget.h toqsqlconnection.cpp tora_toad.ts toresultconstraint.cpp toresultlong.cpp toresultlong.h toresultview.cpp toresultview.h tosession.h tosqledit.cpp totableselect.cpp toworksheet.cpp utils.cpp Log Message: Index: toparamget.h =================================================================== RCS file: /cvsroot/tora/tora/toparamget.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** toparamget.h 12 May 2004 19:02:12 -0000 1.22 --- toparamget.h 20 May 2004 07:10:51 -0000 1.23 *************** *** 45,49 **** #include <qpushbutton.h> ! class QLineEdit; class QGrid; class QScrollView; --- 45,49 ---- #include <qpushbutton.h> ! class QComboBox; class QGrid; class QScrollView; *************** *** 71,83 **** /** Default values cache */ ! static std::map<QString,std::map<QString,QString> > DefaultCache; /** Specified values cache */ ! static std::map<QString,std::map<QString,QString> > Cache; QScrollView *View; QGrid *Container; ! std::list<QLineEdit *> Value; toParamGet(QWidget *parent=0,const char *name=0); protected: --- 71,83 ---- /** Default values cache */ ! static std::map<QString,std::list<QString> > DefaultCache; /** Specified values cache */ ! static std::map<QString,std::list<QString> > Cache; QScrollView *View; QGrid *Container; ! std::list<QComboBox *> Value; toParamGet(QWidget *parent=0,const char *name=0); protected: Index: toresultconstraint.cpp =================================================================== RCS file: /cvsroot/tora/tora/toresultconstraint.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** toresultconstraint.cpp 12 May 2004 19:02:33 -0000 1.34 --- toresultconstraint.cpp 20 May 2004 07:10:51 -0000 1.35 *************** *** 51,55 **** addColumn(tr("Constraint Name")); addColumn(tr("Condition")); ! #ifndef TOAD addColumn(tr("Enabled")); addColumn(tr("Delete Rule")); --- 51,55 ---- addColumn(tr("Constraint Name")); addColumn(tr("Condition")); ! #ifndef TO_NO_ORACLE addColumn(tr("Enabled")); addColumn(tr("Delete Rule")); Index: utils.cpp =================================================================== RCS file: /cvsroot/tora/tora/utils.cpp,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** utils.cpp 12 May 2004 19:02:35 -0000 1.143 --- utils.cpp 20 May 2004 07:10:51 -0000 1.144 *************** *** 778,782 **** if (!url.isLocalFile()) { QString tmpFile; ! if(KIO::NetAccess::download(url,tmpFile)) { QFile file(tmpFile); if (!file.open(IO_ReadOnly)) { --- 778,782 ---- if (!url.isLocalFile()) { QString tmpFile; ! if(KIO::NetAccess::download(url,tmpFile,toMainWidget())) { QFile file(tmpFile); if (!file.open(IO_ReadOnly)) { *************** *** 834,838 **** } file.close(); ! if (!KIO::NetAccess::upload(file.name(),url)) { file.unlink(); TOMessageBox::warning(toMainWidget(),QT_TRANSLATE_NOOP("toWriteFile","File error"), --- 834,838 ---- } file.close(); ! if (!KIO::NetAccess::upload(file.name(),url,toMainWidget())) { file.unlink(); TOMessageBox::warning(toMainWidget(),QT_TRANSLATE_NOOP("toWriteFile","File error"), Index: tosqledit.cpp =================================================================== RCS file: /cvsroot/tora/tora/tosqledit.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** tosqledit.cpp 12 Jan 2004 01:06:06 -0000 1.52 --- tosqledit.cpp 20 May 2004 07:10:51 -0000 1.53 *************** *** 513,517 **** { Name=name; ! setExpandable(true); } --- 513,519 ---- { Name=name; ! std::list<QCString> def=toSQL::range(Name+":"); ! if (def.begin()!=def.end()) ! setExpandable(true); } *************** *** 546,550 **** if (defs.find(Name)==defs.end()) return QString::null; ! return toSQL::string(Name,toMainWidget()->currentConnection()); } catch(...) { return QString::null; --- 548,552 ---- if (defs.find(Name)==defs.end()) return QString::null; ! return toSQL::string(Name,toMainWidget()->currentConnection())+";"; } catch(...) { return QString::null; Index: toqsqlconnection.cpp =================================================================== RCS file: /cvsroot/tora/tora/toqsqlconnection.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** toqsqlconnection.cpp 12 May 2004 19:02:12 -0000 1.27 --- toqsqlconnection.cpp 20 May 2004 07:10:51 -0000 1.28 *************** *** 1154,1158 **** if (Query->isNull(col-1)) val.clear(); ! else if (val.isNull()) fixEmpty=true; } else if (col==0) { --- 1154,1158 ---- if (Query->isNull(col-1)) val.clear(); ! else if ((val.type()==QVariant::Date||val.type()==QVariant::DateTime)&&val.isNull()) fixEmpty=true; } else if (col==0) { *************** *** 1163,1167 **** if (Query->isNull(Column)) val.clear(); ! else if (val.type()==QVariant::Date&&val.isNull()) fixEmpty=true; } --- 1163,1167 ---- if (Query->isNull(Column)) val.clear(); ! else if ((val.type()==QVariant::Date||val.type()==QVariant::DateTime)&&val.isNull()) fixEmpty=true; } *************** *** 1531,1534 **** --- 1531,1547 ---- return ret; } + + virtual std::list<QString> providedOptions(const QCString &provider) + { + std::list<QString> ret; + if (provider=="MySQL") { + ret.insert(ret.end(),"*SSL"); + ret.insert(ret.end(),"*Compress"); + ret.insert(ret.end(),"-"); + ret.insert(ret.end(),"Ignore Space"); + ret.insert(ret.end(),"No Schema"); + } + return ret; + } virtual std::list<QString> providedDatabases(const QCString &,const QString &,const QString &,const QString &) { *************** *** 1644,1647 **** --- 1657,1675 ---- } + QString opt; + + std::set<QString> options=conn.options(); + if (options.find("Compress")==options.end()) + opt+=";CLIENT_COMPRESS"; + if (options.find("Ignore Space")==options.end()) + opt+=";CLIENT_IGNORE_SPACE"; + if (options.find("No Schema")==options.end()) + opt+=";CLIENT_NO_SCHEMA"; + if (options.find("SSL")==options.end()) + opt+=";CLIENT_SSL"; + + if (!opt.isEmpty()) + db->setConnectOptions(opt.mid(1)); // Strip first ; character + db->open(conn.user(),conn.password()); if (!db->isOpen()) { Index: tonewconnection.cpp =================================================================== RCS file: /cvsroot/tora/tora/tonewconnection.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** tonewconnection.cpp 12 May 2004 19:02:12 -0000 1.45 --- tonewconnection.cpp 20 May 2004 07:10:51 -0000 1.46 *************** *** 42,45 **** --- 42,46 ---- #include "totool.h" + #include <qbuttongroup.h> #include <qcheckbox.h> #include <qcombobox.h> *************** *** 72,75 **** --- 73,82 ---- toHelp::connectDialog(this); + OptionGroup->setColumnLayout(0, Qt::Vertical ); + OptionGroup->layout()->setSpacing( 6 ); + OptionGroup->layout()->setMargin( 11 ); + OptionGroupLayout = new QVBoxLayout( OptionGroup->layout() ); + OptionGroupLayout->setAlignment( Qt::AlignTop ); + QPopupMenu *menu = new QPopupMenu(Previous); Database->insertItem(toTool::globalConfig(CONF_DATABASE,DEFAULT_DATABASE)); *************** *** 102,107 **** Provider->setCurrentItem(sel); changeProvider(); - SqlNet->setChecked(!toTool::globalConfig(CONF_HOST,DEFAULT_HOST).isEmpty()); QString host=toTool::globalConfig(CONF_HOST,DEFAULT_HOST); --- 109,114 ---- Provider->setCurrentItem(sel); changeProvider(); + processOptions(toTool::globalConfig(CONF_OPTIONS,DEFAULT_OPTIONS)); QString host=toTool::globalConfig(CONF_HOST,DEFAULT_HOST); *************** *** 154,158 **** QString provider=toTool::globalConfig(tmp,DEFAULT_PROVIDER); ! last=new QListViewItem(Previous,last,provider,host,database,user,passstr); } } --- 161,169 ---- QString provider=toTool::globalConfig(tmp,DEFAULT_PROVIDER); ! tmp=path; ! tmp+=CONF_OPTIONS; ! QString options=toTool::globalConfig(tmp,DEFAULT_OPTIONS); ! ! last=new QListViewItem(Previous,last,provider,host,database,user,passstr,options); } } *************** *** 168,173 **** QString current=Host->currentText(); - Host->clear(); bool sqlNet=false; DefaultPort=0; for(std::list<QString>::iterator i=hosts.begin();i!=hosts.end();i++) { --- 179,185 ---- QString current=Host->currentText(); bool sqlNet=false; + + Host->clear(); DefaultPort=0; for(std::list<QString>::iterator i=hosts.begin();i!=hosts.end();i++) { *************** *** 185,189 **** PortLabel->hide(); Port->hide(); - SqlNet->show(); } else { HostLabel->show(); --- 197,200 ---- *************** *** 191,208 **** PortLabel->show(); Port->show(); - SqlNet->hide(); } Host->lineEdit()->setText(current); ! Mode->clear(); ! std::list<QString> modes=toConnectionProvider::modes(Provider->currentText().latin1()); ! for(std::list<QString>::iterator j=modes.begin();j!=modes.end();j++) ! Mode->insertItem(*j); ! if (Mode->count()==1) { ! Mode->hide(); ! ModeLabel->hide(); ! } else { ! Mode->show(); ! ModeLabel->show(); } } catch (const QString &str) { Host->clear(); --- 202,250 ---- PortLabel->show(); Port->show(); } Host->lineEdit()->setText(current); ! ! for(std::list<QWidget *>::iterator k=OptionWidgets.begin();k!=OptionWidgets.end();k++) { ! if ((*k)->isA("QCheckBox")) { ! QCheckBox *box=(QCheckBox *)(*k); ! Options[box->text()]=box->isChecked(); ! } ! delete *k; ! } ! OptionWidgets.clear(); ! ! std::list<QString> options=toConnectionProvider::options(Provider->currentText().latin1()); ! for(std::list<QString>::iterator j=options.begin();j!=options.end();j++) { ! if ((*j)=="-") { ! QFrame *frame=new QFrame(OptionGroup); ! frame->setFrameShape( QFrame::HLine ); ! frame->setFrameShadow( QFrame::Sunken ); ! OptionGroupLayout->addWidget(frame); ! frame->show(); ! OptionWidgets.insert(OptionWidgets.end(),frame); ! } else { ! QString option=*j; ! bool defOn=false; ! if (option.startsWith("*")) { ! defOn=true; ! option=option.mid(1); ! } ! ! QCheckBox *ow=new QCheckBox(OptionGroup); ! ow->setText(option); ! if (Options.find(option)!=Options.end()) ! ow->setChecked((*(Options.find(option))).second); ! else ! ow->setChecked(defOn); ! OptionGroupLayout->addWidget(ow); ! ow->show(); ! OptionWidgets.insert(OptionWidgets.end(),ow); ! } } + if (options.begin()==options.end()) + OptionGroup->hide(); + else + OptionGroup->show(); + } catch (const QString &str) { Host->clear(); *************** *** 214,236 **** { try { ! QString host; ! if (SqlNet->isHidden()) host=Host->currentText(); ! else ! host=(SqlNet->isChecked()?QString::fromLatin1("SQL*Net"):QString::null); ! std::list<QString> databases=toConnectionProvider::databases(Provider->currentText().latin1(), ! host, ! Username->text(), ! Password->text()); ! QString current=Database->currentText(); ! ! Database->clear(); ! for(std::list<QString>::iterator i=databases.begin();i!=databases.end();i++) ! Database->insertItem(*i); ! Database->lineEdit()->setText(current); } catch (const QString &str) { Database->clear(); toStatusMessage(str); ! } } --- 256,297 ---- { try { ! if (!Host->isHidden()) { ! QString host; host=Host->currentText(); ! std::list<QString> databases=toConnectionProvider::databases(Provider->currentText().latin1(), ! host, ! Username->text(), ! Password->text()); ! QString current=Database->currentText(); ! ! Database->clear(); ! for(std::list<QString>::iterator i=databases.begin();i!=databases.end();i++) ! Database->insertItem(*i); ! Database->lineEdit()->setText(current); ! } } catch (const QString &str) { Database->clear(); toStatusMessage(str); ! } ! } ! ! void toNewConnection::processOptions(const QString &str) ! { ! QStringList options=QStringList::split(",",str); ! std::map<QString,bool> values; ! for(unsigned int i=0;i<options.count();i++) { ! QString val=options[i]; ! if (val.startsWith("*")) ! values[val.mid(1)]=true; ! else ! values[val]=false; ! } ! for(std::list<QWidget *>::iterator k=OptionWidgets.begin();k!=OptionWidgets.end();k++) { ! if ((*k)->isA("QCheckBox")) { ! QCheckBox *box=(QCheckBox *)(*k); ! if (values.find(box->text())!=values.end()) ! box->setChecked(values[box->text()]); ! } ! } } *************** *** 242,249 **** QString pass; QString host; ! if (SqlNet->isHidden()) host=Host->currentText(); ! else ! host=SqlNet->isChecked()?QString::fromLatin1("SQL*Net"):QString::null; std::list<QString> con=toMainWidget()->connections(); --- 303,325 ---- QString pass; QString host; ! if (Host->isHidden()) host=Host->currentText(); ! ! QString optionstring; ! std::set<QString> options; ! ! for(std::list<QWidget *>::iterator k=OptionWidgets.begin();k!=OptionWidgets.end();k++) { ! if ((*k)->isA("QCheckBox")) { ! if (!optionstring.isEmpty()) ! optionstring+=","; ! QCheckBox *box=(QCheckBox *)(*k); ! if (box->isChecked()) { ! optionstring+="*"; ! options.insert(box->text()); ! } ! optionstring+=box->text(); ! } ! } ! toTool::globalSetConfig(CONF_OPTIONS,optionstring); std::list<QString> con=toMainWidget()->connections(); *************** *** 269,273 **** host, Database->currentText(), ! Mode->currentText()); { for(QListViewItem *item=Previous->firstChild();item;item=item->nextSibling()) { --- 345,349 ---- host, Database->currentText(), ! options); { for(QListViewItem *item=Previous->firstChild();item;item=item->nextSibling()) { *************** *** 294,298 **** Database->currentText(), Username->text(), ! retCon->password()); historySave(); return retCon; --- 370,375 ---- Database->currentText(), Username->text(), ! retCon->password(), ! optionstring); historySave(); return retCon; *************** *** 306,309 **** --- 383,387 ---- } } + void toNewConnection::historySave(void) { int siz=toTool::globalConfig(CONF_CONNECT_SIZE,DEFAULT_CONNECT_SIZE).toInt(); *************** *** 351,354 **** --- 429,439 ---- toTool::globalEraseConfig(tmp); + tmp=path; + tmp+=CONF_OPTIONS; + if (i<siz&&item) + toTool::globalSetConfig(tmp,item->text(5)); + else + toTool::globalEraseConfig(tmp); + i++; if (i<siz&&item) *************** *** 369,384 **** } changeProvider(); ! if (SqlNet->isHidden()) { ! QString host=item->text(1); ! int portix=host.find(":"); ! if (portix>=0) { ! Host->lineEdit()->setText(host.mid(0,portix)); ! Port->setValue(host.mid(portix+1).toInt()); ! } else { ! Host->lineEdit()->setText(host); ! Port->setValue(DefaultPort); ! } ! } else ! SqlNet->setChecked(!item->text(1).isEmpty()); Database->lineEdit()->setText(item->text(2)); Username->setText(item->text(3)); --- 454,470 ---- } changeProvider(); ! ! QString host=item->text(1); ! int portix=host.find(":"); ! if (portix>=0) { ! Host->lineEdit()->setText(host.mid(0,portix)); ! Port->setValue(host.mid(portix+1).toInt()); ! } else { ! Host->lineEdit()->setText(host); ! Port->setValue(DefaultPort); ! } ! ! processOptions(item->text(5)); ! Database->lineEdit()->setText(item->text(2)); Username->setText(item->text(3)); Index: toconnection.h =================================================================== RCS file: /cvsroot/tora/tora/toconnection.h,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** toconnection.h 12 May 2004 19:02:11 -0000 1.59 --- toconnection.h 20 May 2004 07:10:51 -0000 1.60 *************** *** 41,44 **** --- 41,45 ---- #include <list> #include <map> + #include <set> #include <qstring.h> *************** *** 414,421 **** QString Host; QString Database; - QString Mode; QCString Version; std::list<QObject *> Widgets; std::list<QString> InitStrings; toLock Lock; std::list<toConnectionSub *> Connections; --- 415,422 ---- QString Host; QString Database; QCString Version; std::list<QObject *> Widgets; std::list<QString> InitStrings; + std::set<QString> Options; toLock Lock; std::list<toConnectionSub *> Connections; *************** *** 625,633 **** * @param host Host to connect to the database with. * @param database Database to connect to. ! * @param mode Mode to connect to the database with. * @param cache Enable object cache for this connection. */ toConnection(const QCString &provider,const QString &user,const QString &password, ! const QString &host,const QString &database,const QString &mode=QString::null, bool cache=true); /** Create a copy of a connection. Will not cache objects, so objects will never be available --- 626,634 ---- * @param host Host to connect to the database with. * @param database Database to connect to. ! * @param options Options used to connect to the database with. * @param cache Enable object cache for this connection. */ toConnection(const QCString &provider,const QString &user,const QString &password, ! const QString &host,const QString &database,const std::set<QString> &options, bool cache=true); /** Create a copy of a connection. Will not cache objects, so objects will never be available *************** *** 640,643 **** --- 641,647 ---- virtual ~toConnection(); + //* Get the options for the connection. + const std::set<QString> &options() const + { return Options; } /** Try to close all the widgets associated with this connection. * @return True if all widgets agreed to close. *************** *** 664,671 **** const QString &database() const { return Database; } - /** Get mode of connection. - */ - const QString &mode() const - { return Mode; } /** Get version of connection. */ --- 668,671 ---- *************** *** 941,952 **** /** Create an implementation of a connection to this database. * @return A connection implementation created with new. */ virtual toConnection::connectionImpl *provideConnection(const QCString &provider, toConnection *conn)=0; - /** List the available modes for this database. - * @return A list of modes that the connection implementation understands. - */ - virtual std::list<QString> providedModes(const QCString &provider); /** List the available hosts this database provider knows about. * @return A list of hosts. --- 941,950 ---- /** Create an implementation of a connection to this database. + * @param provider Provider to use for connection. + * @param conn The connection object to use the created connection. * @return A connection implementation created with new. */ virtual toConnection::connectionImpl *provideConnection(const QCString &provider, toConnection *conn)=0; /** List the available hosts this database provider knows about. * @return A list of hosts. *************** *** 969,972 **** --- 967,977 ---- { } + /** Get a list of options available for the connection. An option with the name + * "-" indicates a break should be made to separate the rest of the options from the previous + * options. An option preceeded by "*" means selected by default. The * shoul be stripped before + * before passing it to the connection call. + */ + virtual std::list<QString> providedOptions(const QCString &provider); + /** * Create and return configuration tab for this connectiontype. The returned widget should also *************** *** 984,990 **** */ static std::list<QCString> providers(); ! /** Get a list of modes for a given provider. */ ! static std::list<QString> modes(const QCString &provider); /** Implement a connection for a given provider. * @param provider Provider to implement. --- 989,995 ---- */ static std::list<QCString> providers(); ! /** Get a list of options for a given provider. */ ! static std::list<QString> options(const QCString &provider); /** Implement a connection for a given provider. * @param provider Provider to implement. Index: toresultview.cpp =================================================================== RCS file: /cvsroot/tora/tora/toresultview.cpp,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** toresultview.cpp 12 May 2004 19:02:34 -0000 1.132 --- toresultview.cpp 20 May 2004 07:10:51 -0000 1.133 *************** *** 473,482 **** }; ! toListView::toListView(QWidget *parent,const char *name) ! : QListView(parent,name), toEditWidget(false,true,true, false,false, false,false,false, ! true,false,false) { FirstSearch=false; --- 473,482 ---- }; ! toListView::toListView(QWidget *parent,const char *name,WFlags f) ! : QListView(parent,name,f), toEditWidget(false,true,true, false,false, false,false,false, ! true,true,false) { FirstSearch=false; *************** *** 1364,1375 **** } ! toResultView::toResultView(bool readable,bool dispCol,QWidget *parent,const char *name) ! : toListView(parent,name) { setup(readable,dispCol); } ! toResultView::toResultView(QWidget *parent,const char *name) ! : toListView(parent,name) { setup(false,true); --- 1364,1375 ---- } ! toResultView::toResultView(bool readable,bool dispCol,QWidget *parent,const char *name,WFlags f) ! : toListView(parent,name,f) { setup(readable,dispCol); } ! toResultView::toResultView(QWidget *parent,const char *name,WFlags f) ! : toListView(parent,name,f) { setup(false,true); Index: tora_toad.ts =================================================================== RCS file: /cvsroot/tora/tora/tora_toad.ts,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tora_toad.ts 12 May 2004 21:15:54 -0000 1.1 --- tora_toad.ts 20 May 2004 07:10:51 -0000 1.2 *************** *** 1,592 **** ! <!DOCTYPE TS><TS> ! <context> ! <name>toAlert</name> ! <message> ! <source>Alt+R</source> ! <comment>Alert|Add Name</comment> ! <translation>Alt+R</translation> ! </message> ! <message> ! <source>Ctrl+Backspace</source> [...1155 lines suppressed...] ! <comment>Worksheet|Reexecute last statement</comment> ! <translation>F5</translation> ! </message> ! <message> ! <source>F3</source> ! <comment>Worksheet|Explain plan</comment> ! <translation>CTRL+E</translation> ! </message> ! <message> ! <source>Ctrl+Shift+S</source> ! <comment>Worksheet|Select saved SQL</comment> ! <translation>Ctrl+N</translation> ! </message> ! <message> ! <source>Ctrl+F9</source> ! <comment>Worksheet|Check syntax of buffer</comment> ! <translation>Ctrl+F9</translation> ! </message> ! </context> ! </TS> Index: toconf.h =================================================================== RCS file: /cvsroot/tora/tora/toconf.h,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** toconf.h 12 May 2004 19:02:11 -0000 1.109 --- toconf.h 20 May 2004 07:10:51 -0000 1.110 *************** *** 47,51 **** #define DEFAULT_USER "system" #define CONF_HOST "Host" ! #define DEFAULT_HOST "SQL*Net" #define CONF_MAX_NUMBER "MaxNumber" #define DEFAULT_MAX_NUMBER "50" --- 47,53 ---- #define DEFAULT_USER "system" #define CONF_HOST "Host" ! #define DEFAULT_HOST "localhost" ! #define CONF_OPTIONS "Options" ! #define DEFAULT_OPTIONS "" #define CONF_MAX_NUMBER "MaxNumber" #define DEFAULT_MAX_NUMBER "50" Index: toresultlong.h =================================================================== RCS file: /cvsroot/tora/tora/toresultlong.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** toresultlong.h 12 Jan 2004 01:06:06 -0000 1.25 --- toresultlong.h 20 May 2004 07:10:51 -0000 1.26 *************** *** 91,101 **** * @param parent Parent of list. * @param name Name of widget. */ ! toResultLong(bool readable,bool numCol,toQuery::queryMode mode,QWidget *parent,const char *name=NULL); /** Create widget. The columns are not readable and the number column is displayed. * @param parent Parent of list. * @param name Name of widget. */ ! toResultLong(QWidget *parent,const char *name=NULL); ~toResultLong(); --- 91,103 ---- * @param parent Parent of list. * @param name Name of widget. + * @param f Widget flags. */ ! toResultLong(bool readable,bool numCol,toQuery::queryMode mode,QWidget *parent,const char *name=NULL,WFlags f=0); /** Create widget. The columns are not readable and the number column is displayed. * @param parent Parent of list. * @param name Name of widget. + * @param f Widget flags. */ ! toResultLong(QWidget *parent,const char *name=NULL,WFlags f=0); ~toResultLong(); Index: tomain.cpp =================================================================== RCS file: /cvsroot/tora/tora/tomain.cpp,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** tomain.cpp 12 May 2004 19:02:12 -0000 1.177 --- tomain.cpp 20 May 2004 07:10:51 -0000 1.178 *************** *** 89,92 **** --- 89,95 ---- #ifdef TO_KDE #include "tomainwindow.kde.moc" + + #include "icons/toramini.xpm" + #else #include "tomainwindow.moc" *************** *** 1371,1375 **** data[key+":User"]=(*i)->user(); data[key+":Host"]=(*i)->host(); ! data[key+":Mode"]=(*i)->mode(); data[key+":Database"]=(*i)->database(); data[key+":Provider"]=(*i)->provider(); --- 1374,1383 ---- data[key+":User"]=(*i)->user(); data[key+":Host"]=(*i)->host(); ! ! QString options; ! for(std::set<QString>::const_iterator j=(*i)->options().begin();j!=(*i)->options().end();j++) ! options+=","+*j; ! data[key+":Options"]=options.mid(1); // Strip extra , in beginning ! data[key+":Database"]=(*i)->database(); data[key+":Provider"]=(*i)->provider(); *************** *** 1424,1428 **** QString user=data[key+":User"]; QString host=data[key+":Host"]; ! QString mode=data[key+":Mode"]; QString password=toUnobfuscate(data[key+":Password"]); QString provider=data[key+":Provider"]; --- 1432,1442 ---- QString user=data[key+":User"]; QString host=data[key+":Host"]; ! ! QStringList optionlist=QStringList::split(",",data[key+":Options"]); ! std::set<QString> options; ! for(unsigned int j=0;j<optionlist.count();j++) ! if (!optionlist[j].isEmpty()) ! options.insert(optionlist[j]); ! QString password=toUnobfuscate(data[key+":Password"]); QString provider=data[key+":Provider"]; *************** *** 1438,1442 **** if (ok) { try { ! toConnection *conn=new toConnection(provider.latin1(),user,password,host,database,mode); if (conn) { conn=addConnection(conn,false); --- 1452,1456 ---- if (ok) { try { ! toConnection *conn=new toConnection(provider.latin1(),user,password,host,database,options); if (conn) { conn=addConnection(conn,false); Index: tonewconnection.h =================================================================== RCS file: /cvsroot/tora/tora/tonewconnection.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tonewconnection.h 12 May 2004 19:02:12 -0000 1.21 --- tonewconnection.h 20 May 2004 07:10:51 -0000 1.22 *************** *** 46,49 **** --- 46,56 ---- int DefaultPort; + + QVBoxLayout *OptionGroupLayout; + + std::map<QString,bool> Options; + std::list<QWidget *> OptionWidgets; + + void processOptions(const QString &); public: toNewConnection(QWidget* parent=0,const char* name=0,bool modal=false,WFlags fl=0); Index: totableselect.cpp =================================================================== RCS file: /cvsroot/tora/tora/totableselect.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** totableselect.cpp 12 May 2004 21:15:54 -0000 1.1 --- totableselect.cpp 20 May 2004 07:10:51 -0000 1.2 *************** *** 1,81 **** ! #include "utils.h" ! ! #include "toconnection.h" ! #include "toresultcombo.h" ! #include "totableselect.h" ! ! #include <qlabel.h> ! ! #include "totableselect.moc" ! ! void toTableSelect::setup() ! { ! setTitle(tr("Table selection")); ! setColumnLayout(1,Vertical); ! bool mysql=false; ! try { ! mysql=toIsMySQL(toCurrentConnection(this)); ! } catch(...) { ! } ! QLabel *label=new QLabel(mysql?tr("Database"):tr("Schema"),this); ! label->show(); ! Schema=new toResultCombo(this); ! Schema->show(); ! Schema->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); ! label=new QLabel(tr("Table"),this); ! label->show(); ! Table=new toResultCombo(this); ! Table->show(); ! Table->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); ! ! Schema->additionalItem(mysql?tr("Select database"):tr("Select schema")); ! Schema->query(toSQL::sql(toSQL::TOSQL_USERLIST)); ! Table->additionalItem(tr("Select table")); ! Table->setSQL(toSQL::sql("toBrowser:ListTables")); ! ! Schema->refresh(); ! if (!SelectedTable.isNull()) ! setTable(SelectedTable); ! connect(Schema,SIGNAL(activated(int)),this,SLOT(changeSchema())); ! connect(Table,SIGNAL(activated(int)),this,SLOT(changeTable())); ! } ! ! toTableSelect::toTableSelect(QWidget *parent,const char *name) ! : QGroupBox(parent,name) ! { ! Schema=Table=NULL; ! QTimer::singleShot(1,this,SLOT(setup())); ! } ! ! void toTableSelect::setTable(const QString &table) ! { ! if (!Table||!Schema) ! SelectedTable=table; ! else { ! QStringList parts=QStringList::split(".",table); ! toConnection &conn=toCurrentConnection(this); ! if (parts.size()>1) { ! Schema->setSelected(conn.unQuote(parts[0])); ! Table->setSelected(conn.unQuote(parts[1])); ! } else ! Schema->setSelected(conn.unQuote(table)); ! Table->changeParams(Schema->selected()); ! } ! } ! ! void toTableSelect::changeSchema(void) ! { ! if (Schema->currentItem()!=0) ! Table->changeParams(Schema->selected()); ! } ! ! void toTableSelect::changeTable(void) ! { ! if (Table->currentItem()!=0) { ! toConnection &conn=toCurrentConnection(this); ! QString table=conn.quote(Schema->selected()); ! table+="."; ! table+=conn.quote(Table->selected()); ! emit selectTable(table); ! } ! } --- 1,81 ---- ! #include "utils.h" ! ! #include "toconnection.h" ! #include "toresultcombo.h" ! #include "totableselect.h" ! ! #include <qlabel.h> ! ! #include "totableselect.moc" ! ! void toTableSelect::setup() ! { ! setTitle(tr("Table selection")); ! setColumnLayout(1,Vertical); ! bool mysql=false; ! try { ! mysql=toIsMySQL(toCurrentConnection(this)); ! } catch(...) { ! } ! QLabel *label=new QLabel(mysql?tr("Database"):tr("Schema"),this); ! label->show(); ! Schema=new toResultCombo(this); ! Schema->show(); ! Schema->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); ! label=new QLabel(tr("Table"),this); ! label->show(); ! Table=new toResultCombo(this); ! Table->show(); ! Table->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); ! ! Schema->additionalItem(mysql?tr("Select database"):tr("Select schema")); ! Schema->query(toSQL::sql(toSQL::TOSQL_USERLIST)); ! Table->additionalItem(tr("Select table")); ! Table->setSQL(toSQL::sql("toBrowser:ListTables")); ! ! Schema->refresh(); ! if (!SelectedTable.isNull()) ! setTable(SelectedTable); ! connect(Schema,SIGNAL(activated(int)),this,SLOT(changeSchema())); ! connect(Table,SIGNAL(activated(int)),this,SLOT(changeTable())); ! } ! ! toTableSelect::toTableSelect(QWidget *parent,const char *name) ! : QGroupBox(parent,name) ! { ! Schema=Table=NULL; ! QTimer::singleShot(1,this,SLOT(setup())); ! } ! ! void toTableSelect::setTable(const QString &table) ! { ! if (!Table||!Schema) ! SelectedTable=table; ! else { ! QStringList parts=QStringList::split(".",table); ! toConnection &conn=toCurrentConnection(this); ! if (parts.size()>1) { ! Schema->setSelected(conn.unQuote(parts[0])); ! Table->setSelected(conn.unQuote(parts[1])); ! } else ! Schema->setSelected(conn.unQuote(table)); ! Table->changeParams(Schema->selected()); ! } ! } ! ! void toTableSelect::changeSchema(void) ! { ! if (Schema->currentItem()!=0) ! Table->changeParams(Schema->selected()); ! } ! ! void toTableSelect::changeTable(void) ! { ! if (Table->currentItem()!=0) { ! toConnection &conn=toCurrentConnection(this); ! QString table=conn.quote(Schema->selected()); ! table+="."; ! table+=conn.quote(Table->selected()); ! emit selectTable(table); ! } ! } Index: tobrowser.h =================================================================== RCS file: /cvsroot/tora/tora/tobrowser.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tobrowser.h 12 May 2004 19:02:11 -0000 1.39 --- tobrowser.h 20 May 2004 07:10:50 -0000 1.40 *************** *** 80,83 **** --- 80,85 ---- void enableDisableConstraints(const QString &); void dropSomething(const QString &,const QString &); + + QListViewItem *selectedItem(); public: toBrowser(QWidget *parent,toConnection &connection); *************** *** 95,99 **** void changeSecond(void); void changeSecondTab(QWidget *tab); ! void changeItem(QListViewItem *item); void clearFilter(void); void defineFilter(void); --- 97,101 ---- void changeSecond(void); void changeSecondTab(QWidget *tab); ! void changeItem(); void clearFilter(void); void defineFilter(void); *************** *** 107,111 **** --- 109,120 ---- void modifyConstraint(void); void modifyIndex(void); + void dropTable(void); + void truncateTable(void); + + void checkTable(void); + void optimizeTable(void); + void analyzeTable(void); + void dropIndex(void); void fixIndexCols(void); Index: tooracleconnection.cpp =================================================================== RCS file: /cvsroot/tora/tora/tooracleconnection.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** tooracleconnection.cpp 12 May 2004 19:02:12 -0000 1.85 --- tooracleconnection.cpp 20 May 2004 07:10:51 -0000 1.86 *************** *** 760,769 **** virtual toConnection::connectionImpl *provideConnection(const QCString &,toConnection *conn) { return new oracleConnection(conn); } ! virtual std::list<QString> providedModes(const QCString &) { std::list<QString> ret; ! ret.insert(ret.end(),QString::fromLatin1("Normal")); ! ret.insert(ret.end(),QString::fromLatin1("SYS_OPER")); ! ret.insert(ret.end(),QString::fromLatin1("SYS_DBA")); return ret; } --- 760,770 ---- virtual toConnection::connectionImpl *provideConnection(const QCString &,toConnection *conn) { return new oracleConnection(conn); } ! virtual std::list<QString> providedOptions(const QCString &) { std::list<QString> ret; ! ret.insert(ret.end(),"*SQL*Net"); ! ret.insert(ret.end(),"-"); ! ret.insert(ret.end(),"SYS_OPER"); ! ret.insert(ret.end(),"SYS_DBA"); return ret; } *************** *** 969,973 **** { QString oldSid; ! bool sqlNet=!connection().host().isEmpty(); if (!sqlNet) { oldSid=getenv("ORACLE_SID"); --- 970,977 ---- { QString oldSid; ! ! std::set<QString> options=connection().options(); ! ! bool sqlNet=(options.find("SQL*Net")!=options.end()); if (!sqlNet) { oldSid=getenv("ORACLE_SID"); *************** *** 976,984 **** otl_connect *conn=NULL; try { - QString mode=connection().mode(); int session_mode=OCI_DEFAULT; ! if (mode==QString::fromLatin1("SYS_OPER")) session_mode=OCI_SYSOPER; ! else if (mode==QString::fromLatin1("SYS_DBA")) session_mode=OCI_SYSDBA; do { --- 980,987 ---- otl_connect *conn=NULL; try { int session_mode=OCI_DEFAULT; ! if (options.find("SYS_OPER")!=options.end()) session_mode=OCI_SYSOPER; ! else if (options.find("SYS_DBA")!=options.end()) session_mode=OCI_SYSDBA; do { Index: tonewconnectionui.ui =================================================================== RCS file: /cvsroot/tora/tora/tonewconnectionui.ui,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tonewconnectionui.ui 12 May 2004 19:02:12 -0000 1.13 --- tonewconnectionui.ui 20 May 2004 07:10:51 -0000 1.14 *************** *** 1,3 **** ! <!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <class>toNewConnectionUI</class> <widget class="QDialog"> --- 1,3 ---- ! <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>toNewConnectionUI</class> <widget class="QDialog"> *************** *** 10,14 **** <y>0</y> <width>654</width> ! <height>412</height> </rect> </property> --- 10,14 ---- <y>0</y> <width>654</width> ! <height>424</height> </rect> </property> *************** *** 26,30 **** <number>6</number> </property> ! <widget class="QPushButton" row="15" column="3"> <property name="name"> <cstring>CancelButton</cstring> --- 26,30 ---- <number>6</number> </property> ! <widget class="QPushButton" row="13" column="3"> <property name="name"> <cstring>CancelButton</cstring> *************** *** 42,46 **** </property> </widget> ! <widget class="QPushButton" row="15" column="2"> <property name="name"> <cstring>OkButton</cstring> --- 42,46 ---- </property> </widget> ! <widget class="QPushButton" row="13" column="2"> <property name="name"> <cstring>OkButton</cstring> *************** *** 61,65 **** </property> </widget> ! <spacer row="15" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>Spacer1</cstring> --- 61,65 ---- </property> </widget> ! <spacer row="13" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>Spacer1</cstring> *************** *** 78,82 **** </property> </spacer> ! <widget class="toListView" row="1" column="0" rowspan="14" colspan="1"> <property name="name"> <cstring>Previous</cstring> --- 78,82 ---- </property> </spacer> ! <widget class="toListView" row="1" column="0" rowspan="12" colspan="1"> <property name="name"> <cstring>Previous</cstring> *************** *** 90,93 **** --- 90,96 ---- </sizepolicy> </property> + <property name="focusPolicy"> + <enum>StrongFocus</enum> + </property> </widget> <widget class="QLabel" row="0" column="0"> *************** *** 186,218 **** </property> </widget> ! <spacer row="14" column="1"> ! <property name="name"> ! <cstring>Spacer3</cstring> ! </property> ! <property name="orientation"> ! <enum>Vertical</enum> ! </property> ! <property name="sizeType"> ! <enum>Expanding</enum> ! </property> ! <property name="sizeHint"> ! <size> ! <width>20</width> ! <height>30</height> ! </size> ! </property> ! </spacer> ! <widget class="QCheckBox" row="9" column="1" rowspan="1" colspan="3"> ! <property name="name"> ! <cstring>SqlNet</cstring> ! </property> ! <property name="text"> ! <string>Use &SQL*Net</string> ! </property> ! <property name="toolTip" stdset="0"> ! <string>Wether or not connect using the listener or directly to a local database.</string> ! </property> ! </widget> ! <widget class="QComboBox" row="11" column="1" rowspan="1" colspan="3"> <property name="name"> <cstring>Database</cstring> --- 189,193 ---- </property> </widget> ! <widget class="QComboBox" row="10" column="1" rowspan="1" colspan="3"> <property name="name"> <cstring>Database</cstring> *************** *** 228,259 **** </property> </widget> ! <widget class="QLabel" row="12" column="1" rowspan="1" colspan="3"> ! <property name="name"> ! <cstring>ModeLabel</cstring> ! </property> ! <property name="text"> ! <string>&Connection Mode</string> ! </property> ! <property name="buddy" stdset="0"> ! <cstring>Database</cstring> ! </property> ! <property name="toolTip" stdset="0"> ! <string>Mode of the connection. If you don't understand select normal.</string> ! </property> ! </widget> ! <widget class="QComboBox" row="13" column="1" rowspan="1" colspan="3"> ! <property name="name"> ! <cstring>Mode</cstring> ! </property> ! <property name="sizePolicy"> ! <sizepolicy> ! <hsizetype>7</hsizetype> ! <vsizetype>0</vsizetype> ! <horstretch>0</horstretch> ! <verstretch>0</verstretch> ! </sizepolicy> ! </property> ! </widget> ! <widget class="QLabel" row="10" column="1" rowspan="1" colspan="3"> <property name="name"> <cstring>TextLabel3</cstring> --- 203,207 ---- </property> </widget> ! <widget class="QLabel" row="9" column="1" rowspan="1" colspan="3"> <property name="name"> <cstring>TextLabel3</cstring> *************** *** 319,322 **** --- 267,298 ---- </property> </widget> + <widget class="QButtonGroup" row="11" column="1" rowspan="1" colspan="3"> + <property name="name"> + <cstring>OptionGroup</cstring> + </property> + <property name="focusPolicy"> + <enum>StrongFocus</enum> + </property> + <property name="title"> + <string>Options</string> + </property> + </widget> + <spacer row="12" column="1"> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>30</height> + </size> + </property> + </spacer> </grid> </widget> *************** *** 341,345 **** <images> <image name="image0"> ! <data format="XPM.GZ" length="4462">789c9d97c76e24490e86effd1442f3d65870d2451a0ce6206f5adeb4cc620f8c34f2553225b5a4c1befb46927fe6a1d4c0ccac4287fa8a0c26834193f5dbb785b3fd9d856fbf7d799ec9ecba5ea8afe469e15bf3727ffffeeffffcf1e797af49b2d0ffc7d142f2f55f5fbe1ecc16ea85dde9a4ed81290045faa77ca49cf4ab67ba1e3953969173651ab9d4fdf1c8a27c3872ad7c3c72d3b32c2a67c3f3444636fbef23eb7e590267e68fcc4656395d8dacf6d938ef97eaef289781cddebdb2846fccff44b989ba58e3411f3dc75158e6df1d3889539517ca49bf54fe43398d1dec4f46567f685fd9c539f43fc025f80c1c3ce8d93f28e77185f8bf0c6cfae4c0b5f9c3c6e5c0542a4b5876fe13708df39d2bd7716372aa8c93c4e4723bb2f977aadc26ceec4bdb7310e6b0bfab9c2445ecd49f1370694cebca65d260ffa6711a41aef14d24e94cee6be3348e0ae5e9c8765f07ca3e8db17f0f9c825794eb3489351fe9bb7217e4969f29388bd51ee9fda5715a19730696b852fea95c6471647ca95cf64bcf43e0cef4657b647bfe6acf213d6bb32f9a9f5992b5a64f9a8f990b6cf9ecc15d6cf9acf6b2da55a8a75cb973dee4b2d1b38b5c05de02434e87e01aacfb351df5bebddea74b5c67f9c795711ea15e357e2ecde358fb87efc0a867df8cac728a074e62e527706afb59f3cf6583be5c28bb3c35f693812d1fbdc6dbe57966fec932d899ffa4f7e38adca17e34beaeca4b9c271a18f1d5fc739257b0d70d9c68be7bed7fcee7827ab91cd8e4740cf6b19d4ffb87ab07b9bf516e72d4a3ac821b9cef6e60d84f47367ded2fae1d9f7704f6163f79000ffde27660f387ed3c5dbf54dfeebb0bf6acbe6b706bfa5ef32f8f8b18f5bf0f463f20edb77956a4e68fbc80b3c4facd163847be6bfde72ec86dbeac82715fbc0286be683cf3bc081d44f7df80d344fb0b6b7de64581fb916765297263d6fccd9b7ee97e566e8b06cfdb1f59cf2bda2f8bbc2c11df0c5c41aefdb328ca22b1feb0012eedbce24736f91b18fb796d64eb87cb60817dcdafb07d906bfd14d22f659d8785ef97b2f6d7b2df6ef1d6fb2babaac6f92e8c25b27ecc1f239b7f3a5fca5a8678ea7c2d9bc0e6ef1238b3fca2c7814d5f4cbf9334b5f833384bed3c7a5f5514f4adbe2ec07962e7590457f06f6f649b977afe2a16f42f5e070bfc591e18f7a5f1a812a9e0df39d827da4fbd8c6ccfd7785569bf945f953371a9d5a3de67950bfa2d75c63eb2fb15bdcfaaf011e6c7263846bf8f4636f91618f3c7d3c0f047fb69550efab2074e12bd6fd27957553ec33c5b043bcc7f9d0795f818fdb501a3df8ae673e507ff69021eea37063bc45ffb73550736ff36c0a84f3e0317a86f8b5f139e6ffe1f821de6d9127898ff3be00a7c3ab2cd03e3d697560ff40016e47b3bb2e96bbd559d8f32bbff4b7065f193042c98873acf240af6adbf3c83c5f2954bb0c7bcd77c107d81d2fdebc63e33ff640aaecc9e1c8151df5c803dfaadc64b52dfa03ed64636ffb4ff4b2867f453ede7227586fcd3f9264ded91fffafe236d5da37fe83c91ceb7b9e5b7f6731ff92ed7f747d6fbf7e185cf58347e3e6932e47b3430fa893edf87d795c2fc3f003b67f5f902cec17abfde0dfa3c053b3c5ffb832fc2eb8fddcf233887fc195c801f46b6f3cdc02558fba72f7d2d1a7f7e321ee58fe0cad86bbff24dd3e2fe74fef836b0c6eb60d62fa6bf5e07b3419f853dd7dc70fb8bd5f1255fd90ed30f9f3c5ff30ddff21ddff384a7fcc08ffcc4cf61cdf8855ff9e79c7e1db4dff89d3f7891977899577895d7789d377893b7f83b6fcfe937bc13b477798ff7f9800ff928ac633ee11f7cca6761d7f99c7e1b3cb908da11c7413be1943376e153cc39175c72f549ff9e17c31744429e6a6aa8a58e2ee98aaee9866e7f617fc24b7417a4f734a1293dd0233dd133cd8285177aa5f9f3b63ca5377aa78f607b919668995682e62aadd17ab0b1419b9ff41f682b48bed336edd02eed05ed7d5ea3033a0cdf1ed1f127fd273ae123fa41a774a6b685cee982228a837e42e927fd47caf8985c38651eb40b2ac38e4a5842658a97fab33fd248cb87d2c9a55cc9b5dcc82d1fc99ddccb44a6f230af2f8ff224cf417f262ff22a3fe54ddee543166549966545567f617f4dd66523dc6b2c9bb225df655b7682f692ecca9eeccfe97772c09b722847722c27c1f3eb70f66bf9116c9fca999ccbc59cfe25bf4a143a5ef8992561324a78bd92522acf9ebc78efe7cf7b153276db37bef59dbff457fedadff85b7f27abfede4ffcd4cf9ff76faeff4fffefeff8c7f5fedfdfbffc0fa355c495</data> </image> </images> --- 317,321 ---- <images> <image name="image0"> ! <data format="XPM.GZ" length="45">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f</data> </image> </images> *************** *** 358,367 **** </connection> <connection> - <sender>SqlNet</sender> - <signal>toggled(bool)</signal> - <receiver>toNewConnectionUI</receiver> - <slot>changeHost()</slot> - </connection> - <connection> <sender>Provider</sender> <signal>activated(int)</signal> --- 334,337 ---- *************** *** 382,388 **** <tabstop>Host</tabstop> <tabstop>Port</tabstop> - <tabstop>SqlNet</tabstop> <tabstop>Database</tabstop> ! <tabstop>Mode</tabstop> <tabstop>OkButton</tabstop> <tabstop>CancelButton</tabstop> --- 352,357 ---- <tabstop>Host</tabstop> <tabstop>Port</tabstop> <tabstop>Database</tabstop> ! <tabstop>OptionGroup</tabstop> <tabstop>OkButton</tabstop> <tabstop>CancelButton</tabstop> Index: toeditextensions.cpp =================================================================== RCS file: /cvsroot/tora/tora/toeditextensions.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** toeditextensions.cpp 12 May 2004 19:02:11 -0000 1.31 --- toeditextensions.cpp 20 May 2004 07:10:51 -0000 1.32 *************** *** 331,335 **** try { ! #ifdef TOAD Example->setText(toSQLParse::indent("CREATE PROCEDURE COUNT_EMPS_IN_DEPTS (OUT V_TOTAL INT)\n" "BEGIN\n" --- 331,335 ---- try { ! #ifdef TO_NO_ORACLE Example->setText(toSQLParse::indent("CREATE PROCEDURE COUNT_EMPS_IN_DEPTS (OUT V_TOTAL INT)\n" "BEGIN\n" Index: tobrowserindex.cpp =================================================================== RCS file: /cvsroot/tora/tora/tobrowserindex.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tobrowserindex.cpp 12 May 2004 21:15:54 -0000 1.1 --- tobrowserindex.cpp 20 May 2004 07:10:50 -0000 1.2 *************** *** 1,351 **** ! //*************************************************************************** ! /* ! * TOra - An Oracle Toolkit for DBA's and developers ! * Copyright (C) 2003 Quest Software, Inc ! * ! * 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. ! * ! * All trademarks belong to their respective owners. ! * ! ****************************************************************************/ ! ! #include "utils.h" ! ! #include "tobrowserindex.h" ! #include "toconnection.h" ! #include "toresultcols.h" ! #include "toextract.h" ! #include "tomemoeditor.h" ! #include "tosql.h" ! #include "totableselect.h" ! ! #include <qapplication.h> ! #include <qbuttongroup.h> ! #include <qcombobox.h> ! #include <qinputdialog.h> ! #include <qlabel.h> ! #include <qlineedit.h> ! #include <qprogressdialog.h> ! #include <qradiobutton.h> ! #include <qtimer.h> ! #include <qwidgetstack.h> ! ! #include "tobrowserindex.moc" ! #include "tobrowserindexui.moc" ! ! void toBrowserIndex::modifyIndex(toConnection &conn,const QString &owner,const QString &table,QWidget *parent,const QString &index) ! { ! toBrowserIndex dialog(conn,owner,table,index,parent); ! if (dialog.exec()) { ! dialog.changeIndex(); ! dialog.execute(); ! } ! } ! ! void toBrowserIndex::addIndex(toConnection &conn,const QString &owner,const QString &table,QWidget *parent) ! { ! toBrowserIndex dialog(conn,owner,table,QString::null,parent); ! dialog.addIndex(); ! if (dialog.exec()) { ! dialog.changeIndex(); ! dialog.execute(); ! } ! } ! ! void toBrowserIndex::execute() ! { ! std::list<toSQLParse::statement> statements=toSQLParse::parse(sql(),connection()); ! try { ! QProgressDialog prog(tr("Performing index changes"), ! tr("Executing index change script"), ! statements.size(), ! this,"progress",true); ! prog.setCaption(tr("Performing index changes")); ! for(std::list<toSQLParse::statement>::iterator i=statements.begin();i!=statements.end();i++) { ! QString sql=toSQLParse::indentStatement(*i,connection()); ! int i=sql.length()-1; ! while(i>=0&&(sql.at(i)==';'||sql.at(i).isSpace())) ! i--; ! if (i>=0) ! connection().execute(sql.mid(0,i+1)); ! qApp->processEvents(); ! if (prog.wasCancelled()) ! throw tr("Cancelled ongoing index modification, indexes might be corrupt"); ! } ! } TOCATCH ! } ! ! void toBrowserIndex::registerIndex(const QString &type,const QString &name,std::list<QString>::iterator beg,std::list<QString>::iterator end) ! { ! std::list<toExtract::columnInfo> columns=toExtract::parseColumnDescription(beg,end); ! QString val; ! for(std::list<toExtract::columnInfo>::iterator i=columns.begin();i!=columns.end();i++) { ! if (i!=columns.begin()) ! val+=","; ! val+=(*i).Name; ! } ! IndexType[name]=type; ! IndexCols[name]=val; ! } ! ! toBrowserIndex::toBrowserIndex(toConnection &conn,const QString &owner,const QString &table,const QString &index,QWidget *parent,const char *name) ! : toBrowserIndexUI(parent,name,true),toConnectionWidget(conn,this),Extractor(conn,NULL) ! { ! Extractor.setIndexes(true); ! Extractor.setConstraints(false); ! Extractor.setPrompt(false); ! Extractor.setHeading(false); ! ! if (toIsMySQL(connection())) ! Type->insertItem("Fulltext Index"); ! ! if (!owner.isEmpty()&&!table.isEmpty()) { ! QString fulltable=conn.quote(owner)+"."+conn.quote(table); ! TableSelect->setTable(fulltable); ! describeTable(fulltable); ! } else if (!owner.isEmpty()) ! TableSelect->setTable(conn.quote(owner)); ! ! 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) { ! Name->setCurrentItem(Name->count()-1); ! break; ! } ! } ! ! QString toBrowserIndex::table(void) ! { ! if (Owner.isEmpty()&&Table.isEmpty()) ! return QString::null; ! return connection().quote(Owner)+"."+connection().quote(Table); ! } ! ! void toBrowserIndex::describeTable(const QString &table) ! { ! try { ! QStringList parts=QStringList::split(".",table); ! if (parts.size()>1) { ! Owner=connection().unQuote(parts[0]); ! Table=connection().unQuote(parts[1]); ! } else { ! Table=connection().unQuote(table); ! if (toIsOracle(connection())) ! Owner=connection().user(); ! else ! Owner=connection().database(); ! } ! ! Current=QString::null; ! if (!table.isEmpty()) { ! if (OriginalDescription[table].begin()==OriginalDescription[table].end()) { ! std::list<QString> Objects; ! Objects.insert(Objects.end(),"TABLE:"+table); ! ! NewDescription[table]=Extractor.describe(Objects); ! } ! std::list<QString> &origDescription=NewDescription[table]; ! std::list<QString>::iterator beg=origDescription.end(); ! QString lname; ! QString ltype; ! QString realtype; ! ! IndexType.clear(); ! IndexCols.clear(); ! ! for(std::list<QString>::iterator i=origDescription.begin();i!=origDescription.end();) { ! std::list<QString> ctx=toExtract::splitDescribe(*i); ! toShift(ctx); ! QString type=toShift(ctx); ! if (type=="INDEX") { ! QString name=toShift(ctx); ! if (name!=lname) { ! if (beg!=origDescription.end()) ! registerIndex(realtype,lname,beg,i); ! beg=i; ! ltype=type; ! lname=name; ! } ! if (toShift(ctx)=="TYPE") ! realtype=toShift(ctx); ! i++; ! } else { ! if (beg!=origDescription.end()) { ! registerIndex(realtype,lname,beg,i); ! beg=origDescription.end(); ! } ! i=origDescription.erase(i); // Remove everything that isn't indexes ! } ! } ! if (beg!=origDescription.end()) ! registerIndex(realtype,lname,beg,origDescription.end()); ! } ! if (OriginalDescription[table].begin()==OriginalDescription[table].end()) ! OriginalDescription[table]=NewDescription[table]; ! ! Name->clear(); ! for(std::map<QString,QString>::iterator i=IndexType.begin();i!=IndexType.end();i++) ! Name->insertItem((*i).first); ! ! ColList->displayHeader(false); ! ColList->changeParams(Owner,Table); ! ! show(); ! changeIndex(); ! } catch(const QString &exc) { ! toStatusMessage(exc); ! reject(); ! } ! } ! ! void toBrowserIndex::saveChanges(void) ! { ! if (table().isEmpty()) ! return; ! ! changeIndex(); ! ! std::list<QString> migrateTable; ! ! for(std::map<QString,QString>::iterator i=IndexType.begin();i!=IndexType.end();i++) { ! std::list<QString> ctx; ! toPush(ctx,Owner); ! toPush(ctx,QString("INDEX")); ! toPush(ctx,(*i).first); ! ! QStringList lst=QStringList::split(",",IndexCols[(*i).first]); ! for(unsigned int j=0;j<lst.count();j++) { ! toExtract::addDescription(migrateTable,ctx,"COLUMN",lst[j]); ! toExtract::addDescription(migrateTable,ctx,"COLUMN",lst[j],"ORDER",QString::number(j+1)); ! } ! toExtract::addDescription(migrateTable,ctx); ! toExtract::addDescription(migrateTable,ctx,"ON",Table); ! toExtract::addDescription(migrateTable,ctx,"TYPE",(*i).second); ! } ! NewDescription[table()]=migrateTable; ! } ! ! QString toBrowserIndex::sql() ! { ! saveChanges(); ! ! std::list<QString> origTable; ! std::list<QString> migrateTable; ! ! { ! for(std::map<QString,std::list<QString> >::iterator i=OriginalDescription.begin();i!=OriginalDescription.end();i++) { ! std::list<QString> &cur=(*i).second; ! for(std::list<QString>::iterator j=cur.begin();j!=cur.end();j++) ! toPush(origTable,*j); ! } ! } ! { ! for(std::map<QString,std::list<QString> >::iterator i=NewDescription.begin();i!=NewDescription.end();i++) { ! std::list<QString> &cur=(*i).second; ! for(std::list<QString>::iterator j=cur.begin();j!=cur.end();j++) ! toPush(migrateTable,*j); ! } ! } ! ! origTable.sort(); ! migrateTable.sort(); ! ! return Extractor.migrate(origTable,migrateTable); ! } ! ! void toBrowserIndex::displaySQL() ! { ! toMemoEditor memo(this,sql(),-1,-1,true,true); ! memo.exec(); ! } ! ! void toBrowserIndex::addIndex() ! { ! if (Table.isEmpty()) ! return; ! bool ok=false; ! QString name=QInputDialog::getText(tr("Enter new index name"), ! tr("Enter name of new index."), ! QLineEdit::Normal,QString::null,&ok,this); ! if (ok) { ! Name->insertI... [truncated message content] |