GnuCash
Contact   Instructions
Bug 797200 - closing window in python console should trigger regular shutdown or none at all
Summary: closing window in python console should trigger regular shutdown or none at all
Status: NEW
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Python Bindings (show other bugs)
Version: git-maint
Hardware: PC All
: Normal normal
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-18 01:03 EDT by Christoph Holtermann
Modified: 2019-04-19 06:08 EDT (History)
2 users (show)

See Also:


Attachments

Description Christoph Holtermann 2019-04-18 01:03:00 EDT
Closing the python shell immediately quits gnucash. As mentioned in a code comment (init.py):

# Hm. Gtk.main_quit will kill gnucash without closing the file
# properly. That's kinda bad.

That behavoir should change. Either do a regular shutdown or don't quit gnucash at all.
Comment 1 John Ralls 2019-04-18 10:47:18 EDT
Yeah, calling gtk_main_quit kills the event loop. gnc_main_window_quit is the right function to quit GnuCash, but it's not exposed to the python bindings.

Is there a use-case for the python console being able to shut down GnuCash? Shouldn't it just exit the console and leave it for the user to quit GnuCash the usual way?
Comment 2 Christoph Holtermann 2019-04-19 03:50:48 EDT
It would make sense to just shut the console. There is no possibility to reopen it from running gnucash but in that case gnucash has to be restarted. That' no problem. If the shell would be more useful than it is now it may make sense to have it openable on demand.

From a perspective of gui logic killing a subwindow should not kill the main program.

I'll change it so closing the shell does not affect the main process.
Comment 3 Christoph Holtermann 2019-04-19 06:08:40 EDT
https://github.com/Gnucash/gnucash/pull/491

Note You need to log in before you can comment on or make changes to this bug.