[Kde-imaging] branches/extragear/kde3/libs/kipi-plugins/printwizard

Angelo Naselli anaselli at linux.it
Fri Aug 24 11:09:24 CEST 2007


SVN commit 704188 by anaselli:

- minimal gui review (used some icons on wizard) 
- added a checkbox to print out with no margins

GUI:
BUG: 103152
CCMAIL: kde-imaging at kde.org

 M  +82 -1     frmprintwizard.cpp  
 M  +12 -7     frmprintwizard.h  
 M  +93 -48    frmprintwizardbase.ui  


--- branches/extragear/kde3/libs/kipi-plugins/printwizard/frmprintwizard.cpp #704187:704188
@@ -110,6 +110,32 @@
   m_about->addAuthor("Angelo Naselli", I18N_NOOP("Maintainer"),
                      "anaselli at linux.it");
 
+  // setting-up icons on buttons
+  BtnBrowseOutputPath->setText("");
+  BtnBrowseOutputPath->setIconSet( SmallIconSet( "fileopen" ) );
+  BtnPrintOrderDown->setText("");
+  BtnPrintOrderDown->setIconSet( SmallIconSet( "down" ) );
+  BtnPrintOrderUp->setText("");
+  BtnPrintOrderUp->setIconSet( SmallIconSet( "up" ) );
+  BtnPreviewPageUp->setText("");
+  BtnPreviewPageUp->setIconSet( SmallIconSet( "next" ) );
+  BtnPreviewPageDown->setText("");
+  BtnPreviewPageDown->setIconSet( SmallIconSet( "previous" ) );
+  BtnCropPrev->setText("");
+  BtnCropPrev->setIconSet( SmallIconSet( "previous" ) );
+  BtnCropNext->setText("");
+  BtnCropNext->setIconSet( SmallIconSet( "next" ) );
+  BtnCropRotate->setText("");
+  BtnCropRotate->setIconSet( SmallIconSet( "rotate" ) );
+
+  // wizard buttons
+  QPushButton *pBtn = backButton ();
+  pBtn->setText("");
+  pBtn->setIconSet( SmallIconSet( "previous" ) );
+  pBtn = nextButton ();
+  pBtn->setText("");
+  pBtn->setIconSet( SmallIconSet( "next" ) );
+
   m_helpButton = helpButton();
   KHelpMenu* helpMenu = new KHelpMenu(this, m_about, false);
   helpMenu->menu()->removeItemAt(0);
@@ -310,8 +336,14 @@
 
     if (RdoOutputPrinter->isChecked())
     {
-      KPrinter printer;
+      KPrinter printer(false);
       printer.setPageSize(m_pageSize);
+      if (m_fullbleed->isChecked())
+      {
+        printer.setFullPage(true);
+        printer.setMargins (0, 0, 0, 0);
+      }
+
 #if KDE_IS_VERSION(3,2,0)
       printer.setUsePrinterResolution(true);
 #endif    
@@ -836,6 +868,9 @@
   BmpFirstPagePreview->setPixmap(img);
   LblPreview->setText(i18n("Page ") + QString::number(m_currentPreviewPage + 1) + i18n(" of ") + QString::number(getPageCount()));
   LblPreview->setText(i18n("Page %1 of %2").arg(m_currentPreviewPage + 1).arg(getPageCount()));
+
+  manageBtnPreviewPage();
+  manageBtnPrintOrder();
 }
 
 void FrmPrintWizard::ListPhotoSizes_highlighted ( int )
@@ -854,6 +889,48 @@
   previewPhotos();
 }
 
+void FrmPrintWizard::manageBtnPreviewPage()
+{
+	BtnPreviewPageDown->setEnabled(true);
+	BtnPreviewPageUp->setEnabled(true);
+	if (m_currentPreviewPage == 0)
+	{
+		BtnPreviewPageDown->setEnabled(false);
+	}
+  
+	if ((m_currentPreviewPage + 1) == getPageCount())
+	{
+		BtnPreviewPageUp->setEnabled(false);
+	}
+}
+
+void FrmPrintWizard::manageBtnPrintOrder()
+{
+	if (ListPrintOrder->currentItem() == -1)
+		return;
+
+	BtnPrintOrderDown->setEnabled(true);
+	BtnPrintOrderUp->setEnabled(true);
+	if (ListPrintOrder->currentItem() == 0)
+	{
+		BtnPrintOrderUp->setEnabled(false);
+	}
+	if (uint(ListPrintOrder->currentItem() + 1) == ListPrintOrder->count())
+	{
+		BtnPrintOrderDown->setEnabled(false);
+	}
+}
+
+void FrmPrintWizard::ListPhotoOrder_highlighted ( int )
+{
+	manageBtnPrintOrder();
+}
+
+void FrmPrintWizard::ListPrintOrder_selected( QListBoxItem * )
+{
+	manageBtnPrintOrder();
+}
+
 void FrmPrintWizard::EditCopies_valueChanged( int copies )
 {
   for (TPhoto *photo = m_photos.first(); photo != 0; photo = m_photos.next())
@@ -1028,6 +1105,9 @@
   else
       CmbPaperSize->setCurrentItem(0);
 
+  //Use Margins
+  m_fullbleed->setChecked(config.readBoolEntry("NoMargins", false));
+
   // captions
   int captions = config.readNumEntry("ImageCaptions", 0);
   GrpImageCaptions->setButton(captions);
@@ -1073,6 +1153,7 @@
   config.setGroup("PrintWizard");
 
   config.writeEntry("PageSize", (int)m_pageSize);
+  config.writeEntry("NoMargins", m_fullbleed->isChecked());
 
   // output
   int output = 0;
--- branches/extragear/kde3/libs/kipi-plugins/printwizard/frmprintwizard.h #704187:704188
@@ -80,14 +80,17 @@
   void saveSettings();
 
   int getPageCount();
-  
-  
-bool paintOnePage(QPainter &p, QPtrList<TPhoto> photos, QPtrList<QRect> layouts,
-                  int captionType, unsigned int &current, bool useThumbnails = false);
 
-bool paintOnePage(QImage &p, QPtrList<TPhoto> photos, QPtrList<QRect> layouts,
-                  int captionType, unsigned int &current);
-                  
+
+  bool paintOnePage(QPainter &p, QPtrList<TPhoto> photos, QPtrList<QRect> layouts,
+                    int captionType, unsigned int &current, bool useThumbnails = false);
+
+  bool paintOnePage(QImage &p, QPtrList<TPhoto> photos, QPtrList<QRect> layouts,
+                    int captionType, unsigned int &current);
+
+  void manageBtnPrintOrder();
+  void manageBtnPreviewPage();
+
 public:
   
   FrmPrintWizard(QWidget *parent=0, const char *name=0);
@@ -103,6 +106,8 @@
   void FrmPrintWizardBaseSelected(const QString &);
   void ListPhotoSizes_selected( QListBoxItem * );
   void ListPhotoSizes_highlighted ( int );
+  void ListPrintOrder_selected( QListBoxItem * );
+  void ListPhotoOrder_highlighted ( int );
   void EditCopies_valueChanged( int );
   void GrpOutputSettings_clicked(int id);
   void EditOutputPath_textChanged(const QString &);
--- branches/extragear/kde3/libs/kipi-plugins/printwizard/frmprintwizardbase.ui #704187:704188
@@ -252,52 +252,6 @@
                             <property name="name">
                                 <cstring>unnamed</cstring>
                             </property>
-                            <widget class="QLayoutWidget" row="0" column="0">
-                                <property name="name">
-                                    <cstring>layout36</cstring>
-                                </property>
-                                <hbox>
-                                    <property name="name">
-                                        <cstring>unnamed</cstring>
-                                    </property>
-                                    <widget class="QLabel">
-                                        <property name="name">
-                                            <cstring>textLabel1</cstring>
-                                        </property>
-                                        <property name="sizePolicy">
-                                            <sizepolicy>
-                                                <hsizetype>5</hsizetype>
-                                                <vsizetype>5</vsizetype>
-                                                <horstretch>0</horstretch>
-                                                <verstretch>0</verstretch>
-                                            </sizepolicy>
-                                        </property>
-                                        <property name="text">
-                                            <string>Paper size:</string>
-                                        </property>
-                                    </widget>
-                                    <widget class="KComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>Letter</string>
-                                            </property>
-                                        </item>
-                                        <item>
-                                            <property name="text">
-                                                <string>A4</string>
-                                            </property>
-                                        </item>
-                                        <item>
-                                            <property name="text">
-                                                <string>10x15cm</string>
-                                            </property>
-                                        </item>
-                                        <property name="name">
-                                            <cstring>CmbPaperSize</cstring>
-                                        </property>
-                                    </widget>
-                                </hbox>
-                            </widget>
                             <widget class="QButtonGroup" row="1" column="0">
                                 <property name="name">
                                     <cstring>GrpImageCaptions</cstring>
@@ -347,7 +301,7 @@
                                     </widget>
                                 </grid>
                             </widget>
-                            <widget class="QFrame" row="1" column="1">
+                            <widget class="QGroupBox" row="1" column="1" rowspan="1" colspan="2">
                                 <property name="name">
                                     <cstring>m_font_frame</cstring>
                                 </property>
@@ -360,6 +314,12 @@
                                 <property name="frameShadow">
                                     <enum>Sunken</enum>
                                 </property>
+                                <property name="title">
+                                    <string>Caption font</string>
+                                </property>
+                                <property name="toolTip" stdset="0">
+                                    <string>Choose the caption font size</string>
+                                </property>
                                 <grid>
                                     <property name="name">
                                         <cstring>unnamed</cstring>
@@ -444,6 +404,77 @@
                                     </widget>
                                 </grid>
                             </widget>
+                            <widget class="QLayoutWidget" row="0" column="0">
+                                <property name="name">
+                                    <cstring>layout36</cstring>
+                                </property>
+                                <hbox>
+                                    <property name="name">
+                                        <cstring>unnamed</cstring>
+                                    </property>
+                                    <widget class="QLabel">
+                                        <property name="name">
+                                            <cstring>textLabel1</cstring>
+                                        </property>
+                                        <property name="sizePolicy">
+                                            <sizepolicy>
+                                                <hsizetype>5</hsizetype>
+                                                <vsizetype>5</vsizetype>
+                                                <horstretch>0</horstretch>
+                                                <verstretch>0</verstretch>
+                                            </sizepolicy>
+                                        </property>
+                                        <property name="text">
+                                            <string>Paper size:</string>
+                                        </property>
+                                    </widget>
+                                    <widget class="KComboBox">
+                                        <item>
+                                            <property name="text">
+                                                <string>Letter</string>
+                                            </property>
+                                        </item>
+                                        <item>
+                                            <property name="text">
+                                                <string>A4</string>
+                                            </property>
+                                        </item>
+                                        <item>
+                                            <property name="text">
+                                                <string>10x15cm</string>
+                                            </property>
+                                        </item>
+                                        <property name="name">
+                                            <cstring>CmbPaperSize</cstring>
+                                        </property>
+                                    </widget>
+                                </hbox>
+                            </widget>
+                            <widget class="QCheckBox" row="0" column="2">
+                                <property name="name">
+                                    <cstring>m_fullbleed</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>No margins</string>
+                                </property>
+                            </widget>
+                            <spacer row="0" column="1">
+                                <property name="name">
+                                    <cstring>spacer19</cstring>
+                                </property>
+                                <property name="orientation">
+                                    <enum>Horizontal</enum>
+                                </property>
+                                <property name="sizeType">
+                                    <enum>Expanding</enum>
+                                </property>
+                                <property name="sizeHint">
+                                    <size>
+                                        <width>40</width>
+                                        <height>20</height>
+                                    </size>
+                                </property>
+                            </spacer>
                         </grid>
                     </widget>
                     <widget class="QButtonGroup">
@@ -1777,6 +1808,18 @@
         <receiver>m_font_frame</receiver>
         <slot>setDisabled(bool)</slot>
     </connection>
+    <connection>
+        <sender>ListPrintOrder</sender>
+        <signal>selected(QListBoxItem*)</signal>
+        <receiver>FrmPrintWizardBase</receiver>
+        <slot>ListPrintOrder_selected(QListBoxItem*)</slot>
+    </connection>
+    <connection>
+        <sender>ListPrintOrder</sender>
+        <signal>highlighted(int)</signal>
+        <receiver>FrmPrintWizardBase</receiver>
+        <slot>ListPhotoOrder_highlighted(int)</slot>
+    </connection>
 </connections>
 <slots>
     <slot>BtnCropNext_clicked()</slot>
@@ -1785,13 +1828,15 @@
     <slot>ListPhotoSizes_selected( QListBoxItem * )</slot>
     <slot>ListPhotoSizes_highlighted( int )</slot>
     <slot>EditCopies_valueChanged( int )</slot>
+    <slot>ListPrintOrder_selected( QListBoxItem * )</slot>
+    <slot>ListPhotoOrder_highlighted( int )</slot>
 </slots>
 <layoutdefaults spacing="6" margin="11"/>
 <includehints>
-    <includehint>kcombobox.h</includehint>
     <includehint>kfontcombo.h</includehint>
     <includehint>klineedit.h</includehint>
     <includehint>kcolorcombo.h</includehint>
+    <includehint>kcombobox.h</includehint>
     <includehint>kurllabel.h</includehint>
     <includehint>klineedit.h</includehint>
     <includehint>kpushbutton.h</includehint>


More information about the Kde-imaging mailing list