Use computed offset instead of hand-built array for access to struct swb_config members To access an arbitrary member of struct swb_config, we currently use the entries array in the struct, which contains pointers to the members of the struct in order. This has several disadvantages: * the entries array must be filled by hand for each instance; * structure instances cannot be copied in the normal way; * the swb_config_options array describing the possible config options must be kept in the same order as the members of the struct. A much better solution is to let the compiler compute the offset of structure members using the offsetof() macro and stick the results in the swb_config_options array; we can then access the member by adding the offset to the address of the structure instance. This also allows us to get rid of the entries array in struct swb_config and the swb_config_copy() function.
Fremantle: Prestart MicroB if appropriate when reconfiguring browser-switchboard If, in changing the browser-switchboard configuration, we go from a configuration where MicroB is not left running to one where it is, we should start MicroB in the background in order to make sure that the MicroB browser window comes up quickly when requested. Make a best-effort attempt at this in both the command-line utility and the GUI, refactoring to give a swb_reconfig() function that can be shared between the two along the way. Ideally, we'd also kill MicroB when making a config change in the other direction, but we don't have an easy way of knowing whether MicroB is actually in use and we don't want to kill MicroB if it's in use at the time.
Whitespace fixes
Config UI: Only offer the user browsers that are installed Check to see which of the known browsers is installed, and only offer the user choices for the ones that are. If the currently configured default browser is not installed (e.g. if the user uninstalled the browser without changing the default), use the default default browser like browser-switchboard does. This fixes Browser Switchboard bug 5469: https://garage.maemo.org/tracker/index.php?func=detail&aid=5469&group_id=1159&atid=4348
Remove continuous_mode config option from Fremantle UI Now that we force continuous_mode on for Fremantle, there's no point in having the setting exposed in the UI. Remove it.
Config UI: leave other_browser_cmd unset instead of configuring an empty value It used to be that when the user cleared the value of other_browser_cmd in the UI, the setting would be removed from the config file instead of writing an empty value. Restore this behavior.
Describe MicroB slightly more verbosely in the UI Emanuele Cassioli pointed out that users could potentially be unfamiliar with the name "MicroB", since it's not used in normally user-visible places. Rename the entry "MicroB (stock browser)" to hopefully help these users; better suggestions welcome.
Clean up configuration again Commit ec8b58af... ("Refactor configuration") still has too much boilerplate code and leaves too many places that have to be modified to add a new config option. To fix this, add a new array of config options with name and type of information stored, and then add an array of pointers to the elements of struct swb_config with indices matching the list of config options to struct swb_config. This consolidates all the work needed to add new config options to config.h and config.c, and allows us to replace the boilerplate code with loops over the array of config options.
Refactor configuration Most of the code for loading configuration from the config file was being duplicated between the UI and the main browser-switchboard code; also, the forthcoming command-line configuration tool should share the code for loading and saving configuration with the UI. Therefore, move code for loading and saving configuration information into functions generic enough to be shared between the UIs and browser-switchboard.
Add preliminary support for Opera Mobile We do this the lazy way, using use_other_browser_cmd("opera %s"). The Opera Labs post announcing Opera Mobile for Maemo (http://labs.opera.com/news/2010/05/11/) says that "an extra empty tab will get opened every time you open a link from an external application", so I suspect we may need a different method of opening links in an already open browser.
Add a new config setting for logging Add a new config setting: logging = "stdout" -- log to stdout (default) logging = "syslog" -- log to syslog logging = "none" -- disable logging No configuration UI is exposed, but the UI needs to be taught that this is a legal config setting (so that it doesn't discard it).
Spelling/grammar fixes to comments
Update copyright notices
Diablo: disable autocap/predictive text for the other_browser_cmd entry The Fremantle UI introduced in commit 18bad5e9... ("Revise GUI for Fremantle to be more finger-friendly") disables autocapitalization and predictive text/dictionary features for the other_browser_cmd entry -- those input method features are for natural language text only, and get in the way here. Now do the same for the Diablo UI (and make a style cleanup along the way).
Revise GUI for Fremantle to be more finger-friendly Make the GUI for Fremantle more finger-friendly by making the widgets larger and using HildonTouchSelector widgets in place of combo box/radiobutton widgets. Based on a patch by Faheem Pervez (qwerty12): http://slexy.org/view/s2JL7ye01p
Don't use killall to HUP browser-switchboard Use kill and pidof instead -- killall might kill a standalone config app.
config-ui: Teach UI how to HUP C browser-switchboards
HUP running browser-switchboard processes after saving config Sending SIGHUP to a running browser-switchboard in continuous mode causes it to reload its config. If not in continuous mode, it'll die and the next browser-switchboard will pick up the config changes.
Use a stock GTK+ dialog Use the stock OK/Cancel GTK+ dialog instead of making our own. Also use the response from gtk_dialog_run() to decide whether to save instead of using custom callbacks for the buttons. Should make the dialog more Maemo 5 friendly. Also, eliminate some unnecessary crap in the hildon-control-panel plugin path, and reintroduce do_reconfig() in preparation for adding HUPing of a running browser-switchboard.
Don't execute hildon_program_get_instance() before gtk_init() Shuts up some runtime assertions in the Hildon app.