This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10187 - Theme Deleter - Parses CFG files and removes their files
Attached to Project:
Rockbox
Opened by Mattitiah Curtis (motionman95) - Monday, 04 May 2009, 00:13 GMT+2
Last edited by Teruaki Kawashima (teru) - Monday, 14 December 2009, 06:51 GMT+2
Opened by Mattitiah Curtis (motionman95) - Monday, 04 May 2009, 00:13 GMT+2
Last edited by Teruaki Kawashima (teru) - Monday, 14 December 2009, 06:51 GMT+2
|
DetailsThis is plugin that will parse a given config (.cfg) file and remove it's files in an attempt to "remove" the files installed by a theme, as requested by BdN3504 (on the rockbox forums). This is the plugin in it's most basic/beta state, TONS of work must be done before it's complete.
For now it relies on the "cabbiev2.cfg" file being placed in the same directory as it. Also, as pointed out in the forums (I forget by who) that it may not be a good idea to remove certain files, such as the font or iconset files. So, to sum it all up, this plugin is really just a starting point, and user input will definitely be a factor in it's growth. |
This task depends upon
Closed by Teruaki Kawashima (teru)
Monday, 14 December 2009, 06:51 GMT+2
Reason for closing: Accepted
Additional comments about closing: committed in r23130.
Monday, 14 December 2009, 06:51 GMT+2
Reason for closing: Accepted
Additional comments about closing: committed in r23130.
Hilton: there are several themes that *do* include a font. This is nothing special and has allways been that way -- the only exception are the themes shipped with the rockbox builds and themes relying on the fonts package. The more important thing is that before deleting a file all other themes need to get checked if some other theme is using that file. Especially fonts, but other files might be affected as well. Also, I don't see a reason thy CATEGORIES and SOURCES would need to be alphabetical -- in fact, SOURCES is definitely *not* sorted alphabetically. Please don't make such obvious wrong statements as that will only cause confusion.
#ifdef HAVE_LCD_BITMAP /* Not for the Player */
rockblox1d.c
brickmania.c
maze.c
mazezam.c
text_editor.c
wavview.c
robotfindskitten.c
from my understanding of "alphabetical" brickmania.c has to come before rockblox1d.c if that would be sorted. Thus, they are NOT sorted alphabetical. Parts of the file are, but for compiling it doesn't matter at all. You call that alphabetical?
[...] in settings.h
#define WPS_DIR ROCKBOX_DIR "/wps"
#define THEME_DIR ROCKBOX_DIR "/themes"
this works as viewer and user can select to remove a file or not.
only tested on a simulator.
Something must have gone wrong, although i get no errors, when i compile.
I tested both simulator and my gigabeat. version is r21072.
I forget to write how to use this plugin, sorry.
usage:
goto "Main Menu" -> "Settings" -> "Theme Settings" -> "Browse Themes".
enter Context Menu for the cfg file to remove, and execute theme_remove in "Open With...".
selecting "Remove Theme" will remove wps, backdrop, and the cfg file. Font is not removed by default.
I think it's not so difficult to add "Remove Theme" option to the context menu.
IIUC, "Properties" and "Add to Shortcuts" in the context menu use plugins, so i guess it can be done in the same way.
*add option "Remove if not Used".
*save options.
*create log file "/theme_remove_log.txt".
also, attach a patch to add item to context menu.
for this, apply theme_remove_context_menu.patch with theme_remove.patch.
open context menu on .cfg file and "Remove Theme" will be shown in it.
selecting this is same as selecting theme_remove in "Open With...".
i have compiled a sim with both patches and uploaded it to my rs account. if anybody wishes to see how this feature looks on target check it out!
http://rapidshare.com/files/258412449/PatchedGigaSimrar.zip
i hope this patch will make it into svn, cross your fingers!
One glitch i have observed: In the log file, if an item is not present it says: "Not exists". This shall be "Does not exist".
A suggestion for improvement: Attach some ifdefs for targets that don't have remote control displays. For example i think it's unneccessary to ask a gigabeat owner to remove the "remote wps" or the "remote viewers iconset" or the "remote iconset" because these things don't exist on targets without a remote display.
i turned it to plugin manual and added ifdefs.
also, integrate almost same option descriptions.
I can think of the case where fonts from rockbox-fonts.zip are deleted by this plugin, and then themes installed at a later date which rely on that theme will stop working. Is there anything else?
I'm just slightly worried that if it's not perfect, then this plugin could do more harm than good.
*use global_settings struct to check files currently used.
*add rockbox-fonts.config which contains filenames in rockbox-fonts.zip to prevent removing fnt files from the zip.
imo it would be possible to add context menu after plugin is committed, although i'm not sure if it is worth doing or safe enough.
Could you change the title of the menu from "Theme Remove" to "Remove [Theme Name]" ? (and maybe let it scroll, if the theme's name is too long)
i attached a proper manual patch containing the directory locations.
On topic: apparently i am too noob to post a proper patch. The very first line shall of course be
Index: manual/plugins/theme_remove.tex
and not
Index: theme_remove.tex
sorry, but i am still learning. plus i did svn add theme_remove.tex and then svn diff, because i thought that's how it works, but apparently either it just doesn't or i did something wrong.
I believe this plugin basically wont cause problem. but this plugin isn't perfect and I have no idea what kind of things would happen.
maybe what we need is more tester?
BdN3504: maybe you added theme_remove.tex in wrong directory?
yes, i added it in the source... now i used svn diff correctly and have it right patch for the right files.
thanks to pixelma, i now know how to make a proper newline. before the note i could remove the descriiption tags in the first paragraph.
Bug: Go to "Menu/Settings/Theme Settings/While Playing Screen/" now go back to "Theme Settings"
Then to go to /Browse Theme Files/" it says "Says "No Files!"
but if you exit the menu and got to /Browse Theme Files/ FIRST it shows the files that are there.
*add "I am running Running Version: r22090M-090801"
The only thing i had to change were the strlcpy s to strncpy s. i have tested it on a sim and it doesn't cause a problem, even if you have extremely long filenames.
So for testing purposes, i compiled five 3.3 versions and posted them to the forums. This time, i only compiled for targets which have actually been downloaded. if you want a testbuild for a specific target which isn't in the forumthread, either contact me, or download and apply the patch i provide after you check out 3.3 using
svn co svn://svn.rockbox.org/rockbox/branches/v3_3 rockbox-3.3
you don't know how compile?
you have vmwareplayer installed? can use vmware image debian.7z provided in wiki?
if yes login root. name: root password: rockbox
hit windows-e.
assume you winxp: go My Network Places.
if root at samba is shown double click
if not type \\debian\root into adress toolbar in current window and press enter
wait
asked for login again root/rockbox
save this page to \\debian\root name file: td.patch
http://www.rockbox.org/tracker/task/10187?getfile=20267
save this page to same dir name file: cm.patch
http://www.rockbox.org/tracker/task/10187?getfile=20104
click on vmware
right click open shells -> eterm
execute command: vmware-toolbox& (note: sic!)
now you can copy text into bash. use ctrl-c and paste into shell by using shift+insert.
execute following command (assuming your player is gigabeat f):
cd && svn co svn://svn.rockbox.org/rockbox/branches/v3_3 rockbox && cd && patch -p0 < td.patch && patch -p0 < cm.patch && cd ~/rockbox && mkdir giga && cd giga && ../tools/configure --target=gigabeatf --type=n && make && make zip && mv rockbox.zip ~/gigabeat-f-patched-33.zip && rm -rf ~/rockbox
this command make you build with patch applied to 3.3 and context menu.
the test builds have been up since about two weeks and there hasn't been a single bug iiuc. the manual is ready and the functionality is given.
i know you can patch it so its like that but will the final version be in the context menu? like theme_remove.3.patch
* change string "Ask" to "Ask for Removal".
* set default setting of font to "Ask for Removal".
* Use splash function to show message.
* add some comments.