[Jdlraw-discussion] jdlRaw/Sources jdlChoice.cpp, 1.4, 1.5 jdlHistogramWindow.cpp, 1.5, 1.6 jdlInpu
Status: Beta
Brought to you by:
jdla
|
From: Jos De L. <jd...@us...> - 2010-08-07 21:24:57
|
Update of /cvsroot/jdlraw/jdlRaw/Sources In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1186/Sources Modified Files: jdlChoice.cpp jdlHistogramWindow.cpp jdlInput.cpp jdlItems.i jdlMain.cpp jdlMain.h jdlProcessor.cpp jdlThumbnailer.cpp jdlToolBoxControl.cpp jdlToolBoxes.i Log Message: *) Some restyling and theming possibility. Index: jdlToolBoxes.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlToolBoxes.i,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** jdlToolBoxes.i 18 Jul 2010 08:01:34 -0000 1.13 --- jdlToolBoxes.i 7 Aug 2010 21:24:48 -0000 1.14 *************** *** 29,33 **** {1, "Fixed_WorkColorSpace", _("Work Colorspace") }, {1, "Fixed_PreviewColorSpace", _("Preview Colorspace") }, - {1, "Fixed_PipeSize", _("Scaling in pipe") }, {1, "Fixed_GenericCorrections", _("Generic Corrections") }, {1, "Fixed_WhiteBalance", _("White Balance") }, --- 29,32 ---- Index: jdlProcessor.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlProcessor.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** jdlProcessor.cpp 18 Jul 2010 08:01:34 -0000 1.27 --- jdlProcessor.cpp 7 Aug 2010 21:24:48 -0000 1.28 *************** *** 107,112 **** } else if (ToolBoxes[i].Key == "Fixed_PreviewColorSpace") { ; - } else if (ToolBoxes[i].Key == "Fixed_PipeSize") { - ; } else if (ToolBoxes[i].Key == "Fixed_GenericCorrections") { ; --- 107,110 ---- Index: jdlToolBoxControl.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlToolBoxControl.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlToolBoxControl.cpp 27 Feb 2010 19:02:42 -0000 1.4 --- jdlToolBoxControl.cpp 7 Aug 2010 21:24:48 -0000 1.5 *************** *** 116,120 **** QIcon ButtonOnIcon; ButtonOnIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/2downarrow.svg")), QIcon::Normal, QIcon::On); m_Button->setIcon(ButtonOnIcon); --- 116,120 ---- QIcon ButtonOnIcon; ButtonOnIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/triangle_down_13x13_c0.png")), QIcon::Normal, QIcon::On); m_Button->setIcon(ButtonOnIcon); *************** *** 122,126 **** QIcon ButtonOffIcon; ButtonOffIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/2rightarrow.svg")), QIcon::Normal, QIcon::Off); m_Button->setIcon(ButtonOffIcon); --- 122,126 ---- QIcon ButtonOffIcon; ButtonOffIcon.addPixmap(QPixmap( ! QString::fromUtf8(":/jdlRaw/Icons/triangle_right_13x13_c0.png")), QIcon::Normal, QIcon::Off); m_Button->setIcon(ButtonOffIcon); Index: jdlInput.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlInput.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlInput.cpp 27 Feb 2010 19:02:42 -0000 1.4 --- jdlInput.cpp 7 Aug 2010 21:24:48 -0000 1.5 *************** *** 137,140 **** --- 137,144 ---- m_Label = new QLabel(Parent); m_Label->setText(LabelText); + + // XXXX JDLA : Couldn't find better for the moment. + m_SpinBox->setFixedHeight(m_Button->height()-5); + m_Slider->setFixedHeight(m_Button->height()-9); Layout->addWidget(m_Button); Index: jdlHistogramWindow.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlHistogramWindow.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** jdlHistogramWindow.cpp 27 Feb 2010 19:02:42 -0000 1.5 --- jdlHistogramWindow.cpp 7 Aug 2010 21:24:48 -0000 1.6 *************** *** 339,353 **** Painter.save(); if (!m_QPixmap) { ! QString FileName = ! jdlRaw->m_Settings->GetString("SplashDirectory") + "jdlRawLogo.png"; ! m_QPixmap = new QPixmap(FileName); ! QPixmap* Scaled = new QPixmap( ! m_QPixmap->scaled(width(), ! height(), ! Qt::KeepAspectRatio, ! Qt::SmoothTransformation)); delete m_QPixmap; ! m_QPixmap = Scaled; ! } Painter.drawPixmap(0,0,*m_QPixmap); Painter.restore(); --- 339,379 ---- Painter.save(); if (!m_QPixmap) { ! ! int WidgetWidth = width(); ! int WidgetHeight = height(); ! ! // Instantiate an Image8 and put blanco histogram in it. ! delete m_Image8; ! m_Image8 = new jdlImage8(WidgetWidth,WidgetHeight,3); ! ! const uint16_t HistogramMargin = 5; ! const uint16_t HistogramWidth = WidgetWidth-2*HistogramMargin; ! ! // Grid ! int Sections = 5; ! int Step = HistogramWidth/Sections; ! for (short i=1; i<Sections; i++) { ! uint16_t Col=i*Step+HistogramMargin; ! for (uint16_t Row=0; Row<WidgetHeight; Row++) { ! //int value = (int) MIN(MAX(Row-15,0), 0x60); ! const int value = 0x60; ! if (!m_Image8->m_Image[Row*WidgetWidth+Col][0] && ! !m_Image8->m_Image[Row*WidgetWidth+Col][1] && ! !m_Image8->m_Image[Row*WidgetWidth+Col][2]) { ! m_Image8->m_Image[Row*WidgetWidth+Col][0] = value; ! m_Image8->m_Image[Row*WidgetWidth+Col][1] = value; ! m_Image8->m_Image[Row*WidgetWidth+Col][2] = value; ! } ! } ! } ! delete m_QPixmap; ! m_QPixmap = new QPixmap( ! QPixmap::fromImage(QImage((const uchar*) m_Image8->m_Image, ! m_Image8->m_Width, ! m_Image8->m_Height, ! QImage::Format_RGB32))); ! ! } Painter.drawPixmap(0,0,*m_QPixmap); Painter.restore(); Index: jdlChoice.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlChoice.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdlChoice.cpp 27 Feb 2010 19:02:41 -0000 1.4 --- jdlChoice.cpp 7 Aug 2010 21:24:48 -0000 1.5 *************** *** 75,80 **** QHBoxLayout *Layout = new QHBoxLayout(Parent); - Layout->setContentsMargins(2,2,2,2); - Layout->setMargin(2); Parent->setLayout(Layout); --- 75,78 ---- *************** *** 97,100 **** --- 95,101 ---- if (!m_HaveDefault) m_Button->hide(); + // XXXX JDLA : Couldn't find better for the moment. + m_ComboBox->setFixedHeight(m_Button->height()-5); + Layout->addWidget(m_Button); Layout->addWidget(m_ComboBox); Index: jdlMain.h =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** jdlMain.h 18 Jul 2010 08:01:34 -0000 1.12 --- jdlMain.h 7 Aug 2010 21:24:48 -0000 1.13 *************** *** 97,100 **** --- 97,101 ---- void ToolConfHighlighted(int Index); + void ThemeHighlighted(int Index); void ReportProgress(const QString Message); Index: jdlThumbnailer.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlThumbnailer.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlThumbnailer.cpp 24 Apr 2010 17:30:51 -0000 1.10 --- jdlThumbnailer.cpp 7 Aug 2010 21:24:48 -0000 1.11 *************** *** 404,409 **** CenteredImage = (uint16_t (*)[3]) CALLOC(Size*Size,sizeof(*CenteredImage)); jdlMemoryError(CenteredImage,__FILE__,__LINE__); ! // BG as window. ! QColor BGColor = jdlRaw->palette().color(QPalette::Window); for (uint16_t j=0;j<Size*Size;j++) { CenteredImage[j][0] = BGColor.blue() << 8; --- 404,411 ---- CenteredImage = (uint16_t (*)[3]) CALLOC(Size*Size,sizeof(*CenteredImage)); jdlMemoryError(CenteredImage,__FILE__,__LINE__); ! // The statusbar is an easy one to find and with the ! // slightly lighter color than background. ! QColor BGColor = ! jdlRaw->m_MainWindow->StatusBar->palette().color(QPalette::Window); for (uint16_t j=0;j<Size*Size;j++) { CenteredImage[j][0] = BGColor.blue() << 8; Index: jdlItems.i =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlItems.i,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** jdlItems.i 18 Jul 2010 08:01:34 -0000 1.10 --- jdlItems.i 7 Aug 2010 21:24:48 -0000 1.11 *************** *** 131,135 **** _("Intent of the profile")}, ! {"Fixed_PipeSize", "PipeSize", jdlGT_Choice, --- 131,135 ---- _("Intent of the profile")}, ! {"", "PipeSize", jdlGT_Choice, *************** *** 281,284 **** --- 281,296 ---- {"", + "ThemesDirectory", + 0, + "@INSTALL@/Themes", + 0}, + + {"", + "ThemeFile", + 0, + "@INSTALL@/Themes/Standard.dlt", + 0}, + + {"", "ToolConfsDirectory", 0, Index: jdlMain.cpp =================================================================== RCS file: /cvsroot/jdlraw/jdlRaw/Sources/jdlMain.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** jdlMain.cpp 18 Jul 2010 08:01:34 -0000 1.27 --- jdlMain.cpp 7 Aug 2010 21:24:48 -0000 1.28 *************** *** 183,186 **** --- 183,187 ---- // must be done. // Also the processing pipe is asked here. + // As well as the theme. short RememberSettingLevel = UserSettings->value("RememberSettingLevel",2).toInt(); *************** *** 235,238 **** --- 236,290 ---- assert(ToolConfsIndex > -1); + // For the ThemeFile we do about the same as above for the ToolConfs + + QString ThemesDir = + // XXX TODO Remark that this means that we expect the Themes + // directory at the same place as installed. We have + UserSettings->value("ThemesDirectory","Themes").toString(); + Dir.setPath(ThemesDir); + QStringList Themes = Dir.entryList(QStringList("*.dlt"),QDir::Files); + QStringList ThemesTip; + + // Read the header of each dlt file as tooltip. + for (short i=0; i<Themes.size(); i++) { + ThemesTip << QString(""); + QString FileName = ThemesDir + "/" + Themes[i]; + FILE *InFile = fopen(FileName.toAscii().data(),"r"); + if (!InFile) { + jdlLogError(jdlError_FileOpen, + "File %s could not be opened\n", + FileName.toAscii().data()); + ::exit(EXIT_FAILURE); + } + + char LineBuffer[100]; + do { + if (NULL == fgets(LineBuffer,100,InFile)) break; + if (';' != LineBuffer[0]) break; + if (';' != LineBuffer[1]) continue; + ThemesTip[i] += QString(LineBuffer+2); + } while (!feof(InFile)); + } + + short ThemesIndex = -1; + QString ThemeFile = + UserSettings->value("ThemeFile","Standard.dlt").toString(); + TRACEMAIN("ThemeFile : %s",ThemeFile.toAscii().data()); + + // This is needed at bootup of the jdlRaw system. The default + // Themes must be in the UserSettings. + UserSettings->setValue("ThemeFile",ThemeFile); + + // At which index is the themes file ? + for (short i=0;i<Themes.size();i++) { + if (ThemeFile == Themes[i]) { + ThemesIndex = i; + break; + } + } + assert(ThemesIndex > -1); + + // Here goes the Rememberdialog. + if (PathInfo.exists() && !RememberSettingDontAsk && !m_JobMode) { m_RememberDialog = *************** *** 272,279 **** --- 324,347 ---- SLOT(ToolConfHighlighted(int))); + // Additional stuff for choosing the theme. + m_RememberDialog->ThemeLabel->setText(QObject::tr("Theme :")); + for (short i=0;i<Themes.size();i++) { + m_RememberDialog->ThemeFileChoice-> + addItem(Themes[i],ThemesTip[i]); + if (ThemeFile == Themes[i]) { + m_RememberDialog->ThemeFileChoice->setCurrentIndex(i); + } + } + + connect(m_RememberDialog->ThemeFileChoice, + SIGNAL(highlighted(int)), + this, + SLOT(ThemeHighlighted(int))); + m_RememberDialog->exec(); RememberSettingLevel = m_RememberDialog->ChoiceBox->currentIndex(); RememberSettingDontAsk = m_RememberDialog->DontAskAgainCheck->isChecked(); ToolConfsIndex = m_RememberDialog->ToolConfFileChoice->currentIndex(); + ThemesIndex = m_RememberDialog->ThemeFileChoice->currentIndex(); delete m_RememberDialog; *************** *** 281,284 **** --- 349,353 ---- UserSettings->setValue("RememberSettingDontAsk",RememberSettingDontAsk); UserSettings->setValue("ToolConfFile",ToolConfs[ToolConfsIndex]); + UserSettings->setValue("ThemeFile",Themes[ThemesIndex]); } delete UserSettings; *************** *** 304,313 **** // Start op the Gui stuff. ! QColor BGColor = jdlRaw->palette().color(QPalette::Window); ! jdlRaw->setStyleSheet( ! QString("QSplitter::handle {background-color:rgb(220,220,220);} ") + ! QString("QListWidget {background-color:rgb(%1,%2,%3);}") ! .arg(BGColor.red()).arg(BGColor.green()).arg(BGColor.blue())); m_GuiOptions = new jdlGuiOptions(); --- 373,402 ---- // Start op the Gui stuff. ! // Read the "theme" file, which is in fact a stylesheet. Apply it. ! QString FileName = jdlRaw->m_Settings->GetString(QString("ThemesDirectory")) ! + "/" ! + jdlRaw->m_Settings->GetString(QString("ThemeFile")); ! QFile StyleSheetFile(FileName); ! ! if (!StyleSheetFile.open(QIODevice::ReadOnly|QIODevice::Text)) { ! jdlLogError(jdlError_FileOpen, ! m_Settings->GetString("ThemeFile").toAscii().data()); ! assert(0); ! } ! QTextStream StyleSheetStream(&StyleSheetFile); ! QString StyleSheet; ! while (!StyleSheetStream.atEnd()) { ! QString Line = StyleSheetStream.readLine(); ! // ; will be considered comment. ! if (!Line.startsWith(";")) { ! StyleSheet += Line + " "; ! } ! } ! StyleSheetFile.close(); + jdlRaw->setStyleSheet(StyleSheet); + + + // Load gui options and all the windows. m_GuiOptions = new jdlGuiOptions(); *************** *** 423,426 **** --- 512,530 ---- //////////////////////////////////////////////////////////////////////////////// // + // theme highlighted. Show tooltip with description. + // + //////////////////////////////////////////////////////////////////////////////// + + void jdlMain::ThemeHighlighted(int Index) { + QPoint ThePoint = m_RememberDialog->pos(); + ThePoint.setX(ThePoint.x()+m_RememberDialog->width()/3); + ThePoint.setY(ThePoint.y()+m_RememberDialog->height()*2/3); + QToolTip::showText(ThePoint, + m_RememberDialog->ThemeFileChoice-> + itemData(Index).toString()); + } + + //////////////////////////////////////////////////////////////////////////////// + // // Determine and update the preview image. // *************** *** 752,758 **** m_Settings->SetValue(QString("RawsDirectory"),DirName); - QColor BGColor = jdlRaw->palette().color(QPalette::Window); - QColor AltColor = jdlRaw->palette().color(QPalette::AlternateBase); - QIcon Icon; Icon.addPixmap(QPixmap(QString(":/jdlRaw/Icons/Dia.jpg")), --- 856,859 ---- *************** *** 1926,1933 **** UpdatePreviewImage(); return; - } else if (ToolBoxName == "Fixed_PipeSize") { - QVariant Dummy; - CB_PipeSize(Dummy); - return; } else if (ToolBoxName == "Fixed_GenericCorrections") { m_TheProcessor->m_TriggerUpdateExifInfoAtEnd = 0; --- 2027,2030 ---- |