Merge remote-tracking branch 'origin/KDE/4.7'
Conflicts: plasma/CMakeLists.txt
This commit is contained in:
commit
7f2b0b44c0
@ -7,6 +7,8 @@ if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
||||
set(PLASMA_NO_SOLID TRUE)
|
||||
set(PLASMA_NO_KIO TRUE)
|
||||
set(PLASMA_NO_PACKAGEKIT TRUE)
|
||||
set(PLASMA_NO_KUTILS TRUE)
|
||||
set(PLASMA_NO_GLOBAL_SHORTCUTS TRUE)
|
||||
endif(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
||||
|
||||
if(NOT Q_WS_X11)
|
||||
@ -18,7 +20,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${KDE4_KDEUI_INCLUDES}
|
||||
${CMAKE_SOURCE_DIR}/experimental/libkdeclarative
|
||||
${CMAKE_BINARY_DIR}/experimental/libkdeclarative
|
||||
${CMAKE_SOURCE_DIR}/threadweaver/
|
||||
${CMAKE_SOURCE_DIR}/threadweaver
|
||||
${CMAKE_SOURCE_DIR}/plasma/extenders
|
||||
${CMAKE_SOURCE_DIR}/plasma/remote
|
||||
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/qtjolie
|
||||
@ -47,10 +49,17 @@ if(NOT PLASMA_NO_SOLID)
|
||||
set(PLASMA_EXTRA_LIBS ${PLASMA_EXTRA_LIBS} ${KDE4_SOLID_LIBS})
|
||||
endif(NOT PLASMA_NO_SOLID)
|
||||
|
||||
<<<<<<< HEAD
|
||||
if(NOT PLASMA_NO_PACKAGEKIT)
|
||||
add_definitions(-DPLASMA_ENABLE_PACKAGEKIT_SUPPORT=1)
|
||||
set(PLASMA_EXTRA_LIBS ${PLASMA_EXTRA_LIBS} ${QT_QTDBUS_LIBRARY})
|
||||
endif(NOT PLASMA_NO_PACKAGEKIT)
|
||||
=======
|
||||
if (NOT PLASMA_NO_KUTILS)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/kutils)
|
||||
set(PLASMA_EXTRA_LIBS ${PLASMA_EXTRA_LIBS} ${KDE4_KUTILS_LIBS})
|
||||
endif(NOT PLASMA_NO_KUTILS)
|
||||
>>>>>>> origin/KDE/4.7
|
||||
|
||||
if(QCA2_FOUND)
|
||||
include_directories(${QCA2_INCLUDE_DIR})
|
||||
@ -272,7 +281,7 @@ kde4_add_library(plasma ${LIBRARY_TYPE} ${plasma_LIB_SRCS})
|
||||
#add kdeclarative after the 4.7 release
|
||||
target_link_libraries(plasma ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY}
|
||||
${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSQL_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}
|
||||
${KDE4_KDEUI_LIBS} kdnssd threadweaver ${PLASMA_EXTRA_LIBS})
|
||||
${KDE4_KDEUI_LIBS} ${KDE4_KDNSSD_LIBS} ${KDE4_THREADWEAVER_LIBS} ${PLASMA_EXTRA_LIBS})
|
||||
|
||||
if(QCA2_FOUND)
|
||||
target_link_libraries(plasma ${QCA2_LIBRARIES})
|
||||
|
62
applet.cpp
62
applet.cpp
@ -54,6 +54,7 @@
|
||||
#include <kauthorized.h>
|
||||
#include <kcolorscheme.h>
|
||||
#include <kdialog.h>
|
||||
#include <kdesktopfile.h>
|
||||
#include <kicon.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kkeysequencewidget.h>
|
||||
@ -65,6 +66,13 @@
|
||||
#include <kwindowsystem.h>
|
||||
#include <kpushbutton.h>
|
||||
|
||||
#ifndef PLASMA_NO_KUTILS
|
||||
#include <kcmoduleinfo.h>
|
||||
#include <kcmoduleproxy.h>
|
||||
#else
|
||||
#include <kcmodule.h>
|
||||
#endif
|
||||
|
||||
#ifndef PLASMA_NO_SOLID
|
||||
#include <solid/powermanagement.h>
|
||||
#endif
|
||||
@ -1882,22 +1890,62 @@ void Applet::showConfigurationInterface()
|
||||
}
|
||||
|
||||
d->publishUI.publishCheckbox = 0;
|
||||
if (d->package && d->configLoader) {
|
||||
if (d->package) {
|
||||
KConfigDialog *dialog = 0;
|
||||
|
||||
QString uiFile = d->package->filePath("mainconfigui");
|
||||
if (!uiFile.isEmpty()) {
|
||||
const QString uiFile = d->package->filePath("mainconfigui");
|
||||
KDesktopFile df(d->package->path() + "/metadata.desktop");
|
||||
const QStringList kcmPlugins = df.desktopGroup().readEntry("X-Plasma-ConfigPlugins", QStringList());
|
||||
if (!uiFile.isEmpty() || !kcmPlugins.isEmpty()) {
|
||||
KConfigSkeleton *configLoader = d->configLoader ? d->configLoader : new KConfigSkeleton(0);
|
||||
dialog = new AppletConfigDialog(0, d->configDialogId(), configLoader);
|
||||
|
||||
dialog->setWindowTitle(d->configWindowTitle());
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
bool hasPages = false;
|
||||
|
||||
QFile f(uiFile);
|
||||
QUiLoader loader;
|
||||
QWidget *w = loader.load(&f);
|
||||
if (w) {
|
||||
dialog = new AppletConfigDialog(0, d->configDialogId(), d->configLoader);
|
||||
dialog->setWindowTitle(d->configWindowTitle());
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name()));
|
||||
hasPages = true;
|
||||
}
|
||||
|
||||
foreach (const QString &kcm, kcmPlugins) {
|
||||
#ifndef PLASMA_NO_KUTILS
|
||||
KCModuleProxy *module = new KCModuleProxy(kcm);
|
||||
if (module->realModule()) {
|
||||
dialog->addPage(module, module->moduleInfo().moduleName(), module->moduleInfo().icon());
|
||||
hasPages = true;
|
||||
} else {
|
||||
delete module;
|
||||
}
|
||||
#else
|
||||
KService::Ptr service = KService::serviceByStorageId(kcm);
|
||||
if (service) {
|
||||
QString error;
|
||||
KCModule *module = service->createInstance<KCModule>(dialog, QVariantList(), &error);
|
||||
if (module) {
|
||||
connect(module, SIGNAL(changed(bool)), dialog, SLOT(settingsModified(bool)));
|
||||
dialog->addPage(module, service->name(), service->icon());
|
||||
hasPages = true;
|
||||
} else {
|
||||
#ifndef NDEBUG
|
||||
kDebug() << "failed to load kcm" << kcm << "for" << name();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (hasPages) {
|
||||
d->addGlobalShortcutsPage(dialog);
|
||||
d->addPublishPage(dialog);
|
||||
dialog->show();
|
||||
} else {
|
||||
delete dialog;
|
||||
dialog = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1987,6 +2035,7 @@ void AppletPrivate::addStandardConfigurationPages(KConfigDialog *dialog)
|
||||
|
||||
void AppletPrivate::addGlobalShortcutsPage(KConfigDialog *dialog)
|
||||
{
|
||||
#ifndef PLASMA_NO_GLOBAL_SHORTCUTS
|
||||
if (isContainment) {
|
||||
return;
|
||||
}
|
||||
@ -2006,6 +2055,7 @@ void AppletPrivate::addGlobalShortcutsPage(KConfigDialog *dialog)
|
||||
|
||||
QObject::connect(dialog, SIGNAL(applyClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection);
|
||||
QObject::connect(dialog, SIGNAL(okClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection);
|
||||
#endif
|
||||
}
|
||||
|
||||
void AppletPrivate::addPublishPage(KConfigDialog *dialog)
|
||||
|
@ -5,4 +5,6 @@
|
||||
#cmakedefine PLASMA_NO_KNEWSTUFF
|
||||
#cmakedefine PLASMA_NO_SOLID
|
||||
#cmakedefine PLASMA_NO_KIO
|
||||
#cmakedefine PLASMA_NO_KUTILS
|
||||
#cmakedefine PLASMA_NO_GLOBAL_SHORTCUTS
|
||||
|
||||
|
@ -304,6 +304,18 @@ void FocusIndicator::syncGeometry()
|
||||
}
|
||||
}
|
||||
|
||||
void FocusIndicator::setFrameSvg(FrameSvg *frameSvg)
|
||||
{
|
||||
if (m_background != frameSvg) {
|
||||
m_background = frameSvg;
|
||||
}
|
||||
}
|
||||
|
||||
FrameSvg *FocusIndicator::frameSvg() const
|
||||
{
|
||||
return m_background;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include <focusindicator_p.moc>
|
||||
|
@ -43,6 +43,9 @@ public:
|
||||
void animateVisibility(const bool visible);
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
void setFrameSvg(FrameSvg *svg);
|
||||
FrameSvg *frameSvg() const;
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
void resizeEvent(QGraphicsSceneResizeEvent *event);
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
|
||||
FrameSvg *background;
|
||||
FrameSvg *lineEditBackground;
|
||||
FocusIndicator *focusIndicator;
|
||||
int animId;
|
||||
qreal opacity;
|
||||
QRectF activeRect;
|
||||
@ -99,6 +100,13 @@ void ComboBoxPrivate::syncBorders()
|
||||
q->setFont(Theme::defaultTheme()->font(Theme::DefaultFont));
|
||||
customFont = false;
|
||||
}
|
||||
|
||||
if (q->nativeWidget()->isEditable()) {
|
||||
focusIndicator->setFrameSvg(lineEditBackground);
|
||||
} else {
|
||||
focusIndicator->setFrameSvg(background);
|
||||
}
|
||||
focusIndicator->setFlag(QGraphicsItem::ItemStacksBehindParent, !q->nativeWidget()->isEditable() || !lineEditBackground->hasElement("hint-focus-over-base"));
|
||||
}
|
||||
|
||||
|
||||
@ -119,7 +127,7 @@ ComboBox::ComboBox(QGraphicsWidget *parent)
|
||||
|
||||
d->style = Style::sharedStyle();
|
||||
|
||||
new FocusIndicator(this, d->background);
|
||||
d->focusIndicator = new FocusIndicator(this, d->background);
|
||||
setNativeWidget(new KComboBox);
|
||||
connect(d->background, SIGNAL(repaintNeeded()), SLOT(syncBorders()));
|
||||
d->initTheming();
|
||||
|
@ -94,13 +94,14 @@ void DeclarativeWidgetPrivate::execute(const QString &fileName)
|
||||
return;
|
||||
}
|
||||
|
||||
component->loadUrl(fileName);
|
||||
|
||||
KDeclarative kdeclarative;
|
||||
kdeclarative.setDeclarativeEngine(engine);
|
||||
kdeclarative.initialize();
|
||||
//binds things like kconfig and icons
|
||||
kdeclarative.setupBindings();
|
||||
|
||||
component->loadUrl(fileName);
|
||||
|
||||
scriptEngine = kdeclarative.scriptEngine();
|
||||
registerDataEngineMetaTypes(scriptEngine);
|
||||
|
||||
@ -194,9 +195,6 @@ DeclarativeWidget::DeclarativeWidget(QGraphicsWidget *parent)
|
||||
|
||||
d->engine = new QDeclarativeEngine(this);
|
||||
d->engine->setNetworkAccessManagerFactory(new DeclarativeNetworkAccessManagerFactory);
|
||||
foreach(const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) {
|
||||
d->engine->addImportPath(importPath);
|
||||
}
|
||||
|
||||
d->component = new QDeclarativeComponent(d->engine, this);
|
||||
}
|
||||
|
@ -64,7 +64,10 @@ LineEdit::LineEdit(QGraphicsWidget *parent)
|
||||
d->background->setImagePath("widgets/lineedit");
|
||||
d->background->setCacheAllRenderedFrames(true);
|
||||
|
||||
new FocusIndicator(this, d->background);
|
||||
FocusIndicator *indicator = new FocusIndicator(this, d->background);
|
||||
if (d->background->hasElement("hint-focus-over-base")) {
|
||||
indicator->setFlag(QGraphicsItem::ItemStacksBehindParent, false);
|
||||
}
|
||||
setNativeWidget(new KLineEdit);
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,9 @@ SpinBox::SpinBox(QGraphicsWidget *parent)
|
||||
d->background->setImagePath("widgets/lineedit");
|
||||
d->background->setCacheAllRenderedFrames(true);
|
||||
|
||||
if (d->background->hasElement("hint-focus-over-base")) {
|
||||
d->focusIndicator->setFlag(QGraphicsItem::ItemStacksBehindParent, false);
|
||||
}
|
||||
|
||||
d->style = Plasma::Style::sharedStyle();
|
||||
native->setStyle(d->style.data());
|
||||
|
Loading…
Reference in New Issue
Block a user