psifidotos / workflow-project

This is an effort to create a KDE Plasmoid that integrates the main Activities, Virtual Desktops and Tasks Functionalities from Plasma Desktop in just one component.
http://workflow.opentoolsandspace.org/
GNU General Public License v2.0
11 stars 2 forks source link

Make use of the global plasma object in qml #51

Closed mdaffin closed 11 years ago

mdaffin commented 11 years ago

I just found this which explains how to use the global plasma object inside qml and some of the features it contains.

It allows direct access to many components such as the configuration settings. This should allow us to simplify the code allot more by accessing these values directly rather then propagation them up through the qml files. It will also remove allot of code from the workflow class and the Activities2 object.

mdaffin commented 11 years ago

Sadly I do not think that the global plasmoid object is available to qml widgets that are started with Plasma::DeclarativeWidget.

I still think that using the global plasmoid object is the cleanest method, and considering that most of the functionality that the workflow class provides is available via the plasmoid object I think it would be a good idea to move towards a pure qml widget, with anything that isn't provided to be managed by a dataengine.

This is a long term goal however, I think the first step should be moving the activities and task classes to a dataengine which will be where most of the work is involved.

Basically, there is not much that can be done with this until #11 is solved.

psifidotos commented 11 years ago

I don't know how possible is this even for a very late release. The activities data engine and the tasks one do not provide even the half of the needed functionality. Michael what do you have in mind? All the C ++ part to be put in a plasma plugin?

mdaffin commented 11 years ago

What functional does the standard activities dataengine not provide?

As far as I can tell it is only the clone function that is missing.

But we can always implement the needed functionality as a plasma plugin, just like the way the homerun widget does, all the qml code in that widget is independent of the wrapper that shows it.

psifidotos commented 11 years ago

OK, I will point to some: Cloning activity, Adding Widgets, Live previews (without c++ how can we do that?) Changing windows activities (Xorg libraries) Activity background

I don't remember any other but it could be some...

With plasma plugins I haven't worked, I suppose it is a way to add functionality in plasma and decoupling your code? Does it support signaling?

mdaffin commented 11 years ago

I don't see why they cannot be implemented in a separate dataengine or a qml plugin.

I believe qml plugins do not make use of signals given that the rest of qml and qt does... they seem to support (read: rely on heavily) the rest of the qt meta system.

They are basically a way of exposing c++ classes to the qml system. Which means if we make the activitiesmanager and the taskmanager a completely separate class and then we can expose them directly to the qml via the plugin system.

But I would like to remove the duplicate code and rely on the dataengine for the functions that it supports, we could even submit patches to kde with the added functionality that way more application can benefit form it.

I have started a new branch to experiment with the activities data engine, will know more about how it works soon.

psifidotos commented 11 years ago

ok no problem... One small detail the missing functionality for activities data engine I dont think is going to be accepted upstream. For example in activities data engine there was a lot of debate why the remove activity is in the data engine if I remember correct with Ivan Cukic. I dont know if the design decision in official kde is to add all the functionality in data engines as long as there are libraries which provide it.

mdaffin commented 11 years ago

I can see reason to add the clone, but yea, not so much the other items... But that is where we can use qml plugins.

psifidotos commented 11 years ago

QML Plugins can have C++ part? For example the Wid 's for the windows and the popup and the dashboard can be found?

Michael I dont have it in my mind, I will wait for some code implementation to see what you are describing as I havent programmed before any plasma plugin or qml plugin.

mdaffin commented 11 years ago

Plasma plugins can be c++ or qml. I am working on an implementation now, but am mostly going to have to change large parts of the qml code in order to remove its reliance on the old way of doing things. I have decided to just rewrite some of the major parts of the qml as I think it will be less work and I can clean them up as I go along.

Consider this an experiment and continue to develop the towards 0.3 for now, we will consider merging/moving across the code when/if I have made it feature complete again.

My current progress is in the dataengine-port branch and in it I have started to rewrite the WorkAreasAllList and associated components.

PS: on the plus side, scaling is allot smother now.. probably due to the lack of components current implemented :)

On 8 December 2012 12:59, Michail Vourlakos notifications@github.comwrote:

QML Plugins can have C++ part? For example the Wid 's for the windows and the popup and the dashboard can be found?

Michael I dont have it in my mind, I will wait for some code implementation to see what you are describing as I havent programmed before any plasma plugin or qml plugin.

— Reply to this email directly or view it on GitHubhttps://github.com/psifidotos/workflow-project/issues/51#issuecomment-11158388.

Michael Daffin james1479@gmail.com

psifidotos commented 11 years ago

Στις 08/12/2012 03:08 μμ, ο/η Michael Daffin έγραψε:

Plasma plugins can be c++ or qml. I am working on an implementation now, but am mostly going to have to change large parts of the qml code in order to remove its reliance on the old way of doing things. I have decided to just rewrite some of the major parts of the qml as I think it will be less work and I can clean them up as I go along.

Consider this an experiment and continue to develop the towards 0.3 for now, we will consider merging/moving across the code when/if I have made it feature complete again.

My current progress is in the dataengine-port branch and in it I have started to rewrite the WorkAreasAllList and associated components.

PS: on the plus side, scaling is allot smother now.. probably due to the lack of components current implemented :)

This is fantastic news, smoother scaling is very important...

mdaffin commented 11 years ago

I have now removed the reliance on the c++ wrapper code from my dataengines-port branch, this has lost allot of the functionality the it had previously (that hadn't already been lost or ported) but enables the use of the plasma global variable so functionality can start to be added back in properly (without temporary staging hacks). (note that you will want to make sure that the old widget is properly removed before installing this version as it wont overwrite/delete the old widget plugin)

I have also changed the toolbar to make use of the PlasmaComponents.ToolBar component which I think makes things look allot nicer, and simplifies the ToolBar code allot.

psifidotos commented 11 years ago

James I just didnt like the icons in the toolbar.

mdaffin commented 11 years ago

What exactly dont you like about them?

psifidotos commented 11 years ago

maybe the specific icons. I will look it again but they didnt provide the needed meaning...

mdaffin commented 11 years ago

I thought I used the icons you used.. at least for the lock and duplicate windows

The last one is more a place holder as I couldn't find the icon (not that I spend ages looking for it)

On the plus side, notice how the lock icon changes when the widgets are lock and unlocked :)

Edit: opps, I may have also put the icons the wrong way around ;) - Fixed now

Also, that about the general layout? I icons can easily by changed if needed.

mdaffin commented 11 years ago

Is there any reason you are not using PlasmaCore.ToolTip instead of your custom DToolTip?

psifidotos commented 11 years ago

Στις 18/12/2012 02:41 πμ, ο/η Michael Daffin έγραψε:

Is there any reason you are not using PlasmaCore.ToolTip instead of your custom DToolTip?

Michail if I remember correct for two reasons:

  1. I couldnt make it work possibly because I had caught the onEntered and onExited events from the MouseAreas
  2. I couldnt set a local image in the Tooltip. I think that only the default QIcons could be supported

Of course my pure programming skills could be the reason :), if 1 and 2 can be supported we will definitely use the default PlasmaCore.Tooltip

do you have any ideas?

mdaffin commented 11 years ago

I have gotten them to work in my data engine port but I have been migrating to use the system icons so have not suffered that and if you set a target they seem to just work. Even if it is not a mouse area. On Dec 18, 2012 4:59 PM, "Michail Vourlakos" notifications@github.com wrote:

Óôéò 18/12/2012 02:41 ðì, ï/ç Michael Daffin Ýãñáøå:

Is there any reason you are not using PlasmaCore.ToolTip instead of your custom DToolTip?

Michail if I remember correct for two reasons:

  1. I couldnt make it work possibly because I had caught the onEntered and onExited events from the MouseAreas
  2. I couldnt set a local image in the Tooltip. I think that only the default QIcons could be supported

Of course my pure programming skills could be the reason :), if 1 and 2 can be supported we will definitely use the default PlasmaCore.Tooltip

do you have any ideas?

Reply to this email directly or view it on GitHubhttps://github.com/psifidotos/workflow-project/issues/51#issuecomment-11495191.

psifidotos commented 11 years ago

I have found it Michael.... :) Even if it is a enormous hack I've made it.... I can access everything I need containment() corona() view() and all the public functions of popupapplet() from a clean qml plasmoid. That means that I can move ALL the needed functionality to qml plugins. I am going to take your code for the settings and make it a clean qml plugin .

I was investigating also how easy it is to make it a KWin Effect. You were also right a clean QML plasmoid is very easy to change to KWIn effect based on the code I have seen and test...

So things are moving a lot faster now...

For the KWin effect two things are not going to work (a. showing widgets explorer, b. showing wallpaper new created activities). I sent an email to plasma-devel. For b. in the future there will be a data engine to provide the backgrounds for each activity, for a. there is a discussion but I dont know in what direction is going....)

psifidotos commented 11 years ago

I think this is ready.... All the functionality has moved to clean qml plasmoid....

mdaffin commented 11 years ago

Nice work, considering you have moved over to a pure qml widget I think I will started work back on the master branch again to help clean up the code even more. The code is already better structured and so should be much easier to work with.

Sorry I have not been working on this much of late but I have been quite busy. I will continue to help once I have a bit more free time. FYI, I have started a free online programming languages course which you might be interested in taking, first assignment is due next week but is not to hard if you are interested (it is designed to improve your programming skills by teaching you how programming languages work rather then teaching programming itself).

psifidotos commented 11 years ago

Óôéò 19/01/2013 04:52 ìì, ï/ç Michael Daffin Ýãñáøå:

Nice work, considering you have moved over to a pure qml widget I think I will started work back on the master branch again to help clean up the code even more. The code is already better structured and so should be much easier to work with.

thanks a lot...

Sorry I have not been working on this much of late but I have been quite busy. I will continue to help once I have a bit more free time.

no worries, the project is back on track with the new design... I can also work more regularly on this from now on...

FYI, I have started a free online programming languages course https://www.coursera.org/course/proglang which you might be interested in taking, first assignment is due next week but is not to hard if you are interested.

Looks interesting, even though with my time constraints is a little difficult to follow it but we will see....

mdaffin commented 11 years ago

You can enrol and unenrol at anytime as well, so if it is too much you can simply drop out. However, do be able to pass the module you need to enrol before the assignments are due and complete them all. (but you can still browse the material even if you don't intend to pass the course due to lack of time).