[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: patch for Mail Merge dialog
From:       Thomas Zander <zander () planescape ! com>
Date:       2002-05-19 8:08:23
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


On Sun, May 19, 2002 at 11:28:01AM +0700, Ariya Hidayat wrote:
> 
> attached is a patch for fixing Mail Merge dialog in KWord. The problem was
> that QSpinBox for record number in Mail Merge editor is too wide. It
> "pushes" the last toolbutton so that the toolbutton is only partially
> visible.
> 
> please review.

> Index: serialletter_classicplugin.cc
> ===================================================================
> RCS file: /home/kde/koffice/kword/mailmerge/serialletter_classicplugin.cc,v
> retrieving revision 1.8
> diff -u -3 -p -r1.8 serialletter_classicplugin.cc
> --- serialletter_classicplugin.cc	2002/04/03 17:17:05	1.8
> +++ serialletter_classicplugin.cc	2002/05/19 04:04:20
> @@ -337,6 +337,7 @@ KWClassicMailMergeEditor::KWClassicMailM
>  
>      records = new QSpinBox( 1, db->getNumRecords(), 1, toolbar );
>      records->setMaximumHeight( records->sizeHint().height() );
> +    records->setMaximumWidth( 150 );
>      connect( records, SIGNAL( valueChanged( int ) ),
>               this, SLOT( changeRecord( int ) ) );
>  

While I agree that the spinbox is too wide, the buttons should not fall off of
the toolbar anyway. So basically there is a bug somewhere else.

If you are hacking this dialog anyway; maybe you can consider the following
designer mock-up

-- 
Thomas Zander                                           zander@planescape.com
                                                 We are what we pretend to be

["mailmerge.ui" (text/plain)]

<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>MyDialog</class>
<widget class="QDialog">
    <property name="name">
        <cstring>MyDialog</cstring>
    </property>
    <property name="geometry">
        <rect>
            <x>0</x>
            <y>0</y>
            <width>633</width>
            <height>397</height>
        </rect>
    </property>
    <property name="caption">
        <string>MyDialog</string>
    </property>
    <property name="sizeGripEnabled">
        <bool>true</bool>
    </property>
    <vbox>
        <property name="name">
            <cstring>unnamed</cstring>
        </property>
        <property name="margin">
            <number>11</number>
        </property>
        <property name="spacing">
            <number>6</number>
        </property>
        <widget class="QLayoutWidget">
            <property name="name">
                <cstring>Layout6</cstring>
            </property>
            <hbox>
                <property name="name">
                    <cstring>unnamed</cstring>
                </property>
                <property name="margin">
                    <number>0</number>
                </property>
                <property name="spacing">
                    <number>6</number>
                </property>
                <widget class="QGroupBox">
                    <property name="name">
                        <cstring>GroupBox1</cstring>
                    </property>
                    <property name="sizePolicy">
                        <sizepolicy>
                            <hsizetype>5</hsizetype>
                            <vsizetype>5</vsizetype>
                            <horstretch>5</horstretch>
                            <verstretch>0</verstretch>
                        </sizepolicy>
                    </property>
                    <property name="title">
                        <string>Records</string>
                    </property>
                    <vbox>
                        <property name="name">
                            <cstring>unnamed</cstring>
                        </property>
                        <property name="margin">
                            <number>11</number>
                        </property>
                        <property name="spacing">
                            <number>6</number>
                        </property>
                        <widget class="QLayoutWidget">
                            <property name="name">
                                <cstring>Layout4</cstring>
                            </property>
                            <hbox>
                                <property name="name">
                                    <cstring>unnamed</cstring>
                                </property>
                                <property name="margin">
                                    <number>0</number>
                                </property>
                                <property name="spacing">
                                    <number>6</number>
                                </property>
                                <widget class="QLabel">
                                    <property name="name">
                                        <cstring>TextLabel3</cstring>
                                    </property>
                                    <property name="text">
                                        <string>Record number:</string>
                                    </property>
                                </widget>
                                <widget class="QSpinBox">
                                    <property name="name">
                                        <cstring>SpinBox1</cstring>
                                    </property>
                                </widget>
                                <widget class="QLabel">
                                    <property name="name">
                                        <cstring>TextLabel1</cstring>
                                    </property>
                                    <property name="text">
                                        <string>/ 100</string>
                                    </property>
                                </widget>
                                <spacer>
                                    <property name="name">
                                        <cstring>Spacer4</cstring>
                                    </property>
                                    <property name="orientation">
                                        <enum>Horizontal</enum>
                                    </property>
                                    <property name="sizeType">
                                        <enum>Expanding</enum>
                                    </property>
                                </spacer>
                            </hbox>
                        </widget>
                        <widget class="QListView">
                            <column>
                                <property name="text">
                                    <string>Name</string>
                                </property>
                                <property name="clickable">
                                    <bool>true</bool>
                                </property>
                                <property name="resizeable">
                                    <bool>true</bool>
                                </property>
                            </column>
                            <column>
                                <property name="text">
                                    <string>Value</string>
                                </property>
                                <property name="clickable">
                                    <bool>true</bool>
                                </property>
                                <property name="resizeable">
                                    <bool>true</bool>
                                </property>
                            </column>
                        <item>
                            <property name="text">
                                <string>address</string>
                            </property>
                            <property name="text">
                                <string>Dorpstraat</string>
                            </property>
                            <property name="pixmap">
                                <pixmap></pixmap>
                            </property>
                            <property name="pixmap">
                                <pixmap></pixmap>
                            </property>
                        </item>
                            <property name="name">
                                <cstring>ListView1</cstring>
                            </property>
                        </widget>
                        <widget class="QLayoutWidget">
                            <property name="name">
                                <cstring>Layout2</cstring>
                            </property>
                            <hbox>
                                <property name="name">
                                    <cstring>unnamed</cstring>
                                </property>
                                <property name="margin">
                                    <number>0</number>
                                </property>
                                <property name="spacing">
                                    <number>6</number>
                                </property>
                                <widget class="QToolButton">
                                    <property name="name">
                                        <cstring>ToolButton1</cstring>
                                    </property>
                                    <property name="text">
                                        <string>|&lt;</string>
                                    </property>
                                </widget>
                                <widget class="QToolButton">
                                    <property name="name">
                                        <cstring>ToolButton1_2</cstring>
                                    </property>
                                    <property name="text">
                                        <string>&lt;</string>
                                    </property>
                                </widget>
                                <widget class="QPushButton">
                                    <property name="name">
                                        <cstring>PushButton5</cstring>
                                    </property>
                                    <property name="text">
                                        <string>&amp;Add</string>
                                    </property>
                                </widget>
                                <widget class="QPushButton">
                                    <property name="name">
                                        <cstring>PushButton5_2</cstring>
                                    </property>
                                    <property name="text">
                                        <string>Remove</string>
                                    </property>
                                </widget>
                                <widget class="QToolButton">
                                    <property name="name">
                                        <cstring>ToolButton1_2_2</cstring>
                                    </property>
                                    <property name="text">
                                        <string>&gt;</string>
                                    </property>
                                </widget>
                                <widget class="QToolButton">
                                    <property name="name">
                                        <cstring>ToolButton1_2_3</cstring>
                                    </property>
                                    <property name="text">
                                        <string>&gt;|</string>
                                    </property>
                                </widget>
                                <spacer>
                                    <property name="name">
                                        <cstring>Spacer2</cstring>
                                    </property>
                                    <property name="orientation">
                                        <enum>Horizontal</enum>
                                    </property>
                                    <property name="sizeType">
                                        <enum>Expanding</enum>
                                    </property>
                                </spacer>
                            </hbox>
                        </widget>
                    </vbox>
                </widget>
                <widget class="QGroupBox">
                    <property name="name">
                        <cstring>GroupBox2</cstring>
                    </property>
                    <property name="sizePolicy">
                        <sizepolicy>
                            <hsizetype>5</hsizetype>
                            <vsizetype>5</vsizetype>
                            <horstretch>1</horstretch>
                            <verstretch>0</verstretch>
                        </sizepolicy>
                    </property>
                    <property name="title">
                        <string>Variable names</string>
                    </property>
                    <vbox>
                        <property name="name">
                            <cstring>unnamed</cstring>
                        </property>
                        <property name="margin">
                            <number>11</number>
                        </property>
                        <property name="spacing">
                            <number>6</number>
                        </property>
                        <widget class="QListBox">
                            <item>
                                <property name="text">
                                    <string>address</string>
                                </property>
                            </item>
                            <property name="name">
                                <cstring>ListBox2</cstring>
                            </property>
                        </widget>
                        <widget class="QLineEdit">
                            <property name="name">
                                <cstring>LineEdit1</cstring>
                            </property>
                        </widget>
                        <widget class="QLayoutWidget">
                            <property name="name">
                                <cstring>Layout5</cstring>
                            </property>
                            <hbox>
                                <property name="name">
                                    <cstring>unnamed</cstring>
                                </property>
                                <property name="margin">
                                    <number>0</number>
                                </property>
                                <property name="spacing">
                                    <number>6</number>
                                </property>
                                <widget class="QPushButton">
                                    <property name="name">
                                        <cstring>PushButton7</cstring>
                                    </property>
                                    <property name="text">
                                        <string>Add</string>
                                    </property>
                                </widget>
                                <widget class="QPushButton">
                                    <property name="name">
                                        <cstring>PushButton7_2</cstring>
                                    </property>
                                    <property name="text">
                                        <string>Remove</string>
                                    </property>
                                </widget>
                            </hbox>
                        </widget>
                    </vbox>
                </widget>
            </hbox>
        </widget>
        <widget class="QLayoutWidget">
            <property name="name">
                <cstring>Layout1</cstring>
            </property>
            <hbox>
                <property name="name">
                    <cstring>unnamed</cstring>
                </property>
                <property name="margin">
                    <number>0</number>
                </property>
                <property name="spacing">
                    <number>6</number>
                </property>
                <widget class="QPushButton">
                    <property name="name">
                        <cstring>buttonHelp</cstring>
                    </property>
                    <property name="text">
                        <string>Help</string>
                    </property>
                    <property name="accel">
                        <number>4144</number>
                    </property>
                    <property name="autoDefault">
                        <bool>true</bool>
                    </property>
                </widget>
                <spacer>
                    <property name="name">
                        <cstring>Horizontal Spacing2</cstring>
                    </property>
                    <property name="orientation">
                        <enum>Horizontal</enum>
                    </property>
                    <property name="sizeType">
                        <enum>Expanding</enum>
                    </property>
                </spacer>
                <widget class="QPushButton">
                    <property name="name">
                        <cstring>buttonOk</cstring>
                    </property>
                    <property name="text">
                        <string>OK</string>
                    </property>
                    <property name="accel">
                        <number>0</number>
                    </property>
                    <property name="autoDefault">
                        <bool>true</bool>
                    </property>
                    <property name="default">
                        <bool>true</bool>
                    </property>
                </widget>
                <widget class="QPushButton">
                    <property name="name">
                        <cstring>buttonCancel</cstring>
                    </property>
                    <property name="text">
                        <string>Cancel</string>
                    </property>
                    <property name="accel">
                        <number>0</number>
                    </property>
                    <property name="autoDefault">
                        <bool>true</bool>
                    </property>
                </widget>
            </hbox>
        </widget>
    </vbox>
</widget>
<connections>
    <connection>
        <sender>buttonOk</sender>
        <signal>clicked()</signal>
        <receiver>MyDialog</receiver>
        <slot>accept()</slot>
    </connection>
    <connection>
        <sender>buttonCancel</sender>
        <signal>clicked()</signal>
        <receiver>MyDialog</receiver>
        <slot>reject()</slot>
    </connection>
</connections>
<layoutdefaults spacing="6" margin="11"/>
</UI>

[Attachment #6 (application/pgp-signature)]
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic