From: <ibr...@us...> - 2011-11-30 16:22:26
|
Revision: 4168 http://tora.svn.sourceforge.net/tora/?rev=4168&view=rev Author: ibre5041 Date: 2011-11-30 16:22:16 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Modified Paths: -------------- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp branches/tora-trotl/sandbox/tora3/src/core/tomain.h branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h branches/tora-trotl/sandbox/tora3/src/core/utils.cpp branches/tora-trotl/sandbox/tora3/src/core/utils.h branches/tora-trotl/sandbox/tora3/src/migratetool/sqldeveloper.cpp branches/tora-trotl/sandbox/tora3/src/migratetool/squirrelsql.cpp branches/tora-trotl/sandbox/tora3/src/migratetool/tora3.cpp Added Paths: ----------- branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.h branches/tora-trotl/sandbox/tora3/src/core/toconnectionimportui.ui branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.cpp branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.h branches/tora-trotl/sandbox/tora3/src/core/tonewconnection.cpp branches/tora-trotl/sandbox/tora3/src/core/tonewconnection.h branches/tora-trotl/sandbox/tora3/src/core/tonewconnectionui.ui Removed Paths: ------------- branches/tora-trotl/sandbox/tora3/src/Makefile.am branches/tora-trotl/sandbox/tora3/src/toconnectionimport.cpp branches/tora-trotl/sandbox/tora3/src/toconnectionimport.h branches/tora-trotl/sandbox/tora3/src/toconnectionimportui.ui branches/tora-trotl/sandbox/tora3/src/toconnectionmodel.cpp branches/tora-trotl/sandbox/tora3/src/toconnectionmodel.h branches/tora-trotl/sandbox/tora3/src/tonewconnection.cpp branches/tora-trotl/sandbox/tora3/src/tonewconnection.h branches/tora-trotl/sandbox/tora3/src/tonewconnectionui.ui Modified: branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt =================================================================== --- branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/CMakeLists.txt 2011-11-30 16:22:16 UTC (rev 4168) @@ -80,12 +80,14 @@ core/tosyntaxsetupui.ui core/totoolsettingui.ui core/connectioncolorsdialogui.ui - + core/tonewconnectionui.ui + core/toconnectionimportui.ui + # tobrowserconstraintui.ui # tobrowserfilterui.ui # tobrowserindexui.ui # tobrowsertableui.ui - # toconnectionimportui.ui + # todebugchangeui.ui # todebugwatch.ui # todescribeui.ui @@ -97,7 +99,6 @@ # tochartalarmui.ui # tochartsetupui.ui # tolinechartsetupui.ui - # tonewconnectionui.ui # toresultcontentfilterui.ui # toresultlistformatui.ui # torollbackdialogui.ui @@ -151,7 +152,10 @@ core/tothread_p.h core/totreewidget.h core/utils.h - + core/tonewconnection.h + core/toconnectionimport.h + core/toconnectionmodel.h + ts_log/toostream.h # toalert.h @@ -182,8 +186,6 @@ # # toconfiguration.h # toquery.h # #tocache.h -# toconnectionimport.h -# toconnectionmodel.h # toconnectionpool.h # torunnable.h # tocurrent.h @@ -219,7 +221,6 @@ # tomemoeditor.h # tomodeleditor.h # # tomysqlkeywords.h -# tonewconnection.h # tooutput.h # toparamget.h # topiechart.h @@ -345,7 +346,14 @@ core/totreewidget.cpp core/utils.cpp core/tosplash.cpp + core/tonewconnection.cpp + core/toconnectionimport.cpp + core/toconnectionmodel.cpp + migratetool/sqldeveloper.cpp + migratetool/squirrelsql.cpp + migratetool/tora3.cpp + connection/tooraclefind.cpp # # main.cpp # totool.cpp @@ -377,8 +385,6 @@ # # tobrowserschemabasewidget.cpp # # tocache.cpp # toquery.cpp -# toconnectionimport.cpp -# toconnectionmodel.cpp # toconnectionpool.cpp # torunnable.cpp # tocurrent.cpp @@ -408,7 +414,6 @@ # tolistviewformattertext.cpp # tomemoeditor.cpp # tomodeleditor.cpp -# tonewconnection.cpp # #win only? toocistub.cpp # tooracleconnection_trotl.cpp # tooracleextract.cpp @@ -484,9 +489,6 @@ # toworksheettext.cpp # toworksheetwidget.cpp # # -# migratetool/sqldeveloper.cpp -# migratetool/squirrelsql.cpp -# migratetool/tora3.cpp # # shortcuteditor # shortcuteditor/shortcuteditordialog.cpp # shortcuteditor/shortcutmodel.cpp Deleted: branches/tora-trotl/sandbox/tora3/src/Makefile.am =================================================================== --- branches/tora-trotl/sandbox/tora3/src/Makefile.am 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/Makefile.am 2011-11-30 16:22:16 UTC (rev 4168) @@ -1,553 +0,0 @@ -# require version or better -AUTOMAKE_OPTIONS = 1.7 - -bin_PROGRAMS=tora - -METASOURCES = AUTO - -TRANSLATIONS= \ - i18n/tora_se.ts \ - i18n/tora_fr.ts \ - i18n/tora_it.ts \ - i18n/tora_toad.ts - -LOKIDIR_INC=$(top_srcdir)/src/loki/include -LOKIDIR_SRC=$(top_srcdir)/src/loki/src - -AM_CPPFLAGS = -I./otl -I$(LOKIDIR_INC) $(QT_INCLUDES) $(LTDLINCL) -AM_CPPFLAGS += $(PCRE_CFLAGS) \ - -DDEFAULT_PLUGIN_DIR=\"$(libdir)\" \ - -DTOVERSION=\"$(PACKAGE_VERSION)\" \ - $(ORACLE_CXXFLAGS) \ - $(TERADATA_CXXFLAGS) \ - $(QT_DEFINES) \ - $(WIN_CXXFLAGS) \ - $(QSCINTILLA_CXXFLAGS) - -AM_LDFLAGS = $(PCRE_LIBS) \ - $(QT_LDFLAGS) \ - $(LIB_DCOP) \ - -lstdc++ \ - $(LIBPTHREAD) \ - $(ORACLE_LDFLAGS) \ - $(TERADATA_LDFLAGS) \ - $(WIN_LDFLAGS) \ - $(QSCINTILLA_LDFLAGS) - -# fix for annoying automake naming problems. -tora_CXXFLAGS = $(AM_CXXFLAGS) - -tora_LDADD = $(ORACLE_LIBS) $(PQ_LIBS) $(TERADATA_LIBS) $(@TORA_LINK_OTHERS@) - -if HAVE_ORACLE -EXTRA_ORACLE_MONO_SOURCE = tooracleconnection.cpp tooraclesetting.h \ - tooracletable.cpp \ - tooracleextract.cpp otl/otlv4.h -EXTRA_ORACLE_MONO_SOURCE_MOC = moc_tooraclesetting.cpp -endif - -if HAVE_TERADATA -EXTRA_TERADATE_SOURCE = toteradataconnection.cpp -endif - -tora_SOURCES=main.cpp \ - tomainwindow.cpp tomainwindow.h \ - toabout.cpp toabout.h \ - tobackground.cpp tobackground.h \ - tobackgroundlabel.cpp tobackgroundlabel.h \ - toconfiguration.cpp toconfiguration.h \ - toconnection.cpp toconnection.h \ - toquery.cpp toquery.h \ - toqueryimpl.h \ - toqvalue.cpp toqvalue.h \ - tocache.cpp tocache.h \ - toconnectionimport.cpp toconnectionimport.h \ - toconnectionpool.cpp toconnectionpool.h \ - todescribe.cpp todescribe.h \ - torunnable.cpp torunnable.h \ - toeditwidget.cpp toeditwidget.h \ - toglobalsetting.cpp toglobalsetting.h \ - tohelp.cpp tohelp.h tohelpsetup.h \ - tohighlightedtext.cpp tohighlightedtext.h \ - tohtml.cpp tohtml.h \ - tolistviewformatter.cpp tolistviewformatter.h \ - tolistviewformattercsv.cpp tolistviewformattercsv.h \ - tolistviewformatterfactory.h \ - tolistviewformatterhtml.cpp tolistviewformatterhtml.h \ - tolistviewformatteridentifier.h \ - tolistviewformattersql.cpp tolistviewformattersql.h \ - tolistviewformattertabdel.cpp tolistviewformattertabdel.h \ - tolistviewformattertext.cpp tolistviewformattertext.h \ - tomain.cpp tomain.h \ - tomarkedtext.cpp tomarkedtext.h \ - tomemoeditor.cpp tomemoeditor.h \ - tomodeleditor.cpp tomodeleditor.h \ - tomessage.cpp tomessage.h \ - tonewconnection.cpp tonewconnection.h \ - toeventquery.cpp toeventquery.h \ - toeventquerytask.cpp toeventquerytask.h \ - toparamget.cpp toparamget.h \ - topreferences.cpp topreferences.h \ - toplsqleditor.cpp toplsqleditor.h \ - toplsqltext.cpp toplsqltext.h \ - toresult.cpp toresult.h \ - toresultfield.cpp toresultfield.h \ - toresultitem.cpp toresultitem.h \ - toresultstats.cpp toresultstats.h \ - toresultview.cpp toresultview.h \ - toresultlistformat.cpp toresultlistformat.h \ - toresultmodel.cpp toresultmodel.h \ - toresulttableview.cpp toresulttableview.h \ - toresulttableviewedit.cpp toresulttableviewedit.h \ - toresultdata.cpp toresultdata.h \ - toresultdatasingle.cpp toresultdatasingle.h \ - totreewidget.cpp totreewidget.h \ - tosearchreplace.cpp tosearchreplace.h \ - tosmtp.cpp tosmtp.h \ - tosplash.cpp tosplash.h \ - tosql.cpp tosql.h \ - tosqlparse.cpp tosqlparse.h \ - tosyntaxsetup.cpp tosyntaxsetup.h \ - totabwidget.cpp totabwidget.h \ - totemplateprovider.cpp \ - totextview.cpp totextview.h \ - tothread.cpp tothread.h tothread_p.h \ - totimer.cpp totimer.h \ - totool.cpp totool.h \ - utils.cpp utils.h \ - toalert.cpp toalert.h \ - toanalyze.cpp toanalyze.h \ - tobackup.cpp tobackup.h \ - tobackuptool.cpp tobackuptool.h \ - tobrowser.cpp tobrowser.h \ - todocklet.cpp todocklet.h \ - todockbar.cpp todockbar.h \ - topushbutton.cpp topushbutton.h \ - docklets/toviewdirectory.cpp docklets/toviewdirectory.h \ - docklets/toviewconnections.cpp docklets/toviewconnections.h \ - tobarchart.cpp tobarchart.h \ - tocurrent.cpp tocurrent.h \ - todebug.cpp todebug.h \ - toeditextensions.cpp toeditextensions.h \ - todatatype.cpp todatatype.h \ - toinvalid.cpp toinvalid.h \ - tooutput.cpp tooutput.h \ - topassword.cpp \ - toprofiler.cpp toprofiler.h \ - toproject.cpp toproject.h \ - toqsqlconnection.cpp \ - torollback.cpp torollback.h \ - toscript.cpp toscript.h \ - toscriptschemawidget.cpp toscriptschemawidget.h \ - toscripttreeitem.cpp toscripttreeitem.h \ - tocodemodel.cpp tocodemodel.h \ - toscripttreemodel.cpp toscripttreemodel.h \ - tosecurity.cpp tosecurity.h \ - tosecuritytreemodel.cpp tosecuritytreemodel.h \ - tosecuritytreeitem.cpp tosecuritytreeitem.h \ - tosession.cpp tosession.h \ - tosgatrace.cpp tosgatrace.h \ - tosqledit.cpp tosqledit.h \ - tostorage.cpp tostorage.h \ - tostoragedefinition.cpp tostoragedefinition.h \ - totemplate.cpp totemplate.h \ - totemporary.cpp totemporary.h \ - totuning.cpp totuning.h \ - tounittest.cpp tounittest.h \ - tochangeconnection.cpp tochangeconnection.h \ - toworkingwidget.cpp toworkingwidget.h \ - toworksheet.cpp toworksheet.h \ - toeditablemenu.cpp toeditablemenu.h \ - toworksheetwidget.cpp toworksheetwidget.h \ - toworksheettext.cpp toworksheettext.h \ - toworksheetstatistic.cpp toworksheetstatistic.h \ - tobrowserconstraint.cpp tobrowserconstraint.h \ - tobrowserindex.cpp tobrowserindex.h \ - tobrowsertable.cpp tobrowsertable.h \ - tochartmanager.cpp tochartmanager.h \ - tolegendchart.cpp tolegendchart.h \ - tolinechart.cpp tolinechart.h \ - topiechart.cpp topiechart.h \ - toresultbar.cpp toresultbar.h \ - toresultline.cpp toresultline.h \ - toresultpie.cpp toresultpie.h \ - todebugtext.cpp todebugtext.h \ - toextract.cpp toextract.h \ - toreport.cpp toreport.h \ - toresultextract.cpp toresultextract.h \ - toresultcols.cpp toresultcols.h \ - toresultcolscomment.cpp toresultcolscomment.h \ - toresultcombo.cpp toresultcombo.h \ - toresultschema.cpp toresultschema.h \ - toresultdepend.cpp toresultdepend.h \ - toresultlabel.cpp toresultlabel.h \ - toresultlock.cpp toresultlock.h \ - toresultlong.cpp toresultlong.h \ - toresultplan.cpp toresultplan.h \ - toresultparam.cpp toresultparam.h \ - toresultstorage.cpp toresultstorage.h \ - tofilesize.cpp tofilesize.h \ - tosgastatement.cpp tosgastatement.h \ - totableselect.cpp totableselect.h \ - tovisualize.cpp tovisualize.h \ - towaitevents.cpp towaitevents.h \ - toconnectionmodel.cpp toconnectionmodel.h \ - tobrowserbasewidget.cpp tobrowserbasewidget.h \ - tobrowseraccesswidget.cpp tobrowseraccesswidget.h \ - tobrowsertablewidget.cpp tobrowsertablewidget.h \ - tobrowserviewwidget.cpp tobrowserviewwidget.h \ - tobrowserindexwidget.cpp tobrowserindexwidget.h \ - tobrowserschemawidget.cpp tobrowserschemawidget.h \ - tobrowsersequencewidget.cpp tobrowsersequencewidget.h \ - tobrowsersynonymwidget.cpp tobrowsersynonymwidget.h \ - tobrowsercodewidget.cpp tobrowsercodewidget.h \ - tobrowsertriggerwidget.cpp tobrowsertriggerwidget.h \ - tobrowserdblinkswidget.cpp tobrowserdblinkswidget.h \ - tobrowserdirectorieswidget.cpp tobrowserdirectorieswidget.h \ - toresultgrants.cpp toresultgrants.h \ - toawr.cpp toawr.h \ - precompiled.h \ - migratetool/sqldeveloper.cpp migratetool/sqldeveloper.h \ - migratetool/squirrelsql.cpp migratetool/squirrelsql.h \ - migratetool/tora3.cpp migratetool/tora3.h \ - shortcuteditor/shortcuteditordialog.cpp shortcuteditor/shortcuteditordialog.h \ - shortcuteditor/shortcutmodel.cpp shortcuteditor/shortcutmodel.h \ - $(EXTRA_ORACLE_MONO_SOURCE) \ - $(EXTRA_TERADATE_SOURCE) \ - $(LOKIDIR_SRC)/SmallObj.cpp \ - $(LOKIDIR_SRC)/Singleton.cpp \ - $(EXTRA_tora_SOURCES) \ - $(BUILT_SOURCES) - -UI_FILES = toaboutui.ui \ - tobrowserconstraintui.ui \ - tobrowserfilterui.ui \ - tobrowserindexui.ui \ - tobrowsertableui.ui \ - toconnectionimportui.ui \ - todescribeui.ui \ - tooraclesettingui.ui \ - tostoragetablespaceui.ui \ - tochartalarmui.ui \ - topreferencesui.ui \ - tosyntaxsetupui.ui \ - tochartsetupui.ui \ - toresultcontentfilterui.ui \ - totemplateaddfileui.ui \ - todatabasesettingui.ui \ - toresultlistformatui.ui \ - totemplateeditui.ui \ - todebugchangeui.ui \ - torollbackdialogui.ui \ - totemplatesetupui.ui \ - todebugwatch.ui \ - toscriptui.ui \ - toscriptschemawidgetui.ui \ - totoolsettingui.ui \ - toeditextensiongotoui.ui \ - tosearchreplaceui.ui \ - totuningoverviewui.ui \ - toeditextensionsetupui.ui \ - tosecurityquotaui.ui \ - totuningsettingui.ui \ - toglobalsettingui.ui \ - tosecurityroleui.ui \ - toworksheetsetupui.ui \ - tohelpui.ui \ - tohelpaddfileui.ui \ - tosecurityuserui.ui \ - tohelpsetupui.ui \ - tostoragedatafileui.ui \ - tolinechartsetupui.ui \ - tostoragedefinitionui.ui \ - tomessageui.ui \ - tostoragedialogui.ui \ - tonewconnectionui.ui \ - tostorageprefsui.ui \ - todroptablespaceui.ui \ - toscriptschemawidgetui.ui \ - shortcuteditor/shortcuteditordialog.ui \ - connectioncolorsdialogui.ui - - -EXTRA_DIST = icons \ - templates \ - windows \ - qscintilla2 \ - COPYRIGHT.h \ - help \ - $(LOKIDIR_INC) \ - $(UI_FILES) \ - CMakeLists.txt \ - loki/CMakeLists.txt \ - Makefile.am \ - toconf.h \ - todefaultkeywords.h \ - toextratranslations.cpp \ - tomysqlkeywords.h \ - toocistub.cpp \ - tooraclepreload.cpp \ - toresultresources.h \ - tooracleextract.h \ - tologger.h \ - ts_log/critical_section.h \ - ts_log/decorator.h \ - ts_log/message_handler_log.h \ - ts_log/thread_safe_log.h \ - ts_log/ts_log_utils.h \ - $(TRANSLATIONS) \ - LICENSE.h \ - tora.qrc \ - tora.rc - -# this is a hack (but it *is* mentioned in the automake manual, of all -# places). EXTRA_DIST includes all files, even things like CVS -# folders. so we delete them here. but specifying all the files in -# those subdirs would suck more because many of them are generated -# (help api for one). -dist-hook: - rm -rf `find $(distdir) -name .svn` - -# mrj: this sorta sucks. there's a lot of generated source files... -# the old build system distributed the .depends folder in the source -# tarball, which is the old way of handling the dependencies. that's -# not fully portable. using BUILT_SOURCES is the (relatively speaking) -# new work around. this is mainly why i've required automake >= 1.6. - -# files listed in BUILT_SOURCES are built before anything else. -BUILT_SOURCES = \ - moc_toabout.cpp \ - moc_toalert.cpp \ - moc_toanalyze.cpp \ - moc_tobackup.cpp \ - moc_tobarchart.cpp \ - moc_tobackground.cpp \ - moc_tobackgroundlabel.cpp \ - moc_tobrowser.cpp \ - moc_tobrowserconstraint.cpp \ - moc_tobrowserindex.cpp \ - moc_tobrowsertable.cpp \ - moc_tochangeconnection.cpp \ - moc_tochartmanager.cpp \ - moc_toconnection.cpp \ - moc_toquery.cpp \ - moc_toqueryimpl.cpp \ - moc_tocache.cpp \ - moc_toconnectionmodel.cpp \ - moc_tocodemodel.cpp \ - moc_toconnectionpool.cpp \ - moc_toconnectionimport.cpp \ - moc_todescribe.cpp \ - moc_torunnable.cpp \ - moc_toeventquery.cpp \ - moc_toeventquerytask.cpp \ - moc_tocurrent.cpp \ - moc_todatatype.cpp \ - moc_todebug.cpp \ - moc_todebugtext.cpp \ - moc_toeditextensions.cpp \ - moc_tofilesize.cpp \ - moc_toglobalsetting.cpp \ - moc_tohelp.cpp \ - moc_tohelpsetup.cpp \ - moc_tohighlightedtext.cpp \ - moc_toinvalid.cpp \ - moc_tolegendchart.cpp \ - moc_tolinechart.cpp \ - moc_tomain.cpp \ - moc_tomainwindow.cpp \ - moc_tomarkedtext.cpp \ - moc_tomemoeditor.cpp \ - moc_tomodeleditor.cpp \ - moc_tomessage.cpp \ - moc_tonewconnection.cpp \ - moc_tooutput.cpp \ - moc_toparamget.cpp \ - moc_topiechart.cpp \ - moc_toplsqleditor.cpp \ - moc_toplsqltext.cpp \ - moc_topreferences.cpp \ - moc_toprofiler.cpp \ - moc_toproject.cpp \ - moc_toresult.cpp \ - moc_toresultbar.cpp \ - moc_toresultcols.cpp \ - moc_toresultcolscomment.cpp \ - moc_toresultcombo.cpp \ - moc_toresultschema.cpp \ - moc_toresultdepend.cpp \ - moc_toresultextract.cpp \ - moc_toresultfield.cpp \ - moc_toresultitem.cpp \ - moc_toresultlabel.cpp \ - moc_toresultline.cpp \ - moc_toresultlock.cpp \ - moc_toresultlong.cpp \ - moc_toresultparam.cpp \ - moc_toresultpie.cpp \ - moc_toresultplan.cpp \ - moc_toresultstats.cpp \ - moc_toresultstorage.cpp \ - moc_toresultview.cpp \ - moc_toresultlistformat.cpp \ - moc_toresultmodel.cpp \ - moc_toresulttableview.cpp \ - moc_toresulttableviewedit.cpp \ - moc_toresultdata.cpp \ - moc_toresultdatasingle.cpp \ - moc_totreewidget.cpp \ - moc_torollback.cpp \ - moc_toscript.cpp \ - moc_tosearchreplace.cpp \ - moc_tosecurity.cpp \ - moc_tosecuritytreemodel.cpp \ - moc_tosession.cpp \ - moc_tosgastatement.cpp \ - moc_tosgatrace.cpp \ - moc_tosmtp.cpp \ - moc_tosqledit.cpp \ - moc_tostorage.cpp \ - moc_tosyntaxsetup.cpp \ - moc_totableselect.cpp \ - moc_totabwidget.cpp \ - moc_totemplate.cpp \ - moc_totemporary.cpp \ - moc_tothread_p.cpp \ - moc_totool.cpp \ - moc_totuning.cpp \ - moc_tounittest.cpp \ - moc_tovisualize.cpp \ - moc_towaitevents.cpp \ - moc_toworksheet.cpp \ - moc_toeditablemenu.cpp \ - moc_toworksheetwidget.cpp \ - moc_toworksheetstatistic.cpp \ - moc_utils.cpp \ - moc_toscriptschemawidget.cpp \ - moc_toscripttreemodel.cpp \ - moc_toworkingwidget.cpp \ - shortcuteditor/moc_shortcuteditordialog.cpp \ - shortcuteditor/moc_shortcutmodel.cpp \ - moc_todocklet.cpp \ - moc_todockbar.cpp \ - moc_topushbutton.cpp \ - moc_tobrowserbasewidget.cpp \ - moc_tobrowseraccesswidget.cpp \ - moc_tobrowsertablewidget.cpp \ - moc_tobrowserviewwidget.cpp \ - moc_tobrowserindexwidget.cpp \ - moc_tobrowserschemawidget.cpp \ - moc_tobrowsersequencewidget.cpp \ - moc_tobrowsersynonymwidget.cpp \ - moc_tobrowsercodewidget.cpp \ - moc_tobrowsertriggerwidget.cpp \ - moc_tobrowserdblinkswidget.cpp \ - moc_tobrowserdirectorieswidget.cpp \ - moc_toresultgrants.cpp \ - moc_toawr.cpp \ - docklets/moc_toviewdirectory.cpp \ - docklets/moc_toviewconnections.cpp \ - ui_toaboutui.h \ - ui_todroptablespaceui.h \ - ui_tobrowserconstraintui.h \ - ui_tobrowserfilterui.h \ - ui_tobrowserindexui.h \ - ui_todescribeui.h \ - ui_tobrowsertableui.h \ - ui_toconnectionimportui.h \ - ui_tochartalarmui.h \ - ui_tochartsetupui.h \ - ui_todatabasesettingui.h \ - ui_todebugchangeui.h \ - ui_todebugwatch.h \ - ui_toeditextensiongotoui.h \ - ui_toeditextensionsetupui.h \ - ui_toglobalsettingui.h \ - ui_tohelpaddfileui.h \ - ui_tohelpsetupui.h \ - ui_tolinechartsetupui.h \ - ui_tomessageui.h \ - ui_tonewconnectionui.h \ - ui_tooraclesettingui.h \ - ui_topreferencesui.h \ - ui_toresultcontentfilterui.h \ - ui_toresultlistformatui.h \ - ui_torollbackdialogui.h \ - ui_toscriptui.h \ - ui_tosearchreplaceui.h \ - ui_tosecurityquotaui.h \ - ui_tosecurityroleui.h \ - ui_tosecurityuserui.h \ - ui_tostoragedatafileui.h \ - ui_tostoragedefinitionui.h \ - ui_tostoragedialogui.h \ - ui_tostorageprefsui.h \ - ui_tostoragetablespaceui.h \ - ui_tosyntaxsetupui.h \ - ui_totemplateaddfileui.h \ - ui_totemplateeditui.h \ - ui_totemplatesetupui.h \ - ui_totoolsettingui.h \ - ui_totuningoverviewui.h \ - ui_totuningsettingui.h \ - ui_toworksheetsetupui.h \ - ui_tohelpui.h \ - ui_toscriptschemawidgetui.h \ - ui_connectioncolorsdialogui.h \ - shortcuteditor/ui_shortcuteditordialog.h \ - $(EXTRA_ORACLE_MONO_SOURCE_MOC) \ - $(filter %.qm,$(TRANSLATIONS:%.ts=%.qm)) \ - tora_toad.h \ - qrc_tora.cpp - -#.ui.h: -# $(UIC) -o $@ $< -ui_%.h: %.ui - $(UIC) -o $@ $< - -%.cpp: %.h %.ui - $(UIC) -o $@ $< - -moc_%.cpp: %.h - $(MOC) $< -o $@ - -qrc_%.cpp: %.qrc - $(RCC) $< -o $@ - -#make resource file depend on resources -qrc_tora.cpp: help/*.html help/images/*.png icons/*.xpm - -#.h.moc: -# $(MOC) $(AM_CPPFLAGS) -o $@ $< - -.ts.qm: - @if ! test -d i18n; then mkdir i18n; echo "create i18n"; fi - $(LRELEASE) $< -qm $@ - -clean-local: - rm -f moc_* - for file in `ls *.ui`; do \ - rm -f `echo $$file | sed 's/\.ui/\.cpp/g'`; \ - rm -f `echo $$file | sed 's/\.ui/\.h/g'`; \ - done - -tora_toad.h: i18n/tora_toad.qm - $(top_builddir)/utils/chex/chex $< > $@ - -tora.pro: Makefile.am - echo "# Not indended to be used for anything except lupdate" > tora.pro - echo 'SOURCES= \ ' >> tora.pro - echo ' main.cpp \ ' >> tora.pro - echo ' toextratranslations.cpp \ ' >> tora.pro - echo " $(tora_SOURCES)" >> tora.pro - echo 'TRANSLATIONS=$(TRANSLATIONS)' >> tora.pro - -lupdate: tora.pro - $(LUPDATE) tora.pro - -lrelease: tora.pro $(TRANSLATIONS) - $(LRELEASE) tora.pro - -install-data-hook: - mkdir -p $(DESTDIR)$(libdir) - cp -f $(top_builddir)/src/i18n/*.qm $(DESTDIR)$(libdir) Modified: branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/core/tobackgroundlabel.cpp 2011-11-30 16:22:16 UTC (rev 4168) @@ -84,8 +84,8 @@ if (e->button() == Qt::LeftButton) { QString str = "Currently running SQL:\n\n"; - std::list<QString> conns = toMainWidget()->connections(); - for (std::list<QString>::iterator i = conns.begin();i != conns.end();i++) + QList<QString> conns = toMainWidget()->connections(); + foreach (QString const& i, conns) { #ifdef TORA3_CONNECTION toConnection &conn = toMainWidget()->connection(*i); Copied: branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.cpp (from rev 4166, branches/tora-trotl/sandbox/tora3/src/toconnectionimport.cpp) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.cpp 2011-11-30 16:22:16 UTC (rev 4168) @@ -0,0 +1,108 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous 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. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include <QMessageBox> + +#include "migratetool/sqldeveloper.h" +#include "migratetool/squirrelsql.h" +#include "migratetool/tora3.h" +#include "toconnectionimport.h" +#include "toconnectionmodel.h" + + + +toConnectionImport::toConnectionImport(QWidget * parent) + : QDialog(parent) +{ + setupUi(this); + m_tool = toConnectionImport::None; + toolComboBox->addItem("None", toConnectionImport::None); + toolComboBox->addItem("TOra (1.3.x)", + toConnectionImport::Tora3); + toolComboBox->addItem("Oracle SQL Developer (1.5)", + toConnectionImport::OracleSQLDeveloper); + toolComboBox->addItem("SquirrelSQL (2.6.x)", + toConnectionImport::SquirrelSQL); + + toolComboBox_changed(0); + + availableModel = new toConnectionModel(); + + tableView->setModel(availableModel); + + connect(toolComboBox, SIGNAL(currentIndexChanged(int)), + this, SLOT(toolComboBox_changed(int))); + connect(runButton, SIGNAL(clicked()), + this, SLOT(refreshAvailable())); +} + +void toConnectionImport::toolComboBox_changed(int ix) +{ + m_tool = (ToolUsed)toolComboBox->itemData(ix).toInt(); + if (m_tool == toConnectionImport::OracleSQLDeveloper) + notificationLabel->setText(tr("Import connections from an XML file.\n" + "No passwords or options are imported.")); + else if (m_tool == toConnectionImport::SquirrelSQL) + notificationLabel->setText(tr("Import connections from tool config directory.")); + else if (m_tool == toConnectionImport::Tora3) + notificationLabel->setText(tr("Import connections from ~/.torarc")); + else + notificationLabel->setText(tr("Select one of tools available.\n" + "Connections could require manual changes after importing.")); +} + +void toConnectionImport::refreshAvailable() +{ + if (m_tool == toConnectionImport::None) + { + QMessageBox::information(this, "TOra", + "Please select an import tool first."); + return; + } + if (m_tool == toConnectionImport::OracleSQLDeveloper) + availableModel->setupData(MigrateTool::sqlDeveloper(this)); + else if (m_tool == toConnectionImport::SquirrelSQL) + availableModel->setupData(MigrateTool::squirrelSql(this)); + else if (m_tool == toConnectionImport::Tora3) + availableModel->setupData(MigrateTool::tora3(this)); + + tableView->resizeColumnsToContents(); +} Copied: branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.h (from rev 4166, branches/tora-trotl/sandbox/tora3/src/toconnectionimport.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionimport.h 2011-11-30 16:22:16 UTC (rev 4168) @@ -0,0 +1,86 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous 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. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TOCONNECTIONIMPORT_H +#define TOCONNECTIONIMPORT_H + +#include "ui_toconnectionimportui.h" +#include "core/toconnectionmodel.h" + + +/*! \brief GUI to load conections from the others tools. +\author Petr Vanek <pe...@sc...> +*/ +class toConnectionImport : public QDialog, public Ui::toConnectionImport +{ + Q_OBJECT + + public: + toConnectionImport(QWidget * parent = 0); + + //! \brief Supported loaders + enum ToolUsed { + None = 0, + OracleSQLDeveloper = 1, + SquirrelSQL = 2, + Tora3 = 3 + }; + + //! \brief Send all imported connections to the caller + QMap<int,toConnectionOptions> availableConnections() + { + return availableModel->availableConnections(); + }; + + private: + toConnectionModel * availableModel; + + ToolUsed m_tool; + + private slots: + //! Change m_tool + void toolComboBox_changed(int); + //! Read new connections from the outside + void refreshAvailable(); + +}; + +#endif Copied: branches/tora-trotl/sandbox/tora3/src/core/toconnectionimportui.ui (from rev 4166, branches/tora-trotl/sandbox/tora3/src/toconnectionimportui.ui) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionimportui.ui (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionimportui.ui 2011-11-30 16:22:16 UTC (rev 4168) @@ -0,0 +1,100 @@ +<ui version="4.0" > + <class>toConnectionImport</class> + <widget class="QDialog" name="toConnectionImport" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>679</width> + <height>456</height> + </rect> + </property> + <property name="windowTitle" > + <string>Import Connections</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <widget class="QLabel" name="label" > + <property name="text" > + <string>&From:</string> + </property> + <property name="buddy" > + <cstring>toolComboBox</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QComboBox" name="toolComboBox" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item row="0" column="2" > + <widget class="QPushButton" name="runButton" > + <property name="text" > + <string>&Run...</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="3" > + <widget class="QLabel" name="notificationLabel" /> + </item> + <item row="2" column="0" colspan="3" > + <widget class="QTableView" name="tableView" > + <property name="alternatingRowColors" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="3" column="0" colspan="3" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>toConnectionImport</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel" > + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>toConnectionImport</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel" > + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> Copied: branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.cpp (from rev 4166, branches/tora-trotl/sandbox/tora3/src/toconnectionmodel.cpp) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.cpp 2011-11-30 16:22:16 UTC (rev 4168) @@ -0,0 +1,185 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous 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. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "core/toconnectionmodel.h" +#include "core/tonewconnection.h" +#include "core/toconfiguration.h" +#include "core/utils.h" + +#include <QSettings> + + +toConnectionModel::toConnectionModel() +{ +} + +void toConnectionModel::setupData(QMap<int,toConnectionOptions> list) +{ + m_data.clear(); + m_data = list; + reset(); +} + + +void toConnectionModel::readConfig() +{ + m_data.clear(); + + QSettings Settings; + Settings.beginGroup("connections"); + Settings.beginGroup("history"); + for (int pos = 0; pos < Settings.childGroups().count(); ++pos) + { + Settings.beginGroup(QString::number(pos)); // history\## entry in TOra.conf + if (!Settings.contains("provider")) + { + Settings.endGroup(); + break; + } + + QString provider = Settings.value("provider", "").toString(); + QString host = Settings.value("host", "").toString(); + QString database = Settings.value("database", "").toString(); + QString username = Settings.value("username", "").toString(); + QString password = Utils::toUnobfuscate(Settings.value("password", "").toString()); + QString schema = Settings.value("schema", "").toString(); + QString color = Settings.value("color", "").toString(); + + if (provider.startsWith("Oracle Client")) + host = ""; + + Settings.beginGroup("options"); + QSet<QString> options; + QStringList keys = Settings.allKeys(); + foreach(QString const& s, keys) + { + if (Settings.value(s, false).toBool()) + options.insert(s); + } + Settings.endGroup(); + + toConnectionOptions opt( + provider, + host, + database, + username, + password, + schema, + color, + Settings.value("port", 0).toInt(), + options); + m_data[pos] = opt; + Settings.endGroup(); + } + Settings.endGroup(); // history section + + reset(); +} + +void toConnectionModel::append(int ix, toConnectionOptions conn) +{ + m_data[ix] = conn; + reset(); +} + +bool toConnectionModel::removeRow(int row, const QModelIndex &parent) +{ + beginRemoveRows(QModelIndex(), row, row + 1); + QModelIndex ix = index(row, 0); + int key = data(ix, Qt::DisplayRole).toInt(); + bool ret = m_data.remove(key); + endRemoveRows(); + + return ret; +} + +QVariant toConnectionModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + if (orientation == Qt::Vertical) + return section + 1; + switch (section) + { + case 0 : return "#"; + case 1 : return "Provider"; + case 2 : return "Host"; + case 3 : return "Database"; + case 4 : return "Username"; + case 5 : return "Schema"; + } + return "oops!"; +} + +QVariant toConnectionModel::data(const QModelIndex & index, int role) const +{ + if (!index.isValid()) + return QVariant(); + + + toConnectionOptions opt = m_data[index.row()]; + switch (role) + { + case Qt::DisplayRole: + switch (index.column()) + { + case 0 : return index.row(); + case 1 : return opt.provider; + case 2 : return opt.host; + case 3 : return opt.database; + case 4 : return opt.username; + case 5 : return opt.schema; + default : return "oops!"; + } + break; + case Qt::DecorationRole: + if (index.column() == 1 && toConfigurationSingle::Instance().colorizedConnections()) + return Utils::connectionColorPixmap(opt.color); + break; + } + return QVariant(); +} + +Qt::ItemFlags toConnectionModel::flags(const QModelIndex & index) const +{ + return Qt::ItemIsSelectable | Qt::ItemIsEnabled; +} + Copied: branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.h (from rev 4166, branches/tora-trotl/sandbox/tora3/src/toconnectionmodel.h) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.h (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionmodel.h 2011-11-30 16:22:16 UTC (rev 4168) @@ -0,0 +1,81 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous 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. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#ifndef TOCONNECTIONMODEL_H +#define TOCONNECTIONMODEL_H + +#include <QAbstractTableModel> +#include "tonewconnection.h" + + +/*! \brief Display imported/available connections in +the Import dialog's view. +\author Petr Vanek <pe...@sc...> +*/ + +class toConnectionModel : public QAbstractTableModel +{ + Q_OBJECT + + public: + toConnectionModel(); + + //! \brief Pull connections from QSettings + void readConfig(); + //! \brief Set the m_data and update all connected views. + void setupData(QMap<int,toConnectionOptions> list); + void append(int ix, toConnectionOptions conn); + bool removeRow(int row, const QModelIndex & parent = QModelIndex()); + //! \brief Bring m_data back to caller. + QMap<int,toConnectionOptions> availableConnections() { return m_data; }; + toConnectionOptions availableConnection(int ix) { return m_data[ix]; }; + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; + int columnCount(const QModelIndex & parent = QModelIndex()) const { return 6; }; + int rowCount(const QModelIndex & parent = QModelIndex()) const { return m_data.count(); }; + Qt::ItemFlags flags(const QModelIndex & index) const; + + private: + QMap<int,toConnectionOptions> m_data; +}; + +#endif Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.cpp 2011-11-30 16:22:16 UTC (rev 4168) @@ -37,3 +37,8 @@ } return *m_registry.value(providerName); }; + +QList<QString> toConnectionProviderRegistry::providers() const +{ + return m_registry.keys(); +} \ No newline at end of file Modified: branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/core/toconnectionprovider.h 2011-11-30 16:22:16 UTC (rev 4168) @@ -134,6 +134,8 @@ void load(toConnectionProviderFinder::ConnectionProvirerParams const& provider); + QList<QString> providers() const; + protected: /** only singleton @ref toConnectionProviderRegistrySing can create a instance of this class */ friend class toConnectionProviderRegistrySing; Modified: branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/core/tomain.cpp 2011-11-30 16:22:16 UTC (rev 4168) @@ -55,6 +55,8 @@ #include "core/topreferences.h" #include "core/tosearchreplace.h" #include "core/toconnectionprovider.h" +#include "core/toconnection.h" +#include "core/tonewconnection.h" #include "connection/absfact.h" #include "icons/connect.xpm" @@ -194,32 +196,6 @@ BackgroundLabel->show(); BackgroundLabel->setToolTip(tr("No background queries.")); -#ifdef TORA3_CONNECTION - if (Connections.empty()) - { - try - { - toConnection *conn; - - do - { - toNewConnection newConnection(this); - - conn = NULL; - if (newConnection.exec()) - conn = newConnection.connection(); - else - break; - } - while (!conn); - - if (conn) - addConnection(conn); - } - TOCATCH; - } -#endif - std::vector<std::string> finders = ConnectionProvirerFinderFactory::Instance().keys(); ConnectionProvirerFinderFactory::Instance().dump(); QList<toConnectionProviderFinder::ConnectionProvirerParams> allProviders; @@ -257,6 +233,30 @@ TLOG(5, toDecorator, __HERE__) << "Loaded client: " << *i << std::endl; } + if (Connections.empty()) + { + try + { + toConnection *conn; + + do + { + toNewConnection newConnection(this); + + conn = NULL; + if (newConnection.exec()) + conn = newConnection.connection(); + else + break; + } + while (!conn); + + if (conn) + addConnection(conn); + } + TOCATCH; + } + } void toMain::createActions() @@ -736,7 +736,7 @@ if (!widget) return; -#ifdef TORA3_CONNECTION +#ifdef TORA3_TOOL toToolWidget *tool = dynamic_cast<toToolWidget *>(widget->widget()); if (tool) @@ -1198,23 +1198,22 @@ throw tr("Can't find active connection"); } -#ifdef TORA3_CONNECTION -toConnection *toMain::addConnection(toConnection *conn, bool def) +toConnection *toMain::addConnection(toConnection *newconn, bool def) { int j = 0; - for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++, j++) + foreach(toConnection* con, Connections) { - if ((*i)->description() == conn->description()) + if (con->description() == newconn->description()) { ConnectionSelection->setCurrentIndex(j); if (def) createDefault(); - return *i; + return con; } } - Connections.insert(Connections.end(), conn); - ConnectionSelection->addItem(Utils::connectionColorPixmap(conn->color()), conn->description()); + Connections.insert(Connections.end(), newconn); + ConnectionSelection->addItem(Utils::connectionColorPixmap(newconn->color()), newconn->description()); ConnectionSelection->setCurrentIndex(ConnectionSelection->count() - 1); if (ConnectionSelection->count() == 1) @@ -1223,14 +1222,13 @@ checkCaching(); changeConnection(); - emit addedConnection(conn->description()); + emit addedConnection(newconn->description()); if (def) createDefault(); - return conn; + return newconn; } -#endif void toMain::setNeedCommit(toConnection &conn, bool needCommit) { @@ -1325,9 +1323,9 @@ return true; } -std::list<QString> toMain::connections(void) +QList<QString> toMain::connections(void) { - std::list<QString> ret; + QList<QString> ret; #ifdef TORA3_CONNECTION for (std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++) Utils::toPush(ret, (*i)->description()); Modified: branches/tora-trotl/sandbox/tora3/src/core/tomain.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomain.h 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/core/tomain.h 2011-11-30 16:22:16 UTC (rev 4168) @@ -91,7 +91,7 @@ /** * The connections that have been opened in TOra. */ - std::list<toConnection *> Connections; + QList<toConnection *> Connections; /** * Workspace of main window - MDI area. */ @@ -357,7 +357,7 @@ * @return List of connection names. The returned list can then be used by * @ref connection to get the actual connection. */ - /*virtual*/ std::list<QString> connections(void); + virtual QList<QString> connections(void); /** Get a connection identified by a string. * @return A reference to a connection. * @exception QString If connection wasn't found. @@ -480,9 +480,7 @@ * Add a new connection. The connection itself must already be created. * Returns the connection or it's duplicate already opened connection. */ -#ifdef TORA3_CONNECTION - /*virtual*/toConnection *addConnection(toConnection *conn, bool def = true); -#endif + toConnection *addConnection(toConnection *conn, bool def = true); /** returns pointer onto widget that receives all the logging messages */ Modified: branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h 2011-11-30 13:24:04 UTC (rev 4167) +++ branches/tora-trotl/sandbox/tora3/src/core/tomainwindow.h 2011-11-30 16:22:16 UTC (rev 4168) @@ -126,7 +126,7 @@ * @return List of connection names. The returned list can then be used by * @ref connection to get the actual connection. */ - virtual std::list<QString> connections(void) = 0; + virtual QList<QString> connections(void) = 0; /** Get a connection identified by a string. * @return A reference to a connection. Copied: branches/tora-trotl/sandbox/tora3/src/core/tonewconnection.cpp (from rev 4166, branches/tora-trotl/sandbox/tora3/src/tonewconnection.cpp) =================================================================== --- branches/tora-trotl/sandbox/tora3/src/core/tonewconnection.cpp (rev 0) +++ branches/tora-trotl/sandbox/tora3/src/core/tonewconnection.cpp 2011-11-30 16:22:16 UTC (rev 4168) @@ -0,0 +1,672 @@ + +/* BEGIN_COMMON_COPYRIGHT_HEADER + * + * TOra - An Oracle Toolkit for DBA's and developers + * + * Shared/mixed copyright is held throughout files in this product + * + * Portions Copyright (C) 2000-2001 Underscore AB + * Portions Copyright (C) 2003-2005 Quest Software, Inc. + * Portions Copyright (C) 2004-2009 Numerous 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. + * + * You may link this product with any GPL'd Qt library. + * + * All trademarks belong to their respective owners. + * + * END_COMMON_COPYRIGHT_HEADER */ + +#include "core/tonewconnection.h" +#include "core/utils.h" +#include "core/toconf.h" +#include "core/toconfiguration.h" +#include "core/toconnectionprovider.h" +#include "core/toconnectionmodel.h" +#include "core/tomain.h" +#include "core/toconnectionimport.h" + +#include "tologger.h" + +//#include "totool.h" + +#include "icons/trash.xpm" + +#include <QMessageBox> +#include <QHeaderView> +#include <QStringList> +#include <QMenu> +#include <QIcon> +#include <QSortFilterProxyModel> + +// #define MAX_HISTORY 50 + +//const QString toNewConnection::ORACLE_INSTANT = "Oracle (Instant Client)"; +//const QString toNewConnection::ORACLE_TNS = "Oracle (TNS)"; + +static toConnectionModel *m_connectionModel = 0; +static QSortFilterProxyModel *m_proxyModel = 0; + + +toNewConnection::toNewConnection(QWidget* parent, Qt::WFlags fl) + : QDialog(parent, fl) +//tool , toHelpContext(QString::fromLatin1("newconnection.html")) +{ + setupUi(this); + + colorComboBox->addItem("None", ""); + ConnectionColorsIterator it(toConfigurationSingle::Instance().connectionColors()); + while (it.hasNext()) + { + it.next(); + colorComboBox->addItem(Utils::connectionColorPixmap(it.key()), it.value(), it.key()); + } + + //tool toHelp::connectDialog(this); + + Previous->setModel(proxyModel()); + proxyModel()->setFilterWildcard("*"); + + QList<QString> lst = toConnectionProviderRegistrySing::Instance().providers(); + foreach(QString s, lst) + { + //if (s == "Oracle") + //{ + // Provider->addItem(ORACLE_INSTANT); + // Provider->addItem(ORACLE_TNS); + //} + //else + Provider->addItem(s); + } + + if (Provider->count() < 1) + { + TOMessageBox::information( + this, + tr("No connection provider"), + tr("No available connection provider")); + + reject(); + return; + } + + NewConnection = 0; + + Previous->setContextMenuPolicy(Qt::CustomContextMenu); + + PreviousContext = new QMenu(this); + QAction *delact = PreviousContext->addAction( + QIcon(trash_xpm), + tr("&Delete")); + connect(delact, + SIGNAL(triggered()), + this, + SLOT(historyDelete())); + + connect(Previous, + SIGNAL(customContextMenuRequested(const QPoint &)), + this, + SLOT(previousMenu(const QPoint &))); + + Settings.beginGroup("connections"); + readSettings(); + + Previous->horizontalHeader()->setStretchLastSection(true); + Previous->horizontalHeader()->setHighlightSections(false); + Previous->verticalHeader()->setVisible(false); + + connect(Previous->selectionModel(), + SIGNAL(currentRowChanged(const QModelIndex &,const QModelIndex &)), + this, + SLOT(previousCellChanged(const QModelIndex &))); + + connect(Provider, + SIGNAL(currentIndexChanged(int)), + this, + SLOT(changeProvider(int))); + + connect(Previous, + SIGNAL(doubleClicked(const QModelIndex &)), + this, + SLOT(accept())); + + connect(Host, + SIGNAL(editTextChanged(QString)), + this, + SLOT(changeHost())); + + connect(ImportButton, SIGNAL(clicked()), + this, SLOT(importButton_clicked())); + + connect(searchEdit, SIGNAL(textEdited(const QString &)), + this, SLOT(searchEdit_textEdited(const QString &))); + + connect(testConnectionButton, SIGNAL(clicked()), + this, SLOT(testConnectionButton_clicked())); + + connect(saveConnectionButton, SIGNAL(clicked()), + this, SLOT(saveConnectionButton_clicked())); + + // must make sure this gets called manually. + changeProvider(Provider->currentIndex()); + Previous->setFocus(Qt::OtherFocusReason); +} + +QString toNewConnection::realProvider() +{ + QString p = Provider->currentText(); + if (p.startsWith("Oracle")) + return "Oracle"; + + return p; +} + +void toNewConnection::readSettings() +{ + restoreGeometry(Settings.value("geometry").toByteArray()); + + connectionModel()->readConfig(); + + Previous->setSortingEnabled(false); + + Previous->resizeColumnsToContents(); + Previous->setSortingEnabled(true); + + int sortList = Settings.value(CONF_PROVIDER_LIST_SORT_OFFSET,DEFAULT_PROVIDER_LIST_SORT_OFFSET).toInt(); + Previous->sortByColumn(abs(sortList), (sortList>=0 ? Qt::AscendingOrder : Qt::DescendingOrder)); + + Previous->hideColumn(0); +} + + +void toNewConnection::writeSettings(bool checkHistory) +{ + int r = 0; + Settings.setValue("geometry", saveGeometry()); + + Settings.setValue(CONF_PROVIDER_LIST_SORT_OFFSET, + (Previous->horizontalHeader()->sortIndicatorOrder() == Qt:: AscendingOrder? 1:-1)* + Previous->horizontalHeader()->sortIndicatorSection()); + + Settings.remove("history"); + + if (!Provider->currentText().isEmpty() && checkHistory) + { + Settings.beginGroup("history/0"); + Settings.setValue("provider", Provider->currentText()); + Settings.setValue("username", Username->text()); + if (toConfigurationSingle::Instance().savePassword()) + { + Settings.setValue("password", Utils::toObfuscate(Password->text())); + } + Settings.setValue("host", Host->currentText()); + Settings.setValue("port", Port->value()); + Settings.setValue("database", Database->currentText()); + Settings.setValue("schema", Schema->text()); + Settings.setValue("color", colorComboBox->itemData(colorComboBox->currentIndex())); + + Settings.beginGroup("options"); + QList<QCheckBox *> widgets = OptionGroup->findChildren<QCheckBox *>(); + Q_FOREACH(QCheckBox *box, widgets) + Settings.setValue(box->text(), box->isChecked()); + Settings.endGroup(); // options + Settings.endGroup(); // history/0 + ++r; + } + + // find history item with same options. will skip later. + int skip = -1; + if (checkHistory) + { + skip = findHistory(Provider->currentText(), + Username->text(), + Host->currentText(), + Database->currentText(), + Schema->text(), + Port->value() + ); + } + + QMap<int,toConnectionOptions> c = connectionModel()->availableConnections(); + foreach(int row, c.keys()) + { + if (row == skip)// && ++skipped) + continue; + + toConnectionOptions &opt = c[row]; + + Settings.beginGroup("history/" + QString::number(r/*row*/));// + 1 - skipped)); + Settings.setValue("provider", opt.provider); + Settings.setValue("username", opt.username); + Settings.setValue("host", opt.host); + Settings.setValue("database", opt.database); + Settings.setValue("schema", opt.schema); + Settings.setValue("color", opt.color); + Settings.setValue("port", opt.port); + if (toConfigurationSingle::Instance().savePassword()) + { + Settings.setValue("password", Utils::toObfuscate(opt.password)); + } + Settings.beginGroup("options"); + Q_FOREACH(QString s, opt.options) + Settings.setValue(s, true); + Settings.endGroup(); + + Settings.endGroup(); + ++r; + } + + connectionModel()->readConfig(); +} + + +int toNewConnection::findHistory(const QString &provider, + const QString &username, + const QString &host, + const QString &database, + const QString &schema,... [truncated message content] |