From 6fd7f5b1c931051b9fff31436955c1c6af00d135 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 3 Jan 2014 14:38:01 +0000 Subject: convert import library dialog to .ui Change-Id: Iaedcbeb5618ece65692a9688ccb5c13aad1e6626 --- basctl/UIConfig_basicide.mk | 1 + basctl/inc/basidesh.hrc | 1 - basctl/inc/helpid.hrc | 1 - basctl/source/basicide/moduldl2.cxx | 20 +++ basctl/source/basicide/moduldlg.cxx | 25 +--- basctl/source/basicide/moduldlg.hxx | 39 +++-- basctl/source/basicide/moduldlg.src | 56 ------- basctl/uiconfig/basicide/ui/importlibdialog.ui | 195 +++++++++++++++++++++++++ extras/source/glade/libreoffice-catalog.xml.in | 3 + 9 files changed, 244 insertions(+), 97 deletions(-) create mode 100644 basctl/uiconfig/basicide/ui/importlibdialog.ui diff --git a/basctl/UIConfig_basicide.mk b/basctl/UIConfig_basicide.mk index 0a0263d12e16..21e52ee864bb 100644 --- a/basctl/UIConfig_basicide.mk +++ b/basctl/UIConfig_basicide.mk @@ -32,6 +32,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/BasicIDE,\ basctl/uiconfig/basicide/ui/basicmacrodialog \ basctl/uiconfig/basicide/ui/gotolinedialog \ basctl/uiconfig/basicide/ui/exportdialog \ + basctl/uiconfig/basicide/ui/importlibdialog \ basctl/uiconfig/basicide/ui/managebreakpoints \ basctl/uiconfig/basicide/ui/newlibdialog \ basctl/uiconfig/basicide/ui/organizedialog \ diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc index fbf22d45c830..6fdd05efe570 100644 --- a/basctl/inc/basidesh.hrc +++ b/basctl/inc/basidesh.hrc @@ -33,7 +33,6 @@ #define RID_TP_MODULS ( RID_BASICIDE_START + 37 ) #define RID_TP_LIBS ( RID_BASICIDE_START + 38 ) #define RID_TP_DLGS ( RID_BASICIDE_START + 39 ) -#define RID_DLG_LIBS ( RID_BASICIDE_START + 40 ) #define RID_POPUP_DLGED ( RID_BASICIDE_START + 62 ) #define RID_PRINTDLG_STRLIST ( RID_BASICIDE_START + 78 ) diff --git a/basctl/inc/helpid.hrc b/basctl/inc/helpid.hrc index 4d6c92b9187c..75aca8fbe564 100644 --- a/basctl/inc/helpid.hrc +++ b/basctl/inc/helpid.hrc @@ -26,7 +26,6 @@ #define HID_BASICIDE_MODULES_TREE "BASCTL_HID_BASICIDE_MODULES_TREE" #define HID_BASICIDE_LIBS_TREE "BASCTL_HID_BASICIDE_LIBS_TREE" -#define HID_BASICIDE_LIBSDLG_TREE "BASCTL_HID_BASICIDE_LIBSDLG_TREE" #define HID_BASICIDE_OBJECTCAT "BASCTL_HID_BASICIDE_OBJECTCAT" #define HID_BASICIDE_OBJCAT_SHOW "BASCTL_HID_BASICIDE_OBJCAT_SHOW" diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 9a4c1a1ff72c..4edc506747b5 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -173,6 +173,26 @@ CheckBox::CheckBox( Window* pParent, const ResId& rResId ) Init(); } +CheckBox::CheckBox(Window* pParent, WinBits nStyle) + : SvTabListBox(pParent, nStyle) + , eMode(ObjectMode::Module) + , m_aDocument(ScriptDocument::getApplicationScriptDocument()) +{ + long aTabs_[] = { 1, 12 }; // TabPos needs at least one... + // 12 because of the CheckBox + SetTabs( aTabs_ ); + Init(); +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeCheckBox(Window *pParent, VclBuilder::stringmap &rMap) +{ + WinBits nWinBits = WB_TABSTOP; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinBits |= WB_BORDER; + return new CheckBox(pParent, nWinBits); +} + //---------------------------------------------------------------------------- CheckBox::~CheckBox() diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index c6808c50a884..48bf93efbfb5 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -909,31 +909,22 @@ void ObjectPage::EndTabDialog( sal_uInt16 nRet ) pTabDlg->EndDialog( nRet ); } - LibDialog::LibDialog( Window* pParent ) - : ModalDialog( pParent, IDEResId( RID_DLG_LIBS ) ), - aOKButton( this, IDEResId( RID_PB_OK ) ), - aCancelButton( this, IDEResId( RID_PB_CANCEL ) ), - aStorageName( this, IDEResId( RID_FT_STORAGENAME ) ), - aLibBox( this, IDEResId( RID_CTRL_LIBS ) ), - aFixedLine( this, IDEResId( RID_FL_OPTIONS ) ), - aReferenceBox( this, IDEResId( RID_CB_REF ) ), - aReplaceBox( this, IDEResId( RID_CB_REPL ) ) -{ - SetText( IDE_RESSTR(RID_STR_APPENDLIBS) ); - FreeResource(); -} - - -LibDialog::~LibDialog() + : ModalDialog(pParent, "ImportLibDialog", "modules/BasicIDE/ui/importlibdialog.ui") { + get(m_pStorageFrame, "storageframe"); + get(m_pReferenceBox, "ref"); + get(m_pReplaceBox, "replace"); + get(m_pLibBox, "entries"); + m_pLibBox->set_height_request(m_pLibBox->GetTextHeight() * 8); + m_pLibBox->set_width_request(m_pLibBox->approximate_char_width() * 32); } void LibDialog::SetStorageName( const OUString& rName ) { OUString aName( IDE_RESSTR(RID_STR_FILENAME) ); aName += rName; - aStorageName.SetText( aName ); + m_pStorageFrame->set_label(aName); } // Helper function diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx index abd91fb07531..529e8406cdaf 100644 --- a/basctl/source/basicide/moduldlg.hxx +++ b/basctl/source/basicide/moduldlg.hxx @@ -23,18 +23,17 @@ #include #include -#include - +#include #include +#include #include -#include +#include +#include +#include #include #include #include -#include -#include - class SvxPasswordDialog; namespace basctl @@ -125,7 +124,8 @@ private: void Init(); public: - CheckBox( Window* pParent, const ResId& rResId ); + CheckBox(Window* pParent, const ResId& rResId); + CheckBox(Window* pParent, WinBits nStyle); ~CheckBox(); SvTreeListEntry* DoInsertEntry( const OUString& rStr, sal_uLong nPos = LISTBOX_APPEND ); @@ -147,29 +147,24 @@ public: class LibDialog: public ModalDialog { private: - OKButton aOKButton; - CancelButton aCancelButton; - FixedText aStorageName; - CheckBox aLibBox; - FixedLine aFixedLine; - ::CheckBox aReferenceBox; - ::CheckBox aReplaceBox; + VclFrame* m_pStorageFrame; + CheckBox* m_pLibBox; + ::CheckBox* m_pReferenceBox; + ::CheckBox* m_pReplaceBox; public: - LibDialog( Window* pParent ); - ~LibDialog(); + LibDialog( Window* pParent ); void SetStorageName( const OUString& rName ); - CheckBox& GetLibBox() { return aLibBox; } - bool IsReference() const { return aReferenceBox.IsChecked(); } - bool IsReplace() const { return aReplaceBox.IsChecked(); } + CheckBox& GetLibBox() { return *m_pLibBox; } + bool IsReference() const { return m_pReferenceBox->IsChecked(); } + bool IsReplace() const { return m_pReplaceBox->IsChecked(); } - void EnableReference (bool b) { aReferenceBox.Enable(b); } - void EnableReplace (bool b) { aReplaceBox.Enable(b); } + void EnableReference (bool b) { m_pReferenceBox->Enable(b); } + void EnableReplace (bool b) { m_pReplaceBox->Enable(b); } }; - class OrganizeDialog : public TabDialog { private: diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src index 885ee0699121..4e542116cfc9 100644 --- a/basctl/source/basicide/moduldlg.src +++ b/basctl/source/basicide/moduldlg.src @@ -215,62 +215,6 @@ TabPage RID_TP_LIBS TabStop = TRUE ; }; }; -ModalDialog RID_DLG_LIBS -{ - HelpId = "basctl:ModalDialog:RID_DLG_LIBS" ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 168 , 132 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - OKButton RID_PB_OK - { - Pos = MAP_APPFONT ( 112 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton RID_PB_CANCEL - { - Pos = MAP_APPFONT ( 112 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedText RID_FT_STORAGENAME - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - }; - Control RID_CTRL_LIBS - { - HelpID = HID_BASICIDE_LIBSDLG_TREE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 19 ) ; - Size = MAP_APPFONT ( 100 , 67 ) ; - TabStop = TRUE ; - }; - FixedLine RID_FL_OPTIONS - { - Pos = MAP_APPFONT ( 6 , 89 ) ; - Size = MAP_APPFONT ( 156 , 8 ) ; - Text [ en-US ] = "Options" ; - }; - CheckBox RID_CB_REF - { - HelpID = "basctl:CheckBox:RID_DLG_LIBS:RID_CB_REF"; - Pos = MAP_APPFONT ( 12 , 100 ) ; - Size = MAP_APPFONT ( 146 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Insert as reference (read-only)" ; - }; - CheckBox RID_CB_REPL - { - HelpID = "basctl:CheckBox:RID_DLG_LIBS:RID_CB_REPL"; - Pos = MAP_APPFONT ( 12 , 113 ) ; - Size = MAP_APPFONT ( 146 , 10 ) ; - Text [ en-US ] = "Replace existing libraries" ; - }; -}; String RID_STR_EXPORTPACKAGE { diff --git a/basctl/uiconfig/basicide/ui/importlibdialog.ui b/basctl/uiconfig/basicide/ui/importlibdialog.ui new file mode 100644 index 000000000000..9d145fe0ff51 --- /dev/null +++ b/basctl/uiconfig/basicide/ui/importlibdialog.ui @@ -0,0 +1,195 @@ + + + + + + False + 6 + Import Libraries + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + False + True + end + 0 + + + + + True + False + 12 + + + True + False + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + + + Insert as reference (read-only) + True + True + False + True + 0 + True + + + 0 + 0 + 1 + 1 + + + + + Replace existing libraries + True + True + False + True + 0 + True + + + 0 + 1 + 1 + 1 + + + + + + + + + True + False + Options + + + + + + + + 0 + 1 + 1 + 1 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + True + True + True + + + + + + + + + + True + False + + + + + + + + 0 + 0 + 1 + 1 + + + + + False + True + 1 + + + + + + ok + cancel + + + diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 0bf7ecade403..766e0729731d 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -436,6 +436,9 @@ + -- cgit