From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- knewsticker/kntsrcfilepropsdlg/Makefile.am | 12 ++ .../kntsrcfilepropsdlg/kntsrcfilepropsdlg.cpp | 130 +++++++++++++ .../kntsrcfilepropsdlg/kntsrcfilepropsdlg.desktop | 69 +++++++ .../kntsrcfilepropsdlg/kntsrcfilepropsdlg.h | 57 ++++++ .../kntsrcfilepropsdlg/kntsrcfilepropsdlgwidget.ui | 215 +++++++++++++++++++++ 5 files changed, 483 insertions(+) create mode 100644 knewsticker/kntsrcfilepropsdlg/Makefile.am create mode 100644 knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.cpp create mode 100644 knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.desktop create mode 100644 knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.h create mode 100644 knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlgwidget.ui (limited to 'knewsticker/kntsrcfilepropsdlg') diff --git a/knewsticker/kntsrcfilepropsdlg/Makefile.am b/knewsticker/kntsrcfilepropsdlg/Makefile.am new file mode 100644 index 00000000..9782b90c --- /dev/null +++ b/knewsticker/kntsrcfilepropsdlg/Makefile.am @@ -0,0 +1,12 @@ +INCLUDES = -I$(top_srcdir)/knewsticker/common -I$(top_srcdir)/librss $(all_includes) + +kde_module_LTLIBRARIES = libkntsrcfilepropsdlg.la + +libkntsrcfilepropsdlg_la_SOURCES = kntsrcfilepropsdlg.cpp \ + kntsrcfilepropsdlgwidget.ui +libkntsrcfilepropsdlg_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) +libkntsrcfilepropsdlg_la_LIBADD = $(LIB_KIO) ../common/libknewstickercommon.la ../../librss/librss.la +libkntsrcfilepropsdlg_la_METASOURCES = AUTO + +service_DATA = kntsrcfilepropsdlg.desktop +servicedir = $(kde_servicesdir) diff --git a/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.cpp b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.cpp new file mode 100644 index 00000000..93bc71cc --- /dev/null +++ b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.cpp @@ -0,0 +1,130 @@ +/* + * kntsrcfilepropsdlg.cpp + * + * Copyright (c) 2001, 2002, 2003 Frerich Raabe + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the + * accompanying file 'COPYING'. + */ +#include "kntsrcfilepropsdlg.h" +#include "kntsrcfilepropsdlgwidget.h" +#include "xmlnewsaccess.h" +#include "newsiconmgr.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace RSS; + +class ArticleListBoxItem : public QListBoxText +{ + public: + ArticleListBoxItem( QListBox *listbox, const Article &article ); + + const Article &article() const { return m_article; } + + private: + Article m_article; +}; + +ArticleListBoxItem::ArticleListBoxItem( QListBox *listbox, const Article &article ) + : QListBoxText( listbox ), + m_article( article ) +{ + setText( article.title() ); +} + +KntSrcFilePropsDlg::KntSrcFilePropsDlg(KPropertiesDialog *props) + : KPropsDlgPlugin(props) +{ + m_child = new KntSrcFilePropsDlgWidget(properties->addVBoxPage(i18n("News Resource"))); + connect(m_child->urlName, SIGNAL(leftClickedURL(const QString &)), + SLOT(slotOpenURL(const QString &))); + connect(m_child->lbArticles, SIGNAL(executed(QListBoxItem *)), + SLOT(slotClickedArticle(QListBoxItem *))); + + Loader *loader = Loader::create(); + connect(loader, SIGNAL(loadingComplete(Loader *, Document, Status)), + SLOT(slotConstructUI(Loader *, Document, Status))); + loader->loadFrom(props->item()->url(), new FileRetriever); + + connect(NewsIconMgr::self(), SIGNAL(gotIcon(const KURL &, const QPixmap &)), + SLOT(slotGotIcon(const KURL &, const QPixmap &))); + + m_child->show(); +} + +void KntSrcFilePropsDlg::slotConstructUI(Loader *, Document doc, Status status) +{ + if (status != RSS::Success) + return; + + KURL iconURL = doc.link(); + iconURL.setEncodedPathAndQuery(QString::fromLatin1("/favicon.ico")); + NewsIconMgr::self()->getIcon(iconURL); + + m_child->urlName->setText(doc.title()); + m_child->urlName->setURL(doc.link().url()); + + m_child->mleDescription->setText(doc.description()); + + Article::List::ConstIterator it = doc.articles().begin(); + Article::List::ConstIterator end = doc.articles().end(); + for (; it != end; ++it) + new ArticleListBoxItem(m_child->lbArticles, *it); +} + +void KntSrcFilePropsDlg::slotOpenURL(const QString &url) +{ + kapp->invokeBrowser(url); +} + +void KntSrcFilePropsDlg::slotGotIcon(const KURL &, const QPixmap &pixmap) +{ + m_child->pixmapIcon->setPixmap(pixmap); +} + +void KntSrcFilePropsDlg::slotClickedArticle(QListBoxItem *item) +{ + ArticleListBoxItem *articleItem = static_cast(item); + slotOpenURL(articleItem->article().link().url()); +} + +QObject *KntSrcFilePropsFactory::createObject(QObject *parent, const char *, + const char *classname, const QStringList &) +{ + if (QString::fromLatin1(classname) == "KPropsDlgPlugin") + { + if (!parent->inherits("KPropertiesDialog")) + return 0L; + + QObject *obj = new KntSrcFilePropsDlg(static_cast(parent)); + return obj; + } + return 0L; +} + +extern "C" +{ + KDE_EXPORT void *init_libkntsrcfilepropsdlg() + { + KGlobal::locale()->insertCatalogue( "knewsticker" ); + return new KntSrcFilePropsFactory(); + } +} + +#include "kntsrcfilepropsdlg.moc" diff --git a/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.desktop b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.desktop new file mode 100644 index 00000000..6902d9b3 --- /dev/null +++ b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.desktop @@ -0,0 +1,69 @@ +[Desktop Entry] +Type=Service +Name=KNewsticker Source File Properties Page +Name[af]=K-nuustikker Bron Lêer Eienskappe Bladsy +Name[ar]=صفحة خصائص ملف مصدر مجدد الأخبار +Name[az]=KNewsticker Mənbə Faylı Xüsusiyyətləri Səhifəsi +Name[bg]=Настройване на файла източник на KNewsticker +Name[bn]=কে-নিউজ-টিকার উত্‍স ফাইল বৈশিষ্ট্যাবলী পাতা +Name[bs]=KNewsticker stranica sa osobinama izvorne datoteke +Name[ca]=Pàgina de propietats dels fitxers font del KNewsticker +Name[cs]=Popis vlastností zdrojového souboru programu KNewsticker +Name[cy]=Tudalen Priodweddau Ffeil Tarddiad KTicerNewyddion +Name[da]=KNewsTickers side med egenskaber for kildefil +Name[de]=KNewsticker: Einstellungsseite für Quelldateien +Name[el]=Σελίδα ιδιοτήτων αρχείου πηγής KNewsticker +Name[eo]=Ecopaĝo por Novaĵprezentilaj fontdosieroj +Name[es]=Página de propiedades de archivos fuente de KNewsticker +Name[et]=KNewstickeri lähtefaili omaduste dialoog +Name[eu]=KNewsticker iturburu fitxategiaren propietateen orria +Name[fa]=صفحۀ ویژگیهای پروندۀ مبدأ KNewsticker +Name[fi]=KNewsticker lähdetiedostojen asetussivu +Name[fr]=Page des propriétés du fichier source de KNewsTicker +Name[gl]=Páxina de propiedades dos arquivos fonte de KNewsTicker +Name[he]=דף מאפייני קובץ מקור של KNewsTicker +Name[hi]=के-न्यूज टिकर स्रोत फ़ाइल गुण पृष्ठ +Name[hr]=Stranica sa postavkama KNewsTicker izvorne datoteke +Name[hu]=A KNewsTicker forrásfájlok tulajdonságlapja +Name[is]=Stillisíða fyrir frumskrár Fréttastrimils +Name[it]=Pagina proprietà file sorgente di notizie per KNewsticker +Name[ja]=KNewsticker ソースファイルプロパティページ +Name[ka]=KNewsticker წყაროს ფაილის თვისებათა გვერდი +Name[kk]=KNewsticker файлының қасиеттер беті +Name[km]=ទំព័រ​លក្ខណៈ​សម្បត្តិ​ឯកសារ​ប្រភព KNewsticker +Name[lt]=KNewsticker pirminio teksto bylos parinkčių puslapis +Name[lv]=KZiņutikkera Avota Faila Īpašību Lapa +Name[mk]=Страница за својствата на изворната датотека на KNewsticker +Name[mn]=KNewsticker сурвалж файлын Тодорхойлолт хуудас +Name[ms]=Laman Ciri-ciri Fail Sumber KNewsticker +Name[mt]=Paġna ta' Propjetajiet Fajl ta' Sors KNewsticker +Name[nb]=Egenskaper for kildefiler til KNewsticker +Name[nds]=KNewsTicker Borndateien-Egenschappensiet +Name[ne]=केडीई न्यूज टिकर स्रोत फाइल विशेषता पृष्ठ +Name[nl]=KNewsticker Bronbestand Eigenschappenpagina +Name[nn]=Eigenskapsside for KNewsticker-kjeldefil +Name[nso]=Letlakala la Dithoto tsa Faele ya Mothopo wa seswai sa KDitaba +Name[pl]=Strona właściwości pliku źródłowego KNewsTickera +Name[pt]=Página de Propriedades do Ficheiro da Fonte do KNewsticker +Name[pt_BR]=Página de Propriedades do Arquivo Fonte do KNewsTicher +Name[ro]=Pagină de proprietăţi pentru fişier sursă KNewsticker +Name[ru]=Страница свойств сведений о файле KNewsticker +Name[se]=KNewsTicker-gáldofiilla iešvuohtasiidu +Name[sk]=Popis vlastností konfiguračného súboru pre KNewsticker +Name[sl]=Stran z lastnostmi za izvorno datoteko KNewsTicker +Name[sr]=KNewsticker страна за подешавање својстава изворних фајлова +Name[sr@Latn]=KNewsticker strana za podešavanje svojstava izvornih fajlova +Name[sv]=Nyhetsövervakarens sida för källfilsegenskaper +Name[ta]=கேசெய்தி அறிவிப்பானின் மூல கோப்பின் பண்புகளை அறியும் பக்கம். +Name[tg]=Саҳофаи Хусусиятҳои Файли Сарчашмавии KДидабони Ахборот +Name[th]=หน้าคุณสมบัติของแฟ้มต้นฉบับตั๋วข่าว - K +Name[tr]=KDE Haber Gözlemcisi Kaynak Dosyası Özellikler Sayfası +Name[uk]=Сторінка властивостей вихідного файла KNewsticker +Name[ven]=Siatari la tshishumiswa tshavhubvo ha faela la tshauthika mafhungo a K +Name[xh]=Iphepha Leempahla Lemvelaphi Yefayile ye KNewsticker +Name[zh_CN]=KNewsticker 来源文件属性页 +Name[zh_HK]=KNewsticker 來源檔案屬性頁 +Name[zh_TW]=KNewsticker 來源檔案屬性頁 +Name[zu]=Umlekeleli wezindaba ze K wephepha lefayela Yemvelaphi Yempahla +X-KDE-Library=libkntsrcfilepropsdlg +ServiceTypes=KPropsDlg/Plugin,text/rdf,text/rss diff --git a/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.h b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.h new file mode 100644 index 00000000..8fe1be58 --- /dev/null +++ b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlg.h @@ -0,0 +1,57 @@ +/* + * kntsrcfilepropsdlg.h + * + * Copyright (c) 2001 Frerich Raabe + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the + * accompanying file 'COPYING'. + */ +#ifndef KNTSRCFILEPROPSDLG_H +#define KNTSRCFILEPROPSDLG_H + +#include + +#include +#include + +class KntSrcFilePropsDlgWidget; +class QListBoxItem; + +namespace RSS { + class Loader; + class Document; +} + +using RSS::Loader; +using RSS::Document; +using RSS::Status; + +class KntSrcFilePropsFactory : public KLibFactory +{ + Q_OBJECT + + public: + virtual QObject *createObject(QObject * = 0, const char * = 0, + const char * = "QObject", const QStringList & = QStringList()); +}; + +class KntSrcFilePropsDlg : public KPropsDlgPlugin +{ + Q_OBJECT + + public: + KntSrcFilePropsDlg(KPropertiesDialog *); + + protected slots: + void slotOpenURL(const QString &); + void slotConstructUI(Loader *loader, Document doc, Status status); + void slotGotIcon(const KURL &, const QPixmap &); + void slotClickedArticle(QListBoxItem *); + + private: + KntSrcFilePropsDlgWidget *m_child; +}; + +#endif // KNTSRCFILEPROPSDLG_H diff --git a/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlgwidget.ui b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlgwidget.ui new file mode 100644 index 00000000..b8d1827e --- /dev/null +++ b/knewsticker/kntsrcfilepropsdlg/kntsrcfilepropsdlgwidget.ui @@ -0,0 +1,215 @@ + +KntSrcFilePropsDlgWidget +The widget to be used for the RDF/RSS file properties dialog plugin. +Frerich Raabe <raabe@kde.org> + + + KntSrcFilePropsDlgWidget + + + + 0 + 0 + 311 + 274 + + + + + + + + + unnamed + + + 4 + + + 4 + + + + Spacer5 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + pixmapIcon + + + + 0 + 0 + 0 + 0 + + + + image0 + + + Icon of this news site + + + Here you can see the icon of this news site. + + + + + urlName + + + heise online news + + + http://www.heise.de/newsticker/ + + + + + lDescription + + + Description: + + + Brief description of the news site + + + Here you can see a brief description about the news site and its contents. + + + + + lName + + + Name: + + + leName + + + Name of the news site + + + This is the name of the news site. + + + + + mleDescription + + + + 7 + 4 + 0 + 0 + + + + WidgetWidth + + + true + + + Brief description of the news site + + + Here you can see a brief description about the news site and its contents. + + + + + Spacer_2 + + + Vertical + + + Maximum + + + + 20 + 63 + + + + + + Line1 + + + 5 + + + + + lArticles + + + Available articles: + + + Articles contained within this source file + + + This list shows the headlines and links to the corresponding complete articles which have been stored in the source file whose properties you are watching. + + + + + lbArticles + + + + 7 + 7 + 0 + 0 + + + + Articles contained within this source file + + + This list shows the headlines and links to the corresponding complete articles which have been stored in the source file whose properties you are watching.<p>You can open the corresponding full article for each headline by, depending on the global KDE settings, clicking or double-clicking on a headline + + + + + + + + + 89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000021c49444154388d8592316813511cc67f910c1770b8408704742838248260c63ad943974041533a84d0a1440a9ad6418a83dc22a853b62693c40c25e9503c07e93908ed601b3b354be90916ae43e10e2c5c06e1fed007714873b56daadff28ef7eefbf17dfff762db9d6dfe567db9dee73faa2c5662c3eff8c5c3dcdd1ca56209518216d7a2d5d9dba5b1d2c6b86f505faef787907300f393d91f9f4a621e7c8fccee5761e3dd3afa7503fbcb26e5f97294b4b25889c52f9aad9716e96c1614783f5d8c171318af0c365e6f401c76bbbb1164e1d9423f020ccc36b93b93983326fa988e73e462ab0fb8471ddc4397542a457ba54da3d9e0d0393c3f03e79b873e9e227f2b4f3693257d338d9be9e2adb9c82f8dfd837d961697f08e5ddc1ffb746e7469af5a5c1b02aa93d5583223f8be0f0ad64f5ad83b36c435509020017148eb29b299dbdccbe500ce0000b5871f639eefd149d9585b16aee7e2343d6a73358c0713a04242d543d334e4b77f193094bd639f99e76b4ccfe46935eb84aa87bdd64224403b2d3f12303457e7aa4c3fca8302949038bddae4581a11b91ac0964e32077a62d03f941ea562191414a60aa0403bfdf5d24b04683dad22aa070cccd66a83c2e30228419420be8f9c045727308fdf527eff865069241494662b589f6d44044d0112460946cf602da0dbddc4f75d421510f65c0ac53220880451922b2b548b26cc9a8804387bcea08eea8204034828ff9ec193e74ba3b647ea0f69200af223e8435e0000000049454e44ae426082 + + + + klistbox.h + kurllabel.h + kseparator.h + + + + kurllabel.h + kseparator.h + klistbox.h + + -- cgit v1.2.1