diff --git a/abstractrunner.h b/abstractrunner.h index 7e336d4ea..9e30d46e0 100644 --- a/abstractrunner.h +++ b/abstractrunner.h @@ -9,7 +9,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details + * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the @@ -101,7 +101,7 @@ class PLASMA_EXPORT AbstractRunner : public QObject * * Each runner is executed in its own thread. Whenever the user input changes this * method is called again. Thus, it needs to be thread-safe. Also, all matches need - * to be reported once this method returns. Asyncroneous runners therefore need + * to be reported once this method returns. Asynchronous runners therefore need * to make use of a local event loop to wait for all matches. * * It is recommended to use local status data in async runners. The simplest way is diff --git a/containment.cpp b/containment.cpp index c3c688fc0..00a8a77b2 100644 --- a/containment.cpp +++ b/containment.cpp @@ -687,14 +687,16 @@ void ContainmentPrivate::addAppletActions(KMenu &desktopMenu, Applet *applet, QE } } - QAction *configureApplet = applet->d->actions->action("configure"); - if (configureApplet && configureApplet->isEnabled()) { - desktopMenu.addAction(configureApplet); - } + if (!applet->d->failed) { + QAction *configureApplet = applet->d->actions->action("configure"); + if (configureApplet && configureApplet->isEnabled()) { + desktopMenu.addAction(configureApplet); + } - QAction *runAssociatedApplication = applet->d->actions->action("run associated application"); - if (runAssociatedApplication && runAssociatedApplication->isEnabled()) { - desktopMenu.addAction(runAssociatedApplication); + QAction *runAssociatedApplication = applet->d->actions->action("run associated application"); + if (runAssociatedApplication && runAssociatedApplication->isEnabled()) { + desktopMenu.addAction(runAssociatedApplication); + } } KMenu *containmentMenu = new KMenu(i18nc("%1 is the name of the containment", "%1 Options", q->name()), &desktopMenu); diff --git a/data/services/plasma-applet-extenderapplet.desktop b/data/services/plasma-applet-extenderapplet.desktop index f0932eeeb..80206dc1f 100644 --- a/data/services/plasma-applet-extenderapplet.desktop +++ b/data/services/plasma-applet-extenderapplet.desktop @@ -39,6 +39,7 @@ Name[km]=សម្រាំង Name[kn]=ಸಮೂಹ Name[ko]=모음집 Name[ku]=Berhevok +Name[lt]=Rinkinys Name[lv]=Kolekcija Name[ml]=കൂട്ടം Name[ms]=Koleksi diff --git a/data/services/plasma.protocol b/data/services/plasma.protocol index 9f0566264..630216ee8 100644 --- a/data/services/plasma.protocol +++ b/data/services/plasma.protocol @@ -18,15 +18,18 @@ Description[el]=Ένα πρωτόκολλο υπηρεσιών Plasma Description[es]=Un protocolo para los servicios de Plasma Description[et]=Plasma teenuste protokoll Description[eu]=Plasma zerbitzuentzako protokolo bat -Description[fi]=Plasma-palvelujen protokolla +Description[fi]=Plasma-palvelujen yhteyskäytäntö +Description[fr]=Un protocole pour les services Plasma Description[hr]=Protokol za servise u Plasmi Description[hu]=Protokoll a Plazma-szolgáltatáshoz Description[ia]=un protocollo per servicios de Plasma Description[is]=Samskiptamáti fyrir Plasma-þjónustur +Description[it]=Un protocollo per servizi plasma Description[ja]=Plasma サービスのためのプロトコル Description[kk]=Plasma қызметінің протоколы Description[km]=ពិធីការ​សម្រាប់​សេវា​កម្ម​ប្លាស្មា Description[ko]=Plasma 서비스 프로토콜 +Description[lv]=Plasma servisu protokols Description[nb]=En protokoll for plasma-tjenester Description[nds]=En Protokoll för Plasma-Deensten Description[nl]=Een protocol voor Plasma-services @@ -42,10 +45,12 @@ Description[sr@ijekavian]=Протокол за плазма сервисе Description[sr@ijekavianlatin]=Protokol za plasma servise Description[sr@latin]=Protokol za plasma servise Description[sv]=Ett protokoll för Plasma-tjänster +Description[th]=โพรโทคอลสำหรับใช้กับบริการของพลาสมา Description[tr]=Plasma servisleri için bir protokol Description[ug]=پلازما(Plasma) مۇلازىمىتىنىڭ كېلىشىمى Description[uk]=Протокол для служб Плазми Description[x-test]=xxA protocol for Plasma servicesxx +Description[zh_CN]=Plasma 服务协议 Description[zh_TW]=Plasma 服務協定 helper=true diff --git a/data/servicetypes/plasma-dataengine.desktop b/data/servicetypes/plasma-dataengine.desktop index b4da43ed3..ab82e66a3 100644 --- a/data/servicetypes/plasma-dataengine.desktop +++ b/data/servicetypes/plasma-dataengine.desktop @@ -71,7 +71,7 @@ Comment[ta]=பிளாஸ்மா தரவு இயந்திரம் Comment[tg]=Системаи маълумотии Plasma Comment[th]=กลไกข้อมูลของพลาสมา Comment[tr]=Plasma Veri Motoru -Comment[ug]=Plasma سانلىق مەلۇمات ماتورى +Comment[ug]=Plasma سانلىق-مەلۇمات ماتورى Comment[uk]=Рушій даних Плазми Comment[wa]=Moteur di dnêyes di Plasma Comment[x-test]=xxPlasma Data Enginexx diff --git a/data/servicetypes/plasma-service.desktop b/data/servicetypes/plasma-service.desktop index d9f8d7381..cfb80feb8 100644 --- a/data/servicetypes/plasma-service.desktop +++ b/data/servicetypes/plasma-service.desktop @@ -16,6 +16,7 @@ Comment[es]=Servicio de Plasma Comment[et]=Plasma teenus Comment[eu]=Plasma zerbitzua Comment[fi]=Plasma-palvelu +Comment[fr]=Service Plasma Comment[gl]=Servizo do Plasma Comment[hr]=Servis u Plasmi Comment[hu]=Plazma-szolgáltatás @@ -27,6 +28,7 @@ Comment[kk]=Plasma қызметі Comment[km]=សេវា​​ប្លាស្មា Comment[ko]=Plasma 서비스 Comment[lt]=Plasma tarnyba +Comment[lv]=Plasma serviss Comment[nb]=Plasma-tjeneste Comment[nds]=Plasma-Deenst Comment[nl]=Plasma-service diff --git a/data/servicetypes/plasma-toolbox.desktop b/data/servicetypes/plasma-toolbox.desktop index 93f2fae76..92a5bffaa 100644 --- a/data/servicetypes/plasma-toolbox.desktop +++ b/data/servicetypes/plasma-toolbox.desktop @@ -16,6 +16,7 @@ Comment[es]=Caja de herramientas de Plasma Comment[et]=Plasma tööriistakast Comment[eu]=Plasma tresna-kutxa Comment[fi]=Plasma-työkalurivi +Comment[fr]=Boîte à outils Plasma Comment[gl]=Barra de ferramentas do Plasma Comment[hr]=Plasma alatni okvir Comment[hu]=Plazma-eszközkészlet @@ -28,6 +29,7 @@ Comment[km]=ប្រអប់​ឧបករណ៍​ប្លាស្មា Comment[ko]=Plasma 도구 상자 Comment[ku]=Qutiya amûrên Plasma Comment[lt]=Pasma įrankinė +Comment[lv]=Plasma rīkkopa Comment[nb]=Plasma-verktøykasse Comment[nds]=Plasma-Warktüüchkist Comment[nl]=Plasma-hulpmiddelen diff --git a/datacontainer.cpp b/datacontainer.cpp index 663c7ca97..33d8157ef 100644 --- a/datacontainer.cpp +++ b/datacontainer.cpp @@ -31,8 +31,6 @@ DataContainer::DataContainer(QObject *parent) : QObject(parent), d(new DataContainerPrivate(this)) { - d->storageTimer = new QTimer(this); - QObject::connect(d->storageTimer, SIGNAL(timeout()), this, SLOT(store())); } DataContainer::~DataContainer() @@ -61,7 +59,7 @@ void DataContainer::setData(const QString &key, const QVariant &value) //setData() since the last time it was stored. This //gives us only one singleShot timer. if (isStorageEnabled() || !needsToBeStored()) { - d->storageTimer->start(180000); + d->storageTimer.start(180000, this); } setNeedsToBeStored(true); @@ -330,11 +328,24 @@ void DataContainer::setNeedsUpdate(bool update) void DataContainer::checkUsage() { - if (d->relays.count() < 1 && - receivers(SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data))) < 1) { - // DO NOT CALL ANYTHING AFTER THIS LINE AS IT MAY GET DELETED! - kDebug() << objectName() << "is unused"; - emit becameUnused(objectName()); + if (!d->checkUsageTimer.isActive()) { + d->checkUsageTimer.start(10, this); + } +} + +void DataContainer::timerEvent(QTimerEvent * event) +{ + if (event->timerId() == d->checkUsageTimer.timerId()) { + if (d->relays.count() < 1 && + receivers(SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data))) < 1) { + // DO NOT CALL ANYTHING AFTER THIS LINE AS IT MAY GET DELETED! + kDebug() << objectName() << "is unused"; + emit becameUnused(objectName()); + } + d->checkUsageTimer.stop(); + } else if (event->timerId() == d->storageTimer.timerId()) { + d->store(); + d->storageTimer.stop(); } } diff --git a/datacontainer.h b/datacontainer.h index 746be5e40..3c196c10e 100644 --- a/datacontainer.h +++ b/datacontainer.h @@ -245,6 +245,11 @@ class PLASMA_EXPORT DataContainer : public QObject **/ void checkUsage(); + /** + * @reimp from QObject + */ + void timerEvent(QTimerEvent * event); + private: friend class SignalRelay; friend class DataContainerPrivate; @@ -253,7 +258,6 @@ class PLASMA_EXPORT DataContainer : public QObject Q_PRIVATE_SLOT(d, void storeJobFinished(KJob *job)) Q_PRIVATE_SLOT(d, void populateFromStoredData(KJob *job)) - Q_PRIVATE_SLOT(d, void store()) Q_PRIVATE_SLOT(d, void retrieve()) }; diff --git a/dataengine.cpp b/dataengine.cpp index 7be42f9d3..c33b10332 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -197,7 +197,7 @@ void DataEngine::setData(const QString &source, const QString &key, const QVaria s->setData(key, value); - if (isNew) { + if (isNew && source != d->waitingSourceRequest) { emit sourceAdded(source); } @@ -219,7 +219,7 @@ void DataEngine::setData(const QString &source, const Data &data) ++it; } - if (isNew) { + if (isNew && source != d->waitingSourceRequest) { emit sourceAdded(source); } @@ -330,10 +330,10 @@ void DataEngine::removeAllSources() QMutableHashIterator it(d->sources); while (it.hasNext()) { it.next(); - const QString source = it.key(); Plasma::DataContainer *s = it.value(); + emit sourceRemoved(it.key()); it.remove(); - emit sourceRemoved(source); + s->disconnect(this); delete s; } } @@ -701,6 +701,7 @@ DataContainer *DataEnginePrivate::requestSource(const QString &sourceName, bool /*kDebug() << "DataEngine " << q->objectName() << ": could not find DataContainer " << sourceName << " will create on request" << endl;*/ + waitingSourceRequest = sourceName; if (q->sourceRequestEvent(sourceName)) { s = source(sourceName, false); if (s) { @@ -710,8 +711,10 @@ DataContainer *DataEnginePrivate::requestSource(const QString &sourceName, bool *newSource = true; } QObject::connect(s, SIGNAL(becameUnused(QString)), q, SLOT(removeSource(QString))); + emit q->sourceAdded(sourceName); } } + waitingSourceRequest.clear(); } return s; diff --git a/dataengine.h b/dataengine.h index 6623900e0..097d77bc0 100644 --- a/dataengine.h +++ b/dataengine.h @@ -83,7 +83,10 @@ class PLASMA_EXPORT DataEngine : public QObject * This method is called when the DataEngine is started. When this * method is called the DataEngine is fully constructed and ready to be * used. This method should be reimplemented by DataEngine subclasses - * which have the need to perform a startup routine. + * which need to perform a startup routine. + * + * The default implementation does nothing. Reimplementations in + * subclasses don't need to call this one. **/ virtual void init(); diff --git a/dialog.cpp b/dialog.cpp index 4f8e6226a..aa48a6778 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -88,7 +88,7 @@ void DialogPrivate::scheduleBorderCheck(bool triggeredByResize) QObject::connect(moveTimer, SIGNAL(timeout()), q, SLOT(checkBorders())); } - moveTimer->start(triggeredByResize ? 0 : 200); + moveTimer->start(0); } void DialogPrivate::themeChanged() diff --git a/framesvg.cpp b/framesvg.cpp index bac787942..203d7713c 100644 --- a/framesvg.cpp +++ b/framesvg.cpp @@ -321,7 +321,7 @@ void FrameSvg::resizeFrame(const QSizeF &size) } if (size.isEmpty()) { - kDebug() << "Invalid size" << size; + //kDebug() << "Invalid size" << size; return; } diff --git a/popupapplet.cpp b/popupapplet.cpp index c1ed41fdb..116d0a12a 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -348,6 +348,10 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) } //kDebug() << "about to switch to a popup"; + if (!qWidget && !gWidget) { + delete dialogPtr.data(); + return; + } //there was already a dialog? don't make the switch again if (dialogPtr) { @@ -372,7 +376,9 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) dialog->d->appletPtr = q; dialogPtr = dialog; - dialog->setAspectRatioMode(savedAspectRatio); + if (icon) { + dialog->setAspectRatioMode(savedAspectRatio); + } //no longer use Qt::Popup since that seems to cause a lot of problem when you drag //stuff out of your Dialog (extenders). Monitor WindowDeactivate events so we can @@ -423,7 +429,7 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) void PopupAppletPrivate::appletActivated() { - internalTogglePopup(); + internalTogglePopup(true); } QSizeF PopupApplet::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const @@ -696,7 +702,7 @@ void PopupAppletPrivate::iconSizeChanged(int group) } } -void PopupAppletPrivate::internalTogglePopup() +void PopupAppletPrivate::internalTogglePopup(bool fromActivatedSignal) { if (autohideTimer) { autohideTimer->stop(); @@ -707,6 +713,11 @@ void PopupAppletPrivate::internalTogglePopup() Plasma::Dialog *dialog = dialogPtr.data(); if (!dialog) { q->setFocus(Qt::ShortcutFocusReason); + if (!fromActivatedSignal) { + QObject::disconnect(q, SIGNAL(activate()), q, SLOT(appletActivated())); + emit q->activate(); + QObject::connect(q, SIGNAL(activate()), q, SLOT(appletActivated())); + } return; } @@ -727,6 +738,11 @@ void PopupAppletPrivate::internalTogglePopup() q->graphicsWidget() == static_cast(q)->d->extender.data() && static_cast(q)->d->extender.data()->isEmpty()) { // we have nothing to show, so let's not. + if (!fromActivatedSignal) { + QObject::disconnect(q, SIGNAL(activate()), q, SLOT(appletActivated())); + emit q->activate(); + QObject::connect(q, SIGNAL(activate()), q, SLOT(appletActivated())); + } return; } @@ -736,7 +752,9 @@ void PopupAppletPrivate::internalTogglePopup() KWindowSystem::setOnAllDesktops(dialog->winId(), true); KWindowSystem::setState(dialog->winId(), NET::SkipTaskbar | NET::SkipPager); - dialog->setAspectRatioMode(savedAspectRatio); + if (icon) { + dialog->setAspectRatioMode(savedAspectRatio); + } if (q->location() != Floating) { dialog->animatedShow(locationToDirection(q->location())); diff --git a/private/datacontainer_p.h b/private/datacontainer_p.h index 59054d624..a3e1f00a8 100644 --- a/private/datacontainer_p.h +++ b/private/datacontainer_p.h @@ -20,11 +20,13 @@ #ifndef PLASMA_DATACONTAINER_P_H #define PLASMA_DATACONTAINER_P_H -#include -#include #include "servicejob.h" #include "storage_p.h" +#include +#include +#include + class QTimer; namespace Plasma @@ -38,11 +40,11 @@ public: DataContainerPrivate(DataContainer *container) : q(container), storage(NULL), + storageCount(0), dirty(false), cached(false), enableStorage(false), - isStored(true), - storageCount(0) + isStored(true) { } @@ -71,14 +73,15 @@ public: DataEngine::Data data; QMap relayObjects; QMap relays; - QTimer *storageTimer; QTime updateTs; Storage* storage; + QBasicTimer storageTimer; + QBasicTimer checkUsageTimer; + int storageCount; bool dirty : 1; bool cached : 1; bool enableStorage : 1; bool isStored : 1; - int storageCount; }; class SignalRelay : public QObject diff --git a/private/dataengine_p.h b/private/dataengine_p.h index 302b6057c..74a61e221 100644 --- a/private/dataengine_p.h +++ b/private/dataengine_p.h @@ -118,6 +118,7 @@ class DataEnginePrivate QString serviceName; Package *package; Service *publishedService; + QString waitingSourceRequest; }; } // Plasma namespace diff --git a/private/popupapplet_p.h b/private/popupapplet_p.h index 2a3aa4402..eab42c32d 100644 --- a/private/popupapplet_p.h +++ b/private/popupapplet_p.h @@ -35,7 +35,7 @@ public: ~PopupAppletPrivate(); void iconSizeChanged(int group); - void internalTogglePopup(); + void internalTogglePopup(bool fromActivatedSignal = false); void hideTimedPopup(); void clearPopupLostFocus(); void dialogSizeChanged(); diff --git a/private/storage_p.h b/private/storage_p.h index 1a0040112..bb772d39b 100644 --- a/private/storage_p.h +++ b/private/storage_p.h @@ -32,6 +32,8 @@ class StorageJob : public Plasma::ServiceJob { Q_OBJECT + Q_PROPERTY(QVariantHash data READ data WRITE setData) + public: StorageJob(const QString& destination, const QString& operation, diff --git a/private/style.cpp b/private/style.cpp index 1e01302d1..9fff60d8a 100644 --- a/private/style.cpp +++ b/private/style.cpp @@ -314,6 +314,16 @@ QRect Style::subControlRect(ComplexControl control, const QStyleOptionComplex *o } } +int Style::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const +{ + switch (hint) { + case SH_RequestSoftwareInputPanel: + return RSIP_OnMouseClick; + default: + return QCommonStyle::styleHint(hint, option, widget, returnData); + } +} + int Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const { if (Theme::defaultTheme()->useNativeWidgetStyle()) { diff --git a/private/style_p.h b/private/style_p.h index 7f88ec884..787cf8d76 100644 --- a/private/style_p.h +++ b/private/style_p.h @@ -45,6 +45,7 @@ public: ~Style(); void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const; + int styleHint(StyleHint hint, const QStyleOption *option=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const; protected: void drawComplexControl(ComplexControl control, diff --git a/private/wallpaper_p.h b/private/wallpaper_p.h index 32a0fdcd4..7df8e14a5 100644 --- a/private/wallpaper_p.h +++ b/private/wallpaper_p.h @@ -46,6 +46,8 @@ public: void newRenderCompleted(const WallpaperRenderRequest &render, const QImage &image); void setupScriptSupport(); + void renderWallpaper(const QString &sourceImagePath, const QImage &image, const QSize &size, + Wallpaper::ResizeMethod resizeMethod, const QColor &color); static PackageStructure::Ptr s_packageStructure; @@ -70,16 +72,16 @@ public: class LoadImageThread : public QObject, public QRunnable { Q_OBJECT - - private: - QString m_filePath; - Q_SIGNALS: - void done(const QImage &pixmap); +public: + LoadImageThread(const QString &filePath); + void run(); - public: - LoadImageThread(const QString &filePath); - void run(); +Q_SIGNALS: + void done(const QImage &pixmap); + +private: + QString m_filePath; }; } // namespace Plasma diff --git a/private/wallpaperrenderthread.cpp b/private/wallpaperrenderthread.cpp index 316b89b60..0a4e21575 100644 --- a/private/wallpaperrenderthread.cpp +++ b/private/wallpaperrenderthread.cpp @@ -115,12 +115,12 @@ void WallpaperRenderThread::run() QImage result(m_request.size, QImage::Format_ARGB32_Premultiplied); result.fill(m_request.color.rgba()); - if (m_request.file.isEmpty() || !QFile::exists(m_request.file)) { + if (m_request.file.isEmpty() && m_request.providedImage.isNull() && !QFile::exists(m_request.file)) { if (!m_abort) { emit done(m_request, result); } - kDebug() << "oh, fuck it"; + kDebug() << "wrong request or file does not exist"; deleteLater(); return; } @@ -134,7 +134,11 @@ void WallpaperRenderThread::run() // set image size QSize imgSize(1, 1); - if (scalable) { + if (!m_request.providedImage.isNull()) { + img = m_request.providedImage; + kDebug() << "going to resize the img" << img.size(); + imgSize = imgSize.expandedTo(img.size()); + } else if (scalable) { // scalable: image can be of any size imgSize = imgSize.expandedTo(m_request.size); } else { @@ -223,7 +227,6 @@ void WallpaperRenderThread::run() QSvgRenderer svg(m_request.file); if (m_abort) { deleteLater(); - kDebug() << "oh, fuck it 2"; return; } svg.render(&p); @@ -234,7 +237,6 @@ void WallpaperRenderThread::run() if (m_abort) { deleteLater(); - kDebug() << "oh, fuck it 3"; return; } @@ -243,7 +245,6 @@ void WallpaperRenderThread::run() for (int y = pos.y(); y < m_request.size.height(); y += scaledSize.height()) { p.drawImage(QPoint(x, y), img); if (m_abort) { - kDebug() << "oh, fuck it 4"; deleteLater(); return; } @@ -256,7 +257,6 @@ void WallpaperRenderThread::run() // signal we're done if (!m_abort) { - kDebug() << "*****************************************************"; emit done(m_request, result); } diff --git a/private/wallpaperrenderthread_p.h b/private/wallpaperrenderthread_p.h index 7a31d591d..677c0273b 100644 --- a/private/wallpaperrenderthread_p.h +++ b/private/wallpaperrenderthread_p.h @@ -42,6 +42,7 @@ public: } QWeakPointer requester; + QImage providedImage; QString file; QSize size; Wallpaper::ResizeMethod resizeMethod; diff --git a/tests/packagemetadatatest.desktop b/tests/packagemetadatatest.desktop index a0f785460..069943718 100644 --- a/tests/packagemetadatatest.desktop +++ b/tests/packagemetadatatest.desktop @@ -64,7 +64,7 @@ Name[ta]=பொதியின் மூலத்தரவு சோதனைக Name[tg]=Файли санҷишии стсетмаи metadata Name[th]=แฟ้มทดสอบข้อมูลกำกับแพกเกจ Name[tr]=Paket metadata test dosyası -Name[ug]=بوغچا مېتا سانلىق مەلۇمات سىناق ھۆججەت +Name[ug]=بوغچا مېتا سانلىق-مەلۇمات سىناق ھۆججەت Name[uk]=Файл перевірки метаданих пакунка Name[wa]=Fitchî d' asprouvaedje des meta-dnêyes do pacaedje Name[x-test]=xxPackage metadata test filexx diff --git a/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop b/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop index bdcb0c89b..87582b8d9 100644 --- a/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop +++ b/tests/testcontainmentactionsplugin/plasma-containmentactions-test.desktop @@ -14,6 +14,7 @@ Name[et]=Test Name[eu]=Proba Name[fa]=آزمون Name[fi]=Testi +Name[fr]=Test Name[gl]=Proba Name[hr]=Test Name[hu]=Teszt @@ -26,6 +27,7 @@ Name[km]=សាកល្បង Name[ko]=테스트 Name[ku]=Bicaribîne Name[lt]=Testas +Name[lv]=Tests Name[nb]=Test Name[nds]=Utproberen Name[nl]=Test @@ -45,7 +47,7 @@ Name[sr@latin]=Proba Name[sv]=Test Name[th]=ทดสอบ Name[tr]=Deneme -Name[ug]=سىنا +Name[ug]=سىناق Name[uk]=Тест Name[wa]=Sayî Name[x-test]=xxTestxx @@ -65,6 +67,7 @@ Comment[es]=Un complemento de pruebas Comment[et]=Libaplugin testimiseks Comment[eu]=Probatarako gezurretazko plugin bat Comment[fi]=Tyhjä testausliitännäinen +Comment[fr]=Un module factice de test Comment[gl]=Un engadido para probas Comment[hr]=Lažan priključak za testiranje Comment[hu]=Üres bővítmény teszteléshez @@ -77,6 +80,7 @@ Comment[km]=កម្មវិធី​ជំនួយ​ដំបូង​ស Comment[ko]=테스트를 위한 뼈대 플러그인 Comment[ku]=Pêvekekî hêsan ji bo ceribandinê Comment[lt]=Netikras priedas testavimui +Comment[lv]=Testēšanai paredzēts spraudnis Comment[nb]=Et attrapp-programtillegg for testing Comment[nds]=En Platzholler-Moduul för't Utproberen Comment[nl]=Een dummy plugin voor testen diff --git a/tests/testengine/plasma-dataengine-testengine.desktop b/tests/testengine/plasma-dataengine-testengine.desktop index 7b64ee255..734aadfe6 100644 --- a/tests/testengine/plasma-dataengine-testengine.desktop +++ b/tests/testengine/plasma-dataengine-testengine.desktop @@ -11,7 +11,7 @@ Name[ca]=Motor de dades de prova Name[ca@valencia]=Motor de dades de prova Name[cs]=Testovací datový nástroj Name[da]=Test datamotor -Name[de]=Test-Datentreiber +Name[de]=Test-Datenmodul Name[el]=Μηχανή δεδομένων ελέγχου Name[en_GB]=Test Data Engine Name[eo]=Testa Datuma motoro diff --git a/wallpaper.cpp b/wallpaper.cpp index 8cae0d4bf..35d744f7d 100644 --- a/wallpaper.cpp +++ b/wallpaper.cpp @@ -442,6 +442,16 @@ QSizeF Wallpaper::targetSizeHint() const return d->targetSize; } +void Wallpaper::render(const QImage &image, const QSize &size, + Wallpaper::ResizeMethod resizeMethod, const QColor &color) +{ + if (image.isNull()) { + return; + } + + d->renderWallpaper(QString(), image, size, resizeMethod, color); +} + void Wallpaper::render(const QString &sourceImagePath, const QSize &size, Wallpaper::ResizeMethod resizeMethod, const QColor &color) { @@ -450,23 +460,30 @@ void Wallpaper::render(const QString &sourceImagePath, const QSize &size, return; } - resizeMethod = qBound(ScaledResize, resizeMethod, LastResizeMethod); - if (d->lastResizeMethod != resizeMethod) { - d->lastResizeMethod = resizeMethod; - emit renderHintsChanged(); + d->renderWallpaper(sourceImagePath, QImage(), size, resizeMethod, color); +} + +void WallpaperPrivate::renderWallpaper(const QString &sourceImagePath, const QImage &image, const QSize &size, + Wallpaper::ResizeMethod resizeMethod, const QColor &color) +{ + resizeMethod = qBound(Wallpaper::ScaledResize, resizeMethod, Wallpaper::LastResizeMethod); + if (lastResizeMethod != resizeMethod) { + lastResizeMethod = resizeMethod; + emit q->renderHintsChanged(); } - if (d->cacheRendering) { + if (cacheRendering) { QFileInfo info(sourceImagePath); - QString cache = d->cacheKey(sourceImagePath, size, resizeMethod, color); - if (d->findInCache(cache, info.lastModified().toTime_t())) { + QString cache = cacheKey(sourceImagePath, size, resizeMethod, color); + if (findInCache(cache, info.lastModified().toTime_t())) { return; } } WallpaperRenderRequest request; - d->renderToken = request.token; - request.requester = this; + renderToken = request.token; + request.requester = q; + request.providedImage = image; request.file = sourceImagePath; request.size = size; request.resizeMethod = resizeMethod; diff --git a/wallpaper.h b/wallpaper.h index 3bfa2b3ed..ecc08be61 100644 --- a/wallpaper.h +++ b/wallpaper.h @@ -486,6 +486,22 @@ class PLASMA_EXPORT Wallpaper : public QObject Wallpaper::ResizeMethod resizeMethod = ScaledResize, const QColor &color = QColor(0, 0, 0)); + /** + * Renders the wallpaper asyncronously with the given parameters. When the rendering is + * complete, the renderCompleted signal is emitted. + * + * @param image the raw QImage + * @param size the size to render the image as + * @param resizeMethod the method to use when resizing the image to fit size, @see + * ResizeMethod + * @param color the color to use to pad the rendered image if it doesn't take up the + * entire size with the given ResizeMethod + * @since 4.7.4 + */ + void render(const QImage &image, const QSize &size, + Wallpaper::ResizeMethod resizeMethod = ScaledResize, + const QColor &color = QColor(0, 0, 0)); + /** * Sets whether or not to cache on disk the results of calls to render. If the wallpaper * changes often or is innexpensive to render, then it's probably best not to cache them. diff --git a/widgets/declarativewidget.cpp b/widgets/declarativewidget.cpp index fd4b4e0f7..9ad2a436c 100644 --- a/widgets/declarativewidget.cpp +++ b/widgets/declarativewidget.cpp @@ -60,6 +60,8 @@ public: void execute(const QString &fileName); void finishExecute(); void scheduleExecutionEnd(); + void minimumWidthChanged(); + void minimumHeightChanged(); DeclarativeWidget *q; @@ -152,18 +154,19 @@ void DeclarativeWidgetPrivate::finishExecute() lay->addItem(widget); } else { q->setLayout(0); - qreal width = 0; - qreal height = 0; + qreal minimumWidth = 0; + qreal minimumHeight = 0; if (object) { - width = object->property("width").toReal(); - height = object->property("height").toReal(); + minimumWidth = object->property("minimumWidth").toReal(); + minimumHeight = object->property("minimumHeight").toReal(); object->setProperty("width", q->size().width()); object->setProperty("height", q->size().height()); + QObject::connect(object, SIGNAL(minimumWidthChanged()), q, SLOT(minimumWidthChanged())); + QObject::connect(object, SIGNAL(minimumHeightChanged()), q, SLOT(minimumHeightChanged())); } - //FIXME: find a better way to have a minimum size - if (width > 0 && height > 0) { - q->setMinimumSize(width, height); + if (minimumWidth > 0 && minimumHeight > 0) { + q->setMinimumSize(minimumWidth, minimumHeight); } else { q->setMinimumSize(-1, -1); } @@ -171,7 +174,17 @@ void DeclarativeWidgetPrivate::finishExecute() emit q->finished(); } +void DeclarativeWidgetPrivate::minimumWidthChanged() +{ + qreal minimumWidth = root->property("minimumWidth").toReal(); + q->setMinimumWidth(minimumWidth); +} +void DeclarativeWidgetPrivate::minimumHeightChanged() +{ + qreal minimumHeight = root->property("minimumHeight").toReal(); + q->setMinimumHeight(minimumHeight); +} DeclarativeWidget::DeclarativeWidget(QGraphicsWidget *parent) : QGraphicsWidget(parent), diff --git a/widgets/declarativewidget.h b/widgets/declarativewidget.h index 1f59b1a02..28270cb6e 100644 --- a/widgets/declarativewidget.h +++ b/widgets/declarativewidget.h @@ -129,6 +129,8 @@ private: Q_PRIVATE_SLOT(d, void finishExecute()) Q_PRIVATE_SLOT(d, void scheduleExecutionEnd()) + Q_PRIVATE_SLOT(d, void minimumWidthChanged()) + Q_PRIVATE_SLOT(d, void minimumHeightChanged()) }; } // namespace Plasma diff --git a/widgets/lineedit.cpp b/widgets/lineedit.cpp index 09c0c66ef..9842379b2 100644 --- a/widgets/lineedit.cpp +++ b/widgets/lineedit.cpp @@ -189,6 +189,8 @@ void LineEdit::focusInEvent(QFocusEvent *event) // as of Qt 4.7, apparently we have a bug here in QGraphicsProxyWidget nativeWidget()->setFocus(event->reason()); } + + emit focusChanged(true); } void LineEdit::focusOutEvent(QFocusEvent *event) @@ -215,6 +217,8 @@ void LineEdit::focusOutEvent(QFocusEvent *event) } QGraphicsProxyWidget::focusOutEvent(event); + + emit focusChanged(false); } } // namespace Plasma diff --git a/widgets/lineedit.h b/widgets/lineedit.h index 41fcf3928..a0df163c0 100644 --- a/widgets/lineedit.h +++ b/widgets/lineedit.h @@ -133,6 +133,11 @@ Q_SIGNALS: * @since 4.4 */ void textChanged(const QString &text); + /** + * Emitted when the widget receives or loses focus + * @since 4.7 + */ + void focusChanged(bool focused); private: Q_PRIVATE_SLOT(d, void setPalette()) diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index d73ef141e..e67937b5f 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -111,6 +111,25 @@ public: } } + void syncFrame() + { + if (background) { + //resize all panels + background->setElementPrefix("pressed"); + background->resizeFrame(q->size()); + + syncActiveRect(); + + background->setElementPrefix("normal"); + background->resizeFrame(q->size()); + hoverAnimation->setProperty("startPixmap", background->framePixmap()); + + background->setElementPrefix("active"); + background->resizeFrame(activeRect.size()); + hoverAnimation->setProperty("targetPixmap", background->framePixmap()); + } + } + void syncActiveRect(); void syncBorders(); @@ -193,6 +212,7 @@ PushButton::PushButton(QGraphicsWidget *parent) connect(d->background, SIGNAL(repaintNeeded()), SLOT(syncBorders())); d->initTheming(); + d->syncFrame(); } PushButton::~PushButton() @@ -325,23 +345,9 @@ void PushButton::resizeEvent(QGraphicsSceneResizeEvent *event) { d->setPixmap(); - if (d->background) { - //resize all panels - d->background->setElementPrefix("pressed"); - d->background->resizeFrame(size()); + d->syncFrame(); - d->syncActiveRect(); - - d->background->setElementPrefix("normal"); - d->background->resizeFrame(size()); - d->hoverAnimation->setProperty("startPixmap", d->background->framePixmap()); - - d->background->setElementPrefix("active"); - d->background->resizeFrame(d->activeRect.size()); - d->hoverAnimation->setProperty("targetPixmap", d->background->framePixmap()); - } - - QGraphicsProxyWidget::resizeEvent(event); + QGraphicsProxyWidget::resizeEvent(event); } void PushButton::paint(QPainter *painter, diff --git a/widgets/textedit.cpp b/widgets/textedit.cpp index 13cc6aad9..633aec694 100644 --- a/widgets/textedit.cpp +++ b/widgets/textedit.cpp @@ -112,7 +112,6 @@ void TextEdit::setNativeWidget(KTextEdit *nativeWidget) nativeWidget->setAttribute(Qt::WA_NoSystemBackground); nativeWidget->setFrameShape(QFrame::NoFrame); - nativeWidget->setTextBackgroundColor(Qt::transparent); nativeWidget->viewport()->setAutoFillBackground(false); nativeWidget->verticalScrollBar()->setStyle(d->style.data()); nativeWidget->horizontalScrollBar()->setStyle(d->style.data()); diff --git a/widgets/videowidget.h b/widgets/videowidget.h index 689e0c625..82cb63de3 100644 --- a/widgets/videowidget.h +++ b/widgets/videowidget.h @@ -145,14 +145,14 @@ public: /** * @param interval milliseconds the tick signal will be emitted - * @since 4.8 + * @since 4.7.1 */ void setTickInterval(qint64 interval); /** * @return milliseconds the tick signal will be emitted * @see tickInterval() - * @since 4.8 + * @since 4.7.1 */ qint64 tickInterval() const;