[Libreoffice-commits] core.git: 2 commits - fpicker/Module_fpicker.mk fpicker/source fpicker/uiconfig fpicker/UIConfig_fps.mk include/svtools
Caolán McNamara
caolanm at redhat.com
Mon Dec 16 02:41:49 PST 2013
fpicker/Module_fpicker.mk | 1
fpicker/UIConfig_fps.mk | 16 +++
fpicker/source/office/OfficeFilePicker.hrc | 2
fpicker/source/office/QueryFolderName.hxx | 46 +++++++++
fpicker/source/office/iodlg.cxx | 56 ++++--------
fpicker/source/office/iodlg.hrc | 9 -
fpicker/source/office/iodlg.src | 45 ---------
fpicker/uiconfig/ui/foldernamedialog.ui | 135 +++++++++++++++++++++++++++++
include/svtools/QueryFolderName.hxx | 57 ------------
9 files changed, 220 insertions(+), 147 deletions(-)
New commits:
commit 53a3a31cf14ac35345c58553bc259130e1e70711
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 16 10:36:06 2013 +0000
move this QueryFolderName into fpicker
Change-Id: I1b7b26ceef86e0dcc642d760b8413a822c125a2b
diff --git a/include/svtools/QueryFolderName.hxx b/fpicker/source/office/QueryFolderName.hxx
similarity index 78%
rename from include/svtools/QueryFolderName.hxx
rename to fpicker/source/office/QueryFolderName.hxx
index 6f5381e..2984f35 100644
--- a/include/svtools/QueryFolderName.hxx
+++ b/fpicker/source/office/QueryFolderName.hxx
@@ -16,8 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_SVTOOLS_QUERYFOLDERNAME_HXX
-#define INCLUDED_SVTOOLS_QUERYFOLDERNAME_HXX
+#ifndef INCLUDED_QUERYFOLDERNAME_HXX
+#define INCLUDED_QUERYFOLDERNAME_HXX
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
@@ -25,13 +25,6 @@
#include <vcl/dialog.hxx>
#include <vcl/layout.hxx>
-//-------------------------------------------------------------------------
-namespace svtools {
-
-//-------------------------------------------------------------------------
-// QueryFolderNameDialog
-//-------------------------------------------------------------------------
-
class QueryFolderNameDialog : public ModalDialog
{
private:
@@ -48,7 +41,6 @@ public:
OUString GetName() const { return m_pNameEdit->GetText(); }
};
-}
-#endif // INCLUDED_SVTOOLS_QUERYFOLDERNAME_HXX
+#endif // INCLUDED_QUERYFOLDERNAME_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index face054..0e5b467 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -49,7 +49,7 @@
#include "iodlgimp.hxx"
#include "svtools/inettbc.hxx"
#include "unotools/syslocale.hxx"
-#include "svtools/QueryFolderName.hxx"
+#include "QueryFolderName.hxx"
#include <rtl/ustring.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ucb/UniversalContentBroker.hpp>
@@ -773,7 +773,7 @@ IMPL_STATIC_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton*, EMPTYARG )
SmartContent aContent( pThis->_pFileView->GetViewURL( ) );
OUString aTitle;
aContent.getTitle( aTitle );
- svtools::QueryFolderNameDialog aDlg( pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER) );
+ QueryFolderNameDialog aDlg( pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER) );
sal_Bool bHandled = sal_False;
while ( !bHandled )
@@ -3332,10 +3332,6 @@ IMPL_LINK_NOARG( SvtFileDialog, Split_Hdl )
return 0;
}
-// QueryFolderNameDialog -------------------------------------------------------
-
-namespace svtools {
-
QueryFolderNameDialog::QueryFolderNameDialog(Window* _pParent,
const OUString& rTitle, const OUString& rDefaultText, OUString* pGroupName)
: ModalDialog(_pParent, "FolderNameDialog", "fps/ui/foldernamedialog.ui")
@@ -3382,6 +3378,4 @@ IMPL_LINK_NOARG(QueryFolderNameDialog, NameHdl)
return 0;
}
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ae22d6388827958cfd89cd702b8c3c41ff9821e5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 16 10:27:27 2013 +0000
convert query folder dialog to .ui
Change-Id: I844b45b4cc9834550d0d187dfdbc69686e512e5d
diff --git a/fpicker/Module_fpicker.mk b/fpicker/Module_fpicker.mk
index 9134398..573d76c 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 0000000..c18b90c
--- /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 53d8a98..bdc9455 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 009b61d..face054 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 cc7d90f..73e7901 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 0524547..1a6b3a9 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 0000000..59da086
--- /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 ad9b7c0..6f5381e 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(); }
};
}
More information about the Libreoffice-commits
mailing list