Page 1 of 1
Auto glob variable rename
Posted: 28 Dec 2017 09:55
by digitalstone
More often than i like to admit, i must rename the global variable to something else to maintain a certain naming system.
Is there a possibility to build a feature that automatically replaces all global variable references when renaming the reffered global variable?
Re: Auto glob variable rename
Posted: 28 Dec 2017 15:47
by Desmanto
+1 for this, even though not so critical for me. As I mostly use glovar map/list to deal with the stored variables.
This renaming should works like widget auto renaming. And it must can travel thru the glovar map/list too.
So if I use global_list[1] in certain script; then I rename to "global_listed"; the new script should be global_listed[1].
Re: Auto glob variable rename
Posted: 28 Dec 2017 23:15
by digitalstone
Desmanto wrote:+1 for this, even though not so critical for me. As I mostly use glovar map/list to deal with the stored variables.
This renaming should works like widget auto renaming. And it must can travel thru the glovar map/list too.
So if I use global_list[1] in certain script; then I rename to "global_listed"; the new script should be global_listed[1].
Yes maybe i should make use of maps and lists more than for just the obvious reasons.
Although maps and lists can get cluttered as well since you can't rearrange the order (that i know of).
Btw what do you mean with auto widget renaming?
Re: Auto glob variable rename
Posted: 29 Dec 2017 02:28
by Desmanto
List can be rearranged, simply tap and hold, then drag it up or down. But it can be difficult if the list contains a massive data, the row height cover the whole dialog, make it impossible to drag. For map, it can't be dragged as list do. I also want to request for the feature. But somehow when answering anuraag's question, I have made the flow to sort the glovar by querying the key as list, sort the list in debug dialog. So I put it aside first.
Widget auto renaming is what happen when you rename one of your widget. All show/hide widget action will be updated to correspond to the new name. You can try it out, just rename to something and rename back to original. I just realize something is off with the auto renaming. Although all show/hide widget got renamed, but if there are script which contain reference to modify the widget property, the name stays.
Example "Widget1". There are action show widget Widget1; and script
Code: Select all
setWidgetElementProperty("Widget1", "Rectangle_1", "visible", true);
When we rename "Widget1" to "Battery Widget", action Show/hide will be updated to new name. But the script still stays as "Widget1". So, we should change it manually by using the search and replace them all manually. Seems the same thing will happen with glovar, thus auto renaming not yet implemented till now.
Re: Auto glob variable rename
Posted: 31 Dec 2017 19:37
by digitalstone
Desmanto wrote:List can be rearranged, simply tap and hold, then drag it up or down. But it can be difficult if the list contains a massive data, the row height cover the whole dialog, make it impossible to drag. For map, it can't be dragged as list do. I also want to request for the feature. But somehow when answering anuraag's question, I have made the flow to sort the glovar by querying the key as list, sort the list in debug dialog. So I put it aside first.
Widget auto renaming is what happen when you rename one of your widget. All show/hide widget action will be updated to correspond to the new name. You can try it out, just rename to something and rename back to original. I just realize something is off with the auto renaming. Although all show/hide widget got renamed, but if there are script which contain reference to modify the widget property, the name stays.
Example "Widget1". There are action show widget Widget1; and script
Code: Select all
setWidgetElementProperty("Widget1", "Rectangle_1", "visible", true);
When we rename "Widget1" to "Battery Widget", action Show/hide will be updated to new name. But the script still stays as "Widget1". So, we should change it manually by using the search and replace them all manually. Seems the same thing will happen with glovar, thus auto renaming not yet implemented till now.
Rearranging confirmed!
Auto widget renaming as well
Thanks again!
Re: Auto glob variable rename
Posted: 12 Jan 2018 22:50
by TheBrain1984
+1
Re: Auto glob variable rename
Posted: 14 Jan 2018 15:02
by xdauser
+1 definitely "must-have" feature. It is really pain in the ass to rename one by one global variables specially if you have them a lot.
Re: Auto glob variable rename
Posted: 04 Mar 2018 04:11
by digitalstone
That's 1 way of putting it