aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects
diff options
context:
space:
mode:
authorGravatar Noldor2010-04-23 10:40:01 +0000
committerGravatar Noldor2010-04-23 10:40:01 +0000
commit7c7a6dbec4d85bba8d9ba8a987cc9e0f4d03198c (patch)
tree1d11cb98f65b7df43db02c11f54ac48d8cd11087 /src/modules/objects
parentAdded doc to http kvs class (diff)
downloadKVIrc-7c7a6dbec4d85bba8d9ba8a987cc9e0f4d03198c.tar.gz
KVIrc-7c7a6dbec4d85bba8d9ba8a987cc9e0f4d03198c.tar.bz2
KVIrc-7c7a6dbec4d85bba8d9ba8a987cc9e0f4d03198c.zip
Removed obsolete code
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4286 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects')
-rw-r--r--src/modules/objects/class_lineedit.cpp6
-rw-r--r--src/modules/objects/class_mainwindow.cpp33
-rw-r--r--src/modules/objects/class_mainwindow.h3
-rw-r--r--src/modules/objects/class_multilineedit.cpp1
-rw-r--r--src/modules/objects/class_painter.cpp7
-rw-r--r--src/modules/objects/class_socket.cpp79
-rw-r--r--src/modules/objects/class_socket.h3
-rw-r--r--src/modules/objects/class_toolbutton.cpp4
-rw-r--r--src/modules/objects/class_widget.cpp36
9 files changed, 30 insertions, 142 deletions
diff --git a/src/modules/objects/class_lineedit.cpp b/src/modules/objects/class_lineedit.cpp
index 153bd23f4..eed0be67a 100644
--- a/src/modules/objects/class_lineedit.cpp
+++ b/src/modules/objects/class_lineedit.cpp
@@ -245,7 +245,7 @@ bool KviKvsObject_lineedit::init(KviKvsRunTimeContext *,KviKvsVariantList *)
SET_OBJECT(QLineEdit)
connect(widget(),SIGNAL(returnPressed()),this,SLOT(slotreturnPressed()));
- connect(widget(),SIGNAL(lostFocus()),this,SLOT(slotlostFocus()));
+ connect(widget(),SIGNAL(editFinished()),this,SLOT(slotlostFocus()));
connect(widget(),SIGNAL(textChanged(const QString & )),this,SLOT(slottextChanged(const QString & )));
return true;
}
@@ -509,7 +509,7 @@ void KviKvsObject_lineedit::slotreturnPressed()
callFunction(this,"returnPressedEvent",params);
}
-// FIND ME
+
KVSO_CLASS_FUNCTION(lineedit,lostFocusEvent)
{
emitSignal("lostFocus",c);
@@ -521,7 +521,7 @@ void KviKvsObject_lineedit::slotlostFocus()
KviKvsVariantList * params = 0;
callFunction(this,"lostFocusEvent",params);
}
-/////
+
KVSO_CLASS_FUNCTION(lineedit,textChangedEvent)
{
emitSignal("textChanged",c,c->params());
diff --git a/src/modules/objects/class_mainwindow.cpp b/src/modules/objects/class_mainwindow.cpp
index 7e47723f6..a61d55667 100644
--- a/src/modules/objects/class_mainwindow.cpp
+++ b/src/modules/objects/class_mainwindow.cpp
@@ -53,8 +53,6 @@
KVSO_BEGIN_REGISTERCLASS(KviKvsObject_mainwindow,"mainwindow","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_mainwindow,setCentralWidget)
- KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_mainwindow,setDockEnabled)
- KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_mainwindow,isDockEnabled)
KVSO_END_REGISTERCLASS(KviKvsObject_mainwindow)
@@ -100,35 +98,4 @@ KVSO_CLASS_FUNCTION(mainwindow,setCentralWidget)
((KviTalMainWindow *)widget())->setCentralWidget(((QWidget *)(pObject->object())));
return true;
}
-//FIX ME
-KVSO_CLASS_FUNCTION(mainwindow,setDockEnabled)
-{
- CHECK_INTERNAL_POINTER(widget())
- QString szDockarea;
- bool bFlag;
- KVSO_PARAMETERS_BEGIN(c)
- KVSO_PARAMETER("dock area",KVS_PT_STRING,0,szDockarea)
- KVSO_PARAMETER("bool enabled",KVS_PT_BOOL,0,bFlag)
- KVSO_PARAMETERS_END(c)
-/* if(widget())
- {
-
- }
-*/
- return true;
-}
-
-//FIX ME
-KVSO_CLASS_FUNCTION(mainwindow,isDockEnabled)
-{
- CHECK_INTERNAL_POINTER(widget())
- QString szDockarea;
- bool bFlag = false;
- KVSO_PARAMETERS_BEGIN(c)
- KVSO_PARAMETER("dock_area",KVS_PT_STRING,0,szDockarea)
- KVSO_PARAMETERS_END(c)
- c->returnValue()->setBoolean(bFlag);
- return true;
-
-}
diff --git a/src/modules/objects/class_mainwindow.h b/src/modules/objects/class_mainwindow.h
index c59118fad..939b4f0e8 100644
--- a/src/modules/objects/class_mainwindow.h
+++ b/src/modules/objects/class_mainwindow.h
@@ -39,9 +39,6 @@ protected:
virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams);
bool setCentralWidget(KviKvsObjectFunctionCall *c);
- bool setDockEnabled(KviKvsObjectFunctionCall *c);
- bool isDockEnabled(KviKvsObjectFunctionCall *c);
-
};
diff --git a/src/modules/objects/class_multilineedit.cpp b/src/modules/objects/class_multilineedit.cpp
index 425b120ce..01ffd1c6b 100644
--- a/src/modules/objects/class_multilineedit.cpp
+++ b/src/modules/objects/class_multilineedit.cpp
@@ -537,7 +537,6 @@ bool KviKvsObject_textedit::functionisUndoRedoEnabled(KviKvsObjectFunctionCall *
//-->Text & Color & Family
-// Findme
bool KviKvsObject_textedit::functionsetText(KviKvsObjectFunctionCall * c)
{
QString szText;
diff --git a/src/modules/objects/class_painter.cpp b/src/modules/objects/class_painter.cpp
index 76adab385..73746321f 100644
--- a/src/modules/objects/class_painter.cpp
+++ b/src/modules/objects/class_painter.cpp
@@ -141,6 +141,9 @@ const char * const brushstyles_tbl[] = {
!fn: $begin(<paint_device:object>)
Begins painting the paint device <paint_device>: the parameter MUST be a widget or a pixmap.[br]
Warning: A paint device can only be painted by one painter at a time.
+ !fn: $beginPdf(<file_name:string>)
+ Begins painting on a file using the pdf format.
+ At present the pdf support is in experimental state.
!fn: $end()
Ends painting. Any resources used while painting are released.
!fn: $setPen(<rgb or hsv array value or [<red>,<green>,<blue>][<hue>,<saturation>,<value>],[system color:RGB or HSV)
@@ -508,7 +511,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_painter,"painter","object")
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_painter,end)
// extra
- KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_painter,beginPdf)// FIXME: needs doc!
+ KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_painter,beginPdf)
KVSO_END_REGISTERCLASS(KviKvsObject_painter)
@@ -1140,7 +1143,7 @@ KVSO_CLASS_FUNCTION(painter,beginPdf)
KVSO_PARAMETERS_END(c)
if (m_pPrinter) delete m_pPrinter;
m_pPrinter=new QPrinter();//QPrinter::HighResolution);
- m_pPrinter->setOutputFormat(QPrinter::PdfFormat);
+ m_pPrinter->setOutputFormat(QPrinter::PdfFormat);
m_pPrinter->setOutputFileName(szFileName);
m_pPainter->begin(m_pPrinter);
return true;
diff --git a/src/modules/objects/class_socket.cpp b/src/modules/objects/class_socket.cpp
index 63dcf0b62..0bca34b72 100644
--- a/src/modules/objects/class_socket.cpp
+++ b/src/modules/objects/class_socket.cpp
@@ -155,11 +155,6 @@
By default this function can deal ascii data only: NULL characters are transformed to
ASCII characters 255. You can pass a [class]memorybuffer[/class] object to read binary data.
- !fn: $readHex(<length>)
- Reads at most <length> bytes of data from the socket. If <length> is anything "outside" the
- available data range (<length> < 0 or <length> > available_data_length), this function
- returns all the available data.[br]
- Returns the data encoded as hexadecimal digit string: this function can deal with binary data too.
!fn: $write(<data, files or hobject>[,length])
Writes <data> to the socket.[br]
@@ -170,17 +165,6 @@
If you're going to [cmd]delete[/cmd] this object just after the $write call, you should
call [classfnc:socket]$close[/classfnc]() just before [cmd]delete[/cmd] to ensure the data delivery.
- !fn: $writeHex(<hex_data>)
- Writes <data> to the socket.[br]
- <data> is expected to be a hexadecimal rappresentation of the bytes to be sent (two HEX characters
- for each byte). This means that the length of <hex_data> string must be a multiple of 2.[br]
- Returns the length of the actually decoded and sent data in bytes or -1 in case of error (the string
- was not a valid hexadecimla rappresentation).[br]
- Please note that when this function finishes it does not mean that the data has reached the remote end.[br]
- Basically it does not even mean that the data has been sent to the remote host.[br]
- The data is enqueued for sending and will be sent as soon as possible.[br]
- If you're going to [cmd]delete[/cmd] this object just after the $writeHex call, you should
- call [classfnc:socket]$close[/classfnc]() just before [cmd]delete[/cmd] to ensure the data delivery.
!fn: $close()
Resets this socket state: kills any pending or active connection. After a close() call
@@ -292,9 +276,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_socket,"socket","object")
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,setConnectTimeout)
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,close)
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,read)
- KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,readHex)
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,write)
- KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,writeHex)
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,setProtocol)
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,listen)
KVSO_REGISTER_HANDLER_BY_NAME(KviKvsObject_socket,accept)
@@ -461,29 +443,6 @@ KVSO_CLASS_FUNCTION(socket,read)
return true;
}
-// FIXME: obsolete?
-KVSO_CLASS_FUNCTION(socket,readHex)
-{
- unsigned int uLen = readGetLength(c);
- char * str = new char[(uLen*2) + 1];
- int index=0;
- unsigned char byte,msb,lsb=0;
- for (unsigned int i=0;i<uLen;i++)
- {
- byte=(unsigned char)m_pInBuffer[i];
- lsb=byte & 0x0f;
- msb=byte>>4;
- msb>9?msb+='7':msb+='0';
- lsb>9?lsb+='7':lsb+='0';
- str[index++]=msb;
- str[index++]=lsb;
- }
- str[index]='\0';
- c->returnValue()->setString(str);
- eatInData(uLen);
- delete str;
- return true;
-}
KVSO_CLASS_FUNCTION(socket,write)
{
@@ -604,44 +563,6 @@ KVSO_CLASS_FUNCTION(socket,setProtocol)
return false;
}
-// FIXME: obsolete?
-KVSO_CLASS_FUNCTION(socket,writeHex)
-{
- QString m_szHex;
- KVSO_PARAMETERS_BEGIN(c)
- KVSO_PARAMETER("hex_string",KVS_PT_STRING,0,m_szHex)
- KVSO_PARAMETERS_END(c)
- if (m_szHex.length()%2)
- {
- c->warning(__tr2qs_ctx("The hex string length is not a multiple of 2","objects"));
- return true;
- }
- unsigned char byte,lsb,msb;
- char * buff = new char[(m_szHex.length()/2) + 1];
- int index=0;
- m_szHex.toUpper();
- for(int i=0;i<m_szHex.length();i+=2)
- {
- msb=m_szHex.at(i).toAscii();
- lsb=m_szHex.at(i+1).toAscii();
- if (((msb>='A' && msb<='F')||(msb>='0' && msb<='9')) && ((lsb>='A' && lsb<='F')|| (lsb>='0' && lsb<='9')))
- {
- msb>='A'?msb-='7':msb-='0';
- lsb>='A'?lsb-='7':lsb-='0';
- }
- else{
- c->warning(__tr2qs_ctx("The hex string is not correct!","objects"));
- return true;
- }
- byte=(msb*16)+lsb;
- buff[index++]=byte;
- }
- m_pOutBuffer->append((const unsigned char *)buff,m_szHex.length()/2);
- delayedFlush(0);
- c->returnValue()->setInteger(index);
- delete buff;
- return true;
-}
KVSO_CLASS_FUNCTION(socket,functionConnect)
diff --git a/src/modules/objects/class_socket.h b/src/modules/objects/class_socket.h
index b05e7c40b..191ce4699 100644
--- a/src/modules/objects/class_socket.h
+++ b/src/modules/objects/class_socket.h
@@ -82,9 +82,8 @@ protected:
bool close(KviKvsObjectFunctionCall *c);
bool read(KviKvsObjectFunctionCall *c);
- bool readHex(KviKvsObjectFunctionCall *c);
bool write(KviKvsObjectFunctionCall *c);
- bool writeHex(KviKvsObjectFunctionCall *c);
+
bool setProtocol(KviKvsObjectFunctionCall *c);
diff --git a/src/modules/objects/class_toolbutton.cpp b/src/modules/objects/class_toolbutton.cpp
index 127669eca..5c890ba63 100644
--- a/src/modules/objects/class_toolbutton.cpp
+++ b/src/modules/objects/class_toolbutton.cpp
@@ -70,8 +70,8 @@
Toggles the state of the tool button.
!fn:$setOn(<bEnabled:boolean>)
Sets whether the tool button is on to the bool value: 1 enable, 0 disable.
- // findme
- !fn:$setPopup (<toolbutton:object>)
+ !fn:$setPopup (<popupmenu:object>)
+ Associates the given <popupmenu> with this tool button.
!fn:$openPopup()
Opens the associated popup menu. If there is no such menu, this function does nothing.
!fn:setTextPosition(<text_position:string>)
diff --git a/src/modules/objects/class_widget.cpp b/src/modules/objects/class_widget.cpp
index 70197314b..5713e7025 100644
--- a/src/modules/objects/class_widget.cpp
+++ b/src/modules/objects/class_widget.cpp
@@ -87,20 +87,6 @@ QSize KviKvsWidget::sizeHint() const
}
-// FIXME: WFLAGS
-const char * const widgettypes_tbl[] = {
- "TopLevel",
- "Dialog",
- "Popup",
- "Desktop",
- "Title",
- "StaysOnTop",
- "SysMenu",
- "Minimize",
- "Maximize",
- "Subwindow",
- "FramelessWindow"
-};
const Qt::WidgetAttribute widgetattributes_cod[] = {
Qt::WA_OpaquePaintEvent,
@@ -165,13 +151,29 @@ const Qt::WindowType widgettypes_cod[] = {
Qt::FramelessWindowHint
};
+
+const char * const widgettypes_tbl[] = {
+ "Window",
+ "Dialog",
+ "Popup",
+ "Desktop",
+ "Title",
+ "StaysOnTop",
+ "SysMenu",
+ "Minimize",
+ "Maximize",
+ "Subwindow",
+ "FramelessWindow"
+};
+
+
+#define widgettypes_num (sizeof(widgettypes_tbl) / sizeof(widgettypes_tbl[0]))
+
+
#define QT_WIDGET_TABFOCUS Qt::TabFocus
#define QT_WIDGET_CLICKFOCUS Qt::ClickFocus
#define QT_WIDGET_STRONGFOCUS Qt::StrongFocus
#define QT_WIDGET_NOFOCUS Qt::NoFocus
-
-#define widgettypes_num (sizeof(widgettypes_tbl) / sizeof(widgettypes_tbl[0]))
-
/*
@doc: widget
@keyterms: