basctl/UIConfig_basicide.mk | 1 basctl/inc/basidesh.hrc | 1 basctl/source/basicide/moduldl2.cxx | 54 +++++-------- basctl/source/basicide/moduldlg.hxx | 7 - basctl/source/basicide/moduldlg.src | 42 ---------- basctl/uiconfig/basicide/ui/exportdialog.ui | 116 ++++++++++++++++++++++++++++ 6 files changed, 143 insertions(+), 78 deletions(-)
New commits: commit 8c5f5aab2e3f1c600ff362632fb4db8d8c065d46 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Dec 31 21:27:16 2013 +0000 convert export basic dialog to .ui (600th .ui conversion) Change-Id: I67511e69f763761cd1631263fccd0704daf1886b diff --git a/basctl/UIConfig_basicide.mk b/basctl/UIConfig_basicide.mk index ec1e99f..9701469 100644 --- a/basctl/UIConfig_basicide.mk +++ b/basctl/UIConfig_basicide.mk @@ -31,6 +31,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/BasicIDE,\ $(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/newlibdialog \ basctl/uiconfig/basicide/ui/organizedialog \ )) diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc index 4c58e73..fbf22d4 100644 --- a/basctl/inc/basidesh.hrc +++ b/basctl/inc/basidesh.hrc @@ -34,7 +34,6 @@ #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_DLG_EXPORT ( RID_BASICIDE_START + 43 ) #define RID_POPUP_DLGED ( RID_BASICIDE_START + 62 ) #define RID_PRINTDLG_STRLIST ( RID_BASICIDE_START + 78 ) diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index ba23c2f..1f8fc70 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -456,28 +456,20 @@ IMPL_LINK_NOARG(GotoLineDialog, OkButtonHandler) IMPL_LINK_NOARG(ExportDialog, OkButtonHandler) { - mbExportAsPackage = maExportAsPackageButton.IsChecked(); + mbExportAsPackage = m_pExportAsPackageButton->IsChecked(); EndDialog(1); return 0; } -ExportDialog::ExportDialog( Window * pParent ) - : ModalDialog( pParent, IDEResId( RID_DLG_EXPORT ) ) - , maExportAsPackageButton( this, IDEResId( RB_EXPORTASPACKAGE ) ) - , maExportAsBasicButton( this, IDEResId( RB_EXPORTASBASIC ) ) - , maOKButton( this, IDEResId( RID_PB_OK ) ) - , maCancelButton( this, IDEResId( RID_PB_CANCEL ) ) +ExportDialog::ExportDialog(Window * pParent) + : ModalDialog(pParent, "ExportDialog", "modules/BasicIDE/ui/exportdialog.ui") , mbExportAsPackage(false) { - FreeResource(); - maExportAsPackageButton.Check(); - maOKButton.SetClickHdl(LINK(this, ExportDialog, OkButtonHandler)); -} - -//---------------------------------------------------------------------------- + get(m_pExportAsPackageButton, "extension"); + get(m_pOKButton, "ok"); -ExportDialog::~ExportDialog() -{ + m_pExportAsPackageButton->Check(); + m_pOKButton->SetClickHdl(LINK(this, ExportDialog, OkButtonHandler)); } //---------------------------------------------------------------------------- diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx index a341a96..1bac300 100644 --- a/basctl/source/basicide/moduldlg.hxx +++ b/basctl/source/basicide/moduldlg.hxx @@ -81,10 +81,8 @@ public: class ExportDialog : public ModalDialog { private: - RadioButton maExportAsPackageButton; - RadioButton maExportAsBasicButton; - OKButton maOKButton; - CancelButton maCancelButton; + RadioButton* m_pExportAsPackageButton; + OKButton* m_pOKButton; bool mbExportAsPackage; @@ -92,7 +90,6 @@ private: public: ExportDialog( Window * pParent ); - ~ExportDialog(); bool isExportAsPackage () { return mbExportAsPackage; } }; diff --git a/basctl/source/basicide/moduldlg.src b/basctl/source/basicide/moduldlg.src index 7f5a802..885ee06 100644 --- a/basctl/source/basicide/moduldlg.src +++ b/basctl/source/basicide/moduldlg.src @@ -272,48 +272,6 @@ ModalDialog RID_DLG_LIBS }; }; -ModalDialog RID_DLG_EXPORT -{ - HelpID = "basctl:ModalDialog:RID_DLG_EXPORT"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 115 , 55 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "Export Basic library"; - OKButton RID_PB_OK - { - Pos = MAP_APPFONT ( 6 , 35 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton RID_PB_CANCEL - { - Pos = MAP_APPFONT ( 59 , 35 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - - RadioButton RB_EXPORTASPACKAGE - { - HelpID = "basctl:RadioButton:RID_DLG_EXPORT:RB_EXPORTASPACKAGE"; - Pos = MAP_APPFONT( 6, 6 ); - Size = MAP_APPFONT( 103, 10 ); - Group = TRUE; - Text [ en-US ] = "Export as ~extension"; - TabStop = TRUE ; - }; - RadioButton RB_EXPORTASBASIC - { - HelpID = "basctl:RadioButton:RID_DLG_EXPORT:RB_EXPORTASBASIC"; - Pos = MAP_APPFONT( 6, 19 ); - Size = MAP_APPFONT( 103, 10 ); - //Group = TRUE; - Text [ en-US ] = "Export as BASIC library"; - }; -}; - String RID_STR_EXPORTPACKAGE { Text [ en-US ] = "Export library as extension"; diff --git a/basctl/uiconfig/basicide/ui/exportdialog.ui b/basctl/uiconfig/basicide/ui/exportdialog.ui new file mode 100644 index 0000000..3ac800a --- /dev/null +++ b/basctl/uiconfig/basicide/ui/exportdialog.ui @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.0 on Tue Dec 31 21:21:09 2013 --> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="ExportDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Export Basic library</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> + <object class="GtkGrid" id="grid3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <property name="row_homogeneous">True</property> + <child> + <object class="GtkRadioButton" id="extension"> + <property name="label" translatable="yes">Export as _extension</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">basic</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="basic"> + <property name="label" translatable="yes">Export as BASIC library</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">extension</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <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="cancel"> + <property name="label">gtk-cancel</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">2</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + </action-widgets> + </object> +</interface> commit 79c1b86e20bbb2bb826493b07cfc000cb3a5d52d Author: Caolán McNamara <caol...@redhat.com> Date: Tue Dec 31 21:32:47 2013 +0000 MessageDialog isn't ready for this usage just yet Change-Id: If6c886ac4115dd0a030660fd0147491815fa411a diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 956f170..ba23c2f 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <vcl/layout.hxx> +#include <vcl/msgbox.hxx> #include <sot/storinfo.hxx> #include <moduldlg.hrc> @@ -291,7 +291,7 @@ sal_Bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& ) OUString aLibName = GetEntryText( pEntry, 0 ); if ( aLibName.equalsIgnoreAsciiCase( "Standard" ) ) { - MessageDialog(this, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB)).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_CANNOTCHANGENAMESTDLIB) ).Execute(); return false; } @@ -301,7 +301,7 @@ sal_Bool CheckBox::EditingEntry( SvTreeListEntry* pEntry, Selection& ) if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) && xModLibContainer->isLibraryReadOnly( aLibName ) && !xModLibContainer->isLibraryLink( aLibName ) ) || ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) ) { - MessageDialog(this, IDE_RESSTR(RID_STR_LIBISREADONLY)).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_LIBISREADONLY) ).Execute(); return false; } @@ -353,7 +353,7 @@ sal_Bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewNam } catch (const container::ElementExistException& ) { - MessageDialog(this, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED)).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED) ).Execute(); return false; } catch (const container::NoSuchElementException& ) @@ -366,9 +366,9 @@ sal_Bool CheckBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewNam if ( !bValid ) { if ( rNewName.getLength() > 30 ) - MessageDialog(this, IDE_RESSTR(RID_STR_LIBNAMETOLONG)).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_LIBNAMETOLONG) ).Execute(); else - MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) ).Execute(); } return bValid; @@ -384,7 +384,7 @@ IMPL_LINK_NOARG(NewObjectDialog, OkButtonHandler) EndDialog(1); else { - MessageDialog(this, IDE_RESSTR(RID_STR_BADSBXNAME)).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) ).Execute(); m_pEdit->GrabFocus(); } return 0; @@ -868,7 +868,7 @@ void LibPage::InsertLib() } if ( !pLibDlg ) - MessageDialog(this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE), VCL_MESSAGE_INFO).Execute(); + InfoBox( this, IDE_RESSTR(RID_STR_NOLIBINSTORAGE) ).Execute(); else { bool bChanges = false; @@ -905,7 +905,7 @@ void LibPage::InsertLib() // check, if the library is the Standard library if ( aLibName == "Standard" ) { - MessageDialog(this, IDE_RESSTR(RID_STR_REPLACESTDLIB)).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_REPLACESTDLIB) ).Execute(); continue; } @@ -917,7 +917,7 @@ void LibPage::InsertLib() aErrStr = aErrStr.replaceAll("XX", aLibName); aErrStr += "\n"; aErrStr += IDE_RESSTR(RID_STR_LIBISREADONLY); - MessageDialog(this, aErrStr).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute(); continue; } @@ -934,7 +934,7 @@ void LibPage::InsertLib() aErrStr = aErrStr.replaceAll("XX", aLibName); aErrStr += "\n" ; aErrStr += IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED); - MessageDialog(this, aErrStr).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute(); continue; } } @@ -953,7 +953,7 @@ void LibPage::InsertLib() { OUString aErrStr( IDE_RESSTR(RID_STR_NOIMPORT) ); aErrStr = aErrStr.replaceAll("XX", aLibName); - MessageDialog(this, aErrStr).Execute(); + ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute(); continue; } } @@ -1545,15 +1545,17 @@ void createLibImpl( Window* pWin, const ScriptDocument& rDocument, if ( aLibName.getLength() > 30 ) { - MessageDialog(pWin, IDEResId(RID_STR_LIBNAMETOLONG).toString()).Execute(); + ErrorBox( pWin, WB_OK | WB_DEF_OK, IDEResId(RID_STR_LIBNAMETOLONG).toString() ).Execute(); } else if ( !IsValidSbxName( aLibName ) ) { - MessageDialog(pWin, IDEResId(RID_STR_BADSBXNAME).toString()).Execute(); + ErrorBox( pWin, WB_OK | WB_DEF_OK, + IDEResId(RID_STR_BADSBXNAME).toString() ).Execute(); } else if ( rDocument.hasLibrary( E_SCRIPTS, aLibName ) || rDocument.hasLibrary( E_DIALOGS, aLibName ) ) { - MessageDialog(pWin, IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString()).Execute(); + ErrorBox( pWin, WB_OK | WB_DEF_OK, + IDEResId(RID_STR_SBXNAMEALLREADYUSED2).toString() ).Execute(); } else {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits