...in that I can add a link and have it show up in the connected QTableView. We're moving forward. Must remember to add the link subtype field to ImtLink, though.
Began fleshing out the ImtLinkSet class, after some trouble deciding whether to base it off QAbstractTableModel or QStandardItemModel, and whether to keep the links in a QMap or QHash (chose the former in both cases). It compiles, but doesn't have enough functionality for testing yet.
I'm still unsure about QMap; it may be that a simple QList with some lookup functions would be way better in the end.
After some experimentation, I realized my link setup was far too complicated, so I've thrown it away and started again, based on what I've learned from my home project. I've now rewritten ImtLink, and all links will be handled by a single ImtLinkSet class which will descend from QAbstractTableModel (not yet started). The end result should be much simpler, and easier to plug into the GUI.
One thing I've learned from my home project GVT is that your core data model really should descend from an QT abstract model, and not anything else, so I've started converting the top-level link-handling class, ImtLinkGrpSet, to a descendant of QAbstractTableModel. This involves re-implementing inherited functions from ImtElement, and implementing the core virtual functions from the table model. It's about half done, with one outstanding difficulty.
Interview with MT to complete a questionnaire from which she'll build a wireframe model. This was useful, and helped me to clarify a couple of ideas I haven't been sure about. I'm going to detail them here while they're fresh in my mind:
- All main windows will be dockable.
- The three main windows will be:
- The Images window, looking much like our previous mockup.
- The Links window, which will provide an accessible list of all the links made so far, organized by category.
- The document browser, which will provide access by filterable xml:id to the ids already in the document, and also by means of a tree model of the document body.
- Other windows will be modal dialogs:
- The category manager (or should this tie into the links manager?).
- The XML editor (pops up from the document browser when you elect to edit an element).
- The Preferences window.
- The Output options window (could this simply be integrated into Preferences?).
- Still haven't decided how to handle translations -- presumably the easiest mechanism would be QT's built-in translation tools, but this might require separate compilation for each language -- check this out.
- One issue which came up was accessibility: is it going to be possible to allow users to define zones using only the keyboard? It's conceivable, but it might be really difficult to design and code.
A couple of bugfixes and enhancements have been made to the Image Markup Tool, resulting in the release of version 1.8.1.9. These are the changes:
- A Hungarian interface translation was contributed by Kóta Péter.
- Pressing the Delete key when an annotation zone was selected on the image didn't do anything; now it triggers a "Delete annotation(s)" action.
- When clicking in the Annotation Title field, if the default text is still there as a guide, it should be removed automatically. However, this wasn't happening when an alternative language interface was loaded. That bug is now fixed.
The new version is available from the IMT website.
Did some work on the old IMT to create a new release, adding a feature for MB:
- You can now press Control + G or Control + Shift + G in the Annotation Text box, and get a dialog to select one or more images; for each image you select, you'll get a TEI
<graphic>
tag pointing to it, either just by file name or by relative path. - I've added a popup menu to the main image control and to the annotation list, allowing the three regular annotation actions.
- I've hooked up Edit / Delete so that it can also (offer to) delete a selected annotation.
The latter two fix some annoyances that have been bugging me for a while. Also updated the documentation date, and sent the package out to MB for testing.
Started adding some doxygen documentation to the code for the XML editor. This is a way of getting back into the project after a few weeks break.
Created a logo image (which may change, of course), and an About box class based on QDialog which retrieves application title and version information from the auto-generated version.h file, and displays it.
This is now working well, and seems to be pretty solid; I've tested it in the context of the application itself, and it returns the right values. It can also compare another version number to determine whether it's older, newer or identical. I'm still not exactly clear on how I'll integrate this with compilation on other platforms. I've added version.sh to SVN, and the other platforms could just check out and use it (turning off the pre-compilation step that generates it); however, if version.sh is in SVN, we have the slight paradox that every compile will result in a new commit, because version.sh will be renewed each time and will therefore end up being committed. Maybe that's not a bad thing, actually; that has the effect of incrementing the SVN revision number for every build that's done, making the SVN revision work similarly to a build number. I've modified the script a bit so that it does a commit first, to update any other changed files; then it builds version.h; then it commits the rebuilt version.h right at the end. That means the committed version.h will always be one version behind the actual SVN version, but that's no bad thing unless we end up editing code on the other platforms, which I'm hoping will not happen.
#!/bin/bash #Major version number (unlikely to change). major=2 #Minor version number is changeable, but done manually. minor=0 #Build number is yyyymmdd from today. date=$(date +%Y%m%d) dateDashed=$(date +%Y-%m-%d) dateSeconds=$(date +%s) #This is the file we're dealing with. outfile="version.h" #Do an SVN update, then commit to update the revision number. svn update svn commit --message "Committing any changed files before generating version.h for an application build." #Empty the file. echo "">$outfile #Get the SVN revision number into a variable, and parse out the last version number. svnrev=`svnversion | sed -e 's/.*://' -e 's/[A-Z]*$//'` #echo the info into the output file. #echo $svnrev>>$outfile #echo $major"."$minor"."$build"."$svnrev>>$outfile echo "//This is an auto-generated file, created at build time as part of a Custom Build Step.">>$outfile echo "//Do not edit this file directly. It is generated from the bash script appversion.sh.">>$outfile echo "#ifndef VERSION_H">>$outfile echo "#define VERSION_H">>$outfile echo "">>$outfile echo "">>$outfile echo "#include <QString>">>$outfile echo "#include <QStringList>">>$outfile echo "">>$outfile echo "namespace Version">>$outfile echo "{">>$outfile echo "const int MAJOR = "$major";">>$outfile echo "const int MINOR = "$minor";">>$outfile echo "const int DATE = "$date";">>$outfile echo "const int REVISION = "$svnrev";">>$outfile echo "inline const char* strVersion(){return "$'\042'$major"."$minor"."$date"."$svnrev$'\042'";}">>$outfile echo "inline const char* strVersionMajor(){return "$'\042'$major$'\042'";}">>$outfile echo "inline const char* strVersionMinor(){return "$'\042'$minor$'\042'";}">>$outfile echo "inline const char* strVersionDate(){return "$'\042'$dateDashed$'\042'";}">>$outfile echo "inline const char* strVersionRevision(){return "$'\042'$svnrev$'\042'";}">>$outfile echo "inline int intVersionMajor(){return $major;}">>$outfile echo "inline int intVersionMinor(){return $minor;}">>$outfile echo "inline int intVersionDate(){return $dateSeconds;}">>$outfile echo "inline int intVersionRevision(){return $svnrev;}">>$outfile echo "inline int versionComparedWithThis(QString &candidateVersion){">>$outfile echo "//This returns -1 if the candidate version is older, 0 if it's the same, and 1 if it's newer.">>$outfile echo -e "\t bool ok;">>$outfile echo -e "\t QStringList verList = candidateVersion.split("$'\042'"."$'\042'");">>$outfile echo -e "\t if (verList.count() < 1) return -1;">>$outfile echo -e "\t int candMajor = verList.at(0).toInt(&ok, 10);">>$outfile echo -e "\t if (candMajor < "$major") return -1;">>$outfile echo -e "\t if (candMajor > "$major") return 1;">>$outfile echo -e "\t if (verList.count() < 2) return -1;">>$outfile echo -e "\t int candMinor = verList.at(1).toInt(&ok, 10);">>$outfile echo -e "\t if (candMinor < "$minor") return -1;">>$outfile echo -e "\t if (candMinor > "$minor") return 1;">>$outfile echo -e "\t if (verList.count() < 3) return -1;">>$outfile echo -e "\t int candDate = verList.at(2).toInt(&ok, 10);">>$outfile echo -e "\t if (candDate < "$date") return -1;">>$outfile echo -e "\t if (candDate > "$date") return 1;">>$outfile echo -e "\t if (verList.count() < 4) return -1;">>$outfile echo -e "\t int candRevision = verList.at(3).toInt(&ok, 10);">>$outfile echo -e "\t if (candRevision < "$svnrev") return -1;">>$outfile echo -e "\t if (candRevision > "$svnrev") return 1;">>$outfile echo -e "\t return 0;">>$outfile echo -e "\t">>$outfile echo -e "\t">>$outfile echo -e "\t">>$outfile echo "}">>$outfile echo "">>$outfile echo "}">>$outfile echo "">>$outfile echo "">>$outfile echo "#endif // VERSION_H">>$outfile svn commit --message "Committing modified version.h before an application build."