Switch to unified view

a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.13 2006-12-07 07:07:35 dockes Exp $ (C) 2005 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.14 2006-12-14 13:53:43 dockes Exp $ (C) 2005 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
63
#include "guiutils.h"
63
#include "guiutils.h"
64
#include "reslist.h"
64
#include "reslist.h"
65
#include "transcode.h"
65
#include "transcode.h"
66
#include "refcntr.h"
66
#include "refcntr.h"
67
#include "ssearch_w.h"
67
#include "ssearch_w.h"
68
#include "execmd.h"
68
69
69
#include "rclmain_w.h"
70
#include "rclmain_w.h"
70
#include "moc_rclmain_w.cpp"
71
#include "moc_rclmain_w.cpp"
71
72
72
extern "C" int XFlush(void *);
73
extern "C" int XFlush(void *);
...
...
657
    QMessageBox::warning(0, "Recoll", 
658
    QMessageBox::warning(0, "Recoll", 
658
                 tr("No external viewer configured for mime type ")
659
                 tr("No external viewer configured for mime type ")
659
                 + doc.mimetype.c_str());
660
                 + doc.mimetype.c_str());
660
    return;
661
    return;
661
    }
662
    }
663
    list<string> lcmd;
664
    if (!stringToStrings(cmd, lcmd)) {
665
  QMessageBox::warning(0, "Recoll", 
666
               tr("Bad viewer command line for %1: [%2]\n"
667
              "Please check the mimeconf file")
668
               .arg(QString::fromAscii(doc.mimetype.c_str()))
669
               .arg(QString::fromLocal8Bit(cmd.c_str())));
670
  return;
671
    }
672
    string cmdpath;
673
    if (!ExecCmd::which(lcmd.front(), cmdpath)) {
674
  QString message = tr("The viewer specified in mimeconf for %1: %2"
675
               " is not found.\nDo you want to start the "
676
               " preferences dialog ?")
677
      .arg(QString::fromAscii(doc.mimetype.c_str()))
678
      .arg(QString::fromLocal8Bit(lcmd.front().c_str()));
679
680
  switch(QMessageBox::warning(0, "Recoll", message, 
681
                  "Yes", "No", 0, 0, 1)) {
682
  case 0: showUIPrefs();break;
683
  case 1:
684
      
685
      return;
686
  }
687
    }
662
688
663
    string fn = urltolocalpath(doc.url);
689
    string fn = urltolocalpath(doc.url);
664
    string url = url_encode(doc.url, 7);
690
    string url = url_encode(doc.url, 7);
665
    string ipath = doc.ipath;
691
    string ipath = doc.ipath;
666
    // Substitute %u (url) and %f (file name) inside prototype command
692
    // Substitute %u (url) and %f (file name) inside prototype command