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
Added Recent File Menu #209
base: staging
Are you sure you want to change the base?
Conversation
OpenMotor now tracks recently opened files and lets you easily return to them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small things. I'll pull this branch and try it out soon.
|
||
def addRecentFile(self, filepath): | ||
recentFilepaths = [] | ||
too_long = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be unused
def __init__(self, filepath, manager): | ||
super().__init__() | ||
self.manager = manager | ||
tail , self.name = os.path.split(filepath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: extra space
@@ -24,6 +25,10 @@ def __init__(self, app): | |||
self.fileName = None | |||
|
|||
self.newFile() | |||
|
|||
self.recentlyOpenedFiles = [] | |||
self.recentFiles = getConfigPath() + 'recentfiles.txt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a pretty minor difference here, but I'd prefer the use of a yaml file with the same fileIO setup I used for preferences. That is consistent with the rest of the application and gets us things like migrations if we ever need them. You should just be able to stick a list in one of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing: concatenating file paths like that isn't always good practice because different operating systems might have different schemes for it. The safest way is with os.path.join
. I know I used the +
for this in the application myself, but I have learned since then!
OpenMotor now tracks recently opened files and lets you easily return to them.