diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-13 06:26:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-13 06:26:27 +0000 |
commit | 9fab5b8a216e283e563f3457315715672bc8b55a (patch) | |
tree | c1251952e4e0e28fad0bca829d49335ff15b6e98 /kopete/kopete | |
parent | bcb704366cb5e333a626c18c308c7e0448a8e69f (diff) | |
download | tdenetwork-9fab5b8a216e283e563f3457315715672bc8b55a.tar.gz tdenetwork-9fab5b8a216e283e563f3457315715672bc8b55a.zip |
Update to Trinity 3.5.11
Will need to watch for commit warnings and rebuild test
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1061808 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/kopete')
-rw-r--r-- | kopete/kopete/chatwindow/chatmessagepart.cpp | 55 | ||||
-rw-r--r-- | kopete/kopete/chatwindow/chatmessagepart.h | 1 | ||||
-rw-r--r-- | kopete/kopete/config/appearance/Makefile.am | 8 | ||||
-rw-r--r-- | kopete/kopete/config/appearance/appearanceconfig.cpp | 18 | ||||
-rw-r--r-- | kopete/kopete/config/appearance/appearanceconfig.h | 1 | ||||
-rw-r--r-- | kopete/kopete/config/appearance/appearanceconfig_emoticons.ui | 11 | ||||
-rw-r--r-- | kopete/kopete/main.cpp | 3 |
7 files changed, 92 insertions, 5 deletions
diff --git a/kopete/kopete/chatwindow/chatmessagepart.cpp b/kopete/kopete/chatwindow/chatmessagepart.cpp index 36523dac..3cf70b8a 100644 --- a/kopete/kopete/chatwindow/chatmessagepart.cpp +++ b/kopete/kopete/chatwindow/chatmessagepart.cpp @@ -43,6 +43,7 @@ #include <dom/html_base.h> #include <dom/html_document.h> #include <dom/html_inline.h> +#include <qurloperator.h> // KDE includes @@ -60,8 +61,10 @@ #include <ktempfile.h> #include <kurldrag.h> #include <kio/netaccess.h> +#include <kio/job.h> #include <kstandarddirs.h> #include <kiconloader.h> +#include <kinputdialog.h> // Kopete includes #include "chatmemberslistwidget.h" @@ -144,6 +147,7 @@ public: KAction *printAction; KAction *closeAction; KAction *copyURLAction; + KAction *importEmoticon; ChatWindowStyle *currentChatStyle; Kopete::Contact *latestContact; @@ -259,6 +263,7 @@ ChatMessagePart::ChatMessagePart( Kopete::ChatSession *mgr, QWidget *parent, con d->saveAction = KStdAction::saveAs( this, SLOT(save()), actionCollection() ); d->printAction = KStdAction::print( this, SLOT(print()),actionCollection() ); d->closeAction = KStdAction::close( this, SLOT(slotCloseView()),actionCollection() ); + d->importEmoticon = new KAction( i18n( "Import Emoticon"), QString::fromLatin1( "importemot" ), 0, this, SLOT( slotImportEmoticon() ), actionCollection() ); d->copyURLAction = new KAction( i18n( "Copy Link Address" ), QString::fromLatin1( "editcopy" ), 0, this, SLOT( slotCopyURL() ), actionCollection() ); // read formatting override flags @@ -281,6 +286,53 @@ void ChatMessagePart::slotScrollingTo( int /*x*/, int y ) d->scrollPressed = true; } +void ChatMessagePart::slotImportEmoticon() +{ + QString emoticonString = KInputDialog::getText( i18n("Import Emoticon"), + i18n("<qt><img src=\"%1\"><br>Insert the string for the emoticon<br>separated by space if you want multiple strings</qt>").arg( d->activeElement.getAttribute("src").string() ) ); + if (emoticonString.isNull() ) + return; + + QString emo = d->activeElement.getAttribute("src").string(); + QString themeName = KopetePrefs::prefs()->iconTheme(); + + KIO::copy(emo, KGlobal::dirs()->saveLocation( "emoticons", themeName, false )); + + QFile *fp = new QFile(KGlobal::dirs()->saveLocation( "emoticons", themeName, false ) + "/emoticons.xml"); + + QDomDocument themeXml; + + if(!fp->exists() || !fp->open( IO_ReadOnly ) || !themeXml.setContent(fp)) + return; + + fp->close(); + + QDomNode lc = themeXml.lastChild(); + if(lc.isNull()) + return; + + QDomElement emoticon = themeXml.createElement("emoticon"); + emoticon.setAttribute("file", QFileInfo(emo).baseName()); + lc.appendChild(emoticon); + QStringList splitted = QStringList::split(" ", emoticonString); + QStringList::const_iterator constIterator; + for(constIterator = splitted.begin(); constIterator != splitted.end(); constIterator++) + { + QDomElement emotext = themeXml.createElement("string"); + QDomText txt = themeXml.createTextNode((*constIterator).stripWhiteSpace()); + emotext.appendChild(txt); + emoticon.appendChild(emotext); + } + + if(!fp->open( IO_WriteOnly )) + return; + + QTextStream emoStream(fp); + emoStream << themeXml.toString(4); + fp->close(); + QTimer::singleShot( 1500, Kopete::Emoticons::self(), SLOT( reload() ) ); +} + void ChatMessagePart::save() { KFileDialog dlg( QString::null, QString::fromLatin1( "text/html text/plain" ), view(), "fileSaveDialog", false ); @@ -680,11 +732,12 @@ void ChatMessagePart::slotRightClick( const QString &, const QPoint &point ) d->copyURLAction->plug( chatWindowPopup ); chatWindowPopup->insertSeparator(); } - + kdDebug() << "ChatMessagePart::slotRightClick(): " << d->activeElement.tagName().lower() << endl; d->copyAction->setEnabled( hasSelection() ); d->copyAction->plug( chatWindowPopup ); d->saveAction->plug( chatWindowPopup ); d->printAction->plug( chatWindowPopup ); + if( d->activeElement.tagName().lower() == "img" ) d->importEmoticon->plug( chatWindowPopup ); chatWindowPopup->insertSeparator(); d->closeAction->plug( chatWindowPopup ); diff --git a/kopete/kopete/chatwindow/chatmessagepart.h b/kopete/kopete/chatwindow/chatmessagepart.h index ba92b95f..ad14d3e3 100644 --- a/kopete/kopete/chatwindow/chatmessagepart.h +++ b/kopete/kopete/chatwindow/chatmessagepart.h @@ -148,6 +148,7 @@ private slots: void slotCopyURL(); void slotCloseView( bool force = false ); + void slotImportEmoticon(); /** * Do the actual style change. diff --git a/kopete/kopete/config/appearance/Makefile.am b/kopete/kopete/config/appearance/Makefile.am index 7e7fc8ca..f349297c 100644 --- a/kopete/kopete/config/appearance/Makefile.am +++ b/kopete/kopete/config/appearance/Makefile.am @@ -4,9 +4,10 @@ AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private \ kde_module_LTLIBRARIES = kcm_kopete_appearanceconfig.la -kcm_kopete_appearanceconfig_la_SOURCES = appearanceconfig_emoticons.ui \ - appearanceconfig_colors.ui appearanceconfig_chatwindow.ui appearanceconfig_contactlist.ui \ - appearanceconfig.cpp tooltipeditwidget.ui tooltipeditdialog.cpp +kcm_kopete_appearanceconfig_la_SOURCES = appearanceconfig.cpp \ + appearanceconfig_chatwindow.ui appearanceconfig_colors.ui appearanceconfig_contactlist.ui \ + appearanceconfig_emoticons.ui emoticonseditdialog.cpp emoticonseditwidget.ui tooltipeditdialog.cpp \ + tooltipeditwidget.ui kcm_kopete_appearanceconfig_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) \ $(all_libraries) @@ -18,3 +19,4 @@ service_DATA = kopete_appearanceconfig.desktop servicedir = $(kde_servicesdir) # vim: set noet: +noinst_HEADERS = emoticonseditdialog.h diff --git a/kopete/kopete/config/appearance/appearanceconfig.cpp b/kopete/kopete/config/appearance/appearanceconfig.cpp index e3867d41..d83b0801 100644 --- a/kopete/kopete/config/appearance/appearanceconfig.cpp +++ b/kopete/kopete/config/appearance/appearanceconfig.cpp @@ -27,6 +27,7 @@ #include "appearanceconfig_contactlist.h" #include "tooltipeditdialog.h" +#include "emoticonseditdialog.h" #include <qcheckbox.h> #include <qdir.h> @@ -204,6 +205,8 @@ AppearanceConfig::AppearanceConfig(QWidget *parent, const char* /*name*/, const this, SLOT(slotGetEmoticonThemes())); connect(d->mPrfsEmoticons->btnRemoveTheme, SIGNAL(clicked()), this, SLOT(removeSelectedEmoticonTheme())); + connect(d->mPrfsEmoticons->btnEditThemes, SIGNAL(clicked()), + this, SLOT(editSelectedEmoticonTheme())); d->mAppearanceTabCtl->addTab(d->mPrfsEmoticons, i18n("&Emoticons")); @@ -866,5 +869,20 @@ void AppearanceConfig::slotEditTooltips() delete dlg; } +void AppearanceConfig::editSelectedEmoticonTheme() +{ + QListBoxItem *selected = d->mPrfsEmoticons->icon_theme_list->selectedItem(); + if(selected==0) + return; + + QString themeName = selected->text(); + + EmoticonsEditDialog *dlg = new EmoticonsEditDialog(this, themeName); + dlg->exec(); + delete dlg; + + updateEmoticonlist(); +} + #include "appearanceconfig.moc" // vim: set noet ts=4 sts=4 sw=4: diff --git a/kopete/kopete/config/appearance/appearanceconfig.h b/kopete/kopete/config/appearance/appearanceconfig.h index 22a23024..747117c6 100644 --- a/kopete/kopete/config/appearance/appearanceconfig.h +++ b/kopete/kopete/config/appearance/appearanceconfig.h @@ -57,6 +57,7 @@ private slots: void slotGetChatStyles(); void slotLoadChatStyles(); void updateEmoticonsButton(bool); + void editSelectedEmoticonTheme(); private: void updateEmoticonlist(); void createPreviewChatSession(); diff --git a/kopete/kopete/config/appearance/appearanceconfig_emoticons.ui b/kopete/kopete/config/appearance/appearanceconfig_emoticons.ui index 8649e4c2..01652e9f 100644 --- a/kopete/kopete/config/appearance/appearanceconfig_emoticons.ui +++ b/kopete/kopete/config/appearance/appearanceconfig_emoticons.ui @@ -111,6 +111,17 @@ </widget> <widget class="QPushButton"> <property name="name"> + <cstring>btnEditThemes</cstring> + </property> + <property name="text"> + <string>&Edit Theme...</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Edit the selected emoticons theme</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> <cstring>btnInstallTheme</cstring> </property> <property name="text"> diff --git a/kopete/kopete/main.cpp b/kopete/kopete/main.cpp index d428c1bc..187dc8de 100644 --- a/kopete/kopete/main.cpp +++ b/kopete/kopete/main.cpp @@ -51,9 +51,10 @@ int main( int argc, char *argv[] ) { KAboutData aboutData( "kopete", I18N_NOOP("Kopete"), KOPETE_VERSION_STRING, description, KAboutData::License_GPL, - I18N_NOOP("(c) 2001-2004, Duncan Mac-Vicar Prett\n(c) 2002-2005, Kopete Development Team"), "kopete-devel@kde.org", "http://kopete.kde.org"); + I18N_NOOP("(c) 2009-2010, Timothy Pearson\n(c) 2001-2004, Duncan Mac-Vicar Prett\n(c) 2002-2005, Kopete Development Team"), "kopete-devel@kde.org", "http://kopete.kde.org"); aboutData.addAuthor ( "Duncan Mac-Vicar Prett", I18N_NOOP("Developer and Project founder"), "duncan@kde.org", "http://www.mac-vicar.org/~duncan" ); + aboutData.addAuthor ( "Timothy Pearson", I18N_NOOP("Developer, maintainer"), "kb9vqf@pearsoncomputing.net" ); aboutData.addAuthor ( "Andre Duffeck", I18N_NOOP("Developer, Yahoo plugin maintainer"), "andre@duffeck.de" ); aboutData.addAuthor ( "Andy Goossens", I18N_NOOP("Developer"), "andygoossens@telenet.be" ); aboutData.addAuthor ( "Chetan Reddy", I18N_NOOP("Developer, Yahoo"), "chetan13@gmail.com" ); |