~ubuntu-branches/ubuntu/vivid/regina-normal/vivid

« back to all changes in this revision

Viewing changes to qtui/src/foreign/reginahandler.cpp

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2013-11-02 11:44:32 UTC
  • mfrom: (1.2.8)
  • Revision ID: package-import@ubuntu.com-20131102114432-acgci6b1pb2hjl8q
Tags: 4.95-1
* New upstream release.
* The python module is now installed in a standard location beneath
  /usr/lib/python2.7/dist-packages.
* Switched python packaging from python-support to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include "file/nxmlfile.h"
36
36
 
37
37
#include "reginahandler.h"
 
38
#include "reginamain.h"
38
39
#include "reginasupport.h"
39
40
#include "../packetfilter.h"
40
41
 
42
43
#include <QTextDocument>
43
44
 
44
45
regina::NPacket* ReginaHandler::importData(const QString& fileName,
45
 
        QWidget* parentWidget) const {
 
46
        ReginaMain* parentWidget) const {
46
47
    regina::NPacket* ans = regina::readFileMagic(
47
48
        static_cast<const char*>(QFile::encodeName(fileName)));
48
49
    if (! ans)
51
52
            QObject::tr("<qt>Please check that the file <tt>%1</tt> "
52
53
            "is readable and in Regina format.</qt>").
53
54
                arg(Qt::escape(fileName)));
 
55
    if (ans->getPacketLabel().empty())
 
56
        ans->setPacketLabel("Imported data");
54
57
    return ans;
55
58
}
56
59
 
65
68
            QObject::tr("I cannot export this packet subtree on its own."), 
66
69
            QObject::tr("<qt>This is because the root packet <i>%1</i> "
67
70
            "must stay connected to its parent.</qt>").
68
 
            arg(Qt::escape(data->getPacketLabel().c_str())));
 
71
            arg(Qt::escape(data->getHumanLabel().c_str())));
69
72
        return false;
70
73
    }
71
74
    if (! regina::writeXMLFile(QFile::encodeName(fileName), data, compressed)) {