Changeset 26 for trunk/src/MainPter.cxx

Show
Ignore:
Timestamp:
04/11/06 11:40:45 (3 years ago)
Author:
jordi
Message:

When an error loading the document happens, the view shows to the user an error message.

Also, updated POTFILES.in with the correct document sources and the MainPter? sources.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/MainPter.cxx

    r25 r26  
    147147    if ( NULL != fileName ) 
    148148    { 
    149         GError *error; 
     149        GError *error = NULL; 
    150150        if ( m_Document->loadFile (fileName, NULL, &error) ) 
    151151        { 
     
    154154            setInitialState (); 
    155155            g_free (fileName); 
     156        } 
     157        else 
     158        { 
     159            // We got an error, but also can be that the file is encrypted. 
     160            if ( DocumentErrorEncrypted == error->code ) 
     161            { 
     162                // TODO 
     163            } 
     164            else 
     165            { 
     166                // It was an error. Show the error message. 
     167                getView ().showErrorMessage (_("Error Loading File"),  
     168                                             error->message);                 
     169 
     170            } 
     171            g_free (error); 
    156172        } 
    157173    }