GNOME Bugzilla – Bug 748135
--mode command-line option to start calculator in desired mode
Last modified: 2016-10-11 09:11:23 UTC
I propose a --mode command-line option. $ gnome-calculator --mode=MODE Where MODE is one of 'advanced', 'financial', or 'programming'. == Rationale == Financial software could have a toolbar button or menu entry or something else to let the user launch gnome-calculator in financial mode. Programming software could have a toolbar button or menu entry or something else to let the user launch gnome-calculator in programming mode. Software can integrate with gnome-calculator and let the user get a calculator in a mode that is expected from the context. == Example == $ gnome-calculator --mode=programming $ gnome-calculator --mode=programming --equation=1024*1024
Created attachment 301925 [details] [review] Patch to add support for --mode Probably does not even work. I was unable to get gnome-calculator to even build.
Created attachment 335747 [details] [review] command-line: added option to select mode from CLI
My attached patch is based on Moo's patch, only extended to work properly. Of course, this will happen only for the next cycle.
Fix pushed to master. Attachment 301925 [details] pushed as 56c9e3e - Patch to add support for --mode Attachment 335747 [details] pushed as f9d760e - command-line: added option to select mode from CLI
Thanks Robert, you're awesome! :) Next step would perhaps be to make use of it from within some GNOME software. Suggestions for programming mode: - Anjuta - Glade Interface Designer - GNOME Builder - Geany Suggestions for financial mode: - Gnumeric - GnuCash - HomeBank Suggestions for advanced or programming mode: - Nemiver
I think those are separate feature requests for each application, so we'll have to handle those separately in each product. However, I'm not sure if apps would add shortcuts just to start calculator in a given mode, as it adds a hard-dependency on another application (calculator in this case), and having hard-links just to start another application would be against the current goals of simplifying toolbars and menus. In any case, the mode cli switch could be useful in several different contexts, e.g. unity quick menus, or simply launching from CLI.
Indeed, those are for separate feature requests. I just mentioned a few applications as candidates. Yes, a hard dependency would be undesirable. Maybe it could be an optional dependency that only adds a entry to the toolbar or menubar if the application exists on the system? if (system.hasCalculator) { toolbar.add("Calculator", calc); menubar.add("Calculator", calc); } public void calc() { system.execute("gnome-calculator --mode=programming"); }