summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-04 09:55:32 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-04 12:01:20 +0000
commit24a00c43c2b59df9b3f29c76f2e898e43bbb27ba (patch)
treed200e771e72f6bf252dd71999502401d82fd60cd /dbaccess
parentc234d4c2cd63bcd8fb7e4a39b8f36226c289373d (diff)
convert database save as dialog to .ui
Change-Id: Ifc8d43930ecbd3ccd67147cd891260555976dc0d
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/AllLangResTarget_dbu.mk1
-rw-r--r--dbaccess/UIConfig_dbaccess.mk1
-rw-r--r--dbaccess/inc/dbaccess_helpid.hrc3
-rw-r--r--dbaccess/source/ui/app/app.src25
-rw-r--r--dbaccess/source/ui/control/SqlNameEdit.cxx12
-rw-r--r--dbaccess/source/ui/dlg/dlgsave.cxx251
-rw-r--r--dbaccess/source/ui/dlg/dlgsave.hrc46
-rw-r--r--dbaccess/source/ui/dlg/dlgsave.src131
-rw-r--r--dbaccess/source/ui/inc/dbu_resource.hrc6
-rw-r--r--dbaccess/uiconfig/ui/savedialog.ui195
10 files changed, 330 insertions, 341 deletions
diff --git a/dbaccess/AllLangResTarget_dbu.mk b/dbaccess/AllLangResTarget_dbu.mk
index 6840629bc336..39749243db34 100644
--- a/dbaccess/AllLangResTarget_dbu.mk
+++ b/dbaccess/AllLangResTarget_dbu.mk
@@ -46,7 +46,6 @@ $(eval $(call gb_SrsTarget_add_files,dbaccess/dbu,\
dbaccess/source/ui/dlg/dbadmin.src \
dbaccess/source/ui/dlg/dbfindex.src \
dbaccess/source/ui/dlg/directsql.src \
- dbaccess/source/ui/dlg/dlgsave.src \
dbaccess/source/ui/dlg/dsselect.src \
dbaccess/source/ui/dlg/indexdialog.src \
dbaccess/source/ui/dlg/paramdialog.src \
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index d8f71c8b216b..206a81b85a89 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
dbaccess/uiconfig/ui/queryfilterdialog \
dbaccess/uiconfig/ui/querypropertiesdialog \
dbaccess/uiconfig/ui/rowheightdialog \
+ dbaccess/uiconfig/ui/savedialog \
dbaccess/uiconfig/ui/specialsettingspage \
dbaccess/uiconfig/ui/sortdialog \
dbaccess/uiconfig/ui/tablesfilterdialog \
diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc
index 84de27157bf0..04f230ca35fb 100644
--- a/dbaccess/inc/dbaccess_helpid.hrc
+++ b/dbaccess/inc/dbaccess_helpid.hrc
@@ -78,7 +78,6 @@
#define HID_DLG_ERROR "DBACCESS_HID_DLG_ERROR"
#define HID_DLG_TEXT "DBACCESS_HID_DLG_TEXT"
#define UID_SQLERROR_BUTTONMORE "DBACCESS_UID_SQLERROR_BUTTONMORE"
-#define HID_DLG_SAVE_AS "DBACCESS_HID_DLG_SAVE_AS"
#define HID_BROWSER_QUERY_EDIT "DBACCESS_HID_BROWSER_QUERY_EDIT"
#define HID_BROWSER_QUERY_DELETE "DBACCESS_HID_BROWSER_QUERY_DELETE"
@@ -247,8 +246,6 @@
#define HID_DSADMIN_USESSL_LDAP "DBACCESS_HID_DSADMIN_USESSL_LDAP"
#define HID_BROWSER_QUERY_WIZARD "DBACCESS_HID_BROWSER_QUERY_WIZARD"
-#define HID_DLG_RENAME "DBACCESS_HID_DLG_RENAME"
-
#define HID_DSADMIN_PAGE_MYSQL_JDBC "DBACCESS_HID_DSADMIN_PAGE_MYSQL_JDBC"
#define HID_DSADMIN_DBASE_PATH "DBACCESS_HID_DSADMIN_DBASE_PATH"
diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src
index f06f29b6c3d4..585fa43b1644 100644
--- a/dbaccess/source/ui/app/app.src
+++ b/dbaccess/source/ui/app/app.src
@@ -471,4 +471,29 @@ String STR_PAGETITLE_CONNECTION
Text [ en-US ] = "Connection settings" ;
};
+String STR_TBL_LABEL
+{
+ Text [ en-US ] = "~Table Name" ;
+};
+
+String STR_VW_LABEL
+{
+ Text [ en-US ] = "~Name of table view" ;
+};
+
+String STR_QRY_LABEL
+{
+ Text [ en-US ] = "~Query name" ;
+};
+
+String STR_TITLE_RENAME
+{
+ Text [ en-US ] = "Rename to";
+};
+
+String STR_TITLE_PASTE_AS
+{
+ Text [ en-US ] = "Insert as";
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx
index 8a6f861fc51d..603a50c37099 100644
--- a/dbaccess/source/ui/control/SqlNameEdit.cxx
+++ b/dbaccess/source/ui/control/SqlNameEdit.cxx
@@ -18,6 +18,8 @@
*/
#include "SqlNameEdit.hxx"
+#include <vcl/builder.hxx>
+
namespace dbaui
{
sal_Bool isCharOk(sal_Unicode _cChar,sal_Bool _bFirstChar,sal_Bool _bUpperCase,const OUString& _sAllowedChars)
@@ -79,4 +81,14 @@ namespace dbaui
}
}
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeOSQLNameEdit(Window *pParent, VclBuilder::stringmap &)
+{
+ return new dbaui::OSQLNameEdit(pParent);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeOSQLNameComboBox(Window *pParent, VclBuilder::stringmap &)
+{
+ return new dbaui::OSQLNameComboBox(pParent);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx
index ce21f4dda4f2..0f217d4c7a33 100644
--- a/dbaccess/source/ui/dlg/dlgsave.cxx
+++ b/dbaccess/source/ui/dlg/dlgsave.cxx
@@ -18,7 +18,6 @@
*/
#include "dlgsave.hxx"
-#include "dlgsave.hrc"
#include <vcl/msgbox.hxx>
#include "dbu_dlg.hrc"
#include <com/sun/star/sdb/CommandType.hpp>
@@ -49,16 +48,14 @@ namespace dbaui
class OSaveAsDlgImpl
{
public:
- FixedText m_aDescription;
- FixedText m_aCatalogLbl;
- OSQLNameComboBox m_aCatalog;
- FixedText m_aSchemaLbl;
- OSQLNameComboBox m_aSchema;
- FixedText m_aLabel;
- OSQLNameEdit m_aTitle;
- OKButton m_aPB_OK;
- CancelButton m_aPB_CANCEL;
- HelpButton m_aPB_HELP;
+ FixedText* m_pDescription;
+ FixedText* m_pCatalogLbl;
+ OSQLNameComboBox* m_pCatalog;
+ FixedText* m_pSchemaLbl;
+ OSQLNameComboBox* m_pSchema;
+ FixedText* m_pLabel;
+ OSQLNameEdit* m_pTitle;
+ OKButton* m_pPB_OK;
OUString m_aQryLabel;
OUString m_sTblLabel;
OUString m_aName;
@@ -69,12 +66,12 @@ public:
sal_Int32 m_nType;
sal_Int32 m_nFlags;
- OSaveAsDlgImpl( Window * pParent,const sal_Int32& _rType,
+ OSaveAsDlgImpl( OSaveAsDlg* pParent,const sal_Int32& _rType,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
const OUString& rDefault,
const IObjectNameCheck& _rObjectNameCheck,
sal_Int32 _nFlags);
- OSaveAsDlgImpl( Window * pParent,
+ OSaveAsDlgImpl( OSaveAsDlg* pParent,
const OUString& rDefault,
const IObjectNameCheck& _rObjectNameCheck,
sal_Int32 _nFlags);
@@ -82,67 +79,65 @@ public:
} // dbaui
-OSaveAsDlgImpl::OSaveAsDlgImpl( Window * _pParent,
+OSaveAsDlgImpl::OSaveAsDlgImpl(OSaveAsDlg* pParent,
const sal_Int32& _rType,
const Reference< XConnection>& _xConnection,
const OUString& rDefault,
const IObjectNameCheck& _rObjectNameCheck,
sal_Int32 _nFlags)
- :m_aDescription(_pParent, ModuleRes (FT_DESCRIPTION))
- ,m_aCatalogLbl(_pParent, ModuleRes (FT_CATALOG))
- ,m_aCatalog(_pParent, ModuleRes (ET_CATALOG), OUString())
- ,m_aSchemaLbl(_pParent, ModuleRes (FT_SCHEMA))
- ,m_aSchema(_pParent, ModuleRes (ET_SCHEMA), OUString())
- ,m_aLabel(_pParent, ModuleRes (FT_TITLE))
- ,m_aTitle(_pParent, ModuleRes (ET_TITLE), OUString())
- ,m_aPB_OK(_pParent, ModuleRes( PB_OK ) )
- ,m_aPB_CANCEL(_pParent, ModuleRes( PB_CANCEL ))
- ,m_aPB_HELP(_pParent, ModuleRes( PB_HELP))
- ,m_aQryLabel(ModuleRes(STR_QRY_LABEL))
- ,m_sTblLabel(ModuleRes(STR_TBL_LABEL))
- ,m_aName(rDefault)
- ,m_rObjectNameCheck( _rObjectNameCheck )
- ,m_nType(_rType)
- ,m_nFlags(_nFlags)
+ : m_aQryLabel(ModuleRes(STR_QRY_LABEL))
+ , m_sTblLabel(ModuleRes(STR_TBL_LABEL))
+ , m_aName(rDefault)
+ , m_rObjectNameCheck( _rObjectNameCheck )
+ , m_nType(_rType)
+ , m_nFlags(_nFlags)
{
+ pParent->get(m_pDescription, "descriptionft");
+ pParent->get(m_pCatalogLbl, "catalogft");
+ pParent->get(m_pCatalog, "catalog");
+ pParent->get(m_pSchemaLbl, "schemaft");
+ pParent->get(m_pSchema, "schema");
+ pParent->get(m_pLabel, "titleft");
+ pParent->get(m_pTitle, "title");
+ pParent->get(m_pPB_OK, "ok");
+
if ( _xConnection.is() )
m_xMetaData = _xConnection->getMetaData();
if ( m_xMetaData.is() )
{
OUString sExtraNameChars( m_xMetaData->getExtraNameCharacters() );
- m_aCatalog.setAllowedChars( sExtraNameChars );
- m_aSchema.setAllowedChars( sExtraNameChars );
- m_aTitle.setAllowedChars( sExtraNameChars );
+ m_pCatalog->setAllowedChars( sExtraNameChars );
+ m_pSchema->setAllowedChars( sExtraNameChars );
+ m_pTitle->setAllowedChars( sExtraNameChars );
}
- m_aCatalog.SetDropDownLineCount( 10 );
- m_aSchema.SetDropDownLineCount( 10 );
+ m_pCatalog->SetDropDownLineCount( 10 );
+ m_pSchema->SetDropDownLineCount( 10 );
}
-OSaveAsDlgImpl::OSaveAsDlgImpl( Window * _pParent,
+OSaveAsDlgImpl::OSaveAsDlgImpl(OSaveAsDlg* pParent,
const OUString& rDefault,
const IObjectNameCheck& _rObjectNameCheck,
sal_Int32 _nFlags)
- :m_aDescription(_pParent, ModuleRes (FT_DESCRIPTION))
- ,m_aCatalogLbl(_pParent, ModuleRes (FT_CATALOG))
- ,m_aCatalog(_pParent, ModuleRes (ET_CATALOG))
- ,m_aSchemaLbl(_pParent, ModuleRes (FT_SCHEMA))
- ,m_aSchema(_pParent, ModuleRes (ET_SCHEMA))
- ,m_aLabel(_pParent, ModuleRes (FT_TITLE))
- ,m_aTitle(_pParent, ModuleRes (ET_TITLE))
- ,m_aPB_OK(_pParent, ModuleRes( PB_OK ) )
- ,m_aPB_CANCEL(_pParent, ModuleRes( PB_CANCEL ))
- ,m_aPB_HELP(_pParent, ModuleRes( PB_HELP))
- ,m_aQryLabel(ModuleRes(STR_QRY_LABEL))
- ,m_sTblLabel(ModuleRes(STR_TBL_LABEL))
- ,m_aName(rDefault)
- ,m_rObjectNameCheck( _rObjectNameCheck )
- ,m_nType(CommandType::COMMAND)
- ,m_nFlags(_nFlags)
+ : m_aQryLabel(ModuleRes(STR_QRY_LABEL))
+ , m_sTblLabel(ModuleRes(STR_TBL_LABEL))
+ , m_aName(rDefault)
+ , m_rObjectNameCheck( _rObjectNameCheck )
+ , m_nType(CommandType::COMMAND)
+ , m_nFlags(_nFlags)
{
- m_aCatalog.SetDropDownLineCount( 10 );
- m_aSchema.SetDropDownLineCount( 10 );
+ pParent->get(m_pDescription, "descriptionft");
+ pParent->get(m_pCatalogLbl, "catalogft");
+ pParent->get(m_pCatalog, "catalog");
+ pParent->get(m_pSchemaLbl, "schemaft");
+ pParent->get(m_pSchema, "schema");
+ pParent->get(m_pLabel, "titleft");
+ pParent->get(m_pTitle, "title");
+ pParent->get(m_pPB_OK, "ok");
+
+ m_pCatalog->SetDropDownLineCount( 10 );
+ m_pSchema->SetDropDownLineCount( 10 );
}
using namespace ::com::sun::star::lang;
@@ -188,8 +183,8 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent,
const OUString& rDefault,
const IObjectNameCheck& _rObjectNameCheck,
sal_Int32 _nFlags)
- :ModalDialog( pParent, ModuleRes(DLG_SAVE_AS))
- ,m_xContext( _rxContext )
+ : ModalDialog(pParent, "SaveDialog", "dbaccess/ui/savedialog.ui")
+ , m_xContext( _rxContext )
{
m_pImpl = new OSaveAsDlgImpl(this,_rType,_xConnection,rDefault,_rObjectNameCheck,_nFlags);
@@ -202,41 +197,27 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent,
case CommandType::TABLE:
OSL_ENSURE( m_pImpl->m_xMetaData.is(), "OSaveAsDlg::OSaveAsDlg: no meta data for entering table names: this will crash!" );
{
- m_pImpl->m_aLabel.SetText(m_pImpl->m_sTblLabel);
- Point aPos(m_pImpl->m_aPB_OK.GetPosPixel());
+ m_pImpl->m_pLabel->SetText(m_pImpl->m_sTblLabel);
if(m_pImpl->m_xMetaData.is() && !m_pImpl->m_xMetaData->supportsCatalogsInTableDefinitions())
{
- m_pImpl->m_aCatalogLbl.Hide();
- m_pImpl->m_aCatalog.Hide();
-
- aPos = m_pImpl->m_aLabel.GetPosPixel();
-
- m_pImpl->m_aLabel.SetPosPixel(m_pImpl->m_aSchemaLbl.GetPosPixel());
- m_pImpl->m_aTitle.SetPosPixel(m_pImpl->m_aSchema.GetPosPixel());
-
- m_pImpl->m_aSchemaLbl.SetPosPixel(m_pImpl->m_aCatalogLbl.GetPosPixel());
- m_pImpl->m_aSchema.SetPosPixel(m_pImpl->m_aCatalog.GetPosPixel());
+ m_pImpl->m_pCatalogLbl->Hide();
+ m_pImpl->m_pCatalog->Hide();
}
else
{
// now fill the catalogs
- lcl_fillComboList( m_pImpl->m_aCatalog, _xConnection,
+ lcl_fillComboList( *m_pImpl->m_pCatalog, _xConnection,
&XDatabaseMetaData::getCatalogs, _xConnection->getCatalog() );
}
if ( !m_pImpl->m_xMetaData->supportsSchemasInTableDefinitions())
{
- m_pImpl->m_aSchemaLbl.Hide();
- m_pImpl->m_aSchema.Hide();
-
- aPos = m_pImpl->m_aLabel.GetPosPixel();
-
- m_pImpl->m_aLabel.SetPosPixel(m_pImpl->m_aSchemaLbl.GetPosPixel());
- m_pImpl->m_aTitle.SetPosPixel(m_pImpl->m_aSchema.GetPosPixel());
+ m_pImpl->m_pSchemaLbl->Hide();
+ m_pImpl->m_pSchema->Hide();
}
else
{
- lcl_fillComboList( m_pImpl->m_aSchema, _xConnection,
+ lcl_fillComboList( *m_pImpl->m_pSchema, _xConnection,
&XDatabaseMetaData::getSchemas, m_pImpl->m_xMetaData->getUserName() );
}
@@ -251,42 +232,33 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent,
sTable,
::dbtools::eInDataManipulation);
- sal_uInt16 nPos = m_pImpl->m_aCatalog.GetEntryPos(OUString(sCatalog));
+ sal_uInt16 nPos = m_pImpl->m_pCatalog->GetEntryPos(OUString(sCatalog));
if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- m_pImpl->m_aCatalog.SelectEntryPos(nPos);
+ m_pImpl->m_pCatalog->SelectEntryPos(nPos);
if ( !sSchema.isEmpty() )
{
- nPos = m_pImpl->m_aSchema.GetEntryPos(OUString(sSchema));
+ nPos = m_pImpl->m_pSchema->GetEntryPos(OUString(sSchema));
if ( nPos != COMBOBOX_ENTRY_NOTFOUND )
- m_pImpl->m_aSchema.SelectEntryPos(nPos);
+ m_pImpl->m_pSchema->SelectEntryPos(nPos);
}
- m_pImpl->m_aTitle.SetText(sTable);
+ m_pImpl->m_pTitle->SetText(sTable);
}
else
- m_pImpl->m_aTitle.SetText(m_pImpl->m_aName);
- m_pImpl->m_aTitle.SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
-
- m_pImpl->m_aPB_OK.SetPosPixel(Point(m_pImpl->m_aPB_OK.GetPosPixel().X(),aPos.Y()));
- m_pImpl->m_aPB_CANCEL.SetPosPixel(Point(m_pImpl->m_aPB_CANCEL.GetPosPixel().X(),aPos.Y()));
- m_pImpl->m_aPB_HELP.SetPosPixel(Point(m_pImpl->m_aPB_HELP.GetPosPixel().X(),aPos.Y()));
+ m_pImpl->m_pTitle->SetText(m_pImpl->m_aName);
+ m_pImpl->m_pTitle->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
sal_Int32 nLength = m_pImpl->m_xMetaData.is() ? m_pImpl->m_xMetaData->getMaxTableNameLength() : 0;
nLength = nLength ? nLength : EDIT_NOLIMIT;
- m_pImpl->m_aTitle.SetMaxTextLen(nLength);
- m_pImpl->m_aSchema.SetMaxTextLen(nLength);
- m_pImpl->m_aCatalog.SetMaxTextLen(nLength);
+ m_pImpl->m_pTitle->SetMaxTextLen(nLength);
+ m_pImpl->m_pSchema->SetMaxTextLen(nLength);
+ m_pImpl->m_pCatalog->SetMaxTextLen(nLength);
sal_Bool bCheck = _xConnection.is() && isSQL92CheckEnabled(_xConnection);
- m_pImpl->m_aTitle.setCheck(bCheck); // enable non valid sql chars as well
- m_pImpl->m_aSchema.setCheck(bCheck); // enable non valid sql chars as well
- m_pImpl->m_aCatalog.setCheck(bCheck); // enable non valid sql chars as well
-
- Size aSize = GetSizePixel();
- aSize.Height() =
- aPos.Y() + m_pImpl->m_aPB_OK.GetSizePixel().Height() + m_pImpl->m_aTitle.GetSizePixel().Height() / 2;
- SetSizePixel(aSize);
+ m_pImpl->m_pTitle->setCheck(bCheck); // enable non valid sql chars as well
+ m_pImpl->m_pSchema->setCheck(bCheck); // enable non valid sql chars as well
+ m_pImpl->m_pCatalog->setCheck(bCheck); // enable non valid sql chars as well
}
break;
@@ -303,8 +275,8 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent,
const OUString& _sLabel,
const IObjectNameCheck& _rObjectNameCheck,
sal_Int32 _nFlags)
- :ModalDialog( pParent, ModuleRes(DLG_SAVE_AS))
- ,m_xContext( _rxContext )
+ : ModalDialog(pParent, "SaveDialog", "dbaccess/ui/savedialog.ui")
+ , m_xContext( _rxContext )
{
m_pImpl = new OSaveAsDlgImpl(this,rDefault,_rObjectNameCheck,_nFlags);
implInitOnlyTitle(_sLabel);
@@ -318,9 +290,9 @@ OSaveAsDlg::~OSaveAsDlg()
IMPL_LINK(OSaveAsDlg, ButtonClickHdl, Button *, pButton)
{
- if (pButton == &m_pImpl->m_aPB_OK)
+ if (pButton == m_pImpl->m_pPB_OK)
{
- m_pImpl->m_aName = m_pImpl->m_aTitle.GetText();
+ m_pImpl->m_aName = m_pImpl->m_pTitle->GetText();
OUString sNameToCheck( m_pImpl->m_aName );
@@ -341,41 +313,28 @@ IMPL_LINK(OSaveAsDlg, ButtonClickHdl, Button *, pButton)
EndDialog( RET_OK );
showError( aNameError, this, m_xContext );
- m_pImpl->m_aTitle.GrabFocus();
+ m_pImpl->m_pTitle->GrabFocus();
}
return 0;
}
IMPL_LINK(OSaveAsDlg, EditModifyHdl, Edit *, pEdit )
{
- if (pEdit == &m_pImpl->m_aTitle)
- m_pImpl->m_aPB_OK.Enable(!m_pImpl->m_aTitle.GetText().isEmpty());
+ if (pEdit == m_pImpl->m_pTitle)
+ m_pImpl->m_pPB_OK->Enable(!m_pImpl->m_pTitle->GetText().isEmpty());
return 0;
}
void OSaveAsDlg::implInitOnlyTitle(const OUString& _rLabel)
{
- m_pImpl->m_aLabel.SetText(_rLabel);
- m_pImpl->m_aCatalogLbl.Hide();
- m_pImpl->m_aCatalog.Hide();
- m_pImpl->m_aSchemaLbl.Hide();
- m_pImpl->m_aSchema.Hide();
-
- Point aPos(m_pImpl->m_aSchemaLbl.GetPosPixel());
- m_pImpl->m_aLabel.SetPosPixel(m_pImpl->m_aCatalogLbl.GetPosPixel());
- m_pImpl->m_aTitle.SetPosPixel(m_pImpl->m_aCatalog.GetPosPixel());
-
- m_pImpl->m_aPB_OK.SetPosPixel(Point(m_pImpl->m_aPB_OK.GetPosPixel().X(),aPos.Y()));
- m_pImpl->m_aPB_CANCEL.SetPosPixel(Point(m_pImpl->m_aPB_CANCEL.GetPosPixel().X(),aPos.Y()));
- m_pImpl->m_aPB_HELP.SetPosPixel(Point(m_pImpl->m_aPB_HELP.GetPosPixel().X(),aPos.Y()));
-
- sal_Int32 nNewHeight =
- aPos.Y() + m_pImpl->m_aPB_OK.GetSizePixel().Height() + m_pImpl->m_aTitle.GetSizePixel().Height() / 2;
-
- SetSizePixel(Size(GetSizePixel().Width(), nNewHeight));
-
- m_pImpl->m_aTitle.SetText(m_pImpl->m_aName);
- m_pImpl->m_aTitle.setCheck(sal_False); // enable non valid sql chars as well
+ m_pImpl->m_pLabel->SetText(_rLabel);
+ m_pImpl->m_pCatalogLbl->Hide();
+ m_pImpl->m_pCatalog->Hide();
+ m_pImpl->m_pSchemaLbl->Hide();
+ m_pImpl->m_pSchema->Hide();
+
+ m_pImpl->m_pTitle->SetText(m_pImpl->m_aName);
+ m_pImpl->m_pTitle->setCheck(sal_False); // enable non valid sql chars as well
}
void OSaveAsDlg::implInit()
@@ -383,47 +342,21 @@ void OSaveAsDlg::implInit()
if ( 0 == ( m_pImpl->m_nFlags & SAD_ADDITIONAL_DESCRIPTION ) )
{
// hide the description window
- m_pImpl->m_aDescription.Hide();
-
- // the number of pixels we have to move the other controls
- sal_Int32 nMoveUp = m_pImpl->m_aCatalog.GetPosPixel().Y() - m_pImpl->m_aDescription.GetPosPixel().Y();
-
- // loop to all controls and move them ...
- for ( Window* pChildControl = GetWindow( WINDOW_FIRSTCHILD );
- pChildControl;
- pChildControl= pChildControl->GetWindow( WINDOW_NEXT )
- )
- {
- if ( &m_pImpl->m_aDescription != pChildControl )
- {
- Point aPos = pChildControl->GetPosPixel();
- aPos.Y() -= nMoveUp;
- pChildControl->SetPosPixel(aPos);
- }
- }
-
- // change our own size accordingly
- Size aSize = GetSizePixel();
- aSize.Height() -= nMoveUp;
- SetSizePixel(aSize);
+ m_pImpl->m_pDescription->Hide();
}
if ( SAD_TITLE_PASTE_AS == ( m_pImpl->m_nFlags & SAD_TITLE_PASTE_AS ) )
SetText( ModuleRes( STR_TITLE_PASTE_AS ) );
else if ( SAD_TITLE_RENAME == ( m_pImpl->m_nFlags & SAD_TITLE_RENAME ) )
- {
SetText( ModuleRes( STR_TITLE_RENAME ) );
- m_pImpl->m_aTitle.SetHelpId(HID_DLG_RENAME);
- }
- m_pImpl->m_aPB_OK.SetClickHdl(LINK(this,OSaveAsDlg,ButtonClickHdl));
- m_pImpl->m_aTitle.SetModifyHdl(LINK(this,OSaveAsDlg,EditModifyHdl));
- m_pImpl->m_aTitle.GrabFocus();
- FreeResource();
+ m_pImpl->m_pPB_OK->SetClickHdl(LINK(this,OSaveAsDlg,ButtonClickHdl));
+ m_pImpl->m_pTitle->SetModifyHdl(LINK(this,OSaveAsDlg,EditModifyHdl));
+ m_pImpl->m_pTitle->GrabFocus();
}
OUString OSaveAsDlg::getName() const { return m_pImpl->m_aName; }
-OUString OSaveAsDlg::getCatalog() const { return m_pImpl->m_aCatalog.IsVisible() ? m_pImpl->m_aCatalog.GetText() : OUString(); }
-OUString OSaveAsDlg::getSchema() const { return m_pImpl->m_aSchema.IsVisible() ? m_pImpl->m_aSchema.GetText() : OUString(); }
+OUString OSaveAsDlg::getCatalog() const { return m_pImpl->m_pCatalog->IsVisible() ? m_pImpl->m_pCatalog->GetText() : OUString(); }
+OUString OSaveAsDlg::getSchema() const { return m_pImpl->m_pSchema->IsVisible() ? m_pImpl->m_pSchema->GetText() : OUString(); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/dlg/dlgsave.hrc b/dbaccess/source/ui/dlg/dlgsave.hrc
deleted file mode 100644
index 21d7a67bcbac..000000000000
--- a/dbaccess/source/ui/dlg/dlgsave.hrc
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef DBAUI_DLGSAVE_HRC
-#define DBAUI_DLGSAVE_HRC
-
-// defines ------------------------------------------------------------------
-
-#define PB_OK 1
-#define PB_CANCEL 1
-#define PB_HELP 1
-
-#define ET_CATALOG 1
-#define ET_SCHEMA 2
-#define ET_TITLE 3
-
-#define FT_DESCRIPTION 1
-#define FT_CATALOG 2
-#define FT_SCHEMA 3
-#define FT_TITLE 4
-
-#define STR_TBL_LABEL 1
-#define STR_VW_LABEL 2
-#define STR_QRY_LABEL 3
-#define STR_TITLE_RENAME 4
-#define STR_TITLE_PASTE_AS 6
-
-#endif // DBAUI_DLGSAVE_HRC
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/dlg/dlgsave.src b/dbaccess/source/ui/dlg/dlgsave.src
deleted file mode 100644
index 44fd740538ea..000000000000
--- a/dbaccess/source/ui/dlg/dlgsave.src
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "dlgsave.hrc"
-#include "dbu_dlg.hrc"
-#include "dbaccess_helpid.hrc"
-
-ModalDialog DLG_SAVE_AS
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- HelpId = HID_DLG_SAVE_AS ;
- Size = MAP_APPFONT ( 174 , 75 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "Save As" ;
-
- FixedText FT_DESCRIPTION
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 174 - 12 , 16 ) ;
- WordBreak=TRUE;
- Text [ en-US ] = "Please enter a name for the object to be created:";
- };
-
- FixedText FT_CATALOG
- {
- Pos = MAP_APPFONT ( 6 , 26 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "~Catalog";
- };
- ComboBox ET_CATALOG
- {
- HelpID = "dbaccess:ComboBox:DLG_SAVE_AS:ET_CATALOG";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 77 , 25 ) ;
- Size = MAP_APPFONT ( 89 , 12 ) ;
- SVLook = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- };
- FixedText FT_SCHEMA
- {
- Pos = MAP_APPFONT ( 6 , 43 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Text [ en-US ] = "~Schema";
- };
- ComboBox ET_SCHEMA
- {
- HelpID = "dbaccess:ComboBox:DLG_SAVE_AS:ET_SCHEMA";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 77 , 42 ) ;
- Size = MAP_APPFONT ( 89 , 12 ) ;
- SVLook = TRUE ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- AutoHScroll = TRUE ;
- };
- FixedText FT_TITLE
- {
- Pos = MAP_APPFONT ( 6 , 60 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- };
- Edit ET_TITLE
- {
- HelpID = "dbaccess:Edit:DLG_SAVE_AS:ET_TITLE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 77 , 59 ) ;
- Size = MAP_APPFONT ( 89 , 12 ) ;
- TabStop = TRUE ;
- };
- OKButton PB_OK
- {
- Pos = MAP_APPFONT ( 6 , 77 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton PB_CANCEL
- {
- Pos = MAP_APPFONT ( 62 , 77 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton PB_HELP
- {
- Pos = MAP_APPFONT ( 118 , 77 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- // String Resourcen ------------------------------------------------------------------
- String STR_TBL_LABEL
- {
- Text [ en-US ] = "~Table Name" ;
- };
- String STR_VW_LABEL
- {
- Text [ en-US ] = "~Name of table view" ;
- };
- String STR_QRY_LABEL
- {
- Text [ en-US ] = "~Query name" ;
- };
- String STR_TITLE_RENAME
- {
- Text [ en-US ] = "Rename to";
- };
- String STR_TITLE_PASTE_AS
- {
- Text [ en-US ] = "Insert as";
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc
index 17aca78d5ad4..1532133a1119 100644
--- a/dbaccess/source/ui/inc/dbu_resource.hrc
+++ b/dbaccess/source/ui/inc/dbu_resource.hrc
@@ -81,7 +81,6 @@
#define DLG_DATASOURCE_SELECTION RID_DIALOG_START + 4
#define DLG_PARAMETERS RID_DIALOG_START + 5
-#define DLG_SAVE_AS RID_DIALOG_START + 11
#define DLG_JOIN_TABADD RID_DIALOG_START + 14
#define DLG_QRY_JOIN RID_DIALOG_START + 15
#define WIZ_RTFCOPYTABLE RID_DIALOG_START + 16
@@ -267,6 +266,11 @@
#define STR_PAGETITLE_ADVANCED RID_STR_GEN_START + 39
#define RID_STR_EXTENSION_NOT_PRESENT RID_STR_GEN_START + 40
#define STR_PAGETITLE_CONNECTION RID_STR_GEN_START + 41
+#define STR_TBL_LABEL RID_STR_GEN_START + 42
+#define STR_VW_LABEL RID_STR_GEN_START + 43
+#define STR_QRY_LABEL RID_STR_GEN_START + 44
+#define STR_TITLE_RENAME RID_STR_GEN_START + 45
+#define STR_TITLE_PASTE_AS RID_STR_GEN_START + 46
//========================================================================
// untyped resources
diff --git a/dbaccess/uiconfig/ui/savedialog.ui b/dbaccess/uiconfig/ui/savedialog.ui
new file mode 100644
index 000000000000..11274624af86
--- /dev/null
+++ b/dbaccess/uiconfig/ui/savedialog.ui
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Tue Feb 4 11:57:25 2014 -->
+<interface>
+ <!-- interface-requires LibreOffice 1.0 -->
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="SaveDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Save As</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="descriptionft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Please enter a name for the object to be created:</property>
+ <property name="wrap">True</property>
+ <property name="max_width_chars">52</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="catalogft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Catalog</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">catalog</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="schemaft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Schema</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">schema</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="dbulo-OSQLNameComboBox" id="schema">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="titleft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">title</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="dbulo-OSQLNameEdit" id="title">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="dbulo-OSQLNameComboBox" id="catalog">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>