Diffstat (limited to 'noncore/net/ubrowser/mainview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/ubrowser/mainview.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/noncore/net/ubrowser/mainview.cpp b/noncore/net/ubrowser/mainview.cpp index d3f4c57..f68c5db 100644 --- a/noncore/net/ubrowser/mainview.cpp +++ b/noncore/net/ubrowser/mainview.cpp @@ -30,12 +30,13 @@ MainView::MainView(QWidget *parent, const char *name) : QMainWindow(parent, name home = new QToolButton(Resource::loadPixmap("ubrowser/home"), 0, 0, 0, 0, toolbar, "home"); location = new QComboBox(true, toolbar, "location"); go = new QToolButton(Resource::loadPixmap("ubrowser/go"), 0, 0, 0, 0, toolbar, "go"); toolbar->setStretchableWidget(location); toolbar->setHorizontalStretchable(true); + location->setAutoCompletion( true ); addToolBar(toolbar); browser = new QTextBrowser(this, "browser"); setCentralWidget(browser); @@ -58,18 +59,25 @@ MainView::MainView(QWidget *parent, const char *name) : QMainWindow(parent, name http = new HttpFactory(browser); if( qApp->argc() > 1 ) { char **argv = qApp->argv(); - QString *argv1 = new QString( argv[1] ); - if( !argv1->startsWith( "http://" ) && !argv1->startsWith( "/" ) ) + int i = 0; + QString *openfile = new QString( argv[0] ); + while( openfile->contains( "ubrowser" ) == 0 && i < qApp->argc() ) { - argv1->insert( 0, QDir::currentDirPath()+"/" ); + i++; + *openfile = argv[i]; } - location->setEditText( *argv1 ); + *openfile = argv[i+1]; + if( !openfile->startsWith( "http://" ) && !openfile->startsWith( "/" ) ) + { + openfile->insert( 0, QDir::currentDirPath()+"/" ); + } + location->setEditText( *openfile ); goClicked(); } } void MainView::goClicked() { @@ -100,6 +108,14 @@ void MainView::textChanged() { setCaption(browser->documentTitle() + " - uBrowser"); } location->setEditText(browser->source()); } + +void MainView::setDocument( const QString& applnk_filename ) +{ + DocLnk *file = new DocLnk( applnk_filename ); + + location->setEditText( file->file() ); + goClicked(); +} |