-
-
Notifications
You must be signed in to change notification settings - Fork 74
migrating Preferences and Messages to stand-alone version #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
so for the language display issue, i suspect it happened when i renamed it's fixed now |
Hi @AhmedMagedC Thank you for the PR! Sorry I got a little busy, hope to get to this soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AhmedMagedC Thank you again for the work! It is heading very much in the right direction. I have added some comments as suggestions to help further improve
@@ -472,12 +471,12 @@ static public String getVersionName() { | |||
|
|||
|
|||
public static void setCommandLine() { | |||
commandLine = true; | |||
System.setProperty("processing.cli", "true"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain why this needed to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main motivation behind this change was to be able to know if Processing is launched via CLI or not without the need to depend on app
module via using Base.isCommandLine()
as for example im using it in the utils.Messages.kt
*/ | ||
@JvmStatic | ||
fun showMessage(title: String = "Message", message: String) { | ||
if (Base.isCommandLine()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that the JOptionPane
parts should stay and the println can be in the universal class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i understand you correctly, you wanna seperate the appearance of graphical messages via JOptionPane
to be only used by app.Messages
and a simple println only for the utils.Messages
but wouldn't that make an issue in utils
module? as for example in processing.utils.settingslocation
and processing.utils.Base
error messages via Messages.showError()
wouldn't display a graphical message only just a console print. So is it accepctable? also bear in mind that i cannot use app.Messages
for this purpose because i want the utils
module along with the utils.preference
class to be fully independent of app
module
load(new FileInputStream(preferencesFile)); | ||
|
||
} catch (Exception ex) { | ||
Messages.showError("Error reading preferences", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these could be transformed to normal errors and then catch and log them in the app
classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that. but that would depend on how we choose to implement utils.Messages
if we decided to keep the use of JOptionPane
in utils.Messages
then this delegation of catching and logging the errors in app
rather than in utils
wouldn't make much sense because we will use the same method but in different location
if we decided to remove JOptionPane
and keep only the println
then i can do that delegation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the build
folder to the .gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already did in this commit
Resolves #1104
Changes
Preferences
to:app:utils
module making it independent ofapp
module by also moving the functionalities that depends onapp
toAppPreferences
classMessages
class to be able to use it (for example in debugging) in different areas of ProcessingUtils
into:app:utils
, because why keeping it inapp
it doesn't need any functionalities from there, and also can be used in:app:utils
without the need to depend onapp
getSettingsFolder()
method for each platform from:app
to:app:utils
, without duplication the code i madeapp.Platform
class to depend onSettingsResolver
in:app:utils
to get the correct location for each platformdefaults.txt
now by using JAR resource system instead ofPlatform.getContentFile()
(which is also marked as deprecated in the codebase encouraging to migrate to JAR RS)Todo
Tests
I tried to compile and run, as for now preferences are loaded and saved correctly
but for some reason some languages aren't displayed properly like: arabic , chinese, but languages like: english, japanese properly displayed.
I will look into it, but any help or suggestion of why that happens is very much appreciated