Commit 29103b14 authored by Christian Loose's avatar Christian Loose

Added method openURL() to CervisiaShell. Use this method to

open the sandbox which was provided on the command line.
TODO: remove restorePseudo()

svn path=/trunk/kdesdk/cervisia/; revision=200453
parent 450701b5
......@@ -2,6 +2,9 @@
* Changed main window size handling. The window size is now
handled by KMainWindow.
* Added method openURL() to CervisiaShell. Use this method to
open the sandbox which was provided on the command line.
TODO: remove restorePseudo()
2003-01-11 Christian Loose <christian.loose@hamburg.de>
......
......@@ -137,6 +137,13 @@ void CervisiaShell::setupActions()
action->setWhatsThis( hint );
}
void CervisiaShell::openURL(const KURL& url)
{
part->openURL(url);
}
void CervisiaShell::slotConfigureKeys()
{
KKeyDialog::configureKeys( actionCollection(), xmlFile() );
......
/*
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@mail.berlios.de
* Copyright (c) 2002-2003 Christian Loose <christian.loose@hamburg.de>
*
* This program may be distributed under the terms of the Q Public
* License as defined by Trolltech AS of Norway and appearing in the
......@@ -36,6 +37,7 @@ public:
void restorePseudo(const QString &dirname);
public slots:
void openURL(const KURL& url);
void slotConfigureKeys();
void slotConfigureToolBars();
......
......@@ -17,6 +17,7 @@
#include <kcmdlineargs.h>
#include <kconfig.h>
#include <klocale.h>
#include <kurl.h>
#include "misc.h"
#include "cervisiashell.h"
......@@ -62,15 +63,20 @@ int main(int argc, char **argv)
if ( app.isRestored() ) {
RESTORE(CervisiaShell);
} else {
QString dirname = QString(KCmdLineArgs::parsedArgs()->count()?
KCmdLineArgs::parsedArgs()->arg(0) : "");
CervisiaShell* shell = new CervisiaShell();
CervisiaShell *t = new CervisiaShell();
t->restorePseudo(dirname);
t->setIcon(app.icon());
app.setMainWidget(t);
t->show();
QString dirname; // TODO: remove later
shell->restorePseudo(dirname); // - dito -
const KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
QString dirName = args->count() ? args->arg(0) : QString::null;
if( !dirName.isEmpty() )
shell->openURL(KURL::fromPathOrURL(dirName));
shell->setIcon(app.icon());
app.setMainWidget(shell);
shell->show();
}
int res = app.exec();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment