summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-01 20:22:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-04 20:22:57 +0000
commit4b9c6542f7107be7536f239ca061fd363395b3d4 (patch)
tree49586dcf8bbe98bb9018bff47686be4da74ab703 /basctl/source/basicide
parenta2045ea778ee0191528bdc69165ad382cc7c1cb1 (diff)
fdo#74104 fdo#73904 backport Message dialog creation from message strings
Original title: "allow simple MessageDialogs to be created from just message strings" Commit 9b6b03542df7f6b0feecf60a13bab7e885ef3587 upgraded sd/source/ui/view/Outliner.cxx to use a MessageDialog created from just a message string, but was done before the existence of this commit -- it's presumably safest to backport this commit to ensure that any other such changed dialogs will work as expected. (cherry picked from commit 257d1f4ff3094a42952663d620d7c49e3e7c747f) Conflicts: basctl/source/basicide/moduldl2.cxx Change-Id: I9f8324d1c61bd55ccc78e67699ebdfa946e48af6 Reviewed-on: https://gerrit.libreoffice.org/7859 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/moduldl2.cxx33
1 files changed, 15 insertions, 18 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index f4d5bad8b326..3db35b8333bd 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
#include <sot/storinfo.hxx>
#include <moduldlg.hrc>
@@ -291,7 +291,7 @@ sal_Bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& )
OUString aLibName = GetEntryText( pEntry, 0 );
if ( aLibName.equalsIgnoreAsciiCase( "Standard" ) )
{
- ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB) ).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB)).Execute();
return false;
}
@@ -301,7 +301,7 @@ sal_Bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& )
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) ||
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) )
{
- ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_LIBISREADONLY) ).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_LIBISREADONLY)).Execute();
return false;
}
@@ -353,7 +353,7 @@ sal_Bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewNam
}
catch (const container::ElementExistException& )
{
- ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED) ).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED)).Execute();
return false;
}
catch (const container::NoSuchElementException& )
@@ -366,9 +366,9 @@ sal_Bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewNam
if ( !bValid )
{
if ( rNewName.getLength() > 30 )
- ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_LIBNAMETOLONG) ).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_LIBNAMETOLONG)).Execute();
else
- ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) ).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute();
}
return bValid;
@@ -384,8 +384,7 @@ IMPL_LINK_NOARG(NewObjectDialog, OkButtonHandler)
EndDialog(1);
else
{
- ErrorBox(this, WB_OK | WB_DEF_OK,
- IDE_RESSTR(RID_STR_BADSBXNAME)).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute();
aEdit.GrabFocus();
}
return 0;
@@ -893,7 +892,7 @@ void LibPage::InsertLib()
}
if ( !pLibDlg )
- InfoBox( this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE) ).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE), VCL_MESSAGE_INFO).Execute();
else
{
bool bChanges = false;
@@ -930,7 +929,7 @@ void LibPage::InsertLib()
// check, if the library is the Standard library
if ( aLibName == "Standard" )
{
- ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_REPLACESTDLIB) ).Execute();
+ MessageDialog(this, IDE_RESSTR(RID_STR_REPLACESTDLIB)).Execute();
continue;
}
@@ -942,7 +941,7 @@ void LibPage::InsertLib()
aErrStr = aErrStr.replaceAll("XX", aLibName);
aErrStr += "\n";
aErrStr += IDE_RESSTR(RID_STR_LIBISREADONLY);
- ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
+ MessageDialog(this, aErrStr).Execute();
continue;
}
@@ -959,7 +958,7 @@ void LibPage::InsertLib()
aErrStr = aErrStr.replaceAll("XX", aLibName);
aErrStr += "\n" ;
aErrStr += IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED);
- ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
+ MessageDialog(this, aErrStr).Execute();
continue;
}
}
@@ -978,7 +977,7 @@ void LibPage::InsertLib()
{
OUString aErrStr( IDE_RESSTR(RID_STR_NOIMPORT) );
aErrStr = aErrStr.replaceAll("XX", aLibName);
- ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
+ MessageDialog(this, aErrStr).Execute();
continue;
}
}
@@ -1570,17 +1569,15 @@ void createLibImpl( Window* pWin, const ScriptDocument& rDocument,
if ( aLibName.getLength() > 30 )
{
- ErrorBox( pWin, WB_OK | WB_DEF_OK, IDEResId(RID_STR_LIBNAMETOLONG).toString() ).Execute();
+ MessageDialog(pWin, IDEResId(RID_STR_LIBNAMETOLONG).toString()).Execute();
}
else if ( !IsValidSbxName( aLibName ) )
{
- ErrorBox( pWin, WB_OK | WB_DEF_OK,
- IDEResId(RID_STR_BADSBXNAME).toString() ).Execute();
+ MessageDialog(pWin, IDEResId(RID_STR_BADSBXNAME).toString()).Execute();
}
else if ( rDocument.hasLibrary( E_SCRIPTS, aLibName ) || rDocument.hasLibrary( E_DIALOGS, aLibName ) )
{
- ErrorBox( pWin, WB_OK | WB_DEF_OK,
- IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString() ).Execute();
+ MessageDialog(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString()).Execute();
}
else
{