Hello community, here is the log from the commit of package libksane for openSUSE:Factory checked in at 2012-01-27 15:21:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libksane (Old) and /work/SRC/openSUSE:Factory/.libksane.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libksane", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/libksane/libksane.changes 2011-12-08 12:12:51.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libksane.new/libksane.changes 2012-01-27 15:21:48.000000000 +0100 @@ -1,0 +2,16 @@ +Wed Jan 18 21:00:09 CET 2012 - dmuel...@suse.de + +- update to 4.8.0 + * first stable release of KDE 4.8 (only critical fixes over 4.7.98) + * see http://kde.org/announcements/4.8/ for details + + +------------------------------------------------------------------- +Tue Jan 10 18:47:10 CET 2012 - dmuel...@suse.de + +- update to 4.7.98 + * RC2+ milestone release of KDE 4.8 + * see http://kde.org/announcements/4.8/ for details + + +------------------------------------------------------------------- Old: ---- libksane-4.7.4.tar.bz2 New: ---- libksane-4.8.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libksane.spec ++++++ --- /var/tmp/diff_new_pack.rup9l9/_old 2012-01-27 15:21:49.000000000 +0100 +++ /var/tmp/diff_new_pack.rup9l9/_new 2012-01-27 15:21:49.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package libksane # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -39,7 +39,7 @@ License: GPL-2.0+ Group: Development/Libraries/KDE Url: http://www.kde.org -Version: 4.7.4 +Version: 4.8.0 Release: 0 Source0: %{name}-%version.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ libksane-4.7.4.tar.bz2 -> libksane-4.8.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/CMakeLists.txt new/libksane-4.8.0/CMakeLists.txt --- old/libksane-4.7.4/CMakeLists.txt 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/CMakeLists.txt 2011-08-07 17:41:52.000000000 +0200 @@ -10,7 +10,8 @@ # Check if sane API is available. IF (NOT WIN32) - FIND_PACKAGE(Sane REQUIRED) + FIND_PACKAGE(Sane) + macro_log_feature(SANE_FOUND "SANE development toolkit" "Scanner Access Now Easy (SANE) development package" "http://www.sane-project.org" TRUE "" "Needed by libksane") ENDIF (NOT WIN32) ADD_DEFINITIONS (${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) @@ -84,3 +85,5 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libksane.lsm.cmake ${CMAKE_CURRENT_BINARY_DIR}/libksane.lsm) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libksane.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) ENDIF(NOT WIN32) + +macro_display_feature_log() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/TODO new/libksane-4.8.0/TODO --- old/libksane-4.7.4/TODO 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/TODO 2011-09-26 11:45:48.000000000 +0200 @@ -1,6 +1,49 @@ TODO list of new features: * Cleanup the code for closing the device -* Add public api to get a list of all available devices. * Progressive final scan: scan can provide huge image especially in 16 bits color depth. Send image data to host application by block, not the whole image at once. + + + +# KSaneCore (most signals/slots from KSaneWidget) +QList<KSaneOption*> options() const // handles to sane options +KSaneBasicOptions* createBasicOptions(QWidget *parent=0) const // A widget with current "basic options" +KSaneSpecialOptions* createSpecialOptions(QWidget *parent=0) const // A widget with the rest of the options +void signalPreviewUpdated(QImage *img); + +KSaneCore never displays popups and always emits userMessage like signals for user information + + +# KSaneOption +virtual QWidget* createWidget(QWidget* parent=0) const; // Create a KSaneOptionWidget and connect it to the option +QString saneName() const; // Technical name of the sane option +QString title() const; // Translated option title +QString description() const; // Translated option description + +Cleanup public API + +# KSaneOptionWidget +Remove label and custom label size code + +# KSaneBasicOptions(QWidget *parent=0) // Use private header for basic/Special selection +bool loadOptions(const QList<KSaneOption*> &options) + +# KSaneSpecialOptions(QWidget *parent=0) // Use private header for basic/Special selection +bool loadOptions(const QList<KSaneOption*> &options) + +# KSanePreview +Figure out how to minimize copying the image data to all possible preview widgets +void "connectToCore"(KSaneCore*) // connect to previewUpdated(..), scanProgress(), ... + +# KSaneWidget +Use KSaneCore + KSaneBasicOptions + KSaneSpecialOptions + KSanePreview to create a GUI like the current +Forward userMessage signals if connected or popup a dialog + + +#General cleanup: +-> enum xxx { }; for easier signal/slot handling +float -> qreal + +# Pure Qt library option? + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/ksanetwain/ktwain_widget.cpp new/libksane-4.8.0/ksanetwain/ktwain_widget.cpp --- old/libksane-4.7.4/ksanetwain/ktwain_widget.cpp 2011-09-01 22:47:59.000000000 +0200 +++ new/libksane-4.8.0/ksanetwain/ktwain_widget.cpp 2011-09-26 11:45:48.000000000 +0200 @@ -58,9 +58,9 @@ // Forward signals from the private class //connect(d, SIGNAL(scanProgress(int)), this, SIGNAL(scanProgress(int))); - connect(d, SIGNAL(ImageReady(QByteArray &, int, int, int, int)), - this, SIGNAL(imageReady(QByteArray &, int, int, int, int))); - //connect(d, SIGNAL(scanDone(int, QString)), this, SIGNAL(scanDone(int, QString))); + connect(d, SIGNAL(ImageReady(QByteArray&,int,int,int,int)), + this, SIGNAL(imageReady(QByteArray&,int,int,int,int))); + //connect(d, SIGNAL(scanDone(int,QString)), this, SIGNAL(scanDone(int,QString))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/ksane.h new/libksane-4.8.0/libksane/ksane.h --- old/libksane-4.7.4/libksane/ksane.h 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/ksane.h 2011-07-27 20:42:01.000000000 +0200 @@ -278,9 +278,25 @@ /** * This signal is emitted every time the device list is updated or * after initGetDeviceList() is called. + * @param deviceList is a QList of KSaneWidget::DeviceInfo that contain the + * device name, model, vendor and type of the attached scanners. + * @note The list is only a snapshot of the current available devices. Devices + * might be added or removed/opened after the signal is emitted. */ void availableDevices(const QList<KSaneWidget::DeviceInfo> &deviceList); + /** + * This Signal is emitted when a hardware button is pressed. + * @param optionName is the untranslated technical name of the sane-option. + * @param optionLabel is the translated user visible label of the sane-option. + * @param pressed indicates if the value is true or false. + * @note The SANE standard does not specify hardware buttons and their behaviors, + * so this signal is emitted for sane-options that behave like hardware buttons. + * That is the sane-options are read-only and type boolean. The naming of hardware + * buttons also differ from backend to backend. + */ + void buttonPressed(const QString &optionName, const QString &optionLabel, bool pressed); + private: KSaneWidgetPrivate * const d; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/ksane_viewer.cpp new/libksane-4.8.0/libksane/ksane_viewer.cpp --- old/libksane-4.7.4/libksane/ksane_viewer.cpp 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/ksane_viewer.cpp 2011-07-27 20:42:01.000000000 +0200 @@ -722,48 +722,48 @@ switch (d->change) { case SelectionItem::None: - setCursor(Qt::CrossCursor); + viewport()->setCursor(Qt::CrossCursor); break; case SelectionItem::Top: - setCursor(Qt::SizeVerCursor); + viewport()->setCursor(Qt::SizeVerCursor); break; case SelectionItem::TopRight: - setCursor(Qt::SizeBDiagCursor); + viewport()->setCursor(Qt::SizeBDiagCursor); break; case SelectionItem::Right: - setCursor(Qt::SizeHorCursor); + viewport()->setCursor(Qt::SizeHorCursor); break; case SelectionItem::BottomRight: - setCursor(Qt::SizeFDiagCursor); + viewport()->setCursor(Qt::SizeFDiagCursor); break; case SelectionItem::Bottom: - setCursor(Qt::SizeVerCursor); + viewport()->setCursor(Qt::SizeVerCursor); break; case SelectionItem::BottomLeft: - setCursor(Qt::SizeBDiagCursor); + viewport()->setCursor(Qt::SizeBDiagCursor); break; case SelectionItem::Left: - setCursor(Qt::SizeHorCursor); + viewport()->setCursor(Qt::SizeHorCursor); break; case SelectionItem::TopLeft: - setCursor(Qt::SizeFDiagCursor); + viewport()->setCursor(Qt::SizeFDiagCursor); break; case SelectionItem::Move: - setCursor(Qt::SizeAllCursor); + viewport()->setCursor(Qt::SizeAllCursor); break; case SelectionItem::AddRemove: - setCursor(Qt::ArrowCursor); + viewport()->setCursor(Qt::ArrowCursor); break; } } else { - setCursor(Qt::CrossCursor); + viewport()->setCursor(Qt::CrossCursor); } // now check the selection list for (int i=0; i<d->selectionList.size(); i++) { if (d->selectionList[i]->intersects(scenePoint) == SelectionItem::AddRemove) { - setCursor(Qt::ArrowCursor); + viewport()->setCursor(Qt::ArrowCursor); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/ksane_widget.cpp new/libksane-4.8.0/libksane/ksane_widget.cpp --- old/libksane-4.7.4/libksane/ksane_widget.cpp 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/ksane_widget.cpp 2011-09-26 11:45:48.000000000 +0200 @@ -109,8 +109,8 @@ // Create the static UI // create the preview d->m_previewViewer = new KSaneViewer(&(d->m_previewImg), this); - connect(d->m_previewViewer, SIGNAL(newSelection(float, float, float, float)), - d, SLOT(handleSelection(float, float, float, float))); + connect(d->m_previewViewer, SIGNAL(newSelection(float,float,float,float)), + d, SLOT(handleSelection(float,float,float,float))); d->m_warmingUp = new QLabel; @@ -410,7 +410,7 @@ // read the rest of the options for (i=1; i<numSaneOptions; ++i) { - switch (KSaneOption::otpionType(sane_get_option_descriptor(d->m_saneHandle, i))) { + switch (KSaneOption::optionType(sane_get_option_descriptor(d->m_saneHandle, i))) { case KSaneOption::TYPE_DETECT_FAIL: d->m_optList.append(new KSaneOption(d->m_saneHandle, i)); break; @@ -443,6 +443,21 @@ //kDebug() << d->m_optList.at(i)->name(); connect (d->m_optList.at(i), SIGNAL(optsNeedReload()), d, SLOT(optReload())); connect (d->m_optList.at(i), SIGNAL(valsNeedReload()), d, SLOT(scheduleValReload())); + + if (d->m_optList.at(i)->needsPolling()) { + //kDebug() << d->m_optList.at(i)->name() << " needs polling"; + d->m_pollList.append(d->m_optList.at(i)); + KSaneOptCheckBox *buttonOption = qobject_cast<KSaneOptCheckBox *>(d->m_optList.at(i)); + if (buttonOption) { + connect(buttonOption, SIGNAL(buttonPressed(QString,QString,bool)), + this, SIGNAL(buttonPressed(QString,QString,bool))); + } + } + } + + // start polling the poll options + if (d->m_pollList.size() > 0) { + d->m_optionPollTmr.start(); } // Create the preview thread diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/ksane_widget_private.cpp new/libksane-4.8.0/libksane/ksane_widget_private.cpp --- old/libksane-4.7.4/libksane/ksane_widget_private.cpp 2011-07-19 23:34:54.000000000 +0200 +++ new/libksane-4.8.0/libksane/ksane_widget_private.cpp 2011-09-26 11:45:48.000000000 +0200 @@ -54,7 +54,6 @@ m_optsTabWidget = 0; m_basicOptsTab = 0; m_otherOptsTab = 0; - m_colorOpts = 0; m_zInBtn = 0; m_zOutBtn = 0; m_zSelBtn = 0; @@ -90,16 +89,20 @@ connect(m_findDevThread, SIGNAL(finished()), this, SLOT(signalDevListUpdate())); m_auth = KSaneAuth::getInstance(); + m_optionPollTmr.setInterval(100); + connect(&m_optionPollTmr, SIGNAL(timeout()), this, SLOT(pollPollOptions())); } void KSaneWidgetPrivate::clearDeviceOptions() { m_optSource = 0; + m_colorOpts = 0; m_optNegative = 0; m_optFilmType = 0; m_optMode = 0; m_optDepth = 0; m_optRes = 0; + m_optResX = 0; m_optResY = 0; m_optTlX = 0; m_optTlY = 0; @@ -112,21 +115,15 @@ m_optWaitForBtn = 0; m_scanOngoing = false; m_closeDevicePending = false; - - delete m_invertColors; - m_invertColors = 0; + // delete all the options in the list. while (!m_optList.isEmpty()) { delete m_optList.takeFirst(); } + m_pollList.clear(); + m_optionPollTmr.stop(); // remove the remaining layouts/widgets and read thread - delete m_commonGamma; - m_commonGamma = 0; - - delete m_splitGamChB; - m_splitGamChB = 0; - delete m_basicOptsTab; m_basicOptsTab = 0; @@ -138,7 +135,7 @@ delete m_scanThread; m_scanThread = 0; - + m_devName.clear(); } @@ -279,18 +276,17 @@ option->createWidget(m_basicOptsTab); basic_layout->addWidget(option->widget()); } - else { - // TODO: add a combined x and y resolution widget. - if ((option = getOption(SANE_NAME_SCAN_X_RESOLUTION)) != 0) { - m_optRes = option; + // These two next resolution options are a bit tricky. + if ((option = getOption(SANE_NAME_SCAN_X_RESOLUTION)) != 0) { + m_optResX = option; + if (!m_optRes) m_optRes = m_optResX; + option->createWidget(m_basicOptsTab); + basic_layout->addWidget(option->widget()); + } + if ((option = getOption(SANE_NAME_SCAN_Y_RESOLUTION)) != 0) { + m_optResY = option; option->createWidget(m_basicOptsTab); basic_layout->addWidget(option->widget()); - } - if ((option = getOption(SANE_NAME_SCAN_Y_RESOLUTION)) != 0) { - m_optResY = option; - option->createWidget(m_basicOptsTab); - basic_layout->addWidget(option->widget()); - } } // save a pointer to the preview option if possible @@ -322,7 +318,7 @@ } // Color Options Frame - m_colorOpts = new QWidget; + m_colorOpts = new QWidget(m_basicOptsTab); basic_layout->addWidget(m_colorOpts); QVBoxLayout *color_lay = new QVBoxLayout(m_colorOpts); color_lay->setContentsMargins(0,0,0,0); @@ -338,28 +334,27 @@ } // Add gamma tables to the color "frame" - QWidget *gamma_frm = new QWidget; + QWidget *gamma_frm = new QWidget(m_colorOpts); color_lay->addWidget(gamma_frm); QVBoxLayout *gam_frm_l = new QVBoxLayout(gamma_frm); gam_frm_l->setContentsMargins(0,0,0,0); if ((option = getOption(SANE_NAME_GAMMA_VECTOR_R)) != 0) { - m_optGamR= option; + m_optGamR = option; option->createWidget(gamma_frm); gam_frm_l->addWidget(option->widget()); } if ((option = getOption(SANE_NAME_GAMMA_VECTOR_G)) != 0) { - m_optGamG= option; + m_optGamG = option; option->createWidget(gamma_frm); gam_frm_l->addWidget(option->widget()); } if ((option = getOption(SANE_NAME_GAMMA_VECTOR_B)) != 0) { - m_optGamB= option; + m_optGamB = option; option->createWidget(gamma_frm); gam_frm_l->addWidget(option->widget()); } - - + if ((m_optGamR != 0) && (m_optGamG != 0) && (m_optGamB != 0)) { LabeledGamma *gamma = reinterpret_cast<LabeledGamma *>(m_optGamR->widget()); m_commonGamma = new LabeledGamma(m_colorOpts, i18n(SANE_TITLE_GAMMA_VECTOR), gamma->size()); @@ -372,7 +367,7 @@ connect(m_commonGamma, SIGNAL(gammaChanged(int,int,int)), m_optGamG->widget(), SLOT(setValues(int,int,int))); connect(m_commonGamma, SIGNAL(gammaChanged(int,int,int)), m_optGamB->widget(), SLOT(setValues(int,int,int))); - m_splitGamChB = new LabeledCheckbox(m_basicOptsTab, i18n("Separate color intensity tables")); + m_splitGamChB = new LabeledCheckbox(m_colorOpts, i18n("Separate color intensity tables")); color_lay->addWidget(m_splitGamChB); connect (m_splitGamChB, SIGNAL(toggled(bool)), gamma_frm, SLOT(setVisible(bool))); @@ -523,6 +518,12 @@ // Also read the values m_optList.at(i)->readValue(); } + // Gamma table special case + if (m_optGamR && m_optGamG && m_optGamB) { + m_commonGamma->setHidden(m_optGamR->state() == KSaneOption::STATE_HIDDEN); + m_splitGamChB->setHidden(m_optGamR->state() == KSaneOption::STATE_HIDDEN); + } + // estimate the preview size and create an empty image // this is done so that you can select scan area without // having to scan a preview. @@ -709,6 +710,7 @@ // store the current settings of parameters to be changed if (m_optDepth != 0) m_optDepth->storeCurrentData(); if (m_optRes != 0) m_optRes->storeCurrentData(); + if (m_optResX != 0) m_optResX->storeCurrentData(); if (m_optResY != 0) m_optResY->storeCurrentData(); if (m_optPreview != 0) m_optPreview->storeCurrentData(); @@ -808,10 +810,11 @@ emit q->scanDone(KSaneWidget::NoError, ""); return; } - + // restore the original settings of the changed parameters if (m_optDepth != 0) m_optDepth->restoreSavedData(); if (m_optRes != 0) m_optRes->restoreSavedData(); + if (m_optResX != 0) m_optResX->restoreSavedData(); if (m_optResY != 0) m_optResY->restoreSavedData(); if (m_optPreview != 0) m_optPreview->restoreSavedData(); @@ -855,18 +858,18 @@ m_previewViewer->selectionAt(m_selIndex, x1,y1,x2,y2); m_previewViewer->setHighlightArea(x1,y1,x2,y2); m_selIndex++; - + // calculate the option values x1 *= max_x; y1 *= max_y; x2 *= max_x; y2 *= max_y; - + // now set the selection m_optTlX->setValue(x1); m_optTlY->setValue(y1); m_optBrX->setValue(x2); m_optBrY->setValue(y2); } - + // execute a pending value reload while (m_readValsTmr.isActive()) { m_readValsTmr.stop(); @@ -1099,7 +1102,7 @@ void KSaneWidgetPrivate::alertUser(int type, const QString &strStatus) { - if (q->receivers(SIGNAL(userMessage(int, QString))) == 0) { + if (q->receivers(SIGNAL(userMessage(int,QString))) == 0) { switch (type) { case KSaneWidget::ErrorGeneral: KMessageBox::sorry(0, strStatus); @@ -1113,5 +1116,12 @@ } } +void KSaneWidgetPrivate::pollPollOptions() +{ + for (int i=1; i<m_pollList.size(); ++i) { + m_pollList.at(i)->readValue(); + } +} + } // NameSpace KSaneIface diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/ksane_widget_private.h new/libksane-4.8.0/libksane/ksane_widget_private.h --- old/libksane-4.7.4/libksane/ksane_widget_private.h 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/ksane_widget_private.h 2011-08-22 15:32:03.000000000 +0200 @@ -104,6 +104,7 @@ void checkInvert(); void invertPreview(); + void pollPollOptions(); public: void alertUser(int type, const QString &strStatus); @@ -144,12 +145,14 @@ // Option variables QList<KSaneOption*> m_optList; + QList<KSaneOption*> m_pollList; KSaneOption *m_optSource; KSaneOption *m_optNegative; KSaneOption *m_optFilmType; KSaneOption *m_optMode; KSaneOption *m_optDepth; KSaneOption *m_optRes; + KSaneOption *m_optResX; KSaneOption *m_optResY; KSaneOption *m_optTlX; KSaneOption *m_optTlY; @@ -182,6 +185,7 @@ // option handling QTimer m_readValsTmr; QTimer m_updProgressTmr; + QTimer m_optionPollTmr; KSaneScanThread *m_scanThread; KSanePreviewThread *m_previewThread; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/options/ksane_opt_checkbox.cpp new/libksane-4.8.0/libksane/options/ksane_opt_checkbox.cpp --- old/libksane-4.7.4/libksane/options/ksane_opt_checkbox.cpp 2011-12-02 00:26:29.000000000 +0100 +++ new/libksane-4.8.0/libksane/options/ksane_opt_checkbox.cpp 2011-11-04 15:35:52.000000000 +0100 @@ -79,7 +79,7 @@ { if (state() == STATE_HIDDEN) return; - // read that current value + // read the current value QVarLengthArray<unsigned char> data(m_optDesc->size); SANE_Status status; SANE_Int res; @@ -87,11 +87,14 @@ if (status != SANE_STATUS_GOOD) { return; } - + bool old = m_checked; m_checked = (toSANE_Word(data.data()) != 0) ? true:false; if (m_checkbox) { m_checkbox->setChecked(m_checked); } + if ((old != m_checked) && ((m_optDesc->cap & SANE_CAP_SOFT_SELECT) == 0)) { + emit buttonPressed(name(), i18n(m_optDesc->title), m_checked); + } } bool KSaneOptCheckBox::getValue(float &val) @@ -127,6 +130,7 @@ else { checkboxChanged(false); } + readValue(); return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/options/ksane_opt_checkbox.h new/libksane-4.8.0/libksane/options/ksane_opt_checkbox.h --- old/libksane-4.7.4/libksane/options/ksane_opt_checkbox.h 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/options/ksane_opt_checkbox.h 2011-07-27 20:42:01.000000000 +0200 @@ -55,6 +55,9 @@ private Q_SLOTS: void checkboxChanged(bool toggled); +Q_SIGNALS: + void buttonPressed(const QString &optionName, const QString &optionLabel, bool pressed); + private: LabeledCheckbox *m_checkbox; bool m_checked; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/options/ksane_opt_combo.cpp new/libksane-4.8.0/libksane/options/ksane_opt_combo.cpp --- old/libksane-4.7.4/libksane/options/ksane_opt_combo.cpp 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/options/ksane_opt_combo.cpp 2011-09-26 11:45:48.000000000 +0200 @@ -146,7 +146,7 @@ case SANE_UNIT_MM: return i18np("%1 mm","%1 mm", ival); case SANE_UNIT_DPI: return i18np("%1 DPI","%1 DPI", ival); case SANE_UNIT_PERCENT: return i18np("%1 %","%1 %", ival); - case SANE_UNIT_MICROSECOND: return i18np("%1 usec","%1 usec", ival); + case SANE_UNIT_MICROSECOND: return i18np("%1 µs","%1 µs", ival); } return QString::number(ival); } @@ -158,10 +158,10 @@ case SANE_UNIT_NONE: break; case SANE_UNIT_PIXEL: return i18ncp("Parameter and Unit","%1 Pixel", "%1 Pixels", fval); case SANE_UNIT_BIT: return i18ncp("Parameter and Unit","%1 Bit","%1 Bits", fval); - case SANE_UNIT_MM: return i18nc("Parameter and Unit","%1 mm", fval); - case SANE_UNIT_DPI: return i18nc("Parameter and Unit","%1 DPI", fval); - case SANE_UNIT_PERCENT: return i18nc("Parameter and Unit","%1 %", fval); - case SANE_UNIT_MICROSECOND: return i18ncp("Parameter and Unit","%1 usec","%1 usec", fval); + case SANE_UNIT_MM: return i18nc("Parameter and Unit (Millimeter)","%1 mm", fval); + case SANE_UNIT_DPI: return i18nc("Parameter and Unit (Dots Per Inch)","%1 DPI", fval); + case SANE_UNIT_PERCENT: return i18nc("Parameter and Unit (Percentage)","%1 %", fval); + case SANE_UNIT_MICROSECOND: return i18nc("Parameter and Unit (Microseconds)","%1 µs", fval); } return QString::number(fval, 'F', 4); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/options/ksane_opt_entry.cpp new/libksane-4.8.0/libksane/options/ksane_opt_entry.cpp --- old/libksane-4.7.4/libksane/options/ksane_opt_entry.cpp 2011-12-02 00:26:29.000000000 +0100 +++ new/libksane-4.8.0/libksane/options/ksane_opt_entry.cpp 2011-11-04 15:35:52.000000000 +0100 @@ -59,7 +59,7 @@ m_widget = m_entry = new LabeledEntry(parent, i18n(m_optDesc->title)); m_widget->setToolTip(i18n(m_optDesc->desc)); - connect(m_entry, SIGNAL(entryEdited(const QString&)), this, SLOT(entryChanged(const QString&))); + connect(m_entry, SIGNAL(entryEdited(QString)), this, SLOT(entryChanged(QString))); updateVisibility(); readValue(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/options/ksane_opt_gamma.cpp new/libksane-4.8.0/libksane/options/ksane_opt_gamma.cpp --- old/libksane-4.7.4/libksane/options/ksane_opt_gamma.cpp 2011-12-02 00:26:29.000000000 +0100 +++ new/libksane-4.8.0/libksane/options/ksane_opt_gamma.cpp 2011-11-04 15:35:52.000000000 +0100 @@ -59,8 +59,8 @@ m_widget = m_gamma = new LabeledGamma(parent, i18n(m_optDesc->title), m_optDesc->size/sizeof(SANE_Word)); - connect(m_gamma, SIGNAL(gammaTableChanged(const QVector<int> &)), - this, SLOT(gammaTableChanged(const QVector<int> &))); + connect(m_gamma, SIGNAL(gammaTableChanged(QVector<int>)), + this, SLOT(gammaTableChanged(QVector<int>))); if (strcmp(m_optDesc->name, SANE_NAME_GAMMA_VECTOR_R) == 0) m_gamma->setColor(Qt::red); if (strcmp(m_optDesc->name, SANE_NAME_GAMMA_VECTOR_G) == 0) m_gamma->setColor(Qt::green); if (strcmp(m_optDesc->name, SANE_NAME_GAMMA_VECTOR_B) == 0) m_gamma->setColor(Qt::blue); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/options/ksane_option.cpp new/libksane-4.8.0/libksane/options/ksane_option.cpp --- old/libksane-4.7.4/libksane/options/ksane_option.cpp 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/options/ksane_option.cpp 2011-09-26 11:45:48.000000000 +0200 @@ -95,7 +95,7 @@ if (((m_optDesc->cap & SANE_CAP_SOFT_DETECT) == 0) || (m_optDesc->cap & SANE_CAP_INACTIVE) || - ((m_optDesc->size == 0) && (otpionType(m_optDesc) != TYPE_BUTTON))) + ((m_optDesc->size == 0) && (optionType(m_optDesc) != TYPE_BUTTON))) { return STATE_HIDDEN; } @@ -105,6 +105,17 @@ return STATE_SHOWN; } +bool KSaneOption::needsPolling() +{ + if (!m_optDesc) return false; + + if ((m_optDesc->cap & SANE_CAP_AUTOMATIC) || !(m_optDesc->cap & SANE_CAP_SOFT_SELECT)) { + return true; + } + + return false; +} + QString KSaneOption::name() { if (m_optDesc == 0) return QString(""); @@ -116,6 +127,10 @@ SANE_Status status; SANE_Int res; + if (state() == STATE_DISABLED) { + return false; + } + status = sane_control_option (m_handle, m_index, SANE_ACTION_SET_VALUE, data, &res); if (status != SANE_STATUS_GOOD) { kDebug() << m_optDesc->name << "sane_control_option returned:" << sane_strstatus(status); @@ -204,17 +219,7 @@ return true; } -void KSaneOption::widgetSizeHints(int *, int *) -{ - kDebug() << m_optDesc->name << " : type not supported"; -} - -void KSaneOption::setColumnWidths(int, int) -{ - kDebug() << m_optDesc->name << " : type not supported"; -} - -KSaneOption::KSaneOptType KSaneOption::otpionType(const SANE_Option_Descriptor *optDesc) +KSaneOption::KSaneOptType KSaneOption::optionType(const SANE_Option_Descriptor *optDesc) { if (!optDesc) return TYPE_DETECT_FAIL; @@ -293,10 +298,10 @@ case SANE_UNIT_NONE: return KLocalizedString(); case SANE_UNIT_PIXEL: return ki18ncp("SpinBox parameter unit", " Pixel", " Pixels"); case SANE_UNIT_BIT: return ki18ncp("SpinBox parameter unit", " Bit", " Bits"); - case SANE_UNIT_MM: return ki18nc("SpinBox parameter unit", " mm"); - case SANE_UNIT_DPI: return ki18nc("SpinBox parameter unit", " DPI"); - case SANE_UNIT_PERCENT: return ki18nc("SpinBox parameter unit", " %"); - case SANE_UNIT_MICROSECOND: return ki18ncp("SpinBox parameter unit", " usec", " usecs"); + case SANE_UNIT_MM: return ki18nc("SpinBox parameter unit (Millimeter)", " mm"); + case SANE_UNIT_DPI: return ki18nc("SpinBox parameter unit (Dots Per Inch)", " DPI"); + case SANE_UNIT_PERCENT: return ki18nc("SpinBox parameter unit (Percentage)", " %"); + case SANE_UNIT_MICROSECOND: return ki18nc("SpinBox parameter unit (Microseconds)", " µs"); } return KLocalizedString(); } @@ -308,10 +313,10 @@ case SANE_UNIT_NONE: return QString(""); case SANE_UNIT_PIXEL: return i18nc("Double numbers. SpinBox parameter unit", " Pixels"); case SANE_UNIT_BIT: return i18nc("Double numbers. SpinBox parameter unit", " Bits"); - case SANE_UNIT_MM: return i18nc("Double numbers. SpinBox parameter unit", " mm"); - case SANE_UNIT_DPI: return i18nc("Double numbers. SpinBox parameter unit", " DPI"); - case SANE_UNIT_PERCENT: return i18nc("Double numbers. SpinBox parameter unit", " %"); - case SANE_UNIT_MICROSECOND: return i18nc("Double numbers. SpinBox parameter unit", " usec"); + case SANE_UNIT_MM: return i18nc("Double numbers. SpinBox parameter unit (Millimeter)", " mm"); + case SANE_UNIT_DPI: return i18nc("Double numbers. SpinBox parameter unit (Dots Per Inch)", " DPI"); + case SANE_UNIT_PERCENT: return i18nc("Double numbers. SpinBox parameter unit (Percentage)", " %"); + case SANE_UNIT_MICROSECOND: return i18nc("Double numbers. SpinBox parameter unit (Microseconds)", " µs"); } return QString(""); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/options/ksane_option.h new/libksane-4.8.0/libksane/options/ksane_option.h --- old/libksane-4.7.4/libksane/options/ksane_option.h 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/options/ksane_option.h 2011-08-22 15:32:03.000000000 +0200 @@ -64,12 +64,21 @@ TYPE_BUTTON } KSaneOptType; + typedef enum + { + STATE_HIDDEN, + STATE_DISABLED, + STATE_SHOWN + } KSaneOptWState; + KSaneOption(const SANE_Handle handle, const int index); ~KSaneOption(); - static KSaneOptType otpionType(const SANE_Option_Descriptor *optDesc); + static KSaneOptType optionType(const SANE_Option_Descriptor *optDesc); KSaneOptionWidget *widget() {return m_widget;} virtual bool hasGui() {return false;} + bool needsPolling(); + KSaneOptWState state(); QString name(); virtual void createWidget(QWidget *parent); @@ -88,27 +97,17 @@ bool storeCurrentData(); bool restoreSavedData(); - virtual void widgetSizeHints(int *lab_w, int *rest_w); - virtual void setColumnWidths(int lab_w, int rest_w); - Q_SIGNALS: void optsNeedReload(); void valsNeedReload(); protected: - typedef enum - { - STATE_HIDDEN, - STATE_DISABLED, - STATE_SHOWN - } KSaneOptWState; SANE_Word toSANE_Word(unsigned char *data); void fromSANE_Word(unsigned char *data, SANE_Word from); bool writeData(void *data); KLocalizedString unitString(); QString unitDoubleString(); - KSaneOptWState state(); void updateVisibility(); SANE_Handle m_handle; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/widgets/ksane_option_widget.cpp new/libksane-4.8.0/libksane/widgets/ksane_option_widget.cpp --- old/libksane-4.7.4/libksane/widgets/ksane_option_widget.cpp 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/widgets/ksane_option_widget.cpp 2011-07-27 20:42:01.000000000 +0200 @@ -30,6 +30,7 @@ // Qt includes #include <KDebug> +#include <KLocale> namespace KSaneIface { @@ -37,7 +38,8 @@ KSaneOptionWidget::KSaneOptionWidget(QWidget *parent, const QString& labelText) : QWidget(parent) { - m_label = new QLabel(labelText); + m_label = new QLabel; + setLabelText(labelText); m_layout = new QGridLayout(this); m_layout->addWidget(m_label, 0, 0, Qt::AlignRight); @@ -51,7 +53,11 @@ void KSaneOptionWidget::setLabelText(const QString &text) { - m_label->setText(text); + if (text.isEmpty()) { + m_label->setText(QString()); + } else { + m_label->setText(i18nc("Label for a scanner option", "%1:", text)); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libksane-4.7.4/libksane/widgets/labeled_checkbox.cpp new/libksane-4.8.0/libksane/widgets/labeled_checkbox.cpp --- old/libksane-4.7.4/libksane/widgets/labeled_checkbox.cpp 2011-05-20 22:36:12.000000000 +0200 +++ new/libksane-4.8.0/libksane/widgets/labeled_checkbox.cpp 2011-07-27 20:42:01.000000000 +0200 @@ -36,9 +36,9 @@ { LabeledCheckbox::LabeledCheckbox(QWidget *parent, const QString& ltext) -: KSaneOptionWidget(parent, ltext) +: KSaneOptionWidget(parent, QString()) { - chbx = new QCheckBox(QString(), this); + chbx = new QCheckBox(ltext, this); m_layout->addWidget(chbx, 0, 1); m_layout->setColumnStretch(1, 50); -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org