[Libreoffice-commits] core.git: vcl/inc vcl/source vcl/uiconfig vcl/UIConfig_vcl.mk

Ayhan Yalçınsoy (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 29 08:22:44 UTC 2020


 vcl/UIConfig_vcl.mk                  |    1 
 vcl/inc/printdlg.hxx                 |   18 ------
 vcl/source/window/printdlg.cxx       |   43 ++-------------
 vcl/uiconfig/ui/moreoptionsdialog.ui |   99 -----------------------------------
 vcl/uiconfig/ui/printdialog.ui       |   49 +++++++++--------
 5 files changed, 35 insertions(+), 175 deletions(-)

New commits:
commit 1628d815712ef40020f744a80b949e3cf4d8380d
Author:     Ayhan Yalçınsoy <ayhanyalcinsoy at pisilinux.org>
AuthorDate: Mon Oct 26 13:28:38 2020 +0300
Commit:     Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Thu Oct 29 09:22:09 2020 +0100

    tdf#137506: Move single control in 'More Options' to print dialog
    
    Change-Id: Iacefe276bf174b96118015b48e746d1591b93c1d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104805
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>

diff --git a/vcl/UIConfig_vcl.mk b/vcl/UIConfig_vcl.mk
index a6ba276250a0..faaa0f25c673 100644
--- a/vcl/UIConfig_vcl.mk
+++ b/vcl/UIConfig_vcl.mk
@@ -17,7 +17,6 @@ $(eval $(call gb_UIConfig_add_uifiles,vcl,\
 	vcl/uiconfig/ui/errornocontentdialog \
 	vcl/uiconfig/ui/errornoprinterdialog \
 	vcl/uiconfig/ui/menutogglebutton \
-	vcl/uiconfig/ui/moreoptionsdialog \
 	vcl/uiconfig/ui/printdialog \
 	vcl/uiconfig/ui/printerdevicepage \
 	vcl/uiconfig/ui/printerpaperpage \
diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 3e337057d042..43760bab815c 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -34,21 +34,6 @@ namespace vcl {
 
 namespace vcl
 {
-    class MoreOptionsDialog final : public weld::GenericDialogController
-    {
-        PrintDialog*                            mpParent;
-        std::unique_ptr<weld::Button>           mxOKButton;
-        std::unique_ptr<weld::Button>           mxCancelButton;
-        std::unique_ptr<weld::CheckButton>      mxSingleJobsBox;
-
-        DECL_LINK( ClickHdl, weld::Button&, void );
-
-    public:
-
-        MoreOptionsDialog(PrintDialog* i_pParent);
-        virtual ~MoreOptionsDialog() override;
-    };
-
     class PrintDialog : public weld::GenericDialogController
     {
         friend class MoreOptionsDialog;
@@ -129,8 +114,6 @@ namespace vcl
 
         std::shared_ptr<PrinterController>      maPController;
 
-        std::unique_ptr<MoreOptionsDialog>      mxMoreOptionsDlg;
-
         std::unique_ptr<weld::Notebook>         mxTabCtrl;
         std::unique_ptr<weld::Frame>            mxPageLayoutFrame;
         std::unique_ptr<weld::ComboBox>         mxPrinters;
@@ -143,6 +126,7 @@ namespace vcl
         std::unique_ptr<weld::Entry>            mxPageRangeEdit;
         std::unique_ptr<weld::RadioButton>      mxPageRangesRadioButton;
         std::unique_ptr<weld::ComboBox>         mxPaperSidesBox;
+        std::unique_ptr<weld::CheckButton>      mxSingleJobsBox;
         std::unique_ptr<weld::CheckButton>      mxReverseOrderBox;
 
         std::unique_ptr<weld::Button>           mxOKButton;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 88516e9f320b..8e970bfc0154 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -63,36 +63,6 @@ namespace {
    }
 }
 
-MoreOptionsDialog::MoreOptionsDialog(PrintDialog* i_pParent)
-    : GenericDialogController(i_pParent->getDialog(), "vcl/ui/moreoptionsdialog.ui", "MoreOptionsDialog")
-    , mpParent( i_pParent )
-    , mxOKButton(m_xBuilder->weld_button("ok"))
-    , mxCancelButton(m_xBuilder->weld_button("cancel"))
-    , mxSingleJobsBox(m_xBuilder->weld_check_button("singlejobs"))
-{
-    mxSingleJobsBox->set_active( mpParent->isSingleJobs() );
-
-    mxOKButton->connect_clicked( LINK( this, MoreOptionsDialog, ClickHdl ) );
-    mxCancelButton->connect_clicked( LINK( this, MoreOptionsDialog, ClickHdl ) );
-}
-
-MoreOptionsDialog::~MoreOptionsDialog()
-{
-}
-
-IMPL_LINK (MoreOptionsDialog, ClickHdl, weld::Button&, rButton, void)
-{
-    if (&rButton == mxOKButton.get())
-    {
-        mpParent->mbSingleJobs = mxSingleJobsBox->get_active();
-        m_xDialog->response(RET_OK);
-    }
-    else if (&rButton == mxCancelButton.get())
-    {
-        m_xDialog->response(RET_CANCEL);
-    }
-}
-
 PrintDialog::PrintPreviewWindow::PrintPreviewWindow(PrintDialog* pDialog)
     : mpDialog(pDialog)
     , maMtf()
@@ -531,6 +501,7 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptr<PrinterC
     , mxPageRangeEdit(m_xBuilder->weld_entry("pagerange"))
     , mxPageRangesRadioButton(m_xBuilder->weld_radio_button("rbRangePages"))
     , mxPaperSidesBox(m_xBuilder->weld_combo_box("sidesbox"))
+    , mxSingleJobsBox(m_xBuilder->weld_check_button("singlejobs"))
     , mxReverseOrderBox(m_xBuilder->weld_check_button("reverseorder"))
     , mxOKButton(m_xBuilder->weld_button("ok"))
     , mxCancelButton(m_xBuilder->weld_button("cancel"))
@@ -674,7 +645,6 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptr<PrinterC
     mxCancelButton->connect_clicked(LINK(this, PrintDialog, ClickHdl));
     mxHelpButton->connect_clicked(LINK(this, PrintDialog, ClickHdl));
     mxSetupButton->connect_clicked( LINK( this, PrintDialog, ClickHdl ) );
-    mxMoreOptionsBtn->connect_clicked( LINK( this, PrintDialog, ClickHdl ) );
     mxBackwardBtn->connect_clicked(LINK(this, PrintDialog, ClickHdl));
     mxForwardBtn->connect_clicked(LINK(this, PrintDialog, ClickHdl));
     mxFirstBtn->connect_clicked(LINK(this, PrintDialog, ClickHdl));
@@ -1868,6 +1838,12 @@ IMPL_LINK(PrintDialog, ClickHdl, weld::Button&, rButton, void)
                                  makeAny( isCollate() ) );
         checkControlDependencies();
     }
+    else if( &rButton == mxSingleJobsBox.get() )
+    {
+        maPController->setValue( "SingleJob",
+                                 makeAny( isSingleJobs() ) );
+        checkControlDependencies();
+    }
     else if( &rButton == mxReverseOrderBox.get() )
     {
         bool bChecked = mxReverseOrderBox->get_active();
@@ -1880,11 +1856,6 @@ IMPL_LINK(PrintDialog, ClickHdl, weld::Button&, rButton, void)
     {
         updateNup();
     }
-    else if ( &rButton == mxMoreOptionsBtn.get() )
-    {
-        mxMoreOptionsDlg.reset(new MoreOptionsDialog(this));
-        mxMoreOptionsDlg->run();
-    }
     else
     {
         if( &rButton == mxSetupButton.get() )
diff --git a/vcl/uiconfig/ui/moreoptionsdialog.ui b/vcl/uiconfig/ui/moreoptionsdialog.ui
deleted file mode 100644
index 1b129aa40026..000000000000
--- a/vcl/uiconfig/ui/moreoptionsdialog.ui
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
-<interface domain="vcl">
-  <requires lib="gtk+" version="3.20"/>
-  <object class="GtkDialog" id="MoreOptionsDialog">
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" context="moreoptionsdialog|moreprintingoptions">More Printing Options</property>
-    <property name="modal">True</property>
-    <property name="default_width">0</property>
-    <property name="default_height">0</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="box">
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="buttonbox">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="ok">
-                <property name="label" context="moreoptionsdialog|ok">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel">
-                <property name="label" context="moreoptionsdialog|cancel">gtk-cancel</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">True</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkBox" id="box2">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="border_width">6</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkCheckButton" id="singlejobs">
-                <property name="label" translatable="yes" context="moreoptionsdialog|singlejobs">Create separate print jobs for collated output</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="draw_indicator">True</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="singlejobs-atkobject">
-                    <property name="AtkObject::accessible-description" translatable="yes" context="moreoptionsdialog|extended_tip|singlejobs">Check to not rely on the printer to create collated copies but create a print job for each copy instead.</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <child type="titlebar">
-      <placeholder/>
-    </child>
-  </object>
-</interface>
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index 76107646c85c..362c967b0745 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -90,26 +90,6 @@
                 <property name="secondary">True</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkButton" id="moreoptionsbtn">
-                <property name="label" translatable="yes" context="printdialog|moreoptions">More Options...</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="margin_right">10</property>
-                <property name="use_underline">True</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="moreoptionsbtn-atkobject">
-                    <property name="AtkObject::accessible-description" translatable="yes" context="printdialog|extended_tip|moreoptionsbtn">In the More Options window you can set some additional options for the current print job.</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkButton" id="ok">
                 <property name="label" translatable="yes" context="printdialog|print">_Print</property>
@@ -755,7 +735,7 @@
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <object class="GtkLabel" id="cbPrintOrder">
+                                                <object class="GtkLabel" id="cbPrintOrder">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                     <property name="halign">start</property>
@@ -786,7 +766,7 @@
                                                   </object>
                                                   <packing>
                                                     <property name="left_attach">1</property>
-                                                    <property name="top_attach">4</property>
+                                                    <property name="top_attach">5</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -833,6 +813,31 @@
                                                     <property name="top_attach">3</property>
                                                   </packing>
                                                 </child>
+                                                <child>
+                                                  <object class="GtkCheckButton" id="singlejobs">
+                                                    <property name="label" translatable="yes" context="printdialog|singlejobs">Create separate print jobs for collated output</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="draw_indicator">True</property>
+                                                    <child internal-child="accessible">
+                                                      <object class="AtkObject" id="singlejobs-atkobject">
+                                                        <property name="AtkObject::accessible-description" translatable="yes" context="printdialog|extended_tip|collate">Check to not rely on the printer to create collated copies but create a print job for each copy instead.</property>
+                                                      </object>
+                                                    </child>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="left_attach">1</property>
+                                                    <property name="top_attach">4</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <placeholder/>
+                                                </child>
+                                                <child>
+                                                  <placeholder/>
+                                                </child>
                                                 <child>
                                                   <placeholder/>
                                                 </child>


More information about the Libreoffice-commits mailing list