diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-06 09:22:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-06 09:38:14 +0000 |
commit | e661d295c2643d6706a9b2040051445591880c46 (patch) | |
tree | 37b979375a3d3268e88819b7b0e706bb52a9dadd /desktop | |
parent | 5efc2a34a54327961bb393fcf07a562b90f462bd (diff) |
convert show extension licence dialog to .ui
Change-Id: I0e34a0ddaee1485184b55788d618288f4e3f69cb
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/UIConfig_deployment.mk | 1 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui.hrc | 1 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog.src | 31 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 40 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.hxx | 10 | ||||
-rw-r--r-- | desktop/uiconfig/ui/showlicensedialog.ui | 70 |
6 files changed, 82 insertions, 71 deletions
diff --git a/desktop/UIConfig_deployment.mk b/desktop/UIConfig_deployment.mk index f23136b3968f..cced1310328e 100644 --- a/desktop/UIConfig_deployment.mk +++ b/desktop/UIConfig_deployment.mk @@ -12,6 +12,7 @@ $(eval $(call gb_UIConfig_UIConfig,desktop)) $(eval $(call gb_UIConfig_add_uifiles,desktop,\ desktop/uiconfig/ui/cmdlinehelp \ desktop/uiconfig/ui/extensionmanager \ + desktop/uiconfig/ui/showlicensedialog \ )) # vim: set noet sw=4 ts=4: diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc index 9916c695f998..0238b24352bc 100644 --- a/desktop/source/deployment/gui/dp_gui.hrc +++ b/desktop/source/deployment/gui/dp_gui.hrc @@ -153,7 +153,6 @@ #define RID_WARNINGBOX_REMOVE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+104) #define RID_WARNINGBOX_ENABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+105) #define RID_WARNINGBOX_DISABLE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START+106) -#define RID_DLG_SHOW_LICENSE (RID_DEPLOYMENT_GUI_START+107) #define RID_DLG_LICENSE RID_DEPLOYMENT_LICENSE_START diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src index 4d523f7b592a..7669d8ba879e 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog.src +++ b/desktop/source/deployment/gui/dp_gui_dialog.src @@ -295,37 +295,6 @@ ModalDialog RID_DLG_LICENSE }; -ModalDialog RID_DLG_SHOW_LICENSE -{ - Text [ en-US ] = "Extension Software License Agreement"; - Size = MAP_APPFONT( 300, 200 ); - OutputSize = TRUE; - SVLook = TRUE; - Moveable = TRUE; - Closeable = TRUE; - Sizeable = TRUE; - - MultiLineEdit ML_LICENSE - { - Pos = MAP_APPFONT( 5, 5 ); - Size = MAP_APPFONT( 300 - 10, 200 - 15 - RSC_CD_PUSHBUTTON_HEIGHT ); - Border = TRUE; - VScroll = TRUE; - ReadOnly = TRUE; - }; - - OKButton RID_EM_BTN_CLOSE - { - TabStop = TRUE; - DefButton = TRUE; - Text [ en-US ] = "Close"; - Pos = MAP_APPFONT( (300-RSC_CD_PUSHBUTTON_WIDTH)/2, 200 - 5 - RSC_CD_PUSHBUTTON_HEIGHT ); - Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); - }; -}; - - - WarningBox RID_WARNINGBOX_INSTALL_EXTENSION { Buttons = WB_OK_CANCEL; DefButton = WB_DEF_OK; diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 6a90a9843529..16250ca4a027 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -167,7 +167,7 @@ ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl(Window* pParent) Size ExtBoxWithBtns_Impl::GetOptimalSize() const { - return LogicToPixel(Size(250, 150), MapMode(MAP_APPFONT)); + return LogicToPixel(Size(250, 150), MAP_APPFONT); } //------------------------------------------------------------------------------ @@ -1704,36 +1704,14 @@ void UpdateRequiredDialog::disableAllEntries() // ShowLicenseDialog //------------------------------------------------------------------------------ ShowLicenseDialog::ShowLicenseDialog( Window * pParent, - const uno::Reference< deployment::XPackage > &xPackage ) : - ModalDialog( pParent, DialogHelper::getResId( RID_DLG_SHOW_LICENSE ) ), - m_aLicenseText( this, DialogHelper::getResId( ML_LICENSE ) ), - m_aCloseBtn( this, DialogHelper::getResId( RID_EM_BTN_CLOSE ) ) -{ - FreeResource(); - - OUString aText = xPackage->getLicenseText(); - m_aLicenseText.SetText( aText ); -} - -//------------------------------------------------------------------------------ -ShowLicenseDialog::~ShowLicenseDialog() -{} - -//------------------------------------------------------------------------------ -void ShowLicenseDialog::Resize() -{ - Size aTotalSize( GetOutputSizePixel() ); - Size aTextSize( aTotalSize.Width() - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT, - aTotalSize.Height() - RSC_SP_DLG_INNERBORDER_TOP - 2*RSC_SP_DLG_INNERBORDER_BOTTOM - - m_aCloseBtn.GetSizePixel().Height() ); - - m_aLicenseText.SetPosSizePixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ), - aTextSize ); - - Point aBtnPos( (aTotalSize.Width() - m_aCloseBtn.GetSizePixel().Width())/2, - aTotalSize.Height() - RSC_SP_DLG_INNERBORDER_BOTTOM - - m_aCloseBtn.GetSizePixel().Height() ); - m_aCloseBtn.SetPosPixel( aBtnPos ); + const uno::Reference< deployment::XPackage > &xPackage ) + : ModalDialog(pParent, "ShowLicenseDialog", "desktop/ui/showlicensedialog.ui") +{ + get(m_pLicenseText, "textview"); + Size aSize(m_pLicenseText->LogicToPixel(Size(290, 170), MAP_APPFONT)); + m_pLicenseText->set_width_request(aSize.Width()); + m_pLicenseText->set_height_request(aSize.Height()); + m_pLicenseText->SetText(xPackage->getLicenseText()); } //================================================================================= diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index 369f99b8cc8b..05f78fccd555 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -242,15 +242,9 @@ public: //============================================================================== class ShowLicenseDialog : public ModalDialog { - MultiLineEdit m_aLicenseText; - OKButton m_aCloseBtn; - + VclMultiLineEdit* m_pLicenseText; public: - ShowLicenseDialog( Window * pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &xPackage ); - virtual ~ShowLicenseDialog(); - - virtual void Resize(); + ShowLicenseDialog(Window * pParent, const css::uno::Reference< css::deployment::XPackage > &xPackage); }; //============================================================================== diff --git a/desktop/uiconfig/ui/showlicensedialog.ui b/desktop/uiconfig/ui/showlicensedialog.ui new file mode 100644 index 000000000000..120a1e9df2f4 --- /dev/null +++ b/desktop/uiconfig/ui/showlicensedialog.ui @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="ShowLicenseDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Extension Software License Agreement</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="close"> + <property name="label">gtk-close</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">1</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="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="vscrollbar_policy">always</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTextView" id="textview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="editable">False</property> + </object> + </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">close</action-widget> + </action-widgets> + </object> +</interface> |