PhonologicalCorpusTools / SLPAA

5 stars 0 forks source link

250 bug slpaa and ubuntu device crashes on toolbar selection #257

Closed stannam closed 10 months ago

stannam commented 11 months ago

Although clicking on the tool bar does not crash the program on my end, I did find that two options triggered errors independently: 1. Settings > Preferences... and 2. Location > Define locations... This PR addresses both.

@brdiep113 Brian could you kindly check if the issues have been resolved and if the program no longer crashes?

1. Settings > Preferences...

This is from a known issue where the two settings parameters entryid_digits and sig_figs are incorrectly typed as str instead of int on Ubuntu.

So the solution was simple: explicitly type sig_figs and entryid_digits as int from the very beginning.

2. Location > Define locations...

The location definer dialog has tabs that can be closed by clicking Ⓧ, which appear on the left or right side of the tab. The right-most tab is 'Add new tab' and we don't want the Ⓧ button for this tab. So we previously deleted the button. However, since Ⓧ appears on different location by OS (e.g., right-hand side on Win, and left side on macOS), I previously wrote a conditional that locates and deletes this Ⓧ differently depending on the OS (87c9bd800bf60d79df3c0df78f432a0d15b81241). There, I grouped Linux (including Ubuntu) with macOS to expect Ⓧ on the left side of a tab, but the problem was that the Ⓧ location is not fixed on Linux.

This PR takes a different approach. Rather than deleting Ⓧ from 'Add new tab', the program now ignores the input when the user clicks (x) on the 'New Location' tab.

stannam commented 10 months ago

Interesting.. I'll double check with a new environment just to make sure again that the issue is not replicable. I haven't used Windows Subsystem for Linux and it is the right moment to do it.

Edit: Clicking on the toolbar did not crash in another Linux distro. So I'll just go ahead and merge it into main.

I installed Debian using wsl --install Debian and ran the program from the source code. All toolbar options seem to work, although the graphics sometimes gets distorted, as shown below.

image

Windows Subsystem for Linux started supporting GUI apps just about a week ago, so no surprise. This seems to happen only for a background window. Also, we don't expect anyone to use the program on WSL.

Thanks Brian and Kaili for having a look at this.