Changeset 65 for trunk/src/MainPter.cxx
- Timestamp:
- 04/14/06 16:24:42 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/MainPter.cxx (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MainPter.cxx
r64 r65 245 245 IMainView &view = getView (); 246 246 gchar *fileName = view.openFileDialog (); 247 openDocument (fileName, TRUE);247 openDocument (fileName, NULL, TRUE); 248 248 g_free (fileName); 249 249 } … … 263 263 gdouble currentZoom = m_Document->getZoom (); 264 264 // Reopen the document. 265 openDocument (m_Document->getFileName (), FALSE); 265 openDocument (m_Document->getFileName (), m_Document->getPassword (), 266 FALSE); 266 267 // And restore the state 267 268 m_Document->setZoom (currentZoom); … … 359 360 /// NULL then that means the user didn't wanted to 360 361 /// open a file, so this function won't do anything. 362 /// @param oldPassword This is only used when reloading. It is the last 363 /// password that was used to open a file, and will be 364 /// used to open the file the first try before asking 365 /// to the user. For opening a new file, just set to NULL. 361 366 /// @param canShowPage Set to TRUE if the application should show the page 362 367 /// after the loading or not. This is useful when reloading … … 365 370 /// 366 371 void 367 MainPter::openDocument (const gchar *fileName, gboolean canShowPage) 372 MainPter::openDocument (const gchar *fileName, const gchar *oldPassword, 373 gboolean canShowPage) 368 374 { 369 375 // if fileName is NULL, then the user cancelled the operation. … … 372 378 if ( NULL != fileName ) 373 379 { 374 GError *error = NULL; 375 if ( m_Document->loadFile (fileName, NULL, &error) )380 GError *error = NULL; 381 if ( m_Document->loadFile (fileName, oldPassword, &error) ) 376 382 { 377 383 // Now that the document has been loaded, just reset the initial … … 380 386 } 381 387 else 382 { 388 { 383 389 // We got an error, but also can be that the file is encrypted. 384 390 if ( DocumentErrorEncrypted == error->code )
