diff options
-rw-r--r-- | fpicker/Module_fpicker.mk | 1 | ||||
-rw-r--r-- | fpicker/UIConfig_fps.mk | 16 | ||||
-rw-r--r-- | fpicker/source/office/OfficeFilePicker.hrc | 2 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 46 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hrc | 9 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.src | 45 | ||||
-rw-r--r-- | fpicker/uiconfig/ui/foldernamedialog.ui | 135 | ||||
-rw-r--r-- | include/svtools/QueryFolderName.hxx | 17 |
8 files changed, 179 insertions, 92 deletions
diff --git a/fpicker/Module_fpicker.mk b/fpicker/Module_fpicker.mk index 913439848a6a..573d76c0b1cc 100644 --- a/fpicker/Module_fpicker.mk +++ b/fpicker/Module_fpicker.mk @@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,fpicker)) $(eval $(call gb_Module_add_targets,fpicker,\ Library_fps_office \ + UIConfig_fps \ )) $(eval $(call gb_Module_add_l10n_targets,fpicker,\ diff --git a/fpicker/UIConfig_fps.mk b/fpicker/UIConfig_fps.mk new file mode 100644 index 000000000000..c18b90c99534 --- /dev/null +++ b/fpicker/UIConfig_fps.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UIConfig_UIConfig,fps)) + +$(eval $(call gb_UIConfig_add_uifiles,fps,\ + fpicker/uiconfig/ui/foldernamedialog \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/fpicker/source/office/OfficeFilePicker.hrc b/fpicker/source/office/OfficeFilePicker.hrc index 53d8a983340b..bdc9455c04c6 100644 --- a/fpicker/source/office/OfficeFilePicker.hrc +++ b/fpicker/source/office/OfficeFilePicker.hrc @@ -12,7 +12,7 @@ #include <vcl/fpicker.hrc> #define DLG_FPICKER_EXPLORERFILE (RID_FPICKER_START+14) -#define DLG_FPICKER_QUERYFOLDERNAME (RID_FPICKER_START+15) + #define DLG_FPICKER_PLACE_EDIT (RID_FPICKER_START+16) #define RID_FILEPICKER_IMAGES (RID_FPICKER_START+17) diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 009b61d7fcb0..face054e63e9 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -3336,37 +3336,29 @@ IMPL_LINK_NOARG( SvtFileDialog, Split_Hdl ) namespace svtools { -QueryFolderNameDialog::QueryFolderNameDialog -( - Window* _pParent, - const OUString& rTitle, - const OUString& rDefaultText, - OUString* pGroupName -) : - ModalDialog( _pParent, SvtResId( DLG_FPICKER_QUERYFOLDERNAME ) ), - - aNameText ( this, SvtResId( FT_SVT_QUERYFOLDERNAME_DLG_NAME ) ), - aNameEdit ( this, SvtResId( ED_SVT_QUERYFOLDERNAME_DLG_NAME ) ), - aNameLine ( this, SvtResId( FL_SVT_QUERYFOLDERNAME_DLG_NAME ) ), - aOKBtn ( this, SvtResId( BT_SVT_QUERYFOLDERNAME_DLG_OK ) ), - aCancelBtn ( this, SvtResId( BT_SVT_QUERYFOLDERNAME_DLG_CANCEL ) ) +QueryFolderNameDialog::QueryFolderNameDialog(Window* _pParent, + const OUString& rTitle, const OUString& rDefaultText, OUString* pGroupName) + : ModalDialog(_pParent, "FolderNameDialog", "fps/ui/foldernamedialog.ui") { - FreeResource(); + get(m_pNameEdit, "entry"); + get(m_pNameLine, "frame"); + get(m_pOKBtn, "ok"); + SetText( rTitle ); - aNameEdit.SetText( rDefaultText ); - aNameEdit.SetSelection( Selection( 0, rDefaultText.getLength() ) ); - aOKBtn.SetClickHdl( LINK( this, QueryFolderNameDialog, OKHdl ) ); - aNameEdit.SetModifyHdl( LINK( this, QueryFolderNameDialog, NameHdl ) ); + m_pNameEdit->SetText( rDefaultText ); + m_pNameEdit->SetSelection( Selection( 0, rDefaultText.getLength() ) ); + m_pOKBtn->SetClickHdl( LINK( this, QueryFolderNameDialog, OKHdl ) ); + m_pNameEdit->SetModifyHdl( LINK( this, QueryFolderNameDialog, NameHdl ) ); - if ( pGroupName ) - aNameLine.SetText( *pGroupName ); + if (pGroupName) + m_pNameLine->set_label( *pGroupName ); }; // ----------------------------------------------------------------------- IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl) { // trim the strings - aNameEdit.SetText(comphelper::string::strip(aNameEdit.GetText(), ' ')); + m_pNameEdit->SetText(comphelper::string::strip(m_pNameEdit->GetText(), ' ')); EndDialog( RET_OK ); return 1; } @@ -3375,16 +3367,16 @@ IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl) IMPL_LINK_NOARG(QueryFolderNameDialog, NameHdl) { // trim the strings - OUString aName = comphelper::string::strip(aNameEdit.GetText(), ' '); + OUString aName = comphelper::string::strip(m_pNameEdit->GetText(), ' '); if ( !aName.isEmpty() ) { - if ( !aOKBtn.IsEnabled() ) - aOKBtn.Enable( sal_True ); + if ( !m_pOKBtn->IsEnabled() ) + m_pOKBtn->Enable( sal_True ); } else { - if ( aOKBtn.IsEnabled() ) - aOKBtn.Enable( sal_False ); + if ( m_pOKBtn->IsEnabled() ) + m_pOKBtn->Enable( sal_False ); } return 0; diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index cc7d90fcd4c0..73e7901bf3b2 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -68,15 +68,6 @@ #define STR_DEFAULT_DIRECTORY 9 #define STR_PLACES_TITLE 10 -// DLG_SVT_QUERYFOLDERNAME ----------------------- - -#define FT_SVT_QUERYFOLDERNAME_DLG_NAME 10 -#define ED_SVT_QUERYFOLDERNAME_DLG_NAME 11 -#define FL_SVT_QUERYFOLDERNAME_DLG_NAME 12 -#define BT_SVT_QUERYFOLDERNAME_DLG_OK 13 -#define BT_SVT_QUERYFOLDERNAME_DLG_CANCEL 14 -#define BT_SVT_QUERYFOLDERNAME_DLG_HELP 15 - // ----------------------------------------------- #define SID_SFX_START 5000 diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index 052454768326..1a6b3a9f32cc 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -240,51 +240,6 @@ ModalDialog DLG_FPICKER_EXPLORERFILE }; }; -// QueryFolderNameDialog ---------------------------------------------------------- - -ModalDialog DLG_FPICKER_QUERYFOLDERNAME -{ - HelpID = "fpicker:ModalDialog:DLG_SVT_QUERYFOLDERNAME"; - Border = TRUE ; - Moveable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Text = "Ordner" ; - Size = MAP_APPFONT ( 215 , 45 ) ; - FixedText FT_SVT_QUERYFOLDERNAME_DLG_NAME - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 138 , 10 ) ; - Text [ en-US ] = "Na~me" ; - }; - Edit ED_SVT_QUERYFOLDERNAME_DLG_NAME - { - HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME"; - Pos = MAP_APPFONT ( 12 , 27 ) ; - Size = MAP_APPFONT ( 138 , 12 ) ; - Border = TRUE ; - Left = TRUE ; - }; - FixedLine FL_SVT_QUERYFOLDERNAME_DLG_NAME - { - Group = TRUE ; - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 150 , 8 ) ; - Text [ en-US ] = "Create new folder" ; - }; - OKButton BT_SVT_QUERYFOLDERNAME_DLG_OK - { - Pos = MAP_APPFONT ( 162 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BT_SVT_QUERYFOLDERNAME_DLG_CANCEL - { - Pos = MAP_APPFONT ( 162 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; -}; - // strings ******************************************************************* String RID_FILEOPEN_NOTEXISTENTFILE diff --git a/fpicker/uiconfig/ui/foldernamedialog.ui b/fpicker/uiconfig/ui/foldernamedialog.ui new file mode 100644 index 000000000000..59da086e609c --- /dev/null +++ b/fpicker/uiconfig/ui/foldernamedialog.ui @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="FolderNameDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Folder Name ?</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">start</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> + <property name="secondary">True</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> + <property name="secondary">True</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="GtkFrame" id="frame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">start</property> + <property name="hexpand">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Na_me</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Create new folder</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </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">ok</action-widget> + <action-widget response="0">cancel</action-widget> + </action-widgets> + </object> +</interface> diff --git a/include/svtools/QueryFolderName.hxx b/include/svtools/QueryFolderName.hxx index ad9b7c0835ee..6f5381ee0c1c 100644 --- a/include/svtools/QueryFolderName.hxx +++ b/include/svtools/QueryFolderName.hxx @@ -23,6 +23,7 @@ #include <vcl/button.hxx> #include <vcl/edit.hxx> #include <vcl/dialog.hxx> +#include <vcl/layout.hxx> //------------------------------------------------------------------------- namespace svtools { @@ -34,21 +35,17 @@ namespace svtools { class QueryFolderNameDialog : public ModalDialog { private: - FixedText aNameText; - Edit aNameEdit; - FixedLine aNameLine; - OKButton aOKBtn; - CancelButton aCancelBtn; + Edit* m_pNameEdit; + VclFrame* m_pNameLine; + OKButton* m_pOKBtn; DECL_LINK( OKHdl, void * ); DECL_LINK( NameHdl, void * ); public: - QueryFolderNameDialog( Window* _pParent, - const OUString& rTitle, - const OUString& rDefaultText, - OUString* pGroupName = NULL ); - OUString GetName() const { return aNameEdit.GetText(); } + QueryFolderNameDialog(Window* _pParent, const OUString& rTitle, + const OUString& rDefaultText, OUString* pGroupName = NULL); + OUString GetName() const { return m_pNameEdit->GetText(); } }; } |