several_fixes_HEAD.diff

Redmine Admin, 2007-06-05 12:19 PM

Download (3.8 KB)

View differences:

src/app/qgisapp.cpp (working copy)
2729 2729
    {
2730 2730
      QMessageBox::critical(this, 
2731 2731
          tr("QGIS Project Read Error"), 
2732
          tr("") + "\n" + e.what() );
2732
          tr("") + "\n" + QString::fromLocal8Bit( e.what() ) );
2733 2733
      qDebug( "%s:%d %d bad layers found", __FILE__, __LINE__, static_cast<int>(e.layers().size()) );
2734 2734

  
2735 2735
      // attempt to find the new locations for missing layers
......
2740 2740
    {
2741 2741
      QMessageBox::critical(this, 
2742 2742
          tr("QGIS Project Read Error"), 
2743
          tr("") + "\n" + e.what() );
2743
          tr("") + "\n" + QString::fromLocal8Bit( e.what() ) );
2744 2744
      qDebug( "%s:%d BAD LAYERS FOUND", __FILE__, __LINE__ );
2745 2745
    }
2746 2746
  }
......
2793 2793

  
2794 2794
    if ( QMessageBox::Ok == QMessageBox::critical( this, 
2795 2795
          tr("QGIS Project Read Error"), 
2796
          tr("") + "\n" + e.what() + "\n" +
2796
          tr("") + "\n" + QString::fromLocal8Bit( e.what() ) + "\n" +
2797 2797
          tr("Try to find missing layers?"),
2798 2798
          QMessageBox::Ok | QMessageBox::Cancel ) )
2799 2799
    {
......
2810 2810
    qDebug( "%s:%d BAD LAYERS FOUND", __FILE__, __LINE__ );
2811 2811

  
2812 2812
    QMessageBox::critical( this, 
2813
        tr("Unable to open project"), QString::fromLocal8Bit(e.what()) );
2813
        tr("Unable to open project"), QString::fromLocal8Bit( e.what() ) );
2814 2814

  
2815 2815
    mMapCanvas->freeze(false);
2816 2816
    mMapCanvas->refresh();
......
2898 2898
  {
2899 2899
    QMessageBox::critical( this,
2900 2900
        tr("Unable to save project ") + QgsProject::instance()->filename(),
2901
        e.what() );
2901
        QString::fromLocal8Bit( e.what() ) );
2902 2902
  }
2903 2903
  return true;
2904 2904
} // QgisApp::fileSave
......
2949 2949
    fullPath.setFile( newFilePath );
2950 2950
  }
2951 2951

  
2952
  try
2953
  {
2954
    QgsProject::instance()->filename( fullPath.filePath() );
2952 2955

  
2953
  QgsProject::instance()->filename( fullPath.filePath() );
2954

  
2955
  if ( QgsProject::instance()->write() )
2956
  {
2957
    setTitleBarText_(*this); // update title bar
2958
    statusBar()->message(tr("Saved project to:") + " " + QgsProject::instance()->filename() );
2959
    // add this to the list of recently used project files
2960
    saveRecentProjectPath(fullPath.filePath(), settings);
2956
    if ( QgsProject::instance()->write() )
2957
    {
2958
      setTitleBarText_(*this); // update title bar
2959
      statusBar()->message(tr("Saved project to:") + " " + QgsProject::instance()->filename() );
2960
      // add this to the list of recently used project files
2961
      saveRecentProjectPath(fullPath.filePath(), settings);
2962
    }
2963
    else
2964
    {
2965
      QMessageBox::critical(this,
2966
          tr("Unable to save project"),
2967
          tr("Unable to save project to ") + QgsProject::instance()->filename() );
2968
    }
2961 2969
  }
2962
  else
2970
  catch ( std::exception & e )
2963 2971
  {
2964
    QMessageBox::critical(this,
2965
        tr("Unable to save project"),
2966
        tr("Unable to save project to ") + QgsProject::instance()->filename() );
2972
    QMessageBox::critical( 0x0,
2973
        tr("Unable to save project ") + QgsProject::instance()->filename(),
2974
        QString::fromLocal8Bit( e.what() ),
2975
        QMessageBox::Ok,
2976
        Qt::NoButton );
2967 2977
  }
2968 2978
} // QgisApp::fileSaveAs
2969 2979

  
src/core/qgsproject.cpp (working copy)
748 748
        imp_->file.close();     // even though we got an error, let's make
749 749
                                // sure it's closed anyway
750 750

  
751
        throw QgsIOException("Unable to open " + imp_->file.name());
751
        throw QgsIOException( QObject::tr("Unable to open ") + imp_->file.name());
752 752

  
753 753
        return false;           // XXX raise exception? Ok now superfluous
754 754
                                // XXX because of exception.