diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /korganizer/plugins/datenums | |
download | tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip |
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/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/plugins/datenums')
-rw-r--r-- | korganizer/plugins/datenums/Makefile.am | 14 | ||||
-rw-r--r-- | korganizer/plugins/datenums/configdialog.cpp | 80 | ||||
-rw-r--r-- | korganizer/plugins/datenums/configdialog.h | 44 | ||||
-rw-r--r-- | korganizer/plugins/datenums/datenums.cpp | 72 | ||||
-rw-r--r-- | korganizer/plugins/datenums/datenums.desktop | 99 | ||||
-rw-r--r-- | korganizer/plugins/datenums/datenums.h | 41 |
6 files changed, 350 insertions, 0 deletions
diff --git a/korganizer/plugins/datenums/Makefile.am b/korganizer/plugins/datenums/Makefile.am new file mode 100644 index 000000000..8081a5645 --- /dev/null +++ b/korganizer/plugins/datenums/Makefile.am @@ -0,0 +1,14 @@ +INCLUDES = -I$(top_srcdir)/korganizer/interfaces -I$(top_srcdir)/korganizer $(all_includes) + +kde_module_LTLIBRARIES = libkorg_datenums.la + +libkorg_datenums_la_SOURCES = configdialog.cpp datenums.cpp +libkorg_datenums_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) +libkorg_datenums_la_LIBADD = $(top_builddir)/korganizer/libkorganizer.la $(LIB_KDEUI) + +noinst_HEADERS = datenums.h + +servicedir = $(kde_servicesdir)/korganizer +service_DATA = datenums.desktop + +METASOURCES = AUTO diff --git a/korganizer/plugins/datenums/configdialog.cpp b/korganizer/plugins/datenums/configdialog.cpp new file mode 100644 index 000000000..d26a1fd86 --- /dev/null +++ b/korganizer/plugins/datenums/configdialog.cpp @@ -0,0 +1,80 @@ +/* + This file is part of KOrganizer. + Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> + Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> + + 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. + + 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. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include <qlayout.h> +#include <qlabel.h> +#include <qvbuttongroup.h> +#include <qradiobutton.h> + +#include <klocale.h> +#include <kmessagebox.h> +#include <kapplication.h> +#include <kglobal.h> +#include <kconfig.h> +#include <kstandarddirs.h> +#include <ksimpleconfig.h> + +#include "configdialog.h" +#include "configdialog.moc" + +ConfigDialog::ConfigDialog(QWidget *parent) + : KDialogBase(Plain,i18n("Configure Day Numbers"),Ok|Cancel,Ok,parent) +{ + QFrame *topFrame = plainPage(); + QVBoxLayout *topLayout = new QVBoxLayout(topFrame,0,spacingHint()); + +// QLabel *label = new QLabel(i18n("Show date numbers:"),topFrame); +// topLayout->addWidget(label); + mDayNumGroup = new QVButtonGroup( i18n("Show Date Number"), topFrame ); + topLayout->addWidget( mDayNumGroup ); + + new QRadioButton( i18n("Show day number"), mDayNumGroup ); + new QRadioButton( i18n("Show days to end of year"), mDayNumGroup ); + new QRadioButton( i18n("Show both"), mDayNumGroup ); + + load(); +} + +ConfigDialog::~ConfigDialog() +{ +} + +void ConfigDialog::load() +{ + KConfig config( "korganizerrc", true, false); // Open read-only, no kdeglobals + config.setGroup("Calendar/DateNum Plugin"); + int datenum = config.readNumEntry( "ShowDayNumbers", 0 ); + mDayNumGroup->setButton( datenum ); +} + +void ConfigDialog::save() +{ + KConfig config( "korganizerrc", false, false); // Open read-write, no kdeglobals + config.setGroup("Calendar/DateNum Plugin"); + config.writeEntry("ShowDayNumbers", mDayNumGroup->selectedId() ); + config.sync(); +} + +void ConfigDialog::slotOk() +{ + save(); + + accept(); +} diff --git a/korganizer/plugins/datenums/configdialog.h b/korganizer/plugins/datenums/configdialog.h new file mode 100644 index 000000000..15efaf049 --- /dev/null +++ b/korganizer/plugins/datenums/configdialog.h @@ -0,0 +1,44 @@ +/* + This file is part of KOrganizer. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +#ifndef CONFIGDIALOG_H +#define CONFIGDIALOG_H + +#include <kdialogbase.h> + +class QButtonGroup; + +class ConfigDialog : public KDialogBase +{ + Q_OBJECT + public: + ConfigDialog(QWidget *parent=0); + virtual ~ConfigDialog(); + + protected: + void load(); + void save(); + + protected slots: + void slotOk(); + + private: + QButtonGroup *mDayNumGroup; +}; + +#endif diff --git a/korganizer/plugins/datenums/datenums.cpp b/korganizer/plugins/datenums/datenums.cpp new file mode 100644 index 000000000..a849f39f3 --- /dev/null +++ b/korganizer/plugins/datenums/datenums.cpp @@ -0,0 +1,72 @@ +/* + This file is part of KOrganizer. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include "datenums.h" +#include "koglobals.h" +#include <kconfig.h> +#include <kstandarddirs.h> + +#include "configdialog.h" +#include <kcalendarsystem.h> + +class DatenumsFactory : public CalendarDecorationFactory { + public: + CalendarDecoration *create() { return new Datenums; } +}; + +K_EXPORT_COMPONENT_FACTORY( libkorg_datenums, DatenumsFactory ) + + +Datenums::Datenums() +{ + KConfig config( "korganizerrc", true, false); // Open read-only, no kdeglobals + config.setGroup("Calendar/DateNum Plugin"); + mDateNum = config.readNumEntry( "ShowDayNumbers", 0 ); +} + +void Datenums::configure(QWidget *parent) +{ + ConfigDialog *dlg = new ConfigDialog(parent); + dlg->exec(); + delete dlg; +} + + +QString Datenums::shortText(const QDate &date) +{ + int doy = KOGlobals::self()->calendarSystem()->dayOfYear(date); + switch (mDateNum) { + case 1: // only days until end of year + return QString::number( KOGlobals::self()->calendarSystem()->daysInYear(date) - doy ); + break; + case 2: // both day of year and days till end of year + return i18n("dayOfYear / daysTillEndOfYear", "%1 / %2").arg( doy ) + .arg(KOGlobals::self()->calendarSystem()->daysInYear(date) - doy); + break; + case 0: // only day of year + default: + return QString::number( doy ); + } + return QString::number( doy ); +} + +QString Datenums::info() +{ + return i18n("This plugin provides numbers of days and weeks."); +} diff --git a/korganizer/plugins/datenums/datenums.desktop b/korganizer/plugins/datenums/datenums.desktop new file mode 100644 index 000000000..b5010edc9 --- /dev/null +++ b/korganizer/plugins/datenums/datenums.desktop @@ -0,0 +1,99 @@ +[Desktop Entry] +X-KDE-Library=libkorg_datenums +Name=Date Numbers Plugin for Calendars +Name[af]=Dag nommer inprop module vir kalenders +Name[ar]=قابس أرقام التاريخ للتقويم +Name[bg]=Приставка на календара за дати +Name[bs]=Dodatak za kalendar - brojevi datuma +Name[ca]=Endollable de números de data per als calendaris +Name[cs]=Modul pro očíslování dat v kalendáři +Name[da]=Datonumre-plugin for kalendere +Name[de]=Kalendertag-Modul für Kalender +Name[el]=Πρόσθετο αριθμού ημερών για Ημερολόγια +Name[eo]=Datnumera kromaĵo por Kalendaro +Name[es]=Accesorio de números de fecha para calendarios +Name[et]=Kuupäeva nummerdamise plugin kalendritele +Name[eu]=Egutegientzako data zenbakiak +Name[fa]=وصلۀ عدد تاریخ برای تقویمها +Name[fi]=Päivämääräliitännäinen kalentereihin +Name[fr]=Module de numérotation des jours +Name[fy]=Datumgetallenplugin foar aginda's +Name[gl]=Engadido para Números dos Días nos Calendarios +Name[he]=תוסף מספרי תאריכים ללוחות שנה +Name[hu]=Dátumkezelő bővítőmodul naptárakhoz +Name[is]=Íforrit fyrir númer dags á dagatali +Name[it]=Plugin delle date per i calendari +Name[ja]=日数表示カレンダープラグイン +Name[ka]=თარიღის რიცხვების მოდული კალენდრებისათვის +Name[kk]=Күнтізбедегі күн нөмірінің модулі +Name[km]=កម្មវិធីជំនួយលេខកាលបរិច្ឆេទសម្រាប់ប្រតិទិន +Name[lt]=Datų numerių priedas kalendoriams +Name[ms]=Plugin Bilangan Tarikh untuk Kalendar +Name[nb]=Datonummer programtillegg for Kalender +Name[nds]=Kalennerdag-Moduul för Kalenners +Name[ne]=क्यालेन्डरका लागि मिति सङ्ख्या प्लगइन +Name[nl]=Datumgetallenplugin voor agenda's +Name[nn]=Datonummer programtillegg for Kalender +Name[pl]=Wtyczka numerów dni dla Kalendarzy +Name[pt]='plugin' de Números de Datas para Calendários +Name[pt_BR]=Plugin-de Números e Datas para Calendários +Name[ru]=Даты календаря +Name[sk]=Modul dátumov pre kalendáre +Name[sl]=Datumski vstavek za koledarje +Name[sr]=Прикључак календара за бројеве датума +Name[sr@Latn]=Priključak kalendara za brojeve datuma +Name[sv]=Datuminsticksprogram för kalendrar +Name[ta]=நாள்காட்டிகளுக்கான தேதி எண்களின் சொருகுப்பொருள் +Name[tg]=Санаҳои тақвим +Name[tr]=Takvimler için Tarih Rakamları Eklentisi +Name[uk]=Втулок дат для календарів +Name[zh_CN]=日历的日期数字插件 +Name[zh_TW]=行事曆日期數字外掛程式 +Comment=For each day this plugin shows its daynumber of the year at the top of the agenda view. For example, February 1 is day 32 of the year. +Comment[af]=Die inprop module vertoon die dag nommer van die jaar bo aan die agenda aansig. Bv: 1 Februarie is dag 32 van die jaar. +Comment[bg]=Приставката служи за показване на деня от началото на годината. Примерно, 1-ви февруари е 32-ия ден от годината. +Comment[ca]=Per cada dia, aquest endollable mostra el número de dia de l'any al capdamunt de la vista d'agenda. Per exemple, 1 de Febrer és el dia 32 de l'any. +Comment[cs]=tento modul pro každý den zobrazuje pořadí dne v roce na vrcholu pohledu. Např. 1. únor je 32 druhý den v roce. +Comment[da]=For hver dag viser dette plugin nummeret for dagen i året for oven i agendavisningen. For eksempel er 1. februar 1 is den 32. dag i året. +Comment[de]=Für jeden Tag des Jahres wird mit diesem Modul der Kalendertag oben in der Tagesansicht angezeigt. Der 1. Februar ist beispielsweise der 32. Kalendertag des Jahres. +Comment[el]=Για κάθε μέρα, αυτό το πρόσθετο εμφανίζει τον αύξοντα αριθμό της ημέρας του έτους στην προβολή προγράμματος εργασίας. Για παράδειγμα, η 1ι Φεβρουαρίου είναι η ημέρα 32 του έτους. +Comment[es]=Para cada día, esta extensión mostrará el número del día en el año en la parte superior de la vista de la agenda. Por ejemplo, el 1 de febrero es el día número 32 del año. +Comment[et]=See plugin näitab iga päevakavavaate ülaosas iga päeva järjekorranumbrit aastas. Näiteks 1. veebruar on aasta 32. päev. +Comment[eu]=Egun bakoitzeko, plugin honek bere urteko egun-zenbakia erakutsiko du agenda ikuspegiaren goiko aldean. Adibidez, Otsailak 1 urtearen 32. eguna da. +Comment[fa]=در هر روز، این وصله عدد مربوط به روز سال را در بالای نمای agenda نمایش میدهد. مثلاً ۱ فوریه، سی و دومین روز سال میباشد. +Comment[fi]=Tämä liitännäinen näyttää jokaisen päivän järjestysnumeron vuoden alusta agendanäkymässä. Esimerkiksi helmikuun ensimmäinen päivä on vuoden 32. päivä. +Comment[fr]=Pour chaque jour, ce module montre le numéro du jour en haut de la vue agenda. Par exemple, le 1er février est le 32ème jour de l'année. +Comment[fy]=Dizze plugin soarget derfoar dat it nûmer fan de dei boppe de agindawerjefte setten wurdt. Bygelyks, by 1 february heard deinûmer 32. +Comment[gl]=Este engadido amosa cada día o número de día anual na vista superior da axenda. Por exemplo, o 1 de febreiro é o día 32 do ano. +Comment[hu]=Megjeleníti az év elejétől eltelt napok számát az áttekintő nézet tetején. Például február elseje az év 32. napja. +Comment[is]=Þetta íforrit sýnir efst í fundarskránni númer hvers dags í árinu. T.d. er 1. febrúar 32. dagurinn í árinu. +Comment[it]=Per ciascun giorno, questo plugin mostra la data giuliana (numero progressivo a partire dal primo gennaio dell'anno corrente). Per esempio al primo di febbraio corrisponde il numero 32. +Comment[ja]=このプラグインは予定表ビューの上に、それぞれの日がその年の何日目であるかを表示します。例えば、2 月 1 日はその年の 32 日目です。 +Comment[ka]= გეგმის ზედა ხედში ეს მოდული თვითეული დღისათვის აჩვენებს მის დღის ნომერს ამ წლისათვის . მაგალითად,1 თებერვალი წლის 32-ე დღეა. +Comment[kk]=Бұл модуль күн тәртібі бетінің жоғарында жыл басынан өткен күндер санын көрсетеді. Мысалы, 1-ақпан жылдың 32-күні. +Comment[km]=សម្រាប់ថ្ងៃនីមួយៗ កម្មវិធីជំនួយនេះនឹងបង្ហាញលេខថ្ងៃនៃឆ្នាំ នៅផ្នែកខាងលើនៃទិដ្ឋភាពរបៀបវារៈ ។ ឧទាហរណ៍ ថ្ងៃទី ១ ខែ កុម្ភៈ នឹងត្រូវជាថ្ងៃទី ៣២ នៃឆ្នាំ ។ +Comment[lt]=Kiekvienai dienai šis priedas rodo metų dienos numerį tvarkyklės viršuje. Pvz., Vasario 1 yra32 metų diena. +Comment[ms]=Setiap hari plugin ini memaparkan bilangan hari tahun tersebut di atas paparan agenda. Contohnya , 1 Februari adalah hari ke 32 bagi tahun tersebut. +Comment[nb]=For hver dag viser dette programtillegget dagens nummer i året øverst på dagsvisningen. 1. februar er f.eks. dag nr. 32 i året. +Comment[nds]=Dit Moduul wiest för elkeen Dag sien Nummer in't Johr baven de Dagansicht. De 1. Februor is t.B. de 32. Dag vun't Johr. +Comment[ne]=प्रत्येक दिनका लागि यो प्लगइनले एजेन्डा दृश्यको माथि यस वर्षको दिन नम्बर देखाउछ । उदारणका लागि, फेब्रुवरी १ वर्षको बत्तिसौ दिन हो । +Comment[nl]=Deze plugin zorgt ervoor dat het dagnummer boven de agendaweergave wordt geplaatst. Bijvoorbeeld, bij 1 februari hoort dagnummer 32. +Comment[nn]=For kvar dag vil dette programtillegget visa nummeret til denne dagen i året øvst i tidsplanen. 1. februar vil til dømes visast som dag 32. +Comment[pl]=Ta wtyczka dla każdego dnia pokazuje jego numer kolejny w roku, na szczycie widoku planu. Na przykład, 1 luty to 32 dzień roku. +Comment[pt]=Para cada dia, este 'plugin' mostra o seu número de dia do ano no topo da agenda. Por exemplo, o dia 1 de Fevereiro é o dia 32 do ano. +Comment[pt_BR]=Para cada dia, esse plug-in mostra o número do dia no topo da visão de agenda. Por exemplo, 1º de fevereiro é o dia 32 do ano. +Comment[ru]=Этот модуль показывает номер дня в году для каждой даты. Например, для 1 февраля будет показан номер 32. +Comment[sk]=Tento modul pre každý deň zobrazí jeho číslo dňa v roku navrchu pohľadu agendy. Napríklad 1. február je deň číslo 32 v roku. +Comment[sl]=Za vsak dan ta vstavek prikazuje številko dneva v letu na vrhu praikaza agende. Npr., 1. februar je 32. dan v letu. +Comment[sr]=За сваки датум овај прикључак приказује његов број дана у години на врху приказа распореда. На пример, 1. фебруар је 32. дан у години. +Comment[sr@Latn]=Za svaki datum ovaj priključak prikazuje njegov broj dana u godini na vrhu prikaza rasporeda. Na primer, 1. februar je 32. dan u godini. +Comment[sv]=Insticksprogrammet visar dagens nummer under året för varje dag längst upp i agendavyn. Till exempel är 1:a februari den 32:e dagen under året. +Comment[ta]=ஒவ்வோரு நாளும் நிகழ்ச்சி நிரல் காட்சியின் மேற்புறத்தில் வருடத்தின் நாளின் எண்ணை இந்த சொருகுப்பொருள் காட்டுகிறது. உதாரணமாக, பிப்ரவரி 1 வருடத்தின் 32வது நாள் +Comment[tr]=Bu eklenti, her gün için tarih bilgisini gün sayısı olarak ajanda görünümünün yukarısında gösterir. Örneğin, 1 Şubat yılın 32. günüdür. +Comment[uk]=Цей втулок показує зверху перегляду щоденника номер для кожного дня року. Наприклад, 1-го лютого - це 32 день року. +Comment[zh_CN]=此插件可对每天在议事日程视图中上方显示该日在一年中的序号。例如,2月1日是一年的第32天。 +Comment[zh_TW]=對每一天,此外掛程式會顯示這是一年中的第幾天。 +Type=Service +ServiceTypes=Calendar/Plugin,Calendar/Decoration +X-KDE-KOrganizer-HasSettings=true +X-KDE-PluginInterfaceVersion=2 diff --git a/korganizer/plugins/datenums/datenums.h b/korganizer/plugins/datenums/datenums.h new file mode 100644 index 000000000..af3e46473 --- /dev/null +++ b/korganizer/plugins/datenums/datenums.h @@ -0,0 +1,41 @@ +/* + This file is part of KOrganizer. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +#ifndef KORG_DATENUMS_H +#define KORG_DATENUMS_H + +#include <qstring.h> + +#include <calendar/calendardecoration.h> + +using namespace KOrg; + +class Datenums : public CalendarDecoration { + public: + Datenums(); + ~Datenums() {} + + void configure(QWidget *parent); + QString shortText(const QDate &); + + QString info(); + protected: + int mDateNum; +}; + +#endif |