Skip to content

Add noctalia-vantage plugin#494

Open
wizard-28 wants to merge 1 commit intonoctalia-dev:mainfrom
wizard-28:main
Open

Add noctalia-vantage plugin#494
wizard-28 wants to merge 1 commit intonoctalia-dev:mainfrom
wizard-28:main

Conversation

@wizard-28
Copy link
Copy Markdown

Repo: https://github.com/wizard-28/NoctaliaVantage

Allows users to change control their Lenovo ideapad/legion laptop settings through a panel widget.

Continuation of #493, which I had to close due to some issues

Copy link
Copy Markdown
Contributor

@spiros132 spiros132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor feedback about the PR :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to use qmldir, instead just import the relative folder and it will import the components in the folder as well.

@@ -0,0 +1,20 @@
{
"id": "noctalia-vantage",
"name": "Noctalia Vantage",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we know that this is a plugin for the noctalia-shell, it might be better for the name to be something that doesn't contain noctalia. I'm not sure if this is a good idea but for example "Vantage Driver" or maybe "Vantage Controller".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I initially went with "Noctalia Vantage" following the name pattern used in other environments:

But I agree it's probably redundant here.

What do you think about "VantageCtl" as an alternative?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great actually!

"minNoctaliaVersion": "3.6.0",
"author": "Sourajyoti Basak",
"license": "GPL-3.0-or-later",
"repository": "https://github.com/wizard-28/noctalia-plugins",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the noctalia-plugins repository

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, you don't need the qmldir, just import the relative folder. For example:

import "./ui"
// Or
import "./ui/settings"

property bool writeable: false
property var value: null
property var validValues: null
property var transformWrite: v => typeof v === "boolean" ? (v ? 1 : 0) : v
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very confusing lambda function, can it be made to a regular function instead?

}

return v === 1;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend all of these to be regular functions, there's no need for them to be properties

root.reload();
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This process already contains an id, I would suggest turning the root component to an Item instead, that way you don't need to define properties for each component.

Logger.d("NoctaliaVantage", `${root.label} unchanged:`, parsed);
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well, prefer for the root component to be an item so that you can have this component inside it without assigning it to a property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants