several_fixes_08branch.diff

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

Download (4.21 KB)

View differences:

src/gui/qgsproject.cpp (working copy)
1016 1016
        imp_->file.close();     // even though we got an error, let's make
1017 1017
                                // sure it's closed anyway
1018 1018

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

  
1021 1021
        return false;           // XXX raise exception? Ok now superfluous
1022 1022
                                // XXX because of exception.
......
1137 1137
        // doesn't *have* layers -- nor a GUI for that matter -- we'll just
1138 1138
        // leave in the whining and boldly stomp on.
1139 1139

  
1140
         throw QgsException("Cannot get extents from " + imp_->file.name());
1140
         throw QgsException( QObject::tr("Cannot get extents from ") + imp_->file.name());
1141 1141

  
1142 1142
         // return false;
1143 1143
    }
src/gui/qgisapp.cpp (working copy)
2674 2674
    {
2675 2675
      QMessageBox::critical(this, 
2676 2676
          tr("QGIS Project Read Error"), 
2677
          tr("") + "\n" + e.what() );
2677
          tr("") + "\n" + QString::fromLocal8Bit( e.what() ) );
2678 2678
      qDebug( "%s:%d %d bad layers found", __FILE__, __LINE__, e.layers().size() );
2679 2679

  
2680 2680
      // attempt to find the new locations for missing layers
......
2685 2685
    {
2686 2686
      QMessageBox::critical(this, 
2687 2687
          tr("QGIS Project Read Error"), 
2688
          tr("") + "\n" + e.what() );
2688
          tr("") + "\n" + QString::fromLocal8Bit( e.what() ) );
2689 2689
      qDebug( "%s:%d BAD LAYERS FOUND", __FILE__, __LINE__ );
2690 2690
    }
2691 2691
  }
......
2756 2756

  
2757 2757
    if ( QMessageBox::Yes == QMessageBox::critical( this, 
2758 2758
          tr("QGIS Project Read Error"), 
2759
          tr("") + "\n" + e.what() + "\n" +
2759
          tr("") + "\n" + QString::fromLocal8Bit( e.what() ) + "\n" +
2760 2760
          tr("Try to find missing layers?"),
2761 2761
          QMessageBox::Yes | QMessageBox::Default, 
2762 2762
          QMessageBox::No  | QMessageBox::Escape ) )
......
2774 2774
    qDebug( "%s:%d BAD LAYERS FOUND", __FILE__, __LINE__ );
2775 2775

  
2776 2776
    QMessageBox::critical( 0x0, 
2777
        tr("Unable to open project"), QString::fromLocal8Bit(e.what()), QMessageBox::Ok, 
2777
        tr("Unable to open project"), QString::fromLocal8Bit( e.what() ), QMessageBox::Ok, 
2778 2778
        Qt::NoButton );
2779 2779

  
2780 2780
    mMapCanvas->freeze(false);
......
2869 2869
  {
2870 2870
    QMessageBox::critical( 0x0,
2871 2871
        tr("Unable to save project ") + QgsProject::instance()->filename(),
2872
        e.what(),
2872
        QString::fromLocal8Bit( e.what() ),
2873 2873
        QMessageBox::Ok,
2874 2874
        Qt::NoButton );
2875 2875

  
......
2926 2926
    fullPath.setFile( newFilePath );
2927 2927
  }
2928 2928

  
2929
  try
2930
  {
2931
    QgsProject::instance()->filename( fullPath.filePath() );
2929 2932

  
2930
  QgsProject::instance()->filename( fullPath.filePath() );
2931

  
2932
  if ( QgsProject::instance()->write() )
2933
  {
2934
    setTitleBarText_(*this); // update title bar
2935
    statusBar()->message(tr("Saved project to:") + " " + QgsProject::instance()->filename() );
2936
    // add this to the list of recently used project files
2937
    saveRecentProjectPath(fullPath.filePath(), settings);
2933
    if ( QgsProject::instance()->write() )
2934
    {
2935
      setTitleBarText_(*this); // update title bar
2936
      statusBar()->message(tr("Saved project to:") + " " + QgsProject::instance()->filename() );
2937
      // add this to the list of recently used project files
2938
      saveRecentProjectPath(fullPath.filePath(), settings);
2939
    }
2940
    else
2941
    {
2942
      QMessageBox::critical(this,
2943
          tr("Unable to save project"),
2944
          tr("Unable to save project to ") + QgsProject::instance()->filename() );
2945
    }
2938 2946
  }
2939
  else
2947
  catch ( std::exception & e )
2940 2948
  {
2941
    QMessageBox::critical(this,
2942
        tr("Unable to save project"),
2943
        tr("Unable to save project to ") + QgsProject::instance()->filename() );
2949
    QMessageBox::critical( 0x0,
2950
        tr("Unable to save project ") + QgsProject::instance()->filename(),
2951
        QString::fromLocal8Bit( e.what() ),
2952
        QMessageBox::Ok,
2953
        Qt::NoButton );
2944 2954
  }
2945 2955
} // QgisApp::fileSaveAs
2946 2956