[Libreoffice-commits] core.git: 2 commits - cui/source cui/uiconfig include/svtools svtools/source svtools/uiconfig

Caolán McNamara caolanm at redhat.com
Tue Aug 2 20:05:54 UTC 2016


 cui/source/options/optgdlg.cxx           |   33 +++++++++++++++++--------------
 cui/uiconfig/ui/optviewpage.ui           |    9 ++++----
 include/svtools/restartdialog.hxx        |    5 +++-
 svtools/source/dialogs/restartdialog.cxx |    3 ++
 svtools/uiconfig/ui/restartdialog.ui     |   17 +++++++++++++++
 5 files changed, 47 insertions(+), 20 deletions(-)

New commits:
commit 4e8bc5462a01818f0f9c92a09f1bdc68821187f4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 2 21:04:44 2016 +0100

    Related: tdf#101196 prompt to restart after OpenGL config changes
    
    Change-Id: If0ade12ed4cf360bdac8cfbec7bb09c9a640fc6d

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 1f6019f..5c7944d 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -868,8 +868,13 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
         }
     }
 
-    mpOpenGLConfig->setUseOpenGL(m_pUseOpenGL->IsChecked());
-    mpOpenGLConfig->setForceOpenGL(m_pForceOpenGL->IsChecked());
+    if (m_pUseOpenGL->IsValueChangedFromSaved() ||
+        m_pForceOpenGL->IsValueChangedFromSaved())
+    {
+        mpOpenGLConfig->setUseOpenGL(m_pUseOpenGL->IsChecked());
+        mpOpenGLConfig->setForceOpenGL(m_pForceOpenGL->IsChecked());
+        bModified = true;
+    }
 
     if( bMenuOptModified )
     {
@@ -898,6 +903,15 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
         }
     }
 
+    if (m_pUseOpenGL->IsValueChangedFromSaved() ||
+        m_pForceOpenGL->IsValueChangedFromSaved())
+    {
+        SolarMutexGuard aGuard;
+        svtools::executeRestartDialog(
+            comphelper::getProcessComponentContext(), nullptr,
+            svtools::RESTART_REASON_OPENGL);
+    }
+
     return bModified;
 }
 
@@ -985,6 +999,9 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
 #endif
     m_pFontShowCB->SaveValue();
 
+    m_pUseOpenGL->SaveValue();
+    m_pForceOpenGL->SaveValue();
+
 #if defined( UNX )
     LINK( this, OfaViewTabPage, OnAntialiasingToggled ).Call( *m_pFontAntiAliasing );
 #endif
diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx
index 2d0ccd8..74aba87 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -50,9 +50,12 @@ enum RestartReason {
     RESTART_REASON_EXP_FEATURES,
         // "For the modified experimental features to take effect,
         // %PRODUCTNAME must be restarted."
-    RESTART_REASON_EXTENSION_INSTALL
+    RESTART_REASON_EXTENSION_INSTALL,
         // "For the extension to work properly,
         // %PRODUCTNAME must be restarted."
+    RESTART_REASON_OPENGL
+        // "For the OpenGL changes to take effect,
+        // %PRODUCTNAME must be restarted."
 };
 
 // Must be called with the solar mutex locked:
diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx
index a905d21..adf4827 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -61,6 +61,9 @@ public:
         case svtools::RESTART_REASON_EXTENSION_INSTALL:
             get(reason_, "reason_extension_install");
             break;
+        case svtools::RESTART_REASON_OPENGL:
+            get(reason_, "reason_opengl");
+            break;
         default:
             assert(false); // this cannot happen
         }
diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui
index c9765e7..3edc5cc 100644
--- a/svtools/uiconfig/ui/restartdialog.ui
+++ b/svtools/uiconfig/ui/restartdialog.ui
@@ -211,6 +211,21 @@
               </packing>
             </child>
             <child>
+              <object class="GtkLabel" id="reason_opengl">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">For the OpenGL changes to take effect, %PRODUCTNAME must be restarted.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">50</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">10</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkLabel" id="label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
@@ -221,7 +236,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">10</property>
+                <property name="position">11</property>
               </packing>
             </child>
           </object>
commit 40c889105ff758ae09c7d9f423fbc3b85d5e2a53
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 2 20:53:57 2016 +0100

    Related: tdf#101196 shorten description, move info into tooltip
    
    Change-Id: Id3e083dc45135c8af724c64530b6eb4e36c7f6d2

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index fb7aa58..1f6019f 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -644,18 +644,6 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
         m_pOpenGLStatusEnabled->Hide();
         m_pOpenGLStatusDisabled->Hide();
     }
-    else
-    {
-        //tdf#191196, we need height-for-width support here, but for now we can
-        //bodge it
-        Size aPrefSize(m_pForceOpenGL->get_preferred_size());
-        Size aSize(m_pForceOpenGL->CalcMinimumSize(36*approximate_char_width()));
-        if (aPrefSize.Width() > aSize.Width())
-        {
-            m_pForceOpenGL->set_width_request(aSize.Width());
-            m_pForceOpenGL->set_height_request(aSize.Height());
-        }
-    }
 
 #if defined( UNX )
     m_pFontAntiAliasing->SetToggleHdl( LINK( this, OfaViewTabPage, OnAntialiasingToggled ) );
diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui
index a59758f..8389125 100644
--- a/cui/uiconfig/ui/optviewpage.ui
+++ b/cui/uiconfig/ui/optviewpage.ui
@@ -44,6 +44,7 @@
                   <object class="GtkGrid" id="grid3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="tooltip_text" translatable="yes">Requires restart</property>
                     <property name="row_spacing">6</property>
                     <child>
                       <object class="GtkCheckButton" id="useaccel">
@@ -77,7 +78,7 @@
                     </child>
                     <child>
                       <object class="GtkCheckButton" id="useopengl">
-                        <property name="label" translatable="yes">Use OpenGL for all rendering (on restart)</property>
+                        <property name="label" translatable="yes">Use OpenGL for all rendering</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
@@ -90,12 +91,12 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkCheckButton" id="forceopengl:wrap">
-                        <property name="label" translatable="yes">Force OpenGL even if blacklisted (on restart)</property>
+                      <object class="GtkCheckButton" id="forceopengl">
+                        <property name="label" translatable="yes">Ignore OpenGL blacklist</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip_text" translatable="yes">Enabling this may expose driver bugs</property>
+                        <property name="tooltip_text" translatable="yes">Requires restart. Enabling this may expose driver bugs</property>
                         <property name="margin_left">12</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>


More information about the Libreoffice-commits mailing list