~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Gui/ViewProviderPythonFeature.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2010-01-11 08:48:33 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100111084833-4g9vgdqbkw8u34zb
Tags: 0.9.2646.5-1
* New upstream version (closes: #561696).
* Added swig to Build-Depends (closes: #563523, #563772).
* Removed python-opencv from Build-Depends and Recommends (closes: #560768).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de>              *
 
2
 *   Copyright (c) 2006 Werner Mayer <wmayer[at]users.sourceforge.net>     *
3
3
 *                                                                         *
4
4
 *   This file is part of the FreeCAD CAx development system.              *
5
5
 *                                                                         *
24
24
#include "PreCompiled.h"
25
25
 
26
26
#ifndef _PreComp_
27
 
# include <qpixmap.h>
 
27
# include <QPixmap>
28
28
#endif
29
29
 
30
30
#include "ViewProviderPythonFeature.h"
31
31
#include "ViewProviderPythonFeaturePy.h"
32
32
#include "Tree.h"
 
33
#include "BitmapFactory.h"
33
34
#include <Base/Console.h>
34
35
#include <Base/Reader.h>
35
36
#include <Base/Interpreter.h>
55
56
QIcon ViewProviderPythonFeature::getIcon() const
56
57
{
57
58
    // default icon
58
 
    static const char * Python_Feature_xpm[] = {
59
 
        "14 15 7 1",
60
 
        "# c #000000",
61
 
        "b c #0000ff",
62
 
        "d c #00ff00",
63
 
        "a c #808000",
64
 
        ". c None",
65
 
        "e c #ff0000",
66
 
        "c c #ffff00",
67
 
        "...###........",
68
 
        "..#aaa#.......",
69
 
        "..#b#ba##.....",
70
 
        ".##c#c#aa#....",
71
 
        "#aa#a#aaaa#...",
72
 
        "#aaaaaadaa#...",
73
 
        "#dddddd#aa#...",
74
 
        "##de#d##da#...",
75
 
        ".#ee###da#..##",
76
 
        ".#e##ddaa#.#a#",
77
 
        "..##ddaa#..#a#",
78
 
        "..#ddaa####aa#",
79
 
        "..#ddaa#aaaa#.",
80
 
        "..#ddaaaaaad#.",
81
 
        "...#ddddddd#.."};
82
 
    QPixmap px(Python_Feature_xpm);
 
59
    static QPixmap px = BitmapFactory().pixmap("Tree_Python");
83
60
 
84
61
    // Run the getDisplayModes method of the proxy object.
85
62
    Base::PyGILStateLocker lock;
100
77
                ary[j]=content[j];
101
78
            icon.loadFromData(ary, "XPM");
102
79
            if (!icon.isNull()) {
103
 
                px = icon;
 
80
                return icon;
104
81
            }
105
82
        }
106
83
    }
203
180
            Py::Tuple args(1);
204
181
            args.setItem(0, Py::String(ModeName));
205
182
            Py::String str(method.apply(args));
206
 
            setDisplayMaskMode(str.as_std_string().c_str());
 
183
            setDisplayMaskMode(str.as_std_string().c_str());
207
184
        }
208
185
        else
209
 
            setDisplayMaskMode(ModeName);
 
186
            setDisplayMaskMode(ModeName);
210
187
    }
211
188
    catch (Py::Exception&) {
212
189
        Base::PyException e; // extract the Python error text