]> git.lyx.org Git - features.git/commitdiff
printer fixe
authorJohn Levon <levon@movementarian.org>
Wed, 11 Sep 2002 19:57:49 +0000 (19:57 +0000)
committerJohn Levon <levon@movementarian.org>
Wed, 11 Sep 2002 19:57:49 +0000 (19:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5275 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QPrint.C
src/frontends/qt2/ui/QPrintDialog.ui

index 5deb40621bcaa15cd40745822459249b818eae9a..3d2404e08aab9807c19f156fa7e2aed1832443a6 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-11  John Levon  <levon@movementarian.org>
+
+       * QPrint.h:
+       * QPrint.C: 
+       * ui/QPrintDialog.ui: update for odd/even changes
 2002-09-11  John Levon  <levon@movementarian.org>
 
        * QCitationDialog.C: show right info when selecting a cite
index 7f6af2bb649ec358b1bd2d2edff1d51bbe8787f3..86d1bf2a3e2ca5956c7c468121c039b23b67a53f 100644 (file)
@@ -60,52 +60,28 @@ void QPrint::update_contents()
 
        dialog_->reverseCB->setChecked(pp.reverse_order);
 
-       QRadioButton * button;
-       switch (pp.which_pages) {
-               case PrinterParams::ALL: button = dialog_->allRB; break;
-               case PrinterParams::ODD: button = dialog_->oddRB; break;
-               case PrinterParams::EVEN: button = dialog_->evenRB; break;
-       }
-       button->setChecked(true);
-
-       // hmmm... maybe a bit weird but maybe not
-       // we might just be remembering the last
-       // time this was printed.
-       if (!pp.from_page.empty()) {
-               dialog_->fromED->setText(pp.from_page.c_str());
-
-               dialog_->toED->setText("");
-               if (pp.to_page)
-                       dialog_->toED->setText(tostr(pp.to_page).c_str());
-       } else {
-               dialog_->fromED->setText("");
-               dialog_->toED->setText("");
+       dialog_->copiesSB->setValue(pp.count_copies);
+       dialog_->oddCB->setChecked(pp.odd_pages);
+       dialog_->evenCB->setChecked(pp.even_pages);
+       if (pp.all_pages) {
+               dialog_->allRB->setChecked(true);
+               return;
        }
 
-       dialog_->copiesSB->setValue(pp.count_copies);
+       dialog_->rangeRB->setChecked(true);
+       QString s;
+       s.setNum(pp.from_page);
+       dialog_->fromED->setText(s);
+       s.setNum(pp.to_page);
+       dialog_->toED->setText(s);
 }
 
 
 void QPrint::apply()
 {
-       PrinterParams::WhichPages wp;
-
-       if (dialog_->allRB->isChecked())
-               wp = PrinterParams::ALL;
-       else if (dialog_->oddRB->isChecked())
-               wp = PrinterParams::ODD;
-       else
-               wp = PrinterParams::EVEN;
-
-       string from;
-       int to(0);
-       if (!dialog_->fromED->text().isEmpty()) {
-               // we have at least one page requested
-               from = dialog_->fromED->text().latin1();
-               if (!dialog_->toED->text().isEmpty())
-                       to = strToInt(dialog_->toED->text().latin1());
-       }
-
        PrinterParams::Target t = PrinterParams::PRINTER;
        if (dialog_->fileRB->isChecked())
                t = PrinterParams::FILE;
@@ -113,10 +89,14 @@ void QPrint::apply()
        PrinterParams const pp(t,
                dialog_->printerED->text().latin1(),
                dialog_->fileED->text().latin1(),
-               wp, from, to,
-               dialog_->reverseCB->isChecked(),
-               !dialog_->collateCB->isChecked(),
-               strToInt(dialog_->copiesSB->text().latin1()));
+               dialog_->allRB->isChecked(), 
+               dialog_->fromED->text().toUInt(),
+               dialog_->toED->text().toUInt(), 
+               dialog_->oddCB->isChecked(),
+               dialog_->evenCB->isChecked(),
+               dialog_->copiesSB->text().toUInt(),
+               dialog_->collateCB->isChecked(),
+               dialog_->reverseCB->isChecked());
 
        controller().params() = pp;
 }
index 2cd056148b575c14cca5c895cd914a2b18c3ce61..dd8da3d532b77d82db3938d423e39287ad63e652 100644 (file)
@@ -13,8 +13,8 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>327</width>
-            <height>342</height>
+            <width>225</width>
+            <height>395</height>
         </rect>
     </property>
     <property stdset="1">
                 </property>
                 <property stdset="1">
                     <name>spacing</name>
-                    <number>3</number>
+                    <number>6</number>
                 </property>
-                <widget row="0"  column="0" >
-                    <class>QRadioButton</class>
+                <widget row="1"  column="1" >
+                    <class>QLineEdit</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>printerRB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>P&amp;rinter</string>
+                        <cstring>fileED</cstring>
                     </property>
                     <property stdset="1">
-                        <name>checked</name>
+                        <name>enabled</name>
                         <bool>true</bool>
                     </property>
                     <property>
                         <name>toolTip</name>
-                        <string>Send output to the printer</string>
+                        <string>Send output to a file</string>
                     </property>
                 </widget>
-                <widget row="1"  column="0" >
+                <widget row="2"  column="1" >
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout5</cstring>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>browsePB</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>enabled</name>
+                                <bool>true</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>&amp;Browse ...</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer15</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                    </hbox>
+                </widget>
+                <widget row="0"  column="0" >
                     <class>QRadioButton</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>fileRB</cstring>
+                        <cstring>printerRB</cstring>
                     </property>
                     <property stdset="1">
                         <name>text</name>
-                        <string>&amp;File</string>
+                        <string>P&amp;rinter</string>
+                    </property>
+                    <property stdset="1">
+                        <name>checked</name>
+                        <bool>true</bool>
                     </property>
                     <property>
                         <name>toolTip</name>
-                        <string>Send output to a file</string>
+                        <string>Send output to the printer</string>
                     </property>
                 </widget>
                 <widget row="0"  column="1" >
                         <string>Send output to the given printer</string>
                     </property>
                 </widget>
-                <widget row="1"  column="1" >
-                    <class>QLineEdit</class>
+                <widget row="1"  column="0" >
+                    <class>QRadioButton</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>fileED</cstring>
+                        <cstring>fileRB</cstring>
                     </property>
                     <property stdset="1">
-                        <name>enabled</name>
-                        <bool>true</bool>
+                        <name>text</name>
+                        <string>&amp;File</string>
                     </property>
                     <property>
                         <name>toolTip</name>
                         <string>Send output to a file</string>
                     </property>
                 </widget>
-                <widget row="1"  column="2" >
-                    <class>QPushButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>browsePB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>enabled</name>
-                        <bool>true</bool>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Browse ...</string>
-                    </property>
-                </widget>
             </grid>
         </widget>
         <widget>
             <property>
                 <name>layoutSpacing</name>
             </property>
-            <grid>
+            <vbox>
                 <property stdset="1">
                     <name>margin</name>
                     <number>11</number>
                     <name>spacing</name>
                     <number>6</number>
                 </property>
-                <widget row="0"  column="0" >
-                    <class>QRadioButton</class>
+                <widget>
+                    <class>QLayoutWidget</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>allRB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;All</string>
-                    </property>
-                    <property stdset="1">
-                        <name>checked</name>
-                        <bool>true</bool>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Print all pages</string>
-                    </property>
+                        <cstring>Layout3</cstring>
+                    </property>
+                    <grid>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget row="1"  column="1" >
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout2</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>fromED</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Page number to print from</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>toLA</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>&amp;to</string>
+                                    </property>
+                                    <property>
+                                        <name>buddy</name>
+                                        <cstring>toED</cstring>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>toED</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Page number to print to</string>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget row="1"  column="0" >
+                            <class>QRadioButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>rangeRB</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Fro&amp;m</string>
+                            </property>
+                            <property stdset="1">
+                                <name>checked</name>
+                                <bool>false</bool>
+                            </property>
+                            <property>
+                                <name>toolTip</name>
+                                <string>Print all pages</string>
+                            </property>
+                        </widget>
+                        <widget row="0"  column="0" >
+                            <class>QRadioButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>allRB</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>&amp;All</string>
+                            </property>
+                            <property stdset="1">
+                                <name>checked</name>
+                                <bool>true</bool>
+                            </property>
+                            <property>
+                                <name>toolTip</name>
+                                <string>Print all pages</string>
+                            </property>
+                        </widget>
+                    </grid>
                 </widget>
-                <widget row="1"  column="0" >
-                    <class>QRadioButton</class>
+                <widget>
+                    <class>QCheckBox</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>oddRB</cstring>
+                        <cstring>oddCB</cstring>
                     </property>
                     <property stdset="1">
                         <name>text</name>
-                        <string>&amp;Odd</string>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Print odd pages only</string>
-                    </property>
-                </widget>
-                <widget row="2"  column="0" >
-                    <class>QRadioButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>evenRB</cstring>
+                        <string>Print &amp;odd-numbered pages</string>
                     </property>
                     <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Even</string>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Print even pages only</string>
+                        <name>checked</name>
+                        <bool>true</bool>
                     </property>
                 </widget>
-                <widget row="3"  column="2" >
-                    <class>QLabel</class>
+                <widget>
+                    <class>QCheckBox</class>
                     <property stdset="1">
                         <name>name</name>
-                        <cstring>toPageL</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>enabled</name>
-                        <bool>true</bool>
+                        <cstring>evenCB</cstring>
                     </property>
                     <property stdset="1">
                         <name>text</name>
-                        <string>&amp;Last page:</string>
-                    </property>
-                    <property>
-                        <name>buddy</name>
-                        <cstring>toED</cstring>
-                    </property>
-                </widget>
-                <widget row="4"  column="2" >
-                    <class>QLineEdit</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>toED</cstring>
+                        <string>Print &amp;even-numbered pages</string>
                     </property>
                     <property stdset="1">
-                        <name>enabled</name>
+                        <name>checked</name>
                         <bool>true</bool>
                     </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Page number to print to</string>
-                    </property>
                 </widget>
-                <widget row="0"  column="2" >
+                <widget>
                     <class>QCheckBox</class>
                     <property stdset="1">
                         <name>name</name>
                         <string>Print in reverse order</string>
                     </property>
                 </widget>
-                <widget row="4"  column="1" >
-                    <class>QLineEdit</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>fromED</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>enabled</name>
-                        <bool>true</bool>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Page number to print from</string>
-                    </property>
-                </widget>
-                <widget row="4"  column="0" >
-                    <class>QLabel</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>rangeLA</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>Ran&amp;ge</string>
-                    </property>
-                    <property>
-                        <name>buddy</name>
-                        <cstring>fromED</cstring>
-                    </property>
-                    <property>
-                        <name>toolTip</name>
-                        <string>Set a range of pages to print</string>
-                    </property>
-                </widget>
-                <widget row="3"  column="1" >
-                    <class>QLabel</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>fromPageL</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>enabled</name>
-                        <bool>true</bool>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Starting range:</string>
-                    </property>
-                    <property>
-                        <name>buddy</name>
-                        <cstring>fromED</cstring>
-                    </property>
-                </widget>
-            </grid>
+            </vbox>
         </widget>
         <widget>
             <class>QGroupBox</class>
         <receiver>QPrintDialogBase</receiver>
         <slot>change_adaptor()</slot>
     </connection>
-    <connection>
-        <sender>oddRB</sender>
-        <signal>toggled(bool)</signal>
-        <receiver>QPrintDialogBase</receiver>
-        <slot>change_adaptor()</slot>
-    </connection>
-    <connection>
-        <sender>evenRB</sender>
-        <signal>toggled(bool)</signal>
-        <receiver>QPrintDialogBase</receiver>
-        <slot>change_adaptor()</slot>
-    </connection>
     <connection>
         <sender>reverseCB</sender>
         <signal>toggled(bool)</signal>
         <receiver>QPrintDialogBase</receiver>
         <slot>change_adaptor()</slot>
     </connection>
+    <connection>
+        <sender>rangeRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>fromED</receiver>
+        <slot>setEnabled(bool)</slot>
+    </connection>
+    <connection>
+        <sender>rangeRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>toED</receiver>
+        <slot>setEnabled(bool)</slot>
+    </connection>
     <slot access="protected">browseClicked()</slot>
     <slot access="public">change_adaptor()</slot>
     <slot access="public">copiesChanged(int)</slot>
     <tabstop>fileED</tabstop>
     <tabstop>browsePB</tabstop>
     <tabstop>allRB</tabstop>
-    <tabstop>oddRB</tabstop>
-    <tabstop>evenRB</tabstop>
     <tabstop>fromED</tabstop>
     <tabstop>toED</tabstop>
     <tabstop>reverseCB</tabstop>