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

convert solver success dialog to .ui

Change-Id: Ia9062a21afde96510a4953d1b51e7e59e9012fb7
üst 5825567c
......@@ -137,6 +137,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/sidebarnumberformat \
sc/uiconfig/scalc/ui/sidebarcellappearance \
sc/uiconfig/scalc/ui/solverdlg \
sc/uiconfig/scalc/ui/solversuccessdialog \
sc/uiconfig/scalc/ui/sortcriteriapage \
sc/uiconfig/scalc/ui/sortdialog \
sc/uiconfig/scalc/ui/sortkey \
......
......@@ -163,7 +163,6 @@
#define HID_SC_SOLVEROPTIONS "SC_HID_SC_SOLVEROPTIONS"
#define HID_SC_SOLVEROPTIONS_LB "SC_HID_SC_SOLVEROPTIONS_LB"
#define HID_SC_SOLVER_PROGRESS "SC_HID_SC_SOLVER_PROGRESS"
#define HID_SC_SOLVER_SUCCESS "SC_HID_SC_SOLVER_SUCCESS"
#define HID_SCDLG_CONFLICTS "SC_HID_SCDLG_CONFLICTS"
......
......@@ -1095,7 +1095,6 @@
#define RID_SCDLG_SOLVEROPTIONS (SC_DIALOGS_START + 139)
#define RID_SCDLG_SOLVER_PROGRESS (SC_DIALOGS_START + 142)
#define RID_SCDLG_SOLVER_SUCCESS (SC_DIALOGS_START + 144)
#define RID_SCDLG_CONFLICTS (SC_DIALOGS_START + 145)
#define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146)
......
......@@ -21,9 +21,6 @@
#define FT_PROGRESS 7
#define FT_TIMELIMIT 8
#define FT_SUCCESS 11
#define FT_RESULT 12
#define FT_QUESTION 13
#define FL_CONDITIONS 1
#define FL_BUTTONS 2
......
......@@ -229,16 +229,14 @@ public:
class ScSolverSuccessDialog : public ModalDialog
{
FixedText maFtSuccess;
FixedText maFtResult;
FixedText maFtQuestion;
FixedLine maFlButtons;
OKButton maBtnOk;
CancelButton maBtnCancel;
FixedText* m_pFtResult;
PushButton* m_pBtnOk;
PushButton* m_pBtnCancel;
DECL_LINK(ClickHdl, PushButton*);
public:
ScSolverSuccessDialog( Window* pParent, const OUString& rSolution );
~ScSolverSuccessDialog();
};
......
......@@ -88,21 +88,24 @@ ScSolverNoSolutionDialog::ScSolverNoSolutionDialog( Window* pParent, const OUStr
//----------------------------------------------------------------------------
ScSolverSuccessDialog::ScSolverSuccessDialog( Window* pParent, const OUString& rSolution )
: ModalDialog( pParent, ScResId( RID_SCDLG_SOLVER_SUCCESS ) ),
maFtSuccess ( this, ScResId( FT_SUCCESS ) ),
maFtResult ( this, ScResId( FT_RESULT ) ),
maFtQuestion ( this, ScResId( FT_QUESTION ) ),
maFlButtons ( this, ScResId( FL_BUTTONS ) ),
maBtnOk ( this, ScResId( BTN_OK ) ),
maBtnCancel ( this, ScResId( BTN_CANCEL ) )
: ModalDialog(pParent, "SolverSuccessDialog", "modules/scalc/ui/solversuccessdialog.ui")
{
OUString aMessage = maFtResult.GetText() + " " + rSolution;
maFtResult.SetText( aMessage );
FreeResource();
get(m_pFtResult, "result");
get(m_pBtnOk, "ok");
m_pBtnOk->SetClickHdl(LINK(this, ScSolverSuccessDialog, ClickHdl));
get(m_pBtnCancel, "cancel");
m_pBtnCancel->SetClickHdl(LINK(this, ScSolverSuccessDialog, ClickHdl));
OUString aMessage = m_pFtResult->GetText() + " " + rSolution;
m_pFtResult->SetText(aMessage);
}
ScSolverSuccessDialog::~ScSolverSuccessDialog()
IMPL_LINK( ScSolverSuccessDialog, ClickHdl, PushButton*, pBtn )
{
if (pBtn == m_pBtnOk)
EndDialog(true);
else
EndDialog(false);
return 0;
}
//----------------------------------------------------------------------------
......
......@@ -56,54 +56,4 @@ ModelessDialog RID_SCDLG_SOLVER_PROGRESS
Text [ en-US ] = "Solving..." ;
};
ModalDialog RID_SCDLG_SOLVER_SUCCESS
{
OutputSize = TRUE ;
HelpId = HID_SC_SOLVER_SUCCESS ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 138 , 89 ) ;
Moveable = TRUE ;
FixedText FT_SUCCESS
{
Pos = MAP_APPFONT ( 6 , 8 ) ;
Size = MAP_APPFONT ( 126 , 8 ) ;
Text [ en-US ] = "Solving successfully finished." ;
};
FixedText FT_RESULT
{
Pos = MAP_APPFONT ( 6 , 22 ) ;
Size = MAP_APPFONT ( 126 , 8 ) ;
Text [ en-US ] = "Result:" ;
};
FixedText FT_QUESTION
{
Pos = MAP_APPFONT ( 6 , 36 ) ;
Size = MAP_APPFONT ( 126 , 16 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "Do you want to keep the result or do you want to restore previous values?" ;
};
FixedLine FL_BUTTONS
{
Pos = MAP_APPFONT ( 0 , 58 ) ;
Size = MAP_APPFONT ( 138 , 8 ) ;
};
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 6 , 69 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
Text [ en-US ] = "Keep Result" ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 72 , 69 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Restore Previous" ;
};
Text [ en-US ] = "Solving Result" ;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="SolverSuccessDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Solving Result</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>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">24</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Do you want to keep the result or do you want to restore previous values?</property>
<property name="wrap">True</property>
<property name="max_width_chars">52</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Solving successfully finished.</property>
</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="GtkLabel" id="result">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Result:</property>
</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">0</property>
</packing>
</child>
<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="ok">
<property name="label">Keep Result</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_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="cancel">
<property name="label">Restore Previous</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">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">2</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>
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