diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-30 09:15:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-30 11:39:33 +0200 |
commit | f67188df868d40aa81b58616c3702b9f81904119 (patch) | |
tree | 4284068e6af92919e2df02fa7761231af47c0296 /cui | |
parent | 5ba84c3c7080d55d86b8b39db077b6da36cb700a (diff) |
weld SvxProxyTabPage
Change-Id: I34651fc7c56da5205b349a83276d5efa536c4301
Reviewed-on: https://gerrit.libreoffice.org/76582
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optinet2.cxx | 282 | ||||
-rw-r--r-- | cui/source/options/optinet2.hxx | 60 | ||||
-rw-r--r-- | cui/uiconfig/ui/optproxypage.ui | 40 |
3 files changed, 166 insertions, 216 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index af3c497d44e8..a6476b60b950 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -122,53 +122,17 @@ bool isValidPort(OUString const & value) { } -VCL_BUILDER_FACTORY_ARGS(SvxNoSpaceEdit, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK) - -void SvxNoSpaceEdit::KeyInput( const KeyEvent& rKEvent ) -{ - bool bValid = rKEvent.GetKeyCode().GetCode() != KEY_SPACE; - if (bValid && bOnlyNumeric) - { - const vcl::KeyCode& rKeyCode = rKEvent.GetKeyCode(); - sal_uInt16 nGroup = rKeyCode.GetGroup(); - sal_uInt16 nKey = rKeyCode.GetCode(); - bValid = ( KEYGROUP_NUM == nGroup || KEYGROUP_CURSOR == nGroup || - ( KEYGROUP_MISC == nGroup && ( nKey < KEY_ADD || nKey > KEY_EQUAL ) ) ); - if ( !bValid && ( rKeyCode.IsMod1() && ( - KEY_A == nKey || KEY_C == nKey || KEY_V == nKey || KEY_X == nKey || KEY_Z == nKey ) ) ) - // Erase, Copy, Paste, Select All and Undo should work - bValid = true; - } - if (bValid) - Edit::KeyInput(rKEvent); -} - -void SvxNoSpaceEdit::Modify() +IMPL_LINK(SvxProxyTabPage, PortChangedHdl, weld::Entry&, rEdit, void) { - Edit::Modify(); - - if ( bOnlyNumeric ) + if (!isValidPort(rEdit.get_text())) { - if ( !isValidPort(GetText()) ) - { - std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(), - VclMessageType::Warning, VclButtonsType::Ok, - CuiResId( RID_SVXSTR_OPT_PROXYPORTS))); - xErrorBox->run(); - } + std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetDialogFrameWeld(), + VclMessageType::Warning, VclButtonsType::Ok, + CuiResId( RID_SVXSTR_OPT_PROXYPORTS))); + xErrorBox->run(); } } -bool SvxNoSpaceEdit::set_property(const OString &rKey, const OUString &rValue) -{ - if (rKey == "only-numeric") - bOnlyNumeric = toBool(rValue); - else - return Edit::set_property(rKey, rValue); - return true; -} - - static const char g_aProxyModePN[] = "ooInetProxyType"; static const char g_aHttpProxyPN[] = "ooInetHTTPProxyName"; static const char g_aHttpPortPN[] = "ooInetHTTPProxyPort"; @@ -178,42 +142,64 @@ static const char g_aFtpProxyPN[] = "ooInetFTPProxyName"; static const char g_aFtpPortPN[] = "ooInetFTPProxyPort"; static const char g_aNoProxyDescPN[] = "ooInetNoProxy"; +IMPL_STATIC_LINK(SvxProxyTabPage, NumberOnlyTextFilterHdl, OUString&, rTest, bool) +{ + OUStringBuffer sAllowed; + for (sal_Int32 i = 0, nLen = rTest.getLength(); i < nLen; ++i) + { + if (rTest[i] >= '0' && rTest[i] <= '9') + sAllowed.append(rTest[i]); + } + rTest = sAllowed.makeStringAndClear(); + return true; +} + +IMPL_STATIC_LINK(SvxProxyTabPage, NoSpaceTextFilterHdl, OUString&, rTest, bool) +{ + rTest = rTest.replaceAll(" ", ""); + return true; +} + /********************************************************************/ /* */ /* SvxProxyTabPage */ /* */ /********************************************************************/ - -SvxProxyTabPage::SvxProxyTabPage(vcl::Window* pParent, const SfxItemSet& rSet) - : SfxTabPage(pParent, "OptProxyPage","cui/ui/optproxypage.ui", &rSet) +SvxProxyTabPage::SvxProxyTabPage(TabPageParent pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "cui/ui/optproxypage.ui", "OptProxyPage", &rSet) + , m_xProxyModeLB(m_xBuilder->weld_combo_box("proxymode")) + , m_xHttpProxyFT(m_xBuilder->weld_label("httpft")) + , m_xHttpProxyED(m_xBuilder->weld_entry("http")) + , m_xHttpPortFT(m_xBuilder->weld_label("httpportft")) + , m_xHttpPortED(m_xBuilder->weld_entry("httpport")) + , m_xHttpsProxyFT(m_xBuilder->weld_label("httpsft")) + , m_xHttpsProxyED(m_xBuilder->weld_entry("https")) + , m_xHttpsPortFT(m_xBuilder->weld_label("httpsportft")) + , m_xHttpsPortED(m_xBuilder->weld_entry("httpsport")) + , m_xFtpProxyFT(m_xBuilder->weld_label("ftpft")) + , m_xFtpProxyED(m_xBuilder->weld_entry("ftp")) + , m_xFtpPortFT(m_xBuilder->weld_label("ftpportft")) + , m_xFtpPortED(m_xBuilder->weld_entry("ftpport")) + , m_xNoProxyForFT(m_xBuilder->weld_label("noproxyft")) + , m_xNoProxyForED(m_xBuilder->weld_entry("noproxy")) + , m_xNoProxyDescFT(m_xBuilder->weld_label("noproxydesc")) { - get(m_pProxyModeLB, "proxymode"); - - get(m_pHttpProxyFT, "httpft"); - get(m_pHttpProxyED, "http"); - get(m_pHttpPortFT, "httpportft"); - get(m_pHttpPortED, "httpport"); - - get(m_pHttpsProxyFT, "httpsft"); - get(m_pHttpsProxyED, "https"); - get(m_pHttpsPortFT, "httpsportft"); - get(m_pHttpsPortED, "httpsport"); - - get(m_pFtpProxyFT, "ftpft"); - get(m_pFtpProxyED, "ftp"); - get(m_pFtpPortFT, "ftpportft"); - get(m_pFtpPortED, "ftpport"); - - get(m_pNoProxyForFT, "noproxyft"); - get(m_pNoProxyForED, "noproxy"); - get(m_pNoProxyDescFT, "noproxydesc"); - - Link<Control&,void> aLink = LINK( this, SvxProxyTabPage, LoseFocusHdl_Impl ); - m_pHttpPortED->SetLoseFocusHdl( aLink ); - m_pHttpsPortED->SetLoseFocusHdl( aLink ); - m_pFtpPortED->SetLoseFocusHdl( aLink ); - - m_pProxyModeLB->SetSelectHdl(LINK( this, SvxProxyTabPage, ProxyHdl_Impl )); + m_xHttpProxyED->connect_insert_text(LINK(this, SvxProxyTabPage, NoSpaceTextFilterHdl)); + m_xHttpPortED->connect_insert_text(LINK(this, SvxProxyTabPage, NumberOnlyTextFilterHdl)); + m_xHttpPortED->connect_changed(LINK(this, SvxProxyTabPage, PortChangedHdl)); + m_xHttpsProxyED->connect_insert_text(LINK(this, SvxProxyTabPage, NoSpaceTextFilterHdl)); + m_xHttpsPortED->connect_insert_text(LINK(this, SvxProxyTabPage, NumberOnlyTextFilterHdl)); + m_xHttpsPortED->connect_changed(LINK(this, SvxProxyTabPage, PortChangedHdl)); + m_xFtpProxyED->connect_insert_text(LINK(this, SvxProxyTabPage, NoSpaceTextFilterHdl)); + m_xFtpPortED->connect_insert_text(LINK(this, SvxProxyTabPage, NumberOnlyTextFilterHdl)); + m_xFtpPortED->connect_changed(LINK(this, SvxProxyTabPage, PortChangedHdl)); + + Link<weld::Widget&,void> aLink = LINK( this, SvxProxyTabPage, LoseFocusHdl_Impl ); + m_xHttpPortED->connect_focus_out( aLink ); + m_xHttpsPortED->connect_focus_out( aLink ); + m_xFtpPortED->connect_focus_out( aLink ); + + m_xProxyModeLB->connect_changed(LINK( this, SvxProxyTabPage, ProxyHdl_Impl )); Reference< css::lang::XMultiServiceFactory > xConfigurationProvider( @@ -234,33 +220,11 @@ SvxProxyTabPage::SvxProxyTabPage(vcl::Window* pParent, const SfxItemSet& rSet) SvxProxyTabPage::~SvxProxyTabPage() { - disposeOnce(); -} - -void SvxProxyTabPage::dispose() -{ - m_pProxyModeLB.clear(); - m_pHttpProxyFT.clear(); - m_pHttpProxyED.clear(); - m_pHttpPortFT.clear(); - m_pHttpPortED.clear(); - m_pHttpsProxyFT.clear(); - m_pHttpsProxyED.clear(); - m_pHttpsPortFT.clear(); - m_pHttpsPortED.clear(); - m_pFtpProxyFT.clear(); - m_pFtpProxyED.clear(); - m_pFtpPortFT.clear(); - m_pFtpPortED.clear(); - m_pNoProxyForFT.clear(); - m_pNoProxyForED.clear(); - m_pNoProxyDescFT.clear(); - SfxTabPage::dispose(); } VclPtr<SfxTabPage> SvxProxyTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxProxyTabPage>::Create(pParent.pParent, *rAttrSet); + return VclPtr<SvxProxyTabPage>::Create(pParent, *rAttrSet); } void SvxProxyTabPage::ReadConfigData_Impl() @@ -273,42 +237,42 @@ void SvxProxyTabPage::ReadConfigData_Impl() if( xNameAccess->getByName(g_aProxyModePN) >>= nIntValue ) { - m_pProxyModeLB->SelectEntryPos( nIntValue ); + m_xProxyModeLB->set_active(nIntValue); } if( xNameAccess->getByName(g_aHttpProxyPN) >>= aStringValue ) { - m_pHttpProxyED->SetText( aStringValue ); + m_xHttpProxyED->set_text( aStringValue ); } if( xNameAccess->getByName(g_aHttpPortPN) >>= nIntValue ) { - m_pHttpPortED->SetText( OUString::number( nIntValue )); + m_xHttpPortED->set_text( OUString::number( nIntValue )); } if( xNameAccess->getByName(g_aHttpsProxyPN) >>= aStringValue ) { - m_pHttpsProxyED->SetText( aStringValue ); + m_xHttpsProxyED->set_text( aStringValue ); } if( xNameAccess->getByName(g_aHttpsPortPN) >>= nIntValue ) { - m_pHttpsPortED->SetText( OUString::number( nIntValue )); + m_xHttpsPortED->set_text( OUString::number( nIntValue )); } if( xNameAccess->getByName(g_aFtpProxyPN) >>= aStringValue ) { - m_pFtpProxyED->SetText( aStringValue ); + m_xFtpProxyED->set_text( aStringValue ); } if( xNameAccess->getByName(g_aFtpPortPN) >>= nIntValue ) { - m_pFtpPortED->SetText( OUString::number( nIntValue )); + m_xFtpPortED->set_text( OUString::number( nIntValue )); } if( xNameAccess->getByName(g_aNoProxyDescPN) >>= aStringValue ) { - m_pNoProxyForED->SetText( aStringValue ); + m_xNoProxyForED->set_text( aStringValue ); } } catch (const container::NoSuchElementException&) { @@ -333,37 +297,37 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl() if( xPropertyState->getPropertyDefault(g_aHttpProxyPN) >>= aStringValue ) { - m_pHttpProxyED->SetText( aStringValue ); + m_xHttpProxyED->set_text( aStringValue ); } if( xPropertyState->getPropertyDefault(g_aHttpPortPN) >>= nIntValue ) { - m_pHttpPortED->SetText( OUString::number( nIntValue )); + m_xHttpPortED->set_text( OUString::number( nIntValue )); } if( xPropertyState->getPropertyDefault(g_aHttpsProxyPN) >>= aStringValue ) { - m_pHttpsProxyED->SetText( aStringValue ); + m_xHttpsProxyED->set_text( aStringValue ); } if( xPropertyState->getPropertyDefault(g_aHttpsPortPN) >>= nIntValue ) { - m_pHttpsPortED->SetText( OUString::number( nIntValue )); + m_xHttpsPortED->set_text( OUString::number( nIntValue )); } if( xPropertyState->getPropertyDefault(g_aFtpProxyPN) >>= aStringValue ) { - m_pFtpProxyED->SetText( aStringValue ); + m_xFtpProxyED->set_text( aStringValue ); } if( xPropertyState->getPropertyDefault(g_aFtpPortPN) >>= nIntValue ) { - m_pFtpPortED->SetText( OUString::number( nIntValue )); + m_xFtpPortED->set_text( OUString::number( nIntValue )); } if( xPropertyState->getPropertyDefault(g_aNoProxyDescPN) >>= aStringValue ) { - m_pNoProxyForED->SetText( aStringValue ); + m_xNoProxyForED->set_text( aStringValue ); } } catch (const beans::UnknownPropertyException &) @@ -414,14 +378,14 @@ void SvxProxyTabPage::Reset(const SfxItemSet*) { ReadConfigData_Impl(); - m_pProxyModeLB->SaveValue(); - m_pHttpProxyED->SaveValue(); - m_pHttpPortED->SaveValue(); - m_pHttpsProxyED->SaveValue(); - m_pHttpsPortED->SaveValue(); - m_pFtpProxyED->SaveValue(); - m_pFtpPortED->SaveValue(); - m_pNoProxyForED->SaveValue(); + m_xProxyModeLB->save_value(); + m_xHttpProxyED->save_value(); + m_xHttpPortED->save_value(); + m_xHttpsProxyED->save_value(); + m_xHttpsPortED->save_value(); + m_xFtpProxyED->save_value(); + m_xFtpPortED->save_value(); + m_xNoProxyForED->save_value(); EnableControls_Impl(); } @@ -433,8 +397,8 @@ bool SvxProxyTabPage::FillItemSet(SfxItemSet* ) try { Reference< beans::XPropertySet > xPropertySet(m_xConfigurationUpdateAccess, UNO_QUERY_THROW ); - sal_Int32 nSelPos = m_pProxyModeLB->GetSelectedEntryPos(); - if(m_pProxyModeLB->IsValueChangedFromSaved()) + sal_Int32 nSelPos = m_xProxyModeLB->get_active(); + if(m_xProxyModeLB->get_value_changed_from_saved()) { if( nSelPos == 1 ) { @@ -446,45 +410,45 @@ bool SvxProxyTabPage::FillItemSet(SfxItemSet* ) bModified = true; } - if(m_pHttpProxyED->IsValueChangedFromSaved()) + if(m_xHttpProxyED->get_value_changed_from_saved()) { - xPropertySet->setPropertyValue( g_aHttpProxyPN, Any(m_pHttpProxyED->GetText())); + xPropertySet->setPropertyValue( g_aHttpProxyPN, Any(m_xHttpProxyED->get_text())); bModified = true; } - if ( m_pHttpPortED->IsValueChangedFromSaved()) + if ( m_xHttpPortED->get_value_changed_from_saved()) { - xPropertySet->setPropertyValue( g_aHttpPortPN, Any(m_pHttpPortED->GetText().toInt32())); + xPropertySet->setPropertyValue( g_aHttpPortPN, Any(m_xHttpPortED->get_text().toInt32())); bModified = true; } - if( m_pHttpsProxyED->IsValueChangedFromSaved() ) + if( m_xHttpsProxyED->get_value_changed_from_saved() ) { - xPropertySet->setPropertyValue( g_aHttpsProxyPN, Any(m_pHttpsProxyED->GetText()) ); + xPropertySet->setPropertyValue( g_aHttpsProxyPN, Any(m_xHttpsProxyED->get_text()) ); bModified = true; } - if ( m_pHttpsPortED->IsValueChangedFromSaved() ) + if ( m_xHttpsPortED->get_value_changed_from_saved() ) { - xPropertySet->setPropertyValue( g_aHttpsPortPN, Any(m_pHttpsPortED->GetText().toInt32()) ); + xPropertySet->setPropertyValue( g_aHttpsPortPN, Any(m_xHttpsPortED->get_text().toInt32()) ); bModified = true; } - if( m_pFtpProxyED->IsValueChangedFromSaved()) + if( m_xFtpProxyED->get_value_changed_from_saved()) { - xPropertySet->setPropertyValue( g_aFtpProxyPN, Any(m_pFtpProxyED->GetText()) ); + xPropertySet->setPropertyValue( g_aFtpProxyPN, Any(m_xFtpProxyED->get_text()) ); bModified = true; } - if ( m_pFtpPortED->IsValueChangedFromSaved() ) + if ( m_xFtpPortED->get_value_changed_from_saved() ) { - xPropertySet->setPropertyValue( g_aFtpPortPN, Any(m_pFtpPortED->GetText().toInt32())); + xPropertySet->setPropertyValue( g_aFtpPortPN, Any(m_xFtpPortED->get_text().toInt32())); bModified = true; } - if ( m_pNoProxyForED->IsValueChangedFromSaved() ) + if ( m_xNoProxyForED->get_value_changed_from_saved() ) { - xPropertySet->setPropertyValue( g_aNoProxyDescPN, Any( m_pNoProxyForED->GetText())); + xPropertySet->setPropertyValue( g_aNoProxyDescPN, Any( m_xNoProxyForED->get_text())); bModified = true; } @@ -512,41 +476,40 @@ bool SvxProxyTabPage::FillItemSet(SfxItemSet* ) void SvxProxyTabPage::EnableControls_Impl() { - m_pProxyModeLB->Enable(!officecfg::Inet::Settings::ooInetNoProxy::isReadOnly()); + m_xProxyModeLB->set_sensitive(!officecfg::Inet::Settings::ooInetNoProxy::isReadOnly()); - const bool bManualConfig = m_pProxyModeLB->GetSelectedEntryPos() == 2; + const bool bManualConfig = m_xProxyModeLB->get_active() == 2; const bool bHTTPProxyNameEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPProxyName::isReadOnly(); const bool bHTTPProxyPortEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPProxyPort::isReadOnly(); - m_pHttpProxyFT->Enable(bHTTPProxyNameEnabled); - m_pHttpProxyED->Enable(bHTTPProxyNameEnabled); - m_pHttpPortFT->Enable(bHTTPProxyPortEnabled); - m_pHttpPortED->Enable(bHTTPProxyPortEnabled); + m_xHttpProxyFT->set_sensitive(bHTTPProxyNameEnabled); + m_xHttpProxyED->set_sensitive(bHTTPProxyNameEnabled); + m_xHttpPortFT->set_sensitive(bHTTPProxyPortEnabled); + m_xHttpPortED->set_sensitive(bHTTPProxyPortEnabled); const bool bHTTPSProxyNameEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPSProxyName::isReadOnly(); const bool bHTTPSProxyPortEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPSProxyPort::isReadOnly(); - m_pHttpsProxyFT->Enable(bHTTPSProxyNameEnabled); - m_pHttpsProxyED->Enable(bHTTPSProxyNameEnabled); - m_pHttpsPortFT->Enable(bHTTPSProxyPortEnabled); - m_pHttpsPortED->Enable(bHTTPSProxyPortEnabled); + m_xHttpsProxyFT->set_sensitive(bHTTPSProxyNameEnabled); + m_xHttpsProxyED->set_sensitive(bHTTPSProxyNameEnabled); + m_xHttpsPortFT->set_sensitive(bHTTPSProxyPortEnabled); + m_xHttpsPortED->set_sensitive(bHTTPSProxyPortEnabled); const bool bFTPProxyNameEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetFTPProxyName::isReadOnly(); const bool bFTPProxyPortEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetFTPProxyPort::isReadOnly(); - m_pFtpProxyFT->Enable(bFTPProxyNameEnabled); - m_pFtpProxyED->Enable(bFTPProxyNameEnabled); - m_pFtpPortFT->Enable(bFTPProxyPortEnabled); - m_pFtpPortED->Enable(bFTPProxyPortEnabled); + m_xFtpProxyFT->set_sensitive(bFTPProxyNameEnabled); + m_xFtpProxyED->set_sensitive(bFTPProxyNameEnabled); + m_xFtpPortFT->set_sensitive(bFTPProxyPortEnabled); + m_xFtpPortED->set_sensitive(bFTPProxyPortEnabled); const bool bInetNoProxyEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetNoProxy::isReadOnly(); - m_pNoProxyForFT->Enable(bInetNoProxyEnabled); - m_pNoProxyForED->Enable(bInetNoProxyEnabled); - m_pNoProxyDescFT->Enable(bInetNoProxyEnabled); + m_xNoProxyForFT->set_sensitive(bInetNoProxyEnabled); + m_xNoProxyForED->set_sensitive(bInetNoProxyEnabled); + m_xNoProxyDescFT->set_sensitive(bInetNoProxyEnabled); } - -IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox&, rBox, void ) +IMPL_LINK(SvxProxyTabPage, ProxyHdl_Impl, weld::ComboBox&, rBox, void) { - sal_Int32 nPos = rBox.GetSelectedEntryPos(); + sal_Int32 nPos = rBox.get_active(); // Restore original system values if( nPos == 1 ) @@ -557,16 +520,13 @@ IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox&, rBox, void ) EnableControls_Impl(); } - -IMPL_STATIC_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Control&, rControl, void ) +IMPL_STATIC_LINK(SvxProxyTabPage, LoseFocusHdl_Impl, weld::Widget&, rControl, void) { - Edit* pEdit = static_cast<Edit*>(&rControl); - if ( !isValidPort(pEdit->GetText()) ) - pEdit->SetText( OUString('0') ); + weld::Entry* pEdit = dynamic_cast<weld::Entry*>(&rControl); + if (pEdit && !isValidPort(pEdit->get_text())) + pEdit->set_text(OUString('0')); } - - /********************************************************************/ /* */ /* SvxSecurityTabPage */ diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index dd75a3920ad0..b19cb2cd30f6 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -29,49 +29,31 @@ namespace svx { class SecurityOptionsDialog; } - -// class SvxNoSpaceEdit -------------------------------------------------- - -class SvxNoSpaceEdit : public Edit -{ -private: - bool bOnlyNumeric; -public: - SvxNoSpaceEdit(vcl::Window* pParent, WinBits nStyle) - : Edit(pParent, nStyle) - , bOnlyNumeric(false) - {} - virtual void KeyInput(const KeyEvent& rKEvent) override; - virtual void Modify() override; - virtual bool set_property(const OString &rKey, const OUString &rValue) override; -}; - // class SvxProxyTabPage ------------------------------------------------- - class SvxProxyTabPage : public SfxTabPage { private: - VclPtr<ListBox> m_pProxyModeLB; + std::unique_ptr<weld::ComboBox> m_xProxyModeLB; - VclPtr<FixedText> m_pHttpProxyFT; - VclPtr<SvxNoSpaceEdit> m_pHttpProxyED; - VclPtr<FixedText> m_pHttpPortFT; - VclPtr<SvxNoSpaceEdit> m_pHttpPortED; + std::unique_ptr<weld::Label> m_xHttpProxyFT; + std::unique_ptr<weld::Entry> m_xHttpProxyED; + std::unique_ptr<weld::Label> m_xHttpPortFT; + std::unique_ptr<weld::Entry> m_xHttpPortED; - VclPtr<FixedText> m_pHttpsProxyFT; - VclPtr<SvxNoSpaceEdit> m_pHttpsProxyED; - VclPtr<FixedText> m_pHttpsPortFT; - VclPtr<SvxNoSpaceEdit> m_pHttpsPortED; + std::unique_ptr<weld::Label> m_xHttpsProxyFT; + std::unique_ptr<weld::Entry> m_xHttpsProxyED; + std::unique_ptr<weld::Label> m_xHttpsPortFT; + std::unique_ptr<weld::Entry> m_xHttpsPortED; - VclPtr<FixedText> m_pFtpProxyFT; - VclPtr<SvxNoSpaceEdit> m_pFtpProxyED; - VclPtr<FixedText> m_pFtpPortFT; - VclPtr<SvxNoSpaceEdit> m_pFtpPortED; + std::unique_ptr<weld::Label> m_xFtpProxyFT; + std::unique_ptr<weld::Entry> m_xFtpProxyED; + std::unique_ptr<weld::Label> m_xFtpPortFT; + std::unique_ptr<weld::Entry> m_xFtpPortED; - VclPtr<FixedText> m_pNoProxyForFT; - VclPtr<Edit> m_pNoProxyForED; - VclPtr<FixedText> m_pNoProxyDescFT; + std::unique_ptr<weld::Label> m_xNoProxyForFT; + std::unique_ptr<weld::Entry> m_xNoProxyForED; + std::unique_ptr<weld::Label> m_xNoProxyDescFT; css::uno::Reference< css::uno::XInterface > m_xConfigurationUpdateAccess; @@ -80,13 +62,15 @@ private: void ReadConfigDefaults_Impl(); void RestoreConfigDefaults_Impl(); - DECL_LINK( ProxyHdl_Impl, ListBox&, void ); - DECL_STATIC_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Control&, void ); + DECL_LINK(PortChangedHdl, weld::Entry&, void); + DECL_STATIC_LINK(SvxProxyTabPage, NumberOnlyTextFilterHdl, OUString&, bool); + DECL_STATIC_LINK(SvxProxyTabPage, NoSpaceTextFilterHdl, OUString&, bool); + DECL_LINK(ProxyHdl_Impl, weld::ComboBox&, void); + DECL_STATIC_LINK(SvxProxyTabPage, LoseFocusHdl_Impl, weld::Widget&, void); public: - SvxProxyTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + SvxProxyTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxProxyTabPage() 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/optproxypage.ui b/cui/uiconfig/ui/optproxypage.ui index 6379c1842698..1b2d0c75af45 100644 --- a/cui/uiconfig/ui/optproxypage.ui +++ b/cui/uiconfig/ui/optproxypage.ui @@ -1,8 +1,7 @@ <?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"/> - <requires lib="LibreOffice" version="1.0"/> <object class="GtkFrame" id="OptProxyPage"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -28,10 +27,10 @@ <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="optproxypage|label2">Proxy s_erver:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">proxymode</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -39,11 +38,12 @@ </packing> </child> <child> - <object class="cuilo-SvxNoSpaceEdit" id="http"> + <object class="GtkEntry" id="http"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="left_attach">1</property> @@ -51,11 +51,12 @@ </packing> </child> <child> - <object class="cuilo-SvxNoSpaceEdit" id="https"> + <object class="GtkEntry" id="https"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="left_attach">1</property> @@ -63,11 +64,12 @@ </packing> </child> <child> - <object class="cuilo-SvxNoSpaceEdit" id="ftp"> + <object class="GtkEntry" id="ftp"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="left_attach">1</property> @@ -80,6 +82,7 @@ <property name="can_focus">True</property> <property name="valign">center</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="left_attach">1</property> @@ -87,13 +90,14 @@ </packing> </child> <child> - <object class="cuilo-SvxNoSpaceEdit" id="httpport"> + <object class="GtkEntry" id="httpport"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="max_length">5</property> + <property name="activates_default">True</property> <property name="width_chars">5</property> - <property name="only_numeric">True</property> + <property name="input_purpose">digits</property> </object> <packing> <property name="left_attach">3</property> @@ -101,13 +105,14 @@ </packing> </child> <child> - <object class="cuilo-SvxNoSpaceEdit" id="httpsport"> + <object class="GtkEntry" id="httpsport"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="max_length">5</property> + <property name="activates_default">True</property> <property name="width_chars">5</property> - <property name="only_numeric">True</property> + <property name="input_purpose">digits</property> </object> <packing> <property name="left_attach">3</property> @@ -115,13 +120,14 @@ </packing> </child> <child> - <object class="cuilo-SvxNoSpaceEdit" id="ftpport"> + <object class="GtkEntry" id="ftpport"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="valign">center</property> <property name="max_length">5</property> + <property name="activates_default">True</property> <property name="width_chars">5</property> - <property name="only_numeric">True</property> + <property name="input_purpose">digits</property> </object> <packing> <property name="left_attach">3</property> @@ -148,10 +154,10 @@ <object class="GtkLabel" id="httpft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="optproxypage|httpft">HT_TP proxy:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">http</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -175,10 +181,10 @@ <object class="GtkLabel" id="httpsft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="optproxypage|httpsft">HTTP_S proxy:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">https</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -189,10 +195,10 @@ <object class="GtkLabel" id="ftpft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="optproxypage|ftpft">_FTP proxy:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">ftp</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -203,10 +209,10 @@ <object class="GtkLabel" id="noproxyft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="optproxypage|noproxyft">_No proxy for:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">noproxy</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">0</property> @@ -243,8 +249,8 @@ <object class="GtkLabel" id="noproxydesc"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="optproxypage|noproxydesc">Separator ;</property> + <property name="xalign">0</property> </object> <packing> <property name="left_attach">2</property> |