[calligra] plugins/textshape: Make the StyleManger show tabs for all the character properties even when it's a ParagraphStyle

Cyrille Berger Skott cberger at cberger.net
Thu Nov 10 06:37:43 GMT 2011


The ParagraphGeneral.ui file is still needed for a clean build:

http://my.cdash.org/viewBuildError.php?buildid=257423

On Wednesday 09 November 2011, C. Boemann wrote:
> Git commit 437b593fec6db6832859b4e5509b151135df3eb5 by C. Boemann.
> Committed on 09/11/2011 at 22:37.
> Pushed by boemann into branch 'master'.
> 
> Make the StyleManger show tabs for all the character properties even when
> it's a ParagraphStyle
> 
> M  +0    -1    plugins/textshape/CMakeLists.txt
> M  +3    -1    plugins/textshape/dialogs/CharacterGeneral.h
> M  +39   -9    plugins/textshape/dialogs/CharacterGeneral.ui
> M  +5    -7    plugins/textshape/dialogs/ParagraphGeneral.cpp
> M  +3    -3    plugins/textshape/dialogs/ParagraphGeneral.h
> D  +0    -167  plugins/textshape/dialogs/ParagraphGeneral.ui
> 
> http://commits.kde.org/calligra/437b593fec6db6832859b4e5509b151135df3eb5
> 
> diff --git a/plugins/textshape/CMakeLists.txt
> b/plugins/textshape/CMakeLists.txt index 52fd060..ab2d3a5 100644
> --- a/plugins/textshape/CMakeLists.txt
> +++ b/plugins/textshape/CMakeLists.txt
> @@ -110,7 +110,6 @@ kde4_add_ui_files(textshape_SRCS
>      dialogs/ParagraphDecorations.ui
>      dialogs/ParagraphBulletsNumbers.ui
>      dialogs/StyleManager.ui
> -    dialogs/ParagraphGeneral.ui
>      dialogs/NewStyleWidget.ui
>      dialogs/CharacterGeneral.ui
>      dialogs/CharacterHighlighting.ui
> diff --git a/plugins/textshape/dialogs/CharacterGeneral.h
> b/plugins/textshape/dialogs/CharacterGeneral.h index 5e4490e..1e0ee27
> 100644
> --- a/plugins/textshape/dialogs/CharacterGeneral.h
> +++ b/plugins/textshape/dialogs/CharacterGeneral.h
> @@ -58,8 +58,10 @@ private slots:
>      void slotStrikethroughChanged(KoCharacterStyle::LineType,
> KoCharacterStyle::LineStyle, QColor); void
> slotCapitalizationChanged(QFont::Capitalization capitalisation);
> 
> -private:
> +protected:
>      Ui::CharacterGeneral widget;
> +
> +private:
>      bool m_blockSignals;
>      bool m_nameHidden;
> 
> diff --git a/plugins/textshape/dialogs/CharacterGeneral.ui
> b/plugins/textshape/dialogs/CharacterGeneral.ui index 471e1f0..b416b5a
> 100644
> --- a/plugins/textshape/dialogs/CharacterGeneral.ui
> +++ b/plugins/textshape/dialogs/CharacterGeneral.ui
> @@ -7,7 +7,7 @@
>      <x>0</x>
>      <y>0</y>
>      <width>512</width>
> -    <height>253</height>
> +    <height>363</height>
>     </rect>
>    </property>
>    <layout class="QVBoxLayout" name="verticalLayout">
> @@ -27,8 +27,8 @@
>         <string>General</string>
>        </attribute>
>        <layout class="QGridLayout">
> -       <item row="0" column="0" colspan="2">
> -        <widget class="QLabel" name="label_2">
> +       <item row="0" column="0" colspan="3">
> +        <widget class="QLabel" name="label_5">
>           <property name="sizePolicy">
>            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
>             <horstretch>0</horstretch>
> @@ -36,24 +36,54 @@
>            </sizepolicy>
>           </property>
>           <property name="text">
> -          <string><b>Character style properties</b></string>
> +          <string><b>Paragraph style properties</b></string>
>           </property>
>          </widget>
>         </item>
> -       <item row="1" column="0">
> +       <item row="1" column="0" colspan="2">
>          <widget class="QLabel" name="label">
>           <property name="text">
>            <string>Name:</string>
>           </property>
> +        </widget>
> +       </item>
> +       <item row="1" column="2">
> +        <widget class="QLineEdit" name="name"/>
> +       </item>
> +       <item row="2" column="0" colspan="2">
> +        <widget class="QLabel" name="label_2">
> +         <property name="text">
> +          <string>Next style:</string>
> +         </property>
>           <property name="buddy">
> -          <cstring>name</cstring>
> +          <cstring>nextStyle</cstring>
>           </property>
>          </widget>
>         </item>
> -       <item row="1" column="1">
> -        <widget class="QLineEdit" name="name"/>
> +       <item row="2" column="2">
> +        <widget class="QComboBox" name="nextStyle"/>
> +       </item>
> +       <item row="3" column="0" colspan="2">
> +        <widget class="QLabel" name="label_3">
> +         <property name="text">
> +          <string>Inherit style:</string>
> +         </property>
> +         <property name="buddy">
> +          <cstring>inheritStyle</cstring>
> +         </property>
> +        </widget>
> +       </item>
> +       <item row="3" column="2">
> +        <widget class="QComboBox" name="inheritStyle"/>
> +       </item>
> +       <item row="4" column="0" colspan="3">
> +        <widget class="QCheckBox" name="inToc">
> +         <property name="text">
> +          <string>Include in table of contents</string>
> +         </property>
> +        </widget>
>         </item>
> -       <item row="2" column="1">
> +       <item row="5" column="0">
>          <spacer name="verticalSpacer">
>           <property name="orientation">
>            <enum>Qt::Vertical</enum>
> diff --git a/plugins/textshape/dialogs/ParagraphGeneral.cpp
> b/plugins/textshape/dialogs/ParagraphGeneral.cpp index c3a1f06..e0722ca
> 100644
> --- a/plugins/textshape/dialogs/ParagraphGeneral.cpp
> +++ b/plugins/textshape/dialogs/ParagraphGeneral.cpp
> @@ -27,21 +27,15 @@
>  #include <KoParagraphStyle.h>
> 
>  ParagraphGeneral::ParagraphGeneral(QWidget *parent)
> -        : QWidget(parent),
> +        : CharacterGeneral(parent),
>          m_blockSignals(false),
>          m_nameHidden(false),
>          m_style(0)
>  {
> -    widget.setupUi(this);
> -
>  //Disable for now
>      //inherit style
>      widget.label_3->setVisible(false);
>      widget.inheritStyle->setVisible(false);
> -    //use named charStyle
> -    widget.useCharacterStyle->setVisible(false);
> -    widget.label_4->setVisible(false);
> -    widget.characterStyle->setVisible(false);
>      //include in TOC
>      widget.inToc->setVisible(false);
>  //
> @@ -112,6 +106,8 @@ void ParagraphGeneral::setStyle(KoParagraphStyle
> *style, int level) if (m_style == 0)
>          return;
> 
> +    CharacterGeneral::setStyle(style);
> +
>      m_blockSignals = true;
> 
>  /*    widget.inheritStyle->clear();
> @@ -164,6 +160,8 @@ void ParagraphGeneral::setUnit(const KoUnit &unit)
> 
>  void ParagraphGeneral::save(KoParagraphStyle *style)
>  {
> +    CharacterGeneral::save(style);
> +
>      KoParagraphStyle *savingStyle;
>      if (style == 0) {
>          if (m_style == 0)
> diff --git a/plugins/textshape/dialogs/ParagraphGeneral.h
> b/plugins/textshape/dialogs/ParagraphGeneral.h index 9d66351..ede7540
> 100644
> --- a/plugins/textshape/dialogs/ParagraphGeneral.h
> +++ b/plugins/textshape/dialogs/ParagraphGeneral.h
> @@ -22,7 +22,8 @@
> 
>  #include <ui_ParagraphGeneral.h>
> 
> -#include <QWidget>
> +#include "CharacterGeneral.h"
> +
>  #include <QList>
> 
>  class KoParagraphStyle;
> @@ -32,7 +33,7 @@ class ParagraphIndentSpacing;
>  class ParagraphLayout;
>  class ParagraphDecorations;
> 
> -class ParagraphGeneral : public QWidget
> +class ParagraphGeneral : public CharacterGeneral
>  {
>      Q_OBJECT
>  public:
> @@ -59,7 +60,6 @@ private slots:
>      void bulletListItemChanged(const QString&);
> 
>  private:
> -    Ui::ParagraphGeneral widget;
>      bool m_blockSignals;
>      bool m_nameHidden;
> 
> diff --git a/plugins/textshape/dialogs/ParagraphGeneral.ui
> b/plugins/textshape/dialogs/ParagraphGeneral.ui deleted file mode 100644
> index 2f0ffcc..0000000
> --- a/plugins/textshape/dialogs/ParagraphGeneral.ui
> +++ /dev/null
> @@ -1,167 +0,0 @@
> -<?xml version="1.0" encoding="UTF-8"?>
> -<ui version="4.0">
> - <class>ParagraphGeneral</class>
> - <widget class="QWidget" name="ParagraphGeneral">
> -  <property name="geometry">
> -   <rect>
> -    <x>0</x>
> -    <y>0</y>
> -    <width>512</width>
> -    <height>363</height>
> -   </rect>
> -  </property>
> -  <layout class="QVBoxLayout" name="verticalLayout">
> -   <property name="margin">
> -    <number>0</number>
> -   </property>
> -   <item>
> -    <widget class="QTabWidget" name="tabs">
> -     <property name="sizePolicy">
> -      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
> -       <horstretch>99</horstretch>
> -       <verstretch>0</verstretch>
> -      </sizepolicy>
> -     </property>
> -     <widget class="QWidget" name="generalTab">
> -      <attribute name="title">
> -       <string>General</string>
> -      </attribute>
> -      <layout class="QGridLayout">
> -       <item row="0" column="0" colspan="3">
> -        <widget class="QLabel" name="label_5">
> -         <property name="sizePolicy">
> -          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
> -           <horstretch>0</horstretch>
> -           <verstretch>0</verstretch>
> -          </sizepolicy>
> -         </property>
> -         <property name="text">
> -          <string><b>Paragraph style properties</b></string>
> -         </property>
> -        </widget>
> -       </item>
> -       <item row="1" column="0" colspan="2">
> -        <widget class="QLabel" name="label">
> -         <property name="text">
> -          <string>Name:</string>
> -         </property>
> -        </widget>
> -       </item>
> -       <item row="1" column="2">
> -        <widget class="QLineEdit" name="name"/>
> -       </item>
> -       <item row="2" column="0" colspan="2">
> -        <widget class="QLabel" name="label_2">
> -         <property name="text">
> -          <string>Next style:</string>
> -         </property>
> -         <property name="buddy">
> -          <cstring>nextStyle</cstring>
> -         </property>
> -        </widget>
> -       </item>
> -       <item row="2" column="2">
> -        <widget class="QComboBox" name="nextStyle"/>
> -       </item>
> -       <item row="3" column="0" colspan="2">
> -        <widget class="QLabel" name="label_3">
> -         <property name="text">
> -          <string>Inherit style:</string>
> -         </property>
> -         <property name="buddy">
> -          <cstring>inheritStyle</cstring>
> -         </property>
> -        </widget>
> -       </item>
> -       <item row="3" column="2">
> -        <widget class="QComboBox" name="inheritStyle"/>
> -       </item>
> -       <item row="4" column="0" colspan="3">
> -        <widget class="QCheckBox" name="useCharacterStyle">
> -         <property name="text">
> -          <string>Use named character style</string>
> -         </property>
> -        </widget>
> -       </item>
> -       <item row="5" column="0">
> -        <spacer>
> -         <property name="orientation">
> -          <enum>Qt::Horizontal</enum>
> -         </property>
> -         <property name="sizeType">
> -          <enum>QSizePolicy::Fixed</enum>
> -         </property>
> -         <property name="sizeHint" stdset="0">
> -          <size>
> -           <width>16</width>
> -           <height>22</height>
> -          </size>
> -         </property>
> -        </spacer>
> -       </item>
> -       <item row="5" column="1">
> -        <widget class="QLabel" name="label_4">
> -         <property name="text">
> -          <string>Style:</string>
> -         </property>
> -         <property name="buddy">
> -          <cstring>characterStyle</cstring>
> -         </property>
> -        </widget>
> -       </item>
> -       <item row="5" column="2">
> -        <widget class="QComboBox" name="characterStyle"/>
> -       </item>
> -       <item row="6" column="0" colspan="3">
> -        <widget class="QCheckBox" name="inToc">
> -         <property name="text">
> -          <string>Include in table of contents</string>
> -         </property>
> -        </widget>
> -       </item>
> -       <item row="7" column="0">
> -        <spacer name="verticalSpacer">
> -         <property name="orientation">
> -          <enum>Qt::Vertical</enum>
> -         </property>
> -         <property name="sizeHint" stdset="0">
> -          <size>
> -           <width>20</width>
> -           <height>40</height>
> -          </size>
> -         </property>
> -        </spacer>
> -       </item>
> -      </layout>
> -     </widget>
> -    </widget>
> -   </item>
> -   <item>
> -    <widget class="FormattingPreview" name="preview">
> -     <property name="minimumSize">
> -      <size>
> -       <width>500</width>
> -       <height>100</height>
> -      </size>
> -     </property>
> -     <property name="frameShape">
> -      <enum>QFrame::StyledPanel</enum>
> -     </property>
> -     <property name="frameShadow">
> -      <enum>QFrame::Raised</enum>
> -     </property>
> -    </widget>
> -   </item>
> -  </layout>
> - </widget>
> - <customwidgets>
> -  <customwidget>
> -   <class>FormattingPreview</class>
> -   <extends>QFrame</extends>
> -   <header>dialogs/FormattingPreview.h</header>
> -   <container>1</container>
> -  </customwidget>
> - </customwidgets>
> - <resources/>
> - <connections/>
> -</ui>


-- 
Cyrille Berger Skott



More information about the calligra-devel mailing list