[Libreoffice-commits] core.git: desktop/Library_deploymentgui.mk desktop/source desktop/uiconfig extras/source

Caolán McNamara caolanm at redhat.com
Tue May 27 04:08:44 PDT 2014


 desktop/Library_deploymentgui.mk                             |    1 
 desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx      |   68 -----------
 desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx      |   45 -------
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx        |    4 
 desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx |   19 +--
 desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx |    8 -
 desktop/uiconfig/ui/updateinstalldialog.ui                   |   31 +----
 extras/source/glade/libreoffice-catalog.xml.in               |    3 
 8 files changed, 25 insertions(+), 154 deletions(-)

New commits:
commit 9172ee72938a42f9f792b627c47f42f02ce468df
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 27 11:51:52 2014 +0100

    the stock multilineedit is sufficient IMO
    
    Change-Id: I374c17fcda80c4f821271bf665a41beae100cccf

diff --git a/desktop/Library_deploymentgui.mk b/desktop/Library_deploymentgui.mk
index ec0a836..cdf8bcd 100644
--- a/desktop/Library_deploymentgui.mk
+++ b/desktop/Library_deploymentgui.mk
@@ -56,7 +56,6 @@ endif
 $(eval $(call gb_Library_set_componentfile,deploymentgui,desktop/source/deployment/gui/deploymentgui))
 
 $(eval $(call gb_Library_add_exception_objects,deploymentgui,\
-    desktop/source/deployment/gui/dp_gui_autoscrolledit \
     desktop/source/deployment/gui/dp_gui_dependencydialog \
     desktop/source/deployment/gui/dp_gui_dialog2 \
     desktop/source/deployment/gui/dp_gui_extensioncmdqueue \
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
deleted file mode 100644
index 2292472..0000000
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
+++ /dev/null
@@ -1,68 +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 "svtools/svmedit2.hxx"
-#include "svl/lstner.hxx"
-#include "vcl/xtextedt.hxx"
-#include "vcl/scrbar.hxx"
-#include "vcl/builder.hxx"
-
-#include "dp_gui_autoscrolledit.hxx"
-
-
-namespace dp_gui {
-
-
-AutoScrollEdit::AutoScrollEdit( Window* pParent, WinBits nWinStyle )
-    : ExtMultiLineEdit( pParent, nWinStyle )
-{
-    ScrollBar*  pScroll = GetVScrollBar();
-    if (pScroll)
-        pScroll->Hide();
-    StartListening( *GetTextEngine() );
-}
-
-AutoScrollEdit::~AutoScrollEdit()
-{
-    EndListeningAll();
-}
-
-void AutoScrollEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
-{
-    if ( rHint.IsA( TYPE(TextHint) ) )
-    {
-        sal_uLong   nId = ((const TextHint&)rHint).GetId();
-        if ( nId == TEXT_HINT_VIEWSCROLLED )
-        {
-            ScrollBar*  pScroll = GetVScrollBar();
-            if ( pScroll )
-                pScroll->Show();
-        }
-    }
-}
-
-
-} // namespace dp_gui
-
-extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeAutoScrollEdit(Window *pParent, VclBuilder::stringmap &)
-{
-    return new dp_gui::AutoScrollEdit(pParent, WB_BORDER);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx
deleted file mode 100644
index 8707bfa..0000000
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx
+++ /dev/null
@@ -1,45 +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 .
- */
-#ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_AUTOSCROLLEDIT_HXX
-#define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_AUTOSCROLLEDIT_HXX
-
-#include "svtools/svmedit2.hxx"
-#include "svl/lstner.hxx"
-
-namespace dp_gui {
-
-/** This control shows automatically the vertical scroll bar if text is inserted,
-    that does not fit into the text area. In the resource one uses MultiLineEdit
-    and needs to set VScroll = TRUE
-*/
-class AutoScrollEdit : public ExtMultiLineEdit, public SfxListener
-{
-public:
-    AutoScrollEdit( Window* pParent, WinBits nWinStyle);
-    virtual ~AutoScrollEdit();
-
-    using ExtMultiLineEdit::Notify;
-    virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
-};
-
-} // namespace dp_gui
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 02db3ff..1586152 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -138,9 +138,9 @@ static const sal_uInt16 CMD_IGNORE_ALL_UPDATES = 3;
 enum Kind { ENABLED_UPDATE, DISABLED_UPDATE, SPECIFIC_ERROR };
 
 OUString confineToParagraph(OUString const & text) {
-    // Confine arbitrary text to a single paragraph in a dp_gui::AutoScrollEdit.
+    // Confine arbitrary text to a single paragraph in a VclMultiLineEdit
     // This assumes that U+000A and U+000D are the only paragraph separators in
-    // a dp_gui::AutoScrollEdit, and that replacing them with a single space
+    // a VclMultiLineEdit, and that replacing them with a single space
     // each is acceptable:
     return text.replace(LF, ' ').replace(CR, ' ');
 }
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index bf4b40a..a7bb5b1 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -225,6 +225,8 @@ UpdateInstallDialog::UpdateInstallDialog(
     get(m_pStatusbar, "STATUSBAR");
     get(m_pFt_extension_name, "EXTENSION_NAME");
     get(m_pMle_info, "INFO");
+    m_pMle_info->set_height_request(m_pMle_info->GetTextHeight() * 5);
+    m_pMle_info->set_width_request(m_pMle_info->approximate_char_width() * 56);
     get(m_pHelp, "HELP");
     get(m_pOk, "OK");
     get(m_pCancel, "CANCEL");
@@ -232,7 +234,6 @@ UpdateInstallDialog::UpdateInstallDialog(
     m_xExtensionManager = css::deployment::ExtensionManager::get( xCtx );
 
     m_pCancel->SetClickHdl(LINK(this, UpdateInstallDialog, cancelHandler));
-    m_pMle_info->EnableCursor(false);
     if ( ! dp_misc::office_is_running())
         m_pHelp->Disable();
 }
@@ -255,7 +256,7 @@ short UpdateInstallDialog::Execute()
 void UpdateInstallDialog::updateDone()
 {
     if (!m_bError)
-        m_pMle_info->InsertText(m_sNoErrors);
+        m_pMle_info->SetText(m_pMle_info->GetText() + m_sNoErrors);
     m_pOk->Enable();
     m_pOk->GrabFocus();
     m_pCancel->Disable();
@@ -284,26 +285,28 @@ void UpdateInstallDialog::setError(INSTALL_ERROR err, OUString const & sExtensio
         OSL_ASSERT(false);
     }
 
+    OUString sMsg(m_pMle_info->GetText());
     sError = sError.replaceFirst("%NAME", sExtension);
     //We want to have an empty line between the error messages. However,
     //there shall be no empty line after the last entry.
     if (m_bNoEntry)
         m_bNoEntry = false;
     else
-        m_pMle_info->InsertText(OUString("\n"));
-    m_pMle_info->InsertText(sError);
+        sMsg += "\n";
+    sMsg += sError;
     //Insert more information about the error
     if (!exceptionMessage.isEmpty())
-        m_pMle_info->InsertText(m_sThisErrorOccurred + exceptionMessage + "\n");
+        sMsg += m_sThisErrorOccurred + exceptionMessage + "\n";
 
-    m_pMle_info->InsertText(m_sNoInstall);
-    m_pMle_info->InsertText(OUString("\n"));
+    sMsg += m_sNoInstall + "\n";
+
+    m_pMle_info->SetText(sMsg);
 }
 
 void UpdateInstallDialog::setError(OUString const & exceptionMessage)
 {
     m_bError = true;
-    m_pMle_info->InsertText(exceptionMessage + "\n");
+    m_pMle_info->SetText(m_pMle_info->GetText() + exceptionMessage + "\n");
 }
 
 IMPL_LINK_NOARG(UpdateInstallDialog, cancelHandler)
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
index d7b68e2..fb594cd 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
@@ -25,12 +25,11 @@
 #include "vcl/fixed.hxx"
 #include "vcl/dialog.hxx"
 #include "vcl/prgsbar.hxx"
+#include "vcl/vclmedit.hxx"
 #include "rtl/ref.hxx"
 #include <vector>
 
-#include "dp_gui_autoscrolledit.hxx"
 /// @HTML
-
 namespace com { namespace sun { namespace star { namespace deployment {
     class XExtensionManager;
 }}}}
@@ -109,15 +108,12 @@ private:
     FixedText *m_pFt_action;
     ProgressBar *m_pStatusbar;
     FixedText *m_pFt_extension_name;
-    AutoScrollEdit *m_pMle_info;
+    VclMultiLineEdit *m_pMle_info;
     HelpButton *m_pHelp;
     OKButton *m_pOk;
     CancelButton *m_pCancel;
 };
 
-
-
-
 }
 
 #endif
diff --git a/desktop/uiconfig/ui/updateinstalldialog.ui b/desktop/uiconfig/ui/updateinstalldialog.ui
index 079f0d8..6af0f31 100644
--- a/desktop/uiconfig/ui/updateinstalldialog.ui
+++ b/desktop/uiconfig/ui/updateinstalldialog.ui
@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
 <interface>
-  <!-- interface-requires LibreOffice 1.0 -->
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkDialog" id="UpdateInstallDialog">
-    <property name="width_request">500</property>
-    <property name="height_request">250</property>
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes">Download and Installation</property>
@@ -25,7 +23,6 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -42,7 +39,6 @@
                 <property name="sensitive">False</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -58,7 +54,6 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -89,6 +84,8 @@
                 <property name="can_focus">False</property>
                 <property name="halign">start</property>
                 <property name="label" translatable="yes">Downloading extensions...</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">STATUSBAR</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -125,6 +122,8 @@
                 <property name="can_focus">False</property>
                 <property name="halign">start</property>
                 <property name="label" translatable="yes">Result</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">INFO</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -133,26 +132,16 @@
               </packing>
             </child>
             <child>
-              <object class="GtkScrolledWindow" id="scrolledwindow1">
+              <object class="GtkTextView" id="INFO">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <property name="shadow_type">in</property>
-                <child>
-                  <object class="deploymentgui-AutoScrollEdit" id="INFO">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
-                    <property name="editable">False</property>
-                    <property name="cursor_visible">False</property>
-                    <property name="accepts_tab">False</property>
-                  </object>
-                </child>
+                <property name="editable">False</property>
+                <property name="cursor_visible">False</property>
               </object>
               <packing>
-                <property name="expand">True</property>
+                <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">4</property>
               </packing>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 01f9ba3..fb120fa 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -323,9 +323,6 @@
     <glade-widget-class title="Cui Custom MultiLine Edit" name="cuilo-CuiCustomMultilineEdit"
                         generic-name="CuiCustomMultiLineEdit" parent="GtkTextView"
                         icon-name="widget-gtk-textview"/>
-    <glade-widget-class title="AutoScrollEdit" name="deploymentgui-AutoScrollEdit"
-                        generic-name="AutoScrollEdit" parent="GtkTextView"
-                        icon-name="widget-gtk-textview"/>
     <glade-widget-class title="LicenseView" name="deploymentgui-LicenseView"
                         generic-name="LicenseView" parent="GtkTextView"
                         icon-name="widget-gtk-textview"/>


More information about the Libreoffice-commits mailing list