[Libreoffice-commits] core.git: cui/source
Olivier Hallot
olivier.hallot at edx.srv.br
Mon Aug 12 00:56:42 PDT 2013
cui/source/inc/cuires.hrc | 2 +-
cui/source/tabpages/strings.src | 4 ----
cui/source/tabpages/tpcolor.cxx | 23 +++++++++++------------
cui/source/tabpages/tpgradnt.cxx | 19 ++++++++++---------
cui/source/tabpages/tphatch.cxx | 21 +++++++++++----------
5 files changed, 33 insertions(+), 36 deletions(-)
New commits:
commit 14018e0bd509d1f7be89f3037404f08f660f8662
Author: Olivier Hallot <olivier.hallot at edx.srv.br>
Date: Sun Aug 11 23:31:28 2013 -0300
Replace warn duplicate dialogs with new UI
Change-Id: I9d2fbea71f486d1cd8340609547da8059676cd63
Reviewed-on: https://gerrit.libreoffice.org/5356
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index dacb276..e89b484 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -98,7 +98,7 @@
#define RID_SVXSTR_TABLE (RID_SVX_START + 220)
#define RID_SVXSTR_WARN_TABLE_OVERWRITE (RID_SVX_START + 231)
-#define RID_SVXSTR_WARN_NAME_DUPLICATE (RID_SVX_START + 236)
+
#define RID_SVXSTR_CHARNAME_TRANSPARENT (RID_SVX_START + 237)
#define RID_SVXSTR_DESC_LINEEND (RID_SVX_START + 238)
#define RID_SVXSTR_CHARNAME_NOSTYLE (RID_SVX_START + 239)
diff --git a/cui/source/tabpages/strings.src b/cui/source/tabpages/strings.src
index 4ef7c13..58c35d9 100644
--- a/cui/source/tabpages/strings.src
+++ b/cui/source/tabpages/strings.src
@@ -95,10 +95,6 @@ String RID_SVXSTR_WARN_TABLE_OVERWRITE
{
Text [ en-US ] = "The list was modified without saving. Would you like to save the list now?" ;
};
-String RID_SVXSTR_WARN_NAME_DUPLICATE
-{
- Text [ en-US ] = "The name you have entered already exists. \nPlease choose another name." ;
-};
String RID_SVXSTR_DESC_LINEEND
{
Text [ en-US ] = "Please enter a name for the new arrowhead:" ;
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index b47acba..05004a7 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -380,12 +380,9 @@ SvxColorTabPage::SvxColorTabPage(Window* pParent, const SfxItemSet& rInAttrs)
m_pK->SetModifyHdl( aLink );
m_pBtnAdd->SetClickHdl( LINK( this, SvxColorTabPage, ClickAddHdl_Impl ) );
- m_pBtnModify->SetClickHdl(
- LINK( this, SvxColorTabPage, ClickModifyHdl_Impl ) );
- m_pBtnWorkOn->SetClickHdl(
- LINK( this, SvxColorTabPage, ClickWorkOnHdl_Impl ) );
- m_pBtnDelete->SetClickHdl(
- LINK( this, SvxColorTabPage, ClickDeleteHdl_Impl ) );
+ m_pBtnModify->SetClickHdl( LINK( this, SvxColorTabPage, ClickModifyHdl_Impl ) );
+ m_pBtnWorkOn->SetClickHdl( LINK( this, SvxColorTabPage, ClickWorkOnHdl_Impl ) );
+ m_pBtnDelete->SetClickHdl( LINK( this, SvxColorTabPage, ClickDeleteHdl_Impl ) );
// ValueSet
m_pValSetColorList->SetStyle( m_pValSetColorList->GetStyle() | WB_ITEMBORDER );
@@ -689,9 +686,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
// if yes, it is repeated and a new name is demanded
if ( !bDifferent )
{
- WarningBox aWarningBox( GetParentDialog(), WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
+ MessageDialog aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+// aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
aWarningBox.Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -763,9 +761,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
// if yes, it is repeated and a new name is demanded
if ( !bDifferent )
{
- WarningBox aWarningBox( GetParentDialog(), WinBits( WB_OK ),
- String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
+ MessageDialog aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+// aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
aWarningBox.Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index c41bcee..442c46a 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -406,7 +406,6 @@ IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl )
IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
{
- ResMgr& rMgr = CUI_MGR();
String aNewName( SVX_RES( RID_SVXSTR_GRADIENT ) );
String aDesc( CUI_RES( RID_SVXSTR_DESC_GRADIENT ) );
String aName;
@@ -431,8 +430,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialogdiet fail!");
AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
- WarningBox* pWarnBox = NULL;
- sal_uInt16 nError = RID_SVXSTR_WARN_NAME_DUPLICATE;
+ MessageDialog* pWarnBox = NULL;
+ sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
{
@@ -452,10 +451,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox = new WarningBox( GetParentDialog(),
- WinBits( WB_OK_CANCEL ),
- String( ResId( nError, rMgr ) ) );
- pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
+ pWarnBox = new MessageDialog( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+// pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
}
if( pWarnBox->Execute() != RET_OK )
@@ -566,8 +565,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
}
else
{
- WarningBox aBox( GetParentDialog(), WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
+ MessageDialog aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+// aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
aBox.Execute();
}
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 9336dab..1c30030 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -455,7 +455,6 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl_Impl)
IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
{
- ResMgr& rMgr = CUI_MGR();
String aNewName( SVX_RES( RID_SVXSTR_HATCH ) );
String aDesc( CUI_RES( RID_SVXSTR_DESC_HATCH ) );
String aName;
@@ -468,7 +467,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
{
aName = aNewName;
aName += sal_Unicode(' ');
- aName += OUString::valueOf( j++ );
+ aName += OUString::number( j++ );
bDifferent = sal_True;
for( long i = 0; i < nCount && bDifferent; i++ )
@@ -480,8 +479,8 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialogdiet fail!");
AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
- WarningBox* pWarnBox = NULL;
- sal_uInt16 nError = RID_SVXSTR_WARN_NAME_DUPLICATE;
+ MessageDialog* pWarnBox = NULL;
+ sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
{
@@ -500,10 +499,10 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox = new WarningBox( GetParentDialog(),
- WinBits( WB_OK_CANCEL ),
- String( ResId( nError, rMgr ) ) );
- pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
+ pWarnBox = new MessageDialog( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+// pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE );
}
if( pWarnBox->Execute() != RET_OK )
@@ -610,8 +609,10 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl)
}
else
{
- WarningBox aBox( GetParentDialog(), WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) );
- aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
+ MessageDialog aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+// aBox.SetHelpId( HID_WARN_NAME_DUPLICATE );
aBox.Execute();
}
}
More information about the Libreoffice-commits
mailing list