The next feature added is the ability to specify a program file to load on the command line. This is specifically to support integrating the application with the OS where files with a certain extension can be associated with the application.
The CommandLine class was modified to look for a single argument that does not begin with a "-" option character if none of the other expected options were found. This argument is stored into a new file name member variable, which has an access function to get its value. The usage help message was updated for the new argument.
The MainWindow constructor was modified to check if the file name from the CommandLine instance is not empty. If it is not empty, then the current program is set to this file name overriding any in the saved settings. If this program doesn't exist or there is an error loading the program, then the application starts up blank but with the current program name set to the file specified instead of being Untitled.
[commit c8f48aa9d5]
Tuesday, January 1, 2013
GUI – Save Current Program
Now, that the basic GUI elements are in place, some additional features will be added before beginning work in changing the edit box from a simple text editor into a program editor. The first feature to add is to have the application save the program file path name that was loaded the last time it was run. This involves saving the current program path as part of the saved settings.
When the settings are restored, the set current program helper function is called with the restored program name. The current program member variable can't be set directly because the window title does not get set and a warning message is issued by the Qt routines that there is no '[*]' placeholder in the window title when the program is loaded. When the program is loaded into the edit box, a document modified signal is sent to the set window modified slot, when then attempts to set the modified flag, but placeholder has not yet been set in the window title. The helper function takes care of this.
Once the edit box instance has been created, the constructor checks if the current program is not empty. It then checks if the program file still exists, otherwise the file was either deleted or moved since the last run, so the current program path is cleared. Also, if there is an error loading the program file, the current program path is cleared.
[commit dd489476cc]
When the settings are restored, the set current program helper function is called with the restored program name. The current program member variable can't be set directly because the window title does not get set and a warning message is issued by the Qt routines that there is no '[*]' placeholder in the window title when the program is loaded. When the program is loaded into the edit box, a document modified signal is sent to the set window modified slot, when then attempts to set the modified flag, but placeholder has not yet been set in the window title. The helper function takes care of this.
Once the edit box instance has been created, the constructor checks if the current program is not empty. It then checks if the program file still exists, otherwise the file was either deleted or moved since the last run, so the current program path is cleared. Also, if there is an error loading the program file, the current program path is cleared.
[commit dd489476cc]
Base GUI Complete
All the basic GUI elements have now been added, so this is a good place to tag the release, which was tagged with the name v0.3.0. The various files (license, read me, release notes, etc.) were updated for this development release.
It was also noticed the about box (nor the test output) contained the full GPL statement, only the copyright and warranty statements. The CommandLine class was updated to reflect this, but the test output was not changed so that the regression tests continue to pass. The About box was updated to contain the full GPL statement along with the required Oxygen icons license statement and web links.
The original release numbering is again being used. While Git did sort the tags as desired with the '-' developmental release before the '.' official release (so v0.2.0 will be listed after v0.2-6); GitHub (on the tags page) appears to only look at the numbers ignoring the separator characters, so v0.2.0 is sorted before v0.2-1 instead of after v0.2-6, which could be very confusing even though a fuzzy time of the release is listed, it's not obvious, and there is no way to sort by this time.
Since all 0.x releases are development releases, there is no reason to have development development releases. For now on, only the last one of the development release series will be uploaded to Sourceforge, whatever is release number is at that point. The source code of the others can be downloaded as archives from GitHub on the tags page. The release number for any patches needed for an official release will simply increment the last (patch) number and re-uploaded.
[commit 4f0378e72c]
It was also noticed the about box (nor the test output) contained the full GPL statement, only the copyright and warranty statements. The CommandLine class was updated to reflect this, but the test output was not changed so that the regression tests continue to pass. The About box was updated to contain the full GPL statement along with the required Oxygen icons license statement and web links.
The original release numbering is again being used. While Git did sort the tags as desired with the '-' developmental release before the '.' official release (so v0.2.0 will be listed after v0.2-6); GitHub (on the tags page) appears to only look at the numbers ignoring the separator characters, so v0.2.0 is sorted before v0.2-1 instead of after v0.2-6, which could be very confusing even though a fuzzy time of the release is listed, it's not obvious, and there is no way to sort by this time.
Since all 0.x releases are development releases, there is no reason to have development development releases. For now on, only the last one of the development release series will be uploaded to Sourceforge, whatever is release number is at that point. The source code of the others can be downloaded as archives from GitHub on the tags page. The release number for any patches needed for an official release will simply increment the last (patch) number and re-uploaded.
[commit 4f0378e72c]
Subscribe to:
Posts (Atom)