Kaydet (Commit) 8fb49ab6 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert email options to .ui format

Change-Id: Ie42117b21c4b6a37831462f34f3af52c7933d438
üst 75ece7ac
......@@ -40,6 +40,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/optadvancedpage \
cui/uiconfig/ui/optappearancepage \
cui/uiconfig/ui/optbrowserpage \
cui/uiconfig/ui/optemailpage \
cui/uiconfig/ui/optfltrpage \
cui/uiconfig/ui/optfontspage \
cui/uiconfig/ui/optgeneralpage \
......
......@@ -30,7 +30,6 @@
#define HID_OPTIONS_CHART_DEFCOLORS "CUI_HID_OPTIONS_CHART_DEFCOLORS"
#define HID_OPTIONS_CTL "CUI_HID_OPTIONS_CTL"
#define HID_OPTIONS_PROXY "CUI_HID_OPTIONS_PROXY"
#define HID_OPTIONS_MAIL "CUI_HID_OPTIONS_MAIL"
#define HID_OPTIONS_ASIAN_LAYOUT "CUI_HID_OPTIONS_ASIAN_LAYOUT"
#define HID_CLB_EDIT_MODULES_DICS "CUI_HID_CLB_EDIT_MODULES_DICS"
#define HID_CLB_EDIT_MODULES_MODULES "CUI_HID_CLB_EDIT_MODULES_MODULES"
......
......@@ -1247,37 +1247,16 @@ struct SvxEMailTabPage_Impl
MailerProgramCfg_Impl aMailConfig;
};
SvxEMailTabPage::SvxEMailTabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, CUI_RES( RID_SVXPAGE_INET_MAIL ), rSet),
aMailFL(this, CUI_RES(FL_MAIL )),
aMailerURLFI(this, CUI_RES(FI_MAILERURL )),
aMailerURLFT(this, CUI_RES(FT_MAILERURL )),
aMailerURLED(this, CUI_RES(ED_MAILERURL )),
aMailerURLPB(this, CUI_RES(PB_MAILERURL )),
m_sDefaultFilterName( CUI_RES(STR_DEFAULT_FILENAME )),
pImpl(new SvxEMailTabPage_Impl)
SvxEMailTabPage::SvxEMailTabPage(Window* pParent, const SfxItemSet& rSet)
: SfxTabPage( pParent, "OptEmailPage", "cui/ui/optemailpage.ui", rSet)
, pImpl(new SvxEMailTabPage_Impl)
{
FreeResource();
aMailerURLPB.SetClickHdl( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) );
// FixedText not wide enough?
long nTxtW = aMailerURLFT.GetCtrlTextWidth( aMailerURLFT.GetText() );
long nCtrlW = aMailerURLFT.GetSizePixel().Width();
if ( nTxtW >= nCtrlW )
{
long nDelta = Max( (long)10, nTxtW - nCtrlW );
// so FixedText wider
Size aNewSz = aMailerURLFT.GetSizePixel();
aNewSz.Width() += nDelta;
aMailerURLFT.SetSizePixel( aNewSz );
// and Edit smaller
aNewSz = aMailerURLED.GetSizePixel();
aNewSz.Width() -= nDelta;
Point aNewPt = aMailerURLED.GetPosPixel();
aNewPt.X() += nDelta;
aMailerURLED.SetPosSizePixel( aNewPt, aNewSz );
}
get(m_pMailContainer, "OptEmailPage");
get(m_pMailerURLFI, "lockemail");
get(m_pMailerURLED, "url");
get(m_pMailerURLPB, "browse");
m_sDefaultFilterName = get<FixedText>("browsetitle")->GetText();
m_pMailerURLPB->SetClickHdl( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) );
}
/* -------------------------------------------------------------------------*/
......@@ -1299,9 +1278,9 @@ SfxTabPage* SvxEMailTabPage::Create( Window* pParent, const SfxItemSet& rAttrSe
sal_Bool SvxEMailTabPage::FillItemSet( SfxItemSet& )
{
sal_Bool bMailModified = sal_False;
if(!pImpl->aMailConfig.bROProgram && aMailerURLED.GetSavedValue() != aMailerURLED.GetText())
if(!pImpl->aMailConfig.bROProgram && m_pMailerURLED->GetSavedValue() != m_pMailerURLED->GetText())
{
pImpl->aMailConfig.sProgram = aMailerURLED.GetText();
pImpl->aMailConfig.sProgram = m_pMailerURLED->GetText();
bMailModified = sal_True;
}
if ( bMailModified )
......@@ -1314,33 +1293,28 @@ sal_Bool SvxEMailTabPage::FillItemSet( SfxItemSet& )
void SvxEMailTabPage::Reset( const SfxItemSet& )
{
aMailerURLED.Enable(sal_True );
aMailerURLPB.Enable(sal_True );
m_pMailerURLED->Enable(sal_True );
m_pMailerURLPB->Enable(sal_True );
if(pImpl->aMailConfig.bROProgram)
aMailerURLFI.Show();
if (pImpl->aMailConfig.bROProgram)
m_pMailerURLFI->Show();
aMailerURLED.SetText(pImpl->aMailConfig.sProgram);
aMailerURLED.SaveValue();
aMailerURLED.Enable(!pImpl->aMailConfig.bROProgram);
aMailerURLPB.Enable(!pImpl->aMailConfig.bROProgram);
aMailerURLFT.Enable(!pImpl->aMailConfig.bROProgram);
m_pMailerURLED->SetText(pImpl->aMailConfig.sProgram);
m_pMailerURLED->SaveValue();
aMailFL.Enable(aMailerURLFT.IsEnabled() ||
aMailerURLED.IsEnabled() ||
aMailerURLPB.IsEnabled());
m_pMailContainer->Enable(!pImpl->aMailConfig.bROProgram);
}
/* -------------------------------------------------------------------------*/
IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, PushButton*, pButton )
{
if ( &aMailerURLPB == pButton && !pImpl->aMailConfig.bROProgram )
if (m_pMailerURLPB == pButton && !pImpl->aMailConfig.bROProgram)
{
FileDialogHelper aHelper(
com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
0 );
OUString sPath = aMailerURLED.GetText();
OUString sPath = m_pMailerURLED->GetText();
if ( sPath.isEmpty() )
sPath = OUString("/usr/bin");
......@@ -1353,7 +1327,7 @@ IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, PushButton*, pButton )
{
sUrl = aHelper.GetPath();
::utl::LocalFileHelper::ConvertURLToPhysicalName(sUrl, sPath);
aMailerURLED.SetText(sPath);
m_pMailerURLED->SetText(sPath);
}
}
return 0;
......
......@@ -215,13 +215,12 @@ public:
struct SvxEMailTabPage_Impl;
class SvxEMailTabPage : public SfxTabPage
{
FixedLine aMailFL;
ReadOnlyImage aMailerURLFI;
FixedText aMailerURLFT;
Edit aMailerURLED;
PushButton aMailerURLPB;
VclContainer* m_pMailContainer;
FixedImage* m_pMailerURLFI;
Edit* m_pMailerURLED;
PushButton* m_pMailerURLPB;
String m_sDefaultFilterName;
OUString m_sDefaultFilterName;
SvxEMailTabPage_Impl* pImpl;
......
......@@ -290,58 +290,4 @@ ModalDialog RID_SVXDLG_OPT_JAVASCRIPT_DISABLE
};
};
// *******************************************************************
TabPage RID_SVXPAGE_INET_MAIL
{
HelpID = HID_OPTIONS_MAIL ;
SVLook = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
Hide = TRUE ;
FixedLine FL_MAIL
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Sending documents as e-mail attachments";
};
FixedImage FI_MAILERURL
{
Pos = MAP_APPFONT ( 5 , 21 ) ;
Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE;
};
FixedText FT_MAILERURL
{
Pos = MAP_APPFONT ( 14 , 20 ) ;
Size = MAP_APPFONT ( 43 , 8 ) ;
Text [ en-US ] = "~E-mail program";
};
Edit ED_MAILERURL
{
HelpID = "cui:Edit:RID_SVXPAGE_INET_MAIL:ED_MAILERURL";
Pos = MAP_APPFONT ( 60 , 18 ) ;
Size = MAP_APPFONT ( 171 , 12 ) ;
Border = TRUE;
};
PushButton PB_MAILERURL
{
HelpID = "cui:PushButton:RID_SVXPAGE_INET_MAIL:PB_MAILERURL";
Pos = MAP_APPFONT ( 234 , 17 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
Text = "..." ;
};
String STR_DEFAULT_FILENAME
{
Text [ en-US ] = "All files" ;
};
};
// ******************************************************************* EOF
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkFrame" id="OptEmailPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="border_width">6</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_E-mail program</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">url</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="url">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
<property name="width_chars">32</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="browse">
<property name="label" translatable="yes">...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkImage" id="lockemail">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="pixbuf">res/lock.png</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="browsetitle">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">All files</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">4</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Sending documents as e-mail attachments</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment