Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 26 16:59
  • Jan 24 13:08
    hkollmann synchronize #9855
  • Jan 24 13:08

    hkollmann on hkollmann-add-luca

    (compare)

  • Jan 24 13:08

    hkollmann on master

    add lucapivato at codeowner (#9… (compare)

  • Jan 24 13:08
    hkollmann closed #9856
  • Jan 23 21:37
    pullapprove[bot] review_requested #9856
  • Jan 23 21:30
    pullapprove[bot] review_request_removed #9856
  • Jan 23 21:24
    pullapprove[bot] review_requested #9855
  • Jan 23 21:09
    hkollmann review_requested #9856
  • Jan 23 21:09
    hkollmann review_requested #9856
  • Jan 23 21:09
    hkollmann review_requested #9856
  • Jan 23 21:09
    hkollmann review_requested #9856
  • Jan 23 21:09
    hkollmann opened #9856
  • Jan 23 21:09
    hkollmann review_requested #9856
  • Jan 23 21:09

    hkollmann on hkollmann-add-luca

    add lucapivato at codeowner So… (compare)

  • Jan 23 21:03
    hkollmann synchronize #9855
  • Jan 23 21:03

    hkollmann on master

    Named parameter string format t… (compare)

  • Jan 23 21:03
    hkollmann closed #9854
  • Jan 23 16:57
    pullapprove[bot] review_request_removed #9855
  • Jan 23 16:36
    derrell review_requested #9855
Dietrich Streifert
@level420
But that may be to much ‚magic‘
Christian Boulanger
@cboulanger
@level420 Given that it is trivial to pass the qx object through qx.util.Serializer.toNativeObject() I wonder if tr() should do that automatically?
If it is documented, why not.
Dietrich Streifert
@level420
@cboulanger yep! Thats also a good idea!
rommni
@rommni
oki will look at that next week ;)
Derrell Lipman
@derrell
@rommni Although it would be a nice feature, I wonder how much benefit it would have? In my experience, this.tr() strings tend to be short, fitting easily on one 80-character line of code; very occasionally wrapping to a new line. I haven't encountered any uses of it where entire paragraphs are translated as a whole. If my experience of the use cases aligns with most peoples' experience, matching %2 to the second argument isn't a problem that really needs solving. I'd be curious whether other people use this.tr() in such a fashion as to make the work to add this improvement worthwhile?
Christian Boulanger
@cboulanger
@derrell I would think the main use case is where you have a data object with key-value pairs that can reused in different tr() calls. Rather than having to worry about the order of the arguments (which is tedious), you just populate your object with values (e.g.let obj = {foo: "Foo", bar: "Bar", baz:"Baz"}) and do tr("%foo bla bla %bar", obj)and later tr("bla bla %baz bla bla", obj). I would find that immensely useful.
I don't know the internals of the translation classes well enough, but it could even be implemented in a way to do data binding, i.e. if the object is an instance of qx.core.Object, changing a member could automatically change the replaced value in the translation. But that might be too much.
Derrell Lipman
@derrell
That sounds like a possible use case. I'm certainly not arguing against this change! I just didn't immediately see a good use case for it.
rad-pat
@rad-pat
I've tried to install an older version of qooxdoo compiler to avoid a bug that's in the framework at the moment (fixed but not made it into a build, or so I think). Anyway, I thought that installing @qooxdoo/compiler@1.0.0-beta.20191216-1034 would give me a version of the framework at that time, but when I compile and run, it seems to show qx.version: "6.0.0-beta-20200103-1449" which makes no sense really. Any ideas? (Apart from that I must be doing something wrong!!)
Our build is just a simple Dockerfile that uses an node image, installs the qooxdoo compiler and then builds the source.
rad-pat
@rad-pat
Well, it seems like actually our environment is not updating with the new image despite reporting that it has. Sorry for the noise.....
voger
@voger

Hello. I am looking at the current qooxdoo documentation for qx.ui.container.Scroll() and it mentions demos by following these links
http://www.qooxdoo.org/5.1/demobrowser/#test~ScrollContainer_EdgeCaseHeight.html
http://www.qooxdoo.org/5.1/demobrowser/#test~ScrollContainer_EdgeCaseWidth.html
http://www.qooxdoo.org/5.1/demobrowser/#test~ScrollContainer_ResizeMatch.html

but I can't access them and I can't find them in the repo. Any idea how to access these demos?

Henner Kollmann
@hkollmann
Where did you find this docu? Seems that it is not up to date
Dietrich Streifert
@level420
voger
@voger
slachtar
@slachtar
http://www.qooxdoo.org/docs/#/
Just discovered the link and liked it, very promising and one shouldn't be shy any more when presenting qooxdoo to a mate.
Ignacio Pascual
@ignapas
good morning everyone! I am having problems trying to get environmental variables at runtime, set by adding the --set option to qx compile. is this a known bug or a dropped feature?
Ignacio Pascual
@ignapas
I see a new set-env option was added at some point and when I create a new application with the most recent compiler, I can get the value with qx.core.Environment.get(...)
so I guess there is a problem with the compiler we are using... that only has the set option (set-env is not working)
voger
@voger
--set-env was added about a month a go precisely for this use case. --set sets environment variables for the compiler while --set-env sets environment variables for the application.
Derrell Lipman
@derrell
I'm also playing with --set-env. It works as far as being able to detect environment variables at run-time. How do I specify that I want code compiled out entirely if some environment variable isn't set? I believe there is such a capability, isn't there?
voger
@voger
@derrell I haven't tested that but it should work as if the variable was set in the compile.json file.
the only difference is that values set with --set-env are passed in the application as strings
Derrell Lipman
@derrell
@voger Thanks. I think the compiler isn't compiling it out when there's an environment test in the code. Probably need an answer from @johnspackman ...
voger
@voger
@derrell I wrote the code for the --set-env. I will take a look at it
Derrell Lipman
@derrell
@voger Did you get around the issue of a log message saying that the variable is not a valid key. Please see the API-doc of qx.core.Environment for a list of predefined keys. if you choose not to set it? (I'm trying to have code that only applies if a particular environment variable is set.)
Thanks for looking at it.
(I guess that wouldn't happen if the code were compiled out entirely as I'd prefer)
voger
@voger
I haven't seen that message. It probably has to do with how qx.core.Environment gets the key and maybe how the compiler handles undefined return
Derrell Lipman
@derrell
I think I figured out how to do what I want. If I add an environment variable my.special in compile.json, with value false, then by default, anything inside of if (qx.core.Environment.get("my.special")) will be compiled out. If I then add a set-env to the compile line, e.g., npx qx compile --target=build --set-env my.special=magic then the code is compiled in, and all occurrences of qx.core.Environment.get("my.special") are replaced by magic.
rommni
@rommni

Hi guys, working on my PR for namedArguments in translation, all the code is done but i have quite problem by editing the docs. I decide to use the format %${namedArgs} to stay consistent with template literals js feature. However when i want to explain this in the docs i can't find a way to escape my literals , the doc always try to interpret it. any idea?

My sentence:

to indicate the name like this : `Copied %${numberOfCopy} files. %${myName}`.

i Tried:

\$\{numberOfCopy\}
\${numberOfCopy}
$${numberOfCopy}
$${{numberOfCopy}}
John Spackman
@johnspackman

do you mean that the code would write something like:

let myLabel = new qx.ui.basic.Label(this.tr(`Copied %${numberOfCopy} files. %${myName}`, myObj));

That won’t work, the compiler will process back ticks into this:

var  myLabel = new qx.ui.basic.Label(this.tr("Copied %" + numberOfCopy + " files. %" + myName, myObj));

How about not using a $ at all, eg:

let myLabel = new qx.ui.basic.Label(this.tr("Copied %{numberOfCopy} files. %{myName}", myObj));
rommni
@rommni

Not with backticks, i think my code to work like this :

let myObject = { numberOfCopy: 2, myName: "Kevin" }
let myLabel  =  new qx.ui.basic.Label(this.tr("Copied %${numberOfCopy} files. %${myName}", myObj));

It was just to keep a known format of javascript i found that more consistent, however i can remove the $ if you find it better it's not a problem for me.

John Spackman
@johnspackman
i think that would be better, otherwise it could be confusing what it’s doing; that last example has double quotes, but at first glance what you see as a reader is the ${numberOfCopy} and that indicates those string template literals.
rommni
@rommni
Yep you're right, will edit that to avoid confusion, and it should solve my problem with doc ;)
lUNuXl
@lUNuXl

I have a class that starts with this:

qx.Class.define("panel.BetaConsole"), {
    statics: {
        NAME: "Beta console",
        ICON: "panel/test.png"
    },

    construct: function construct() {},

    members: {
        createLauncher : function() {
            const button = new qx.ui.form.Button(this.self(arguments).NAME, this.self(arguments).ICON);

            button.addListener("execute", function(event) {
                this.createApplicationWindow();
            });

            return button;
        },
...

Then I want to use this class like this:

...
      const buttonServerConsole = new qx.ui.form.Button("beta console", "panel/test.png");
      buttonServerConsole.addListener("execute", function(event) {
        const betaConsole = new panel.BetaConsole();
...

I get these errors from qx serve:

panel.BetaConsole: error: FATAL Syntax error: Cannot read property 'type' of undefined
Cannot write application 'panel' because it has fatal errors

And I get this error on runtime:

Uncaught TypeError: panel.BetaConsole is not a constructor
    at wrapper.<anonymous> (Application.js:131)
    at Direct.js:136
    at Function.qx.event.Utils.then() [as then] (Utils.js:142)
    at Direct.js:135
    at Array.qx.lang.normalize.Array.forEach() [as forEach] (Array.js:127)
    at wrapper.qx.event.dispatch.Direct.prototype.dispatchEvent() (Direct.js:120)
    at wrapper.wrappedFunction [as dispatchEvent] (Interface.js:537)
    at wrapper.qx.event.Manager.prototype.dispatchEvent() [as dispatchEvent] (Manager.js:924)
    at Registration.js:346
    at Function.qx.event.Utils.then() [as then] (Utils.js:142)
    at Object.qx.event.Registration.fireEvent() [as fireEvent] (Registration.js:345)
    at wrapper.qx.core.Object.prototype.fireEvent() [as fireEvent] (MEvent.js:181)
    at wrapper.qx.ui.form.Button.prototype.execute() (MExecutable.js:109)
    at wrapper.wrappedFunction [as execute] (Interface.js:537)
    at wrapper.qx.ui.form.Button.prototype._onTap() [as _onTap] (Button.js:307)
    at EventHandler.js:316
John Spackman
@johnspackman
you’re missing an extends clause, eg:
qx.Class.define("panel.BetaConsole"), {
  extends: qx.core.Object,
  construct() {
     /* snip */
lUNuXl
@lUNuXl
I still get the compile error:
panel.BetaConsole: error: FATAL Syntax error: Cannot read property 'type' of undefined
Cannot write application 'panel' because it has fatal errors
qx.Class.define("panel.BetaConsole"), {
    extends: qx.core.Object,

    construct: function construct() {},

    statics: {
        NAME: "Beta console",
        ICON: "panel/test.png"
    },

    members: {
...
John Spackman
@johnspackman
ah, i see it now - that first line has an extra (, it should be:
qx.Class.define("panel.BetaConsole", {
    extends: qx.core.Object,

    construct: function construct() {},

    statics: {
        NAME: "Beta console",
        ICON: "panel/test.png"
    },

    members: {
but please can you file an issue with qooxdoo-compiler, that error message is rubbish!
(I'm presuming you’re using qx compile not the generator?)
lUNuXl
@lUNuXl

I'm "running" this app with
$ npx ../qx serve
I got it from the "newer" version repository (the one compatible with es6)
so, probably?

And thank you, I literally looked at how Button class is declared and didn't notice this mistake : p

John Spackman
@johnspackman
no worries - ps yes, thats the new compiler
voger
@voger
@derrell Thanks for the find. That is a great way to also document in code what external environment variables the code expects.
lUNuXl
@lUNuXl
Is there anything like "setVisible()" for TextField?
I'd like to hide it when certain conditions are met
John Spackman
@johnspackman
setVisibility() (actually the visibility property)
can be visible, hidden, or excluded - if hidden it’s invisible but still part of the layout, if excluded it’s as though it was never there