Ofunniku / dwarftherapist

Automatically exported from code.google.com/p/dwarftherapist
Other
0 stars 0 forks source link

Invalid connect state #255

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start Dwarf Fortress and wait in the main menu
2. Start Dwarf Therapist

What is the expected output? What do you see instead?
Expect:
Dwarf Therapist to state it cannot connect to a running game, and remain 
unconnected.
Actual:
Dwarf Therapist gives the message, but disables the "Connect to DF" button and 
enables the "Read Dwarves" button.

What version of the product are you using? On what operating system?
v0.5.4, Windows 7 32 bit

run.log attached

Original issue reported on code.google.com by dwatt...@gmail.com on 20 Jun 2010 at 11:20

Attachments:

GoogleCodeExporter commented 9 years ago
Not enough information, reopen if this is a problem still

Original comment by treyst...@gmail.com on 27 Jun 2010 at 5:31

GoogleCodeExporter commented 9 years ago
The fault is in the connect_to_df function in mainwindow.cpp.

The read_dwarves function can fail & report it is unable to connect to a 
running game, and sets the interface state to false 
(set_interface_enabled(false)). However, as read_dwarves does not return this 
fact to the connect_to_df function, the connect_to_df function assumes the read 
was successful and proceeds to call set_interface_enabled(true) after the call.

Recommended solution (only tested locally) is to move line 261 (mainwindow.cpp; 
the call set_interface_enabled(true) at the end of the if block in 
connect_to_df) to line ~240 (before any other functions report a failure to 
connect).
This ensures that if any functions in the block set the interface state to 
false, it does not get overwritten.

Original comment by dwatt...@gmail.com on 27 Jun 2010 at 9:06

GoogleCodeExporter commented 9 years ago
This is indeed a problem. Thank you for looking into it. Re-opening, and will 
fix ASAP.

Original comment by treyst...@gmail.com on 29 Jun 2010 at 11:25

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 2fc36930f1.

Original comment by treyst...@gmail.com on 30 Jun 2010 at 2:50