Commit 7b6b7a35 authored by Enrico Ros's avatar Enrico Ros

KPDF HotNewStuff Browser!

It's not yet complete (file dowload and internal notifies are missing) but
the new stuff browser is running. The ui is modeled on an Aaron's mockup.

NewStuff:
  Fetches the providers list (kpdf.kde.org/newstuff/providers.xml), lets
  the user select a provider and displays provider's contents in a KHMTL
  part (for flexibility and eye candy).
  Internally we use KNS' Entry and Provider structures only, doing all the
  transfer operations by hand via KIO::get jobs. Download will be done
  internally too (to give better consistancy in the interface).
  Network timeouts, problems or info messages are notified in a statusbar-
  like widget and we try to keep all information in the dialog, without
  using messageBoxes

Part:
  Added the action and the dialog invocation

Makefiles:
  Link the KNEWSTUFF and KHTML libraries.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=405828
parent c8f81224
......@@ -19,7 +19,8 @@ libkpdfpart_la_SOURCES = dcop.skel error.cpp part.cpp
libkpdfpart_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
libkpdfpart_la_LIBADD = xpdf/xpdf/libxpdf.la conf/libkpdfconf.la core/libkpdfcore.la \
ui/libkpdfui.la ui/painter_agg2/libagg2.la $(LIB_KPARTS) \
$(LIB_KFILE) $(LIB_KDEPRINT) $(LIB_KUTILS) -lm
$(LIB_KFILE) $(LIB_KDEPRINT) $(LIB_KUTILS) $(LIB_KNEWSTUFF) \
$(LIB_KHTML) -lm
partdesktopdir = $(kde_servicesdir)
partdesktop_DATA = kpdf_part.desktop
......
......@@ -61,6 +61,7 @@
#include "ui/thumbnaillist.h"
#include "ui/side_reviews.h"
#include "ui/minibar.h"
#include "ui/newstuff.h"
#include "ui/propertiesdialog.h"
#include "ui/presentationwidget.h"
#include "conf/preferencesdialog.h"
......@@ -232,12 +233,15 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
m_printPreview = KStdAction::printPreview( this, SLOT( slotPrintPreview() ), ac );
m_printPreview->setEnabled( false );
m_showLeftPanel = new KToggleAction( i18n( "Show &left panel"), "show_side_panel", 0, this, SLOT( slotShowLeftPanel() ), ac, "show_leftpanel" );
m_showLeftPanel = new KToggleAction( i18n( "Show &left panel"), "show_side_panel", 0, this, SLOT( slotShowLeftPanel() ), ac, "show_leftpanel" );
m_showLeftPanel->setShortcut( "CTRL+L" );
m_showLeftPanel->setCheckedState( i18n("Hide &left panel") );
m_showLeftPanel->setChecked( Settings::showLeftPanel() );
slotShowLeftPanel();
KAction * ghns = new KAction(i18n("&Get new stuff"), "knewstuff", 0, this, SLOT(slotGetNewStuff()), ac, "get_new_stuff");
ghns->setShortcut( "G" ); // TEMP, REMOVE ME!
m_showProperties = new KAction(i18n("&Properties"), "info", 0, this, SLOT(slotShowProperties()), ac, "properties");
m_showProperties->setEnabled( false );
......@@ -565,6 +569,14 @@ void Part::slotSaveFileAs()
}
}
void Part::slotGetNewStuff()
{
// show the modal dialog over pageview and execute it
NewStuffDialog * dialog = new NewStuffDialog( m_pageView );
dialog->exec();
delete dialog;
}
void Part::slotPreferences()
{
// an instance the dialog could be already created and could be cached,
......
......@@ -96,6 +96,7 @@ protected slots:
void slotFind();
void slotFindNext();
void slotSaveFileAs();
void slotGetNewStuff();
void slotPreferences();
void slotNewConfig();
void slotPrintPreview();
......
......@@ -6,6 +6,8 @@
<Action name="file_print" group="file_print"/>
<Action name="file_print_preview" group="file_print"/>
<Action name="properties" group="file_print"/>
<Separator/>
<Action name="get_new_stuff"/>
</Menu>
<Menu name="edit"><text>&amp;Edit</text>
<Action name="find"/>
......
......@@ -8,7 +8,7 @@ noinst_LTLIBRARIES = libkpdfui.la
libkpdfui_la_SOURCES = pagepainter.cpp pageview.cpp pageviewutils.cpp \
pageviewannotator.cpp minibar.cpp thumbnaillist.cpp \
searchwidget.cpp toc.cpp propertiesdialog.cpp \
presentationwidget.cpp side_reviews.cpp
presentationwidget.cpp side_reviews.cpp newstuff.cpp
pageview.lo: ../conf/settings.h
pageviewutils.lo: ../conf/settings.h
......
......@@ -10,6 +10,10 @@ annpics_DATA = checkmark.png circle.png comment.png cross.png help.png \
rightarrow.png rightpointer.png star.png uparrow.png \
upleftarrow.png
# install misc images
miscpicsdir = $(kde_datadir)/kpdf/pics
miscpics_DATA = ghns.png ghns_star.png ghns_star_gray.png
# install annotator xml tools description
xmldir = $(kde_datadir)/kpdf
xml_DATA = tools.xml
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/***************************************************************************
* Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef _KPDF_NEWSTUFF_H_
#define _KPDF_NEWSTUFF_H_
#include <qdialog.h>
#include <knewstuff/provider.h>
using namespace KNS;
namespace KIO { class JOB; }
class AvailableItem;
class NewStuffDialog : public QDialog
{
Q_OBJECT
public:
NewStuffDialog( QWidget * parent );
~NewStuffDialog();
// show a message in the bottom bar
enum MessageType { Normal, Info, Error };
void displayMessage( const QString & msg, MessageType type = Normal,
int timeOutMs = 3000 );
private:
// private storage class
class NewStuffDialogPrivate * d;
private slots:
void slotResetMessageColors();
void slotNetworkTimeout();
void slotSortingSelected( int sortType );
// providers loading related
void slotLoadProviders();
void slotProvidersLoaded( Provider::List * list );
// items loading related
void slotLoadProvider( int provider = 0 );
void slotProviderInfoData( KIO::Job *, const QByteArray & );
void slotProviderInfoResult( KIO::Job * );
// files downloading related
//void slotDownloadItem( AvailableItem * );
//void slotItemDownloaded( KIO::Job * );
};
#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