summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-30 09:55:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-30 10:00:40 +0000
commit3103445754969aaf0fdf6c29ee0318228d74b266 (patch)
treef8378439db0ae436025f619d8456916abb11348c
parent92c8a8fc823e8a96fb3997386364652b759a31fa (diff)
convert view certs tabdialog to .ui
Change-Id: Iee67e273cf19a1af6c4947870bb9f131f0a6cc11
-rw-r--r--xmlsecurity/UIConfig_xmlsec.mk1
-rw-r--r--xmlsecurity/inc/xmlsecurity/certificateviewer.hxx7
-rw-r--r--xmlsecurity/inc/xmlsecurity/global.hrc1
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx25
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.src47
-rw-r--r--xmlsecurity/source/dialogs/helpids.hrc1
-rw-r--r--xmlsecurity/uiconfig/ui/viewcertdialog.ui118
7 files changed, 136 insertions, 64 deletions
diff --git a/xmlsecurity/UIConfig_xmlsec.mk b/xmlsecurity/UIConfig_xmlsec.mk
index 5bc39e9d1b18..fda420348361 100644
--- a/xmlsecurity/UIConfig_xmlsec.mk
+++ b/xmlsecurity/UIConfig_xmlsec.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UIConfig_add_uifiles,xmlsec,\
xmlsecurity/uiconfig/ui/securitytrustpage \
xmlsecurity/uiconfig/ui/selectcertificatedialog \
xmlsecurity/uiconfig/ui/macrosecuritydialog \
+ xmlsecurity/uiconfig/ui/viewcertdialog \
))
# vim: set noet sw=4 ts=4:
diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
index 540b1288a8e2..58771c98b21f 100644
--- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
+++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
@@ -46,9 +46,10 @@ private:
friend class CertificateViewerDetailsTP;
friend class CertificateViewerCertPathTP;
- TabControl maTabCtrl;
- OKButton maOkBtn;
- HelpButton maHelpBtn;
+ TabControl* mpTabCtrl;
+ sal_uInt16 mnGeneralId;
+ sal_uInt16 mnDetailsId;
+ sal_uInt16 mnPathId;
bool mbCheckForPrivateKey;
diff --git a/xmlsecurity/inc/xmlsecurity/global.hrc b/xmlsecurity/inc/xmlsecurity/global.hrc
index 7608d5cbe50c..f7a541dd06f4 100644
--- a/xmlsecurity/inc/xmlsecurity/global.hrc
+++ b/xmlsecurity/inc/xmlsecurity/global.hrc
@@ -22,7 +22,6 @@
// global resource ids
-#define RID_XMLSECDLG_CERTVIEWER 1002
#define RID_XMLSECTP_GENERAL 1003
#define RID_XMLSECTP_DETAILS 1004
#define RID_XMLSECTP_CERTPATH 1005
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index a1586d539f40..f9ef599e0102 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -46,29 +46,30 @@ CertificateViewer::CertificateViewer(
Window* _pParent,
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment,
const css::uno::Reference< css::security::XCertificate >& _rXCert, bool bCheckForPrivateKey )
- :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTVIEWER ) )
- ,maTabCtrl ( this, XMLSEC_RES( 1 ) )
- ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) )
- ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) )
+ : TabDialog(_pParent, "ViewCertDialog", "xmlsec/ui/viewcertdialog.ui" )
{
- FreeResource();
+ get(mpTabCtrl, "tabcontrol");
mbCheckForPrivateKey = bCheckForPrivateKey;
mxSecurityEnvironment = _rxSecurityEnvironment;
mxCert = _rXCert;
- maTabCtrl.SetTabPage( RID_XMLSECTP_GENERAL, new CertificateViewerGeneralTP( &maTabCtrl, this ) );
- maTabCtrl.SetTabPage( RID_XMLSECTP_DETAILS, new CertificateViewerDetailsTP( &maTabCtrl, this ) );
- maTabCtrl.SetTabPage( RID_XMLSECTP_CERTPATH, new CertificateViewerCertPathTP( &maTabCtrl, this ) );
- maTabCtrl.SetCurPageId( RID_XMLSECTP_GENERAL );
+ mnGeneralId = mpTabCtrl->GetPageId("general");
+ mnDetailsId = mpTabCtrl->GetPageId("details");
+ mnPathId = mpTabCtrl->GetPageId("path");
+
+ mpTabCtrl->SetTabPage(mnGeneralId, new CertificateViewerGeneralTP( mpTabCtrl, this));
+ mpTabCtrl->SetTabPage(mnDetailsId, new CertificateViewerDetailsTP( mpTabCtrl, this));
+ mpTabCtrl->SetTabPage(mnPathId, new CertificateViewerCertPathTP( mpTabCtrl, this));
+ mpTabCtrl->SetCurPageId(mnGeneralId);
}
CertificateViewer::~CertificateViewer()
{
- delete maTabCtrl.GetTabPage( RID_XMLSECTP_CERTPATH );
- delete maTabCtrl.GetTabPage( RID_XMLSECTP_DETAILS );
- delete maTabCtrl.GetTabPage( RID_XMLSECTP_GENERAL );
+ delete mpTabCtrl->GetTabPage(mnGeneralId);
+ delete mpTabCtrl->GetTabPage(mnDetailsId);
+ delete mpTabCtrl->GetTabPage(mnPathId);
}
CertificateViewerTP::CertificateViewerTP( Window* _pParent, const ResId& _rResId, CertificateViewer* _pDlg )
diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src
index a5a6778376e3..9deabd966189 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.src
+++ b/xmlsecurity/source/dialogs/certificateviewer.src
@@ -20,53 +20,6 @@
#include "dialogs.hrc"
#include "helpids.hrc"
-TabDialog RID_XMLSECDLG_CERTVIEWER
-{
- HelpID = HID_XMLSEC_DLG_CERTVIEWER;
- Size = MAP_APPFONT( TD_WIDTH, TD_HEIGHT );
- OutputSize = TRUE;
- Closeable = TRUE;
- Moveable = TRUE;
- SVLook = TRUE;
-
- Text [ en-US ] = "View Certificate";
- TabControl 1
- {
- Pos = MAP_APPFONT( TD_SP_INNERBORDER_LEFT, TD_SP_INNERBORDER_TOP );
- Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT+RIDDER_HEIGHT );
- SVLook = TRUE ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_XMLSECTP_GENERAL;
- Text [ en-US ] = "General";
- };
- PageItem
- {
- Identifier = RID_XMLSECTP_DETAILS;
- Text [ en-US ] = "Details";
- };
- PageItem
- {
- Identifier = RID_XMLSECTP_CERTPATH;
- Text [ en-US ] = "Certification Path";
- };
- };
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT( CV_COL_A, CV_ROW_A );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- DefButton = TRUE;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT( CV_COL_C, CV_ROW_A );
- Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
- };
-};
-
TabPage RID_XMLSECTP_GENERAL
{
HelpId = HID_XMLSEC_TP_GENERAL;
diff --git a/xmlsecurity/source/dialogs/helpids.hrc b/xmlsecurity/source/dialogs/helpids.hrc
index 9745f05c5439..88a772987d76 100644
--- a/xmlsecurity/source/dialogs/helpids.hrc
+++ b/xmlsecurity/source/dialogs/helpids.hrc
@@ -24,7 +24,6 @@
// Help-Ids --------------------------------------------------------------
-#define HID_XMLSEC_DLG_CERTVIEWER "XMLSECURITY_HID_XMLSEC_DLG_CERTVIEWER"
#define HID_XMLSEC_TP_GENERAL "XMLSECURITY_HID_XMLSEC_TP_GENERAL"
#define HID_XMLSEC_TP_DETAILS "XMLSECURITY_HID_XMLSEC_TP_DETAILS"
#define HID_XMLSEC_TP_CERTPATH "XMLSECURITY_HID_XMLSEC_TP_CERTPATH"
diff --git a/xmlsecurity/uiconfig/ui/viewcertdialog.ui b/xmlsecurity/uiconfig/ui/viewcertdialog.ui
new file mode 100644
index 000000000000..481fbbe07181
--- /dev/null
+++ b/xmlsecurity/uiconfig/ui/viewcertdialog.ui
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Thu Jan 30 09:59:07 2014 -->
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="ViewCertDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">View Certificate</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="tabcontrol">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="general">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">General</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="details">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Details</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="path">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Certification Path</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>