[Libreoffice-commits] core.git: 2 commits - cui/source cui/uiconfig
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 30 07:55:06 UTC 2019
cui/source/options/optctl.cxx | 111 +++++++---------
cui/source/options/optctl.hxx | 22 +--
cui/source/options/optgdlg.cxx | 268 ++++++++++++++++++-----------------------
cui/source/options/optgdlg.hxx | 57 ++++----
cui/uiconfig/ui/optctlpage.ui | 3
cui/uiconfig/ui/optviewpage.ui | 16 --
6 files changed, 208 insertions(+), 269 deletions(-)
New commits:
commit 16073ff56f792144bf262795869f7e5413eca8fc
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 29 20:01:09 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 30 09:52:54 2019 +0200
weld OfaViewTabPage
Change-Id: I259e10ad8bdf3d1630ab1d24590c43919a351a86
Reviewed-on: https://gerrit.libreoffice.org/76567
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index a1e6e777656c..32802f75a3ed 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -605,8 +605,8 @@ static bool DisplayNameCompareLessThan(const vcl::IconThemeInfo& rInfo1, const v
return rInfo1.GetDisplayName().compareTo(rInfo2.GetDisplayName()) < 0;
}
-OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
- : SfxTabPage(pParent, "OptViewPage", "cui/ui/optviewpage.ui", &rSet)
+OfaViewTabPage::OfaViewTabPage(TabPageParent pParent, const SfxItemSet& rSet)
+ : SfxTabPage(pParent, "cui/ui/optviewpage.ui", "OptViewPage", &rSet)
, nSizeLB_InitialSelection(0)
, nSidebarSizeLB_InitialSelection(0)
, nNotebookbarSizeLB_InitialSelection(0)
@@ -615,50 +615,48 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
, pCanvasSettings(new CanvasSettings)
, mpDrawinglayerOpt(new SvtOptionsDrawinglayer)
, mpOpenGLConfig(new svt::OpenGLCfg)
+ , m_xIconSizeLB(m_xBuilder->weld_combo_box("iconsize"))
+ , m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box("sidebariconsize"))
+ , m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box("notebookbariconsize"))
+ , m_xIconStyleLB(m_xBuilder->weld_combo_box("iconstyle"))
+ , m_xFontAntiAliasing(m_xBuilder->weld_check_button("aafont"))
+ , m_xAAPointLimitLabel(m_xBuilder->weld_label("aafrom"))
+ , m_xAAPointLimit(m_xBuilder->weld_metric_spin_button("aanf", FieldUnit::PIXEL))
+ , m_xMenuIconsLB(m_xBuilder->weld_combo_box("menuicons"))
+ , m_xContextMenuShortcutsLB(m_xBuilder->weld_combo_box("contextmenushortcuts"))
+ , m_xFontShowCB(m_xBuilder->weld_check_button("showfontpreview"))
+ , m_xUseHardwareAccell(m_xBuilder->weld_check_button("useaccel"))
+ , m_xUseAntiAliase(m_xBuilder->weld_check_button("useaa"))
+ , m_xUseOpenGL(m_xBuilder->weld_check_button("useopengl"))
+ , m_xForceOpenGL(m_xBuilder->weld_check_button("forceopengl"))
+ , m_xOpenGLStatusEnabled(m_xBuilder->weld_label("openglenabled"))
+ , m_xOpenGLStatusDisabled(m_xBuilder->weld_label("opengldisabled"))
+ , m_xMousePosLB(m_xBuilder->weld_combo_box("mousepos"))
+ , m_xMouseMiddleLB(m_xBuilder->weld_combo_box("mousemiddle"))
{
- get(m_pIconSizeLB, "iconsize");
- get(m_pSidebarIconSizeLB, "sidebariconsize");
- get(m_pNotebookbarIconSizeLB, "notebookbariconsize");
- get(m_pIconStyleLB, "iconstyle");
-
- get(m_pFontAntiAliasing, "aafont");
- get(m_pAAPointLimitLabel, "aafrom");
- get(m_pAAPointLimit, "aanf");
- get(m_pMenuIconsLB, "menuicons");
- get(m_pContextMenuShortcutsLB, "contextmenushortcuts");
- get(m_pFontShowCB, "showfontpreview");
- get(m_pUseHardwareAccell, "useaccel");
- get(m_pUseAntiAliase, "useaa");
- get(m_pUseOpenGL, "useopengl");
- get(m_pForceOpenGL, "forceopengl");
- get(m_pOpenGLStatusEnabled, "openglenabled");
- get(m_pOpenGLStatusDisabled, "opengldisabled");
- get(m_pMousePosLB, "mousepos");
- get(m_pMouseMiddleLB, "mousemiddle");
-
if (Application::GetToolkitName() == "gtk3")
{
- m_pUseOpenGL->Hide();
- m_pForceOpenGL->Hide();
- m_pOpenGLStatusEnabled->Hide();
- m_pOpenGLStatusDisabled->Hide();
+ m_xUseOpenGL->hide();
+ m_xForceOpenGL->hide();
+ m_xOpenGLStatusEnabled->hide();
+ m_xOpenGLStatusDisabled->hide();
}
#if defined( UNX )
- m_pFontAntiAliasing->SetToggleHdl( LINK( this, OfaViewTabPage, OnAntialiasingToggled ) );
+ m_xFontAntiAliasing->connect_toggled( LINK( this, OfaViewTabPage, OnAntialiasingToggled ) );
#else
// on this platform, we do not have the anti aliasing options
- m_pFontAntiAliasing->Hide();
- m_pAAPointLimitLabel->Hide();
- m_pAAPointLimit->Hide();
+ m_xFontAntiAliasing->hide();
+ m_xAAPointLimitLabel->hide();
+ m_xAAPointLimit->hide();
#endif
- m_pForceOpenGL->SetToggleHdl(LINK(this, OfaViewTabPage, OnForceOpenGLToggled));
+ m_xForceOpenGL->connect_toggled(LINK(this, OfaViewTabPage, OnForceOpenGLToggled));
// Set known icon themes
- OUString sAutoStr( m_pIconStyleLB->GetEntry( 0 ) );
- m_pIconStyleLB->Clear();
+ OUString sAutoStr( m_xIconStyleLB->get_text( 0 ) );
+ m_xIconStyleLB->clear();
StyleSettings aStyleSettings = Application::GetSettings().GetStyleSettings();
mInstalledIconThemes = aStyleSettings.GetInstalledIconThemes();
std::sort(mInstalledIconThemes.begin(), mInstalledIconThemes.end(), DisplayNameCompareLessThan);
@@ -670,77 +668,51 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
OUString entryForAuto = sAutoStr + " (" +
autoIconTheme.GetDisplayName() +
")";
- m_pIconStyleLB->InsertEntry(entryForAuto);
+ m_xIconStyleLB->append_text(entryForAuto);
+
+ // separate auto and other icon themes
+ m_xIconStyleLB->append_separator();
for (auto const& installIconTheme : mInstalledIconThemes)
- {
- m_pIconStyleLB->InsertEntry(installIconTheme.GetDisplayName());
- }
+ m_xIconStyleLB->append_text(installIconTheme.GetDisplayName());
- // separate auto and other icon themes
- m_pIconStyleLB->SetSeparatorPos( 0 );
- m_pIconStyleLB->SelectEntryPos(0);
+ m_xIconStyleLB->set_active(0);
// FIXME: should really add code to show a 'lock' icon here.
if (officecfg::Office::Common::VCL::UseOpenGL::isReadOnly())
- m_pUseOpenGL->Enable(false);
+ m_xUseOpenGL->set_sensitive(false);
if (officecfg::Office::Common::VCL::ForceOpenGL::isReadOnly())
- m_pForceOpenGL->Enable(false);
+ m_xForceOpenGL->set_sensitive(false);
UpdateOGLStatus();
}
OfaViewTabPage::~OfaViewTabPage()
{
- disposeOnce();
-}
-
-void OfaViewTabPage::dispose()
-{
- mpDrawinglayerOpt.reset();
- pCanvasSettings.reset();
- pAppearanceCfg.reset();
- m_pIconSizeLB.clear();
- m_pSidebarIconSizeLB.clear();
- m_pNotebookbarIconSizeLB.clear();
- m_pIconStyleLB.clear();
- m_pFontAntiAliasing.clear();
- m_pAAPointLimitLabel.clear();
- m_pAAPointLimit.clear();
- m_pMenuIconsLB.clear();
- m_pContextMenuShortcutsLB.clear();
- m_pFontShowCB.clear();
- m_pUseHardwareAccell.clear();
- m_pUseAntiAliase.clear();
- m_pUseOpenGL.clear();
- m_pForceOpenGL.clear();
- m_pOpenGLStatusEnabled.clear();
- m_pOpenGLStatusDisabled.clear();
- m_pMousePosLB.clear();
- m_pMouseMiddleLB.clear();
- SfxTabPage::dispose();
}
#if defined( UNX )
-IMPL_LINK_NOARG( OfaViewTabPage, OnAntialiasingToggled, CheckBox&, void )
+IMPL_LINK_NOARG( OfaViewTabPage, OnAntialiasingToggled, weld::ToggleButton&, void )
{
- bool bAAEnabled = m_pFontAntiAliasing->IsChecked();
+ bool bAAEnabled = m_xFontAntiAliasing->get_active();
- m_pAAPointLimitLabel->Enable( bAAEnabled );
- m_pAAPointLimit->Enable( bAAEnabled );
+ m_xAAPointLimitLabel->set_sensitive(bAAEnabled);
+ m_xAAPointLimit->set_sensitive(bAAEnabled);
}
#endif
-IMPL_LINK_NOARG(OfaViewTabPage, OnForceOpenGLToggled, CheckBox&, void)
+IMPL_LINK_NOARG(OfaViewTabPage, OnForceOpenGLToggled, weld::ToggleButton&, void)
{
- if (m_pForceOpenGL->IsChecked())
+ if (m_xForceOpenGL->get_active())
+ {
// Ignoring the opengl blacklist implies that opengl is on.
- m_pUseOpenGL->Check();
+ m_xUseOpenGL->set_active(true);
+ }
}
VclPtr<SfxTabPage> OfaViewTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<OfaViewTabPage>::Create(pParent.pParent, *rAttrSet);
+ return VclPtr<OfaViewTabPage>::Create(pParent, *rAttrSet);
}
bool OfaViewTabPage::FillItemSet( SfxItemSet* )
@@ -753,7 +725,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
bool bRepaintWindows(false);
SvtMiscOptions aMiscOptions;
- const sal_Int32 nSizeLB_NewSelection = m_pIconSizeLB->GetSelectedEntryPos();
+ const sal_Int32 nSizeLB_NewSelection = m_xIconSizeLB->get_active();
if( nSizeLB_InitialSelection != nSizeLB_NewSelection )
{
// from now on it's modified, even if via auto setting the same size was set as now selected in the LB
@@ -770,7 +742,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
aMiscOptions.SetSymbolsSize( eSet );
}
- const sal_Int32 nSidebarSizeLB_NewSelection = m_pSidebarIconSizeLB->GetSelectedEntryPos();
+ const sal_Int32 nSidebarSizeLB_NewSelection = m_xSidebarIconSizeLB->get_active();
if( nSidebarSizeLB_InitialSelection != nSidebarSizeLB_NewSelection )
{
// from now on it's modified, even if via auto setting the same size was set as now selected in the LB
@@ -786,7 +758,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
aMiscOptions.SetSidebarIconSize( eSet );
}
- const sal_Int32 nNotebookbarSizeLB_NewSelection = m_pNotebookbarIconSizeLB->GetSelectedEntryPos();
+ const sal_Int32 nNotebookbarSizeLB_NewSelection = m_xNotebookbarIconSizeLB->get_active();
if( nNotebookbarSizeLB_InitialSelection != nNotebookbarSizeLB_NewSelection )
{
// from now on it's modified, even if via auto setting the same size was set as now selected in the LB
@@ -797,12 +769,12 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
case 1: eSet = ToolBoxButtonSize::Small; break;
case 2: eSet = ToolBoxButtonSize::Large; break;
default:
- OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_pNotebookbarIconSizeLB should not be possible!" );
+ OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_xNotebookbarIconSizeLB should not be possible!" );
}
aMiscOptions.SetNotebookbarIconSize( eSet );
}
- const sal_Int32 nStyleLB_NewSelection = m_pIconStyleLB->GetSelectedEntryPos();
+ const sal_Int32 nStyleLB_NewSelection = m_xIconStyleLB->get_active();
if( nStyleLB_InitialSelection != nStyleLB_NewSelection )
{
// 0 means choose style automatically
@@ -810,7 +782,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
aMiscOptions.SetIconTheme("auto");
else
{
- const sal_Int32 pos = m_pIconStyleLB->GetSelectedEntryPos();
+ const sal_Int32 pos = m_xIconStyleLB->get_active();
const vcl::IconThemeInfo& iconThemeId = mInstalledIconThemes.at(pos-1);
aMiscOptions.SetIconTheme(iconThemeId.GetThemeId());
}
@@ -821,7 +793,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
// Mouse Snap Mode
SnapType eOldSnap = pAppearanceCfg->GetSnapMode();
- SnapType eNewSnap = static_cast<SnapType>(m_pMousePosLB->GetSelectedEntryPos());
+ SnapType eNewSnap = static_cast<SnapType>(m_xMousePosLB->get_active());
if(eNewSnap > SnapType::NONE)
eNewSnap = SnapType::NONE;
@@ -833,7 +805,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
// Middle Mouse Button
MouseMiddleButtonAction eOldMiddleMouse = pAppearanceCfg->GetMiddleMouseButton();
- short eNewMiddleMouse = m_pMouseMiddleLB->GetSelectedEntryPos();
+ short eNewMiddleMouse = m_xMouseMiddleLB->get_active();
if(eNewMiddleMouse > 2)
eNewMiddleMouse = 2;
@@ -844,71 +816,71 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
}
#if defined( UNX )
- if ( m_pFontAntiAliasing->IsValueChangedFromSaved() )
+ if (m_xFontAntiAliasing->get_state_changed_from_saved())
{
- pAppearanceCfg->SetFontAntiAliasing( m_pFontAntiAliasing->IsChecked() );
+ pAppearanceCfg->SetFontAntiAliasing(m_xFontAntiAliasing->get_active());
bAppearanceChanged = true;
}
- if ( m_pAAPointLimit->IsValueChangedFromSaved() )
+ if (m_xAAPointLimit->get_value_changed_from_saved())
{
- pAppearanceCfg->SetFontAntialiasingMinPixelHeight( m_pAAPointLimit->GetValue() );
+ pAppearanceCfg->SetFontAntialiasingMinPixelHeight(m_xAAPointLimit->get_value(FieldUnit::PIXEL));
bAppearanceChanged = true;
}
#endif
- if ( m_pFontShowCB->IsValueChangedFromSaved() )
+ if (m_xFontShowCB->get_state_changed_from_saved())
{
- aFontOpt.EnableFontWYSIWYG( m_pFontShowCB->IsChecked() );
+ aFontOpt.EnableFontWYSIWYG(m_xFontShowCB->get_active());
bModified = true;
}
- if(m_pMenuIconsLB->IsValueChangedFromSaved())
+ if (m_xMenuIconsLB->get_value_changed_from_saved())
{
- aMenuOpt.SetMenuIconsState(m_pMenuIconsLB->GetSelectedEntryPos() == 0 ?
+ aMenuOpt.SetMenuIconsState(m_xMenuIconsLB->get_active() == 0 ?
TRISTATE_INDET :
- static_cast<TriState>(m_pMenuIconsLB->GetSelectedEntryPos() - 1));
+ static_cast<TriState>(m_xMenuIconsLB->get_active() - 1));
bModified = true;
bMenuOptModified = true;
bAppearanceChanged = true;
}
- if(m_pContextMenuShortcutsLB->IsValueChangedFromSaved())
+ if (m_xContextMenuShortcutsLB->get_value_changed_from_saved())
{
- aMenuOpt.SetContextMenuShortcuts(m_pContextMenuShortcutsLB->GetSelectedEntryPos() == 0 ?
+ aMenuOpt.SetContextMenuShortcuts(m_xContextMenuShortcutsLB->get_active() == 0 ?
TRISTATE_INDET :
- static_cast<TriState>(m_pContextMenuShortcutsLB->GetSelectedEntryPos() - 1));
+ static_cast<TriState>(m_xContextMenuShortcutsLB->get_active() - 1));
bModified = true;
bMenuOptModified = true;
bAppearanceChanged = true;
}
// #i95644# if disabled, do not use value, see in ::Reset()
- if(m_pUseHardwareAccell->IsEnabled())
+ if (m_xUseHardwareAccell->get_sensitive())
{
- if(m_pUseHardwareAccell->IsValueChangedFromSaved())
+ if(m_xUseHardwareAccell->get_state_changed_from_saved())
{
- pCanvasSettings->EnabledHardwareAcceleration(m_pUseHardwareAccell->IsChecked());
+ pCanvasSettings->EnabledHardwareAcceleration(m_xUseHardwareAccell->get_active());
bModified = true;
}
}
// #i95644# if disabled, do not use value, see in ::Reset()
- if(m_pUseAntiAliase->IsEnabled())
+ if (m_xUseAntiAliase->get_sensitive())
{
- if(m_pUseAntiAliase->IsChecked() != mpDrawinglayerOpt->IsAntiAliasing())
+ if (m_xUseAntiAliase->get_active() != mpDrawinglayerOpt->IsAntiAliasing())
{
- mpDrawinglayerOpt->SetAntiAliasing(m_pUseAntiAliase->IsChecked());
+ mpDrawinglayerOpt->SetAntiAliasing(m_xUseAntiAliase->get_active());
bModified = true;
bRepaintWindows = true;
}
}
- if (m_pUseOpenGL->IsValueChangedFromSaved() ||
- m_pForceOpenGL->IsValueChangedFromSaved())
+ if (m_xUseOpenGL->get_state_changed_from_saved() ||
+ m_xForceOpenGL->get_state_changed_from_saved())
{
- mpOpenGLConfig->setUseOpenGL(m_pUseOpenGL->IsChecked());
- mpOpenGLConfig->setForceOpenGL(m_pForceOpenGL->IsChecked());
+ mpOpenGLConfig->setUseOpenGL(m_xUseOpenGL->get_active());
+ mpOpenGLConfig->setForceOpenGL(m_xForceOpenGL->get_active());
bModified = true;
}
@@ -939,8 +911,8 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
}
}
- if (m_pUseOpenGL->IsValueChangedFromSaved() ||
- m_pForceOpenGL->IsValueChangedFromSaved())
+ if (m_xUseOpenGL->get_state_changed_from_saved() ||
+ m_xForceOpenGL->get_state_changed_from_saved())
{
SolarMutexGuard aGuard;
if( svtools::executeRestartDialog(
@@ -966,8 +938,8 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
else if (aMiscOptions.GetSymbolsSize() == SFX_SYMBOLS_SIZE_32)
nSizeLB_InitialSelection = 3;
}
- m_pIconSizeLB->SelectEntryPos( nSizeLB_InitialSelection );
- m_pIconSizeLB->SaveValue();
+ m_xIconSizeLB->set_active( nSizeLB_InitialSelection );
+ m_xIconSizeLB->save_value();
if( aMiscOptions.GetSidebarIconSize() == ToolBoxButtonSize::DontCare )
; // do nothing
@@ -975,16 +947,16 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
nSidebarSizeLB_InitialSelection = 1;
else if( aMiscOptions.GetSidebarIconSize() == ToolBoxButtonSize::Large )
nSidebarSizeLB_InitialSelection = 2;
- m_pSidebarIconSizeLB->SelectEntryPos( nSidebarSizeLB_InitialSelection );
- m_pSidebarIconSizeLB->SaveValue();
+ m_xSidebarIconSizeLB->set_active( nSidebarSizeLB_InitialSelection );
+ m_xSidebarIconSizeLB->save_value();
if( aMiscOptions.GetNotebookbarIconSize() == ToolBoxButtonSize::DontCare )
; // do nothing
else if( aMiscOptions.GetNotebookbarIconSize() == ToolBoxButtonSize::Small )
nNotebookbarSizeLB_InitialSelection = 1;
else if( aMiscOptions.GetNotebookbarIconSize() == ToolBoxButtonSize::Large )
nNotebookbarSizeLB_InitialSelection = 2;
- m_pNotebookbarIconSizeLB->SelectEntryPos( nNotebookbarSizeLB_InitialSelection );
- m_pNotebookbarIconSizeLB->SaveValue();
+ m_xNotebookbarIconSizeLB->set_active(nNotebookbarSizeLB_InitialSelection);
+ m_xNotebookbarIconSizeLB->save_value();
if (aMiscOptions.IconThemeWasSetAutomatically()) {
nStyleLB_InitialSelection = 0;
@@ -993,79 +965,79 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
const OUString& selected = aMiscOptions.GetIconTheme();
const vcl::IconThemeInfo& selectedInfo =
vcl::IconThemeInfo::FindIconThemeById(mInstalledIconThemes, selected);
- nStyleLB_InitialSelection = m_pIconStyleLB->GetEntryPos(selectedInfo.GetDisplayName());
+ nStyleLB_InitialSelection = m_xIconStyleLB->find_text(selectedInfo.GetDisplayName());
}
- m_pIconStyleLB->SelectEntryPos( nStyleLB_InitialSelection );
- m_pIconStyleLB->SaveValue();
+ m_xIconStyleLB->set_active(nStyleLB_InitialSelection);
+ m_xIconStyleLB->save_value();
// Mouse Snap
- m_pMousePosLB->SelectEntryPos(static_cast<sal_Int32>(pAppearanceCfg->GetSnapMode()));
- m_pMousePosLB->SaveValue();
+ m_xMousePosLB->set_active(static_cast<sal_Int32>(pAppearanceCfg->GetSnapMode()));
+ m_xMousePosLB->save_value();
// Mouse Snap
- m_pMouseMiddleLB->SelectEntryPos(static_cast<short>(pAppearanceCfg->GetMiddleMouseButton()));
- m_pMouseMiddleLB->SaveValue();
+ m_xMouseMiddleLB->set_active(static_cast<short>(pAppearanceCfg->GetMiddleMouseButton()));
+ m_xMouseMiddleLB->save_value();
#if defined( UNX )
- m_pFontAntiAliasing->Check( pAppearanceCfg->IsFontAntiAliasing() );
- m_pAAPointLimit->SetValue( pAppearanceCfg->GetFontAntialiasingMinPixelHeight() );
+ m_xFontAntiAliasing->set_active( pAppearanceCfg->IsFontAntiAliasing() );
+ m_xAAPointLimit->set_value(pAppearanceCfg->GetFontAntialiasingMinPixelHeight(), FieldUnit::PIXEL);
#endif
// WorkingSet
SvtFontOptions aFontOpt;
- m_pFontShowCB->Check( aFontOpt.IsFontWYSIWYGEnabled() );
+ m_xFontShowCB->set_active( aFontOpt.IsFontWYSIWYGEnabled() );
SvtMenuOptions aMenuOpt;
- m_pMenuIconsLB->SelectEntryPos(aMenuOpt.GetMenuIconsState() == 2 ? 0 : aMenuOpt.GetMenuIconsState() + 1);
- m_pMenuIconsLB->SaveValue();
+ m_xMenuIconsLB->set_active(aMenuOpt.GetMenuIconsState() == 2 ? 0 : aMenuOpt.GetMenuIconsState() + 1);
+ m_xMenuIconsLB->save_value();
TriState eContextMenuShortcuts = aMenuOpt.GetContextMenuShortcuts();
bool bContextMenuShortcutsNonDefault = eContextMenuShortcuts == TRISTATE_FALSE || eContextMenuShortcuts == TRISTATE_TRUE;
- m_pContextMenuShortcutsLB->SelectEntryPos(bContextMenuShortcutsNonDefault ? eContextMenuShortcuts + 1 : 0);
- m_pContextMenuShortcutsLB->SaveValue();
+ m_xContextMenuShortcutsLB->set_active(bContextMenuShortcutsNonDefault ? eContextMenuShortcuts + 1 : 0);
+ m_xContextMenuShortcutsLB->save_value();
{ // #i95644# HW accel (unified to disable mechanism)
if(pCanvasSettings->IsHardwareAccelerationAvailable())
{
- m_pUseHardwareAccell->Check(pCanvasSettings->IsHardwareAccelerationEnabled());
- m_pUseHardwareAccell->Enable(!pCanvasSettings->IsHardwareAccelerationRO());
+ m_xUseHardwareAccell->set_active(pCanvasSettings->IsHardwareAccelerationEnabled());
+ m_xUseHardwareAccell->set_sensitive(!pCanvasSettings->IsHardwareAccelerationRO());
}
else
{
- m_pUseHardwareAccell->Check(false);
- m_pUseHardwareAccell->Disable();
+ m_xUseHardwareAccell->set_active(false);
+ m_xUseHardwareAccell->set_sensitive(false);
}
- m_pUseHardwareAccell->SaveValue();
+ m_xUseHardwareAccell->save_state();
}
{ // #i95644# AntiAliasing
if(mpDrawinglayerOpt->IsAAPossibleOnThisSystem())
{
- m_pUseAntiAliase->Check(mpDrawinglayerOpt->IsAntiAliasing());
+ m_xUseAntiAliase->set_active(mpDrawinglayerOpt->IsAntiAliasing());
}
else
{
- m_pUseAntiAliase->Check(false);
- m_pUseAntiAliase->Disable();
+ m_xUseAntiAliase->set_active(false);
+ m_xUseAntiAliase->set_sensitive(false);
}
- m_pUseAntiAliase->SaveValue();
+ m_xUseAntiAliase->save_state();
}
- m_pUseOpenGL->Check(mpOpenGLConfig->useOpenGL());
- m_pForceOpenGL->Check(mpOpenGLConfig->forceOpenGL());
+ m_xUseOpenGL->set_active(mpOpenGLConfig->useOpenGL());
+ m_xForceOpenGL->set_active(mpOpenGLConfig->forceOpenGL());
#if defined( UNX )
- m_pFontAntiAliasing->SaveValue();
- m_pAAPointLimit->SaveValue();
+ m_xFontAntiAliasing->save_state();
+ m_xAAPointLimit->save_value();
#endif
- m_pFontShowCB->SaveValue();
+ m_xFontShowCB->save_state();
- m_pUseOpenGL->SaveValue();
- m_pForceOpenGL->SaveValue();
+ m_xUseOpenGL->save_state();
+ m_xForceOpenGL->save_state();
#if defined( UNX )
- LINK( this, OfaViewTabPage, OnAntialiasingToggled ).Call( *m_pFontAntiAliasing );
+ OnAntialiasingToggled(*m_xFontAntiAliasing);
#endif
}
@@ -1079,8 +1051,8 @@ void OfaViewTabPage::UpdateOGLStatus()
#else
bool bEnabled = false;
#endif
- m_pOpenGLStatusEnabled->Show(bEnabled);
- m_pOpenGLStatusDisabled->Show(!bEnabled);
+ m_xOpenGLStatusEnabled->set_visible(bEnabled);
+ m_xOpenGLStatusDisabled->set_visible(!bEnabled);
}
struct LanguageConfig_Impl
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index c1ab0bc765af..e9d2666ec633 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -78,31 +78,6 @@ class SvtTabAppearanceCfg;
class OfaViewTabPage : public SfxTabPage
{
private:
- VclPtr<ListBox> m_pIconSizeLB;
- VclPtr<ListBox> m_pSidebarIconSizeLB;
- VclPtr<ListBox> m_pNotebookbarIconSizeLB;
- VclPtr<ListBox> m_pIconStyleLB;
-
- VclPtr<CheckBox> m_pFontAntiAliasing;
- VclPtr<FixedText> m_pAAPointLimitLabel;
- VclPtr<MetricField> m_pAAPointLimit;
-
- VclPtr<ListBox> m_pMenuIconsLB;
- VclPtr<ListBox> m_pContextMenuShortcutsLB;
-
- VclPtr<CheckBox> m_pFontShowCB;
-
- VclPtr<CheckBox> m_pUseHardwareAccell;
- VclPtr<CheckBox> m_pUseAntiAliase;
- VclPtr<CheckBox> m_pUseOpenGL;
- VclPtr<CheckBox> m_pForceOpenGL;
-
- VclPtr<FixedText> m_pOpenGLStatusEnabled;
- VclPtr<FixedText> m_pOpenGLStatusDisabled;
-
- VclPtr<ListBox> m_pMousePosLB;
- VclPtr<ListBox> m_pMouseMiddleLB;
-
sal_Int32 nSizeLB_InitialSelection;
sal_Int32 nSidebarSizeLB_InitialSelection;
sal_Int32 nNotebookbarSizeLB_InitialSelection;
@@ -115,16 +90,40 @@ private:
std::vector<vcl::IconThemeInfo> mInstalledIconThemes;
+ std::unique_ptr<weld::ComboBox> m_xIconSizeLB;
+ std::unique_ptr<weld::ComboBox> m_xSidebarIconSizeLB;
+ std::unique_ptr<weld::ComboBox> m_xNotebookbarIconSizeLB;
+ std::unique_ptr<weld::ComboBox> m_xIconStyleLB;
+
+ std::unique_ptr<weld::CheckButton> m_xFontAntiAliasing;
+ std::unique_ptr<weld::Label> m_xAAPointLimitLabel;
+ std::unique_ptr<weld::MetricSpinButton> m_xAAPointLimit;
+
+ std::unique_ptr<weld::ComboBox> m_xMenuIconsLB;
+ std::unique_ptr<weld::ComboBox> m_xContextMenuShortcutsLB;
+
+ std::unique_ptr<weld::CheckButton> m_xFontShowCB;
+
+ std::unique_ptr<weld::CheckButton> m_xUseHardwareAccell;
+ std::unique_ptr<weld::CheckButton> m_xUseAntiAliase;
+ std::unique_ptr<weld::CheckButton> m_xUseOpenGL;
+ std::unique_ptr<weld::CheckButton> m_xForceOpenGL;
+
+ std::unique_ptr<weld::Label> m_xOpenGLStatusEnabled;
+ std::unique_ptr<weld::Label> m_xOpenGLStatusDisabled;
+
+ std::unique_ptr<weld::ComboBox> m_xMousePosLB;
+ std::unique_ptr<weld::ComboBox> m_xMouseMiddleLB;
+
#if defined( UNX )
- DECL_LINK( OnAntialiasingToggled, CheckBox&, void );
+ DECL_LINK(OnAntialiasingToggled, weld::ToggleButton&, void);
#endif
- DECL_LINK(OnForceOpenGLToggled, CheckBox&, void);
+ DECL_LINK(OnForceOpenGLToggled, weld::ToggleButton&, void);
void UpdateOGLStatus();
public:
- OfaViewTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ OfaViewTabPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~OfaViewTabPage() override;
- virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui
index 0ab9a67a6d8d..d70643f6634e 100644
--- a/cui/uiconfig/ui/optviewpage.ui
+++ b/cui/uiconfig/ui/optviewpage.ui
@@ -1,14 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkAdjustment" id="adjustment1">
- <property name="lower">80</property>
- <property name="upper">400</property>
- <property name="value">100</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
<object class="GtkAdjustment" id="adjustment2">
<property name="lower">1</property>
<property name="upper">10000</property>
@@ -97,9 +90,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_underline">True</property>
<property name="tooltip_text" translatable="yes" context="optviewpage|forceopengl|tooltip_text">Requires restart. Enabling this may expose driver bugs</property>
<property name="margin_left">12</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
@@ -488,7 +481,7 @@
<property name="halign">start</property>
<property name="label" translatable="yes" context="optviewpage|aafrom">fro_m:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">aanf:0pixels</property>
+ <property name="mnemonic_widget">aanf</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -496,9 +489,10 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="aanf:0pixels">
+ <object class="GtkSpinButton" id="aanf">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment2</property>
</object>
<packing>
commit c673b171ba243dc96eb5ddedcb575b295d136310
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 29 17:04:16 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 30 09:51:57 2019 +0200
weld SvxCTLOptionsPage
Change-Id: I7b891e1a1d0ffc52cfd91a33fd01b3ec8ac2cd65
Reviewed-on: https://gerrit.libreoffice.org/76562
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx
index da78943bea33..e9e88d28d417 100644
--- a/cui/source/options/optctl.cxx
+++ b/cui/source/options/optctl.cxx
@@ -24,57 +24,38 @@
// class SvxCTLOptionsPage -----------------------------------------------------
-IMPL_LINK_NOARG(SvxCTLOptionsPage, SequenceCheckingCB_Hdl, Button*, void)
+IMPL_LINK_NOARG(SvxCTLOptionsPage, SequenceCheckingCB_Hdl, weld::Button&, void)
{
- bool bIsSequenceChecking = m_pSequenceCheckingCB->IsChecked();
- m_pRestrictedCB->Enable( bIsSequenceChecking );
- m_pTypeReplaceCB->Enable( bIsSequenceChecking );
+ bool bIsSequenceChecking = m_xSequenceCheckingCB->get_active();
+ m_xRestrictedCB->set_sensitive( bIsSequenceChecking );
+ m_xTypeReplaceCB->set_sensitive( bIsSequenceChecking );
// #i48117#: by default restricted and type&replace have to be switched on
- if(bIsSequenceChecking)
+ if (bIsSequenceChecking)
{
- m_pTypeReplaceCB->Check();
- m_pRestrictedCB->Check();
+ m_xTypeReplaceCB->set_active(true);
+ m_xRestrictedCB->set_active(true);
}
}
-SvxCTLOptionsPage::SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet ) :
-
- SfxTabPage( pParent, "OptCTLPage", "cui/ui/optctlpage.ui", &rSet )
-
+SvxCTLOptionsPage::SvxCTLOptionsPage(TabPageParent pParent, const SfxItemSet& rSet)
+ : SfxTabPage(pParent, "cui/ui/optctlpage.ui", "OptCTLPage", &rSet)
+ , m_xSequenceCheckingCB(m_xBuilder->weld_check_button("sequencechecking"))
+ , m_xRestrictedCB(m_xBuilder->weld_check_button("restricted"))
+ , m_xTypeReplaceCB(m_xBuilder->weld_check_button("typeandreplace"))
+ , m_xMovementLogicalRB(m_xBuilder->weld_radio_button("movementlogical"))
+ , m_xMovementVisualRB(m_xBuilder->weld_radio_button("movementvisual"))
+ , m_xNumeralsLB(m_xBuilder->weld_combo_box("numerals"))
{
- get( m_pSequenceCheckingCB, "sequencechecking");
- get( m_pRestrictedCB, "restricted");
- get( m_pTypeReplaceCB, "typeandreplace");
-
- get( m_pMovementLogicalRB, "movementlogical");
- get( m_pMovementVisualRB, "movementvisual");
-
- get( m_pNumeralsLB, "numerals");
-
- m_pSequenceCheckingCB->SetClickHdl( LINK( this, SvxCTLOptionsPage, SequenceCheckingCB_Hdl ) );
-
- m_pNumeralsLB->SetDropDownLineCount( m_pNumeralsLB->GetEntryCount() );
+ m_xSequenceCheckingCB->connect_clicked(LINK(this, SvxCTLOptionsPage, SequenceCheckingCB_Hdl));
}
SvxCTLOptionsPage::~SvxCTLOptionsPage()
{
- disposeOnce();
-}
-
-void SvxCTLOptionsPage::dispose()
-{
- m_pSequenceCheckingCB.clear();
- m_pRestrictedCB.clear();
- m_pTypeReplaceCB.clear();
- m_pMovementLogicalRB.clear();
- m_pMovementVisualRB.clear();
- m_pNumeralsLB.clear();
- SfxTabPage::dispose();
}
VclPtr<SfxTabPage> SvxCTLOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SvxCTLOptionsPage>::Create( pParent.pParent, *rAttrSet );
+ return VclPtr<SvxCTLOptionsPage>::Create( pParent, *rAttrSet );
}
bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
@@ -83,29 +64,29 @@ bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
SvtCTLOptions aCTLOptions;
// Sequence checking
- bool bChecked = m_pSequenceCheckingCB->IsChecked();
- if ( m_pSequenceCheckingCB->IsValueChangedFromSaved() )
+ bool bChecked = m_xSequenceCheckingCB->get_active();
+ if ( m_xSequenceCheckingCB->get_state_changed_from_saved() )
{
aCTLOptions.SetCTLSequenceChecking( bChecked );
bModified = true;
}
- bChecked = m_pRestrictedCB->IsChecked();
- if( m_pRestrictedCB->IsValueChangedFromSaved() )
+ bChecked = m_xRestrictedCB->get_active();
+ if( m_xRestrictedCB->get_state_changed_from_saved() )
{
aCTLOptions.SetCTLSequenceCheckingRestricted( bChecked );
bModified = true;
}
- bChecked = m_pTypeReplaceCB->IsChecked();
- if( m_pTypeReplaceCB->IsValueChangedFromSaved())
+ bChecked = m_xTypeReplaceCB->get_active();
+ if( m_xTypeReplaceCB->get_state_changed_from_saved())
{
aCTLOptions.SetCTLSequenceCheckingTypeAndReplace(bChecked);
bModified = true;
}
- bool bLogicalChecked = m_pMovementLogicalRB->IsChecked();
- if ( m_pMovementLogicalRB->IsValueChangedFromSaved() ||
- m_pMovementVisualRB->IsValueChangedFromSaved() )
+ bool bLogicalChecked = m_xMovementLogicalRB->get_active();
+ if ( m_xMovementLogicalRB->get_state_changed_from_saved() ||
+ m_xMovementVisualRB->get_state_changed_from_saved() )
{
SvtCTLOptions::CursorMovement eMovement =
bLogicalChecked ? SvtCTLOptions::MOVEMENT_LOGICAL : SvtCTLOptions::MOVEMENT_VISUAL;
@@ -113,9 +94,9 @@ bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
bModified = true;
}
- if ( m_pNumeralsLB->IsValueChangedFromSaved() )
+ if (m_xNumeralsLB->get_value_changed_from_saved())
{
- const sal_Int32 nPos = m_pNumeralsLB->GetSelectedEntryPos();
+ const sal_Int32 nPos = m_xNumeralsLB->get_active();
aCTLOptions.SetCTLTextNumerals( static_cast<SvtCTLOptions::TextNumerals>(nPos) );
bModified = true;
}
@@ -127,19 +108,19 @@ void SvxCTLOptionsPage::Reset( const SfxItemSet* )
{
SvtCTLOptions aCTLOptions;
- m_pSequenceCheckingCB->Check( aCTLOptions.IsCTLSequenceChecking() );
- m_pRestrictedCB->Check( aCTLOptions.IsCTLSequenceCheckingRestricted() );
- m_pTypeReplaceCB->Check( aCTLOptions.IsCTLSequenceCheckingTypeAndReplace() );
+ m_xSequenceCheckingCB->set_active( aCTLOptions.IsCTLSequenceChecking() );
+ m_xRestrictedCB->set_active( aCTLOptions.IsCTLSequenceCheckingRestricted() );
+ m_xTypeReplaceCB->set_active( aCTLOptions.IsCTLSequenceCheckingTypeAndReplace() );
SvtCTLOptions::CursorMovement eMovement = aCTLOptions.GetCTLCursorMovement();
switch ( eMovement )
{
case SvtCTLOptions::MOVEMENT_LOGICAL :
- m_pMovementLogicalRB->Check();
+ m_xMovementLogicalRB->set_active(true);
break;
case SvtCTLOptions::MOVEMENT_VISUAL :
- m_pMovementVisualRB->Check();
+ m_xMovementVisualRB->set_active(true);
break;
default:
@@ -147,19 +128,19 @@ void SvxCTLOptionsPage::Reset( const SfxItemSet* )
}
sal_uInt16 nPos = static_cast<sal_uInt16>(aCTLOptions.GetCTLTextNumerals());
- DBG_ASSERT( nPos < m_pNumeralsLB->GetEntryCount(), "SvxCTLOptionsPage::Reset(): invalid numerals enum" );
- m_pNumeralsLB->SelectEntryPos( nPos );
-
- m_pSequenceCheckingCB->SaveValue();
- m_pRestrictedCB->SaveValue();
- m_pTypeReplaceCB->SaveValue();
- m_pMovementLogicalRB->SaveValue();
- m_pMovementVisualRB->SaveValue();
- m_pNumeralsLB->SaveValue();
-
- bool bIsSequenceChecking = m_pSequenceCheckingCB->IsChecked();
- m_pRestrictedCB->Enable( bIsSequenceChecking );
- m_pTypeReplaceCB->Enable( bIsSequenceChecking );
+ DBG_ASSERT( nPos < m_xNumeralsLB->get_count(), "SvxCTLOptionsPage::Reset(): invalid numerals enum" );
+ m_xNumeralsLB->set_active(nPos);
+
+ m_xSequenceCheckingCB->save_state();
+ m_xRestrictedCB->save_state();
+ m_xTypeReplaceCB->save_state();
+ m_xMovementLogicalRB->save_state();
+ m_xMovementVisualRB->save_state();
+ m_xNumeralsLB->save_value();
+
+ bool bIsSequenceChecking = m_xSequenceCheckingCB->get_active();
+ m_xRestrictedCB->set_sensitive( bIsSequenceChecking );
+ m_xTypeReplaceCB->set_sensitive( bIsSequenceChecking );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optctl.hxx b/cui/source/options/optctl.hxx
index 29db016d3369..54dc5f7f6661 100644
--- a/cui/source/options/optctl.hxx
+++ b/cui/source/options/optctl.hxx
@@ -19,8 +19,6 @@
#ifndef INCLUDED_CUI_SOURCE_OPTIONS_OPTCTL_HXX
#define INCLUDED_CUI_SOURCE_OPTIONS_OPTCTL_HXX
-#include <vcl/button.hxx>
-#include <vcl/lstbox.hxx>
#include <sfx2/tabdlg.hxx>
// class SvxCTLOptionsPage -----------------------------------------------------
@@ -28,22 +26,18 @@
class SvxCTLOptionsPage : public SfxTabPage
{
private:
+ std::unique_ptr<weld::CheckButton> m_xSequenceCheckingCB;
+ std::unique_ptr<weld::CheckButton> m_xRestrictedCB;
+ std::unique_ptr<weld::CheckButton> m_xTypeReplaceCB;
+ std::unique_ptr<weld::RadioButton> m_xMovementLogicalRB;
+ std::unique_ptr<weld::RadioButton> m_xMovementVisualRB;
+ std::unique_ptr<weld::ComboBox> m_xNumeralsLB;
- VclPtr<CheckBox> m_pSequenceCheckingCB;
- VclPtr<CheckBox> m_pRestrictedCB;
- VclPtr<CheckBox> m_pTypeReplaceCB;
-
- VclPtr<RadioButton> m_pMovementLogicalRB;
- VclPtr<RadioButton> m_pMovementVisualRB;
-
- VclPtr<ListBox> m_pNumeralsLB;
-
- DECL_LINK( SequenceCheckingCB_Hdl, Button*, void );
+ DECL_LINK( SequenceCheckingCB_Hdl, weld::Button&, void );
public:
- SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ SvxCTLOptionsPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~SvxCTLOptionsPage() override;
- virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) override;
virtual void Reset( const SfxItemSet* rSet ) override;
diff --git a/cui/uiconfig/ui/optctlpage.ui b/cui/uiconfig/ui/optctlpage.ui
index 2bd91679cb0d..630cf3508b0a 100644
--- a/cui/uiconfig/ui/optctlpage.ui
+++ b/cui/uiconfig/ui/optctlpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkBox" id="OptCTLPage">
@@ -150,7 +150,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">movementvisual</property>
</object>
<packing>
<property name="left_attach">1</property>
More information about the Libreoffice-commits
mailing list