diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-25 17:26:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-26 22:14:43 +0100 |
commit | 28488c94d697f169baaf4c67bf2c71287b503c43 (patch) | |
tree | 124245dfe4d87a722fe441ddee97ec8dbfb5bc06 /vcl | |
parent | 94fa259e769b44f2c2ea7f1667b28f2c07489668 (diff) |
convert corner case warningboxes with checkboxes
Change-Id: Ic8b58b792236a733b6687148eac5c06bbf734acf
Reviewed-on: https://gerrit.libreoffice.org/50325
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/strings.hrc | 2 | ||||
-rw-r--r-- | vcl/source/window/msgbox.cxx | 69 |
2 files changed, 0 insertions, 71 deletions
diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc index 99bcd8c79bbe..1475e2a65ceb 100644 --- a/vcl/inc/strings.hrc +++ b/vcl/inc/strings.hrc @@ -83,8 +83,6 @@ #define SV_STDTEXT_SERVICENOTAVAILABLE NC_("SV_STDTEXT_SERVICENOTAVAILABLE", "The component (%s) could not be loaded.\nPlease start setup with the repair option.") -#define SV_STDTEXT_DONTWARNAGAIN NC_("SV_STDTEXT_DONTWARNAGAIN", "Do not show warning again.") - #define SV_STDTEXT_ABOUT NC_("SV_STDTEXT_ABOUT", "About %PRODUCTNAME") #define SV_STDTEXT_PREFERENCES NC_("SV_STDTEXT_PREFERENCES", "Preferences...") #define SV_STDTEXT_ALLFILETYPES NC_("SV_STDTEXT_ALLFILETYPES", "Any type") diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 52d0bfdbdf97..2e85b5e7679f 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -126,7 +126,6 @@ MessBox::MessBox(vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits nWinB const OUString& rTitle, const OUString& rMessage) : ButtonDialog( WindowType::MESSBOX ), mbHelpBtn( false ), - mbCheck( false ), mnMessBoxStyle( nMessBoxStyle ), maMessText( rMessage ) { @@ -147,7 +146,6 @@ void MessBox::dispose() { mpVCLMultiLineEdit.disposeAndClear(); mpFixedImage.disposeAndClear(); - mpCheckBox.disposeAndClear(); ButtonDialog::dispose(); } @@ -187,11 +185,6 @@ void MessBox::ImplPosControls() mpVCLMultiLineEdit.disposeAndClear(); mpFixedImage.disposeAndClear(); - if ( mpCheckBox ) - { - mbCheck = mpCheckBox->IsChecked(); - mpCheckBox.disposeAndClear(); - } // Clean up message text with tabs OUString aMessText(maMessText.replaceAll("\t", " ")); @@ -286,52 +279,6 @@ void MessBox::ImplPosControls() if ( aPageSize.Width() < nTitleWidth ) aPageSize.setWidth( nTitleWidth ); - if ( !maCheckBoxText.isEmpty() ) - { - Size aMinCheckboxSize ( aMEditSize ); - if ( aPageSize.Width() < IMPL_MINSIZE_MSGBOX_WIDTH+80 ) - { - aPageSize.setWidth( IMPL_MINSIZE_MSGBOX_WIDTH+80 ); - aMinCheckboxSize.AdjustWidth(80 ); - } - - // #104492# auto mnemonics for CJK strings may increase the length, so measure the - // checkbox length including a temporary mnemonic, the correct auto mnemonic will be - // generated later in the dialog (see init_show) - - OUString aMnemonicString( maCheckBoxText ); - if( GetSettings().GetStyleSettings().GetAutoMnemonic() ) - { - if( aMnemonicString == GetNonMnemonicString( maCheckBoxText ) ) - { - // no mnemonic found -> create one - MnemonicGenerator aMnemonicGenerator; - aMnemonicString = aMnemonicGenerator.CreateMnemonic( aMnemonicString ); - } - } - - mpCheckBox = VclPtr<CheckBox>::Create( this ); - mpCheckBox->Check( mbCheck ); - mpCheckBox->SetText( aMnemonicString ); - mpCheckBox->SetStyle( mpCheckBox->GetStyle() | WB_WORDBREAK ); - mpCheckBox->SetHelpId( GetHelpId() ); // DR: Check box and dialog have same HID - - // align checkbox with message text - Size aSize = mpCheckBox->CalcMinimumSize( aMinCheckboxSize.Width() ); - - // now set the original non-mnemonic string - mpCheckBox->SetText( maCheckBoxText ); - - Point aPos( aTextPos ); - aPos.AdjustY(aMEditSize.Height() + (IMPL_DIALOG_OFFSET)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2) ); - - // increase messagebox - aPageSize.AdjustHeight(aSize.Height() + (IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2) ); - - mpCheckBox->SetPosSizePixel( aPos, aSize ); - mpCheckBox->Show(); - } - mpVCLMultiLineEdit = VclPtr<VclMultiLineEdit>::Create( this, nWinStyle ); mpVCLMultiLineEdit->SetText( aMessText ); mpVCLMultiLineEdit->SetPosSizePixel( aTextPos, aMEditSize ); @@ -350,17 +297,6 @@ void MessBox::StateChanged( StateChangedType nType ) ButtonDialog::StateChanged( nType ); } -bool MessBox::GetCheckBoxState() const -{ - return mpCheckBox ? mpCheckBox->IsChecked() : mbCheck; -} - -void MessBox::SetCheckBoxState( bool bCheck ) -{ - if( mpCheckBox ) mpCheckBox->Check( bCheck ); - mbCheck = bCheck; -} - Size MessBox::GetOptimalSize() const { // FIXME: base me on the font size ? @@ -395,11 +331,6 @@ WarningBox::WarningBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits nWinB SetImage( WarningBox::GetStandardImage() ); } -void WarningBox::SetDefaultCheckBoxText() -{ - maCheckBoxText = VclResId(SV_STDTEXT_DONTWARNAGAIN); -} - Image const & WarningBox::GetStandardImage() { ImplInitMsgBoxImageList(); |