Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Multiple refreshes of SD card dialog causes selection glitch #6

Closed
getodk-bot opened this issue Nov 23, 2016 · 5 comments
Closed

Multiple refreshes of SD card dialog causes selection glitch #6

getodk-bot opened this issue Nov 23, 2016 · 5 comments

Comments

@getodk-bot
Copy link
Member

Issue by mitchellsundt
Thursday Jul 09, 2015 at 19:01 GMT
Originally opened as getodk/getodk#665 (1 comment(s))


Originally reported on Google Code with ID 664

If you refresh multiple times, the dialog keeps adding visual elements into radio panel.
It also keeps adding multiple radio buttons to the group. This leads to a situation
where you have your selected choice hidden underneath a bunch of empty radio buttons.

In rebuildPanel() you need to clear the radioPanel and clear out the radio group.


  private void rebuildPanel() {
    JPanel panel = radioPanel;
    radioPanel.removeAll();

....

    int len = 0;
    File oldDevice = odkDevice;
    JRadioButton activeButton = null;
    odkDevice = null;
    boolean first = true;

    if (radioGroup != null) {
        for (AbstractButton rb :  Collections.list(radioGroup.getElements())) {
            radioGroup.remove(rb);
        }
    }

Reported by yanokwa@nafundi.com on 2012-08-15 04:13:59

@getodk-bot
Copy link
Member Author

Comment by mitchellsundt
Thursday Jul 09, 2015 at 19:01 GMT


Fix will be in the next release of briefcase.

Undergrads...

Reported by mitchellsundt on 2012-08-15 18:18:03

@yanokwa
Copy link
Member

yanokwa commented Mar 15, 2017

@mitchellsundt I'm leaning towards removing this feature because it doesn't seem to work and because if you can mount an SD card, you can just as well use the Custom path option. Is there a good reason to keep it?

@shivam-tripathi
Copy link
Contributor

shivam-tripathi commented Mar 15, 2017

I was trying to reproduce this issue. I am using Ubuntu 16.04 LTS - and have a SD card mounted using a SD card adapter. However, when SDCardChooserDialog opens, it can't seem to detect my SD card.
Attached : A screen shot with window dialog showing files of the SD card and the chooser dialog in the front.

workspace 1_004

@shivam-tripathi
Copy link
Contributor

shivam-tripathi commented Mar 18, 2017

It appears that there is a variation in the auto mount location of external drives across flavours of Linux. In the utils/FindDirectoryStructure, it is assumed that mount location is /mnt and /media; however in some cases (like Ubuntu) it may be /media/username.

@lognaturel
Copy link
Member

Fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants