Forum

Results 1 to 5 of 5

Thread: Plugin Menus

  1. #1
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029

    Lightbulb Plugin Menus

    Client: 12.01.2012 15:22:23

    While the ability to finally add Menu Items to the Client & Channel Context Menu as well as to the global Menu Bar is certainly nice it is also quite useless in its current state imho.


    Some things that came to mind:
    • You HAVE to create all your Items in one place.
    • You CANNOT change your Items in any way once created.
    • You CANNOT remove your Items in any way.
    • It is generally way too abstract.

    Suggestions:
    • It would be nice if you just had a few Functions on ts3Functions Struct like these:
      • QAction* addMenuItem(PluginMenuType type, char* name = 0, char* IconPath = 0);
      • void removeMenuItem(QAction* menuItem);
      • void renameMenuItem(QAction* menuItem); // Not really required.


    Advantages:
    • Being able to create / change / remove Menu Items anywhere at anytime.
    • Giving Developers full Control over their Menu Items by actually returning the QAction Pointer.
    • Eliminate the need for the #define's
    • Eliminate the need for the Helper Function
    • Eliminate the need to know upfront how many Items one could possibly need at any given time
    • Allow for Menu Items to be hidden / disabled in certain situations
    • Make the Feature actually usable.


    Disadvantage:
    • Developers would need to download the Qt Source.


    While there is also the (rather small) disadvantage of having to have the Qt Source available I think the advantages clearly outrank the disadvantage.
    Last edited by SilentStorm; January 23rd, 2012 at 09:59 PM. Reason: Added small Disadvantage.

  2. #2
    Join Date
    June 2008
    Location
    Krün, Germany
    Posts
    510
    I don't like the idea of accessing Qt code from plugins. While this can be optional, it shouldn't be necessary just to implement those menus. I prefer a way to do menus without Qt. Besides that, some plan for the future is to move plugins in an own executable (just like Firefox or Chrome execute plugins in a plugin container) to avoid plugins crashing the whole TeamSpeak client (I see quite some crashdumps because of this). So once this happens, any access to Qt won't be possible anymore.

    A mechanism to add/remove and enable/disable plugin items should be possible with the current plugin menu system.

  3. #3
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    Using this Thread again since it is related...

    There is no way to create Separators with the current System and most of the above is still not possible.

    I'd like to request to ability to actually create Separators (QAction::setSeparator(true)). If you really don't want to return the QAction Pointer then you could just do a setSeparator(true) if the MenuItem Text is either a single or three dash(es) as iirc this creates a separator in most cases.

    For disabling Menu Items there is setPluginMenuEnabled now but it is only really helpful for Global Menu Items (never found any use for that btw) as you cannot conditionally disable Client / Channel Menu Entries since you don't receive any kind of Notification when such a Menu is created. There would need to be some kind of Callback which gets called when the Menu is requested which includes the Channel / Client ID on which the Context Menu was requested. That way one could disable the Item on instances where it makes no sense to have it.

    Still cannot dynamically add / remove Menu Items.

  4. #4
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    Yet another Menu Related Issue / Request:

    Current System unfortunately doesn't allow to structure the Menu.

    I'd like to request being able to create SubMenus instead of being forced to have everything on the same level which makes it very huge, ugly and confusing. If there were to be a way we could actually structure the menu that would go a long way I think.
    This should even be possible with the current Implementation by either adding a parent Parameter or by splitting on Backslashes to indicate a Structure.
    So
    Code:
    CREATE_MENU(CHANNEL, 0, "Foo", "foo.png");
    CREATE_MENU(CHANNEL, 1, "My Category", "cat1.png");
    CREATE_MENU(CHANNEL, 2, "My Category\\Do something", "do1.png");
    CREATE_MENU(CHANNEL, 3, "My Category\\Do nothing", "do2.png");
    CREATE_MENU(CHANNEL, 4, "Bar", "bar.png");
    // Shortened because too lazy to type all the long stuff ;)
    would display like this
    Code:
    My Plugin Menu Name
        Foo
        My Category
            Do something
            Do nothing
        Bar
    instead of
    Code:
    My Plugin Menu Name
        Foo
        Do something
        Do nothing
        Bar
    With the addition of above suggested Separators it would improve the look a lot

  5. #5
    Join Date
    September 2018
    Location
    Germany
    Posts
    15
    Quote Originally Posted by SilentStorm View Post
    Yet another Menu Related Issue / Request:

    Current System unfortunately doesn't allow to structure the Menu.

    I'd like to request being able to create SubMenus instead of being forced to have everything on the same level which makes it very huge, ugly and confusing. If there were to be a way we could actually structure the menu that would go a long way I think.
    This should even be possible with the current Implementation by either adding a parent Parameter or by splitting on Backslashes to indicate a Structure.
    So
    Code:
    CREATE_MENU(CHANNEL, 0, "Foo", "foo.png");
    CREATE_MENU(CHANNEL, 1, "My Category", "cat1.png");
    CREATE_MENU(CHANNEL, 2, "My Category\\Do something", "do1.png");
    CREATE_MENU(CHANNEL, 3, "My Category\\Do nothing", "do2.png");
    CREATE_MENU(CHANNEL, 4, "Bar", "bar.png");
    // Shortened because too lazy to type all the long stuff ;)
    would display like this
    Code:
    My Plugin Menu Name
        Foo
        My Category
            Do something
            Do nothing
        Bar
    instead of
    Code:
    My Plugin Menu Name
        Foo
        Do something
        Do nothing
        Bar
    With the addition of above suggested Separators it would improve the look a lot
    Has this been added so far or is there any reason against it?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [No Bug] Permission menus are gone
    By varela1george in forum Bug Reports [EN/DE]
    Replies: 7
    Last Post: June 1st, 2011, 04:01 AM
  2. [Suggestion] More Menus
    By Conreason in forum Suggestions and Feedback
    Replies: 6
    Last Post: February 1st, 2010, 09:20 PM
  3. Confusing context menus
    By Horst33 in forum macOS
    Replies: 0
    Last Post: December 26th, 2009, 11:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •