diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-14 13:35:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-14 14:45:36 +0000 |
commit | a83517bd1b99c170e7d3b2fd59af3e85d983c756 (patch) | |
tree | 29524176648f15ade73896d1cef2368f243ec2af /cui/source/options | |
parent | 19abfaffe74b925e4428943d14187a7008797982 (diff) |
convert certificate path dialog to .ui format
Change-Id: Ifb711805a37f7cd49b6063c5d17aa7a3f5dcfdaa
Diffstat (limited to 'cui/source/options')
-rw-r--r-- | cui/source/options/certpath.cxx | 84 | ||||
-rw-r--r-- | cui/source/options/certpath.hrc | 52 | ||||
-rw-r--r-- | cui/source/options/certpath.hxx | 15 | ||||
-rw-r--r-- | cui/source/options/certpath.src | 90 |
4 files changed, 46 insertions, 195 deletions
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx index 8f2023dd95e9..2d55e4ed9bc5 100644 --- a/cui/source/options/certpath.cxx +++ b/cui/source/options/certpath.cxx @@ -16,7 +16,6 @@ #include <unotools/securityoptions.hxx> #include <cuires.hrc> #include "certpath.hxx" -#include "certpath.hrc" #include "dialmgr.hxx" #include <com/sun/star/mozilla/MozillaBootstrap.hpp> @@ -26,39 +25,37 @@ using namespace ::com::sun::star; -CertPathDialog::CertPathDialog( Window* pParent ) : - ModalDialog( pParent, CUI_RES( RID_SVXDLG_CERTPATH ) ) - , m_aCertPathFL ( this, CUI_RES( FL_CERTPATH ) ) - , m_aCertPathFT ( this, CUI_RES( FT_CERTPATH ) ) - , m_aCertPathListContainer( this, CUI_RES( LB_CERTPATH ) ) - , m_aCertPathList( m_aCertPathListContainer, WB_BORDER ) - , m_aAddBtn ( this, CUI_RES( PB_ADD ) ) - , m_aButtonsFL ( this, CUI_RES( FL_BUTTONS ) ) - , m_aOKBtn ( this, CUI_RES( PB_OK ) ) - , m_aCancelBtn ( this, CUI_RES( PB_CANCEL ) ) - , m_aHelpBtn ( this, CUI_RES( PB_HELP ) ) - , m_sAddDialogText(CUI_RESSTR(STR_ADDDLGTEXT)) - , m_sManual(CUI_RESSTR(STR_MANUAL)) +CertPathDialog::CertPathDialog(Window* pParent) + : ModalDialog(pParent, "CertDialog", "cui/ui/certdialog.ui") { + get(m_pOKBtn, "ok"); + get(m_pAddBtn, "add"); + get(m_pCertPathListContainer, "paths"); + Size aSize(LogicToPixel(Size(210, 60), MAP_APPFONT)); + m_pCertPathListContainer->set_width_request(aSize.Width()); + m_pCertPathListContainer->set_height_request(aSize.Height()); + m_pCertPathList = + new svx::SvxRadioButtonListBox(*m_pCertPathListContainer, 0); + m_sAddDialogText = get<FixedText>("certdir")->GetText(); + m_sManual = get<FixedText>("manual")->GetText(); + static long aStaticTabs[]= { 3, 0, 15, 75 }; - m_aCertPathList.SvSimpleTable::SetTabs( aStaticTabs ); + m_pCertPathList->SvSimpleTable::SetTabs( aStaticTabs ); - OUString sProfile(CUI_RESSTR(STR_PROFILE)); - OUString sDirectory(CUI_RESSTR(STR_DIRECTORY)); + OUString sProfile(get<FixedText>("profile")->GetText()); + OUString sDirectory(get<FixedText>("dir")->GetText()); OUStringBuffer sHeader; sHeader.append('\t').append(sProfile).append('\t').append(sDirectory); - m_aCertPathList.InsertHeaderEntry( sHeader.makeStringAndClear(), HEADERBAR_APPEND, HIB_LEFT ); - m_aCertPathList.SetCheckButtonHdl( LINK( this, CertPathDialog, CheckHdl_Impl ) ); - - m_aAddBtn.SetClickHdl( LINK( this, CertPathDialog, AddHdl_Impl ) ); - m_aOKBtn.SetClickHdl( LINK( this, CertPathDialog, OKHdl_Impl ) ); + m_pCertPathList->InsertHeaderEntry( sHeader.makeStringAndClear(), HEADERBAR_APPEND, HIB_LEFT ); + m_pCertPathList->SetCheckButtonHdl( LINK( this, CertPathDialog, CheckHdl_Impl ) ); - FreeResource(); + m_pAddBtn->SetClickHdl( LINK( this, CertPathDialog, AddHdl_Impl ) ); + m_pOKBtn->SetClickHdl( LINK( this, CertPathDialog, OKHdl_Impl ) ); try { @@ -83,7 +80,7 @@ CertPathDialog::CertPathDialog( Window* pParent ) : OUString sProfilePath = xMozillaBootstrap->getProfilePath( productTypes[i], profile ); OUStringBuffer sEntry; sEntry.append('\t').appendAscii(productNames[i]).append(':').append(profile).append('\t').append(sProfilePath); - SvTreeListEntry *pEntry = m_aCertPathList.InsertEntry(sEntry.makeStringAndClear()); + SvTreeListEntry *pEntry = m_pCertPathList->InsertEntry(sEntry.makeStringAndClear()); OUString* pCertPath = new OUString(sProfilePath); pEntry->SetUserData(pCertPath); } @@ -93,10 +90,10 @@ CertPathDialog::CertPathDialog( Window* pParent ) : { } - SvTreeListEntry *pEntry = m_aCertPathList.GetEntry(0); + SvTreeListEntry *pEntry = m_pCertPathList->GetEntry(0); if (pEntry) { - m_aCertPathList.SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); + m_pCertPathList->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); HandleCheckEntry(pEntry); } @@ -140,73 +137,74 @@ IMPL_LINK_NOARG(CertPathDialog, OKHdl_Impl) OUString CertPathDialog::getDirectory() const { - SvTreeListEntry* pEntry = m_aCertPathList.FirstSelected(); + SvTreeListEntry* pEntry = m_pCertPathList->FirstSelected(); void* pCertPath = pEntry ? pEntry->GetUserData() : NULL; return pCertPath ? *static_cast<OUString*>(pCertPath) : OUString(); } CertPathDialog::~CertPathDialog() { - SvTreeListEntry* pEntry = m_aCertPathList.First(); + SvTreeListEntry* pEntry = m_pCertPathList->First(); while (pEntry) { OUString* pCertPath = static_cast<OUString*>(pEntry->GetUserData()); delete pCertPath; - pEntry = m_aCertPathList.Next( pEntry ); + pEntry = m_pCertPathList->Next( pEntry ); } + delete m_pCertPathList; } IMPL_LINK( CertPathDialog, CheckHdl_Impl, SvSimpleTable *, pList ) { - SvTreeListEntry* pEntry = pList ? m_aCertPathList.GetEntry(m_aCertPathList.GetCurMousePoint()) - : m_aCertPathList.FirstSelected(); + SvTreeListEntry* pEntry = pList ? m_pCertPathList->GetEntry(m_pCertPathList->GetCurMousePoint()) + : m_pCertPathList->FirstSelected(); if (pEntry) - m_aCertPathList.HandleEntryChecked(pEntry); + m_pCertPathList->HandleEntryChecked(pEntry); return 0; } void CertPathDialog::HandleCheckEntry( SvTreeListEntry* _pEntry ) { - m_aCertPathList.Select( _pEntry, true ); - SvButtonState eState = m_aCertPathList.GetCheckButtonState( _pEntry ); + m_pCertPathList->Select( _pEntry, true ); + SvButtonState eState = m_pCertPathList->GetCheckButtonState( _pEntry ); if (SV_BUTTON_CHECKED == eState) { // uncheck the other entries - SvTreeListEntry* pEntry = m_aCertPathList.First(); + SvTreeListEntry* pEntry = m_pCertPathList->First(); while (pEntry) { if (pEntry != _pEntry) - m_aCertPathList.SetCheckButtonState(pEntry, SV_BUTTON_UNCHECKED); - pEntry = m_aCertPathList.Next(pEntry); + m_pCertPathList->SetCheckButtonState(pEntry, SV_BUTTON_UNCHECKED); + pEntry = m_pCertPathList->Next(pEntry); } } else - m_aCertPathList.SetCheckButtonState(_pEntry, SV_BUTTON_CHECKED); + m_pCertPathList->SetCheckButtonState(_pEntry, SV_BUTTON_CHECKED); } void CertPathDialog::AddCertPath(const OUString &rProfile, const OUString &rPath) { - SvTreeListEntry* pEntry = m_aCertPathList.First(); + SvTreeListEntry* pEntry = m_pCertPathList->First(); while (pEntry) { OUString* pCertPath = static_cast<OUString*>(pEntry->GetUserData()); //already exists, just select the original one if (pCertPath->equals(rPath)) { - m_aCertPathList.SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); + m_pCertPathList->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); HandleCheckEntry(pEntry); return; } - pEntry = m_aCertPathList.Next(pEntry); + pEntry = m_pCertPathList->Next(pEntry); } OUStringBuffer sEntry; sEntry.append('\t').append(rProfile).append('\t').append(rPath); - pEntry = m_aCertPathList.InsertEntry(sEntry.makeStringAndClear()); + pEntry = m_pCertPathList->InsertEntry(sEntry.makeStringAndClear()); OUString* pCertPath = new OUString(rPath); pEntry->SetUserData(pCertPath); - m_aCertPathList.SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); + m_pCertPathList->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); HandleCheckEntry(pEntry); } diff --git a/cui/source/options/certpath.hrc b/cui/source/options/certpath.hrc deleted file mode 100644 index b2c2ba48cb11..000000000000 --- a/cui/source/options/certpath.hrc +++ /dev/null @@ -1,52 +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/. - */ - -#ifndef _CUI_CERTPATH_HRC -#define _CUI_CERTPATH_HRC - -#define FL_CERTPATH 1 -#define FT_CERTPATH 2 -#define LB_CERTPATH 3 -#define PB_ADD 4 -#define FL_BUTTONS 5 -#define PB_OK 6 -#define PB_CANCEL 7 -#define PB_HELP 8 -#define STR_ADDDLGTEXT 9 -#define STR_MANUAL 10 -#define STR_PROFILE 11 -#define STR_DIRECTORY 12 - -#define DLG_WIDTH 260 - -#define COL_0 (RSC_SP_DLG_INNERBORDER_LEFT) -#define COL_1 (COL_0+RSC_SP_FLGR_SPACE_X) -#define COL_2 (COL_1+RSC_SP_CHK_TEXTINDENT) -#define COL_4 (DLG_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT) -#define COL_3 (COL_4-RSC_SP_FLGR_SPACE_X) - -#define COL_C (COL_4-RSC_CD_PUSHBUTTON_WIDTH) -#define COL_B (COL_C-RSC_SP_CTRL_X-RSC_CD_PUSHBUTTON_WIDTH) -#define COL_A (COL_B-RSC_SP_CTRL_GROUP_X-RSC_CD_PUSHBUTTON_WIDTH) - -#define CHECKBOX_WIDTH ((COL_3-COL_2-RSC_SP_CTRL_X)/2) - -#define ROW_0 (RSC_SP_DLG_INNERBORDER_TOP) -#define ROW_1 (ROW_0+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_2 (ROW_1+2*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_3 (ROW_2+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_4 (ROW_3+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_5 (ROW_4+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_6 (ROW_5+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_7 (ROW_6+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_8 (ROW_7+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_9 (ROW_8+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y) -#define ROW_10 (ROW_9+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_DLG_INNERBORDER_BOTTOM) - -#endif // #ifndef _CUI_CERTPATH_HRC diff --git a/cui/source/options/certpath.hxx b/cui/source/options/certpath.hxx index 8116b401cb19..a0630cf3663b 100644 --- a/cui/source/options/certpath.hxx +++ b/cui/source/options/certpath.hxx @@ -19,16 +19,11 @@ class CertPathDialog : public ModalDialog { private: - FixedLine m_aCertPathFL; - FixedText m_aCertPathFT; - SvSimpleTableContainer m_aCertPathListContainer; - svx::SvxRadioButtonListBox m_aCertPathList; - PushButton m_aAddBtn; - FixedLine m_aButtonsFL; - OKButton m_aOKBtn; - CancelButton m_aCancelBtn; - HelpButton m_aHelpBtn; - OUString m_sAddDialogText; + SvSimpleTableContainer* m_pCertPathListContainer; + svx::SvxRadioButtonListBox* m_pCertPathList; + PushButton* m_pAddBtn; + OKButton* m_pOKBtn; + OUString m_sAddDialogText; OUString m_sManual; DECL_LINK(CheckHdl_Impl, SvSimpleTable *); diff --git a/cui/source/options/certpath.src b/cui/source/options/certpath.src deleted file mode 100644 index 921017b87a07..000000000000 --- a/cui/source/options/certpath.src +++ /dev/null @@ -1,90 +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/. - */ - -#include <svtools/controldims.hrc> -#include "certpath.hrc" -#include <cuires.hrc> -#include "helpid.hrc" - -ModalDialog RID_SVXDLG_CERTPATH -{ - HelpID = HID_DLG_CERTPATH ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( DLG_WIDTH , ROW_10 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "Certificate Path" ; - FixedLine FL_CERTPATH - { - Pos = MAP_APPFONT ( COL_0 , ROW_0 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Certificate Path" ; - }; - FixedText FT_CERTPATH - { - Pos = MAP_APPFONT ( COL_1 , ROW_1 ) ; - Size = MAP_APPFONT ( COL_C - COL_1 - RSC_SP_FLGR_SPACE_X , ROW_2 - ROW_1 ) ; - Wordbreak = TRUE; - Text [ en-US ] = "Select or add the correct Network Security Services Certificate directory to use for digital signatures:" ; - }; - Control LB_CERTPATH - { - Pos = MAP_APPFONT ( COL_1 , ROW_2 ) ; - Size = MAP_APPFONT ( COL_C - COL_1 - RSC_SP_FLGR_SPACE_X, ROW_8 - ROW_2 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - PushButton PB_ADD - { - Pos = MAP_APPFONT ( COL_C , ROW_2 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - Text [ en-US ] = "~Add..." ; - }; - FixedLine FL_BUTTONS - { - Pos = MAP_APPFONT( 0, ROW_8 ); - Size = MAP_APPFONT( DLG_WIDTH, RSC_CD_FIXEDLINE_HEIGHT ); - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( COL_A , ROW_9 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( COL_B , ROW_9 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( COL_C , ROW_9 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; - String STR_ADDDLGTEXT - { - Text [ en-US ] = "Select a Certificate directory" ; - }; - String STR_MANUAL - { - Text [ en-US ] = "manual" ; - }; - String STR_PROFILE - { - Text [ en-US ] = "Profile" ; - }; - String STR_DIRECTORY - { - Text [ en-US ] = "Directory" ; - }; -}; |