[Libreoffice-commits] core.git: 2 commits - cui/source cui/uiconfig cui/UIConfig_cui.mk vcl/source
Caolán McNamara
caolanm at redhat.com
Tue Dec 17 04:16:23 PST 2013
cui/UIConfig_cui.mk | 1
cui/source/dialogs/cuigaldlg.cxx | 19 +---
cui/source/dialogs/gallery.src | 41 --------
cui/source/inc/cuigaldlg.hxx | 13 +-
cui/source/inc/gallery.hrc | 5 -
cui/source/inc/helpid.hrc | 1
cui/uiconfig/ui/gallerysearchprogress.ui | 142 +++++++++++++++++++++++++++++++
vcl/source/control/fixed.cxx | 11 ++
8 files changed, 168 insertions(+), 65 deletions(-)
New commits:
commit bd225bc2b8e0c46a2aa0e7366211452439caa622
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 17 11:59:11 2013 +0000
convert gallery search progress dialog to .ui
Change-Id: I77d9530ebc6529d87e2484c8440794e246aab5b9
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 8101925..1ae0d83 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/dbregisterpage \
cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/formatcellsdialog \
+ cui/uiconfig/ui/gallerysearchprogress \
cui/uiconfig/ui/gallerythemeiddialog \
cui/uiconfig/ui/gallerytitledialog \
cui/uiconfig/ui/hangulhanjaadddialog \
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index a81dbd8..b49e8a5 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -204,17 +204,16 @@ void SearchThread::ImplSearch( const INetURLObject& rStartURL,
// - SearchProgress -
// ------------------
-SearchProgress::SearchProgress( Window* pParent, const INetURLObject& rStartURL ) :
- ModalDialog ( pParent, CUI_RES(RID_SVXDLG_GALLERY_SEARCH_PROGRESS ) ),
- aFtSearchDir ( this, CUI_RES( FT_SEARCH_DIR ) ),
- aFLSearchDir ( this, CUI_RES( FL_SEARCH_DIR ) ),
- aFtSearchType ( this, CUI_RES( FT_SEARCH_TYPE ) ),
- aFLSearchType ( this, CUI_RES( FL_SEARCH_TYPE ) ),
- aBtnCancel ( this, CUI_RES( BTN_CANCEL ) ),
- parent_(pParent), startUrl_(rStartURL)
+SearchProgress::SearchProgress( Window* pParent, const INetURLObject& rStartURL )
+ : ModalDialog(pParent, "GallerySearchProgress", "cui/ui/gallerysearchprogress.ui")
+ , parent_(pParent)
+ , startUrl_(rStartURL)
{
- FreeResource();
- aBtnCancel.SetClickHdl( LINK( this, SearchProgress, ClickCancelBtn ) );
+ get(m_pFtSearchDir, "dir");
+ get(m_pFtSearchType, "file");
+ m_pFtSearchType->set_width_request(m_pFtSearchType->get_preferred_size().Width());
+ get(m_pBtnCancel, "cancel");
+ m_pBtnCancel->SetClickHdl( LINK( this, SearchProgress, ClickCancelBtn ) );
}
// ------------------------------------------------------------------------
diff --git a/cui/source/dialogs/gallery.src b/cui/source/dialogs/gallery.src
index cba3d94..a80d604 100644
--- a/cui/source/dialogs/gallery.src
+++ b/cui/source/dialogs/gallery.src
@@ -219,47 +219,6 @@ TabPage RID_SVXTABPAGE_GALLERYTHEME_FILES
/******************************************************************************/
-ModalDialog RID_SVXDLG_GALLERY_SEARCH_PROGRESS
-{
- HelpId = HID_GALLERY_SEARCH ;
- OutputSize = TRUE ;
- Border = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 124 , 86 ) ;
- Text [ en-US ] = "Find" ;
- Moveable = TRUE ;
- FixedLine FL_SEARCH_DIR
- {
- Pos = MAP_APPFONT ( 6 , 33 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "Directory" ;
- };
- FixedText FT_SEARCH_DIR
- {
- Pos = MAP_APPFONT ( 12 , 44 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 37 , 66 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine FL_SEARCH_TYPE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "File type" ;
- };
- FixedText FT_SEARCH_TYPE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- };
-};
-
-/******************************************************************************/
-
ModalDialog RID_SVXDLG_GALLERY_TAKE_PROGRESS
{
HelpId = HID_GALLERY_APPLY ;
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index 67d2f9e..2e8d829 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -80,12 +80,9 @@ public:
class SearchProgress : public ModalDialog
{
private:
-
- FixedText aFtSearchDir;
- FixedLine aFLSearchDir;
- FixedText aFtSearchType;
- FixedLine aFLSearchType;
- CancelButton aBtnCancel;
+ FixedText* m_pFtSearchDir;
+ FixedText* m_pFtSearchType;
+ CancelButton* m_pBtnCancel;
Window * parent_;
INetURLObject startUrl_;
rtl::Reference< SearchThread > maSearchThread;
@@ -101,8 +98,8 @@ public:
virtual short Execute();
virtual void StartExecuteModal( const Link& rEndDialogHdl );
- void SetFileType( const OUString& rType ) { aFtSearchType.SetText( rType ); }
- void SetDirectory( const INetURLObject& rURL ) { aFtSearchDir.SetText( GetReducedString( rURL, 30 ) ); }
+ void SetFileType( const OUString& rType ) { m_pFtSearchType->SetText( rType ); }
+ void SetDirectory( const INetURLObject& rURL ) { m_pFtSearchDir->SetText( GetReducedString( rURL, 30 ) ); }
};
class TakeThread: public salhelper::Thread
diff --git a/cui/source/inc/gallery.hrc b/cui/source/inc/gallery.hrc
index ce97705..61b038a 100644
--- a/cui/source/inc/gallery.hrc
+++ b/cui/source/inc/gallery.hrc
@@ -25,7 +25,6 @@
#define RID_SVXTABPAGE_GALLERYTHEME_FILES (RID_CUI_GALLERY_START + 4)
// Dialogs
-#define RID_SVXDLG_GALLERY_SEARCH_PROGRESS (RID_CUI_GALLERY_START + 6)
#define RID_SVXDLG_GALLERY_TAKE_PROGRESS (RID_CUI_GALLERY_START + 7)
#define RID_SVXDLG_GALLERY_ACTUALIZE_PROGRESS (RID_CUI_GALLERY_START + 8)
@@ -53,10 +52,6 @@
#define CBX_PREVIEW 3
#define FT_FILETYPE 2
#define CBB_FILETYPE 1
-#define FL_SEARCH_DIR 1
-#define FL_SEARCH_TYPE 2
-#define FT_SEARCH_DIR 1
-#define FT_SEARCH_TYPE 2
#define FL_TAKE_PROGRESS 1
#define FT_TAKE_FILE 1
#define BTN_TAKEALL 1
diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc
index e0c5d2f..11bbf69 100644
--- a/cui/source/inc/helpid.hrc
+++ b/cui/source/inc/helpid.hrc
@@ -183,7 +183,6 @@
#define HID_SEARCH_BTN_SEARCH "CUI_HID_SEARCH_BTN_SEARCH"
#define HID_SEARCH_BTN_CLOSE "CUI_HID_SEARCH_BTN_CLOSE"
#define HID_GALLERY_BROWSER "CUI_HID_GALLERY_BROWSER"
-#define HID_GALLERY_SEARCH "CUI_HID_GALLERY_SEARCH"
#define HID_GALLERY_APPLY "CUI_HID_GALLERY_APPLY"
#define HID_CONFIG_ACCEL "CUI_HID_CONFIG_ACCEL"
#define HID_ACCELCONFIG_LISTBOX "CUI_HID_ACCELCONFIG_LISTBOX"
diff --git a/cui/uiconfig/ui/gallerysearchprogress.ui b/cui/uiconfig/ui/gallerysearchprogress.ui
new file mode 100644
index 0000000..821a896
--- /dev/null
+++ b/cui/uiconfig/ui/gallerysearchprogress.ui
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="GallerySearchProgress">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Find</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">end</property>
+ <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="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">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">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</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="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkLabel" id="file">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="ellipsize">end</property>
+ <property name="width_chars">40</property>
+ <property name="single_line_mode">True</property>
+ <property name="max_width_chars">40</property>
+ </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">File type</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </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="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkLabel" id="dir">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="width_chars">40</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Directory</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </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">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>
commit 0240aa98de2148be78a40a23b94fc24ac621412e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 17 12:14:54 2013 +0000
support setting end ellipsis from .ui
Change-Id: I426f41ffdf107b7dcff8ae713e2dc63610f915af
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 70bfac2..1653916 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -455,6 +455,17 @@ bool FixedText::set_property(const OString &rKey, const OString &rValue)
setMaxWidthChars(rValue.toInt32());
else if (rKey == "width-chars")
setMinWidthChars(rValue.toInt32());
+ else if (rKey == "ellipsize")
+ {
+ WinBits nBits = GetStyle();
+ nBits &= ~(WB_PATHELLIPSIS);
+ if (rValue != "none")
+ {
+ SAL_WARN_IF(rValue != "end", "vcl.layout", "Only endellipsis support for now");
+ nBits |= WB_PATHELLIPSIS;
+ }
+ SetStyle(nBits);
+ }
else
return Control::set_property(rKey, rValue);
return true;
More information about the Libreoffice-commits
mailing list