[PLUGIN] simple plugin settings window without qt?

Hey,
when opening the extensions → my addons menu there is a “settings” button for every plugin.
The function “void ts3plugin_configure(void* handle, void* qParentWidget)” of the ts3 SDK seems to belong to this “settings” button.
Is there a simple way to open a window with only a few input fieds for some values?
I have no clue of QT and just want the most basic and easy to set up settings window :slight_smile:

Thanks in advance!

What a coincidence. I just updated my template plugin a few days ago. Take a look at it here: GitHub - Gamer92000/TeamSpeak3-Qt-Plugin-Template: A simple Qt plugin to demonstrate a full toolchain.
It has a simple settings window and saves those settings in a config file.

Edit: to change the windows layout you want to use the Qt Designer.

2 Likes

Hey thanks a lot for the info!
I have looked into your repo in the past but not got it working for me. I will try with the updated version.
Can I contact you somehow if I ran into problems again?

Sure, I am a bit busy at the moment but will try to get back to your questions asap.

1 Like

No Problem, I only occasionally work on my TS3 plugin :slight_smile:
My first question would be:
My Plugin is written in pure C.
Is it still compatible with your code, because it’s written in c++?
And I’m not quite sure how to merge this two pieces together. (My Plugin and the QT UI)

You should be able to just through your C code in a C++ file. Like 99% of the everyday syntax is the same and there is only a handful of functions that C supports while C++ does not.

For the Qt part: You want to open the config.ui file in Qt Designer to modify the layout to your needs. Make sure to give every input field a unique id. Then you can map these inputs in the saveSettings and loadSettings functions inside the config.cpp file. Your linter should give you all sorts of warnings when using the unmodified setup - even with CMake.

It is specifically built for the GitHub CI. To compile it locally you need to change the project name in the CmakeLists.txt file. (But you need to change it back before committing when you intend to use the GitHub CI for compilation and release.) Then I use VS Code with this extension to easily build locally: CMake Tools - Visual Studio Marketplace.

2 Likes

Okay thank you, I will try this!

How did you get the official plugin sdk from ts3 in c++? Or did you converted it yourself?
And c++ and c seem to be compatible?

C and C++ are almost perfectly compatible. Only the exports need to be wrapped in an extern "C" block to use the correct naming scheme and calling convention. But the plugin.h file from the official plugin SDK already includes this, so it works with both C and C++.

1 Like