Commit 31ac88d6 authored by Simon Hausmann's avatar Simon Hausmann

- utilize and implement the newly added KParts::BrowserInterface

svn path=/trunk/kdebase/konqueror/; revision=85060
parent 3aca99a0
2001-03-02 Simon Hausmann <simon@kde.org>
* konq_view.cc, konq_browseriface.cc/h: Utilize and implement the newly
added KParts::BrowserInterface
2001-02-06 Simon Hausmann <simon@kde.org>
* konq_mainwindow.cc (openBookmarkURL): Patch by
......
......@@ -31,7 +31,8 @@ konqueror_la_SOURCES = konq_main.cc \
konq_actions.cc \
konq_profiledlg.cc \
konq_factory.cc \
konq_combo.cc
konq_combo.cc \
konq_browseriface.cc
konqueror_la_LDFLAGS = $(all_libraries) -module -avoid-version
konqueror_la_LIBADD = ../libkonq/libkonq.la
......
#include "konq_browseriface.h"
#include "konq_view.h"
KonqBrowserInterface::KonqBrowserInterface( KonqView *view, const char *name )
: KParts::BrowserInterface( view, name )
{
m_view = view;
}
uint KonqBrowserInterface::historyLength() const
{
return m_view->historyLength();
}
void KonqBrowserInterface::goHistory( int steps )
{
m_view->goHistory( steps );
}
#include "konq_browseriface.moc"
#ifndef __konq_browseriface_h__
#define __konq_browseriface_h__
#include <kparts/browserinterface.h>
class KonqView;
class KonqBrowserInterface : public KParts::BrowserInterface
{
Q_OBJECT
Q_PROPERTY( uint historyLength READ historyLength );
public:
KonqBrowserInterface( KonqView *view, const char *name );
uint historyLength() const;
public slots:
void goHistory( int );
private:
KonqView *m_view;
};
#endif
......@@ -28,6 +28,7 @@
#include "konq_run.h"
#include "konq_events.h"
#include "konq_viewmgr.h"
#include "konq_browseriface.h"
#include <kio/job.h>
#include <konq_historymgr.h>
......@@ -79,6 +80,7 @@ KonqView::KonqView( KonqViewFactory &viewFactory,
m_bLinkedView = false;
m_bAborted = false;
m_bToggleView = false;
m_browserIface = new KonqBrowserInterface( this, "browseriface" );
switchView( viewFactory );
}
......@@ -258,6 +260,8 @@ void KonqView::connectPart( )
if ( !ext )
return;
ext->setBrowserInterface( m_browserIface );
connect( ext, SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs &) ),
m_pMainWindow, SLOT( slotOpenURLRequest( const KURL &, const KParts::URLArgs & ) ) );
......
......@@ -39,6 +39,7 @@
class KonqRun;
class KonqFrame;
class KonqViewIface;
class KonqBrowserInterface;
struct HistoryEntry
{
......@@ -122,6 +123,8 @@ public:
*/
bool canGoForward() { return m_lstHistory.at() != ((int)m_lstHistory.count())-1; }
uint historyLength() { return m_lstHistory.count(); }
/**
* Move in history. +1 is "forward", -1 is "back", you can guess the rest.
*/
......@@ -257,6 +260,8 @@ public:
KonqViewIface * dcopObject();
void goHistory( int steps );
static QStringList childFrameNames( KParts::ReadOnlyPart *part );
static KParts::BrowserHostExtension *hostExtension( KParts::ReadOnlyPart *part, const QString &name );
......@@ -302,7 +307,6 @@ protected slots:
void slotSelectionInfo( const KFileItemList &items );
void slotOpenURLNotify();
void slotEnableAction( const char * name, bool enabled );
void goHistory( int steps );
protected:
/**
......@@ -365,6 +369,7 @@ protected:
QString m_name;
QString m_caption;
KonqViewIface * m_dcopObject;
KonqBrowserInterface *m_browserIface;
};
#endif
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