[Libreoffice-commits] core.git: 2 commits - chart2/uiconfig sd/AllLangResTarget_sd.mk sd/source sd/uiconfig sd/UIConfig_sdraw.mk

Caolán McNamara caolanm at redhat.com
Wed Nov 13 01:55:24 PST 2013


 chart2/uiconfig/ui/attributedialog.ui |    1 
 sd/AllLangResTarget_sd.mk             |    1 
 sd/UIConfig_sdraw.mk                  |    1 
 sd/source/ui/dlg/brkdlg.cxx           |   42 ++++-----
 sd/source/ui/dlg/brkdlg.src           |   71 ----------------
 sd/source/ui/inc/BreakDlg.hxx         |   12 --
 sd/source/ui/inc/brkdlg.hrc           |   28 ------
 sd/source/ui/view/drviewsc.cxx        |    1 
 sd/uiconfig/sdraw/ui/breakdialog.ui   |  143 ++++++++++++++++++++++++++++++++++
 9 files changed, 165 insertions(+), 135 deletions(-)

New commits:
commit a4451e6e1ff41edfed8eff16b433ae8dab952945
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 13 09:53:51 2013 +0000

    convert break dialog to .ui
    
    Change-Id: Ic0cee9c164eb077f76403a154461f1d1f3b52921

diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk
index 2e311ef..b988697 100644
--- a/sd/AllLangResTarget_sd.mk
+++ b/sd/AllLangResTarget_sd.mk
@@ -42,7 +42,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
     sd/source/ui/app/strings.src \
     sd/source/ui/app/toolbox.src \
     sd/source/ui/dlg/animobjs.src \
-    sd/source/ui/dlg/brkdlg.src \
     sd/source/ui/dlg/dlgass.src \
     sd/source/ui/dlg/dlgfield.src \
     sd/source/ui/dlg/dlgolbul.src \
diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk
index 6ff0334..c6851e2 100644
--- a/sd/UIConfig_sdraw.mk
+++ b/sd/UIConfig_sdraw.mk
@@ -66,6 +66,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/sdraw,\
 ))
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\
+	sd/uiconfig/sdraw/ui/breakdialog \
 	sd/uiconfig/sdraw/ui/dlgsnap \
 	sd/uiconfig/sdraw/ui/copydlg \
 	sd/uiconfig/sdraw/ui/drawchardialog \
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index 676de78..8ec335b 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -26,7 +26,6 @@
 #include <vcl/msgbox.hxx>
 
 #include "sdattr.hxx"
-#include "brkdlg.hrc"
 #include "sdresid.hxx"
 #include "View.hxx"
 #include "drawview.hxx"
@@ -45,18 +44,16 @@ BreakDlg::BreakDlg(
     DrawDocShell* pShell,
     sal_uLong nSumActionCount,
     sal_uLong nObjCount )
-    : SfxModalDialog     ( pWindow, SdResId( DLG_BREAK ) ),
-      aFtObjInfo            ( this, SdResId( FT_OBJ_INFO ) ),
-      aFtActInfo            ( this, SdResId( FT_ACT_INFO ) ),
-      aFtInsInfo            ( this, SdResId( FT_INS_INFO ) ),
-      aFiObjInfo            ( this, SdResId( FI_OBJ_INFO ) ),
-      aFiActInfo            ( this, SdResId( FI_ACT_INFO ) ),
-      aFiInsInfo            ( this, SdResId( FI_INS_INFO ) ),
-      aBtnCancel            ( this, SdResId( BTN_CANCEL ) ),
-      aLink             ( LINK( this, BreakDlg, UpDate)),
-      mpProgress            ( NULL )
+    : SfxModalDialog(pWindow, "BreakDialog", "modules/sdraw/ui/breakdialog.ui")
+    , aLink( LINK(this, BreakDlg, UpDate))
+    , mpProgress( NULL )
 {
-    aBtnCancel.SetClickHdl( LINK( this, BreakDlg, CancelButtonHdl));
+    get(m_pFiObjInfo, "metafiles");
+    get(m_pFiActInfo, "metaobjects");
+    get(m_pFiInsInfo, "drawingobjects");
+    get(m_pBtnCancel, "cancel");
+
+    m_pBtnCancel->SetClickHdl( LINK( this, BreakDlg, CancelButtonHdl));
 
     mpProgress = new SfxProgress( pShell, SD_RESSTR(STR_BREAK_METAFILE), nSumActionCount*3 );
 
@@ -66,24 +63,19 @@ BreakDlg::BreakDlg(
 
     pDrView = _pDrView;
     bCancel = sal_False;
-
-    FreeResource();
 }
 
 BreakDlg::~BreakDlg()
 {
-    if( mpProgress )
-        delete mpProgress;
-
-    if( pProgrInfo )
-        delete pProgrInfo;
+    delete mpProgress;
+    delete pProgrInfo;
 }
 
 // Control-Handler for cancel button
 IMPL_LINK_NOARG(BreakDlg, CancelButtonHdl)
 {
   bCancel = sal_True;
-  aBtnCancel.Disable();
+  m_pBtnCancel->Disable();
   return( 0L );
 }
 
@@ -114,32 +106,32 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit )
     OUString info = OUString::number( pProgrInfo->GetCurObj() )
             + "/"
             + OUString::number( pProgrInfo->GetObjCount() );
-    aFiObjInfo.SetText(info);
+    m_pFiObjInfo->SetText(info);
 
     // how many actions are started?
     if(pProgrInfo->GetActionCount() == 0)
     {
-        aFiActInfo.SetText( OUString() );
+        m_pFiActInfo->SetText( OUString() );
     }
     else
     {
         info = OUString::number( pProgrInfo->GetCurAction() )
             + "/"
             + OUString::number( pProgrInfo->GetActionCount() );
-        aFiActInfo.SetText(info);
+        m_pFiActInfo->SetText(info);
     }
 
     // and inserted????
     if(pProgrInfo->GetInsertCount() == 0)
     {
-        aFiInsInfo.SetText( OUString() );
+        m_pFiInsInfo->SetText( OUString() );
     }
     else
     {
         info = OUString::number( pProgrInfo->GetCurInsert() )
             + "/"
             + OUString::number( pProgrInfo->GetInsertCount() );
-        aFiInsInfo.SetText(info);
+        m_pFiInsInfo->SetText(info);
     }
 
     Application::Reschedule();
diff --git a/sd/source/ui/dlg/brkdlg.src b/sd/source/ui/dlg/brkdlg.src
deleted file mode 100644
index d8e87fb..0000000
--- a/sd/source/ui/dlg/brkdlg.src
+++ /dev/null
@@ -1,71 +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 "brkdlg.hrc"
-ModalDialog DLG_BREAK
-{
-    HelpID = "sd:ModalDialog:DLG_BREAK";
-    OutputSize = TRUE;
-    SVLook   = TRUE;
-    Pos      = MAP_APPFONT( 84, 34 );
-    Size     = MAP_APPFONT( 160, 74 );
-    Moveable = TRUE;
-    FixedText FT_OBJ_INFO
-    {
-        Pos = MAP_APPFONT( 6, 6 );
-        Size = MAP_APPFONT( 85, 10 );
-        Text [ en-US ] = "Processing metafile:";
-    };
-    FixedText FT_ACT_INFO
-    {
-        Pos = MAP_APPFONT( 6, 22 );
-        Size = MAP_APPFONT( 106, 10 );
-        Text [ en-US ] = "Broken down metaobjects:";
-    };
-    FixedText FT_INS_INFO
-    {
-        Pos = MAP_APPFONT( 6, 38 );
-        Size = MAP_APPFONT( 90, 10 );
-        Text [ en-US ] = "Inserted drawing objects:";
-    };
-    FixedText FI_OBJ_INFO
-    {
-        Pos  = MAP_APPFONT( 100, 6 );
-        Size = MAP_APPFONT( 154, 10 );
-    };
-    FixedText FI_ACT_INFO
-    {
-        Pos      = MAP_APPFONT( 100, 22 );
-        Size     = MAP_APPFONT( 54, 10 );
-    };
-    FixedText FI_INS_INFO
-    {
-        Pos             = MAP_APPFONT( 100, 38 );
-        Size    = MAP_APPFONT( 54, 10 );
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT( 55, 54 );
-        Size = MAP_APPFONT( 50, 14 );
-        TabStop = TRUE;
-    };
-    Text [ en-US ] = "Break";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/BreakDlg.hxx b/sd/source/ui/inc/BreakDlg.hxx
index 632a5c1..f50b043 100644
--- a/sd/source/ui/inc/BreakDlg.hxx
+++ b/sd/source/ui/inc/BreakDlg.hxx
@@ -56,15 +56,11 @@ public:
     short Execute();
 
 private:
-    FixedText       aFtObjInfo;
-    FixedText       aFtActInfo;
-    FixedText       aFtInsInfo;
+    FixedText*      m_pFiObjInfo;
+    FixedText*      m_pFiActInfo;
+    FixedText*      m_pFiInsInfo;
+    CancelButton*   m_pBtnCancel;
 
-    FixedInfo       aFiObjInfo;
-    FixedInfo       aFiActInfo;
-    FixedInfo       aFiInsInfo;
-
-    CancelButton    aBtnCancel;
     DrawView*   pDrView;
 
     sal_Bool            bCancel;
diff --git a/sd/source/ui/inc/brkdlg.hrc b/sd/source/ui/inc/brkdlg.hrc
deleted file mode 100644
index 0311505..0000000
--- a/sd/source/ui/inc/brkdlg.hrc
+++ /dev/null
@@ -1,28 +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 .
- */
-#define FT_OBJ_INFO 1
-#define FT_ACT_INFO 2
-#define FT_INS_INFO 3
-#define FI_OBJ_INFO 4
-#define FI_ACT_INFO 5
-#define FI_INS_INFO 6
-#define BTN_CANCEL  7
-#define DLG_BREAK 6197
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index 4cdcdfc..5a9129d 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -49,7 +49,6 @@
 #include "DrawDocShell.hxx"
 #include "drawview.hxx"
 #include "sdabstdlg.hxx"
-#include "brkdlg.hrc"
 namespace sd {
 
 /**
diff --git a/sd/uiconfig/sdraw/ui/breakdialog.ui b/sd/uiconfig/sdraw/ui/breakdialog.ui
new file mode 100644
index 0000000..8ae980a
--- /dev/null
+++ b/sd/uiconfig/sdraw/ui/breakdialog.ui
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="BreakDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Break</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="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>
+            <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">Processing metafile:</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="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Broken down metaobjects:</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>
+            <child>
+              <object class="GtkLabel" id="label3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Inserted drawing objects:</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="metafiles">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="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="GtkLabel" id="metaobjects">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label">                    </property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="drawingobjects">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label">                    </property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">2</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 d1062ff1a5d922b96aea0f422b9399dbafe9e18c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 13 08:52:42 2013 +0000

    allow this dialog to be resizable
    
    Change-Id: I7bc9a25e33f268608877636f215055df910b62ab

diff --git a/chart2/uiconfig/ui/attributedialog.ui b/chart2/uiconfig/ui/attributedialog.ui
index 27972c3..6053ab2 100644
--- a/chart2/uiconfig/ui/attributedialog.ui
+++ b/chart2/uiconfig/ui/attributedialog.ui
@@ -4,7 +4,6 @@
   <object class="GtkDialog" id="AttributeDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
-    <property name="resizable">False</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">


More information about the Libreoffice-commits mailing list