Commit 6c6a1ac5 authored by Albert Astals Cid's avatar Albert Astals Cid

branchport r510876

svn path=/trunk/playground/graphics/oKular/kpdf/; revision=510882
parent 074303b8
......@@ -12,7 +12,7 @@
* Copyright (C) 2004 by Christoph Cullmann <crossfire@babylon2k.de> *
* Copyright (C) 2004 by Henrique Pinto <stampede@coltec.ufmg.br> *
* Copyright (C) 2004 by Waldo Bastian <bastian@kde.org> *
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004 by Antti Markus <antti.markus@starman.ee> *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -141,12 +141,12 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
// [left toolbox: Table of Contents] | []
//QFrame * tocFrame = new QFrame( m_toolBox );
//QVBoxLayout * tocFrameLayout = new QVBoxLayout( tocFrame );
TOC * toc = new TOC( m_toolBox/*tocFrame*/, m_document );
connect( toc, SIGNAL( hasTOC( bool ) ), this, SLOT( enableTOC( bool ) ) );
m_toc = new TOC( m_toolBox/*tocFrame*/, m_document );
connect( m_toc, SIGNAL( hasTOC( bool ) ), this, SLOT( enableTOC( bool ) ) );
//KListViewSearchLine * tocSearchLine = new KListViewSearchLine( tocFrame, toc );
//tocFrameLayout->addWidget( tocSearchLine );
//tocFrameLayout->addWidget( toc );
tbIndex = m_toolBox->addItem( toc/*tocFrame*/, QIconSet(SmallIcon("text_left")), i18n("Contents") );
tbIndex = m_toolBox->addItem( m_toc/*tocFrame*/, QIconSet(SmallIcon("text_left")), i18n("Contents") );
m_toolBox->setItemToolTip( tbIndex, i18n("Contents") );
enableTOC( false );
......@@ -179,8 +179,8 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
miniSpacer->setFixedHeight( 6 );
miniBarLayout->addWidget( miniSpacer );
// widgets: [../[../MiniBar]] | []
MiniBar * miniBar = new MiniBar( miniBarContainer, m_document );
miniBarLayout->addWidget( miniBar );
m_miniBar = new MiniBar( miniBarContainer, m_document );
miniBarLayout->addWidget( m_miniBar );
// widgets: [] | [right 'pageView']
// QWidget * rightContainer = new QWidget( m_splitter );
......@@ -200,8 +200,8 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
m_document->addObserver( this );
m_document->addObserver( m_thumbnailList );
m_document->addObserver( m_pageView );
m_document->addObserver( toc );
m_document->addObserver( miniBar );
m_document->addObserver( m_toc );
m_document->addObserver( m_miniBar );
m_document->addObserver( reviewsWidget );
// ACTIONS
......@@ -211,19 +211,19 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
m_gotoPage = KStdAction::gotoPage( this, SLOT( slotGoToPage() ), ac, "goto_page" );
m_gotoPage->setShortcut( "CTRL+G" );
// dirty way to activate gotopage when pressing miniBar's button
connect( miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( activate() ) );
connect( m_miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( activate() ) );
m_prevPage = KStdAction::prior(this, SLOT(slotPreviousPage()), ac, "previous_page");
m_prevPage->setWhatsThis( i18n( "Moves to the previous page of the document" ) );
m_prevPage->setShortcut( "Backspace" );
// dirty way to activate prev page when pressing miniBar's button
connect( miniBar, SIGNAL( prevPage() ), m_prevPage, SLOT( activate() ) );
connect( m_miniBar, SIGNAL( prevPage() ), m_prevPage, SLOT( activate() ) );
m_nextPage = KStdAction::next(this, SLOT(slotNextPage()), ac, "next_page" );
m_nextPage->setWhatsThis( i18n( "Moves to the next page of the document" ) );
m_nextPage->setShortcut( "Space" );
// dirty way to activate next page when pressing miniBar's button
connect( miniBar, SIGNAL( nextPage() ), m_nextPage, SLOT( activate() ) );
connect( m_miniBar, SIGNAL( nextPage() ), m_nextPage, SLOT( activate() ) );
m_firstPage = KStdAction::firstPage( this, SLOT( slotGotoFirst() ), ac, "first_page" );
m_firstPage->setWhatsThis( i18n( "Moves to the first page of the document" ) );
......@@ -315,6 +315,11 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
Part::~Part()
{
delete m_toc;
delete m_pageView;
delete m_thumbnailList;
delete m_miniBar;
delete m_document;
}
......
......@@ -5,7 +5,7 @@
* Copyright (C) 2003 by Andy Goossens <andygoossens@telenet.be> *
* Copyright (C) 2003 by Laurent Montel <montel@kde.org> *
* Copyright (C) 2004 by Dominique Devriese <devriese@kde.org> *
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -42,6 +42,8 @@ class ThumbnailController;
class PageView;
class PresentationWidget;
class SearchWidget;
class TOC;
class MiniBar;
namespace oKular {
......@@ -144,8 +146,10 @@ private:
QWidget *m_leftPanel;
QToolBox *m_toolBox;
SearchWidget *m_searchWidget;
ThumbnailList *m_thumbnailList;
PageView *m_pageView;
QGuardedPtr<ThumbnailList> m_thumbnailList;
QGuardedPtr<PageView> m_pageView;
QGuardedPtr<TOC> m_toc;
QGuardedPtr<MiniBar> m_miniBar;
QGuardedPtr<PresentationWidget> m_presentationWidget;
// document watcher (and reloader) variables
......
/***************************************************************************
* Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
* Copyright (C) 2006 by Albert Astals Cid <aacid@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -128,6 +129,11 @@ MiniBar::MiniBar( QWidget * parent, KPDFDocument * document )
parent->hide();
}
MiniBar::~MiniBar()
{
m_document->removeObserver( this );
}
void MiniBar::notifySetup( const QValueVector< KPDFPage * > & pageVector, bool changed )
{
// only process data when document changes
......
/***************************************************************************
* Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
* Copyright (C) 2006 by Albert Astals Cid <aacid@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -26,6 +27,7 @@ class MiniBar : public QFrame, public DocumentObserver
Q_OBJECT
public:
MiniBar( QWidget *parent, KPDFDocument * document );
~MiniBar();
// [INHERITED] from DocumentObserver
uint observerId() const { return MINIBAR_ID; }
......
/***************************************************************************
* Copyright (C) 2004-2005 by Enrico Ros <eros.kde@email.it> *
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* *
* With portions of code from kpdf/kpdf_pagewidget.cc by: *
* Copyright (C) 2002 by Wilco Greven <greven@kde.org> *
......@@ -200,6 +200,7 @@ PageView::PageView( QWidget *parent, KPDFDocument *document )
PageView::~PageView()
{
// delete the local storage structure
d->document->removeObserver( this );
delete d;
}
......
/***************************************************************************
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -93,6 +93,7 @@ ThumbnailList::ThumbnailList( QWidget *parent, KPDFDocument *document )
ThumbnailList::~ThumbnailList()
{
m_document->removeObserver( this );
delete m_bookmarkOverlay;
}
......
/***************************************************************************
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -62,6 +62,11 @@ TOC::TOC(QWidget *parent, KPDFDocument *document) : KListView(parent), m_documen
connect(this, SIGNAL(returnPressed(QListViewItem *)), this, SLOT(slotExecuted(QListViewItem *)));
}
TOC::~TOC()
{
m_document->removeObserver( this );
}
uint TOC::observerId() const
{
return TOC_ID;
......
/***************************************************************************
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
* Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -22,6 +22,7 @@ class TOC : public KListView, public DocumentObserver
Q_OBJECT
public:
TOC(QWidget *parent, KPDFDocument *document);
~TOC();
// inherited from DocumentObserver
uint observerId() const;
......
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