#87149# addressbook ui impl

This commit is contained in:
Ocke Janssen
2001-05-29 12:11:52 +00:00
parent aaa383a137
commit f1f9aae8cc
9 changed files with 125 additions and 80 deletions

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: dbaccess_helpid.hrc,v $
*
* $Revision: 1.31 $
* $Revision: 1.32 $
*
* last change: $Author: oj $ $Date: 2001-05-23 14:15:50 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -263,8 +263,10 @@
#define HID_DSADMIN_TABLE_TOOLBOX (HID_DBACCESS_START + 171)
#define HID_DSADMIN_QUERY_TOOLBOX (HID_DBACCESS_START + 172)
#define HID_DSADMIN_BOOKMARK_TOOLBOX (HID_DBACCESS_START + 173)
#define HID_DSADMIN_PAGE_ADDRESSBOOK (HID_DBACCESS_START + 174)
#define HID_DSADMIN_LB_ADDRESSBOOK (HID_DBACCESS_START + 175)
#define HID_DSADMIN_PAGE_LDAP (HID_DBACCESS_START + 174)
#define HID_DSADMIN_LDAP_HOSTNAME (HID_DBACCESS_START + 175)
#define HID_DSADMIN_LDAP_BASEDN (HID_DBACCESS_START + 176)
#define HID_DSADMIN_LDAP_PORTNUMBER (HID_DBACCESS_START + 177)
// don't forget to update the file util/hidother.src
#endif // _DBA_DBACCESS_HELPID_HRC_
@@ -272,6 +274,9 @@
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.31 2001/05/23 14:15:50 oj
* #87149# new helpids
*
* Revision 1.30 2001/05/14 11:57:17 oj
* #86744# new helpids for views
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: detailpages.cxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: oj $ $Date: 2001-05-23 14:16:42 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,6 +80,9 @@
#ifndef _SFXENUMITEM_HXX
#include <svtools/eitem.hxx>
#endif
#ifndef _SFXINTITEM_HXX
#include <svtools/intitem.hxx>
#endif
#ifndef _DBAUI_DATASOURCEITEMS_HXX_
#include "dsitems.hxx"
#endif
@@ -745,31 +748,39 @@ namespace dbaui
}
//========================================================================
//= OAddressBookDetailsPage
//= OLDAPDetailsPage
//========================================================================
OAddressBookDetailsPage::OAddressBookDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs )
:OCommonBehaviourTabPage(pParent, PAGE_ADDRESSBOOK, _rCoreAttrs, CBTP_USE_UIDPWD)
OLDAPDetailsPage::OLDAPDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs )
:OCommonBehaviourTabPage(pParent, PAGE_LDAP, _rCoreAttrs, CBTP_USE_UIDPWD)
,m_aSeparator1 (this, ResId(FL_SEPARATOR1))
,m_aFixedText (this, ResId(FT_ADDRESSBOOK))
,m_aAddressBookList (this, ResId(LB_ADDRESSBOOK))
,m_aHostname (this, ResId(FT_HOSTNAME))
,m_aETHostname (this, ResId(ET_HOSTNAME))
,m_aBaseDN (this, ResId(FT_BASEDN))
,m_aETBaseDN (this, ResId(ET_BASEDN))
,m_aSeparator2 (this, ResId(FL_SEPARATOR2))
,m_aPortNumber (this, ResId(FT_PORTNUMBER))
,m_aNFPortNumber (this, ResId(NF_PORTNUMBER))
{
FreeResource();
}
// -----------------------------------------------------------------------
SfxTabPage* OAddressBookDetailsPage::Create( Window* pParent, const SfxItemSet& _rAttrSet )
SfxTabPage* OLDAPDetailsPage::Create( Window* pParent, const SfxItemSet& _rAttrSet )
{
return ( new OAddressBookDetailsPage( pParent, _rAttrSet ) );
return ( new OLDAPDetailsPage( pParent, _rAttrSet ) );
}
// -----------------------------------------------------------------------
sal_Int32* OAddressBookDetailsPage::getDetailIds()
sal_Int32* OLDAPDetailsPage::getDetailIds()
{
static sal_Int32* pRelevantIds = NULL;
if (!pRelevantIds)
{
static sal_Int32 nRelevantIds[] =
{
DSID_CONN_LDAP_HOSTNAME,
DSID_CONN_LDAP_BASEDN,
DSID_CONN_LDAP_PORTNUMBER,
0
};
pRelevantIds = nRelevantIds;
@@ -777,38 +788,22 @@ namespace dbaui
return pRelevantIds;
}
// -----------------------------------------------------------------------
sal_Bool OAddressBookDetailsPage::FillItemSet( SfxItemSet& _rSet )
sal_Bool OLDAPDetailsPage::FillItemSet( SfxItemSet& _rSet )
{
sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet) || m_aAddressBookList.GetSelectEntryPos() != m_aAddressBookList.GetSavedValue();
String sAddressBook;
switch(m_aAddressBookList.GetSelectEntryPos())
sal_Bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet);
FILL_STRING_ITEM(m_aETHostname,_rSet,DSID_CONN_LDAP_HOSTNAME,bChangedSomething)
FILL_STRING_ITEM(m_aETBaseDN,_rSet,DSID_CONN_LDAP_BASEDN,bChangedSomething)
if (m_aNFPortNumber.GetValue() != m_aNFPortNumber.GetSavedValue())
{
case 0:
sAddressBook.AssignAscii("DEFAULT");
break;
case 1:
sAddressBook.AssignAscii("LDAP");
break;
case 2:
sAddressBook.AssignAscii("OUTLOOK");
break;
default:
OSL_ENSURE(0,"Wrong Addressbook type!");
_rSet.Put(SfxInt32Item(DSID_CONN_LDAP_PORTNUMBER, m_aNFPortNumber.GetValue()));
bChangedSomething = sal_True;
}
SFX_ITEMSET_GET(_rSet, pConnectUrl, SfxStringItem, DSID_CONNECTURL, sal_True);
SFX_ITEMSET_GET(_rSet, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True);
ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
if (pTypeCollection && pConnectUrl && pConnectUrl->GetValue().Len())
{
String sType = pTypeCollection->getDatasourcePrefix(DST_ADDRESSBOOK);
sType += sAddressBook;
_rSet.Put(SfxStringItem(DSID_CONNECTURL, sType));
}
return bChangedSomething;
}
// -----------------------------------------------------------------------
void OAddressBookDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
void OLDAPDetailsPage::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
{
OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
@@ -816,29 +811,28 @@ namespace dbaui
sal_Bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
String sAddressBook;
SFX_ITEMSET_GET(_rSet, pConnectUrl, SfxStringItem, DSID_CONNECTURL, sal_True);
SFX_ITEMSET_GET(_rSet, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True);
ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
if (pTypeCollection && pConnectUrl && pConnectUrl->GetValue().Len())
sAddressBook = pTypeCollection->cutPrefix(pConnectUrl->GetValue());
SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_LDAP_HOSTNAME, sal_True);
SFX_ITEMSET_GET(_rSet, pBaseDN, SfxStringItem, DSID_CONN_LDAP_BASEDN, sal_True);
SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, sal_True);
m_aETHostname.SetText(pHostName->GetValue());
m_aETBaseDN.SetText(pBaseDN->GetValue());
m_aNFPortNumber.SetValue(pPortNumber->GetValue());
USHORT nPos = 0;
if(!sAddressBook.CompareToAscii("DEFAULT"))
nPos = 0;
else if(!sAddressBook.CompareToAscii("LDAP"))
nPos = 1;
else if(!sAddressBook.CompareToAscii("OUTLOOK"))
nPos = 2;
m_aAddressBookList.SelectEntryPos(nPos);
if (_bSaveValue)
m_aAddressBookList.SaveValue();
{
m_aETHostname.SaveValue();
m_aETBaseDN.SaveValue();
m_aNFPortNumber.SaveValue();
}
if (bReadonly)
m_aAddressBookList.Disable();
{
m_aETHostname.Disable();
m_aETBaseDN.Disable();
m_aNFPortNumber.Disable();
}
}
//========================================================================
@@ -1149,6 +1143,9 @@ namespace dbaui
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.5 2001/05/23 14:16:42 oj
* #87149# new helpids
*
* Revision 1.4 2001/04/27 08:07:31 fs
* #86370# disallow UTF-8 for dBase and text data sources
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: detailpages.hxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: oj $ $Date: 2001-05-23 14:16:42 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,9 @@
#ifndef _DBAUI_ADMINPAGES_HXX_
#include "adminpages.hxx"
#endif
#ifndef _SV_FIELD_HXX
#include <vcl/field.hxx>
#endif
//.........................................................................
namespace dbaui
@@ -237,7 +240,7 @@ namespace dbaui
//========================================================================
//= OOdbcDetailsPage
//========================================================================
class OAddressBookDetailsPage : public OCommonBehaviourTabPage
class OLDAPDetailsPage : public OCommonBehaviourTabPage
{
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet );
@@ -248,10 +251,15 @@ namespace dbaui
private:
FixedLine m_aSeparator1;
FixedText m_aFixedText;
ListBox m_aAddressBookList;
FixedText m_aHostname;
Edit m_aETHostname;
FixedText m_aBaseDN;
Edit m_aETBaseDN;
FixedLine m_aSeparator2;
FixedText m_aPortNumber;
NumericField m_aNFPortNumber;
OAddressBookDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
OLDAPDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
};
@@ -306,6 +314,9 @@ namespace dbaui
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.5 2001/05/23 14:16:42 oj
* #87149# new helpids
*
* Revision 1.4 2001/04/27 08:07:01 fs
* #86370# +adjustUTF8
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: dsitems.hxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: oj $ $Date: 2001-04-20 13:38:06 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,18 +96,24 @@
#define DSID_CONN_CTRLUSER 29
#define DSID_CONN_CTRLPWD 30
#define DSID_USECATALOG 31 // should the driver use the catalog name when the database is filebased
#define DSID_CONN_LDAP_HOSTNAME 32
#define DSID_CONN_LDAP_BASEDN 33
#define DSID_CONN_LDAP_PORTNUMBER 34
//========================================================================
//= item range. Adjust this if you introduce new items above
#define DSID_FIRST_ITEM_ID DSID_NAME
#define DSID_LAST_ITEM_ID DSID_USECATALOG
#define DSID_LAST_ITEM_ID DSID_CONN_LDAP_PORTNUMBER
#endif // _DBAUI_DATASOURCEITEMS_HXX_
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.8 2001/04/20 13:38:06 oj
* #85736# new checkbox for odbc
*
* Revision 1.7 2001/03/27 07:34:29 oj
* impl new page for adabas
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: dbadmin.hxx,v $
*
* $Revision: 1.17 $
* $Revision: 1.18 $
*
* last change: $Author: fs $ $Date: 2001-05-15 15:06:25 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -577,6 +577,10 @@ public:
*/
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> createConnection();
// adds a new detail page and remove all the old ones
void addDetailPage(USHORT _nPageId,USHORT _nTextId,CreateTabPage pCreateFunc);
// removes all detail pages
void removeDetailPages();
protected:
virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage);
virtual short Ok();
@@ -674,6 +678,9 @@ private:
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.17 2001/05/15 15:06:25 fs
* #86991# +prepareSwitchDatasource
*
* Revision 1.16 2001/05/10 12:12:46 fs
* #86223# remember view settings while applying (no matter if synchron or asynchronously
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: dbu_resource.hrc,v $
*
* $Revision: 1.46 $
* $Revision: 1.47 $
*
* last change: $Author: oj $ $Date: 2001-05-23 14:16:41 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -124,7 +124,7 @@
#define TAB_WIZ_COPYTABLE RID_PAGE_START + 12
#define TAB_PAG_ADABAS_SETTINGS RID_PAGE_START + 13
#define PAGE_DOCUMENTLINKS RID_PAGE_START + 14
#define PAGE_ADDRESSBOOK RID_PAGE_START + 15
#define PAGE_LDAP RID_PAGE_START + 15
//========================================================================
// error boxes
@@ -418,6 +418,11 @@
#define STR_COULD_NOT_CREATE_DIRECTORY RID_STRING_START + 162
#define STR_MISSING_TABLES_XDROP RID_STRING_START + 163
#define STR_BUTTON_TEXT_ALL RID_STRING_START + 164
#define STR_ADDRESSBOOK_SYSTEM RID_STRING_START + 165
#define STR_ADDRESSBOOK_MOZILLA RID_STRING_START + 166
#define STR_ADDRESSBOOK_LDAP RID_STRING_START + 167
#define STR_ADDRESSBOOK_OUTLOOK RID_STRING_START + 168
//========================================================================
// untyped resources
@@ -432,6 +437,9 @@
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.46 2001/05/23 14:16:41 oj
* #87149# new helpids
*
* Revision 1.45 2001/05/16 15:33:27 fs
* #87065# +QUERY_VIEW_DESIGN_SAVEMODIFIED
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: dbumiscres.src,v $
*
* $Revision: 1.23 $
* $Revision: 1.24 $
*
* last change: $Author: oj $ $Date: 2001-05-23 14:16:41 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,7 +82,7 @@ Resource RSC_DATASOURCE_TYPES
{
String STR_CONNTYPES
{
Text = "sdbc:adabas:;jdbc:;sdbc:odbc:;sdbc:dbase:;sdbc:ado:;sdbc:flat:;sdbc:calc:;sdbc:mozab:" ;
Text = "sdbc:adabas:;jdbc:;sdbc:odbc:;sdbc:dbase:;sdbc:ado:;sdbc:flat:;sdbc:calc:;sdbc:address:" ;
};
String STR_CONNUINAMES
{
@@ -305,6 +305,9 @@ String STR_BUTTON_TEXT_ALL
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.23 2001/05/23 14:16:41 oj
* #87149# new helpids
*
* Revision 1.22 2001/05/16 15:28:52 kz
* Merge SRC632: 16.05.01 - 17:28:14 (NoBranch)
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: dsntypes.cxx,v $
*
* $Revision: 1.7 $
* $Revision: 1.8 $
*
* last change: $Author: oj $ $Date: 2001-05-23 14:16:41 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -206,7 +206,7 @@ DATASOURCE_TYPE ODsnTypeCollection::implDetermineType(const String& _rDsn)
return DST_TEXT;
if (_rDsn.EqualsIgnoreCaseAscii("sdbc:calc:", 0, nSeparator))
return DST_CALC;
if (_rDsn.EqualsIgnoreCaseAscii("sdbc:mozab:", 0, nSeparator))
if (_rDsn.EqualsIgnoreCaseAscii("sdbc:address:", 0, nSeparator))
return DST_ADDRESSBOOK;
// find third :
@@ -383,6 +383,9 @@ SfxPoolItem* DbuTypeCollectionItem::Clone(SfxItemPool* _pPool) const
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.7 2001/05/23 14:16:41 oj
* #87149# new helpids
*
* Revision 1.6 2001/01/29 16:02:05 nn
* added DST_CALC
*

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: hidother.src,v $
*
* $Revision: 1.26 $
* $Revision: 1.27 $
*
* last change: $Author: oj $ $Date: 2001-05-23 14:15:20 $
* last change: $Author: oj $ $Date: 2001-05-29 13:11:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -248,12 +248,17 @@ hidspecial HID_DSBROWSER_BOOKMARK_SELECTED { HelpId = HID_DSBROWSER
hidspecial HID_DSADMIN_TABLE_TOOLBOX { HelpId = HID_DSADMIN_TABLE_TOOLBOX ; };
hidspecial HID_DSADMIN_QUERY_TOOLBOX { HelpId = HID_DSADMIN_QUERY_TOOLBOX ; };
hidspecial HID_DSADMIN_BOOKMARK_TOOLBOX { HelpId = HID_DSADMIN_BOOKMARK_TOOLBOX ; };
hidspecial HID_DSADMIN_PAGE_ADDRESSBOOK { HelpId = HID_DSADMIN_PAGE_ADDRESSBOOK ; };
hidspecial HID_DSADMIN_LB_ADDRESSBOOK { HelpId = HID_DSADMIN_LB_ADDRESSBOOK ; };
hidspecial HID_DSADMIN_PAGE_LDAP { HelpId = HID_DSADMIN_PAGE_LDAP ; };
hidspecial HID_DSADMIN_LDAP_HOSTNAME { HelpId = HID_DSADMIN_LDAP_HOSTNAME ; };
hidspecial HID_DSADMIN_LDAP_BASEDN { HelpId = HID_DSADMIN_LDAP_BASEDN ; };
hidspecial HID_DSADMIN_LDAP_PORTNUMBER { HelpId = HID_DSADMIN_LDAP_PORTNUMBER ; };
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
* Revision 1.26 2001/05/23 14:15:20 oj
* #87149# new helpids
*
* Revision 1.25 2001/05/14 11:57:35 oj
* #86744# new helpids for views
*