Kaydet (Commit) db8b11b8 authored tarafından Albert Thuswaldner's avatar Albert Thuswaldner Kaydeden (comit) Caolán McNamara

Calc: converted sort warning dialog to .ui

Change-Id: I2bc44990efb62183507f46b22bfd8e09edf02eb6
Reviewed-on: https://gerrit.libreoffice.org/3380Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6fe3a4a3
...@@ -75,6 +75,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ ...@@ -75,6 +75,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/sortcriteriapage \ sc/uiconfig/scalc/ui/sortcriteriapage \
sc/uiconfig/scalc/ui/sortkey \ sc/uiconfig/scalc/ui/sortkey \
sc/uiconfig/scalc/ui/sortoptionspage \ sc/uiconfig/scalc/ui/sortoptionspage \
sc/uiconfig/scalc/ui/sortwarning \
sc/uiconfig/scalc/ui/textimportoptions \ sc/uiconfig/scalc/ui/textimportoptions \
sc/uiconfig/scalc/ui/textimportcsv \ sc/uiconfig/scalc/ui/textimportcsv \
)) ))
......
...@@ -1080,7 +1080,6 @@ ...@@ -1080,7 +1080,6 @@
#define RID_SCDLG_CONFLICTS (SC_DIALOGS_START + 145) #define RID_SCDLG_CONFLICTS (SC_DIALOGS_START + 145)
#define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146) #define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146)
#define RID_SCDLG_SORT_WARNING (SC_DIALOGS_START + 147)
#define RID_SCDLG_TABPROTECTION (SC_DIALOGS_START + 148) #define RID_SCDLG_TABPROTECTION (SC_DIALOGS_START + 148)
#define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150) #define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150)
#define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) #define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151)
......
...@@ -46,6 +46,7 @@ class SfxStyleSheetBase; ...@@ -46,6 +46,7 @@ class SfxStyleSheetBase;
class ScDPObject; class ScDPObject;
struct ScPivotFuncData; struct ScPivotFuncData;
struct ScDPNumGroupInfo; struct ScDPNumGroupInfo;
class ScSortWarningDlg;
class ScTabViewShell; class ScTabViewShell;
class ScConditionalFormat; class ScConditionalFormat;
class ScConditionalFormatList; class ScConditionalFormatList;
...@@ -293,6 +294,10 @@ public: ...@@ -293,6 +294,10 @@ public:
virtual sal_uInt16 GetSelectEntryPos(sal_uInt16 nPos) const = 0; virtual sal_uInt16 GetSelectEntryPos(sal_uInt16 nPos) const = 0;
}; };
class AbstractScSortWarningDlg : public VclAbstractDialog //add for ScSortWarningDlg
{
};
class AbstractScStringInputDlg : public VclAbstractDialog //add for ScStringInputDlg class AbstractScStringInputDlg : public VclAbstractDialog //add for ScStringInputDlg
{ {
public: public:
...@@ -345,7 +350,8 @@ public: ...@@ -345,7 +350,8 @@ public:
const String& rStrLabel, const String& rStrLabel,
int nId, int nId,
sal_Bool bColDefault = sal_True ) = 0; sal_Bool bColDefault = sal_True ) = 0;
virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ) = 0; //add for ScSortWarningDlg
virtual AbstractScSortWarningDlg * CreateScSortWarningDlg(Window* pParent, const String& rExtendText, const String& rCurrentText ) = 0; //add for ScSortWarningDlg
virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList,
const ScAddress& rPos, int nId ) = 0; const ScAddress& rPos, int nId ) = 0;
......
...@@ -109,6 +109,7 @@ IMPL_ABSTDLG_BASE(AbstractScDPDateGroupDlg_Impl); ...@@ -109,6 +109,7 @@ IMPL_ABSTDLG_BASE(AbstractScDPDateGroupDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScSortWarningDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl);
...@@ -729,23 +730,10 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScColOrRowDlg(Window* ...@@ -729,23 +730,10 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScColOrRowDlg(Window*
return 0; return 0;
} }
AbstractScSortWarningDlg* ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText )
VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window* pParent, const String& rExtendText,
const String& rCurrentText, int nId )
{ {
Dialog * pDlg=NULL; ScSortWarningDlg* pDlg = new ScSortWarningDlg(pParent, rExtendText, rCurrentText );
switch ( nId ) return new AbstractScSortWarningDlg_Impl( pDlg );
{
case RID_SCDLG_SORT_WARNING:
pDlg = new ScSortWarningDlg( pParent, rExtendText, rCurrentText );
break;
default:
break;
}
if( pDlg )
return new ScVclAbstractDialog_Impl( pDlg );
return 0;
} }
......
...@@ -47,6 +47,7 @@ class ScDPSubtotalDlg; ...@@ -47,6 +47,7 @@ class ScDPSubtotalDlg;
class ScDPNumGroupDlg; class ScDPNumGroupDlg;
class ScDPDateGroupDlg; class ScDPDateGroupDlg;
class ScDPShowDetailDlg; class ScDPShowDetailDlg;
class ScSortWarningDlg;
class ScNewScenarioDlg; class ScNewScenarioDlg;
class ScShowTabDlg; class ScShowTabDlg;
class ScStringInputDlg; class ScStringInputDlg;
...@@ -343,6 +344,12 @@ class AbstractScShowTabDlg_Impl : public AbstractScShowTabDlg //add for ScShowT ...@@ -343,6 +344,12 @@ class AbstractScShowTabDlg_Impl : public AbstractScShowTabDlg //add for ScShowT
virtual sal_uInt16 GetSelectEntryPos(sal_uInt16 nPos) const; virtual sal_uInt16 GetSelectEntryPos(sal_uInt16 nPos) const;
}; };
class AbstractScSortWarningDlg_Impl : public AbstractScSortWarningDlg
{
DECL_ABSTDLG_BASE( AbstractScSortWarningDlg_Impl, ScSortWarningDlg )
};
class AbstractScStringInputDlg_Impl : public AbstractScStringInputDlg //add for ScStringInputDlg class AbstractScStringInputDlg_Impl : public AbstractScStringInputDlg //add for ScStringInputDlg
{ {
DECL_ABSTDLG_BASE( AbstractScStringInputDlg_Impl, ScStringInputDlg ) DECL_ABSTDLG_BASE( AbstractScStringInputDlg_Impl, ScStringInputDlg )
...@@ -412,7 +419,7 @@ public: ...@@ -412,7 +419,7 @@ public:
int nId, int nId,
sal_Bool bColDefault = sal_True ); sal_Bool bColDefault = sal_True );
virtual VclAbstractDialog * CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ); virtual AbstractScSortWarningDlg * CreateScSortWarningDlg(Window* pParent, const String& rExtendText, const String& rCurrentText );
virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList,
const ScAddress& rPos, int nId ); const ScAddress& rPos, int nId );
......
...@@ -48,22 +48,19 @@ ScSortDlg::~ScSortDlg() ...@@ -48,22 +48,19 @@ ScSortDlg::~ScSortDlg()
ScSortWarningDlg::ScSortWarningDlg( Window* pParent, ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
const String& rExtendText, const String& rExtendText,
const String& rCurrentText ): const String& rCurrentText ):
ModalDialog ( pParent, ScResId( RID_SCDLG_SORT_WARNING ) ), ModalDialog ( pParent, "SortWarning", "modules/scalc/ui/sortwarning.ui" )
aFtText ( this, ScResId( FT_TEXT ) ),
aFtTip ( this, ScResId( FT_TIP ) ),
aBtnExtSort ( this, ScResId( BTN_EXTSORT ) ),
aBtnCurSort ( this, ScResId( BTN_CURSORT ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) )
{ {
String sTextName = aFtText.GetText(); get(aFtText, "sorttext" );
get( aBtnExtSort, "extend" );
get( aBtnCurSort, "current" );
String sTextName = aFtText->GetText();
sTextName.SearchAndReplaceAscii("%1", rExtendText); sTextName.SearchAndReplaceAscii("%1", rExtendText);
sTextName.SearchAndReplaceAscii("%2", rCurrentText); sTextName.SearchAndReplaceAscii("%2", rCurrentText);
aFtText.SetText( sTextName ); aFtText->SetText( sTextName );
aBtnExtSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
aBtnCurSort .SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
FreeResource(); aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
aBtnCurSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
} }
ScSortWarningDlg::~ScSortWarningDlg() ScSortWarningDlg::~ScSortWarningDlg()
...@@ -72,11 +69,11 @@ ScSortWarningDlg::~ScSortWarningDlg() ...@@ -72,11 +69,11 @@ ScSortWarningDlg::~ScSortWarningDlg()
IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn ) IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
{ {
if ( pBtn == &aBtnExtSort ) if ( pBtn == aBtnExtSort )
{ {
EndDialog( BTN_EXTEND_RANGE ); EndDialog( BTN_EXTEND_RANGE );
} }
else if( pBtn == &aBtnCurSort ) else if( pBtn == aBtnCurSort )
{ {
EndDialog( BTN_CURRENT_SELECTION ); EndDialog( BTN_CURRENT_SELECTION );
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "sc.hrc" // -> RID_SCDLG_SORT #include "sc.hrc" // -> RID_SCDLG_SORT
// -> RID_SCPAGE_SORT_FIELDS // -> RID_SCPAGE_SORT_FIELDS
// -> RID_SCDLG_SORT_WARNING
// -> SCSTR_NONAME // -> SCSTR_NONAME
// -> SCSTR_UNDEFINED // -> SCSTR_UNDEFINED
// -> SCSTR_FIELD // -> SCSTR_FIELD
...@@ -33,10 +32,4 @@ ...@@ -33,10 +32,4 @@
#define WIN_MANAGESORTKEY 2 #define WIN_MANAGESORTKEY 2
#define SB_SORT 3 #define SB_SORT 3
#define FT_TEXT 1
#define FT_TIP 2
#define BTN_EXTSORT 3
#define BTN_CURSORT 4
#define BTN_CANCEL 5
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -56,11 +56,9 @@ public: ...@@ -56,11 +56,9 @@ public:
~ScSortWarningDlg(); ~ScSortWarningDlg();
DECL_LINK( BtnHdl, PushButton* ); DECL_LINK( BtnHdl, PushButton* );
private: private:
FixedText aFtText; FixedText* aFtText;
FixedText aFtTip; PushButton* aBtnExtSort;
PushButton aBtnExtSort; PushButton* aBtnCurSort;
PushButton aBtnCurSort;
CancelButton aBtnCancel;
}; };
#endif // SC_SORTDLG_HXX #endif // SC_SORTDLG_HXX
......
...@@ -74,52 +74,4 @@ TabDialog RID_SCDLG_SORT ...@@ -74,52 +74,4 @@ TabDialog RID_SCDLG_SORT
}; };
}; };
ModalDialog RID_SCDLG_SORT_WARNING
{
HelpID = "sc:ModalDialog:RID_SCDLG_SORT_WARNING";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 180 , 91 ) ;
Text [ en-US ] = "Sort Range" ;
Moveable = TRUE ;
Closeable = FALSE ;
FixedText FT_TEXT
{
Pos = MAP_APPFONT ( 8 , 3 ) ;
Size = MAP_APPFONT ( 170 , 33 ) ;
WordBreak = TRUE;
Text [ en-US ] = "The cells next to the current selection also contain data. Do you want to extend the sort range to %1, or sort the currently selected range, %2?";
};
FixedText FT_TIP
{
Pos = MAP_APPFONT ( 8 , 55 ) ;
Size = MAP_APPFONT ( 170 , 33 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "Tip: The sort range can be detected automatically. Place the cell cursor inside a list and execute sort. The whole range of neighboring non-empty cells will then be sorted.";
};
PushButton BTN_EXTSORT
{
HelpID = "sc:PushButton:RID_SCDLG_SORT_WARNING:BTN_EXTSORT";
Pos = MAP_APPFONT ( 6 , 39 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
Text [ en-US ] = "Extend selection";
};
PushButton BTN_CURSORT
{
HelpID = "sc:PushButton:RID_SCDLG_SORT_WARNING:BTN_CURSORT";
Pos = MAP_APPFONT ( 70 , 39 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Current selection";
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 134 , 39 ) ;
Size = MAP_APPFONT ( 40 , 14 ) ;
TabStop = TRUE ;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -150,7 +150,7 @@ static sal_Bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortPar ...@@ -150,7 +150,7 @@ static sal_Bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortPar
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
VclAbstractDialog* pWarningDlg = pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(),aExtendStr,aCurrentStr,RID_SCDLG_SORT_WARNING ); AbstractScSortWarningDlg* pWarningDlg = pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(), aExtendStr, aCurrentStr );
OSL_ENSURE(pWarningDlg, "Dialog create fail!"); OSL_ENSURE(pWarningDlg, "Dialog create fail!");
short bResult = pWarningDlg->Execute(); short bResult = pWarningDlg->Execute();
if( bResult == BTN_EXTEND_RANGE || bResult == BTN_CURRENT_SELECTION ) if( bResult == BTN_EXTEND_RANGE || bResult == BTN_CURRENT_SELECTION )
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="SortWarning">
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="default_height">200</property>
<property name="type_hint">dialog</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">6</property>
<property name="right_padding">6</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="sorttext">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">The cells next to the current selection also contain data. Do you want to extend the sort range to %1, or sort the currently selected range, %2?</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
<property name="max_width_chars">72</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="spacing">12</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="extend">
<property name="label" translatable="yes">_Extend selection</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">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="current">
<property name="label" translatable="yes">Current selection</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</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">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="sorttip">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Tip: The sort range can be detected automatically. Place the cell cursor inside a list and execute sort. The whole range of neighboring non-empty cells will then be sorted.</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
<property name="max_width_chars">72</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
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