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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch, Kai Wasserbäch, Raúl Sánchez Siles
  • Date: 2011-02-12 10:40:21 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110212104021-5mh4f75jlku20mnt
The combined "Twisted Experiment" and "Nocturnal Raid" release.

[ Kai Wasserbäch ]
* Synced to upstream's SVN revision 5467.
* debian/rules:
  - Added .PHONY line.
  - Resurrect -DMANUAL_REVISION, got lost somewhere and we build SVN
    revisions again.
  - Replace "-DWITH_NO_EMBEDDED_CODE=YES" with "-DWANT_CRYPTOPP=YES".
  - Change the remaining -DWITH/-DWITHOUT to the new -DWANT syntax.
* debian/control:
  - Removed DMUA, I'm a DD now.
  - Changed my e-mail address.
  - Removed unneeded relationships (no upgrades over two releases are
    supported).
  - Fix Suggests for kvirc-dbg.
  - kvirc-data: Make the "Suggests: kvirc" a Recommends, doesn't make much
    sense to install the -data package without the program.
* debian/source/local-options: Added with "unapply-patches".
* debian/kvirc.lintian-overrides: Updated to work for 4.1.1.
* debian/patches/21_make_shared-mime-info_B-D_superfluous.patch: Updated.
* debian/kvirc-data.install: Added .notifyrc.

[ Raúl Sánchez Siles ]
* Stating the right version where kvirc-data break and replace should happen.
* Fixing link to license file.
* Added French and Portuguese man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=============================================================================
 
2
//
 
3
//   File : KvsObject_mainWindow.cpp
 
4
//   Creation date : Mon Feb 28 14:21:48 CEST 2005
 
5
//   by Tonino Imbesi(Grifisx) and Alessandro Carbone(Noldor)
 
6
//
 
7
//   This file is part of the KVIrc irc client distribution
 
8
//   Copyright (C) 2005-2008 Alessandro Carbone (elfonol at gmail dot com)
 
9
//
 
10
//   This program is FREE software. You can redistribute it and/or
 
11
//   modify it under the terms of the GNU General Public License
 
12
//   as published by the Free Software Foundation; either version 2
 
13
//   of the License, or (at your opinion) any later version.
 
14
//
 
15
//   This program is distributed in the HOPE that it will be USEFUL,
 
16
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
18
//   See the GNU General Public License for more details.
 
19
//
 
20
//   You should have received a copy of the GNU General Public License
 
21
//   along with this program. If not, write to the Free Software Foundation,
 
22
//   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
23
//
 
24
//=============================================================================
 
25
 
 
26
#include "KviTalMainWindow.h"
 
27
#include "KvsObject_mainWindow.h"
 
28
#include "KviError.h"
 
29
#include "kvi_debug.h"
 
30
#include "KviLocale.h"
 
31
#include "KviIconManager.h"
 
32
 
 
33
 
 
34
/*
 
35
        @doc:   mainwindow
 
36
        @keyterms:
 
37
                mainwindow object class,
 
38
        @title:
 
39
                mainwindow class
 
40
        @type:
 
41
                class
 
42
        @short:
 
43
                Provides a mainwindow.
 
44
        @inherits:
 
45
                [class]object[/class]
 
46
                [class]widget[/class]
 
47
        @description:
 
48
                The mainwindow class provides a main application window, with menubar, toolbars.
 
49
        @functions:
 
50
                !fn: $setCentralWidget(<widget:object>)
 
51
                Sets the central widget for the main window to <wid>.
 
52
*/
 
53
 
 
54
KVSO_BEGIN_REGISTERCLASS(KvsObject_mainWindow,"mainwindow","widget")
 
55
        KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_mainWindow,setCentralWidget)
 
56
 
 
57
KVSO_END_REGISTERCLASS(KvsObject_mainWindow)
 
58
 
 
59
KVSO_BEGIN_CONSTRUCTOR(KvsObject_mainWindow,KvsObject_widget)
 
60
 
 
61
KVSO_END_CONSTRUCTOR(KvsObject_mainWindow)
 
62
 
 
63
 
 
64
KVSO_BEGIN_DESTRUCTOR(KvsObject_mainWindow)
 
65
 
 
66
KVSO_END_CONSTRUCTOR(KvsObject_mainWindow)
 
67
 
 
68
bool KvsObject_mainWindow::init(KviKvsRunTimeContext *,KviKvsVariantList *)
 
69
{
 
70
        setObject(new KviTalMainWindow(parentScriptWidget(), getName().toUtf8().data()), true);
 
71
        return true;
 
72
}
 
73
 
 
74
KVSO_CLASS_FUNCTION(mainWindow,setCentralWidget)
 
75
{
 
76
        CHECK_INTERNAL_POINTER(widget())
 
77
        KviKvsObject * pObject;
 
78
        kvs_hobject_t hObject;
 
79
        KVSO_PARAMETERS_BEGIN(c)
 
80
                KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject)
 
81
        KVSO_PARAMETERS_END(c)
 
82
        pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
 
83
        if (!pObject)
 
84
        {
 
85
                c->warning(__tr2qs_ctx("Widget parameter is not an object","objects"));
 
86
                return true;
 
87
        }
 
88
        if (!pObject->object())
 
89
        {
 
90
                c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects"));
 
91
                return true;
 
92
        }
 
93
        if(!pObject->inheritsClass("widget"))
 
94
    {
 
95
                c->warning(__tr2qs_ctx("Widget object required","objects"));
 
96
        return TRUE;
 
97
    }
 
98
        ((KviTalMainWindow *)widget())->setCentralWidget(((QWidget  *)(pObject->object())));
 
99
        return true;
 
100
}
 
101