Back to index

scribus-ng  1.3.4.dfsg+svn20071115
effectsdialog.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #include "effectsdialog.h"
00008 #include "effectsdialog.moc"
00009 #include <qvariant.h>
00010 #include <qpushbutton.h>
00011 #include <qlabel.h>
00012 #include <qlayout.h>
00013 #include <qtooltip.h>
00014 #include <qwhatsthis.h>
00015 #include <qimage.h>
00016 #include <qtextstream.h>
00017 #include <qwidgetstack.h>
00018 #include <qwidget.h>
00019 #include <qslider.h>
00020 #include <qpainter.h>
00021 #include <qtoolbutton.h>
00022 #include <qpopupmenu.h>
00023 #include "colorcombo.h"
00024 #include "cmsettings.h"
00025 #include "sccombobox.h"
00026 #include "scribusdoc.h"
00027 #include "shadebutton.h"
00028 #include "mspinbox.h"
00029 #include "page.h"
00030 #include "colorutil.h"
00031 #include "curvewidget.h"
00032 
00033 extern QPixmap loadIcon(QString nam);
00034 
00035 EffectListItem::EffectListItem(QListBox* parent, QString f) : QListBoxText(parent, f)
00036 {
00037 }
00038 
00039 const int EffectListItem::width(const QListBox *listbox)
00040 {
00041        return listbox->fontMetrics().width(text()) + 2;
00042 }
00043 
00044 const int EffectListItem::height(const QListBox *listbox)
00045 {
00046        QFontMetrics fontMetrics(listbox->fontMetrics());
00047        return fontMetrics.lineSpacing() + 2;
00048 }
00049 
00050 void EffectListItem::paint(QPainter *painter)
00051 {
00052        QFontMetrics fontMetrics(painter->fontMetrics());
00053        if (!isSelectable())
00054               painter->setPen(QColor(128, 128, 128));
00055        painter->drawText(3, fontMetrics.lineSpacing()-fontMetrics.descent(), text());
00056 }
00057 
00058 EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc ) : QDialog( parent, "EffectsDialog", true, 0 )
00059 {
00060        EffectsDialogLayout = new QHBoxLayout( this, 10, 5, "EffectsDialogLayout");
00061        setCaption( tr( "Image Effects" ) );
00062        setIcon(loadIcon("AppIcon.png"));
00063        currItem = item;
00064        effectsList = currItem->effectsInUse;
00065        doc = docc;
00066        currentOptions = 0;
00067        bool mode = false;
00068        CMSettings cms(docc, "", 0);
00069 /*     if (currItem->pixm.imgInfo.RequestProps.count() != 0)
00070        {
00071               image.imgInfo.RequestProps = currItem->pixm.imgInfo.RequestProps;
00072               image.imgInfo.isRequest = true;
00073        } */
00074        image.LoadPicture(currItem->Pfile, cms, false, false, ScImage::RGBData, 72, &mode);
00075        int ix = image.width();
00076        int iy = image.height();
00077        imageScale = 1.0;
00078        if ((ix > 220) || (iy > 220))
00079        {
00080               double sx = ix / 220.0;
00081               double sy = iy / 220.0;
00082               if (sy < sx)
00083                      image.createLowRes(sx);
00084               else
00085                      image.createLowRes(sy);
00086               imageScale = QMIN(sx, sy);
00087        }
00088        layout16 = new QVBoxLayout( 0, 0, 5, "layout16");
00089        pixmapLabel1 = new QLabel( this, "pixmapLabel1" );
00090        pixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, pixmapLabel1->sizePolicy().hasHeightForWidth() ) );
00091        pixmapLabel1->setMinimumSize( QSize( 220, 220 ) );
00092        pixmapLabel1->setMaximumSize( QSize( 220, 220 ) );
00093        pixmapLabel1->setFrameShape( QLabel::StyledPanel );
00094        pixmapLabel1->setFrameShadow( QLabel::Sunken );
00095        pixmapLabel1->setScaledContents( false );
00096        layout16->addWidget( pixmapLabel1 );
00097        textLabel5 = new QLabel( this, "textLabel5" );
00098        textLabel5->setText( tr( "Options:" ) );
00099        layout16->addWidget( textLabel5 );
00100        optionStack = new QWidgetStack( this, "optionStack" );
00101        optionStack->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, optionStack->sizePolicy().hasHeightForWidth() ) );
00102        optionStack->setMinimumSize( QSize( 220, 180 ) );
00103        optionStack->setFrameShape( QWidgetStack::GroupBoxPanel );
00104        WStackPage = new QWidget( optionStack, "WStackPage" );
00105        optionStack->addWidget( WStackPage, 0 );
00106 
00107        WStackPage_2 = new QWidget( optionStack, "WStackPage_2" );
00108        WStackPageLayout = new QVBoxLayout( WStackPage_2, 5, 5, "WStackPageLayout");
00109        WStackPageLayout->setAlignment( Qt::AlignTop );
00110        layout17 = new QHBoxLayout( 0, 0, 5, "layout7");
00111        textLabel3 = new QLabel( tr( "Color:" ), WStackPage_2, "textLabel3" );
00112        layout17->addWidget( textLabel3 );
00113 
00114        colData = new ColorCombo(false, WStackPage_2, "colData");
00115        colData->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00116        layout17->addWidget( colData );
00117        WStackPageLayout->addLayout( layout17 );
00118 
00119        layout19 = new QHBoxLayout( 0, 0, 5, "layout7");
00120        textLabel4 = new QLabel( tr( "Shade:" ), WStackPage_2, "textLabel4" );
00121        layout19->addWidget( textLabel4 );
00122        shade = new ShadeButton(WStackPage_2);
00123        shade->setValue(100);
00124        layout19->addWidget( shade );
00125        WStackPageLayout->addLayout( layout19 );
00126        optionStack->addWidget( WStackPage_2, 1 );
00127 
00128        WStackPage_3 = new QWidget( optionStack, "WStackPage_3" );
00129        WStackPage3Layout = new QVBoxLayout( WStackPage_3, 5, 5, "WStackPageLayout");
00130        WStackPage3Layout->setAlignment( Qt::AlignTop );
00131        layout20 = new QHBoxLayout( 0, 0, 5, "layout7");
00132        textLabel6 = new QLabel( tr( "Brightness:" ), WStackPage_3, "textLabel6" );
00133        layout20->addWidget( textLabel6, Qt::AlignLeft );
00134        textLabel7 = new QLabel( "0", WStackPage_3, "textLabel7" );
00135        layout20->addWidget( textLabel7, Qt::AlignRight );
00136        WStackPage3Layout->addLayout( layout20 );
00137        brightnessSlider = new QSlider( WStackPage_3, "Slider1_2" );
00138        brightnessSlider->setMinValue(-255);
00139        brightnessSlider->setMaxValue(255);
00140        brightnessSlider->setValue(0);
00141        brightnessSlider->setOrientation( QSlider::Horizontal );
00142        brightnessSlider->setTickmarks( QSlider::Below );
00143        WStackPage3Layout->addWidget( brightnessSlider );
00144        optionStack->addWidget( WStackPage_3, 2 );
00145 
00146        WStackPage_4 = new QWidget( optionStack, "WStackPage_4" );
00147        WStackPage4Layout = new QVBoxLayout( WStackPage_4, 5, 5, "WStackPageLayout");
00148        WStackPage4Layout->setAlignment( Qt::AlignTop );
00149        layout21 = new QHBoxLayout( 0, 0, 5, "layout7");
00150        textLabel8 = new QLabel( tr( "Contrast:" ), WStackPage_4, "textLabel8" );
00151        layout21->addWidget( textLabel8, Qt::AlignLeft );
00152        textLabel9 = new QLabel( "0", WStackPage_4, "textLabel9" );
00153        layout21->addWidget( textLabel9, Qt::AlignRight );
00154        WStackPage4Layout->addLayout( layout21 );
00155        contrastSlider = new QSlider( WStackPage_4, "Slider2" );
00156        contrastSlider->setMinValue(-127);
00157        contrastSlider->setMaxValue(127);
00158        contrastSlider->setValue(0);
00159        contrastSlider->setOrientation( QSlider::Horizontal );
00160        contrastSlider->setTickmarks( QSlider::Below );
00161        WStackPage4Layout->addWidget( contrastSlider );
00162        optionStack->addWidget( WStackPage_4, 3 );
00163 
00164        WStackPage_5 = new QWidget( optionStack, "WStackPage_5" );
00165        WStackPage5Layout = new QVBoxLayout( WStackPage_5, 5, 5, "WStackPageLayout");
00166        WStackPage5Layout->setAlignment( Qt::AlignTop );
00167        layout22 = new QHBoxLayout( 0, 0, 5, "layout7");
00168        textLabel10 = new QLabel( tr( "Radius:" ), WStackPage_5, "textLabel10" );
00169        layout22->addWidget( textLabel10 );
00170        shRadius = new MSpinBox( 0.0, 10.0, WStackPage_5, 1 );
00171        shRadius->setValue(0);
00172        layout22->addWidget( shRadius );
00173        WStackPage5Layout->addLayout( layout22 );
00174        layout23 = new QHBoxLayout( 0, 0, 5, "layout7");
00175        textLabel11 = new QLabel( tr("Value:"), WStackPage_5, "textLabel11" );
00176        layout23->addWidget( textLabel11 );
00177        shValue = new MSpinBox( 0.0, 5.0, WStackPage_5, 1 );
00178        shValue->setValue(1.0);
00179        layout23->addWidget( shValue );
00180        WStackPage5Layout->addLayout( layout23 );
00181        optionStack->addWidget( WStackPage_5, 4 );
00182 
00183        WStackPage_6 = new QWidget( optionStack, "WStackPage_6" );
00184        WStackPage6Layout = new QVBoxLayout( WStackPage_6, 5, 5, "WStackPageLayout");
00185        WStackPage6Layout->setAlignment( Qt::AlignTop );
00186        layout24 = new QHBoxLayout( 0, 0, 5, "layout7");
00187        textLabel12 = new QLabel( tr( "Radius:" ), WStackPage_6, "textLabel10" );
00188        layout24->addWidget( textLabel12 );
00189        blRadius = new MSpinBox( 0.0, 30.0, WStackPage_6, 1 );
00190        blRadius->setValue(0);
00191        layout24->addWidget( blRadius );
00192        WStackPage6Layout->addLayout( layout24 );
00193        optionStack->addWidget( WStackPage_6, 5 );
00194 
00195        WStackPage_7 = new QWidget( optionStack, "WStackPage_4" );
00196        WStackPage7Layout = new QVBoxLayout( WStackPage_7, 5, 5, "WStackPageLayout");
00197        WStackPage7Layout->setAlignment( Qt::AlignTop );
00198        layout26 = new QHBoxLayout( 0, 0, 5, "layout7");
00199        textLabel14 = new QLabel( tr( "Posterize:" ), WStackPage_7, "textLabel8" );
00200        layout26->addWidget( textLabel14, Qt::AlignLeft );
00201        textLabel15 = new QLabel( "0", WStackPage_7, "textLabel9" );
00202        layout26->addWidget( textLabel15, Qt::AlignRight );
00203        WStackPage7Layout->addLayout( layout26 );
00204        solarizeSlider = new QSlider( WStackPage_7, "Slider2" );
00205        solarizeSlider->setMinValue(1);
00206        solarizeSlider->setMaxValue(255);
00207        solarizeSlider->setValue(255);
00208        solarizeSlider->setOrientation( QSlider::Horizontal );
00209        solarizeSlider->setTickmarks( QSlider::Below );
00210        WStackPage7Layout->addWidget( solarizeSlider );
00211        optionStack->addWidget( WStackPage_7, 6 );
00212 
00213        WStackPage_8 = new QWidget( optionStack, "WStackPage_8" );
00214        WStackPage8Layout = new QGridLayout( WStackPage_8, 1, 1, 4, 5, "WStackPage8Layout");
00215        textLabel1d = new QLabel( tr( "Color 1:" ), WStackPage_8, "textLabel1d" );
00216        WStackPage8Layout->addWidget( textLabel1d, 0, 0 );
00217        colData1 = new ColorCombo(false, WStackPage_8, "colData1");
00218        colData1->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00219        WStackPage8Layout->addMultiCellWidget( colData1, 0, 0, 1, 2);
00220        shade1 = new ShadeButton(WStackPage_8);
00221        shade1->setValue(100);
00222        WStackPage8Layout->addWidget( shade1, 1, 1 );
00223        CurveD1 = new CurveWidget( NULL );
00224        CurveD1Pop = new QPopupMenu();
00225        CurveD1Pop->insertItem(CurveD1);
00226        CurveD1Button = new QToolButton( WStackPage_8, "CurveD1Button" );
00227        CurveD1Button->setText( "" );
00228        CurveD1Button->setMaximumSize( QSize( 22, 22 ) );
00229        CurveD1Button->setPixmap(loadIcon("curve.png"));
00230        CurveD1Button->setPopup(CurveD1Pop);
00231        CurveD1Button->setPopupDelay(40);
00232        WStackPage8Layout->addWidget( CurveD1Button, 1, 2 );
00233 
00234        textLabel2d = new QLabel( tr( "Color 2:" ), WStackPage_8, "textLabel2d" );
00235        WStackPage8Layout->addWidget( textLabel2d, 2, 0 );
00236        colData2 = new ColorCombo(false, WStackPage_8, "colData2");
00237        colData2->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00238        WStackPage8Layout->addMultiCellWidget( colData2, 2, 2, 1, 2);
00239        shade2 = new ShadeButton(WStackPage_8);
00240        shade2->setValue(100);
00241        WStackPage8Layout->addWidget( shade2, 3, 1 );
00242        CurveD2 = new CurveWidget( NULL );
00243        CurveD2Pop = new QPopupMenu();
00244        CurveD2Pop->insertItem(CurveD2);
00245        CurveD2Button = new QToolButton( WStackPage_8, "CurveD2Button" );
00246        CurveD2Button->setText( "" );
00247        CurveD2Button->setMaximumSize( QSize( 22, 22 ) );
00248        CurveD2Button->setPixmap(loadIcon("curve.png"));
00249        CurveD2Button->setPopup(CurveD2Pop);
00250        CurveD2Button->setPopupDelay(40);
00251        WStackPage8Layout->addWidget( CurveD2Button, 3, 2 );
00252        QSpacerItem *spacerD1 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
00253        WStackPage8Layout->addItem( spacerD1, 4, 0 );
00254        optionStack->addWidget( WStackPage_8, 7 );
00255 
00256        WStackPage_9 = new QWidget( optionStack, "WStackPage_9" );
00257        WStackPage9Layout = new QGridLayout( WStackPage_9, 1, 1, 4, 5, "WStackPage9Layout");
00258        textLabel1t = new QLabel( tr( "Color 1:" ), WStackPage_9, "textLabel1t" );
00259        WStackPage9Layout->addWidget( textLabel1t, 0, 0 );
00260        colDatat1 = new ColorCombo(false, WStackPage_9, "colDatat1");
00261        colDatat1->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00262        WStackPage9Layout->addMultiCellWidget( colDatat1, 0, 0, 1, 2 );
00263        shadet1 = new ShadeButton(WStackPage_9);
00264        shadet1->setValue(100);
00265        WStackPage9Layout->addWidget( shadet1, 1, 1 );
00266        CurveT1 = new CurveWidget( NULL );
00267        CurveT1Pop = new QPopupMenu();
00268        CurveT1Pop->insertItem(CurveT1);
00269        CurveT1Button = new QToolButton( WStackPage_9, "CurveT1Button" );
00270        CurveT1Button->setText( "" );
00271        CurveT1Button->setMaximumSize( QSize( 22, 22 ) );
00272        CurveT1Button->setPixmap(loadIcon("curve.png"));
00273        CurveT1Button->setPopup(CurveT1Pop);
00274        CurveT1Button->setPopupDelay(40);
00275        WStackPage9Layout->addWidget( CurveT1Button, 1, 2 );
00276        textLabel2t = new QLabel( tr( "Color 2:" ), WStackPage_9, "textLabel2t" );
00277        WStackPage9Layout->addWidget( textLabel2t, 2, 0 );
00278        colDatat2 = new ColorCombo(false, WStackPage_9, "colDatat2");
00279        colDatat2->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00280        WStackPage9Layout->addMultiCellWidget( colDatat2, 2, 2, 1, 2 );
00281        shadet2 = new ShadeButton(WStackPage_9);
00282        shadet2->setValue(100);
00283        WStackPage9Layout->addWidget( shadet2, 3, 1 );
00284        CurveT2 = new CurveWidget( NULL );
00285        CurveT2Pop = new QPopupMenu();
00286        CurveT2Pop->insertItem(CurveT2);
00287        CurveT2Button = new QToolButton( WStackPage_9, "CurveT2Button" );
00288        CurveT2Button->setText( "" );
00289        CurveT2Button->setMaximumSize( QSize( 22, 22 ) );
00290        CurveT2Button->setPixmap(loadIcon("curve.png"));
00291        CurveT2Button->setPopup(CurveT2Pop);
00292        CurveT2Button->setPopupDelay(40);
00293        WStackPage9Layout->addWidget( CurveT2Button, 3, 2 );
00294        textLabel3t = new QLabel( tr( "Color 3:" ), WStackPage_9, "textLabel3t" );
00295        WStackPage9Layout->addWidget( textLabel3t, 4, 0 );
00296        colDatat3 = new ColorCombo(false, WStackPage_9, "colDatat3");
00297        colDatat3->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00298        WStackPage9Layout->addMultiCellWidget( colDatat3, 4, 4, 1, 2 );
00299        shadet3 = new ShadeButton(WStackPage_9);
00300        shadet3->setValue(100);
00301        WStackPage9Layout->addWidget( shadet3, 5, 1 );
00302        CurveT3 = new CurveWidget( NULL );
00303        CurveT3Pop = new QPopupMenu();
00304        CurveT3Pop->insertItem(CurveT3);
00305        CurveT3Button = new QToolButton( WStackPage_9, "CurveT3Button" );
00306        CurveT3Button->setText( "" );
00307        CurveT3Button->setMaximumSize( QSize( 22, 22 ) );
00308        CurveT3Button->setPixmap(loadIcon("curve.png"));
00309        CurveT3Button->setPopup(CurveT3Pop);
00310        CurveT3Button->setPopupDelay(40);
00311        WStackPage9Layout->addWidget( CurveT3Button, 5, 2 );
00312        optionStack->addWidget( WStackPage_9, 8 );
00313 
00314        WStackPage_10 = new QWidget( optionStack, "WStackPage_10" );
00315        WStackPage10Layout = new QGridLayout( WStackPage_10, 1, 1, 4, 5, "WStackPage10Layout");
00316        textLabel1q = new QLabel( tr( "Color 1:" ), WStackPage_10, "textLabel1q" );
00317        WStackPage10Layout->addWidget( textLabel1q, 0, 0 );
00318        colDataq1 = new ColorCombo(false, WStackPage_10, "colDataq1");
00319        colDataq1->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00320        WStackPage10Layout->addMultiCellWidget( colDataq1, 0, 0, 1, 2 );
00321        shadeq1 = new ShadeButton(WStackPage_10);
00322        shadeq1->setValue(100);
00323        WStackPage10Layout->addWidget( shadeq1, 1, 1 );
00324        CurveQ1 = new CurveWidget( NULL );
00325        CurveQ1Pop = new QPopupMenu();
00326        CurveQ1Pop->insertItem(CurveQ1);
00327        CurveQ1Button = new QToolButton( WStackPage_10, "CurveQ1Button" );
00328        CurveQ1Button->setText( "" );
00329        CurveQ1Button->setMaximumSize( QSize( 22, 22 ) );
00330        CurveQ1Button->setPixmap(loadIcon("curve.png"));
00331        CurveQ1Button->setPopup(CurveQ1Pop);
00332        CurveQ1Button->setPopupDelay(40);
00333        WStackPage10Layout->addWidget( CurveQ1Button, 1, 2 );
00334        textLabel2q = new QLabel( tr( "Color 2:" ), WStackPage_10, "textLabel2q" );
00335        WStackPage10Layout->addWidget( textLabel2q, 2, 0 );
00336        colDataq2 = new ColorCombo(false, WStackPage_10, "colDataq2");
00337        colDataq2->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00338        WStackPage10Layout->addMultiCellWidget( colDataq2, 2, 2, 1, 2 );
00339        shadeq2 = new ShadeButton(WStackPage_10);
00340        shadeq2->setValue(100);
00341        WStackPage10Layout->addWidget( shadeq2, 3, 1 );
00342        CurveQ2 = new CurveWidget( NULL );
00343        CurveQ2Pop = new QPopupMenu();
00344        CurveQ2Pop->insertItem(CurveQ2);
00345        CurveQ2Button = new QToolButton( WStackPage_10, "CurveQ2Button" );
00346        CurveQ2Button->setText( "" );
00347        CurveQ2Button->setMaximumSize( QSize( 22, 22 ) );
00348        CurveQ2Button->setPixmap(loadIcon("curve.png"));
00349        CurveQ2Button->setPopup(CurveQ2Pop);
00350        CurveQ2Button->setPopupDelay(40);
00351        WStackPage10Layout->addWidget( CurveQ2Button, 3, 2 );
00352        textLabel3q = new QLabel( tr( "Color 3:" ), WStackPage_10, "textLabel3q" );
00353        WStackPage10Layout->addWidget( textLabel3q, 4, 0 );
00354        colDataq3 = new ColorCombo(false, WStackPage_10, "colDataq3");
00355        colDataq3->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00356        WStackPage10Layout->addMultiCellWidget( colDataq3, 4, 4, 1, 2 );
00357        shadeq3 = new ShadeButton(WStackPage_10);
00358        shadeq3->setValue(100);
00359        WStackPage10Layout->addWidget( shadeq3, 5, 1 );
00360        CurveQ3 = new CurveWidget( NULL );
00361        CurveQ3Pop = new QPopupMenu();
00362        CurveQ3Pop->insertItem(CurveQ3);
00363        CurveQ3Button = new QToolButton( WStackPage_10, "CurveQ3Button" );
00364        CurveQ3Button->setText( "" );
00365        CurveQ3Button->setMaximumSize( QSize( 22, 22 ) );
00366        CurveQ3Button->setPixmap(loadIcon("curve.png"));
00367        CurveQ3Button->setPopup(CurveQ1Pop);
00368        CurveQ3Button->setPopupDelay(40);
00369        WStackPage10Layout->addWidget( CurveQ3Button, 5, 2 );
00370        textLabel4q = new QLabel( tr( "Color 4:" ), WStackPage_10, "textLabel4q" );
00371        WStackPage10Layout->addWidget( textLabel4q, 6, 0 );
00372        colDataq4 = new ColorCombo(false, WStackPage_10, "colDataq4");
00373        colDataq4->insertItems(doc->PageColors, ColorCombo::smallPixmaps);
00374        WStackPage10Layout->addMultiCellWidget( colDataq4, 6, 6, 1, 2 );
00375        shadeq4 = new ShadeButton(WStackPage_10);
00376        shadeq4->setValue(100);
00377        WStackPage10Layout->addWidget( shadeq4, 7, 1 );
00378        CurveQ4 = new CurveWidget( NULL );
00379        CurveQ4Pop = new QPopupMenu();
00380        CurveQ4Pop->insertItem(CurveQ4);
00381        CurveQ4Button = new QToolButton( WStackPage_10, "CurveQ4Button" );
00382        CurveQ4Button->setText( "" );
00383        CurveQ4Button->setMaximumSize( QSize( 22, 22 ) );
00384        CurveQ4Button->setPixmap(loadIcon("curve.png"));
00385        CurveQ4Button->setPopup(CurveQ1Pop);
00386        CurveQ4Button->setPopupDelay(40);
00387        WStackPage10Layout->addWidget( CurveQ4Button, 7, 2 );
00388        optionStack->addWidget( WStackPage_10, 9 );
00389 
00390        WStackPage_11 = new QWidget( optionStack, "WStackPage_11" );
00391        WStackPage11Layout = new QVBoxLayout( WStackPage_11, 5, 5, "WStackPageLayout");
00392        WStackPage11Layout->setAlignment( Qt::AlignTop );
00393        Kdisplay = new CurveWidget(WStackPage_11);
00394        WStackPage11Layout->addWidget( Kdisplay );
00395        optionStack->addWidget( WStackPage_11, 10 );
00396 
00397        layout16->addWidget( optionStack );
00398        EffectsDialogLayout->addLayout( layout16 );
00399 
00400        layout18 = new QVBoxLayout( 0, 0, 0, "layout18");
00401        layout10 = new QGridLayout( 0, 1, 1, 0, 5, "layout10");
00402        layout2 = new QVBoxLayout( 0, 0, 5, "layout2");
00403        textLabel1 = new QLabel( this, "textLabel1" );
00404        textLabel1->setText( tr( "Available Effects" ) );
00405        layout2->addWidget( textLabel1 );
00406        availableEffects = new QListBox( this, "availableEffects" );
00407        availableEffects->clear();
00408        
00409        new EffectListItem(availableEffects, tr("Blur"));
00410        new EffectListItem(availableEffects, tr("Brightness"));
00411        new EffectListItem(availableEffects, tr("Colorize"));
00412        new EffectListItem(availableEffects, tr("Duotone"));
00413        new EffectListItem(availableEffects, tr("Tritone"));
00414        new EffectListItem(availableEffects, tr("Quadtone"));
00415        new EffectListItem(availableEffects, tr("Contrast"));
00416        new EffectListItem(availableEffects, tr("Grayscale"));
00417        new EffectListItem(availableEffects, tr("Curves"));
00418        new EffectListItem(availableEffects, tr("Invert"));
00419        new EffectListItem(availableEffects, tr("Posterize"));
00420        new EffectListItem(availableEffects, tr("Sharpen"));
00421 /*
00422        availableEffects->insertItem( tr("Blur"));
00423        availableEffects->insertItem( tr("Brightness"));
00424        availableEffects->insertItem( tr("Colorize"));
00425        availableEffects->insertItem( tr("Duotone"));
00426        availableEffects->insertItem( tr("Tritone"));
00427        availableEffects->insertItem( tr("Quadtone"));
00428        availableEffects->insertItem( tr("Contrast"));
00429        availableEffects->insertItem( tr("Grayscale"));
00430        availableEffects->insertItem( tr("Curves"));
00431        availableEffects->insertItem( tr("Invert"));
00432        availableEffects->insertItem( tr("Posterize"));
00433        availableEffects->insertItem( tr("Sharpen"));
00434 */
00435        availableEffects->setMinimumSize(fontMetrics().width( tr( "Available Effects" ))+40, 180);
00436        layout2->addWidget( availableEffects );
00437        layout10->addLayout( layout2, 0, 0 );
00438 
00439        layout1 = new QVBoxLayout( 0, 0, 5, "layout1");
00440        QSpacerItem* spacer1 = new QSpacerItem( 21, 61, QSizePolicy::Minimum, QSizePolicy::Expanding );
00441        layout1->addItem( spacer1 );
00442        toEffects = new QPushButton( this, "toEffects" );
00443        toEffects->setText( tr( ">>" ) );
00444        toEffects->setEnabled(false);
00445        layout1->addWidget( toEffects );
00446        fromEffects = new QPushButton( this, "fromEffects" );
00447        fromEffects->setText( tr( "<<" ) );
00448        fromEffects->setEnabled(false);
00449        layout1->addWidget( fromEffects );
00450        QSpacerItem* spacer2 = new QSpacerItem( 31, 81, QSizePolicy::Minimum, QSizePolicy::Expanding );
00451        layout1->addItem( spacer2 );
00452        layout10->addLayout( layout1, 0, 1 );
00453 
00454        layout8 = new QVBoxLayout( 0, 0, 5, "layout8");
00455        textLabel2 = new QLabel( this, "textLabel2" );
00456        textLabel2->setText( tr( "Effects in use" ) );
00457        layout8->addWidget( textLabel2 );
00458        usedEffects = new QListBox( this, "usedEffects" );
00459        usedEffects->setMinimumSize(fontMetrics().width( tr( "Available Effects" ))+40, 180);
00460        usedEffects->clear();
00461        effectValMap.clear();
00462        for (uint a = 0; a < effectsList.count(); ++a)
00463        {
00464               if ((*effectsList.at(a)).effectCode == ScImage::EF_INVERT)
00465               {
00466                      usedEffects->insertItem( tr("Invert"));
00467                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), "");
00468               }
00469               if ((*effectsList.at(a)).effectCode == ScImage::EF_GRAYSCALE)
00470               {
00471                      usedEffects->insertItem( tr("Grayscale"));
00472                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), "");
00473               }
00474               if ((*effectsList.at(a)).effectCode == ScImage::EF_COLORIZE)
00475               {
00476                      usedEffects->insertItem( tr("Colorize"));
00477                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00478                      availableEffects->item(2)->setSelectable(false);
00479                      availableEffects->item(3)->setSelectable(false);
00480                      availableEffects->item(4)->setSelectable(false);
00481                      availableEffects->item(5)->setSelectable(false);
00482               }
00483               if ((*effectsList.at(a)).effectCode == ScImage::EF_BRIGHTNESS)
00484               {
00485                      usedEffects->insertItem( tr("Brightness"));
00486                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00487               }
00488               if ((*effectsList.at(a)).effectCode == ScImage::EF_CONTRAST)
00489               {
00490                      usedEffects->insertItem( tr("Contrast"));
00491                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00492               }
00493               if ((*effectsList.at(a)).effectCode == ScImage::EF_SHARPEN)
00494               {
00495                      usedEffects->insertItem( tr("Sharpen"));
00496                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00497               }
00498               if ((*effectsList.at(a)).effectCode == ScImage::EF_BLUR)
00499               {
00500                      usedEffects->insertItem( tr("Blur"));
00501                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00502               }
00503               if ((*effectsList.at(a)).effectCode == ScImage::EF_SOLARIZE)
00504               {
00505                      usedEffects->insertItem( tr("Posterize"));
00506                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00507               }
00508               if ((*effectsList.at(a)).effectCode == ScImage::EF_DUOTONE)
00509               {
00510                      usedEffects->insertItem( tr("Duotone"));
00511                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00512                      availableEffects->item(2)->setSelectable(false);
00513                      availableEffects->item(3)->setSelectable(false);
00514                      availableEffects->item(4)->setSelectable(false);
00515                      availableEffects->item(5)->setSelectable(false);
00516               }
00517               if ((*effectsList.at(a)).effectCode == ScImage::EF_TRITONE)
00518               {
00519                      usedEffects->insertItem( tr("Tritone"));
00520                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00521                      availableEffects->item(2)->setSelectable(false);
00522                      availableEffects->item(3)->setSelectable(false);
00523                      availableEffects->item(4)->setSelectable(false);
00524                      availableEffects->item(5)->setSelectable(false);
00525               }
00526               if ((*effectsList.at(a)).effectCode == ScImage::EF_QUADTONE)
00527               {
00528                      usedEffects->insertItem( tr("Quadtone"));
00529                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00530                      availableEffects->item(2)->setSelectable(false);
00531                      availableEffects->item(3)->setSelectable(false);
00532                      availableEffects->item(4)->setSelectable(false);
00533                      availableEffects->item(5)->setSelectable(false);
00534               }
00535               if ((*effectsList.at(a)).effectCode == ScImage::EF_GRADUATE)
00536               {
00537                      usedEffects->insertItem( tr("Curves"));
00538                      effectValMap.insert(usedEffects->item(usedEffects->count()-1), (*effectsList.at(a)).effectParameters);
00539               }
00540        }
00541        layout8->addWidget( usedEffects );
00542        layout7 = new QHBoxLayout( 0, 0, 5, "layout7");
00543        QSpacerItem* spacer4 = new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum );
00544        layout7->addItem( spacer4 );
00545        effectUp = new QPushButton( this, "effectUp" );
00546        effectUp->setText( "" );
00547        effectUp->setPixmap(loadIcon("16/go-up.png"));
00548        effectUp->setEnabled(false);
00549        layout7->addWidget( effectUp );
00550        effectDown = new QPushButton( this, "effectDown" );
00551        effectDown->setText( "" );
00552        effectDown->setPixmap(loadIcon("16/go-down.png"));
00553        effectDown->setEnabled(false);
00554        layout7->addWidget( effectDown );
00555        QSpacerItem* spacer5 = new QSpacerItem( 10, 10, QSizePolicy::Expanding, QSizePolicy::Minimum );
00556        layout7->addItem( spacer5 );
00557        layout8->addLayout( layout7 );
00558        layout10->addLayout( layout8, 0, 2 );
00559        layout18->addLayout( layout10 );
00560 
00561        layout9 = new QHBoxLayout( 0, 0, 5, "layout9");
00562        QSpacerItem* spacer3 = new QSpacerItem( 111, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00563        layout9->addItem( spacer3 );
00564 
00565        okButton = new QPushButton( this, "okButton" );
00566        okButton->setText( tr( "OK" ) );
00567        layout9->addWidget( okButton );
00568 
00569        cancelButton = new QPushButton( this, "cancelButton" );
00570        cancelButton->setText( tr( "Cancel" ) );
00571        layout9->addWidget( cancelButton );
00572        layout18->addLayout( layout9 );
00573        EffectsDialogLayout->addLayout( layout18 );
00574        optionStack->raiseWidget(0);
00575        createPreview();
00576        availableEffects->repaintContents();
00577        resize( minimumSizeHint() );
00578        clearWState( WState_Polished );
00579 
00580        // signals and slots connections
00581        connect( okButton, SIGNAL( clicked() ), this, SLOT( leaveOK() ) );
00582        connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
00583        connect( usedEffects, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00584        connect( usedEffects, SIGNAL( doubleClicked(QListBoxItem*) ), this, SLOT( moveFromEffects() ) );
00585        connect( availableEffects, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( selectAvailEffect(QListBoxItem*) ) );
00586        connect( availableEffects, SIGNAL( doubleClicked(QListBoxItem*) ), this, SLOT( selectAvailEffectDbl(QListBoxItem*) ) );
00587        connect( toEffects, SIGNAL( clicked() ), this, SLOT( moveToEffects() ) );
00588        connect( fromEffects, SIGNAL( clicked() ), this, SLOT( moveFromEffects() ) );
00589        connect( effectUp, SIGNAL( clicked() ), this, SLOT( moveEffectUp() ) );
00590        connect( effectDown, SIGNAL( clicked() ), this, SLOT( moveEffectDown() ) );
00591        connect( colData, SIGNAL(activated(int)), this, SLOT( createPreview()));
00592        connect( shade, SIGNAL(clicked()), this, SLOT(createPreview()));
00593        connect( colData1, SIGNAL(activated(int)), this, SLOT( createPreview()));
00594        connect( shade1, SIGNAL(clicked()), this, SLOT(createPreview()));
00595        connect( colData2, SIGNAL(activated(int)), this, SLOT( createPreview()));
00596        connect( shade2, SIGNAL(clicked()), this, SLOT(createPreview()));
00597        connect( colDatat1, SIGNAL(activated(int)), this, SLOT( createPreview()));
00598        connect( shadet1, SIGNAL(clicked()), this, SLOT(createPreview()));
00599        connect( colDatat2, SIGNAL(activated(int)), this, SLOT( createPreview()));
00600        connect( shadet2, SIGNAL(clicked()), this, SLOT(createPreview()));
00601        connect( colDatat3, SIGNAL(activated(int)), this, SLOT( createPreview()));
00602        connect( shadet3, SIGNAL(clicked()), this, SLOT(createPreview()));
00603        connect( colDataq1, SIGNAL(activated(int)), this, SLOT( createPreview()));
00604        connect( shadeq1, SIGNAL(clicked()), this, SLOT(createPreview()));
00605        connect( colDataq2, SIGNAL(activated(int)), this, SLOT( createPreview()));
00606        connect( shadeq2, SIGNAL(clicked()), this, SLOT(createPreview()));
00607        connect( colDataq3, SIGNAL(activated(int)), this, SLOT( createPreview()));
00608        connect( shadeq3, SIGNAL(clicked()), this, SLOT(createPreview()));
00609        connect( colDataq4, SIGNAL(activated(int)), this, SLOT( createPreview()));
00610        connect( shadeq4, SIGNAL(clicked()), this, SLOT(createPreview()));
00611        connect( brightnessSlider, SIGNAL(valueChanged(int)), this, SLOT(updateBright(int)));
00612        connect( brightnessSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
00613        connect( contrastSlider, SIGNAL(valueChanged(int)), this, SLOT(updateContrast(int)));
00614        connect( contrastSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
00615        connect( shRadius, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
00616        connect( shValue, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
00617        connect( blRadius, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
00618        connect( solarizeSlider, SIGNAL(valueChanged(int)), this, SLOT(updateSolarize(int)));
00619        connect( solarizeSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
00620        connect( Kdisplay->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00621        connect( CurveD1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00622        connect( CurveD2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00623        connect( CurveT1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00624        connect( CurveT2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00625        connect( CurveT3->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00626        connect( CurveQ1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00627        connect( CurveQ2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00628        connect( CurveQ3->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00629        connect( CurveQ4->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00630        tim.start();
00631 }
00632 
00633 void EffectsDialog::leaveOK()
00634 {
00635        saveValues(true);
00636        accept();
00637 }
00638 
00639 void EffectsDialog::updateSolarize(int val)
00640 {
00641        QString tmp;
00642        tmp.setNum(val);
00643        textLabel15->setText(tmp);
00644        createPreview();
00645 }
00646 
00647 void EffectsDialog::updateContrast(int val)
00648 {
00649        QString tmp;
00650        tmp.setNum(val);
00651        textLabel9->setText(tmp);
00652        createPreview();
00653 }
00654 
00655 void EffectsDialog::updateBright(int val)
00656 {
00657        QString tmp;
00658        tmp.setNum(val);
00659        textLabel7->setText(tmp);
00660        createPreview();
00661 }
00662 
00663 void EffectsDialog::createPreview()
00664 {
00665        if (tim.elapsed() < 50)
00666               return;
00667        ScImage im(image);
00668        saveValues(false);
00669        im.applyEffect(effectsList, doc->PageColors, false);
00670        QPixmap Bild = QPixmap(pixmapLabel1->width(), pixmapLabel1->height());
00671        int x = (pixmapLabel1->width() - im.qImage().width()) / 2;
00672        int y = (pixmapLabel1->height() - im.qImage().height()) / 2;
00673        QPainter p;
00674        QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
00675        p.begin(&Bild);
00676        p.fillRect(0, 0, pixmapLabel1->width(), pixmapLabel1->height(), b);
00677        p.drawImage(x, y, im.qImage());
00678        p.end();
00679        pixmapLabel1->setPixmap( Bild );
00680        tim.start();
00681 }
00682 
00683 void EffectsDialog::saveValues(bool final)
00684 {
00685        selectEffectHelper(final);
00686        effectsList.clear();
00687        struct ScImage::imageEffect ef;
00688        for (uint e = 0; e < usedEffects->count(); ++e)
00689        {
00690               if (usedEffects->item(e)->text() == tr("Invert"))
00691               {
00692                      ef.effectCode = ScImage::EF_INVERT;
00693                      ef.effectParameters = "";
00694               }
00695               if (usedEffects->item(e)->text() == tr("Grayscale"))
00696               {
00697                      ef.effectCode = ScImage::EF_GRAYSCALE;
00698                      ef.effectParameters = "";
00699               }
00700               if (usedEffects->item(e)->text() == tr("Colorize"))
00701               {
00702                      ef.effectCode = ScImage::EF_COLORIZE;
00703                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00704               }
00705               if (usedEffects->item(e)->text() == tr("Brightness"))
00706               {
00707                      ef.effectCode = ScImage::EF_BRIGHTNESS;
00708                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00709               }
00710               if (usedEffects->item(e)->text() == tr("Contrast"))
00711               {
00712                      ef.effectCode = ScImage::EF_CONTRAST;
00713                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00714               }
00715               if (usedEffects->item(e)->text() == tr("Sharpen"))
00716               {
00717                      ef.effectCode = ScImage::EF_SHARPEN;
00718                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00719               }
00720               if (usedEffects->item(e)->text() == tr("Blur"))
00721               {
00722                      ef.effectCode = ScImage::EF_BLUR;
00723                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00724               }
00725               if (usedEffects->item(e)->text() == tr("Posterize"))
00726               {
00727                      ef.effectCode = ScImage::EF_SOLARIZE;
00728                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00729               }
00730               if (usedEffects->item(e)->text() == tr("Duotone"))
00731               {
00732                      ef.effectCode = ScImage::EF_DUOTONE;
00733                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00734               }
00735               if (usedEffects->item(e)->text() == tr("Tritone"))
00736               {
00737                      ef.effectCode = ScImage::EF_TRITONE;
00738                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00739               }
00740               if (usedEffects->item(e)->text() == tr("Quadtone"))
00741               {
00742                      ef.effectCode = ScImage::EF_QUADTONE;
00743                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00744               }
00745               if (usedEffects->item(e)->text() == tr("Curves"))
00746               {
00747                      ef.effectCode = ScImage::EF_GRADUATE;
00748                      ef.effectParameters = effectValMap[usedEffects->item(e)];
00749               }
00750               effectsList.append(ef);
00751        }
00752 }
00753 
00754 void EffectsDialog::selectAvailEffectDbl(QListBoxItem* c)
00755 {
00756        if (c)
00757        {
00758               if (!c->isSelectable())
00759                      return;
00760               else
00761                      moveToEffects();
00762        }
00763 }
00764 
00765 void EffectsDialog::moveToEffects()
00766 {
00767        usedEffects->insertItem(availableEffects->currentText());
00768        if (availableEffects->currentText() == tr("Invert"))
00769               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "");
00770        if (availableEffects->currentText() == tr("Grayscale"))
00771               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "");
00772        if (availableEffects->currentText() == tr("Brightness"))
00773               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "0");
00774        if (availableEffects->currentText() == tr("Contrast"))
00775               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "0");
00776        if (availableEffects->currentText() == tr("Sharpen"))
00777               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "0 1");
00778        if (availableEffects->currentText() == tr("Blur"))
00779               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "0 1");
00780        if (availableEffects->currentText() == tr("Posterize"))
00781               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "255");
00782        if (availableEffects->currentText() == tr("Colorize"))
00783        {
00784               ColorList::Iterator it;
00785               it = doc->PageColors.begin();
00786               QString efval = it.key()+"\n100";
00787               effectValMap.insert(usedEffects->item(usedEffects->count()-1), efval);
00788               availableEffects->item(2)->setSelectable(false);
00789               availableEffects->item(3)->setSelectable(false);
00790               availableEffects->item(4)->setSelectable(false);
00791               availableEffects->item(5)->setSelectable(false);
00792        }
00793        if (availableEffects->currentText() == tr("Duotone"))
00794        {
00795               ColorList::Iterator it;
00796               it = doc->PageColors.begin();
00797               QString efval = it.key()+"\n"+it.key()+"\n100 100 2 0.0 0.0 1.0 1.0 0 2 0.0 0.0 1.0 1.0 0";
00798               effectValMap.insert(usedEffects->item(usedEffects->count()-1), efval);
00799               availableEffects->item(2)->setSelectable(false);
00800               availableEffects->item(3)->setSelectable(false);
00801               availableEffects->item(4)->setSelectable(false);
00802               availableEffects->item(5)->setSelectable(false);
00803        }
00804        if (availableEffects->currentText() == tr("Tritone"))
00805        {
00806               ColorList::Iterator it;
00807               it = doc->PageColors.begin();
00808               QString efval = it.key()+"\n"+it.key()+"\n"+it.key()+"\n100 100 100 2 0.0 0.0 1.0 1.0 0 2 0.0 0.0 1.0 1.0 0 2 0.0 0.0 1.0 1.0 0";
00809               effectValMap.insert(usedEffects->item(usedEffects->count()-1), efval);
00810               availableEffects->item(2)->setSelectable(false);
00811               availableEffects->item(3)->setSelectable(false);
00812               availableEffects->item(4)->setSelectable(false);
00813               availableEffects->item(5)->setSelectable(false);
00814        }
00815        if (availableEffects->currentText() == tr("Quadtone"))
00816        {
00817               ColorList::Iterator it;
00818               it = doc->PageColors.begin();
00819               QString efval = it.key()+"\n"+it.key()+"\n"+it.key()+"\n"+it.key()+"\n100 100 100 100 2 0.0 0.0 1.0 1.0 0 2 0.0 0.0 1.0 1.0 0 2 0.0 0.0 1.0 1.0 0 2 0.0 0.0 1.0 1.0 0";
00820               effectValMap.insert(usedEffects->item(usedEffects->count()-1), efval);
00821               availableEffects->item(2)->setSelectable(false);
00822               availableEffects->item(3)->setSelectable(false);
00823               availableEffects->item(4)->setSelectable(false);
00824               availableEffects->item(5)->setSelectable(false);
00825        }
00826        if (availableEffects->currentText() == tr("Curves"))
00827               effectValMap.insert(usedEffects->item(usedEffects->count()-1), "2 0.0 0.0 1.0 1.0 0");
00828        disconnect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00829        usedEffects->setCurrentItem(usedEffects->item(usedEffects->count()-1));
00830        selectEffect(usedEffects->item(usedEffects->count()-1));
00831        connect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00832        createPreview();
00833        availableEffects->repaintContents();
00834 }
00835 
00836 void EffectsDialog::moveFromEffects()
00837 {
00838        disconnect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00839        if ((usedEffects->currentText() == tr("Colorize")) || (usedEffects->currentText() == tr("Duotone")) || (usedEffects->currentText() == tr("Tritone")) || (usedEffects->currentText() == tr("Quadtone")))
00840        {
00841               availableEffects->item(2)->setSelectable(true);
00842               availableEffects->item(3)->setSelectable(true);
00843               availableEffects->item(4)->setSelectable(true);
00844               availableEffects->item(5)->setSelectable(true);
00845               availableEffects->repaintContents();
00846        }
00847        effectValMap.remove(usedEffects->item(usedEffects->currentItem()));
00848        usedEffects->removeItem(usedEffects->currentItem());
00849        currentOptions = 0;
00850        if (usedEffects->count() == 0)
00851               fromEffects->setEnabled(false);
00852        if (usedEffects->count() < 2)
00853        {
00854               effectUp->setEnabled(false);
00855               effectDown->setEnabled(false);
00856        }
00857        usedEffects->setSelected(usedEffects->item(usedEffects->currentItem()), true);
00858        selectEffect(usedEffects->item(usedEffects->currentItem()));
00859        createPreview();
00860        connect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00861 }
00862 
00863 void EffectsDialog::moveEffectUp()
00864 {
00865        int curr = usedEffects->currentItem();
00866        if (curr == 0)
00867               return;
00868        disconnect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00869        usedEffects->clearSelection();
00870        QListBoxItem *it = usedEffects->item(curr);
00871        usedEffects->takeItem(it);
00872        usedEffects->insertItem(it, curr-1);
00873        usedEffects->setCurrentItem(it);
00874        selectEffect(usedEffects->item(usedEffects->currentItem()));
00875        createPreview();
00876        connect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00877 }
00878 
00879 void EffectsDialog::moveEffectDown()
00880 {
00881        int curr = usedEffects->currentItem();
00882        if (curr == static_cast<int>(usedEffects->count())-1)
00883               return;
00884        disconnect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00885        usedEffects->clearSelection();
00886        QListBoxItem *it = usedEffects->item(curr);
00887        usedEffects->takeItem(it);
00888        usedEffects->insertItem(it, curr+1);
00889        usedEffects->setCurrentItem(it);
00890        selectEffect(usedEffects->item(usedEffects->currentItem()));
00891        createPreview();
00892        connect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
00893 }
00894 
00895 void EffectsDialog::selectEffect(QListBoxItem* c)
00896 {
00897        toEffects->setEnabled(false);
00898        selectEffectHelper();
00899        if (c)
00900        {
00901               fromEffects->setEnabled(true);
00902               if (usedEffects->count() > 1)
00903               {
00904                      effectUp->setEnabled(true);
00905                      effectDown->setEnabled(true);
00906                      if (usedEffects->currentItem() == 0)
00907                             effectUp->setEnabled(false);
00908                      if (usedEffects->currentItem() == static_cast<int>(usedEffects->count())-1)
00909                             effectDown->setEnabled(false);
00910               }
00911               if (c->text() == tr("Grayscale"))
00912                      optionStack->raiseWidget(0);
00913               else if (c->text() == tr("Invert"))
00914                      optionStack->raiseWidget(0);
00915               else if (c->text() == tr("Colorize"))
00916               {
00917                      disconnect( colData, SIGNAL(activated(int)), this, SLOT( createPreview()));
00918                      disconnect( shade, SIGNAL(clicked()), this, SLOT(createPreview()));
00919                      QString tmpstr = effectValMap[c];
00920                      QString col;
00921                      int shading;
00922                      QTextStream fp(&tmpstr, IO_ReadOnly);
00923                      fp >> col;
00924                      fp >> shading;
00925                      colData->setCurrentText(col);
00926                      shade->setValue(shading);
00927                      optionStack->raiseWidget(1);
00928                      connect( colData, SIGNAL(activated(int)), this, SLOT( createPreview()));
00929                      connect( shade, SIGNAL(clicked()), this, SLOT(createPreview()));
00930               }
00931               else if (c->text() == tr("Duotone"))
00932               {
00933                      disconnect( colData1, SIGNAL(activated(int)), this, SLOT( createPreview()));
00934                      disconnect( shade1, SIGNAL(clicked()), this, SLOT(createPreview()));
00935                      disconnect( colData2, SIGNAL(activated(int)), this, SLOT( createPreview()));
00936                      disconnect( shade2, SIGNAL(clicked()), this, SLOT(createPreview()));
00937                      disconnect( CurveD1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00938                      disconnect( CurveD2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00939                      QString tmpstr = effectValMap[c];
00940                      QString col1, col2;
00941                      int shading1, shading2;
00942                      QTextStream fp(&tmpstr, IO_ReadOnly);
00943                      col1 = fp.readLine();
00944                      col2 = fp.readLine();
00945                      fp >> shading1;
00946                      fp >> shading2;
00947                      colData1->setCurrentText(col1);
00948                      shade1->setValue(shading1);
00949                      colData2->setCurrentText(col2);
00950                      shade2->setValue(shading2);
00951                      int numVals;
00952                      double xval, yval;
00953                      FPointArray curve;
00954                      curve.resize(0);
00955                      fp >> numVals;
00956                      for (int nv = 0; nv < numVals; nv++)
00957                      {
00958                             fp >> xval;
00959                             fp >> yval;
00960                             curve.addPoint(xval, yval);
00961                      }
00962                      CurveD1->cDisplay->setCurve(curve);
00963                      int lin;
00964                      fp >> lin;
00965                      CurveD1->setLinear(lin);
00966                      curve.resize(0);
00967                      fp >> numVals;
00968                      for (int nv = 0; nv < numVals; nv++)
00969                      {
00970                             fp >> xval;
00971                             fp >> yval;
00972                             curve.addPoint(xval, yval);
00973                      }
00974                      CurveD2->cDisplay->setCurve(curve);
00975                      fp >> lin;
00976                      CurveD2->setLinear(lin);
00977                      optionStack->raiseWidget(7);
00978                      connect( colData1, SIGNAL(activated(int)), this, SLOT( createPreview()));
00979                      connect( shade1, SIGNAL(clicked()), this, SLOT(createPreview()));
00980                      connect( colData2, SIGNAL(activated(int)), this, SLOT( createPreview()));
00981                      connect( shade2, SIGNAL(clicked()), this, SLOT(createPreview()));
00982                      connect( CurveD1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00983                      connect( CurveD2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00984               }
00985               else if (c->text() == tr("Tritone"))
00986               {
00987                      disconnect( colDatat1, SIGNAL(activated(int)), this, SLOT( createPreview()));
00988                      disconnect( shadet1, SIGNAL(clicked()), this, SLOT(createPreview()));
00989                      disconnect( colDatat2, SIGNAL(activated(int)), this, SLOT( createPreview()));
00990                      disconnect( shadet2, SIGNAL(clicked()), this, SLOT(createPreview()));
00991                      disconnect( colDatat3, SIGNAL(activated(int)), this, SLOT( createPreview()));
00992                      disconnect( shadet3, SIGNAL(clicked()), this, SLOT(createPreview()));
00993                      disconnect( CurveT1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00994                      disconnect( CurveT2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00995                      disconnect( CurveT3->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
00996                      QString tmpstr = effectValMap[c];
00997                      QString col1, col2, col3;
00998                      int shading1, shading2, shading3;
00999                      QTextStream fp(&tmpstr, IO_ReadOnly);
01000                      col1 = fp.readLine();
01001                      col2 = fp.readLine();
01002                      col3 = fp.readLine();
01003                      fp >> shading1;
01004                      fp >> shading2;
01005                      fp >> shading3;
01006                      colDatat1->setCurrentText(col1);
01007                      shadet1->setValue(shading1);
01008                      colDatat2->setCurrentText(col2);
01009                      shadet2->setValue(shading2);
01010                      colDatat3->setCurrentText(col3);
01011                      shadet3->setValue(shading3);
01012                      int numVals;
01013                      double xval, yval;
01014                      FPointArray curve;
01015                      curve.resize(0);
01016                      fp >> numVals;
01017                      for (int nv = 0; nv < numVals; nv++)
01018                      {
01019                             fp >> xval;
01020                             fp >> yval;
01021                             curve.addPoint(xval, yval);
01022                      }
01023                      CurveT1->cDisplay->setCurve(curve);
01024                      int lin;
01025                      fp >> lin;
01026                      CurveT1->setLinear(lin);
01027                      curve.resize(0);
01028                      fp >> numVals;
01029                      for (int nv = 0; nv < numVals; nv++)
01030                      {
01031                             fp >> xval;
01032                             fp >> yval;
01033                             curve.addPoint(xval, yval);
01034                      }
01035                      CurveT2->cDisplay->setCurve(curve);
01036                      fp >> lin;
01037                      CurveT2->setLinear(lin);
01038                      curve.resize(0);
01039                      fp >> numVals;
01040                      for (int nv = 0; nv < numVals; nv++)
01041                      {
01042                             fp >> xval;
01043                             fp >> yval;
01044                             curve.addPoint(xval, yval);
01045                      }
01046                      CurveT3->cDisplay->setCurve(curve);
01047                      fp >> lin;
01048                      CurveT3->setLinear(lin);
01049                      optionStack->raiseWidget(8);
01050                      connect( colDatat1, SIGNAL(activated(int)), this, SLOT( createPreview()));
01051                      connect( shadet1, SIGNAL(clicked()), this, SLOT(createPreview()));
01052                      connect( colDatat2, SIGNAL(activated(int)), this, SLOT( createPreview()));
01053                      connect( shadet2, SIGNAL(clicked()), this, SLOT(createPreview()));
01054                      connect( colDatat3, SIGNAL(activated(int)), this, SLOT( createPreview()));
01055                      connect( shadet3, SIGNAL(clicked()), this, SLOT(createPreview()));
01056                      connect( CurveT1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01057                      connect( CurveT2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01058                      connect( CurveT3->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01059               }
01060               else if (c->text() == tr("Quadtone"))
01061               {
01062                      disconnect( colDataq1, SIGNAL(activated(int)), this, SLOT( createPreview()));
01063                      disconnect( shadeq1, SIGNAL(clicked()), this, SLOT(createPreview()));
01064                      disconnect( colDataq2, SIGNAL(activated(int)), this, SLOT( createPreview()));
01065                      disconnect( shadeq2, SIGNAL(clicked()), this, SLOT(createPreview()));
01066                      disconnect( colDataq3, SIGNAL(activated(int)), this, SLOT( createPreview()));
01067                      disconnect( shadeq3, SIGNAL(clicked()), this, SLOT(createPreview()));
01068                      disconnect( colDataq4, SIGNAL(activated(int)), this, SLOT( createPreview()));
01069                      disconnect( shadeq4, SIGNAL(clicked()), this, SLOT(createPreview()));
01070                      disconnect( CurveQ1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01071                      disconnect( CurveQ2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01072                      disconnect( CurveQ3->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01073                      disconnect( CurveQ4->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01074                      QString tmpstr = effectValMap[c];
01075                      QString col1, col2, col3, col4;
01076                      int shading1, shading2, shading3, shading4;
01077                      QTextStream fp(&tmpstr, IO_ReadOnly);
01078                      col1 = fp.readLine();
01079                      col2 = fp.readLine();
01080                      col3 = fp.readLine();
01081                      col4 = fp.readLine();
01082                      fp >> shading1;
01083                      fp >> shading2;
01084                      fp >> shading3;
01085                      fp >> shading4;
01086                      colDataq1->setCurrentText(col1);
01087                      shadeq1->setValue(shading1);
01088                      colDataq2->setCurrentText(col2);
01089                      shadeq2->setValue(shading2);
01090                      colDataq3->setCurrentText(col3);
01091                      shadeq3->setValue(shading3);
01092                      colDataq4->setCurrentText(col4);
01093                      shadeq4->setValue(shading4);
01094                      int numVals;
01095                      double xval, yval;
01096                      FPointArray curve;
01097                      curve.resize(0);
01098                      fp >> numVals;
01099                      for (int nv = 0; nv < numVals; nv++)
01100                      {
01101                             fp >> xval;
01102                             fp >> yval;
01103                             curve.addPoint(xval, yval);
01104                      }
01105                      CurveQ1->cDisplay->setCurve(curve);
01106                      int lin;
01107                      fp >> lin;
01108                      CurveQ1->setLinear(lin);
01109                      curve.resize(0);
01110                      fp >> numVals;
01111                      for (int nv = 0; nv < numVals; nv++)
01112                      {
01113                             fp >> xval;
01114                             fp >> yval;
01115                             curve.addPoint(xval, yval);
01116                      }
01117                      CurveQ2->cDisplay->setCurve(curve);
01118                      fp >> lin;
01119                      CurveQ2->setLinear(lin);
01120                      curve.resize(0);
01121                      fp >> numVals;
01122                      for (int nv = 0; nv < numVals; nv++)
01123                      {
01124                             fp >> xval;
01125                             fp >> yval;
01126                             curve.addPoint(xval, yval);
01127                      }
01128                      CurveQ3->cDisplay->setCurve(curve);
01129                      fp >> lin;
01130                      CurveQ3->setLinear(lin);
01131                      curve.resize(0);
01132                      fp >> numVals;
01133                      for (int nv = 0; nv < numVals; nv++)
01134                      {
01135                             fp >> xval;
01136                             fp >> yval;
01137                             curve.addPoint(xval, yval);
01138                      }
01139                      CurveQ4->cDisplay->setCurve(curve);
01140                      fp >> lin;
01141                      CurveQ4->setLinear(lin);
01142                      optionStack->raiseWidget(9);
01143                      connect( colDataq1, SIGNAL(activated(int)), this, SLOT( createPreview()));
01144                      connect( shadeq1, SIGNAL(clicked()), this, SLOT(createPreview()));
01145                      connect( colDataq2, SIGNAL(activated(int)), this, SLOT( createPreview()));
01146                      connect( shadeq2, SIGNAL(clicked()), this, SLOT(createPreview()));
01147                      connect( colDataq3, SIGNAL(activated(int)), this, SLOT( createPreview()));
01148                      connect( shadeq3, SIGNAL(clicked()), this, SLOT(createPreview()));
01149                      connect( colDataq4, SIGNAL(activated(int)), this, SLOT( createPreview()));
01150                      connect( shadeq4, SIGNAL(clicked()), this, SLOT(createPreview()));
01151                      connect( CurveQ1->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01152                      connect( CurveQ2->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01153                      connect( CurveQ3->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01154                      connect( CurveQ4->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01155               }
01156               else if (c->text() == tr("Brightness"))
01157               {
01158                      disconnect( brightnessSlider, SIGNAL(valueChanged(int)), this, SLOT(updateBright(int)));
01159                      disconnect( brightnessSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
01160                      QString tmpstr = effectValMap[c];
01161                      int brightness;
01162                      QTextStream fp(&tmpstr, IO_ReadOnly);
01163                      fp >> brightness;
01164                      brightnessSlider->setValue(brightness);
01165                      QString tmp;
01166                      tmp.setNum(brightness);
01167                      textLabel7->setText(tmp);
01168                      optionStack->raiseWidget(2);
01169                      connect( brightnessSlider, SIGNAL(valueChanged(int)), this, SLOT(updateBright(int)));
01170                      connect( brightnessSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
01171               }
01172               else if (c->text() == tr("Contrast"))
01173               {
01174                      disconnect( contrastSlider, SIGNAL(valueChanged(int)), this, SLOT(updateContrast(int)));
01175                      disconnect( contrastSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
01176                      QString tmpstr = effectValMap[c];
01177                      int contrast;
01178                      QTextStream fp(&tmpstr, IO_ReadOnly);
01179                      fp >> contrast;
01180                      contrastSlider->setValue(contrast);
01181                      QString tmp;
01182                      tmp.setNum(contrast);
01183                      textLabel9->setText(tmp);
01184                      optionStack->raiseWidget(3);
01185                      connect( contrastSlider, SIGNAL(valueChanged(int)), this, SLOT(updateContrast(int)));
01186                      connect( contrastSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
01187               }
01188               else if (c->text() == tr("Sharpen"))
01189               {
01190                      disconnect( shRadius, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
01191                      disconnect( shValue, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
01192                      QString tmpstr = effectValMap[c];
01193                      double radius, sigma;
01194                      QTextStream fp(&tmpstr, IO_ReadOnly);
01195                      fp >> radius;
01196                      fp >> sigma;
01197                      shRadius->setValue(radius);
01198                      shValue->setValue(sigma);
01199                      optionStack->raiseWidget(4);
01200                      connect( shRadius, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
01201                      connect( shValue, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
01202               }
01203               else if (c->text() == tr("Blur"))
01204               {
01205                      disconnect( blRadius, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
01206                      QString tmpstr = effectValMap[c];
01207                      double radius, sigma;
01208                      QTextStream fp(&tmpstr, IO_ReadOnly);
01209                      fp >> radius;
01210                      fp >> sigma;
01211                      blRadius->setValue(radius);
01212                      //                   blValue->setValue(sigma);
01213                      optionStack->raiseWidget(5);
01214                      connect( blRadius, SIGNAL(valueChanged(int)), this, SLOT(createPreview()));
01215               }
01216               else if (c->text() == tr("Posterize"))
01217               {
01218                      disconnect( solarizeSlider, SIGNAL(valueChanged(int)), this, SLOT(updateSolarize(int)));
01219                      disconnect( solarizeSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
01220                      QString tmpstr = effectValMap[c];
01221                      int solarize;
01222                      QTextStream fp(&tmpstr, IO_ReadOnly);
01223                      fp >> solarize;
01224                      solarizeSlider->setValue(solarize);
01225                      QString tmp;
01226                      tmp.setNum(solarize);
01227                      textLabel15->setText(tmp);
01228                      optionStack->raiseWidget(6);
01229                      connect( solarizeSlider, SIGNAL(valueChanged(int)), this, SLOT(updateSolarize(int)));
01230                      connect( solarizeSlider, SIGNAL(sliderReleased()), this, SLOT(createPreview()));
01231               }
01232               else if (c->text() == tr("Curves"))
01233               {
01234                      disconnect( Kdisplay->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01235                      QString tmpstr = effectValMap[c];
01236                      QTextStream fp(&tmpstr, IO_ReadOnly);
01237                      int numVals;
01238                      double xval, yval;
01239                      FPointArray curve;
01240                      curve.resize(0);
01241                      fp >> numVals;
01242                      for (int nv = 0; nv < numVals; nv++)
01243                      {
01244                             fp >> xval;
01245                             fp >> yval;
01246                             curve.addPoint(xval, yval);
01247                      }
01248                      Kdisplay->cDisplay->setCurve(curve);
01249                      int lin;
01250                      fp >> lin;
01251                      if (lin == 1)
01252                             Kdisplay->setLinear(true);
01253                      else
01254                             Kdisplay->setLinear(false);
01255                      optionStack->raiseWidget(10);
01256                      connect( Kdisplay->cDisplay, SIGNAL(modified()), this, SLOT(createPreview()));
01257               }
01258               else
01259                      optionStack->raiseWidget(0);
01260               currentOptions = c;
01261        }
01262        else
01263               optionStack->raiseWidget(0);
01264        disconnect( availableEffects, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( selectAvailEffect(QListBoxItem*) ) );
01265        availableEffects->clearSelection();
01266        connect( availableEffects, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( selectAvailEffect(QListBoxItem*) ) );
01267 }
01268 
01269 void EffectsDialog::selectAvailEffect(QListBoxItem* c)
01270 {
01271        if (c)
01272        {
01273               if (!c->isSelectable())
01274                      toEffects->setEnabled(false);
01275               else
01276                      toEffects->setEnabled(true);
01277        }
01278        fromEffects->setEnabled(false);
01279        effectUp->setEnabled(false);
01280        effectDown->setEnabled(false);
01281        disconnect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
01282        selectEffectHelper();
01283        currentOptions = 0;
01284        usedEffects->clearSelection();
01285        optionStack->raiseWidget(0);
01286        connect( usedEffects, SIGNAL( selected(QListBoxItem*) ), this, SLOT( selectEffect(QListBoxItem*) ) );
01287 }
01288 
01289 void EffectsDialog::selectEffectHelper(bool final)
01290 {
01291        if (currentOptions != 0)
01292        {
01293               if (currentOptions->text() == tr("Colorize"))
01294               {
01295                      QString efval = "";
01296                      efval = colData->currentText();
01297                      QString tmp;
01298                      tmp.setNum(shade->getValue());
01299                      efval += "\n"+tmp;
01300                      effectValMap[currentOptions] = efval;
01301               }
01302               if (currentOptions->text() == tr("Brightness"))
01303               {
01304                      QString tmp;
01305                      tmp.setNum(brightnessSlider->value());
01306                      effectValMap[currentOptions] = tmp;
01307               }
01308               if (currentOptions->text() == tr("Contrast"))
01309               {
01310                      QString tmp;
01311                      tmp.setNum(contrastSlider->value());
01312                      effectValMap[currentOptions] = tmp;
01313               }
01314               if (currentOptions->text() == tr("Sharpen"))
01315               {
01316                      QString efval = "";
01317                      QString tmp;
01318                      tmp.setNum(shRadius->value());
01319                      efval += tmp;
01320                      tmp.setNum(shValue->value());
01321                      efval += " "+tmp;
01322                      effectValMap[currentOptions] = efval;
01323               }
01324               if (currentOptions->text() == tr("Blur"))
01325               {
01326                      QString efval = "";
01327                      QString tmp;
01328                      if (final)
01329                             tmp.setNum(blRadius->value());
01330                      else
01331                             tmp.setNum(blRadius->value()/imageScale);
01332                      efval += tmp;
01333                      tmp.setNum(1.0);
01334                      efval += " "+tmp;
01335                      effectValMap[currentOptions] = efval;
01336               }
01337               if (currentOptions->text() == tr("Posterize"))
01338               {
01339                      QString tmp;
01340                      tmp.setNum(solarizeSlider->value());
01341                      effectValMap[currentOptions] = tmp;
01342               }
01343               if (currentOptions->text() == tr("Duotone"))
01344               {
01345                      QString efval = "";
01346                      efval = colData1->currentText()+"\n";
01347                      efval += colData2->currentText()+"\n";
01348                      QString tmp;
01349                      tmp.setNum(shade1->getValue());
01350                      efval += tmp;
01351                      tmp.setNum(shade2->getValue());
01352                      efval += " "+tmp;
01353                      FPointArray Vals = CurveD1->cDisplay->getCurve();
01354                      tmp.setNum(Vals.size());
01355                      efval += " "+tmp;
01356                      for (uint p = 0; p < Vals.size(); p++)
01357                      {
01358                             FPoint pv = Vals.point(p);
01359                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01360                      }
01361                      if (CurveD1->cDisplay->isLinear())
01362                             efval += " 1";
01363                      else
01364                             efval += " 0";
01365                      Vals = CurveD2->cDisplay->getCurve();
01366                      tmp.setNum(Vals.size());
01367                      efval += " "+tmp;
01368                      for (uint p = 0; p < Vals.size(); p++)
01369                      {
01370                             FPoint pv = Vals.point(p);
01371                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01372                      }
01373                      if (CurveD2->cDisplay->isLinear())
01374                             efval += " 1";
01375                      else
01376                             efval += " 0";
01377                      effectValMap[currentOptions] = efval;
01378               }
01379               if (currentOptions->text() == tr("Tritone"))
01380               {
01381                      QString efval = "";
01382                      efval = colDatat1->currentText()+"\n";
01383                      efval += colDatat2->currentText()+"\n";
01384                      efval += colDatat3->currentText()+"\n";
01385                      QString tmp;
01386                      tmp.setNum(shadet1->getValue());
01387                      efval += tmp;
01388                      tmp.setNum(shadet2->getValue());
01389                      efval += " "+tmp;
01390                      tmp.setNum(shadet3->getValue());
01391                      efval += " "+tmp;
01392                      FPointArray Vals = CurveT1->cDisplay->getCurve();
01393                      tmp.setNum(Vals.size());
01394                      efval += " "+tmp;
01395                      for (uint p = 0; p < Vals.size(); p++)
01396                      {
01397                             FPoint pv = Vals.point(p);
01398                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01399                      }
01400                      if (CurveT1->cDisplay->isLinear())
01401                             efval += " 1";
01402                      else
01403                             efval += " 0";
01404                      Vals = CurveT2->cDisplay->getCurve();
01405                      tmp.setNum(Vals.size());
01406                      efval += " "+tmp;
01407                      for (uint p = 0; p < Vals.size(); p++)
01408                      {
01409                             FPoint pv = Vals.point(p);
01410                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01411                      }
01412                      if (CurveT2->cDisplay->isLinear())
01413                             efval += " 1";
01414                      else
01415                             efval += " 0";
01416                      Vals = CurveT3->cDisplay->getCurve();
01417                      tmp.setNum(Vals.size());
01418                      efval += " "+tmp;
01419                      for (uint p = 0; p < Vals.size(); p++)
01420                      {
01421                             FPoint pv = Vals.point(p);
01422                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01423                      }
01424                      if (CurveT3->cDisplay->isLinear())
01425                             efval += " 1";
01426                      else
01427                             efval += " 0";
01428                      effectValMap[currentOptions] = efval;
01429               }
01430               if (currentOptions->text() == tr("Quadtone"))
01431               {
01432                      QString efval = "";
01433                      efval = colDataq1->currentText()+"\n";
01434                      efval += colDataq2->currentText()+"\n";
01435                      efval += colDataq3->currentText()+"\n";
01436                      efval += colDataq4->currentText()+"\n";
01437                      QString tmp;
01438                      tmp.setNum(shadeq1->getValue());
01439                      efval += tmp;
01440                      tmp.setNum(shadeq2->getValue());
01441                      efval += " "+tmp;
01442                      tmp.setNum(shadeq3->getValue());
01443                      efval += " "+tmp;
01444                      tmp.setNum(shadeq4->getValue());
01445                      efval += " "+tmp;
01446                      FPointArray Vals = CurveQ1->cDisplay->getCurve();
01447                      tmp.setNum(Vals.size());
01448                      efval += " "+tmp;
01449                      for (uint p = 0; p < Vals.size(); p++)
01450                      {
01451                             FPoint pv = Vals.point(p);
01452                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01453                      }
01454                      if (CurveQ1->cDisplay->isLinear())
01455                             efval += " 1";
01456                      else
01457                             efval += " 0";
01458                      Vals = CurveQ2->cDisplay->getCurve();
01459                      tmp.setNum(Vals.size());
01460                      efval += " "+tmp;
01461                      for (uint p = 0; p < Vals.size(); p++)
01462                      {
01463                             FPoint pv = Vals.point(p);
01464                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01465                      }
01466                      if (CurveQ2->cDisplay->isLinear())
01467                             efval += " 1";
01468                      else
01469                             efval += " 0";
01470                      Vals = CurveQ3->cDisplay->getCurve();
01471                      tmp.setNum(Vals.size());
01472                      efval += " "+tmp;
01473                      for (uint p = 0; p < Vals.size(); p++)
01474                      {
01475                             FPoint pv = Vals.point(p);
01476                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01477                      }
01478                      if (CurveQ3->cDisplay->isLinear())
01479                             efval += " 1";
01480                      else
01481                             efval += " 0";
01482                      Vals = CurveQ4->cDisplay->getCurve();
01483                      tmp.setNum(Vals.size());
01484                      efval += " "+tmp;
01485                      for (uint p = 0; p < Vals.size(); p++)
01486                      {
01487                             FPoint pv = Vals.point(p);
01488                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01489                      }
01490                      if (CurveQ4->cDisplay->isLinear())
01491                             efval += " 1";
01492                      else
01493                             efval += " 0";
01494                      effectValMap[currentOptions] = efval;
01495               }
01496               if (currentOptions->text() == tr("Curves"))
01497               {
01498                      QString efval = "";
01499                      FPointArray Vals = Kdisplay->cDisplay->getCurve();
01500                      QString tmp;
01501                      tmp.setNum(Vals.size());
01502                      efval += tmp;
01503                      for (uint p = 0; p < Vals.size(); p++)
01504                      {
01505                             FPoint pv = Vals.point(p);
01506                             efval += QString(" %1 %2").arg(pv.x()).arg(pv.y());
01507                      }
01508                      if (Kdisplay->cDisplay->isLinear())
01509                             efval += " 1";
01510                      else
01511                             efval += " 0";
01512                      effectValMap[currentOptions] = efval;
01513               }
01514        }
01515 }