Kaydet (Commit) ae22d638 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert query folder dialog to .ui

Change-Id: I844b45b4cc9834550d0d187dfdbc69686e512e5d
üst 1327020b
...@@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,fpicker)) ...@@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,fpicker))
$(eval $(call gb_Module_add_targets,fpicker,\ $(eval $(call gb_Module_add_targets,fpicker,\
Library_fps_office \ Library_fps_office \
UIConfig_fps \
)) ))
$(eval $(call gb_Module_add_l10n_targets,fpicker,\ $(eval $(call gb_Module_add_l10n_targets,fpicker,\
......
# -*- 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:
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <vcl/fpicker.hrc> #include <vcl/fpicker.hrc>
#define DLG_FPICKER_EXPLORERFILE (RID_FPICKER_START+14) #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 DLG_FPICKER_PLACE_EDIT (RID_FPICKER_START+16)
#define RID_FILEPICKER_IMAGES (RID_FPICKER_START+17) #define RID_FILEPICKER_IMAGES (RID_FPICKER_START+17)
......
...@@ -3336,37 +3336,29 @@ IMPL_LINK_NOARG( SvtFileDialog, Split_Hdl ) ...@@ -3336,37 +3336,29 @@ IMPL_LINK_NOARG( SvtFileDialog, Split_Hdl )
namespace svtools { namespace svtools {
QueryFolderNameDialog::QueryFolderNameDialog QueryFolderNameDialog::QueryFolderNameDialog(Window* _pParent,
( const OUString& rTitle, const OUString& rDefaultText, OUString* pGroupName)
Window* _pParent, : ModalDialog(_pParent, "FolderNameDialog", "fps/ui/foldernamedialog.ui")
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 ) )
{ {
FreeResource(); get(m_pNameEdit, "entry");
get(m_pNameLine, "frame");
get(m_pOKBtn, "ok");
SetText( rTitle ); SetText( rTitle );
aNameEdit.SetText( rDefaultText ); m_pNameEdit->SetText( rDefaultText );
aNameEdit.SetSelection( Selection( 0, rDefaultText.getLength() ) ); m_pNameEdit->SetSelection( Selection( 0, rDefaultText.getLength() ) );
aOKBtn.SetClickHdl( LINK( this, QueryFolderNameDialog, OKHdl ) ); m_pOKBtn->SetClickHdl( LINK( this, QueryFolderNameDialog, OKHdl ) );
aNameEdit.SetModifyHdl( LINK( this, QueryFolderNameDialog, NameHdl ) ); m_pNameEdit->SetModifyHdl( LINK( this, QueryFolderNameDialog, NameHdl ) );
if ( pGroupName ) if (pGroupName)
aNameLine.SetText( *pGroupName ); m_pNameLine->set_label( *pGroupName );
}; };
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl) IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl)
{ {
// trim the strings // trim the strings
aNameEdit.SetText(comphelper::string::strip(aNameEdit.GetText(), ' ')); m_pNameEdit->SetText(comphelper::string::strip(m_pNameEdit->GetText(), ' '));
EndDialog( RET_OK ); EndDialog( RET_OK );
return 1; return 1;
} }
...@@ -3375,16 +3367,16 @@ IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl) ...@@ -3375,16 +3367,16 @@ IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl)
IMPL_LINK_NOARG(QueryFolderNameDialog, NameHdl) IMPL_LINK_NOARG(QueryFolderNameDialog, NameHdl)
{ {
// trim the strings // trim the strings
OUString aName = comphelper::string::strip(aNameEdit.GetText(), ' '); OUString aName = comphelper::string::strip(m_pNameEdit->GetText(), ' ');
if ( !aName.isEmpty() ) if ( !aName.isEmpty() )
{ {
if ( !aOKBtn.IsEnabled() ) if ( !m_pOKBtn->IsEnabled() )
aOKBtn.Enable( sal_True ); m_pOKBtn->Enable( sal_True );
} }
else else
{ {
if ( aOKBtn.IsEnabled() ) if ( m_pOKBtn->IsEnabled() )
aOKBtn.Enable( sal_False ); m_pOKBtn->Enable( sal_False );
} }
return 0; return 0;
......
...@@ -68,15 +68,6 @@ ...@@ -68,15 +68,6 @@
#define STR_DEFAULT_DIRECTORY 9 #define STR_DEFAULT_DIRECTORY 9
#define STR_PLACES_TITLE 10 #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 #define SID_SFX_START 5000
......
...@@ -240,51 +240,6 @@ ModalDialog DLG_FPICKER_EXPLORERFILE ...@@ -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 ******************************************************************* // strings *******************************************************************
String RID_FILEOPEN_NOTEXISTENTFILE String RID_FILEOPEN_NOTEXISTENTFILE
......
<?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>
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <vcl/dialog.hxx> #include <vcl/dialog.hxx>
#include <vcl/layout.hxx>
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
namespace svtools { namespace svtools {
...@@ -34,21 +35,17 @@ namespace svtools { ...@@ -34,21 +35,17 @@ namespace svtools {
class QueryFolderNameDialog : public ModalDialog class QueryFolderNameDialog : public ModalDialog
{ {
private: private:
FixedText aNameText; Edit* m_pNameEdit;
Edit aNameEdit; VclFrame* m_pNameLine;
FixedLine aNameLine; OKButton* m_pOKBtn;
OKButton aOKBtn;
CancelButton aCancelBtn;
DECL_LINK( OKHdl, void * ); DECL_LINK( OKHdl, void * );
DECL_LINK( NameHdl, void * ); DECL_LINK( NameHdl, void * );
public: public:
QueryFolderNameDialog( Window* _pParent, QueryFolderNameDialog(Window* _pParent, const OUString& rTitle,
const OUString& rTitle, const OUString& rDefaultText, OUString* pGroupName = NULL);
const OUString& rDefaultText, OUString GetName() const { return m_pNameEdit->GetText(); }
OUString* pGroupName = NULL );
OUString GetName() const { return aNameEdit.GetText(); }
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment