Commit 3595ecae authored by Fredrik Edemar's avatar Fredrik Edemar

Add the new function KmPlot::fileOpen(const KURL &url) which is accessible via DCOP.

svn path=/trunk/kdeedu/kmplot/; revision=360491
parent 43020386
......@@ -350,7 +350,6 @@ bool MainDlg::openFile()
{
m_recentFiles->removeURL(m_url ); //remove the file from the recent-opened-file-list
m_url = "";
kdDebug() << "Hit2?" << endl;
return false;
}
m_currentfile = m_url;
......
......@@ -256,6 +256,22 @@ void KmPlot::fileOpen()
}
}
void KmPlot::fileOpen(const KURL &url)
{
if ( !url.isEmpty())
{
// About this function, the style guide (
// http://developer.kde.org/documentation/standards/kde/style/basics/index.html )
// says that it should open a new window if the document is _not_
// in its initial state. This is what we do here..
if ( m_part->url().isEmpty() && !isModified() )
load( KStandardDirs::realFilePath(url.url()) ); // we open the file in this window...
else
openFileInNewWindow(url); // we open the file in a new window...
}
}
void KmPlot::openFileInNewWindow(const KURL url)
{
KApplication::startServiceByDesktopName("kmplot",url.url());
......
......@@ -85,6 +85,7 @@ protected:
private slots:
void fileNew();
void fileOpen();
void fileOpen(const KURL &url);
void optionsShowToolbar();
void optionsShowStatusbar();
void optionsConfigureKeys();
......
......@@ -38,13 +38,12 @@ class KmPlotIface : virtual public DCOPObject
{
K_DCOP
k_dcop:
virtual void fileOpen(const KURL &url) = 0;
virtual void fileOpen() = 0;
virtual void setStatusBarText(const QString &text, int id) = 0;
virtual void optionsConfigureKeys() = 0;
virtual void optionsConfigureToolbars() = 0;
virtual void openFileInNewWindow(const KURL url) = 0;
virtual bool stopProgressBar() = 0;
virtual void startProgressBar(int) = 0;
virtual void increaseProgressBar() = 0;
......
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