Menu

#511 [ScriptedWizard] Add button for global vars in "Generic select path" dialog

Undefined
open
Patch
2021-05-08
2017-05-24
bluehazzard
No

This patch adds a button to the generic select path frame in the wizard page, like in the edit path dialog

1 Attachments

Discussion

  • bluehazzard

    bluehazzard - 2017-05-27

    Can a admin pleas correct the title?

     
  • ollydbg

    ollydbg - 2017-05-27
    • summary: [ScriptedWizard] Add puton for global vars in "Generic select path" dialog --> [ScriptedWizard] Add button for global vars in "Generic select path" dialog
     
  • Teodor Petrov

    Teodor Petrov - 2017-05-27

    How can this patch be tested?

     
  • bluehazzard

    bluehazzard - 2017-05-28

    How can this patch be tested?

    Automatically? It can't, because it is some ui thing
    Manually: Use the wx project wizard. On the frame where it will ask you for the wx location, now there will be two buttons:
    1) browse directory
    2) browse global variables (this is the new button)

     
  • Teodor Petrov

    Teodor Petrov - 2017-05-28

    I'm interested in manual testing, so I can verify it does what is advertised.

     
  • Teodor Petrov

    Teodor Petrov - 2017-05-28

    My wx wizard doesn't ask for location? Any other way I can test this on linux?

     
  • Teodor Petrov

    Teodor Petrov - 2017-05-28

    Ok, testing the matlab wizard. But the patch doesn't make things less confusing. In fact it shows a dialog which allows you to choose a variable from a list/tree, but I am super confused what I am supposed to do with this dialog. I don't have the matlab variable set.

    Isn't it better to show the dialog that has all the subfields of the variable where the user can enter or edit them?

    Also it will be good if we can make the field red if the variable is not defined, so the user will know that something must be done with it. The same way it is done in the debugger settings where the path to the debugger executable is set.

     

    Last edit: Teodor Petrov 2017-05-28
  • bluehazzard

    bluehazzard - 2017-05-28

    My wx wizard doesn't ask for location? Any other way I can test this on linux?

    I forget, am using windows.. On linux it does not ask the path to wx...

    But the patch doesn't make things less confusing. In fact it shows a dialog which allows you to choose a variable from a list/tree, but I am super confused what I am supposed to do with this dialog. I don't have the matlab variable set.

    This is the same dialog as it is used for the search paths in the compiler options. So if you liked it there , why is it confusing here? You can open the global variable dialogue with the config button. I don't really like the button name, but it was chosen in the old ticket...

    Also it will be good if we can make the field red if the variable is not defined, so the user will know that something must be done with it. The same way it is done in the debugger settings where the path to the debugger executable is set.

    i don't think this is easy to implement. But if the variable is not defined, or valid, there should pop up a small window telling you that you have a wrong global variable, it even should open the global variable dialog where you can set the new variable....

    But this is not the purpose of this dialog. The purpose is if you have for example multiple wx Widgets global variables you can choose from a list. At the moment i always have to close the wizard, because i don't remember the correct name.

     
  • Teodor Petrov

    Teodor Petrov - 2017-05-28

    OK, the last statement makes it more clear what is the intent. So to make this feature more useful we need to do two things (in my opinion):
    1. if the variable is not in the list it should say so with a cbmessage/annoying dialog and then show the global variable dialog, so the user can enter it. If it can pre fill it then it will be even better
    2. if the variable is in the list it should be selected, so the user will have a clue that this is what is going to be selected, he/she can change it, but there is visual clue what is going on.

    Why do you think it is had to mark the control red?

     
  • Teodor Petrov

    Teodor Petrov - 2017-05-28

    Also it will be good if you can add tooltips to both buttons.

     
  • bluehazzard

    bluehazzard - 2017-05-31
    1. if the variable is not in the list it should say so with a cbmessage/annoying dialog and then show the global variable dialog, so the user can enter it. If it can pre fill it then it will be even better

    This is already implemented. If the variable does not exists and you finish the wizard, the global variables dialog will pop up and ask you to add the new variable.

    Just to make something clear: As far as i understand this wizard page is a generic input field for paths. At the moment the script has not the possibility to make any fancy checks on the path. So it is not easy to check if the current entered path is a correct path for this wizard (wx path for the wx-wizard or matlab path for the matlab-wizard, or a empty new path for documentation output). At the moment the script api does not provide a interface to set/get or read any global user variable.

    1. if the variable is in the list it should be selected, so the user will have a clue that this is what is going to be selected, he/she can change it, but there is visual clue what is going on.

    I do not understand this.

    Current situation:
    1) The script needs a path to something (library path, output path, some executable) So it asks with this dialog for a path
    2) The user enters a path, Here he has two possibilities:
    a) Enter a path with the help of the browse button
    b) Enter a user variable defined in the user variable dialog. Here he has absolutely no aid
    3) The script processes (validates) the input
    4) The script closes
    5) If the global user variable does not exists, codeblocks asks the user if he want to add a variable and warns also if the variable is not valid (only check for emptiness)

    With this patch:
    1) The script needs a path to something (library, output path, some executable) So it asks with this dialog for a path
    2) The user enters a path, Here he has two possibilities:
    a) Enter a path with the help of the browse button
    b) Enter a user variable defined in the user variable dialog. The user can use the new button to open a dialog and select a existing variable or add a new one
    3) The script processes the input
    4) The script closes (validates) the input
    5) If the global user variable does not exists, codeblocks asks the user if he want to add a variable and warns also if the variable is not valid (only check for emptiness)

    Why do you think it is had to mark the control red?

    As i mentioned above there is no logic implemented to validate the path. Only the wizard script can decide if the current path is valid.

    If you want the validation logic, we can open a new ticket and i can try to implement it. But i don't think this is in the scope of this ticket. This patch provides only some help by choosing the right name. This would improve the user experience a lot (from my opinion).

    Also it will be good if you can add tooltips to both buttons.

    good idea, i will try it

     
  • Teodor Petrov

    Teodor Petrov - 2017-05-31

    Too long post and so I cannot answer to all the topics...

    But I'll state my main concern;
    1. I start the wizard and hit next until I see the path control
    2. The path control already contains a variable, it is not empty, at least this is how the mathlab wizards is done, I guess the others are the same.
    3. I press the new button and this variable is not in the list
    4. What am I supposed to do?

    It is confusing for me, imagine how a novice or a user that doesn't know what global variable is in the context of C::B is. Global variables are already confusing and annoying, so it is better to try and improve them, not make them even more confusing.

    For validating: if the path is not a valid path on disk or contains invalid global variables - them make it red. Don't provide access to scripts to do the validation, at least for now. I doubt it is that hard a thing to do. But I guess this could be left for later when them main problem I have is addressed.

     
  • bluehazzard

    bluehazzard - 2020-03-07

    I struggle with this problem every time i create a new wxWidgets project, so lets bring this on...
    I have reread your concern, and if i understand you correctly, you do not like, that there is a pre-filled variable in the path dialog, that is not existend if you open the "select variable" dialog. (related https://sourceforge.net/p/codeblocks/tickets/923/ )
    So the easy solution would be to leave this control empty.
    The second solution would be ask the user for the new variable (by opening the global variables dialog) if he opens the "select variable" dialog when the current variable in the path text control is not existent

     
  • Teodor Petrov

    Teodor Petrov - 2020-03-07

    So the easy solution would be to leave this control empty.

    Why do you think this is a solution? This would cause even more confusion - the user would have no idea what to do. We need some way to automatically detect these things and the code should be part of the wizard script and not in the plugin, so every wizard should have control on the detection code.

    Also why don't you just use the main variable for your projects? Or make the variable name change with the selected version of wx (I think there were some controls for that)?

    This is how it looks for me when I press the button. I don't have even the slightest idea what to do.

     
  • Teodor Petrov

    Teodor Petrov - 2021-05-08
    • assigned_to: bluehazzard
     
  • Teodor Petrov

    Teodor Petrov - 2021-05-08

    @bluehazzard Do you plan to work on this? If not please close it.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.