diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-11-21 14:27:11 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-11-21 14:27:11 +0000 |
commit | ff65b5883ab2ffb35400ec2419a1504c6da4b540 (patch) | |
tree | e532c4f47f7bebe8a6206419fffa653da37f3450 /dbaccess/source | |
parent | 0ac5f7e60dcb77a68c72a11d47a1cd67335da451 (diff) |
#105213# impl new feature of rown mysql driver page
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/dlg/adminpages.cxx | 47 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adminpages.hxx | 19 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.cxx | 17 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.hrc | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.src | 143 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 168 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.hxx | 43 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dsitems.hxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dsselect.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 177 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.hxx | 13 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/dbumiscres.src | 36 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/dsntypes.cxx | 35 |
13 files changed, 582 insertions, 147 deletions
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index dde4898cb42a..8b086a4d635a 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -2,9 +2,9 @@ * * $RCSfile: adminpages.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: oj $ $Date: 2002-08-19 07:43:44 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:22:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -103,6 +103,16 @@ #ifndef _OSL_FILE_HXX_ #include <osl/file.hxx> #endif +#ifndef _DBAUI_DSSELECT_HXX_ +#include "dsselect.hxx" +#endif +#ifndef _DBAUI_ODBC_CONFIG_HXX_ +#include "odbcconfig.hxx" +#endif +#ifndef _SVTOOLS_LOCALRESACCESS_HXX_ +#include <svtools/localresaccess.hxx> +#endif + //......................................................................... namespace dbaui @@ -116,6 +126,8 @@ namespace dbaui using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::dbtools; + using namespace ::svt; + //========================================================================= //= OPageSettings @@ -297,6 +309,34 @@ namespace dbaui callModifiedHdl(); return 0L; } + // ----------------------------------------------------------------------- + sal_Bool OGenericAdministrationPage::getSelectedDataSource(DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn) + { + // collect all ODBC data source names + StringBag aOdbcDatasources; + OOdbcEnumeration aEnumeration; + if (!aEnumeration.isLoaded()) + { + // show an error message + ModuleRes aModuleRes(PAGE_GENERAL); + OLocalResourceAccess aLocRes(aModuleRes, RSC_TABPAGE); + String sError(ResId(STR_COULDNOTLOAD_ODBCLIB)); + sError.SearchAndReplaceAscii("#lib#", aEnumeration.getLibraryName()); + ErrorBox aDialog(this, WB_OK, sError); + aDialog.Execute(); + return sal_False; + } + else + { + aEnumeration.getDatasourceNames(aOdbcDatasources); + // excute the select dialog + ODatasourceSelectDialog aSelector(GetParent(), aOdbcDatasources, _eType); + if ( RET_OK == aSelector.Execute() ) + _sReturn = aSelector.GetSelected(); + } + return sal_True; + } + //......................................................................... } // namespace dbaui @@ -305,6 +345,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.32 2002/08/19 07:43:44 oj + * #99473# change string resource files + * * Revision 1.31 2001/08/15 08:49:16 fs * #89822# added functionality to accelerate toolbox functions with key codes * diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index c7e574bd019c..4655d75ebadd 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -2,9 +2,9 @@ * * $RCSfile: adminpages.hxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: fs $ $Date: 2001-08-15 08:49:16 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:22:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -171,6 +171,18 @@ namespace dbaui */ virtual void restoreViewSettings(const OPageSettings* _pSettings); + /** opens a dialog filled with all data sources available for this type and + returns the selected on. + @param _eType + The type for which the data source dialog should be opened. + @param _sReturn + <OUT/> contains the selected name. + @return + <FALSE/> if an error occured, otherwise <TRUE/> + */ + sal_Bool getSelectedDataSource(DATASOURCE_TYPE _eType,::rtl::OUString& _sReturn); + + protected: /// default implementation: call FillItemSet, call checkItems, virtual int DeactivatePage(SfxItemSet* pSet); @@ -249,6 +261,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.23 2001/08/15 08:49:16 fs + * #89822# added functionality to accelerate toolbox functions with key codes + * * Revision 1.22 2001/05/29 10:17:26 fs * #86082# +OToolboxedPageViewSettings * diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 39eeda294183..3864e25b3774 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dbadmin.cxx,v $ * - * $Revision: 1.82 $ + * $Revision: 1.83 $ * - * last change: $Author: oj $ $Date: 2002-11-15 12:29:30 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -459,6 +459,8 @@ IMPL_LINK( ODbAdminDialog, OnAsyncSelectDetailsPage, void*, NOTINTERESTEDIN ) case DST_ODBC : nDetailPageId = PAGE_ODBC; break; case DST_ADABAS : nDetailPageId = PAGE_ADABAS; break; case DST_ADDRESSBOOK: nDetailPageId = PAGE_LDAP; /* juest a guess */ break; + case DST_MYSQL_ODBC : + case DST_MYSQL_JDBC : nDetailPageId = PAGE_MYSQL; break; } if (nDetailPageId) { @@ -728,6 +730,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxBoolItem(DSID_AUTORETRIEVEENABLED, sal_False); + // create the pool static SfxItemInfo __READONLY_DATA aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = { @@ -958,6 +961,11 @@ IMPL_LINK(ODbAdminDialog, OnTypeSelected, OGeneralPage*, _pTabPage) addDetailPage(PAGE_ODBC, STR_PAGETITLE_ODBC, OOdbcDetailsPage::Create); break; + case DST_MYSQL_ODBC: + case DST_MYSQL_JDBC: + addDetailPage(PAGE_MYSQL, STR_PAGETITLE_MYSQL, OMySQLDetailsPage::Create); + break; + case DST_ADABAS: // for adabas we have more than one page // CAUTION: the order of inserting pages matters. @@ -1523,6 +1531,8 @@ const sal_Int32* ODbAdminDialog::getRelevantItems(const SfxItemSet& _rSet) const pRelevantItems = pAdabasItems; } break; + case DST_MYSQL_ODBC: + case DST_MYSQL_JDBC: pRelevantItems = OMySQLDetailsPage::getDetailIds(); break; case DST_JDBC: pRelevantItems = OJdbcDetailsPage::getDetailIds(); break; case DST_ADO: pRelevantItems = OAdoDetailsPage::getDetailIds(); break; case DST_ODBC: pRelevantItems = OOdbcDetailsPage::getDetailIds(); break; @@ -2151,6 +2161,9 @@ IMPL_LINK(ODbAdminDialog, OnApplyChanges, PushButton*, EMPTYARG) /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.82 2002/11/15 12:29:30 oj + * #105175# check size of poolitems + * * Revision 1.81 2002/08/19 07:40:36 oj * #99473# change string resource files * diff --git a/dbaccess/source/ui/dlg/dbadmin.hrc b/dbaccess/source/ui/dlg/dbadmin.hrc index ddb8981ceb1a..cab49656a199 100644 --- a/dbaccess/source/ui/dlg/dbadmin.hrc +++ b/dbaccess/source/ui/dlg/dbadmin.hrc @@ -2,9 +2,9 @@ * * $RCSfile: dbadmin.hrc,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: oj $ $Date: 2002-11-15 12:28:32 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -146,6 +146,9 @@ #define NF_PORTNUMBER 1 #define NF_LDAPROWCOUNT 2 +#define RB_USEMYODBC 1 +#define RB_USECONNECTORJ3 2 + //======================================================================== // string ids (usually relative to other resources, that's why not necessarily unique) @@ -174,6 +177,10 @@ #define STR_UNSUPPORTED_DATASOURCE_TYPE 22 #define STR_PAGETITLE_USERADMIN 23 #define STR_TEXT_FIELD_SEP_NONE 24 +#define STR_PAGETITLE_MYSQL 25 +#define STR_MYSQL_CONFIG_NEXT_PAGE 26 +#define STR_JDBC_DEFAULT_URL 27 + //======================================================================== // menu item ids @@ -186,6 +193,9 @@ /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.23 2002/11/15 12:28:32 oj + * #105175# insert none for empty string + * * Revision 1.22 2002/07/25 06:59:03 oj * #95146# new defines for auto fields * diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src index f48de31b1414..4738ec67f083 100644 --- a/dbaccess/source/ui/dlg/dbadmin.src +++ b/dbaccess/source/ui/dlg/dbadmin.src @@ -2,9 +2,9 @@ * * $RCSfile: dbadmin.src,v $ * - * $Revision: 1.113 $ + * $Revision: 1.114 $ * - * last change: $Author: oj $ $Date: 2002-11-15 12:28:31 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,7 @@ #define RELATED_CONTROLS 4 #define UNRELATED_CONTROLS 7 #define EDIT_HEIGHT 12 +#define BUTTON_HEIGHT 14 #define IL_TABLESUBCRIPTION \ \ @@ -682,6 +683,12 @@ TabDialog DLG_DATABASE_ADMINISTRATION Text[ catalan ] = "Estadstiques de l'Adabas D"; Text[ thai ] = "สถิติ Adabas D "; }; + + String STR_PAGETITLE_MYSQL + { + Text = "MySQL" ; + }; + String STR_PAGETITLE_USERADMIN { Text = "Benutzereinstellungen" ; @@ -1271,6 +1278,10 @@ TabPage PAGE_GENERAL Text[ catalan ] = "Aquest tipus de font de dades no se soporta en aquesta plataforma.\nTot i que podeu canviar els parmetres s molt probable que no pugueu connectar-vos a la base de dades."; Text[ thai ] = "ไม่สนับสนุนชนิดแหล่งข้อมูลนี้บนแพลตฟอร์มนี้\nอนุญาตให้คุณเปลี่ยนแปลงการตั้งค่า แต่คุณไม่อาจจะสามารถเชื่อมต่อกับฐานข้อมูลได้"; }; + String STR_MYSQL_CONFIG_NEXT_PAGE + { + Text = "Die Einstellungen fr MySQL knnen auf der nchsten Seite vorgenommen werden."; + }; }; //......................................................................... @@ -1998,7 +2009,7 @@ TabPage PAGE_ODBC HelpId = HID_DSADMIN_CHARSET_ODBC; }; - FixedLine FL_SEPARATOR1 + FixedLine FL_SEPARATOR2 { Pos = MAP_APPFONT ( 4 , 68 ) ; Size = MAP_APPFONT ( 252 , 8 ) ; @@ -2090,6 +2101,129 @@ TabPage PAGE_ODBC }; }; //......................................................................... +#define MYSQL_YDIST 53 +#define MYSQL_FL_Y 8 +#define MYSQL_DRIVERCLASS_Y 8 + +TabPage PAGE_MYSQL +{ + SVLook = TRUE ; + Pos = MAP_APPFONT ( 0 , 0 ) ; + Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; + Hide = TRUE; + HelpId = HID_DSADMIN_PAGE_MYSQL; + + FixedLine FL_SEPARATOR1 + { + Pos = MAP_APPFONT ( 4 , 4 ) ; + Size = MAP_APPFONT ( 252 , FIXEDTEXT_HEIGHT ) ; + Text = "Art der Verbindung"; + }; + + RadioButton RB_USEMYODBC + { + Pos = MAP_APPFONT ( 6 , 4 + FIXEDTEXT_HEIGHT + RELATED_CONTROLS ) ; + Size = MAP_APPFONT ( 150 , CHECKBOX_HEIGHT ) ; + Text = "Existierende My~ODBC Datenquelle verwenden" ; + }; + + RadioButton RB_USECONNECTORJ3 + { + Pos = MAP_APPFONT ( 6 , 4 + FIXEDTEXT_HEIGHT + CHECKBOX_HEIGHT + 2*RELATED_CONTROLS ) ; + Size = MAP_APPFONT ( 150 , CHECKBOX_HEIGHT ) ; + Text = "Connector/~J3 verwenden" ; + }; + + FixedText FT_JDBCDRIVERCLASS + { + Pos = MAP_APPFONT ( 15 , 4 + FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + 3*RELATED_CONTROLS) ; + Size = MAP_APPFONT ( 80 , FIXEDTEXT_HEIGHT ) ; + Text = "MySQL JDBC ~Treiberklasse" ; + }; + Edit ET_JDBCDRIVERCLASS + { + Pos = MAP_APPFONT ( 101 , 4 + FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + 3*RELATED_CONTROLS ) ; + Size = MAP_APPFONT ( 134 , EDIT_HEIGHT ) ; + TabStop = TRUE ; + Border = TRUE ; + }; + + FixedLine FL_SEPARATOR2 + { + Pos = MAP_APPFONT ( 4 , 4 + FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + UNRELATED_CONTROLS + 3*RELATED_CONTROLS + EDIT_HEIGHT) ; + Size = MAP_APPFONT ( 252 , FIXEDTEXT_HEIGHT ) ; + Text = "Allgemein"; + }; + + FixedText FT_CONNECTURL + { + HelpId = HID_DSADMIN_URL_GENERAL; + Pos = MAP_APPFONT ( 6 , 4 + 2*FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + UNRELATED_CONTROLS + 4*RELATED_CONTROLS + EDIT_HEIGHT ) ; + Size = MAP_APPFONT ( 80 , 10 ) ; + Text = "D~atenquellen-URL" ; + }; + Edit ET_CONNECTURL + { + Pos = MAP_APPFONT ( 101 , 4 + 2*FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + UNRELATED_CONTROLS + 4*RELATED_CONTROLS + EDIT_HEIGHT -1) ; + Size = MAP_APPFONT ( 134 , 12 ) ; + TabStop = TRUE ; + Border = TRUE ; + }; + + PushButton PB_BROWSECONNECTION + { + TabStop = TRUE ; + Pos = MAP_APPFONT ( 241 , 4 + 2*FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + UNRELATED_CONTROLS + 4*RELATED_CONTROLS + EDIT_HEIGHT -2 ) ; + Size = MAP_APPFONT ( 12 , 14 ) ; + HelpId = HID_DSADMIN_BROWSECONN; + Text = "~..." ; + }; + + FixedText FT_USERNAME + { + Pos = MAP_APPFONT ( 6 , 4 + 2*FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + 2*UNRELATED_CONTROLS + 4*RELATED_CONTROLS + EDIT_HEIGHT + BUTTON_HEIGHT ) ; + Size = MAP_APPFONT ( 80 , FIXEDTEXT_HEIGHT ) ; + Text = "~Benutzername" ; + }; + Edit ET_USERNAME + { + Border = TRUE ; + Pos = MAP_APPFONT ( 101 , 4 + 2*FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + 2*UNRELATED_CONTROLS + 4*RELATED_CONTROLS + EDIT_HEIGHT -1 + BUTTON_HEIGHT) ; + Size = MAP_APPFONT ( 134 , EDIT_HEIGHT ) ; + TabStop = TRUE ; + HelpId = HID_DSADMIN_USER_ODBC; + }; + CheckBox CB_PASSWORD_REQUIRED + { + Pos = MAP_APPFONT ( 101 , 4 + 2*FIXEDTEXT_HEIGHT + 2*CHECKBOX_HEIGHT + 2*UNRELATED_CONTROLS + 4*RELATED_CONTROLS + 2*EDIT_HEIGHT + BUTTON_HEIGHT) ; + Size = MAP_APPFONT ( 134 , CHECKBOX_HEIGHT ) ; + Text = "Kennwort ~erforderlich"; + }; + FixedText FT_CHARSET + { + Pos = MAP_APPFONT ( 6 , 4 + 2*FIXEDTEXT_HEIGHT + 3*CHECKBOX_HEIGHT + 3*UNRELATED_CONTROLS + 4*RELATED_CONTROLS + 2*EDIT_HEIGHT + BUTTON_HEIGHT ) ; + Size = MAP_APPFONT ( 80 , 10 ) ; + Text = "~Zeichensatz" ; + }; + ListBox LB_CHARSET + { + Border = TRUE ; + Pos = MAP_APPFONT ( 101 , 4 + 2*FIXEDTEXT_HEIGHT + 3*CHECKBOX_HEIGHT + 3*UNRELATED_CONTROLS + 4*RELATED_CONTROLS + 2*EDIT_HEIGHT + BUTTON_HEIGHT ) ; + Size = MAP_APPFONT ( 134 , 60 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + CurPos = 0 ; + HelpId = HID_DSADMIN_CHARSET_ODBC; + }; + + String STR_JDBC_DEFAULT_URL + { + Text = "<Rechnername>:<3306>/<DBNAME>" ; + }; + +}; + +//......................................................................... TabPage PAGE_LDAP { SVLook = TRUE ; @@ -3964,6 +4098,9 @@ String STR_HINT_CONNECTION_NOT_CAPABLE /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.113 2002/11/15 12:28:31 oj + * #105175# insert none for empty string + * * Revision 1.112 2002/11/04 18:07:16 rt * Merge SRX644: 04.11.02 - 19:03:18 * diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 8c4fdd6c38e1..fa25388278cf 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -2,9 +2,9 @@ * * $RCSfile: detailpages.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: oj $ $Date: 2002-11-15 12:28:32 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -822,7 +822,7 @@ namespace dbaui //======================================================================== OOdbcDetailsPage::OOdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) :OCommonBehaviourTabPage(pParent, PAGE_ODBC, _rCoreAttrs, CBTP_USE_UIDPWD | CBTP_USE_CHARSET | CBTP_USE_OPTIONS | CBTP_USE_SQL92CHECK| CBTP_USE_AUTOINCREMENT) - ,m_aSeparator1 (this, ResId(FL_SEPARATOR1)) + ,m_aSeparator1 (this, ResId(FL_SEPARATOR2)) ,m_aUseCatalog (this, ResId(CB_USECATALOG)) { m_aUseCatalog.SetToggleHdl(getControlModifiedLink()); @@ -882,6 +882,165 @@ namespace dbaui if (bReadonly) m_aUseCatalog.Disable(); } + //======================================================================== + //= OMySQLDetailsPage + //======================================================================== + OMySQLDetailsPage::OMySQLDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ) + :OCommonBehaviourTabPage(pParent, PAGE_MYSQL, _rCoreAttrs, CBTP_USE_UIDPWD | CBTP_USE_CHARSET ) + ,m_aSeparator1 (this, ResId(FL_SEPARATOR1)) + ,m_aUseODBC (this, ResId(RB_USEMYODBC)) + ,m_aUseJDBC (this, ResId(RB_USECONNECTORJ3)) + ,m_aFTDriverClass (this, ResId(FT_JDBCDRIVERCLASS)) + ,m_aEDDriverClass (this, ResId(ET_JDBCDRIVERCLASS)) + ,m_aSeparator2 (this, ResId(FL_SEPARATOR2)) + ,m_aUrlLabel (this, ResId(FT_CONNECTURL)) + ,m_aUrl (this, ResId(ET_CONNECTURL)) + ,m_aBrowseConnection (this, ResId(PB_BROWSECONNECTION)) + ,m_sJDBCDefaultUrl (ResId(STR_JDBC_DEFAULT_URL)) + { + m_aUseODBC.SetToggleHdl(LINK(this, OMySQLDetailsPage,OnToggle)); + + m_aUrl.SetModifyHdl(getControlModifiedLink()); + m_aEDDriverClass.SetModifyHdl(getControlModifiedLink()); + m_aBrowseConnection.SetClickHdl(LINK(this, OMySQLDetailsPage, OnBrowseConnections)); + + Window* pWindows[] = { &m_aUseODBC, &m_aUseJDBC, + &m_aFTDriverClass, &m_aEDDriverClass, + &m_aUrlLabel,&m_aUrl, + &m_aBrowseConnection, + m_pUserNameLabel, m_pUserName, + m_pPasswordRequired, + m_pCharsetLabel, m_pCharset }; + + sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]); + for (sal_Int32 i=1; i < nCount; ++i) + pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND); + + FreeResource(); + } + + // ----------------------------------------------------------------------- + SfxTabPage* OMySQLDetailsPage::Create( Window* pParent, const SfxItemSet& _rAttrSet ) + { + return ( new OMySQLDetailsPage( pParent, _rAttrSet ) ); + } + + // ----------------------------------------------------------------------- + sal_Int32* OMySQLDetailsPage::getDetailIds() + { + static sal_Int32* pRelevantIds = NULL; + if (!pRelevantIds) + { + static sal_Int32 nRelevantIds[] = + { + DSID_CHARSET, + DSID_JDBCDRIVERCLASS, + DSID_CONNECTURL, + 0 + }; + pRelevantIds = nRelevantIds; + } + return pRelevantIds; + } + // ----------------------------------------------------------------------- + sal_Bool OMySQLDetailsPage::FillItemSet( SfxItemSet& _rSet ) + { + sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet); + FILL_STRING_ITEM(m_aEDDriverClass, _rSet, DSID_JDBCDRIVERCLASS, bChangedSomething); + + if ( m_aUrl.GetText() != m_aUrl.GetSavedValue() ) + { + _rSet.Put(SfxStringItem(DSID_CONNECTURL, m_aUrl.GetText())); + bChangedSomething = sal_True; + } + return bChangedSomething; + } + // ----------------------------------------------------------------------- + void OMySQLDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) + { + OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); + + // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) + sal_Bool bValid, bReadonly; + getFlags(_rSet, bValid, bReadonly); + + SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, sal_True); + SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); + + sal_Bool bODBC = pUrlItem->GetValue().EqualsIgnoreCaseAscii("sdbc:mysql:odbc:",0,16); + m_aUseODBC.Check(bODBC); + m_aUseJDBC.Check(!bODBC); + + m_aBrowseConnection.Enable( bODBC ); + m_aFTDriverClass.Enable( !bODBC ); + m_aEDDriverClass.Enable( !bODBC ); + + + String sURL; + if ( bValid ) + { + sURL = pUrlItem->GetValue(); + m_aEDDriverClass.SetText(pDrvItem->GetValue()); + } + m_aUrl.SetText(sURL); + m_aUrl.ClearModifyFlag(); + + if ( !m_aEDDriverClass.GetText().Len() ) + m_aEDDriverClass.SetText(String::CreateFromAscii("com.mysql.jdbc.Driver")); + m_aEDDriverClass.ClearModifyFlag(); + + if ( !bODBC && !sURL.Len() ) + m_aUrl.SetTextNoPrefix(m_sJDBCDefaultUrl); + + if ( _bSaveValue ) + { + m_aUseODBC.SaveValue(); + m_aUseJDBC.SaveValue(); + m_aUrl.SaveValue(); + m_aUrl.SaveValueNoPrefix(); + } + + if ( bReadonly ) + { + m_aUseODBC.Disable(); + m_aUseJDBC.Disable(); + m_aUrlLabel.Disable(); + m_aUrl.Disable(); + } + } + //------------------------------------------------------------------------ + IMPL_LINK( OMySQLDetailsPage, OnToggle, RadioButton*, pRadioButton ) + { + sal_Bool bODBC = &m_aUseODBC == pRadioButton && pRadioButton->IsChecked(); + m_aBrowseConnection.Enable( bODBC ); + m_aFTDriverClass.Enable( !bODBC ); + m_aEDDriverClass.Enable( !bODBC ); + + if ( bODBC ) + m_aUrl.SetText(String::CreateFromAscii("sdbc:mysql:odbc:")); + else + { + String sUrl = String::CreateFromAscii("sdbc:mysql:jdbc:"); + sUrl += m_sJDBCDefaultUrl; + m_aUrl.SetText(sUrl); + } + callModifiedHdl(); + + return 0; + } + //------------------------------------------------------------------------- + IMPL_LINK(OMySQLDetailsPage, OnBrowseConnections, PushButton*, _pButton) + { + // collect all ODBC data source names + ::rtl::OUString sDataSource; + if ( getSelectedDataSource(DST_MYSQL_ODBC,sDataSource) && sDataSource.getLength() ) + { + m_aUrl.SetTextNoPrefix(sDataSource); + callModifiedHdl(); + } + else + return 1L; + } //======================================================================== //= OAdabasDetailsPage @@ -1362,6 +1521,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.20 2002/11/15 12:28:32 oj + * #105175# insert none for empty string + * * Revision 1.19 2002/10/15 09:52:21 oj * #98982# disable thousand seperator * diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index bee6c4b6f33c..f0950666f71b 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -2,9 +2,9 @@ * * $RCSfile: detailpages.hxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: oj $ $Date: 2002-11-15 12:28:32 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,6 +68,10 @@ #ifndef _SV_FIELD_HXX #include <vcl/field.hxx> #endif +#ifndef _SV_BUTTON_HXX +#include <vcl/imagebtn.hxx> +#endif + //......................................................................... namespace dbaui @@ -236,6 +240,38 @@ namespace dbaui }; //======================================================================== + //= OMySQLDetailsPage + //======================================================================== + class OMySQLDetailsPage : public OCommonBehaviourTabPage + { + public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet ); + virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + + /// get the SfxPoolItem ids used by this tab page + static sal_Int32* getDetailIds(); + + private: + FixedLine m_aSeparator1; + RadioButton m_aUseODBC; + RadioButton m_aUseJDBC; + FixedText m_aFTDriverClass; + Edit m_aEDDriverClass; + FixedLine m_aSeparator2; + FixedText m_aUrlLabel; + OConnectionURLEdit m_aUrl; + PushButton m_aBrowseConnection; + String m_sJDBCDefaultUrl; + + OMySQLDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); + + virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); + + DECL_LINK( OnToggle, RadioButton * ); + DECL_LINK(OnBrowseConnections, PushButton*); + }; + + //======================================================================== //= OAdabasDetailsPage //======================================================================== class OAdabasDetailsPage : public OCommonBehaviourTabPage @@ -332,6 +368,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.13 2002/11/15 12:28:32 oj + * #105175# insert none for empty string + * * Revision 1.12 2002/07/26 09:33:29 oj * #95146# new controls inserted for auto retrieving * diff --git a/dbaccess/source/ui/dlg/dsitems.hxx b/dbaccess/source/ui/dlg/dsitems.hxx index b87a1e574529..30337688c578 100644 --- a/dbaccess/source/ui/dlg/dsitems.hxx +++ b/dbaccess/source/ui/dlg/dsitems.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dsitems.hxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: oj $ $Date: 2002-07-25 07:00:13 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -105,6 +105,7 @@ #define DSID_AUTORETRIEVEVALUE 38 #define DSID_AUTORETRIEVEENABLED 39 + //======================================================================== //= item range. Adjust this if you introduce new items above @@ -116,6 +117,9 @@ /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.12 2002/07/25 07:00:13 oj + * #95146# new defines for auto fields + * * Revision 1.11 2002/07/09 12:39:11 oj * #99921# check if datasource allows to check names * diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index d16150e1766c..abdcc92495bd 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dsselect.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oj $ $Date: 2002-08-19 07:40:34 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,7 +142,7 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringB fillListBox(_rDatasources); // allow ODBC datasource managenment - if (DST_ODBC == _eType) + if ( DST_ODBC == _eType || DST_MYSQL_ODBC == _eType ) { m_aManageDatasources.Show(); m_aManageDatasources.Enable(); @@ -216,6 +216,9 @@ void ODatasourceSelectDialog::fillListBox(const StringBag& _rDatasources) /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.4 2002/08/19 07:40:34 oj + * #99473# change string resource files + * * Revision 1.3 2001/10/18 06:50:39 oj * #93260# reload odbc datasources * diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 127afeb65266..702ef3f56dae 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: generalpage.cxx,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: oj $ $Date: 2002-08-19 07:40:33 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -224,20 +224,6 @@ namespace dbaui DBG_ASSERT(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !"); - // initially fill the listbox - if (m_pCollection) - { - for ( ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin(); - aTypeLoop != m_pCollection->end(); - ++aTypeLoop - ) - { - DATASOURCE_TYPE eType = aTypeLoop.getType(); - sal_Int32 nPos = m_aDatasourceType.InsertEntry(aTypeLoop.getDisplayName()); - m_aDatasourceType.SetEntryData((sal_uInt16)nPos, reinterpret_cast<void*>(eType)); - } - } - // do some knittings m_aDatasourceType.SetSelectHdl(LINK(this, OGeneralPage, OnDatasourceTypeSelected)); m_aName.SetModifyHdl(LINK(this, OGeneralPage, OnNameModified)); @@ -389,7 +375,7 @@ namespace dbaui ShowServiceNotAvailableError(GetParent(), String(SERVICE_SDBC_DRIVERMANAGER), sal_True); } - if (m_pCollection) + if ( m_pCollection ) { for ( ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin(); aTypeLoop != m_pCollection->end(); @@ -398,7 +384,7 @@ namespace dbaui { DATASOURCE_TYPE eType = aTypeLoop.getType(); - if (xDriverManager.is()) + if ( xDriverManager.is() ) { // we have a driver manager to check ::rtl::OUString sURLPrefix = m_pCollection->getDatasourcePrefix(eType); if (!xDriverManager->getDriverByURL(sURLPrefix).is()) @@ -407,8 +393,12 @@ namespace dbaui continue; } - sal_Int32 nPos = m_aDatasourceType.InsertEntry(aTypeLoop.getDisplayName()); - m_aDatasourceType.SetEntryData((sal_uInt16)nPos, reinterpret_cast<void*>(eType)); + String sDisplayName = aTypeLoop.getDisplayName(); + if ( m_aDatasourceType.GetEntryPos( sDisplayName ) == LISTBOX_ENTRY_NOTFOUND ) + { + sal_Int32 nPos = m_aDatasourceType.InsertEntry(sDisplayName); + m_aDatasourceType.SetEntryData((sal_uInt16)nPos, reinterpret_cast<void*>(eType)); + } } } } @@ -448,6 +438,13 @@ namespace dbaui case DST_CALC: case DST_ADDRESSBOOK: return sal_True; +// case DST_MYSQL: +// { +// const SfxItemSet& rItemSet = GetItemSet(); +// SFX_ITEMSET_GET(rItemSet, pURL, SfxStringItem, DSID_CONNECTURL, sal_True); +// return pURL->GetValue().EqualsIgnoreCaseAscii("sdbc:mysql:odbc:",0,16); +// } + } return sal_False; } @@ -482,35 +479,48 @@ namespace dbaui } //------------------------------------------------------------------------- - void OGeneralPage::previousMessage() + void OGeneralPage::switchMessage(sal_Bool _bDeleted,const DATASOURCE_TYPE _eType) { - SPECIAL_MESSAGE eSwitchPrevious = m_eLastMessage; - switchMessage(smNone); - } - - //------------------------------------------------------------------------- - void OGeneralPage::switchMessage(const SPECIAL_MESSAGE _eType) - { - if (_eType == m_eLastMessage) - return; - - sal_uInt16 nResId = 0; - switch (_eType) + SPECIAL_MESSAGE eMessage = smNone; + if ( _eType == m_eNotSupportedKnownType ) + { + eMessage = smUnsupportedType; + } + else if ( _bDeleted ) { - case smInvalidName: nResId = STR_NAMEINVALID; break; - case smDatasourceDeleted: nResId = STR_DATASOURCEDELETED; break; - case smUnsupportedType: nResId = STR_UNSUPPORTED_DATASOURCE_TYPE; break; + eMessage = smDatasourceDeleted; } - String sMessage; - if (nResId) + else if ( m_aName.IsEnabled() && ( 0L == m_aNameValidator.Call( this ) ) ) { - ModuleRes aModuleRes(PAGE_GENERAL); - OLocalResourceAccess aStringResAccess(aModuleRes, RSC_TABPAGE); - sMessage = String(ResId(nResId)); + eMessage = smInvalidName; } - m_aSpecialMessage.SetText(sMessage); + else if ( (_eType == DST_MYSQL_ODBC) || (_eType == DST_MYSQL_JDBC) ) + { + eMessage = smMySQL; + } + - m_eLastMessage = _eType; + if ( eMessage != m_eLastMessage ) + { + sal_uInt16 nResId = 0; + switch (eMessage) + { + case smInvalidName: nResId = STR_NAMEINVALID; break; + case smDatasourceDeleted: nResId = STR_DATASOURCEDELETED; break; + case smUnsupportedType: nResId = STR_UNSUPPORTED_DATASOURCE_TYPE; break; + case smMySQL: nResId = STR_MYSQL_CONFIG_NEXT_PAGE; break; + } + String sMessage; + if ( nResId ) + { + ModuleRes aModuleRes(PAGE_GENERAL); + OLocalResourceAccess aStringResAccess(aModuleRes, RSC_TABPAGE); + sMessage = String(ResId(nResId)); + } + m_aSpecialMessage.SetText(sMessage); + + m_eLastMessage = eMessage; + } } //------------------------------------------------------------------------- @@ -522,12 +532,11 @@ namespace dbaui // the the new URL text as indicated by the selection history implSetCurrentType( _eType ); - if (_eType == m_eNotSupportedKnownType) - switchMessage(smUnsupportedType); - else - switchMessage(smNone); + m_aConnection.Enable( (_eType != DST_MYSQL_ODBC) && (_eType != DST_MYSQL_JDBC) ); + + switchMessage(sal_False,_eType); - if (m_aTypeSelectHandler.IsSet()) + if ( m_aTypeSelectHandler.IsSet() ) m_aTypeSelectHandler.Call(this); } @@ -570,7 +579,7 @@ namespace dbaui m_aBrowseConnection.Enable(bValid); String sConnectURL, sName; - SPECIAL_MESSAGE eSpecialMessage = smNone; + sal_Bool bDeleted = sal_False; m_bDisplayingInvalid = !bValid; if (bValid) { @@ -585,10 +594,7 @@ namespace dbaui else { SFX_ITEMSET_GET(_rSet, pDeleted, SfxBoolItem, DSID_DELETEDDATASOURCE, sal_True); - if (pDeleted && pDeleted->GetValue()) - { - eSpecialMessage = smDatasourceDeleted; - } + bDeleted = pDeleted && pDeleted->GetValue(); } DATASOURCE_TYPE eOldSelection = m_eCurrentSelection; @@ -613,7 +619,7 @@ namespace dbaui if (sDisplayName.Len()) { // this indicates it's really a type which is known in general, but not supported on the current platform // show a message saying so - eSpecialMessage = smUnsupportedType; + // eSpecialMessage = smUnsupportedType; // insert a (temporary) entry sal_uInt16 nPos = m_aDatasourceType.InsertEntry(sDisplayName); @@ -631,16 +637,22 @@ namespace dbaui setURL(sConnectURL); // notify our listener that our type selection has changed (if so) - if (eOldSelection != m_eCurrentSelection) + sal_Bool bTypeChanged = eOldSelection != m_eCurrentSelection; + if ( m_pCollection && bTypeChanged ) + bTypeChanged = !m_pCollection->areTypesRelated(eOldSelection,m_eCurrentSelection); + + if ( bTypeChanged ) onTypeSelected(m_eCurrentSelection); // are we allowed to change the data source type? sal_Bool bSingleTypeEdit = ODbAdminDialog::omSingleEditFixedType == m_pAdminDialog->getMode(); // is the current data source type "AddressBook"? - sal_Bool bEditingAddressBook = (DST_ADDRESSBOOK == m_eCurrentSelection); + sal_Bool bBrowseNotAllowed = ( DST_ADDRESSBOOK == m_eCurrentSelection + || DST_MYSQL_ODBC == m_eCurrentSelection + || DST_MYSQL_JDBC == m_eCurrentSelection); // don't allow sub-type changes in case of the address book in single-edit mode - if ( bSingleTypeEdit && bEditingAddressBook ) + if ( bSingleTypeEdit && bBrowseNotAllowed ) m_aBrowseConnection.Disable( ); if (_bSaveValue) @@ -654,12 +666,15 @@ namespace dbaui if (_bSaveValue) m_aName.SaveValue(); - // is the very current name valid? - if ( m_aName.IsEnabled() && ( 0L == m_aNameValidator.Call( this ) ) ) - eSpecialMessage = smInvalidName; +// // is the very current name valid? +// if ( m_aName.IsEnabled() && ( 0L == m_aNameValidator.Call( this ) ) ) +// eSpecialMessage = smInvalidName; +// +// if ( eSpecialMessage == smNone && (DST_MYSQL_ODBC == m_eCurrentSelection || DST_MYSQL_JDBC == m_eCurrentSelection) ) +// eSpecialMessage = smMySQL; // a special message for the current page state - switchMessage(eSpecialMessage); + switchMessage(bDeleted,m_eCurrentSelection); } //------------------------------------------------------------------------- @@ -760,14 +775,8 @@ namespace dbaui if (m_aNameModifiedHandler.IsSet()) bNewNameValid = (0L != m_aNameModifiedHandler.Call(this)); - if (m_aName.IsEnabled()) - { // (this way we prevent overwriting a "this datasource is deleted" message) - // show a text if the name is invalid - if (bNewNameValid) - previousMessage(); - else - switchMessage(smInvalidName); - } + if ( m_aName.IsEnabled() ) + switchMessage(sal_False, m_eCurrentSelection); return 0L; } @@ -1222,33 +1231,18 @@ namespace dbaui } } break; + case DST_MYSQL_ODBC: case DST_ODBC: { // collect all ODBC data source names - StringBag aOdbcDatasources; - OOdbcEnumeration aEnumeration; - if (!aEnumeration.isLoaded()) + ::rtl::OUString sDataSource; + if ( getSelectedDataSource(GetSelectedType(),sDataSource) && sDataSource.getLength() ) { - // show an error message - ModuleRes aModuleRes(PAGE_GENERAL); - OLocalResourceAccess aLocRes(aModuleRes, RSC_TABPAGE); - String sError(ResId(STR_COULDNOTLOAD_ODBCLIB)); - sError.SearchAndReplaceAscii("#lib#", aEnumeration.getLibraryName()); - ErrorBox aDialog(this, WB_OK, sError); - aDialog.Execute(); - return 1L; + setURLNoPrefix(sDataSource); + callModifiedHdl(); } else - { - aEnumeration.getDatasourceNames(aOdbcDatasources); - // excute the select dialog - ODatasourceSelectDialog aSelector(GetParent(), aOdbcDatasources, GetSelectedType()); - if (RET_OK == aSelector.Execute()) - { - setURLNoPrefix(aSelector.GetSelected()); - callModifiedHdl(); - } - } + return 1L; } break; case DST_ADDRESSBOOK: @@ -1417,6 +1411,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.28 2002/08/19 07:40:33 oj + * #99473# change string resource files + * * Revision 1.27 2001/10/26 16:14:39 hr * #92924#: gcc-3.0.1 needs lvalue * diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 9709c45e0e18..6a9224f658a9 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -2,9 +2,9 @@ * * $RCSfile: generalpage.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: fs $ $Date: 2001-08-30 16:12:30 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:23:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,7 +110,8 @@ namespace dbaui smNone, smInvalidName, smDatasourceDeleted, - smUnsupportedType + smUnsupportedType, + smMySQL }; SPECIAL_MESSAGE m_eLastMessage; @@ -176,8 +177,7 @@ namespace dbaui void implSetCurrentType( const DATASOURCE_TYPE _eType ); - void switchMessage(const SPECIAL_MESSAGE _eType); - void previousMessage(); + void switchMessage(sal_Bool _bDeleted,const DATASOURCE_TYPE _eType); sal_Int32 checkPathExistence(const String& _rURL); sal_Bool commitURL(); @@ -215,6 +215,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.7 2001/08/30 16:12:30 fs + * #88427# check for a valid name in implInitControls + * * Revision 1.6 2001/08/07 15:56:26 fs * #88431# centralized methods for setting/retrieving the URL in m_aConnection - this way we can translate URLs so that they're displayed in a decoded version * diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src index 0efc297b0834..67b77b48c6eb 100644 --- a/dbaccess/source/ui/misc/dbumiscres.src +++ b/dbaccess/source/ui/misc/dbumiscres.src @@ -2,9 +2,9 @@ * * $RCSfile: dbumiscres.src,v $ * - * $Revision: 1.48 $ + * $Revision: 1.49 $ * - * last change: $Author: kz $ $Date: 2002-09-05 10:53:01 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:27:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,34 +71,13 @@ Resource RSC_DATASOURCE_TYPES { String STR_CONNTYPES { - Text = "sdbc:adabas:;jdbc:;sdbc:odbc:;sdbc:dbase:;sdbc:ado:;sdbc:flat:;sdbc:calc:;sdbc:address:" ; + Text = "sdbc:mysql:odbc:;sdbc:mysql:jdbc:;sdbc:adabas:;jdbc:;sdbc:odbc:;sdbc:dbase:;sdbc:ado:;sdbc:flat:;sdbc:calc:;sdbc:address:" ; }; String STR_CONNUINAMES { - Text = "Adabas;JDBC;ODBC;dBase;ADO;Text;Tabellendokument;Adressbuch" ; - Text [ english ] = "Adabas;JDBC;ODBC;dBase;ADO;Text;Spreadsheet;Addressbook" ; - Text [ english_us ] = "Adabas;JDBC;ODBC;dBase;ADO;Text;Spreadsheet;Address book" ; - Text[ portuguese ] = "Adabas;JDBC;ODBC;dBase;ADO;Texto;FolhaClculo;LivroEndereos"; - Text[ russian ] = "Adabas;JDBC;ODBC;dBase;ADO;; ; "; - Text[ greek ] = "Adabas;JDBC;ODBC;dBase;ADO;; ; "; - Text[ dutch ] = "Adabas;JDBC;ODBC;dBase;ADO;Tekst;Werkbladdocument;Adresboek"; - Text[ french ] = "Adabas;JDBC;ODBC;dBase;ADO;Texte;Classeur;CarnetAdresses"; - Text[ spanish ] = "Adabas;JDBC;ODBC;dBase;ADO;Texto;Hoja de clculo;Libreta de direcciones"; - Text[ italian ] = "Adabas;JDBC;ODBC;dBase;ADO;Testo;Foglio elettronico;Rubrica"; - Text[ danish ] = "Adabas;JDBC;ODBC;dBase;ADO;Tekst;Regneark;Adressekartotek"; - Text[ swedish ] = "Adabas;JDBC;ODBC;dBase;ADO;Text;Tabelldokument;Adressbok"; - Text[ polish ] = "Adabas;JDBC;ODBC;dBase;ADO;Tekst;Arkusz kalkulacyjny;Ksika adresowa"; - Text[ portuguese_brazilian ] = "Adabas;JDBC;ODBC;dBase;Text"; - Text[ japanese ] = "Adabas;JDBC;ODBC;dBase;ADO;文書;表計算ドキュメント;アドレス帳"; - Text[ korean ] = "Adabas;JDBC;ODBC;dBase;ADO;텍스트;스프레드시트 문서;주소록"; - Text[ chinese_simplified ] = "Adabas;JDBC;ODBC;dBase;ADO;文字;工作表文档;通讯簿"; - Text[ chinese_traditional ] = "Adabas;JDBC;ODBC;dBase;ADO;文字;工作表文件;通訊錄"; - Text[ turkish ] = "Adabas;JDBC;ODBC;dBase;Text"; - Text[ arabic ] = "Adabas;JDBC;ODBC;dBase;ADO;; "; - Text[ language_user1 ] = "Please be carefull with the number/ordering of (semicolon-separated) tokens in the string."; - Text[ finnish ] = "Adabas;JDBC;ODBC;dBase;ADO;Teksti;Laskentataulukko;Osoitteisto"; - Text[ catalan ] = "Adabas;JDBC;ODBC;dBase;ADO;Text;Spreadsheet"; - Text[ thai ] = "Adabas;JDBC;ODBC;ดีเบส;ADO;ข้อความ;กระดาษคำนวณ;สมุดที่อยู่"; + Text = "MySQL;MySQL;Adabas;JDBC;ODBC;dBase;ADO;Text;Tabellendokument;Adressbuch" ; + Text [ english ] = "MySQL;MySQL;Adabas;JDBC;ODBC;dBase;ADO;Text;Spreadsheet;Addressbook" ; + Text [ english_us ] = "MySQL;MySQL;Adabas;JDBC;ODBC;dBase;ADO;Text;Spreadsheet;Addressbook" ; }; }; @@ -640,6 +619,9 @@ String STR_REDO_COLON /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.48 2002/09/05 10:53:01 kz + * Merge SRX643: 05.09.02 - 12:49:41 + * * Revision 1.47 2002/08/19 07:51:10 oj * #99473# change string resource files * diff --git a/dbaccess/source/ui/misc/dsntypes.cxx b/dbaccess/source/ui/misc/dsntypes.cxx index 5b2c5a98a61c..26768a6f5e66 100644 --- a/dbaccess/source/ui/misc/dsntypes.cxx +++ b/dbaccess/source/ui/misc/dsntypes.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dsntypes.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: oj $ $Date: 2002-08-19 07:51:11 $ + * last change: $Author: oj $ $Date: 2002-11-21 15:24:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -102,6 +102,10 @@ ODsnTypeCollection::ODsnTypeCollection() m_aDsnPrefixes.push_back(sCurrentType); m_aDsnTypes.push_back(implDetermineType(sCurrentType)); } + + // insert related types here + m_aRelatedTypes.insert(TRelatedTypes::value_type(DST_MYSQL_ODBC,DST_MYSQL_JDBC)); + FreeResource(); } @@ -177,6 +181,8 @@ sal_Bool ODsnTypeCollection::hasAuthentication(DATASOURCE_TYPE _eType) { case DST_ADABAS: case DST_JDBC: + case DST_MYSQL_ODBC: + case DST_MYSQL_JDBC: case DST_ODBC: case DST_ADO: case DST_ADDRESSBOOK: @@ -235,12 +241,31 @@ DATASOURCE_TYPE ODsnTypeCollection::implDetermineType(const String& _rDsn) return DST_UNKNOWN; } + if (_rDsn.EqualsIgnoreCaseAscii("sdbc:mysql:odbc", 0, nSeparator)) + return DST_MYSQL_ODBC; + if (_rDsn.EqualsIgnoreCaseAscii("sdbc:mysql:jdbc", 0, nSeparator)) + return DST_MYSQL_JDBC; DBG_ERROR("ODsnTypeCollection::implDetermineType : unrecognized data source type !"); return DST_UNKNOWN; } - +// ----------------------------------------------------------------------------- +sal_Bool ODsnTypeCollection::areTypesRelated(DATASOURCE_TYPE _eType1,DATASOURCE_TYPE _eType2) +{ + OSL_ENSURE(_eType1 != _eType2,"Type are identical!"); + sal_Bool bRelated = sal_False; + TRelatedTypes::iterator aFind = m_aRelatedTypes.find(_eType1); + if ( aFind != m_aRelatedTypes.end() ) + bRelated = aFind->second == _eType2; + if ( !bRelated ) + { + aFind = m_aRelatedTypes.find(_eType2); + if ( aFind != m_aRelatedTypes.end() ) + bRelated = aFind->second == _eType1; + } + return bRelated; +} //------------------------------------------------------------------------- sal_Int32 ODsnTypeCollection::implDetermineTypeIndex(DATASOURCE_TYPE _eType) { @@ -252,7 +277,6 @@ sal_Int32 ODsnTypeCollection::implDetermineTypeIndex(DATASOURCE_TYPE _eType) // the type of the datasource described by the DSN string if (DST_UNKNOWN == _eType) { - DBG_ERROR("ODsnTypeCollection::implDetermineTypeIndex : invalid argument !"); return -1; } @@ -435,6 +459,9 @@ ADDRESSBOOK_TYPE AddressBookTypes::getAddressType( const String& _rAddressURL ) /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.14 2002/08/19 07:51:11 oj + * #99473# change string resource files + * * Revision 1.13 2001/08/16 13:00:02 hr * #65293#: syntax * |