Kaydet (Commit) 0ec55639 authored tarafından Caolán McNamara's avatar Caolán McNamara

actually finish mail settings conversion to .ui

Change-Id: If5aa84fbd4582a0889df2bb000fa6b68c51977fd
üst d84b9742
...@@ -68,7 +68,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ ...@@ -68,7 +68,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/app/error.src \ sw/source/ui/app/error.src \
sw/source/ui/app/mn.src \ sw/source/ui/app/mn.src \
sw/source/ui/chrdlg/chrdlg.src \ sw/source/ui/chrdlg/chrdlg.src \
sw/source/ui/config/mailconfigpage.src \
sw/source/ui/config/optdlg.src \ sw/source/ui/config/optdlg.src \
sw/source/ui/config/optload.src \ sw/source/ui/config/optload.src \
sw/source/ui/dbui/createaddresslistdialog.src \ sw/source/ui/dbui/createaddresslistdialog.src \
......
...@@ -382,8 +382,6 @@ ...@@ -382,8 +382,6 @@
#define HID_MM_ASSIGNFIELDS "SW_HID_MM_ASSIGNFIELDS" #define HID_MM_ASSIGNFIELDS "SW_HID_MM_ASSIGNFIELDS"
#define HID_MM_LAYOUT_PAGE "SW_HID_MM_LAYOUT_PAGE" #define HID_MM_LAYOUT_PAGE "SW_HID_MM_LAYOUT_PAGE"
#define HID_MM_ADDRESSLIST_HB "SW_HID_MM_ADDRESSLIST_HB" #define HID_MM_ADDRESSLIST_HB "SW_HID_MM_ADDRESSLIST_HB"
#define HID_MM_TESTACCOUNTSETTINGS_TLB "SW_HID_MM_TESTACCOUNTSETTINGS_TLB"
#define HID_MM_TESTACCOUNTSETTINGS_HB "SW_HID_MM_TESTACCOUNTSETTINGS_HB"
#define HID_MM_MAILBODY "SW_HID_MM_MAILBODY" #define HID_MM_MAILBODY "SW_HID_MM_MAILBODY"
#define HID_MM_SENDMAILS "SW_HID_MM_SENDMAILS" #define HID_MM_SENDMAILS "SW_HID_MM_SENDMAILS"
#define HID_MM_SENDMAILS_STATUSLB "SW_HID_MM_SENDMAILS_STATUSLB" #define HID_MM_SENDMAILS_STATUSLB "SW_HID_MM_SENDMAILS_STATUSLB"
......
...@@ -21,13 +21,8 @@ ...@@ -21,13 +21,8 @@
#include "rcid.hrc" #include "rcid.hrc"
// dialogs for configuration
// strings for configuration // strings for configuration
#define DLG_MM_TESTACCOUNTSETTINGS (RC_CONFIG_BEGIN + 19)
#define STR_ARR_METRIC (RC_CONFIG_BEGIN + 26) #define STR_ARR_METRIC (RC_CONFIG_BEGIN + 26)
#define CONFIG_ACT_END STR_ARR_METRIC #define CONFIG_ACT_END STR_ARR_METRIC
...@@ -35,7 +30,6 @@ ...@@ -35,7 +30,6 @@
#error Resource-Id Ueberlauf in #file, #line #error Resource-Id Ueberlauf in #file, #line
#endif #endif
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <swmodule.hxx>
#include <swtypes.hxx> #include <swtypes.hxx>
#include <mailconfigpage.hxx> #include <mailconfigpage.hxx>
#include <sfx2/imgmgr.hxx>
#include <svtools/svmedit.hxx> #include <svtools/svmedit.hxx>
#include <svtools/stdctrl.hxx> #include <svtools/stdctrl.hxx>
#include <svtools/svtabbx.hxx> #include <svtools/svtabbx.hxx>
...@@ -33,7 +35,6 @@ ...@@ -33,7 +35,6 @@
#include "com/sun/star/mail/MailServiceProvider.hpp" #include "com/sun/star/mail/MailServiceProvider.hpp"
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
#include <globals.hrc> #include <globals.hrc>
#include <mailconfigpage.hrc>
#include <config.hrc> #include <config.hrc>
#include <helpid.h> #include <helpid.h>
...@@ -44,29 +45,22 @@ using namespace ::com::sun::star::beans; ...@@ -44,29 +45,22 @@ using namespace ::com::sun::star::beans;
class SwTestAccountSettingsDialog : public SfxModalDialog class SwTestAccountSettingsDialog : public SfxModalDialog
{ {
FixedInfo m_aInfoFI; VclMultiLineEdit* m_pErrorsED;
HeaderBar m_aStatusHB; PushButton* m_pStopPB;
SvTabListBox m_aStatusLB;
FixedInfo m_aErrorFI; FixedText* m_pEstablish;
MultiLineEdit m_eErrorsED; FixedText* m_pFind;
FixedText* m_pResult1;
FixedText* m_pResult2;
FixedImage* m_pImage1;
FixedImage* m_pImage2;
FixedLine m_aSeparatorFL; Image m_aCompletedImg;
PushButton m_aStopPB; Image m_aFailedImg;
CancelButton m_aCancelPB; OUString m_sCompleted;
HelpButton m_aHelpPB; OUString m_sFailed;
OUString m_sErrorServer;
ImageList m_aImageList;
String m_sTask ;
String m_sStatus ;
String m_sEstablish ;
String m_sFindServer ;
String m_sCompleted ;
String m_sFailed ;
String m_sErrorNetwork;
String m_sErrorServer ;
SwMailConfigPage* m_pParent; SwMailConfigPage* m_pParent;
...@@ -77,7 +71,6 @@ class SwTestAccountSettingsDialog : public SfxModalDialog ...@@ -77,7 +71,6 @@ class SwTestAccountSettingsDialog : public SfxModalDialog
DECL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*); DECL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*);
public: public:
SwTestAccountSettingsDialog(SwMailConfigPage* pParent); SwTestAccountSettingsDialog(SwMailConfigPage* pParent);
~SwTestAccountSettingsDialog();
}; };
class SwAuthenticationSettingsDialog : public SfxModalDialog class SwAuthenticationSettingsDialog : public SfxModalDialog
...@@ -217,74 +210,36 @@ IMPL_LINK_NOARG(SwMailConfigPage, TestHdl) ...@@ -217,74 +210,36 @@ IMPL_LINK_NOARG(SwMailConfigPage, TestHdl)
return 0; return 0;
} }
SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pParent) : SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pParent)
SfxModalDialog(pParent, SW_RES(DLG_MM_TESTACCOUNTSETTINGS)), : SfxModalDialog(pParent, "TestMailSettings", "modules/swriter/ui/testmailsettings.ui")
#ifdef _MSC_VER , m_pParent(pParent)
#pragma warning (disable : 4355) , m_bStop(false)
#endif
m_aInfoFI( this, SW_RES( FI_INFO )),
m_aStatusHB( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER),
m_aStatusLB( this, SW_RES( LB_STATUS )),
m_aErrorFI( this, SW_RES( FI_ERROR )),
m_eErrorsED( this, SW_RES( ED_ERROR )),
m_aSeparatorFL( this, SW_RES( FL_SEPAPARATOR )),
m_aStopPB( this, SW_RES( PB_STOP )),
m_aCancelPB( this, SW_RES( PB_CANCEL )),
m_aHelpPB( this, SW_RES( PB_HELP )),
#ifdef _MSC_VER
#pragma warning (default : 4355)
#endif
m_aImageList( SW_RES(ILIST) ),
m_sTask( SW_RES( ST_TASK )),
m_sStatus( SW_RES( ST_STATUS )),
m_sEstablish( SW_RES( ST_ESTABLISH )),
m_sFindServer( SW_RES( ST_FINDSERVER )),
m_sCompleted( SW_RES( ST_COMPLETED )),
m_sFailed( SW_RES( ST_FAILED )),
m_sErrorServer( SW_RES( ST_ERROR_SERVER )),
m_pParent(pParent),
m_bStop(false)
{ {
FreeResource(); get(m_pStopPB, "stop");
m_aStopPB.SetClickHdl(LINK(this, SwTestAccountSettingsDialog, StopHdl)); get(m_pErrorsED, "errors");
m_pErrorsED->SetMaxTextWidth(80 * m_pErrorsED->approximate_char_width());
Size aLBSize(m_aStatusLB.GetOutputSizePixel()); m_pErrorsED->set_height_request(8 * m_pErrorsED->GetTextHeight());
m_aStatusHB.SetSizePixel(aLBSize); m_sErrorServer = m_pErrorsED->GetText();
Size aHeadSize(m_aStatusHB.CalcWindowSizePixel()); m_pErrorsED->SetText("");
aHeadSize.Width() = aLBSize.Width(); get(m_pEstablish, "establish");
m_aStatusHB.SetSizePixel(aHeadSize); get(m_pFind, "find");
Point aLBPos(m_aStatusLB.GetPosPixel()); get(m_pImage1, "image1");
m_aStatusHB.SetPosPixel(aLBPos); get(m_pResult1, "result1");
aLBPos.Y() += aHeadSize.Height(); get(m_pImage2, "image2");
aLBSize.Height() -= aHeadSize.Height(); get(m_pResult2, "result2");
m_aStatusLB.SetPosSizePixel(aLBPos, aLBSize); m_sCompleted = m_pResult1->GetText();
m_sFailed = m_pResult2->GetText();
Size aSz(m_aStatusHB.GetOutputSizePixel());
m_aStatusHB.InsertItem( 1, m_sTask,
aSz.Width()/2, SfxImageManager* pManager = SfxImageManager::GetImageManager( SW_MOD() );
HIB_LEFT | HIB_VCENTER ); m_aFailedImg = pManager->GetImage(FN_FORMULA_CANCEL);
m_aStatusHB.InsertItem( 2, m_sStatus, m_aCompletedImg = pManager->GetImage(FN_FORMULA_APPLY);
aSz.Width()/2,
HIB_LEFT | HIB_VCENTER ); m_pStopPB->SetClickHdl(LINK(this, SwTestAccountSettingsDialog, StopHdl));
m_aStatusHB.SetHelpId(HID_MM_TESTACCOUNTSETTINGS_HB );
m_aStatusHB.Show();
m_aStatusLB.SetHelpId(HID_MM_TESTACCOUNTSETTINGS_TLB);
static long nTabs[] = {2, 0, aSz.Width()/2 };
m_aStatusLB.SetStyle( m_aStatusLB.GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
m_aStatusLB.SetSelectionMode( SINGLE_SELECTION );
m_aStatusLB.SetTabs(&nTabs[0], MAP_PIXEL);
short nEntryHeight = m_aStatusLB.GetEntryHeight();
m_aStatusLB.SetEntryHeight( nEntryHeight * 15 / 10 );
Application::PostUserEvent( STATIC_LINK( this, SwTestAccountSettingsDialog, TestHdl ), this ); Application::PostUserEvent( STATIC_LINK( this, SwTestAccountSettingsDialog, TestHdl ), this );
} }
SwTestAccountSettingsDialog::~SwTestAccountSettingsDialog()
{
}
IMPL_LINK_NOARG(SwTestAccountSettingsDialog, StopHdl) IMPL_LINK_NOARG(SwTestAccountSettingsDialog, StopHdl)
{ {
m_bStop = true; m_bStop = true;
...@@ -383,29 +338,18 @@ void SwTestAccountSettingsDialog::Test() ...@@ -383,29 +338,18 @@ void SwTestAccountSettingsDialog::Test()
sException = e.Message; sException = e.Message;
} }
Image aFailedImg = m_aImageList.GetImage( FN_FORMULA_CANCEL ); m_pResult1->SetText(bIsServer ? m_sCompleted : m_sFailed);
Image aCompletedImg = m_aImageList.GetImage( FN_FORMULA_APPLY ); m_pImage1->SetImage(bIsServer ? m_aCompletedImg : m_aFailedImg);
String sTmp(m_sEstablish);
sTmp += '\t';
sTmp += bIsServer ? m_sCompleted : m_sFailed;
m_aStatusLB.InsertEntry(sTmp,
bIsServer ? aCompletedImg : aFailedImg,
bIsServer ? aCompletedImg : aFailedImg);
sTmp = m_sFindServer; m_pResult2->SetText(bIsLoggedIn ? m_sCompleted : m_sFailed);
sTmp += '\t'; m_pImage2->SetImage(bIsLoggedIn ? m_aCompletedImg : m_aFailedImg);
sTmp += bIsLoggedIn ? m_sCompleted : m_sFailed;
m_aStatusLB.InsertEntry(sTmp,
bIsLoggedIn ? aCompletedImg : aFailedImg,
bIsLoggedIn ? aCompletedImg : aFailedImg);
if(!bIsServer || !bIsLoggedIn ) if (!bIsServer || !bIsLoggedIn)
{ {
OUStringBuffer aErrorMessage(m_sErrorServer); OUStringBuffer aErrorMessage(m_sErrorServer);
if (!sException.isEmpty()) if (!sException.isEmpty())
aErrorMessage.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n--\n")).append(sException); aErrorMessage.append("\n--\n").append(sException);
m_eErrorsED.SetText(aErrorMessage.makeStringAndClear()); m_pErrorsED->SetText(aErrorMessage.makeStringAndClear());
} }
} }
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _MAILCONFIGPAGE_HRC
#define _MAILCONFIGPAGE_HRC
#define FI_INFO 31
#define LB_STATUS 32
#define FI_ERROR 33
#define ED_ERROR 34
#define FL_SEPAPARATOR 35
#define PB_STOP 36
#define PB_CANCEL 37
#define PB_HELP 38
#define ST_TASK 39
#define ST_STATUS 40
#define ST_ESTABLISH 41
#define ST_FINDSERVER 42
#define ST_COMPLETED 43
#define ST_FAILED 44
#define ST_ERROR_SERVER 46
#define ILIST 47
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <mailconfigpage.hrc>
#include <config.hrc>
#include <helpid.h>
#include <cmdid.h>
#include <globals.hrc>
ModalDialog DLG_MM_TESTACCOUNTSETTINGS
{
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 250 , 176 ) ;
Moveable = TRUE ;
Text[ en-US ] = "Test Account Settings";
FixedText FI_INFO
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 238 , 8 ) ;
Text[ en-US ] = "%PRODUCTNAME is testing the e-mail account settings...";
};
Control LB_STATUS
{
Pos = MAP_APPFONT ( 6, 14 ) ;
Size = MAP_APPFONT ( 238 , 50 ) ;
Border = TRUE;
};
FixedText FI_ERROR
{
Pos = MAP_APPFONT ( 6 , 68 ) ;
Size = MAP_APPFONT ( 238 , 8 ) ;
Text[ en-US ] = "Errors";
};
MultiLineEdit ED_ERROR
{
HelpID = "sw:MultiLineEdit:DLG_MM_TESTACCOUNTSETTINGS:ED_ERROR";
Pos = MAP_APPFONT ( 6 , 79 ) ;
Size = MAP_APPFONT ( 238 , 60 ) ;
Border = TRUE;
Readonly = TRUE;
};
FixedLine FL_SEPAPARATOR
{
Pos = MAP_APPFONT ( 0 , 145 ) ;
Size = MAP_APPFONT ( 250 , 8 ) ;
};
PushButton PB_STOP
{
HelpID = "sw:PushButton:DLG_MM_TESTACCOUNTSETTINGS:PB_STOP";
Pos = MAP_APPFONT ( 85 , 156 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text[ en-US ] = "~Stop";
};
CancelButton PB_CANCEL
{
Pos = MAP_APPFONT ( 138 , 156 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
HelpButton PB_HELP
{
Pos = MAP_APPFONT ( 194 , 156 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
#define IMGLIST_IDS\
IdList = \
{ \
FN_FORMULA_CANCEL ;\
FN_FORMULA_APPLY ;\
}; \
IdCount = 2
ImageList ILIST
{
Prefix = "sc";
MaskColor = IMAGE_MASK_COLOR;
IMGLIST_IDS;
};
String ST_TASK
{
Text[ en-US ] = "Task";
};
String ST_STATUS
{
Text[ en-US ] = "Status";
};
String ST_ESTABLISH
{
Text[ en-US ] = "Establish network connection";
};
String ST_FINDSERVER
{
Text[ en-US ] = "Find outgoing mail server";
};
String ST_COMPLETED
{
Text[ en-US ] = "Successful";
};
String ST_FAILED
{
Text[ en-US ] = "Failed";
};
String ST_ERROR_SERVER
{
Text[ en-US ] = "%PRODUCTNAME could not connect to the outgoing mail server. Check your system's settings and the settings in %PRODUCTNAME. Check the server name, the port and the secure connections settings";
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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