Forum Archive

File Type Not Changing

techteej

In this script, changing the file type in the file type dialog doesn't actually change it. Find the .pyui file here.

JonB

It is good practice to avoid global variables. This is one read on why--it can be hard to debug.
In this case, it seems like having file_type as a variable within your NotePadView would be cleaner, I.e self.file_type.

Now the specific problem is that, in python,you can read global variables without doing anything special, but to modify a global, you need to declare it as global. So, inside your type_action your first line would need to be

global file_type

techteej

This solves one problem, but apparently whatever is picked in the dialog prints as none instead of what was selected