[Libreoffice-commits] core.git: sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk

Caolán McNamara caolanm at redhat.com
Fri Dec 20 02:52:40 PST 2013


 sc/UIConfig_scalc.mk                           |    1 
 sc/inc/helpids.h                               |    1 
 sc/inc/sc.hrc                                  |    1 
 sc/source/ui/inc/optsolver.hrc                 |    2 
 sc/source/ui/inc/optsolver.hxx                 |    8 --
 sc/source/ui/miscdlgs/optsolver.cxx            |   14 ---
 sc/source/ui/src/optsolver.src                 |   36 ----------
 sc/uiconfig/scalc/ui/nosolutiondialog.ui       |   90 +++++++++++++++++++++++++
 sc/uiconfig/scalc/ui/optimalrowheightdialog.ui |   70 +------------------
 9 files changed, 103 insertions(+), 120 deletions(-)

New commits:
commit 1822302066fba5a21a8fb72cbaaae9bbe4cf9fbd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 20 10:46:52 2013 +0000

    convert solver no solution dialog to .ui
    
    Change-Id: I94ba29d328c443e0f944fef8d33fc25cdc0e9694

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 3cd1c63..f55823e 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -99,6 +99,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/leftheaderdialog \
 	sc/uiconfig/scalc/ui/namerangesdialog \
 	sc/uiconfig/scalc/ui/managenamesdialog \
+	sc/uiconfig/scalc/ui/nosolutiondialog \
 	sc/uiconfig/scalc/ui/optcalculatepage \
 	sc/uiconfig/scalc/ui/optchangespage \
 	sc/uiconfig/scalc/ui/optcompatibilitypage \
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 9188d40..22526d6 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -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_NOSOLUTION                                "SC_HID_SC_SOLVER_NOSOLUTION"
 #define HID_SC_SOLVER_SUCCESS                                   "SC_HID_SC_SOLVER_SUCCESS"
 
 #define HID_SCDLG_CONFLICTS                                     "SC_HID_SCDLG_CONFLICTS"
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 78d887a..000a6e1 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1085,7 +1085,6 @@
 
 #define RID_SCDLG_SOLVEROPTIONS         (SC_DIALOGS_START + 139)
 #define RID_SCDLG_SOLVER_PROGRESS       (SC_DIALOGS_START + 142)
-#define RID_SCDLG_SOLVER_NOSOLUTION     (SC_DIALOGS_START + 143)
 #define RID_SCDLG_SOLVER_SUCCESS        (SC_DIALOGS_START + 144)
 
 #define RID_SCDLG_CONFLICTS             (SC_DIALOGS_START + 145)
diff --git a/sc/source/ui/inc/optsolver.hrc b/sc/source/ui/inc/optsolver.hrc
index 5557cf7..f72063e 100644
--- a/sc/source/ui/inc/optsolver.hrc
+++ b/sc/source/ui/inc/optsolver.hrc
@@ -21,8 +21,6 @@
 
 #define FT_PROGRESS             7
 #define FT_TIMELIMIT            8
-#define FT_NOSOLUTION           9
-#define FT_ERRORTEXT            10
 #define FT_SUCCESS              11
 #define FT_RESULT               12
 #define FT_QUESTION             13
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index ad80ced..aaf756d 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -221,14 +221,10 @@ public:
 
 class ScSolverNoSolutionDialog : public ModalDialog
 {
-    FixedText       maFtNoSolution;
-    FixedText       maFtErrorText;
-    FixedLine       maFlButtons;
-    OKButton        maBtnOk;
+    FixedText* m_pFtErrorText;
 
 public:
-    ScSolverNoSolutionDialog( Window* pParent, const OUString& rErrorText );
-    ~ScSolverNoSolutionDialog();
+    ScSolverNoSolutionDialog(Window* pParent, const OUString& rErrorText);
 };
 
 class ScSolverSuccessDialog : public ModalDialog
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 873a81a..d0020e2 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -79,18 +79,10 @@ void ScSolverProgressDialog::SetTimeLimit( sal_Int32 nSeconds )
 //----------------------------------------------------------------------------
 
 ScSolverNoSolutionDialog::ScSolverNoSolutionDialog( Window* pParent, const OUString& rErrorText )
-    : ModalDialog( pParent, ScResId( RID_SCDLG_SOLVER_NOSOLUTION ) ),
-    maFtNoSolution  ( this, ScResId( FT_NOSOLUTION ) ),
-    maFtErrorText   ( this, ScResId( FT_ERRORTEXT ) ),
-    maFlButtons     ( this, ScResId( FL_BUTTONS ) ),
-    maBtnOk         ( this, ScResId( BTN_OK ) )
-{
-    maFtErrorText.SetText( rErrorText );
-    FreeResource();
-}
-
-ScSolverNoSolutionDialog::~ScSolverNoSolutionDialog()
+    : ModalDialog(pParent, "NoSolutionDialog", "modules/scalc/ui/nosolutiondialog.ui")
 {
+    get(m_pFtErrorText, "error");
+    m_pFtErrorText->SetText(rErrorText);
 }
 
 //----------------------------------------------------------------------------
diff --git a/sc/source/ui/src/optsolver.src b/sc/source/ui/src/optsolver.src
index 477baad..1de4b5e 100644
--- a/sc/source/ui/src/optsolver.src
+++ b/sc/source/ui/src/optsolver.src
@@ -57,42 +57,6 @@ ModelessDialog RID_SCDLG_SOLVER_PROGRESS
 };
 
 
-ModalDialog RID_SCDLG_SOLVER_NOSOLUTION
-{
-    OutputSize = TRUE ;
-    HelpId = HID_SC_SOLVER_NOSOLUTION ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 118 , 72 ) ;
-    Moveable = TRUE ;
-    FixedText FT_NOSOLUTION
-    {
-        Pos = MAP_APPFONT ( 6 , 8 ) ;
-        Size = MAP_APPFONT ( 106 , 8 ) ;
-        Text [ en-US ] = "No solution was found." ;
-    };
-    FixedText FT_ERRORTEXT
-    {
-        Pos = MAP_APPFONT ( 6 , 22 ) ;
-        Size = MAP_APPFONT ( 106 , 16 ) ;
-        WordBreak = TRUE ;
-        // text is dynamic
-    };
-    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 ] = "No Solution" ;
-};
-
-
 ModalDialog RID_SCDLG_SOLVER_SUCCESS
 {
     OutputSize = TRUE ;
diff --git a/sc/uiconfig/scalc/ui/nosolutiondialog.ui b/sc/uiconfig/scalc/ui/nosolutiondialog.ui
new file mode 100644
index 0000000..e08986e
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/nosolutiondialog.ui
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="NoSolutionDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">No Solution</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="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>
+              </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="hexpand">True</property>
+            <property name="row_spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="label" translatable="yes">No solution was found.</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="error">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">56</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">1</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/optimalrowheightdialog.ui b/sc/uiconfig/scalc/ui/optimalrowheightdialog.ui
index 6a4beeb..0dee26e 100644
--- a/sc/uiconfig/scalc/ui/optimalrowheightdialog.ui
+++ b/sc/uiconfig/scalc/ui/optimalrowheightdialog.ui
@@ -31,34 +31,6 @@
                 <property name="position">0</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>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="help">
-                <property name="label">gtk-help</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>
@@ -68,22 +40,17 @@
           </packing>
         </child>
         <child>
-          <object class="GtkGrid" id="grid2">
+          <object class="GtkGrid" id="grid1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="valign">start</property>
             <property name="hexpand">True</property>
-            <property name="vexpand">True</property>
             <property name="row_spacing">6</property>
-            <property name="column_spacing">12</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">Add</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">value:0.00cm</property>
+                <property name="hexpand">True</property>
+                <property name="label" translatable="yes">No solution was found.</property>
               </object>
               <packing>
                 <property name="left_attach">0</property>
@@ -93,40 +60,19 @@
               </packing>
             </child>
             <child>
-              <object class="GtkSpinButton" id="value:0.00cm">
+              <object class="GtkLabel" id="error">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
+                <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
-                <property name="invisible_char">•</property>
-                <property name="digits">2</property>
+                <property name="label" translatable="yes">label</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkCheckButton" id="default">
-                <property name="label" translatable="yes">_Default value</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-                <property name="xalign">0</property>
-                <property name="draw_indicator">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
+                <property name="left_attach">0</property>
                 <property name="top_attach">1</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
             </child>
-            <child>
-              <placeholder/>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -138,8 +84,6 @@
     </child>
     <action-widgets>
       <action-widget response="0">ok</action-widget>
-      <action-widget response="0">cancel</action-widget>
-      <action-widget response="0">help</action-widget>
     </action-widgets>
   </object>
 </interface>


More information about the Libreoffice-commits mailing list