plugins: Add preferences for text font and color in the Developer Console
AbandonedPublic

Authored by cfoch on Jul 20 2017, 11:53 PM.

Details

Reviewers
thiblahute
aleb
Summary

Depends on D1790

Diff Detail

Repository
rPTV Pitivi
Branch
T7784-developer-console_separate
aleb requested changes to this revision.Jul 22 2017, 6:57 PM
aleb added inline comments.
pitivi/dialogs/prefs.py
419

why is this necessary?

pitivi/settings.py
141

Add a pydoc to explain when it should be used.

171–174

why try instead of elif type_ == Gdk.RGBA:?

287

newline above, for consistency

plugins/console/console.py
85

Why is this needed?

122

These descriptions above are not really useful. Is it possible to remove them?

126

Hm, not sure how we can do this, but it would be good if we can not go through app.gui to the preferences_dialog.
Maybe after activating a plugin we can check if any new preferences have been added.
Or maybe we can have a signal to which the preferences dialog instance can connect to monitor if preferences are added or removed ... and then do something, not sure what. We should keep it simple. Maybe show an infobar with a "Reload" button?

133

Why do we raise in removeSection? If the section is already gone, we should just do nothing. Could you please make it more friendly?

198

You seem to pass self.terminal only because the handlers are classmethods. Make them normal methods which receive self, and they can access self.terminal then?

220

Change the names of the new methods to use the new style

plugins/console/utils.py
41

Why is this needed?

plugins/console/widgets.py
53

DEFAULT_BACKGROUND_COLOR ?

152

Shouldn't these default values better be defined where we define the settings which store them? Then we can use the settings .. (which we already do somewhere else?)

This revision now requires changes to proceed.Jul 22 2017, 6:57 PM
aleb added a comment.Jul 23 2017, 12:31 PM

Two issues:

  1. When copying text from the developer console and pasting it in the >>> line, it appears colored - it should appear the prompt color
  1. IMO there should be 3 colors of the text
    • errors/tracebacks
    • input (what the user writes)
    • output

.. but now I see that the current >>> line has a different color than the past >>> lines. Any reason to have them different colors?

cfoch added inline comments.Aug 1 2017, 2:38 PM
pitivi/dialogs/prefs.py
419

I actually don't know why there is this line in Pitivi

value = type(value)(real_widget.getWidgetValue())

https://github.com/pitivi/pitivi/blob/master/pitivi/dialogs/prefs.py#L381

This is used for Gdk.RGBA color, because type(value), gives you a Gdk.RGBA. Then if you do something like Gdk.RGBA(real_widget.getWidgetValue()), it will fail because getWidgetValue will return a Gdk.RGBA.

And a Gdk.RGBA doesn't receive Gdk.RGBAs

aleb added inline comments.Aug 1 2017, 9:50 PM
pitivi/dialogs/prefs.py
419

I see it has been added a long time ago specifically for Colors...
40828aa6485b0ee9c910a8d0b0eefe835e189e3f
Let's clean this up, remove this if block entirely and the comment above it.

cfoch added inline comments.Aug 6 2017, 6:33 PM
plugins/console/console.py
126

If you want simplicity, IMHO I think that what is already done is more simple than adding a button and adding a handler method for when it is clicked.

cfoch added inline comments.Aug 6 2017, 7:14 PM
plugins/console/console.py
85

Because addConfigOption may raise many exceptions

plugins/console/widgets.py
152

I wanted to avoid mixing Pitivi stuff with the widget itself. But what should I do? It is a matter of tastes. And I was thinking that in a long-term future I can add this plugin to other GNOME apps, but maybe that will never happen. Again, what do I do?

aleb added inline comments.Aug 6 2017, 7:51 PM
plugins/console/console.py
85

Ok, but why is it needed to ignore those exceptions?

126

The added complexity is worth IMO.

plugins/console/widgets.py
152

Maybe use the modern API for storing settings in GNOME, I remember you wanted to use it in Pitivi.. Would that work? You could then use it as an example for future plugins.

cfoch marked an inline comment as done.Aug 6 2017, 8:01 PM
cfoch added inline comments.
plugins/console/widgets.py
152

Yes, but this is a really huge change.

aleb added inline comments.Aug 6 2017, 8:08 PM
plugins/console/widgets.py
152

Hm, in any case.. not a good moment for this change.

cfoch updated this revision to Diff 6227.Aug 12 2017, 10:03 AM

This commit reloads removes and adds again a section page whenever a new preference has been added.

cfoch updated this revision to Diff 6228.Aug 12 2017, 10:05 AM

This commit adds a button every time a new preference has been added. If the reload button is pressed, then the old page is removed an a new section page is created and added again.

cfoch updated this revision to Diff 6229.Aug 12 2017, 10:09 AM

It creates a new page as soon a section is created (a new blank container widget). Everytime a preference is added, it adds the respective preference widgets (one by one) to the blank container widget.