diff options
author | Oliver Specht <os@openoffice.org> | 2000-11-20 11:23:38 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-11-20 11:23:38 +0000 |
commit | e3df8bccc696556d15bd145510d452228648d07d (patch) | |
tree | c59e57a4fd84a62d4dac555bbe774288a7cf3970 /extensions | |
parent | e3b88a0886a551fbb82991daa72358ccc56b7b74 (diff) |
data source dialog revived - dialogs can be called via toolbox button
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/bibliography/bibconfig.cxx | 249 | ||||
-rw-r--r-- | extensions/source/bibliography/bibconfig.hxx | 20 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 113 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.hxx | 6 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.cxx | 22 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.hrc | 7 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.hxx | 10 | ||||
-rw-r--r-- | extensions/source/bibliography/toolbar.src | 61 |
8 files changed, 166 insertions, 322 deletions
diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx index b7475ed14914..6a1587312bdd 100644 --- a/extensions/source/bibliography/bibconfig.cxx +++ b/extensions/source/bibliography/bibconfig.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bibconfig.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-11-15 11:03:41 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -372,243 +372,26 @@ void BibConfig::SetMapping(const BibDBDescriptor& rDesc, const Mapping* pSetMapp Mapping* pNew = new Mapping(*pSetMapping); pMappingsArr->Insert(pNew, pMappingsArr->Count()); SetModified(); - -/* SfxAppIniManagerProperty aProp; - GetpApp()->Property( aProp ); - SfxIniManager* pIniMan = aProp.GetIniManager(); - if(pIniMan) - { - //kill all old entries an rewrite all mappings - String sTempEntry; - sal_uInt16 nIdx = USHRT_MAX; - do - { - String sDBKey(C2S(BIBLIOGRAPHY_INI_DB_ENTRY)); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sDBKey += nIdx; - sMapKey += nIdx; - } - sTempEntry = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), - sDBKey ); - pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey); - pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey); - nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; - }while(sTempEntry.Len()); - - nIdx = USHRT_MAX; - for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) - { - const Mapping* pMapping = pMappingsArr->GetObject(i); - - String sDataTableEntry(pMapping->sURL); - sDataTableEntry = pIniMan->UsePathVars( sDataTableEntry ); - sDataTableEntry += ';'; - sDataTableEntry += pMapping->sTableName; - - String sDBKey = C2S(BIBLIOGRAPHY_INI_DB_ENTRY); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sDBKey += nIdx; - sMapKey += nIdx; - } - pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey, sDataTableEntry ); - - String sEntry; - for(sal_uInt16 nColumn = 0; nColumn < COLUMN_COUNT; nColumn++) - { - if(!pMapping->aColumnPairs[nColumn].sLogicalColumnName.Len() || - !pMapping->aColumnPairs[nColumn].sRealColumnName.Len()) - break; - sEntry += pMapping->aColumnPairs[nColumn].sLogicalColumnName; - sEntry += PAIR_TOKEN; - sEntry += pMapping->aColumnPairs[nColumn].sRealColumnName; - sEntry += MAP_TOKEN; - } - pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey, sEntry ); - - nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; - } - pIniMan->Flush(); - }*/ } -/* +/* -----------------------------20.11.00 11:56-------------------------------- - SfxAppIniManagerProperty aProp; - GetpApp()->Property( aProp ); - - SfxIniManager* pIniMan = aProp.GetIniManager(); - if(pIniMan) - { - String sBibMapping; - sal_uInt16 nIdx = USHRT_MAX; - String sEntry; - do - { - String sKey(C2S(BIBLIOGRAPHY_INI_DB_ENTRY)); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sKey += nIdx; - sMapKey += nIdx; - } - - sEntry = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), - sKey ); - String sURL = sEntry.GetToken(0, ';'); - sURL = pIniMan->SubstPathVars( sURL ); - - sURL = URIHelper::SmartRelToAbs(sURL); - - - String sTableName = sEntry.GetToken(1, ';'); - - sBibMapping = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), - sMapKey ); - if(sTableName.Len()) - { - Mapping* pNew = new Mapping; - pNew->sTableName = sTableName; - pNew->sURL = sURL; - sal_uInt16 nMapTokens = sBibMapping.GetTokenCount(MAP_TOKEN); - for(sal_uInt16 i = 0; i < nMapTokens && i < COLUMN_COUNT; i++) - { - String sPair = sBibMapping.GetToken(i, MAP_TOKEN); - pNew->aColumnPairs[i].sLogicalColumnName = sPair.GetToken(0, PAIR_TOKEN); - pNew->aColumnPairs[i].sRealColumnName = sPair.GetToken(1, PAIR_TOKEN); - } - pMappingsArr->Insert(pNew, pMappingsArr->Count()); - } - nIdx = USHRT_MAX == nIdx ? 0 : nIdx + 1; - } - while(sEntry.Len()); - } - - -// -----------------12.11.99 14:26------------------- - -// -------------------------------------------------- -const Mapping* BibDataManager::GetMapping(const rtl::OUString& rTableName, const rtl::OUString& sDataSourceURL) const + ---------------------------------------------------------------------------*/ +DBChangeDialogConfig_Impl::DBChangeDialogConfig_Impl() : + ConfigItem(C2U("Office.DataAccess/DataSources")) { - String sTable(rTableName); - String sURL(sDataSourceURL); - for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) - { - sal_Bool bCaseSensitive = sal_True; - INetURLObject aTempURL(sURL); - if(INET_PROT_FILE == aTempURL.GetProtocol()) - { - sal_Bool bCaseSensitive = lcl_IsCaseSensitive(aTempURL.GetMainURL()); -// DirEntry aEnt(aTempURL.GetPath()); -// bCaseSensitive = aEnt.IsCaseSensitive(); - } - - const Mapping* pMapping = pMappingsArr->GetObject(i); - sal_Bool bURLEqual = bCaseSensitive ? - sURL.Equals(pMapping->sURL) : - sURL.EqualsIgnoreCaseAscii(pMapping->sURL); - - if(sTable == pMapping->sTableName && bURLEqual) - return pMapping; - } - return 0; + aSourceNames = GetNodeNames(OUString()); } -// -----------------12.11.99 14:26------------------- +/* -----------------------------20.11.00 11:57-------------------------------- -//-------------------------------------------------- -void BibDataManager::SetMapping(const rtl::OUString& rTableName, const Mapping* pSetMapping) + ---------------------------------------------------------------------------*/ +DBChangeDialogConfig_Impl::~DBChangeDialogConfig_Impl() { - ResetIdentifierMapping(); - String sTable(rTableName); - const String sURL(aDataSourceURL); - for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) - { - const Mapping* pMapping = pMappingsArr->GetObject(i); - - sal_Bool bCaseSensitive = sal_True; - INetURLObject aTempURL(sURL); - if(INET_PROT_FILE == aTempURL.GetProtocol()) - { - sal_Bool bCaseSensitive = lcl_IsCaseSensitive(aTempURL.GetMainURL()); -// DirEntry aEnt(aTempURL.GetPath()); -// bCaseSensitive = aEnt.IsCaseSensitive(); - } - - sal_Bool bURLEqual = bCaseSensitive ? - sURL.Equals(pMapping->sURL) : - sURL.EqualsIgnoreCaseAscii(pMapping->sURL); - - if(sTable == pMapping->sTableName && bURLEqual) - { - pMappingsArr->DeleteAndDestroy(i, 1); - break; - } - } - Mapping* pNew = new Mapping(*pSetMapping); - pMappingsArr->Insert(pNew, pMappingsArr->Count()); - - SfxAppIniManagerProperty aProp; - GetpApp()->Property( aProp ); - SfxIniManager* pIniMan = aProp.GetIniManager(); - if(pIniMan) - { - //kill all old entries an rewrite all mappings - String sTempEntry; - sal_uInt16 nIdx = USHRT_MAX; - do - { - String sDBKey(C2S(BIBLIOGRAPHY_INI_DB_ENTRY)); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sDBKey += nIdx; - sMapKey += nIdx; - } - sTempEntry = pIniMan->ReadKey( C2S(BIBLIOGRAPHY_INI_GROUP), - sDBKey ); - pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey); - pIniMan->DeleteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey); - nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; - }while(sTempEntry.Len()); - - nIdx = USHRT_MAX; - for(sal_uInt16 i = 0; i < pMappingsArr->Count(); i++) - { - const Mapping* pMapping = pMappingsArr->GetObject(i); - - String sDataTableEntry(pMapping->sURL); - sDataTableEntry = pIniMan->UsePathVars( sDataTableEntry ); - sDataTableEntry += ';'; - sDataTableEntry += pMapping->sTableName; - - String sDBKey = C2S(BIBLIOGRAPHY_INI_DB_ENTRY); - String sMapKey = C2S(BIBLIOGRAPHY_INI_MAPPING); - if(USHRT_MAX != nIdx) - { - sDBKey += nIdx; - sMapKey += nIdx; - } - pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sDBKey, sDataTableEntry ); - - String sEntry; - for(sal_uInt16 nColumn = 0; nColumn < COLUMN_COUNT; nColumn++) - { - if(!pMapping->aColumnPairs[nColumn].sLogicalColumnName.Len() || - !pMapping->aColumnPairs[nColumn].sRealColumnName.Len()) - break; - sEntry += pMapping->aColumnPairs[nColumn].sLogicalColumnName; - sEntry += PAIR_TOKEN; - sEntry += pMapping->aColumnPairs[nColumn].sRealColumnName; - sEntry += MAP_TOKEN; - } - pIniMan->WriteKey( C2S(BIBLIOGRAPHY_INI_GROUP), sMapKey, sEntry ); +} +/* -----------------------------20.11.00 11:57-------------------------------- - nIdx = USHRT_MAX == nIdx ? 0 : nIdx +1; - } - pIniMan->Flush(); - } + ---------------------------------------------------------------------------*/ +void DBChangeDialogConfig_Impl::Commit() +{ + // read only } -*/ diff --git a/extensions/source/bibliography/bibconfig.hxx b/extensions/source/bibliography/bibconfig.hxx index 4b43f3c9a28a..f60a0933557b 100644 --- a/extensions/source/bibliography/bibconfig.hxx +++ b/extensions/source/bibliography/bibconfig.hxx @@ -2,9 +2,9 @@ * * $RCSfile: bibconfig.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-11-15 11:03:41 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -151,4 +151,20 @@ public: const rtl::OUString& GetDefColumnName(sal_uInt16 nIndex) const {return aColumnDefaults[nIndex];} }; +/* -----------------------------20.11.00 11:47-------------------------------- + + ---------------------------------------------------------------------------*/ +class DBChangeDialogConfig_Impl : public utl::ConfigItem +{ + com::sun::star::uno::Sequence<rtl::OUString> aSourceNames; +public: + DBChangeDialogConfig_Impl(); + ~DBChangeDialogConfig_Impl(); + + virtual void Commit(); + + const com::sun::star::uno::Sequence<rtl::OUString>& GetDataSourceNames() const + {return aSourceNames;} + +}; #endif diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 9731fb9d31d0..ad9fedee22f4 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -2,9 +2,9 @@ * * $RCSfile: datman.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: os $ $Date: 2000-11-15 15:54:56 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -241,37 +241,6 @@ using namespace ::ucb; #define PAIR_TOKEN ':' -/* -----------------------------15.06.00 16:12-------------------------------- - - ---------------------------------------------------------------------------*/ -BOOL lcl_IsCaseSensitive(const String& rPathURL) -{ - BOOL bCaseSensitive = FALSE; -#ifdef DBG_UTIL - static BOOL bFirstCall = TRUE; - if(bFirstCall) - { - DBG_ERROR("No case checking due to #76253#") - bFirstCall = FALSE; - } -#endif -/* Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory(); - INetURLObject aTempObj(rPathURL); - try - { - aTempObj.SetBase(aTempObj.GetBase().ToLowerAscii()); - Reference<XContentIdentifier> xRef1 = new ::ucb::ContentIdentifier( xMSF, aTempObj.GetMainURL()); - aTempObj.SetBase(aTempObj.GetBase().ToUpperAscii()); - Reference<XContentIdentifier> xRef2 = new ::ucb::ContentIdentifier( xMSF, aTempObj.GetMainURL()); - - ContentBroker& rBroker = *ContentBroker::get(); - Reference<XContentProvider > xProv = rBroker.getContentProviderInterface(); - sal_Int32 nCompare = xProv->compareContentIds( xRef1, xRef2 ); - bCaseSensitive = nCompare != 0; - } - catch(Exception& rEx){} -*/ return bCaseSensitive; -} /* -----------------17.01.00 14:38------------------- --------------------------------------------------*/ @@ -721,12 +690,13 @@ class DBChangeDialog_Impl : public ModalDialog SvTabListBox aSelectionLB; HeaderBar aSelectionHB; + DBChangeDialogConfig_Impl aConfig; String aEntryST; String aURLST; BibDataManager* pDatMan; - DECL_LINK(EndDragHdl, HeaderBar*); +// DECL_LINK(EndDragHdl, HeaderBar*); DECL_LINK(DoubleClickHdl, SvTabListBox*); public: DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ); @@ -751,28 +721,21 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) pDatMan(pMan) { FreeResource(); - aSelectionHB.SetEndDragHdl( LINK(this, DBChangeDialog_Impl, EndDragHdl)); +// aSelectionHB.SetEndDragHdl( LINK(this, DBChangeDialog_Impl, EndDragHdl)); aSelectionLB.SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl)); try { Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); -// Reference< data::XDatabaseFavorites > xFav(xMgr->createInstance( C2U("com.sun.star.data.DatabaseEngine") ), UNO_QUERY ); -// // TODO : XDatabaseFavorites is an obsolete interface, the whole dialog has to be based on -// // the sdb::DatabaseAccessContext service - -// Sequence< beans::PropertyValue > aFavs = xFav->getFavorites(); -// const beans::PropertyValue* pValues = aFavs.getConstArray(); - Size aSize = aSelectionHB.GetSizePixel(); - long nTabs[3]; - nTabs[0] = 2;// Number of Tabs - nTabs[1] = 0; - nTabs[2] = aSize.Width() / 4; + long nTabs[2]; + nTabs[0] = 1;// Number of Tabs +// nTabs[1] = 0; + nTabs[1] = aSize.Width() / 4; aSelectionHB.SetStyle(aSelectionHB.GetStyle()|WB_STDHEADERBAR); - aSelectionHB.InsertItem( 1, aEntryST, nTabs[2]); - aSelectionHB.InsertItem( 2, aURLST, aSize.Width() - nTabs[2]); + aSelectionHB.InsertItem( 1, aEntryST, aSize.Width()); +// aSelectionHB.InsertItem( 2, aURLST, aSize.Width() - nTabs[2]); aSelectionHB.SetSizePixel(aSelectionHB.CalcWindowSizePixel()); aSelectionHB.Show(); @@ -782,26 +745,18 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) //aSelectionLB.SetSelectHdl(LINK(this, SwGlossaryGroupDlg, SelectHdl)); aSelectionLB.GetModel()->SetSortMode(SortAscending); -// String sActiveURL = pDatMan->getActiveDataSource(); -// sActiveURL = URIHelper::SmartRelToAbs(sActiveURL); -// for(int i = 0; i < aFavs.getLength(); i++) -// { -// String sTemp(pValues[i].Name); -// sTemp += '\t'; -// String sSource = *(OUString*)pValues[i].Value.getValue(); -// sTemp += sSource; -// SvLBoxEntry* pEntry = aSelectionLB.InsertEntry(sTemp); -// String sTempPath = INetURLObject(sSource).PathToFileName(); -// sal_Bool bCaseSensitive = lcl_IsCaseSensitive(sSource); -// sal_Bool bCaseSensitive = DirEntry(sTempPath).IsCaseSensitive(); -// if((bCaseSensitive && sActiveURL == sSource)|| -// !bCaseSensitive && COMPARE_EQUAL == sActiveURL.CompareTo(sSource)) -// { -// aSelectionLB.Select(pEntry); -// } -// } -// aSelectionLB.GetModel()->Resort(); - + OUString sActiveSource = pDatMan->getActiveDataSource(); + const Sequence<OUString>& rSources = aConfig.GetDataSourceNames(); + const OUString* pSourceNames = rSources.getConstArray(); + for(int i = 0; i < rSources.getLength(); i++) + { + SvLBoxEntry* pEntry = aSelectionLB.InsertEntry(pSourceNames[i]); + if(pSourceNames[i] == sActiveSource) + { + aSelectionLB.Select(pEntry); + } + } + aSelectionLB.GetModel()->Resort(); } #ifdef DBG_UTIL catch(Exception& e ) @@ -825,7 +780,7 @@ IMPL_LINK(DBChangeDialog_Impl, DoubleClickHdl, SvTabListBox*, pLB) /* -----------------18.11.99 11:17------------------- --------------------------------------------------*/ -IMPL_LINK(DBChangeDialog_Impl, EndDragHdl, HeaderBar*, pHB) +/*IMPL_LINK(DBChangeDialog_Impl, EndDragHdl, HeaderBar*, pHB) { long nTabs[3]; nTabs[0] = 2;// Number of Tabs @@ -833,7 +788,7 @@ IMPL_LINK(DBChangeDialog_Impl, EndDragHdl, HeaderBar*, pHB) nTabs[2] = pHB->GetItemSize( 1 ); aSelectionLB.SetTabs( &nTabs[0], MAP_PIXEL ); return 0; -}; +};*/ /*-- 18.11.99 10:35:20--------------------------------------------------- @@ -850,7 +805,7 @@ String DBChangeDialog_Impl::GetCurrentURL()const SvLBoxEntry* pEntry = aSelectionLB.FirstSelected(); if(pEntry) { - sRet = aSelectionLB.GetEntryText(pEntry, 1); + sRet = aSelectionLB.GetEntryText(pEntry, 0); } return sRet; } @@ -1313,12 +1268,15 @@ void BibDataManager::setActiveDataSource(const rtl::OUString& rURL) { Reference< XComponent > xOldConnection; aPropertySet->getPropertyValue(C2U("ActiveConnection")) >>= xOldConnection; - if(xOldConnection.is()) - xOldConnection->dispose(); Reference< sdbc::XConnection > xConnection = getConnection(rURL); Any aVal; aVal <<= xConnection; aPropertySet->setPropertyValue(C2U("ActiveConnection"), aVal); + Reference< sdb::XSQLQueryComposerFactory > xFactory(xConnection, UNO_QUERY); + xParser = xFactory->createQueryComposer(); + + if(xOldConnection.is()) + xOldConnection->dispose(); Sequence<rtl::OUString> aTableNameSeq; Reference< sdbcx::XTablesSupplier > xSupplyTables(xConnection, UNO_QUERY); @@ -2037,4 +1995,13 @@ const OUString& BibDataManager::GetIdentifierMapping() } return sIdentifierMapping; } +/* -----------------------------20.11.00 10:31-------------------------------- + + ---------------------------------------------------------------------------*/ +void BibDataManager::SetToolbar(BibToolBar* pSet) +{ + pToolbar = pSet; + if(pToolbar) + pToolbar->SetDatMan(*this); +} diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx index c3b4de5added..b6ce32d3c7a3 100644 --- a/extensions/source/bibliography/datman.hxx +++ b/extensions/source/bibliography/datman.hxx @@ -2,9 +2,9 @@ * * $RCSfile: datman.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-11-13 11:41:26 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -188,7 +188,7 @@ public: void SetView(BibView* pView) {pBibView = pView;} - void SetToolbar(BibToolBar* pSet) {pToolbar = pSet;} + void SetToolbar(BibToolBar* pSet); void SetGridWin(BibGridwin* pSet) {pGridWin = pSet;} const rtl::OUString& GetIdentifierMapping(); diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 293fbbe258b3..d764335fa2f2 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -2,9 +2,9 @@ * * $RCSfile: toolbar.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-11-14 11:06:35 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,7 +76,9 @@ #ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_ #include <com/sun/star/frame/FrameSearchFlag.hpp> #endif - +#ifndef _BIB_DATMAN_HXX +#include <datman.hxx> +#endif #ifndef _TOOLS_DEBUG_HXX //autogen wg. DBG_ASSERT #include <tools/debug.hxx> @@ -409,6 +411,20 @@ void BibToolBar::Click() { aMenuTimer.Start(); } + else if(nId == TBC_BT_COL_ASSIGN ) + { + if(pDatMan) + pDatMan->CreateMappingDialog(GetParent()); + } + else if(nId == TBC_BT_CHANGESOURCE) + { + if(pDatMan) + { + OUString sNew = pDatMan->CreateDBChangeDialog(GetParent()); + if(sNew.getLength()) + pDatMan->setActiveDataSource(sNew); + } + } } void BibToolBar::ClearFilterMenu() diff --git a/extensions/source/bibliography/toolbar.hrc b/extensions/source/bibliography/toolbar.hrc index 95596b4ed7fd..c8f82d82eb27 100644 --- a/extensions/source/bibliography/toolbar.hrc +++ b/extensions/source/bibliography/toolbar.hrc @@ -2,9 +2,9 @@ * * $RCSfile: toolbar.hrc,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:45 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,4 +74,5 @@ #define TBC_BT_UPDATE 12 #define TBC_BT_MAIL 13 #define TBC_BT_URL 14 - +#define TBC_BT_COL_ASSIGN 15 +#define TBC_BT_CHANGESOURCE 16 diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index 6b6ecda68931..06fe9492d758 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -2,9 +2,9 @@ * * $RCSfile: toolbar.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-11-14 15:10:26 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,7 +98,7 @@ #include <cppuhelper/implbase1.hxx> // helper for implementations #endif - +class BibDataManager; class BibToolBar; class BibToolBarListener: public cppu::WeakImplHelper1 < ::com::sun::star::frame::XStatusListener> @@ -191,6 +191,8 @@ class BibToolBar: public ToolBox sal_uInt16 nMenuId; sal_uInt16 nSelMenuItem; rtl::OUString aQueryField; + + BibDataManager* pDatMan; DECL_LINK( SelHdl, ListBox* ); DECL_LINK( SendSelHdl, Timer* ); DECL_LINK( MenuHdl, Timer* ); @@ -226,6 +228,8 @@ class BibToolBar: public ToolBox void statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); + + void SetDatMan(BibDataManager& rDatMan) {pDatMan = &rDatMan;} }; diff --git a/extensions/source/bibliography/toolbar.src b/extensions/source/bibliography/toolbar.src index 3b7fa7a8b975..492c0e371cb4 100644 --- a/extensions/source/bibliography/toolbar.src +++ b/extensions/source/bibliography/toolbar.src @@ -2,9 +2,9 @@ * * $RCSfile: toolbar.src,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:45 $ + * last change: $Author: os $ $Date: 2000-11-20 12:23:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -235,6 +235,63 @@ ToolBox RID_BIB_TOOLBAR Text[ turkish ] = "Filtreyi kaldr"; Text[ language_user1 ] = " "; }; + ToolBoxItem + { + Identifier = TBC_BT_COL_ASSIGN ; + HelpId = HID_BIB_MAPPINGDLG; + Text = "Spaltenzuordnung" ; + Text[ English ] = "Column assignment" ; +// Command = ".uno:Bib/Mapping" ; +// ItemBitmap = Bitmap { File = "sc10711.bmp" ; }; + Text[ english_us ] = "Column Arrangement"; + Text[ portuguese ] = "Dispor colunas"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Kolomindeling"; + Text[ french ] = "Assignation de colonnes"; + Text[ spanish ] = "Asignacin de columnas"; + Text[ italian ] = "Assegnazione colonne"; + Text[ danish ] = "Kolonnetildeling"; + Text[ swedish ] = "Kolumntilldelning"; + Text[ polish ] = "Przyporzdkowanie kolumn"; + Text[ portuguese_brazilian ] = "Column assignment"; + Text[ japanese ] = "̕(C)"; + Text[ korean ] = " (C)"; + Text[ chinese_simplified ] = "(C)"; + Text[ chinese_traditional ] = "s(C)"; + Text[ arabic ] = " "; + Text[ turkish ] = "Stun dzeni"; + Text[ language_user1 ] = " "; + }; + ToolBoxItem + { + Identifier = TBC_BT_CHANGESOURCE ; + HelpId = HID_BIB_CHANGESOURCE; + Text = "Datenquelle" ; + Text[ English ] = "Data source" ; +// Command = ".uno:Bib/sdbsource" ; +// ItemBitmap = Bitmap { File = "sc10711.bmp" ; }; + Checkable=TRUE; + Text[ english_us ] = "Data Source"; + Text[ portuguese ] = "Fonte de dados"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Gegevensbron"; + Text[ french ] = "Source de donnes"; + Text[ spanish ] = "Fuente de datos"; + Text[ italian ] = "Sorgente dati"; + Text[ danish ] = "Datakilde"; + Text[ swedish ] = "Dataklla"; + Text[ polish ] = "rdo danych"; + Text[ portuguese_brazilian ] = "Data source"; + Text[ japanese ] = "ް(D)"; + Text[ korean ] = " ҽ(D)"; + Text[ chinese_simplified ] = "Դ(D)"; + Text[ chinese_traditional ] = "u(D)"; + Text[ arabic ] = " "; + Text[ turkish ] = "Veri kayna"; + Text[ language_user1 ] = " "; + }; /* ToolBoxItem { |