~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to akregator/src/articleviewer.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include "utils.h"
39
39
#include "openurlrequest.h"
40
40
 
 
41
#include "kdepim-version.h"
 
42
 
41
43
#include <kpimutils/kfileio.h>
42
44
 
43
45
#include <kaction.h>
76
78
namespace Akregator {
77
79
 
78
80
ArticleViewer::ArticleViewer(QWidget *parent)
79
 
    : QFrame(parent),
 
81
    : QWidget(parent),
80
82
      m_url(0),
81
83
      m_htmlFooter(),
82
84
      m_currentText(),
87
89
      m_normalViewFormatter( new DefaultNormalViewFormatter( m_imageDir, m_part->view() ) ),
88
90
      m_combinedViewFormatter( new DefaultCombinedViewFormatter( m_imageDir, m_part->view() ) )
89
91
{
90
 
    setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
91
92
    QGridLayout* layout = new QGridLayout(this);
92
93
    layout->setMargin(0);
93
94
    layout->addWidget(m_part->widget(), 0, 0);
104
105
    m_part->setAutoloadImages(true);
105
106
    m_part->setStatusMessagesEnabled(false);
106
107
    m_part->view()->setAttribute(Qt::WA_InputMethodEnabled, true); //workaround to fix 216878
 
108
    m_part->view()->setFrameStyle( QFrame::StyledPanel|QFrame::Sunken );
107
109
 
108
110
    // change the cursor when loading stuff...
109
111
    connect( m_part, SIGNAL(started(KIO::Job *)),
168
170
    OpenUrlRequest req(url);
169
171
    req.setArgs(args);
170
172
    req.setBrowserArgs(browserArgs);
171
 
    req.setOptions(OpenUrlRequest::NewTab);
 
173
    if (req.options() == OpenUrlRequest::None)          // no explicit new window,
 
174
        req.setOptions(OpenUrlRequest::NewTab);         // so must open new tab
172
175
 
173
176
    if (m_part->button() == Qt::LeftButton)
174
177
    {
271
274
    QClipboard *cb = QApplication::clipboard();
272
275
    cb->setText(m_url.prettyUrl(), QClipboard::Clipboard);
273
276
    // don't set url to selection as it's a no-no according to a fd.o spec
274
 
    // which spec? Nobody seems to care (tested Firefox (3.5.10) Konqueror,and KMail (4.2.3)), so I re-enable the following line unless someone gives 
 
277
    // which spec? Nobody seems to care (tested Firefox (3.5.10) Konqueror,and KMail (4.2.3)), so I re-enable the following line unless someone gives
275
278
    // a good reason to remove it again (bug 183022) --Frank
276
279
    cb->setText(m_url.prettyUrl(), QClipboard::Selection);
277
280
}
655
658
    endWriting();
656
659
}
657
660
 
 
661
QSize ArticleViewer::sizeHint() const
 
662
{
 
663
    // Increase height a bit so that we can (roughly) read 25 lines of text
 
664
    QSize sh = QWidget::sizeHint();
 
665
    sh.setHeight(qMax(sh.height(), 25 * fontMetrics().height()));
 
666
    return sh;
 
667
}
 
668
 
658
669
void ArticleViewer::displayAboutPage()
659
670
{
660
671
    QString location = KStandardDirs::locate("data", "akregator/about/main.html");
664
675
            i18nc("%1: Akregator version; %2: homepage URL; "
665
676
            "--- end of comment ---",
666
677
    "<h2 style='margin-top: 0px;'>Welcome to Akregator %1</h2>"
667
 
            "<p>Akregator is a feed reader for the K Desktop Environment. "
 
678
            "<p>Akregator is a KDE news feed reader. "
668
679
            "Feed readers provide a convenient way to browse different kinds of "
669
680
            "content, including news, blogs, and other content from online sites. "
670
681
            "Instead of checking all your favorite web sites manually for updates, "
675
686
            "<p>We hope that you will enjoy Akregator.</p>\n"
676
687
            "<p>Thank you,</p>\n"
677
688
            "<p style='margin-bottom: 0px'>&nbsp; &nbsp; The Akregator Team</p>\n",
678
 
    AKREGATOR_VERSION, // Akregator version
 
689
    KDEPIM_VERSION,
679
690
    "http://akregator.kde.org/"); // Akregator homepage URL
680
691
 
681
692
    QString fontSize = QString::number( pointsToPixel( Settings::mediumFontSize() ));
682
693
    QString appTitle = i18n("Akregator");
683
694
    QString catchPhrase = ""; //not enough space for a catch phrase at default window size i18n("Part of the Kontact Suite");
684
 
    QString quickDescription = i18n("An RSS feed reader for the K Desktop Environment.");
 
695
    QString quickDescription = i18n("A KDE news feed reader.");
685
696
 
686
697
    QString content = KPIMUtils::kFileToByteArray(location);
687
698