Changeset 200 for trunk/src/MainPter.cxx
- Timestamp:
- 06/05/06 08:41:08 (2 years ago)
- Files:
-
- 1 modified
-
trunk/src/MainPter.cxx (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MainPter.cxx
r199 r200 123 123 view.sensitiveRotateRight (TRUE); 124 124 view.sensitiveRotateLeft (TRUE); 125 view.sensitiveSave (TRUE); 125 126 view.sensitiveZoomIn (TRUE); 126 127 view.sensitiveZoomOut (TRUE); … … 150 151 view.sensitiveRotateRight (FALSE); 151 152 view.sensitiveRotateLeft (FALSE); 153 view.sensitiveSave (FALSE); 152 154 view.sensitiveZoomIn (FALSE); 153 155 view.sensitiveZoomOut (FALSE); … … 199 201 view.sensitiveRotateRight (FALSE); 200 202 view.sensitiveRotateLeft (FALSE); 203 view.sensitiveSave (FALSE); 201 204 view.sensitiveZoomIn (FALSE); 202 205 view.sensitiveZoomOut (FALSE); … … 292 295 g_assert (NULL != m_Document && 293 296 "Tried to go to the last page of a NULL document."); 294 297 295 298 m_PagePter->setNextPageScroll (PAGE_SCROLL_START); 296 299 m_Document->goToLastPage (); … … 380 383 IMainView &view = getView (); 381 384 gchar *fileName = view.openFileDialog (lastFolder); 382 g_free (lastFolder); 385 g_free (lastFolder); 383 386 if ( NULL != fileName ) 384 387 { … … 389 392 setOpenState (fileName, FALSE); 390 393 m_Document->load (fileName, NULL); 394 g_free (fileName); 391 395 } 392 396 } … … 465 469 checkZoomSettings (); 466 470 } 471 472 /// 473 /// @brief The Save File action was activated. 474 /// 475 /// This means that the user wants to save a copy of the document. 476 /// The presenter asks the view to show the Save File dialog and return a 477 /// file name. 478 /// Then it will try to save the document and if there's any error it will 479 /// request the view to show an error dialog. 480 /// 481 void 482 MainPter::saveFileActivated () 483 { 484 Config &config = Config::getConfig (); 485 gchar *lastFolder = config.getSaveFileFolder (); 486 IMainView &view = getView (); 487 gchar *fileName = view.saveFileDialog (lastFolder); 488 g_free (lastFolder); 489 if ( NULL != fileName ) 490 { 491 492 // Show on the status bar that we are saving the copy. 493 gchar *statusText = g_strdup_printf (_("Saving document to %s..."), 494 fileName); 495 view.setStatusBarText (statusText); 496 g_free (statusText); 497 gchar *dirName = g_path_get_dirname (fileName); 498 config.setSaveFileFolder (dirName); 499 g_free (dirName); 500 // Save the document. 501 m_Document->save (fileName); 502 g_free (fileName); 503 } 504 } 505 467 506 468 507 /// … … 720 759 view.setGoToPageText (goToPageText); 721 760 g_free (goToPageText); 722 761 723 762 // Set the page navigation sensitivity. 724 763 gboolean documentLoaded = m_Document->isLoaded (); … … 761 800 } 762 801 802 void 803 MainPter::notifySave () 804 { 805 // Remove the status text. 806 getView ().setStatusBarText (NULL); 807 } 808 809 void 810 MainPter::notifySaveError (const GError *error) 811 { 812 getView ().showErrorMessage (_("Error Saving File"), error->message); 813 } 814 763 815 #if defined (DEBUG) 764 816 ///
