Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

high level over view for adding features #3309

Closed
spikefishjohn opened this issue Mar 23, 2022 · 9 comments
Closed

high level over view for adding features #3309

spikefishjohn opened this issue Mar 23, 2022 · 9 comments
Labels
Milestone

Comments

@spikefishjohn
Copy link
Contributor

I'd like to play around with adding a feature to GNS3. The idea is to right click a VM and create a new base image.

high level this would have to make sure the VM is shutoff, verify its qcow backed and then issue a qemu-img command to clone it and maybe create a copy of the template. Just kind of thinking out loud at the moment.

Is there a high level work flow for adding feature to the gui? Not sure if that requires recompile of the fat client. I'm also not sure if the feature I'm thinking about would require a new API end point, but lets just say in theory it did.

Any pointers?

@ghost
Copy link

ghost commented Mar 26, 2022

Currently the only way for adding new features is to modify the source and then reinstall the GUI. On Windows and macOS this means you have to either compile the modified source to binaries or install the python3 interpreter and run the GUI using the interpreter. As compiling the GUI is undocumented, the second way is easier, but redistribution is difficult. The easiest way is to convince the GNS3 devs to include your addition.

Adding new features in the nodes context menu is done in graphics_view.py function populateDeviceContextualMenu. If you need new API endpoints you additionally have to modify the GNS3 server.

The issue #708 discusses a plugin system, that would allow to add new features to the GUI without modifying its source. But that is one of those ever lasting issues (already open since 2015) and I don't know, if you want to wait for its implementation.

@spikefishjohn
Copy link
Contributor Author

Yeah, I think I'll stick to doing dev work on Linux which should make prototyping easier.

Thanks for the link to graphics_view.py. That should be enough to get me started. I don't think I'll need a new API endpoint, but I really don't know yet.

@ghost
Copy link

ghost commented Mar 27, 2022

Development under Windows or macOS is not much different to development under Linux. You have to install Python3, choose a good editor and then you are good to go. Even when you prefer using Linux, you might want to check, if your changes are running fine on Windows.

My comment about compiling the source was meant, when you want to distribute your changes. On Linux there is normally python installed. So you can give others your sources, and tell then to install it with python3 setup.py install. On Windows and macOS the users like to get an installer, containing a compiled GNS3. But the procedure creating installer packages is not documented. So the distribution of your changes is difficult. But if you want to use it only for you, that's not an issue.

@spikefishjohn
Copy link
Contributor Author

ah, I get you. I'll do this as a push request and see happens. I don't plan on making an official Spikefish GNS3 fork beyond doing so for patches.

@kefins
Copy link

kefins commented Apr 1, 2022

Hi, can you give some guidance on how to make an installer on Windows. I tried PyInstaller but faulthandler gave some error when starting the exe.

Traceback (most recent call last):
  File "gns3\main.py", line 316, in <module>
  File "gns3\main.py", line 116, in main
AttributeError: 'NullWriter' object has no attribute 'fileno'

@ghost
Copy link

ghost commented Apr 1, 2022

Sorry no, I have never tried to create an installer.

@kefins
Copy link

kefins commented Apr 1, 2022

OK, do you know who is responsible for making the installer, just as you said, there is no related document.

@grossmj
Copy link
Member

grossmj commented Apr 1, 2022

@kefins unfortunately we do not share how we make the installer. We use cx_Freeze and NSIS to make it.

@kefins
Copy link

kefins commented Apr 1, 2022

OK, I got it. I used PyInstaller and NSIS, maybe I should try cx_Freeze. Thank you, anyway.

@grossmj grossmj added this to the 2.2.32 milestone Apr 18, 2022
@grossmj grossmj closed this as completed Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants