to ericshliao:
I have the same idear for implement icon to execute scripts, but I don't know how to do it. I think it's doable so I write down the code that been modified, it's relative easy, hope someone can get it and make a better contentlister.
1. in liberipc/src/eripctoolbar.c add the icon map in function iconMap_t g_icon_map_table[] like this:
{iconID_uplevel, "uplevel"},
{iconID_upmostlevel, "upmostlevel"},
{iconID_shutdown, "shutdown"}
2. in liberipc/include/eripctoolbar.h add the iconID to enum e_iconID_t like this:
iconID_uplevel,
iconID_upmostlevel ,
iconID_shutdown
3. in newLister/src/control.cpp add the action been triggered when click the icon like this:
case iconID_uplevel:
CL_LOGPRINTF("OVERVIEW_BUTTON");
pm_SendKey(GDK_F5);
break;
case iconID_upmostlevel:
CL_LOGPRINTF("OVERVIEW_BUTTON LONG");
pm_SendKey(GDK_Home);
break;
case iconID_shutdown:
ctrl_shutdown();
break;
the function or script been called should be handled here.
4. in newLister/src/toolbar.c add the toolbar icon like this:
tbAppendPlatformIcon( toolbarChannel, ER_CONTENT_LISTER_UA_ID, iconID_uplevel, ccClToolbarIcon);
tbSetStatePlatformIcon(toolbarChannel, ER_CONTENT_LISTER_UA_ID, iconID_uplevel, iconState_normal );
tbAppendPlatformIcon( toolbarChannel, ER_CONTENT_LISTER_UA_ID, iconID_upmostlevel, ccClToolbarIcon);
tbSetStatePlatformIcon(toolbarChannel, ER_CONTENT_LISTER_UA_ID, iconID_upmostlevel, iconState_normal );
tbAppendPlatformIcon( toolbarChannel, ER_CONTENT_LISTER_UA_ID, iconID_shutdown, ccClToolbarIcon);
tbSetStatePlatformIcon(toolbarChannel, ER_CONTENT_LISTER_UA_ID, iconID_shutdown, iconState_normal );
5. copy the icon picture to /usr/share/pixmaps/ folder, for my version, I copyed uplevel.png/upmostlevel.png/shutdown.png total 9 files to this folder (see from the tarball), maybe just this three does work.
6. add the name of icon to the toolsbar.xml like this:
<toolbarIcon name="uplevel">
<iconFileName id="1">uplevel.png</iconFileName>
<iconFileName id="2">uplevel_grey.png</iconFileName>
<iconFileName id="3">uplevel_selected.png</iconFileName>
</toolbarIcon>
add copy it to /etc/registry/ overwrite the original one.
Cause I compile it a few month ago, I just remember above step to change, so pls be carefully do it when you use it. I suggest you that when you want to use the new contentlister, pls add some code at /home/root/startup.sh to change back to use original contentLister every time you boot up and manully change it to the new one after you test in case this one have problem, when you confirm the new one have no problem, you can safely remove the code that switch to old original contentLister.
I switch for more than five times to get the new contentlister to function normally. For the liberipc.so.0.2, I think it's safe to overwrite because it just add the icon to toolbar, nothing else.
For the top-most black bar clickable problem, I don't know, maybe hansel can tell.
|