[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    KHTMLPart with SSL website
From:       "Roger Wang" <fullertonmail () gmail ! com>
Date:       2006-07-25 7:25:41
Message-ID: f5014eff0607250025l7cfa04ccra6b86b4daacdaa8e () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,
     I am currently learning KHTMLPart for web browsing, but I got into some
problems.
When I tried to access SSL site (like https://www.gmail.com), I couldn't
submit any field data. The response was empty.
I wonder if there is any extra steps that I need to do. I tried to find a
solution via google without success. Hopefully someone
could help me out here :)

The following is the python code I did:

from kdeui import *
from khtml import *
from kdecore import *
from qt import *

class Form1(KMainWindow):
    def __init__(self):
        KMainWindow.__init__(self)

        self.lineEdit2 = QLineEdit(self,"lineEdit2")
        self.lineEdit2.setGeometry(QRect(0,0,601,31))
        self.vBox1 = QVBox(self,"vBox1")
        self.vBox1.setGeometry(QRect(0,30,601,631))
        self.vBox1 = QVBox(self,"vBox1")
        self.vBox1.setGeometry(QRect(0,30,601,631))
        self.kHTMLPart1 = KHTMLPart(self.vBox1,"kHTMLPart1")
        self.languageChange()
        self.resize(QSize(607,665).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)
        self.connect(self.lineEdit2,SIGNAL("returnPressed()"), self.newURL)
        self.connect(self.kHTMLPart1.browserExtension(),SIGNAL("openURLRequest(const
KURL&, const KParts::URLArgs&)"),self.openURLRequest)

    def languageChange(self):
        self.setCaption(self.__tr("Form1"))

    def newURL(self):
        e = self.lineEdit2.text().ascii()
        r = KURL(e)
        QMessageBox.information( self, "url", r.url())
        self.kHTMLPart1.openURL(r)

    def openURLRequest(self,url,arg):
        QMessageBox.information( self, "url", url.url(), arg.contentType() )
        self.kHTMLPart1.openURL(KURL(url))

    def __tr(self,s,c = None):
        return qApp.translate("Form1",s,c)


Thanks for taking a look, any comment will be appreciated :)

Roger

[Attachment #5 (text/html)]

Hello,<br>&nbsp;&nbsp;&nbsp;&nbsp; I am currently learning KHTMLPart for web \
browsing, but I got into some problems.<br>When I tried to access SSL site (like <a \
href="https://www.gmail.com">https://www.gmail.com</a>), I couldn't submit any field \
data. The response was empty. <br>I wonder if there is any extra steps that I need to \
do. I tried to find a solution via google without success. Hopefully someone \
<br>could help me out here :)<br><br>The following is the python code I \
did:<br><br>from kdeui import * <br>from khtml import *<br>from kdecore import \
*<br>from qt import *<br><br>class Form1(KMainWindow):<br>&nbsp;&nbsp;&nbsp; def \
__init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
KMainWindow.__init__(self)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.lineEdit2 = QLineEdit(self,&quot;lineEdit2&quot;) \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.lineEdit2.setGeometry(QRect(0,0,601,31))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.vBox1 = QVBox(self,&quot;vBox1&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.vBox1.setGeometry(QRect(0,30,601,631))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.vBox1 = QVBox(self,&quot;vBox1&quot;)<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.vBox1.setGeometry(QRect(0,30,601,631))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.kHTMLPart1 = KHTMLPart(self.vBox1,&quot;kHTMLPart1&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.languageChange()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.resize(QSize(607,665).expandedTo(self.minimumSizeHint \
()))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.clearWState(Qt.WState_Polished)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.connect(self.lineEdit2,SIGNAL(&quot;returnPressed()&quot;), \
self.newURL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.connect(self.kHTMLPart1.browserExtension(),SIGNAL(&quot;openURLRequest(const \
KURL&amp;, const KParts::URLArgs&amp;)&quot;), \
self.openURLRequest)<br><br>&nbsp;&nbsp;&nbsp; def \
languageChange(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.setCaption(self.__tr(&quot;Form1&quot;))<br><br>&nbsp;&nbsp;&nbsp; def \
newURL(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e = \
self.lineEdit2.text().ascii()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = \
KURL(e)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  QMessageBox.information( self, \
&quot;url&quot;, r.url())<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.kHTMLPart1.openURL(r)<br><br>&nbsp;&nbsp;&nbsp; def \
openURLRequest(self,url,arg):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
QMessageBox.information( self, &quot;url&quot;, url.url(), arg.contentType () \
)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
self.kHTMLPart1.openURL(KURL(url))<br><br>&nbsp;&nbsp;&nbsp; def __tr(self,s,c = \
None):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return \
qApp.translate(&quot;Form1&quot;,s,c)<br><br><br>Thanks for taking a look, any \
comment will be appreciated :)<br><br> Roger<br>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic