[Digikam-devel] extragear/graphics/digikam/utilities/imageeditor/tools

Francisco J. Cruz fj.cruz at supercable.es
Sat Feb 4 22:23:10 GMT 2006


SVN commit 505801 by fjcruz:

ICC profiles for print

CCMAIL:digikam-devel at kde.org

 M  +48 -7     imageprint.cpp  
 M  +7 -0      imageprint.h  


--- trunk/extragear/graphics/digikam/utilities/imageeditor/tools/imageprint.cpp #505800:505801
@@ -65,7 +65,10 @@
 // Local includes
 
 #include "imageprint.h"
+// #include "setup.h"
+// #include "setupicc.h"
 
+
 namespace Digikam
 {
 
@@ -76,6 +79,8 @@
 {
     setTitle( i18n("Image Settings") );
 
+    readSettings();
+
     QVBoxLayout *layout = new QVBoxLayout( this );
     layout->setMargin( KDialog::marginHint() );
     layout->setSpacing( KDialog::spacingHint() );
@@ -98,19 +103,23 @@
     QHBox *cmbox = new QHBox(cmgroup);
     layout->addWidget(cmbox);
     cmbox->setSpacing(KDialog::spacingHint());
-//     QWidget *width = new QWidget(cmbox);
-//     width->setFixedWidth(m_cmPreferences->style().subRect( QStyle::SR_PushButtonContents, m_cmPreferences ).width());
-    
+    QWidget *wth = new QWidget(cmbox);
 
     m_colorManaged = new QCheckBox(i18n("Color Management"), cmbox);
     m_colorManaged->setChecked( false );
-//     layout->addWidget(m_colorManaged);
 
     m_cmPreferences = new QPushButton(i18n("Settings"), cmbox);
+
+    wth->setFixedWidth(m_colorManaged->style().subRect( QStyle::SR_CheckBoxIndicator, m_colorManaged ).width());
+    wth = new QWidget(cmbox);
+    cmbox->setStretchFactor(wth, 1);
+
+    connect( m_colorManaged, SIGNAL(toggled(bool)),
+            this, SLOT(slotAlertSettings( bool )) );
+
+    connect( m_cmPreferences, SIGNAL(clicked()),
+             this, SLOT(slotSetupDlg()) );
     
-//     width = new QWidget(cmbox);
-//     cmbox->setStretchFactor(width, 1);
-    
 
     QVButtonGroup *group = new QVButtonGroup( i18n("Scaling"), this );
     group->setRadioButtonExclusive( true );
@@ -209,6 +218,38 @@
     m_units->setEnabled( enable );
 }
 
+void ImageEditorPrintDialogPage::readSettings()
+{
+    ///TODO implement me
+    KConfig* config = kapp->config();
+
+    config->setGroup("Color Management");
+
+    m_cmEnabled = config->readBoolEntry("EnableCM", false);
+    m_inProfilePath = config->readPathEntry("InProfileFile");
+    m_outpuProfilePath = config->readPathEntry("ProofProfileFile");
+}
+
+void ImageEditorPrintDialogPage::slotSetupDlg()
+{
+   ///TODO implement me
+// //    Setup setup(this, 0, Setup::Icc);
+// //     
+// //     if (setup.exec() != QDialog::Accepted)
+// //         return;
+}
+
+void ImageEditorPrintDialogPage::slotAlertSettings( bool t)
+{
+    if (t && !m_cmEnabled)
+    {
+        QString message = i18n("<p>Color Managemente is disabled</p> \
+                                <p>You can enabled now clicking on \"Settings\" button.</p>");
+        KMessageBox::information(this, message);
+        m_colorManaged->setChecked(!t);
+    }
+}
+
 // Image print class -----------------------------------------------------------------
 
 ImagePrint::ImagePrint(DImg& image, KPrinter& printer, const QString& filename)
--- trunk/extragear/graphics/digikam/utilities/imageeditor/tools/imageprint.h #505800:505801
@@ -86,6 +86,8 @@
 private slots:
 
     void toggleScaling( bool enable );
+    void slotSetupDlg();
+    void slotAlertSettings(bool t);
 
 private:
 
@@ -99,6 +101,11 @@
     QCheckBox       *m_autoRotate;
     QCheckBox       *m_colorManaged;
     QPushButton     *m_cmPreferences;
+    QString         m_inProfilePath;
+    QString         m_outpuProfilePath;
+    bool            m_cmEnabled;
+
+    void readSettings();
 };
 
 }  // namespace Digikam



More information about the Digikam-devel mailing list