summaryrefslogtreecommitdiffstats
path: root/sw/source/ui/config
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-18 20:46:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-19 09:55:12 +0100
commit0ec55639bee0bab05e55d97d83d30cd813db3039 (patch)
treea840287bebdeb60e8653cb88f78479d47d4fc812 /sw/source/ui/config
parentconvert sw/inc/swtable.hxx from String to OUString (diff)
downloadcore-0ec55639bee0bab05e55d97d83d30cd813db3039.tar.gz
core-0ec55639bee0bab05e55d97d83d30cd813db3039.zip
actually finish mail settings conversion to .ui
Change-Id: If5aa84fbd4582a0889df2bb000fa6b68c51977fd
Diffstat (limited to 'sw/source/ui/config')
-rw-r--r--sw/source/ui/config/config.hrc6
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx150
-rw-r--r--sw/source/ui/config/mailconfigpage.hrc41
-rw-r--r--sw/source/ui/config/mailconfigpage.src129
4 files changed, 47 insertions, 279 deletions
diff --git a/sw/source/ui/config/config.hrc b/sw/source/ui/config/config.hrc
index 5878018fd087..ee1da914ec9c 100644
--- a/sw/source/ui/config/config.hrc
+++ b/sw/source/ui/config/config.hrc
@@ -21,13 +21,8 @@
#include "rcid.hrc"
-// dialogs for configuration
-
// strings for configuration
-
-#define DLG_MM_TESTACCOUNTSETTINGS (RC_CONFIG_BEGIN + 19)
-
#define STR_ARR_METRIC (RC_CONFIG_BEGIN + 26)
#define CONFIG_ACT_END STR_ARR_METRIC
@@ -35,7 +30,6 @@
#error Resource-Id Ueberlauf in #file, #line
#endif
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 3467a1894d82..ea6408ca13af 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -17,8 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <swmodule.hxx>
#include <swtypes.hxx>
#include <mailconfigpage.hxx>
+#include <sfx2/imgmgr.hxx>
#include <svtools/svmedit.hxx>
#include <svtools/stdctrl.hxx>
#include <svtools/svtabbx.hxx>
@@ -33,7 +35,6 @@
#include "com/sun/star/mail/MailServiceProvider.hpp"
#include <vcl/msgbox.hxx>
#include <globals.hrc>
-#include <mailconfigpage.hrc>
#include <config.hrc>
#include <helpid.h>
@@ -44,29 +45,22 @@ using namespace ::com::sun::star::beans;
class SwTestAccountSettingsDialog : public SfxModalDialog
{
- FixedInfo m_aInfoFI;
+ VclMultiLineEdit* m_pErrorsED;
- HeaderBar m_aStatusHB;
- SvTabListBox m_aStatusLB;
+ PushButton* m_pStopPB;
- FixedInfo m_aErrorFI;
- MultiLineEdit m_eErrorsED;
+ FixedText* m_pEstablish;
+ FixedText* m_pFind;
+ FixedText* m_pResult1;
+ FixedText* m_pResult2;
+ FixedImage* m_pImage1;
+ FixedImage* m_pImage2;
- FixedLine m_aSeparatorFL;
- PushButton m_aStopPB;
- CancelButton m_aCancelPB;
- HelpButton m_aHelpPB;
-
- 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 ;
+ Image m_aCompletedImg;
+ Image m_aFailedImg;
+ OUString m_sCompleted;
+ OUString m_sFailed;
+ OUString m_sErrorServer;
SwMailConfigPage* m_pParent;
@@ -77,7 +71,6 @@ class SwTestAccountSettingsDialog : public SfxModalDialog
DECL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*);
public:
SwTestAccountSettingsDialog(SwMailConfigPage* pParent);
- ~SwTestAccountSettingsDialog();
};
class SwAuthenticationSettingsDialog : public SfxModalDialog
@@ -217,74 +210,36 @@ IMPL_LINK_NOARG(SwMailConfigPage, TestHdl)
return 0;
}
-SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pParent) :
- SfxModalDialog(pParent, SW_RES(DLG_MM_TESTACCOUNTSETTINGS)),
-#ifdef _MSC_VER
-#pragma warning (disable : 4355)
-#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)
+SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pParent)
+ : SfxModalDialog(pParent, "TestMailSettings", "modules/swriter/ui/testmailsettings.ui")
+ , m_pParent(pParent)
+ , m_bStop(false)
{
- FreeResource();
- m_aStopPB.SetClickHdl(LINK(this, SwTestAccountSettingsDialog, StopHdl));
-
- Size aLBSize(m_aStatusLB.GetOutputSizePixel());
- m_aStatusHB.SetSizePixel(aLBSize);
- Size aHeadSize(m_aStatusHB.CalcWindowSizePixel());
- aHeadSize.Width() = aLBSize.Width();
- m_aStatusHB.SetSizePixel(aHeadSize);
- Point aLBPos(m_aStatusLB.GetPosPixel());
- m_aStatusHB.SetPosPixel(aLBPos);
- aLBPos.Y() += aHeadSize.Height();
- aLBSize.Height() -= aHeadSize.Height();
- m_aStatusLB.SetPosSizePixel(aLBPos, aLBSize);
-
- Size aSz(m_aStatusHB.GetOutputSizePixel());
- m_aStatusHB.InsertItem( 1, m_sTask,
- aSz.Width()/2,
- HIB_LEFT | HIB_VCENTER );
- m_aStatusHB.InsertItem( 2, m_sStatus,
- aSz.Width()/2,
- HIB_LEFT | HIB_VCENTER );
-
- 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 );
+ get(m_pStopPB, "stop");
+ get(m_pErrorsED, "errors");
+ m_pErrorsED->SetMaxTextWidth(80 * m_pErrorsED->approximate_char_width());
+ m_pErrorsED->set_height_request(8 * m_pErrorsED->GetTextHeight());
+ m_sErrorServer = m_pErrorsED->GetText();
+ m_pErrorsED->SetText("");
+ get(m_pEstablish, "establish");
+ get(m_pFind, "find");
+ get(m_pImage1, "image1");
+ get(m_pResult1, "result1");
+ get(m_pImage2, "image2");
+ get(m_pResult2, "result2");
+ m_sCompleted = m_pResult1->GetText();
+ m_sFailed = m_pResult2->GetText();
+
+
+ SfxImageManager* pManager = SfxImageManager::GetImageManager( SW_MOD() );
+ m_aFailedImg = pManager->GetImage(FN_FORMULA_CANCEL);
+ m_aCompletedImg = pManager->GetImage(FN_FORMULA_APPLY);
+
+ m_pStopPB->SetClickHdl(LINK(this, SwTestAccountSettingsDialog, StopHdl));
Application::PostUserEvent( STATIC_LINK( this, SwTestAccountSettingsDialog, TestHdl ), this );
}
-SwTestAccountSettingsDialog::~SwTestAccountSettingsDialog()
-{
-}
-
IMPL_LINK_NOARG(SwTestAccountSettingsDialog, StopHdl)
{
m_bStop = true;
@@ -383,29 +338,18 @@ void SwTestAccountSettingsDialog::Test()
sException = e.Message;
}
- Image aFailedImg = m_aImageList.GetImage( FN_FORMULA_CANCEL );
- Image aCompletedImg = m_aImageList.GetImage( FN_FORMULA_APPLY );
-
- String sTmp(m_sEstablish);
- sTmp += '\t';
- sTmp += bIsServer ? m_sCompleted : m_sFailed;
- m_aStatusLB.InsertEntry(sTmp,
- bIsServer ? aCompletedImg : aFailedImg,
- bIsServer ? aCompletedImg : aFailedImg);
+ m_pResult1->SetText(bIsServer ? m_sCompleted : m_sFailed);
+ m_pImage1->SetImage(bIsServer ? m_aCompletedImg : m_aFailedImg);
- sTmp = m_sFindServer;
- sTmp += '\t';
- sTmp += bIsLoggedIn ? m_sCompleted : m_sFailed;
- m_aStatusLB.InsertEntry(sTmp,
- bIsLoggedIn ? aCompletedImg : aFailedImg,
- bIsLoggedIn ? aCompletedImg : aFailedImg);
+ m_pResult2->SetText(bIsLoggedIn ? m_sCompleted : m_sFailed);
+ m_pImage2->SetImage(bIsLoggedIn ? m_aCompletedImg : m_aFailedImg);
- if(!bIsServer || !bIsLoggedIn )
+ if (!bIsServer || !bIsLoggedIn)
{
OUStringBuffer aErrorMessage(m_sErrorServer);
if (!sException.isEmpty())
- aErrorMessage.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n--\n")).append(sException);
- m_eErrorsED.SetText(aErrorMessage.makeStringAndClear());
+ aErrorMessage.append("\n--\n").append(sException);
+ m_pErrorsED->SetText(aErrorMessage.makeStringAndClear());
}
}
diff --git a/sw/source/ui/config/mailconfigpage.hrc b/sw/source/ui/config/mailconfigpage.hrc
deleted file mode 100644
index 99b5b2921cf5..000000000000
--- a/sw/source/ui/config/mailconfigpage.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- 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: */
diff --git a/sw/source/ui/config/mailconfigpage.src b/sw/source/ui/config/mailconfigpage.src
deleted file mode 100644
index 11b1c91f82d6..000000000000
--- a/sw/source/ui/config/mailconfigpage.src
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- 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: */