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

« back to all changes in this revision

Viewing changes to src/kvirc/ui/KviScriptEditor.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 : KviScriptEditor.cpp
 
4
//   Creation date : Sun Mar 28 1999 16:12:41 CEST by Szymon Stefanek
 
5
//
 
6
//   This file is part of the KVIrc irc client distribution
 
7
//   Copyright (C) 1999-2010 Szymon Stefanek (pragma at kvirc dot net)
 
8
//
 
9
//   This program is FREE software. You can redistribute it and/or
 
10
//   modify it under the terms of the GNU General Public License
 
11
//   as published by the Free Software Foundation; either version 2
 
12
//   of the License, or (at your opinion) any later version.
 
13
//
 
14
//   This program is distributed in the HOPE that it will be USEFUL,
 
15
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
17
//   See the GNU General Public License for more details.
 
18
//
 
19
//   You should have received a copy of the GNU General Public License
 
20
//   along with this program. If not, write to the Free Software Foundation,
 
21
//   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
22
//
 
23
//=============================================================================
 
24
 
 
25
#define _KVI_SCRIPTEDITOR_CPP_
 
26
#define _KVI_DEBUG_CHECK_RANGE_
 
27
 
 
28
#include "kvi_debug.h"
 
29
#include "KviScriptEditor.h"
 
30
#include "KviModuleManager.h"
 
31
 
 
32
 
 
33
KviScriptEditor::KviScriptEditor(QWidget * par)
 
34
: QWidget(par)
 
35
{
 
36
}
 
37
 
 
38
KviScriptEditor::~KviScriptEditor()
 
39
{
 
40
}
 
41
 
 
42
void KviScriptEditor::setText(const char * txt)
 
43
{
 
44
        setText(QByteArray(txt));
 
45
}
 
46
 
 
47
void KviScriptEditor::setText(const QByteArray &)
 
48
{
 
49
}
 
50
 
 
51
void KviScriptEditor::setText(const QString &txt)
 
52
{
 
53
        setText(QByteArray(txt.toUtf8()));
 
54
}
 
55
 
 
56
void KviScriptEditor::setFindText(const QString &)
 
57
{
 
58
}
 
59
void KviScriptEditor::setInfoText(const QString &)
 
60
{
 
61
}
 
62
 
 
63
void KviScriptEditor::setFindLineeditReadOnly(bool)
 
64
{
 
65
}
 
66
void KviScriptEditor::setReadOnly(bool)
 
67
{
 
68
}
 
69
void KviScriptEditor::setUnHighlightedText(const QString &)
 
70
{
 
71
}
 
72
void KviScriptEditor::getText(QByteArray &)
 
73
{
 
74
}
 
75
 
 
76
void KviScriptEditor::setCursorPosition(int)
 
77
{
 
78
}
 
79
 
 
80
bool KviScriptEditor::isModified()
 
81
{
 
82
        return false;
 
83
}
 
84
 
 
85
int KviScriptEditor::getCursor()
 
86
{
 
87
        return 0;
 
88
}
 
89
void KviScriptEditor::getText(QString &txt)
 
90
{
 
91
        QByteArray tmp;
 
92
        getText(tmp);
 
93
        txt = QString::fromUtf8(tmp.data());
 
94
}
 
95
 
 
96
KviScriptEditor * KviScriptEditor::getDummyEditor(QWidget * par)
 
97
{
 
98
        return new KviScriptEditor(par);
 
99
}
 
100
 
 
101
 
 
102
static KviScriptEditor * (*editorModuleCreateScriptEditor)(QWidget *);
 
103
static void (*editorModuleDestroyScriptEditor)(KviScriptEditor *);
 
104
 
 
105
KviScriptEditor * KviScriptEditor::createInstance(QWidget * par)
 
106
{
 
107
        KviModule * m = g_pModuleManager->getModule("editor");
 
108
        // If the module can't be loaded...return a dummy widget
 
109
        // FIXME: #warning "Maybe provide some sort of basic default editable widget ?"
 
110
        if(!m)return KviScriptEditor::getDummyEditor(par); // dummy implementation
 
111
 
 
112
 
 
113
        editorModuleCreateScriptEditor = (KviScriptEditor * (*)(QWidget *)) m->getSymbol("editor_module_createScriptEditor");
 
114
 
 
115
        if(!editorModuleCreateScriptEditor)return KviScriptEditor::getDummyEditor(par);
 
116
 
 
117
        return editorModuleCreateScriptEditor(par);
 
118
}
 
119
 
 
120
void KviScriptEditor::destroyInstance(KviScriptEditor * e)
 
121
{
 
122
        KviModule * m = g_pModuleManager->getModule("editor");
 
123
        if(!m)
 
124
        {
 
125
                delete e;
 
126
                return;
 
127
        }
 
128
 
 
129
        editorModuleDestroyScriptEditor = (void (*)(KviScriptEditor *)) m->getSymbol("editor_module_destroyScriptEditor");
 
130
 
 
131
        if(!editorModuleDestroyScriptEditor)
 
132
        {
 
133
                delete e;
 
134
                return;
 
135
        }
 
136
 
 
137
        editorModuleDestroyScriptEditor(e);
 
138
}
 
139
 
 
140
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
 
141
#include "KviScriptEditor.moc"
 
142
#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES