Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 2800)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 2805)
@@ -190,4 +190,5 @@
     filemenu->AddEntry("Save As status.&root", kFileSaveAsRoot);
     filemenu->AddSeparator();
+    filemenu->AddEntry("&Open...",             kFileOpen);
     filemenu->AddEntry("Save &As...",          kFileSaveAs);
     filemenu->AddSeparator();
@@ -1088,4 +1089,8 @@
         return kTRUE;
 
+    case kFileOpen:
+        Open();
+        return kTRUE;
+
     case kFileSaveAs:
         SaveAs();
@@ -1725,5 +1730,28 @@
 {
     const TString newstr("%%DocumentPaperSizes: a4\n%%Orientation: Landscape\n");
-    const Int_t   l = newstr.Length();
+
+    ifstream fin(name);
+    ofstream fout(name+".$$$");
+
+    char c;
+
+    TString str;
+    fin >> str >> c;                // Read "%!PS-Adobe-2.0\n"
+    fout << str << endl << newstr;
+
+    // Doing it in blocks seems not to gain much for small (MB) files
+    while (fin)
+    {
+        fin.read(&c, 1);
+        fout.write(&c, 1);
+    }
+
+    gSystem->Unlink(name);
+    gSystem->Rename(name+".$$$", name);
+/*
+    //
+    // Old style algorithm. Shifts blocks inside a single file --- SLOW!
+    //
+    const Int_t l = newstr.Length();
 
     Long_t t[4]; // { id, size, flags, modtime }
@@ -1768,4 +1796,5 @@
     delete c[1];
     delete c[0];
+*/
 }
 
@@ -2155,5 +2184,4 @@
     {
         "PostScript",   "*.ps",
-        // "Encapsulated PostScript", "*.eps",
         "Gif files",    "*.gif",
         "Macro files",  "*.C",
@@ -2186,4 +2214,50 @@
     Warning("MStatusDisplay::SaveAs", "Unknown Extension: %s", fi.fFilename);
     return 0;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Open contents of a MStatusDisplay with key name from file fname.
+//
+Int_t MStatusDisplay::Open(TString fname, const char *name)
+{
+    TFile file(fname, "READ");
+    if (file.IsZombie())
+    {
+        gLog << warn << "WARNING - Cannot open file " << fname << endl;
+        return 0;
+    }
+
+    return Read(name);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Opens an open dialog
+//
+Int_t MStatusDisplay::Open()
+{
+    static const char *gOpenTypes[] =
+    {
+        "ROOT files", "*.root",
+        "All files",  "*",
+        NULL,           NULL
+    };
+
+    static TString dir(".");
+
+    TGFileInfo fi; // fFileName and fIniDir deleted in ~TGFileInfo
+
+    fi.fFileTypes = (const char**)gOpenTypes;
+    fi.fIniDir    = StrDup(dir);
+
+    new TGFileDialog(fClient->GetRoot(), this, kFDSave, &fi);
+
+    if (!fi.fFilename)
+        return 0;
+
+    dir = fi.fIniDir;
+
+    return Open(fi.fFilename);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 2800)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 2805)
@@ -39,5 +39,5 @@
     typedef enum {
         // kFile
-        kFileBrowser, kFileCanvas, kFileSave, kFileSaveAs, kFileSaveAsPS,
+        kFileBrowser, kFileCanvas, kFileOpen, kFileSave, kFileSaveAs, kFileSaveAsPS,
         kFileSaveAsRoot, kFileSaveAsGIF, kFileSaveAsC, kFilePrint,
         kFilePrinterName, kFileClose, kFileExit, kFileReset,
@@ -183,4 +183,6 @@
 
      Int_t  SaveAs(Int_t num=-1);
+     Int_t  Open(TString fname, const char *name="MStatusDisplay");
+     Int_t  Open();
 
      Status_t CheckStatus() const { return fStatus; }
