summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-29 23:24:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-12-30 00:21:09 +0000
commitecc62c9cd21bec2580d5a936c7784735bff89504 (patch)
tree54567c732825ef51cab5f4dca4da1815ab4e87c9
parente2591cdeeb9a7d2d87e8c8772eed3ece6056fae1 (diff)
convert solver progress dialog to .ui
Change-Id: I259f7d75591121be584e3a8cfe514232a404c0fa
-rw-r--r--sc/AllLangResTarget_sc.mk1
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/helpids.h1
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/source/ui/inc/optsolver.hrc33
-rw-r--r--sc/source/ui/inc/optsolver.hxx6
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx27
-rw-r--r--sc/source/ui/src/optsolver.src59
-rw-r--r--sc/uiconfig/scalc/ui/solverprogressdialog.ui90
-rw-r--r--sc/uiconfig/scalc/ui/solversuccessdialog.ui2
10 files changed, 101 insertions, 120 deletions
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index ae6faa25739a..9bf30003658a 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -36,7 +36,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/src/popup.src \
sc/source/ui/src/autofmt.src \
sc/source/ui/src/globstr.src \
- sc/source/ui/src/optsolver.src \
sc/source/ui/src/toolbox.src \
sc/source/ui/src/scfuncs.src \
sc/source/ui/src/textdlgs.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 41bcb7cc0b94..2473b255c1e1 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -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/solverprogressdialog \
sc/uiconfig/scalc/ui/solversuccessdialog \
sc/uiconfig/scalc/ui/sortcriteriapage \
sc/uiconfig/scalc/ui/sortdialog \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 8d989dde85c0..e13c082b9fb6 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -162,7 +162,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_SCDLG_CONFLICTS "SC_HID_SCDLG_CONFLICTS"
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 0b0f3980fd06..7230fee5dfe7 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1094,7 +1094,6 @@
#define RID_SCDLG_DPSHOWDETAIL (SC_DIALOGS_START + 137)
#define RID_SCDLG_SOLVEROPTIONS (SC_DIALOGS_START + 139)
-#define RID_SCDLG_SOLVER_PROGRESS (SC_DIALOGS_START + 142)
#define RID_SCDLG_CONFLICTS (SC_DIALOGS_START + 145)
#define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146)
diff --git a/sc/source/ui/inc/optsolver.hrc b/sc/source/ui/inc/optsolver.hrc
deleted file mode 100644
index bbb3bce07e94..000000000000
--- a/sc/source/ui/inc/optsolver.hrc
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sc.hrc"
-
-#define FT_PROGRESS 7
-#define FT_TIMELIMIT 8
-
-#define FL_CONDITIONS 1
-#define FL_BUTTONS 2
-
-#define BTN_HELP 2
-#define BTN_CLOSE 3
-#define BTN_OK 4
-#define BTN_CANCEL 5
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index 1f850d7c7ca6..f4af6effb496 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -206,14 +206,10 @@ private:
class ScSolverProgressDialog : public ModelessDialog
{
- FixedText maFtProgress;
- FixedText maFtTime;
- FixedLine maFlButtons;
- OKButton maBtnOk;
+ FixedText* m_pFtTime;
public:
ScSolverProgressDialog( Window* pParent );
- ~ScSolverProgressDialog();
void HideTimeLimit();
void SetTimeLimit( sal_Int32 nSeconds );
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 7648ac2bd4a2..3a02d8d5943f 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -38,7 +38,6 @@
#include "solveroptions.hxx"
#include "solverutil.hxx"
#include "globstr.hrc"
-#include "optsolver.hrc"
#include "optsolver.hxx"
@@ -47,33 +46,23 @@
using namespace com::sun::star;
-//----------------------------------------------------------------------------
-
-ScSolverProgressDialog::ScSolverProgressDialog( Window* pParent )
- : ModelessDialog( pParent, ScResId( RID_SCDLG_SOLVER_PROGRESS ) ),
- maFtProgress ( this, ScResId( FT_PROGRESS ) ),
- maFtTime ( this, ScResId( FT_TIMELIMIT ) ),
- maFlButtons ( this, ScResId( FL_BUTTONS ) ),
- maBtnOk ( this, ScResId( BTN_OK ) )
-{
- maBtnOk.Enable(false);
- FreeResource();
-}
-
-ScSolverProgressDialog::~ScSolverProgressDialog()
+ScSolverProgressDialog::ScSolverProgressDialog(Window* pParent)
+ : ModelessDialog(pParent, "SolverProgressDialog",
+ "modules/scalc/ui/solverprogressdialog.ui")
{
+ get(m_pFtTime, "progress");
}
void ScSolverProgressDialog::HideTimeLimit()
{
- maFtTime.Hide();
+ m_pFtTime->Hide();
}
void ScSolverProgressDialog::SetTimeLimit( sal_Int32 nSeconds )
{
- OUString aOld = maFtTime.GetText();
- OUString aNew = aOld.getToken(0,'#') + OUString::number( nSeconds ) + aOld.getToken(1,'#');
- maFtTime.SetText( aNew );
+ OUString aOld = m_pFtTime->GetText();
+ OUString aNew = aOld.replaceFirst("#", OUString::number(nSeconds));
+ m_pFtTime->SetText( aNew );
}
//----------------------------------------------------------------------------
diff --git a/sc/source/ui/src/optsolver.src b/sc/source/ui/src/optsolver.src
deleted file mode 100644
index 9ab6de12dd0e..000000000000
--- a/sc/source/ui/src/optsolver.src
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "optsolver.hrc"
-
-ModelessDialog RID_SCDLG_SOLVER_PROGRESS
-{
- OutputSize = TRUE ;
- HelpId = HID_SC_SOLVER_PROGRESS ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 118 , 72 ) ;
- Moveable = TRUE ;
- Closeable = FALSE ;
- FixedText FT_PROGRESS
- {
- Pos = MAP_APPFONT ( 6 , 11 ) ;
- Size = MAP_APPFONT ( 106 , 8 ) ;
- Center = TRUE ;
- Text [ en-US ] = "Solving in progress..." ;
- };
- FixedText FT_TIMELIMIT
- {
- Pos = MAP_APPFONT ( 6 , 25 ) ;
- Size = MAP_APPFONT ( 106 , 8 ) ;
- Center = TRUE ;
- Text [ en-US ] = "(time limit # seconds)" ;
- };
- FixedLine FL_BUTTONS
- {
- Pos = MAP_APPFONT ( 0 , 41 ) ;
- Size = MAP_APPFONT ( 118 , 8 ) ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 34 , 52 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- Text [ en-US ] = "Solving..." ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/solverprogressdialog.ui b/sc/uiconfig/scalc/ui/solverprogressdialog.ui
new file mode 100644
index 000000000000..1e43f566095a
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/solverprogressdialog.ui
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="SolverProgressDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Solving...</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="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Solving in progress...</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="progress">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">(time limit # seconds)</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">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</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>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</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-widgets>
+ </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/solversuccessdialog.ui b/sc/uiconfig/scalc/ui/solversuccessdialog.ui
index c0e461991fa2..3c01f37e2b26 100644
--- a/sc/uiconfig/scalc/ui/solversuccessdialog.ui
+++ b/sc/uiconfig/scalc/ui/solversuccessdialog.ui
@@ -23,7 +23,7 @@
<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>
+ <property name="max_width_chars">40</property>
</object>
<packing>
<property name="left_attach">0</property>