Logo Search packages:      
Sourcecode: sailcut version File versions  Download package

void CFormMain::slotOpenRecent (  )  [protected, virtual, slot]

Opens a recently used sail definition.

Definition at line 598 of file formmain.cpp.

References fileAccess(), filename, makeMenuMru(), CPrefs::mruSaildef, prefs, CPrefsMru::removeEntry(), setSailDef(), and statusbar.

Referenced by makeMenuMru().

{
    // retrieve the index of the MRU entry
    QAction *a = qobject_cast<QAction *>(sender());
    if ( !a ) return;
    int index = a->data().toInt();

    filename = prefs->mruSaildef[index];
    try
    {
        setSailDef(CSailDefXmlReader("saildef").read(filename));
        fileAccess(tr("loaded '%1'").arg(filename), filename);
    }
    catch (CException e)
    {
        prefs->mruSaildef.removeEntry(filename);
        makeMenuMru();
        statusbar->showMessage( tr("error loading '%1'").arg(filename) );
    }
}


Generated by  Doxygen 1.6.0   Back to index