Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,812,702 Members 46,408 Now Online
XDA Developers Android and Mobile Development Forum

[APP][14/01/2011] FoddTweak using DynamicMenu - ROM customisation & Menu Tool Kit

Tip us?
 
arealityfarbetween
Old
(Last edited by arealityfarbetween; 16th January 2011 at 10:03 AM.) Reason: Fleshed out syntax section of DynamicMenu description
#1  
Senior Member - OP
Thanks Meter 71
Posts: 422
Join Date: Nov 2008
Location: Newcastle upon Tyne

 
DONATE TO ME
Default [APP][14/01/2011] FoddTweak using DynamicMenu - ROM customisation & Menu Tool Kit

Hi there chef's! I'm not sure if any of you will find this useful but I'll post it in case you do...

I designed this little mortscript application so that users of my rom can tweak a few settings to their needs and because all of the other tweak applications couldn't be tweaked easily themselves without learning .NET or something similar.

I wasn't getting much feedback so I thought perhaps it wasn't customisable enough or maybe you didn't like my selection of tweaks. Perhaps you thought the menu layout sucked?

Anyway, to address those problems I've moved this on quite a way. It now includes a set of functions for creating Menu's. To Find out how, see the section titled DynamicMenu.

FoddTweak
  • Backup and restore of important data (Full registry, Titanium configuration, Start menu cpr files, Start menu icon registry settings)
  • Icon removal to save RAM (all, or all but settings (HTC icons are excluded))
  • Titanium plugin injection/removal and plugin order settings
  • Slide lock settings (both manila and wm6.5)
  • Enable/Disable Sleuth's myLocation service (soft-reset needed)
  • Enable/Disable start menu replacements and complete removal of the WM6.5 start menu

FoddTweak depends on a few things:
  • MortScript! (tested on 4.3.b15)
  • DynamicMenu (included in versions>0.0.1)
  • TICS Installer (for plugin injection/removal, included in versions>0.0.1)
  • FDC task manager (for backup purposes, included in versions>0.0.1)

DynamicMenu
It works like this; the menu system 'compiles' a master menu source file with extension mgs to it's component mgc files for each menu. If you want DynamicMenu to 'recompile' then just delete the top level compiled menu (e.g. If you add new options to "FoddTweak.mgs" then delete "FoddTweak.mgc" then re-run FoddTweak.)

This is a sample file, which is used to create menu's for the FoddTweak application:

Code:
menu(FoddTweak:Main Menu)
	item(Toggle Lock on Screen Dim:true:Call:"AnyRegWrite", "Toggle", "HKCU", "ControlPanel\Backlight", "AutoDeviceLockEnable")
	item(Sleuth's myLocation Service:true:Call:"AnyRegWrite", "Toggle", "HKLM", "Services\myLocation", "Enabled")
	item(:false)
	menu(RAM Savings:RAM Saving Options)
		item(Remove all Start Menu Icons:false:Call:"RmAllStartIcons")
		item(Remove all but Settings Icons:false:Call:"RmAllButSettings")
		item(Remove the Start Menu:false:Call:"RmStartMenu")
	endmenu
	item(:false)
	menu(WM6.5 Settings:WM6.5 Specific Settings)
		item(Toggle WM6.5 Slide Lock:true:Call:"AnyRegWrite", "Toggle", "HKLM", "Software\Microsoft\Shell\LockScreen", "Enable")
		item(:false)
		item(Titanium Plugin Injector:false:Call:"TitaniumPluginInjector")
		item(Titanium Plugin Uninstaller:false:Call:"TitaniumPluginUninstaller")
		item(Titanium Plugin Order:false:Call:"TitaniumPluginOrder")
	endmenu
	item(:false)
	menu(HTC Sense:HTC Sense Options)
		item(Toggle Sense 2.5 Slide Lock:true:Call:"AnyRegWrite", "Toggle", "HKCU", "Software\HTC\Manila", "Home.lock.Enabled")
		item(Toggle Sense Menu Replacement:true:Call:"ToggleSenseMenuRep", "Toggle")		
	endmenu
	item(:false)
	menu(Backup:Backup Options)
		item(Make Backup:false:Call:"Backup")
		item(Select Backup Folder:false:Call:"SelectBackup")
		item(:false)
		item(Restore ZIP Backup:false:Call:"RestoreZIP", backupdir\"*.zip", "\Windows")
		item(Restore REG Backup:false:Call:"RestoreREG", backupdir\"*.reg")
	endmenu
endmenu
Syntax
It should be quite obvious how the menu/submenu entries work with a title and description-those can be nested without any problems (though, I only tested one nesting at present.)

Menu syntax is a little restricted, you can't have the colon (":") symbol in the name or description as it's used as a field delimiter and they must be string literals:
Code:
menu(name:description)
...
endmenu
For your menu items, the ItemName and Mortscript Command are string literals. Arguments which are not enclosed in double quotes will be interpreted as variables (I haven't tested this though,) which obviously must be set by the calling script before the call to DynamicMenu().

You can make use of any Mortscript function that the script which calls DynamicMenu() has access to and of course Mortscript commands such as "Run" etc will also work just fine so with this you can access any system command as well.

The testing field for the items is important, if your function supports taking it's first argument as the word "test" and outputting something, that something will be output in brackets next to the menu item. Sounds vague? Well, it is. That something can be anything, true/false, a string. Whatever. So the idea is that it'll be used to denote whether a switch is on/off or the value of that particular menu item...
Code:
item(ItemName:Can it be tested?:Mortscript Command:Argument1, Argument2, ..., ArgumentN)
To put in a seperator you can include a blank line in the menu using the code below. I wouldn't recommend it due to differences in screen size, but if you wanted a dashed line as the seperator, for example, then just fill the first field with hyphens. Seperators are as follows:
Code:
item(:false)
It's a v.simple language, I haven't included any comment support and it's line by line but see what you make of it
Attached Files
File Type: 7z FoddTweak - 0.0.3.7z - [Click for QR Code] (368.5 KB, 347 views)
TRITaniumWeather - Titanium, S2U2, iPhoneToday, HTML Weather
--
UIFlex - Disable HTC Sense/SPB Mobile Shell/AnyUI.exe Automatically
--
Fodd Sense - ROM Series

Device: DIAM100
HSPL: 1.93 Olinex
Radio: 1.13.25.24
The Following 3 Users Say Thank You to arealityfarbetween For This Useful Post: [ Click to Expand ]
 
ai6908
Old
#2  
ai6908's Avatar
Senior Member
Thanks Meter 266
Posts: 3,605
Join Date: Nov 2006
Location: Land of Lincoln

 
DONATE TO ME
Interesting line of thinking. I like the idea of removing the SM icons. I will play with this and see what it can offer. Thanks...
Hit "THANKS" button if you like the above post!!
Moto Atrix HD ROM - Batakang
HTC Flyer (WiFi) ROM - Stock Honeycomb3.2 No Root
My UnderVolt Tweak for cfX
 
arealityfarbetween
Old
#3  
Senior Member - OP
Thanks Meter 71
Posts: 422
Join Date: Nov 2008
Location: Newcastle upon Tyne

 
DONATE TO ME
sorry to bump this, but I've updated the menu compiler a little so it shouldn't be thrown off by menus or items which have parentheses in the name or description...

Plus, I added the menu option for the RAM savings again. Hope you like it.
TRITaniumWeather - Titanium, S2U2, iPhoneToday, HTML Weather
--
UIFlex - Disable HTC Sense/SPB Mobile Shell/AnyUI.exe Automatically
--
Fodd Sense - ROM Series

Device: DIAM100
HSPL: 1.93 Olinex
Radio: 1.13.25.24
The Following User Says Thank You to arealityfarbetween For This Useful Post: [ Click to Expand ]
 
claros
Old
#4  
claros's Avatar
Senior Member
Thanks Meter 6
Posts: 250
Join Date: Jul 2007
Location: L'Aquila
Quote:
Originally Posted by arealityfarbetween View Post
sorry to bump this, but I've updated the menu compiler a little so it shouldn't be thrown off by menus or items which have parentheses in the name or description...

Plus, I added the menu option for the RAM savings again. Hope you like it.
Very good idea, trying it now

ciao
HTC Raphael
Rom version : Custom - Claros 3.7
Radio version : 1.14.25.35
 
ai6908
Old
#5  
ai6908's Avatar
Senior Member
Thanks Meter 266
Posts: 3,605
Join Date: Nov 2006
Location: Land of Lincoln

 
DONATE TO ME
Removing the reg is almost equivalent to disabling the SM. I do love your concept, and have included this in my personal ROM...
Hit "THANKS" button if you like the above post!!
Moto Atrix HD ROM - Batakang
HTC Flyer (WiFi) ROM - Stock Honeycomb3.2 No Root
My UnderVolt Tweak for cfX
 
arealityfarbetween
Old
#6  
Senior Member - OP
Thanks Meter 71
Posts: 422
Join Date: Nov 2008
Location: Newcastle upon Tyne

 
DONATE TO ME
glad you like it that much!

I was hoping that chefs and users alike would get involved writing menu source files so if you think any would like this then point them to here. Tell them that, FoddTweak is the Tweakable Tweak app
TRITaniumWeather - Titanium, S2U2, iPhoneToday, HTML Weather
--
UIFlex - Disable HTC Sense/SPB Mobile Shell/AnyUI.exe Automatically
--
Fodd Sense - ROM Series

Device: DIAM100
HSPL: 1.93 Olinex
Radio: 1.13.25.24
 
ai6908
Old
#7  
ai6908's Avatar
Senior Member
Thanks Meter 266
Posts: 3,605
Join Date: Nov 2006
Location: Land of Lincoln

 
DONATE TO ME
I am still trying to get a grasp of the menu source! Havent checked into your latest files yet...but planning on soon...
Hit "THANKS" button if you like the above post!!
Moto Atrix HD ROM - Batakang
HTC Flyer (WiFi) ROM - Stock Honeycomb3.2 No Root
My UnderVolt Tweak for cfX
 
wapvirus
Old
#8  
wapvirus's Avatar
Senior Member
Thanks Meter 70
Posts: 1,716
Join Date: Jan 2008
Location: London
Thanks a bit late finding this but looks a great tool
HTC Sensation XE with Beats Audio Z715e
Viper S 5.0.0 Sense 5 JB Pro
S-Off Super CID
Revolutionary

HBOOT-1.27.1100
Radio-11.24a 3504.31_M

Kernel: SebastianFM kernel 1.0.3
MODS: Crossbreeder MultiSwap

My Beats Inspired Wallpapers for Sensation



Tags
mortscript, xda_uc
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Sony PS4 Remote Play Ported to All Android Devices

Im pretty sure that every informed gamer out there perked their ears up when Sony came out … more

Change Your Samsung Galaxy S2’s Dialer Background in Real Time

As with anything, if youve looked at something long enough, things can … more

Increase Your Multitasking Workflow with C-Floating Windows

Technology has put life on the fast track. Lazy, relaxed days have turned into … more

Compile Your Own Kernel From Source with Comprehensive Tutorial

One glance at any developer section of any device forum on XDA and youll find … more