xqemu / xqemu-manager

Simple graphical user interface to manage XQEMU
http://xqemu.com
GNU General Public License v2.0
34 stars 10 forks source link

Minimize args and disable using MUs in ports without attached controllers #33

Closed GXTX closed 5 years ago

GXTX commented 5 years ago

As it stands right now there's a few redundant args being set such as -net nic,model=nvnet, -net user, and -usb. All 3 of these are automatically set by default.

In this commit i've removed those as well as made it impossible to attach a MU when a controller isn't present in that particular port (if there's a way to disable the "Choose..." button I think that would be a better solution than what I came up with here).

Default args with controller attached to player 1 --

Original: /path/to/xqemu -cpu pentium3 -machine xbox,bootrom=/path/to/mcpx.bin -m 64M -bios /path/to/flash.bin -net nic,model=nvnet -net user -drive file=/path/to/hdd.img,index=0,media=disk,locked -drive index=1,media=cdrom,file=/path/to/disc.iso -usb -device usb-hub,port=3 -usb -device usb-hub,port=4 -usb -device usb-hub,port=1 -usb -device usb-hub,port=2 -qmp tcp:localhost:4444,server,nowait -display sdl -device usb-xbox-gamepad-sdl,index=0,port=3.1

Modified: /path/to/xqemu -cpu pentium3 -machine xbox,bootrom=/path/to/mcpx.bin -m 64M -bios /path/to/flash.bin -drive file=/path/to/hdd.img,index=0,media=disk,locked -drive index=1,media=cdrom,file=/path/to/disc.iso -qmp tcp:localhost:4444,server,nowait -display sdl -device usb-hub,port=3 -device usb-xbox-gamepad-sdl,index=0,port=3.1

I'm ok with this not being merged if it's not ideal, but I figured I'd offer it up to discussion.

thrimbor commented 5 years ago

As it stands right now there's a few redundant args being set such as -net nic,model=nvnet, -net user, and -usb. All 3 of these are automatically set by default.

I don't know whether there's a reason for explicitly specifying the default net args, but the usb one was an oversight on my part, and I'm fine with that change.

[...] made it impossible to attach a MU when a controller isn't present in that particular port (if there's a way to disable the "Choose..." button I think that would be a better solution than what I came up with here).

Using the setEnabled(False) method should do the trick. I'd suggest using that on not only the buttons, but also on the labels and lineedits to provide a clear visual hint (thinking of it, we could introduce that behavior also for other parts of the settings window, like the GDB server part). I didn't bother with that yesterday because I didn't know how wireless controller receivers behave when not having a controller attached (theoretically, they could only expose the memory unit and the hub, so I didn't want to prevent users from configuring xqemu that way), but I just checked, and all my wireless controllers behave like your changes do, so that's fine to me as well.

mborgerson commented 5 years ago

I'll merge this now, thanks! Waiting for @thrimbor to file his PR adding visual feedback to the MU file pickers indicating disabled state.