Skip to content

Inform after package installation via drag&drop#4418

Merged
Kebap merged 19 commits intodevelopmentfrom
Notify-on-drag-drop-packages
Jan 21, 2021
Merged

Inform after package installation via drag&drop#4418
Kebap merged 19 commits intodevelopmentfrom
Notify-on-drag-drop-packages

Conversation

@Kebap
Copy link
Copy Markdown
Contributor

@Kebap Kebap commented Dec 1, 2020

Brief overview of PR changes/additions

A brief message informs, whether installation was successful or not.

Motivation for adding to Mudlet

Until now, you need to open package manager or script editor to see effects (if any)

Other info (issues closed, discussion etc)

Close #3874

Does not name package dropped.
Does not inform about reasons for failure.
Adds translation capability to global mudlet (in lieu of a concrete base-object like AdjustableContainer have)

@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Dec 1, 2020

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Dec 1, 2020

Not a solution that immediately came to my mind, but it works, so why not 😃

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 1, 2020

Not sure how much I like the mudlet.Locale.packageInstallSuccess.message structure, yet. Maybe refactor later.

@Kebap Kebap marked this pull request as ready for review December 1, 2020 12:04
@Kebap Kebap requested a review from a team December 1, 2020 12:04
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
@Kebap Kebap marked this pull request as draft December 1, 2020 15:13
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

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

Looks like the function isnt available yet, \Other.lua:9: attempt to call global 'loadTranslations' (a nil value))?

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 1, 2020

Looks like the function isnt available yet, \Other.lua:9: attempt to call global 'loadTranslations' (a nil value))?

Sorry to bother you with this already, I have marked as draft again!

This is probably not the best way to solve this, when we get more Lua translations..!

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 1, 2020

So it seems, the C function returns true or false, but these will never reach Lua.
Therefore, the simple if/else I built will always receive nil and report failure.

As the C function is doing multi duty, I don't even want to untangle and enhance it.
That was probably the direction you expected this solution to take way up above?
However I am not sure which other use cases I would destroy with modifications.

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 1, 2020

Workaround suggested courtesy of demonnic:

could add a one-time listener for the sysPackageInstall event with a tempTimer to remove it and display the failure message if it hasn't fired by X seconds

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 8, 2020

edit: wrong button, please ignore

@Kebap Kebap closed this Dec 8, 2020
@Kebap Kebap reopened this Dec 8, 2020
@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 10, 2020

Also add .trigger as acceptable package suffix

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 10, 2020

Testing the Github codespases approach..

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Dec 11, 2020

I've updated installPackage() to return true/false so you have an easier time with this.

@Kebap Kebap mentioned this pull request Dec 12, 2020
@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 12, 2020

Not sure why, but now I can "install" an empty .xml file, and it will be shown in package manager (and return true)
Whereas in PTB, dropping the same file in Mudlet will not produce any entries in package manager.
@vadi2 any changes you did maybe!?

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 12, 2020

Meanwhile..
image

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Dec 12, 2020

#4418 (comment) not that I know of.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Dec 12, 2020

#4418 (comment) Looks good. Maybe a bit more exciting? Feels a bit too robotic.

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 12, 2020

#4418 (comment) Looks good. Maybe a bit more exciting? Feels a bit too robotic.

Are you referring to the text contents? Yeah, I was just glad this actually arrived and had the correct colors, etc.
On the other hand, my orientation were the robotic texts shown on Mudlet startup, so this follows the same style.
Feel free to suggest other texts though...

image

#4418 (comment) not that I know of.

Me neither.. but how to remedy?
I could very well burn this branch and redo it all over again, just to make sure.
Not sure if there is another way that could be completed with less work maybe?

Actually localization doesn't work, yet, as that mudlet-lua.json isn't multi-level capable, or I didn't find how.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Dec 28, 2020

Sorry, this fell off my radar. I've repaired the branch so the diff looks okay (just by merging in the latest).

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

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

There are improvements we can do, but it does what it says it should 👍

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 28, 2020

Open issues here:

  • make localisation work again
  • change success message to ok and color accordingly

@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Dec 28, 2020

Not sure why, but now I can "install" an empty .xml file, and it will be shown in package manager (and return true)
Whereas in PTB, dropping the same file in Mudlet will not produce any entries in package manager.

  • Need to test this again, not to introduce any regressions

Edru2 and others added 2 commits January 19, 2021 08:50
* get Translation to work (suggestion)

* get translations to work (suggestion)

loadTranslations only accepts one "."
@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Jan 19, 2021

Not sure why, but now I can "install" an empty .xml file, and it will be shown in package manager (and return true)
Whereas in PTB, dropping the same file in Mudlet will not produce any entries in package manager.

  • Need to test this again, not to introduce any regressions

This is actually already so in 4.10.1 release version so no regression introduced here.

@Kebap Kebap marked this pull request as ready for review January 19, 2021 13:54
@Kebap Kebap requested a review from a team as a code owner January 19, 2021 13:54
@Kebap Kebap requested a review from a team January 19, 2021 13:54
@Kebap
Copy link
Copy Markdown
Contributor Author

Kebap commented Jan 19, 2021

For some reason, the most recent commits are not (yet?) shown in this PR, only listed in the commits of the branch..!? How do I update PR? edit: seems like Github was struggling.
image

@Kebap Kebap merged commit 108f870 into development Jan 21, 2021
@Kebap Kebap deleted the Notify-on-drag-drop-packages branch January 21, 2021 08:35
Chris7 pushed a commit to Chris7/Mudlet that referenced this pull request Jan 2, 2022
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com> 
Co-authored-by: Edru2
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.

Notify user that a package was installed

3 participants