# libs
add_subdirectory(libs)
-# pictures
-add_subdirectory(pics)
add_subdirectory(systemsettings)
add_subdirectory( mediaplayer )
add_subdirectory( menus )
add_subdirectory( dnssd )
-add_subdirectory( emoticons )
add_subdirectory( spellchecking )
add_subdirectory( kdebug )
+++ /dev/null
-kde4_add_plugin(kcm_emoticons emoticonslist.cpp)
-
-target_link_libraries(kcm_emoticons
- ${KDE4_KDEUI_LIBS}
- ${KDE4_KPARTS_LIBS}
- ${KDE4_KEMOTICONS_LIBS}
-)
-
-########### install files ###############
-
-install(
- TARGETS kcm_emoticons
- DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
-)
-
-install(
- FILES emoticons.desktop
- DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
-)
+++ /dev/null
-#!/usr/bin/env bash
-$EXTRACTRC *.ui >> rc.cpp
-$XGETTEXT *.cpp -o $podir/kcm_emoticons.pot
-
+++ /dev/null
-[Desktop Entry]
-Exec=kcmshell4 emoticons
-Icon=face-smile
-Type=Service
-X-DocPath=kcontrol/emoticons/index.html
-
-X-KDE-ServiceTypes=KCModule
-X-KDE-Library=kcm_emoticons
-X-KDE-ParentApp=kcontrol
-X-KDE-System-Settings-Parent-Category=desktop-appearance
-X-KDE-Weight=210
-
-Name=Emoticons
-Name[af]=Emotikons
-Name[ar]=أوجه تعبيرية
-Name[as]=ভাব-প্ৰতীক
-Name[ast]=Fustaxes
-Name[be@latin]=Smajliki
-Name[bg]=Емотикони
-Name[bn]=ইমোট-আইকন
-Name[bn_IN]=ইমোআইকন
-Name[bs]=Emotikoni
-Name[ca]=Emoticones
-Name[ca@valencia]=Emoticones
-Name[cs]=Emotikony
-Name[csb]=Emòtikónczi
-Name[da]=Emotikoner
-Name[de]=Emoticons
-Name[el]=Εικονίδια διάθεσης
-Name[en_GB]=Emoticons
-Name[eo]=Miensimboloj
-Name[es]=Emoticonos
-Name[et]=Emotikonid
-Name[eu]=Aurpegierak
-Name[fa]=صورتک
-Name[fi]=Hymiöt
-Name[fr]=Émoticônes
-Name[fy]=Emobyldkaikes
-Name[ga]=Straoiseoga
-Name[gl]=Emoticonas
-Name[gu]=લાગણીઓ
-Name[he]=רגשונים
-Name[hi]=हँसमुख
-Name[hne]=चेहराचिनहा
-Name[hr]=Emoticons
-Name[hsb]=Emotikony
-Name[hu]=Emotikonok
-Name[ia]=Emoticones
-Name[id]=Emoticon
-Name[is]=Tjáningartákn
-Name[it]=Faccine
-Name[ja]=感情アイコン
-Name[kk]=Көңіл күйі белгілері
-Name[km]=សញ្ញាអារម្មណ៍
-Name[kn]=ಭಾವನಾಚಿಹ್ನೆಗಳು (ಎಮೋಟಿಕಾನ್)
-Name[ko]=이모티콘
-Name[ku]=Emotîkon
-Name[lt]=Jaustukai
-Name[lv]=Emocijzīmes
-Name[mai]=भाव-प्रतीक
-Name[mk]=Емотикони
-Name[ml]=വികാരചിഹ്നങ്ങള്
-Name[mr]=भावप्रतिमा
-Name[nb]=Humørfjes
-Name[nds]=Snuten
-Name[nl]=Emoticons
-Name[nn]=Fjesingar
-Name[or]=Emoticons
-Name[pa]=ਈਮੋਸ਼ਨ
-Name[pl]=Emotikony
-Name[pt]=Ícones Emotivos
-Name[pt_BR]=Emoticons
-Name[ro]=Emoticoni
-Name[ru]=Смайлики
-Name[se]=Mojánat
-Name[si]=ඉමොටිකොන
-Name[sk]=Emotikony
-Name[sl]=Izrazne ikone
-Name[sr]=Емотикони
-Name[sr@ijekavian]=Емотикони
-Name[sr@ijekavianlatin]=Emotikoni
-Name[sr@latin]=Emotikoni
-Name[sv]=Smilisar
-Name[ta]=உணர்வோயியங்கள்
-Name[te]=ఎమొటికాన్లు
-Name[tg]=Тасвирчаҳо
-Name[th]=ไอคอนสื่ออารมณ์
-Name[tr]=Duygu Simgeleri
-Name[ug]=چىراي ئىپادىلىرى
-Name[uk]=Емоційки
-Name[uz]=His-tuygʻular
-Name[uz@cyrillic]=Ҳис-туйғулар
-Name[vi]=Hình biểu cảm
-Name[wa]=Xhinêyes
-Name[x-test]=xxEmoticonsxx
-Name[zh_CN]=表情
-Name[zh_TW]=表情圖示
-Comment=Choose Emoticon Theme
-Comment[ar]=اختر سمة وجه تعبيري
-Comment[bg]=Избор на теми с емотикони
-Comment[bs]=Izbor emotikonskih tema
-Comment[ca]=Selecció de tema d'emoticones
-Comment[ca@valencia]=Selecció de tema d'emoticones
-Comment[cs]=Vyberte motiv emotikonů
-Comment[da]=Vælg emotikontema
-Comment[de]=Emoticon-Design auswählen
-Comment[el]=Επιλογή θέματος εικονιδίων διάθεσης
-Comment[en_GB]=Choose Emoticon Theme
-Comment[es]=Escoger tema de emoticonos
-Comment[et]=Emotikoniteema valimine
-Comment[eu]=Hautatu aurpegiera-gaia
-Comment[fa]=انتخاب چهرههای صورتکها
-Comment[fi]=Valitse hymiöteema
-Comment[fr]=Choisir le thème d'émoticônes
-Comment[gl]=Escolle o tema de emoticonas
-Comment[hu]=Hangulatjel-téma kiválasztása
-Comment[ia]=Selige Thema de Emoticon
-Comment[id]=Pilih Tema Emoticon
-Comment[is]=Veldu tjáningartáknaþema
-Comment[it]=Scegli tema delle faccine
-Comment[ja]=感情アイコンテーマの選択
-Comment[kk]=Көңіл күй белгілер нақышының таңдау
-Comment[ko]=이모티콘 테마 선택
-Comment[lt]=Pasirinkite jaustukų temą
-Comment[nb]=Velg humørfjes-temaer
-Comment[nds]=Snutensett utsöken
-Comment[nl]=Thema voor emoticon kiezen
-Comment[nn]=Vel fjesingtema
-Comment[pa]=ਈਮੋਸ਼ਨ ਥੀਮ ਚੁਣੋ
-Comment[pl]=Wybierz zestaw emotikon
-Comment[pt]=Escolher o Tema de Ícones Emotivos
-Comment[pt_BR]=Escolhe o tema de emoticons
-Comment[ro]=Alegeți tema de emoticoni
-Comment[ru]=Выбор темы смайликов
-Comment[sk]=Vybrať tému emotikonov
-Comment[sl]=Izberite temo izraznih ikon
-Comment[sr]=Избор емотиконских тема
-Comment[sr@ijekavian]=Избор емотиконских тема
-Comment[sr@ijekavianlatin]=Izbor emotikonskih tema
-Comment[sr@latin]=Izbor emotikonskih tema
-Comment[sv]=Välj smilistema
-Comment[tr]=Duygu Simgesi Temasını Seçin
-Comment[ug]=چىراي ئۆرنەكلىرى تاللاش
-Comment[uk]=Вибір теми емоційок
-Comment[wa]=Tchoezixhoz li tinme des xhinêyes
-Comment[x-test]=xxChoose Emoticon Themexx
-Comment[zh_CN]=选择表情主题
-Comment[zh_TW]=選擇表情圖示主題
-X-KDE-Keywords=Emoticons
-X-KDE-Keywords[ar]=أوجه تعبيرية
-X-KDE-Keywords[ast]=Fustaxes
-X-KDE-Keywords[bg]=Emoticons,Емотикони
-X-KDE-Keywords[bn]=ইমোট-আইকন
-X-KDE-Keywords[bs]=Emotikoni
-X-KDE-Keywords[ca]=Emoticones
-X-KDE-Keywords[ca@valencia]=Emoticones
-X-KDE-Keywords[cs]=Emotikony
-X-KDE-Keywords[da]=Emotikoner
-X-KDE-Keywords[de]=Emoticons
-X-KDE-Keywords[el]=Εικονίδια διάθεσης
-X-KDE-Keywords[en_GB]=Emoticons
-X-KDE-Keywords[eo]=Miensimboloj
-X-KDE-Keywords[es]=Emoticonos
-X-KDE-Keywords[et]=Emotikonid
-X-KDE-Keywords[eu]=Aurpegierak
-X-KDE-Keywords[fa]=صورتک
-X-KDE-Keywords[fi]=Hymiöt
-X-KDE-Keywords[fr]=Émoticônes
-X-KDE-Keywords[ga]=Straoiseoga
-X-KDE-Keywords[gl]=Emoticonas
-X-KDE-Keywords[gu]=લાગણીઓ
-X-KDE-Keywords[he]=רגשונים
-X-KDE-Keywords[hi]=हँसमुख
-X-KDE-Keywords[hu]=Emotikonok
-X-KDE-Keywords[ia]=Emoticones
-X-KDE-Keywords[id]=Emotikon
-X-KDE-Keywords[is]=Tjáningartákn
-X-KDE-Keywords[it]=Faccine
-X-KDE-Keywords[ja]=感情アイコン
-X-KDE-Keywords[kk]=Emoticons,Көңіл күйі белгілері
-X-KDE-Keywords[km]=សញ្ញាអារម្មណ៍
-X-KDE-Keywords[ko]=이모티콘
-X-KDE-Keywords[lt]=Jaustukai
-X-KDE-Keywords[lv]=Emocijzīmes
-X-KDE-Keywords[mr]=भावप्रतिमा
-X-KDE-Keywords[nb]=Humørfjes
-X-KDE-Keywords[nds]=Snuten
-X-KDE-Keywords[nl]=Emoticons
-X-KDE-Keywords[nn]=Fjesingar
-X-KDE-Keywords[pa]=ਈਮੋਸ਼ਨ
-X-KDE-Keywords[pl]=Emotikony
-X-KDE-Keywords[pt]=Ícones Emotivos
-X-KDE-Keywords[pt_BR]=Emoticons
-X-KDE-Keywords[ro]=Emoticoni
-X-KDE-Keywords[ru]=Emoticons,смайлики,смайлы,улыбочки
-X-KDE-Keywords[sk]=Emotikony
-X-KDE-Keywords[sl]=Izrazne ikone
-X-KDE-Keywords[sr]=emoticons,емотикон
-X-KDE-Keywords[sr@ijekavian]=emoticons,емотикон
-X-KDE-Keywords[sr@ijekavianlatin]=emoticons,emotikon
-X-KDE-Keywords[sr@latin]=emoticons,emotikon
-X-KDE-Keywords[sv]=Smilisar
-X-KDE-Keywords[tg]=Тасвирчаҳо
-X-KDE-Keywords[tr]=Duygu Simgeleri
-X-KDE-Keywords[ug]=چىراي ئىپادىلىرى
-X-KDE-Keywords[uk]=емоційка,емоційки,смайлик,смайлики
-X-KDE-Keywords[vi]=Hình biểu cảm
-X-KDE-Keywords[wa]=Xhinêyes
-X-KDE-Keywords[x-test]=xxEmoticonsxx
-X-KDE-Keywords[zh_CN]=Emoticons,表情
-X-KDE-Keywords[zh_TW]=Emoticons
+++ /dev/null
-/***************************************************************************
- * Copyright (C) 2007 by Carlo Segato <brandon.ml@gmail.com> *
- * Copyright (C) 2008 Montel Laurent <montel@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 "emoticonslist.h"
-#include <QString>
-#include <QDir>
-#include <QIcon>
-#include <QLabel>
-#include <QListWidget>
-#include <KMessageBox>
-#include <KDebug>
-#include <KIcon>
-#include <KAboutData>
-#include <KStandardDirs>
-#include <KFileDialog>
-#include <KInputDialog>
-#include <KUrlRequesterDialog>
-#include <kio/netaccess.h>
-#include <kpluginfactory.h>
-
-EditDialog::EditDialog(QWidget *parent, const QString &name)
- : KDialog(parent)
-{
- setCaption(name);
- setupDlg();
-}
-
-EditDialog::EditDialog(QWidget *parent, const QString &name, QListWidgetItem *itm, const QString &file)
- : KDialog(parent)
-{
- setCaption(name);
- emoticon = file;
- setupDlg();
- leText->setText(itm->text());
- btnIcon->setIcon(itm->icon());
-}
-
-void EditDialog::setupDlg()
-{
- wdg = new QWidget(this);
- QVBoxLayout *vl = new QVBoxLayout;
- QHBoxLayout *hb = new QHBoxLayout;
- leText = new KLineEdit(this);
- btnIcon = new QPushButton(this);
- btnIcon->setFixedSize(QSize(64, 64));
- btnIcon->setIconSize(QSize(64, 64));
-
- QLabel *lab = new QLabel(i18n("Insert the string for the emoticon. If you want multiple strings, separate them by spaces."), wdg);
- lab->setWordWrap(true);
- vl->addWidget(lab);
- hb->addWidget(btnIcon);
- hb->addWidget(leText);
- vl->addLayout(hb);
- wdg->setLayout(vl);
- setMainWidget(wdg);
- connect(btnIcon, SIGNAL(clicked()), this, SLOT(btnIconClicked()));
- connect(leText, SIGNAL(textChanged(const QString &)), this, SLOT(updateOkButton()));
- updateOkButton();
- leText->setFocus();
-}
-
-void EditDialog::btnIconClicked()
-{
- KUrl url = KFileDialog::getImageOpenUrl();
-
- if (!url.isLocalFile())
- return;
-
- emoticon = url.toLocalFile();
-
- if (emoticon.isEmpty())
- return;
-
- btnIcon->setIcon(QPixmap(emoticon));
- updateOkButton();
-}
-
-void EditDialog::updateOkButton()
-{
- enableButtonOk(!leText->text().isEmpty() && !emoticon.isEmpty());
-}
-
-K_PLUGIN_FACTORY(EmoticonsFactory, registerPlugin<EmoticonList>();)
-K_EXPORT_PLUGIN(EmoticonsFactory("emoticons", "kcm_emoticons"))
-
-EmoticonList::EmoticonList(QWidget *parent, const QVariantList &args)
- : KCModule(EmoticonsFactory::componentData(), parent, args)
-{
- KAboutData *about = new KAboutData("kcm_emoticons", 0, ki18n("Emoticons"), "1.0");
- setAboutData(about);
-// setButtons(Apply | Help);
- setupUi(this);
- btAdd->setIcon(KIcon("list-add"));
- btEdit->setIcon(KIcon("edit-rename"));
- btRemoveEmoticon->setIcon(KIcon("edit-delete"));
- btNew->setIcon(KIcon("document-new"));
- btInstall->setIcon(KIcon("document-import"));
- btRemoveTheme->setIcon(KIcon("edit-delete"));
-
- connect(themeList, SIGNAL(itemSelectionChanged()), this, SLOT(selectTheme()));
- connect(themeList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButton()));
- connect(btRemoveTheme, SIGNAL(clicked()), this, SLOT(btRemoveThemeClicked()));
- connect(btInstall, SIGNAL(clicked()), this, SLOT(installEmoticonTheme()));
- connect(btNew, SIGNAL(clicked()), this, SLOT(newTheme()));
- connect(cbStrict, SIGNAL(clicked()), this, SLOT(somethingChanged()));
-
- connect(btAdd, SIGNAL(clicked()), this, SLOT(addEmoticon()));
- connect(btEdit, SIGNAL(clicked()), this, SLOT(editEmoticon()));
- connect(btRemoveEmoticon, SIGNAL(clicked()), this, SLOT(btRemoveEmoticonClicked()));
- connect(emoList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButton()));
- connect(emoList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(editEmoticon()));
-}
-
-EmoticonList::~EmoticonList()
-{
-}
-
-bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
-{
- return (QString::localeAwareCompare(s1, s2) < 0);
-}
-
-void EmoticonList::load()
-{
- KStandardDirs dir;
-
- delFiles.clear();
- themeList->clear();
- emoMap.clear();
- emoList->clear();
-
- QStringList themeList = kEmoticons.themeList();
- qSort(themeList.begin(), themeList.end(), caseInsensitiveLessThan);
-
- for (int i = 0; i < themeList.count(); i++) {
- loadTheme(themeList.at(i));
- }
-
- if (kEmoticons.parseMode() & KEmoticonsTheme::StrictParse) {
- cbStrict->setChecked(true);
- } else {
- cbStrict->setChecked(false);
- }
-
- updateButton();
- emit changed(false);
-}
-
-void EmoticonList::save()
-{
- for (int i = 0; i < delFiles.size(); i++) {
- KIO::NetAccess::del(delFiles.at(i), this);
- }
-
- foreach (KEmoticonsTheme t, emoMap) {
- t.save();
- }
-
- if (themeList->currentItem()) {
- kEmoticons.setTheme(themeList->currentItem()->text());
- }
-
- if (cbStrict->isChecked()) {
- kEmoticons.setParseMode((kEmoticons.parseMode() |= KEmoticonsTheme::StrictParse) &= ~KEmoticonsTheme::RelaxedParse);
- } else {
- kEmoticons.setParseMode((kEmoticons.parseMode() |= KEmoticonsTheme::RelaxedParse) &= ~KEmoticonsTheme::StrictParse);
- }
-}
-
-void EmoticonList::somethingChanged()
-{
- emit changed(true);
-}
-
-void EmoticonList::updateButton()
-{
- bool can = canEditTheme();
- btRemoveEmoticon->setEnabled(themeList->currentItem() && emoList->selectedItems().size() && can);
- btRemoveTheme->setEnabled(themeList->currentItem() && themeList->currentItem()->text() != "kde4" && themeList->count() > 1 && can);
- btEdit->setEnabled(themeList->currentItem() && emoList->selectedItems().size() && can);
- btAdd->setEnabled(themeList->currentItem() && can);
-}
-
-void EmoticonList::selectTheme()
-{
-
- kDebug() << "current_item: " << themeList->currentItem();
-
- updateButton();
- if (!themeList->currentItem()) {
- emoList->clear();
- return;
- }
-
- if (!themeList->currentItem()) {
- themeList->currentItem()->setSelected(true);
- return;
- }
- emoList->clear();
-
- KEmoticonsTheme em = emoMap.value(themeList->currentItem()->text());
- QHash<QString, QStringList>::const_iterator it = em.emoticonsMap().constBegin();
-
- for (; it != em.emoticonsMap().constEnd(); ++it) {
- QString text;
- if (it.value().size()) {
- text = it.value().at(0);
- for (int i = 1; i < it.value().size(); i++) {
- text += ' ' + it.value().at(i);
- }
- }
-
- new QListWidgetItem(QIcon(it.key()), text, emoList);
- }
- emit changed();
-}
-
-void EmoticonList::btRemoveThemeClicked()
-{
- if (!themeList->currentItem()) {
- return;
- }
-
- QString name = themeList->currentItem()->text();
-
- delFiles.append(KGlobal::dirs()->findResource("emoticons", name + QDir::separator()));
- delete themeList->currentItem();
- emoMap.remove(name);
- emit changed();
-}
-
-void EmoticonList::installEmoticonTheme()
-{
- KUrl themeURL = KUrlRequesterDialog::getUrl(QString(), this, i18n("Drag or Type Emoticon Theme URL"));
- if (themeURL.isEmpty())
- return;
-
- if (!themeURL.isLocalFile()) {
- KMessageBox::queuedMessageBox(this, KMessageBox::Error, i18n("Emoticon themes must be installed from local files."),
- i18n("Could Not Install Emoticon Theme"));
- return;
- }
- QStringList installed = kEmoticons.installTheme(themeURL.toLocalFile());
- for (int i = 0; i < installed.size(); i++)
- loadTheme(installed.at(i));
-}
-
-void EmoticonList::btRemoveEmoticonClicked()
-{
- if (!emoList->currentItem()) {
- return;
- }
-
- QListWidgetItem *itm = emoList->currentItem();
- KEmoticonsTheme theme = emoMap.value(themeList->currentItem()->text());
- QString fPath = theme.emoticonsMap().key(itm->text().split(' '));
- if (theme.removeEmoticon(itm->text())) {
- int ret = KMessageBox::questionYesNo(this, i18n("Do you want to remove %1 too?", fPath), i18n("Delete emoticon"));
- if (ret == KMessageBox::Yes) {
- delFiles.append(fPath);
- }
-
- delete itm;
- themeList->currentItem()->setIcon(QIcon(previewEmoticon(theme)));
- emit changed();
- }
-}
-
-void EmoticonList::addEmoticon()
-{
- if (!themeList->currentItem())
- return;
-
- EditDialog *dlg = new EditDialog(this, i18n("Add Emoticon"));
-
- if (dlg->exec() == QDialog::Rejected) {
- delete dlg;
- return;
- }
-
- KEmoticonsTheme theme = emoMap.value(themeList->currentItem()->text());
- if (theme.addEmoticon(dlg->getEmoticon(), dlg->getText(), KEmoticonsProvider::Copy)) {
- new QListWidgetItem(QPixmap(dlg->getEmoticon()), dlg->getText(), emoList);
- themeList->currentItem()->setIcon(QIcon(previewEmoticon(theme)));
- emit changed();
- }
- delete dlg;
-}
-
-void EmoticonList::editEmoticon()
-{
- if (!themeList->currentItem() || !emoList->currentItem())
- return;
-
- KEmoticonsTheme theme = emoMap.value(themeList->currentItem()->text());
- QString path = theme.emoticonsMap().key(emoList->currentItem()->text().split(' '));
- QString f = QFileInfo(path).fileName();
- EditDialog *dlg = new EditDialog(this, i18n("Edit Emoticon"), emoList->currentItem(), path);
-
- if (dlg->exec() == QDialog::Rejected) {
- delete dlg;
- return;
- }
- bool copy;
- QString emo = dlg->getEmoticon();
- if (path != dlg->getEmoticon()) {
- copy = true;
- } else {
- copy = false;
-
- KStandardDirs *dir = KGlobal::dirs();
- emo = dir->findResource("emoticons", themeList->currentItem()->text() + QDir::separator() + f);
-
- if (emo.isNull())
- emo = dir->findResource("emoticons", themeList->currentItem()->text() + QDir::separator() + f + ".mng");
- if (emo.isNull())
- emo = dir->findResource("emoticons", themeList->currentItem()->text() + QDir::separator() + f + ".png");
- if (emo.isNull())
- emo = dir->findResource("emoticons", themeList->currentItem()->text() + QDir::separator() + f + ".gif");
- if (emo.isNull())
- emo = dir->findResource("emoticons", themeList->currentItem()->text() + QDir::separator() + f + ".jpg");
- if (emo.isNull())
- emo = dir->findResource("emoticons", themeList->currentItem()->text() + QDir::separator() + f + ".jpeg");
- if (emo.isNull()) {
- delete dlg;
- return;
- }
- }
-
- if (theme.removeEmoticon(emoList->currentItem()->text())) {
- delete emoList->currentItem();
- }
-
- if (theme.addEmoticon(emo, dlg->getText(), copy ? KEmoticonsProvider::Copy : KEmoticonsProvider::DoNotCopy)) {
- new QListWidgetItem(QPixmap(emo), dlg->getText(), emoList);
- }
-
- emit changed();
- delete dlg;
-}
-
-void EmoticonList::newTheme()
-{
- QString name = KInputDialog::getText(i18n("New Emoticon Theme"), i18n("Enter the name of the new emoticon theme:"));
- if (name.isEmpty())
- return;
- QString path = KGlobal::dirs()->saveLocation("emoticons", name, false);
-
- if (KIO::NetAccess::exists(path, KIO::NetAccess::SourceSide, this)) {
- KMessageBox::error(this, i18n("%1 theme already exists", name));
- } else {
- QString constraint("(exist Library)");
- KService::List srv = KServiceTypeTrader::self()->query("KEmoticons", constraint);
-
- QStringList ls;
- int current = 0;
-
- for (int i = 0; i < srv.size(); ++i) {
- ls << srv.at(i)->name();
-
- if (srv.at(i)->property("X-KDE-Priority").toInt() > srv.at(current)->property("X-KDE-Priority").toInt()) {
- current = i;
- }
- }
-
- bool ok;
- QString type = KInputDialog::getItem(i18n("New Emoticon Theme"), i18n("Choose the type of emoticon theme to create"), ls, current, false, &ok, this);
-
- if (ok && !type.isEmpty()) {
- int index = ls.indexOf(type);
- kEmoticons.newTheme(name, srv.at(index));
-
- loadTheme(name);
- }
- }
-}
-
-void EmoticonList::loadTheme(const QString &name)
-{
- if (name.isEmpty())
- return;
-
- if (emoMap.contains(name)) {
- emoMap.remove(name);
- QList<QListWidgetItem *>ls = themeList->findItems(name, Qt::MatchExactly);
- if (ls.size()) {
- delete ls.at(0);
- }
- }
-
- KEmoticonsTheme emo = kEmoticons.theme(name);
- if (!emo.isNull()) {
- emoMap[name] = emo;
- QIcon previewIcon = QIcon(previewEmoticon(emo));
- QListWidgetItem *itm = new QListWidgetItem(previewIcon, name, themeList);
-
- if (name == kEmoticons.currentThemeName()) {
- themeList->setCurrentItem(itm);
- }
- }
-}
-
-QString EmoticonList::previewEmoticon(const KEmoticonsTheme &theme)
-{
- QString path = theme.tokenize(":)")[0].picPath;
- if (path.isEmpty()) {
- path = theme.emoticonsMap().keys().value(0);
- }
- return path;
-}
-
-
-
-
-void EmoticonList::initDefaults()
-{
- QList<QListWidgetItem *>ls = themeList->findItems("kde4", Qt::MatchExactly);
- themeList->setCurrentItem( ls.first() );
-
- cbStrict->setChecked(false);
-}
-
-
-void EmoticonList::defaults()
-{
- initDefaults();
- selectTheme();
- emit changed(true);
-}
-
-bool EmoticonList::canEditTheme()
-{
- if (!themeList->currentItem()) {
- return false;
- }
-
- KEmoticonsTheme theme = emoMap.value(themeList->currentItem()->text());
- QFileInfo inf(theme.themePath() + '/' + theme.fileName());
-
- return inf.isWritable();
-}
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
+++ /dev/null
-/***************************************************************************
- * Copyright (C) 2007 by Carlo Segato <brandon.ml@gmail.com> *
- * Copyright (C) 2008 Montel Laurent <montel@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 EMOTICONSLIST_H
-#define EMOTICONSLIST_H
-
-#include <QStringList>
-#include <KLineEdit>
-#include <KDialog>
-#include <kcmodule.h>
-#include <kemoticons.h>
-#include "ui_emoticonslist.h"
-
-class EditDialog : public KDialog
-{
- Q_OBJECT
-
-public:
- EditDialog(QWidget *parent, const QString &name);
- EditDialog(QWidget *parent, const QString &name, QListWidgetItem *itm, const QString &file);
- QString getText() const { return leText->text(); };
- QString getEmoticon() const { return emoticon; };
-private slots:
- void btnIconClicked();
- void updateOkButton();
-private:
- void setupDlg();
- QWidget *wdg;
- KLineEdit *leText;
- QPushButton *btnIcon;
- QString emoticon;
-};
-
-class EmoticonList : public KCModule, Ui::EmoticonsManager
-{
- Q_OBJECT
-
-public:
- EmoticonList(QWidget *parent, const QVariantList &args);
- ~EmoticonList();
- void load();
- void save();
- virtual void defaults();
-private slots:
- void installEmoticonTheme();
- void btRemoveThemeClicked();
- void btRemoveEmoticonClicked();
- void selectTheme();
- void addEmoticon();
- void editEmoticon();
- void newTheme();
- void updateButton();
- void somethingChanged();
-private:
- void loadTheme(const QString &name);
- void initDefaults();
- bool canEditTheme();
- QString previewEmoticon(const KEmoticonsTheme &theme);
- QHash<QString, KEmoticonsTheme> emoMap;
- QStringList delFiles;
- KEmoticons kEmoticons;
-};
-
-#endif /* EMOTICONSLIST_H */
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>EmoticonsManager</class>
- <widget class="QWidget" name="EmoticonsManager">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>630</width>
- <height>419</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Emoticons Manager</string>
- </property>
- <layout class="QGridLayout">
- <item row="0" column="0">
- <widget class="QListWidget" name="themeList">
- <property name="iconSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="1" rowspan="2">
- <widget class="QListWidget" name="emoList">
- <property name="iconSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="2" rowspan="2">
- <layout class="QVBoxLayout">
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="KPushButton" name="btAdd">
- <property name="toolTip">
- <string>Create a new emoticon</string>
- </property>
- <property name="whatsThis">
- <string>Create a new emoticon by assigning it an icon and some text</string>
- </property>
- <property name="text">
- <string>Add...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KPushButton" name="btEdit">
- <property name="toolTip">
- <string>Modify the selected emoticon icon or text </string>
- </property>
- <property name="whatsThis">
- <string>Edit the selected emoticon to change its icon or its text</string>
- </property>
- <property name="text">
- <string>Edit...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KPushButton" name="btRemoveEmoticon">
- <property name="toolTip">
- <string>Remove the selected emoticon</string>
- </property>
- <property name="whatsThis">
- <string>Remove the selected emoticon from your disk</string>
- </property>
- <property name="text">
- <string>Remove</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <layout class="QVBoxLayout">
- <item>
- <widget class="QCheckBox" name="cbStrict">
- <property name="text">
- <string>Require spaces around emoticons</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KPushButton" name="btNew">
- <property name="toolTip">
- <string>Design a new emoticon theme</string>
- </property>
- <property name="whatsThis">
- <string>Start a new theme by assigning it a name. Then use the Add button on the right to add emoticons to this theme.</string>
- </property>
- <property name="text">
- <string>New Theme...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KPushButton" name="btInstall">
- <property name="toolTip">
- <string>Install a theme archive file you already have locally</string>
- </property>
- <property name="whatsThis">
- <string>If you already have an emoticon theme archive locally, this button will unpack it and make it available for KDE applications</string>
- </property>
- <property name="text">
- <string>Install Theme File...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KPushButton" name="btRemoveTheme">
- <property name="toolTip">
- <string>Remove the selected theme from your disk</string>
- </property>
- <property name="whatsThis">
- <string>This will remove the selected theme from your disk.</string>
- </property>
- <property name="text">
- <string>Remove Theme</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>KPushButton</class>
- <extends>QPushButton</extends>
- <header>kpushbutton.h</header>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-add_subdirectory( emoticons )
-
-set(ksvgtopng_SRCS ksvgtopng.cpp )
-add_executable(ksvgtopng ${ksvgtopng_SRCS})
-target_link_libraries(ksvgtopng ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
-install(TARGETS ksvgtopng ${INSTALL_TARGETS_DEFAULT_ARGS} )
+++ /dev/null
-
-########### install files ###############
-
-install( FILES angry.png bat.png beer.png biggrin.png cake.png camera.png cat.png clock.png cocktail.png confused.png cry.png cup.png dog.png email.png embarassed.png emoticons.xml film.png kiss.png lightbulb.png love.png note.png oh.png omg.png phone.png present.png rose.png sad.png shade.png sleep.png smile.png star.png teeth.png thumbs_down.png thumbs_up.png tongue.png unhappy.png unlove.png wilted_rose.png wink.png foot_in_mouth.png innocent.png undecided.png DESTINATION ${KDE4_SHARE_INSTALL_PREFIX}/emoticons/kde4)
-
-
-
-
+++ /dev/null
-<?xml version="1.0"?>
-<messaging-emoticon-map >
-
-<emoticon file="angry">
- <string>:-@</string>
- <string>:@</string>
- <string>>:-(</string>
- <string>>:(</string>
-</emoticon>
-
-<emoticon file="bat">
- <string>:-[</string>
- <string>:[</string>
-</emoticon>
-
-<emoticon file="beer">
- <string>(B)</string>
- <string>(b)</string>
-</emoticon>
-
-<emoticon file="cake">
- <string>(^)</string>
-</emoticon>
-
-<emoticon file="camera">
- <string>(P)</string>
- <string>(p)</string>
-</emoticon>
-
-<emoticon file="cat">
- <string>(@)</string>
-</emoticon>
-
-<emoticon file="clock">
- <string>(O)</string>
- <string>(o)</string>
-</emoticon>
-
-<emoticon file="cocktail">
- <string>(D)</string>
- <string>(d)</string>
-</emoticon>
-
-<emoticon file="confused">
- <string>:-S</string>
- <string>:S</string>
- <string>:-s</string>
- <string>:s</string>
-</emoticon>
-
-<emoticon file="cry">
- <string>:'(</string>
- <string>:'-(</string>
- <string>;-(</string>
- <string>;(</string>
-</emoticon>
-
-<emoticon file="cup">
- <string>(C)</string>
- <string>(c)</string>
-</emoticon>
-
-<emoticon file="dog">
- <string>(&)</string>
-</emoticon>
-
-<emoticon file="embarassed">
- <string>:-$</string>
- <string>:$</string>
-</emoticon>
-
-<emoticon file="email">
- <string>(E)</string>
- <string>(e)</string>
-</emoticon>
-
-<emoticon file="film">
- <string>(~)</string>
-</emoticon>
-
-<emoticon file="kiss">
- <string>(K)</string>
- <string>(k)</string>
- <string>:-X</string>
- <string>:X</string>
- <string>:-x</string>
- <string>:x</string>
-</emoticon>
-
-<emoticon file="lightbulb">
- <string>(I)</string>
- <string>(i)</string>
-</emoticon>
-
-<emoticon file="love">
- <string>(L)</string>
- <string>(l)</string>
-</emoticon>
-
-<emoticon file="note">
- <string>(8)</string>
-</emoticon>
-
-<emoticon file="omg">
- <string>:-O</string>
- <string>:O</string>
- <string>:-o</string>
- <string>:o</string>
-</emoticon>
-
-<emoticon file="phone">
- <string>(T)</string>
- <string>(t)</string>
-</emoticon>
-
-<emoticon file="present">
- <string>(G)</string>
- <string>(g)</string>
-</emoticon>
-
-<emoticon file="rose">
- <string>(F)</string>
- <string>(f)</string>
-</emoticon>
-
-<emoticon file="sad">
- <string>:-(</string>
- <string>:(</string>
-</emoticon>
-
-<emoticon file="shade">
- <string>(H)</string>
- <string>(h)</string>
- <string>8-)</string>
- <string>8)</string>
-</emoticon>
-
-<emoticon file="smile">
- <string>:-)</string>
- <string>:)</string>
- <string>:o)</string>
-</emoticon>
-
-<emoticon file="star">
- <string>(*)</string>
-</emoticon>
-
-<emoticon file="teeth">
- <string>:-D</string>
- <string>:D</string>
-</emoticon>
-
-<emoticon file="thumbs_down">
- <string>(N)</string>
- <string>(n)</string>
-</emoticon>
-
-<emoticon file="thumbs_up">
- <string>(Y)</string>
- <string>(y)</string>
-</emoticon>
-
-<emoticon file="tongue">
- <string>:-P</string>
- <string>:P</string>
- <string>:-p</string>
- <string>:p</string>
-</emoticon>
-
-<emoticon file="unlove">
- <string>(U)</string>
- <string>(u)</string>
-</emoticon>
-
-<emoticon file="wilted_rose">
- <string>(W)</string>
- <string>(w)</string>
-</emoticon>
-
-<emoticon file="wink">
- <string>;-)</string>
- <string>;)</string>
-</emoticon>
-
-</messaging-emoticon-map>
+++ /dev/null
-/* This file is part of the KDE Project
- Copyright (C) 2022 Ivailo Monev <xakepa10@gmail.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License version 2, as published by the Free Software Foundation.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include <QApplication>
-#include <QImageReader>
-#include <QImage>
-#include <QDebug>
-
-#include <stdlib.h>
-
-int main(int argc, char **argv)
-{
- // Initialize Qt application, otherwise for some svg files it can segfault with:
- // ASSERT failure in QFontDatabase: "A QApplication object needs to be
- // constructed before FontConfig is used."
- QApplication app(argc, argv);
-
- if (argc < 5) {
- qDebug() << "Usage : ksvgtopng width height svgfilename outputfilename";
- qDebug() << "Please use full path name for svgfilename";
- return 1;
- }
-
- const int width = atoi(argv[1]);
- const int height = atoi(argv[2]);
- if (width <= 0) {
- qWarning() << "Width cannot be negative or zero";
- return 2;
- } else if (height <= 0) {
- qWarning() << "Height cannot be negative or zero";
- return 2;
- }
-
- QImageReader imagereader(argv[3], "SVG");
- imagereader.setScaledSize(QSize(width, height));
- QImage image = imagereader.read();
- if (image.isNull()) {
- qWarning() << "Cannot not read" << argv[3] << ":" << imagereader.errorString();
- return 3;
- }
-
- if (image.save(argv[4], "PNG") == false) {
- qWarning() << "Could not save" << argv[4];
- return 4;
- }
-
- return 0;
-}