~ubuntu-branches/ubuntu/trusty/kvirc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/modules/objects/KvsObject_window.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch
  • Date: 2011-02-23 13:19:39 UTC
  • mfrom: (14.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110223131939-fmb8l4arvgul8hy0
The "Cunning Advisor" release.

* Synced to upstream's SVN revision 5507.
* debian/kvirc-data.preinst: Removed. Upgrades from stable won't need it.
* debian/watch: Replace the "latest" part with "([\d\.]+)" to make us
  independent of the upstream symlink.
* debian/README.Debian:
  - Removed obsolete parts about Python and upgrades from 3.4.
  - Added notice about handling default script issues.
* debian/README.source: Updated for 4.1.1.
* debian/{compat,control,rules}: Updates for debhelper 8.
* debian/patches/10_fix_desktop_entry.patch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "KviError.h"
29
29
#include "kvi_debug.h"
30
30
 
 
31
#include "KviIconManager.h"
31
32
#include "KviLocale.h"
32
33
#include "KviMainWindow.h"
33
34
 
37
38
: KviWindow(KviWindow::ScriptObject,pParent,szName)
38
39
{
39
40
        m_pCentralWidget = 0;
 
41
        m_pIcon = 0;
40
42
 
41
43
}
42
44
 
69
71
}
70
72
 
71
73
 
72
 
 
 
74
QPixmap * KviKvsScriptWindowWindow::myIconPtr()
 
75
{
 
76
        if (m_pIcon) return m_pIcon;
 
77
        else return g_pIconManager->getSmallIcon(KviIconManager::DefaultIcon);
 
78
}
73
79
 
74
80
/*
75
81
        @doc:   window
97
103
 
98
104
KVSO_BEGIN_REGISTERCLASS(KvsObject_window,"window","widget")
99
105
        KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setWindowTitle)
 
106
        KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setIcon)
100
107
        KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setCentralWidget)
101
108
KVSO_END_REGISTERCLASS(KvsObject_window)
102
109
 
106
113
 
107
114
 
108
115
KVSO_BEGIN_DESTRUCTOR(KvsObject_window)
109
 
 
 
116
        if(widget())
 
117
                g_pMainWindow->closeWindow(((KviKvsScriptWindowWindow *)widget()));
110
118
KVSO_END_CONSTRUCTOR(KvsObject_window)
111
119
 
112
120
bool KvsObject_window::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *)
113
121
{
114
 
        KviWindow * w = new KviKvsScriptWindowWindow(pContext->window()->frame(),getName());
 
122
        KviKvsScriptWindowWindow * w = new KviKvsScriptWindowWindow(pContext->window()->frame(),getName());
115
123
        setObject(w);
116
124
        pContext->window()->frame()->addWindow(w,false);
117
125
        w->minimize(); // must be minimized before children are added, otherwise the focus handling goes nuts...
128
136
        ((KviKvsScriptWindowWindow *)widget())->setWindowTitleString(szCaption);
129
137
        return true;
130
138
}
 
139
 
 
140
KVSO_CLASS_FUNCTION(window,setIcon)
 
141
{
 
142
        CHECK_INTERNAL_POINTER(widget())
 
143
        QString szIcon;
 
144
        KVSO_PARAMETERS_BEGIN(c)
 
145
                KVSO_PARAMETER("icon",KVS_PT_STRING,0,szIcon)
 
146
        KVSO_PARAMETERS_END(c)
 
147
        QPixmap * pix = g_pIconManager->getImage(szIcon);
 
148
        if(pix) ((KviKvsScriptWindowWindow *)widget())->setIcon(pix);
 
149
        return true;
 
150
}
 
151
 
131
152
KVSO_CLASS_FUNCTION(window,setCentralWidget)
132
153
{
133
154
        CHECK_INTERNAL_POINTER(widget())