You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.4 KiB
66 lines
1.4 KiB
11 years ago
|
import org.trinitydesktop.qt.*;
|
||
|
import org.trinitydesktop.koala.*;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Class KSimpleBrowser is the main application window.
|
||
|
*
|
||
|
* Taken from KDE 2.0 Development book
|
||
|
*
|
||
|
* Rendering HTML Files
|
||
|
*
|
||
|
* A Simple Web Browser - A feature-limited Web Browser.
|
||
|
*
|
||
12 years ago
|
* @see TDEMainWindow
|
||
12 years ago
|
* @see TDEApplication
|
||
12 years ago
|
* @see TDEHTMLPart
|
||
15 years ago
|
*
|
||
|
* @author java translation Kenneth J. Pouncey, kjpou@hotmail.com
|
||
|
* @version 0.1
|
||
|
*/
|
||
|
|
||
12 years ago
|
public class KSimpleBrowser extends TDEMainWindow {
|
||
15 years ago
|
|
||
|
|
||
|
static final int URLLined = 1;
|
||
|
|
||
12 years ago
|
TDEHTMLPart tdehtmlpart;
|
||
15 years ago
|
|
||
|
public KSimpleBrowser (String name) {
|
||
|
|
||
|
super(null,name,0);
|
||
|
|
||
|
toolBar().insertLined( "", URLLined, SIGNAL("returnPressed()"),
|
||
|
this, SLOT ("slotNewURL()"));
|
||
|
|
||
|
|
||
|
toolBar().setItemAutoSized(URLLined);
|
||
|
|
||
12 years ago
|
tdehtmlpart = new TDEHTMLPart(this);
|
||
12 years ago
|
tdehtmlpart.begin();
|
||
15 years ago
|
|
||
12 years ago
|
tdehtmlpart.write("<HTML><BODY><H1>KSimpleBrowser</H1>" +
|
||
15 years ago
|
"<P>To load a web page, type its URL in the line " +
|
||
|
"edit box and press enter,</P>" +
|
||
|
"</BODY></HTML>");
|
||
|
|
||
12 years ago
|
tdehtmlpart.end();
|
||
15 years ago
|
|
||
|
setCaption("KDE 2 Development book example - KSimpleBrowser");
|
||
|
|
||
12 years ago
|
setCentralWidget(tdehtmlpart.view());
|
||
15 years ago
|
|
||
|
}
|
||
|
|
||
|
public void slotNewURL () {
|
||
|
|
||
12 years ago
|
tdehtmlpart.openURL(new KURL(this.toolBar().getLinedText(URLLined))) ;
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
static {
|
||
|
qtjava.initialize();
|
||
11 years ago
|
tdejava.initialize();
|
||
15 years ago
|
}
|
||
|
|
||
|
}
|